Skip to content

Commit

Permalink
Add terminationBaseModel
Browse files Browse the repository at this point in the history
  • Loading branch information
JLampeMW committed Sep 30, 2024
1 parent 1cf99e8 commit 01666d8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/models/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
19 changes: 19 additions & 0 deletions packages/models/src/base/TerminationBaseModel.ts
Original file line number Diff line number Diff line change
@@ -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<void>;
}
6 changes: 4 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 01666d8

Please sign in to comment.