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