@turndown/library 0.1.16 → 0.1.22

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.
Files changed (60) hide show
  1. package/dist/helpers/date/index.d.ts +113 -0
  2. package/dist/helpers/date/index.js +171 -0
  3. package/dist/helpers/index.d.ts +3 -1
  4. package/dist/helpers/index.js +2 -1
  5. package/dist/helpers/object/index.d.ts +160 -75
  6. package/dist/helpers/object/index.js +355 -168
  7. package/dist/helpers/string/index.d.ts +227 -74
  8. package/dist/helpers/string/index.js +448 -114
  9. package/dist/types/api/index.d.ts +22 -11
  10. package/dist/types/api/index.js +9 -2
  11. package/dist/types/auth/index.d.ts +56 -18
  12. package/dist/types/auth/index.js +7 -0
  13. package/dist/types/auth/routes.d.ts +76 -47
  14. package/dist/types/auth/routes.js +0 -1
  15. package/dist/types/base/index.d.ts +200 -69
  16. package/dist/types/base/index.js +116 -0
  17. package/dist/types/base/paging.types.d.ts +11 -11
  18. package/dist/types/checklist-template/index.d.ts +8 -8
  19. package/dist/types/checklist-template/routes.d.ts +57 -28
  20. package/dist/types/checklist-template/routes.js +0 -1
  21. package/dist/types/company/index.d.ts +5 -5
  22. package/dist/types/company/routes.d.ts +81 -33
  23. package/dist/types/company/routes.js +0 -1
  24. package/dist/types/damage-report/index.d.ts +9 -9
  25. package/dist/types/damage-report/routes.d.ts +128 -51
  26. package/dist/types/damage-report/routes.js +0 -1
  27. package/dist/types/errors/index.d.ts +15 -16
  28. package/dist/types/errors/index.js +17 -7
  29. package/dist/types/health/index.d.ts +20 -0
  30. package/dist/types/health/index.js +1 -0
  31. package/dist/types/health/routes.d.ts +10 -0
  32. package/dist/types/health/routes.js +1 -0
  33. package/dist/types/image/index.d.ts +34 -0
  34. package/dist/types/image/index.js +11 -0
  35. package/dist/types/image/routes.d.ts +32 -0
  36. package/dist/types/image/routes.js +1 -0
  37. package/dist/types/index.d.ts +3 -0
  38. package/dist/types/index.js +3 -0
  39. package/dist/types/inventory/index.d.ts +13 -87
  40. package/dist/types/inventory/routes.d.ts +73 -36
  41. package/dist/types/inventory/routes.js +0 -1
  42. package/dist/types/job/index.d.ts +7 -0
  43. package/dist/types/job/index.js +1 -0
  44. package/dist/types/property/index.d.ts +88 -29
  45. package/dist/types/property/index.js +23 -23
  46. package/dist/types/property/routes.d.ts +40 -14
  47. package/dist/types/property/routes.js +0 -1
  48. package/dist/types/room/index.d.ts +4 -4
  49. package/dist/types/room/routes.d.ts +27 -8
  50. package/dist/types/room/routes.js +0 -1
  51. package/dist/types/room-checklist/index.d.ts +9 -9
  52. package/dist/types/room-checklist/routes.d.ts +50 -28
  53. package/dist/types/room-checklist/routes.js +0 -1
  54. package/dist/types/user/index.d.ts +12 -12
  55. package/dist/types/user/routes.d.ts +26 -16
  56. package/dist/types/user/routes.js +0 -1
  57. package/dist/types/work-session/index.d.ts +12 -12
  58. package/dist/types/work-session/routes.d.ts +55 -34
  59. package/dist/types/work-session/routes.js +0 -1
  60. package/package.json +14 -5
