@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
@@ -1,5 +1,6 @@
1
- export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, l as CheckoutOperations, l as CheckoutService, a6 as CimplifyElement, a5 as CimplifyElements, aa as ELEMENT_TYPES, a9 as EVENT_TYPES, ae as ElementEventType, ac as ElementOptions, ad as ElementType, ab as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q as LiteService, a8 as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, p as SchedulingService, a7 as createElements } from './client-C5LcbNxL.mjs';
2
- import './payment-4JSLNTVM.mjs';
1
+ export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, l as CheckoutOperations, l as CheckoutService, a6 as CimplifyElement, a5 as CimplifyElements, aa as ELEMENT_TYPES, a9 as EVENT_TYPES, ae as ElementEventType, ac as ElementOptions, ad as ElementType, ab as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q as LiteService, a8 as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, p as SchedulingService, a7 as createElements } from './client-CDUY-6nC.mjs';
2
+ import './product-DiX-HGkT.mjs';
3
+ import './payment-Bse2XJ-c.mjs';
3
4
 
4
5
  declare function generateIdempotencyKey(prefix?: string): string;
5
6
 
@@ -1,5 +1,6 @@
1
- export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, l as CheckoutOperations, l as CheckoutService, a6 as CimplifyElement, a5 as CimplifyElements, aa as ELEMENT_TYPES, a9 as EVENT_TYPES, ae as ElementEventType, ac as ElementOptions, ad as ElementType, ab as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q as LiteService, a8 as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, p as SchedulingService, a7 as createElements } from './client-Bsd4Vi_y.js';
2
- import './payment-4JSLNTVM.js';
1
+ export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, l as CheckoutOperations, l as CheckoutService, a6 as CimplifyElement, a5 as CimplifyElements, aa as ELEMENT_TYPES, a9 as EVENT_TYPES, ae as ElementEventType, ac as ElementOptions, ad as ElementType, ab as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q as LiteService, a8 as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, p as SchedulingService, a7 as createElements } from './client-aZInadOY.js';
2
+ import './product-DiX-HGkT.js';
3
+ import './payment-JcNqOf_T.js';
3
4
 
4
5
  declare function generateIdempotencyKey(prefix?: string): string;
5
6
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkLLZZMHSU_js = require('./chunk-LLZZMHSU.js');
4
- var chunkB2MJQ7SU_js = require('./chunk-B2MJQ7SU.js');
4
+ var chunkCJN5SPXN_js = require('./chunk-CJN5SPXN.js');
5
5
  var zod = require('zod');
6
6
 
7
7
  var cimplifyRegistry = zod.z.registry();
@@ -595,7 +595,7 @@ async function toForwardedRequest(input, init) {
595
595
  };
596
596
  }
