ErrorResponse:
  type: object
  properties:
    code:
      type: number
    type:
      type: string
    message:
      type: string

ResultResponse:
  type: object
  properties:
    result:
      type: boolean
      description: true if the result is positive and false otherwise
    message:
      type: string
      description: the detail message of the result

OnlineOrderResponse:
  allOf:
    - $ref: "#/components/schemas/ResultResponse"
    - type: object
      properties:
        postmates_delivery_time:
          type: number
          description: the time by minutes that Postmates couriers need to delivery goods for customer.
        postmates_response:
          $ref: "#/components/schemas/ModelRef"

QuerySummary:
  type: object
  required:
    - count
  properties:
    count:
      type: number
      description: Total of available records
    tip:
      type: number
      description: Total of tip
    total:
      type: number
      description: The total of all value of the records if any

BaseModel:
  type: object
  required:
    - id
    - name
    - type
  discriminator:
    propertyName: type
  properties:
    id:
      type: string
      format: timestamp
      description: Object ID in timestamp format to 10 milliseconds
    type:
      type: string
    name:
      type: string
      description: name of the object.
    name2:
      type: string
      description: extra name of the object (normally for naming in different language).
    merchantid:
      type: string
      description: The ID of the merchant that this model belong to
    storeid:
      type: string
      description: The ID of the store that this model belong to
    updated_at:
      type: string
      description: The timestamp of last updated time
    updated_by:
      type: string
      description: The ID of user who made the last updated

ModelRef:
  type: object
  required:
    - id
  properties:
    id:
      type: string
      format: timestamp
      description: Object ID in timestamp format to 10 milliseconds

Permissions:
  type: object
  properties:
    weblogin:
      type: boolean
      description: True if this user can login to web admin
    max_discount:
      type: number
      description: The maximum discount that this user is able to use
    max_discount_amount:
      type: number
      description: The maximum discount amount that this user is able to use
    all_transactions:
      type: boolean
      description: True if this user is able to edit all transactions
    manage_all_tables:
      type: boolean
      description: True if this user is able to manage all tables
    employee:
      type: boolean
      description: True if this user is able to manage employee list
    view_customer:
      type: boolean
      description: True if this user is able to manage customer list
    giftcard:
      type: boolean
      description: True if this user is able to manage gift card list
    area:
      type: boolean
      description: True if this user is able to manage area list
    online_ordering:
      type: boolean
      description: True if this user is able to view edit online ordering permission
    waitlist:
      type: boolean
      description: True if this user is able to manage waitlist
    gallery:
      type: boolean
      description: True if this user is able to manage gallery
    screen:
      type: boolean
      description: True if this user is able to enable and disable manage TV signage
    tip_report:
      type: boolean
      description: True if this user is able to edit tip
    tax:
      type: boolean
      description: True if this user is able to manage settings
    website:
      type: boolean
      description: True if this user is able to manage website
    reservation:
      type: boolean
      description: True if this user is able to manage reservation
    edit_modifiers:
      type: boolean
      description: True if this user is able to edit modifiers
    view_report:
      type: boolean
      description: True if this user is able view reports
    device:
      type: boolean
      description: True if this user is able to manage device list
    printtpl:
      type: boolean
      description: True if this user is able to manage print templates
    menu:
      type: boolean
      description: True if this user is able to manage menu (categories, items, modifiers)
    refund_void_unpaid_settle:
      type: boolean
      description: True if this user is able refund, void, unpaid and settle using POS app
    delete_edit_sent_items:
      type: boolean
      description: True if this user is able to delete or edit sent items using POS app
    price_adjustment:
      type: boolean
      description: True if this user is able to adjust item price using POS app.
    change_order_tax:
      type: boolean
      description: True if this user is able to change tax using POS app.
    report:
      type: boolean
    show_save_price:
      type: boolean
      description: True if this user is able to see save price button on POS app.
    open_item:
      type: boolean
      description: True if this user is able to open new item on POS app.
    cash_report_edit:
      type: boolean
      description: True if this user is able to edit cash report using POS app.
    tip_calculator:
      type: boolean
      description: True if this user is able to open tip calculator using POS app.
    customer:
      type: boolean
    order:
      type: boolean
      description: True if this user is able to create order using POS app.
    activate_gift_card:
      type: boolean
      description: True if this user is able to activate gift card using POS app.
    must_clockin:
      type: boolean
      description: True if this user is must clockin before using POS app.
    view_shop:
      type: boolean
      description: True if this user is able to order shop item.
    send_offline_mode:
      type: boolean
      description: True if this user is able to send offline mode to pax device.
    promotion:
      type: boolean
      description: True if this user is able to manage promotion.
    promocode:
      type: boolean
      description: True if this user is able to manage promocode.
    allow_close_batch:
      type: boolean
      description: True if allow employee close batch.
    close_all_orders:
      type: boolean
      description: True if allow employee close all orders.
    change_order_employee:
      type: boolean
    delete_item_on_menu:
      type: boolean
      description: True if allow employee delete items on Menu.

Employee:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        country:
          type: string
        state:
          type: string
        zip:
          type: string
        status:
          type: string
          description: Status of this employee, possible values are active and inactive
        email:
          type: string
          description: Use as web admin login account
        password:
          type: string
          description: Use as web admin login account
        permissions:
          $ref: "#/components/schemas/Permissions"
        address:
          type: string
        city:
          type: string
        passkey:
          type: string
          description: Use as POS app identification
        fobkey:
          type: string
        start:
          type: string
          description: The date that employee start working
        payrate:
          type: string
        overtime_payrate:
          type: string
        cash_tip_percentage:
          type: number
          description: The percentage used for tip calculating
        dob:
          type: string
        mobilephone:
          type: string
        delivery_driver:
          type: boolean
          description: True is this employee is also a delivery driver
        jobtitle:
          type: string
        location:
          type: string
        co_owner:
          type: boolean

Merchant:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      required:
        - email
        - password
        - biz_first_name
        - biz_last_name
        - partnerid
      properties:
        partnerid:
          type: string
        biz_legal_country:
          type: string
        owner_country:
          type: string
        status:
          type: string
        store_name:
          type: string
        email:
          type: string
        password:
          type: string
        biz_first_name:
          type: string
        biz_last_name:
          type: string
        biz_phone:
          type: string
        biz_city:
          type: string
        stores:
          type: array
          items:
            $ref: "#/components/schemas/Store"
        groups:
          type: array
          items:
            $ref: "#/components/schemas/GcGroup"

Image:
  type: object
  required:
    - mime
    - file
    - size
  properties:
    mime:
      type: string
    size:
      type: integer
    file:
      type: string

GcGroup:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        stores:
          type: array
          description: list of stores this group belongs to.
          items:
            type: string
        giftcards:
          type: array
          items:
            $ref: "#/components/schemas/Giftcard"

Store:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      required:
        - partnerid
      properties:
        partnerid:
          type: string
          description: the partner's id that this store belongs to.
        status:
          type: string
          description: status of a store, can be either active and inactive.
        biz_legal_country:
          type: string
        owner_country:
          type: string
        store_name:
          type: string
          description: store's brand name.
        biz_first_name:
          type: string
          description: store's contact first name.
        biz_last_name:
          type: string
          description: store's contact last name.
        biz_phone:
          type: string
          description: store's contact phone.
        biz_city:
          type: string
          description: store's city.
        biz_email:
          type: string
          description: store's contact email.
        biz_country:
          type: string
          description: store's country.
        biz_zip:
          type: string
          description: store's zip.
        biz_address:
          type: string
          description: store's address.
        logo:
          $ref: "#/components/schemas/Image"
        expiration_date:
          type: string
        incorp:
          type: string
        isActive:
          type: boolean
        vaultKey:
          type: string
        creditCardId:
          type: integer
        cardInfo:
          type: object
          properties:
            cardNoFirst6:
              type: string
            cardNoLast4:
              type: string
            cardExpMM:
              type: string
            cardExpYY:
              type: string
            cardType:
              type: string
        achId:
          type: integer
        bankInfo:
          type: object
          properties:
            ddaLast4:
              type: string
            abaLast4:
              type: string
            achName:
              type: string
            accountType:
              type: string
        isPaymentActive:
          type: boolean
        current_version:
          type: string
          description: The current main PC version
        latest_version:
          type: string
          description: The latest main PC version that is available
        owner_security_number:
          type: string
        account_number:
          type: string  
        timezone:
          type: string
        owner_dob:
          type: string      
        terminal_id:
          type: string
        emails:
          type: array
          items:
            type: string

Customer:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        address:
          type: string
        city:
          type: string
        country:
          type: string
        email:
          type: string
        note:
          type: string
        state:
          type: string
        zip:
          type: string
        mobilephone:
          type: string
        company:
          type: string
        customer_no:
          type: number
        reward_points:
          type: number
        deposit_amount:
          type: number

GiftcardLog:
  type: object
  description: Log the history of operation of a giftcard
  properties:
    by:
      type: string
      description: User ID that perform the action
    by_name:
      type: string
      description: User name that perform the action
    at:
      type: string
      description: Station ID that perform the action
    at_name:
      type: string
      description: Station name that perform the action
    type:
      type: string
      description: The type of actions that was perform, possible value are add and subtract
    amount:
      type: number
      description: The amount of this action log
    balance:
      type: number
      description: The balance amount after this action log

Giftcard:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        status:
          type: string
          description: Status of this giftcard, possible value are active/inactive
        balance:
          type: number
          description: The current balance amount
        card_number:
          type: string
          description: The unique number of this card
        logs:
          type: array
          items:
            $ref: "#/components/schemas/GiftcardLog"
        gc_group:
          type: string
          description: Gift card group

