@vibe-flats/booking-engine-common-server 1.0.154 → 1.0.156

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/build/index.d.ts CHANGED
@@ -5,3 +5,4 @@ export * from './src/utils/monthly-diff';
5
5
  export * from './src/utils/purge-unit-cache';
6
6
  export * from './src/utils/cache';
7
7
  export * from './src/utils/guesty-total';
8
+ export * from './src/types/guesty-reservation';
package/build/index.js CHANGED
@@ -21,3 +21,4 @@ __exportStar(require("./src/utils/monthly-diff"), exports);
21
21
  __exportStar(require("./src/utils/purge-unit-cache"), exports);
22
22
  __exportStar(require("./src/utils/cache"), exports);
23
23
  __exportStar(require("./src/utils/guesty-total"), exports);
24
+ __exportStar(require("./src/types/guesty-reservation"), exports);
@@ -58,6 +58,7 @@ export interface UnitDocument extends mongoose.Document {
58
58
  amenities: string[];
59
59
  checkin: string;
60
60
  checkout: string;
61
+ timezone: string;
61
62
  areaSquareFeet: number;
62
63
  beds: {
63
64
  type: string;
@@ -78,6 +78,7 @@ const schema = new mongoose_1.default.Schema({
78
78
  amenities: [{ type: String, required: true }],
79
79
  checkin: { type: String, required: true },
80
80
  checkout: { type: String, required: true },
81
+ timezone: { type: String, required: false },
81
82
  areaSquareFeet: { type: Number, required: false },
82
83
  beds: [{ type: { type: String, required: true }, qty: { type: Number, required: true }, _id: false }],
83
84
  prices: {
@@ -0,0 +1,192 @@
1
+ /**
2
+ * Consolidated shape of a Guesty reservation, merged from every variation
3
+ * previously duplicated across the booking-engine subprojects
4
+ * (pay, quotes, extensions, admin, sync).
5
+ *
6
+ * Fields are required when every variation had them as required,
7
+ * and optional when at least one variation marked them optional OR
8
+ * when Guesty only returns them for specific `?fields=` queries.
9
+ */
10
+ export interface GuestyReservationCurrency {
11
+ rate?: number;
12
+ rateDate?: string;
13
+ from?: string;
14
+ to?: string;
15
+ }
16
+ export interface GuestyReservationChannelCommission {
17
+ manual?: any[];
18
+ }
19
+ export interface GuestyReservationSettingsSnapshot {
20
+ currency?: GuestyReservationCurrency;
21
+ monthlyPriceFactor?: number;
22
+ weeklyPriceFactor?: number;
23
+ taxes?: any[];
24
+ additionalFees?: any[];
25
+ markup?: any | null;
26
+ channelCommission?: GuestyReservationChannelCommission;
27
+ useAccountRevenueShare?: boolean;
28
+ useAccountAdditionalFees?: boolean;
29
+ guestsIncludedInRegularFee?: number;
30
+ extraPersonFee?: number;
31
+ cleaningFee?: number;
32
+ }
33
+ export interface GuestyReservationInvoiceItem {
34
+ _id?: string;
35
+ type?: string;
36
+ normalType?: string;
37
+ title: string;
38
+ amount: number;
39
+ isLocked?: boolean;
40
+ currency?: string;
41
+ }
42
+ export interface GuestyReservationChargebacksData {
43
+ chargebacks?: any[];
44
+ }
45
+ export interface GuestyReservationRefund {
46
+ status: string;
47
+ amount: number;
48
+ }
49
+ export interface GuestyReservationPayment {
50
+ _id: string;
51
+ paymentMethodStatus?: string;
52
+ isAuthorizationHold?: boolean;
53
+ status: string;
54
+ chargebacksData?: GuestyReservationChargebacksData;
55
+ paymentMethodId?: string;
56
+ amount: number;
57
+ shouldBePaidAt?: string;
58
+ currency?: string;
59
+ guestId?: string;
60
+ refunds?: GuestyReservationRefund[];
61
+ authorizationHoldCaptures?: any[];
62
+ createdAt?: string;
63
+ attempts?: any[];
64
+ receiptTargets?: any[];
65
+ paidAt?: string;
66
+ receiptId?: number;
67
+ }
68
+ export interface GuestyMoney {
69
+ _id?: string;
70
+ settingsSnapshot?: GuestyReservationSettingsSnapshot;
71
+ channelCommissionRules?: any | null;
72
+ paymentProviderIds?: string[];
73
+ altered?: boolean;
74
+ invoiceItems?: GuestyReservationInvoiceItem[];
75
+ payments?: GuestyReservationPayment[];
76
+ autoPaymentsPolicy?: any[];
77
+ transientOccupancyTax?: number;
78
+ hostOriginalPayout?: number;
79
+ fareAccommodation?: number;
80
+ hostServiceFee?: number;
81
+ fareCleaning?: number;
82
+ currency?: string;
83
+ version?: number;
84
+ fareAccommodationAdjustment?: number;
85
+ fareAccommodationDiscount?: number;
86
+ fareAccommodationAdjusted?: number;
87
+ hostServiceFeeTax?: number;
88
+ hostServiceFeeIncTax?: number;
89
+ totalFees?: number;
90
+ subTotalPrice: number;
91
+ hostPayout?: number;
92
+ hostPayoutUsd?: number;
93
+ totalTaxes: number;
94
+ useAccountRevenueShare?: boolean;
95
+ netIncomeFormula?: string;
96
+ netIncome?: number;
97
+ commissionFormula?: string;
98
+ commission?: number;
99
+ commissionTaxPercentage?: number;
100
+ commissionTax?: number;
101
+ commissionIncTax?: number;
102
+ ownerRevenueFormula?: string;
103
+ ownerRevenue?: number;
104
+ currencyConversionRateToAccount?: number;
105
+ fareAccommodationBundleFeesApplied?: number;
106
+ platform?: string;
107
+ reservationId?: string;
108
+ bundledFees?: any[];
109
+ createdAt?: string;
110
+ updatedAt?: string;
111
+ balanceDue: number;
112
+ isFullyPaid?: boolean;
113
+ paymentsDue?: number;
114
+ totalRefunded?: number;
115
+ totalPaid: number;
116
+ isTouchedPayments?: boolean;
117
+ }
118
+ export interface GuestyReservationListing {
119
+ _id: string;
120
+ picture?: {
121
+ thumbnail?: string;
122
+ };
123
+ prices?: {
124
+ currency?: string;
125
+ };
126
+ type?: string;
127
+ nickname?: string;
128
+ title?: string;
129
+ address?: {
130
+ full?: string;
131
+ };
132
+ timezone?: string;
133
+ defaultCheckInTime?: string;
134
+ }
135
+ export interface GuestyReservationNumberOfGuests {
136
+ numberOfAdults?: number;
137
+ numberOfChildren?: number;
138
+ numberOfInfants?: number;
139
+ numberOfPets?: number;
140
+ }
141
+ export interface GuestyReservationGuest {
142
+ _id: string;
143
+ phone?: string;
144
+ fullName?: string;
145
+ lastName?: string;
146
+ firstName?: string;
147
+ email?: string;
148
+ }
149
+ export interface GuestyReservationIntegration {
150
+ platform?: string;
151
+ }
152
+ export interface GuestyReservationBlockDayFlag {
153
+ blockDay?: boolean;
154
+ }
155
+ export interface GuestyReservation {
156
+ _id: string;
157
+ manuallyCreated?: boolean;
158
+ creationInfo?: any | null;
159
+ listingId: string;
160
+ confirmationCode?: string;
161
+ checkIn?: string;
162
+ checkInDateLocalized: string;
163
+ nightsCount: number;
164
+ guestsCount?: number;
165
+ cancellationPolicy?: string;
166
+ checkOut?: string;
167
+ checkOutDateLocalized: string;
168
+ source?: string;
169
+ listing: GuestyReservationListing;
170
+ numberOfGuests?: GuestyReservationNumberOfGuests;
171
+ plannedArrival?: string;
172
+ plannedDeparture?: string;
173
+ status: string;
174
+ guest: GuestyReservationGuest;
175
+ money: GuestyMoney;
176
+ accountId?: string;
177
+ importedAt?: string;
178
+ guestId?: string;
179
+ isReturningGuest?: boolean;
180
+ confirmedAt?: string;
181
+ createdAt?: string;
182
+ pendingTasks?: any[];
183
+ customFields?: any[];
184
+ integration?: GuestyReservationIntegration;
185
+ earlyCheckIn?: GuestyReservationBlockDayFlag;
186
+ lateCheckOut?: GuestyReservationBlockDayFlag;
187
+ reservedAt?: string;
188
+ reservedExpiresAt?: string;
189
+ createdBy?: string;
190
+ browserCheckIn?: string;
191
+ browserCheckOut?: string;
192
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * Consolidated shape of a Guesty reservation, merged from every variation
4
+ * previously duplicated across the booking-engine subprojects
5
+ * (pay, quotes, extensions, admin, sync).
6
+ *
7
+ * Fields are required when every variation had them as required,
8
+ * and optional when at least one variation marked them optional OR
9
+ * when Guesty only returns them for specific `?fields=` queries.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +1,4 @@
1
- export interface GuestyMoney {
2
- subTotalPrice: number;
3
- totalTaxes: number;
4
- [key: string]: any;
5
- }
1
+ import { GuestyMoney } from '../types/guesty-reservation';
6
2
  /**
7
3
  * Calculates the true Guesty reservation total including taxes.
8
4
  * Guesty's `subTotalPrice` excludes taxes, so this adds `totalTaxes` to get the full amount.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibe-flats/booking-engine-common-server",
3
- "version": "1.0.154",
3
+ "version": "1.0.156",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",