framework:
    workflows:
        contract:
            type: workflow
            marking_store:
                type: method
            supports:
                - App\Entity\Contract
            places:
                draft:
                    metadata:
                        title: Draft
                waiting: ~
                proposal: ~
                incomplete: ~
                signed: ~
                validated: ~
                invoiced: ~
                paid: ~
                recycled: ~
                suspended: ~
                cancelled: ~
            transitions:
                start cycle:
                    from: draft
                    to: waiting
                request proposal:
                    #guard: "is_granted('ROLE_ADMIN')"
                    from: waiting
                    to:
                        - proposal
                        - cancelled
                        - suspended
                        - incomplete

                request verification:
                    #guard: "is_granted('ROLE_JOURNALIST')" check if exprired status or incomplete
                    from: incomplete
                    to: recycled

                proposal suspended:
                    from: suspended
                    to:
                        - cancelled
                        - recycled

                proceed proposal:
                    #guard: "subject->getRequestedCreditLimit() < now()"
                    from: proposal
                    to:
                        - signed
                        - recycled
                        - cancelled
                        - suspended

                proposal incomplete:
                    from: incomplete
                    to:
                        - recycled
                        - cancelled
                        - suspended

                proposal signed:
                    from: signed
                    to:
                        - validated
                        - recycled
                        - cancelled
                        - suspended

                proposal finalized:
                    from: validated
                    to:
                        - invoiced
                        - paid

                restart recycled cycle:
                    from: recycled
                    to:
                        - proposal
                        - cancelled
                        - suspended
                        - incomplete

            metadata:
                title: Workflow to manage contract
            audit_trail: true
