{
  "kind": "collectionType",
  "collectionName": "orders",
  "info": {
    "name": "Orders"
  },
  "options": {
    "increments": true,
    "timestamps": true
  },
  "attributes": {
    "orderNumber": {
      "type": "string"
    },
    "shippingCost": {
      "type": "biginteger"
    },
    "discount": {
      "type": "biginteger"
    },
    "total": {
      "type": "biginteger"
    },
    "customer": {
      "via": "orders",
      "model": "customers"
    },
    "paymentStatus": {
      "type": "enumeration",
      "enum": [
        "paid",
        "not_paid"
      ],
      "default": "not_paid"
    },
    "status": {
      "type": "enumeration",
      "enum": [
        "pending",
        "confirmed",
        "shipped",
        "fulfilled"
      ],
      "default": "pending"
    },
    "customer_address": {
      "model": "customer-address"
    },
    "shippingMode": {
      "type": "enumeration",
      "enum": [
        "delivery",
        "pick_up"
      ]
    },
    "order_products": {
      "via": "order",
      "collection": "order-products"
    },
    "shipping_location": {
      "model": "shipping-locations"
    },
    "paymentMode": {
      "type": "enumeration",
      "enum": [
        "pay_online",
        "bank_transfer",
        "pay_on_delivery",
        "pay_on_pickup"
      ]
    },
    "narrationCode": {
      "type": "string"
    },
    "transaction": {
      "model": "transactions",
      "via": "order"
    },
    "discount_code": {
      "model": "discount-codes"
    },
    "pick_up_location": {
      "model": "pick-up-locations"
    }
  }
}
