@turndown/library 0.1.24 → 0.1.29
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.
- package/dist/index.cjs +1719 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2820 -0
- package/dist/index.d.ts +2820 -2
- package/dist/index.mjs +1577 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +10 -6
- package/dist/helpers/date/index.d.ts +0 -113
- package/dist/helpers/date/index.js +0 -171
- package/dist/helpers/index.d.ts +0 -4
- package/dist/helpers/index.js +0 -3
- package/dist/helpers/object/index.d.ts +0 -298
- package/dist/helpers/object/index.js +0 -540
- package/dist/helpers/string/index.d.ts +0 -258
- package/dist/helpers/string/index.js +0 -496
- package/dist/index.js +0 -2
- package/dist/types/api/index.d.ts +0 -71
- package/dist/types/api/index.js +0 -54
- package/dist/types/auth/index.d.ts +0 -107
- package/dist/types/auth/index.js +0 -8
- package/dist/types/auth/routes.d.ts +0 -160
- package/dist/types/auth/routes.js +0 -1
- package/dist/types/base/index.d.ts +0 -200
- package/dist/types/base/index.js +0 -177
- package/dist/types/base/paging.types.d.ts +0 -47
- package/dist/types/base/paging.types.js +0 -1
- package/dist/types/checklist-template/index.d.ts +0 -48
- package/dist/types/checklist-template/index.js +0 -1
- package/dist/types/checklist-template/routes.d.ts +0 -85
- package/dist/types/checklist-template/routes.js +0 -1
- package/dist/types/company/index.d.ts +0 -22
- package/dist/types/company/index.js +0 -7
- package/dist/types/company/routes.d.ts +0 -100
- package/dist/types/company/routes.js +0 -1
- package/dist/types/damage-report/index.d.ts +0 -148
- package/dist/types/damage-report/index.js +0 -29
- package/dist/types/damage-report/routes.d.ts +0 -112
- package/dist/types/damage-report/routes.js +0 -1
- package/dist/types/errors/index.d.ts +0 -66
- package/dist/types/errors/index.js +0 -41
- package/dist/types/health/index.d.ts +0 -20
- package/dist/types/health/index.js +0 -1
- package/dist/types/health/routes.d.ts +0 -10
- package/dist/types/health/routes.js +0 -1
- package/dist/types/image/index.d.ts +0 -35
- package/dist/types/image/index.js +0 -12
- package/dist/types/image/routes.d.ts +0 -32
- package/dist/types/image/routes.js +0 -1
- package/dist/types/index.d.ts +0 -22
- package/dist/types/index.js +0 -22
- package/dist/types/inventory/index.d.ts +0 -124
- package/dist/types/inventory/index.js +0 -30
- package/dist/types/inventory/routes.d.ts +0 -109
- package/dist/types/inventory/routes.js +0 -1
- package/dist/types/job/index.d.ts +0 -7
- package/dist/types/job/index.js +0 -1
- package/dist/types/property/index.d.ts +0 -113
- package/dist/types/property/index.js +0 -25
- package/dist/types/property/routes.d.ts +0 -54
- package/dist/types/property/routes.js +0 -1
- package/dist/types/room/index.d.ts +0 -28
- package/dist/types/room/index.js +0 -17
- package/dist/types/room/routes.d.ts +0 -35
- package/dist/types/room/routes.js +0 -1
- package/dist/types/room-checklist/index.d.ts +0 -43
- package/dist/types/room-checklist/index.js +0 -1
- package/dist/types/room-checklist/routes.d.ts +0 -78
- package/dist/types/room-checklist/routes.js +0 -1
- package/dist/types/subscription/index.d.ts +0 -32
- package/dist/types/subscription/index.js +0 -16
- package/dist/types/user/index.d.ts +0 -59
- package/dist/types/user/index.js +0 -20
- package/dist/types/user/routes.d.ts +0 -46
- package/dist/types/user/routes.js +0 -1
- package/dist/types/work-session/index.d.ts +0 -97
- package/dist/types/work-session/index.js +0 -18
- package/dist/types/work-session/routes.d.ts +0 -89
- package/dist/types/work-session/routes.js +0 -1
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { IMetaData } from "../index";
|
|
2
|
-
export * from "./routes";
|
|
3
|
-
export interface IChecklistTemplate extends IMetaData {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
companyId: string;
|
|
8
|
-
createdBy: string;
|
|
9
|
-
isActive: boolean;
|
|
10
|
-
items: IChecklistTemplateItem[];
|
|
11
|
-
}
|
|
12
|
-
export interface IChecklistTemplateItem extends IMetaData {
|
|
13
|
-
id: string;
|
|
14
|
-
templateId: string;
|
|
15
|
-
title: string;
|
|
16
|
-
description: string | null;
|
|
17
|
-
displayOrder: number;
|
|
18
|
-
requiresPhoto: boolean;
|
|
19
|
-
isRequired: boolean;
|
|
20
|
-
estimatedTimeMinutes: number | null;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Template with items
|
|
24
|
-
*/
|
|
25
|
-
export interface IChecklistTemplateWithItems extends IChecklistTemplate {
|
|
26
|
-
items: IChecklistTemplateItem[];
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Input for creating a template
|
|
30
|
-
*/
|
|
31
|
-
export interface ICreateTemplateInput {
|
|
32
|
-
name: string;
|
|
33
|
-
description?: string;
|
|
34
|
-
companyId: string;
|
|
35
|
-
createdBy: string;
|
|
36
|
-
isActive?: boolean;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Input for creating template items
|
|
40
|
-
*/
|
|
41
|
-
export interface ICreateTemplateItemInput {
|
|
42
|
-
title: string;
|
|
43
|
-
description?: string;
|
|
44
|
-
displayOrder: number;
|
|
45
|
-
requiresPhoto?: boolean;
|
|
46
|
-
isRequired?: boolean;
|
|
47
|
-
estimatedTimeMinutes?: number;
|
|
48
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./routes";
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { IChecklistTemplate, IChecklistTemplateItem, IChecklistTemplateWithItems, ICreateTemplateInput, ICreateTemplateItemInput } from ".";
|
|
2
|
-
import type { ICountResponse, IMessageResponse } from "../base";
|
|
3
|
-
export interface IChecklistTemplateCompanyRouteParams {
|
|
4
|
-
companyId: string;
|
|
5
|
-
}
|
|
6
|
-
export interface ITemplateIdParams {
|
|
7
|
-
templateId: string;
|
|
8
|
-
}
|
|
9
|
-
export interface ITemplateItemIdParams {
|
|
10
|
-
itemId: string;
|
|
11
|
-
}
|
|
12
|
-
export interface ITemplateAndItemIdParams {
|
|
13
|
-
templateId: string;
|
|
14
|
-
itemId: string;
|
|
15
|
-
}
|
|
16
|
-
export interface IIncludeInactiveQuery {
|
|
17
|
-
includeInactive?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface ICreateTemplateRequest extends Partial<Omit<ICreateTemplateInput, "companyId" | "createdBy">> {
|
|
20
|
-
name: string;
|
|
21
|
-
}
|
|
22
|
-
export interface ICreateTemplateResponse extends IChecklistTemplate {
|
|
23
|
-
}
|
|
24
|
-
export interface ICreateTemplateWithItemsRequest extends ICreateTemplateInput {
|
|
25
|
-
items: ICreateTemplateItemInput[];
|
|
26
|
-
}
|
|
27
|
-
export interface ICreateTemplateWithItemsResponse extends IChecklistTemplateWithItems {
|
|
28
|
-
}
|
|
29
|
-
export interface IGetTemplatesByCompanyIdRequest extends IChecklistTemplateCompanyRouteParams {
|
|
30
|
-
}
|
|
31
|
-
export type IGetTemplatesByCompanyIdResponse = IChecklistTemplate[];
|
|
32
|
-
export interface IGetTemplateByIdRequest extends ITemplateIdParams {
|
|
33
|
-
}
|
|
34
|
-
export interface IGetTemplateByIdResponse extends IChecklistTemplate {
|
|
35
|
-
}
|
|
36
|
-
export interface IGetTemplateWithItemsRequest extends ITemplateIdParams {
|
|
37
|
-
}
|
|
38
|
-
export interface IGetTemplateWithItemsResponse extends IChecklistTemplateWithItems {
|
|
39
|
-
}
|
|
40
|
-
export interface IUpdateTemplateRequest extends Partial<ICreateTemplateInput> {
|
|
41
|
-
}
|
|
42
|
-
export interface IUpdateTemplateResponse extends IChecklistTemplate {
|
|
43
|
-
}
|
|
44
|
-
export interface IDeleteTemplateRequest extends ITemplateIdParams {
|
|
45
|
-
}
|
|
46
|
-
export interface IDeleteTemplateResponse extends IMessageResponse {
|
|
47
|
-
}
|
|
48
|
-
export interface IToggleTemplateActiveRequest {
|
|
49
|
-
isActive: boolean;
|
|
50
|
-
}
|
|
51
|
-
export interface IToggleTemplateActiveResponse extends IChecklistTemplate {
|
|
52
|
-
}
|
|
53
|
-
export interface IGetTemplateUsageRequest extends ITemplateIdParams {
|
|
54
|
-
}
|
|
55
|
-
export interface IGetTemplateUsageResponse extends ICountResponse {
|
|
56
|
-
}
|
|
57
|
-
export interface IGetTemplateItemsRequest extends ITemplateIdParams {
|
|
58
|
-
}
|
|
59
|
-
export type IGetTemplateItemsResponse = IChecklistTemplateItem[];
|
|
60
|
-
export interface IAddTemplateItemRequest extends ICreateTemplateItemInput {
|
|
61
|
-
title: string;
|
|
62
|
-
}
|
|
63
|
-
export interface IAddTemplateItemResponse extends IChecklistTemplateItem {
|
|
64
|
-
}
|
|
65
|
-
export interface IUpdateTemplateItemRequest extends Partial<ICreateTemplateItemInput> {
|
|
66
|
-
}
|
|
67
|
-
export interface IUpdateTemplateItemResponse extends IChecklistTemplateItem {
|
|
68
|
-
}
|
|
69
|
-
export interface IDuplicateTemplateItemRequest extends ITemplateItemIdParams {
|
|
70
|
-
}
|
|
71
|
-
export interface IDuplicateTemplateItemResponse extends IChecklistTemplateItem {
|
|
72
|
-
}
|
|
73
|
-
export interface IDeleteTemplateItemRequest extends ITemplateItemIdParams {
|
|
74
|
-
}
|
|
75
|
-
export interface IDeleteTemplateItemResponse extends IMessageResponse {
|
|
76
|
-
}
|
|
77
|
-
export interface ITemplateItemOrder {
|
|
78
|
-
itemId: string;
|
|
79
|
-
displayOrder: number;
|
|
80
|
-
}
|
|
81
|
-
export interface IReorderTemplateItemsRequest {
|
|
82
|
-
itemOrders: ITemplateItemOrder[];
|
|
83
|
-
}
|
|
84
|
-
export interface IReorderTemplateItemsResponse extends IMessageResponse {
|
|
85
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { IMetaData, TRecordValue, TUSStateCode } from "../index";
|
|
2
|
-
export * from "./routes";
|
|
3
|
-
export interface ICompany extends IMetaData {
|
|
4
|
-
id: string;
|
|
5
|
-
displayName: string;
|
|
6
|
-
addressLine1: string;
|
|
7
|
-
addressLine2?: string;
|
|
8
|
-
city: string;
|
|
9
|
-
stateCode: TUSStateCode;
|
|
10
|
-
companyType: TCompanyType;
|
|
11
|
-
postalCode: string;
|
|
12
|
-
country?: string;
|
|
13
|
-
timezone?: string;
|
|
14
|
-
photoUrl?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare const COMPANY_TYPES: {
|
|
17
|
-
readonly PROPERTY_MANAGEMENT: "PROPERTY_MANAGEMENT";
|
|
18
|
-
readonly MAINTENANCE: "MAINTENANCE";
|
|
19
|
-
readonly CLEANER: "CLEANER";
|
|
20
|
-
readonly OTHER: "OTHER";
|
|
21
|
-
};
|
|
22
|
-
export type TCompanyType = TRecordValue<typeof COMPANY_TYPES>;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import type { ICompany, TCompanyType } from ".";
|
|
2
|
-
import type { IMessageResponse } from "../base";
|
|
3
|
-
import type { TAccountType } from "../user";
|
|
4
|
-
export interface ICompanyRouteParams {
|
|
5
|
-
companyId: string;
|
|
6
|
-
}
|
|
7
|
-
export interface ICompanyUserRouteParams {
|
|
8
|
-
userId: string;
|
|
9
|
-
}
|
|
10
|
-
export interface ICompanyInvitationTokenParams {
|
|
11
|
-
token: string;
|
|
12
|
-
}
|
|
13
|
-
export interface ICompanyInvitationIdParams extends ICompanyRouteParams {
|
|
14
|
-
invitationId: string;
|
|
15
|
-
}
|
|
16
|
-
export interface IGetCompaniesQuery {
|
|
17
|
-
search?: string;
|
|
18
|
-
filter?: "active" | "pending" | "all";
|
|
19
|
-
}
|
|
20
|
-
export interface ICreateCompanyRequest {
|
|
21
|
-
displayName: string;
|
|
22
|
-
addressLine1: string;
|
|
23
|
-
addressLine2?: string;
|
|
24
|
-
city: string;
|
|
25
|
-
stateCode: string;
|
|
26
|
-
postalCode: string;
|
|
27
|
-
companyType: TCompanyType;
|
|
28
|
-
}
|
|
29
|
-
export interface ICreateCompanyResponse extends ICompany {
|
|
30
|
-
}
|
|
31
|
-
export interface IGetCompaniesRequest {
|
|
32
|
-
}
|
|
33
|
-
export type IGetCompaniesResponse = ICompany[];
|
|
34
|
-
export interface IGetCompanyByIdRequest extends ICompanyRouteParams {
|
|
35
|
-
}
|
|
36
|
-
export interface IGetCompanyByIdResponse extends ICompany {
|
|
37
|
-
}
|
|
38
|
-
export interface IUpdateCompanyRequest extends Partial<ICompany> {
|
|
39
|
-
}
|
|
40
|
-
export interface IUpdateCompanyResponse extends ICompany {
|
|
41
|
-
}
|
|
42
|
-
export interface IInviteUserToCompanyRequest {
|
|
43
|
-
email: string;
|
|
44
|
-
role: TAccountType;
|
|
45
|
-
}
|
|
46
|
-
export interface IInviteUserToCompanyResponse extends IMessageResponse {
|
|
47
|
-
}
|
|
48
|
-
export interface IGetCompanyUsersRequest extends ICompanyRouteParams {
|
|
49
|
-
}
|
|
50
|
-
export interface ICompanyUserSummary {
|
|
51
|
-
id: string;
|
|
52
|
-
email: string;
|
|
53
|
-
firstName: string;
|
|
54
|
-
lastName: string;
|
|
55
|
-
role: TAccountType;
|
|
56
|
-
}
|
|
57
|
-
export type IGetCompanyUsersResponse = Array<ICompany & ICompanyUserSummary>;
|
|
58
|
-
export interface IGetUserCompaniesRequest extends ICompanyUserRouteParams {
|
|
59
|
-
}
|
|
60
|
-
export type IGetUserCompaniesResponse = ICompany[];
|
|
61
|
-
export interface IInviteCompanyToCompanyRequest {
|
|
62
|
-
message?: string;
|
|
63
|
-
}
|
|
64
|
-
export interface IInviteCompanyToCompanyResponse {
|
|
65
|
-
id: string;
|
|
66
|
-
token: string;
|
|
67
|
-
expiresAt: Date | string;
|
|
68
|
-
}
|
|
69
|
-
export interface IValidateCompanyInvitationRequest extends ICompanyInvitationTokenParams {
|
|
70
|
-
}
|
|
71
|
-
export interface IValidateCompanyInvitationResponse {
|
|
72
|
-
id: string;
|
|
73
|
-
requesterCompanyId: string;
|
|
74
|
-
providerCompanyId: string;
|
|
75
|
-
invitedBy: string;
|
|
76
|
-
message?: string | null;
|
|
77
|
-
expiresAt: Date | string;
|
|
78
|
-
requesterCompanyName: string;
|
|
79
|
-
providerCompanyName: string;
|
|
80
|
-
invitedByName: string;
|
|
81
|
-
}
|
|
82
|
-
export interface IAcceptCompanyInvitationRequest extends ICompanyInvitationTokenParams {
|
|
83
|
-
}
|
|
84
|
-
export interface IAcceptCompanyInvitationResponse {
|
|
85
|
-
requesterCompanyId: string;
|
|
86
|
-
providerCompanyId: string;
|
|
87
|
-
requesterCompanyName: string;
|
|
88
|
-
providerCompanyName: string;
|
|
89
|
-
}
|
|
90
|
-
export interface IDeclineCompanyInvitationRequest extends ICompanyInvitationTokenParams {
|
|
91
|
-
}
|
|
92
|
-
export interface IDeclineCompanyInvitationResponse extends IMessageResponse {
|
|
93
|
-
}
|
|
94
|
-
export interface IGetPendingCompanyInvitationsRequest extends ICompanyRouteParams {
|
|
95
|
-
}
|
|
96
|
-
export type IGetPendingCompanyInvitationsResponse = IValidateCompanyInvitationResponse[];
|
|
97
|
-
export interface IRevokeCompanyInvitationRequest extends ICompanyInvitationIdParams {
|
|
98
|
-
}
|
|
99
|
-
export interface IRevokeCompanyInvitationResponse extends IMessageResponse {
|
|
100
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { TRecordValue } from "../base";
|
|
2
|
-
export declare const DAMAGE_SEVERITY: {
|
|
3
|
-
readonly LOW: "LOW";
|
|
4
|
-
readonly MEDIUM: "MEDIUM";
|
|
5
|
-
readonly HIGH: "HIGH";
|
|
6
|
-
readonly CRITICAL: "CRITICAL";
|
|
7
|
-
};
|
|
8
|
-
export type TDamageSeverity = TRecordValue<typeof DAMAGE_SEVERITY>;
|
|
9
|
-
export declare const DAMAGE_STATUS: {
|
|
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";
|
|
17
|
-
};
|
|
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>;
|
|
34
|
-
export interface IDamageReport {
|
|
35
|
-
id: string;
|
|
36
|
-
propertyId: string;
|
|
37
|
-
roomId: string;
|
|
38
|
-
workSessionId: string | null;
|
|
39
|
-
cleaningSessionId?: string;
|
|
40
|
-
reportedBy: string;
|
|
41
|
-
reportedAt: Date;
|
|
42
|
-
severity: TDamageSeverity;
|
|
43
|
-
status: TDamageStatus;
|
|
44
|
-
title: string;
|
|
45
|
-
description: 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;
|
|
54
|
-
requiresProfessional: boolean;
|
|
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[];
|
|
63
|
-
}
|
|
64
|
-
export interface IDamageReportPhoto {
|
|
65
|
-
id: string;
|
|
66
|
-
damageReportId: string;
|
|
67
|
-
photoId: string;
|
|
68
|
-
photoUrl?: string;
|
|
69
|
-
caption: string | null;
|
|
70
|
-
isBeforePhoto: boolean;
|
|
71
|
-
displayOrder: number;
|
|
72
|
-
uploadedBy: string | null;
|
|
73
|
-
createdAt: Date;
|
|
74
|
-
}
|
|
75
|
-
export interface IDamagePhoto extends IDamageReportPhoto {
|
|
76
|
-
}
|
|
77
|
-
export interface IDamageComment {
|
|
78
|
-
id: string;
|
|
79
|
-
damageReportId: string;
|
|
80
|
-
userId: string;
|
|
81
|
-
userName?: string;
|
|
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;
|
|
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;
|
|
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,29 +0,0 @@
|
|
|
1
|
-
export const DAMAGE_SEVERITY = {
|
|
2
|
-
LOW: "LOW",
|
|
3
|
-
MEDIUM: "MEDIUM",
|
|
4
|
-
HIGH: "HIGH",
|
|
5
|
-
CRITICAL: "CRITICAL",
|
|
6
|
-
};
|
|
7
|
-
export const DAMAGE_STATUS = {
|
|
8
|
-
OPEN: "OPEN",
|
|
9
|
-
IN_REVIEW: "IN_REVIEW",
|
|
10
|
-
ASSIGNED: "ASSIGNED",
|
|
11
|
-
IN_PROGRESS: "IN_PROGRESS",
|
|
12
|
-
RESOLVED: "RESOLVED",
|
|
13
|
-
CLOSED: "CLOSED",
|
|
14
|
-
ESCALATED: "ESCALATED",
|
|
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,112 +0,0 @@
|
|
|
1
|
-
import type { ICreateDamageReportInput, ICreateWorkOrderInput, IDamageComment, IDamagePhoto, IDamageReport, IDamageReportStatusHistory, IWorkOrder, TDamageStatus, TWorkOrderStatus } from ".";
|
|
2
|
-
export interface IDamageReportPropertyRouteParams {
|
|
3
|
-
propertyId: string;
|
|
4
|
-
}
|
|
5
|
-
export interface IDamageReportRoomRouteParams {
|
|
6
|
-
roomId: string;
|
|
7
|
-
}
|
|
8
|
-
export interface IDamageReportRouteParams {
|
|
9
|
-
reportId: string;
|
|
10
|
-
}
|
|
11
|
-
export interface IDamageReportWorkOrderRouteParams {
|
|
12
|
-
workOrderId: string;
|
|
13
|
-
}
|
|
14
|
-
export interface IIncludeResolvedQuery {
|
|
15
|
-
includeResolved?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface ICreateDamageReportRequest extends ICreateDamageReportInput {
|
|
18
|
-
}
|
|
19
|
-
export interface ICreateDamageReportResponse extends IDamageReport {
|
|
20
|
-
}
|
|
21
|
-
export interface IGetDamageReportByIdRequest extends IDamageReportRouteParams {
|
|
22
|
-
}
|
|
23
|
-
export interface IGetDamageReportByIdResponse extends IDamageReport {
|
|
24
|
-
}
|
|
25
|
-
export interface IUpdateDamageReportRequest extends Partial<IDamageReport> {
|
|
26
|
-
}
|
|
27
|
-
export interface IUpdateDamageReportResponse extends IDamageReport {
|
|
28
|
-
}
|
|
29
|
-
export interface IUpdateDamageReportStatusRequest {
|
|
30
|
-
status: TDamageStatus;
|
|
31
|
-
changedBy: string;
|
|
32
|
-
reason?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface IUpdateDamageReportStatusResponse extends IDamageReport {
|
|
35
|
-
}
|
|
36
|
-
export interface IAssignDamageReportRequest {
|
|
37
|
-
assignedTo: string;
|
|
38
|
-
}
|
|
39
|
-
export interface IAssignDamageReportResponse extends IDamageReport {
|
|
40
|
-
}
|
|
41
|
-
export interface IResolveDamageReportRequest {
|
|
42
|
-
resolvedBy: string;
|
|
43
|
-
resolutionNotes?: string;
|
|
44
|
-
actualCost?: number;
|
|
45
|
-
}
|
|
46
|
-
export interface IResolveDamageReportResponse extends IDamageReport {
|
|
47
|
-
}
|
|
48
|
-
export interface IGetDamageReportsByPropertyIdRequest extends IDamageReportPropertyRouteParams {
|
|
49
|
-
}
|
|
50
|
-
export type IGetDamageReportsByPropertyIdResponse = IDamageReport[];
|
|
51
|
-
export interface IGetDamageReportsByRoomIdRequest extends IDamageReportRoomRouteParams {
|
|
52
|
-
}
|
|
53
|
-
export type IGetDamageReportsByRoomIdResponse = IDamageReport[];
|
|
54
|
-
export interface IGetDamageReportPhotosRequest extends IDamageReportRouteParams {
|
|
55
|
-
}
|
|
56
|
-
export type IGetDamageReportPhotosResponse = IDamagePhoto[];
|
|
57
|
-
export interface IAddDamageReportPhotoRequest {
|
|
58
|
-
photoId: string;
|
|
59
|
-
isBeforePhoto?: boolean;
|
|
60
|
-
caption?: string;
|
|
61
|
-
uploadedBy?: string;
|
|
62
|
-
}
|
|
63
|
-
export interface IAddDamageReportPhotoResponse extends IDamagePhoto {
|
|
64
|
-
}
|
|
65
|
-
export interface IGetDamageReportCommentsRequest extends IDamageReportRouteParams {
|
|
66
|
-
}
|
|
67
|
-
export type IGetDamageReportCommentsResponse = IDamageComment[];
|
|
68
|
-
export interface IAddDamageReportCommentRequest {
|
|
69
|
-
userId: string;
|
|
70
|
-
comment: string;
|
|
71
|
-
isInternal?: boolean;
|
|
72
|
-
}
|
|
73
|
-
export interface IAddDamageReportCommentResponse extends IDamageComment {
|
|
74
|
-
}
|
|
75
|
-
export interface IGetDamageReportHistoryRequest extends IDamageReportRouteParams {
|
|
76
|
-
}
|
|
77
|
-
export type IGetDamageReportHistoryResponse = IDamageReportStatusHistory[];
|
|
78
|
-
export interface ICreateWorkOrderRequest extends ICreateWorkOrderInput {
|
|
79
|
-
}
|
|
80
|
-
export interface ICreateWorkOrderResponse extends IWorkOrder {
|
|
81
|
-
}
|
|
82
|
-
export interface IGetWorkOrderByIdRequest extends IDamageReportWorkOrderRouteParams {
|
|
83
|
-
}
|
|
84
|
-
export interface IGetWorkOrderByIdResponse extends IWorkOrder {
|
|
85
|
-
}
|
|
86
|
-
export interface IUpdateWorkOrderRequest extends Partial<IWorkOrder> {
|
|
87
|
-
}
|
|
88
|
-
export interface IUpdateWorkOrderResponse extends IWorkOrder {
|
|
89
|
-
}
|
|
90
|
-
export interface IAssignWorkOrderRequest {
|
|
91
|
-
assignedTo: string;
|
|
92
|
-
}
|
|
93
|
-
export interface IAssignWorkOrderResponse extends IWorkOrder {
|
|
94
|
-
}
|
|
95
|
-
export interface ICompleteWorkOrderRequest {
|
|
96
|
-
completedBy: string;
|
|
97
|
-
workPerformed: string;
|
|
98
|
-
materialsUsed?: string;
|
|
99
|
-
laborHours?: number;
|
|
100
|
-
laborCost?: number;
|
|
101
|
-
materialsCost?: number;
|
|
102
|
-
}
|
|
103
|
-
export interface ICompleteWorkOrderResponse extends IWorkOrder {
|
|
104
|
-
}
|
|
105
|
-
export interface IGetWorkOrdersByPropertyIdRequest extends IDamageReportPropertyRouteParams {
|
|
106
|
-
}
|
|
107
|
-
export type IGetWorkOrdersByPropertyIdResponse = IWorkOrder[];
|
|
108
|
-
export interface IUpdateWorkOrderStatusRequest {
|
|
109
|
-
status: TWorkOrderStatus;
|
|
110
|
-
}
|
|
111
|
-
export interface IUpdateWorkOrderStatusResponse extends IWorkOrder {
|
|
112
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error Types
|
|
3
|
-
* Custom error types and validation error structures
|
|
4
|
-
*/
|
|
5
|
-
import { TErrorCode } from "../api";
|
|
6
|
-
/**
|
|
7
|
-
* Validation Error Detail
|
|
8
|
-
* Detailed information about a validation error
|
|
9
|
-
*/
|
|
10
|
-
export interface IValidationErrorDetail {
|
|
11
|
-
field: string;
|
|
12
|
-
message: string;
|
|
13
|
-
value?: unknown;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Missing Fields Error Detail
|
|
17
|
-
* Information about missing required fields
|
|
18
|
-
*/
|
|
19
|
-
export interface IMissingFieldsErrorDetail {
|
|
20
|
-
missingFields: string[];
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Rate Limit Error Detail
|
|
24
|
-
* Information about rate limiting
|
|
25
|
-
*/
|
|
26
|
-
export interface IRateLimitErrorDetail {
|
|
27
|
-
retryAfter?: number;
|
|
28
|
-
message: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Error Response Detail
|
|
32
|
-
* Union type for all possible error details
|
|
33
|
-
*/
|
|
34
|
-
export type TErrorResponseDetail = IValidationErrorDetail[] | IMissingFieldsErrorDetail | IRateLimitErrorDetail | Record<string, unknown> | string;
|
|
35
|
-
/**
|
|
36
|
-
* Typed API Error
|
|
37
|
-
* API error with typed details
|
|
38
|
-
*/
|
|
39
|
-
export interface ITypedApiError<T = TErrorResponseDetail> {
|
|
40
|
-
message: string;
|
|
41
|
-
code: TErrorCode;
|
|
42
|
-
details?: T;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Error Helper Types
|
|
46
|
-
* For identifying specific error types
|
|
47
|
-
*/
|
|
48
|
-
export type TValidationError = ITypedApiError<IValidationErrorDetail[]>;
|
|
49
|
-
export type TMissingFieldsError = ITypedApiError<IMissingFieldsErrorDetail>;
|
|
50
|
-
export type TRateLimitError = ITypedApiError<IRateLimitErrorDetail>;
|
|
51
|
-
/**
|
|
52
|
-
* Type guard for ValidationError
|
|
53
|
-
*/
|
|
54
|
-
export declare function isValidationError(error: unknown): error is TValidationError;
|
|
55
|
-
/**
|
|
56
|
-
* Type guard for MissingFieldsError
|
|
57
|
-
*/
|
|
58
|
-
export declare function isMissingFieldsError(error: unknown): error is TMissingFieldsError;
|
|
59
|
-
/**
|
|
60
|
-
* Type guard for RateLimitError
|
|
61
|
-
*/
|
|
62
|
-
export declare function isRateLimitError(error: unknown): error is TRateLimitError;
|
|
63
|
-
/**
|
|
64
|
-
* Type guard for authentication errors
|
|
65
|
-
*/
|
|
66
|
-
export declare function isAuthError(error: unknown): boolean;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error Types
|
|
3
|
-
* Custom error types and validation error structures
|
|
4
|
-
*/
|
|
5
|
-
const isErrorLike = (error) => {
|
|
6
|
-
return typeof error === "object" && error !== null;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Type guard for ValidationError
|
|
10
|
-
*/
|
|
11
|
-
export function isValidationError(error) {
|
|
12
|
-
return (isErrorLike(error) &&
|
|
13
|
-
error.code === "VALIDATION_ERROR" &&
|
|
14
|
-
Array.isArray(error.details));
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Type guard for MissingFieldsError
|
|
18
|
-
*/
|
|
19
|
-
export function isMissingFieldsError(error) {
|
|
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));
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Type guard for RateLimitError
|
|
29
|
-
*/
|
|
30
|
-
export function isRateLimitError(error) {
|
|
31
|
-
return isErrorLike(error) && error.code === "RATE_LIMIT_EXCEEDED";
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Type guard for authentication errors
|
|
35
|
-
*/
|
|
36
|
-
export function isAuthError(error) {
|
|
37
|
-
return (isErrorLike(error) &&
|
|
38
|
-
(error.code === "UNAUTHORIZED" ||
|
|
39
|
-
error.code === "INVALID_TOKEN" ||
|
|
40
|
-
error.code === "INVALID_CREDENTIALS"));
|
|
41
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
}
|