- Every column type and length must be validated according to the database columns.
- contact_key, order_id, order_date, order_status, item_count, total_amount columns are required and can not be null or empty
- quantity > 0 (quantity should be positive integer)
- item_count should be sum of quantities of items. (item_count == sum(items[].quantity)
- total_amount should be sum of items paid prices (total_amount == sum(items.discounted_price * items.quantity)
- order_status, order_source, payment_method values should be validated for valid values
- order_status = success / refund
- order_source = web / mobile_app / offline
- payment_method = cash / bank_transfer / credit_card / debit_card / mobile_payment / check / prepaid_card / crypto / cod / online_payment
- quantity, unit_price and discounted_price should be greater than zero
- product_id, product_variant_id, quantity, unit_price, discounted_price columns are required and can not be null or empty
- discounted_price <= unit_price (discounted_price should be smaller or equal to unit_price)
All other columns like contact_key, order_id, order_status, payment_method ... for orders_item should be coming from parent order object.