hububb-saas-shared 1.2.59 → 1.2.60

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.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Fixed cleaning duration estimates by property size.
3
+ * Not based on historical task durations (which can be skewed by forgotten clock-outs).
4
+ */
5
+ export declare function estimateCleaningHoursByProperty(bedrooms?: number | null, propertyType?: string | null): number;
6
+ /** Formats cleaning duration for display, e.g. 3.5 → "3h 30m", 2 → "2h". */
7
+ export declare function formatCleaningDuration(hours: number): string;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.estimateCleaningHoursByProperty = estimateCleaningHoursByProperty;
4
+ exports.formatCleaningDuration = formatCleaningDuration;
5
+ /**
6
+ * Fixed cleaning duration estimates by property size.
7
+ * Not based on historical task durations (which can be skewed by forgotten clock-outs).
8
+ */
9
+ function estimateCleaningHoursByProperty(bedrooms, propertyType) {
10
+ const bedCount = bedrooms !== null && bedrooms !== void 0 ? bedrooms : 0;
11
+ if (propertyType === "STUDIO" || bedCount === 0) {
12
+ return 1;
13
+ }
14
+ if (bedCount === 1) {
15
+ return 2;
16
+ }
17
+ if (bedCount === 2) {
18
+ return 3;
19
+ }
20
+ if (bedCount === 3) {
21
+ return 3.5;
22
+ }
23
+ return 4;
24
+ }
25
+ /** Formats cleaning duration for display, e.g. 3.5 → "3h 30m", 2 → "2h". */
26
+ function formatCleaningDuration(hours) {
27
+ const wholeHours = Math.floor(hours);
28
+ const minutes = Math.round((hours - wholeHours) * 60);
29
+ if (minutes === 0) {
30
+ return `${wholeHours}h`;
31
+ }
32
+ if (wholeHours === 0) {
33
+ return `${minutes}m`;
34
+ }
35
+ return `${wholeHours}h ${minutes}m`;
36
+ }
@@ -10,3 +10,4 @@ export interface Timestamp {
10
10
  export declare const firestoreTimestampSchema: z.ZodType<Timestamp>;
11
11
  export { getReservationXeroSyncView, type ReservationXeroSyncView, type XeroSyncStatus, } from "./reservation-xero";
12
12
  export { AIRBNB_SUPPORT_THREAD_TITLE, isAirbnbSupportThread, isAirbnbSupportThreadTitle, resolveAirbnbInquiryThread, } from "./chat-thread";
13
+ export { estimateCleaningHoursByProperty, formatCleaningDuration, } from "./cleaning-estimate";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveAirbnbInquiryThread = exports.isAirbnbSupportThreadTitle = exports.isAirbnbSupportThread = exports.AIRBNB_SUPPORT_THREAD_TITLE = exports.getReservationXeroSyncView = exports.firestoreTimestampSchema = void 0;
3
+ exports.formatCleaningDuration = exports.estimateCleaningHoursByProperty = exports.resolveAirbnbInquiryThread = exports.isAirbnbSupportThreadTitle = exports.isAirbnbSupportThread = exports.AIRBNB_SUPPORT_THREAD_TITLE = 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
@@ -20,3 +20,6 @@ Object.defineProperty(exports, "AIRBNB_SUPPORT_THREAD_TITLE", { enumerable: true
20
20
  Object.defineProperty(exports, "isAirbnbSupportThread", { enumerable: true, get: function () { return chat_thread_1.isAirbnbSupportThread; } });
21
21
  Object.defineProperty(exports, "isAirbnbSupportThreadTitle", { enumerable: true, get: function () { return chat_thread_1.isAirbnbSupportThreadTitle; } });
22
22
  Object.defineProperty(exports, "resolveAirbnbInquiryThread", { enumerable: true, get: function () { return chat_thread_1.resolveAirbnbInquiryThread; } });
23
+ var cleaning_estimate_1 = require("./cleaning-estimate");
24
+ Object.defineProperty(exports, "estimateCleaningHoursByProperty", { enumerable: true, get: function () { return cleaning_estimate_1.estimateCleaningHoursByProperty; } });
25
+ Object.defineProperty(exports, "formatCleaningDuration", { enumerable: true, get: function () { return cleaning_estimate_1.formatCleaningDuration; } });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "commonjs",
3
3
  "name": "hububb-saas-shared",
4
- "version": "1.2.59",
4
+ "version": "1.2.60",
5
5
  "description": "This is a shared package for the hububb saas project",
6
6
  "types": "./dist/index.d.ts",
7
7
  "main": "./dist/index.js",