Area:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        area_type:
          type: string
          description: Area Type
        layout:
          type: array
          items:
            $ref: "#/components/schemas/Table"
        delivery_auto_increment:
          type: boolean
          description: True if this area is for delivery
        customer_info:
          type: boolean
          description: True if this area should prompt for customer info
        order:
          type: number
          description: The order in which this area will be displayed in POS app
        apply_tax:
          type: boolean
          description: True if this created order for this area should have tax by default
        item_price_type:
          type: string
          description: Item price type
        quick_pay:
          type: boolean
          description: True if apply quick pay
        quick_payment_type:
          type: string
          description: quick payment type
        pay_with_save_send:
          type: boolean
          description: True if order belongs to this area should pay when send/save
        auto_claim:
          type: boolean
          description: True if auto claim
        show_time_lapsed:
          type: boolean
          description: True if show time lapsed
        print_check_with_save_send:
          type: boolean
          description: True if order belongs to this area should print check when send/save
        no_of_guest:
          type: boolean
          description: True if this area should prompt for number of guest
        service_fee_prompt:
          type: boolean
          description: True if this area should prompt for service fee inputs
        delivery_fee_prompt:
          type: boolean
          description: True if this area should prompt for delivery fee inputs
        misc_prompt:
          type: boolean
          description: True if this area should prompt for misc prompt
        condiments:
          type: boolean
          description: True if this area should prompt for condiments
        plastic_utensils:
          type: boolean
          description: True if this area should prompt for plastic utensils
        pickup_delivery_prompt:
          type: boolean
          description: True if this area should prompt for pickup/delivery time inputs
        time_delay:
          type: number
          description: Pickup/delivery time inputs
        togo_auto_increment:
          type: boolean
          description: True if this area is for TOGO
        check_copies:
          type: string
        receipt_settings:
          type: array
          items:
            $ref: "#/components/schemas/ReceiptSettings"
        kitchen_receipts:
          type: array
          items:
            type: string
        payment_types:
          type: array
          items:
            type: string
        auto_assign:
          type: boolean
        assigned_employee:
          type: string
        payment_type_for_order_pay:
          type: string
        printer_group_items:
          type: array
          items:
            type: object
            properties:
              printer_id:
                type: string
              items:
                type: array
                items:
                  type: number
        pay_first_send_later:
          type: boolean

ReceiptSettings:
  type: object
  description: Receipt settings for an Area.
  properties:
    payment_type:
      type: string
      description: payment type's id.

    auto:
      type: boolean
      description: auto print ReceiptSettings

    merchant_copy:
      type: boolean
      description: print merchant copy

    customer_copy:
      type: boolean
      description: print customer copy

    check_copy:
      type: boolean
      description: check copy
Table:
  type: object
  description: Contain information about a single table including its position and size.
  properties:
    ppl:
      type: number
      description: Number of people that can sit this table
    type:
      type: string
      description: Shape of this table, possible values are rectangle/ellipse
    left:
      type: number
      description: Left position
    top:
      type: number
      description: Top position
    width:
      type: number
      description: Table width
    height:
      type: number
      description: Table height
    angle:
      type: number
      description: Rotation angle

Category:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        hidden:
          type: boolean
          description: True if this category should not be displayed in POS app for ordering
        show_on_web_order:
          type: boolean
          description: True if this category should be displayed in web order
        category_types:
          type: array
          items:
            type: string
          description: The types of category to be grouped in POS app
        category_buckets:
          type: array
          items:
            type: string
          description: The bucket of category
        printers:
          type: array
          items:
            $ref: "#/components/schemas/PrinterReceipt"
        kitchen_displays:
          type: array
          items:
            $ref: "#/components/schemas/KitchenDisplay"
        color:
          type: string
          description: The display color on menu of POS app
        order:
          type: string
          description: The display order inside a category group
        open_item:
          type: boolean
          description: True if this category can open new item when ordering on PC/iPad
        description:
          type: string
          description: Category description
        schedules:
          $ref: "#/components/schemas/CategorySchedules"
        gift_card:
          type: boolean
          description: True if user can create gift cards for this category
        gift_certificate:
          type: boolean
          description: True if user can create gift certificates for this category
        display_order:
          type: number
          description: The display order of this category in online ordering.
        max_display_count:
          type: number

CategorySchedules:
  type: object
  properties:
    always_available:
      type: boolean
      description: True if this category is always available to order
    unavailable_message:
      type: string
      description: The message show in web order when category is not available.
    available_hours:
      description: list of from/to available hours in weeks.
      type: array
      items:
        $ref: "#/components/schemas/CategoryScheduleHour"

CategoryScheduleHour:
  type: object
  properties:
    day_of_week:
      type: number
      description: date of week in number.
    is_available:
      type: boolean
      description: true if it this is a available day, false otherwise.
    from_1:
      type: string
      description: first period start time.
    to_1:
      type: string
      description: first period end time.
    from_2:
      type: string
      description: second period start time.
    to_2:
      type: string
      description: second period end time.

CategorySummary:
  type: object
  properties:
    id:
      type: string
      description: the Category's ID
    name:
      type: string
      description: the Category's Name
    item_count:
      type: number
      description: the number of Items belongs to this Category

Item:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        hidden:
          type: boolean
          description: >-
            True if this item is unavaible in store and should not be displayed in POS app for
            ordering
        modifiers:
          type: array
          items:
            $ref: "#/components/schemas/ModelRef"
        notes:
          type: array
          items:
            $ref: "#/components/schemas/ModelRef"
        printers:
          type: array
          items:
            $ref: "#/components/schemas/ModelRef"
        color:
          type: string
          description: The display color on menu of POS app
        imported_id:
          type: string
        name2:
          type: string
          description: The second name of item with special language
        oldmodifiers:
          type: array
          items:
            $ref: "#/components/schemas/ModelRef"
        price:
          type: number
          description: The price of item
        barcode:
          type: number
          description: The item barcode
        non_taxable:
          type: boolean
          description: True if this item is non-taxable
        category:
          type: string
          description: The category ID that this item belong to
        category_name:
          type: string
          description: The category name that this item belong to
        selected:
          type: boolean
          description: True if this item is selected for modifier (use in editting modifier)
        image:
          $ref: "#/components/schemas/Image"
        quantity:
          type: number
        online:
          type: number
        display_order:
          type: number
        kitchen_displays:
          type: array
          items:
            $ref: "#/components/schemas/ModelRef"

Modifier:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        multiple:
          type: boolean
          description: True if this modifier can select multiple options
        global:
          type: boolean
          description: True if this modifier can be applied to all items
        prefix:
          type: string
          description: The prefix of modifier that will be added next to option modifier name
        online_ordering:
          type: boolean
          description: True if this modifier will be shown in online ordering
        options:
          type: array
          items:
            $ref: "#/components/schemas/ModifierOption"
        items:
          type: array
          description: The items that this modifier is used
          items:
            $ref: "#/components/schemas/ModelRef"
        olditems:
          type: array
          description: Old references of items
          items:
            $ref: "#/components/schemas/ModelRef"
        color:
          type: string
        modifier_display:
          type: string

ModifierOption:
  allOf:
    - $ref: "#/components/schemas/ModelRef"
    - type: object
      properties:
        name:
          type: string
          description: the name of this option.
        name2:
          type: string
          description: the extra name (normally in different language) of this option.
        display_order:
          type: number
        price:
          type: number
          description: the price of this option.
        percent:
          type: number
        sub_modifier_id:
          type: string
          description: the ID of sub-modifier.
        color:
          type: string
          description: the color of this option.
        required_level:
          type: string
          description: required level for sub modifier.
        is_modifier_color:
          type: boolean
        display_on:
          type: string

Station:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        enabled:
          type: boolean
          description: True if this station is one of devices to run POS.
        location:
          type: string
          description: This is location that station belong to
        ccdevice:
          type: string
          description: This device will be used on station
        station_type:
          type: string
          description: The type of station can be PC or iPad
        printer:
          type: string
          description: This is printer default of station
        oo_printer:
          type: string
        ip_address:
          type: string
        station_id:
          type: string
          description: iPad station id
        mac_address:
          type: string
        mac_address_2:
          type: string
        mac_address_3:
          type: string
        main:
          type: boolean
          description: True if this station is Main.
        on_screen_signature:
          type: boolean
          description: If it's true, allow customer signature when make a payment by card.
        on_screen_tip_prompt:
          type: boolean
        main_print:
          type: boolean

BillingStation:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        stationType:
          type: string
          description: The type of station can be PC or iPad
        main:
          type: boolean
          description: True if this station is Main.
        quantity:
          type: number
        storeName:
          type: string
        fee:
          type: number
        flatFee:
          type: number
        rate:
          type: number
        total:
          type: number

CCDevice:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        enabled:
          type: boolean
          description: True if this device still be connected.
        location:
          type: string
          description: This is location that device belong to
        ccdevice_type:
          type: string
          description: This is cc device type.
        ip_address:
          type: string
        mac_address:
          type: string
        serial_number:
          type: string
        show_tip_guide_on_pax_device:
          type: boolean
Admin:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        email: 
          type: string
        first_name: 
          type: string
        last_name: 
          type: string
        password:
          type: string
        passkey:
          type: string
        access_all_stores: 
          type: boolean
        permissions:
          $ref: "#/components/schemas/AdminPermissions"
AdminPermissions:
  type: object
  properties:
    access_partners:
      type: boolean
    access_reports:
      type: boolean
    all_stations:
      type: boolean
    app_setting:
      type: boolean
    billings:
      type: boolean
    error_log_list:
      type: boolean
    invoices:
      type: boolean
    partners:
      type: boolean
    reports:
      type: boolean
    shop_items:
      type: boolean
    shop_orders:
      type: boolean
    stores:
      type: boolean
    store_info:
      type: boolean
    holidays:
      type: boolean
SuperAdmin:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        email:
          type: string
        password:
          type: string
AppSettings:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        masterPickupRate:
          type: number
        masterDeliveryRate:
          type: number
        masterPickupFlatFee:
          type: number
        masterDeliveryFlatFee:
          type: number
        master_pin:
          type: number
        support_emails:
          type: array
          description: list of support email
          items:
            $ref: "#/components/schemas/SuperAdminSupportEmail"
        goemerchant:
          $ref: "#/components/schemas/GoEConfig"
        doordash:
          $ref: "#/components/schemas/DoorDashConfig"
        holidays:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              date:
                type: string
              country:
                type: string
SuperAdminSupportEmail:
  type: object
  description: Super admin Support Emails
  properties:
    email:
      type: string
GoEConfig:
  type: object
  description: Go E-Merchant Config
  properties:
    merchantKey:
      type: string
    achProcessorId:
      type: string
    motoProcessorId:
      type: string
    categoryText:
      type: string
