@aneuhold/core-ts-db-lib 1.0.61 → 1.0.63
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/embedded-types/dashboard/task/RecurrenceInfo.d.ts.map +1 -1
- package/lib/embedded-types/dashboard/task/RecurrenceInfo.js +0 -1
- package/lib/schemas/validators/ValidateUtil.d.ts.map +1 -1
- package/lib/schemas/validators/ValidateUtil.js +1 -0
- package/lib/schemas/validators/ValidateUtil.spec.js +0 -1
- package/lib/services/dashboard/Task/TaskRecurrenceService.d.ts.map +1 -1
- package/lib/services/dashboard/Task/TaskRecurrenceService.js +7 -6
- package/lib/services/dashboard/Task/TaskService.js +1 -1
- package/package.json +7 -10
- package/lib/documents/BaseDocumentWithUserId.d.ts +0 -10
- package/lib/documents/BaseDocumentWithUserId.d.ts.map +0 -1
- package/lib/documents/BaseDocumentWithUserId.js +0 -13
- package/lib/schemas/required_refs/RequiredUserId.d.ts +0 -9
- package/lib/schemas/required_refs/RequiredUserId.d.ts.map +0 -1
- package/lib/schemas/required_refs/RequiredUserId.js +0 -12
- package/lib/services/dashboard/TaskService.d.ts +0 -27
- package/lib/services/dashboard/TaskService.d.ts.map +0 -1
- package/lib/services/dashboard/TaskService.js +0 -177
- package/lib/services/dashboard/TaskService.spec.d.ts +0 -2
- package/lib/services/dashboard/TaskService.spec.d.ts.map +0 -1
- package/lib/services/dashboard/TaskService.spec.js +0 -205
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecurrenceInfo.d.ts","sourceRoot":"","sources":["../../../../src/embedded-types/dashboard/task/RecurrenceInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,aAAa,MAAM,mCAAmC,CAAC;AAE9D,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"RecurrenceInfo.d.ts","sourceRoot":"","sources":["../../../../src/embedded-types/dashboard/task/RecurrenceInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,aAAa,MAAM,mCAAmC,CAAC;AAE9D,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,QAuB3E;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,EAAE,mBAAmB,CAAC;IAC/B,eAAe,EAAE,eAAe,CAAC;IACjC,gBAAgB,EAAE,gBAAgB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,uBAAuB,CAAC;IAC9B,cAAc,CAAC,EAAE;QACf,QAAQ,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;QAC5C;;WAEG;QACH,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;IACF;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,oBAAoB,CAAC,EAAE;QACrB,OAAO,EAAE,MAAM,CAAC;QAChB;;;;WAIG;QACH,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;KAC9B,CAAC;CACH,CAAC;AAEF,oBAAY,uBAAuB;IACjC,cAAc,mBAAmB;IACjC,UAAU,eAAe;IACzB,oBAAoB,yBAAyB;IAC7C,cAAc,mBAAmB;CAClC;AAED;;GAEG;AACH,oBAAY,eAAe;IACzB,SAAS,cAAc;IACvB,OAAO,YAAY;CACpB;AAED,oBAAY,gBAAgB;IAC1B;;OAEG;IACH,WAAW,gBAAgB;IAC3B;;;OAGG;IACH,gBAAgB,qBAAqB;IACrC;;;;OAIG;IACH,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,QAAQ,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,CAAC"}
|
|
@@ -18,7 +18,6 @@ function validateRecurrenceInfo(task, errors) {
|
|
|
18
18
|
// Write more if this later if there are any changes to the data model so it
|
|
19
19
|
// can be correctly converted.
|
|
20
20
|
if (recurrenceErrors.length > 0) {
|
|
21
|
-
// eslint-disable-next-line no-param-reassign
|
|
22
21
|
task.recurrenceInfo = undefined;
|
|
23
22
|
}
|
|
24
23
|
errors.push(...recurrenceErrors);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidateUtil.d.ts","sourceRoot":"","sources":["../../../src/schemas/validators/ValidateUtil.ts"],"names":[],"mappings":"AAQA,KAAK,eAAe,GAAG;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,OAAO,QAAQ;IAKzB,OAAO,CAAC,WAAW;IAJrB,YAAY,EAAE,eAAe,CAAC;gBAG5B,YAAY,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EAAE;IAK/B,cAAc,CAAC,SAAS,EAAE,MAAM;IAUhC,cAAc,CAAC,SAAS,EAAE,MAAM;IAUhC,eAAe,CAAC,SAAS,EAAE,MAAM;IAUjC,aAAa,CAAC,SAAS,EAAE,MAAM;IAU/B,cAAc,CAAC,SAAS,EAAE,MAAM;IAUhC,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAU9C,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAW9C,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAU9C,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO;IAUhD,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE;IAUhD;;;;;;;;;OASG;IACH,OAAO,CAAC,gBAAgB;IAexB,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,WAAW;
|
|
1
|
+
{"version":3,"file":"ValidateUtil.d.ts","sourceRoot":"","sources":["../../../src/schemas/validators/ValidateUtil.ts"],"names":[],"mappings":"AAQA,KAAK,eAAe,GAAG;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,OAAO,QAAQ;IAKzB,OAAO,CAAC,WAAW;IAJrB,YAAY,EAAE,eAAe,CAAC;gBAG5B,YAAY,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EAAE;IAK/B,cAAc,CAAC,SAAS,EAAE,MAAM;IAUhC,cAAc,CAAC,SAAS,EAAE,MAAM;IAUhC,eAAe,CAAC,SAAS,EAAE,MAAM;IAUjC,aAAa,CAAC,SAAS,EAAE,MAAM;IAU/B,cAAc,CAAC,SAAS,EAAE,MAAM;IAUhC,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAU9C,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAW9C,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAU9C,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO;IAUhD,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE;IAUhD;;;;;;;;;OASG;IACH,OAAO,CAAC,gBAAgB;IAexB,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,WAAW;CAYpB"}
|
|
@@ -141,6 +141,7 @@ class Validate {
|
|
|
141
141
|
let currentObject = this.parentObject;
|
|
142
142
|
fieldPath.forEach((field, index) => {
|
|
143
143
|
if (index === fieldPath.length - 1) {
|
|
144
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
144
145
|
delete currentObject[field];
|
|
145
146
|
}
|
|
146
147
|
else {
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const ValidateUtil_1 = __importDefault(require("./ValidateUtil"));
|
|
7
7
|
describe('Validate', () => {
|
|
8
8
|
let errorsArray;
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
9
|
let parentObject;
|
|
11
10
|
beforeEach(() => {
|
|
12
11
|
errorsArray = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskRecurrenceService.d.ts","sourceRoot":"","sources":["../../../../src/services/dashboard/Task/TaskRecurrenceService.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"TaskRecurrenceService.d.ts","sourceRoot":"","sources":["../../../../src/services/dashboard/Task/TaskRecurrenceService.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,mBAAmB,EAEpB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,aAAa,MAAM,mCAAmC,CAAC;AAE9D,MAAM,CAAC,OAAO,OAAO,8BAA8B;IACjD;;;OAGG;IACH,MAAM,CAAC,oBAAoB,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,mBAAmB;IAsE3E;;;;;;;;OAQG;IACH,MAAM,CAAC,wBAAwB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI;IAkE1D,OAAO,CAAC,MAAM,CAAC,oBAAoB;CAapC"}
|
|
@@ -86,31 +86,32 @@ class DashboardTaskRecurrenceService {
|
|
|
86
86
|
// No dates to move forward
|
|
87
87
|
(!task.dueDate && !task.startDate) ||
|
|
88
88
|
// Invalid start date recurrence basis
|
|
89
|
-
(task.recurrenceInfo.recurrenceBasis ===
|
|
89
|
+
(task.recurrenceInfo.recurrenceBasis === RecurrenceInfo_1.RecurrenceBasis.startDate &&
|
|
90
90
|
!task.parentRecurringTaskInfo.startDate) ||
|
|
91
91
|
// Invalid due date recurrence basis
|
|
92
|
-
(task.recurrenceInfo.recurrenceBasis ===
|
|
92
|
+
(task.recurrenceInfo.recurrenceBasis === RecurrenceInfo_1.RecurrenceBasis.dueDate &&
|
|
93
93
|
!task.parentRecurringTaskInfo.dueDate)) {
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
// Validation for moving dates based on their own recurrence
|
|
97
97
|
}
|
|
98
98
|
else if (!task.recurrenceInfo ||
|
|
99
|
-
(task.recurrenceInfo.recurrenceBasis ===
|
|
99
|
+
(task.recurrenceInfo.recurrenceBasis === RecurrenceInfo_1.RecurrenceBasis.startDate &&
|
|
100
100
|
!task.startDate) ||
|
|
101
|
-
(task.recurrenceInfo.recurrenceBasis ===
|
|
101
|
+
(task.recurrenceInfo.recurrenceBasis === RecurrenceInfo_1.RecurrenceBasis.dueDate &&
|
|
102
|
+
!task.dueDate)) {
|
|
102
103
|
return;
|
|
103
104
|
}
|
|
104
105
|
let diff = 0;
|
|
105
106
|
if (task.parentRecurringTaskInfo) {
|
|
106
|
-
if (task.recurrenceInfo.recurrenceBasis ===
|
|
107
|
+
if (task.recurrenceInfo.recurrenceBasis === RecurrenceInfo_1.RecurrenceBasis.startDate) {
|
|
107
108
|
diff = this.getDiffForDateUpdate(task.parentRecurringTaskInfo.startDate, task.recurrenceInfo.frequency);
|
|
108
109
|
}
|
|
109
110
|
else {
|
|
110
111
|
diff = this.getDiffForDateUpdate(task.parentRecurringTaskInfo.dueDate, task.recurrenceInfo.frequency);
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
|
-
else if (task.recurrenceInfo.recurrenceBasis ===
|
|
114
|
+
else if (task.recurrenceInfo.recurrenceBasis === RecurrenceInfo_1.RecurrenceBasis.startDate) {
|
|
114
115
|
diff = this.getDiffForDateUpdate(task.startDate, task.recurrenceInfo.frequency);
|
|
115
116
|
}
|
|
116
117
|
else {
|
|
@@ -50,7 +50,7 @@ class DashboardTaskService {
|
|
|
50
50
|
* there isn't recurrence info.
|
|
51
51
|
*/
|
|
52
52
|
static updateDatesForRecurrence(task) {
|
|
53
|
-
|
|
53
|
+
TaskRecurrenceService_1.default.updateDatesForRecurrence(task);
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
56
|
* Gets the filtered and sorted set of task ids for a particular category.
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aneuhold/core-ts-db-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.63",
|
|
4
4
|
"description": "A core database library used for personal projects",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"author": "Anton G Neuhold Jr <agneuhold@gmail.com>",
|
|
8
8
|
"license": "MIT",
|
|
9
|
+
"packageManager": "yarn@4.2.2",
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
11
12
|
"url": "git+https://github.com/aneuhold/core-ts-db-lib.git"
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
"Node.js"
|
|
23
24
|
],
|
|
24
25
|
"scripts": {
|
|
25
|
-
"pushpub": "
|
|
26
|
+
"pushpub": "yarn build && npm version patch && git push",
|
|
26
27
|
"build": "tsc",
|
|
27
28
|
"watch": "tsc -w",
|
|
28
29
|
"link:local": "cd lib && yarn link",
|
|
@@ -31,23 +32,19 @@
|
|
|
31
32
|
"unlink:core-ts-lib": "yarn unlink @aneuhold/core-ts-lib && yarn install --force",
|
|
32
33
|
"upgrade:all": "yarn upgrade --latest",
|
|
33
34
|
"upgrade:core": "yarn upgrade --latest --pattern @aneuhold",
|
|
34
|
-
"test": "jest"
|
|
35
|
+
"test": "jest",
|
|
36
|
+
"lint": "eslint"
|
|
35
37
|
},
|
|
36
38
|
"dependencies": {
|
|
37
39
|
"@aneuhold/core-ts-lib": "^1.1.10",
|
|
38
40
|
"bson": "^6.2.0"
|
|
39
41
|
},
|
|
40
42
|
"devDependencies": {
|
|
43
|
+
"@aneuhold/eslint-config": "^1.0.6",
|
|
41
44
|
"@types/jest": "^29.5.8",
|
|
42
45
|
"@types/node": "^20.10.4",
|
|
43
46
|
"@types/node-fetch": "^2.6.9",
|
|
44
|
-
"
|
|
45
|
-
"@typescript-eslint/parser": "^6.14.0",
|
|
46
|
-
"eslint": "^8.35.0",
|
|
47
|
-
"eslint-config-airbnb-base": "^15.0.0",
|
|
48
|
-
"eslint-config-prettier": "^9.1.0",
|
|
49
|
-
"eslint-plugin-import": "^2.22.1",
|
|
50
|
-
"eslint-plugin-prettier": "^5.0.1",
|
|
47
|
+
"eslint": "^9",
|
|
51
48
|
"jest": "^29.7.0",
|
|
52
49
|
"prettier": "^3.1.1",
|
|
53
50
|
"ts-jest": "^29.1.1",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ObjectId } from 'bson';
|
|
2
|
-
import BaseDocument from './BaseDocument';
|
|
3
|
-
/**
|
|
4
|
-
* A base document type that has a user ID associated with it. This is useful
|
|
5
|
-
* for filtering on all documents that a user has access to.
|
|
6
|
-
*/
|
|
7
|
-
export default abstract class BaseDocumentWithUserId extends BaseDocument {
|
|
8
|
-
abstract userId: ObjectId;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=BaseDocumentWithUserId.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseDocumentWithUserId.d.ts","sourceRoot":"","sources":["../../src/documents/BaseDocumentWithUserId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C;;;GAGG;AACH,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,sBAAuB,SAAQ,YAAY;IACvE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;CAC3B"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const BaseDocument_1 = __importDefault(require("./BaseDocument"));
|
|
7
|
-
/**
|
|
8
|
-
* A base document type that has a user ID associated with it. This is useful
|
|
9
|
-
* for filtering on all documents that a user has access to.
|
|
10
|
-
*/
|
|
11
|
-
class BaseDocumentWithUserId extends BaseDocument_1.default {
|
|
12
|
-
}
|
|
13
|
-
exports.default = BaseDocumentWithUserId;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ObjectId } from 'bson';
|
|
2
|
-
import BaseDocument from '../../documents/BaseDocument';
|
|
3
|
-
/**
|
|
4
|
-
* A document that has a `userId` that must be associated to be valid.
|
|
5
|
-
*/
|
|
6
|
-
export default abstract class RequiredUserId extends BaseDocument {
|
|
7
|
-
abstract userId: ObjectId;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=RequiredUserId.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequiredUserId.d.ts","sourceRoot":"","sources":["../../../src/schemas/required_refs/RequiredUserId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,YAAY,MAAM,8BAA8B,CAAC;AAExD;;GAEG;AACH,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,cAAe,SAAQ,YAAY;IAC/D,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;CAC3B"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const BaseDocument_1 = __importDefault(require("../../documents/BaseDocument"));
|
|
7
|
-
/**
|
|
8
|
-
* A document that has a `userId` that must be associated to be valid.
|
|
9
|
-
*/
|
|
10
|
-
class RequiredUserId extends BaseDocument_1.default {
|
|
11
|
-
}
|
|
12
|
-
exports.default = RequiredUserId;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ObjectId } from 'bson';
|
|
2
|
-
import DashboardTask from '../../documents/dashboard/Task';
|
|
3
|
-
import { RecurrenceFrequency } from '../../embedded-types/dashboard/task/RecurrenceInfo';
|
|
4
|
-
export default class DashboardTaskService {
|
|
5
|
-
/**
|
|
6
|
-
* Gets all the children task IDs for the given parent task IDs.
|
|
7
|
-
*/
|
|
8
|
-
static getChildrenIds: (allUserTasks: DashboardTask[], parentTaskIds: ObjectId[]) => ObjectId[];
|
|
9
|
-
/**
|
|
10
|
-
* Gets the next frequency date from the provided basis date. Returns null
|
|
11
|
-
* if the provided frequency is in an invalid state.
|
|
12
|
-
*/
|
|
13
|
-
static getNextFrequencyDate(basisDate: Date, frequency: RecurrenceFrequency): Date | null;
|
|
14
|
-
/**
|
|
15
|
-
* Moves the start and due date forward by one frequency.
|
|
16
|
-
*
|
|
17
|
-
* This does not take into account the recurrence effect. That should be
|
|
18
|
-
* handled on the frontend.
|
|
19
|
-
*
|
|
20
|
-
* Makes no changes if the state of the task is invalid for recurrence or
|
|
21
|
-
* there isn't recurrence info.
|
|
22
|
-
*/
|
|
23
|
-
static updateDatesForRecurrence(task: DashboardTask): void;
|
|
24
|
-
private static getDiffForDateUpdate;
|
|
25
|
-
private static getChildrenTaskIds;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=TaskService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TaskService.d.ts","sourceRoot":"","sources":["../../../src/services/dashboard/TaskService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EACL,mBAAmB,EAEpB,MAAM,oDAAoD,CAAC;AAE5D,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACvC;;OAEG;IACH,MAAM,CAAC,cAAc,iBACL,aAAa,EAAE,iBACd,QAAQ,EAAE,KACxB,QAAQ,EAAE,CA2BX;IAEF;;;OAGG;IACH,MAAM,CAAC,oBAAoB,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,mBAAmB;IAsE3E;;;;;;;;OAQG;IACH,MAAM,CAAC,wBAAwB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI;IA+D1D,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAcnC,OAAO,CAAC,MAAM,CAAC,kBAAkB;CAsBlC"}
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const bson_1 = require("bson");
|
|
4
|
-
const core_ts_lib_1 = require("@aneuhold/core-ts-lib");
|
|
5
|
-
const RecurrenceInfo_1 = require("../../embedded-types/dashboard/task/RecurrenceInfo");
|
|
6
|
-
class DashboardTaskService {
|
|
7
|
-
/**
|
|
8
|
-
* Gets all the children task IDs for the given parent task IDs.
|
|
9
|
-
*/
|
|
10
|
-
static getChildrenIds = (allUserTasks, parentTaskIds) => {
|
|
11
|
-
const parentToTaskIdsDict = {};
|
|
12
|
-
const taskIdToTaskDict = {};
|
|
13
|
-
allUserTasks.forEach((task) => {
|
|
14
|
-
taskIdToTaskDict[task._id.toString()] = task;
|
|
15
|
-
if (task.parentTaskId) {
|
|
16
|
-
if (!parentToTaskIdsDict[task.parentTaskId.toString()]) {
|
|
17
|
-
parentToTaskIdsDict[task.parentTaskId.toString()] = [];
|
|
18
|
-
}
|
|
19
|
-
parentToTaskIdsDict[task.parentTaskId.toString()].push(task._id.toString());
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
const childrenIds = [];
|
|
23
|
-
parentTaskIds.forEach((taskId) => {
|
|
24
|
-
const task = taskIdToTaskDict[taskId.toString()];
|
|
25
|
-
if (task) {
|
|
26
|
-
const childrenTaskIds = this.getChildrenTaskIds(taskIdToTaskDict, parentToTaskIdsDict, taskId.toString());
|
|
27
|
-
childrenIds.push(...childrenTaskIds.map((id) => new bson_1.ObjectId(id)));
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
return childrenIds;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Gets the next frequency date from the provided basis date. Returns null
|
|
34
|
-
* if the provided frequency is in an invalid state.
|
|
35
|
-
*/
|
|
36
|
-
static getNextFrequencyDate(basisDate, frequency) {
|
|
37
|
-
// Last day of month
|
|
38
|
-
if (frequency.type === RecurrenceInfo_1.RecurrenceFrequencyType.lastDayOfMonth) {
|
|
39
|
-
return core_ts_lib_1.DateService.getLastDayOfGivenMonth(basisDate);
|
|
40
|
-
}
|
|
41
|
-
// Every X Time Unit
|
|
42
|
-
if (frequency.type === RecurrenceInfo_1.RecurrenceFrequencyType.everyXTimeUnit) {
|
|
43
|
-
if (!frequency.everyXTimeUnit) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
if (frequency.everyXTimeUnit.timeUnit === 'day') {
|
|
47
|
-
return core_ts_lib_1.DateService.addDays(basisDate, frequency.everyXTimeUnit.x);
|
|
48
|
-
}
|
|
49
|
-
if (frequency.everyXTimeUnit.timeUnit === 'week') {
|
|
50
|
-
return core_ts_lib_1.DateService.addDays(basisDate, frequency.everyXTimeUnit.x * 7);
|
|
51
|
-
}
|
|
52
|
-
if (frequency.everyXTimeUnit.timeUnit === 'month') {
|
|
53
|
-
return core_ts_lib_1.DateService.addMonths(basisDate, frequency.everyXTimeUnit.x);
|
|
54
|
-
}
|
|
55
|
-
if (frequency.everyXTimeUnit.timeUnit === 'year') {
|
|
56
|
-
return core_ts_lib_1.DateService.addYears(basisDate, frequency.everyXTimeUnit.x);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
// Week Day Set
|
|
60
|
-
if (frequency.type === RecurrenceInfo_1.RecurrenceFrequencyType.weekDaySet) {
|
|
61
|
-
if (!frequency.weekDaySet) {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
const newDate = new Date(basisDate);
|
|
65
|
-
let daysToAdd = 0;
|
|
66
|
-
while (daysToAdd < 7) {
|
|
67
|
-
newDate.setDate(newDate.getDate() + 1);
|
|
68
|
-
if (frequency.weekDaySet.includes(newDate.getDay())) {
|
|
69
|
-
return newDate;
|
|
70
|
-
}
|
|
71
|
-
daysToAdd += 1;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// Every X Weekday of Month
|
|
75
|
-
if (frequency.type === RecurrenceInfo_1.RecurrenceFrequencyType.everyXWeekdayOfMonth) {
|
|
76
|
-
if (!frequency.everyXWeekdayOfMonth) {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
// Start by adding one day
|
|
80
|
-
let newDate = core_ts_lib_1.DateService.getWeekDayOfXWeekOfMonth(core_ts_lib_1.DateService.addDays(basisDate, 1), frequency.everyXWeekdayOfMonth.weekDay, frequency.everyXWeekdayOfMonth.weekOfMonth);
|
|
81
|
-
let monthsPassed = 0;
|
|
82
|
-
while (!newDate ||
|
|
83
|
-
newDate < basisDate ||
|
|
84
|
-
newDate.getTime() === basisDate.getTime()) {
|
|
85
|
-
monthsPassed += 1;
|
|
86
|
-
newDate = core_ts_lib_1.DateService.getWeekDayOfXWeekOfMonth(core_ts_lib_1.DateService.addMonths(basisDate, monthsPassed), frequency.everyXWeekdayOfMonth.weekDay, frequency.everyXWeekdayOfMonth.weekOfMonth);
|
|
87
|
-
if (monthsPassed > 11) {
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return newDate;
|
|
92
|
-
}
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Moves the start and due date forward by one frequency.
|
|
97
|
-
*
|
|
98
|
-
* This does not take into account the recurrence effect. That should be
|
|
99
|
-
* handled on the frontend.
|
|
100
|
-
*
|
|
101
|
-
* Makes no changes if the state of the task is invalid for recurrence or
|
|
102
|
-
* there isn't recurrence info.
|
|
103
|
-
*/
|
|
104
|
-
static updateDatesForRecurrence(task) {
|
|
105
|
-
// Initial basic validation
|
|
106
|
-
if (!task.recurrenceInfo) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
// Validation for dates based on parent
|
|
110
|
-
if (task.parentRecurringTaskInfo) {
|
|
111
|
-
if (
|
|
112
|
-
// No dates to move forward
|
|
113
|
-
(!task.dueDate && !task.startDate) ||
|
|
114
|
-
// Invalid start date recurrence basis
|
|
115
|
-
(task.recurrenceInfo.recurrenceBasis === 'startDate' &&
|
|
116
|
-
!task.parentRecurringTaskInfo.startDate) ||
|
|
117
|
-
// Invalid due date recurrence basis
|
|
118
|
-
(task.recurrenceInfo.recurrenceBasis === 'dueDate' &&
|
|
119
|
-
!task.parentRecurringTaskInfo.dueDate)) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
// Validation for moving dates based on their own recurrence
|
|
123
|
-
}
|
|
124
|
-
else if (!task.recurrenceInfo ||
|
|
125
|
-
(task.recurrenceInfo.recurrenceBasis === 'startDate' &&
|
|
126
|
-
!task.startDate) ||
|
|
127
|
-
(task.recurrenceInfo.recurrenceBasis === 'dueDate' && !task.dueDate)) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
let diff = 0;
|
|
131
|
-
if (task.parentRecurringTaskInfo) {
|
|
132
|
-
if (task.recurrenceInfo.recurrenceBasis === 'startDate') {
|
|
133
|
-
diff = this.getDiffForDateUpdate(task.parentRecurringTaskInfo.startDate, task.recurrenceInfo.frequency);
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
diff = this.getDiffForDateUpdate(task.parentRecurringTaskInfo.dueDate, task.recurrenceInfo.frequency);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
else if (task.recurrenceInfo.recurrenceBasis === 'startDate') {
|
|
140
|
-
diff = this.getDiffForDateUpdate(task.startDate, task.recurrenceInfo.frequency);
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
diff = this.getDiffForDateUpdate(task.dueDate, task.recurrenceInfo.frequency);
|
|
144
|
-
}
|
|
145
|
-
if (task.startDate) {
|
|
146
|
-
task.startDate = new Date(task.startDate.getTime() + diff);
|
|
147
|
-
}
|
|
148
|
-
if (task.dueDate) {
|
|
149
|
-
task.dueDate = new Date(task.dueDate.getTime() + diff);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
static getDiffForDateUpdate(basisDate, frequency) {
|
|
153
|
-
if (!basisDate) {
|
|
154
|
-
return 0;
|
|
155
|
-
}
|
|
156
|
-
const nextFrequencyDate = this.getNextFrequencyDate(basisDate, frequency);
|
|
157
|
-
if (!nextFrequencyDate) {
|
|
158
|
-
return 0;
|
|
159
|
-
}
|
|
160
|
-
return nextFrequencyDate.getTime() - basisDate.getTime();
|
|
161
|
-
}
|
|
162
|
-
static getChildrenTaskIds(taskIdToTaskDict, parentToTaskIdsDict, taskId) {
|
|
163
|
-
const childrenIds = parentToTaskIdsDict[taskId];
|
|
164
|
-
if (!childrenIds) {
|
|
165
|
-
return [];
|
|
166
|
-
}
|
|
167
|
-
childrenIds.forEach((childId) => {
|
|
168
|
-
const childTask = taskIdToTaskDict[childId];
|
|
169
|
-
if (childTask) {
|
|
170
|
-
const grandchildrenIds = this.getChildrenTaskIds(taskIdToTaskDict, parentToTaskIdsDict, childId);
|
|
171
|
-
childrenIds.push(...grandchildrenIds);
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
return childrenIds;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
exports.default = DashboardTaskService;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TaskService.spec.d.ts","sourceRoot":"","sources":["../../../src/services/dashboard/TaskService.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const bson_1 = require("bson");
|
|
7
|
-
const Task_1 = __importDefault(require("../../documents/dashboard/Task"));
|
|
8
|
-
const RecurrenceInfo_1 = require("../../embedded-types/dashboard/task/RecurrenceInfo");
|
|
9
|
-
const TaskService_1 = __importDefault(require("./TaskService"));
|
|
10
|
-
describe('DashboardTaskService', () => {
|
|
11
|
-
describe('getNextFrequencyDate', () => {
|
|
12
|
-
it('should return a valid date for lastDayOfMonth', () => {
|
|
13
|
-
const basisDate = new Date(2024, 0, 1);
|
|
14
|
-
const frequency = {
|
|
15
|
-
type: RecurrenceInfo_1.RecurrenceFrequencyType.lastDayOfMonth
|
|
16
|
-
};
|
|
17
|
-
const result = TaskService_1.default.getNextFrequencyDate(basisDate, frequency);
|
|
18
|
-
expect(result).toEqual(new Date(2024, 0, 31));
|
|
19
|
-
});
|
|
20
|
-
describe('every X time unit', () => {
|
|
21
|
-
it('should return a valid date for every X Day', () => {
|
|
22
|
-
const basisDate = new Date(2024, 0, 1);
|
|
23
|
-
const frequency = {
|
|
24
|
-
type: RecurrenceInfo_1.RecurrenceFrequencyType.everyXTimeUnit,
|
|
25
|
-
everyXTimeUnit: {
|
|
26
|
-
timeUnit: 'day',
|
|
27
|
-
x: 2
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
const result = TaskService_1.default.getNextFrequencyDate(basisDate, frequency);
|
|
31
|
-
expect(result).toEqual(new Date(2024, 0, 3));
|
|
32
|
-
});
|
|
33
|
-
it('should return a valid date for every X Week', () => {
|
|
34
|
-
const basisDate = new Date(2024, 0, 1);
|
|
35
|
-
const frequency = {
|
|
36
|
-
type: RecurrenceInfo_1.RecurrenceFrequencyType.everyXTimeUnit,
|
|
37
|
-
everyXTimeUnit: {
|
|
38
|
-
timeUnit: 'week',
|
|
39
|
-
x: 2
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
const result = TaskService_1.default.getNextFrequencyDate(basisDate, frequency);
|
|
43
|
-
expect(result).toEqual(new Date(2024, 0, 15));
|
|
44
|
-
});
|
|
45
|
-
it('should return a valid date for every X Month', () => {
|
|
46
|
-
const basisDate = new Date(2024, 0, 1);
|
|
47
|
-
const frequency = {
|
|
48
|
-
type: RecurrenceInfo_1.RecurrenceFrequencyType.everyXTimeUnit,
|
|
49
|
-
everyXTimeUnit: {
|
|
50
|
-
timeUnit: 'month',
|
|
51
|
-
x: 2
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
const result = TaskService_1.default.getNextFrequencyDate(basisDate, frequency);
|
|
55
|
-
expect(result).toEqual(new Date(2024, 2, 1));
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
it('should return a valid date for weekDaySet', () => {
|
|
59
|
-
const basisDate = new Date(2024, 0, 1);
|
|
60
|
-
const frequency = {
|
|
61
|
-
type: RecurrenceInfo_1.RecurrenceFrequencyType.weekDaySet,
|
|
62
|
-
weekDaySet: [0, 6]
|
|
63
|
-
};
|
|
64
|
-
const result = TaskService_1.default.getNextFrequencyDate(basisDate, frequency);
|
|
65
|
-
expect(result).toEqual(new Date(2024, 0, 6));
|
|
66
|
-
});
|
|
67
|
-
describe('Every X Weekday of Month', () => {
|
|
68
|
-
it('should return a valid date for every 2nd Sunday of Month', () => {
|
|
69
|
-
const basisDate = new Date(2024, 0, 1);
|
|
70
|
-
// Every second sunday
|
|
71
|
-
const frequency = {
|
|
72
|
-
type: RecurrenceInfo_1.RecurrenceFrequencyType.everyXWeekdayOfMonth,
|
|
73
|
-
everyXWeekdayOfMonth: {
|
|
74
|
-
weekDay: 0,
|
|
75
|
-
weekOfMonth: 2
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
const result = TaskService_1.default.getNextFrequencyDate(basisDate, frequency);
|
|
79
|
-
expect(result).toEqual(new Date(2024, 0, 14));
|
|
80
|
-
});
|
|
81
|
-
it('should return a valid date across year change', () => {
|
|
82
|
-
const basisDate = new Date(2023, 11, 30);
|
|
83
|
-
// Every 1st Saturday
|
|
84
|
-
const frequency = {
|
|
85
|
-
type: RecurrenceInfo_1.RecurrenceFrequencyType.everyXWeekdayOfMonth,
|
|
86
|
-
everyXWeekdayOfMonth: {
|
|
87
|
-
weekDay: 6,
|
|
88
|
-
weekOfMonth: 1
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
const result = TaskService_1.default.getNextFrequencyDate(basisDate, frequency);
|
|
92
|
-
expect(result).toEqual(new Date(2024, 0, 6));
|
|
93
|
-
});
|
|
94
|
-
it('should return a valid next date when the basis is the same as the recurrence', () => {
|
|
95
|
-
const basisDate = new Date(2024, 0, 14);
|
|
96
|
-
// Every second sunday
|
|
97
|
-
const frequency = {
|
|
98
|
-
type: RecurrenceInfo_1.RecurrenceFrequencyType.everyXWeekdayOfMonth,
|
|
99
|
-
everyXWeekdayOfMonth: {
|
|
100
|
-
weekDay: 0,
|
|
101
|
-
weekOfMonth: 2
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
const result = TaskService_1.default.getNextFrequencyDate(basisDate, frequency);
|
|
105
|
-
expect(result).toEqual(new Date(2024, 1, 11));
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
describe('updateDatesForRecurrence', () => {
|
|
110
|
-
describe('Start date basis', () => {
|
|
111
|
-
it('should update the start date correctly for a daily recurrence', () => {
|
|
112
|
-
const task = new Task_1.default(new bson_1.ObjectId());
|
|
113
|
-
task.startDate = new Date(2024, 0, 1);
|
|
114
|
-
task.recurrenceInfo = {
|
|
115
|
-
frequency: {
|
|
116
|
-
type: RecurrenceInfo_1.RecurrenceFrequencyType.everyXTimeUnit,
|
|
117
|
-
everyXTimeUnit: {
|
|
118
|
-
timeUnit: 'day',
|
|
119
|
-
x: 1
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
recurrenceBasis: RecurrenceInfo_1.RecurrenceBasis.startDate,
|
|
123
|
-
recurrenceEffect: RecurrenceInfo_1.RecurrenceEffect.rollOnBasis
|
|
124
|
-
};
|
|
125
|
-
TaskService_1.default.updateDatesForRecurrence(task);
|
|
126
|
-
expect(task.startDate).toEqual(new Date(2024, 0, 2));
|
|
127
|
-
});
|
|
128
|
-
it('should update the start date correctly for daily recurrence on subtask', () => {
|
|
129
|
-
const task = new Task_1.default(new bson_1.ObjectId());
|
|
130
|
-
task.startDate = new Date(2024, 0, 8);
|
|
131
|
-
task.dueDate = new Date(2024, 0, 13);
|
|
132
|
-
task.recurrenceInfo = {
|
|
133
|
-
frequency: {
|
|
134
|
-
type: RecurrenceInfo_1.RecurrenceFrequencyType.everyXTimeUnit,
|
|
135
|
-
everyXTimeUnit: {
|
|
136
|
-
timeUnit: 'day',
|
|
137
|
-
x: 1
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
recurrenceBasis: RecurrenceInfo_1.RecurrenceBasis.startDate,
|
|
141
|
-
recurrenceEffect: RecurrenceInfo_1.RecurrenceEffect.rollOnBasis
|
|
142
|
-
};
|
|
143
|
-
task.parentRecurringTaskInfo = {
|
|
144
|
-
taskId: new bson_1.ObjectId(),
|
|
145
|
-
startDate: new Date(2024, 0, 1)
|
|
146
|
-
};
|
|
147
|
-
TaskService_1.default.updateDatesForRecurrence(task);
|
|
148
|
-
expect(task.startDate).toEqual(new Date(2024, 0, 9));
|
|
149
|
-
expect(task.dueDate).toEqual(new Date(2024, 0, 14));
|
|
150
|
-
});
|
|
151
|
-
it('should update the start date correctly for a weekly recurrence', () => {
|
|
152
|
-
const task = new Task_1.default(new bson_1.ObjectId());
|
|
153
|
-
task.startDate = new Date(2024, 0, 1);
|
|
154
|
-
task.recurrenceInfo = {
|
|
155
|
-
frequency: {
|
|
156
|
-
type: RecurrenceInfo_1.RecurrenceFrequencyType.everyXTimeUnit,
|
|
157
|
-
everyXTimeUnit: {
|
|
158
|
-
timeUnit: 'week',
|
|
159
|
-
x: 1
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
recurrenceBasis: RecurrenceInfo_1.RecurrenceBasis.startDate,
|
|
163
|
-
recurrenceEffect: RecurrenceInfo_1.RecurrenceEffect.rollOnBasis
|
|
164
|
-
};
|
|
165
|
-
TaskService_1.default.updateDatesForRecurrence(task);
|
|
166
|
-
expect(task.startDate).toEqual(new Date(2024, 0, 8));
|
|
167
|
-
});
|
|
168
|
-
it('should update the start and due date correctly for a weekDaySet reccurence', () => {
|
|
169
|
-
const task = new Task_1.default(new bson_1.ObjectId());
|
|
170
|
-
task.startDate = new Date(2024, 0, 1, 11);
|
|
171
|
-
task.dueDate = new Date(2024, 0, 4, 23, 59);
|
|
172
|
-
task.recurrenceInfo = {
|
|
173
|
-
frequency: {
|
|
174
|
-
type: RecurrenceInfo_1.RecurrenceFrequencyType.weekDaySet,
|
|
175
|
-
weekDaySet: [0, 5]
|
|
176
|
-
},
|
|
177
|
-
recurrenceBasis: RecurrenceInfo_1.RecurrenceBasis.startDate,
|
|
178
|
-
recurrenceEffect: RecurrenceInfo_1.RecurrenceEffect.rollOnBasis
|
|
179
|
-
};
|
|
180
|
-
TaskService_1.default.updateDatesForRecurrence(task);
|
|
181
|
-
expect(task.startDate).toEqual(new Date(2024, 0, 5, 11));
|
|
182
|
-
expect(task.dueDate).toEqual(new Date(2024, 0, 8, 23, 59));
|
|
183
|
-
});
|
|
184
|
-
it('should update the start and due date correctly for a everyXWeekdayOfMonth reccurence', () => {
|
|
185
|
-
const task = new Task_1.default(new bson_1.ObjectId());
|
|
186
|
-
task.startDate = new Date(2024, 0, 1, 11);
|
|
187
|
-
task.dueDate = new Date(2024, 0, 4, 23, 59);
|
|
188
|
-
task.recurrenceInfo = {
|
|
189
|
-
frequency: {
|
|
190
|
-
type: RecurrenceInfo_1.RecurrenceFrequencyType.everyXWeekdayOfMonth,
|
|
191
|
-
everyXWeekdayOfMonth: {
|
|
192
|
-
weekDay: 0,
|
|
193
|
-
weekOfMonth: 1
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
recurrenceBasis: RecurrenceInfo_1.RecurrenceBasis.startDate,
|
|
197
|
-
recurrenceEffect: RecurrenceInfo_1.RecurrenceEffect.rollOnBasis
|
|
198
|
-
};
|
|
199
|
-
TaskService_1.default.updateDatesForRecurrence(task);
|
|
200
|
-
expect(task.startDate).toEqual(new Date(2024, 0, 7, 11));
|
|
201
|
-
expect(task.dueDate).toEqual(new Date(2024, 0, 10, 23, 59));
|
|
202
|
-
});
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
});
|