Skip to main content

Entity Relationship Diagram

Rendered Output

Source

sequence.puml
@startuml ERD Demo

title ERD Demo

entity "Account" as account {
*AccountId : number <<generated>>
--
*AccountRoleId : number <<FK>>
Name: varchar
Code: varchar
}

map "Role" as role {
1 => System
2 => Grower
3 => Merchant
4 => Buyer
5 => Admin
}

account ||--o{ role

entity "User" as user {
*UserId : number <<generated>>
--
*AccountId : number <<FK>>
}

account ||--o{ user::AccountId

entity "Lot" as lot {
*LotId : number <<generated>>
--
*AccountId : number <<FK>>
*CreatedBy : number <<FK>>
}

account ||--o{ lot::AccountId

entity "CartOrder" as cartorder {
*CartOrderId : number <<generated>>
--
*BuyerId : number <<FK>>
*CreatedBy : number <<FK>>
}

account ||--o{ cartorder::AccountId

entity "Product" as product {
*ProductId : number <<generated>>
--
*CategoryId : number <<FK>>
}

entity "Category" as category {
*CategoryId : number <<generated>>
--
}

category ||--o{ product


entity "StockLineItem" as stocklineitem {
*StockLineItemId : number <<generated>>
--
*LotId : number <<FK>>
*ProductId : number <<FK>>
LifecycleStatus : number <<FK>>
UserName: string
}

product ||--o{ stocklineitem::ProductId
lot::LotId ||--o{ stocklineitem::LotId



entity "Demo" as demo {
*StockLineItemId : number <<generated>>
--
*LotId : number <<FK>>
*ProductId : number <<FK>>
LifecycleStatus : number <<FK>>
UserName: string
}

@enduml