-- Add MASTERDATA_READ and MASTERDATA_WRITE permissions to relevant roles.
-- These permissions are required by the Masterdata BC controllers
-- (ArticleController, ProductCategoryController, SupplierController, CustomerController).

-- ADMIN gets both READ and WRITE
INSERT INTO role_permissions (role_id, permission) VALUES
    ('c0a80121-0000-0000-0000-000000000001', 'MASTERDATA_READ'),
    ('c0a80121-0000-0000-0000-000000000001', 'MASTERDATA_WRITE');

-- PROCUREMENT_MANAGER gets both (manages suppliers, articles)
INSERT INTO role_permissions (role_id, permission) VALUES
    ('c0a80121-0000-0000-0000-000000000006', 'MASTERDATA_READ'),
    ('c0a80121-0000-0000-0000-000000000006', 'MASTERDATA_WRITE');

-- SALES_MANAGER gets both (manages customers)
INSERT INTO role_permissions (role_id, permission) VALUES
    ('c0a80121-0000-0000-0000-000000000008', 'MASTERDATA_READ'),
    ('c0a80121-0000-0000-0000-000000000008', 'MASTERDATA_WRITE');

-- PRODUCTION_MANAGER gets READ (needs to view articles, categories)
INSERT INTO role_permissions (role_id, permission) VALUES
    ('c0a80121-0000-0000-0000-000000000002', 'MASTERDATA_READ');

-- WAREHOUSE_WORKER gets READ (needs to view articles)
INSERT INTO role_permissions (role_id, permission) VALUES
    ('c0a80121-0000-0000-0000-000000000007', 'MASTERDATA_READ');

-- SALES_STAFF gets READ (needs to view articles, customers)
INSERT INTO role_permissions (role_id, permission) VALUES
    ('c0a80121-0000-0000-0000-000000000009', 'MASTERDATA_READ');
