@cimplify/sdk 0.45.3 → 0.45.4

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 (52) hide show
  1. package/dist/advanced.d.mts +3 -2
  2. package/dist/advanced.d.ts +3 -2
  3. package/dist/{chunk-KD2HHETX.js → chunk-3OPVWRIP.js} +2 -2
  4. package/dist/{chunk-B2MJQ7SU.js → chunk-CJN5SPXN.js} +553 -1
  5. package/dist/{chunk-ZTPP7PDU.mjs → chunk-DZGOF7CA.mjs} +553 -1
  6. package/dist/{chunk-J7BUGTAG.mjs → chunk-GDGDDGAE.mjs} +1 -1
  7. package/dist/{client-DjzIoewX.d.ts → client-B0RPhAvp.d.ts} +2 -2
  8. package/dist/{client-EM8xKCPO.d.mts → client-BUtbmHv-.d.mts} +2 -2
  9. package/dist/{client-C5LcbNxL.d.mts → client-CDUY-6nC.d.mts} +2 -1
  10. package/dist/{client-Bsd4Vi_y.d.ts → client-aZInadOY.d.ts} +2 -1
  11. package/dist/{index-yMe4VZqR.d.mts → index-3C9J8Wb-.d.mts} +3 -2
  12. package/dist/{index-PbBuEWp7.d.ts → index-DC_ZcSgO.d.ts} +3 -2
  13. package/dist/index.d.mts +6 -5
  14. package/dist/index.d.ts +6 -5
  15. package/dist/mock/cli.mjs +553 -1
  16. package/dist/mock/library.d.mts +2 -2
  17. package/dist/mock/library.d.ts +2 -2
  18. package/dist/mock/library.js +553 -1
  19. package/dist/mock/library.mjs +553 -1
  20. package/dist/mock/msw.d.mts +1 -1
  21. package/dist/mock/msw.d.ts +1 -1
  22. package/dist/mock/msw.js +553 -1
  23. package/dist/mock/msw.mjs +553 -1
  24. package/dist/payment-Bse2XJ-c.d.mts +113 -0
  25. package/dist/payment-JcNqOf_T.d.ts +113 -0
  26. package/dist/{price-DMijJ6_3.d.mts → price-YBGk5seG.d.mts} +1 -1
  27. package/dist/{price-DmQTOnjj.d.ts → price-mHkRncgW.d.ts} +1 -1
  28. package/dist/{payment-4JSLNTVM.d.mts → product-DiX-HGkT.d.mts} +1 -111
  29. package/dist/{payment-4JSLNTVM.d.ts → product-DiX-HGkT.d.ts} +1 -111
  30. package/dist/react.d.mts +4 -3
  31. package/dist/react.d.ts +4 -3
  32. package/dist/{server-UARbamIZ.d.ts → server-BY-DDUM0.d.mts} +10 -1
  33. package/dist/{server-Bs295U0t.d.mts → server-CiUhgjZA.d.mts} +43 -1
  34. package/dist/{server-Bs295U0t.d.ts → server-CiUhgjZA.d.ts} +43 -1
  35. package/dist/{server-UARbamIZ.d.mts → server-DkrQ4Idn.d.ts} +10 -1
  36. package/dist/server.d.mts +4 -3
  37. package/dist/server.d.ts +4 -3
  38. package/dist/testing/msw.d.mts +2 -1
  39. package/dist/testing/msw.d.ts +2 -1
  40. package/dist/testing/msw.js +2 -2
  41. package/dist/testing/msw.mjs +1 -1
  42. package/dist/testing/suite.d.mts +6 -5
  43. package/dist/testing/suite.d.ts +6 -5
  44. package/dist/testing/suite.js +21 -21
  45. package/dist/testing/suite.mjs +2 -2
  46. package/dist/testing.d.mts +5 -4
  47. package/dist/testing.d.ts +5 -4
  48. package/dist/testing.js +77 -77
  49. package/dist/testing.mjs +3 -3
  50. package/dist/utils.d.mts +4 -3
  51. package/dist/utils.d.ts +4 -3
  52. package/package.json +1 -1
