package de.effigenix.domain.usermanagement;

/**
 * Granular permissions for all Bounded Contexts.
 * Permissions are assigned to Roles, which are assigned to Users.
 *
 * Naming convention: {CONTEXT}_{ENTITY}_{ACTION}
 * - Context: PRODUCTION, QUALITY, INVENTORY, etc.
 * - Entity: RECIPE, BATCH, STOCK, etc.
 * - Action: READ, WRITE, DELETE, etc.
 *
 * These permissions are mapped from typsafe BC Actions via ActionToPermissionMapper.
 */
public enum Permission {
    // ==================== Production BC ====================
    RECIPE_READ,
    RECIPE_WRITE,
    RECIPE_DELETE,

    BATCH_READ,
    BATCH_WRITE,
    BATCH_COMPLETE,
    BATCH_CANCEL,
    BATCH_DELETE,

    PRODUCTION_ORDER_READ,
    PRODUCTION_ORDER_WRITE,
    PRODUCTION_ORDER_DELETE,

    // ==================== Quality BC ====================
    HACCP_READ,
    HACCP_WRITE,

    TEMPERATURE_LOG_READ,
    TEMPERATURE_LOG_WRITE,

    CLEANING_RECORD_READ,
    CLEANING_RECORD_WRITE,

    GOODS_INSPECTION_READ,
    GOODS_INSPECTION_WRITE,

    // ==================== Inventory BC ====================
    STOCK_READ,
    STOCK_WRITE,

    STOCK_MOVEMENT_READ,
    STOCK_MOVEMENT_WRITE,

    INVENTORY_COUNT_READ,
    INVENTORY_COUNT_WRITE,

    // ==================== Procurement BC ====================
    PURCHASE_ORDER_READ,
    PURCHASE_ORDER_WRITE,
    PURCHASE_ORDER_DELETE,

    GOODS_RECEIPT_READ,
    GOODS_RECEIPT_WRITE,

    SUPPLIER_READ,
    SUPPLIER_WRITE,
    SUPPLIER_DELETE,

    // ==================== Sales BC ====================
    ORDER_READ,
    ORDER_WRITE,
    ORDER_DELETE,

    INVOICE_READ,
    INVOICE_WRITE,
    INVOICE_DELETE,

    CUSTOMER_READ,
    CUSTOMER_WRITE,
    CUSTOMER_DELETE,

    // ==================== Labeling BC ====================
    LABEL_READ,
    LABEL_WRITE,
    LABEL_PRINT,

    // ==================== Master Data BC ====================
    MASTERDATA_READ,
    MASTERDATA_WRITE,

    // ==================== Filiales BC ====================
    BRANCH_READ,
    BRANCH_WRITE,
    BRANCH_DELETE,

    // ==================== User Management BC ====================
    USER_READ,
    USER_WRITE,
    USER_DELETE,
    USER_LOCK,
    USER_UNLOCK,

    ROLE_READ,
    ROLE_WRITE,
    ROLE_ASSIGN,
    ROLE_REMOVE,

    // ==================== Reporting BC ====================
    REPORT_READ,
    REPORT_GENERATE,

    // ==================== Notifications BC ====================
    NOTIFICATION_READ,
    NOTIFICATION_SEND,

    // ==================== System ====================
    AUDIT_LOG_READ,
    SYSTEM_SETTINGS_READ,
    SYSTEM_SETTINGS_WRITE
}
