@startuml
skinparam monochrome true
skinparam packageStyle rectangle
skinparam shadowing false

title System Sequence Diagram (SSD) - Alternative One

autonumber

actor "Agent"
participant ":System" as System

activate Agent

    Agent -> System : Requests to publish a sale announcement
    activate System

    System --> Agent : Requests owner email (email)
    deactivate System

    Agent -> System : types requested data
    activate System

    System --> Agent : requests type of property  (land, house, apartment)
    deactivate System

    Agent -> System : types requested data
    activate System


    alt     (property = house)

    System --> Agent : requested house data (Area in m2, location, distance from city center, \nrequested price, one or more photographs, \nNumber of bedrooms, number of bathrooms, number of parking spaces, available equipment)

    else     (property = apartment)

    System --> Agent : requested apartment data (Area in m2, location, distance from city center, \nrequested price, one or more photographs,\n Existence of basement, inhabitable loft, sun exposure, number of bedrooms, number of bathrooms, \nnumber of parking spaces, available equipment)

    else    (property = land)
     System --> Agent : requested land data (Area in m2, location, distance from city center, \nrequested price, one or more photographsoms)
    deactivate System

    end alt

    Agent -> System : types requested data
    activate System

    System --> Agent : Show all data and ask to confirm data
    deactivate System

    Agent -> System : confirm data
    activate System

    System --> Agent : request type of commission
    deactivate System

    Agent -> System : types requested data
    activate System

    alt (commission = fixed amount)
        System --> Agent : requested amount commission

    else (commission = percentage)
        System --> Agent : request percentage commission

    deactivate System

    end alt

    Agent -> System : types requested data
    activate System

    alt (dataPublished = null)

    System --> Agent : displays operation success

    else (dataPublished != null)

    System --> Agent : Confirm the published sale announcement\n and send an SMS notification to property owner(location, date, agentName, agentPhoneNumber)
    end alt
    deactivate System

@enduml