USE nirvaan;

/* Shop settings */
INSERT INTO settings (skey,sval,stype,sgroup,label) VALUES
 ('shipping_paise','6000','int','shop','Flat delivery charge'),
 ('free_shipping_above_paise','50000','int','shop','Order value above which delivery is free'),
 ('rx_product_validity_days','90','int','shop','How long a prescription remains valid for reordering')
ON DUPLICATE KEY UPDATE label = VALUES(label);

/* Redirect lookups run on every 404; 404 aggregation runs on the redirects screen */
ALTER TABLE seo_redirects ADD INDEX idx_redirect_active (is_active, from_path);
ALTER TABLE products      ADD INDEX idx_prod_active (is_active, category);
ALTER TABLE orders        ADD INDEX idx_order_status (status, created_at);
ALTER TABLE cms_media     ADD INDEX idx_media_created (created_at);

/* Starter catalog. Copy is deliberately claim-free — the DMR gate rejects
   anything stronger, and these are the phrasings that pass. */
INSERT INTO products (slug,name,category,short_desc,body_html,mrp_paise,price_paise,gst_pct,hsn,stock_qty,rx_required,is_active) VALUES
('condoms-ultra-thin-pack-10','Ultra-thin condoms, pack of 10','Protection',
 'Lubricated, electronically tested, plain outer packaging.',
 '<p>Standard-fit latex condoms, lubricated and electronically tested to IS 3428.</p><p>Ships in a plain outer box with no branding and no sender name on the label.</p><h3>Using them well</h3><ul><li>Check the expiry date on the foil.</li><li>Open with your fingers, not your teeth.</li><li>One per act — never two at once, which increases friction and the chance of tearing.</li></ul>',
 30000,21900,12.00,'40141010',200,0,1),

('water-based-lubricant-100ml','Water-based lubricant, 100 ml','Comfort',
 'Fragrance-free, condom-safe, no added colour.',
 '<p>A plain water-based lubricant with no fragrance or added colour. Safe with latex condoms and with silicone toys, unlike oil-based products.</p><p>Discomfort during sex is common and has many causes. If it persists, it is worth <a href="/user/start.php">raising with a doctor</a> rather than managing indefinitely.</p>',
 45000,34900,18.00,'34029099',150,0,1),

('at-home-sti-test-kit','At-home STI sample kit','Testing',
 'Collect at home, post to a NABL-accredited lab, results in the app.',
 '<p>A collection kit you use at home and post back in the prepaid envelope provided. The sample is processed by a NABL-accredited laboratory and the result appears in your account.</p><p>A result is a starting point, not an answer on its own. A doctor on the panel can talk you through what it means and what, if anything, comes next.</p><p>Ships in plain packaging. The return envelope carries a lab address, not ours.</p>',
 180000,149900,18.00,'38220090',60,0,1),

('sertraline-50mg-strip-10','Sertraline 50 mg, strip of 10','Prescription medicines',
 'Prescription only. Dispensed against a valid prescription issued on this platform.',
 '<p>Dispensed only against a current prescription issued by a Registered Medical Practitioner on this platform within the last 90 days.</p><p>Do not start, stop or change the dose of this medicine on your own. If you are having side effects, <a href="/user/consult.php">speak to your prescriber</a> before changing anything.</p>',
 22000,19900,12.00,'30049099',80,1,1)
ON DUPLICATE KEY UPDATE name = VALUES(name);

/* Shop in the footer */
INSERT INTO cms_menu (location,label,url,sort_order) VALUES
 ('header','Shop','/shop/',35),
 ('footer_1','Shop','/shop/',50)
ON DUPLICATE KEY UPDATE url = VALUES(url);

INSERT INTO seo_meta (entity_type,entity_id,route,meta_title,meta_desc,robots,answer_summary,sitemap_priority,sitemap_freq)
VALUES ('page',0,'/shop/','Sexual wellness products, discreetly delivered — Nirvaan',
 'Plain packaging, no sender name on the label, neutral descriptor on your statement. Prescription medicines require a current prescription from a doctor on our panel.',
 'index,follow',
 'Nirvaan ships sexual wellness products across India in plain packaging with no sender name. Prescription medicines are dispensed only against a prescription issued on the platform within the last 90 days.',
 0.7,'weekly')
ON DUPLICATE KEY UPDATE meta_title = VALUES(meta_title);