DoorDashConfig:
  type: object
  description: Door Dash Config
  properties:
    apiKey:
      type: string
    apiKeyStaging:
      type: string
    webhookApiKey:
      type: string

Settings:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        published:
          type: boolean
          description: true if this Store can be listed under WebOrder's stores page.
        is_show_auth:
          type: boolean
        accept_online_order:
          type: boolean
          description: true if this Store is accepting online order, false if the online store is for preview only.
        accept_dinein:
          type: boolean
          description: true if this Store is allowing dinein for online.
        accept_delivery:
          type: boolean
          description: true if this Store is allowing delivery for online orders.
        delay_delivery_time:
          type: number
          description: the time delay that we do auto Move and Send before delivery time.
        accept_pickup:
          type: boolean
          description: true if this Store is allowing pickup for online orders.
        delay_pickup_time:
          type: number
          description: the time delay that we do auto Move and Send before pickup time.
        delay_dinein_time:
          description: the auto move/send time in minutes for delay dinein time.
          type: number
        accept_online_payment:
          type: boolean
          description: true if this Store is allowing online payment.
        auto_move_send:
          type: boolean
          description: true if online Order should be automatically moved and sent.
        auto_move_send_right_way:
          type: boolean
        payment_settings:
          $ref: "#/components/schemas/PaymentSettings"
        auto_close_batch_settings:
          $ref: "#/components/schemas/AutoCloseBatchSettings"
        email_close_batch_settings:
          $ref: "#/components/schemas/EmailCloseBatchSettings"
        web_order_confirm_message:
          type: string
          description: the message to be displayed after online order is submitted.
        web_order_notification_emails:
          type: string
          description: the list of emails to received new order notification.
        ffd_images:
          type: array
          description: list of images to be display on WebOrder's front facing screen.
          items:
            $ref: "#/components/schemas/Image"
        ffd_show_item_name_2:
          type: boolean
          description: show name 2
        ffd_messages_line1:
          type: string
          description: 1st line to be diplayed on front facing screen after finishing an Order.
        ffd_messages_line2:
          type: string
          description: 2nd line to be diplayed on front facing screen after finishing an Order.
        ffd_messages_line3:
          type: string
          description: 3rd line to be diplayed on front facing screen after finishing an Order.
        ffd_idle_timeout:
          type: number
        thanks_messages_line1:
          type: string
          description: >-
            1st line to be diplayed on confirm tip screen after adjuting tip.
        thanks_messages_line2:
          type: string
          description: >-
            2nd line to be diplayed on confirm tip screen after adjuting tip.
        thanks_messages_line3:
          type: string
          description: >-
            3rd line to be diplayed on confirm tip screen after adjuting tip.
        thanks_messages_line4:
          type: string
          description: >-
            4th line to be diplayed on confirm tip screen after adjuting tip.
        thanks_messages_line5:
          type: string
          description: >-
            5th line to be diplayed on confirm tip screen after adjuting tip.
        fixed_delivery_fee:
          type: number
          description: fixed delivery fee to be applied to online orders.
        payment_types:
          type: array
          description: list of custom payment types.
          items:
            $ref: "#/components/schemas/PaymentType"
        default_payment_types:
          type: array
          description: list of default payment types.
          items:
            $ref: "#/components/schemas/PaymentType"
        deliverect_sub_payment_types:
          type: array
          description: list of deliverect sub payment types.
          items:
            $ref: "#/components/schemas/PaymentType"
        delivery_settings:
          $ref: "#/components/schemas/OnlineOrderDeliverySettings"
        web_order_tip_settings:
          $ref: "#/components/schemas/OnlineOrderTipSettings"
        web_order_footnotes_settings:
          $ref: "#/components/schemas/OnlineOrderFootnotesSettings"
        web_order_landing_page_settings:
          $ref: "#/components/schemas/OnlineOrderInfoPageSettings"
        web_order_biz_hour_settings:
          $ref: "#/components/schemas/OrderingBizHourSettings"
        web_order_holiday_settings:
          $ref: "#/components/schemas/OrderingHolidaySettings"
        web_order_locale_settings:
          description: locale settings for online store.
          $ref: "#/components/schemas/OrderingLocale"
        web_order_custom_fee_settings:
          $ref: "#/components/schemas/OnlineOrderCustomFeeSettings"
        web_order_table_ordering_settings:
          $ref: '#/components/schemas/OnlineOrderTableOrderingSettings'
        web_order_view:
          type: boolean
          description: the way web order is displayed.
        kiosk_landing_page_settings:
          $ref: "#/components/schemas/KioskLandingPageSettings"
        kiosk_discount_settings:
          type: array
          description: kiosk discount settings
          items:
            $ref: "#/components/schemas/KioskDiscountSettings"
        kiosk_tip_settings:
          $ref: "#/components/schemas/KioskTipSettings"
        online_order_catering_settings:
          $ref: "#/components/schemas/OnlineOrderCateringSettings"
        status_board_settings:
          $ref: "#/components/schemas/StatusBoardSettings"
        show_name_2:
          type: boolean
          description: show item name 2.
        web_order_show_category_types:
          type: boolean
          description: true to enable displaying of category types, false otherwise.
        web_order_show_special_note:
          description: true to show special note and special note amount, false otherwise.
          type: boolean
        web_order_sync_handle_order:
          description: true to live sync the handle online order process.
          type: boolean
        web_order_version:
          description: the version of the web order.
          type: string
        pause_online_ordering:
          description: type of online order pause period. Value is stored as a number based on the enum defined on the client.
          type: number
        pause_online_ordering_before:
          description: The time is determine to able submit online order
          type: string
        sms_order_received:
          description: true to send sms when order received, false otherwise.
          type: boolean
        sms_order_prepared:
          description: true send sms when order prepared, false otherwise.
          type: boolean
        refund_code:
          type: object
          properties:
            code:
              type: string
            owner_list:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  information:
                    type: string
        onscreen_signature:
          type: object
          properties:
            tip_1:
              type: number
            tip_2:
              type: number
            tip_3:
              type: number
            no_tip_button:
              type: boolean
            tip_for_gg:
              type: array
              items:
                type: number
        nicha_auto_trim:
          type: boolean
        nicha_frequency:
          type: string
        nicha_payment_settings:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              type:
                type: string
              minimum_cc_charge:
                type: number
              surcharge_amt:
                type: number
              surcharge_percent:
                type: number
              surcharge_name:
                type: number
              prompt_surcharge:
                type: boolean
              always_prompt_surcharge:
                type: boolean
        online_channels:
          type: array
          description: online channels (include Deliverect)
          items:
            $ref: "#/components/schemas/OnlineOrderingChannel"
        deliverect_price_type:
          type: string
          description: the price type for Deliverect.
        deliverect_sync_name_type:
          type: string
          description: the name type need to be sync for Deliverect.
        is_ffd_show_email_and_text:
          type: boolean
          description: Show/Hide the email field and the text field
        taxes:
          type: array
          items:
            $ref: "#/components/schemas/SettingTax"
        discounts:
          type: array
          items:
            $ref: "#/components/schemas/SettingDiscount"
        apply_cash_discount:
          type: boolean
        cash_discount_percentage:
          type: number
        void_order_reasons:
          type: array
          items:
            $ref: "#/components/schemas/SettingReason"
        void_transaction_reasons:
          type: array
          items:
            $ref: "#/components/schemas/SettingReason"
        min_cc_charge:
          type: number
        surcharge_amt:
          type: number
        surcharge_percent:
          type: number
        prompt_surcharge:
          type: boolean
        always_prompt_surcharge:
          type: boolean        
        show_debit:
          type: boolean
        card_sub_payment_types:
          type: array
          items:
            $ref: "#/components/schemas/PaymentType"
        debit_sub_payment_types:
          type: array
          items:
            $ref: "#/components/schemas/PaymentType"
        cash_sub_payment_types:
          type: array
          items:
            $ref: "#/components/schemas/PaymentType"
        gift_card_sub_payment_types:
          type: array
          items:
            $ref: "#/components/schemas/PaymentType"
        gift_certificate_sub_payment_types:
          type: array
          items:
            $ref: "#/components/schemas/PaymentType"
        r_points_sub_payment_types:
          type: array
          items:
            $ref: "#/components/schemas/PaymentType"
        deposit_sub_payment_types:
          type: array
          items:
            $ref: "#/components/schemas/PaymentType"
        auto_clock_out_time:
          type: string
        work_hours:
          type: string
        timecard_from:
          type: string
        timecard_to:
          type: string
        clockoutreasons:
          type: array
          items:
            $ref: "#/components/schemas/ClockOutReason"
        is_default_tip_1:
          type: boolean
        is_default_tip_2:
          type: boolean
        is_default_tip_3:
          type: boolean
        is_default_no_tip:
          type: boolean
        is_default_custom_tip:
          type: boolean
        no_tip:
          type: boolean
        show_tip_line_only:
          type: boolean
        tip_1:
          type: number
        tip_2:
          type: number
        tip_3:
          type: number
        tip_for_ggs:
          type: array
          items:
            $ref: "#/components/schemas/TipForGG"
        spent_amount:
          type: number
          description: The amount spent.
        earned_points:
          type: number
          description: The points earned.
        show_customer_no:
          type: boolean
          description: Flag to show the customer number field.
        show_r_point:
          type: boolean
          description: Flag to show the R-Point field.
        auto_accumulative:
          type: boolean
          description: Flag for auto accumulative.
        show_add_subtract_buttons:
          type: boolean
          description: Flag to show the add/subtract buttons.
        redeem_amount:
          type: number
          description: The amount to redeem.
        redeem_points:
          type: number
          description: The points to redeem.
        close_batch_email:
          type: boolean
        close_shift_email:
          type: boolean
        close_shift_reports:
          type: array
          items:
            type: string
        available_color:
          type: string
          description: The available color.
        occupied_color:
          type: string
          description: The occupied color.
        selected_color:
          type: string
          description: The selected color.
        checked_color:
          type: string
          description: The checked color.
        must_close_all_tables:
          type: boolean
          description: Flag to close all tables when closing batch.
        check_owner_table:
          type: boolean
          description: Flag to check table ownership.
        auto_sync_at_shift_close:
          type: boolean
          description: Flag for auto sync at shift close.
        start_time:
          type: string
          format: date-time
          description: The start time.
        end_time:
          type: string
          format: date-time
          description: The end time.
        timeout:
          type: integer
          description: The idle timeout.
        auto_ok:
          type: integer
          description: The auto OK time.
        close_shift_time:
          type: string
          format: date-time
          description: The automatic close shift time.
        inactive_close_batch:
          type: string
          format: date-time
          description: The time when batch becomes inactive.
        beep_sound:
          type: boolean
          description: Flag for beep on touch.
        sound:
          type: string
          description: The sound type.
        max_shift_duration:
          type: integer
          description: The maximum shift duration.
        support_1:
          type: string
          description: The first support text.
        support_2:
          type: string
          description: The second support text.
        support_3:
          type: string
          description: The third support text.
        group_gratuities:
          type: array
          items:
            $ref: "#/components/schemas/GroupGratuity"
        auto_trim:
          type: boolean
        frequency:
          type: string
        group_gratuity_tax:
          type: number
        show_send_later:
          type: boolean
        send_prompt: 
          type: boolean
        print_void_receipt:
          type: boolean
        live_sync: 
          type: boolean
        allow_cashback:
          type: boolean
        maximum_cashback:
          type: number
        is_use_with_credit:
          type: boolean
        is_use_with_debit:
          type: boolean
        quick_options:
          type: array
          items:
            $ref: '#/components/schemas/QuickOption'
        default_tip:
          type: number
          description: The default tip.

