@rocketlink/crm-model 1.0.236 → 1.0.237
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dtos/csv.request.dto.d.ts +1 -1
- package/dist/dtos/csv.request.dto.d.ts.map +1 -1
- package/dist/dtos/csvRow.request.dto.d.ts +1 -1
- package/dist/dtos/csvRow.request.dto.d.ts.map +1 -1
- package/dist/dtos/mid.request.dto.d.ts +1 -1
- package/dist/dtos/mid.request.dto.d.ts.map +1 -1
- package/dist/dtos/subscription.request.dto.d.ts +1 -1
- package/dist/dtos/subscription.request.dto.d.ts.map +1 -1
- package/dist/dtos/transaction.request.dto.d.ts +1 -1
- package/dist/dtos/transaction.request.dto.d.ts.map +1 -1
- package/dist/gateways/adapters/model/transactionEmp.model.d.ts +1 -1
- package/dist/gateways/adapters/model/transactionEmp.model.d.ts.map +1 -1
- package/dist/gateways/adapters/model/transactionEmp.model.js +2 -2
- package/dist/gateways/adapters/model/transactionFinXP.model.d.ts +1 -1
- package/dist/gateways/adapters/model/transactionFinXP.model.d.ts.map +1 -1
- package/dist/gateways/adapters/model/transactionFinXP.model.js +3 -3
- package/dist/gateways/adapters/model/transactionNovalNet.model.d.ts +1 -1
- package/dist/gateways/adapters/model/transactionNovalNet.model.d.ts.map +1 -1
- package/dist/gateways/adapters/model/transactionNovalNet.model.js +2 -2
- package/dist/index.d.ts +17 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -1
- package/dist/mappers/csv/csvRowDataOrder.csv.mapper.d.ts +5 -0
- package/dist/mappers/csv/csvRowDataOrder.csv.mapper.d.ts.map +1 -0
- package/dist/mappers/csv/csvRowDataOrder.csv.mapper.js +21 -0
- package/dist/mappers/csv/csvRowDataSubscriptionId.csv.mapper.d.ts +4 -0
- package/dist/mappers/csv/csvRowDataSubscriptionId.csv.mapper.d.ts.map +1 -0
- package/dist/mappers/csv/csvRowDataSubscriptionId.csv.mapper.js +7 -0
- package/dist/model/campaign.model.d.ts +1 -1
- package/dist/model/campaign.model.d.ts.map +1 -1
- package/dist/model/constants/csv.constants.d.ts +26 -0
- package/dist/model/constants/csv.constants.d.ts.map +1 -0
- package/dist/model/constants/csv.constants.js +25 -0
- package/dist/model/constants/event.constants.d.ts +14 -0
- package/dist/model/constants/event.constants.d.ts.map +1 -0
- package/dist/model/constants/event.constants.js +15 -0
- package/dist/model/constants/gateway.constants.d.ts +21 -0
- package/dist/model/constants/gateway.constants.d.ts.map +1 -0
- package/dist/model/constants/gateway.constants.js +21 -0
- package/dist/model/constants/hookOutbox.constants.d.ts +7 -0
- package/dist/model/constants/hookOutbox.constants.d.ts.map +1 -0
- package/dist/model/constants/hookOutbox.constants.js +8 -0
- package/dist/model/constants/job.constants.d.ts +11 -0
- package/dist/model/constants/job.constants.d.ts.map +1 -0
- package/dist/model/constants/job.constants.js +12 -0
- package/dist/model/constants/lead.constants.d.ts +6 -0
- package/dist/model/constants/lead.constants.d.ts.map +1 -0
- package/dist/model/constants/lead.constants.js +7 -0
- package/dist/model/constants/mid.constants.d.ts +6 -0
- package/dist/model/constants/mid.constants.d.ts.map +1 -0
- package/dist/model/constants/mid.constants.js +7 -0
- package/dist/model/constants/offer.constants.d.ts +7 -0
- package/dist/model/constants/offer.constants.d.ts.map +1 -0
- package/dist/model/constants/offer.constants.js +8 -0
- package/dist/model/constants/order.constants.d.ts +8 -0
- package/dist/model/constants/order.constants.d.ts.map +1 -0
- package/dist/model/constants/order.constants.js +9 -0
- package/dist/model/constants/paymentData.constants.d.ts +7 -0
- package/dist/model/constants/paymentData.constants.d.ts.map +1 -0
- package/dist/model/constants/paymentData.constants.js +8 -0
- package/dist/model/constants/subscription.constants.d.ts +16 -0
- package/dist/model/constants/subscription.constants.d.ts.map +1 -0
- package/dist/model/constants/subscription.constants.js +24 -0
- package/dist/model/constants/subscriptionRebill.constants.d.ts +4 -0
- package/dist/model/constants/subscriptionRebill.constants.d.ts.map +1 -0
- package/dist/model/constants/subscriptionRebill.constants.js +6 -0
- package/dist/model/constants/transaction.constants.d.ts +27 -0
- package/dist/model/constants/transaction.constants.d.ts.map +1 -0
- package/dist/model/constants/transaction.constants.js +25 -0
- package/dist/model/csv.model.d.ts +2 -30
- package/dist/model/csv.model.d.ts.map +1 -1
- package/dist/model/csv.model.js +0 -24
- package/dist/model/csvRowDataOrder.model.d.ts +21 -0
- package/dist/model/csvRowDataOrder.model.d.ts.map +1 -0
- package/dist/model/csvRowDataSubscriptionId.model.d.ts +4 -0
- package/dist/model/csvRowDataSubscriptionId.model.d.ts.map +1 -0
- package/dist/model/csvRowDataSubscriptionId.model.js +2 -0
- package/dist/model/gateway.model.d.ts +1 -20
- package/dist/model/gateway.model.d.ts.map +1 -1
- package/dist/model/gateway.model.js +0 -19
- package/dist/model/hookOutbox.model.d.ts +1 -6
- package/dist/model/hookOutbox.model.d.ts.map +1 -1
- package/dist/model/hookOutbox.model.js +0 -6
- package/dist/model/job.model.d.ts +1 -1
- package/dist/model/job.model.d.ts.map +1 -1
- package/dist/model/lead.model.d.ts +1 -1
- package/dist/model/lead.model.d.ts.map +1 -1
- package/dist/model/mid.model.d.ts +1 -5
- package/dist/model/mid.model.d.ts.map +1 -1
- package/dist/model/mid.model.js +0 -5
- package/dist/model/offer.model.d.ts +2 -2
- package/dist/model/offer.model.d.ts.map +1 -1
- package/dist/model/order.model.d.ts +1 -1
- package/dist/model/order.model.d.ts.map +1 -1
- package/dist/model/paymentData.model.d.ts +1 -6
- package/dist/model/paymentData.model.d.ts.map +1 -1
- package/dist/model/paymentData.model.js +4 -9
- package/dist/model/rebillingConfig.model.d.ts +14 -0
- package/dist/model/rebillingConfig.model.d.ts.map +1 -0
- package/dist/model/rebillingConfig.model.js +2 -0
- package/dist/model/subscription.model.d.ts +2 -4
- package/dist/model/subscription.model.d.ts.map +1 -1
- package/dist/model/subscription.model.js +0 -12
- package/dist/model/subscriptionRebill.model.d.ts +1 -0
- package/dist/model/subscriptionRebill.model.d.ts.map +1 -0
- package/dist/model/subscriptionRebill.model.js +1 -0
- package/dist/model/transaction.model.d.ts +2 -20
- package/dist/model/transaction.model.d.ts.map +1 -1
- package/dist/model/transaction.model.js +0 -17
- package/dist/model/transactionError.model.d.ts +1 -1
- package/dist/model/transactionError.model.d.ts.map +1 -1
- package/dist/util/constants.d.ts +1 -91
- package/dist/util/constants.d.ts.map +1 -1
- package/dist/util/constants.js +2 -82
- package/package.json +1 -1
- package/src/dtos/csv.request.dto.ts +1 -1
- package/src/dtos/csvRow.request.dto.ts +1 -1
- package/src/dtos/mid.request.dto.ts +1 -1
- package/src/dtos/subscription.request.dto.ts +1 -1
- package/src/dtos/transaction.request.dto.ts +1 -1
- package/src/gateways/adapters/model/transactionEmp.model.ts +1 -1
- package/src/gateways/adapters/model/transactionFinXP.model.ts +1 -1
- package/src/gateways/adapters/model/transactionNovalNet.model.ts +1 -1
- package/src/index.ts +22 -2
- package/src/mappers/csv/csvRowDataOrder.csv.mapper.ts +20 -0
- package/src/mappers/csv/csvRowDataSubscriptionId.csv.mapper.ts +6 -0
- package/src/model/campaign.model.ts +1 -1
- package/src/model/constants/csv.constants.ts +27 -0
- package/src/model/constants/event.constants.ts +13 -0
- package/src/model/constants/gateway.constants.ts +21 -0
- package/src/model/constants/hookOutbox.constants.ts +6 -0
- package/src/model/constants/job.constants.ts +10 -0
- package/src/model/constants/lead.constants.ts +5 -0
- package/src/model/constants/mid.constants.ts +5 -0
- package/src/model/constants/offer.constants.ts +6 -0
- package/src/model/constants/order.constants.ts +7 -0
- package/src/model/constants/paymentData.constants.ts +7 -0
- package/src/model/constants/subscription.constants.ts +26 -0
- package/src/model/constants/subscriptionRebill.constants.ts +3 -0
- package/src/model/constants/transaction.constants.ts +29 -0
- package/src/model/csv.model.ts +3 -53
- package/src/model/csvRowDataOrder.model.ts +21 -0
- package/src/model/csvRowDataSubscriptionId.model.ts +3 -0
- package/src/model/gateway.model.ts +2 -22
- package/src/model/hookOutbox.model.ts +1 -6
- package/src/model/job.model.ts +1 -1
- package/src/model/lead.model.ts +1 -1
- package/src/model/mid.model.ts +2 -7
- package/src/model/offer.model.ts +3 -3
- package/src/model/order.model.ts +2 -2
- package/src/model/paymentData.model.ts +2 -9
- package/src/model/{recurringSettingConfig.model.ts → rebillingConfig.model.ts} +5 -5
- package/src/model/subscription.model.ts +2 -14
- package/src/model/subscriptionRebill.model.ts +0 -0
- package/src/model/transaction.model.ts +3 -24
- package/src/model/transactionError.model.ts +1 -1
- package/src/util/constants.ts +2 -106
- package/dist/model/recurringSettingConfig.model.d.ts +0 -14
- package/dist/model/recurringSettingConfig.model.d.ts.map +0 -1
- /package/dist/model/{recurringSettingConfig.model.js → csvRowDataOrder.model.js} +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Subscription } from "../subscription.model";
|
|
2
|
+
|
|
3
|
+
export const SUBSCRIPTION_STATUS = {
|
|
4
|
+
PAYMENT_PENDING: "PAYMENT_PENDING",
|
|
5
|
+
PAYMENT_PENDING_CONFIRMATION: "PAYMENT_PENDING_CONFIRMATION",
|
|
6
|
+
REBILL_PENDING: "REBILL_PENDING",
|
|
7
|
+
REBILL_PENDING_CONFIRMATION: "REBILL_PENDING_CONFIRMATION",
|
|
8
|
+
ACTIVE: "ACTIVE",
|
|
9
|
+
EXPIRED: "EXPIRED",
|
|
10
|
+
CANCELLED: "CANCELLED",
|
|
11
|
+
TRIAL: "TRIAL"
|
|
12
|
+
};
|
|
13
|
+
export type SUBSCRIPTION_STATUS = (typeof SUBSCRIPTION_STATUS)[keyof typeof SUBSCRIPTION_STATUS];
|
|
14
|
+
|
|
15
|
+
export const subscriptionCredentialsColumn: Partial<Record<keyof Subscription, string>> = {
|
|
16
|
+
orderId: "order_id",
|
|
17
|
+
id: "subscription_id",
|
|
18
|
+
email: "email",
|
|
19
|
+
startDate: "subscription_date",
|
|
20
|
+
username: "username",
|
|
21
|
+
password: "password",
|
|
22
|
+
status: "status"
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const subscriptionCredentialsColumnMapper = subscriptionCredentialsColumn;
|
|
26
|
+
export const subscriptionCredentialsColumnKeys = Object.keys(subscriptionCredentialsColumn);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const TRANSACTION_TYPE = {
|
|
2
|
+
sdd_sale: 'sdd_sale',
|
|
3
|
+
chargeback: 'chargeback',
|
|
4
|
+
refund: 'refund'
|
|
5
|
+
};
|
|
6
|
+
export const TRANSACTION_TYPE_VALUES = Object.values(TRANSACTION_TYPE);
|
|
7
|
+
export type TRANSACTION_TYPE = (typeof TRANSACTION_TYPE)[keyof typeof TRANSACTION_TYPE];
|
|
8
|
+
|
|
9
|
+
export const TRANSACTION_STATUS = {
|
|
10
|
+
PENDING_ASYNC: "PENDING_ASYNC",
|
|
11
|
+
SUCCESS: "SUCCESS",
|
|
12
|
+
FAILED: "FAILED",
|
|
13
|
+
UNKNOWN: "UNKNOWN",
|
|
14
|
+
};
|
|
15
|
+
export type TRANSACTION_STATUS = (typeof TRANSACTION_STATUS)[keyof typeof TRANSACTION_STATUS];
|
|
16
|
+
|
|
17
|
+
export const APP_TRANSACTION_TYPE = {
|
|
18
|
+
INITIAL: "INITIAL",
|
|
19
|
+
REBILL: "REBILL",
|
|
20
|
+
STEPDOWN: "STEPDOWN",
|
|
21
|
+
};
|
|
22
|
+
export type APP_TRANSACTION_TYPE = (typeof APP_TRANSACTION_TYPE)[keyof typeof APP_TRANSACTION_TYPE];
|
|
23
|
+
|
|
24
|
+
export const PAYMENT_TYPE = {
|
|
25
|
+
SDD_SALE: "SDD_SALE",
|
|
26
|
+
REFUND: "REFUND",
|
|
27
|
+
CHARGEBACK: "CHARGEBACK"
|
|
28
|
+
};
|
|
29
|
+
export type PAYMENT_TYPE = (typeof PAYMENT_TYPE)[keyof typeof PAYMENT_TYPE];
|
package/src/model/csv.model.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CSVStatusTypes, CSVRowStatusTypes, CSV_TYPES } from "./constants/csv.constants";
|
|
2
2
|
|
|
3
3
|
export interface CSV {
|
|
4
4
|
id?: number;
|
|
@@ -22,59 +22,9 @@ export interface CSVRow {
|
|
|
22
22
|
csvId?: number;
|
|
23
23
|
csv?: CSV;
|
|
24
24
|
rowIndex?: number; // 1..N (data row index)
|
|
25
|
-
|
|
25
|
+
data?: Record<string, any>; // the row data (firstName, email, etc). For each different data type (order, lead, etc) will be a different model csvRowDataOrder.model.ts, etc
|
|
26
26
|
status?: CSVRowStatusTypes; // -- QUEUED | DONE | FAILED
|
|
27
27
|
errorMessage?: string;
|
|
28
28
|
createdAt?: Date;
|
|
29
29
|
updatedAt?: Date;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// firstName,lastName,address1,address2,city,state,country,zipCode,phone,email,iban,bic,offerId
|
|
33
|
-
export interface OrderCSVRow {
|
|
34
|
-
csvId?: number;
|
|
35
|
-
id?: number;
|
|
36
|
-
firstName?: string;
|
|
37
|
-
lastName?: string;
|
|
38
|
-
address1?: string;
|
|
39
|
-
address2?: string;
|
|
40
|
-
city?: string;
|
|
41
|
-
state?: string;
|
|
42
|
-
country?: string;
|
|
43
|
-
zipCode?: string;
|
|
44
|
-
phone?: string;
|
|
45
|
-
email?: string;
|
|
46
|
-
iban?: string;
|
|
47
|
-
bic?: string;
|
|
48
|
-
offerId?: number;
|
|
49
|
-
campaignId?: number;
|
|
50
|
-
createdAt?: Date;
|
|
51
|
-
updatedAt?: Date;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export const ordersCSVColumnsMapper: Partial<Record<keyof OrderCSVRow, string>> = {
|
|
55
|
-
firstName: "firstName",
|
|
56
|
-
lastName: "lastName",
|
|
57
|
-
address1: "address1",
|
|
58
|
-
address2: "address2",
|
|
59
|
-
city: "city",
|
|
60
|
-
state: "state",
|
|
61
|
-
country: "country",
|
|
62
|
-
zipCode: "zipCode",
|
|
63
|
-
phone: "phone",
|
|
64
|
-
email: "email",
|
|
65
|
-
iban: "iban",
|
|
66
|
-
bic: "bic",
|
|
67
|
-
offerId: "offerId",
|
|
68
|
-
campaignId: "campaignId",
|
|
69
|
-
};
|
|
70
|
-
export const ordersCSVColumnKeys = Object.keys(ordersCSVColumnsMapper);
|
|
71
|
-
export const ordersCSVColumnValues = Object.values(ordersCSVColumnsMapper);
|
|
72
|
-
|
|
73
|
-
export interface SubscriptionIdCSVRow {
|
|
74
|
-
subscriptionId: number;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export const subscriptionIdCSVColumnMapper: Partial<Record<keyof SubscriptionIdCSVRow, string>> = {
|
|
78
|
-
subscriptionId: "subscriptionId"
|
|
79
|
-
};
|
|
80
|
-
export const subscriptionIdCSVColumnKeys = Object.keys(subscriptionIdCSVColumnMapper);
|
|
30
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// firstName,lastName,address1,address2,city,state,country,zipCode,phone,email,iban,bic,offerId
|
|
2
|
+
export interface CSVRowDataOrder {
|
|
3
|
+
csvId?: number;
|
|
4
|
+
id?: number;
|
|
5
|
+
firstName?: string;
|
|
6
|
+
lastName?: string;
|
|
7
|
+
address1?: string;
|
|
8
|
+
address2?: string;
|
|
9
|
+
city?: string;
|
|
10
|
+
state?: string;
|
|
11
|
+
country?: string;
|
|
12
|
+
zipCode?: string;
|
|
13
|
+
phone?: string;
|
|
14
|
+
email?: string;
|
|
15
|
+
iban?: string;
|
|
16
|
+
bic?: string;
|
|
17
|
+
offerId?: number;
|
|
18
|
+
campaignId?: number;
|
|
19
|
+
createdAt?: Date;
|
|
20
|
+
updatedAt?: Date;
|
|
21
|
+
}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
EMP: "emp", // status pending
|
|
3
|
-
finXP: "finxp", // manual. status pending.
|
|
4
|
-
Paynt: "paynt",
|
|
5
|
-
Paystrax: "paystrax",
|
|
6
|
-
PayBank2Bank: "paybank2bank",
|
|
7
|
-
Novalnet: "novalnet", //manual. all in un place CB
|
|
8
|
-
UNKNOWN: "unknown",
|
|
9
|
-
ALL: "all",
|
|
10
|
-
};
|
|
11
|
-
export const BANK_NAME_VALUES = Object.values(BANKS);
|
|
12
|
-
export type BANKS = (typeof BANKS)[keyof typeof BANKS];
|
|
1
|
+
import type { BANKS, providersTypes } from "./constants/gateway.constants";
|
|
13
2
|
|
|
14
3
|
export interface Adapter {
|
|
15
4
|
id?: number;
|
|
@@ -21,15 +10,6 @@ export interface Adapter {
|
|
|
21
10
|
updatedAt?: Date;
|
|
22
11
|
}
|
|
23
12
|
|
|
24
|
-
export const PROVIDER_NAMES = {
|
|
25
|
-
GENESIS: "GENESIS",
|
|
26
|
-
ROCKETPAY: "ROCKETPAY",
|
|
27
|
-
NOVALNET_MANUAL: "NOVALNET_MANUAL",
|
|
28
|
-
FINXP_MANUAL: "FINXP_MANUAL",
|
|
29
|
-
ACI: "ACI"
|
|
30
|
-
};
|
|
31
|
-
export type providersTypes = (typeof PROVIDER_NAMES)[keyof typeof PROVIDER_NAMES];
|
|
32
|
-
|
|
33
13
|
export interface Provider {
|
|
34
14
|
id: number;
|
|
35
15
|
name: providersTypes;
|
|
@@ -52,4 +32,4 @@ export interface AdapterProvider {
|
|
|
52
32
|
isDefault?: boolean;
|
|
53
33
|
createdAt?: Date;
|
|
54
34
|
updatedAt?: Date;
|
|
55
|
-
}
|
|
35
|
+
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import type { Campaign } from './campaign.model'
|
|
2
|
-
|
|
3
|
-
PENDING: 'PENDING',
|
|
4
|
-
SENT: 'SENT',
|
|
5
|
-
FAILED: 'FAILED'
|
|
6
|
-
};
|
|
7
|
-
export type HOOK_OUTBOX_STATUS = (typeof HOOK_OUTBOX_STATUS)[keyof typeof HOOK_OUTBOX_STATUS];
|
|
2
|
+
import type { HOOK_OUTBOX_STATUS } from './constants/hookOutbox.constants';
|
|
8
3
|
|
|
9
4
|
export interface HookOutbox {
|
|
10
5
|
id?: number;
|
package/src/model/job.model.ts
CHANGED
package/src/model/lead.model.ts
CHANGED
package/src/model/mid.model.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { AdapterProvider } from "./gateway.model";
|
|
2
2
|
import { Website } from "./website.model";
|
|
3
|
-
|
|
4
|
-
export const MID_STATE = {
|
|
5
|
-
ACTIVE: 'ACTIVE',
|
|
6
|
-
TERMINATED: 'TERMINATED'
|
|
7
|
-
};
|
|
8
|
-
export type MID_STATE = (typeof MID_STATE)[keyof typeof MID_STATE];
|
|
3
|
+
import type { MID_STATE } from "./constants/mid.constants";
|
|
9
4
|
|
|
10
5
|
export interface Mid {
|
|
11
6
|
id?: number;
|
|
@@ -27,4 +22,4 @@ export interface MidAuth {
|
|
|
27
22
|
username: string;
|
|
28
23
|
password: string;
|
|
29
24
|
token: string;
|
|
30
|
-
}
|
|
25
|
+
}
|
package/src/model/offer.model.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OFFER_TYPE } from '../util/constants';
|
|
2
1
|
import { Campaign } from './campaign.model';
|
|
3
2
|
import { Mid } from './mid.model';
|
|
4
3
|
import { Product } from './product.model';
|
|
4
|
+
import type { OFFER_TYPE } from './constants/offer.constants';
|
|
5
5
|
|
|
6
6
|
export interface Offer {
|
|
7
7
|
id?: number;
|
|
@@ -20,7 +20,7 @@ export interface Offer {
|
|
|
20
20
|
midRouterId?: number;
|
|
21
21
|
campaignId?: number;
|
|
22
22
|
campaign?: Campaign;
|
|
23
|
-
|
|
23
|
+
rebillingConfigId?: number;
|
|
24
24
|
createdAt?: Date;
|
|
25
25
|
updatedAt?: Date;
|
|
26
|
-
}
|
|
26
|
+
}
|
package/src/model/order.model.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ORDER_STATUS } from '../util/constants';
|
|
2
1
|
import { Offer } from "./offer.model";
|
|
3
2
|
import { PaymentDataType } from "./paymentData.model";
|
|
4
3
|
import { Mid } from "./mid.model";
|
|
5
4
|
import { Campaign } from "./campaign.model";
|
|
6
5
|
import { Transaction } from "./transaction.model";
|
|
6
|
+
import type { ORDER_STATUS } from "./constants/order.constants";
|
|
7
7
|
|
|
8
8
|
export interface Order {
|
|
9
9
|
id?: number;
|
|
@@ -46,4 +46,4 @@ export interface OrderItemTransaction {
|
|
|
46
46
|
transactionId?: number;
|
|
47
47
|
createdAt?: Date;
|
|
48
48
|
updatedAt?: Date;
|
|
49
|
-
}
|
|
49
|
+
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { Lead } from "./lead.model";
|
|
2
|
-
|
|
3
|
-
export const PAYMENT_METHOD = {
|
|
4
|
-
SEPA: "SEPA",
|
|
5
|
-
CREDIT_CARD: "CREDIT_CARD",
|
|
6
|
-
OPEN_BANKING: "OPEN_BANKING"
|
|
7
|
-
} as const;
|
|
8
|
-
|
|
9
|
-
export type PaymentMethodType = (typeof PAYMENT_METHOD)[keyof typeof PAYMENT_METHOD];
|
|
2
|
+
import { PAYMENT_METHOD, PaymentMethodType } from "./constants/paymentData.constants";
|
|
10
3
|
|
|
11
4
|
export interface PaymentData {
|
|
12
5
|
id?: number;
|
|
@@ -56,4 +49,4 @@ export function isCreditCard(p: PaymentDataType): p is CreditCardPaymentData {
|
|
|
56
49
|
|
|
57
50
|
export function isOpenBanking(p: PaymentDataType): p is OpenBankingPaymentData {
|
|
58
51
|
return p.type === PAYMENT_METHOD.OPEN_BANKING;
|
|
59
|
-
}
|
|
52
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as dateUtil from "../util/dateUtil";
|
|
2
2
|
|
|
3
|
-
export interface
|
|
3
|
+
export interface RebillingConfig {
|
|
4
4
|
id?: number;
|
|
5
5
|
name?: string;
|
|
6
|
-
intervalUnit
|
|
7
|
-
intervalPeriod
|
|
6
|
+
intervalUnit: dateUtil.INTERVAL_UNIT;
|
|
7
|
+
intervalPeriod: number;
|
|
8
8
|
maxTriesAfterFailure?: number;
|
|
9
|
-
maxDelayPeriod
|
|
10
|
-
dunningIntervalPeriod
|
|
9
|
+
maxDelayPeriod: number;
|
|
10
|
+
dunningIntervalPeriod: number;
|
|
11
11
|
dunningMaxRetires?: number;
|
|
12
12
|
createdAt?: Date;
|
|
13
13
|
updatedAt?: Date;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OrderItem } from "./order.model";
|
|
2
|
+
import type { SUBSCRIPTION_STATUS } from "./constants/subscription.constants";
|
|
2
3
|
|
|
3
4
|
export interface Subscription {
|
|
4
5
|
id?: number;
|
|
@@ -7,7 +8,7 @@ export interface Subscription {
|
|
|
7
8
|
startDate?: Date;
|
|
8
9
|
endDate?: Date;
|
|
9
10
|
nextBillingDate?: Date;
|
|
10
|
-
status?:
|
|
11
|
+
status?: SUBSCRIPTION_STATUS;
|
|
11
12
|
orderItemId?: number;
|
|
12
13
|
orderItem?: OrderItem;
|
|
13
14
|
registrationEmailSent?: boolean;
|
|
@@ -28,16 +29,3 @@ export interface Subscription {
|
|
|
28
29
|
leadEmail?: string;
|
|
29
30
|
bankName?: string;
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
-
export const subscriptionCredentialsColumn: Partial<Record<keyof Subscription, string>> = {
|
|
33
|
-
orderId: "order_id",
|
|
34
|
-
id: "subscription_id",
|
|
35
|
-
email: "email",
|
|
36
|
-
startDate: "subscription_date",
|
|
37
|
-
username: "username",
|
|
38
|
-
password: "password",
|
|
39
|
-
status: "status"
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const subscriptionCredentialsColumnMapper = subscriptionCredentialsColumn;
|
|
43
|
-
export const subscriptionCredentialsColumnKeys = Object.keys(subscriptionCredentialsColumn);
|
|
File without changes
|
|
@@ -1,27 +1,6 @@
|
|
|
1
|
-
import { BANKS } from "./gateway.
|
|
1
|
+
import { BANKS } from "./constants/gateway.constants";
|
|
2
2
|
import { Mid } from "./mid.model";
|
|
3
|
-
|
|
4
|
-
export const TRANSACTION_STATUS = {
|
|
5
|
-
PENDING_ASYNC: "PENDING_ASYNC",
|
|
6
|
-
SUCCESS: "SUCCESS",
|
|
7
|
-
FAILED: "FAILED",
|
|
8
|
-
UNKNOWN: "UNKNOWN",
|
|
9
|
-
};
|
|
10
|
-
export type TRANSACTION_STATUS = (typeof TRANSACTION_STATUS)[keyof typeof TRANSACTION_STATUS];
|
|
11
|
-
|
|
12
|
-
export const APP_TRANSACTION_TYPE = {
|
|
13
|
-
INITIAL: "INITIAL",
|
|
14
|
-
REBILL: "REBILL",
|
|
15
|
-
STEPDOWN: "STEPDOWN",
|
|
16
|
-
};
|
|
17
|
-
export type APP_TRANSACTION_TYPE = (typeof APP_TRANSACTION_TYPE)[keyof typeof APP_TRANSACTION_TYPE];
|
|
18
|
-
|
|
19
|
-
export const PAYMENT_TYPE = {
|
|
20
|
-
SDD_SALE: "SDD_SALE",
|
|
21
|
-
REFUND: "REFUND",
|
|
22
|
-
CHARGEBACK: "CHARGEBACK"
|
|
23
|
-
};
|
|
24
|
-
export type PAYMENT_TYPE = (typeof PAYMENT_TYPE)[keyof typeof PAYMENT_TYPE];
|
|
3
|
+
import type { PAYMENT_TYPE, APP_TRANSACTION_TYPE, TRANSACTION_STATUS } from "./constants/transaction.constants";
|
|
25
4
|
|
|
26
5
|
export interface Transaction {
|
|
27
6
|
id?: number;
|
|
@@ -39,4 +18,4 @@ export interface Transaction {
|
|
|
39
18
|
response?: string;
|
|
40
19
|
createdAt?: Date;
|
|
41
20
|
updatedAt?: Date;
|
|
42
|
-
}
|
|
21
|
+
}
|
package/src/util/constants.ts
CHANGED
|
@@ -4,106 +4,13 @@ export const YES_NO = {
|
|
|
4
4
|
};
|
|
5
5
|
export type YES_NO = (typeof YES_NO)[keyof typeof YES_NO];
|
|
6
6
|
|
|
7
|
+
export const ALL = 'all';
|
|
8
|
+
|
|
7
9
|
export const MIME_TYPES = {
|
|
8
10
|
csv: "text/csv",
|
|
9
11
|
};
|
|
10
12
|
export type MIME_TYPES = (typeof MIME_TYPES)[keyof typeof MIME_TYPES];
|
|
11
13
|
|
|
12
|
-
export const CSV_TYPES = {
|
|
13
|
-
CREATE_ORDERS: "CREATE_ORDERS",
|
|
14
|
-
BILL_SUBSCRIPTIONS: "BILL_SUBSCRIPTIONS",
|
|
15
|
-
IMPORT_TRANSACTIONS_SDD: "IMPORT_TRANSACTIONS_SDD",
|
|
16
|
-
IMPORT_TRANSACTIONS_CHARGEBACK: "IMPORT_TRANSACTIONS_CHARGEBACK",
|
|
17
|
-
CANCEL_SUBSCRIPTIONS: "CANCEL_SUBSCRIPTIONS",
|
|
18
|
-
};
|
|
19
|
-
export const CSV_TYPE_VALUES = Object.values(CSV_TYPES);
|
|
20
|
-
export type CSV_TYPES = (typeof CSV_TYPES)[keyof typeof CSV_TYPES];
|
|
21
|
-
|
|
22
|
-
export const CSV_STATUS = {
|
|
23
|
-
UPLOADED: "UPLOADED",
|
|
24
|
-
QUEUED: "QUEUED",
|
|
25
|
-
PROCESSING: "PROCESSING",
|
|
26
|
-
COMPLETED: "COMPLETED",
|
|
27
|
-
COMPLETED_WITH_ERRORS: "COMPLETED_WITH_ERRORS",
|
|
28
|
-
FAILED: "FAILED",
|
|
29
|
-
CANCELLED: "CANCELLED"
|
|
30
|
-
};
|
|
31
|
-
export type CSVStatusTypes = (typeof CSV_STATUS)[keyof typeof CSV_STATUS];
|
|
32
|
-
|
|
33
|
-
export const CSV_ROW_STATUS = {
|
|
34
|
-
QUEUED: 'QUEUED',
|
|
35
|
-
SUCCESS: "SUCCESS",
|
|
36
|
-
FAILED: "FAILED",
|
|
37
|
-
};
|
|
38
|
-
export type CSVRowStatusTypes = (typeof CSV_ROW_STATUS)[keyof typeof CSV_ROW_STATUS];
|
|
39
|
-
|
|
40
|
-
export const REGISTRATION_MODE = {
|
|
41
|
-
LIVE_TRAFFIC: "LIVE_TRAFFIC",
|
|
42
|
-
CSV: "CSV"
|
|
43
|
-
};
|
|
44
|
-
export type REGISTRATION_MODE = (typeof REGISTRATION_MODE)[keyof typeof REGISTRATION_MODE];
|
|
45
|
-
|
|
46
|
-
export const OFFER_TYPE = {
|
|
47
|
-
OFFER: "OFFER",
|
|
48
|
-
UPSELL: "UPSELL",
|
|
49
|
-
DOWNSELL: "DOWNSELL"
|
|
50
|
-
};
|
|
51
|
-
export type OFFER_TYPE = (typeof OFFER_TYPE)[keyof typeof OFFER_TYPE];
|
|
52
|
-
|
|
53
|
-
export const TRANSACTION_TYPE = {
|
|
54
|
-
sdd_sale: 'sdd_sale',
|
|
55
|
-
chargeback: 'chargeback',
|
|
56
|
-
refund: 'refund'
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export const ALL = 'all';
|
|
60
|
-
|
|
61
|
-
export type TRANSACTION_TYPE = (typeof TRANSACTION_TYPE)[keyof typeof TRANSACTION_TYPE];
|
|
62
|
-
export const TRANSACTION_TYPE_VALUES = Object.values(TRANSACTION_TYPE);
|
|
63
|
-
|
|
64
|
-
export const TRANSACTION_TYPE_CODE = {
|
|
65
|
-
DB: 'Debit',
|
|
66
|
-
RF: 'Refund',
|
|
67
|
-
PA: 'Payment Authorization',
|
|
68
|
-
CB: 'Chargeback',
|
|
69
|
-
CP: 'Capture',
|
|
70
|
-
RV: 'Reversal',
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
export const ORDER_STATUS = {
|
|
76
|
-
INITIATED: "INITIATED",
|
|
77
|
-
COMPLETED: "COMPLETED",
|
|
78
|
-
FAILED: "FAILED",
|
|
79
|
-
};
|
|
80
|
-
export type ORDER_STATUS = (typeof ORDER_STATUS)[keyof typeof ORDER_STATUS];
|
|
81
|
-
export const ORDER_STATUS_VALUES = Object.values(CSV_TYPES);
|
|
82
|
-
|
|
83
|
-
export const SUBSCRIPTION_STATUS = {
|
|
84
|
-
PAYMENT_PENDING: "PAYMENT_PENDING",
|
|
85
|
-
PAYMENT_PENDING_CONFIRMATION: "PAYMENT_PENDING_CONFIRMATION",
|
|
86
|
-
ACTIVE: "ACTIVE",
|
|
87
|
-
EXPIRED: "EXPIRED",
|
|
88
|
-
CANCELLED: "CANCELLED",
|
|
89
|
-
TRIAL: "TRIAL"
|
|
90
|
-
};
|
|
91
|
-
export type SUBSCRIPTION_STATUS = (typeof SUBSCRIPTION_STATUS)[keyof typeof SUBSCRIPTION_STATUS];
|
|
92
|
-
|
|
93
|
-
export const EVENTS = {
|
|
94
|
-
ORDER_CREATED: "order.created",
|
|
95
|
-
ORDER_UPDATED: "order.updated",
|
|
96
|
-
SUBSCRIPTION_CREATED: "subscription.created",
|
|
97
|
-
TRANSACTION_SDD_IMPORTED: "transaction.sdd_sale.imported",
|
|
98
|
-
TRANSACTION_REFUND_IMPORTED: "transaction.refund.imported",
|
|
99
|
-
TRANSACTION_CHARGEBACK_IMPORTED: "transaction.chargeback.imported",
|
|
100
|
-
TRANSACTION_REFUND_ISSUED: "transaction.refund.issued",
|
|
101
|
-
TRANSACTION_UPDATED: "transaction.updated",
|
|
102
|
-
TRANSACTION_ERROR: "transaction.error",
|
|
103
|
-
SUBSCRIPTION_CANCELLATION_ISSUED: "subscription.cancellation.issued"
|
|
104
|
-
};
|
|
105
|
-
export type EVENTS = (typeof EVENTS)[keyof typeof EVENTS];
|
|
106
|
-
|
|
107
14
|
export const SAFE_WHILE_LIMIT = 1_000;
|
|
108
15
|
|
|
109
16
|
export const CURRENCIES = {
|
|
@@ -116,14 +23,3 @@ export type CURRENCIES = (typeof CURRENCIES)[keyof typeof CURRENCIES];
|
|
|
116
23
|
export const MB_1 = 1 * 1024 * 1024;
|
|
117
24
|
|
|
118
25
|
export const MAX_MB_STREAM_SIZE = MB_1 * 5;
|
|
119
|
-
|
|
120
|
-
export const JOB_STATE = {
|
|
121
|
-
CREATED: "created",
|
|
122
|
-
RETRY: "retry",
|
|
123
|
-
ACTIVE: "active",
|
|
124
|
-
COMPLETED: "completed",
|
|
125
|
-
EXPIRED: "expired",
|
|
126
|
-
CANCELLED: "cancelled",
|
|
127
|
-
FAILED: "failed"
|
|
128
|
-
};
|
|
129
|
-
export type JobStateTypes = (typeof JOB_STATE)[keyof typeof JOB_STATE];
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as dateUtil from "../util/dateUtil";
|
|
2
|
-
export interface RecurringSettingConfig {
|
|
3
|
-
id?: number;
|
|
4
|
-
name?: string;
|
|
5
|
-
intervalUnit?: dateUtil.INTERVAL_UNIT;
|
|
6
|
-
intervalPeriod?: number;
|
|
7
|
-
maxTriesAfterFailure?: number;
|
|
8
|
-
maxDelayPeriod?: number;
|
|
9
|
-
dunningIntervalPeriod?: number;
|
|
10
|
-
dunningMaxRetires?: number;
|
|
11
|
-
createdAt?: Date;
|
|
12
|
-
updatedAt?: Date;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=recurringSettingConfig.model.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"recurringSettingConfig.model.d.ts","sourceRoot":"","sources":["../../src/model/recurringSettingConfig.model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,MAAM,WAAW,sBAAsB;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
|
File without changes
|