import { UbPromotionType } from '../enums/ub-order'; import { UbMoney } from './ub-utils'; export interface UbPayment { /** 全品項稅率與金額 */ charges: UbCharges; /** 整張單的會計包含稅率 */ accounting: UbAccounting; /** 促銷數據,開發者需要而外開通才接的到 */ promotions?: UbPromotions; } export interface UbCharges { /** 包含稅率的總額 */ total: UbMoney; /** 各品項金額加總 */ sub_total: UbMoney; /** 各品項的稅率總和 */ tax: UbMoney; /** (部分地區適用,暫時不理他) */ total_fee: UbMoney; /** (部分地區適用,暫時不理他) */ total_fee_tax: UbMoney; } export interface UbAccounting { tax_remittance: UbTaxRemittance; } export interface UbTaxRemittance { tax: UbRemittanceInfo; total_fee_tax: UbRemittanceInfo; delivery_fee_tax: UbRemittanceInfo; small_order_fee_tax: UbRemittanceInfo; } /** Contains the Payee details this entity need to remit */ export interface UbRemittanceInfo { uber: UbPayeeDetail[]; /** 店家要負責的稅 */ restaurant: UbPayeeDetail[]; courier: UbPayeeDetail[]; eater: UbPayeeDetail[]; } export interface UbPayeeDetail { value: UbMoney; } export interface UbPromotions { promotions: UbPromotion[]; } export interface UbPromotion { /** the external partner’s promotion id */ external_promotion_id?: string; promo_type: UbPromotionType; promo_discount_value: number; promo_discount_percentage: number; promo_delivery_fee_value: number; discount_items: UbDiscountItem[]; } export interface UbDiscountItem { /** the external partner’s id for an item. */ external_id?: string; discounted_quantity: number; }