@myrjfa/state 2.1.8 → 2.2.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 (181) hide show
  1. package/dist/hooks/usePersistentDraftState.d.ts +20 -0
  2. package/dist/hooks/usePersistentDraftState.d.ts.map +1 -0
  3. package/dist/hooks/usePersistentDraftState.js +47 -0
  4. package/dist/index.d.ts +3 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +3 -0
  7. package/dist/lib/actions/actions.d.ts +15 -15
  8. package/dist/lib/actions/actions.d.ts.map +1 -1
  9. package/dist/lib/actions/actions.js +44 -8
  10. package/dist/lib/actions/auth.d.ts +2 -2
  11. package/dist/lib/actions/auth.d.ts.map +1 -1
  12. package/dist/lib/actions/auth.js +9 -0
  13. package/dist/lib/actions/booking.js +2 -2
  14. package/dist/lib/actions/fetcher.js +2 -1
  15. package/dist/lib/actions.d.ts +556 -0
  16. package/dist/lib/actions.d.ts.map +1 -0
  17. package/dist/lib/actions.js +1327 -0
  18. package/dist/lib/adminDashboardActions.d.ts +61 -0
  19. package/dist/lib/adminDashboardActions.d.ts.map +1 -0
  20. package/dist/lib/adminDashboardActions.js +89 -0
  21. package/dist/lib/adventureActions.d.ts +102 -0
  22. package/dist/lib/adventureActions.d.ts.map +1 -0
  23. package/dist/lib/adventureActions.js +202 -0
  24. package/dist/lib/adventureDummyData.d.ts +3 -0
  25. package/dist/lib/adventureDummyData.d.ts.map +1 -0
  26. package/dist/lib/adventureDummyData.js +138 -0
  27. package/dist/lib/adventureFormPage.d.ts +39 -0
  28. package/dist/lib/adventureFormPage.d.ts.map +1 -0
  29. package/dist/lib/adventureFormPage.js +70 -0
  30. package/dist/lib/brandActions.d.ts +83 -0
  31. package/dist/lib/brandActions.d.ts.map +1 -0
  32. package/dist/lib/brandActions.js +28 -0
  33. package/dist/lib/companionActions.d.ts +174 -0
  34. package/dist/lib/companionActions.d.ts.map +1 -0
  35. package/dist/lib/companionActions.js +276 -0
  36. package/dist/lib/companionDummyData.d.ts +99 -0
  37. package/dist/lib/companionDummyData.d.ts.map +1 -0
  38. package/dist/lib/companionDummyData.js +203 -0
  39. package/dist/lib/destinations.d.ts +14 -0
  40. package/dist/lib/destinations.d.ts.map +1 -0
  41. package/dist/lib/destinations.js +203 -0
  42. package/dist/lib/entitySubmission.d.ts +21 -0
  43. package/dist/lib/entitySubmission.d.ts.map +1 -0
  44. package/dist/lib/entitySubmission.js +10 -0
  45. package/dist/lib/eventActions.d.ts +176 -0
  46. package/dist/lib/eventActions.d.ts.map +1 -0
  47. package/dist/lib/eventActions.js +222 -0
  48. package/dist/lib/eventFormPage.d.ts +49 -0
  49. package/dist/lib/eventFormPage.d.ts.map +1 -0
  50. package/dist/lib/eventFormPage.js +84 -0
  51. package/dist/lib/eventsDummyData.d.ts +54 -0
  52. package/dist/lib/eventsDummyData.d.ts.map +1 -0
  53. package/dist/lib/eventsDummyData.js +586 -0
  54. package/dist/lib/guideActions.d.ts +53 -0
  55. package/dist/lib/guideActions.d.ts.map +1 -0
  56. package/dist/lib/guideActions.js +127 -0
  57. package/dist/lib/guideDummyData.d.ts +3 -0
  58. package/dist/lib/guideDummyData.d.ts.map +1 -0
  59. package/dist/lib/guideDummyData.js +66 -0
  60. package/dist/lib/hooks/use-mobile.js +0 -1
  61. package/dist/lib/hooks/useChatSocket.js +0 -1
  62. package/dist/lib/hooks/useHostCalendarSelection.d.ts +51 -0
  63. package/dist/lib/hooks/useHostCalendarSelection.d.ts.map +1 -0
  64. package/dist/lib/hooks/useHostCalendarSelection.js +200 -0
  65. package/dist/lib/hostDashboardActions.d.ts +189 -0
  66. package/dist/lib/hostDashboardActions.d.ts.map +1 -0
  67. package/dist/lib/hostDashboardActions.js +400 -0
  68. package/dist/lib/imageUpload.d.ts +4 -0
  69. package/dist/lib/imageUpload.d.ts.map +1 -0
  70. package/dist/lib/imageUpload.js +36 -0
  71. package/dist/lib/locationActions.d.ts +141 -0
  72. package/dist/lib/locationActions.d.ts.map +1 -0
  73. package/dist/lib/locationActions.js +113 -0
  74. package/dist/lib/models/adventure.d.ts +26 -9
  75. package/dist/lib/models/adventure.d.ts.map +1 -1
  76. package/dist/lib/models/application.d.ts +1 -1
  77. package/dist/lib/models/application.d.ts.map +1 -1
  78. package/dist/lib/models/blog.d.ts +2 -2
  79. package/dist/lib/models/booking.d.ts +16 -1
  80. package/dist/lib/models/booking.d.ts.map +1 -1
  81. package/dist/lib/models/discount.d.ts +160 -0
  82. package/dist/lib/models/discount.d.ts.map +1 -0
  83. package/dist/lib/models/discount.js +106 -0
  84. package/dist/lib/models/enquiry.d.ts +34 -0
  85. package/dist/lib/models/enquiry.d.ts.map +1 -0
  86. package/dist/lib/models/enquiry.js +140 -0
  87. package/dist/lib/models/guide.d.ts +4 -3
  88. package/dist/lib/models/guide.d.ts.map +1 -1
  89. package/dist/lib/models/notifications.d.ts +12 -12
  90. package/dist/lib/models/opportunities/freelance.d.ts +82 -82
  91. package/dist/lib/models/opportunities/internship.d.ts +82 -82
  92. package/dist/lib/models/opportunities/job.d.ts +84 -84
  93. package/dist/lib/models/opportunities/opportunity.d.ts +89 -84
  94. package/dist/lib/models/opportunities/opportunity.d.ts.map +1 -1
  95. package/dist/lib/models/opportunities/opportunity.js +2 -0
  96. package/dist/lib/models/opportunities/volunteerJob.d.ts +82 -82
  97. package/dist/lib/models/package.d.ts +380 -86
  98. package/dist/lib/models/package.d.ts.map +1 -1
  99. package/dist/lib/models/package.js +9 -8
  100. package/dist/lib/models/pricing.d.ts +255 -0
  101. package/dist/lib/models/pricing.d.ts.map +1 -0
  102. package/dist/lib/models/pricing.js +145 -0
  103. package/dist/lib/models/rental.d.ts +12 -7
  104. package/dist/lib/models/rental.d.ts.map +1 -1
  105. package/dist/lib/models/review.d.ts +11 -2
  106. package/dist/lib/models/review.d.ts.map +1 -1
  107. package/dist/lib/models/review.js +2 -0
  108. package/dist/lib/models/stay.d.ts +11 -8
  109. package/dist/lib/models/stay.d.ts.map +1 -1
  110. package/dist/lib/models/stay.js +1 -0
  111. package/dist/lib/models/tile.d.ts +11 -7
  112. package/dist/lib/models/tile.d.ts.map +1 -1
  113. package/dist/lib/models/travelPackage.d.ts +943 -0
  114. package/dist/lib/models/travelPackage.d.ts.map +1 -0
  115. package/dist/lib/models/travelPackage.js +326 -0
  116. package/dist/lib/multistepDraft.d.ts +4 -0
  117. package/dist/lib/multistepDraft.d.ts.map +1 -0
  118. package/dist/lib/multistepDraft.js +18 -0
  119. package/dist/lib/opportunityFormData.d.ts +13 -0
  120. package/dist/lib/opportunityFormData.d.ts.map +1 -0
  121. package/dist/lib/opportunityFormData.js +62 -0
  122. package/dist/lib/opportunityFormPage.d.ts +38 -0
  123. package/dist/lib/opportunityFormPage.d.ts.map +1 -0
  124. package/dist/lib/opportunityFormPage.js +33 -0
  125. package/dist/lib/packageActions.d.ts +86 -0
  126. package/dist/lib/packageActions.d.ts.map +1 -0
  127. package/dist/lib/packageActions.js +168 -0
  128. package/dist/lib/packageDummyData.d.ts +3 -0
  129. package/dist/lib/packageDummyData.d.ts.map +1 -0
  130. package/dist/lib/packageDummyData.js +57 -0
  131. package/dist/lib/placeActions.d.ts +192 -0
  132. package/dist/lib/placeActions.d.ts.map +1 -0
  133. package/dist/lib/placeActions.js +57 -0
  134. package/dist/lib/propertyActions.d.ts +17 -0
  135. package/dist/lib/propertyActions.d.ts.map +1 -0
  136. package/dist/lib/propertyActions.js +16 -0
  137. package/dist/lib/rentalActions.d.ts +86 -0
  138. package/dist/lib/rentalActions.d.ts.map +1 -0
  139. package/dist/lib/rentalActions.js +235 -0
  140. package/dist/lib/rentalDummyData.d.ts +3 -0
  141. package/dist/lib/rentalDummyData.d.ts.map +1 -0
  142. package/dist/lib/rentalDummyData.js +402 -0
  143. package/dist/lib/rentalFormPage.d.ts +48 -0
  144. package/dist/lib/rentalFormPage.d.ts.map +1 -0
  145. package/dist/lib/rentalFormPage.js +97 -0
  146. package/dist/lib/roomActions.d.ts +39 -0
  147. package/dist/lib/roomActions.d.ts.map +1 -0
  148. package/dist/lib/roomActions.js +74 -0
  149. package/dist/lib/stayActions.d.ts +97 -0
  150. package/dist/lib/stayActions.d.ts.map +1 -0
  151. package/dist/lib/stayActions.js +138 -0
  152. package/dist/lib/staysDummyData.d.ts +72 -0
  153. package/dist/lib/staysDummyData.d.ts.map +1 -0
  154. package/dist/lib/staysDummyData.js +694 -0
  155. package/dist/lib/storeDummyData.d.ts +33 -0
  156. package/dist/lib/storeDummyData.d.ts.map +1 -0
  157. package/dist/lib/storeDummyData.js +336 -0
  158. package/dist/lib/travelPackageActions.d.ts +102 -0
  159. package/dist/lib/travelPackageActions.d.ts.map +1 -0
  160. package/dist/lib/travelPackageActions.js +487 -0
  161. package/dist/lib/travelPackageFormData.d.ts +20 -0
  162. package/dist/lib/travelPackageFormData.d.ts.map +1 -0
  163. package/dist/lib/travelPackageFormData.js +54 -0
  164. package/dist/lib/travelPackageFormPage.d.ts +32 -0
  165. package/dist/lib/travelPackageFormPage.d.ts.map +1 -0
  166. package/dist/lib/travelPackageFormPage.js +43 -0
  167. package/dist/lib/userAtom.d.ts +24 -24
  168. package/dist/lib/userAtom.d.ts.map +1 -1
  169. package/dist/lib/userAtom.js +17 -1
  170. package/dist/lib/util.d.ts +11 -0
  171. package/dist/lib/util.d.ts.map +1 -0
  172. package/dist/lib/util.js +82 -0
  173. package/dist/lib/utils.d.ts.map +1 -1
  174. package/dist/lib/utils.js +1 -0
  175. package/dist/lib/vehicleData.d.ts +2 -0
  176. package/dist/lib/vehicleData.d.ts.map +1 -0
  177. package/dist/lib/vehicleData.js +181 -0
  178. package/dist/lib/vehicleModels.d.ts +2 -0
  179. package/dist/lib/vehicleModels.d.ts.map +1 -0
  180. package/dist/lib/vehicleModels.js +128 -0
  181. package/package.json +6 -5
