@managesome/eposmatic-toolkit 0.2.541 → 0.2.543
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/index.d.ts +2 -0
- package/lib/helpers/utils/index.js +2 -0
- package/lib/helpers/utils/tenant-day-sessions-helpers.d.ts +5 -0
- package/lib/helpers/utils/tenant-day-sessions-helpers.js +46 -0
- package/lib/helpers/utils/tenant-instore-shift-sessions-helpers.d.ts +5 -0
- package/lib/helpers/utils/tenant-instore-shift-sessions-helpers.js +61 -0
- package/lib/schemas/models/index.d.ts +1 -1
- package/lib/schemas/models/index.js +1 -1
- package/lib/schemas/models/tenant_cash_drawer_sessions.d.ts +21 -21
- package/lib/schemas/models/tenant_cash_in_out.d.ts +9 -9
- package/lib/schemas/models/{tenant_days.d.ts → tenant_day_sessions.d.ts} +40 -40
- package/lib/schemas/models/{tenant_days.js → tenant_day_sessions.js} +7 -7
- package/lib/schemas/models/tenant_instore_shift_sessions.d.ts +48 -48
- package/lib/schemas/types/index.d.ts +1 -1
- package/lib/schemas/types/index.js +1 -1
- package/lib/schemas/types/{tenant_days.d.ts → tenant_day_sessions.d.ts} +5 -5
- package/package.json +1 -1
- /package/lib/schemas/types/{tenant_days.js → tenant_day_sessions.js} +0 -0
|
@@ -56,6 +56,8 @@ export * from './simplified-catalog';
|
|
|
56
56
|
export * from './simplified-tenant';
|
|
57
57
|
export * from './specials-helpers';
|
|
58
58
|
export * from './tenant_cash_in_hand_transactions';
|
|
59
|
+
export * from './tenant-day-sessions-helpers';
|
|
60
|
+
export * from './tenant-instore-shift-sessions-helpers';
|
|
59
61
|
export * from './tenant-staff-helpers';
|
|
60
62
|
export * from './time-helpers';
|
|
61
63
|
export * from './void-items-report-helpers';
|
|
@@ -72,6 +72,8 @@ __exportStar(require("./simplified-catalog"), exports);
|
|
|
72
72
|
__exportStar(require("./simplified-tenant"), exports);
|
|
73
73
|
__exportStar(require("./specials-helpers"), exports);
|
|
74
74
|
__exportStar(require("./tenant_cash_in_hand_transactions"), exports);
|
|
75
|
+
__exportStar(require("./tenant-day-sessions-helpers"), exports);
|
|
76
|
+
__exportStar(require("./tenant-instore-shift-sessions-helpers"), exports);
|
|
75
77
|
__exportStar(require("./tenant-staff-helpers"), exports);
|
|
76
78
|
__exportStar(require("./time-helpers"), exports);
|
|
77
79
|
__exportStar(require("./void-items-report-helpers"), exports);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTenantDaySessionFromCents = getTenantDaySessionFromCents;
|
|
4
|
+
const price_conversion_1 = require("./price-conversion");
|
|
5
|
+
/**
|
|
6
|
+
* Converts all monetary fields on a day session from cents to dollars.
|
|
7
|
+
*/
|
|
8
|
+
function getTenantDaySessionFromCents(session) {
|
|
9
|
+
return {
|
|
10
|
+
...session,
|
|
11
|
+
...(session.opening != null
|
|
12
|
+
? {
|
|
13
|
+
opening: {
|
|
14
|
+
...session.opening,
|
|
15
|
+
...(typeof session.opening.cash_amount === 'number'
|
|
16
|
+
? {
|
|
17
|
+
cash_amount: (0, price_conversion_1.convertPriceFromCents)(session.opening.cash_amount),
|
|
18
|
+
}
|
|
19
|
+
: {}),
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
: {}),
|
|
23
|
+
...(session.closing != null
|
|
24
|
+
? {
|
|
25
|
+
closing: {
|
|
26
|
+
...session.closing,
|
|
27
|
+
...(typeof session.closing.cash_amount === 'number'
|
|
28
|
+
? {
|
|
29
|
+
cash_amount: (0, price_conversion_1.convertPriceFromCents)(session.closing.cash_amount),
|
|
30
|
+
}
|
|
31
|
+
: {}),
|
|
32
|
+
...(typeof session.closing.expected_cash_amount === 'number'
|
|
33
|
+
? {
|
|
34
|
+
expected_cash_amount: (0, price_conversion_1.convertPriceFromCents)(session.closing.expected_cash_amount),
|
|
35
|
+
}
|
|
36
|
+
: {}),
|
|
37
|
+
...(typeof session.closing.difference === 'number'
|
|
38
|
+
? {
|
|
39
|
+
difference: (0, price_conversion_1.convertPriceFromCents)(session.closing.difference),
|
|
40
|
+
}
|
|
41
|
+
: {}),
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
: {}),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ITenantInstoreShiftSession } from '../../schemas';
|
|
2
|
+
/**
|
|
3
|
+
* Converts all monetary fields on an instore shift session from cents to dollars.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getTenantInstoreShiftSessionFromCents<T extends Partial<ITenantInstoreShiftSession> | ITenantInstoreShiftSession>(session: T): T;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTenantInstoreShiftSessionFromCents = getTenantInstoreShiftSessionFromCents;
|
|
4
|
+
const price_conversion_1 = require("./price-conversion");
|
|
5
|
+
/**
|
|
6
|
+
* Converts all monetary fields on an instore shift session from cents to dollars.
|
|
7
|
+
*/
|
|
8
|
+
function getTenantInstoreShiftSessionFromCents(session) {
|
|
9
|
+
return {
|
|
10
|
+
...session,
|
|
11
|
+
...(session.opening != null
|
|
12
|
+
? {
|
|
13
|
+
opening: {
|
|
14
|
+
...session.opening,
|
|
15
|
+
...(typeof session.opening.cash_amount === 'number'
|
|
16
|
+
? {
|
|
17
|
+
cash_amount: (0, price_conversion_1.convertPriceFromCents)(session.opening.cash_amount),
|
|
18
|
+
}
|
|
19
|
+
: {}),
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
: {}),
|
|
23
|
+
...(session.closing != null
|
|
24
|
+
? {
|
|
25
|
+
closing: {
|
|
26
|
+
...session.closing,
|
|
27
|
+
...(typeof session.closing.cash_amount === 'number'
|
|
28
|
+
? {
|
|
29
|
+
cash_amount: (0, price_conversion_1.convertPriceFromCents)(session.closing.cash_amount),
|
|
30
|
+
}
|
|
31
|
+
: {}),
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
: {}),
|
|
35
|
+
...(typeof session.cash_in_total === 'number'
|
|
36
|
+
? {
|
|
37
|
+
cash_in_total: (0, price_conversion_1.convertPriceFromCents)(session.cash_in_total),
|
|
38
|
+
}
|
|
39
|
+
: {}),
|
|
40
|
+
...(typeof session.cash_out_total === 'number'
|
|
41
|
+
? {
|
|
42
|
+
cash_out_total: (0, price_conversion_1.convertPriceFromCents)(session.cash_out_total),
|
|
43
|
+
}
|
|
44
|
+
: {}),
|
|
45
|
+
...(typeof session.expected_drawer_total === 'number'
|
|
46
|
+
? {
|
|
47
|
+
expected_drawer_total: (0, price_conversion_1.convertPriceFromCents)(session.expected_drawer_total),
|
|
48
|
+
}
|
|
49
|
+
: {}),
|
|
50
|
+
...(typeof session.actual_drawer_total === 'number'
|
|
51
|
+
? {
|
|
52
|
+
actual_drawer_total: (0, price_conversion_1.convertPriceFromCents)(session.actual_drawer_total),
|
|
53
|
+
}
|
|
54
|
+
: {}),
|
|
55
|
+
...(typeof session.difference === 'number'
|
|
56
|
+
? {
|
|
57
|
+
difference: (0, price_conversion_1.convertPriceFromCents)(session.difference),
|
|
58
|
+
}
|
|
59
|
+
: {}),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -47,7 +47,7 @@ export * from './tenant_cash_drawer_sessions';
|
|
|
47
47
|
export * from './tenant_cash_drawers';
|
|
48
48
|
export * from './tenant_cash_in_hand_transactions';
|
|
49
49
|
export * from './tenant_cash_in_out';
|
|
50
|
-
export * from './
|
|
50
|
+
export * from './tenant_day_sessions';
|
|
51
51
|
export * from './tenant_instore_shift_sessions';
|
|
52
52
|
export * from './tenant_instore_shifts';
|
|
53
53
|
export * from './tenant_inventory_department_transactions';
|
|
@@ -63,7 +63,7 @@ __exportStar(require("./tenant_cash_drawer_sessions"), exports);
|
|
|
63
63
|
__exportStar(require("./tenant_cash_drawers"), exports);
|
|
64
64
|
__exportStar(require("./tenant_cash_in_hand_transactions"), exports);
|
|
65
65
|
__exportStar(require("./tenant_cash_in_out"), exports);
|
|
66
|
-
__exportStar(require("./
|
|
66
|
+
__exportStar(require("./tenant_day_sessions"), exports);
|
|
67
67
|
__exportStar(require("./tenant_instore_shift_sessions"), exports);
|
|
68
68
|
__exportStar(require("./tenant_instore_shifts"), exports);
|
|
69
69
|
__exportStar(require("./tenant_inventory_department_transactions"), exports);
|
|
@@ -14,13 +14,6 @@ export declare const TenantCashDrawerSessionsSchema: Schema<any, import("mongoos
|
|
|
14
14
|
createdAt: NativeDate;
|
|
15
15
|
updatedAt: NativeDate;
|
|
16
16
|
status: import("../../constants").CASH_DRAWER_STATUS_ENUM;
|
|
17
|
-
shift_id: import("mongoose").Types.ObjectId;
|
|
18
|
-
drawer_id: import("mongoose").Types.ObjectId;
|
|
19
|
-
drawer_name: string;
|
|
20
|
-
denominations: Map<string, number>;
|
|
21
|
-
balance: number;
|
|
22
|
-
expected_balance: number;
|
|
23
|
-
variance: number;
|
|
24
17
|
day_index: import("../../constants").DAY_INDEX_ENUM;
|
|
25
18
|
localSecond: number;
|
|
26
19
|
localMinute: number;
|
|
@@ -35,6 +28,13 @@ export declare const TenantCashDrawerSessionsSchema: Schema<any, import("mongoos
|
|
|
35
28
|
localDate: string;
|
|
36
29
|
localTime: string;
|
|
37
30
|
localDayOfYear: number;
|
|
31
|
+
shift_id: import("mongoose").Types.ObjectId;
|
|
32
|
+
drawer_id: import("mongoose").Types.ObjectId;
|
|
33
|
+
drawer_name: string;
|
|
34
|
+
denominations: Map<string, number>;
|
|
35
|
+
balance: number;
|
|
36
|
+
expected_balance: number;
|
|
37
|
+
variance: number;
|
|
38
38
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
39
39
|
createdAt: NativeDate;
|
|
40
40
|
updatedAt: NativeDate;
|
|
@@ -46,13 +46,6 @@ export declare const TenantCashDrawerSessionsSchema: Schema<any, import("mongoos
|
|
|
46
46
|
createdAt: NativeDate;
|
|
47
47
|
updatedAt: NativeDate;
|
|
48
48
|
status: import("../../constants").CASH_DRAWER_STATUS_ENUM;
|
|
49
|
-
shift_id: import("mongoose").Types.ObjectId;
|
|
50
|
-
drawer_id: import("mongoose").Types.ObjectId;
|
|
51
|
-
drawer_name: string;
|
|
52
|
-
denominations: Map<string, number>;
|
|
53
|
-
balance: number;
|
|
54
|
-
expected_balance: number;
|
|
55
|
-
variance: number;
|
|
56
49
|
day_index: import("../../constants").DAY_INDEX_ENUM;
|
|
57
50
|
localSecond: number;
|
|
58
51
|
localMinute: number;
|
|
@@ -67,6 +60,13 @@ export declare const TenantCashDrawerSessionsSchema: Schema<any, import("mongoos
|
|
|
67
60
|
localDate: string;
|
|
68
61
|
localTime: string;
|
|
69
62
|
localDayOfYear: number;
|
|
63
|
+
shift_id: import("mongoose").Types.ObjectId;
|
|
64
|
+
drawer_id: import("mongoose").Types.ObjectId;
|
|
65
|
+
drawer_name: string;
|
|
66
|
+
denominations: Map<string, number>;
|
|
67
|
+
balance: number;
|
|
68
|
+
expected_balance: number;
|
|
69
|
+
variance: number;
|
|
70
70
|
}>> & import("mongoose").FlatRecord<{
|
|
71
71
|
createdAt: NativeDate;
|
|
72
72
|
updatedAt: NativeDate;
|
|
@@ -78,13 +78,6 @@ export declare const TenantCashDrawerSessionsSchema: Schema<any, import("mongoos
|
|
|
78
78
|
createdAt: NativeDate;
|
|
79
79
|
updatedAt: NativeDate;
|
|
80
80
|
status: import("../../constants").CASH_DRAWER_STATUS_ENUM;
|
|
81
|
-
shift_id: import("mongoose").Types.ObjectId;
|
|
82
|
-
drawer_id: import("mongoose").Types.ObjectId;
|
|
83
|
-
drawer_name: string;
|
|
84
|
-
denominations: Map<string, number>;
|
|
85
|
-
balance: number;
|
|
86
|
-
expected_balance: number;
|
|
87
|
-
variance: number;
|
|
88
81
|
day_index: import("../../constants").DAY_INDEX_ENUM;
|
|
89
82
|
localSecond: number;
|
|
90
83
|
localMinute: number;
|
|
@@ -99,6 +92,13 @@ export declare const TenantCashDrawerSessionsSchema: Schema<any, import("mongoos
|
|
|
99
92
|
localDate: string;
|
|
100
93
|
localTime: string;
|
|
101
94
|
localDayOfYear: number;
|
|
95
|
+
shift_id: import("mongoose").Types.ObjectId;
|
|
96
|
+
drawer_id: import("mongoose").Types.ObjectId;
|
|
97
|
+
drawer_name: string;
|
|
98
|
+
denominations: Map<string, number>;
|
|
99
|
+
balance: number;
|
|
100
|
+
expected_balance: number;
|
|
101
|
+
variance: number;
|
|
102
102
|
}> & Required<{
|
|
103
103
|
_id: import("mongoose").Types.ObjectId;
|
|
104
104
|
}> & {
|
|
@@ -16,8 +16,6 @@ export declare const TenantCashInOutSchema: Schema<any, import("mongoose").Model
|
|
|
16
16
|
updatedAt: NativeDate;
|
|
17
17
|
note: string;
|
|
18
18
|
amount: number;
|
|
19
|
-
shift_id: string;
|
|
20
|
-
drawer_id: string;
|
|
21
19
|
day_index: import("../../constants").DAY_INDEX_ENUM;
|
|
22
20
|
localSecond: number;
|
|
23
21
|
localMinute: number;
|
|
@@ -32,8 +30,10 @@ export declare const TenantCashInOutSchema: Schema<any, import("mongoose").Model
|
|
|
32
30
|
localDate: string;
|
|
33
31
|
localTime: string;
|
|
34
32
|
localDayOfYear: number;
|
|
35
|
-
|
|
33
|
+
shift_id: string;
|
|
36
34
|
shift_number: number;
|
|
35
|
+
drawer_id: string;
|
|
36
|
+
expense_id: string;
|
|
37
37
|
drawer_balance_before: number;
|
|
38
38
|
drawer_balance_after: number;
|
|
39
39
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
@@ -49,8 +49,6 @@ export declare const TenantCashInOutSchema: Schema<any, import("mongoose").Model
|
|
|
49
49
|
updatedAt: NativeDate;
|
|
50
50
|
note: string;
|
|
51
51
|
amount: number;
|
|
52
|
-
shift_id: string;
|
|
53
|
-
drawer_id: string;
|
|
54
52
|
day_index: import("../../constants").DAY_INDEX_ENUM;
|
|
55
53
|
localSecond: number;
|
|
56
54
|
localMinute: number;
|
|
@@ -65,8 +63,10 @@ export declare const TenantCashInOutSchema: Schema<any, import("mongoose").Model
|
|
|
65
63
|
localDate: string;
|
|
66
64
|
localTime: string;
|
|
67
65
|
localDayOfYear: number;
|
|
68
|
-
|
|
66
|
+
shift_id: string;
|
|
69
67
|
shift_number: number;
|
|
68
|
+
drawer_id: string;
|
|
69
|
+
expense_id: string;
|
|
70
70
|
drawer_balance_before: number;
|
|
71
71
|
drawer_balance_after: number;
|
|
72
72
|
}>> & import("mongoose").FlatRecord<{
|
|
@@ -82,8 +82,6 @@ export declare const TenantCashInOutSchema: Schema<any, import("mongoose").Model
|
|
|
82
82
|
updatedAt: NativeDate;
|
|
83
83
|
note: string;
|
|
84
84
|
amount: number;
|
|
85
|
-
shift_id: string;
|
|
86
|
-
drawer_id: string;
|
|
87
85
|
day_index: import("../../constants").DAY_INDEX_ENUM;
|
|
88
86
|
localSecond: number;
|
|
89
87
|
localMinute: number;
|
|
@@ -98,8 +96,10 @@ export declare const TenantCashInOutSchema: Schema<any, import("mongoose").Model
|
|
|
98
96
|
localDate: string;
|
|
99
97
|
localTime: string;
|
|
100
98
|
localDayOfYear: number;
|
|
101
|
-
|
|
99
|
+
shift_id: string;
|
|
102
100
|
shift_number: number;
|
|
101
|
+
drawer_id: string;
|
|
102
|
+
expense_id: string;
|
|
103
103
|
drawer_balance_before: number;
|
|
104
104
|
drawer_balance_after: number;
|
|
105
105
|
}> & Required<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from 'mongoose';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const TenantDaySessionSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
3
3
|
timestamps: true;
|
|
4
4
|
versionKey: false;
|
|
5
5
|
minimize: false;
|
|
@@ -12,47 +12,24 @@ export declare const TenantDaySchema: Schema<any, import("mongoose").Model<any,
|
|
|
12
12
|
createdAt: NativeDate;
|
|
13
13
|
updatedAt: NativeDate;
|
|
14
14
|
status: import("../../constants").POS_DAY_STATUS_ENUM;
|
|
15
|
-
day_index: import("../../constants").DAY_INDEX_ENUM;
|
|
16
|
-
localSecond: number;
|
|
17
|
-
localMinute: number;
|
|
18
|
-
localHour: number;
|
|
19
|
-
localDay: number;
|
|
20
|
-
localWeek: number;
|
|
21
|
-
localWeekOfYear: number;
|
|
22
|
-
localMonth: number;
|
|
23
|
-
localQuarter: number;
|
|
24
|
-
localSemester: number;
|
|
25
|
-
localYear: number;
|
|
26
|
-
localDate: string;
|
|
27
|
-
localTime: string;
|
|
28
|
-
localDayOfYear: number;
|
|
29
15
|
opening: {
|
|
30
16
|
staff_id: string;
|
|
31
17
|
staff_name: string;
|
|
32
18
|
note: string;
|
|
33
|
-
opened_at: NativeDate;
|
|
34
19
|
cash_amount: number;
|
|
20
|
+
opened_at: NativeDate;
|
|
35
21
|
};
|
|
36
22
|
closing: {
|
|
37
23
|
staff_id: string;
|
|
38
24
|
staff_name: string;
|
|
39
25
|
note: string;
|
|
40
26
|
cash_amount: number;
|
|
41
|
-
closed_at: NativeDate;
|
|
42
27
|
expected_cash_amount: number;
|
|
43
28
|
difference: number;
|
|
29
|
+
closed_at: NativeDate;
|
|
44
30
|
cash_in_out_id: string;
|
|
45
31
|
};
|
|
46
32
|
total_shifts: number;
|
|
47
|
-
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
48
|
-
createdAt: NativeDate;
|
|
49
|
-
updatedAt: NativeDate;
|
|
50
|
-
} & {
|
|
51
|
-
_id: import("mongoose").Types.ObjectId;
|
|
52
|
-
tenant_id: string;
|
|
53
|
-
createdAt: NativeDate;
|
|
54
|
-
updatedAt: NativeDate;
|
|
55
|
-
status: import("../../constants").POS_DAY_STATUS_ENUM;
|
|
56
33
|
day_index: import("../../constants").DAY_INDEX_ENUM;
|
|
57
34
|
localSecond: number;
|
|
58
35
|
localMinute: number;
|
|
@@ -67,33 +44,33 @@ export declare const TenantDaySchema: Schema<any, import("mongoose").Model<any,
|
|
|
67
44
|
localDate: string;
|
|
68
45
|
localTime: string;
|
|
69
46
|
localDayOfYear: number;
|
|
47
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
48
|
+
createdAt: NativeDate;
|
|
49
|
+
updatedAt: NativeDate;
|
|
50
|
+
} & {
|
|
51
|
+
_id: import("mongoose").Types.ObjectId;
|
|
52
|
+
tenant_id: string;
|
|
53
|
+
createdAt: NativeDate;
|
|
54
|
+
updatedAt: NativeDate;
|
|
55
|
+
status: import("../../constants").POS_DAY_STATUS_ENUM;
|
|
70
56
|
opening: {
|
|
71
57
|
staff_id: string;
|
|
72
58
|
staff_name: string;
|
|
73
59
|
note: string;
|
|
74
|
-
opened_at: NativeDate;
|
|
75
60
|
cash_amount: number;
|
|
61
|
+
opened_at: NativeDate;
|
|
76
62
|
};
|
|
77
63
|
closing: {
|
|
78
64
|
staff_id: string;
|
|
79
65
|
staff_name: string;
|
|
80
66
|
note: string;
|
|
81
67
|
cash_amount: number;
|
|
82
|
-
closed_at: NativeDate;
|
|
83
68
|
expected_cash_amount: number;
|
|
84
69
|
difference: number;
|
|
70
|
+
closed_at: NativeDate;
|
|
85
71
|
cash_in_out_id: string;
|
|
86
72
|
};
|
|
87
73
|
total_shifts: number;
|
|
88
|
-
}>> & import("mongoose").FlatRecord<{
|
|
89
|
-
createdAt: NativeDate;
|
|
90
|
-
updatedAt: NativeDate;
|
|
91
|
-
} & {
|
|
92
|
-
_id: import("mongoose").Types.ObjectId;
|
|
93
|
-
tenant_id: string;
|
|
94
|
-
createdAt: NativeDate;
|
|
95
|
-
updatedAt: NativeDate;
|
|
96
|
-
status: import("../../constants").POS_DAY_STATUS_ENUM;
|
|
97
74
|
day_index: import("../../constants").DAY_INDEX_ENUM;
|
|
98
75
|
localSecond: number;
|
|
99
76
|
localMinute: number;
|
|
@@ -108,27 +85,50 @@ export declare const TenantDaySchema: Schema<any, import("mongoose").Model<any,
|
|
|
108
85
|
localDate: string;
|
|
109
86
|
localTime: string;
|
|
110
87
|
localDayOfYear: number;
|
|
88
|
+
}>> & import("mongoose").FlatRecord<{
|
|
89
|
+
createdAt: NativeDate;
|
|
90
|
+
updatedAt: NativeDate;
|
|
91
|
+
} & {
|
|
92
|
+
_id: import("mongoose").Types.ObjectId;
|
|
93
|
+
tenant_id: string;
|
|
94
|
+
createdAt: NativeDate;
|
|
95
|
+
updatedAt: NativeDate;
|
|
96
|
+
status: import("../../constants").POS_DAY_STATUS_ENUM;
|
|
111
97
|
opening: {
|
|
112
98
|
staff_id: string;
|
|
113
99
|
staff_name: string;
|
|
114
100
|
note: string;
|
|
115
|
-
opened_at: NativeDate;
|
|
116
101
|
cash_amount: number;
|
|
102
|
+
opened_at: NativeDate;
|
|
117
103
|
};
|
|
118
104
|
closing: {
|
|
119
105
|
staff_id: string;
|
|
120
106
|
staff_name: string;
|
|
121
107
|
note: string;
|
|
122
108
|
cash_amount: number;
|
|
123
|
-
closed_at: NativeDate;
|
|
124
109
|
expected_cash_amount: number;
|
|
125
110
|
difference: number;
|
|
111
|
+
closed_at: NativeDate;
|
|
126
112
|
cash_in_out_id: string;
|
|
127
113
|
};
|
|
128
114
|
total_shifts: number;
|
|
115
|
+
day_index: import("../../constants").DAY_INDEX_ENUM;
|
|
116
|
+
localSecond: number;
|
|
117
|
+
localMinute: number;
|
|
118
|
+
localHour: number;
|
|
119
|
+
localDay: number;
|
|
120
|
+
localWeek: number;
|
|
121
|
+
localWeekOfYear: number;
|
|
122
|
+
localMonth: number;
|
|
123
|
+
localQuarter: number;
|
|
124
|
+
localSemester: number;
|
|
125
|
+
localYear: number;
|
|
126
|
+
localDate: string;
|
|
127
|
+
localTime: string;
|
|
128
|
+
localDayOfYear: number;
|
|
129
129
|
}> & Required<{
|
|
130
130
|
_id: import("mongoose").Types.ObjectId;
|
|
131
131
|
}> & {
|
|
132
132
|
__v: number;
|
|
133
133
|
}>;
|
|
134
|
-
export declare const
|
|
134
|
+
export declare const TENANT_DAY_SESSIONS_COLLECTION_NAME = "tenant_day_sessions";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TENANT_DAY_SESSIONS_COLLECTION_NAME = exports.TenantDaySessionSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const constants_1 = require("../../constants");
|
|
6
6
|
const common_models_1 = require("./common-models");
|
|
7
|
-
const
|
|
7
|
+
const TenantDaySessionOpeningSchema = new mongoose_1.Schema({
|
|
8
8
|
staff_id: {
|
|
9
9
|
type: String,
|
|
10
10
|
required: true,
|
|
@@ -26,7 +26,7 @@ const TenantDayOpeningSchema = new mongoose_1.Schema({
|
|
|
26
26
|
required: true,
|
|
27
27
|
},
|
|
28
28
|
}, { _id: false, minimize: false });
|
|
29
|
-
const
|
|
29
|
+
const TenantDaySessionClosingSchema = new mongoose_1.Schema({
|
|
30
30
|
staff_id: {
|
|
31
31
|
type: String,
|
|
32
32
|
required: true,
|
|
@@ -60,7 +60,7 @@ const TenantDayClosingSchema = new mongoose_1.Schema({
|
|
|
60
60
|
default: null,
|
|
61
61
|
},
|
|
62
62
|
}, { _id: false, minimize: false });
|
|
63
|
-
exports.
|
|
63
|
+
exports.TenantDaySessionSchema = new mongoose_1.Schema({
|
|
64
64
|
_id: {
|
|
65
65
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
66
66
|
required: true,
|
|
@@ -78,11 +78,11 @@ exports.TenantDaySchema = new mongoose_1.Schema({
|
|
|
78
78
|
required: true,
|
|
79
79
|
},
|
|
80
80
|
opening: {
|
|
81
|
-
type:
|
|
81
|
+
type: TenantDaySessionOpeningSchema,
|
|
82
82
|
default: null,
|
|
83
83
|
},
|
|
84
84
|
closing: {
|
|
85
|
-
type:
|
|
85
|
+
type: TenantDaySessionClosingSchema,
|
|
86
86
|
default: null,
|
|
87
87
|
},
|
|
88
88
|
total_shifts: {
|
|
@@ -107,4 +107,4 @@ exports.TenantDaySchema = new mongoose_1.Schema({
|
|
|
107
107
|
versionKey: false,
|
|
108
108
|
minimize: false,
|
|
109
109
|
});
|
|
110
|
-
exports.
|
|
110
|
+
exports.TENANT_DAY_SESSIONS_COLLECTION_NAME = 'tenant_day_sessions';
|
|
@@ -12,7 +12,20 @@ export declare const TenantInstoreShiftSessionSchema: Schema<any, import("mongoo
|
|
|
12
12
|
createdAt: NativeDate;
|
|
13
13
|
updatedAt: NativeDate;
|
|
14
14
|
status: import("../../constants").POS_SHIFT_STATUS_ENUM;
|
|
15
|
-
|
|
15
|
+
opening: {
|
|
16
|
+
staff_id: string;
|
|
17
|
+
staff_name: string;
|
|
18
|
+
note: string;
|
|
19
|
+
cash_amount: number;
|
|
20
|
+
opened_at: NativeDate;
|
|
21
|
+
};
|
|
22
|
+
closing: {
|
|
23
|
+
staff_id: string;
|
|
24
|
+
staff_name: string;
|
|
25
|
+
note: string;
|
|
26
|
+
cash_amount: number;
|
|
27
|
+
closed_at: NativeDate;
|
|
28
|
+
};
|
|
16
29
|
day_index: import("../../constants").DAY_INDEX_ENUM;
|
|
17
30
|
localSecond: number;
|
|
18
31
|
localMinute: number;
|
|
@@ -27,23 +40,10 @@ export declare const TenantInstoreShiftSessionSchema: Schema<any, import("mongoo
|
|
|
27
40
|
localDate: string;
|
|
28
41
|
localTime: string;
|
|
29
42
|
localDayOfYear: number;
|
|
30
|
-
shift_number: number;
|
|
31
43
|
difference: number;
|
|
32
|
-
opening: {
|
|
33
|
-
staff_id: string;
|
|
34
|
-
staff_name: string;
|
|
35
|
-
note: string;
|
|
36
|
-
opened_at: NativeDate;
|
|
37
|
-
cash_amount: number;
|
|
38
|
-
};
|
|
39
|
-
closing: {
|
|
40
|
-
staff_id: string;
|
|
41
|
-
staff_name: string;
|
|
42
|
-
note: string;
|
|
43
|
-
cash_amount: number;
|
|
44
|
-
closed_at: NativeDate;
|
|
45
|
-
};
|
|
46
44
|
day_id: import("mongoose").Types.ObjectId;
|
|
45
|
+
shift_id: import("mongoose").Types.ObjectId;
|
|
46
|
+
shift_number: number;
|
|
47
47
|
cash_in_total: number;
|
|
48
48
|
cash_out_total: number;
|
|
49
49
|
expected_drawer_total: number;
|
|
@@ -57,7 +57,20 @@ export declare const TenantInstoreShiftSessionSchema: Schema<any, import("mongoo
|
|
|
57
57
|
createdAt: NativeDate;
|
|
58
58
|
updatedAt: NativeDate;
|
|
59
59
|
status: import("../../constants").POS_SHIFT_STATUS_ENUM;
|
|
60
|
-
|
|
60
|
+
opening: {
|
|
61
|
+
staff_id: string;
|
|
62
|
+
staff_name: string;
|
|
63
|
+
note: string;
|
|
64
|
+
cash_amount: number;
|
|
65
|
+
opened_at: NativeDate;
|
|
66
|
+
};
|
|
67
|
+
closing: {
|
|
68
|
+
staff_id: string;
|
|
69
|
+
staff_name: string;
|
|
70
|
+
note: string;
|
|
71
|
+
cash_amount: number;
|
|
72
|
+
closed_at: NativeDate;
|
|
73
|
+
};
|
|
61
74
|
day_index: import("../../constants").DAY_INDEX_ENUM;
|
|
62
75
|
localSecond: number;
|
|
63
76
|
localMinute: number;
|
|
@@ -72,23 +85,10 @@ export declare const TenantInstoreShiftSessionSchema: Schema<any, import("mongoo
|
|
|
72
85
|
localDate: string;
|
|
73
86
|
localTime: string;
|
|
74
87
|
localDayOfYear: number;
|
|
75
|
-
shift_number: number;
|
|
76
88
|
difference: number;
|
|
77
|
-
opening: {
|
|
78
|
-
staff_id: string;
|
|
79
|
-
staff_name: string;
|
|
80
|
-
note: string;
|
|
81
|
-
opened_at: NativeDate;
|
|
82
|
-
cash_amount: number;
|
|
83
|
-
};
|
|
84
|
-
closing: {
|
|
85
|
-
staff_id: string;
|
|
86
|
-
staff_name: string;
|
|
87
|
-
note: string;
|
|
88
|
-
cash_amount: number;
|
|
89
|
-
closed_at: NativeDate;
|
|
90
|
-
};
|
|
91
89
|
day_id: import("mongoose").Types.ObjectId;
|
|
90
|
+
shift_id: import("mongoose").Types.ObjectId;
|
|
91
|
+
shift_number: number;
|
|
92
92
|
cash_in_total: number;
|
|
93
93
|
cash_out_total: number;
|
|
94
94
|
expected_drawer_total: number;
|
|
@@ -102,7 +102,20 @@ export declare const TenantInstoreShiftSessionSchema: Schema<any, import("mongoo
|
|
|
102
102
|
createdAt: NativeDate;
|
|
103
103
|
updatedAt: NativeDate;
|
|
104
104
|
status: import("../../constants").POS_SHIFT_STATUS_ENUM;
|
|
105
|
-
|
|
105
|
+
opening: {
|
|
106
|
+
staff_id: string;
|
|
107
|
+
staff_name: string;
|
|
108
|
+
note: string;
|
|
109
|
+
cash_amount: number;
|
|
110
|
+
opened_at: NativeDate;
|
|
111
|
+
};
|
|
112
|
+
closing: {
|
|
113
|
+
staff_id: string;
|
|
114
|
+
staff_name: string;
|
|
115
|
+
note: string;
|
|
116
|
+
cash_amount: number;
|
|
117
|
+
closed_at: NativeDate;
|
|
118
|
+
};
|
|
106
119
|
day_index: import("../../constants").DAY_INDEX_ENUM;
|
|
107
120
|
localSecond: number;
|
|
108
121
|
localMinute: number;
|
|
@@ -117,23 +130,10 @@ export declare const TenantInstoreShiftSessionSchema: Schema<any, import("mongoo
|
|
|
117
130
|
localDate: string;
|
|
118
131
|
localTime: string;
|
|
119
132
|
localDayOfYear: number;
|
|
120
|
-
shift_number: number;
|
|
121
133
|
difference: number;
|
|
122
|
-
opening: {
|
|
123
|
-
staff_id: string;
|
|
124
|
-
staff_name: string;
|
|
125
|
-
note: string;
|
|
126
|
-
opened_at: NativeDate;
|
|
127
|
-
cash_amount: number;
|
|
128
|
-
};
|
|
129
|
-
closing: {
|
|
130
|
-
staff_id: string;
|
|
131
|
-
staff_name: string;
|
|
132
|
-
note: string;
|
|
133
|
-
cash_amount: number;
|
|
134
|
-
closed_at: NativeDate;
|
|
135
|
-
};
|
|
136
134
|
day_id: import("mongoose").Types.ObjectId;
|
|
135
|
+
shift_id: import("mongoose").Types.ObjectId;
|
|
136
|
+
shift_number: number;
|
|
137
137
|
cash_in_total: number;
|
|
138
138
|
cash_out_total: number;
|
|
139
139
|
expected_drawer_total: number;
|
|
@@ -53,7 +53,7 @@ export * from './tenant_cash_drawer_sessions';
|
|
|
53
53
|
export * from './tenant_cash_drawers';
|
|
54
54
|
export * from './tenant_cash_in_hand_transactions';
|
|
55
55
|
export * from './tenant_cash_in_out';
|
|
56
|
-
export * from './
|
|
56
|
+
export * from './tenant_day_sessions';
|
|
57
57
|
export * from './tenant_instore_shift_sessions';
|
|
58
58
|
export * from './tenant_instore_shifts';
|
|
59
59
|
export * from './tenant_metadata';
|
|
@@ -69,7 +69,7 @@ __exportStar(require("./tenant_cash_drawer_sessions"), exports);
|
|
|
69
69
|
__exportStar(require("./tenant_cash_drawers"), exports);
|
|
70
70
|
__exportStar(require("./tenant_cash_in_hand_transactions"), exports);
|
|
71
71
|
__exportStar(require("./tenant_cash_in_out"), exports);
|
|
72
|
-
__exportStar(require("./
|
|
72
|
+
__exportStar(require("./tenant_day_sessions"), exports);
|
|
73
73
|
__exportStar(require("./tenant_instore_shift_sessions"), exports);
|
|
74
74
|
__exportStar(require("./tenant_instore_shifts"), exports);
|
|
75
75
|
__exportStar(require("./tenant_metadata"), exports);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { POS_DAY_STATUS_ENUM } from '../../constants';
|
|
2
2
|
import { ILocalTimeFields } from '../../helpers';
|
|
3
|
-
export interface
|
|
3
|
+
export interface ITenantDaySessionOpening {
|
|
4
4
|
staff_id: string;
|
|
5
5
|
staff_name: string;
|
|
6
6
|
note: string;
|
|
7
7
|
opened_at: Date;
|
|
8
8
|
cash_amount: number;
|
|
9
9
|
}
|
|
10
|
-
export interface
|
|
10
|
+
export interface ITenantDaySessionClosing {
|
|
11
11
|
staff_id: string;
|
|
12
12
|
staff_name: string;
|
|
13
13
|
note: string;
|
|
@@ -17,12 +17,12 @@ export interface ITenantDayClosing {
|
|
|
17
17
|
difference: number;
|
|
18
18
|
cash_in_out_id: string | null;
|
|
19
19
|
}
|
|
20
|
-
export interface
|
|
20
|
+
export interface ITenantDaySession extends ILocalTimeFields {
|
|
21
21
|
_id: string;
|
|
22
22
|
tenant_id: string;
|
|
23
23
|
status: POS_DAY_STATUS_ENUM;
|
|
24
|
-
opening:
|
|
25
|
-
closing:
|
|
24
|
+
opening: ITenantDaySessionOpening | null;
|
|
25
|
+
closing: ITenantDaySessionClosing | null;
|
|
26
26
|
total_shifts: number;
|
|
27
27
|
createdAt: Date;
|
|
28
28
|
updatedAt: Date;
|
package/package.json
CHANGED
|
File without changes
|