-- ============================================
-- 此文件由 Meoo Cloud 自动生成，请勿修改
-- This file is auto-generated by Meoo Cloud, DO NOT MODIFY
-- ============================================


-- 创建公司
INSERT INTO public.companies (id, name, role, address, contact_phone) VALUES
 ('11111111-1111-1111-1111-111111111101', '示例布行', 'purchaser', '浙江省杭州市', '13800138000'),
 ('11111111-1111-1111-1111-111111111102', '示例纺织厂', 'textile', '浙江省绍兴市', '13800138001'),
 ('11111111-1111-1111-1111-111111111103', '示例水洗厂', 'washing', '广东省广州市', '13800138002');

-- 创建 profiles
INSERT INTO public.profiles (id, username, phone, company_id, is_master) VALUES
 ('a0000001-0000-0000-0000-000000000001', 'purchaser', '13800138000', '11111111-1111-1111-1111-111111111101', true),
 ('a0000002-0000-0000-0000-000000000002', 'textile', '13800138001', '11111111-1111-1111-1111-111111111102', true),
 ('a0000003-0000-0000-0000-000000000003', 'washing', '13800138002', '11111111-1111-1111-1111-111111111103', true);

-- 创建公司成员
INSERT INTO public.company_members (company_id, user_id, role) VALUES
 ('11111111-1111-1111-1111-111111111101', 'a0000001-0000-0000-0000-000000000001', 'master'),
 ('11111111-1111-1111-1111-111111111102', 'a0000002-0000-0000-0000-000000000002', 'master'),
 ('11111111-1111-1111-1111-111111111103', 'a0000003-0000-0000-0000-000000000003', 'master');

-- 创建仓库
INSERT INTO public.warehouses (id, company_id, name, type, location) VALUES
 ('22222222-2222-2222-2222-222222222201', '11111111-1111-1111-1111-111111111101', '原坯布仓库', 'raw_fabric', 'A区-01'),
 ('22222222-2222-2222-2222-222222222202', '11111111-1111-1111-1111-111111111101', '坯布仓库', 'fabric', 'B区-01'),
 ('22222222-2222-2222-2222-222222222203', '11111111-1111-1111-1111-111111111101', '成品仓库', 'finished', 'C区-01'),
 ('22222222-2222-2222-2222-222222222204', '11111111-1111-1111-1111-111111111102', '原料纱仓库', 'yarn', '绍兴厂区');

-- 创建纱线库存
INSERT INTO public.yarn_stock (company_id, warehouse_id, name, spec, quantity, min_stock, unit) VALUES
 ('11111111-1111-1111-1111-111111111102', '22222222-2222-2222-2222-222222222204', '棉纱32S', '32支纯棉', 500, 100, 'kg'),
 ('11111111-1111-1111-1111-111111111102', '22222222-2222-2222-2222-222222222204', '涤纶纱', '75D/36F', 30, 50, 'kg'),
 ('11111111-1111-1111-1111-111111111102', '22222222-2222-2222-2222-222222222204', '氨纶', '40D', 200, 80, 'kg');

