@startuml
    hide empty description

    ' input data
    state INITIAL_DATA as "initial data" #aliceblue;line:blue;line.dotted;text:blue {
        INITIAL_DATA: new unprocessed data
        }
    state REVISION_DATA as "revision data" #aliceblue;line:blue;line.dotted;text:blue {
        REVISION_DATA: already existing sequence
        REVISION_DATA: with status RELEASED
        REVISION_DATA: + new unprocessed data
    }
    state REVOKED_DATA as "revocation data" #aliceblue;line:blue;line.dotted;text:blue{
        REVOKED_DATA: already existing sequence
        REVOKED_DATA: with status RELEASED
    }

    ' status states
    state RECEIVED
    state IN_PROCESSING
    state PROCESSED
    state RECEIVED
    state RELEASED

    ' actions
    state CREATING_SUBMIT as "entry with new accession\n will be created" #lightgreen;line:green;line.dotted
    state CREATING_REVISE as "entry with existing accession\n and incremented version number\n will be created" #lightgreen;line:green;line.dotted
    state CREATING_REVOKE as "entry with existing accession,\n incremented version number, \n and is_revocation=true will be created" #lightgreen;line:green;line.dotted
    state DELETION as "entry will be deleted" #IndianRed;line:red;line.dotted
    state is_approved <<choice>>

    ' transitions
    INITIAL_DATA --> CREATING_SUBMIT : initial submission
    CREATING_SUBMIT --> RECEIVED
    REVISION_DATA --> CREATING_REVISE : user initiates revision
    CREATING_REVISE --> RECEIVED

    REVOKED_DATA --> CREATING_REVOKE : user initiates revocation
    CREATING_REVOKE --> PROCESSED

    RECEIVED --> IN_PROCESSING : preprocessing starts
    IN_PROCESSING --> PROCESSED : preprocessing done,\nmight contain errors that need editing.
    PROCESSED --> RECEIVED : user edits data
    PROCESSED --> is_approved
    is_approved --> RELEASED : user approves \nif sequence does not have errors
    is_approved --> DELETION : user rejects

@enduml