597
597
  function createTestClient(options = {}) {
598
- const mock = chunkB2MJQ7SU_js.createMockApp(options);
598
+ const mock = chunkCJN5SPXN_js.createMockApp(options);
599
599
  let sessionToken;
600
600
  const fetchImpl = async (input, init) => {
601
601
  const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
@@ -3786,6 +3786,10 @@ function toApiProduct(p, ctx) {
3786
3786
  duration_unit: p.duration_unit,
3787
3787
  duration_minutes: p.duration_minutes,
3788
3788
  billing_plans: p.billing_plans,
3789
+ /** Per-product customer inputs (prescription upload, consent
3790
+ * signature, etc.). The Rust backend emits this on ProductView; the
3791
+ * SDK's React components branch on its presence to render inputs. */
3792
+ input_fields: p.input_fields ?? [],
3789
3793
  created_at: p.created_at,
3790
3794
  updated_at: p.updated_at,
3791
3795
  metadata: {
@@ -9031,6 +9035,553 @@ function seedFashion(registry) {
9031
9035
  return { businessId };
9032
9036
  }
9033
9037
 
9038
+ // src/mock/seeds/pharmacy.ts
9039
+ var ISO9 = "2026-01-01T00:00:00.000Z";
9040
+ var photoFor6 = (slug) => seedImage("pharmacy", slug);
9041
+ function seedPharmacy(registry) {
9042
+ const businessId = "bus_wellspring_pharmacy";
9043
+ const business = {
9044
+ id: businessId,
9045
+ name: "Wellspring Pharmacy",
9046
+ handle: "wellspring",
9047
+ business_type: "retail",
9048
+ email: "care@wellspringpharmacy.test",
9049
+ default_currency: "GHS",
9050
+ default_phone: "+233244778899",
9051
+ default_address: "5 Liberation Road, Ridge, Accra",
9052
+ default_offers_table_service: false,
9053
+ default_accepts_online_orders: true,
9054
+ image: photoFor6("business-hero"),
9055
+ status: "active",
9056
+ created_at: ISO9,
9057
+ updated_at: ISO9,
9058
+ created_by: "seed",
9059
+ preferences: {
9060
+ theme: "clinical",
9061
+ tagline: "Trusted care, delivered same-day",
9062
+ checkout: { allow_guest: true }
9063
+ },
9064
+ is_online_only: false,
9065
+ enabled_payment_types: ["card", "mobile_money", "cash"],
9066
+ default_location_settings: {},
9067
+ country_code: "GH",
9068
+ timezone: "Africa/Accra"
9069
+ };
9070
+ registry.businesses.put(businessId, business);
9071
+ const categories = [
9072
+ { slug: "pain-relief", name: "Pain Relief" },
9073
+ { slug: "cold-flu", name: "Cold & Flu" },
9074
+ { slug: "vitamins", name: "Vitamins & Supplements" },
9075
+ { slug: "first-aid", name: "First Aid" },
9076
+ { slug: "personal-care", name: "Personal Care" },
9077
+ { slug: "devices", name: "Medical Devices" },
9078
+ { slug: "baby", name: "Baby & Mother" }
9079
+ ];
9080
+ const catIds = /* @__PURE__ */ new Map();
9081
+ for (const c of categories) {
9082
+ const id = `cat_${c.slug}`;
9083
+ catIds.set(c.slug, id);
9084
+ const cat = {
9085
+ id,
9086
+ business_id: businessId,
9087
+ name: c.name,
9088
+ slug: c.slug,
9089
+ description: `Wellspring \u2014 ${c.name}`,
9090
+ product_ids: [],
9091
+ display_order: 0,
9092
+ is_active: true,
9093
+ created_at: ISO9,
9094
+ updated_at: ISO9
9095
+ };
9096
+ registry.categories.put(id, cat);
9097
+ }
9098
+ function field(productSlug, f) {
9099
+ return {
9100
+ id: f.id ?? `fld_${productSlug}_${f.slug}`,
9101
+ product_id: `prod_${productSlug}`,
9102
+ ...f
9103
+ };
9104
+ }
9105
+ const products = [
9106
+ // Pain Relief
9107
+ {
9108
+ slug: "paracetamol",
9109
+ name: "Paracetamol 500mg (24 tablets)",
9110
+ price: "12.00",
9111
+ category: "pain-relief",
9112
+ description: "Fever and mild-to-moderate pain. Adults and children over 12.",
9113
+ tags: ["otc", "analgesic"],
9114
+ inputs: [
9115
+ field("paracetamol", {
9116
+ slug: "age_confirmation",
9117
+ name: "Age confirmation",
9118
+ field_type: "checkbox",
9119
+ is_required: true,
9120
+ display_order: 0,
9121
+ help_text: "I confirm this product is for someone aged 12 or over."
9122
+ })
9123
+ ]
9124
+ },
9125
+ { 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"] },
9126
+ { 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"] },
9127
+ { slug: "allergy-relief", name: "Cetirizine 10mg (10 tablets)", price: "22.00", category: "pain-relief", description: "Non-drowsy antihistamine for seasonal allergies.", tags: ["otc", "antihistamine"] },
9128
+ // Cold & Flu
9129
+ { 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"] },
9130
+ { slug: "throat-lozenges", name: "Honey-Lemon Throat Lozenges (24)", price: "18.00", category: "cold-flu", description: "Soothes sore throat and irritation.", tags: ["otc", "lozenge"] },
9131
+ { slug: "decongestant", name: "Nasal Decongestant Spray (10ml)", price: "28.00", category: "cold-flu", description: "Fast-acting relief for blocked nasal passages.", tags: ["otc", "spray"] },
9132
+ // Vitamins & Supplements
9133
+ { 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"] },
9134
+ { slug: "vitamin-c", name: "Vitamin C 1000mg (90 tablets)", price: "65.00", category: "vitamins", description: "Immune-support antioxidant. Time-released.", tags: ["supplement", "immune"] },
9135
+ { 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"] },
9136
+ { 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"] },
9137
+ { slug: "probiotics", name: "Probiotic 10-Strain (30 capsules)", price: "95.00", category: "vitamins", description: "Digestive and immune support.", tags: ["supplement", "digestive"] },
9138
+ // First Aid
9139
+ { 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"] },
9140
+ { slug: "plasters", name: "Assorted Plasters (40 pack)", price: "22.00", category: "first-aid", description: "Waterproof adhesive bandages in five sizes.", tags: ["first-aid"] },
9141
+ { slug: "antiseptic", name: "Antiseptic Cream (30g)", price: "18.00", category: "first-aid", description: "For cuts, grazes, and minor skin infections.", tags: ["first-aid", "cream"] },
9142
+ { 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"] },
9143
+ // Personal Care
9144
+ { 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"] },
9145
+ { slug: "face-mask", name: "Surgical Face Masks (50 pack)", price: "45.00", category: "personal-care", description: "3-ply earloop masks. Disposable.", tags: ["hygiene", "ppe"] },
9146
+ { 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"] },
9147
+ // Medical Devices
9148
+ { slug: "thermometer", name: "Digital Thermometer", price: "65.00", category: "devices", description: "Fast oral / underarm reading in 10 seconds. Auto-shutoff.", tags: ["device", "essential"] },
9149
+ {
9150
+ slug: "blood-pressure-monitor",
9151
+ name: "Automatic BP Monitor",
9152
+ price: "320.00",
9153
+ category: "devices",
9154
+ description: "Upper-arm cuff with memory for two users. Irregular heartbeat detection.",
9155
+ tags: ["device", "premium"],
9156
+ inputs: [
9157
+ field("blood-pressure-monitor", {
9158
+ slug: "arm_size",
9159
+ name: "Arm circumference",
9160
+ field_type: "select",
9161
+ options: ["Standard (22\u201332 cm)", "Large (32\u201342 cm)"],
9162
+ is_required: true,
9163
+ display_order: 0,
9164
+ help_text: "Pick the cuff that fits \u2014 wrong size gives inaccurate readings."
9165
+ })
9166
+ ]
9167
+ },
9168
+ { 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"] },
9169
+ { slug: "pulse-oximeter", name: "Fingertip Pulse Oximeter", price: "145.00", category: "devices", description: "SpO2 + heart-rate reading in under 10 seconds.", tags: ["device"] },
9170
+ // Baby & Mother
9171
+ {
9172
+ slug: "baby-formula",
9173
+ name: "Infant Formula Stage 1 (400g)",
9174
+ price: "150.00",
9175
+ category: "baby",
9176
+ description: "0\u20136 months. Iron-fortified, with prebiotics.",
9177
+ tags: ["baby", "nutrition"],
9178
+ inputs: [
9179
+ field("baby-formula", {
9180
+ slug: "baby_dob",
9181
+ name: "Baby's date of birth",
9182
+ field_type: "date",
9183
+ is_required: true,
9184
+ display_order: 0,
9185
+ help_text: "Confirms stage 1 is the right formula for your baby's age."
9186
+ }),
9187
+ field("baby-formula", {
9188
+ slug: "allergies",
9189
+ name: "Known allergies or intolerances",
9190
+ field_type: "textarea",
9191
+ is_required: false,
9192
+ display_order: 1,
9193
+ placeholder: "e.g. lactose, soy. Leave blank if none.",
9194
+ semantic_kind: "allergen"
9195
+ })
9196
+ ]
9197
+ },
9198
+ { slug: "baby-wipes", name: "Sensitive Baby Wipes (72 pack)", price: "28.00", category: "baby", description: "Alcohol-free, fragrance-free. Dermatologist-tested.", tags: ["baby", "hygiene"] },
9199
+ // ── Prescription medications (Rx; require a verified prescription) ─
9200
+ {
9201
+ slug: "amoxicillin-rx",
9202
+ name: "Amoxicillin 500mg (Rx)",
9203
+ price: "65.00",
9204
+ category: "pain-relief",
9205
+ description: "Broad-spectrum antibiotic. Prescription required \u2014 our pharmacist will verify before dispensing.",
9206
+ tags: ["prescription", "antibiotic"],
9207
+ requiresPrescription: true,
9208
+ inputs: [
9209
+ field("amoxicillin-rx", {
9210
+ slug: "prescription_upload",
9211
+ name: "Upload prescription",
9212
+ field_type: "file",
9213
+ is_required: true,
9214
+ display_order: 0,
9215
+ help_text: "PDF or photo of your doctor's prescription (max 10 MB).",
9216
+ validation: { accepted_formats: ["pdf", "jpg", "jpeg", "png", "heic"], max_size_mb: 10 }
9217
+ }),
9218
+ field("amoxicillin-rx", {
9219
+ slug: "patient_dob",
9220
+ name: "Patient date of birth",
9221
+ field_type: "date",
9222
+ is_required: true,
9223
+ display_order: 1
9224
+ }),
9225
+ field("amoxicillin-rx", {
9226
+ slug: "consent",
9227
+ name: "I confirm this prescription is genuine and issued for the named patient",
9228
+ field_type: "checkbox",
9229
+ is_required: true,
9230
+ display_order: 2,
9231
+ semantic_kind: "consent"
9232
+ })
9233
+ ]
9234
+ },
9235
+ {
9236
+ slug: "insulin-rx",
9237
+ name: "Insulin Glargine 100u/ml (Rx)",
9238
+ price: "240.00",
9239
+ category: "devices",
9240
+ description: "Long-acting basal insulin. Cold-chain delivery; prescription required.",
9241
+ tags: ["prescription", "diabetes", "cold-chain"],
9242
+ requiresPrescription: true,
9243
+ inputs: [
9244
+ field("insulin-rx", {
9245
+ slug: "prescription_upload",
9246
+ name: "Upload prescription",
9247
+ field_type: "file",
9248
+ is_required: true,
9249
+ display_order: 0,
9250
+ help_text: "PDF or photo of your doctor's prescription (max 10 MB).",
9251
+ validation: { accepted_formats: ["pdf", "jpg", "jpeg", "png", "heic"], max_size_mb: 10 }
9252
+ }),
9253
+ field("insulin-rx", {
9254
+ slug: "delivery_temp_acknowledgement",
9255
+ name: "I'll be available to receive a cold-chain delivery",
9256
+ field_type: "checkbox",
9257
+ is_required: true,
9258
+ display_order: 1,
9259
+ help_text: "Insulin must be refrigerated. Delivery driver will hand over directly \u2014 not leave at door.",
9260
+ semantic_kind: "consent"
9261
+ })
9262
+ ]
9263
+ },
9264
+ {
9265
+ slug: "vaccination-consent",
9266
+ name: "Flu Shot \u2014 At-Pharmacy",
9267
+ price: "80.00",
9268
+ category: "personal-care",
9269
+ description: "Pharmacist-administered seasonal influenza vaccine. Walk-in or book a slot.",
9270
+ tags: ["service", "vaccination"],
9271
+ inputs: [
9272
+ field("vaccination-consent", {
9273
+ slug: "patient_name",
9274
+ name: "Patient name",
9275
+ field_type: "text",
9276
+ is_required: true,
9277
+ display_order: 0
9278
+ }),
9279
+ field("vaccination-consent", {
9280
+ slug: "patient_dob",
9281
+ name: "Date of birth",
9282
+ field_type: "date",
9283
+ is_required: true,
9284
+ display_order: 1
9285
+ }),
9286
+ field("vaccination-consent", {
9287
+ slug: "allergies",
9288
+ name: "Known allergies or reactions to past vaccines",
9289
+ field_type: "textarea",
9290
+ is_required: false,
9291
+ display_order: 2,
9292
+ placeholder: "Egg, latex, prior vaccine reactions, etc. Leave blank if none.",
9293
+ semantic_kind: "allergen"
9294
+ }),
9295
+ field("vaccination-consent", {
9296
+ slug: "consent_signature",
9297
+ name: "Signed consent",
9298
+ field_type: "signature",
9299
+ is_required: true,
9300
+ display_order: 3,
9301
+ help_text: "Required by our administering pharmacist before vaccination.",
9302
+ semantic_kind: "consent"
9303
+ })
9304
+ ]
9305
+ }
9306
+ ];
9307
+ for (const p of products) {
9308
+ const id = `prod_${p.slug}`;
9309
+ const catId = catIds.get(p.category);
9310
+ const product = {
9311
+ id,
9312
+ business_id: businessId,
9313
+ name: p.name,
9314
+ slug: p.slug,
9315
+ description: p.description,
9316
+ product_type: "product",
9317
+ base_price: p.price,
9318
+ currency: "GHS",
9319
+ image: photoFor6(p.slug),
9320
+ images: [photoFor6(p.slug)],
9321
+ is_available: true,
9322
+ category_ids: [catId],
9323
+ collection_ids: [],
9324
+ add_on_ids: [],
9325
+ variant_ids: [],
9326
+ tags: p.tags ?? [],
9327
+ input_fields: p.inputs,
9328
+ metadata: p.requiresPrescription ? { requires_prescription: true } : void 0,
9329
+ created_at: ISO9,
9330
+ updated_at: ISO9
9331
+ };
9332
+ registry.products.put(id, product);
9333
+ const cat = registry.categories.get(catId);
9334
+ cat.product_ids.push(id);
9335
+ registry.categories.put(catId, cat);
9336
+ }
9337
+ const essentials = {
9338
+ id: "col_essentials",
9339
+ business_id: businessId,
9340
+ name: "Home Essentials",
9341
+ slug: "essentials",
9342
+ description: "Stock up your medicine cabinet.",
9343
+ product_ids: [
9344
+ "prod_paracetamol",
9345
+ "prod_first-aid-kit",
9346
+ "prod_thermometer",
9347
+ "prod_hand-sanitizer",
9348
+ "prod_multivitamin"
9349
+ ],
9350
+ is_active: true,
9351
+ created_at: ISO9,
9352
+ updated_at: ISO9
9353
+ };
9354
+ registry.collections.put(essentials.id, essentials);
9355
+ for (const pid of essentials.product_ids) {
9356
+ const p = registry.products.get(pid);
9357
+ if (p) {
9358
+ p.collection_ids.push(essentials.id);
9359
+ registry.products.put(pid, p);
9360
+ }
9361
+ }
9362
+ const packAxis = {
9363
+ id: "axis_pack_size",
9364
+ business_id: businessId,
9365
+ product_id: "prod_paracetamol",
9366
+ name: "Pack size",
9367
+ display_order: 0,
9368
+ affects_recipe: false,
9369
+ values: [
9370
+ { id: "axv_pack_24", name: "24 tablets", display: 0 },
9371
+ { id: "axv_pack_48", name: "48 tablets", display: 1 },
9372
+ { id: "axv_pack_100", name: "100 tablets (family)", display: 2 }
9373
+ ].map((v) => ({
9374
+ id: v.id,
9375
+ business_id: businessId,
9376
+ axis_id: "axis_pack_size",
9377
+ name: v.name,
9378
+ display_order: v.display,
9379
+ created_at: ISO9,
9380
+ updated_at: ISO9
9381
+ })),
9382
+ created_at: ISO9,
9383
+ updated_at: ISO9
9384
+ };
9385
+ registry.variantAxes.put(packAxis.id, packAxis);
9386
+ const packAdj = { pack_24: "0.00", pack_48: "8.00", pack_100: "18.00" };
9387
+ const paracetamolVariantIds = [];
9388
+ let firstVariant = true;
9389
+ for (const pk of packAxis.values) {
9390
+ const key = pk.id.replace("axv_pack_", "pack_");
9391
+ const id = `var_paracetamol_${key.replace("pack_", "")}`;
9392
+ const variant = {
9393
+ id,
9394
+ product_id: "prod_paracetamol",
9395
+ business_id: businessId,
9396
+ name: pk.name,
9397
+ sku: `PCM-${key.toUpperCase()}`,
9398
+ price_adjustment: packAdj[key] ?? "0.00",
9399
+ component_multiplier: "1.00",
9400
+ is_default: firstVariant,
9401
+ is_active: true,
9402
+ axis_value_ids: [pk.id],
9403
+ created_at: ISO9,
9404
+ updated_at: ISO9
9405
+ };
9406
+ registry.variants.put(id, variant);
9407
+ paracetamolVariantIds.push(id);
9408
+ firstVariant = false;
9409
+ }
9410
+ const paracetamol = registry.products.get("prod_paracetamol");
9411
+ if (paracetamol) {
9412
+ paracetamol.variant_ids = paracetamolVariantIds;
9413
+ registry.products.put(paracetamol.id, paracetamol);
9414
+ }
9415
+ const formAddOn = {
9416
+ id: "addon_form",
9417
+ business_id: businessId,
9418
+ name: "Format",
9419
+ is_multiple_allowed: false,
9420
+ is_required: false,
9421
+ is_mutually_exclusive: true,
9422
+ min_selections: 0,
9423
+ max_selections: 1,
9424
+ created_at: ISO9,
9425
+ updated_at: ISO9,
9426
+ options: [
9427
+ { 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 },
9428
+ { 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 }
9429
+ ]
9430
+ };
9431
+ registry.addOns.put(formAddOn.id, formAddOn);
9432
+ const medProductIds = ["prod_paracetamol", "prod_ibuprofen", "prod_aspirin", "prod_allergy-relief"];
9433
+ for (const pid of medProductIds) {
9434
+ registry.productAddOns.put(`${pid}:${formAddOn.id}`, { product_id: pid, add_on_id: formAddOn.id });
9435
+ const p = registry.products.get(pid);
9436
+ if (p) {
9437
+ p.add_on_ids.push(formAddOn.id);
9438
+ registry.products.put(pid, p);
9439
+ }
9440
+ }
9441
+ const services = [
9442
+ {
9443
+ id: "svc_bp_check",
9444
+ business_id: businessId,
9445
+ name: "Blood Pressure Check",
9446
+ description: "Free in-store BP reading with our pharmacist.",
9447
+ duration_minutes: 15,
9448
+ price: "0.00",
9449
+ is_available: true
9450
+ },
9451
+ {
9452
+ id: "svc_consultation",
9453
+ business_id: businessId,
9454
+ name: "Pharmacist Consultation",
9455
+ description: "15-minute one-on-one about medications, interactions, or symptoms.",
9456
+ duration_minutes: 15,
9457
+ price: "30.00",
9458
+ is_available: true
9459
+ },
9460
+ {
9461
+ id: "svc_prescription_refill",
9462
+ business_id: businessId,
9463
+ name: "Prescription Refill",
9464
+ description: "Upload your prescription; we prepare it for pickup or delivery same-day.",
9465
+ duration_minutes: 30,
9466
+ price: "0.00",
9467
+ is_available: true
9468
+ },
9469
+ {
9470
+ id: "svc_vaccination",
9471
+ business_id: businessId,
9472
+ name: "Vaccination (Flu, Tetanus)",
9473
+ description: "Walk-in or by appointment. Pharmacist-administered.",
9474
+ duration_minutes: 20,
9475
+ price: "80.00",
9476
+ is_available: true
9477
+ }
9478
+ ];
9479
+ for (const s of services) registry.services.put(s.id, s);
9480
+ const tags = [
9481
+ { id: "tag_otc", business_id: businessId, name: "OTC", slug: "otc", color: "#16a34a", sort_order: 0, usage_count: 11, created_at: ISO9, updated_at: ISO9 },
9482
+ { id: "tag_essential", business_id: businessId, name: "Essential", slug: "essential", color: "#2563eb", sort_order: 1, usage_count: 2, created_at: ISO9, updated_at: ISO9 },
9483
+ { id: "tag_prescription", business_id: businessId, name: "Prescription", slug: "prescription", color: "#dc2626", sort_order: 2, usage_count: 0, created_at: ISO9, updated_at: ISO9 }
9484
+ ];
9485
+ for (const t of tags) registry.tags.put(t.id, t);
9486
+ const medication = {
9487
+ id: "tax_medication",
9488
+ business_id: businessId,
9489
+ name: "Medication",
9490
+ slug: "medication",
9491
+ path: ["Health", "Medication"],
9492
+ attribute_template_ids: ["attr_active_ingredient", "attr_dosage"],
9493
+ created_at: ISO9,
9494
+ updated_at: ISO9
9495
+ };
9496
+ registry.taxonomies.put(medication.id, medication);
9497
+ const attrs = [
9498
+ {
9499
+ id: "attr_active_ingredient",
9500
+ business_id: businessId,
9501
+ namespace: "core",
9502
+ name: "Active ingredient",
9503
+ slug: "active-ingredient",
9504
+ attribute_type: "text",
9505
+ is_required: false,
9506
+ is_filterable: true,
9507
+ visibility: "public",
9508
+ display_order: 0,
9509
+ applies_to: "product",
9510
+ created_at: ISO9,
9511
+ updated_at: ISO9
9512
+ },
9513
+ {
9514
+ id: "attr_dosage",
9515
+ business_id: businessId,
9516
+ namespace: "core",
9517
+ name: "Dosage form",
9518
+ slug: "dosage-form",
9519
+ attribute_type: "select",
9520
+ options: ["tablet", "capsule", "syrup", "spray", "cream", "drops"],
9521
+ is_required: false,
9522
+ is_filterable: true,
9523
+ visibility: "public",
9524
+ display_order: 1,
9525
+ applies_to: "product",
9526
+ created_at: ISO9,
9527
+ updated_at: ISO9
9528
+ },
9529
+ {
9530
+ id: "attr_prescription_required",
9531
+ business_id: businessId,
9532
+ namespace: "core",
9533
+ name: "Prescription required",
9534
+ slug: "prescription-required",
9535
+ attribute_type: "boolean",
9536
+ is_required: false,
9537
+ is_filterable: true,
9538
+ visibility: "public",
9539
+ display_order: 2,
9540
+ applies_to: "product",
9541
+ created_at: ISO9,
9542
+ updated_at: ISO9
9543
+ }
9544
+ ];
9545
+ for (const a of attrs) registry.attributeDefs.put(a.id, a);
9546
+ const articles = [
9547
+ {
9548
+ id: "kb_prescription",
9549
+ business_id: businessId,
9550
+ title: "Prescription handling",
9551
+ slug: "prescription-handling",
9552
+ content: "Upload prescriptions through the prescription-refill service. Our pharmacist verifies before dispensing; same-day pickup or delivery within Accra.",
9553
+ category: "logistics",
9554
+ tags: ["prescription", "delivery"],
9555
+ created_at: ISO9,
9556
+ updated_at: ISO9
9557
+ },
9558
+ {
9559
+ id: "kb_returns",
9560
+ business_id: businessId,
9561
+ title: "Returns & exchanges",
9562
+ slug: "returns",
9563
+ content: "Sealed OTC products may be returned within 7 days with receipt. Opened products, prescriptions, and refrigerated items are non-returnable for safety reasons.",
9564
+ category: "policies",
9565
+ tags: ["returns"],
9566
+ created_at: ISO9,
9567
+ updated_at: ISO9
9568
+ },
9569
+ {
9570
+ id: "kb_consultation",
9571
+ business_id: businessId,
9572
+ title: "Pharmacist consultations",
9573
+ slug: "consultations",
9574
+ content: "15-minute pharmacist appointments cover medication review, side-effect questions, OTC selection, and symptom triage. Book through the services menu.",
9575
+ category: "services",
9576
+ tags: ["consultation"],
9577
+ created_at: ISO9,
9578
+ updated_at: ISO9
9579
+ }
9580
+ ];
9581
+ for (const a of articles) registry.knowledgeArticles.put(a.id, a);
9582
+ return { businessId };
9583
+ }
9584
+
9034
9585
  // src/mock/seeds/registry.ts
9035
9586
  var SEEDS = {
9036
9587
  default: seedDefault,
@@ -9040,7 +9591,8 @@ var SEEDS = {
9040
9591
  retail: seedRetail,
9041
9592
  services: seedServices,
9042
9593
  grocery: seedGrocery,
9043
- fashion: seedFashion
9594
+ fashion: seedFashion,
9595
+ pharmacy: seedPharmacy
9044
9596
  };
9045
9597
  function applySeed(registry, name) {
9046
9598
  const fn = SEEDS[name];