@bash-app/bash-common 30.51.0 → 30.52.0

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 (184) hide show
  1. package/dist/definitions.d.ts +668 -0
  2. package/dist/definitions.d.ts.map +1 -0
  3. package/dist/definitions.js +467 -0
  4. package/dist/definitions.js.map +1 -0
  5. package/dist/extendedSchemas.d.ts +2206 -0
  6. package/dist/extendedSchemas.d.ts.map +1 -0
  7. package/dist/extendedSchemas.js +429 -0
  8. package/dist/extendedSchemas.js.map +1 -0
  9. package/dist/index.d.ts +39 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +40 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/utils/addressUtils.d.ts +14 -0
  14. package/dist/utils/addressUtils.d.ts.map +1 -0
  15. package/dist/utils/addressUtils.js +177 -0
  16. package/dist/utils/addressUtils.js.map +1 -0
  17. package/dist/utils/apiUtils.d.ts +14 -0
  18. package/dist/utils/apiUtils.d.ts.map +1 -0
  19. package/dist/utils/apiUtils.js +61 -0
  20. package/dist/utils/apiUtils.js.map +1 -0
  21. package/dist/utils/arrayUtils.d.ts +2 -0
  22. package/dist/utils/arrayUtils.d.ts.map +1 -0
  23. package/dist/utils/arrayUtils.js +5 -0
  24. package/dist/utils/arrayUtils.js.map +1 -0
  25. package/dist/utils/awsS3Utils.d.ts +10 -0
  26. package/dist/utils/awsS3Utils.d.ts.map +1 -0
  27. package/dist/utils/awsS3Utils.js +89 -0
  28. package/dist/utils/awsS3Utils.js.map +1 -0
  29. package/dist/utils/badgeUtils.d.ts +33 -0
  30. package/dist/utils/badgeUtils.d.ts.map +1 -0
  31. package/dist/utils/badgeUtils.js +57 -0
  32. package/dist/utils/badgeUtils.js.map +1 -0
  33. package/dist/utils/blog/blogDbUtils.d.ts +48 -0
  34. package/dist/utils/blog/blogDbUtils.d.ts.map +1 -0
  35. package/dist/utils/blog/blogDbUtils.js +218 -0
  36. package/dist/utils/blog/blogDbUtils.js.map +1 -0
  37. package/dist/utils/blogUtils.d.ts +19 -0
  38. package/dist/utils/blogUtils.d.ts.map +1 -0
  39. package/dist/utils/blogUtils.js +118 -0
  40. package/dist/utils/blogUtils.js.map +1 -0
  41. package/dist/utils/dateTimeUtils.d.ts +38 -0
  42. package/dist/utils/dateTimeUtils.d.ts.map +1 -0
  43. package/dist/utils/dateTimeUtils.js +207 -0
  44. package/dist/utils/dateTimeUtils.js.map +1 -0
  45. package/dist/utils/entityUtils.d.ts +5 -0
  46. package/dist/utils/entityUtils.d.ts.map +1 -0
  47. package/dist/utils/entityUtils.js +5 -0
  48. package/dist/utils/entityUtils.js.map +1 -0
  49. package/dist/utils/generalDateTimeUtils.d.ts +15 -0
  50. package/dist/utils/generalDateTimeUtils.d.ts.map +1 -0
  51. package/dist/utils/generalDateTimeUtils.js +38 -0
  52. package/dist/utils/generalDateTimeUtils.js.map +1 -0
  53. package/dist/utils/luxonUtils.d.ts +95 -0
  54. package/dist/utils/luxonUtils.d.ts.map +1 -0
  55. package/dist/utils/luxonUtils.js +623 -0
  56. package/dist/utils/luxonUtils.js.map +1 -0
  57. package/dist/utils/mathUtils.d.ts +2 -0
  58. package/dist/utils/mathUtils.d.ts.map +1 -0
  59. package/dist/utils/mathUtils.js +4 -0
  60. package/dist/utils/mathUtils.js.map +1 -0
  61. package/dist/utils/objUtils.d.ts +3 -0
  62. package/dist/utils/objUtils.d.ts.map +1 -0
  63. package/dist/utils/objUtils.js +29 -0
  64. package/dist/utils/objUtils.js.map +1 -0
  65. package/dist/utils/paymentUtils.d.ts +18 -0
  66. package/dist/utils/paymentUtils.d.ts.map +1 -0
  67. package/dist/utils/paymentUtils.js +50 -0
  68. package/dist/utils/paymentUtils.js.map +1 -0
  69. package/dist/utils/promoCodesUtils.d.ts +6 -0
  70. package/dist/utils/promoCodesUtils.d.ts.map +1 -0
  71. package/dist/utils/promoCodesUtils.js +23 -0
  72. package/dist/utils/promoCodesUtils.js.map +1 -0
  73. package/dist/utils/qrCodeUtils.d.ts +4 -0
  74. package/dist/utils/qrCodeUtils.d.ts.map +1 -0
  75. package/dist/utils/qrCodeUtils.js +22 -0
  76. package/dist/utils/qrCodeUtils.js.map +1 -0
  77. package/dist/utils/recurrenceUtils.d.ts +8 -0
  78. package/dist/utils/recurrenceUtils.d.ts.map +1 -0
  79. package/dist/utils/recurrenceUtils.js +153 -0
  80. package/dist/utils/recurrenceUtils.js.map +1 -0
  81. package/dist/utils/reviewUtils.d.ts +29 -0
  82. package/dist/utils/reviewUtils.d.ts.map +1 -0
  83. package/dist/utils/reviewUtils.js +65 -0
  84. package/dist/utils/reviewUtils.js.map +1 -0
  85. package/dist/utils/service/apiServiceBookingApiUtils.d.ts +21 -0
  86. package/dist/utils/service/apiServiceBookingApiUtils.d.ts.map +1 -0
  87. package/dist/utils/service/apiServiceBookingApiUtils.js +131 -0
  88. package/dist/utils/service/apiServiceBookingApiUtils.js.map +1 -0
  89. package/dist/utils/service/attendeeOptionUtils.d.ts +11 -0
  90. package/dist/utils/service/attendeeOptionUtils.d.ts.map +1 -0
  91. package/dist/utils/service/attendeeOptionUtils.js +9 -0
  92. package/dist/utils/service/attendeeOptionUtils.js.map +1 -0
  93. package/dist/utils/service/frontendServiceBookingUtils.d.ts +53 -0
  94. package/dist/utils/service/frontendServiceBookingUtils.d.ts.map +1 -0
  95. package/dist/utils/service/frontendServiceBookingUtils.js +134 -0
  96. package/dist/utils/service/frontendServiceBookingUtils.js.map +1 -0
  97. package/dist/utils/service/regexUtils.d.ts +6 -0
  98. package/dist/utils/service/regexUtils.d.ts.map +1 -0
  99. package/dist/utils/service/regexUtils.js +16 -0
  100. package/dist/utils/service/regexUtils.js.map +1 -0
  101. package/dist/utils/service/serviceBookingStatusUtils.d.ts +21 -0
  102. package/dist/utils/service/serviceBookingStatusUtils.d.ts.map +1 -0
  103. package/dist/utils/service/serviceBookingStatusUtils.js +130 -0
  104. package/dist/utils/service/serviceBookingStatusUtils.js.map +1 -0
  105. package/dist/utils/service/serviceBookingTypes.d.ts +19 -0
  106. package/dist/utils/service/serviceBookingTypes.d.ts.map +1 -0
  107. package/dist/utils/service/serviceBookingTypes.js +2 -0
  108. package/dist/utils/service/serviceBookingTypes.js.map +1 -0
  109. package/dist/utils/service/serviceDBUtils.d.ts +5 -0
  110. package/dist/utils/service/serviceDBUtils.d.ts.map +1 -0
  111. package/dist/utils/service/serviceDBUtils.js +48 -0
  112. package/dist/utils/service/serviceDBUtils.js.map +1 -0
  113. package/dist/utils/service/serviceRateDBUtils.d.ts +1 -0
  114. package/dist/utils/service/serviceRateDBUtils.d.ts.map +1 -0
  115. package/dist/utils/service/serviceRateDBUtils.js +159 -0
  116. package/dist/utils/service/serviceRateDBUtils.js.map +1 -0
  117. package/dist/utils/service/serviceRateTypes.d.ts +9 -0
  118. package/dist/utils/service/serviceRateTypes.d.ts.map +1 -0
  119. package/dist/utils/service/serviceRateTypes.js +2 -0
  120. package/dist/utils/service/serviceRateTypes.js.map +1 -0
  121. package/dist/utils/service/serviceRateUtils.d.ts +24 -0
  122. package/dist/utils/service/serviceRateUtils.d.ts.map +1 -0
  123. package/dist/utils/service/serviceRateUtils.js +183 -0
  124. package/dist/utils/service/serviceRateUtils.js.map +1 -0
  125. package/dist/utils/service/serviceUtils.d.ts +83 -0
  126. package/dist/utils/service/serviceUtils.d.ts.map +1 -0
  127. package/dist/utils/service/serviceUtils.js +311 -0
  128. package/dist/utils/service/serviceUtils.js.map +1 -0
  129. package/dist/utils/service/venueUtils.d.ts +13 -0
  130. package/dist/utils/service/venueUtils.d.ts.map +1 -0
  131. package/dist/utils/service/venueUtils.js +18 -0
  132. package/dist/utils/service/venueUtils.js.map +1 -0
  133. package/dist/utils/slugUtils.d.ts +9 -0
  134. package/dist/utils/slugUtils.d.ts.map +1 -0
  135. package/dist/utils/slugUtils.js +47 -0
  136. package/dist/utils/slugUtils.js.map +1 -0
  137. package/dist/utils/sortUtils.d.ts +7 -0
  138. package/dist/utils/sortUtils.d.ts.map +1 -0
  139. package/dist/utils/sortUtils.js +26 -0
  140. package/dist/utils/sortUtils.js.map +1 -0
  141. package/dist/utils/stringUtils.d.ts +2 -0
  142. package/dist/utils/stringUtils.d.ts.map +1 -0
  143. package/dist/utils/stringUtils.js +6 -0
  144. package/dist/utils/stringUtils.js.map +1 -0
  145. package/dist/utils/stripeAccountUtils.d.ts +3 -0
  146. package/dist/utils/stripeAccountUtils.d.ts.map +1 -0
  147. package/dist/utils/stripeAccountUtils.js +10 -0
  148. package/dist/utils/stripeAccountUtils.js.map +1 -0
  149. package/dist/utils/ticketListUtils.d.ts +12 -0
  150. package/dist/utils/ticketListUtils.d.ts.map +1 -0
  151. package/dist/utils/ticketListUtils.js +78 -0
  152. package/dist/utils/ticketListUtils.js.map +1 -0
  153. package/dist/utils/typeUtils.d.ts +11 -0
  154. package/dist/utils/typeUtils.d.ts.map +1 -0
  155. package/dist/utils/typeUtils.js +8 -0
  156. package/dist/utils/typeUtils.js.map +1 -0
  157. package/dist/utils/urlUtils.d.ts +10 -0
  158. package/dist/utils/urlUtils.d.ts.map +1 -0
  159. package/dist/utils/urlUtils.js +66 -0
  160. package/dist/utils/urlUtils.js.map +1 -0
  161. package/dist/utils/userPromoCodeUtils.d.ts +21 -0
  162. package/dist/utils/userPromoCodeUtils.d.ts.map +1 -0
  163. package/dist/utils/userPromoCodeUtils.js +13 -0
  164. package/dist/utils/userPromoCodeUtils.js.map +1 -0
  165. package/dist/utils/userSubscriptionUtils.d.ts +36 -0
  166. package/dist/utils/userSubscriptionUtils.d.ts.map +1 -0
  167. package/dist/utils/userSubscriptionUtils.js +56 -0
  168. package/dist/utils/userSubscriptionUtils.js.map +1 -0
  169. package/dist/utils/userUtils.d.ts +2 -0
  170. package/dist/utils/userUtils.d.ts.map +1 -0
  171. package/dist/utils/userUtils.js +2 -0
  172. package/dist/utils/userUtils.js.map +1 -0
  173. package/package.json +4 -2
  174. package/prisma/schema.prisma +117 -0
  175. package/src/definitions.ts +52 -1
  176. package/src/extendedSchemas.ts +177 -6
  177. package/src/index.ts +32 -21
  178. package/src/utils/blog/blogDbUtils.ts +343 -0
  179. package/src/utils/blogUtils.ts +134 -0
  180. package/src/utils/qrCodeUtils.ts +4 -2
  181. package/src/utils/service/apiServiceBookingApiUtils.ts +0 -0
  182. package/src/utils/slugUtils.ts +60 -0
  183. package/src/utils/ticketListUtils.ts +24 -6
  184. package/src/utils/typeUtils.ts +0 -0
