@kkkarsss/lr-models 1.0.3 → 1.0.5

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.
@@ -1,6 +1,6 @@
1
1
  import { TGUID } from '../guid';
2
- export type TEventType = 'create-task' | 'complete-task' | 'complete-task-overdue' | 'delete-task' | 'mark-task-as-not-completed' | 'create-project' | 'archive-project' | 'unarchive-project' | 'reduce-priority' | 'increase-priority' | 'create-note' | 'success-archive-note' | 'not-needed-archive-note' | 'take-to-work';
3
- export type TEventEntityType = 'task' | 'project' | 'note' | 'person' | 'system';
2
+ export type TEventType = 'create-task' | 'complete-task' | 'complete-task-overdue' | 'delete-task' | 'mark-task-as-not-completed' | 'create-project' | 'archive-project' | 'unarchive-project' | 'reduce-priority' | 'increase-priority' | 'create-note' | 'success-archive-note' | 'not-needed-archive-note' | 'take-to-work' | 'create-incident';
3
+ export type TEventEntityType = 'task' | 'project' | 'note' | 'person' | 'system' | 'incident';
4
4
  export type TEvent = {
5
5
  id: TGUID;
6
6
  type: TEventType;
@@ -0,0 +1,33 @@
1
+ import { Temporal } from '@js-temporal/polyfill';
2
+ import { TGUID } from '../guid';
3
+ export type TIncident = {
4
+ id: TGUID;
5
+ title: string;
6
+ description: string;
7
+ participants: TGUID[];
8
+ dateStart: Temporal.PlainDate;
9
+ timeStart: Temporal.PlainTime;
10
+ dateEnd: Temporal.PlainDate;
11
+ timeEnd: Temporal.PlainTime;
12
+ tags: TGUID[];
13
+ createdAt: Temporal.PlainDateTime;
14
+ updatedAt: Temporal.PlainDateTime;
15
+ };
16
+ export type TCreateIncidentRequestBody = Omit<TIncident, 'id' | 'createdAt' | 'updatedAt' | 'participants'> & {
17
+ authorId: TGUID;
18
+ participants?: TGUID[];
19
+ };
20
+ export type TCreateIncidentResponse = TIncident;
21
+ export type TGetIncidentsByUserIdRequestParams = {
22
+ userId: TGUID;
23
+ };
24
+ export type TGetIncidentsByUserIdResponse = TIncident[];
25
+ export type TDeleteIncidentRequestParams = {
26
+ id: TGUID;
27
+ };
28
+ export type TDeleteIncidentResponse = void;
29
+ export type TLinkUserToIncidentRequestBody = {
30
+ incidentId: TGUID;
31
+ userId: TGUID;
32
+ approved?: boolean;
33
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import { Temporal } from '@js-temporal/polyfill';
2
+ import { TGUID } from '../guid';
3
+ export type TIncidentUser = {
4
+ incidentId: TGUID;
5
+ participantId: TGUID;
6
+ approved?: boolean;
7
+ approvedAt?: Temporal.PlainDateTime;
8
+ linkedAt?: Temporal.PlainDateTime;
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -10,3 +10,5 @@ export * from './user-day';
10
10
  export * from './routine';
11
11
  export * from './routine-entry';
12
12
  export * from './day-item';
13
+ export * from './incident/incident';
14
+ export * from './incident-user/incident-user';
@@ -26,3 +26,5 @@ __exportStar(require("./user-day"), exports);
26
26
  __exportStar(require("./routine"), exports);
27
27
  __exportStar(require("./routine-entry"), exports);
28
28
  __exportStar(require("./day-item"), exports);
29
+ __exportStar(require("./incident/incident"), exports);
30
+ __exportStar(require("./incident-user/incident-user"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kkkarsss/lr-models",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Common models for life-reader project",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,6 +15,7 @@
15
15
  "author": "",
16
16
  "license": "MIT",
17
17
  "devDependencies": {
18
+ "@js-temporal/polyfill": "^0.5.1",
18
19
  "@eslint/js": "^9.39.2",
19
20
  "typescript": "5.9.3",
20
21
  "eslint": "^9.39.1",