@darkpos/pricing 1.0.147 → 1.0.148
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.
|
@@ -505,4 +505,24 @@ describe('pickEndDate function', () => {
|
|
|
505
505
|
|
|
506
506
|
expect(result).toBe('2025-05-13T21:00:00Z');
|
|
507
507
|
});
|
|
508
|
+
|
|
509
|
+
test('pickEndDate - applies addDays when fromDate is provided', () => {
|
|
510
|
+
const schedule = {
|
|
511
|
+
addDays: 3,
|
|
512
|
+
readyHour: { hour: 17, minute: 0 },
|
|
513
|
+
skipDays: [],
|
|
514
|
+
cutHour: { hour: 16, minute: 0 },
|
|
515
|
+
cutDay: 1,
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
const pricingService = usePricing(getDefaultSettings([schedule]));
|
|
519
|
+
|
|
520
|
+
const result = pricingService.store.pickEndDate(
|
|
521
|
+
undefined,
|
|
522
|
+
undefined,
|
|
523
|
+
'2026-03-01T09:00:00'
|
|
524
|
+
);
|
|
525
|
+
|
|
526
|
+
expect(result).toBe('2026-03-04T22:00:00Z');
|
|
527
|
+
});
|
|
508
528
|
});
|
|
@@ -18,11 +18,7 @@ module.exports = ({ moment, actions }) =>
|
|
|
18
18
|
|
|
19
19
|
let addDays = 0;
|
|
20
20
|
|
|
21
|
-
if (
|
|
22
|
-
!fromDate &&
|
|
23
|
-
typeof addDaysParam === 'number' &&
|
|
24
|
-
addDaysParam <= MAX_ADD_DAYS
|
|
25
|
-
) {
|
|
21
|
+
if (typeof addDaysParam === 'number' && addDaysParam <= MAX_ADD_DAYS) {
|
|
26
22
|
addDays = addDaysParam;
|
|
27
23
|
}
|
|
28
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darkpos/pricing",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.148",
|
|
4
4
|
"description": "Pricing calculator",
|
|
5
5
|
"author": "Dark POS",
|
|
6
6
|
"license": "ISC",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"supertest": "^6.2.3",
|
|
55
55
|
"supervisor": "^0.12.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "ef7e78a71a5fb6cfd619b8f525b7950669bd7995"
|
|
58
58
|
}
|