Appearance
Data Model
Core Doctrine entities organized by domain.
Entity Relationship Diagram
View diagram source
erDiagram
Sale ||--o{ SaleProduct : "has line items"
Sale ||--o{ SaleLog : "status history"
Sale ||--o{ SaleSav : "after-sales cases"
Sale ||--o{ Refund : "refunds"
SaleProduct }o--|| Product : "references"
SaleProduct ||--o| SaleProductShipment : "shipment"
Product ||--o{ ProductQtyLog : "stock mutations"
Product ||--o{ EanProduct : "EAN mappings"
Refund ||--o{ RefundLog : "audit trail"
Queue ||--o| Sale : "processes"
Queue ||--o| Product : "processes"
Sale {
int id PK
int magento_id
string status
string customer_email
}
SaleProduct {
int id PK
int sale_id FK
int product_id FK
int qty
string status
}
Product {
int id PK
string sku
string ean
string name
int qty
}
Queue {
int id PK
string model
string status
int number_of_trials
}
Sale Domain
| Entity | Table | Key Fields | Description |
|---|---|---|---|
| Sale | mz_sale | id, magento_id, status, customer_* | Order record synced from Magento |
| SaleProduct | mz_sale_product | id, sale_id, product_id, qty, status | Order line item |
| SaleLog | mz_sale_log | id, sale_id, old_status, new_status | Status change journal |
| SaleSav | — | id, sale_id, type, status | After-sales case (returns, claims) |
Sale status flow
pending > processing > complete > canceled / closed
See the Glossary for detailed status definitions.
Product Domain
| Entity | Table | Key Fields | Description |
|---|---|---|---|
| Product | mz_product | id, sku, ean, name, qty | Product catalog entry |
| ProductQtyLog | — | id, product_id, qty_change, type | Stock mutation journal |
| EanProduct | mz_ean_product | id, sku, ean | EAN-to-SKU mapping |
| Container | — | id, arrival_date, status | Stock arrival container from supplier |
Shipping Domain
| Entity | Table | Key Fields | Description |
|---|---|---|---|
| SaleProductShipment | — | id, sale_product_id, carrier, tracking | Shipment record per sale product |
SaleProduct status flow
Processing Not Printed > Shipped > Delivered > Returned
Financial Domain
| Entity | Table | Key Fields | Description |
|---|---|---|---|
| Refund | — | id, sale_id, amount, status | Refund record |
| RefundLog | — | id, refund_id, action | Refund audit trail |
| PaylineTransactionLog | — | id, transaction_id, amount, status | Payline transaction log |
Queue Domain
| Entity | Table | Key Fields | Description |
|---|---|---|---|
| Queue | — | id, model, status, number_of_trials | Async job record (SQL-backed) |
TIP
The Queue entity works alongside RabbitMQ. SQL-backed queues are used for jobs that need persistence and retry tracking. See Queue Debugging for operational procedures.
See also
- Event System — domain events triggered by entity changes
- Glossary — definitions of all terms
- Sales Import workflow — how Sale entities are created