@managesome/eposmatic-toolkit 0.2.543 → 0.2.544
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/lib/helpers/utils/tenant-day-sessions-helpers.d.ts +4 -0
- package/lib/helpers/utils/tenant-day-sessions-helpers.js +43 -0
- package/lib/helpers/utils/tenant-instore-shift-sessions-helpers.d.ts +4 -0
- package/lib/helpers/utils/tenant-instore-shift-sessions-helpers.js +58 -0
- package/package.json +1 -1
|
@@ -3,3 +3,7 @@ import { ITenantDaySession } from '../../schemas';
|
|
|
3
3
|
* Converts all monetary fields on a day session from cents to dollars.
|
|
4
4
|
*/
|
|
5
5
|
export declare function getTenantDaySessionFromCents<T extends Partial<ITenantDaySession> | ITenantDaySession>(session: T): T;
|
|
6
|
+
/**
|
|
7
|
+
* Converts all monetary fields on a day session from dollars to cents.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getTenantDaySessionWithCents<T extends Partial<ITenantDaySession> | ITenantDaySession>(session: T): T;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTenantDaySessionFromCents = getTenantDaySessionFromCents;
|
|
4
|
+
exports.getTenantDaySessionWithCents = getTenantDaySessionWithCents;
|
|
4
5
|
const price_conversion_1 = require("./price-conversion");
|
|
5
6
|
/**
|
|
6
7
|
* Converts all monetary fields on a day session from cents to dollars.
|
|
@@ -44,3 +45,45 @@ function getTenantDaySessionFromCents(session) {
|
|
|
44
45
|
: {}),
|
|
45
46
|
};
|
|
46
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Converts all monetary fields on a day session from dollars to cents.
|
|
50
|
+
*/
|
|
51
|
+
function getTenantDaySessionWithCents(session) {
|
|
52
|
+
return {
|
|
53
|
+
...session,
|
|
54
|
+
...(session.opening != null
|
|
55
|
+
? {
|
|
56
|
+
opening: {
|
|
57
|
+
...session.opening,
|
|
58
|
+
...(typeof session.opening.cash_amount === 'number'
|
|
59
|
+
? {
|
|
60
|
+
cash_amount: (0, price_conversion_1.convertPriceToCents)(session.opening.cash_amount),
|
|
61
|
+
}
|
|
62
|
+
: {}),
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
: {}),
|
|
66
|
+
...(session.closing != null
|
|
67
|
+
? {
|
|
68
|
+
closing: {
|
|
69
|
+
...session.closing,
|
|
70
|
+
...(typeof session.closing.cash_amount === 'number'
|
|
71
|
+
? {
|
|
72
|
+
cash_amount: (0, price_conversion_1.convertPriceToCents)(session.closing.cash_amount),
|
|
73
|
+
}
|
|
74
|
+
: {}),
|
|
75
|
+
...(typeof session.closing.expected_cash_amount === 'number'
|
|
76
|
+
? {
|
|
77
|
+
expected_cash_amount: (0, price_conversion_1.convertPriceToCents)(session.closing.expected_cash_amount),
|
|
78
|
+
}
|
|
79
|
+
: {}),
|
|
80
|
+
...(typeof session.closing.difference === 'number'
|
|
81
|
+
? {
|
|
82
|
+
difference: (0, price_conversion_1.convertPriceToCents)(session.closing.difference),
|
|
83
|
+
}
|
|
84
|
+
: {}),
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
: {}),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
@@ -3,3 +3,7 @@ import { ITenantInstoreShiftSession } from '../../schemas';
|
|
|
3
3
|
* Converts all monetary fields on an instore shift session from cents to dollars.
|
|
4
4
|
*/
|
|
5
5
|
export declare function getTenantInstoreShiftSessionFromCents<T extends Partial<ITenantInstoreShiftSession> | ITenantInstoreShiftSession>(session: T): T;
|
|
6
|
+
/**
|
|
7
|
+
* Converts all monetary fields on an instore shift session from dollars to cents.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getTenantInstoreShiftSessionWithCents<T extends Partial<ITenantInstoreShiftSession> | ITenantInstoreShiftSession>(session: T): T;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTenantInstoreShiftSessionFromCents = getTenantInstoreShiftSessionFromCents;
|
|
4
|
+
exports.getTenantInstoreShiftSessionWithCents = getTenantInstoreShiftSessionWithCents;
|
|
4
5
|
const price_conversion_1 = require("./price-conversion");
|
|
5
6
|
/**
|
|
6
7
|
* Converts all monetary fields on an instore shift session from cents to dollars.
|
|
@@ -59,3 +60,60 @@ function getTenantInstoreShiftSessionFromCents(session) {
|
|
|
59
60
|
: {}),
|
|
60
61
|
};
|
|
61
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Converts all monetary fields on an instore shift session from dollars to cents.
|
|
65
|
+
*/
|
|
66
|
+
function getTenantInstoreShiftSessionWithCents(session) {
|
|
67
|
+
return {
|
|
68
|
+
...session,
|
|
69
|
+
...(session.opening != null
|
|
70
|
+
? {
|
|
71
|
+
opening: {
|
|
72
|
+
...session.opening,
|
|
73
|
+
...(typeof session.opening.cash_amount === 'number'
|
|
74
|
+
? {
|
|
75
|
+
cash_amount: (0, price_conversion_1.convertPriceToCents)(session.opening.cash_amount),
|
|
76
|
+
}
|
|
77
|
+
: {}),
|
|
78
|
+
},
|
|
79
|
+
}
|
|
80
|
+
: {}),
|
|
81
|
+
...(session.closing != null
|
|
82
|
+
? {
|
|
83
|
+
closing: {
|
|
84
|
+
...session.closing,
|
|
85
|
+
...(typeof session.closing.cash_amount === 'number'
|
|
86
|
+
? {
|
|
87
|
+
cash_amount: (0, price_conversion_1.convertPriceToCents)(session.closing.cash_amount),
|
|
88
|
+
}
|
|
89
|
+
: {}),
|
|
90
|
+
},
|
|
91
|
+
}
|
|
92
|
+
: {}),
|
|
93
|
+
...(typeof session.cash_in_total === 'number'
|
|
94
|
+
? {
|
|
95
|
+
cash_in_total: (0, price_conversion_1.convertPriceToCents)(session.cash_in_total),
|
|
96
|
+
}
|
|
97
|
+
: {}),
|
|
98
|
+
...(typeof session.cash_out_total === 'number'
|
|
99
|
+
? {
|
|
100
|
+
cash_out_total: (0, price_conversion_1.convertPriceToCents)(session.cash_out_total),
|
|
101
|
+
}
|
|
102
|
+
: {}),
|
|
103
|
+
...(typeof session.expected_drawer_total === 'number'
|
|
104
|
+
? {
|
|
105
|
+
expected_drawer_total: (0, price_conversion_1.convertPriceToCents)(session.expected_drawer_total),
|
|
106
|
+
}
|
|
107
|
+
: {}),
|
|
108
|
+
...(typeof session.actual_drawer_total === 'number'
|
|
109
|
+
? {
|
|
110
|
+
actual_drawer_total: (0, price_conversion_1.convertPriceToCents)(session.actual_drawer_total),
|
|
111
|
+
}
|
|
112
|
+
: {}),
|
|
113
|
+
...(typeof session.difference === 'number'
|
|
114
|
+
? {
|
|
115
|
+
difference: (0, price_conversion_1.convertPriceToCents)(session.difference),
|
|
116
|
+
}
|
|
117
|
+
: {}),
|
|
118
|
+
};
|
|
119
|
+
}
|