QuickOption:
  type: object
  properties:
    type:
      type: string
    is_default:
      type: boolean
    amount:
      type: boolean       

GroupGratuity:
  type: object
  properties:
    id:
      type: string
    percent:
      type: number
    number:
      type: number

ClockOutReason:
  type: object
  properties:
    id:
      type: string
    duration:
      type: string
    time:
      type: string    
    name:
      type: string

TipForGG:
  type: object
  properties:
    id:
      type: string
    percent:
      type: number

SettingTax:
  type: object
  properties:
    id:
      type: string
    created_at:
      type: string
    name:
      type: string
    percent:
      type: number
    default:
      type: boolean

SettingDiscount:
  type: object
  properties:
    id:
      type: string
    name:
      type: string
    percent:
      type: number
    amount:
      type: number

SettingReason:
  type: object
  properties:
    id:
      type: string
    name:
      type: string
    created_at:
      type: string
    type:
      type: string

StatusBoardSettings:
  type: object
  description: status board settings
  properties:
    apply:
      type: boolean
      description: True if the status board is applied
    areas:
      type: array
      description: List of area that apply status board
      items:
        type: string

PaymentSettings:
  type: object
  description: payment settings for accepting online payment
  properties:
    payment_type:
      type: string
    auth_net_name:
      type: string
      description: Auth.NET transaction name.
    auth_net_transaction_key:
      type: string
      description: Auth.NET transaction key.
    nmi_name:
      type: string
      description: NMI transaction name.
    nmi_transaction_key:
      type: string
      description: NMI transaction key.
    nmi_apple_wallet_token:
      type: string
      description: NMI Apple Wallet token.
    accept_apple_pay:
      description: Accept Apple Pay
      type: boolean
    sandbox:
      description: Turn on sandbox payment
      type: boolean

AutoCloseBatchSettings:
  type: object
  description: auto close batch settings
  properties:
    enable:
      type: boolean
      description: true if auto close batch enable.
    start_time:
      type: string
      description: The time start to auto close batch.
    end_time:
      type: string
      description: The time end to auto close batch.
    retry_interval:
      type: number
      description: The number to retry.

EmailCloseBatchSettings:
  type: object
  description: email close batch settings
  properties:
    enable:
      type: boolean
      description: true if email close batch enable.
    total_report_by_server:
      type: boolean
      description: true if total report by server.

PaymentType:
  type: object
  description: info about a payment type.
  properties:
    id:
      type: string
    name:
      type: string
      description: name of the payment type.
    sub_payment_types:
      type: array
      description: list of sub payment types.
      items:
        $ref: "#/components/schemas/PaymentType"

OnlineOrderDeliverySettings:
  type: object
  properties:
    accept_delivery:
      type: boolean
      description: true if this Store is allowing delivery for online orders.
    delay_delivery_time:
      type: number
      description: the time delay that we do auto Move and Send before delivery time.
    delivery_time:
      type: number
      description: the time that we delivery.
    delivery_type:
      type: string
    third_party_delivery_button_link:
      type: string
      description: text of delivery button link.
    third_party_delivery_button_text:
      type: string
      description: "text of third party delivery button"
    accept_delivery_amount:
      type: number
      description: minimum order amount to accept delivery.
    free_delivery_amount:
      type: number
      description: the minimum order amount to have free delivery.
    maximum_delivery_distance:
      type: number
      description: the maximum distance to accept delivery.
    use_fixed_delivery_fee:
      type: boolean
      description: true if a fixed delivery fee should be applied.
    fixed_delivery_fee:
      type: number
      description: the fixed delivery fee to be applied.
    delivery_from_address:
      description: the address where order got delivered from.
      $ref: "#/components/schemas/Place"
    delivery_fees:
      type: array
      description: list of distance/fee combinations.
      items:
        $ref: "#/components/schemas/DeliveryFee"
    postmates_settings:
      $ref: "#/components/schemas/PostmatesSettings"
    doordash_settings:
      $ref: "#/components/schemas/DoordashSettings"

PostmatesSettings:
  type: object
  properties:
    customer_id:
      type: string
    authorize_key:
      type: string
DoordashSettings:
  type: object
  properties:
    is_api_key_production:
      type: boolean

OnlineOrderTipSettings:
  type: object
  properties:
    enable_tip_guides:
      type: boolean
      description: true to enable tip guides, false otherwise.
    split_tip_for_restaurant_staff:
      type: boolean
    default_tip_for_staff:
      type: number
    default_tip_for_driver:
      type: number
    tip_guides:
      description: the tip guides to be suggested for online ordering.
      type: array
      items:
        type: number
    default_tip_guide:
      type: number
      description: the default selected tip guide index
    note:
      type: string
      description: the note for tip guide
    note_for_online_ordering:
      type: string

OnlineOrderCateringSettings:
  type: object
  properties:
    enable_online_catering:
      type: boolean
      description: true to enable online catering, false otherwise.
    area:
      type: string
      description: area of online catering

OnlineOrderFootnotesSettings:
  type: object
  properties:
    enable_footnotes:
      type: boolean
      description: true to enable footnotes on weborder, false otherwise.
    no_plastic_utensils:
      type: boolean
      description: true if no use plastic utensils.
    no_contactless_delivery:
      type: boolean
      description: true if dont use contactless delivery.
    custom_note:
      type: boolean
      description: true to enable custom note

KioskTipSettings:
  type: object
  properties:
    enable_tip_guides:
      type: boolean
      description: true to enable tip guides, false otherwise.
    tip_guides:
      description: the tip guides to be suggested for online ordering.
      type: array
      items:
        type: number

KioskDiscountSettings:
  type: object
  properties:
    is_apply:
      type: boolean
      description: "true to apply discount"
    name_discount:
      type: string
      description: "name of discount"
    percent:
      type: number
      description: "number percentage of discount"

KioskLandingPageSettings:
  type: object
  properties:
    enable_landing_page:
      type: boolean
      description: "true to enable info page, false otherwise."
    enable_table_tent_prompt:
      type: boolean
    use_kiosk:
      type: boolean
      description: true to display kiosk areas on station, false otherwise.
    kiosk_view:
      type: boolean
      description: "the type that menu kiosk will be displayed ."
    special_note:
      type: boolean
      description: "true to show special note and special note amount, false otherwise."
    text_line:
      type: boolean
      description: "true to enable text lines, false otherwise."
    text_1:
      type: string
      description: "Introduction text 1 on Kiosk landing Page"
    text_2:
      type: string
      description: "Introduction text 2 on Kiosk landing Page"
    dine_in_order_button_text:
      type: string
      description: "text of delivery button"
    to_go_order_button_text:
      type: string
      description: "text of pickup button"

OnlineOrderInfoPageSettings:
  type: object
  properties:
    show_store_logo:
      type: boolean
    enable_info_page:
      type: boolean
      description: "true to enable info page, false otherwise."
    enable_text_line:
      type: boolean
      description: "true to enable text line, false otherwise."
    delivery_button_text:
      type: string
      description: "text of delivery button"
    pickup_button_text:
      type: string
      description: "text of pickup button"
    dinein_button_text:
      type: string
      description: "text of dinein button"
    third_party_delivery_button_link:
      type: string
      description: "text of delivery button link"
    enable_store_address:
      type: boolean
      description: "true to enable store address, false otherwise."
    enable_store_phone:
      type: boolean
      description: "true to enable store phone, false otherwise."
    enable_store_email:
      type: boolean
      description: "true to enable store email, false otherwise."
    store_email:
      type: string
      description: to be displayed as email of store.
    enable_payment_icon:
      type: boolean
      description: "true to enable payment icon, false otherwise."
    intro_text_1:
      type: string
      description: to be displayed as introduction to store.
    intro_text_2:
      type: string
      description: to be displayed as introduction to store.

OrderingBizHourSettings:
  type: object
  properties:
    enable_biz_hours:
      type: boolean
      description: true to enable biz hours, false otherwise.
    biz_hours:
      description: list of from/to working hours in weeks.
      type: array
      items:
        $ref: "#/components/schemas/OrderingBizHour"

OrderingBizHour:
  type: object
  properties:
    day_of_week:
      type: number
      description: date of week in number.
    is_working:
      type: boolean
      description: true if it this is a working day, false otherwise.
    from_1:
      type: string
      description: first period start time.
    to_1:
      type: string
      description: first period end time.
    from_2:
      type: string
      description: second period start time.
    to_2:
      type: string
      description: second period end time.

OrderingHolidaySettings:
  type: object
  description: holidays and special days setting for online ordering.
  properties:
    holidays:
      type: array
      description: list of holidays and special days for this store
      items:
        $ref: "#/components/schemas/OrderingHoliday"

