@turndown/library 0.1.23 → 0.1.24

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.
@@ -46,6 +46,7 @@ export declare const ERROR_CODES: {
46
46
  readonly NOT_FOUND: "NOT_FOUND";
47
47
  readonly CONFLICT: "CONFLICT";
48
48
  readonly ALREADY_EXISTS: "ALREADY_EXISTS";
49
+ readonly RATE_LIMIT: "RATE_LIMIT";
49
50
  readonly RATE_LIMIT_EXCEEDED: "RATE_LIMIT_EXCEEDED";
50
51
  readonly INTERNAL_ERROR: "INTERNAL_ERROR";
51
52
  readonly DATABASE_ERROR: "DATABASE_ERROR";
@@ -30,6 +30,7 @@ export const ERROR_CODES = {
30
30
  CONFLICT: "CONFLICT",
31
31
  ALREADY_EXISTS: "ALREADY_EXISTS",
32
32
  // 429 - Rate Limiting
33
+ RATE_LIMIT: "RATE_LIMIT",
33
34
  RATE_LIMIT_EXCEEDED: "RATE_LIMIT_EXCEEDED",
34
35
  // 500 - Server Errors
35
36
  INTERNAL_ERROR: "INTERNAL_ERROR",
@@ -1,5 +1,4 @@
1
1
  import { TRecordValue } from "../base";
2
- export * from "./routes";
3
2
  export declare const DAMAGE_SEVERITY: {
4
3
  readonly LOW: "LOW";
5
4
  readonly MEDIUM: "MEDIUM";
@@ -8,44 +7,72 @@ export declare const DAMAGE_SEVERITY: {
8
7
  };
9
8
  export type TDamageSeverity = TRecordValue<typeof DAMAGE_SEVERITY>;
10
9
  export declare const DAMAGE_STATUS: {
11
- OPEN: string;
12
- IN_REVIEW: string;
13
- ASSIGNED: string;
14
- IN_PROGRESS: string;
15
- RESOLVED: string;
16
- CLOSED: string;
17
- ESCALATED: string;
10
+ readonly OPEN: "OPEN";
11
+ readonly IN_REVIEW: "IN_REVIEW";
12
+ readonly ASSIGNED: "ASSIGNED";
13
+ readonly IN_PROGRESS: "IN_PROGRESS";
14
+ readonly RESOLVED: "RESOLVED";
15
+ readonly CLOSED: "CLOSED";
16
+ readonly ESCALATED: "ESCALATED";
18
17
  };
19
18
  export type TDamageStatus = TRecordValue<typeof DAMAGE_STATUS>;
19
+ export declare const WORK_ORDER_PRIORITY: {
20
+ readonly LOW: "LOW";
21
+ readonly NORMAL: "NORMAL";
22
+ readonly HIGH: "HIGH";
23
+ readonly URGENT: "URGENT";
24
+ };
25
+ export type TWorkOrderPriority = TRecordValue<typeof WORK_ORDER_PRIORITY>;
26
+ export declare const WORK_ORDER_STATUS: {
27
+ readonly PENDING: "PENDING";
28
+ readonly SCHEDULED: "SCHEDULED";
29
+ readonly IN_PROGRESS: "IN_PROGRESS";
30
+ readonly COMPLETED: "COMPLETED";
31
+ readonly CANCELLED: "CANCELLED";
32
+ };
33
+ export type TWorkOrderStatus = TRecordValue<typeof WORK_ORDER_STATUS>;
20
34
  export interface IDamageReport {
21
35
  id: string;
22
36
  propertyId: string;
23
37
  roomId: string;
38
+ workSessionId: string | null;
24
39
  cleaningSessionId?: string;
25
40
  reportedBy: string;
41
+ reportedAt: Date;
26
42
  severity: TDamageSeverity;
27
43
  status: TDamageStatus;
28
44
  title: string;
29
45
  description: string;
30
- locationDetails?: string;
31
- estimatedCost?: number;
32
- actualCost?: number;
33
- assignedTo?: string;
34
- resolvedAt?: Date;
35
- resolvedBy?: string;
36
- resolutionNotes?: string;
46
+ locationDetails: string | null;
47
+ estimatedCost: number | null;
48
+ actualCost: number | null;
49
+ assignedTo: string | null;
50
+ assignedAt: Date | null;
51
+ resolvedAt: Date | null;
52
+ resolvedBy: string | null;
53
+ resolutionNotes: string | null;
37
54
  requiresProfessional: boolean;
38
- photos: IDamagePhoto[];
39
- comments: IDamageComment[];
55
+ vendorInfo: string | null;
56
+ insuranceClaimNumber: string | null;
57
+ isTenantResponsible: boolean;
58
+ tenantChargeAmount: number | null;
59
+ createdAt: Date;
60
+ updatedAt: Date;
61
+ photos?: IDamagePhoto[];
62
+ comments?: IDamageComment[];
40
63
  }
41
- export interface IDamagePhoto {
64
+ export interface IDamageReportPhoto {
42
65
  id: string;
43
66
  damageReportId: string;
44
67
  photoId: string;
45
- photoUrl: string;
46
- caption?: string;
68
+ photoUrl?: string;
69
+ caption: string | null;
47
70
  isBeforePhoto: boolean;
48
71
  displayOrder: number;
72
+ uploadedBy: string | null;
73
+ createdAt: Date;
74
+ }
75
+ export interface IDamagePhoto extends IDamageReportPhoto {
49
76
  }
50
77
  export interface IDamageComment {
51
78
  id: string;
@@ -53,5 +80,69 @@ export interface IDamageComment {
53
80
  userId: string;
54
81
  userName?: string;
55
82
  comment: string;
83
+ isInternal: boolean;
84
+ createdAt: Date;
85
+ updatedAt: Date;
86
+ }
87
+ export interface IDamageReportStatusHistory {
88
+ id: string;
89
+ damageReportId: string;
90
+ previousStatus: TDamageStatus | null;
91
+ newStatus: TDamageStatus;
92
+ changedBy: string;
93
+ reason: string | null;
94
+ createdAt: Date;
95
+ }
96
+ export interface IWorkOrder {
97
+ id: string;
98
+ damageReportId: string | null;
99
+ propertyId: string;
100
+ roomId: string | null;
101
+ workOrderNumber: string | null;
102
+ priority: TWorkOrderPriority;
103
+ category: string | null;
104
+ assignedTo: string | null;
105
+ assignedAt: Date | null;
106
+ scheduledDate: Date | null;
107
+ scheduledTimeStart: string | null;
108
+ scheduledTimeEnd: string | null;
109
+ startedAt: Date | null;
110
+ completedAt: Date | null;
111
+ completedBy: string | null;
112
+ description: string;
113
+ workPerformed: string | null;
114
+ materialsUsed: string | null;
115
+ laborHours: number | null;
116
+ laborCost: number | null;
117
+ materialsCost: number | null;
118
+ totalCost: number | null;
119
+ status: TWorkOrderStatus;
56
120
  createdAt: Date;
121
+ updatedAt: Date;
122
+ }
123
+ export interface ICreateDamageReportInput {
124
+ propertyId: string;
125
+ roomId: string;
126
+ workSessionId?: string;
127
+ reportedBy: string;
128
+ severity: TDamageSeverity;
129
+ title: string;
130
+ description: string;
131
+ locationDetails?: string;
132
+ estimatedCost?: number;
133
+ requiresProfessional?: boolean;
134
+ isTenantResponsible?: boolean;
135
+ tenantChargeAmount?: number;
57
136
  }
137
+ export interface ICreateWorkOrderInput {
138
+ damageReportId?: string;
139
+ propertyId: string;
140
+ roomId?: string;
141
+ priority?: TWorkOrderPriority;
142
+ category?: string;
143
+ description: string;
144
+ scheduledDate?: Date;
145
+ scheduledTimeStart?: string;
146
+ scheduledTimeEnd?: string;
147
+ }
148
+ export * from "./routes";
@@ -1,4 +1,3 @@
1
- export * from "./routes";
2
1
  export const DAMAGE_SEVERITY = {
3
2
  LOW: "LOW",
4
3
  MEDIUM: "MEDIUM",
@@ -14,3 +13,17 @@ export const DAMAGE_STATUS = {
14
13
  CLOSED: "CLOSED",
15
14
  ESCALATED: "ESCALATED",
16
15
  };
16
+ export const WORK_ORDER_PRIORITY = {
17
+ LOW: "LOW",
18
+ NORMAL: "NORMAL",
19
+ HIGH: "HIGH",
20
+ URGENT: "URGENT",
21
+ };
22
+ export const WORK_ORDER_STATUS = {
23
+ PENDING: "PENDING",
24
+ SCHEDULED: "SCHEDULED",
25
+ IN_PROGRESS: "IN_PROGRESS",
26
+ COMPLETED: "COMPLETED",
27
+ CANCELLED: "CANCELLED",
28
+ };
29
+ export * from "./routes";
@@ -1,4 +1,4 @@
1
- import type { IDamageComment, IDamagePhoto, IDamageReport, TDamageStatus } from ".";
1
+ import type { ICreateDamageReportInput, ICreateWorkOrderInput, IDamageComment, IDamagePhoto, IDamageReport, IDamageReportStatusHistory, IWorkOrder, TDamageStatus, TWorkOrderStatus } from ".";
2
2
  export interface IDamageReportPropertyRouteParams {
3
3
  propertyId: string;
4
4
  }
@@ -14,13 +14,7 @@ export interface IDamageReportWorkOrderRouteParams {
14
14
  export interface IIncludeResolvedQuery {
15
15
  includeResolved?: string;
16
16
  }
17
- export interface ICreateDamageReportRequest extends Partial<IDamageReport> {
18
- propertyId: string;
19
- roomId: string;
20
- reportedBy: string;
21
- severity: IDamageReport["severity"];
22
- title: string;
23
- description: string;
17
+ export interface ICreateDamageReportRequest extends ICreateDamageReportInput {
24
18
  }
25
19
  export interface ICreateDamageReportResponse extends IDamageReport {
26
20
  }
@@ -78,50 +72,10 @@ export interface IAddDamageReportCommentRequest {
78
72
  }
79
73
  export interface IAddDamageReportCommentResponse extends IDamageComment {
80
74
  }
81
- export interface IDamageReportStatusHistory {
82
- id: string;
83
- damageReportId: string;
84
- previousStatus: TDamageStatus | null;
85
- newStatus: TDamageStatus;
86
- changedBy: string;
87
- reason: string | null;
88
- createdAt: Date;
89
- }
90
75
  export interface IGetDamageReportHistoryRequest extends IDamageReportRouteParams {
91
76
  }
92
77
  export type IGetDamageReportHistoryResponse = IDamageReportStatusHistory[];
93
- export type TWorkOrderPriority = "LOW" | "NORMAL" | "HIGH" | "URGENT";
94
- export type TWorkOrderStatus = "PENDING" | "SCHEDULED" | "IN_PROGRESS" | "COMPLETED" | "CANCELLED";
95
- export interface IWorkOrder {
96
- id: string;
97
- damageReportId: string | null;
98
- propertyId: string;
99
- roomId: string | null;
100
- workOrderNumber: string | null;
101
- priority: TWorkOrderPriority;
102
- category: string | null;
103
- assignedTo: string | null;
104
- assignedAt: Date | null;
105
- scheduledDate: Date | null;
106
- scheduledTimeStart: string | null;
107
- scheduledTimeEnd: string | null;
108
- startedAt: Date | null;
109
- completedAt: Date | null;
110
- completedBy: string | null;
111
- description: string;
112
- workPerformed: string | null;
113
- materialsUsed: string | null;
114
- laborHours: number | null;
115
- laborCost: number | null;
116
- materialsCost: number | null;
117
- totalCost: number | null;
118
- status: TWorkOrderStatus;
119
- createdAt: Date;
120
- updatedAt: Date;
121
- }
122
- export interface ICreateWorkOrderRequest extends Partial<IWorkOrder> {
123
- propertyId: string;
124
- description: string;
78
+ export interface ICreateWorkOrderRequest extends ICreateWorkOrderInput {
125
79
  }
126
80
  export interface ICreateWorkOrderResponse extends IWorkOrder {
127
81
  }
@@ -151,3 +105,8 @@ export interface ICompleteWorkOrderResponse extends IWorkOrder {
151
105
  export interface IGetWorkOrdersByPropertyIdRequest extends IDamageReportPropertyRouteParams {
152
106
  }
153
107
  export type IGetWorkOrdersByPropertyIdResponse = IWorkOrder[];
108
+ export interface IUpdateWorkOrderStatusRequest {
109
+ status: TWorkOrderStatus;
110
+ }
111
+ export interface IUpdateWorkOrderStatusResponse extends IWorkOrder {
112
+ }
@@ -7,6 +7,7 @@ export declare const IMAGE_ENTITY_TYPE: {
7
7
  readonly PROPERTY_ROOM: "PROPERTY_ROOM";
8
8
  readonly MAINTENANCE_TICKET: "MAINTENANCE_TICKET";
9
9
  readonly WORK_REPORT: "WORK_REPORT";
10
+ readonly CLEANING_REPORT: "CLEANING_REPORT";
10
11
  readonly TURNDOWN_DEFAULT: "TURNDOWN_DEFAULT";
11
12
  };
12
13
  export type TStoredImageEntityType = (typeof IMAGE_ENTITY_TYPE)[keyof typeof IMAGE_ENTITY_TYPE];
@@ -7,5 +7,6 @@ export const IMAGE_ENTITY_TYPE = {
7
7
  PROPERTY_ROOM: "PROPERTY_ROOM",
8
8
  MAINTENANCE_TICKET: "MAINTENANCE_TICKET",
9
9
  WORK_REPORT: "WORK_REPORT",
10
+ CLEANING_REPORT: "CLEANING_REPORT",
10
11
  TURNDOWN_DEFAULT: "TURNDOWN_DEFAULT",
11
12
  };
@@ -17,5 +17,6 @@ export * from "./job";
17
17
  export * from "./property";
18
18
  export * from "./room";
19
19
  export * from "./room-checklist";
20
+ export * from "./subscription";
20
21
  export * from "./user";
21
22
  export * from "./work-session";
@@ -17,5 +17,6 @@ export * from "./job";
17
17
  export * from "./property";
18
18
  export * from "./room";
19
19
  export * from "./room-checklist";
20
+ export * from "./subscription";
20
21
  export * from "./user";
21
22
  export * from "./work-session";
@@ -0,0 +1,32 @@
1
+ import { TRecordValue } from "../base";
2
+ export declare const SUBSCRIPTION_STATUS: {
3
+ readonly ACTIVE: "active";
4
+ readonly CANCELED: "canceled";
5
+ readonly EXPIRED: "expired";
6
+ readonly PAST_DUE: "past_due";
7
+ readonly TRIALING: "trialing";
8
+ };
9
+ export type TSubscriptionStatus = TRecordValue<typeof SUBSCRIPTION_STATUS>;
10
+ export declare const SUBSCRIPTION_PROVIDER: {
11
+ readonly STRIPE: "stripe";
12
+ readonly APPLE: "apple";
13
+ readonly GOOGLE: "google";
14
+ };
15
+ export type TSubscriptionProvider = TRecordValue<typeof SUBSCRIPTION_PROVIDER>;
16
+ export declare const BILLING_PERIOD: {
17
+ readonly MONTHLY: "monthly";
18
+ readonly YEARLY: "yearly";
19
+ };
20
+ export type TBillingPeriod = TRecordValue<typeof BILLING_PERIOD>;
21
+ export interface IUserSubscription {
22
+ id: string;
23
+ userId: string;
24
+ planId: string;
25
+ status: TSubscriptionStatus;
26
+ billingPeriod: TBillingPeriod;
27
+ currentPeriodStart: Date;
28
+ currentPeriodEnd: Date;
29
+ provider: TSubscriptionProvider;
30
+ providerSubscriptionId: string;
31
+ cancelAtPeriodEnd: boolean;
32
+ }
@@ -0,0 +1,16 @@
1
+ export const SUBSCRIPTION_STATUS = {
2
+ ACTIVE: "active",
3
+ CANCELED: "canceled",
4
+ EXPIRED: "expired",
5
+ PAST_DUE: "past_due",
6
+ TRIALING: "trialing",
7
+ };
8
+ export const SUBSCRIPTION_PROVIDER = {
9
+ STRIPE: "stripe",
10
+ APPLE: "apple",
11
+ GOOGLE: "google",
12
+ };
13
+ export const BILLING_PERIOD = {
14
+ MONTHLY: "monthly",
15
+ YEARLY: "yearly",
16
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turndown/library",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "Shared TypeScript library for the Turndown suite.",
5
5
  "keywords": [
6
6
  "types",