@unchainedshop/core 3.0.0-rc4 → 3.0.0-rc5
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.
|
@@ -21,7 +21,7 @@ export type IEnrollmentAdapter = IBaseAdapter & {
|
|
|
21
21
|
};
|
|
22
22
|
export declare const periodForReferenceDate: (referenceDate: Date, intervalCount?: number, interval?: string) => {
|
|
23
23
|
start: Date;
|
|
24
|
-
end:
|
|
24
|
+
end: any;
|
|
25
25
|
};
|
|
26
26
|
export declare const EnrollmentAdapter: Omit<IEnrollmentAdapter, 'key' | 'label' | 'version'>;
|
|
27
27
|
//# sourceMappingURL=EnrollmentAdapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnrollmentAdapter.d.ts","sourceRoot":"","sources":["../../src/directors/EnrollmentAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"EnrollmentAdapter.d.ts","sourceRoot":"","sources":["../../src/directors/EnrollmentAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,cAAc,EAEf,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,qBAAqB,EAAE,CAAC,MAAM,EAAE;QAC9B,MAAM,EAAE,gBAAgB,CAAC;QACzB,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;KAC1B,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACnB,SAAS,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAClC,oBAAoB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,UAAU,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC7C;AAED,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG;IAC9C,cAAc,EAAE,CAAC,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC;IAEvD,kCAAkC,EAAE,CAClC,aAAa,EAAE,aAAa,EAC5B,YAAY,KAAA,KACT,OAAO,CAAC,cAAc,CAAC,CAAC;IAE7B,OAAO,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,wBAAwB,CAAC;CAClE,CAAC;AACF,eAAO,MAAM,sBAAsB,kBAAmB,IAAI;;;CAgBzD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,EAAE,KAAK,GAAG,OAAO,GAAG,SAAS,CA2DnF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { log, LogLevel } from '@unchainedshop/logger';
|
|
2
|
-
import {
|
|
2
|
+
import { addToDate, } from '@unchainedshop/core-enrollments';
|
|
3
3
|
export const periodForReferenceDate = (referenceDate, intervalCount = 1, interval = 'WEEKS') => {
|
|
4
4
|
const lowerCaseInterval = interval.toLowerCase();
|
|
5
5
|
const start = new Date(referenceDate);
|
|
@@ -11,7 +11,7 @@ export const periodForReferenceDate = (referenceDate, intervalCount = 1, interva
|
|
|
11
11
|
}
|
|
12
12
|
return {
|
|
13
13
|
start,
|
|
14
|
-
end:
|
|
14
|
+
end: addToDate(start, {
|
|
15
15
|
[lowerCaseInterval]: intervalCount,
|
|
16
16
|
}),
|
|
17
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnrollmentAdapter.js","sourceRoot":"","sources":["../../src/directors/EnrollmentAdapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG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B,CAAC,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,eAAe,CAAC;oBACnF,OAAO,EAAE,KAAK;iBACf,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;IAED,2BAA2B;IAC3B,GAAG,CAAC,OAAe,EAAE,EAAE,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE;QAC9D,OAAO,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/core",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-rc5",
|
|
4
4
|
"main": "lib/core-index.js",
|
|
5
5
|
"types": "lib/core-index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -29,27 +29,26 @@
|
|
|
29
29
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@breejs/later": "^4.2.0",
|
|
32
|
-
"@unchainedshop/core-assortments": "^3.0.0-
|
|
33
|
-
"@unchainedshop/core-bookmarks": "^3.0.0-
|
|
34
|
-
"@unchainedshop/core-countries": "^3.0.0-
|
|
35
|
-
"@unchainedshop/core-currencies": "^3.0.0-
|
|
36
|
-
"@unchainedshop/core-delivery": "^3.0.0-
|
|
37
|
-
"@unchainedshop/core-enrollments": "^3.0.0-
|
|
38
|
-
"@unchainedshop/core-events": "^3.0.0-
|
|
39
|
-
"@unchainedshop/core-files": "^3.0.0-
|
|
40
|
-
"@unchainedshop/core-filters": "^3.0.0-
|
|
41
|
-
"@unchainedshop/core-languages": "^3.0.0-
|
|
42
|
-
"@unchainedshop/core-messaging": "^3.0.0-
|
|
43
|
-
"@unchainedshop/core-orders": "^3.0.0-
|
|
44
|
-
"@unchainedshop/core-payment": "^3.0.0-
|
|
45
|
-
"@unchainedshop/core-products": "^3.0.0-
|
|
46
|
-
"@unchainedshop/core-quotations": "^3.0.0-
|
|
47
|
-
"@unchainedshop/core-users": "^3.0.0-
|
|
48
|
-
"@unchainedshop/core-warehousing": "^3.0.0-
|
|
49
|
-
"@unchainedshop/core-worker": "^3.0.0-
|
|
50
|
-
"@unchainedshop/logger": "^3.0.0-
|
|
51
|
-
"@unchainedshop/utils": "^3.0.0-
|
|
52
|
-
"date-fns": "^4.1.0"
|
|
32
|
+
"@unchainedshop/core-assortments": "^3.0.0-rc5",
|
|
33
|
+
"@unchainedshop/core-bookmarks": "^3.0.0-rc5",
|
|
34
|
+
"@unchainedshop/core-countries": "^3.0.0-rc5",
|
|
35
|
+
"@unchainedshop/core-currencies": "^3.0.0-rc5",
|
|
36
|
+
"@unchainedshop/core-delivery": "^3.0.0-rc5",
|
|
37
|
+
"@unchainedshop/core-enrollments": "^3.0.0-rc5",
|
|
38
|
+
"@unchainedshop/core-events": "^3.0.0-rc5",
|
|
39
|
+
"@unchainedshop/core-files": "^3.0.0-rc5",
|
|
40
|
+
"@unchainedshop/core-filters": "^3.0.0-rc5",
|
|
41
|
+
"@unchainedshop/core-languages": "^3.0.0-rc5",
|
|
42
|
+
"@unchainedshop/core-messaging": "^3.0.0-rc5",
|
|
43
|
+
"@unchainedshop/core-orders": "^3.0.0-rc5",
|
|
44
|
+
"@unchainedshop/core-payment": "^3.0.0-rc5",
|
|
45
|
+
"@unchainedshop/core-products": "^3.0.0-rc5",
|
|
46
|
+
"@unchainedshop/core-quotations": "^3.0.0-rc5",
|
|
47
|
+
"@unchainedshop/core-users": "^3.0.0-rc5",
|
|
48
|
+
"@unchainedshop/core-warehousing": "^3.0.0-rc5",
|
|
49
|
+
"@unchainedshop/core-worker": "^3.0.0-rc5",
|
|
50
|
+
"@unchainedshop/logger": "^3.0.0-rc5",
|
|
51
|
+
"@unchainedshop/utils": "^3.0.0-rc5"
|
|
53
52
|
},
|
|
54
53
|
"devDependencies": {
|
|
55
54
|
"@types/node": "^22.10.2",
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { IBaseAdapter } from '@unchainedshop/utils';
|
|
2
2
|
import { log, LogLevel } from '@unchainedshop/logger';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
Enrollment,
|
|
5
|
+
EnrollmentPeriod,
|
|
6
|
+
EnrollmentPlan,
|
|
7
|
+
addToDate,
|
|
8
|
+
} from '@unchainedshop/core-enrollments';
|
|
5
9
|
import type { Product, ProductPlan } from '@unchainedshop/core-products';
|
|
6
10
|
import type { OrderPosition } from '@unchainedshop/core-orders';
|
|
7
11
|
|
|
@@ -41,7 +45,7 @@ export const periodForReferenceDate = (referenceDate: Date, intervalCount = 1, i
|
|
|
41
45
|
|
|
42
46
|
return {
|
|
43
47
|
start,
|
|
44
|
-
end:
|
|
48
|
+
end: addToDate(start, {
|
|
45
49
|
[lowerCaseInterval]: intervalCount,
|
|
46
50
|
}),
|
|
47
51
|
};
|