-- default starter seed (generic store sample)
INSERT OR IGNORE INTO catalog_services (name, price, duration_min, status) VALUES
  ('基础服务', 298, 60, 'active'),
  ('特色服务', 168, 45, 'active');

INSERT OR IGNORE INTO catalog_products (name, cost, sale_price, unit, threshold, status) VALUES
  ('商品A', 30, 98, '件', 20, 'active'),
  ('商品B', 80, 198, '件', 10, 'active');

INSERT OR IGNORE INTO inv_items (key, stock_qty, unit, cost, sale_price, low_stock_threshold, status) VALUES
  ('商品A', 50, '件', 30, 98, 20, 'active'),
  ('商品B', 30, '件', 80, 198, 10, 'active');

INSERT OR IGNORE INTO staff_staff (id, name, phone, join_date, base_salary, fields_json, status) VALUES
  ('S001', '张师傅', '13800138001', '2024-01-01', 5000, '{"skills":"基础服务,特色服务"}', 'active'),
  ('S002', '李师傅', '13800138002', '2024-02-01', 4800, '{"skills":"特色服务"}', 'active');

INSERT OR IGNORE INTO staff_commission_rules (staff_id, kind, target_name, ratio) VALUES
  ('S001', 'service', '基础服务', 0.15),
  ('S002', 'service', '特色服务', 0.12);

INSERT OR IGNORE INTO staff_schedules (staff_id, date, status, slots_json) VALUES
  ('S001', date('now'), 'work', '["09:00-12:00","14:00-18:00"]'),
  ('S002', date('now'), 'work', '["10:00-19:00"]');

INSERT OR IGNORE INTO store_members (id, name, phone, birthday, tags_json, fields_json, status) VALUES
  ('M001', '王芳', '13900139000', '1990-03-21', '["VIP"]', '{"preference":"周末到店","notes":"无特殊禁忌"}', 'active');

INSERT OR IGNORE INTO store_wallet (member_id, balance, total_recharge, total_consume) VALUES
  ('M001', 5000, 5000, 0);

INSERT OR IGNORE INTO store_cards (id, member_id, name, service_name, total_times, used_times, price, status) VALUES
  ('C001', 'M001', '基础服务10次卡', '基础服务', 10, 0, 1980, 'active');

INSERT OR IGNORE INTO store_appointments (id, member_id, service_name, technician_id, start_dt, duration_min, status) VALUES
  ('A001', 'M001', '基础服务', 'S001', '2026-06-01 15:00', 60, 'scheduled');

INSERT OR IGNORE INTO store_meta (key, value_json) VALUES
  ('balance_low_threshold', '500'),
  ('card_expiring_days', '30'),
  ('segment_preset', '"A"');