@@ -0,0 +1,235 @@
1
+ import { get, patch, post, del } from "@myrjfa/state/dist/lib/actions/fetcher";
2
+ import { calculatePricingStrategyDisplayUnitPrice, getPricingStrategies, getPricingCurrency } from "@myrjfa/state/dist/lib/models/pricing";
3
+ // ─── Public ───────────────────────────────────────────────────────────────────
4
+ export async function getRentalTiles(limit, filters) {
5
+ try {
6
+ let endpoint = `/rentals/getAllRentalTiles?status=open`;
7
+ if (limit)
8
+ endpoint += `&limit=${limit}`;
9
+ if (filters?.vehicleType)
10
+ endpoint += `&vehicleType=${filters.vehicleType}`;
11
+ if (filters?.fuelType)
12
+ endpoint += `&fuelType=${filters.fuelType}`;
13
+ if (filters?.driverOption)
14
+ endpoint += `&driverOption=${filters.driverOption}`;
15
+ const data = await get(endpoint);
16
+ return {
17
+ success: true,
18
+ message: data.message,
19
+ tiles: data.data.map(rentalToTile),
20
+ };
21
+ }
22
+ catch (error) {
23
+ console.error("Failed to fetch rental tiles:", error);
24
+ return { success: false, error: error.message, tiles: [] };
25
+ }
26
+ }
27
+ export async function trendingRentalTiles(limit) {
28
+ return getRentalTiles(limit);
29
+ }
30
+ export async function rentalDetails(slug) {
31
+ try {
32
+ const data = await get(`/rentals/getRental/${slug}`);
33
+ return { success: true, message: data.message, rental: data.data };
34
+ }
35
+ catch (error) {
36
+ console.error("Failed to fetch rental details:", error);
37
+ return { success: false, error: error.message, rental: null };
38
+ }
39
+ }
40
+ export async function rentalMetaData(slug) {
41
+ try {
42
+ const data = await get(`/rentals/getRental/${slug}`);
43
+ const rental = data.data;
44
+ return {
45
+ success: true,
46
+ message: data.message,
47
+ metadata: {
48
+ image: rental.images?.[0] || "/images/placeholder.svg",
49
+ title: rental.title || "Trippeaze Rentals",
50
+ city: rental.city,
51
+ state: rental.state,
52
+ category: rental.vehicleType,
53
+ price: getRentalStartingPrice(rental),
54
+ currency: getPricingCurrency(rental),
55
+ },
56
+ };
57
+ }
58
+ catch (error) {
59
+ return { success: false, error: error.message, metadata: null };
60
+ }
61
+ }
62
+ export async function rentalsByUsername(username, limit) {
63
+ try {
64
+ let endpoint = `/rentals/getRentalsByUsername/${username}`;
65
+ if (limit)
66
+ endpoint += `?limit=${limit}`;
67
+ const data = await get(endpoint);
68
+ return {
69
+ success: true,
70
+ message: data.message,
71
+ tiles: data.data.map(rentalToTile),
72
+ };
73
+ }
74
+ catch (error) {
75
+ return { success: false, error: error.message, tiles: [] };
76
+ }
77
+ }
78
+ // ─── Host Dashboard ───────────────────────────────────────────────────────────
79
+ export async function rentalsByHost() {
80
+ try {
81
+ const data = await get(`/rentals/hostRentals`);
82
+ return { success: true, message: data.message, rentals: data.data || [] };
83
+ }
84
+ catch (error) {
85
+ console.error("Failed to fetch host rentals:", error);
86
+ const errorMessage = error?.message ||
87
+ error?.error ||
88
+ "Failed to load rentals. Please try again.";
89
+ return { success: false, error: errorMessage, rentals: [] };
90
+ }
91
+ }
92
+ export async function createRental(formData) {
93
+ try {
94
+ const data = await post(`/rentals/create`, formData);
95
+ return { success: true, slug: data.data, message: data.message };
96
+ }
97
+ catch (error) {
98
+ console.error("Failed to create rental:", error);
99
+ return { success: false, error: error.message };
100
+ }
101
+ }
102
+ export async function editRental(formData, slug) {
103
+ try {
104
+ const data = await patch(`/rentals/update/${slug}`, formData);
105
+ return { success: true, message: data.message };
106
+ }
107
+ catch (error) {
108
+ console.error("Failed to update rental:", error);
109
+ return { success: false, error: error.message };
110
+ }
111
+ }
112
+ export async function deleteRental(slug) {
113
+ try {
114
+ const data = await del(`/rentals/delete/${slug}`);
115
+ return { success: true, message: data.message };
116
+ }
117
+ catch (error) {
118
+ return { success: false, error: error.message };
119
+ }
120
+ }
121
+ // ─── Admin Dashboard ──────────────────────────────────────────────────────────
122
+ export async function getPendingRentals() {
123
+ try {
124
+ const data = await get(`/admin/rentals?status=all`);
125
+ return { success: true, message: data.message, rentals: data.data };
126
+ }
127
+ catch (error) {
128
+ return { success: false, error: error.message, rentals: [] };
129
+ }
130
+ }
131
+ export async function adminRentalsByHost(username) {
132
+ try {
133
+ const data = await get(`/rentals/getRentalsByUsername/${username}?status=open,pending,draft,denied,archived,closed`);
134
+ return { success: true, rentals: data.data || [] };
135
+ }
136
+ catch (error) {
137
+ return { success: false, rentals: [], error: error.message };
138
+ }
139
+ }
140
+ // Approve uses the dedicated admin endpoint
141
+ export async function approveRental(slug, modelImage) {
142
+ try {
143
+ const body = modelImage ? new FormData() : {};
144
+ if (modelImage && body instanceof FormData)
145
+ body.append("images", modelImage);
146
+ const data = await patch(`/admin/rentals/approve/${slug}`, body);
147
+ return { success: true, message: data.message };
148
+ }
149
+ catch (error) {
150
+ return { success: false, error: error.message, ...(error.data ? { data: error.data } : {}) };
151
+ }
152
+ }
153
+ export async function rejectRental(slug, rejectionReason) {
154
+ try {
155
+ const data = await patch(`/admin/rentals/reject/${slug}`, { rejectionReason });
156
+ return { success: true, message: data.message };
157
+ }
158
+ catch (error) {
159
+ return { success: false, error: error.message };
160
+ }
161
+ }
162
+ export async function getRentalBookingsAdmin(slugOrId) {
163
+ try {
164
+ const data = await get(`/rentals/host/${slugOrId}/bookings`);
165
+ return { success: true, bookings: data.data || [] };
166
+ }
167
+ catch (error) {
168
+ return { success: false, bookings: [], error: error.message };
169
+ }
170
+ }
171
+ // ─── Helper ───────────────────────────────────────────────────────────────────
172
+ function getRentalStartingPrice(rental) {
173
+ const strategyPrices = getPricingStrategies(rental)
174
+ .map((strategy) => calculatePricingStrategyDisplayUnitPrice(strategy))
175
+ .filter((price) => Number.isFinite(price) && price > 0);
176
+ return strategyPrices.length ? Math.min(...strategyPrices) : 0;
177
+ }
178
+ function getRentalAreaCityLabel(rental) {
179
+ const city = String(rental.city || "").trim();
180
+ const primaryPickupPoint = Array.isArray(rental.pickupPoints) ? rental.pickupPoints[0] : null;
181
+ const pickupName = String(primaryPickupPoint?.name || "").trim();
182
+ const pickupAddress = String(primaryPickupPoint?.address || rental.address || "").trim();
183
+ const addressParts = pickupAddress
184
+ .split(",")
185
+ .map((part) => part.trim())
186
+ .filter(Boolean);
187
+ const normalizedCity = city.toLowerCase();
188
+ const cityIndex = addressParts.findIndex((part) => part.toLowerCase() === normalizedCity);
189
+ const addressArea = cityIndex > 0
190
+ ? addressParts[cityIndex - 1]
191
+ : addressParts.find((part) => part.toLowerCase() !== normalizedCity);
192
+ const area = pickupName && !/^main location$/i.test(pickupName)
193
+ ? pickupName
194
+ : addressArea;
195
+ if (area && city && area.toLowerCase() !== normalizedCity)
196
+ return `${area}, ${city}`;
197
+ if (city)
198
+ return city;
199
+ return [rental.city, rental.state].filter(Boolean).join(", ");
200
+ }
201
+ function rentalToTile(rental) {
202
+ return {
203
+ slug: rental.slug || "",
204
+ image: rental.images?.[0] || "/images/placeholder.svg",
205
+ title: rental.title || "",
206
+ description: rental.description || "",
207
+ location: getRentalAreaCityLabel(rental),
208
+ date: rental.createdAt,
209
+ rating: rental.rating,
210
+ price: getRentalStartingPrice(rental),
211
+ currency: getPricingCurrency(rental),
212
+ tileType: "rentals",
213
+ isWishlisted: rental.isWishlisted,
214
+ host: rental.host
215
+ ? {
216
+ name: rental.host.name,
217
+ image: rental.host.image || rental.host.profilePic,
218
+ }
219
+ : undefined,
220
+ vehicleType: rental.vehicleType,
221
+ fuelType: rental.fuelType,
222
+ transmission: rental.transmission,
223
+ seatingCapacity: rental.seatingCapacity,
224
+ address: rental.address,
225
+ pickupPoints: rental.pickupPoints,
226
+ payAtPickup: rental.payAtPickup,
227
+ completedTrips: rental.completedTrips,
228
+ reviewCount: rental.reviewCount,
229
+ distanceLimit: rental.distanceLimit,
230
+ discount: rental.discount,
231
+ brand: rental.brand,
232
+ model: rental.model,
233
+ depositAmount: rental.depositAmount,
234
+ };
235
+ }
@@ -0,0 +1,3 @@
1
+ import { TileProps } from "@myrjfa/state/dist/lib/models/tile";
2
+ export declare const rentalDummyData: TileProps[];
3
+ //# sourceMappingURL=rentalDummyData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rentalDummyData.d.ts","sourceRoot":"","sources":["../../src/lib/rentalDummyData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAE/D,eAAO,MAAM,eAAe,EAAE,SAAS,EA8ZtC,CAAC"}
@@ -0,0 +1,402 @@
1
+ export const rentalDummyData = [
2
+ {
3
+ slug: "royal-enfield-himalayan-manali",
4
+ image: "https://images.pexels.com/photos/2607554/pexels-photo-2607554.jpeg",
5
+ title: "Royal Enfield Himalayan 411",
6
+ description: "Ideal for mountain terrain. Comes with panniers, helmet, and full insurance. Self-drive only.",
7
+ location: "Manali, Himachal Pradesh",
8
+ date: new Date("2025-01-10"),
9
+ rating: 4.7,
10
+ price: 1800,
11
+ currency: "INR",
12
+ tileType: "rentals",
13
+ vehicleType: "bike",
14
+ duration: 1,
15
+ host: {
16
+ name: "Himachal Rides",
17
+ image: "https://images.pexels.com/photos/1722198/pexels-photo-1722198.jpeg",
18
+ },
19
+ seatingCapacity: 2,
20
+ driverOption: "self-drive",
21
+ fuelType: "petrol",
22
+ transmission: "manual",
23
+ cancellationPolicy: "Free cancellation up to 48 hours before pickup.",
24
+ lastServiceDate: new Date("2024-12-15").toISOString(),
25
+ homeDeliveryAvailable: false,
26
+ payAtPickup: true,
27
+ completedTrips: 110,
28
+ reviewCount: 25,
29
+ brand: "Royal Enfield",
30
+ model: "Himalayan 411",
31
+ depositAmount: 5000,
32
+ distanceLimit: "120 km/day",
33
+ discount: {
34
+ discountStrategies: [
35
+ { type: "duration", durationType: "weekly", minDays: 7, discountType: "percentage", discountValue: 84, description: "Weekly discount", suggestedByPlatform: false, active: true },
36
+ { type: "duration", durationType: "fifteen-days", minDays: 15, discountType: "percentage", discountValue: 85, description: "15 day discount", suggestedByPlatform: false, active: true },
37
+ { type: "duration", durationType: "monthly", minDays: 30, discountType: "percentage", discountValue: 86, description: "Monthly discount", suggestedByPlatform: false, active: true },
38
+ ],
39
+ },
40
+ pickupPoints: [
41
+ {
42
+ name: "Mall Road Showroom",
43
+ address: "12 Mall Road, Manali",
44
+ lat: 32.2396,
45
+ lng: 77.1887,
46
+ },
47
+ {
48
+ name: "Manali Bus Stand",
49
+ address: "Private Bus Stand, Manali",
50
+ lat: 32.238,
51
+ lng: 77.187,
52
+ },
53
+ ],
54
+ },
55
+ {
56
+ slug: "swift-dzire-goa-self-drive",
57
+ image: "https://images.pexels.com/photos/170811/pexels-photo-170811.jpeg",
58
+ title: "Maruti Swift Dzire – AC",
59
+ description: "Perfect for beach drives. Unlimited km, GPS included. Petrol, automatic transmission.",
60
+ location: "Panaji, Goa",
61
+ date: new Date("2025-02-15"),
62
+ rating: 4.5,
63
+ price: 2200,
64
+ currency: "INR",
65
+ tileType: "rentals",
66
+ vehicleType: "car",
67
+ duration: 1,
68
+ host: {
69
+ name: "Goa Wheels",
70
+ image: "https://images.pexels.com/photos/1545743/pexels-photo-1545743.jpeg",
71
+ },
72
+ seatingCapacity: 5,
73
+ driverOption: "self-drive",
74
+ fuelType: "petrol",
75
+ transmission: "automatic",
76
+ cancellationPolicy: "Non-refundable if cancelled within 24 hours.",
77
+ lastServiceDate: new Date("2025-01-05").toISOString(),
78
+ homeDeliveryAvailable: true,
79
+ homeDeliveryPrice: 400,
80
+ payAtPickup: true,
81
+ completedTrips: 269,
82
+ reviewCount: 14,
83
+ brand: "Maruti",
84
+ model: "Swift Dzire",
85
+ depositAmount: 10000,
86
+ distanceLimit: "150 km/day",
87
+ discount: {
88
+ discountStrategies: [
89
+ { type: "duration", durationType: "weekly", minDays: 7, discountType: "percentage", discountValue: 22, description: "Weekly discount", suggestedByPlatform: false, active: true },
90
+ { type: "duration", durationType: "fifteen-days", minDays: 15, discountType: "percentage", discountValue: 27, description: "15 day discount", suggestedByPlatform: false, active: true },
91
+ { type: "duration", durationType: "monthly", minDays: 30, discountType: "percentage", discountValue: 39, description: "Monthly discount", suggestedByPlatform: false, active: true },
92
+ ],
93
+ },
94
+ pickupPoints: [
95
+ {
96
+ name: "Dabolim Airport",
97
+ address: "Airport Terminal, Goa",
98
+ lat: 15.3803,
99
+ lng: 73.8344,
100
+ },
101
+ {
102
+ name: "Panaji Main Hub",
103
+ address: "Panaji Bus Stand, Goa",
104
+ lat: 15.4909,
105
+ lng: 73.8278,
106
+ },
107
+ ],
108
+ },
109
+ {
110
+ slug: "activa-125-mysore",
111
+ image: "https://images.pexels.com/photos/1413412/pexels-photo-1413412.jpeg",
112
+ title: "Honda Activa 125 – City Scooter",
113
+ description: "Comfortable city scooter, fuel-efficient and easy to ride. Storage basket included.",
114
+ location: "Mysore, Karnataka",
115
+ date: new Date("2025-01-25"),
116
+ rating: 4.3,
117
+ price: 450,
118
+ currency: "INR",
119
+ tileType: "rentals",
120
+ vehicleType: "scooty",
121
+ duration: 1,
122
+ host: {
123
+ name: "Mysore Scooters",
124
+ image: "https://images.pexels.com/photos/697509/pexels-photo-697509.jpeg",
125
+ },
126
+ seatingCapacity: 2,
127
+ driverOption: "self-drive",
128
+ fuelType: "petrol",
129
+ transmission: "automatic",
130
+ cancellationPolicy: "Cancel anytime.",
131
+ homeDeliveryAvailable: true,
132
+ homeDeliveryPrice: 50,
133
+ payAtPickup: true,
134
+ completedTrips: 45,
135
+ reviewCount: 3,
136
+ brand: "Honda",
137
+ model: "Activa 125",
138
+ depositAmount: 1000,
139
+ distanceLimit: "No distance limit",
140
+ discount: {
141
+ discountStrategies: [
142
+ { type: "duration", durationType: "weekly", minDays: 7, discountType: "percentage", discountValue: 21, description: "Weekly discount", suggestedByPlatform: false, active: true },
143
+ { type: "duration", durationType: "fifteen-days", minDays: 15, discountType: "percentage", discountValue: 29, description: "15 day discount", suggestedByPlatform: false, active: true },
144
+ { type: "duration", durationType: "monthly", minDays: 30, discountType: "percentage", discountValue: 33, description: "Monthly discount", suggestedByPlatform: false, active: true },
145
+ ],
146
+ },
147
+ pickupPoints: [
148
+ {
149
+ name: "Mysore Palace Gate",
150
+ address: "Mysore Palace South Gate",
151
+ lat: 12.3051,
152
+ lng: 76.6551,
153
+ },
154
+ ],
155
+ },
156
+ {
157
+ slug: "innova-crysta-jaipur",
158
+ image: "https://images.pexels.com/photos/3764984/pexels-photo-3764984.jpeg",
159
+ title: "Toyota Innova Crysta – 7 Seater",
160
+ description: "Spacious SUV ideal for family trips. With driver option available. AC, music system, comfortable seats.",
161
+ location: "Jaipur, Rajasthan",
162
+ date: new Date("2025-03-01"),
163
+ rating: 4.8,
164
+ price: 4500,
165
+ currency: "INR",
166
+ tileType: "rentals",
167
+ vehicleType: "suv",
168
+ duration: 1,
169
+ host: {
170
+ name: "Rajputana Cabs",
171
+ image: "https://images.pexels.com/photos/733872/pexels-photo-733872.jpeg",
172
+ },
173
+ seatingCapacity: 7,
174
+ driverOption: "both",
175
+ fuelType: "diesel",
176
+ transmission: "manual",
177
+ cancellationPolicy: "Free cancellation 7 days before.",
178
+ lastServiceDate: new Date("2025-02-12").toISOString(),
179
+ homeDeliveryAvailable: true,
180
+ homeDeliveryPrice: 0,
181
+ payAtPickup: true,
182
+ completedTrips: 87,
183
+ reviewCount: 2,
184
+ brand: "Toyota",
185
+ model: "Innova Crysta",
186
+ depositAmount: 15000,
187
+ distanceLimit: "No distance limit",
188
+ discount: {
189
+ discountStrategies: [
190
+ { type: "duration", durationType: "weekly", minDays: 7, discountType: "percentage", discountValue: 87, description: "Weekly discount", suggestedByPlatform: false, active: true },
191
+ { type: "duration", durationType: "fifteen-days", minDays: 15, discountType: "percentage", discountValue: 88, description: "15 day discount", suggestedByPlatform: false, active: true },
192
+ { type: "duration", durationType: "monthly", minDays: 30, discountType: "percentage", discountValue: 90, description: "Monthly discount", suggestedByPlatform: false, active: true },
193
+ ],
194
+ },
195
+ pickupPoints: [
196
+ {
197
+ name: "Jaipur Railway Station",
198
+ address: "Station Road, Jaipur",
199
+ lat: 26.9196,
200
+ lng: 75.788,
201
+ },
202
+ {
203
+ name: "Jaipur Airport",
204
+ address: "Terminal 2, Jaipur",
205
+ lat: 26.8289,
206
+ lng: 75.8056,
207
+ },
208
+ ],
209
+ },
210
+ {
211
+ slug: "hero-splendor-varanasi",
212
+ image: "https://images.pexels.com/photos/5220751/pexels-photo-5220751.jpeg",
213
+ title: "Hero Splendor Plus – City Bike",
214
+ description: "Lightweight and fuel-efficient bike for city exploration. Easy parking, great mileage.",
215
+ location: "Varanasi, Uttar Pradesh",
216
+ date: new Date("2025-01-05"),
217
+ rating: 4.1,
218
+ price: 350,
219
+ currency: "INR",
220
+ tileType: "rentals",
221
+ vehicleType: "bike",
222
+ duration: 1,
223
+ host: {
224
+ name: "Ganga Bikes",
225
+ image: "https://images.pexels.com/photos/1681010/pexels-photo-1681010.jpeg",
226
+ },
227
+ seatingCapacity: 2,
228
+ driverOption: "self-drive",
229
+ fuelType: "petrol",
230
+ transmission: "manual",
231
+ homeDeliveryAvailable: false,
232
+ payAtPickup: true,
233
+ completedTrips: 110,
234
+ reviewCount: 25,
235
+ distanceLimit: "120 km/day",
236
+ discount: {
237
+ discountStrategies: [
238
+ { type: "duration", durationType: "weekly", minDays: 7, discountType: "percentage", discountValue: 18, description: "Weekly discount", suggestedByPlatform: false, active: true },
239
+ { type: "duration", durationType: "fifteen-days", minDays: 15, discountType: "percentage", discountValue: 24, description: "15 day discount", suggestedByPlatform: false, active: true },
240
+ { type: "duration", durationType: "monthly", minDays: 30, discountType: "percentage", discountValue: 29, description: "Monthly discount", suggestedByPlatform: false, active: true },
241
+ ],
242
+ },
243
+ pickupPoints: [
244
+ {
245
+ name: "Dashashwamedh Ghat",
246
+ address: "Ghat Road, Varanasi",
247
+ lat: 25.306,
248
+ lng: 83.0075,
249
+ },
250
+ ],
251
+ },
252
+ {
253
+ slug: "mahindra-thar-ladakh",
254
+ image: "https://images.pexels.com/photos/3802510/pexels-photo-3802510.jpeg",
255
+ title: "Mahindra Thar 4x4 – Off-Road",
256
+ description: "Built for Ladakh's rough terrain. 4WD, diesel, helmet and emergency kit included. Minimum 3 days.",
257
+ location: "Leh, Ladakh",
258
+ date: new Date("2025-04-10"),
259
+ rating: 4.9,
260
+ price: 5500,
261
+ currency: "INR",
262
+ tileType: "rentals",
263
+ vehicleType: "suv",
264
+ duration: 3,
265
+ host: {
266
+ name: "Ladakh Adventures",
267
+ image: "https://images.pexels.com/photos/2379005/pexels-photo-2379005.jpeg",
268
+ },
269
+ seatingCapacity: 4,
270
+ driverOption: "self-drive",
271
+ fuelType: "diesel",
272
+ transmission: "manual",
273
+ cancellationPolicy: "Strict. 50% refund only.",
274
+ lastServiceDate: new Date("2025-03-20").toISOString(),
275
+ homeDeliveryAvailable: true,
276
+ homeDeliveryPrice: 800,
277
+ pickupPoints: [
278
+ {
279
+ name: "Kushok Bakula Rimpochee Airport",
280
+ address: "Leh Airport, Ladakh",
281
+ lat: 34.136,
282
+ lng: 77.5456,
283
+ },
284
+ {
285
+ name: "Main Bazaar",
286
+ address: "Leh Market, Ladakh",
287
+ lat: 34.1642,
288
+ lng: 77.5848,
289
+ },
290
+ ],
291
+ },
292
+ {
293
+ slug: "trek-cycle-rishikesh",
294
+ image: "https://images.pexels.com/photos/100582/pexels-photo-100582.jpeg",
295
+ title: "Trek Mountain Cycle – Riverside",
296
+ description: "Explore Rishikesh riverside trails on a high-quality mountain bike. Helmet and lock included.",
297
+ location: "Rishikesh, Uttarakhand",
298
+ date: new Date("2025-02-20"),
299
+ rating: 4.4,
300
+ price: 300,
301
+ currency: "INR",
302
+ tileType: "rentals",
303
+ vehicleType: "cycle",
304
+ duration: 1,
305
+ host: {
306
+ name: "Rishikesh Cycles",
307
+ image: "https://images.pexels.com/photos/415829/pexels-photo-415829.jpeg",
308
+ },
309
+ seatingCapacity: 1,
310
+ driverOption: "self-drive",
311
+ fuelType: "hybrid",
312
+ transmission: "manual",
313
+ homeDeliveryAvailable: false,
314
+ pickupPoints: [
315
+ {
316
+ name: "Laxman Jhula Hub",
317
+ address: "Laxman Jhula, Rishikesh",
318
+ lat: 30.1228,
319
+ lng: 78.3262,
320
+ },
321
+ ],
322
+ },
323
+ {
324
+ slug: "tesla-model3-bengaluru",
325
+ image: "https://images.pexels.com/photos/3729464/pexels-photo-3729464.jpeg",
326
+ title: "Tesla Model 3 – Electric",
327
+ description: "Experience luxury electric driving in Bangalore. Zero emissions, autopilot, full charge guaranteed.",
328
+ location: "Bengaluru, Karnataka",
329
+ date: new Date("2025-03-15"),
330
+ rating: 4.6,
331
+ price: 7000,
332
+ currency: "INR",
333
+ tileType: "rentals",
334
+ vehicleType: "electric-car",
335
+ duration: 1,
336
+ host: {
337
+ name: "EV Rides India",
338
+ image: "https://images.pexels.com/photos/774909/pexels-photo-774909.jpeg",
339
+ },
340
+ seatingCapacity: 5,
341
+ driverOption: "self-drive",
342
+ fuelType: "electric",
343
+ transmission: "automatic",
344
+ cancellationPolicy: "24h fully refundable.",
345
+ lastServiceDate: new Date("2025-02-28").toISOString(),
346
+ homeDeliveryAvailable: true,
347
+ homeDeliveryPrice: 1000,
348
+ pickupPoints: [
349
+ {
350
+ name: "Kempegowda Int. Airport",
351
+ address: "KIAL Rd, Bengaluru",
352
+ lat: 13.1986,
353
+ lng: 77.7066,
354
+ },
355
+ {
356
+ name: "Indiranagar Core",
357
+ address: "100ft Road, Indiranagar",
358
+ lat: 12.9784,
359
+ lng: 77.6408,
360
+ },
361
+ ],
362
+ },
363
+ {
364
+ slug: "force-traveller-12-seater-delhi",
365
+ image: "https://images.pexels.com/photos/385997/pexels-photo-385997.jpeg",
366
+ title: "Force Traveller – 12 Seater",
367
+ description: "Perfect for group tours and family trips. Pushback seats, AC, music system, and large luggage space. Professional driver included.",
368
+ location: "Delhi, NCR",
369
+ date: new Date("2025-04-01"),
370
+ rating: 4.7,
371
+ price: 3500,
372
+ currency: "INR",
373
+ tileType: "rentals",
374
+ vehicleType: "tempo-traveller",
375
+ duration: 1,
376
+ host: {
377
+ name: "Safe Travels Delhi",
378
+ image: "https://images.pexels.com/photos/415829/pexels-photo-415829.jpeg",
379
+ },
380
+ seatingCapacity: 12,
381
+ driverOption: "with-driver",
382
+ fuelType: "diesel",
383
+ transmission: "manual",
384
+ cancellationPolicy: "48 hours strict.",
385
+ homeDeliveryAvailable: true,
386
+ homeDeliveryPrice: 300,
387
+ pickupPoints: [
388
+ {
389
+ name: "New Delhi Railway Station",
390
+ address: "Paharganj side, NDLS",
391
+ lat: 28.6429,
392
+ lng: 77.2191,
393
+ },
394
+ {
395
+ name: "IGI Airport T3",
396
+ address: "Terminal 3, New Delhi",
397
+ lat: 28.5562,
398
+ lng: 77.1,
399
+ },
400
+ ],
401
+ },
402
+ ];
@@ -0,0 +1,48 @@
1
+ import { createSinglePricing } from "@myrjfa/state/dist/lib/models/pricing";
2
+ import { type Discount } from "@myrjfa/state/dist/lib/models/discount";
3
+ export type RentalFormValues = {
4
+ title?: string;
5
+ description?: string;
6
+ vehicleType?: string;
7
+ brand?: string;
8
+ model?: string;
9
+ year?: number;
10
+ city?: string;
11
+ state?: string;
12
+ address?: string;
13
+ locationSearchAddress?: string;
14
+ pincode?: string;
15
+ mapLink?: string;
16
+ pricing?: ReturnType<typeof createSinglePricing>;
17
+ discount?: Discount;
18
+ depositAmount?: number;
19
+ inventoryCount?: number;
20
+ seatingCapacity?: number;
21
+ fuelPolicy?: string;
22
+ driverOption?: string;
23
+ damagePolicy?: string;
24
+ cancellationPolicy?: string;
25
+ instantBook?: boolean;
26
+ homeDeliveryAvailable?: boolean;
27
+ homeDeliveryPrice?: number;
28
+ distanceLimit?: string;
29
+ operatingHoursStart?: string;
30
+ operatingHoursEnd?: string;
31
+ normalPickupTime?: string;
32
+ normalDropTime?: string;
33
+ fuelType?: string;
34
+ transmission?: string;
35
+ };
36
+ export type LocationData = {
37
+ latitude: number;
38
+ longitude: number;
39
+ address: string;
40
+ city?: string;
41
+ state?: string;
42
+ postalCode?: string;
43
+ searchAddress?: string;
44
+ };
45
+ export declare function getDefaultRentalFormValues(): Partial<RentalFormValues>;
46
+ export declare function hydrateRentalForm(rental: any): Partial<RentalFormValues>;
47
+ export declare function getRentalLocationData(rental: any): LocationData | null;
48
+ //# sourceMappingURL=rentalFormPage.d.ts.map