-- Minimal non-production seed data for M01-B local verification.
-- Do not insert real user data or production credentials here.

INSERT IGNORE INTO qipai_tenants (id, code, name, status, timezone)
VALUES (1, 'demo', '演示租户', 'ACTIVE', 'Asia/Shanghai');

INSERT IGNORE INTO qipai_stores (id, tenant_id, legacy_store_id, name, address, contact_phone, timezone, business_status)
VALUES (1, 1, NULL, '演示门店', '本地开发地址', '', 'Asia/Shanghai', 'OPEN');

INSERT IGNORE INTO qipai_rooms (id, tenant_id, store_id, legacy_room_id, name, room_no, capacity, base_price_cents, status)
VALUES (1, 1, 1, NULL, '演示包间', 'A001', 4, 3000, 'AVAILABLE');

INSERT IGNORE INTO qipai_legacy_table_mappings (legacy_table, new_table, strategy, note)
VALUES
  ('system_tenant', 'qipai_tenants', 'REMODEL', '保留多租户概念，重建首期租户表。'),
  ('member_store_info', 'qipai_stores', 'REMODEL', '门店字段按新系统重新命名，保留 legacy_store_id。'),
  ('member_room_info', 'qipai_rooms', 'REMODEL', '房间价格统一转为整数分。'),
  ('member_user', 'qipai_members', 'REMODEL', '会员余额统一转为整数分。'),
  ('member_order_info', 'qipai_orders', 'REMODEL', '订单时间统一 DATETIME(3)，内部按 UTC 保存。'),
  ('member_pay_order', 'qipai_payments', 'REMODEL', '支付金额统一整数分，原始回调存 JSON。'),
  ('member_device_info', 'qipai_devices', 'REMODEL', '设备 ID 与 IMEI 分离，后续 M06 接入 MQTT。'),
  ('system_operate_log', 'qipai_audit_logs', 'REMODEL', '统一 traceId 与资源审计字段。');
