diff --git a/.pnp.cjs b/.pnp.cjs index 852300dc..ab1b6b30 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -2174,6 +2174,7 @@ const RAW_RUNTIME_STATE = ["@testing-library/react", "virtual:e06e30328889a833dfcbfbc5c33f5e1173628bc1414934ce897e2f1b90b91087fa3f8b59a8a3ced3a53b1f7df474adc821437919c179e8897ac6cecf6bf31f00#npm:16.0.1"],\ ["@types/dinero.js", "npm:1.9.4"],\ ["@types/jest", "npm:29.5.12"],\ + ["@types/luxon", "npm:3.4.2"],\ ["@types/react", "npm:18.3.3"],\ ["@types/react-dom", "npm:18.3.0"],\ ["@typescript-eslint/eslint-plugin", "virtual:36a01d8083315b8a6e8362097258ea8bc0f9dfb672cb210742e054760850c673a1038f542a6b7156397b5275ace8ee0482231cac5e8898044fa1a1c29f78ee5b#npm:7.18.0"],\ @@ -2187,6 +2188,7 @@ const RAW_RUNTIME_STATE = ["eslint-plugin-prettier", "virtual:36a01d8083315b8a6e8362097258ea8bc0f9dfb672cb210742e054760850c673a1038f542a6b7156397b5275ace8ee0482231cac5e8898044fa1a1c29f78ee5b#npm:5.2.1"],\ ["jest", "virtual:b2e857f8c518119e848cf4ef51cff2bf36fb4db0f8e551e1de9a65b88f5466b35ebea1913543d6258bb39baec552d66e8e4c2e8ae0858f2f3f9bf35009befb70#npm:29.7.0"],\ ["jest-environment-jsdom", "virtual:e06e30328889a833dfcbfbc5c33f5e1173628bc1414934ce897e2f1b90b91087fa3f8b59a8a3ced3a53b1f7df474adc821437919c179e8897ac6cecf6bf31f00#npm:29.7.0"],\ + ["luxon", "npm:3.5.0"],\ ["object-code", "npm:1.3.3"],\ ["polytype", "npm:0.17.0"],\ ["prettier", "npm:3.3.3"],\ diff --git a/packages/models/package.json b/packages/models/package.json index 86050fde..2eef080c 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -43,6 +43,7 @@ "another-deep-freeze": "^1.0.0", "context": "^3.0.31", "dinero.js": "^1.9.1", + "luxon": "^3.5.0", "object-code": "^1.3.3", "polytype": "^0.17.0", "tsd": "^0.31.2", @@ -56,6 +57,7 @@ "@testing-library/react": "^16.0.1", "@types/dinero.js": "^1", "@types/jest": "^29.5.12", + "@types/luxon": "^3", "@types/react": "^18.3.3", "@types/react-dom": "^18", "@typescript-eslint/eslint-plugin": "^7.18.0", diff --git a/packages/models/src/base/TerminationBaseModel.ts b/packages/models/src/base/TerminationBaseModel.ts new file mode 100644 index 00000000..f5eea784 --- /dev/null +++ b/packages/models/src/base/TerminationBaseModel.ts @@ -0,0 +1,19 @@ +import { DateTime } from "luxon"; + +export abstract class TerminationBase { + public readonly scheduledAt: DateTime; + public readonly targetDate: DateTime; + public readonly reason?: string; + + protected constructor( + scheduledAt: DateTime, + targetDate: DateTime, + reason?: string, + ) { + this.scheduledAt = scheduledAt; + this.targetDate = targetDate; + this.reason = reason; + } + + public abstract cancel(): Promise; +} diff --git a/yarn.lock b/yarn.lock index 7b828bdd..bead5c43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1538,6 +1538,7 @@ __metadata: "@testing-library/react": "npm:^16.0.1" "@types/dinero.js": "npm:^1" "@types/jest": "npm:^29.5.12" + "@types/luxon": "npm:^3" "@types/react": "npm:^18.3.3" "@types/react-dom": "npm:^18" "@typescript-eslint/eslint-plugin": "npm:^7.18.0" @@ -1551,6 +1552,7 @@ __metadata: eslint-plugin-prettier: "npm:^5.2.1" jest: "npm:^29.7.0" jest-environment-jsdom: "npm:^29.7.0" + luxon: "npm:^3.5.0" object-code: "npm:^1.3.3" polytype: "npm:^0.17.0" prettier: "npm:^3.3.3" @@ -2850,7 +2852,7 @@ __metadata: languageName: node linkType: hard -"@types/luxon@npm:3.4.2": +"@types/luxon@npm:3.4.2, @types/luxon@npm:^3": version: 3.4.2 resolution: "@types/luxon@npm:3.4.2" checksum: 10/fd89566e3026559f2bc4ddcc1e70a2c16161905ed50be9473ec0cfbbbe919165041408c4f6e06c4bcf095445535052e2c099087c76b1b38e368127e618fc968d @@ -8128,7 +8130,7 @@ __metadata: languageName: node linkType: hard -"luxon@npm:~3.5.0": +"luxon@npm:^3.5.0, luxon@npm:~3.5.0": version: 3.5.0 resolution: "luxon@npm:3.5.0" checksum: 10/48f86e6c1c96815139f8559456a3354a276ba79bcef0ae0d4f2172f7652f3ba2be2237b0e103b8ea0b79b47715354ac9fac04eb1db3485dcc72d5110491dd47f