OnlineOrderingChannel:
  type: object
  description: channel for online ordering (include Deliverect).
  properties:
    name:
      type: string
      description: name of channel
    channel_link:
      type: string
      description: channel link
    pickup_display_name:
      type: string
      description: pick-up display name
    delivery_display_name:
      type: string
      description: delivery display name
    payment_type:
      type: string
      description: payment type

OrderingHoliday:
  allOf:
    - $ref: "#/components/schemas/ModelRef"
    - type: object
      description: holiday or special day for ordering.
      properties:
        name:
          type: string
          description: the name of this holiday.
        date:
          type: string
          description: the date (YYYY-MM-DD) of this holiday.
        displayDate:
          type: string
          description: the display date for Web Admin of this holiday.
        is_working:
          type: boolean
          description: True if the store is still working in this holiday.
        from_1:
          type: string
          description: first period start time.
        to_1:
          type: string
          description: first period end time.
        from_2:
          type: string
          description: second period start time.
        to_2:
          type: string
          description: second period end time.

OrderingLocale:
  type: object
  properties:
    locale:
      type: string
      description: standard locale-string, ex. en-US, fi-FI, vi-VN
    currency:
      type: string
      description: standard currency, ex. USD, EUR, VND

OnlineOrderTableOrderingSettings:
  type: object
  properties:
    show_customer_info:
      type: boolean
      description: true to show customer info, false otherwise.
    show_tip:
      type: boolean
      description: true to show tip, false otherwise.
    show_payment_info:
      type: boolean
      description: true to show payment info, false otherwise.
    auto_send_to_kitchen:
      type: boolean
      description: true to auto send to kitchen, false otherwise.

OnlineOrderCustomFeeSettings:
  type: object
  properties:
    name:
      type: string
    amount:
      type: number
    custom_fee_percent:
      $ref: "#/components/schemas/CustomFeePercent"

CustomFeePercent:
  type: object
  properties:
    name:
      type: string
    percent:
      type: number
      description: the percent to be applied to the subtotal amount.

DeliveryFee:
  type: object
  description: combination of minimum distance and fee to apply.
  properties:
    distance:
      type: number
      description: the mininum distance (in miles) for the fee to be applied.
    fee:
      type: number
      description: the delivery fee amount to be applied.

Printer:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        location:
          type: string
          description: This is location that printer belong to
        printer_model:
          type: string
          description: This is model of printers. Currently, we have StarTSP100, StartSP700 and BrotherQL820
        printer_type:
          type: string
          description: This is printer type.
        mac_address:
          type: string
        ip_address:
          type: string
        backup_printer:
          type: string
          description: If the printer is not connected or fail printing, kitchen receipt will be printed on Backup printer.
        enabled:
          type: boolean
          description: True if this printer still be connected.
        has_buzzer:
          type: boolean
          description: True if this printer has buzzer.

Screen:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        screen_type:
          type: string
          description: Type of the screen
        top_image:
          description: the image to be displayed on top of the screen.
          $ref: "#/components/schemas/Image"
        top_image_height:
          type: number
          description: height of the top image.
        bottom_image:
          description: the image to be displayed on bottom of the screen.
          $ref: "#/components/schemas/Image"
        bottom_image_height:
          type: number
          description: height of the top image.
        menu:
          $ref: "#/components/schemas/ScreenMenuSettings"

ScreenMenuSettings:
  type: object
  description: the menu settings of this screen
  properties:
    background:
      type: string
      description: TV signage background color.
    category_color:
      type: string
      description: TV signage category text color.
    category_font_size:
      type: number
      description: TV signage category text size.
    item_color:
      type: string
      description: TV signage item text color.
    item_font_size:
      type: number
      description: TV signage item text size.
    description_color:
      type: string
      description: TV signage item's description text color.
    description_font_size:
      type: number
      description: TV signage item's description text size.
    dense:
      type: boolean
      description: true to cramp items together.
    columns_count:
      type: number
      description: TV signage columns count.
    columns:
      type: array
      description: the list of columns in this screen, should contain 1 to 3 elements.
      items:
        $ref: "#/components/schemas/ScreenCol"
    show_name_2:
      type: boolean
      description: true to show name 2 of item

ScreenCol:
  type: object
  description: represent a single column inside a screen
  properties:
    cells:
      type: array
      description: the list of cells in this column
      items:
        $ref: "#/components/schemas/ScreenCell"
    list_thumbnail:
      type: string
      description: set list or thumbnail for columns

ScreenCell:
  type: object
  description: represent a single cell inside a menu column
  properties:
    id:
      type: string
      description: the id of the cell, in fact this is the id of the source object and thus is not unique
    type:
      type: string
      description: the type of this cell, possible values are category, image, slideshow
    name:
      type: string
      description: the name of the category (applied to category cell only)
    from:
      type: number
      description: the start index of item to be displayed (applied to category cell only)
    to:
      type: number
      description: the end index of item to be displayed (applied to category cell only)
    list_thumbnail:
      type: string
      description: set list or thumbnail for screencell
    height:
      type: number
      description: the height of this cell (applied to slideshow cell and status board cell)
    is_full_height:
      type: boolean
      description: True if this cell is full height in the screen (applied to status board cell only)
    font_size:
      type: number
      description: the font size of content of this cell (applied to status board cell only)
    images:
      type: array
      description: the list of slides to be displayed  (applied to slideshow cell only)
      items:
        $ref: "#/components/schemas/Image"
    show_name_2:
      type: boolean
      description: true to show name 2 of item
    show_on_tv:
      type: boolean
      description: true to show cell on tv

Tax:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        percent:
          type: number
          description: The tax percent to be applied to

OnlineUser:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        customer_name:
          type: string
        customer_email:
          type: string
        customer_phone:
          type: string
        customer_address:
          type: string
        password:
          type: string
        api_message:
          type: string
        place_id:
          type: string

OnlineOrder:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      required:
        - items
      properties:
        order_type:
          type: string
          description: type of this order, possible values are pickup and delivery.
        customer_name:
          type: string
        unique_id:
          type: string
        customer_first_name:
          type: string
        customer_last_name:
          type: string
        customer_email:
          type: string
        customer_phone:
          type: string
        customer_place:
          description: delivery address in Google Map's format.
          $ref: "#/components/schemas/Place"
        customer_place_unit:
          type: string
          description: the apt# or suite# of the place.
        customer_address:
          type: string
        customer_state:
          type: string
        customer_city:
          type: string
        customer_zip:
          type: string
        billing_place:
          description: billing address in Google Map's format.
          $ref: "#/components/schemas/Place"
        billing_phone:
          type: string
        billing_address:
          type: string
        billing_state:
          type: string
        billing_city:
          type: string
        billing_zip:
          type: string
        billing_street:
          type: string
        time:
          type: string
          description: delivery or pickup time in string format
        timeIsoFormat:
          type: string
          description: delivery or pickup time in ISO string format
        is_asap:
          type: boolean
          description: time order type asap or
        subtotal:
          type: number
          description: the subtotal calculated from order items.
        tax_amount:
          type: number
          description: the tax amount calculated from subtotal and tax.
        delivery_distance:
          type: number
          description: the delivery fee amount.
        delivery_fee_amount:
          type: number
          description: the delivery fee amount.
        total:
          type: number
          description: the total of order.
        tip:
          type: number
          description: the tip amount of order.
        no_plastic_utensils:
          type: boolean
          description: no use of plastic utensils.
        contactless_delivery:
          type: boolean
          description: contactless when delivery
        custom_note:
          type: string
          description: custom note from customer.
        quantity:
          type: number
          description: the total items inside this order.
        card:
          $ref: "#/components/schemas/CreditCard"
        items:
          type: array
          items:
            $ref: "#/components/schemas/OrderItem"
        tax:
          $ref: "#/components/schemas/Tax"
        custom_fee:
          $ref: "#/components/schemas/OnlineOrderCustomFeeSettings"
        submit_count:
          type: number
          description: number of time this order has been submitted.
        discount_amount:
          type: number
          description: the discount amount calculated by subtotal and promo code.
        discount:
          $ref: "#/components/schema/PromoCode"
        ref_num:
          type: string
          description: reference number for online order
        quote_id:
          type: string
          description: The delivery quote's ID for Postmates delivery type.
        delivery_quote_duration:
          type: number
          description: The estimated delivery duration of the delivery quote of Postmates.
        is_catering:
          type: boolean
          description: Order is catering will be true. Otherwise is false
        tip_for_driver:
          type: number
        tip_for_restaurant_staff:
          type: number
        default_tip_for_driver:
          type: number
        delivery_type:
          type: string
        table_tent:
          type: number
        error:
          type: object
          properties:
            message:
              type: string
            stack:
              type: string
        table:
          type: string
        is_payment_by_apple_pay:
          type: boolean
        status:
          type: string
        payment_request:
          type: object
          properties:
            id:
              type: string
            expires_at_utc:
              type: string
            is_paying:
              type: boolean
        deliverect:
          type: object
          properties:
            _id:
              type: string
            channelId:
              type: integer
            channelLink:
              type: string
            channelName:
              type: string
            channelOrderDisplayId:
              type: string
            channelOrderId:
              type: string
            location:
              type: string

CreditCard:
  type: object
  description: the payment card used for paying online order
  properties:
    name:
      type: string
      description: card holder name.
    cvc:
      type: string
      description: card code.
    number:
      type: string
      description: card number (no space).
    expiry:
      type: string
      description: card expiration in MMYY format.

OrderItem:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      description: a single order item
      required:
        - modifiers
      properties:
        itemid:
          type: string
          description: id of the item in which this order item is created from.
        categoryid:
          type: string
          description: id of the category in which this order item is created from.
        price:
          type: number
          description: the price of this order item taken from original item.
        count:
          type: number
          description: the quantity of this order item.
        subtotal:
          type: number
          description: this order item subtotal.
        note:
          type: string
          description: special note for the item.
        price_note:
          type: number
          description: special price_note for the item.
        image_url:
          type: string
          description: url to the original item image.
        modifiers:
          type: array
          description: modifier for the items.
          items:
            $ref: "#/components/schemas/OrderModifier"
        non_taxable:
          type: boolean
          description: True if this item is non-taxable
        IsPromotion:
          type: boolean
          description: True if this item is promotion item
        promotion_id:
          type: string
          description: The ID of the promotion that is applied for this item.
        promotion_name:
          type: string
          description: The name of the promotion that is applied for this item.
        promotion_price:
          type: number
          description: The price of the promotion that is applied for this item.
        gift_card:
          type: boolean
          description: true if this item belong to a gift card category.
        gift_certificate:
          type: boolean
          description: true if this  belong to a gift gift certificate category.
        item_note:
          type: string
          description: Note from store.

