DeliveryCreated
v1.0.0

An event raised on delivery created to notify others about it.
DeliveryCreated Schema (yml)
openapi: 3.0.0
info:
  version: "1.0.0"
  title: DeliveryCreated
paths: {}
components:
  schemas:
    DeliveryCreated:
      type: object
      required:
        - data
        # - metadata
      properties:
        data:
          "$ref": "#/components/schemas/Data"
        metadata:
          "$ref": "#/components/schemas/Metadata"
    Metadata:
      type: object
      properties:
        version:
          type: string
      required:
        - version
    Data:
      type: object
      properties:
        id:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        subscriptionId:
          type: string
        paymentMethod:
          "$ref": "#/components/schemas/PaymentMethod"
        deliveryAddress:
          "$ref": "#/components/schemas/DeliveryAddress"
        food:
          type: array
          items:
            "$ref": "#/components/schemas/Food"
        planType:
          "$ref": "#/components/schemas/PlanType"
        dietType:
          "$ref": "#/components/schemas/DietType"
        foodType:
          type: array
          items:
            "$ref": "#/components/schemas/FoodType"
        frequency:
          "$ref": "#/components/schemas/SubscriptionFrequency"
        cost:
          type: number
        paidAmount:
          type: number
          default: 0
        macrosBag:
          "$ref": "#/components/schemas/MacrosBag"
        name:
          type: string
        phoneNumber:
          type: string
        date:
          type: string
        tier:
          type: string
        kitchen:
          "$ref": "#/components/schemas/Kitchen"
        currency:
          "$ref": "#/components/schemas/Currency"
        country:
          "$ref": "#/components/schemas/Country"
        time:
          "$ref": "#/components/schemas/DeliveryTime"
        status:
          "$ref": "#/components/schemas/DeliveryStatus"
        timezone:
          type: string
        dob:
          type: string
        gender:
          "$ref": "#/components/schemas/Gender"
        withCutlery:
          type: boolean
        brand:
          "$ref": "#/components/schemas/Brand"
      required:
        - id
        - createdAt
        - updatedAt
        - subscriptionId
        - paymentMethod
        - deliveryAddress
        - food
        - planType
        - dietType
        - foodType
        - frequency
        - cost
        - paidAmount
        - macrosBag
        - name
        - phoneNumber
        - date
        - kitchen
        - currency
        - country
        - time
        - status
        - timezone
        - dob
        - gender
        - withCutlery
        - brand
        - tier
    PaymentMethod:
      type: string
      enum:
        - cash
        - cc
        - benefit
        - mada
        - applePay
        - knet
    DeliveryAddress:
      anyOf:
        - type: object
          properties:
            type:
              type: string
              default: home
            apartment:
              type: string
            lat:
              type: number
            lng:
              type: number
            country:
              "$ref": "#/components/schemas/Country"
            notes:
              type: string
            driverNote:
              type: string
            name:
              type: string
            region:
              type: string
            city:
              type: string
            district:
              type: string
            street:
              type: string
            building:
              type: string
            postalCode:
              type: string
            postalCodeSuffix:
              type: string
            id:
              type: string
            default:
              type: boolean
          required:
            - building
            - country
            - default
            - id
            - lat
            - lng
            - street
            - type
        - type: object
          properties:
            type:
              type: string
              default: office
            office:
              type: string
            lat:
              type: number
            lng:
              type: number
            country:
              "$ref": "#/components/schemas/Country"
            notes:
              type: string
            driverNote:
              type: string
            name:
              type: string
            region:
              type: string
            city:
              type: string
            district:
              type: string
            street:
              type: string
            building:
              type: string
            postalCode:
              type: string
            postalCodeSuffix:
              type: string
            id:
              type: string
            default:
              type: boolean
          required:
            - building
            - country
            - default
            - id
            - lat
            - lng
            - street
            - type
    Country:
      type: string
      enum:
        - AE
        - BH
        - SA
        - KW
        - OM
        - QA
        - US
    Food:
      type: object
      properties:
        id:
          type: string
        name:
          "$ref": "#/components/schemas/Localized"
        description:
          "$ref": "#/components/schemas/Localized"
        tags:
          type: array
          items:
            anyOf:
              - "$ref": "#/components/schemas/DietType"
              - type: string
        type:
          type: array
          items:
            "$ref": "#/components/schemas/FoodType"
        size:
          type: string
        isCustom:
          type: boolean
      required:
        - id
        - name
        - description
        - tags
        - ingredients
        - macros
        - type
        - size
    Localized:
      type: object
      properties:
        en:
          type: string
        ar:
          type: string
      required:
        - en
        - ar
    DietType:
      type: string
      enum:
        - balanced
        - vegetarian
        - low-carb
        - high-protein
    Ingredient:
      type: object
      properties:
        id:
          type: string
        name:
          "$ref": "#/components/schemas/Localized"
        category:
          type: array
          items:
            "$ref": "#/components/schemas/IngredientCategory"
        slug:
          type: string
        quantity:
          type: number
      required:
        - id
        - name
        - category
        - slug
    IngredientCategory:
      type: string
      enum:
        - fish
        - beef
        - shellfish
        - chicken
        - turkey
        - spicyMeals
        - treeNuts
        - dairy
        - eggs
        - soy
        - gluten
        - beans
        - sesame
        - peanut
        - psylliumHusk
        - other
    FoodType:
      type: string
      enum:
        - breakfast
        - dinner
        - lunch
        - snack
        - coffee
        - juice
    Currency:
      type: string
      enum:
        - BHD
        - SAR
        - AED
        - KWD
        - QAR
        - OMR
    PlanType:
      type: string
      enum:
        - full
        - custom
        - skipBreakfast
        - skipDinner
        - ramadan
        - businessLunch
        - futoor
    SubscriptionFrequency:
      type: string
      enum:
        - weekly
        - monthly
    Gender:
      type: string
      enum:
        - male
        - female
    MacrosBag:
      type: object
      properties:
        cal:
          type: number
        carbs:
          type: object
          properties:
            min:
              type: number
            max:
              type: number
          required:
            - min
            - max
        protein:
          type: object
          properties:
            min:
              type: number
            max:
              type: number
          required:
            - min
            - max
        fat:
          type: object
          properties:
            min:
              type: number
            max:
              type: number
          required:
            - min
            - max
      required:
        - cal
        - carbs
        - fat
        - protein
    Kitchen:
      type: string
      enum:
        - BH001
        - SA001
        - SA002
        - KW001
        - QA001
        - AE001
        - NA000
    DeliveryTime:
      type: string
      enum:
        - morning
        - evening
    DeliveryStatus:
      type: string
      enum:
        - upcoming
        - paymentRequired
        - paused
        - cancelled
        - suspended
    Brand:
      type: string
      enum:
        - CALO
        - MEALO
Edit this pageLast updated on 2024/4/2