package/dist/mock/msw.mjs CHANGED
@@ -3852,6 +3852,10 @@ function toApiProduct(p, ctx) {
3852
3852
  duration_unit: p.duration_unit,
3853
3853
  duration_minutes: p.duration_minutes,
3854
3854
  billing_plans: p.billing_plans,
3855
+ /** Per-product customer inputs (prescription upload, consent
3856
+ * signature, etc.). The Rust backend emits this on ProductView; the
3857
+ * SDK's React components branch on its presence to render inputs. */
3858
+ input_fields: p.input_fields ?? [],
3855
3859
  created_at: p.created_at,
3856
3860
  updated_at: p.updated_at,
3857
3861
  metadata: {
@@ -9097,6 +9101,553 @@ function seedFashion(registry) {
9097
9101
  return { businessId };
9098
9102
  }
9099
9103
 
9104
+ // src/mock/seeds/pharmacy.ts
9105
+ var ISO9 = "2026-01-01T00:00:00.000Z";
9106
+ var photoFor6 = (slug) => seedImage("pharmacy", slug);
9107
+ function seedPharmacy(registry) {
9108
+ const businessId = "bus_wellspring_pharmacy";
9109
+ const business = {
9110
+ id: businessId,
9111
+ name: "Wellspring Pharmacy",
9112
+ handle: "wellspring",
9113
+ business_type: "retail",
9114
+ email: "care@wellspringpharmacy.test",
9115
+ default_currency: "GHS",
9116
+ default_phone: "+233244778899",
9117
+ default_address: "5 Liberation Road, Ridge, Accra",
9118
+ default_offers_table_service: false,
9119
+ default_accepts_online_orders: true,
9120
+ image: photoFor6("business-hero"),
9121
+ status: "active",
9122
+ created_at: ISO9,
9123
+ updated_at: ISO9,
9124
+ created_by: "seed",
9125
+ preferences: {
9126
+ theme: "clinical",
9127
+ tagline: "Trusted care, delivered same-day",
9128
+ checkout: { allow_guest: true }
9129
+ },
9130
+ is_online_only: false,
9131
+ enabled_payment_types: ["card", "mobile_money", "cash"],
9132
+ default_location_settings: {},
9133
+ country_code: "GH",
9134
+ timezone: "Africa/Accra"
9135
+ };
9136
+ registry.businesses.put(businessId, business);
9137
+ const categories = [
9138
+ { slug: "pain-relief", name: "Pain Relief" },
9139
+ { slug: "cold-flu", name: "Cold & Flu" },
9140
+ { slug: "vitamins", name: "Vitamins & Supplements" },
9141
+ { slug: "first-aid", name: "First Aid" },
9142
+ { slug: "personal-care", name: "Personal Care" },
9143
+ { slug: "devices", name: "Medical Devices" },
9144
+ { slug: "baby", name: "Baby & Mother" }
9145
+ ];
9146
+ const catIds = /* @__PURE__ */ new Map();
9147
+ for (const c of categories) {
9148
+ const id = `cat_${c.slug}`;
9149
+ catIds.set(c.slug, id);
9150
+ const cat = {
9151
+ id,
9152
+ business_id: businessId,
9153
+ name: c.name,
9154
+ slug: c.slug,
9155
+ description: `Wellspring \u2014 ${c.name}`,
9156
+ product_ids: [],
9157
+ display_order: 0,
9158
+ is_active: true,
9159
+ created_at: ISO9,
9160
+ updated_at: ISO9
9161
+ };
9162
+ registry.categories.put(id, cat);
9163
+ }
9164
+ function field(productSlug, f) {
9165
+ return {
9166
+ id: f.id ?? `fld_${productSlug}_${f.slug}`,
9167
+ product_id: `prod_${productSlug}`,
9168
+ ...f
9169
+ };
9170
+ }
9171
+ const products = [
9172
+ // Pain Relief
9173
+ {
9174
+ slug: "paracetamol",
9175
+ name: "Paracetamol 500mg (24 tablets)",
9176
+ price: "12.00",
9177
+ category: "pain-relief",
9178
+ description: "Fever and mild-to-moderate pain. Adults and children over 12.",
9179
+ tags: ["otc", "analgesic"],
9180
+ inputs: [
9181
+ field("paracetamol", {
9182
+ slug: "age_confirmation",
9183
+ name: "Age confirmation",
9184
+ field_type: "checkbox",
9185
+ is_required: true,
9186
+ display_order: 0,
9187
+ help_text: "I confirm this product is for someone aged 12 or over."
9188
+ })
9189
+ ]
9190
+ },
9191
+ { slug: "ibuprofen", name: "Ibuprofen 200mg (20 tablets)", price: "18.00", category: "pain-relief", description: "Anti-inflammatory for headaches, muscle pain, menstrual cramps.", tags: ["otc", "nsaid"] },
9192
+ { slug: "aspirin", name: "Aspirin 300mg (30 tablets)", price: "15.00", category: "pain-relief", description: "Pain relief and low-dose daily cardiovascular protection.", tags: ["otc", "analgesic"] },
9193
+ { slug: "allergy-relief", name: "Cetirizine 10mg (10 tablets)", price: "22.00", category: "pain-relief", description: "Non-drowsy antihistamine for seasonal allergies.", tags: ["otc", "antihistamine"] },
9194
+ // Cold & Flu
9195
+ { slug: "cold-flu-syrup", name: "Cold & Flu Syrup (200ml)", price: "35.00", category: "cold-flu", description: "Multi-symptom relief: blocked nose, sore throat, dry cough.", tags: ["otc", "syrup"] },
9196
+ { slug: "throat-lozenges", name: "Honey-Lemon Throat Lozenges (24)", price: "18.00", category: "cold-flu", description: "Soothes sore throat and irritation.", tags: ["otc", "lozenge"] },
9197
+ { slug: "decongestant", name: "Nasal Decongestant Spray (10ml)", price: "28.00", category: "cold-flu", description: "Fast-acting relief for blocked nasal passages.", tags: ["otc", "spray"] },
9198
+ // Vitamins & Supplements
9199
+ { slug: "multivitamin", name: "Daily Multivitamin (60 tablets)", price: "85.00", category: "vitamins", description: "Once-daily formula with 22 essential vitamins and minerals.", tags: ["supplement", "daily"] },
9200
+ { slug: "vitamin-c", name: "Vitamin C 1000mg (90 tablets)", price: "65.00", category: "vitamins", description: "Immune-support antioxidant. Time-released.", tags: ["supplement", "immune"] },
9201
+ { slug: "vitamin-d", name: "Vitamin D3 1000IU (120 capsules)", price: "55.00", category: "vitamins", description: "Bone and immune health. 4-month supply.", tags: ["supplement", "bone-health"] },
9202
+ { slug: "omega-3", name: "Omega-3 Fish Oil (90 softgels)", price: "120.00", category: "vitamins", description: "1000mg EPA+DHA for heart and brain health.", tags: ["supplement", "heart-health"] },
9203
+ { slug: "probiotics", name: "Probiotic 10-Strain (30 capsules)", price: "95.00", category: "vitamins", description: "Digestive and immune support.", tags: ["supplement", "digestive"] },
9204
+ // First Aid
9205
+ { slug: "first-aid-kit", name: "Home First Aid Kit", price: "180.00", category: "first-aid", description: "60-piece kit with plasters, gauze, antiseptic, scissors, and quick-reference guide.", tags: ["kit", "essential"] },
9206
+ { slug: "plasters", name: "Assorted Plasters (40 pack)", price: "22.00", category: "first-aid", description: "Waterproof adhesive bandages in five sizes.", tags: ["first-aid"] },
9207
+ { slug: "antiseptic", name: "Antiseptic Cream (30g)", price: "18.00", category: "first-aid", description: "For cuts, grazes, and minor skin infections.", tags: ["first-aid", "cream"] },
9208
+ { slug: "bandages", name: "Elastic Crepe Bandage (5cm x 4.5m)", price: "15.00", category: "first-aid", description: "Reusable compression bandage for sprains.", tags: ["first-aid"] },
9209
+ // Personal Care
9210
+ { slug: "hand-sanitizer", name: "Hand Sanitizer 70% Alcohol (500ml)", price: "32.00", category: "personal-care", description: "Kills 99.9% of germs. Moisturising formula.", tags: ["hygiene"] },
9211
+ { slug: "face-mask", name: "Surgical Face Masks (50 pack)", price: "45.00", category: "personal-care", description: "3-ply earloop masks. Disposable.", tags: ["hygiene", "ppe"] },
9212
+ { slug: "lip-balm", name: "Medicated Lip Balm (4g)", price: "12.00", category: "personal-care", description: "SPF 15 with cocoa butter and beeswax.", tags: ["skin-care"] },
9213
+ // Medical Devices
9214
+ { slug: "thermometer", name: "Digital Thermometer", price: "65.00", category: "devices", description: "Fast oral / underarm reading in 10 seconds. Auto-shutoff.", tags: ["device", "essential"] },
9215
+ {
9216
+ slug: "blood-pressure-monitor",
9217
+ name: "Automatic BP Monitor",
9218
+ price: "320.00",
9219
+ category: "devices",
9220
+ description: "Upper-arm cuff with memory for two users. Irregular heartbeat detection.",
9221
+ tags: ["device", "premium"],
9222
+ inputs: [
9223
+ field("blood-pressure-monitor", {
9224
+ slug: "arm_size",
9225
+ name: "Arm circumference",
9226
+ field_type: "select",
9227
+ options: ["Standard (22\u201332 cm)", "Large (32\u201342 cm)"],
9228
+ is_required: true,
9229
+ display_order: 0,
9230
+ help_text: "Pick the cuff that fits \u2014 wrong size gives inaccurate readings."
9231
+ })
9232
+ ]
9233
+ },
9234
+ { slug: "glucometer", name: "Blood Glucose Meter Starter Kit", price: "280.00", category: "devices", description: "Meter, 25 test strips, lancing device, 25 lancets, carry case.", tags: ["device", "diabetes"] },
9235
+ { slug: "pulse-oximeter", name: "Fingertip Pulse Oximeter", price: "145.00", category: "devices", description: "SpO2 + heart-rate reading in under 10 seconds.", tags: ["device"] },
9236
+ // Baby & Mother
9237
+ {
9238
+ slug: "baby-formula",
9239
+ name: "Infant Formula Stage 1 (400g)",
9240
+ price: "150.00",
9241
+ category: "baby",
9242
+ description: "0\u20136 months. Iron-fortified, with prebiotics.",
9243
+ tags: ["baby", "nutrition"],
9244
+ inputs: [
9245
+ field("baby-formula", {
9246
+ slug: "baby_dob",
9247
+ name: "Baby's date of birth",
9248
+ field_type: "date",
9249
+ is_required: true,
9250
+ display_order: 0,
9251
+ help_text: "Confirms stage 1 is the right formula for your baby's age."
9252
+ }),
9253
+ field("baby-formula", {
9254
+ slug: "allergies",
9255
+ name: "Known allergies or intolerances",
9256
+ field_type: "textarea",
9257
+ is_required: false,
9258
+ display_order: 1,
9259
+ placeholder: "e.g. lactose, soy. Leave blank if none.",
9260
+ semantic_kind: "allergen"
9261
+ })
9262
+ ]
9263
+ },
9264
+ { slug: "baby-wipes", name: "Sensitive Baby Wipes (72 pack)", price: "28.00", category: "baby", description: "Alcohol-free, fragrance-free. Dermatologist-tested.", tags: ["baby", "hygiene"] },
9265
+ // ── Prescription medications (Rx; require a verified prescription) ─
9266
+ {
9267
+ slug: "amoxicillin-rx",
9268
+ name: "Amoxicillin 500mg (Rx)",
9269
+ price: "65.00",
9270
+ category: "pain-relief",
9271
+ description: "Broad-spectrum antibiotic. Prescription required \u2014 our pharmacist will verify before dispensing.",
9272
+ tags: ["prescription", "antibiotic"],
9273
+ requiresPrescription: true,
9274
+ inputs: [
9275
+ field("amoxicillin-rx", {
9276
+ slug: "prescription_upload",
9277
+ name: "Upload prescription",
9278
+ field_type: "file",
9279
+ is_required: true,
9280
+ display_order: 0,
9281
+ help_text: "PDF or photo of your doctor's prescription (max 10 MB).",
9282
+ validation: { accepted_formats: ["pdf", "jpg", "jpeg", "png", "heic"], max_size_mb: 10 }
9283
+ }),
9284
+ field("amoxicillin-rx", {
9285
+ slug: "patient_dob",
9286
+ name: "Patient date of birth",
9287
+ field_type: "date",
9288
+ is_required: true,
9289
+ display_order: 1
9290
+ }),
9291
+ field("amoxicillin-rx", {
9292
+ slug: "consent",
9293
+ name: "I confirm this prescription is genuine and issued for the named patient",
9294
+ field_type: "checkbox",
9295
+ is_required: true,
9296
+ display_order: 2,
9297
+ semantic_kind: "consent"
9298
+ })
9299
+ ]
9300
+ },
9301
+ {
9302
+ slug: "insulin-rx",
9303
+ name: "Insulin Glargine 100u/ml (Rx)",
9304
+ price: "240.00",
9305
+ category: "devices",
9306
+ description: "Long-acting basal insulin. Cold-chain delivery; prescription required.",
9307
+ tags: ["prescription", "diabetes", "cold-chain"],
9308
+ requiresPrescription: true,
9309
+ inputs: [
9310
+ field("insulin-rx", {
9311
+ slug: "prescription_upload",
9312
+ name: "Upload prescription",
9313
+ field_type: "file",
9314
+ is_required: true,
9315
+ display_order: 0,
9316
+ help_text: "PDF or photo of your doctor's prescription (max 10 MB).",
9317
+ validation: { accepted_formats: ["pdf", "jpg", "jpeg", "png", "heic"], max_size_mb: 10 }
9318
+ }),
9319
+ field("insulin-rx", {
9320
+ slug: "delivery_temp_acknowledgement",
9321
+ name: "I'll be available to receive a cold-chain delivery",
9322
+ field_type: "checkbox",
9323
+ is_required: true,
9324
+ display_order: 1,
9325
+ help_text: "Insulin must be refrigerated. Delivery driver will hand over directly \u2014 not leave at door.",
9326
+ semantic_kind: "consent"
9327
+ })
9328
+ ]
9329
+ },
9330
+ {
9331
+ slug: "vaccination-consent",
9332
+ name: "Flu Shot \u2014 At-Pharmacy",
9333
+ price: "80.00",
9334
+ category: "personal-care",
9335
+ description: "Pharmacist-administered seasonal influenza vaccine. Walk-in or book a slot.",
9336
+ tags: ["service", "vaccination"],
9337
+ inputs: [
9338
+ field("vaccination-consent", {
9339
+ slug: "patient_name",
9340
+ name: "Patient name",
9341
+ field_type: "text",
9342
+ is_required: true,
9343
+ display_order: 0
9344
+ }),
9345
+ field("vaccination-consent", {
9346
+ slug: "patient_dob",
9347
+ name: "Date of birth",
9348
+ field_type: "date",
9349
+ is_required: true,
9350
+ display_order: 1
9351
+ }),
9352
+ field("vaccination-consent", {
9353
+ slug: "allergies",
9354
+ name: "Known allergies or reactions to past vaccines",
9355
+ field_type: "textarea",
9356
+ is_required: false,
9357
+ display_order: 2,
9358
+ placeholder: "Egg, latex, prior vaccine reactions, etc. Leave blank if none.",
9359
+ semantic_kind: "allergen"
9360
+ }),
9361
+ field("vaccination-consent", {
9362
+ slug: "consent_signature",
9363
+ name: "Signed consent",
9364
+ field_type: "signature",
9365
+ is_required: true,
9366
+ display_order: 3,
9367
+ help_text: "Required by our administering pharmacist before vaccination.",
9368
+ semantic_kind: "consent"
9369
+ })
9370
+ ]
9371
+ }
9372
+ ];
9373
+ for (const p of products) {
9374
+ const id = `prod_${p.slug}`;
9375
+ const catId = catIds.get(p.category);
9376
+ const product = {
9377
+ id,
9378
+ business_id: businessId,
9379
+ name: p.name,
9380
+ slug: p.slug,
9381
+ description: p.description,
9382
+ product_type: "product",
9383
+ base_price: p.price,
9384
+ currency: "GHS",
9385
+ image: photoFor6(p.slug),
9386
+ images: [photoFor6(p.slug)],
9387
+ is_available: true,
9388
+ category_ids: [catId],
9389
+ collection_ids: [],
9390
+ add_on_ids: [],
9391
+ variant_ids: [],
9392
+ tags: p.tags ?? [],
9393
+ input_fields: p.inputs,
9394
+ metadata: p.requiresPrescription ? { requires_prescription: true } : void 0,
9395
+ created_at: ISO9,
9396
+ updated_at: ISO9
9397
+ };
9398
+ registry.products.put(id, product);
9399
+ const cat = registry.categories.get(catId);
9400
+ cat.product_ids.push(id);
9401
+ registry.categories.put(catId, cat);
9402
+ }
9403
+ const essentials = {
9404
+ id: "col_essentials",
9405
+ business_id: businessId,
9406
+ name: "Home Essentials",
9407
+ slug: "essentials",
9408
+ description: "Stock up your medicine cabinet.",
9409
+ product_ids: [
9410
+ "prod_paracetamol",
9411
+ "prod_first-aid-kit",
9412
+ "prod_thermometer",
9413
+ "prod_hand-sanitizer",
9414
+ "prod_multivitamin"
9415
+ ],
9416
+ is_active: true,
9417
+ created_at: ISO9,
9418
+ updated_at: ISO9
9419
+ };
9420
+ registry.collections.put(essentials.id, essentials);
9421
+ for (const pid of essentials.product_ids) {
9422
+ const p = registry.products.get(pid);
9423
+ if (p) {
9424
+ p.collection_ids.push(essentials.id);
9425
+ registry.products.put(pid, p);
9426
+ }
9427
+ }
9428
+ const packAxis = {
9429
+ id: "axis_pack_size",
9430
+ business_id: businessId,
9431
+ product_id: "prod_paracetamol",
9432
+ name: "Pack size",
9433
+ display_order: 0,
9434
+ affects_recipe: false,
9435
+ values: [
9436
+ { id: "axv_pack_24", name: "24 tablets", display: 0 },
9437
+ { id: "axv_pack_48", name: "48 tablets", display: 1 },
9438
+ { id: "axv_pack_100", name: "100 tablets (family)", display: 2 }
9439
+ ].map((v) => ({
9440
+ id: v.id,
9441
+ business_id: businessId,
9442
+ axis_id: "axis_pack_size",
9443
+ name: v.name,
9444
+ display_order: v.display,
9445
+ created_at: ISO9,
9446
+ updated_at: ISO9
9447
+ })),
9448
+ created_at: ISO9,
9449
+ updated_at: ISO9
9450
+ };
9451
+ registry.variantAxes.put(packAxis.id, packAxis);
9452
+ const packAdj = { pack_24: "0.00", pack_48: "8.00", pack_100: "18.00" };
9453
+ const paracetamolVariantIds = [];
9454
+ let firstVariant = true;
9455
+ for (const pk of packAxis.values) {
9456
+ const key = pk.id.replace("axv_pack_", "pack_");
9457
+ const id = `var_paracetamol_${key.replace("pack_", "")}`;
9458
+ const variant = {
9459
+ id,
9460
+ product_id: "prod_paracetamol",
9461
+ business_id: businessId,
9462
+ name: pk.name,
9463
+ sku: `PCM-${key.toUpperCase()}`,
9464
+ price_adjustment: packAdj[key] ?? "0.00",
9465
+ component_multiplier: "1.00",
9466
+ is_default: firstVariant,
9467
+ is_active: true,
9468
+ axis_value_ids: [pk.id],
9469
+ created_at: ISO9,
9470
+ updated_at: ISO9
9471
+ };
9472
+ registry.variants.put(id, variant);
9473
+ paracetamolVariantIds.push(id);
9474
+ firstVariant = false;
9475
+ }
9476
+ const paracetamol = registry.products.get("prod_paracetamol");
9477
+ if (paracetamol) {
9478
+ paracetamol.variant_ids = paracetamolVariantIds;
9479
+ registry.products.put(paracetamol.id, paracetamol);
9480
+ }
9481
+ const formAddOn = {
9482
+ id: "addon_form",
9483
+ business_id: businessId,
9484
+ name: "Format",
9485
+ is_multiple_allowed: false,
9486
+ is_required: false,
9487
+ is_mutually_exclusive: true,
9488
+ min_selections: 0,
9489
+ max_selections: 1,
9490
+ created_at: ISO9,
9491
+ updated_at: ISO9,
9492
+ options: [
9493
+ { id: "addopt_generic", add_on_id: "addon_form", business_id: businessId, name: "Generic (default)", default_price: "0.00", is_required: false, is_mutually_exclusive: true, created_at: ISO9, updated_at: ISO9 },
9494
+ { id: "addopt_brand", add_on_id: "addon_form", business_id: businessId, name: "Brand-name (+30%)", default_price: "8.00", is_required: false, is_mutually_exclusive: true, created_at: ISO9, updated_at: ISO9 }
9495
+ ]
9496
+ };
9497
+ registry.addOns.put(formAddOn.id, formAddOn);
9498
+ const medProductIds = ["prod_paracetamol", "prod_ibuprofen", "prod_aspirin", "prod_allergy-relief"];
9499
+ for (const pid of medProductIds) {
9500
+ registry.productAddOns.put(`${pid}:${formAddOn.id}`, { product_id: pid, add_on_id: formAddOn.id });
9501
+ const p = registry.products.get(pid);
9502
+ if (p) {
9503
+ p.add_on_ids.push(formAddOn.id);
9504
+ registry.products.put(pid, p);
9505
+ }
9506
+ }
9507
+ const services = [
9508
+ {
9509
+ id: "svc_bp_check",
9510
+ business_id: businessId,
9511
+ name: "Blood Pressure Check",
9512
+ description: "Free in-store BP reading with our pharmacist.",
9513
+ duration_minutes: 15,
9514
+ price: "0.00",
9515
+ is_available: true
9516
+ },
9517
+ {
9518
+ id: "svc_consultation",
9519
+ business_id: businessId,
9520
+ name: "Pharmacist Consultation",
9521
+ description: "15-minute one-on-one about medications, interactions, or symptoms.",
9522
+ duration_minutes: 15,
9523
+ price: "30.00",
9524
+ is_available: true
9525
+ },
9526
+ {
9527
+ id: "svc_prescription_refill",
9528
+ business_id: businessId,
9529
+ name: "Prescription Refill",
9530
+ description: "Upload your prescription; we prepare it for pickup or delivery same-day.",
9531
+ duration_minutes: 30,
9532
+ price: "0.00",
9533
+ is_available: true
9534
+ },
9535
+ {
9536
+ id: "svc_vaccination",
9537
+ business_id: businessId,
9538
+ name: "Vaccination (Flu, Tetanus)",
9539
+ description: "Walk-in or by appointment. Pharmacist-administered.",
9540
+ duration_minutes: 20,
9541
+ price: "80.00",
9542
+ is_available: true
9543
+ }
9544
+ ];
9545
+ for (const s of services) registry.services.put(s.id, s);
9546
+ const tags = [
9547
+ { id: "tag_otc", business_id: businessId, name: "OTC", slug: "otc", color: "#16a34a", sort_order: 0, usage_count: 11, created_at: ISO9, updated_at: ISO9 },
9548
+ { id: "tag_essential", business_id: businessId, name: "Essential", slug: "essential", color: "#2563eb", sort_order: 1, usage_count: 2, created_at: ISO9, updated_at: ISO9 },
9549
+ { id: "tag_prescription", business_id: businessId, name: "Prescription", slug: "prescription", color: "#dc2626", sort_order: 2, usage_count: 0, created_at: ISO9, updated_at: ISO9 }
9550
+ ];
9551
+ for (const t of tags) registry.tags.put(t.id, t);
9552
+ const medication = {
9553
+ id: "tax_medication",
9554
+ business_id: businessId,
9555
+ name: "Medication",
9556
+ slug: "medication",
9557
+ path: ["Health", "Medication"],
9558
+ attribute_template_ids: ["attr_active_ingredient", "attr_dosage"],
9559
+ created_at: ISO9,
9560
+ updated_at: ISO9
9561
+ };
9562
+ registry.taxonomies.put(medication.id, medication);
9563
+ const attrs = [
9564
+ {
9565
+ id: "attr_active_ingredient",
9566
+ business_id: businessId,
9567
+ namespace: "core",
9568
+ name: "Active ingredient",
9569
+ slug: "active-ingredient",
9570
+ attribute_type: "text",
9571
+ is_required: false,
9572
+ is_filterable: true,
9573
+ visibility: "public",
9574
+ display_order: 0,
9575
+ applies_to: "product",
9576
+ created_at: ISO9,
9577
+ updated_at: ISO9
9578
+ },
9579
+ {
9580
+ id: "attr_dosage",
9581
+ business_id: businessId,
9582
+ namespace: "core",
9583
+ name: "Dosage form",
9584
+ slug: "dosage-form",
9585
+ attribute_type: "select",
9586
+ options: ["tablet", "capsule", "syrup", "spray", "cream", "drops"],
9587
+ is_required: false,
9588
+ is_filterable: true,
9589
+ visibility: "public",
9590
+ display_order: 1,
9591
+ applies_to: "product",
9592
+ created_at: ISO9,
9593
+ updated_at: ISO9
9594
+ },
9595
+ {
9596
+ id: "attr_prescription_required",
9597
+ business_id: businessId,
9598
+ namespace: "core",
9599
+ name: "Prescription required",
9600
+ slug: "prescription-required",
9601
+ attribute_type: "boolean",
9602
+ is_required: false,
9603
+ is_filterable: true,
9604
+ visibility: "public",
9605
+ display_order: 2,
9606
+ applies_to: "product",
9607
+ created_at: ISO9,
9608
+ updated_at: ISO9
9609
+ }
9610
+ ];
9611
+ for (const a of attrs) registry.attributeDefs.put(a.id, a);
9612
+ const articles = [
9613
+ {
9614
+ id: "kb_prescription",
9615
+ business_id: businessId,
9616
+ title: "Prescription handling",
9617
+ slug: "prescription-handling",
9618
+ content: "Upload prescriptions through the prescription-refill service. Our pharmacist verifies before dispensing; same-day pickup or delivery within Accra.",
9619
+ category: "logistics",
9620
+ tags: ["prescription", "delivery"],
9621
+ created_at: ISO9,
9622
+ updated_at: ISO9
9623
+ },
9624
+ {
9625
+ id: "kb_returns",
9626
+ business_id: businessId,
9627
+ title: "Returns & exchanges",
9628
+ slug: "returns",
9629
+ content: "Sealed OTC products may be returned within 7 days with receipt. Opened products, prescriptions, and refrigerated items are non-returnable for safety reasons.",
9630
+ category: "policies",
9631
+ tags: ["returns"],
9632
+ created_at: ISO9,
9633
+ updated_at: ISO9
9634
+ },
9635
+ {
9636
+ id: "kb_consultation",
9637
+ business_id: businessId,
9638
+ title: "Pharmacist consultations",
9639
+ slug: "consultations",
9640
+ content: "15-minute pharmacist appointments cover medication review, side-effect questions, OTC selection, and symptom triage. Book through the services menu.",
9641
+ category: "services",
9642
+ tags: ["consultation"],
9643
+ created_at: ISO9,
9644
+ updated_at: ISO9
9645
+ }
9646
+ ];
9647
+ for (const a of articles) registry.knowledgeArticles.put(a.id, a);
9648
+ return { businessId };
9649
+ }
9650
+
9100
9651
  // src/mock/seeds/registry.ts
9101
9652
  var SEEDS = {
9102
9653
  default: seedDefault,
@@ -9106,7 +9657,8 @@ var SEEDS = {
9106
9657
  retail: seedRetail,
9107
9658
  services: seedServices,
9108
9659
  grocery: seedGrocery,
9109
- fashion: seedFashion
9660
+ fashion: seedFashion,
9661
+ pharmacy: seedPharmacy
9110
9662
  };
9111
9663
  function applySeed(registry, name) {
9112
9664
  const fn = SEEDS[name];
@@ -0,0 +1,113 @@
1
+ import { M as Money, a as CurrencyCode } from './product-DiX-HGkT.mjs';
2
+
3
+ type PaymentStatus = "initialized" | "pending" | "processing" | "authorized" | "captured" | "failed" | "cancelled" | "refunded" | "unknown" | "voided" | "requires_action" | "abandoned" | "reversed" | "disputed" | "refund_pending";
4
+ type PaymentProvider = "stripe" | "paystack" | "cellulant" | "mtnmomo" | "offline" | "mtn" | "vodafone" | "airtel" | "cash" | "manual";
5
+ type PaymentMethodType = "card" | "bank_transfer" | "cash" | {
6
+ mobile_money: {
7
+ provider: string;
8
+ phone_number: string;
9
+ };
10
+ } | {
11
+ ussd: {
12
+ provider: string;
13
+ };
14
+ } | {
15
+ bank: {
16
+ bank_code: string;
17
+ account_number: string;
18
+ account_name?: string;
19
+ bank_name?: string;
20
+ };
21
+ } | {
22
+ qr: {
23
+ provider: string;
24
+ };
25
+ } | {
26
+ wallet: {
27
+ provider: string;
28
+ };
29
+ } | {
30
+ crypto: {
31
+ currency: string;
32
+ };
33
+ } | {
34
+ custom: string;
35
+ };
36
+ interface AddressAuthorizationData {
37
+ address: string;
38
+ city: string;
39
+ state: string;
40
+ zip_code: string;
41
+ }
42
+ type AuthorizationType = "otp" | "pin" | "phone" | "birthday" | "address" | {
43
+ address: AddressAuthorizationData;
44
+ };
45
+ type PaymentProcessingState = "initial" | "preparing" | "processing" | "verifying" | "awaiting_authorization" | "success" | "error" | "timeout";
46
+ interface PaymentMethod {
47
+ type: PaymentMethodType;
48
+ provider?: string;
49
+ phone_number?: string;
50
+ card_last_four?: string;
51
+ custom_value?: string;
52
+ }
53
+ interface Payment {
54
+ id: string;
55
+ order_id: string;
56
+ business_id: string;
57
+ amount: Money;
58
+ currency: CurrencyCode;
59
+ payment_method: PaymentMethod;
60
+ status: PaymentStatus;
61
+ provider: PaymentProvider;
62
+ provider_reference?: string;
63
+ failure_reason?: string;
64
+ created_at: string;
65
+ updated_at: string;
66
+ }
67
+ interface InitializePaymentResult {
68
+ payment_id: string;
69
+ status: PaymentStatus;
70
+ redirect_url?: string;
71
+ authorization_url?: string;
72
+ reference: string;
73
+ provider: PaymentProvider;
74
+ }
75
+ interface PaymentResponse {
76
+ method: string;
77
+ provider: string;
78
+ requires_action: boolean;
79
+ public_key?: string;
80
+ client_secret?: string;
81
+ access_code?: string;
82
+ redirect_url?: string;
83
+ transaction_id?: string;
84
+ order_id?: string;
85
+ reference?: string;
86
+ metadata?: Record<string, unknown>;
87
+ instructions?: string;
88
+ display_text?: string;
89
+ requires_authorization?: boolean;
90
+ authorization_type?: AuthorizationType;
91
+ provider_payment_id?: string;
92
+ }
93
+ interface PaymentStatusResponse {
94
+ status: PaymentStatus;
95
+ paid: boolean;
96
+ amount: Money;
97
+ currency: string;
98
+ reference?: string;
99
+ message: string;
100
+ }
101
+ interface PaymentErrorDetails {
102
+ code: string;
103
+ message: string;
104
+ recoverable: boolean;
105
+ technical?: string;
106
+ }
107
+ interface SubmitAuthorizationInput {
108
+ reference: string;
109
+ auth_type: AuthorizationType;
110
+ value: string;
111
+ }
112
+
113
+ export type { AddressAuthorizationData as A, InitializePaymentResult as I, PaymentStatus as P, SubmitAuthorizationInput as S, PaymentProvider as a, PaymentMethodType as b, AuthorizationType as c, PaymentProcessingState as d, PaymentMethod as e, Payment as f, PaymentResponse as g, PaymentStatusResponse as h, PaymentErrorDetails as i };