@@ -1,76 +1,153 @@
1
- export interface CreateDamageReportRequest {
1
+ import type { IDamageComment, IDamagePhoto, IDamageReport, TDamageStatus } from ".";
2
+ export interface IDamageReportPropertyRouteParams {
3
+ propertyId: string;
2
4
  }
3
- export interface CreateDamageReportResponse {
5
+ export interface IDamageReportRoomRouteParams {
6
+ roomId: string;
4
7
  }
5
- export interface GetDamageReportByIdRequest {
8
+ export interface IDamageReportRouteParams {
9
+ reportId: string;
6
10
  }
7
- export interface GetDamageReportByIdResponse {
11
+ export interface IDamageReportWorkOrderRouteParams {
12
+ workOrderId: string;
13
+ }
14
+ export interface IIncludeResolvedQuery {
15
+ includeResolved?: string;
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;
24
+ }
25
+ export interface ICreateDamageReportResponse extends IDamageReport {
26
+ }
27
+ export interface IGetDamageReportByIdRequest extends IDamageReportRouteParams {
28
+ }
29
+ export interface IGetDamageReportByIdResponse extends IDamageReport {
30
+ }
31
+ export interface IUpdateDamageReportRequest extends Partial<IDamageReport> {
32
+ }
33
+ export interface IUpdateDamageReportResponse extends IDamageReport {
8
34
  }
9
- export interface UpdateDamageReportRequest {
35
+ export interface IUpdateDamageReportStatusRequest {
36
+ status: TDamageStatus;
37
+ changedBy: string;
38
+ reason?: string;
10
39
  }
11
- export interface UpdateDamageReportResponse {
40
+ export interface IUpdateDamageReportStatusResponse extends IDamageReport {
12
41
  }
13
- export interface UpdateDamageReportStatusRequest {
42
+ export interface IAssignDamageReportRequest {
43
+ assignedTo: string;
14
44
  }
15
- export interface UpdateDamageReportStatusResponse {
45
+ export interface IAssignDamageReportResponse extends IDamageReport {
16
46
  }
17
- export interface AssignDamageReportRequest {
47
+ export interface IResolveDamageReportRequest {
48
+ resolvedBy: string;
49
+ resolutionNotes?: string;
50
+ actualCost?: number;
18
51
  }
19
- export interface AssignDamageReportResponse {
52
+ export interface IResolveDamageReportResponse extends IDamageReport {
20
53
  }
21
- export interface ResolveDamageReportRequest {
54
+ export interface IGetDamageReportsByPropertyIdRequest extends IDamageReportPropertyRouteParams {
22
55
  }
23
- export interface ResolveDamageReportResponse {
56
+ export type IGetDamageReportsByPropertyIdResponse = IDamageReport[];
57
+ export interface IGetDamageReportsByRoomIdRequest extends IDamageReportRoomRouteParams {
24
58
  }
25
- export interface GetDamageReportsByPropertyIdRequest {
59
+ export type IGetDamageReportsByRoomIdResponse = IDamageReport[];
60
+ export interface IGetDamageReportPhotosRequest extends IDamageReportRouteParams {
26
61
  }
27
- export interface GetDamageReportsByPropertyIdResponse {
62
+ export type IGetDamageReportPhotosResponse = IDamagePhoto[];
63
+ export interface IAddDamageReportPhotoRequest {
64
+ photoId: string;
65
+ isBeforePhoto?: boolean;
66
+ caption?: string;
67
+ uploadedBy?: string;
28
68
  }
29
- export interface GetDamageReportsByRoomIdRequest {
69
+ export interface IAddDamageReportPhotoResponse extends IDamagePhoto {
30
70
  }
31
- export interface GetDamageReportsByRoomIdResponse {
71
+ export interface IGetDamageReportCommentsRequest extends IDamageReportRouteParams {
32
72
  }
33
- export interface GetDamageReportPhotosRequest {
73
+ export type IGetDamageReportCommentsResponse = IDamageComment[];
74
+ export interface IAddDamageReportCommentRequest {
75
+ userId: string;
76
+ comment: string;
77
+ isInternal?: boolean;
34
78
  }
35
- export interface GetDamageReportPhotosResponse {
79
+ export interface IAddDamageReportCommentResponse extends IDamageComment {
36
80
  }
37
- export interface AddDamageReportPhotoRequest {
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;
38
89
  }
39
- export interface AddDamageReportPhotoResponse {
90
+ export interface IGetDamageReportHistoryRequest extends IDamageReportRouteParams {
40
91
  }
41
- export interface GetDamageReportCommentsRequest {
92
+ 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;
42
121
  }
43
- export interface GetDamageReportCommentsResponse {
122
+ export interface ICreateWorkOrderRequest extends Partial<IWorkOrder> {
123
+ propertyId: string;
124
+ description: string;
44
125
  }
45
- export interface AddDamageReportCommentRequest {
126
+ export interface ICreateWorkOrderResponse extends IWorkOrder {
46
127
  }
47
- export interface AddDamageReportCommentResponse {
128
+ export interface IGetWorkOrderByIdRequest extends IDamageReportWorkOrderRouteParams {
48
129
  }
49
- export interface GetDamageReportHistoryRequest {
50
- }
51
- export interface GetDamageReportHistoryResponse {
52
- }
53
- export interface CreateWorkOrderRequest {
54
- }
55
- export interface CreateWorkOrderResponse {
56
- }
57
- export interface GetWorkOrderByIdRequest {
58
- }
59
- export interface GetWorkOrderByIdResponse {
60
- }
61
- export interface UpdateWorkOrderRequest {
62
- }
63
- export interface UpdateWorkOrderResponse {
64
- }
65
- export interface AssignWorkOrderRequest {
66
- }
67
- export interface AssignWorkOrderResponse {
68
- }
69
- export interface CompleteWorkOrderRequest {
70
- }
71
- export interface CompleteWorkOrderResponse {
72
- }
73
- export interface GetWorkOrdersByPropertyIdRequest {
74
- }
75
- export interface GetWorkOrdersByPropertyIdResponse {
130
+ export interface IGetWorkOrderByIdResponse extends IWorkOrder {
76
131
  }
132
+ export interface IUpdateWorkOrderRequest extends Partial<IWorkOrder> {
133
+ }
134
+ export interface IUpdateWorkOrderResponse extends IWorkOrder {
135
+ }
136
+ export interface IAssignWorkOrderRequest {
137
+ assignedTo: string;
138
+ }
139
+ export interface IAssignWorkOrderResponse extends IWorkOrder {
140
+ }
141
+ export interface ICompleteWorkOrderRequest {
142
+ completedBy: string;
143
+ workPerformed: string;
144
+ materialsUsed?: string;
145
+ laborHours?: number;
146
+ laborCost?: number;
147
+ materialsCost?: number;
148
+ }
149
+ export interface ICompleteWorkOrderResponse extends IWorkOrder {
150
+ }
151
+ export interface IGetWorkOrdersByPropertyIdRequest extends IDamageReportPropertyRouteParams {
152
+ }
153
+ export type IGetWorkOrdersByPropertyIdResponse = IWorkOrder[];
@@ -1,2 +1 @@
1
- // damage-report.interfaces.ts
2
1
  export {};
@@ -2,29 +2,28 @@
2
2
  * Error Types
3
3
  * Custom error types and validation error structures
4
4
  */
5
- import { ErrorCode } from "../api";
6
- import { TurndownObject } from "../base";
5
+ import { TErrorCode } from "../api";
7
6
  /**
8
7
  * Validation Error Detail
9
8
  * Detailed information about a validation error
10
9
  */
11
- export interface ValidationErrorDetail {
10
+ export interface IValidationErrorDetail {
12
11
  field: string;
13
12
  message: string;
14
- value?: TurndownObject;
13
+ value?: unknown;
15
14
  }
16
15
  /**
17
16
  * Missing Fields Error Detail
18
17
  * Information about missing required fields
19
18
  */
20
- export interface MissingFieldsErrorDetail {
19
+ export interface IMissingFieldsErrorDetail {
21
20
  missingFields: string[];
22
21
  }
23
22
  /**
24
23
  * Rate Limit Error Detail
25
24
  * Information about rate limiting
26
25
  */
27
- export interface RateLimitErrorDetail {
26
+ export interface IRateLimitErrorDetail {
28
27
  retryAfter?: number;
29
28
  message: string;
30
29
  }
@@ -32,36 +31,36 @@ export interface RateLimitErrorDetail {
32
31
  * Error Response Detail
33
32
  * Union type for all possible error details
34
33
  */
35
- export type ErrorResponseDetail = ValidationErrorDetail[] | MissingFieldsErrorDetail | RateLimitErrorDetail | Record<string, TurndownObject> | string;
34
+ export type TErrorResponseDetail = IValidationErrorDetail[] | IMissingFieldsErrorDetail | IRateLimitErrorDetail | Record<string, unknown> | string;
36
35
  /**
37
36
  * Typed API Error
38
37
  * API error with typed details
39
38
  */
40
- export interface TypedApiError<T = ErrorResponseDetail> {
39
+ export interface ITypedApiError<T = TErrorResponseDetail> {
41
40
  message: string;
42
- code: ErrorCode;
41
+ code: TErrorCode;
43
42
  details?: T;
44
43
  }
45
44
  /**
46
45
  * Error Helper Types
47
46
  * For identifying specific error types
48
47
  */
49
- export type ValidationError = TypedApiError<ValidationErrorDetail[]>;
50
- export type MissingFieldsError = TypedApiError<MissingFieldsErrorDetail>;
51
- export type RateLimitError = TypedApiError<RateLimitErrorDetail>;
48
+ export type TValidationError = ITypedApiError<IValidationErrorDetail[]>;
49
+ export type TMissingFieldsError = ITypedApiError<IMissingFieldsErrorDetail>;
50
+ export type TRateLimitError = ITypedApiError<IRateLimitErrorDetail>;
52
51
  /**
53
52
  * Type guard for ValidationError
54
53
  */
55
- export declare function isValidationError(error: TurndownObject): error is ValidationError;
54
+ export declare function isValidationError(error: unknown): error is TValidationError;
56
55
  /**
57
56
  * Type guard for MissingFieldsError
58
57
  */
59
- export declare function isMissingFieldsError(error: TurndownObject): error is MissingFieldsError;
58
+ export declare function isMissingFieldsError(error: unknown): error is TMissingFieldsError;
60
59
  /**
61
60
  * Type guard for RateLimitError
62
61
  */
63
- export declare function isRateLimitError(error: TurndownObject): error is RateLimitError;
62
+ export declare function isRateLimitError(error: unknown): error is TRateLimitError;
64
63
  /**
65
64
  * Type guard for authentication errors
66
65
  */
67
- export declare function isAuthError(error: TurndownObject): boolean;
66
+ export declare function isAuthError(error: unknown): boolean;
@@ -2,30 +2,40 @@
2
2
  * Error Types
3
3
  * Custom error types and validation error structures
4
4
  */
5
+ const isErrorLike = (error) => {
6
+ return typeof error === "object" && error !== null;
7
+ };
5
8
  /**
6
9
  * Type guard for ValidationError
7
10
  */
8
11
  export function isValidationError(error) {
9
- return error?.code === "VALIDATION_ERROR" && Array.isArray(error?.details);
12
+ return (isErrorLike(error) &&
13
+ error.code === "VALIDATION_ERROR" &&
14
+ Array.isArray(error.details));
10
15
  }
11
16
  /**
12
17
  * Type guard for MissingFieldsError
13
18
  */
14
19
  export function isMissingFieldsError(error) {
15
- return (error?.code === "MISSING_FIELDS" &&
16
- Array.isArray(error?.details?.missingFields));
20
+ return (isErrorLike(error) &&
21
+ error.code === "MISSING_FIELDS" &&
22
+ typeof error.details === "object" &&
23
+ error.details !== null &&
24
+ "missingFields" in error.details &&
25
+ Array.isArray(error.details.missingFields));
17
26
  }
18
27
  /**
19
28
  * Type guard for RateLimitError
20
29
  */
21
30
  export function isRateLimitError(error) {
22
- return error?.code === "RATE_LIMIT_EXCEEDED";
31
+ return isErrorLike(error) && error.code === "RATE_LIMIT_EXCEEDED";
23
32
  }
24
33
  /**
25
34
  * Type guard for authentication errors
26
35
  */
27
36
  export function isAuthError(error) {
28
- return (error?.code === "UNAUTHORIZED" ||
29
- error?.code === "INVALID_TOKEN" ||
30
- error?.code === "INVALID_CREDENTIALS");
37
+ return (isErrorLike(error) &&
38
+ (error.code === "UNAUTHORIZED" ||
39
+ error.code === "INVALID_TOKEN" ||
40
+ error.code === "INVALID_CREDENTIALS"));
31
41
  }
@@ -0,0 +1,20 @@
1
+ export * from "./routes";
2
+ export interface IHealthCheckResponse {
3
+ status: "healthy";
4
+ database: "connected";
5
+ timestamp: string;
6
+ environment?: string;
7
+ }
8
+ export interface IHealthChecks {
9
+ database: "unknown" | "connected" | "disconnected";
10
+ uptime: number;
11
+ memory: {
12
+ rss: number;
13
+ heapTotal: number;
14
+ heapUsed: number;
15
+ external: number;
16
+ arrayBuffers: number;
17
+ };
18
+ timestamp: string;
19
+ databaseError?: string;
20
+ }
@@ -0,0 +1 @@
1
+ export * from "./routes";
@@ -0,0 +1,10 @@
1
+ import type { IHealthChecks, IHealthCheckResponse } from ".";
2
+ export interface IGetHealthRequest {
3
+ }
4
+ export interface IGetHealthResponse extends IHealthCheckResponse {
5
+ }
6
+ export interface IGetDetailedHealthRequest {
7
+ }
8
+ export interface IGetDetailedHealthResponse {
9
+ checks: IHealthChecks;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,34 @@
1
+ export * from "./routes";
2
+ export declare const IMAGE_ENTITY_TYPE: {
3
+ readonly USER_PROFILE: "USER_PROFILE";
4
+ readonly PROPERTY: "PROPERTY";
5
+ readonly COMPANY: "COMPANY";
6
+ readonly CHECKLIST_ITEM: "CHECKLIST_ITEM";
7
+ readonly PROPERTY_ROOM: "PROPERTY_ROOM";
8
+ readonly MAINTENANCE_TICKET: "MAINTENANCE_TICKET";
9
+ readonly WORK_REPORT: "WORK_REPORT";
10
+ readonly TURNDOWN_DEFAULT: "TURNDOWN_DEFAULT";
11
+ };
12
+ export type TStoredImageEntityType = (typeof IMAGE_ENTITY_TYPE)[keyof typeof IMAGE_ENTITY_TYPE];
13
+ export interface IImage {
14
+ id: string;
15
+ s3Key: string;
16
+ s3Bucket: string;
17
+ entityType: TStoredImageEntityType;
18
+ entityId: string;
19
+ fileName: string;
20
+ mimeType: string;
21
+ fileSizeBytes?: number;
22
+ width?: number;
23
+ height?: number;
24
+ isPublic: boolean;
25
+ category?: string;
26
+ displayOrder: number;
27
+ uploadedBy?: string;
28
+ createdAt: Date;
29
+ updatedAt: Date;
30
+ deletedAt?: Date;
31
+ }
32
+ export interface IImageWithUrl extends IImage {
33
+ url: string;
34
+ }
@@ -0,0 +1,11 @@
1
+ export * from "./routes";
2
+ export const IMAGE_ENTITY_TYPE = {
3
+ USER_PROFILE: "USER_PROFILE",
4
+ PROPERTY: "PROPERTY",
5
+ COMPANY: "COMPANY",
6
+ CHECKLIST_ITEM: "CHECKLIST_ITEM",
7
+ PROPERTY_ROOM: "PROPERTY_ROOM",
8
+ MAINTENANCE_TICKET: "MAINTENANCE_TICKET",
9
+ WORK_REPORT: "WORK_REPORT",
10
+ TURNDOWN_DEFAULT: "TURNDOWN_DEFAULT",
11
+ };
@@ -0,0 +1,32 @@
1
+ import type { IImageWithUrl } from ".";
2
+ import type { ISuccessResponse } from "../base";
3
+ export interface IImageUserRouteParams {
4
+ userId: string;
5
+ }
6
+ export interface IImagePropertyRouteParams {
7
+ propertyId: string;
8
+ }
9
+ export interface IImageRoomRouteParams {
10
+ roomId: string;
11
+ }
12
+ export interface IImageCompanyRouteParams {
13
+ companyId: string;
14
+ }
15
+ export interface IImageRouteParams {
16
+ imageId: string;
17
+ }
18
+ export interface IUploadProfileImageRequest {
19
+ }
20
+ export interface IUploadProfileImageResponse {
21
+ image: IImageWithUrl;
22
+ }
23
+ export interface IUploadImagesResponse {
24
+ images: IImageWithUrl[];
25
+ }
26
+ export interface IGetImagesForEntityResponse {
27
+ images: IImageWithUrl[];
28
+ }
29
+ export interface IDeleteImageRequest extends IImageRouteParams {
30
+ }
31
+ export interface IDeleteImageResponse extends ISuccessResponse {
32
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -10,7 +10,10 @@ export * from "./checklist-template";
10
10
  export * from "./company";
11
11
  export * from "./damage-report";
12
12
  export * from "./errors";
13
+ export * from "./health";
14
+ export * from "./image";
13
15
  export * from "./inventory";
16
+ export * from "./job";
14
17
  export * from "./property";
15
18
  export * from "./room";
16
19
  export * from "./room-checklist";
@@ -10,7 +10,10 @@ export * from "./checklist-template";
10
10
  export * from "./company";
11
11
  export * from "./damage-report";
12
12
  export * from "./errors";
13
+ export * from "./health";
14
+ export * from "./image";
13
15
  export * from "./inventory";
16
+ export * from "./job";
14
17
  export * from "./property";
15
18
  export * from "./room";
16
19
  export * from "./room-checklist";
@@ -1,4 +1,4 @@
1
- import { MetaData, ObjectValues } from "../index";
1
+ import { IMetaData, TRecordValue } from "../index";
2
2
  export * from "./routes";
3
3
  declare const INVENTORY_RESTOCK_ORDER_STATUS: {
4
4
  readonly PENDING: "PENDING";
@@ -6,7 +6,7 @@ declare const INVENTORY_RESTOCK_ORDER_STATUS: {
6
6
  readonly SHIPPED: "SHIPPED";
7
7
  readonly RECEIVED: "RECEIVED";
8
8
  };
9
- export type InventoryRestockOrderStatus = ObjectValues<typeof INVENTORY_RESTOCK_ORDER_STATUS>;
9
+ export type TInventoryRestockOrderStatus = TRecordValue<typeof INVENTORY_RESTOCK_ORDER_STATUS>;
10
10
  export declare const INVENTORY_UNITS: {
11
11
  COUNT: string;
12
12
  ROLLS: string;
@@ -26,19 +26,19 @@ export declare const INVENTORY_UNITS: {
26
26
  CARTONS: string;
27
27
  OTHER: string;
28
28
  };
29
- export type InventoryUnitType = ObjectValues<typeof INVENTORY_UNITS>;
29
+ export type TInventoryUnitType = TRecordValue<typeof INVENTORY_UNITS>;
30
30
  export declare const INVENTORY_ITEM_TYPE: {
31
31
  readonly CONSUMABLE: "CONSUMABLE";
32
32
  readonly FIXED: "FIXED";
33
33
  };
34
- export type InventoryItemType = ObjectValues<typeof INVENTORY_ITEM_TYPE>;
35
- export interface InventoryItem extends MetaData {
34
+ export type TInventoryItemType = TRecordValue<typeof INVENTORY_ITEM_TYPE>;
35
+ export interface IInventoryItem extends IMetaData {
36
36
  id: string;
37
37
  companyId: string;
38
38
  name: string;
39
39
  description?: string;
40
- itemType: InventoryItemType;
41
- unit: InventoryUnitType;
40
+ itemType: TInventoryItemType;
41
+ unit: TInventoryUnitType;
42
42
  unitCustom?: string;
43
43
  minimumLevel: number;
44
44
  reorderLevel: number;
@@ -48,7 +48,7 @@ export interface InventoryItem extends MetaData {
48
48
  sku?: string;
49
49
  barcode?: string;
50
50
  }
51
- export interface RoomInventory extends MetaData {
51
+ export interface IRoomInventory extends IMetaData {
52
52
  id: string;
53
53
  roomId: string;
54
54
  inventoryItemId: string;
@@ -63,7 +63,7 @@ export interface RoomInventory extends MetaData {
63
63
  autoReorder: boolean;
64
64
  locationNotes?: string;
65
65
  }
66
- export interface PropertyInventory extends MetaData {
66
+ export interface IPropertyInventory extends IMetaData {
67
67
  id: string;
68
68
  propertyId: string;
69
69
  inventoryItemId: string;
@@ -78,7 +78,7 @@ export interface PropertyInventory extends MetaData {
78
78
  autoReorder: boolean;
79
79
  locationNotes?: string;
80
80
  }
81
- export interface InventoryCount {
81
+ export interface IInventoryCount {
82
82
  id: string;
83
83
  checklistExecutionId: string;
84
84
  roomInventoryId: string;
@@ -93,11 +93,11 @@ export interface InventoryCount {
93
93
  notes?: string;
94
94
  createdAt: Date;
95
95
  }
96
- export interface InventoryRestockOrder {
96
+ export interface IInventoryRestockOrder {
97
97
  id: string;
98
98
  companyId: string;
99
99
  orderNumber?: string;
100
- status: InventoryRestockOrderStatus;
100
+ status: TInventoryRestockOrderStatus;
101
101
  totalItems?: number;
102
102
  totalCost?: number;
103
103
  orderedBy?: string;
@@ -110,81 +110,7 @@ export interface InventoryRestockOrder {
110
110
  createdAt: Date;
111
111
  updatedAt: Date;
112
112
  }
113
- export interface InventoryRestockOrderItem {
114
- id: string;
115
- orderId: string;
116
- inventoryItemId: string;
117
- roomInventoryId?: string;
118
- propertyInventoryId?: string;
119
- quantityOrdered: number;
120
- quantityReceived: number;
121
- unitCost?: number;
122
- totalCost?: number;
123
- createdAt: Date;
124
- }
125
- export interface RoomInventory extends MetaData {
126
- id: string;
127
- roomId: string;
128
- inventoryItemId: string;
129
- currentLevel: number;
130
- minimumLevel: number;
131
- maximumLevel?: number;
132
- parLevel?: number;
133
- lastRestockedAt?: Date;
134
- lastRestockedBy?: string;
135
- lastCheckedAt?: Date;
136
- lastCheckedBy?: string;
137
- autoReorder: boolean;
138
- locationNotes?: string;
139
- }
140
- export interface PropertyInventory extends MetaData {
141
- id: string;
142
- propertyId: string;
143
- inventoryItemId: string;
144
- currentLevel: number;
145
- minimumLevel: number;
146
- maximumLevel?: number;
147
- parLevel?: number;
148
- lastRestockedAt?: Date;
149
- lastRestockedBy?: string;
150
- lastCheckedAt?: Date;
151
- lastCheckedBy?: string;
152
- autoReorder: boolean;
153
- locationNotes?: string;
154
- }
155
- export interface InventoryCount {
156
- id: string;
157
- checklistExecutionId: string;
158
- roomInventoryId: string;
159
- previousLevel: number;
160
- countedLevel: number;
161
- consumedAmount: number;
162
- restockedAmount: number;
163
- finalLevel: number;
164
- countedBy: string;
165
- countedAt: Date;
166
- needsRestock: boolean;
167
- notes?: string;
168
- createdAt: Date;
169
- }
170
- export interface InventoryRestockOrder {
171
- id: string;
172
- companyId: string;
173
- orderNumber?: string;
174
- status: InventoryRestockOrderStatus;
175
- totalItems?: number;
176
- totalCost?: number;
177
- orderedBy?: string;
178
- orderedAt?: Date;
179
- expectedDelivery?: Date;
180
- receivedBy?: string;
181
- receivedAt?: Date;
182
- supplierInfo?: string;
183
- notes?: string;
184
- createdAt: Date;
185
- updatedAt: Date;
186
- }
187
- export interface InventoryRestockOrderItem {
113
+ export interface IInventoryRestockOrderItem {
188
114
  id: string;
189
115
  orderId: string;
190
116
  inventoryItemId: string;