import { UbDeliveryType, UbOrderBrand, UbOrderState, UbOrderType } from '../enums/ub-order'; import { UbCart } from './ub-cart'; import { UbPayment } from './ub-payment'; import { UbLocation } from './ub-utils'; export interface UbOrder { id: string; display_id: string; /** 如果POS有Call Accept API,會帶入POS的 orderID */ external_reference_id: string; current_state: UbOrderState; /** Serve type */ type: UbOrderType; brand: UbOrderBrand; store: UbStore; eater: UbEater; eaters: UbEater[]; cart: UbCart; payment: UbPayment; packaging: UbPackaging; /** Order.createdAt; e.g. “2019-05-14T15:16:54.723-05:00” */ placed_at: string; /** 餐點預計完成時間; e.g. “2019-05-14T15:16:54.723-05:00” */ estimated_ready_for_pickup_at: string; } export interface UbStore { id: string; name: string; /** * An optional reference ID for the store that can be used to identify the location in the partner’s systems. * 1. If you are using the POS Provision platform, this data is configurable via the Set up POS Integration endpoint. * 2. Otherwise, this data must be provided directly to your Uber Eats account manager * to configure for each store or provided in store staging requests. */ external_reference_id?: string; } export interface UbEater { first_name: string; last_name: string; phone: string; phone_code: string; id: string; /** * 更新內容一:GET /v2/eats/order * 在 API 回應中的 eater 物件,新增以下欄位: * 1. tax_profile.tax_profile_metadata (object) * 此欄位將包含三種發票載具類型(若有填寫): * donation_code:捐贈碼 * mobile_barcode:手機條碼 * digital_certificate_code:自然人憑證條碼 */ tax_profile?: { tax_profile_metadata: { donation_code?: string; mobile_barcode?: string; digital_certificate_code?: string; }; }; /** * 更新內容一:GET /v2/eats/order * 2. corporate_tax_id_taiwan (string) * 此欄位將直接位於 eater object 下,用於提供統一編號資訊。 */ corporate_tax_id_taiwan?: string; /** * 台灣好像沒有店家外送 * 店家自行外送時才有的特殊指示 */ delivery: UbDelivery; } export interface UbDelivery { location: UbLocation; type: UbDeliveryType; note: string; } export interface UbPackaging { disposable_items: UbDisposableItems; } export interface UbDisposableItems { should_include: boolean; }