@rocketlink/crm-model 1.0.191 → 1.0.193
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/gateways/adapters/dtos/transaction-emp.request.dto.d.ts +0 -2
- package/dist/gateways/adapters/dtos/transaction-emp.request.dto.d.ts.map +1 -1
- package/dist/util/dateUtil.d.ts +9 -6
- package/dist/util/dateUtil.d.ts.map +1 -1
- package/dist/util/dateUtil.js +36 -1
- package/dist/util/normalizeUtil.d.ts +1 -1
- package/dist/util/normalizeUtil.d.ts.map +1 -1
- package/dist/util/normalizeUtil.js +1 -0
- package/package.json +1 -1
- package/src/gateways/adapters/dtos/transaction-emp.request.dto.ts +0 -2
- package/src/util/dateUtil.ts +39 -6
- package/src/util/normalizeUtil.ts +2 -4
|
@@ -12,8 +12,6 @@ export interface TransactionsEmpRequest extends PaginatedRequest, Omit<Partial<T
|
|
|
12
12
|
paymentType?: string;
|
|
13
13
|
orderId?: number;
|
|
14
14
|
midId?: number;
|
|
15
|
-
reportDateFrom?: string;
|
|
16
|
-
reportDateTo?: string;
|
|
17
15
|
statuses?: string[];
|
|
18
16
|
}
|
|
19
17
|
export interface TransactionsEmpResponse extends PaginatedResponse<TransactionEmp> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-emp.request.dto.d.ts","sourceRoot":"","sources":["../../../../src/gateways/adapters/dtos/transaction-emp.request.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAC/G,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,
|
|
1
|
+
{"version":3,"file":"transaction-emp.request.dto.d.ts","sourceRoot":"","sources":["../../../../src/gateways/adapters/dtos/transaction-emp.request.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAC/G,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB,CAAC,cAAc,CAAC;CACjF"}
|
package/dist/util/dateUtil.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const FORMATS: {
|
|
2
|
+
readonly FE_DATE: "dd-MM-yyyy";
|
|
2
3
|
readonly ISO_DATE: "yyyy-MM-dd";
|
|
3
4
|
readonly ISO_DATE_TIME_TZ: "yyyy-MM-dd'T'HH:mm";
|
|
4
5
|
readonly ISO_DATE_TIME_MINUTES: "yyyy-MM-dd HH:mm";
|
|
@@ -11,12 +12,14 @@ export declare const INTERVAL_UNIT: {
|
|
|
11
12
|
readonly MONTHS: "MONTHS";
|
|
12
13
|
};
|
|
13
14
|
export type INTERVAL_UNIT = (typeof INTERVAL_UNIT)[keyof typeof INTERVAL_UNIT];
|
|
14
|
-
export declare function
|
|
15
|
-
export declare function
|
|
16
|
-
export declare function
|
|
17
|
-
export declare function
|
|
18
|
-
export declare function
|
|
19
|
-
export declare function
|
|
15
|
+
export declare function dateToString_back(date?: Date | string | undefined | null, formatString?: string): string;
|
|
16
|
+
export declare function dateToString(date: Date | string | undefined | null, formatString?: string): string | undefined;
|
|
17
|
+
export declare function toDate(date: Date | string | undefined | null): Date | undefined;
|
|
18
|
+
export declare function dateToYYYYMMDD(date?: Date | undefined | null): string | undefined;
|
|
19
|
+
export declare function dateToTZ(date?: Date | undefined | null): string | undefined;
|
|
20
|
+
export declare function dateToMinutes(date?: Date | undefined | null): string | undefined;
|
|
21
|
+
export declare function dateToMinutesSeconds(date?: Date | undefined | null): string | undefined;
|
|
22
|
+
export declare function getCurrentDateCompacted(): string | undefined;
|
|
20
23
|
export declare function isDateString(value: string): boolean;
|
|
21
24
|
export declare function stringToDate(value: string): Date;
|
|
22
25
|
export declare function formatDateString(value: string, formatString?: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateUtil.d.ts","sourceRoot":"","sources":["../../src/util/dateUtil.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"dateUtil.d.ts","sourceRoot":"","sources":["../../src/util/dateUtil.ts"],"names":[],"mappings":"AAEA,eAAO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.INTERVAL_UNIT = exports.FORMATS = void 0;
|
|
4
|
+
exports.dateToString_back = dateToString_back;
|
|
4
5
|
exports.dateToString = dateToString;
|
|
6
|
+
exports.toDate = toDate;
|
|
5
7
|
exports.dateToYYYYMMDD = dateToYYYYMMDD;
|
|
6
8
|
exports.dateToTZ = dateToTZ;
|
|
7
9
|
exports.dateToMinutes = dateToMinutes;
|
|
@@ -23,6 +25,7 @@ exports.addPeriodToDate = addPeriodToDate;
|
|
|
23
25
|
exports.formatDateForUi = formatDateForUi;
|
|
24
26
|
const date_fns_1 = require("date-fns");
|
|
25
27
|
exports.FORMATS = {
|
|
28
|
+
FE_DATE: 'dd-MM-yyyy', // "07-01-2023"
|
|
26
29
|
ISO_DATE: 'yyyy-MM-dd', // "2026-01-07"
|
|
27
30
|
ISO_DATE_TIME_TZ: "yyyy-MM-dd'T'HH:mm", // "2026-01-07T14:30"
|
|
28
31
|
ISO_DATE_TIME_MINUTES: 'yyyy-MM-dd HH:mm', // "2026-01-07 14:30
|
|
@@ -37,12 +40,44 @@ exports.INTERVAL_UNIT = {
|
|
|
37
40
|
// ============================================
|
|
38
41
|
// Date → String formatted conversions
|
|
39
42
|
// ============================================
|
|
40
|
-
function
|
|
43
|
+
function dateToString_back(date, formatString = exports.FORMATS.ISO_DATE) {
|
|
41
44
|
if (!date || !(0, date_fns_1.isValid)(date)) {
|
|
42
45
|
return undefined;
|
|
43
46
|
}
|
|
44
47
|
return (0, date_fns_1.format)(date, formatString);
|
|
45
48
|
}
|
|
49
|
+
function dateToString(date, formatString = exports.FORMATS.ISO_DATE) {
|
|
50
|
+
if (!date) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
const parsedDate = typeof date === 'string' ? new Date(date) : date;
|
|
55
|
+
if (!(0, date_fns_1.isValid)(parsedDate)) {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
return (0, date_fns_1.format)(parsedDate, formatString);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
console.error('Date formatting error:', error);
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function toDate(date) {
|
|
66
|
+
if (!date) {
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
const parsedDate = typeof date === 'string' ? new Date(date) : date;
|
|
71
|
+
if (!(0, date_fns_1.isValid)(parsedDate)) {
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
return parsedDate;
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
console.error('Date parsing error:', error);
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
46
81
|
function dateToYYYYMMDD(date) {
|
|
47
82
|
return dateToString(date, exports.FORMATS.COMPACT_DATETIME);
|
|
48
83
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare function normalizeString(value: string | undefined | null): string | undefined;
|
|
2
2
|
export declare function normalizeDate(value: Date | undefined | null): Date | undefined;
|
|
3
3
|
export declare function normalizeNumber(value: string | undefined | null): number | undefined;
|
|
4
|
-
export declare function normalizeDateToString(value: Date | string | undefined | null, formatString?: string): string;
|
|
4
|
+
export declare function normalizeDateToString(value: Date | string | undefined | null, formatString?: string): string | undefined;
|
|
5
5
|
//# sourceMappingURL=normalizeUtil.d.ts.map
|
|
@@ -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,CAKpF;
|
|
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,CAKpF;AAGD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAoBxH"}
|
package/package.json
CHANGED
package/src/util/dateUtil.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { addDays, addMonths, format, isValid, parseISO, subDays } from 'date-fns';
|
|
2
2
|
|
|
3
3
|
export const FORMATS = {
|
|
4
|
+
FE_DATE: 'dd-MM-yyyy', // "07-01-2023"
|
|
4
5
|
ISO_DATE: 'yyyy-MM-dd', // "2026-01-07"
|
|
5
6
|
ISO_DATE_TIME_TZ: "yyyy-MM-dd'T'HH:mm", // "2026-01-07T14:30"
|
|
6
7
|
ISO_DATE_TIME_MINUTES: 'yyyy-MM-dd HH:mm', // "2026-01-07 14:30
|
|
@@ -18,30 +19,62 @@ export type INTERVAL_UNIT = (typeof INTERVAL_UNIT)[keyof typeof INTERVAL_UNIT];
|
|
|
18
19
|
// ============================================
|
|
19
20
|
// Date → String formatted conversions
|
|
20
21
|
// ============================================
|
|
21
|
-
export function
|
|
22
|
+
export function dateToString_back(date?: Date | string | undefined | null, formatString: string = FORMATS.ISO_DATE): string {
|
|
22
23
|
if (!date || !isValid(date)) {
|
|
23
24
|
return undefined!;
|
|
24
25
|
}
|
|
25
26
|
return format(date, formatString);
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
export function
|
|
29
|
+
export function dateToString(date: Date | string | undefined | null, formatString: string = FORMATS.ISO_DATE): string | undefined {
|
|
30
|
+
if (!date) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
const parsedDate = typeof date === 'string' ? new Date(date) : date;
|
|
35
|
+
if (!isValid(parsedDate)) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
return format(parsedDate, formatString);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.error('Date formatting error:', error);
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function toDate(date: Date | string | undefined | null): Date | undefined {
|
|
46
|
+
if (!date) {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
const parsedDate = typeof date === 'string' ? new Date(date) : date;
|
|
51
|
+
if (!isValid(parsedDate)) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
return parsedDate;
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.error('Date parsing error:', error);
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function dateToYYYYMMDD(date?: Date | undefined | null): string | undefined {
|
|
29
62
|
return dateToString(date, FORMATS.COMPACT_DATETIME);
|
|
30
63
|
}
|
|
31
64
|
|
|
32
|
-
export function dateToTZ(date?: Date | undefined | null): string {
|
|
65
|
+
export function dateToTZ(date?: Date | undefined | null): string | undefined {
|
|
33
66
|
return dateToString(date, FORMATS.ISO_DATE_TIME_TZ);
|
|
34
67
|
}
|
|
35
68
|
|
|
36
|
-
export function dateToMinutes(date?: Date | undefined | null): string {
|
|
69
|
+
export function dateToMinutes(date?: Date | undefined | null): string | undefined {
|
|
37
70
|
return dateToString(date, FORMATS.ISO_DATE_TIME_MINUTES);
|
|
38
71
|
}
|
|
39
72
|
|
|
40
|
-
export function dateToMinutesSeconds(date?: Date | undefined | null): string {
|
|
73
|
+
export function dateToMinutesSeconds(date?: Date | undefined | null): string | undefined {
|
|
41
74
|
return dateToString(date, FORMATS.ISO_DATE_TIME_SECONDS);
|
|
42
75
|
}
|
|
43
76
|
|
|
44
|
-
export function getCurrentDateCompacted(): string {
|
|
77
|
+
export function getCurrentDateCompacted(): string | undefined {
|
|
45
78
|
return dateToYYYYMMDD(new Date()); // "20260107143000"
|
|
46
79
|
}
|
|
47
80
|
|
|
@@ -16,18 +16,17 @@ export function normalizeNumber(value: string | undefined | null): number | unde
|
|
|
16
16
|
return undefined
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
//TODO Ermal/ Musa why we need this?
|
|
20
|
+
export function normalizeDateToString(value: Date | string | undefined | null, formatString?: string): string | undefined {
|
|
20
21
|
if (!value) {
|
|
21
22
|
return ''
|
|
22
23
|
}
|
|
23
|
-
|
|
24
24
|
if (value instanceof Date) {
|
|
25
25
|
if (!isValid(value)) {
|
|
26
26
|
return ''
|
|
27
27
|
}
|
|
28
28
|
return dateToString(value, formatString)
|
|
29
29
|
}
|
|
30
|
-
|
|
31
30
|
// If it's already a string, try to parse it as a Date
|
|
32
31
|
if (typeof value === 'string') {
|
|
33
32
|
const date = new Date(value)
|
|
@@ -37,6 +36,5 @@ export function normalizeDateToString(value: Date | string | undefined | null, f
|
|
|
37
36
|
// If parsing fails, return the string as-is (assuming it's already formatted)
|
|
38
37
|
return value
|
|
39
38
|
}
|
|
40
|
-
|
|
41
39
|
return ''
|
|
42
40
|
}
|