-- Seed one purchasable Tracecoin package per role so the purchase flow
-- (CreditsPage.tsx -> GET /api/packages, filtered client-side by
-- role_key) has something to show instead of "No packages available for
-- your role." Placeholder pricing per user instruction: ₹250 flat
-- (25000 paise — pricing_packages.price_inr is paise despite the name,
-- see apps/payments/src/payu.rs::paise_to_rupee_string) for 100
-- Tracecoins, across every role. Adjust via the existing admin API
-- (POST/PATCH /api/packages) once real pricing is decided.
INSERT INTO pricing_packages (name, role_key, package_type, tracecoins_amount, price_inr, description, is_active)
SELECT 'Starter Pack', role_key, 'TRACECOIN_BUNDLE', 100, 25000, '100 Tracecoins', true
FROM (VALUES
    ('COMPANY'),
    ('CUSTOMER'),
    ('JOB_SEEKER'),
    ('PHOTOGRAPHER'),
    ('MAKEUP_ARTIST'),
    ('TUTOR'),
    ('DEVELOPER'),
    ('VIDEO_EDITOR'),
    ('GRAPHIC_DESIGNER'),
    ('SOCIAL_MEDIA_MANAGER'),
    ('FITNESS_TRAINER'),
    ('CATERING_SERVICES'),
    ('UGC_CONTENT_CREATOR')
) AS roles(role_key)
WHERE NOT EXISTS (
    SELECT 1 FROM pricing_packages p WHERE p.role_key = roles.role_key
);