@@ -0,0 +1,48 @@
1
+ // import {
2
+ // specialRateConvertToDb,
3
+ // generalRatesConvertRatesToDB,
4
+ // specialRateConvertFromDb,
5
+ // generalRatesConvertRatesFromDB,
6
+ // } from "./serviceRateDBUtils";
7
+ export function serviceToDb(service) {
8
+ if (service.serviceRatesAssociation) {
9
+ // service.serviceRatesAssociation.serviceSpecialRates =
10
+ // service.serviceRatesAssociation.serviceSpecialRates?.map(
11
+ // (
12
+ // serviceSpecialRate: Partial<ServiceSpecialRatesExt>
13
+ // ): ServiceSpecialRatesExt => {
14
+ // return specialRateConvertToDb(
15
+ // serviceSpecialRate
16
+ // ) as ServiceSpecialRatesExt;
17
+ // }
18
+ // );
19
+ // if (service.serviceRatesAssociation.serviceGeneralRates) {
20
+ // service.serviceRatesAssociation.serviceGeneralRates =
21
+ // generalRatesConvertRatesToDB(
22
+ // service.serviceRatesAssociation.serviceGeneralRates
23
+ // ) as ServiceRate;
24
+ // }
25
+ }
26
+ return service;
27
+ }
28
+ export function serviceFromDb(service) {
29
+ if (service.serviceRatesAssociation) {
30
+ // service.serviceRatesAssociation.serviceSpecialRates =
31
+ // service.serviceRatesAssociation.serviceSpecialRates?.map(
32
+ // (
33
+ // serviceSpecialRate: ServiceSpecialRatesExt
34
+ // ): ServiceSpecialRatesExt => {
35
+ // return specialRateConvertFromDb(serviceSpecialRate);
36
+ // }
37
+ // );
38
+ if (service.serviceRatesAssociation.serviceGeneralRates) {
39
+ // console.log("updating general rates from db");
40
+ // service.serviceRatesAssociation.serviceGeneralRates =
41
+ // generalRatesConvertRatesFromDB(
42
+ // service.serviceRatesAssociation.serviceGeneralRates
43
+ // );
44
+ }
45
+ }
46
+ return service;
47
+ }
48
+ //# sourceMappingURL=serviceDBUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceDBUtils.js","sourceRoot":"","sources":["../../../src/utils/service/serviceDBUtils.ts"],"names":[],"mappings":"AAEA,WAAW;AACX,4BAA4B;AAC5B,kCAAkC;AAClC,8BAA8B;AAC9B,oCAAoC;AACpC,iCAAiC;AAEjC,MAAM,UAAU,WAAW,CACzB,OAAgC;IAEhC,IAAI,OAAO,CAAC,uBAAuB,EAAE,CAAC;QACpC,wDAAwD;QACxD,8DAA8D;QAC9D,QAAQ;QACR,4DAA4D;QAC5D,qCAAqC;QACrC,uCAAuC;QACvC,6BAA6B;QAC7B,qCAAqC;QACrC,QAAQ;QACR,OAAO;QACP,6DAA6D;QAC7D,0DAA0D;QAC1D,oCAAoC;QACpC,4DAA4D;QAC5D,wBAAwB;QACxB,IAAI;IACN,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,OAAmB;IAC/C,IAAI,OAAO,CAAC,uBAAuB,EAAE,CAAC;QACpC,wDAAwD;QACxD,8DAA8D;QAC9D,QAAQ;QACR,mDAAmD;QACnD,qCAAqC;QACrC,6DAA6D;QAC7D,QAAQ;QACR,OAAO;QACP,IAAI,OAAO,CAAC,uBAAuB,CAAC,mBAAmB,EAAE,CAAC;YACxD,iDAAiD;YACjD,wDAAwD;YACxD,oCAAoC;YACpC,0DAA0D;YAC1D,OAAO;QACT,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=serviceRateDBUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceRateDBUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/service/serviceRateDBUtils.ts"],"names":[],"mappings":""}
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+ // import { ServiceRate } from "@prisma/client";
3
+ // import { ApiResult } from "../../definitions";
4
+ // import { ServiceSpecialRatesExt } from "../../extendedSchemas";
5
+ // import { convertDollarsToCents, convertCentsToDollars } from "../paymentUtils";
6
+ // export function specialRateConvertToDb(
7
+ // specialRate: Partial<ServiceSpecialRatesExt>
8
+ // ): Partial<ServiceSpecialRatesExt> {
9
+ // return specialRateConvertRatesToDB(
10
+ // specialRateConvertDateStringsToDb(structuredClone(specialRate))
11
+ // );
12
+ // }
13
+ // export function specialRateConvertFromDb(
14
+ // specialRate: ServiceSpecialRatesExt
15
+ // ): ServiceSpecialRatesExt {
16
+ // // console.log(`specialRateConvertFromDb`);
17
+ // return specialRateConvertRatesFromDB(
18
+ // specialRateConvertDateStringsFromDb(specialRate)
19
+ // );
20
+ // }
21
+ // function specialRateConvertDateStringsToDb(
22
+ // specialRate: Partial<ServiceSpecialRatesExt>
23
+ // ): Partial<ServiceSpecialRatesExt> {
24
+ // // const oldStart = new Date(specialRate.startDate!);
25
+ // // const oldEnd = new Date(specialRate.endDate!);
26
+ // // specialRate.startDate = dateTimeLocalToUTCDate(specialRate.startDate!);
27
+ // // specialRate.endDate = dateTimeLocalToUTCDate(specialRate.endDate!);
28
+ // // specialRate.startDate = normalizeDate(specialRate.startDate!);
29
+ // // specialRate.endDate = normalizeDate(specialRate.endDate!);
30
+ // // const localStart = dateTimeLocalFromUTCDate(new Date(specialRate.startDate!));
31
+ // // const localEnd = dateTimeLocalFromUTCDate(new Date(specialRate.endDate!));
32
+ // // console.log(
33
+ // // `specialRateConvertDateStringsToDb oldStart: ${oldStart?.toString()}`
34
+ // // );
35
+ // // console.log(
36
+ // // `specialRateConvertDateStringsToDb oldEnd: ${oldEnd?.toString()}`
37
+ // // );
38
+ // // console.log(
39
+ // // `specialRateConvertDateStringsToDb specialRate.startDate: ${specialRate.startDate?.toString()}`
40
+ // // );
41
+ // // console.log(
42
+ // // `specialRateConvertDateStringsToDb specialRate.endDate: ${specialRate.endDate?.toString()}`
43
+ // // );
44
+ // // console.log(
45
+ // // `specialRateConvertDateStringsToDb localStart: ${localStart?.toString()}`
46
+ // // );
47
+ // // console.log(
48
+ // // `specialRateConvertDateStringsToDb localEnd: ${localEnd?.toString()}`
49
+ // // );
50
+ // // const a = 3 + 4;
51
+ // // specialRate.startDate = specialRate.startDate.toISOString();
52
+ // // specialRate.endDate = specialRate.endDate.toISOString();
53
+ // // return specialRate;
54
+ // return specialRate;
55
+ // }
56
+ // function specialRateConvertDateStringsFromDb(
57
+ // specialRate: ServiceSpecialRatesExt
58
+ // ): ServiceSpecialRatesExt {
59
+ // // specialRate.startDate = localDateToUTC(new Date(specialRate.startDate));
60
+ // // specialRate.endDate = localDateToUTC(new Date(specialRate.endDate));
61
+ // //this shouldnt even be necessary as javascript dates are always stored in UTC timezone (they lack timezone information)
62
+ // // specialRate.startDate = ensureDateTimeIsLocalDateTime(
63
+ // // new Date(specialRate.startDate)
64
+ // // ).toDate();
65
+ // // specialRate.endDate = ensureDateTimeIsLocalDateTime(
66
+ // // new Date(specialRate.endDate)
67
+ // // ).toDate();
68
+ // specialRate.startDate = new Date(specialRate.startDate);
69
+ // specialRate.endDate = new Date(specialRate.endDate);
70
+ // // const oldStart = new Date(specialRate.startDate!);
71
+ // // const oldEnd = new Date(specialRate.endDate!);
72
+ // // specialRate.startDate = dateTimeLocalFromUTCDate(
73
+ // // new Date(specialRate.startDate)
74
+ // // );
75
+ // // specialRate.endDate = dateTimeLocalFromUTCDate(new Date(specialRate.endDate));
76
+ // // // specialRate.startDate = ensureDateTimeIsLocalDateTime(
77
+ // // // new Date(specialRate.startDate)
78
+ // // // ).toDate();
79
+ // // // specialRate.endDate = ensureDateTimeIsLocalDateTime(
80
+ // // // new Date(specialRate.endDate)
81
+ // // // ).toDate();
82
+ // // // specialRate.startDate = localDateToUTC(new Date(specialRate.startDate));
83
+ // // // specialRate.endDate = localDateToUTC(new Date(specialRate.endDate));
84
+ // // const date2 = normalizeDate(specialRate.startDate)!;
85
+ // // const date3 = normalizeDate(specialRate.endDate)!;
86
+ // // const a = 3 + 4;
87
+ // return specialRate;
88
+ // }
89
+ // function specialRateConvertRatesToDB(
90
+ // specialRate: Partial<ServiceSpecialRatesExt>
91
+ // ): Partial<ServiceSpecialRatesExt> {
92
+ // if (specialRate.serviceRate) {
93
+ // specialRate.serviceRate = generalRatesConvertRatesToDB(
94
+ // specialRate.serviceRate
95
+ // ) as ServiceRate;
96
+ // }
97
+ // return specialRate;
98
+ // }
99
+ // function specialRateConvertRatesFromDB(
100
+ // specialRate: ServiceSpecialRatesExt
101
+ // ): ServiceSpecialRatesExt {
102
+ // if (specialRate.serviceRate) {
103
+ // specialRate.serviceRate = generalRatesConvertRatesFromDB(
104
+ // specialRate.serviceRate
105
+ // );
106
+ // }
107
+ // return specialRate;
108
+ // }
109
+ // export function generalRatesConvertRatesToDB(
110
+ // generalRate: ServiceRate
111
+ // ): ServiceRate {
112
+ // return generalRatesConvertRatesToDBHelper(structuredClone(generalRate));
113
+ // }
114
+ // export function generalRatesConvertRatesToDBHelper(
115
+ // generalRate: ServiceRate
116
+ // ): ServiceRate {
117
+ // // console.log(
118
+ // // `generalRatesConvertRatesToDBHelper A: ${JSON.stringify(generalRate)}`
119
+ // // );
120
+ // if (generalRate?.dailyRate) {
121
+ // generalRate.dailyRate = convertDollarsToCents(generalRate.dailyRate);
122
+ // }
123
+ // if (generalRate?.hourlyRate) {
124
+ // generalRate.hourlyRate = convertDollarsToCents(generalRate.hourlyRate);
125
+ // }
126
+ // if (generalRate?.cleaningFeePerBooking) {
127
+ // generalRate.cleaningFeePerBooking = convertDollarsToCents(
128
+ // generalRate.cleaningFeePerBooking
129
+ // );
130
+ // }
131
+ // // console.log(
132
+ // // `generalRatesConvertRatesToDBHelper B: ${JSON.stringify(generalRate)}`
133
+ // // );
134
+ // return generalRate;
135
+ // }
136
+ // export function generalRatesConvertRatesFromDB(
137
+ // generalRate: ServiceRate
138
+ // ): ServiceRate {
139
+ // // console.log(
140
+ // // `generalRatesConvertRatesFromDB A: ${JSON.stringify(generalRate)}`
141
+ // // );
142
+ // // console.log(`specialRateConvertRatesFromDB`);
143
+ // if (generalRate?.dailyRate) {
144
+ // generalRate.dailyRate = convertCentsToDollars(generalRate.dailyRate);
145
+ // }
146
+ // if (generalRate?.hourlyRate) {
147
+ // generalRate.hourlyRate = convertCentsToDollars(generalRate.hourlyRate);
148
+ // }
149
+ // if (generalRate?.cleaningFeePerBooking) {
150
+ // generalRate.cleaningFeePerBooking = convertCentsToDollars(
151
+ // generalRate.cleaningFeePerBooking
152
+ // );
153
+ // }
154
+ // // console.log(
155
+ // // `generalRatesConvertRatesFromDB B: ${JSON.stringify(generalRate)}`
156
+ // // );
157
+ // return generalRate;
158
+ // }
159
+ //# sourceMappingURL=serviceRateDBUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceRateDBUtils.js","sourceRoot":"","sources":["../../../src/utils/service/serviceRateDBUtils.ts"],"names":[],"mappings":";AAAA,gDAAgD;AAChD,iDAAiD;AACjD,kEAAkE;AAClE,kFAAkF;AAElF,0CAA0C;AAC1C,iDAAiD;AACjD,uCAAuC;AACvC,wCAAwC;AACxC,sEAAsE;AACtE,OAAO;AACP,IAAI;AAEJ,4CAA4C;AAC5C,wCAAwC;AACxC,8BAA8B;AAC9B,gDAAgD;AAChD,0CAA0C;AAC1C,uDAAuD;AACvD,OAAO;AACP,IAAI;AAEJ,8CAA8C;AAC9C,iDAAiD;AACjD,uCAAuC;AACvC,0DAA0D;AAC1D,sDAAsD;AAEtD,+EAA+E;AAC/E,2EAA2E;AAC3E,sEAAsE;AACtE,kEAAkE;AAElE,sFAAsF;AACtF,kFAAkF;AAElF,oBAAoB;AACpB,+EAA+E;AAC/E,UAAU;AACV,oBAAoB;AACpB,2EAA2E;AAC3E,UAAU;AACV,oBAAoB;AACpB,yGAAyG;AACzG,UAAU;AACV,oBAAoB;AACpB,qGAAqG;AACrG,UAAU;A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AAS;AACT,MAAM;AACN,sBAAsB;AACtB,kFAAkF;AAClF,YAAY;AACZ,wBAAwB;AACxB,IAAI;AAEJ,kDAAkD;AAClD,6BAA6B;AAC7B,mBAAmB;AACnB,sBAAsB;AACtB,8EAA8E;AAC9E,YAAY;AACZ,qDAAqD;AACrD,kCAAkC;AAClC,4EAA4E;AAC5E,MAAM;AACN,mCAAmC;AACnC,8EAA8E;AAC9E,MAAM;AACN,8CAA8C;AAC9C,iEAAiE;AACjE,0CAA0C;AAC1C,SAAS;AACT,MAAM;AACN,sBAAsB;AACtB,8EAA8E;AAC9E,YAAY;AACZ,wBAAwB;AACxB,IAAI"}
@@ -0,0 +1,9 @@
1
+ import { ServiceDailyRatesExt, ServiceSpecialRatesExt } from "../../extendedSchemas";
2
+ import { LuxonDateRange } from "../luxonUtils";
3
+ export type ServiceDailyRatesExtT = Omit<ServiceDailyRatesExt, "startDate" | "endDate"> & {
4
+ dateTimeRange: LuxonDateRange;
5
+ };
6
+ export type ServiceSpecialRatesExtT = Omit<ServiceSpecialRatesExt, "startDate" | "endDate"> & {
7
+ dateTimeRange: LuxonDateRange;
8
+ };
9
+ //# sourceMappingURL=serviceRateTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceRateTypes.d.ts","sourceRoot":"","sources":["../../../src/utils/service/serviceRateTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,oBAAoB,EACpB,WAAW,GAAG,SAAS,CACxB,GAAG;IACF,aAAa,EAAE,cAAc,CAAC;CAC/B,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,sBAAsB,EACtB,WAAW,GAAG,SAAS,CACxB,GAAG;IACF,aAAa,EAAE,cAAc,CAAC;CAC/B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=serviceRateTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceRateTypes.js","sourceRoot":"","sources":["../../../src/utils/service/serviceRateTypes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import { ServiceRate } from "@prisma/client";
2
+ import { ServiceDailyRatesExt, ServiceRatesAssociationExt, ServiceSpecialRatesExt } from "../../extendedSchemas";
3
+ import { LuxonDateRange } from "../luxonUtils";
4
+ import { ServiceBookingPriceBreakdownBaseT } from "./serviceBookingTypes";
5
+ import { ServiceDailyRatesExtT, ServiceSpecialRatesExtT } from "./serviceRateTypes";
6
+ export declare const SERVICE_DAILY_RATE_HOURS_MIN = 8;
7
+ export declare function serviceRateToLuxonRate(rate: ServiceDailyRatesExt | ServiceSpecialRatesExt, timezone: string | undefined | null): ServiceDailyRatesExtT | ServiceSpecialRatesExtT;
8
+ export declare function serviceBookingPriceBreakdownGetTypeText(pricingInfo: ServiceBookingPriceBreakdownBaseT): string;
9
+ export declare function serviceBookingCalcDayPriceBreakdown(dateTimeRange: LuxonDateRange, serviceRates: (ServiceRate | null | undefined)[], isFullDay: boolean, hoursRemaining: number): ServiceBookingPriceBreakdownBaseT;
10
+ export declare function getServiceRatePricingInfo(dateTimeRange: LuxonDateRange, generalRate: ServiceRate | null | undefined, dailyRates: ServiceDailyRatesExtT[], //filtered to remove unavailable dates
11
+ specialRates: ServiceSpecialRatesExtT[], //filtered to remove unavailable dates
12
+ timezone: string | null | undefined, hoursRemaining: number): ServiceBookingPriceBreakdownBaseT;
13
+ export interface ServiceRatesLuxon {
14
+ generalRate: ServiceRate | null | undefined;
15
+ specialRates: ServiceSpecialRatesExtT[];
16
+ dailyRates: ServiceDailyRatesExtT[];
17
+ }
18
+ export declare function serviceGetFilteredRates(serviceRatesAssociation: ServiceRatesAssociationExt | null | undefined, dateTimeRanges: LuxonDateRange[], timezone: string | null | undefined): ServiceRatesLuxon;
19
+ export declare function serviceRatesFilter(rates: ServiceRatesLuxon, dateTimeRanges: LuxonDateRange[]): ServiceRatesLuxon;
20
+ export declare function serviceRatesHasRates(rates: ServiceRatesLuxon): boolean | null | undefined;
21
+ export declare function serviceRatesToLuxonRates(serviceRatesAssociation: ServiceRatesAssociationExt | null | undefined, dateTimeRanges: LuxonDateRange[], timezone: string | null | undefined): ServiceRatesLuxon;
22
+ export declare function serviceRatesAssociationGetBlockedDates(serviceRatesAssociation: ServiceRatesAssociationExt | null | undefined, timezone: string | undefined | null): LuxonDateRange[];
23
+ export declare function serviceRatesAssociationGetSpecialRates(serviceRatesAssociation: ServiceRatesAssociationExt | null | undefined, timezone: string | undefined | null, filterPastDates?: boolean): ServiceSpecialRatesExtT[];
24
+ //# sourceMappingURL=serviceRateUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceRateUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/service/serviceRateUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAGZ,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,cAAc,EAIf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,oBAAoB,GAAG,sBAAsB,EACnD,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAClC,qBAAqB,GAAG,uBAAuB,CAUjD;AAED,wBAAgB,uCAAuC,CACrD,WAAW,EAAE,iCAAiC,UAG/C;AAED,wBAAgB,mCAAmC,CACjD,aAAa,EAAE,cAAc,EAC7B,YAAY,EAAE,CAAC,WAAW,GA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BAAuB,EAAE,0BAA0B,GAAG,IAAI,GAAG,SAAS,EACtE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EACnC,eAAe,GAAE,OAAe,6BAkBjC"}
@@ -0,0 +1,183 @@
1
+ import { ServiceRatePricingType, ServiceRateType, } from "@prisma/client";
2
+ import { DateTime } from "luxon";
3
+ import { dateRangeNormalizeToMWY, dateTimeFromDate, dateTimeRangeIntersection, } from "../luxonUtils";
4
+ export const SERVICE_DAILY_RATE_HOURS_MIN = 8;
5
+ export function serviceRateToLuxonRate(rate, timezone) {
6
+ const { startDate, endDate, ...rest } = rate;
7
+ return {
8
+ ...rest,
9
+ dateTimeRange: {
10
+ start: dateTimeFromDate(startDate, undefined, timezone ?? undefined),
11
+ end: dateTimeFromDate(endDate, undefined, timezone ?? undefined),
12
+ },
13
+ };
14
+ }
15
+ export function serviceBookingPriceBreakdownGetTypeText(pricingInfo) {
16
+ return `${pricingInfo.rateType} ${pricingInfo.pricingType}`;
17
+ }
18
+ export function serviceBookingCalcDayPriceBreakdown(dateTimeRange, serviceRates, isFullDay, hoursRemaining) {
19
+ let pricingInfo = {
20
+ rateType: "General",
21
+ pricingType: "Hourly",
22
+ hours: 0,
23
+ piTotalCents: 0,
24
+ rateCents: 0,
25
+ unitCount: 0,
26
+ dateTimeRange: dateTimeRange,
27
+ // cleaningFee: 0,
28
+ // minimumTimeBlockHours: 0,
29
+ };
30
+ // First check if any service rate has a flat rate - this takes precedence
31
+ const flatRateService = serviceRates.find((rate) => rate != null && (rate.flatRateCents ?? 0) > 0);
32
+ if (flatRateService) {
33
+ pricingInfo.rateType = flatRateService.rateType ?? ServiceRateType.General;
34
+ pricingInfo.pricingType = "Flat";
35
+ pricingInfo.unitCount = 1; // Flat rate is always a single unit
36
+ pricingInfo.hours = hoursRemaining; // Use all remaining hours
37
+ pricingInfo.rateCents = flatRateService.flatRateCents ?? 0;
38
+ pricingInfo.piTotalCents = pricingInfo.rateCents; // Total is just the flat rate
39
+ pricingInfo.dateTimeRange = {
40
+ start: dateTimeRange.start,
41
+ end: dateTimeRange.start.plus({ hours: pricingInfo.hours }),
42
+ };
43
+ return pricingInfo;
44
+ }
45
+ // If no flat rate, proceed with the existing logic for hourly/daily rates
46
+ // Find the first serviceRate where dailyRate or hourlyRate is not null based on isFullDay
47
+ const validServiceRate = serviceRates.find((rate) => rate != null &&
48
+ ((isFullDay && rate.dailyRateCents != null) ||
49
+ (!isFullDay && rate.hourlyRateCents != null)));
50
+ if (isFullDay && !validServiceRate) {
51
+ return serviceBookingCalcDayPriceBreakdown(
52
+ //default to non-daily rate if it is null
53
+ dateTimeRange, serviceRates, false, hoursRemaining);
54
+ }
55
+ if (!validServiceRate) {
56
+ return pricingInfo; // Return default if no valid serviceRate is found
57
+ }
58
+ // Set values based on the found serviceRate
59
+ // pricingInfo.cleaningFee = validServiceRate.cleaningFeePerBooking ?? 0;
60
+ // pricingInfo.minimumTimeBlockHours =
61
+ // validServiceRate.minimumTimeBlockHours ?? 0;
62
+ pricingInfo.rateType = validServiceRate.rateType ?? ServiceRateType.General;
63
+ if (isFullDay) {
64
+ pricingInfo.pricingType = ServiceRatePricingType.Daily;
65
+ const days = Math.floor(hoursRemaining / SERVICE_DAILY_RATE_HOURS_MIN);
66
+ pricingInfo.unitCount = days;
67
+ pricingInfo.hours = pricingInfo.unitCount * SERVICE_DAILY_RATE_HOURS_MIN;
68
+ pricingInfo.rateCents = validServiceRate.dailyRateCents ?? 0;
69
+ }
70
+ else {
71
+ pricingInfo.pricingType = ServiceRatePricingType.Hourly;
72
+ pricingInfo.unitCount = hoursRemaining;
73
+ pricingInfo.hours = pricingInfo.unitCount;
74
+ pricingInfo.rateCents = validServiceRate.hourlyRateCents ?? 0;
75
+ }
76
+ pricingInfo.piTotalCents = pricingInfo.unitCount * pricingInfo.rateCents;
77
+ pricingInfo.dateTimeRange = {
78
+ start: dateTimeRange.start,
79
+ end: dateTimeRange.start.plus({ hours: pricingInfo.hours }),
80
+ };
81
+ return pricingInfo;
82
+ }
83
+ export function getServiceRatePricingInfo(dateTimeRange, generalRate, dailyRates, //filtered to remove unavailable dates
84
+ specialRates, //filtered to remove unavailable dates
85
+ // overlappingBusinessHours: LuxonDateRange[] | null,
86
+ timezone, hoursRemaining) {
87
+ const specialRate = specialRates?.at(-1); //last element
88
+ const dailyRate = dailyRates?.at(-1); //last element
89
+ // const specialRate = findRateByDate(specialRates, dateTimeRange, timezone) as
90
+ // | ServiceSpecialRatesExt
91
+ // | undefined;
92
+ // const dailyRate = findRateByDate(dailyRates, dateTimeRange, timezone) as
93
+ // | ServiceDailyRatesExt
94
+ // | undefined;
95
+ // const isFullDay =
96
+ // dateTimeRange != null &&
97
+ // overlappingBusinessHours != null &&
98
+ // overlappingBusinessHours.length == 1
99
+ // ? dateRangeDurationMatch(dateTimeRange, overlappingBusinessHours[0])
100
+ // : false;
101
+ // const isFullDay =
102
+ // dateTimeRangeHours(dateTimeRange) >= SERVICE_DAILY_RATE_HOURS_MIN;
103
+ const isFullDay = hoursRemaining >= SERVICE_DAILY_RATE_HOURS_MIN;
104
+ //prefer specialRate over daily, and aily over general, etc...
105
+ const rates = [
106
+ specialRate?.serviceRate,
107
+ dailyRate?.serviceRate,
108
+ generalRate,
109
+ ].filter((rate) => !!rate);
110
+ return serviceBookingCalcDayPriceBreakdown(dateTimeRange, rates, isFullDay, hoursRemaining);
111
+ }
112
+ export function serviceGetFilteredRates(serviceRatesAssociation, dateTimeRanges, timezone) {
113
+ return serviceRatesFilter(serviceRatesToLuxonRates(serviceRatesAssociation, dateTimeRanges, timezone), dateTimeRanges);
114
+ }
115
+ export function serviceRatesFilter(rates, dateTimeRanges) {
116
+ const generalRate = rates.generalRate;
117
+ const intersectsWithAnyRange = (rateRange) => dateTimeRanges.some((range) => dateTimeRangeIntersection(rateRange, range) != null);
118
+ const specialRatesLuxon = rates.specialRates
119
+ .filter((rate) => rate.isAvailable && intersectsWithAnyRange(rate.dateTimeRange))
120
+ .sort((a, b) => b.dateTimeRange.start.toMillis() - a.dateTimeRange.start.toMillis()) ?? [];
121
+ const dailyRatesLuxon = rates.dailyRates
122
+ .filter((rate) => intersectsWithAnyRange(rate.dateTimeRange))
123
+ .sort((a, b) => b.dateTimeRange.start.toMillis() - a.dateTimeRange.start.toMillis()) ?? [];
124
+ return {
125
+ generalRate: generalRate,
126
+ specialRates: specialRatesLuxon,
127
+ dailyRates: dailyRatesLuxon,
128
+ };
129
+ }
130
+ export function serviceRatesHasRates(rates) {
131
+ //check that we have rates with prices
132
+ const isValidSpecialOrDailyRate = (rate) => rate?.serviceRate &&
133
+ ((rate.serviceRate?.dailyRateCents ?? 0) > 0 ||
134
+ (rate.serviceRate?.hourlyRateCents ?? 0) > 0 ||
135
+ (rate.serviceRate?.flatRateCents ?? 0) > 0);
136
+ const isValidGeneralRate = (rate) => rate && ((rate.dailyRateCents ?? 0) > 0 ||
137
+ (rate.hourlyRateCents ?? 0) > 0 ||
138
+ (rate.flatRateCents ?? 0) > 0);
139
+ return (rates.specialRates?.some(isValidSpecialOrDailyRate) ||
140
+ rates.dailyRates?.some(isValidSpecialOrDailyRate) ||
141
+ isValidGeneralRate(rates.generalRate));
142
+ }
143
+ export function serviceRatesToLuxonRates(serviceRatesAssociation, dateTimeRanges, timezone) {
144
+ const generalRate = serviceRatesAssociation?.serviceGeneralRates;
145
+ const specialRatesLuxon = serviceRatesAssociation?.serviceSpecialRates
146
+ ?.filter((specialRate) => specialRate.isAvailable)
147
+ ?.map((rate) => serviceRateToLuxonRate(rate, timezone)) ?? [];
148
+ const dailyRatesLuxon = serviceRatesAssociation?.serviceDailyRates?.map((rate) => {
149
+ const newRate = serviceRateToLuxonRate(rate, timezone);
150
+ dateTimeRanges.forEach((range) => {
151
+ newRate.dateTimeRange = dateRangeNormalizeToMWY(newRate.dateTimeRange, range);
152
+ });
153
+ return newRate;
154
+ }) ?? [];
155
+ return {
156
+ generalRate: generalRate,
157
+ specialRates: specialRatesLuxon,
158
+ dailyRates: dailyRatesLuxon,
159
+ };
160
+ }
161
+ export function serviceRatesAssociationGetBlockedDates(serviceRatesAssociation, timezone) {
162
+ return (serviceRatesAssociation?.serviceSpecialRates
163
+ ?.filter((rate) => !rate.isAvailable)
164
+ .map((rate) => {
165
+ const rateRange = {
166
+ start: dateTimeFromDate(rate.startDate, undefined, timezone ?? undefined),
167
+ end: dateTimeFromDate(rate.endDate, undefined, timezone ?? undefined),
168
+ };
169
+ return rateRange;
170
+ // return dateRangeNormalizeToMWY(rateRange, referenceRange);
171
+ }) ?? []);
172
+ }
173
+ export function serviceRatesAssociationGetSpecialRates(serviceRatesAssociation, timezone, filterPastDates = false) {
174
+ return (serviceRatesAssociation?.serviceSpecialRates
175
+ ?.filter((rate) => rate.isAvailable)
176
+ .map((rate) => {
177
+ return serviceRateToLuxonRate(rate, timezone);
178
+ })
179
+ .filter((rate) => !filterPastDates ||
180
+ (rate.dateTimeRange.start >= DateTime.now() &&
181
+ rate.dateTimeRange.end >= DateTime.now())) ?? []);
182
+ }
183
+ //# sourceMappingURL=serviceRateUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceRateUtils.js","sourceRoot":"","sources":["../../../src/utils/service/serviceRateUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,EACtB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMjC,OAAO,EAEL,uBAAuB,EACvB,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AAOvB,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAE9C,MAAM,UAAU,sBAAsB,CACpC,IAAmD,EACnD,QAAmC;IAEnC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IAE7C,OAAO;QACL,GAAG,IAAI;QACP,aAAa,EAAE;YACb,KAAK,EAAE,gBAAgB,CAAC,SAAS,EAAE,SA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AuB,EAAE,mBAAmB;QAC1C,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC;SACnC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,OAAO,sBAAsB,CAC3B,IAAI,EACJ,QAAQ,CACkB,CAAC;IAC/B,CAAC,CAAC;SACD,MAAM,CACL,CAAC,IAA6B,EAAE,EAAE,CAChC,CAAC,eAAe;QAChB,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,IAAI,QAAQ,CAAC,GAAG,EAAE;YACzC,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC,CAC9C,IAAI,EAAE,CACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { Service, ServiceCancellationPolicy as ServiceCancellationPolicyOption, ServiceSubscriptionStatus, ServiceTypes } from "@prisma/client";
2
+ import { ServiceExt, ServiceExtNoIds, ServiceExtNonSpecific } from "../../extendedSchemas";
3
+ export type ServiceCancellationRefundPolicy = {
4
+ days?: number;
5
+ hours?: number;
6
+ refundPercentage: number;
7
+ };
8
+ export type ServiceCancellationPolicyData = {
9
+ name: string;
10
+ description?: string;
11
+ refundPolicy: ServiceCancellationRefundPolicy[];
12
+ };
13
+ export type ServiceCancellationPolicyMap = {
14
+ [key in ServiceCancellationPolicyOption]: ServiceCancellationPolicyData;
15
+ };
16
+ export declare const SERVICE_CANCELLATION_POLICY_DATA: ServiceCancellationPolicyMap;
17
+ export declare function serviceSubscriptionIsActive(status: ServiceSubscriptionStatus): boolean;
18
+ export interface ServiceSpecificTypeInfo {
19
+ serviceId: string;
20
+ serviceType: ServiceTypes;
21
+ specificFieldName: ServiceSpecificName;
22
+ specificId: string;
23
+ }
24
+ export declare function serviceGetSpecificType<BookingType extends Service>(service: BookingType): ServiceSpecificTypeInfo | null;
25
+ export declare function serviceDetailUrl(serviceId: string, serviceType: string, specificId: string): string;
26
+ export declare function serviceWizardUrl(serviceId: string, serviceType: string, specificId: string, step?: number, substep?: number): string;
27
+ export declare function serviceCheckoutUrl(serviceId: string, serviceType: string, specificId: string): string;
28
+ declare const serviceKeysObject: {
29
+ readonly eventService: true;
30
+ readonly entertainmentService: true;
31
+ readonly vendor: true;
32
+ readonly exhibitor: true;
33
+ readonly sponsor: true;
34
+ readonly venue: true;
35
+ readonly organization: true;
36
+ };
37
+ export type ServiceSpecificName = keyof typeof serviceKeysObject;
38
+ export declare const serviceKeysArray: string[];
39
+ export type ServiceSpecificType = ServiceExt[ServiceSpecificName];
40
+ export declare const specificServiceMap: Record<ServiceTypes, ServiceSpecificName>;
41
+ export declare const serviceTypeToField: (serviceType: ServiceTypes) => ServiceSpecificName;
42
+ type ServiceExtKeyMap = {
43
+ EventServices: "eventService";
44
+ EntertainmentServices: "entertainmentService";
45
+ Vendors: "vendor";
46
+ Exhibitors: "exhibitor";
47
+ Sponsors: "sponsor";
48
+ Venues: "venue";
49
+ Organizations: "organization";
50
+ };
51
+ export type ServiceFieldType = "string" | "integer" | "float" | "boolean" | "date";
52
+ export type ServiceExtKey<T extends ServiceTypes> = ServiceExtKeyMap[T];
53
+ export type ServiceAIInfo = {
54
+ description: string;
55
+ example: string;
56
+ type: ServiceFieldType;
57
+ isArray: boolean;
58
+ };
59
+ export type ServiceSpecificInfoAIMap<T> = {
60
+ [P in keyof T]: ServiceAIInfo;
61
+ };
62
+ export type SpecificServiceInfoAIMap = {
63
+ [K in ServiceTypes]: ServiceSpecificInfoAIMap<Partial<ServiceExt[ServiceExtKey<K>]>>;
64
+ };
65
+ export type ServiceInfoAIMap = {
66
+ [key in keyof ServiceExtNonSpecific]: ServiceAIInfo;
67
+ };
68
+ export declare function aiServiceInfoToInfoString(field: string, info: ServiceAIInfo): string;
69
+ export declare function aiServiceInfoToExampleString(field: string, info: ServiceAIInfo): string;
70
+ export declare const serviceGetInfoAI: (serviceType: ServiceTypes) => Partial<ServiceInfoAIMap>;
71
+ export declare const serviceSpecificInfoAI: SpecificServiceInfoAIMap;
72
+ /**
73
+ * Builds a formatted string of AI context fields, handling optional schemas and types.
74
+ */
75
+ export declare function buildAIFieldsString<T extends Record<string, unknown>>(data: Partial<T>, info: Partial<Record<keyof T, ServiceAIInfo>>): string;
76
+ export declare function serviceExcludeIds(service: Partial<ServiceExt>): Partial<ServiceExtNoIds>;
77
+ export declare function serviceExcludeOwners(service: Partial<ServiceExt>): Partial<ServiceExtNoIds>;
78
+ export declare function serviceExcludeRates(service: Partial<ServiceExt>): Partial<ServiceExtNoIds>;
79
+ export declare function serviceExcludeDates(service: Partial<ServiceExt>): Partial<ServiceExtNoIds>;
80
+ export declare function serviceExcludeMiscData(service: Partial<ServiceExt>): Partial<ServiceExtNoIds>;
81
+ export declare function serviceRelevantData(service: Partial<ServiceExt>): Partial<ServiceExtNoIds>;
82
+ export {};
83
+ //# sourceMappingURL=serviceUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/service/serviceUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,yBAAyB,IAAI,+BAA+B,EAC5D,yBAAyB,EACzB,YAAY,EACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,UAAU,EACV,eAAe,EACf,qBAAqB,EACtB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,+BAA+B,EAAE,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;KACxC,GAAG,IAAI,+BAA+B,GAAG,6BAA6B;CACxE,CAAC;AAEF,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