hububb-saas-shared 1.2.42 → 1.2.44
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/helpers/index.d.ts +1 -0
- package/dist/helpers/index.js +3 -1
- package/dist/helpers/reservation-xero.d.ts +15 -0
- package/dist/helpers/reservation-xero.js +14 -0
- package/dist/schemas/ai-agent/property-manager-session.d.ts +2 -2
- package/dist/schemas/ai-agent/revenue-manager-config.d.ts +2 -2
- package/dist/schemas/ai-agent/revenue-manager-run-log.d.ts +4 -4
- package/dist/schemas/bank-account/index.d.ts +4 -4
- package/dist/schemas/channex/booking.d.ts +2 -2
- package/dist/schemas/channex/thread.d.ts +2 -2
- package/dist/schemas/custom-bundle/index.d.ts +2 -2
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/invoice/index.d.ts +2 -2
- package/dist/schemas/payment-method/index.d.ts +2 -2
- package/dist/schemas/property-room-bed/index.d.ts +2 -2
- package/dist/schemas/reservation/index.d.ts +154 -1
- package/dist/schemas/reservation/index.js +10 -8
- package/dist/schemas/reservation-xero/index.d.ts +136 -0
- package/dist/schemas/reservation-xero/index.js +36 -0
- package/dist/schemas/restriction/index.d.ts +2 -2
- package/dist/schemas/seam/index.d.ts +6 -6
- package/dist/schemas/service-provider/index.d.ts +2 -2
- package/dist/schemas/service-provider-service/index.d.ts +2 -2
- package/dist/schemas/subscription-service/index.d.ts +2 -2
- package/dist/schemas/task/index.d.ts +5 -2
- package/dist/schemas/task/index.js +1 -0
- package/dist/schemas/task-assignment/index.d.ts +2 -2
- package/dist/schemas/task-checklist-item/index.d.ts +2 -2
- package/dist/schemas/task-checklist-space/index.d.ts +2 -2
- package/dist/schemas/task-thread/index.d.ts +8 -8
- package/dist/schemas/thread/index.d.ts +103 -6
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/reservation-xero/index.d.ts +7 -0
- package/dist/types/service-provider/index.d.ts +2 -0
- package/dist/types/task/index.d.ts +2 -0
- package/package.json +1 -1
- package/dist/schemas/enums/index.d.ts +0 -45
- package/dist/schemas/enums/index.js +0 -56
- package/dist/schemas/service-property/index.d.ts +0 -19
- package/dist/schemas/service-property/index.js +0 -11
- package/dist/types/service-property/index.d.ts +0 -8
- /package/dist/types/{service-property → reservation-xero}/index.js +0 -0
package/dist/helpers/index.d.ts
CHANGED
package/dist/helpers/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.firestoreTimestampSchema = void 0;
|
|
3
|
+
exports.getReservationXeroSyncView = exports.firestoreTimestampSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
// Create a complete type-safe timestamp schema
|
|
6
6
|
exports.firestoreTimestampSchema = zod_1.z
|
|
@@ -13,3 +13,5 @@ exports.firestoreTimestampSchema = zod_1.z
|
|
|
13
13
|
valueOf: zod_1.z.function().returns(zod_1.z.string()),
|
|
14
14
|
})
|
|
15
15
|
.refine((val) => val && typeof val.toDate === "function", "Must be a valid Timestamp");
|
|
16
|
+
var reservation_xero_1 = require("./reservation-xero");
|
|
17
|
+
Object.defineProperty(exports, "getReservationXeroSyncView", { enumerable: true, get: function () { return reservation_xero_1.getReservationXeroSyncView; } });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { XeroSyncStatusEnum } from "../schemas/reservation-xero";
|
|
3
|
+
import type { Reservation } from "../types/reservation";
|
|
4
|
+
export type XeroSyncStatus = z.infer<typeof XeroSyncStatusEnum>;
|
|
5
|
+
export type ReservationXeroSyncView = {
|
|
6
|
+
syncStatus: XeroSyncStatus | null | undefined;
|
|
7
|
+
lastAttemptAt?: Date | null;
|
|
8
|
+
lastSuccessAt?: Date | null;
|
|
9
|
+
lastError?: string | null;
|
|
10
|
+
retryCount: number;
|
|
11
|
+
};
|
|
12
|
+
type ReservationXeroFields = Pick<Reservation, "xero" | "xeroSyncStatus" | "xeroLastAttemptAt" | "xeroLastSuccessAt" | "xeroLastError" | "xeroRetryCount">;
|
|
13
|
+
/** Prefer `reservation.xero`; fall back to legacy flat columns during migration. */
|
|
14
|
+
export declare function getReservationXeroSyncView(reservation: ReservationXeroFields): ReservationXeroSyncView;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReservationXeroSyncView = getReservationXeroSyncView;
|
|
4
|
+
/** Prefer `reservation.xero`; fall back to legacy flat columns during migration. */
|
|
5
|
+
function getReservationXeroSyncView(reservation) {
|
|
6
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
7
|
+
return {
|
|
8
|
+
syncStatus: (_c = (_b = (_a = reservation.xero) === null || _a === void 0 ? void 0 : _a.syncStatus) !== null && _b !== void 0 ? _b : reservation.xeroSyncStatus) !== null && _c !== void 0 ? _c : null,
|
|
9
|
+
lastAttemptAt: (_e = (_d = reservation.xero) === null || _d === void 0 ? void 0 : _d.lastAttemptAt) !== null && _e !== void 0 ? _e : reservation.xeroLastAttemptAt,
|
|
10
|
+
lastSuccessAt: (_g = (_f = reservation.xero) === null || _f === void 0 ? void 0 : _f.lastSuccessAt) !== null && _g !== void 0 ? _g : reservation.xeroLastSuccessAt,
|
|
11
|
+
lastError: (_k = (_j = (_h = reservation.xero) === null || _h === void 0 ? void 0 : _h.lastError) !== null && _j !== void 0 ? _j : reservation.xeroLastError) !== null && _k !== void 0 ? _k : null,
|
|
12
|
+
retryCount: (_o = (_m = (_l = reservation.xero) === null || _l === void 0 ? void 0 : _l.retryCount) !== null && _m !== void 0 ? _m : reservation.xeroRetryCount) !== null && _o !== void 0 ? _o : 0,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -23,11 +23,11 @@ export declare const propertyManagerSessionSchema: z.ZodObject<{
|
|
|
23
23
|
sessionType: PropertyManagerSessionType;
|
|
24
24
|
fileUrls: string[];
|
|
25
25
|
fileNames: string[];
|
|
26
|
-
appliedAt?: Date | undefined;
|
|
27
26
|
messages?: unknown;
|
|
28
27
|
analysisSummary?: string | undefined;
|
|
29
28
|
analysisStartedAt?: Date | undefined;
|
|
30
29
|
analysisCompletedAt?: Date | undefined;
|
|
30
|
+
appliedAt?: Date | undefined;
|
|
31
31
|
}, {
|
|
32
32
|
id: string;
|
|
33
33
|
status: PropertyManagerSessionStatus;
|
|
@@ -37,9 +37,9 @@ export declare const propertyManagerSessionSchema: z.ZodObject<{
|
|
|
37
37
|
sessionType: PropertyManagerSessionType;
|
|
38
38
|
fileUrls: string[];
|
|
39
39
|
fileNames: string[];
|
|
40
|
-
appliedAt?: Date | undefined;
|
|
41
40
|
messages?: unknown;
|
|
42
41
|
analysisSummary?: string | undefined;
|
|
43
42
|
analysisStartedAt?: Date | undefined;
|
|
44
43
|
analysisCompletedAt?: Date | undefined;
|
|
44
|
+
appliedAt?: Date | undefined;
|
|
45
45
|
}>;
|
|
@@ -43,9 +43,9 @@ export declare const revenueManagerConfigSchema: import("zod").ZodObject<{
|
|
|
43
43
|
createdAt: Date;
|
|
44
44
|
updatedAt: Date;
|
|
45
45
|
basePrice: number;
|
|
46
|
+
subscriptionId: number;
|
|
46
47
|
minPrice: number;
|
|
47
48
|
maxPrice: number;
|
|
48
|
-
subscriptionId: number;
|
|
49
49
|
strategy: string;
|
|
50
50
|
aggressiveness: number;
|
|
51
51
|
allowOccupancyAdjustments: boolean;
|
|
@@ -82,9 +82,9 @@ export declare const revenueManagerConfigSchema: import("zod").ZodObject<{
|
|
|
82
82
|
createdAt: Date;
|
|
83
83
|
updatedAt: Date;
|
|
84
84
|
basePrice: number;
|
|
85
|
+
subscriptionId: number;
|
|
85
86
|
minPrice: number;
|
|
86
87
|
maxPrice: number;
|
|
87
|
-
subscriptionId: number;
|
|
88
88
|
strategy: string;
|
|
89
89
|
aggressiveness: number;
|
|
90
90
|
allowOccupancyAdjustments: boolean;
|
|
@@ -23,10 +23,10 @@ export declare const revenueManagerRunLogSchema: z.ZodObject<{
|
|
|
23
23
|
succeeded: boolean;
|
|
24
24
|
createdAt: Date;
|
|
25
25
|
propertyId: number;
|
|
26
|
-
minPrice: number;
|
|
27
|
-
maxPrice: number;
|
|
28
26
|
startedAt: Date;
|
|
29
27
|
subscriptionId: number;
|
|
28
|
+
minPrice: number;
|
|
29
|
+
maxPrice: number;
|
|
30
30
|
daysProcessed: number;
|
|
31
31
|
daysSkipped: number;
|
|
32
32
|
avgPrice: number;
|
|
@@ -41,10 +41,10 @@ export declare const revenueManagerRunLogSchema: z.ZodObject<{
|
|
|
41
41
|
succeeded: boolean;
|
|
42
42
|
createdAt: Date;
|
|
43
43
|
propertyId: number;
|
|
44
|
-
minPrice: number;
|
|
45
|
-
maxPrice: number;
|
|
46
44
|
startedAt: Date;
|
|
47
45
|
subscriptionId: number;
|
|
46
|
+
minPrice: number;
|
|
47
|
+
maxPrice: number;
|
|
48
48
|
daysProcessed: number;
|
|
49
49
|
daysSkipped: number;
|
|
50
50
|
avgPrice: number;
|
|
@@ -12,17 +12,17 @@ export declare const bankAccountSchema: import("zod").ZodObject<{
|
|
|
12
12
|
createdAt: Date;
|
|
13
13
|
updatedAt: Date;
|
|
14
14
|
userId: string;
|
|
15
|
-
accountName: string;
|
|
16
|
-
isDefault: boolean;
|
|
17
15
|
accountNumber: string;
|
|
18
16
|
sortCode: string;
|
|
17
|
+
accountName: string;
|
|
18
|
+
isDefault: boolean;
|
|
19
19
|
}, {
|
|
20
20
|
id: number;
|
|
21
21
|
createdAt: Date;
|
|
22
22
|
updatedAt: Date;
|
|
23
23
|
userId: string;
|
|
24
|
-
accountName: string;
|
|
25
|
-
isDefault: boolean;
|
|
26
24
|
accountNumber: string;
|
|
27
25
|
sortCode: string;
|
|
26
|
+
accountName: string;
|
|
27
|
+
isDefault: boolean;
|
|
28
28
|
}>;
|
|
@@ -1086,9 +1086,9 @@ export declare const WebhookChannexBookingSchema: import("zod").ZodObject<{
|
|
|
1086
1086
|
}>;
|
|
1087
1087
|
property_id: import("zod").ZodString;
|
|
1088
1088
|
}, "strip", import("zod").ZodTypeAny, {
|
|
1089
|
+
timestamp: string;
|
|
1089
1090
|
event: string;
|
|
1090
1091
|
property_id: string;
|
|
1091
|
-
timestamp: string;
|
|
1092
1092
|
payload: {
|
|
1093
1093
|
property_id: string;
|
|
1094
1094
|
revision_id: string;
|
|
@@ -1096,9 +1096,9 @@ export declare const WebhookChannexBookingSchema: import("zod").ZodObject<{
|
|
|
1096
1096
|
};
|
|
1097
1097
|
user_id?: string | null | undefined;
|
|
1098
1098
|
}, {
|
|
1099
|
+
timestamp: string;
|
|
1099
1100
|
event: string;
|
|
1100
1101
|
property_id: string;
|
|
1101
|
-
timestamp: string;
|
|
1102
1102
|
payload: {
|
|
1103
1103
|
property_id: string;
|
|
1104
1104
|
revision_id: string;
|
|
@@ -277,9 +277,9 @@ export declare const WebhookChannexMessageSchema: import("zod").ZodObject<{
|
|
|
277
277
|
}>;
|
|
278
278
|
property_id: import("zod").ZodString;
|
|
279
279
|
}, "strip", import("zod").ZodTypeAny, {
|
|
280
|
+
timestamp: string;
|
|
280
281
|
event: string;
|
|
281
282
|
property_id: string;
|
|
282
|
-
timestamp: string;
|
|
283
283
|
payload: {
|
|
284
284
|
message: string;
|
|
285
285
|
id: string;
|
|
@@ -294,9 +294,9 @@ export declare const WebhookChannexMessageSchema: import("zod").ZodObject<{
|
|
|
294
294
|
};
|
|
295
295
|
user_id?: string | null | undefined;
|
|
296
296
|
}, {
|
|
297
|
+
timestamp: string;
|
|
297
298
|
event: string;
|
|
298
299
|
property_id: string;
|
|
299
|
-
timestamp: string;
|
|
300
300
|
payload: {
|
|
301
301
|
message: string;
|
|
302
302
|
id: string;
|
|
@@ -26,8 +26,8 @@ export declare const customBundleSchema: import("zod").ZodObject<{
|
|
|
26
26
|
currency?: string | undefined;
|
|
27
27
|
description?: string | undefined;
|
|
28
28
|
isActive?: boolean | undefined;
|
|
29
|
-
showToHost?: boolean | undefined;
|
|
30
29
|
acceptedAt?: Date | undefined;
|
|
30
|
+
showToHost?: boolean | undefined;
|
|
31
31
|
declinedAt?: Date | undefined;
|
|
32
32
|
reservationCommissionPercentage?: number | undefined;
|
|
33
33
|
}, {
|
|
@@ -42,8 +42,8 @@ export declare const customBundleSchema: import("zod").ZodObject<{
|
|
|
42
42
|
currency?: string | undefined;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
isActive?: boolean | undefined;
|
|
45
|
-
showToHost?: boolean | undefined;
|
|
46
45
|
acceptedAt?: Date | undefined;
|
|
46
|
+
showToHost?: boolean | undefined;
|
|
47
47
|
declinedAt?: Date | undefined;
|
|
48
48
|
reservationCommissionPercentage?: number | undefined;
|
|
49
49
|
}>;
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./rate-plan";
|
|
|
6
6
|
export * from "./tier-pricing";
|
|
7
7
|
export * from "./service";
|
|
8
8
|
export * from "./reservation";
|
|
9
|
+
export * from "./reservation-xero";
|
|
9
10
|
export * from "./reservation-original-unit";
|
|
10
11
|
export * from "./tier-service";
|
|
11
12
|
export * from "./image";
|
package/dist/schemas/index.js
CHANGED
|
@@ -22,6 +22,7 @@ __exportStar(require("./rate-plan"), exports);
|
|
|
22
22
|
__exportStar(require("./tier-pricing"), exports);
|
|
23
23
|
__exportStar(require("./service"), exports);
|
|
24
24
|
__exportStar(require("./reservation"), exports);
|
|
25
|
+
__exportStar(require("./reservation-xero"), exports);
|
|
25
26
|
__exportStar(require("./reservation-original-unit"), exports);
|
|
26
27
|
__exportStar(require("./tier-service"), exports);
|
|
27
28
|
__exportStar(require("./image"), exports);
|
|
@@ -20,8 +20,8 @@ export declare const invoiceSchema: import("zod").ZodObject<{
|
|
|
20
20
|
createdAt: Date;
|
|
21
21
|
updatedAt: Date;
|
|
22
22
|
userId: string;
|
|
23
|
-
amount: number;
|
|
24
23
|
dueDate: Date;
|
|
24
|
+
amount: number;
|
|
25
25
|
subscriptionId?: string | undefined;
|
|
26
26
|
purchaseId?: string | undefined;
|
|
27
27
|
stripeInvoiceId?: string | undefined;
|
|
@@ -33,8 +33,8 @@ export declare const invoiceSchema: import("zod").ZodObject<{
|
|
|
33
33
|
createdAt: Date;
|
|
34
34
|
updatedAt: Date;
|
|
35
35
|
userId: string;
|
|
36
|
-
amount: number;
|
|
37
36
|
dueDate: Date;
|
|
37
|
+
amount: number;
|
|
38
38
|
subscriptionId?: string | undefined;
|
|
39
39
|
purchaseId?: string | undefined;
|
|
40
40
|
stripeInvoiceId?: string | undefined;
|
|
@@ -13,19 +13,19 @@ export declare const paymentMethodSchema: import("zod").ZodObject<{
|
|
|
13
13
|
brand: string;
|
|
14
14
|
createdAt: Date;
|
|
15
15
|
userId: string;
|
|
16
|
+
isDefault: boolean;
|
|
16
17
|
stripePaymentMethodId: string;
|
|
17
18
|
last4: string;
|
|
18
19
|
expiryMonth: number;
|
|
19
20
|
expiryYear: number;
|
|
20
|
-
isDefault: boolean;
|
|
21
21
|
}, {
|
|
22
22
|
id: string;
|
|
23
23
|
brand: string;
|
|
24
24
|
createdAt: Date;
|
|
25
25
|
userId: string;
|
|
26
|
+
isDefault: boolean;
|
|
26
27
|
stripePaymentMethodId: string;
|
|
27
28
|
last4: string;
|
|
28
29
|
expiryMonth: number;
|
|
29
30
|
expiryYear: number;
|
|
30
|
-
isDefault: boolean;
|
|
31
31
|
}>;
|
|
@@ -10,13 +10,13 @@ export declare const propertyRoomBedSchema: import("zod").ZodObject<{
|
|
|
10
10
|
createdAt: Date;
|
|
11
11
|
updatedAt: Date;
|
|
12
12
|
propertyRoomId: number;
|
|
13
|
-
quantity: number;
|
|
14
13
|
bedType: "OTHER" | "SINGLE_BED" | "DOUBLE_BED" | "QUEEN_BED" | "KING_BED" | "BUNK_BED" | "SOFA_BED" | "FLOOR_MATTRESS_BED" | "AIR_MATTRESS_BED" | "COUCH_BED" | "CRIB_BED" | "FUTON_BED" | "HAMMOCK_BED" | "TODDLER_BED" | "TRUNDLE_BED" | "WATER_BED" | "CALIFORNIA_KING_BED" | "SMALL_DOUBLE_BED";
|
|
14
|
+
quantity: number;
|
|
15
15
|
}, {
|
|
16
16
|
id: number;
|
|
17
17
|
createdAt: Date;
|
|
18
18
|
updatedAt: Date;
|
|
19
19
|
propertyRoomId: number;
|
|
20
|
-
quantity: number;
|
|
21
20
|
bedType: "OTHER" | "SINGLE_BED" | "DOUBLE_BED" | "QUEEN_BED" | "KING_BED" | "BUNK_BED" | "SOFA_BED" | "FLOOR_MATTRESS_BED" | "AIR_MATTRESS_BED" | "COUCH_BED" | "CRIB_BED" | "FUTON_BED" | "HAMMOCK_BED" | "TODDLER_BED" | "TRUNDLE_BED" | "WATER_BED" | "CALIFORNIA_KING_BED" | "SMALL_DOUBLE_BED";
|
|
21
|
+
quantity: number;
|
|
22
22
|
}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { XeroSyncStatusEnum } from "../reservation-xero";
|
|
3
|
+
export { XeroSyncStatusEnum };
|
|
2
4
|
export declare const ReservationStatusEnum: z.ZodEnum<["CONFIRMED", "CANCELLED", "PENDING"]>;
|
|
3
|
-
export declare const XeroSyncStatusEnum: z.ZodEnum<["PENDING", "SUCCESS", "FAILED", "SKIPPED"]>;
|
|
4
5
|
export declare const ReservationCustomerSchema: z.ZodObject<{
|
|
5
6
|
id: z.ZodString;
|
|
6
7
|
firstName: z.ZodString;
|
|
@@ -151,11 +152,113 @@ export declare const ReservationSchema: z.ZodObject<{
|
|
|
151
152
|
payoutId: z.ZodOptional<z.ZodNumber>;
|
|
152
153
|
payoutAmount: z.ZodOptional<z.ZodNumber>;
|
|
153
154
|
requiresPayout: z.ZodBoolean;
|
|
155
|
+
/** @deprecated Use `xero.syncStatus` — kept until legacy columns are removed */
|
|
154
156
|
xeroSyncStatus: z.ZodOptional<z.ZodEnum<["PENDING", "SUCCESS", "FAILED", "SKIPPED"]>>;
|
|
157
|
+
/** @deprecated Use `xero.lastAttemptAt` */
|
|
155
158
|
xeroLastAttemptAt: z.ZodOptional<z.ZodDate>;
|
|
159
|
+
/** @deprecated Use `xero.lastSuccessAt` */
|
|
156
160
|
xeroLastSuccessAt: z.ZodOptional<z.ZodDate>;
|
|
161
|
+
/** @deprecated Use `xero.lastError` */
|
|
157
162
|
xeroLastError: z.ZodOptional<z.ZodString>;
|
|
163
|
+
/** @deprecated Use `xero.retryCount` */
|
|
158
164
|
xeroRetryCount: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
xero: z.ZodOptional<z.ZodObject<{
|
|
166
|
+
id: z.ZodNumber;
|
|
167
|
+
reservationId: z.ZodNumber;
|
|
168
|
+
syncStatus: z.ZodNullable<z.ZodOptional<z.ZodEnum<["PENDING", "SUCCESS", "FAILED", "SKIPPED"]>>>;
|
|
169
|
+
lastAttemptAt: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
170
|
+
lastSuccessAt: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
171
|
+
lastError: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
172
|
+
retryCount: z.ZodNumber;
|
|
173
|
+
xeroContactId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
174
|
+
createdAt: z.ZodDate;
|
|
175
|
+
updatedAt: z.ZodDate;
|
|
176
|
+
invoices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
177
|
+
id: z.ZodNumber;
|
|
178
|
+
reservationXeroId: z.ZodNumber;
|
|
179
|
+
xeroInvoiceId: z.ZodString;
|
|
180
|
+
xeroInvoiceNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
181
|
+
reference: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
182
|
+
invoiceDate: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
183
|
+
dueDate: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
184
|
+
unitAmount: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
185
|
+
status: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
186
|
+
createdAt: z.ZodDate;
|
|
187
|
+
updatedAt: z.ZodDate;
|
|
188
|
+
}, "strip", z.ZodTypeAny, {
|
|
189
|
+
id: number;
|
|
190
|
+
createdAt: Date;
|
|
191
|
+
updatedAt: Date;
|
|
192
|
+
reservationXeroId: number;
|
|
193
|
+
xeroInvoiceId: string;
|
|
194
|
+
status?: string | null | undefined;
|
|
195
|
+
xeroInvoiceNumber?: string | null | undefined;
|
|
196
|
+
reference?: string | null | undefined;
|
|
197
|
+
invoiceDate?: Date | null | undefined;
|
|
198
|
+
dueDate?: Date | null | undefined;
|
|
199
|
+
unitAmount?: number | null | undefined;
|
|
200
|
+
}, {
|
|
201
|
+
id: number;
|
|
202
|
+
createdAt: Date;
|
|
203
|
+
updatedAt: Date;
|
|
204
|
+
reservationXeroId: number;
|
|
205
|
+
xeroInvoiceId: string;
|
|
206
|
+
status?: string | null | undefined;
|
|
207
|
+
xeroInvoiceNumber?: string | null | undefined;
|
|
208
|
+
reference?: string | null | undefined;
|
|
209
|
+
invoiceDate?: Date | null | undefined;
|
|
210
|
+
dueDate?: Date | null | undefined;
|
|
211
|
+
unitAmount?: number | null | undefined;
|
|
212
|
+
}>, "many">>;
|
|
213
|
+
}, "strip", z.ZodTypeAny, {
|
|
214
|
+
id: number;
|
|
215
|
+
createdAt: Date;
|
|
216
|
+
updatedAt: Date;
|
|
217
|
+
reservationId: number;
|
|
218
|
+
retryCount: number;
|
|
219
|
+
syncStatus?: "PENDING" | "FAILED" | "SKIPPED" | "SUCCESS" | null | undefined;
|
|
220
|
+
lastAttemptAt?: Date | null | undefined;
|
|
221
|
+
lastSuccessAt?: Date | null | undefined;
|
|
222
|
+
lastError?: string | null | undefined;
|
|
223
|
+
xeroContactId?: string | null | undefined;
|
|
224
|
+
invoices?: {
|
|
225
|
+
id: number;
|
|
226
|
+
createdAt: Date;
|
|
227
|
+
updatedAt: Date;
|
|
228
|
+
reservationXeroId: number;
|
|
229
|
+
xeroInvoiceId: string;
|
|
230
|
+
status?: string | null | undefined;
|
|
231
|
+
xeroInvoiceNumber?: string | null | undefined;
|
|
232
|
+
reference?: string | null | undefined;
|
|
233
|
+
invoiceDate?: Date | null | undefined;
|
|
234
|
+
dueDate?: Date | null | undefined;
|
|
235
|
+
unitAmount?: number | null | undefined;
|
|
236
|
+
}[] | undefined;
|
|
237
|
+
}, {
|
|
238
|
+
id: number;
|
|
239
|
+
createdAt: Date;
|
|
240
|
+
updatedAt: Date;
|
|
241
|
+
reservationId: number;
|
|
242
|
+
retryCount: number;
|
|
243
|
+
syncStatus?: "PENDING" | "FAILED" | "SKIPPED" | "SUCCESS" | null | undefined;
|
|
244
|
+
lastAttemptAt?: Date | null | undefined;
|
|
245
|
+
lastSuccessAt?: Date | null | undefined;
|
|
246
|
+
lastError?: string | null | undefined;
|
|
247
|
+
xeroContactId?: string | null | undefined;
|
|
248
|
+
invoices?: {
|
|
249
|
+
id: number;
|
|
250
|
+
createdAt: Date;
|
|
251
|
+
updatedAt: Date;
|
|
252
|
+
reservationXeroId: number;
|
|
253
|
+
xeroInvoiceId: string;
|
|
254
|
+
status?: string | null | undefined;
|
|
255
|
+
xeroInvoiceNumber?: string | null | undefined;
|
|
256
|
+
reference?: string | null | undefined;
|
|
257
|
+
invoiceDate?: Date | null | undefined;
|
|
258
|
+
dueDate?: Date | null | undefined;
|
|
259
|
+
unitAmount?: number | null | undefined;
|
|
260
|
+
}[] | undefined;
|
|
261
|
+
}>>;
|
|
159
262
|
isUnitChanged: z.ZodBoolean;
|
|
160
263
|
}, "strip", z.ZodTypeAny, {
|
|
161
264
|
currency: string;
|
|
@@ -192,6 +295,31 @@ export declare const ReservationSchema: z.ZodObject<{
|
|
|
192
295
|
xeroLastSuccessAt?: Date | undefined;
|
|
193
296
|
xeroLastError?: string | undefined;
|
|
194
297
|
xeroRetryCount?: number | undefined;
|
|
298
|
+
xero?: {
|
|
299
|
+
id: number;
|
|
300
|
+
createdAt: Date;
|
|
301
|
+
updatedAt: Date;
|
|
302
|
+
reservationId: number;
|
|
303
|
+
retryCount: number;
|
|
304
|
+
syncStatus?: "PENDING" | "FAILED" | "SKIPPED" | "SUCCESS" | null | undefined;
|
|
305
|
+
lastAttemptAt?: Date | null | undefined;
|
|
306
|
+
lastSuccessAt?: Date | null | undefined;
|
|
307
|
+
lastError?: string | null | undefined;
|
|
308
|
+
xeroContactId?: string | null | undefined;
|
|
309
|
+
invoices?: {
|
|
310
|
+
id: number;
|
|
311
|
+
createdAt: Date;
|
|
312
|
+
updatedAt: Date;
|
|
313
|
+
reservationXeroId: number;
|
|
314
|
+
xeroInvoiceId: string;
|
|
315
|
+
status?: string | null | undefined;
|
|
316
|
+
xeroInvoiceNumber?: string | null | undefined;
|
|
317
|
+
reference?: string | null | undefined;
|
|
318
|
+
invoiceDate?: Date | null | undefined;
|
|
319
|
+
dueDate?: Date | null | undefined;
|
|
320
|
+
unitAmount?: number | null | undefined;
|
|
321
|
+
}[] | undefined;
|
|
322
|
+
} | undefined;
|
|
195
323
|
}, {
|
|
196
324
|
currency: string;
|
|
197
325
|
id: number;
|
|
@@ -227,4 +355,29 @@ export declare const ReservationSchema: z.ZodObject<{
|
|
|
227
355
|
xeroLastSuccessAt?: Date | undefined;
|
|
228
356
|
xeroLastError?: string | undefined;
|
|
229
357
|
xeroRetryCount?: number | undefined;
|
|
358
|
+
xero?: {
|
|
359
|
+
id: number;
|
|
360
|
+
createdAt: Date;
|
|
361
|
+
updatedAt: Date;
|
|
362
|
+
reservationId: number;
|
|
363
|
+
retryCount: number;
|
|
364
|
+
syncStatus?: "PENDING" | "FAILED" | "SKIPPED" | "SUCCESS" | null | undefined;
|
|
365
|
+
lastAttemptAt?: Date | null | undefined;
|
|
366
|
+
lastSuccessAt?: Date | null | undefined;
|
|
367
|
+
lastError?: string | null | undefined;
|
|
368
|
+
xeroContactId?: string | null | undefined;
|
|
369
|
+
invoices?: {
|
|
370
|
+
id: number;
|
|
371
|
+
createdAt: Date;
|
|
372
|
+
updatedAt: Date;
|
|
373
|
+
reservationXeroId: number;
|
|
374
|
+
xeroInvoiceId: string;
|
|
375
|
+
status?: string | null | undefined;
|
|
376
|
+
xeroInvoiceNumber?: string | null | undefined;
|
|
377
|
+
reference?: string | null | undefined;
|
|
378
|
+
invoiceDate?: Date | null | undefined;
|
|
379
|
+
dueDate?: Date | null | undefined;
|
|
380
|
+
unitAmount?: number | null | undefined;
|
|
381
|
+
}[] | undefined;
|
|
382
|
+
} | undefined;
|
|
230
383
|
}>;
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReservationSchema = exports.ReservationFinanceSchema = exports.ReservationUnitAssignmentSchema = exports.ReservationServiceSchema = exports.ReservationCustomerSchema = exports.
|
|
3
|
+
exports.ReservationSchema = exports.ReservationFinanceSchema = exports.ReservationUnitAssignmentSchema = exports.ReservationServiceSchema = exports.ReservationCustomerSchema = exports.ReservationStatusEnum = exports.XeroSyncStatusEnum = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const prisma_decimal_1 = require("../prisma-decimal");
|
|
6
|
+
const reservation_xero_1 = require("../reservation-xero");
|
|
7
|
+
Object.defineProperty(exports, "XeroSyncStatusEnum", { enumerable: true, get: function () { return reservation_xero_1.XeroSyncStatusEnum; } });
|
|
6
8
|
exports.ReservationStatusEnum = zod_1.z.enum([
|
|
7
9
|
"CONFIRMED",
|
|
8
10
|
"CANCELLED",
|
|
9
11
|
"PENDING",
|
|
10
12
|
]);
|
|
11
|
-
exports.XeroSyncStatusEnum = zod_1.z.enum([
|
|
12
|
-
"PENDING",
|
|
13
|
-
"SUCCESS",
|
|
14
|
-
"FAILED",
|
|
15
|
-
"SKIPPED",
|
|
16
|
-
]);
|
|
17
13
|
exports.ReservationCustomerSchema = zod_1.z.object({
|
|
18
14
|
id: zod_1.z.string().uuid(),
|
|
19
15
|
firstName: zod_1.z.string(),
|
|
@@ -86,10 +82,16 @@ exports.ReservationSchema = zod_1.z.object({
|
|
|
86
82
|
payoutId: zod_1.z.number().optional(),
|
|
87
83
|
payoutAmount: zod_1.z.number().optional(),
|
|
88
84
|
requiresPayout: zod_1.z.boolean(),
|
|
89
|
-
|
|
85
|
+
/** @deprecated Use `xero.syncStatus` — kept until legacy columns are removed */
|
|
86
|
+
xeroSyncStatus: reservation_xero_1.XeroSyncStatusEnum.optional(),
|
|
87
|
+
/** @deprecated Use `xero.lastAttemptAt` */
|
|
90
88
|
xeroLastAttemptAt: zod_1.z.date().optional(),
|
|
89
|
+
/** @deprecated Use `xero.lastSuccessAt` */
|
|
91
90
|
xeroLastSuccessAt: zod_1.z.date().optional(),
|
|
91
|
+
/** @deprecated Use `xero.lastError` */
|
|
92
92
|
xeroLastError: zod_1.z.string().optional(),
|
|
93
|
+
/** @deprecated Use `xero.retryCount` */
|
|
93
94
|
xeroRetryCount: zod_1.z.number().optional(),
|
|
95
|
+
xero: reservation_xero_1.ReservationXeroSchema.optional(),
|
|
94
96
|
isUnitChanged: zod_1.z.boolean(),
|
|
95
97
|
});
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const XeroSyncStatusEnum: z.ZodEnum<["PENDING", "SUCCESS", "FAILED", "SKIPPED"]>;
|
|
3
|
+
export declare const ReservationXeroInvoiceSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodNumber;
|
|
5
|
+
reservationXeroId: z.ZodNumber;
|
|
6
|
+
xeroInvoiceId: z.ZodString;
|
|
7
|
+
xeroInvoiceNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
8
|
+
reference: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
9
|
+
invoiceDate: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
10
|
+
dueDate: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
11
|
+
unitAmount: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
12
|
+
status: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
13
|
+
createdAt: z.ZodDate;
|
|
14
|
+
updatedAt: z.ZodDate;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
id: number;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
updatedAt: Date;
|
|
19
|
+
reservationXeroId: number;
|
|
20
|
+
xeroInvoiceId: string;
|
|
21
|
+
status?: string | null | undefined;
|
|
22
|
+
xeroInvoiceNumber?: string | null | undefined;
|
|
23
|
+
reference?: string | null | undefined;
|
|
24
|
+
invoiceDate?: Date | null | undefined;
|
|
25
|
+
dueDate?: Date | null | undefined;
|
|
26
|
+
unitAmount?: number | null | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
id: number;
|
|
29
|
+
createdAt: Date;
|
|
30
|
+
updatedAt: Date;
|
|
31
|
+
reservationXeroId: number;
|
|
32
|
+
xeroInvoiceId: string;
|
|
33
|
+
status?: string | null | undefined;
|
|
34
|
+
xeroInvoiceNumber?: string | null | undefined;
|
|
35
|
+
reference?: string | null | undefined;
|
|
36
|
+
invoiceDate?: Date | null | undefined;
|
|
37
|
+
dueDate?: Date | null | undefined;
|
|
38
|
+
unitAmount?: number | null | undefined;
|
|
39
|
+
}>;
|
|
40
|
+
export declare const ReservationXeroSchema: z.ZodObject<{
|
|
41
|
+
id: z.ZodNumber;
|
|
42
|
+
reservationId: z.ZodNumber;
|
|
43
|
+
syncStatus: z.ZodNullable<z.ZodOptional<z.ZodEnum<["PENDING", "SUCCESS", "FAILED", "SKIPPED"]>>>;
|
|
44
|
+
lastAttemptAt: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
45
|
+
lastSuccessAt: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
46
|
+
lastError: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
47
|
+
retryCount: z.ZodNumber;
|
|
48
|
+
xeroContactId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
49
|
+
createdAt: z.ZodDate;
|
|
50
|
+
updatedAt: z.ZodDate;
|
|
51
|
+
invoices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
52
|
+
id: z.ZodNumber;
|
|
53
|
+
reservationXeroId: z.ZodNumber;
|
|
54
|
+
xeroInvoiceId: z.ZodString;
|
|
55
|
+
xeroInvoiceNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
56
|
+
reference: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
57
|
+
invoiceDate: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
58
|
+
dueDate: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
59
|
+
unitAmount: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
60
|
+
status: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
61
|
+
createdAt: z.ZodDate;
|
|
62
|
+
updatedAt: z.ZodDate;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
id: number;
|
|
65
|
+
createdAt: Date;
|
|
66
|
+
updatedAt: Date;
|
|
67
|
+
reservationXeroId: number;
|
|
68
|
+
xeroInvoiceId: string;
|
|
69
|
+
status?: string | null | undefined;
|
|
70
|
+
xeroInvoiceNumber?: string | null | undefined;
|
|
71
|
+
reference?: string | null | undefined;
|
|
72
|
+
invoiceDate?: Date | null | undefined;
|
|
73
|
+
dueDate?: Date | null | undefined;
|
|
74
|
+
unitAmount?: number | null | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
id: number;
|
|
77
|
+
createdAt: Date;
|
|
78
|
+
updatedAt: Date;
|
|
79
|
+
reservationXeroId: number;
|
|
80
|
+
xeroInvoiceId: string;
|
|
81
|
+
status?: string | null | undefined;
|
|
82
|
+
xeroInvoiceNumber?: string | null | undefined;
|
|
83
|
+
reference?: string | null | undefined;
|
|
84
|
+
invoiceDate?: Date | null | undefined;
|
|
85
|
+
dueDate?: Date | null | undefined;
|
|
86
|
+
unitAmount?: number | null | undefined;
|
|
87
|
+
}>, "many">>;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
id: number;
|
|
90
|
+
createdAt: Date;
|
|
91
|
+
updatedAt: Date;
|
|
92
|
+
reservationId: number;
|
|
93
|
+
retryCount: number;
|
|
94
|
+
syncStatus?: "PENDING" | "FAILED" | "SKIPPED" | "SUCCESS" | null | undefined;
|
|
95
|
+
lastAttemptAt?: Date | null | undefined;
|
|
96
|
+
lastSuccessAt?: Date | null | undefined;
|
|
97
|
+
lastError?: string | null | undefined;
|
|
98
|
+
xeroContactId?: string | null | undefined;
|
|
99
|
+
invoices?: {
|
|
100
|
+
id: number;
|
|
101
|
+
createdAt: Date;
|
|
102
|
+
updatedAt: Date;
|
|
103
|
+
reservationXeroId: number;
|
|
104
|
+
xeroInvoiceId: string;
|
|
105
|
+
status?: string | null | undefined;
|
|
106
|
+
xeroInvoiceNumber?: string | null | undefined;
|
|
107
|
+
reference?: string | null | undefined;
|
|
108
|
+
invoiceDate?: Date | null | undefined;
|
|
109
|
+
dueDate?: Date | null | undefined;
|
|
110
|
+
unitAmount?: number | null | undefined;
|
|
111
|
+
}[] | undefined;
|
|
112
|
+
}, {
|
|
113
|
+
id: number;
|
|
114
|
+
createdAt: Date;
|
|
115
|
+
updatedAt: Date;
|
|
116
|
+
reservationId: number;
|
|
117
|
+
retryCount: number;
|
|
118
|
+
syncStatus?: "PENDING" | "FAILED" | "SKIPPED" | "SUCCESS" | null | undefined;
|
|
119
|
+
lastAttemptAt?: Date | null | undefined;
|
|
120
|
+
lastSuccessAt?: Date | null | undefined;
|
|
121
|
+
lastError?: string | null | undefined;
|
|
122
|
+
xeroContactId?: string | null | undefined;
|
|
123
|
+
invoices?: {
|
|
124
|
+
id: number;
|
|
125
|
+
createdAt: Date;
|
|
126
|
+
updatedAt: Date;
|
|
127
|
+
reservationXeroId: number;
|
|
128
|
+
xeroInvoiceId: string;
|
|
129
|
+
status?: string | null | undefined;
|
|
130
|
+
xeroInvoiceNumber?: string | null | undefined;
|
|
131
|
+
reference?: string | null | undefined;
|
|
132
|
+
invoiceDate?: Date | null | undefined;
|
|
133
|
+
dueDate?: Date | null | undefined;
|
|
134
|
+
unitAmount?: number | null | undefined;
|
|
135
|
+
}[] | undefined;
|
|
136
|
+
}>;
|