roos-fs tasks #124
Updated by Vadim Pariev 11 months ago
User story As a system user (administrator), I want the service object to follow a clearly defined state machine, So that each stage of the task (from creation to completion or cancellation) follows business logic, validation rules, and restrictions). **State Machine Flow & Requirements** <u>Statuses</u> - Created - Opened - In Progress - Completed - Cancelled → By customer / Internally - Deleted (only possible from Created) <u>Transitions & Conditions</u> TASK → Created Initial state when a new task is created. Can be deleted in this state only. Created → Opened Triggered manually by a button. Triggered automatically with the service if created in the "created" status of the service. Event - user changed the status of the Service to Opened Opened → In Progress Triggered manually. System must record who triggered the transition. In Progress → Completed Triggered manually. Optional note field becomes visible and can be used to describe what was done. Created, Opened, In Progress → Cancelled Triggered manually. Requires selection of one of the two reasons: --By customer --Internally Documentation for cancellation reasoning is mandatory. **Acceptance Criteria** <u>State Machine</u> - Users can transition between statuses only as outlined above. - Status changes must be explicit and user-triggered via buttons. <u>Deletion</u> - Deletion is only permitted in the Created state. <u>Completion</u> - Task must include an optional field for notes describing what was done. <u>Cancellation</u> - When cancelling a task, the user must: -- Choose the cancellation reason (By customer or Internally). -- Provide a written explanation in a mandatory documentation field. <u>Validation</u> - The system must ensure that tasks in Completed status cannot be edited or deleted. <u>Logging </u> Each state transition must be logged with: - Timestamp - Triggering user - Any notes or cancellation documentation