OrderModifier:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      description: modifier detail for an order item.
      required:
        - options
      properties:
        options:
          type: array
          description: the options of this modifier
          items:
            $ref: "#/components/schemas/OrderOption"
        prefix:
          type: string
        sameline:
          type: boolean

OrderOption:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      description: option for a order modifier.
      properties:
        price:
          type: number
          description: the price of this option taken from original option.
        count:
          type: number
          description: the number of this option that is applied.
        subtotal:
          type: number
          description: this order option subtotal.
        suboptions:
          type: array
          description: this order option sub-options.
          items:
            $ref: "#/components/schemas/OrderOption"
        required_level:
          type: string
          description: required level for sub modifier.

OrderingBaseModel:
  type: object
  required:
    - id
  properties:
    id:
      type: string
      description: id of the ordering object.
    name:
      type: string
      description: name of the ordering object.
    name2:
      type: string
      description: extra name (normally in different language) of the ordering object.

BaseOrderingStore:
  type: object
  properties:
    id:
      type: string
      description: id of the store.
    name:
      type: string
      description: name of the store.
    image_url:
      type: string
    address:
      type: string
      description: address of the store.
    email:
      type: string
      description: email of the store.
    phone:
      type: string
      description: phone of the store.
    description:
      type: string
      description: description of the store.
    accept_order:
      type: boolean
      description: true if this store accept order
        if it is false, then all the Submit Order must be disabled.
    default_view:
      type: boolean
      description: true if the default view is thumbnail mode. If false, it is list mode.
    tax:
      $ref: "#/components/schemas/Tax"
    categories:
      type: array
      description: all categories available for ordering.
      items:
        $ref: "#/components/schemas/OrderingCategory"
    modifiers:
      type: array
      description: all modifiers available for selecting.
      items:
        $ref: "#/components/schemas/OrderingModifier"
    promotions:
      type: array
      description: all promotions available when ordering.
      items:
        $ref: "#/components/schemas/Promotion"
    biz_hours:
      type: array
      description: list of from/to working hours in weeks
      items:
        $ref: "#/components/schemas/OrderingBizHour"
    holidays:
      type: array
      description: list of holidays in year
      items:
        $ref: "#/components/schemas/OrderingHoliday"
    locale:
      description: locale related settings.
      $ref: "#/components/schemas/OrderingLocale"
    show_category_types:
      description: true to show category types, false otherwise.
      type: boolean
    all_category_types:
      description: all category types of store that user has arranged the order.
      type: array
      items:
        type: string
    show_special_note:
      description: true to show special note and special note amount, false otherwise.
      type: boolean
    auto_move_send:
      description: true if auto move/send is enabled.
      type: boolean
    delay_pickup_time:
      description: the auto move/send time in minutes for pickup order.
      type: number
    delay_dinein_time:
      description: the auto move/send time in minutes for delay dinein time.
      type: number
    delay_delivery_time:
      description: the auto move/send time in minutes for delivery order.
      type: number
    delivery_time:
      type: number
      description: the time that we delivery.
    timezone:
      type: string
      description: timezone of the store.

OnlineOrderingStore:
  allOf:
    - $ref: "#/components/schemas/BaseOrderingStore"
    - type: object
      properties:
        timezone:
          type: string
        accept_delivery:
          type: boolean
          description: true if this store accept delivery.
        is_show_auth:
          type: boolean
        accept_dinein:
          type: boolean
          description: true if this store accept dinein.
        accept_pickup:
          type: boolean
          description: true if this store accept pickup.
        accept_online_payment:
          type: boolean
          description: true if this store accept online payment, false then only in-store payment is accepted.
        show_name_2:
          type: boolean
          description: show name 2 of item on order.
        confirm_message:
          type: string
          description: to be displayed before submitting order.
        bill_minimum_amount:
          type: number
          description: given Bill minimum amount to calculate delivery fee.
        bill_maximum_amount:
          type: number
          description: given Bill maximum amount to calculate delivery fee.
        maximum_distance:
          type: number
          description: given maximum distance to calculate delivery fee.
        delivery_settings:
          description: delivery related settings.
          $ref: "#/components/schemas/OnlineOrderDeliverySettings"
        tip_settings:
          description: tip related settings.
          $ref: "#/components/schemas/OnlineOrderTipSettings"
        footnotes_settings:
          description: relates footnotes settings.
          $ref: "#/components/schemas/OnlineOrderFootnotesSettings"
        custom_fee_settings:
          description: custom fee related settings.
          $ref: "#/components/schema/OnlineOrderCustomFeeSettings"
        info_page_settings:
          description: new landing page settings.
          $ref: "#/components/schemas/OnlineOrderInfoPageSettings"
        online_order_catering_settings:
          description: online order catering settings.
          $ref: "#/components/schemas/OnlineOrderCateringSettings"
        kiosk_landing_page_settings:
          description: kiosk landing page setting.
          $ref: "#/components/schemas/KioskLandingPageSettings"
        sync_handle_order:
          description: true to live sync the handle online order process.
          type: boolean
        pause_online_ordering:
          description: type of online order pause period. Value is stored as a number based on the enum defined on the client.
          type: number
        is_sandbox:
          description: Is Sandbox payment
          type: boolean
        apple_wallet_token:
          description: Apple Wallet Token
          type: string
        accept_apple_pay:
          description: Accept Apple Pay
          type: boolean
        pause_online_ordering_before:
          type: string
        version:
          type: string
        category_types:
          type: array
          items:
            type: string

KioskOrderingStore:
  allOf:
    - $ref: "#/components/schemas/BaseOrderingStore"
    - type: object
      properties:
        area_settings:
          type: object
          properties:
            is_apply_tax_kiosk_for_here:
              type: boolean
            is_apply_tax_kiosk_for_togo:
              type: boolean
        main:
          type: string
          description: the in store Main station's IP Address
        accept_dinein:
          type: boolean
          description: true if this store accept dinein.
        accept_takeaway:
          type: boolean
          description: true if this store accept takeaway.
        ccdevice:
          type: string
          description: the PAX device's ID that is bound to this kiosk
        printer:
          type: string
          description: the Printer's ID that is bound to this kiosk
        kiosk_landing_page_settings:
          description: kiosk landing page settings.
          $ref: "#/components/schemas/KioskLandingPageSettings"
        kiosk_discount_settings:
          type: array
          description: kiosk discount settings
          items:
            $ref: "#/components/schemas/KioskDiscountSettings"
        kiosk_tip_settings:
          description: kiosk tip settings.
          $ref: "#/components/schemas/KioskTipSettings"
        promo_codes:
          type: array
          description: the promo codes that apply for kiosk
          items:
            $ref: "#/components/schemas/PromoCode"

OrderingCategory:
  allOf:
    - $ref: "#/components/schemas/OrderingBaseModel"
    - type: object
      properties:
        items:
          type: array
          description: list of items belong to this category.
          items:
            $ref: "#/components/schemas/OrderingItem"
        category_types:
          type: array
          description: list of types this category belongs to.
          items:
            type: string
        category_buckets:
          type: array
          description: list of bucket this category belongs to.
          items:
            type: string
        schedules:
          $ref: "#/components/schemas/CategorySchedules"
        gift_card:
          type: boolean
          description: true if this category is gift card.
        gift_certificate:
          type: boolean
          description: true if this category is gift certificate.

OrderingItem:
  allOf:
    - $ref: "#/components/schemas/OrderingBaseModel"
    - type: object
      properties:
        description:
          type: string
          description: short description for this item
        price:
          type: number
          description: unit price for this item
        imageURL:
          type: string
          description: the full URL of the item's image
        out_of_stock:
          type: string
          description: the out of stock string
        modifiers:
          type: array
          description: the list of modifiers that can be applied to this item
          items:
            description: the extra information about binding the modifier to this item
            type: object
            properties:
              id:
                type: string
                description: the modifier id
              selection_level:
                type: string
                description: the selection level to apply on this modifier for this item
              options:
                type: array
                items:
                  type: string
                description: the list of options ids that can be selected for this modifier on this item
              sameline:
                type: boolean
                description: is same line of modifiers
        non_taxable:
          type: boolean
          description: True if this item is non-taxable
        note:
          type: string
          description: Note to show on menu

OrderingModifier:
  allOf:
    - $ref: "#/components/schemas/OrderingBaseModel"
    - type: object
      properties:
        selection_level:
          type: string
          description: the selection level of this modifier onto the storing item
        options:
          type: array
          description: the available options of this modifier onto the storing item
          items:
            $ref: "#/components/schemas/OrderingOption"
        prefix:
          type: string
        online_ordering:
          type: boolean
          description: True if this modifier will be shown in online ordering
        sameline:
          type: boolean

OrderingOption:
  allOf:
    - $ref: "#/components/schemas/OrderingBaseModel"
    - type: object
      properties:
        price:
          type: number
        suboptions:
          type: array
          description: this option sub-options
          items:
            $ref: "#/components/schemas/OrderingOption"
        out_of_stock:
          type: string
          description: the out of stock type of this option (today or indefinitely).
        required_level:
          type: string
          description: required level for sub modifier.

