Orders and their invoices
Orders and their invoices in two packages. The diagram runs top down, but the Billing package sets "orientation": "landscape", so invoice, invoice lines and tax rate lie side by side as one block that the diagram places like a class; relations from outside meet the block where their class lies. The reminder stays outside both packages.
Orders and their invoices
examples/invoice-model.json{
"schemaVersion": 1,
"type": "classes",
"title": "Orders and their invoices",
"source": "Illustrative domain model",
"width": 900,
"height": 760,
"classes": {
"orientation": "portrait",
"packages": [
{
"id": "sales",
"label": "Sales"
},
{
"id": "billing",
"label": "Billing",
"orientation": "landscape"
}
],
"classes": [
{
"id": "customer",
"label": "Customer",
"attributes": [
"+ id: Int",
"+ name: String"
],
"in": "sales"
},
{
"id": "order",
"label": "Order",
"attributes": [
"+ id: Int",
"+ placedAt: Date"
],
"methods": [
"+ total(): Money"
],
"in": "sales"
},
{
"id": "invoice",
"label": "Invoice",
"attributes": [
"+ number: String",
"+ issuedAt: Date"
],
"methods": [
"+ total(): Money"
],
"in": "billing"
},
{
"id": "line",
"label": "InvoiceLine",
"attributes": [
"+ quantity: Int",
"+ net: Money"
],
"in": "billing"
},
{
"id": "tax",
"label": "TaxRate",
"attributes": [
"+ code: String",
"+ percent: Decimal"
],
"in": "billing"
},
{
"id": "reminder",
"label": "Reminder",
"attributes": [
"+ level: Int",
"+ sentAt: Date"
]
}
],
"relations": [
{
"from": "customer",
"to": "order",
"fromCardinality": "1",
"toCardinality": "0..*",
"label": "places"
},
{
"from": "order",
"to": "invoice",
"fromCardinality": "1",
"toCardinality": "1..*",
"label": "billed as"
},
{
"from": "invoice",
"to": "line",
"kind": "composition",
"fromCardinality": "1",
"toCardinality": "1..*",
"label": "lists"
},
{
"from": "line",
"to": "tax",
"fromCardinality": "*",
"toCardinality": "1",
"label": "taxed at"
},
{
"from": "invoice",
"to": "reminder",
"fromCardinality": "1",
"toCardinality": "0..3",
"label": "dunned by"
}
]
}
}Focus
Source: Illustrative domain model
Show chart data
| Item | Kind | Package | Attributes | Methods | Relations |
|---|---|---|---|---|---|
| Customer | Class | Sales | + id: Int; + name: String | is associated with Order (1 : 0..*) [places] | |
| Order | Class | Sales | + id: Int; + placedAt: Date | + total(): Money | is associated with Invoice (1 : 1..*) [billed as] |
| Invoice | Class | Billing | + number: String; + issuedAt: Date | + total(): Money | is composed of InvoiceLine (1 : 1..*) [lists]; is associated with Reminder (1 : 0..3) [dunned by] |
| InvoiceLine | Class | Billing | + quantity: Int; + net: Money | is associated with TaxRate (* : 1) [taxed at] | |
| TaxRate | Class | Billing | + code: String; + percent: Decimal | ||
| Reminder | Class | + level: Int; + sentAt: Date |