Skip to content

Latest commit

 

History

History
117 lines (90 loc) · 1.69 KB

databases.adoc

File metadata and controls

117 lines (90 loc) · 1.69 KB

Databases

Order Service Database

The database of the Order Service.

Type: PostgreSQL

Table: addresses

Stores saved addresses of customers.

Table 1. addresses columns
Column Type Nullable? Default Value Description

🔑 id

uuid

false

The unique ID of this address.

customer_id

uuid

false

The unique ID of the customer this address belongs to.

name

text

true

The name of the customer used for this address.

street

text

true

The name of the street incl. house numbers and other additions.

city

text

true

The name of the city.

zip_code

text

true

The ZIP code.

country

character (2)

true

A ISO 3166-2 country code.

Table: orders

Central table of this service. Stores all orders and their state.

Table 2. orders columns
Column Type Nullable? Default Value Description

🔑 id

uuid

false

The unique ID of this address.

customer_id

uuid

false

The unique ID of the customer from the central customer management service.

ordered_at

timestamp with time zone

false

The exact point in time when this order was submitted by the customer.

dispatched_at

timestamp with time zone

true

The exact point in time when this order was dispatched to the customer.

billing_address_id

uuid

false

ID of the address used for billing. Foreign key from 'addresses' table.

shipping_address_id

uuid

false

ID of the address used for shipping. Foreign key from 'addresses' table.

status

text

false

'OPEN'::text

The status of the order. Can be 'OPEN', 'PROCESSING', 'DISPATCHED', 'DELIVERED', 'CANCELED' or 'FAILED'