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