I can have the Rental Contract state machine
Event Description Table
| Event | Description |
|---|---|
UPDATE | Updates the contract without changing its state. |
FINALIZE_OFFER | Finalizes the offer and transitions the contract to READY_TO_SIGN. |
CANCEL | Cancels the contract, transitioning it to the CANCELLED state. |
SIGN | The contract is signed, transitioning it to SIGNED. |
NOTIFY | Notification sent, moving the contract to the NOTICED state. |
REVOKE_NOTICE | Revokes the notice, transitioning the contract back to SIGNED. |
END | Marks the contract as ended, transitioning it to ENDED. |
TERMINATE | Terminates the contract, transitioning it to TERMINATED. |
State and Transition Matrix
| Current \ Event | UPDATE | FINALIZE_OFFER | CANCEL | SIGN | NOTIFY | REVOKE_NOTICE | END | TERMINATE |
|---|---|---|---|---|---|---|---|---|
DRAFT | DRAFT | READY_TO_SIGN | CANCELLED | - | - | - | - | - |
READY_TO_SIGN | READY_TO_SIGN | - | CANCELLED | SIGNED | - | - | - | - |
SIGNED | - | - | - | - | NOTICED | REVOKE_NOTICE | - | TERMINATED |
NOTICED | - | - | - | SIGN | - | - | ENDED | TERMINATED |
ENDED | - | - | - | - | - | - | - | TERMINATED |
CANCELLED | - | - | - | - | - | - | - | - |
TERMINATED | - | - | - | - | - | - | - | - |
Full process diagram