DSScreen:
  type: object
  description: Wrap all necessary information for displaying of a screen
  properties:
    id:
      type: string
      description: id of this screen
    name:
      type: string
      description: nameof this screen
    background:
      type: string
      description: the background of the screen
    dense:
      type: boolean
      description: true to have no spacing between items
    category_font_size:
      type: number
      description: the font size used to display category
    category_color:
      type: string
      description: the color used to display category
    item_font_size:
      type: number
      description: the font size used to display item
    item_color:
      type: string
      description: the color used to display item
    description_font_size:
      type: number
      description: the font size used to display item's description
    description_color:
      type: string
      description: the color used to display item's description
    top_image_url:
      type: string
      description: the image to be displayed as top image
    top_image_height:
      type: number
      description: the height of top image banner
    bottom_image_url:
      type: string
      description: the image to be displayed as bottom image
    bottom_image_height:
      type: number
      description: the height of bottom image banner
    show_name_2:
      type: boolean
      description: true to show name 2 of item
    columns:
      type: array
      description:
        The list of columns to be displayed (should have 1-3 elements only).
        This property only makes sense when the screen type is menu.
      items:
        $ref: "#/components/schemas/DSScreenColumn"

DSScreenColumn:
  type: object
  description: a column inside a digital signage screen
  properties:
    cells:
      type: array
      description: The list of categories/slides to be displayed on this column
      items:
        oneOf:
          - $ref: "#/components/schemas/DSScreenMenuCell"
          - $ref: "#/components/schemas/DSScreenSlideshowCell"
    list_thumbnail:
      type: string
      description: set list or thumbnail for columns

DSScreenCell:
  type: object
  description: a cell inside a digital signage screen
  required:
    - type
  discriminator:
    propertyName: type
  properties:
    type:
      type: string
      description: The type of of object, currently support category and slideshow.
    show_on_tv:
      type: boolean
      description: show on tv

DSScreenMenuCell:
  allOf:
    - $ref: "#/components/schemas/DSScreenCell"
    - properties:
        name:
          type: string
          description: The category name
        items:
          type: array
          description: The list of items in this category
          items:
            $ref: "#/components/schemas/DSScreenMenuCellItem"
        list_thumbnail:
          type: string
          description: set list or thumbnail for screencell
        show_name_2:
          type: boolean
          description: true to show name 2 of item

DSScreenMenuCellItem:
  type: object
  description: a single menu item to be displayed in digital signage.
  properties:
    name:
      type: string
      description: The item name
    name2:
      type: string
      description: The item name2
    description:
      type: string
      description: The item description
    price:
      type: number
      description: The item price
    imageURL:
      type: string
      description: the full URL of the item's image
    show_hide_on_tv:
      type: boolean
      description: true to show item on tv

DSScreenSlideshowCell:
  allOf:
    - $ref: "#/components/schemas/DSScreenCell"
    - description: a single slideshow to be displayed.
      properties:
        fullscreen:
          type: boolean
          description: fullscreen or not fullscreen
        height:
          type: number
          description: heigh of the cell
        images:
          type: array
          items:
            type: string
            description: url to each image

DSScreenStatusBoardCell:
  allOf:
    - $ref: "#/components/schemas/DSScreenCell"
    - description: a single status board to be displayed.
      properties:
        is_full_height:
          type: boolean
          description: True if this status board is full height
        height:
          type: number
          description: height of the cell
        font_size:
          type: number
          description: content font size of the cell

FFDSettings:
  type: object
  description: FFD settings
  properties:
    displaying_time:
      type: number
      description: the duration to keep 1 slide on screen
    images:
      type: array
      items:
        type: string
        description: image url

Place:
  type: object
  description: a google map's Place
  properties:
    description:
      type: string
      description: the full detail of the Place
    place_id:
      type: string
      description: google map's place id
    city:
      type: string
    state:
      type: string
    street:
      type: string
    zip_code:
      type: string

ShopItem:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      required:
        - point
      properties:
        in_store:
          type: boolean
        image:
          $ref: "#/components/schemas/Image"
        point:
          type: number
        image_url:
          type: string
          description: Url to the original item image.

ShopInfo:
  type: object
  description: Shop information
  required:
    - storeBalance
    - items
  properties:
    storeBalance:
      type: number
      description: The K-Rewards Points that the store has
    items:
      type: array
      items:
        $ref: "#/components/schemas/OrderingItem"

ShopOrder:
  type: object
  description: Shop order
  required:
    - id
  properties:
    id:
      type: string
      description: The ID of this shop order
    status:
      type: string
    note:
      type: string
    submit_count:
      type: number
      description: number of time this order has been submitted.
    storeid:
      type: string
      description: The ID of the store that this order belong to.
    storeName:
      type: string
      description: The name of the store that this order belong to.
    totalPoints:
      type: number
      description: Total points of all order items.
    items:
      type: array
      items:
        $ref: "#/components/schemas/OrderItem"

PromoCode:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      required:
        - percent
      properties:
        percent:
          type: number
        apply_to_web_order:
          type: boolean
        apply_to_kiosk:
          type: boolean
        instruction_line_1:
          type: string
        instruction_line_2:
          type: string
        instruction_line_3:
          type: string
        show_on_web_order:
          type: boolean

Gallery:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      required:
        - images
      properties:
        images:
          type: array
          description: list of images for each album.
          items:
            $ref: "#/components/schemas/Image"

RefundCode:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        code:
          type: string
        owner_list:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              information:
                type: string

KitchenDisplay:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        enabled:
          type: boolean
          description: True if this kitchen display is still connected.
        local:
          type: string
          description: The location where this kitchen display is placed.
        is_ready_runner_view:
          type: boolean
        is_done_view:
          type: boolean

Promotion:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        promotion_type:
          type: string
          description: The type of this promotion.
        apply:
          type: boolean
          description: True if this promotion is applied for POS.
        apply_to_web_order:
          type: boolean
          description: True if this promotion is applied for online ordering.
        buy_quantity:
          type: number
          description: The quantity of items that customers need to buy to use this promotion.
        buy_items:
          type: array
          items:
            $ref: "#/components/schemas/Item"
          description: List items, categories that customers need to buy to use this promotion.
        get_quantity:
          type: number
          description: The quantity of items that customers will receive when using this promotion.
        get_items:
          type: array
          items:
            $ref: "#/components/schemas/Item"
          description: List items, categories that customers will receive when using this promotion.
        promotion_percent:
          type: number
          description: The discount percent of the item when customers use this promotion.
        promotion_amount:
          type: number
          description: The discount amount of this promotion in the order item.
        note:
          type: string
        applied_count:
          type: number
          description: The number of times this promotion is applied in online ordering.
        can_apply_count:
          type: number
          description: The number of times this promotion can be applied in online ordering base on the order.

DeliveryQuote:
  type: object
  description: The delivery quote for a pickup order
  properties:
    kind:
      type: string
    id:
      type: string
    created:
      type: string
    expires:
      type: string
    fee:
      type: number
    currency:
      type: string
    dropoff_eta:
      type: string
    duration:
      type: number

KitchenReceiptTemplate:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        storeid:
          type: string
        order_type:
          type: string
        print_name:
          type: boolean
        print_date:
          type: boolean
        print_time:
          type: boolean
        print_table_no:
          type: boolean
        print_no_of_guest:
          type: boolean
        print_server_name:
          type: boolean
        print_transaction:
          type: boolean
        print_items_name_1:
          type: boolean
        print_items_name_2:
          type: boolean
        print_modifier:
          type: boolean
        print_note:
          type: boolean
        print_table_name:
          type: boolean
        print_grouping:
          type: boolean
        print_line_separator:
          type: boolean
        single_quantity:
          type: boolean
        hide_quantity_1:
          type: boolean
        is_default:
          type: boolean
        customer_info:
          type: boolean
        customer_info_table_order:
          type: boolean
        total_item_count:
          type: boolean

PrinterReceipt:
  allOf:
    - $ref: "#/components/schemas/ModelRef"
    - type: object
      properties:
        receipt_id:
          type: string
          description: The kitchen receipt template when using the printer

Order:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        order_no:
          type: number
        order_type:
          type: string
        instore_status:
          type: string
TransactionDetail:
  type: object
  properties:
    transaction:
      $ref: "#/components/schemas/Transaction"
    bill:
      $ref: "#/components/schemas/BillReport"
    order:
      $ref: "#/components/schemas/Order"
Transaction:
  type: object
  properties:
    approved_amount:
      type: number
    area:
      type: string
    area_name:
      type: string
    channels:
      type: array
      items:
        type: string
    id:
      type: string
    status:
      type: string
    trans_type:
      type: string
BillReport:
  type: object
  properties:
    custom_fee:
      type: number
    custom_service_fee_amount:
      type: number
    delivery_fee_amount:
      type: number
    discount:
      type: object
      $ref: "#/components/schemas/DiscountReport"
DiscountReport:
  type: object
  properties:
    adjusted_amount: 
      type: number
    adjusted_percent:
      type: number
    amount:
      type: number
    created_at:
      type: string
    id:
      type: string
    name:
      type: string
    percent:
      type: number
BillingSubscription:
  type: object
  properties:
    data:
      type: array
      items:
        type: object
        properties:
          id:
            type: string
          billingType:
            type: string
          amount:
            type: number
          date:
            type: string
          storeid:
            type: string
          storeName:
            type: string
          description:
            type: string
          transformedDescription:
            type: string
          ofOrders:
            type: number
          rate:
            type: number
          fee:
            type: number
          flatFee:
            type: number
          tip:
            type: number
          tipForStaff:
            type: number
          tipForDriver:
            type: number
          total:
            type: number
          secondFee:
            type: number
          percent:
            type: number
          subtotal:
            type: number
    total:
      type: number

SerializedQueryResult:
  type: object
  description: Result of query after serialized
  required:
    - data
    - summary
  properties:
    data:
      type: array
      items:
        type: object
    summary:
      $ref: "#/components/schemas/QuerySummary"
DetailReportQueryResult:
  allOf:
    - $ref: "#/components/schemas/SerializedQueryResult"
    - type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/DetailReportRow"
        summary:
            $ref: "#/components/schemas/QuerySummary"
        areas:
          type: array
          items:
            $ref: "#/components/schemas/NameValueRow"
        categories:
          type: array
          items:
            $ref: "#/components/schemas/NameValueRow"
        shifts:
          type: array
          items:
            $ref: "#/components/schemas/NameValueRow"
        employees:
          type: array
          items:
            $ref: "#/components/schemas/NameValueRow"
