import { AXPStatusProvider, AXPSystemStatusType, systemStatusToDefinition } from '@acorex/platform/common';

//#region ----   Imports   ----
//#endregion
//#region ----   Assessment Case Status Provider   ----
/**
 * Assessment case status provider defining lifecycle states: Draft, Active, In Progress, Closed, Cancelled.
 * Used by the status plugin to manage assessment case status transitions and metadata.
 */
class AXMAssessmentCaseStatusProvider extends AXPStatusProvider {
    constructor() {
        super(...arguments);
        this.key = 'assessment-management.status.case';
        this.defaultStatus = AXPSystemStatusType.Draft;
        this.statuses = [
            systemStatusToDefinition(AXPSystemStatusType.Draft, {
                title: '@assessment-management:cases.states.draft',
                generateView: true,
            }),
            systemStatusToDefinition(AXPSystemStatusType.Active, {
                title: '@assessment-management:cases.states.active',
                generateView: true,
            }),
            systemStatusToDefinition(AXPSystemStatusType.InProgress, {
                title: '@assessment-management:cases.states.in-progress',
                generateView: true,
            }),
            systemStatusToDefinition(AXPSystemStatusType.Closed, {
                title: '@assessment-management:cases.states.closed',
                generateView: true,
            }),
            systemStatusToDefinition(AXPSystemStatusType.Cancelled, {
                title: '@assessment-management:cases.states.cancelled',
                generateView: true,
            }),
        ];
        this.transitions = [
            {
                from: AXPSystemStatusType.Draft,
                to: AXPSystemStatusType.Active,
                title: '@assessment-management:cases.transitions.activate',
            },
            {
                from: AXPSystemStatusType.Active,
                to: AXPSystemStatusType.InProgress,
                title: '@assessment-management:cases.transitions.start',
            },
            {
                from: AXPSystemStatusType.InProgress,
                to: AXPSystemStatusType.Closed,
                title: '@assessment-management:cases.transitions.close',
                requiresApproval: true,
            },
            {
                from: AXPSystemStatusType.Active,
                to: AXPSystemStatusType.Closed,
                title: '@assessment-management:cases.transitions.close',
                requiresApproval: true,
            },
            {
                from: AXPSystemStatusType.Active,
                to: AXPSystemStatusType.Cancelled,
                title: '@assessment-management:cases.transitions.cancel',
                requiresApproval: true,
            },
            {
                from: AXPSystemStatusType.InProgress,
                to: AXPSystemStatusType.Cancelled,
                title: '@assessment-management:cases.transitions.cancel',
                requiresApproval: true,
            },
            {
                from: AXPSystemStatusType.Closed,
                to: AXPSystemStatusType.Active,
                title: '@assessment-management:cases.transitions.reopen',
            },
        ];
    }
}
//#endregion

export { AXMAssessmentCaseStatusProvider };
//# sourceMappingURL=acorex-modules-assessment-management-assessment-case-status.provider-B9sQAPwy.mjs.map
