@startuml
class customers {
    -id: serial
    -first_name: varchar(50)
    -last_name: varchar(50)
    -phone: varchar(20)
    -email: varchar(100)
    -user_id: uuid
    -created_at: timestamp
    -updated_at: timestamp
    -identity_document: text
}

class agents {
    -id: serial
    -first_name: varchar(50)
    -last_name: varchar(50)
    -city: varchar(50)
    -commission_percentage: numeric(5,2)
    -user_id: uuid
    -created_at: timestamp
    -updated_at: timestamp
}

class attachments {
    -id: serial
    -model_name: varchar(100)
    -model_id: integer
    -file_name: varchar(100)
    -file_type: varchar(100)
    -file_size: integer
    -url: varchar(100)
    -created_at: timestamp
    -updated_at: timestamp
}

class cities {
    -id: serial
    -name: varchar(50)
    -created_at: timestamp
    -updated_at: timestamp
}

class properties {
    -id: serial
    -operation_type: varchar(20)
    -address: text
    -photos: bytea[]
    -owners: varchar(200)
    -property_price: numeric(10,2)
    -availability_status: varchar(20)
    -agent_id: integer
    -created_at: timestamp
    -updated_at: timestamp
    -customer_id: integer
    -city_id: integer
    -property_type: text
    -latitude: double precision
    -longitude: double precision
    -property_size: double precision
}

class interested_customers {
    -id: serial
    -customer_id: integer
    -property_id: integer
    -deposit_amount: numeric(10,2)
    -created_at: timestamp
    -updated_at: timestamp
}

customers -- agents
agents -- properties
properties -- interested_customers
attachments -- properties
cities -- properties

@enduml