DetailReportRow:
  allOf:
    - $ref: "#/components/schemas/ReportRow"
    - type: object
      description: The row contains server report
      properties:
        area:
          type: string
          description: The area of detail
        area_name:
          type: string
          description: The area_name of detail
        card_num:
          type: string
          description: The card_num of detail
        card_type:
          type: string
          description: The card_type of detail
        customer:
          type: string
          description: The customer of detail
        customer_address:
          type: string
          description: The customer_address of detail
        customer_email:
          type: string
          description: The customer_email of detail
        customer_name:
          type: string
          description: The customer_name of detail
        customer_phone:
          type: string
          description: The customer_phone of detail
        employee:
          type: string
          description: The employee of detail
        id:
          type: string
          description: The id of detail
        order_no:
          type: number
          description: The order_no of detail
        status:
          type: string
          description: The status of detail
        tip:
          type: number
          description: The tip of detail
        trans_num:
          type: number
          description: The trans_num of detail
        trans_type:
          type: string
          description: The trans_type of detail
TotalReportQueryResult:
  allOf:
    - $ref: "#/components/schemas/SerializedQueryResult"
    - type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/TotalReportRow"
        summary:
            $ref: "#/components/schemas/QuerySummary"
        categories:
          type: array
          items:
            $ref: "#/components/schemas/NameValueRow"
        shifts:
          type: array
          items:
            $ref: "#/components/schemas/NameValueRow"
TotalReportRow:
  allOf:
    - $ref: "#/components/schemas/ReportRow"
    - type: object
      description: The row contains server report
      required:
        - shift
      properties:
        card_type:
          type: string
          description: The card_type of total
        trans_type:
          type: string
          description: The card_type of total
        summary:
          type: boolean
          description: The card_type of total
        shift:
          type: number
          description: The shift of total
        count:
            type: number
            description: The shift of total
        name:
            type: string
            description: The name of total
        area_name:
            type: string
            description: The name of total
        tip:
            type: number
            description: The tip of total
        total:
            type: number
            description: The total of total
ServerReportQueryResult:
  allOf:
    - $ref: "#/components/schemas/SerializedQueryResult"
    - type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/ServerReportRow"
        summary:
          $ref: "#/components/schemas/SummaryServerReport"
        shifts:
          type: array
          items:
            $ref: "#/components/schemas/NameValueRow"
        employees:
          type: array
          items:
            $ref: "#/components/schemas/NameValueRow"
ServerReportRow:
  allOf:
    - $ref: "#/components/schemas/ReportRow"
    - type: object
      description: The row contains server report
      required:
        - date
      properties:
        date:
          type: string
          description: The date of server
        shift:
          type: number
          description: The shift of server
        total:
          type: number
          description: The total of server
        tip:
          type: number
          description: The tip of server
        name:
          type: string
          description: The name of server
        opening:
          type: string
          description: The opening_time of server
        closing:
          type: string
          description: The closing_time of server
        persons:
          type: number
          description: The persons of server
SummaryServerReport:
  allOf:
    - $ref: "#/components/schemas/QuerySummary"
    - type: object
      description: The summary of daily report
      properties:
        shift:
          type: number
          description: The shift of server
        name:
          type: string
          description: The shift of server
        opening:
          type: number
          description: The opening of server
        closing:
          type: number
          description: The closing of server
        tip:
          type: number
          description: The tip of server
InventoryReportQueryResult:
  allOf:
    - $ref: "#/components/schemas/SerializedQueryResult"
    - type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/InventoryReportRow"
        summary:
          $ref: "#/components/schemas/SummaryDailyReport"
InventoryReportRow:
  allOf:
    - $ref: "#/components/schemas/ReportRow"
    - type: object
      description: The row contains inventory report
      properties:
        category_name:
          type: string
          description: The category_name of sale
        categoryid:
          type: string
          description: The categoryid of sale
        item_name:
          type: string
          description: The item_name of sale
        itemid:
          type: string
          description: The itemid of sale
        min_quantity:
          type: number
          description: The min_quantity of sale
        quantity:
          type: number
          description: The quantity of sale
        add_quantity:
          type: number
          description: The add_quantity of sale
DailyReportQueryResult:
  allOf:
    - $ref: "#/components/schemas/SerializedQueryResult"
    - type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/DailyReportRow"
        summary:
          $ref: "#/components/schemas/SummaryDailyReport"

DailyReportRow:
  allOf:
    - $ref: "#/components/schemas/ReportRow"
    - type: object
      description: The row contains daily report
      required:
        - date
      properties:
        date:
          type: string
          description: The date of sale
        shift:
          type: number
          description: The shift of sale
        service_fee:
          type: number
          description: The service_fee of sale
        service_fee_tax: 
          type: number
          description: The service_fee_tax of sale
        tax: 
          type: number
          description: The tax of sale
        net:
          type: number
          description: The net of sale
        cc_sales:
          type: number
          description: The cc_sales of sale
        cc_sales_with_tip:
          type: number
          description: The cc_sales_with_tip of sale
        gift_card_sales:
          type: number
          description: The gift_card_sales of sale
        gift_certificate_sales:
          type: number
          description: The gift_certificate_sales of sale
SummaryDailyReport:
  allOf:
    - $ref: "#/components/schemas/QuerySummary"
    - type: object
      description: The summary of daily report
      properties:
        cc_sales:
          type: number
          description: The cc_sales of sale
        cc_sales_with_tip:
          type: number
          description: The cc_sales_with_tip of sale
        gift_card_sales:
          type: number
          description: The gift_card_sales of sale
        gift_certificate_sales:
          type: number
          description: The gift_certificate_sales of sale
        tax:
          type: number
          description: The tax of sale
        net:
          type: number
          description: The net of sale
TipReportQueryResult:
  allOf:
    - $ref: "#/components/schemas/SerializedQueryResult"
    - type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/TipsByServerReportRow"
        employees:
          type: array
          items:
            $ref: "#/components/schemas/NameValueRow"

ReportRow:
  type: object
  description: The base model for report row data
  required:
    - total
  properties:
    total:
      type: number
      description: The total value of the report data
    date:
      type: string
      description: The date of the report data
    shift:
      type: number
      description: The shift index of the report data

TipsByServerReportRow:
  allOf:
    - $ref: "#/components/schemas/ReportRow"
    - type: object
      description: The row contains tip report by employee data
      required:
        - name
        - total
      properties:
        name:
          type: string
          description: The name of the employee of the tip report data

NameValueRow:
  type: object
  required:
    - name
    - value
  properties:
    name:
      type: string
    value:
      oneOf:
        - type: string
        - type: number

BillingReport:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        billingType:
          type: string
        description:
          type: string
        amount:
          type: number
        date:
          type: string
        storeid:
          type: string

RefundCodeForm:
  type: object
  properties:
    code:
      type: string
    owner_list:
      type: array
      items:
        type: object
        properties:
          name:
            type: string
          information:
            type: string

Invoice:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        total:
          type: number
        created_at:
          type: string
        code:
          type: string
        store:
          type: object
          properties:
            address:
              type: string
            city:
              type: string
            name:
              type: string
            zipCode:
              type: string
        bills:
          type: array
          items:
            type: object
            properties:
              amount:
                type: number
              content:
                type: string
              quantity:
                type: number
              rate:
                type: number
              storeid:
                type: string

InvoiceQueryResult:
  allOf:
    - $ref: "#/components/schemas/SerializedQueryResult"
    - type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/Invoice"

OnlineOrderQueryResult:
  allOf:
    - $ref: "#/components/schemas/SerializedQueryResult"
    - type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/OnlineOrder"

FormImportStore:
  allOf:
    - type: object
      properties:
        from_store:
          type: string
        items:
          type: array
          items:
            type: string

ResultImport:
  allOf:
    - type: object
      properties:
        importid:
          type: string

Printtpl:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        channels:
          type: array
          items:
            type: string
        gratuity_tips:
          type: array
          items:
            $ref: "#/components/schemas/GratuityTip"
        paper_type:
          type: string
        print_address:
          type: boolean
        print_auth_code:
          type: boolean
        print_card_no:
          type: boolean
        print_card_type:
          type: boolean
        print_cashier_name:
          type: boolean
        print_date_time:
          type: boolean
        print_gift_card:
          type: boolean
        print_gratuity:
          type: boolean
        print_items:
          type: boolean
        print_merchant_id:
          type: boolean
        print_no_of_guest:
          type: boolean
        print_order_no:
          type: boolean
        print_payment_type:
          type: boolean
        print_phone:
          type: boolean
        print_receipt_no:
          type: boolean
        print_server_name:
          type: boolean
        print_signature:
          type: boolean
        print_store_id:
          type: boolean
        print_store_logo:
          type: boolean
        print_store_name:
          type: boolean
        print_table_no:
          type: boolean
        print_terminal_id:
          type: boolean
        print_text_1:
          type: boolean
        print_text_2:
          type: boolean
        print_tip:
          type: boolean
        print_transaction_no:
          type: boolean
        print_waiter_name:
          type: boolean
        text_1:
          type: string
        text_2:
          type: string
        tips:
          type: array
          items:
            $ref: "#/components/schemas/Tip"

GratuityTip:
  type: object
  properties:
    percent:
      type: number

Tip:
  type: object
  properties:
    percent:
      type: number

ItemStockDetail:
  type: object
  properties:
    categoryid:
      type: string
    item_name:
      type: string
    itemid:
      type: string
    quantity:
      type: number

Partner:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        country:
          type: string
        password:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        company_name:
          type: string
        states:
          type: string
        zip:
          type: string
        address:
          type: string
        phone:
          type: string
        email:
          type: string
        goe_processor_type:
          type: boolean
        partnerid:
          type: number

SerializedPartner:
  allOf:
    - $ref: "#/components/schemas/BaseModel"
    - type: object
      properties:
        value:
          $ref: "#/components/schemas/Partner"
        merchants:
          type: array
          items:
            $ref: "#/components/schemas/Merchant"

TransferMerchant:
  type: object
  properties:
    merchant:
      type: string
    partner:
      type: string

CCPoint:
  allOf:
  - $ref: "#/components/schemas/BaseModel"
  - type: object
    properties:
      description:
        type: string
      percent:
        type: number
      point:
        type: integer
      subtype:
        type: string
      time:
        type: string
      total:
        type: number
      balance:
        type: integer