@mohasinac/appkit 3.1.2 → 3.1.3

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.
@@ -196,6 +196,12 @@ export declare const EVENT_ENDPOINTS: {
196
196
  readonly ENTRIES: (id: string) => string;
197
197
  readonly LEADERBOARD: (id: string, limit?: number) => string;
198
198
  readonly SPIN: (id: string) => string;
199
+ readonly LOTTERY_PULL: (id: string) => string;
200
+ readonly LOTTERY_ENTRIES: (id: string) => string;
201
+ };
202
+ export declare const LOTTERY_ENDPOINTS: {
203
+ readonly FLAG_ENTRY: (entryId: string) => string;
204
+ readonly REOPEN_SLOT: (entryId: string) => string;
199
205
  };
200
206
  export declare const FAQ_ENDPOINTS: {
201
207
  readonly LIST: "/api/faqs";
@@ -235,6 +241,8 @@ export declare const PRODUCT_ENDPOINTS: {
235
241
  readonly LIST: "/api/products";
236
242
  readonly BY_SLUG: (slug: string) => string;
237
243
  readonly BY_ID: (id: string) => string;
244
+ readonly LOTTERY_PULL: (id: string) => string;
245
+ readonly LOTTERY_ENTRIES: (id: string) => string;
238
246
  };
239
247
  export declare const PROMOTION_ENDPOINTS: {
240
248
  readonly LIST: "/api/coupons";
@@ -526,6 +534,12 @@ export declare const API_ENDPOINTS: {
526
534
  readonly ENTRIES: (id: string) => string;
527
535
  readonly LEADERBOARD: (id: string, limit?: number) => string;
528
536
  readonly SPIN: (id: string) => string;
537
+ readonly LOTTERY_PULL: (id: string) => string;
538
+ readonly LOTTERY_ENTRIES: (id: string) => string;
539
+ };
540
+ readonly LOTTERY: {
541
+ readonly FLAG_ENTRY: (entryId: string) => string;
542
+ readonly REOPEN_SLOT: (entryId: string) => string;
529
543
  };
530
544
  readonly FAQS: {
531
545
  readonly LIST: "/api/faqs";
@@ -565,6 +579,8 @@ export declare const API_ENDPOINTS: {
565
579
  readonly LIST: "/api/products";
566
580
  readonly BY_SLUG: (slug: string) => string;
567
581
  readonly BY_ID: (id: string) => string;
582
+ readonly LOTTERY_PULL: (id: string) => string;
583
+ readonly LOTTERY_ENTRIES: (id: string) => string;
568
584
  };
569
585
  readonly PROMOTIONS: {
570
586
  readonly LIST: "/api/coupons";
@@ -855,6 +871,12 @@ export declare const API_ROUTES: {
855
871
  readonly ENTRIES: (id: string) => string;
856
872
  readonly LEADERBOARD: (id: string, limit?: number) => string;
857
873
  readonly SPIN: (id: string) => string;
874
+ readonly LOTTERY_PULL: (id: string) => string;
875
+ readonly LOTTERY_ENTRIES: (id: string) => string;
876
+ };
877
+ readonly LOTTERY: {
878
+ readonly FLAG_ENTRY: (entryId: string) => string;
879
+ readonly REOPEN_SLOT: (entryId: string) => string;
858
880
  };
859
881
  readonly FAQS: {
860
882
  readonly LIST: "/api/faqs";
@@ -894,6 +916,8 @@ export declare const API_ROUTES: {
894
916
  readonly LIST: "/api/products";
895
917
  readonly BY_SLUG: (slug: string) => string;
896
918
  readonly BY_ID: (id: string) => string;
919
+ readonly LOTTERY_PULL: (id: string) => string;
920
+ readonly LOTTERY_ENTRIES: (id: string) => string;
897
921
  };
898
922
  readonly PROMOTIONS: {
899
923
  readonly LIST: "/api/coupons";
@@ -252,6 +252,16 @@ export const EVENT_ENDPOINTS = {
252
252
  LEADERBOARD: (id, limit) => `/api/events/${id}/leaderboard${limit !== undefined ? `?limit=${limit}` : ""}`,
253
253
  // SB9-E user spin assignment
254
254
  SPIN: (id) => `/api/events/${id}/spin`,
255
+ // Lottery: user self-pull (draw happens immediately on submit)
256
+ LOTTERY_PULL: (id) => `/api/events/${id}/lottery-pull`,
257
+ LOTTERY_ENTRIES: (id) => `/api/events/${id}/lottery-entries`,
258
+ };
259
+ // ---------------------------------------------------------------------------
260
+ // Lottery
261
+ // ---------------------------------------------------------------------------
262
+ export const LOTTERY_ENDPOINTS = {
263
+ FLAG_ENTRY: (entryId) => `/api/lottery-entries/${entryId}/flag`,
264
+ REOPEN_SLOT: (entryId) => `/api/lottery-entries/${entryId}/reopen-slot`,
255
265
  };
256
266
  // ---------------------------------------------------------------------------
257
267
  // FAQ
@@ -312,6 +322,9 @@ export const PRODUCT_ENDPOINTS = {
312
322
  LIST: "/api/products",
313
323
  BY_SLUG: (slug) => `/api/products/${slug}`,
314
324
  BY_ID: (id) => `/api/products/${id}`,
325
+ // Lottery: user self-pull for prize-draw products in lottery mode
326
+ LOTTERY_PULL: (id) => `/api/products/${id}/lottery-pull`,
327
+ LOTTERY_ENTRIES: (id) => `/api/products/${id}/lottery-entries`,
315
328
  };
316
329
  // ---------------------------------------------------------------------------
317
330
  // Promotions
@@ -474,6 +487,7 @@ export const API_ENDPOINTS = {
474
487
  COPILOT: COPILOT_ENDPOINTS,
475
488
  CORPORATE: CORPORATE_ENDPOINTS,
476
489
  EVENTS: EVENT_ENDPOINTS,
490
+ LOTTERY: LOTTERY_ENDPOINTS,
477
491
  FAQS: FAQ_ENDPOINTS,
478
492
  HOMEPAGE: HOMEPAGE_ENDPOINTS,
479
493
  LOYALTY: LOYALTY_ENDPOINTS,
package/dist/index.d.ts CHANGED
@@ -1778,6 +1778,7 @@ export { EVENT_ADMIN_SORT_OPTIONS } from "./features/events/index";
1778
1778
  export { EVENT_ENTRIES_COLLECTION } from "./features/events/index";
1779
1779
  export { LOTTERY_ENTRIES_COLLECTION } from "./features/lottery/schemas/firestore";
1780
1780
  export { lotteryEntriesSeedData } from "./seed/index";
1781
+ export { LOTTERY_ENTRY_FIELDS } from "./features/lottery/schemas/firestore";
1781
1782
  export { EVENT_ENTRY_FIELDS } from "./features/events/index";
1782
1783
  export { EVENT_ENTRY_INDEXED_FIELDS } from "./features/events/index";
1783
1784
  export { EVENT_FIELDS } from "./features/events/index";
package/dist/index.js CHANGED
@@ -3390,6 +3390,9 @@ export { LOTTERY_ENTRIES_COLLECTION } from "./features/lottery/schemas/firestore
3390
3390
  // lotteryEntriesSeedData - Seed data for the lotteryEntries collection.
3391
3391
  export { lotteryEntriesSeedData } from "./seed/index";
3392
3392
  // [SCHEMA]-Schema / data-shape constant â€" Zod validator, default-value object, or Firestore collection/field name constant.
3393
+ // LOTTERY_ENTRY_FIELDS - Canonical field name constants for lotteryEntries collection.
3394
+ export { LOTTERY_ENTRY_FIELDS } from "./features/lottery/schemas/firestore";
3395
+ // [SCHEMA]-Schema / data-shape constant â€" Zod validator, default-value object, or Firestore collection/field name constant.
3393
3396
  // EVENT_ENTRY_FIELDS - Constant used across modules.
3394
3397
  export { EVENT_ENTRY_FIELDS } from "./features/events/index";
3395
3398
  // [SCHEMA]-Schema / data-shape constant â€" Zod validator, default-value object, or Firestore collection/field name constant.
@@ -113,7 +113,76 @@ const _rawProductsPrizeDrawsSeedData = [
113
113
  createdAt: daysAgo(8),
114
114
  updatedAt: daysAgo(1),
115
115
  },
116
+ // 3. Hot Wheels Rare Numbered Slot Lottery (lottery mode — user self-pull)
117
+ {
118
+ id: "prize-hotwheels-slot-lottery",
119
+ slug: "prize-hotwheels-slot-lottery",
120
+ title: "Hot Wheels Rare — Numbered Slot Lottery",
121
+ description: "<p>10 rare Hot Wheels Redline and Treasure Hunt castings. Submit your UPI transaction ID and claim a slot — prize assigned instantly by weighted random draw. Lower-priced slots have a higher chance!</p>",
122
+ categorySlugs: ["category-diecast-vehicles"],
123
+ categoryNames: ["Diecast Vehicles"],
124
+ brand: "Hot Wheels",
125
+ brandSlug: "brand-hot-wheels",
126
+ price: 99900,
127
+ currency: SCHEMA_DEFAULTS.CURRENCY,
128
+ stockQuantity: 10,
129
+ availableQuantity: 10,
130
+ mainImage: seedExtMedia("https://images.unsplash.com/photo-1594736797933-d0401ba2fe65?w=800&h=800&fit=crop"),
131
+ images: [
132
+ seedExtMedia("https://images.unsplash.com/photo-1594736797933-d0401ba2fe65?w=800&h=800&fit=crop"),
133
+ ],
134
+ status: PRODUCT_FIELDS.STATUS_VALUES.PUBLISHED,
135
+ storeName: "Diecast Depot",
136
+ storeId: "store-diecast-depot",
137
+ featured: false,
138
+ isPromoted: false,
139
+ tags: ["hot-wheels", "lottery", "diecast", "redline", "rare"],
140
+ condition: PRODUCT_FIELDS.CONDITION_VALUES.NEW,
141
+ listingType: "prize-draw",
142
+ prizeDrawMode: "lottery",
143
+ lotteryConfig: _hotWheelsLotteryConfig(),
144
+ prizeDrawItems: _hotWheelsPrizeItems(),
145
+ allowOffers: false,
146
+ createdAt: daysAgo(3),
147
+ updatedAt: daysAgo(1),
148
+ },
116
149
  ];
150
+ function _hotWheelsLotteryConfig() {
151
+ const slots = [
152
+ { slotNumber: 1, name: "Red Line Hot Wheels Custom Camaro (1969)", priceInPaise: 49900, weight: 68, isBooked: true, bookedByUserLotteryNumber: 1, bookedByDisplayName: "Ravi K." },
153
+ { slotNumber: 2, name: "Treasure Hunt Dodge Challenger (2023)", priceInPaise: 79900, weight: 42, isBooked: true, bookedByUserLotteryNumber: 2, bookedByDisplayName: "Aisha M." },
154
+ { slotNumber: 3, name: "Hot Wheels Super Treasure Hunt (sealed)", priceInPaise: 99900, weight: 22, isBooked: true, bookedByUserLotteryNumber: 3, bookedByDisplayName: "Dev S." },
155
+ { slotNumber: 4, name: "Redline Ferrari 246 Dino (1969 original)", priceInPaise: 149900, weight: 1, isBooked: true, bookedByUserLotteryNumber: 4, bookedByDisplayName: "Priya L." },
156
+ { slotNumber: 5, name: "Hot Wheels Mystery Car (sealed, unknown model)", priceInPaise: 29900, weight: 100, isBooked: true, bookedByUserLotteryNumber: 5, bookedByDisplayName: "Mohsin C." },
157
+ { slotNumber: 6, name: "Hot Wheels RLC Exclusive Bone Shaker", priceInPaise: 59900, weight: 55, isBooked: false },
158
+ { slotNumber: 7, name: "Hot Wheels Pop Culture DeLorean (BTTF)", priceInPaise: 39900, weight: 79, isBooked: false },
159
+ { slotNumber: 8, name: "Hot Wheels Premium Car Culture (set of 5)", priceInPaise: 89900, weight: 31, isBooked: false },
160
+ { slotNumber: 9, name: "Hot Wheels ID Car (NFC-chip, sealed)", priceInPaise: 69900, weight: 46, isBooked: false },
161
+ { slotNumber: 10, name: "Redline Hot Wheels Beach Bomb (1969 – prototype type)", priceInPaise: 199900, weight: 1, isBooked: false },
162
+ ];
163
+ return {
164
+ slots,
165
+ totalSlots: 10,
166
+ pricingMode: "variable",
167
+ drawWindowDurationMinutes: 60,
168
+ maxPullsPerTransaction: 1,
169
+ maxPullsPerUser: 1,
170
+ };
171
+ }
172
+ function _hotWheelsPrizeItems() {
173
+ return [
174
+ { itemNumber: 1, title: "Red Line Custom Camaro (1969)", images: [seedExtMedia("https://images.unsplash.com/photo-1594736797933-d0401ba2fe65?w=600&h=600&fit=crop")], condition: PRODUCT_FIELDS.CONDITION_VALUES.USED, estimatedValue: 49900, prizeSlotPrice: 49900, isWon: true },
175
+ { itemNumber: 2, title: "Treasure Hunt Dodge Challenger", images: [seedExtMedia("https://images.unsplash.com/photo-1594736797933-d0401ba2fe65?w=600&h=600&fit=crop")], condition: PRODUCT_FIELDS.CONDITION_VALUES.NEW, estimatedValue: 79900, prizeSlotPrice: 79900, isWon: true },
176
+ { itemNumber: 3, title: "Super Treasure Hunt (sealed)", images: [seedExtMedia("https://images.unsplash.com/photo-1594736797933-d0401ba2fe65?w=600&h=600&fit=crop")], condition: PRODUCT_FIELDS.CONDITION_VALUES.NEW, estimatedValue: 99900, prizeSlotPrice: 99900, isWon: true },
177
+ { itemNumber: 4, title: "Redline Ferrari 246 Dino (1969)", images: [seedExtMedia("https://images.unsplash.com/photo-1594736797933-d0401ba2fe65?w=600&h=600&fit=crop")], condition: PRODUCT_FIELDS.CONDITION_VALUES.USED, estimatedValue: 149900, prizeSlotPrice: 149900, isWon: true },
178
+ { itemNumber: 5, title: "Mystery Car (sealed)", images: [seedExtMedia("https://images.unsplash.com/photo-1594736797933-d0401ba2fe65?w=600&h=600&fit=crop")], condition: PRODUCT_FIELDS.CONDITION_VALUES.NEW, estimatedValue: 29900, prizeSlotPrice: 29900, isWon: true },
179
+ { itemNumber: 6, title: "RLC Exclusive Bone Shaker", images: [seedExtMedia("https://images.unsplash.com/photo-1594736797933-d0401ba2fe65?w=600&h=600&fit=crop")], condition: PRODUCT_FIELDS.CONDITION_VALUES.NEW, estimatedValue: 59900, prizeSlotPrice: 59900, isWon: false },
180
+ { itemNumber: 7, title: "Pop Culture DeLorean (BTTF)", images: [seedExtMedia("https://images.unsplash.com/photo-1594736797933-d0401ba2fe65?w=600&h=600&fit=crop")], condition: PRODUCT_FIELDS.CONDITION_VALUES.NEW, estimatedValue: 39900, prizeSlotPrice: 39900, isWon: false },
181
+ { itemNumber: 8, title: "Premium Car Culture set of 5", images: [seedExtMedia("https://images.unsplash.com/photo-1594736797933-d0401ba2fe65?w=600&h=600&fit=crop")], condition: PRODUCT_FIELDS.CONDITION_VALUES.NEW, estimatedValue: 89900, prizeSlotPrice: 89900, isWon: false },
182
+ { itemNumber: 9, title: "ID Car (NFC-chip, sealed)", images: [seedExtMedia("https://images.unsplash.com/photo-1594736797933-d0401ba2fe65?w=600&h=600&fit=crop")], condition: PRODUCT_FIELDS.CONDITION_VALUES.NEW, estimatedValue: 69900, prizeSlotPrice: 69900, isWon: false },
183
+ { itemNumber: 10, title: "Redline Beach Bomb (1969 prototype type)", images: [seedExtMedia("https://images.unsplash.com/photo-1594736797933-d0401ba2fe65?w=600&h=600&fit=crop")], condition: PRODUCT_FIELDS.CONDITION_VALUES.USED, estimatedValue: 199900, prizeSlotPrice: 199900, isWon: false },
184
+ ];
185
+ }
117
186
  function _pokemonPrizeItems() {
118
187
  return [
119
188
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohasinac/appkit",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"