-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathintegrations-api-client.ts
45 lines (41 loc) · 1.04 KB
/
integrations-api-client.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { Result } from "./result-types";
export type ThirdPartyApp = {
idThirdPartyApp: number;
name: string;
assistedShoppingEnabled: boolean;
};
export type ThirdPartyConnection = {
idUser: number;
accountName: string;
connectionErrors: number;
utcLastCompletedSync: Date;
utcLastAssistedShoppingSync: Date;
thirdPartyApp: ThirdPartyApp;
};
export type AssistedSales = {
idOrder: number;
idUser: number;
idThirdPartyApp: number;
orderTotal: number;
currency: string;
orderDate: Date;
openDate: Date;
campaign: {
idCampaign: number;
name: string;
campaignType: string;
automationEventType: string | undefined;
amountSentSubscribers: number;
DistinctOpenedMailCount: number;
utcSentDate: Date;
};
subscriber: { idSubscriber: number; email: string };
};
export interface IntegrationsApiClient {
getConnections: () => Promise<Result<ThirdPartyConnection[]>>;
getAssistedSales: (
idThirdPartyApp: string,
dateFrom: Date,
dateTo: Date,
) => Promise<Result<AssistedSales[]>>;
}