Skip to content

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
    }

Diagram

Sale Domain ​

EntityTableKey FieldsDescription
Salemz_saleid, magento_id, status, customer_*Order record synced from Magento
SaleProductmz_sale_productid, sale_id, product_id, qty, statusOrder line item
SaleLogmz_sale_logid, sale_id, old_status, new_statusStatus change journal
SaleSav—id, sale_id, type, statusAfter-sales case (returns, claims)

Sale status flow

pending > processing > complete > canceled / closed

See the Glossary for detailed status definitions.

Product Domain ​

EntityTableKey FieldsDescription
Productmz_productid, sku, ean, name, qtyProduct catalog entry
ProductQtyLog—id, product_id, qty_change, typeStock mutation journal
EanProductmz_ean_productid, sku, eanEAN-to-SKU mapping
Container—id, arrival_date, statusStock arrival container from supplier

Shipping Domain ​

EntityTableKey FieldsDescription
SaleProductShipment—id, sale_product_id, carrier, trackingShipment record per sale product

SaleProduct status flow

Processing Not Printed > Shipped > Delivered > Returned

Financial Domain ​

EntityTableKey FieldsDescription
Refund—id, sale_id, amount, statusRefund record
RefundLog—id, refund_id, actionRefund audit trail
PaylineTransactionLog—id, transaction_id, amount, statusPayline transaction log

Queue Domain ​

EntityTableKey FieldsDescription
Queue—id, model, status, number_of_trialsAsync 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 ​

Internal developer documentation for Menzzo systems.