State machine - creating a rental contract
Description
The following state machine presents a rental contract creation process.
Rental contract shows that a person (whatever its type, except unknown person and group person) is contracting with a real estate agency and a owner for renting one or more parts belonging to the owner. E.g. a flat only ; or a flat + a garage...
Throughout its creation process, the rental contract object created could have the following state :
DRAFT: first state of the creation process. After completing some information, contract has been correctly sent and recordered into the BE, and, through its Id, can become referenceable by other object. The contract can be updated (e.g the payload can be freely change in one or more attribute.s)READY TO SIGN: the action "finalyse offer" allows to transition fromDRAFTtoREADY TO SIGN. That means that the offer (the renatl contract) is ready to be printed out, sent for signature to the customer.
important : to be in READY TO SIGN state, an easyId must be given, despite the fact that this not for legal reason (as it is for the rental delagate contract). see Attributes Dictionary, chapter related to "master contract data"
The contract can be updated (e.g the payload can be freely change), but can't go back to DRAFT state
CANCELLED: it might happen that for any reason, the customer won't sign. In such a case, the RC canot be deleted, because the easyId that had been given in the previous state must be kept, and won't be used again.SIGNED: once printed, contract will be signed by both parties and scanned. The uplaod of the scanned document by a end-user, that will confirm that the RC is ok, will turn the delegate contract in final stateSIGNED.TERMINATED: a contract might end for different reasons, but mainly because the tenant leaves and gives notice period.
Diagram
Note : this diagram contains no guards nor validation. Those are included in a separate file.