@rocketlink/crm-model 1.0.288 → 1.0.290
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/model/constants/transaction.constants.d.ts +1 -0
- package/dist/model/constants/transaction.constants.d.ts.map +1 -1
- package/dist/model/constants/transaction.constants.js +2 -1
- package/dist/util/normalizeUtil.d.ts.map +1 -1
- package/dist/util/normalizeUtil.js +6 -2
- package/package.json +1 -1
- package/src/model/constants/transaction.constants.ts +2 -1
- package/src/util/normalizeUtil.ts +6 -2
|
@@ -14,6 +14,7 @@ export declare const TRANSACTION_STATUS: {
|
|
|
14
14
|
SUCCESS: string;
|
|
15
15
|
FAILED: string;
|
|
16
16
|
REFUNDED: string;
|
|
17
|
+
CHARGEBACKED: string;
|
|
17
18
|
};
|
|
18
19
|
export type TRANSACTION_STATUS = (typeof TRANSACTION_STATUS)[keyof typeof TRANSACTION_STATUS];
|
|
19
20
|
export declare const BILLING_TYPE: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.constants.d.ts","sourceRoot":"","sources":["../../../src/model/constants/transaction.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;;;CAa5B,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAExF,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"transaction.constants.d.ts","sourceRoot":"","sources":["../../../src/model/constants/transaction.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;;;CAa5B,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAExF,eAAO,MAAM,kBAAkB;;;;;;;CAO9B,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAE9F,eAAO,MAAM,YAAY;;;;CAIxB,CAAC;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeUtil.d.ts","sourceRoot":"","sources":["../../src/util/normalizeUtil.ts"],"names":[],"mappings":"AAGA,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAEpF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAE9E;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"normalizeUtil.d.ts","sourceRoot":"","sources":["../../src/util/normalizeUtil.ts"],"names":[],"mappings":"AAGA,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAEpF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAE9E;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CASpF;AAGD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAoBxH"}
|
|
@@ -13,8 +13,12 @@ function normalizeDate(value) {
|
|
|
13
13
|
return value === null ? undefined : value;
|
|
14
14
|
}
|
|
15
15
|
function normalizeNumber(value) {
|
|
16
|
-
if (
|
|
17
|
-
return
|
|
16
|
+
if (value === '' || value === null || value === undefined) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
const num = Number(value);
|
|
20
|
+
if (!isNaN(num)) {
|
|
21
|
+
return num;
|
|
18
22
|
}
|
|
19
23
|
return undefined;
|
|
20
24
|
}
|
package/package.json
CHANGED
|
@@ -19,7 +19,8 @@ export const TRANSACTION_STATUS = {
|
|
|
19
19
|
PENDING_ASYNC: "PENDING_ASYNC",
|
|
20
20
|
SUCCESS: "SUCCESS",
|
|
21
21
|
FAILED: "FAILED",
|
|
22
|
-
REFUNDED: "REFUNDED"
|
|
22
|
+
REFUNDED: "REFUNDED",
|
|
23
|
+
CHARGEBACKED: "CHARGEBACKED",
|
|
23
24
|
};
|
|
24
25
|
export type TRANSACTION_STATUS = (typeof TRANSACTION_STATUS)[keyof typeof TRANSACTION_STATUS];
|
|
25
26
|
|
|
@@ -10,8 +10,12 @@ export function normalizeDate(value: Date | undefined | null): Date | undefined
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export function normalizeNumber(value: string | undefined | null): number | undefined {
|
|
13
|
-
if (
|
|
14
|
-
return
|
|
13
|
+
if (value === '' || value === null || value === undefined) {
|
|
14
|
+
return undefined
|
|
15
|
+
}
|
|
16
|
+
const num = Number(value)
|
|
17
|
+
if (!isNaN(num)) {
|
|
18
|
+
return num
|
|
15
19
|
}
|
|
16
20
|
return undefined
|
|
17
21
|
}
|