package com.unibuy.smartdevice.structure;

public class DevSetStructure {
    private boolean isVMC;
    private boolean isElectic;
    private boolean isShoppingCar;
    private boolean isInvoice;
    private boolean isDevNFCPay;
    private boolean isDevEsunPay;
    private boolean isDevTapPay;
    private boolean isDevCash;
    private boolean isDevLinePay;
    private boolean isTapPay30;
    private boolean isTapPay31;
    private boolean isTapPay32;
    private boolean isTapPay33;
    private boolean isTapPay34;
    // 取貨碼/通行碼：改由雲端 B014 FunctionSet 下發控制（預設值來自 flavor devset_defaults.xml）
    private boolean isPickupCode;
    private boolean isPassCode;
    // 以下為 B014 新增開關，預設 false，由雲端下發或主控台（系統方）設定後覆寫。
    // DevSet 細項：刷卡機/掃碼底下的子開關
    private boolean isDevCreditCard;
    private boolean isDevMobilePay;
    private boolean isDevCardPay;
    private boolean isDevScanPay;
    // FunctionSet 細項：取貨模組（主）、來店禮、會員系統、環境溫度監控
    private boolean isPickupModule;
    // 領藥單（雲端建單）：取物單(pickup_sheet)模式下的子開關，true 時走雲端 B660 領藥流程
    private boolean isPharmacyPickup;
    private boolean isWelcomeGift;
    private boolean isMemberSystem;
    private boolean isAmbientTemp;

    public DevSetStructure(boolean isVMC, boolean isElectic, boolean isShoppingCar, boolean isInvoice,
                           boolean isDevNFCPay, boolean isDevEsunPay, boolean isDevTapPay, boolean isDevCash, boolean isDevLinePay,
                           boolean isTapPay30,boolean isTapPay31,boolean isTapPay32,boolean isTapPay33, boolean isTapPay34,
                           boolean isPickupCode, boolean isPassCode) {
        this.isVMC = isVMC;
        this.isElectic = isElectic;
        this.isShoppingCar = isShoppingCar;
        this.isInvoice = isInvoice;
        this.isDevNFCPay = isDevNFCPay;
        this.isDevEsunPay = isDevEsunPay;
        this.isDevTapPay = isDevTapPay;
        this.isDevCash = isDevCash;
        this.isDevLinePay = isDevLinePay;
        this.isTapPay30 = isTapPay30;
        this.isTapPay31 = isTapPay31;
        this.isTapPay32 = isTapPay32;
        this.isTapPay33 = isTapPay33;
        this.isTapPay34 = isTapPay34;
        this.isPickupCode = isPickupCode;
        this.isPassCode = isPassCode;
    }

    public boolean isVMC() {
        return isVMC;
    }

    public boolean isElectic() {
        return isElectic;
    }

    public boolean isShoppingCar() {
        return isShoppingCar;
    }

    public boolean isInvoice() {
        return isInvoice;
    }

    public boolean isDevNFCPay() {
        return isDevNFCPay;
    }

    public boolean isDevEsunPay() {
        return isDevEsunPay;
    }

    public boolean isDevTapPay() { return isDevTapPay; }

    public boolean isDevCash() {
        return isDevCash;
    }

    public boolean isDevLinePay() {
        return isDevLinePay;
    }
    public boolean isTapPay30() {
        return isTapPay30;
    }
    public boolean isTapPay31() {
        return isTapPay31;
    }
    public boolean isTapPay32() {
        return isTapPay32;
    }
    public boolean isTapPay33() {
        return isTapPay33;
    }
    public boolean isTapPay34() {
        return isTapPay34;
    }

    public void setVMC(boolean VMC) {
        isVMC = VMC;
    }

    public void setElectic(boolean electic) {
        isElectic = electic;
    }

    public void setShoppingCar(boolean shoppingCar) {
        isShoppingCar = shoppingCar;
    }

    public void setInvoice(boolean invoice) {
        isInvoice = invoice;
    }

    public void setDevNFCPay(boolean devNFCPay) {
        isDevNFCPay = devNFCPay;
    }

    public void setDevEsunPay(boolean devEsunPay) {
        isDevEsunPay = devEsunPay;
    }

    public void setDevTapPay(boolean devTapPay) {
        isDevTapPay = devTapPay;
    }

    public void setDevCash(boolean devCash) {
        isDevCash = devCash;
    }

    public void setDevLinePay(boolean devLinePay) {isDevLinePay = devLinePay;}

    public void setTapPay30(boolean tapPay30) {isTapPay30 = tapPay30;}
    public void setTapPay31(boolean tapPay31) {isTapPay31 = tapPay31;}
    public void setTapPay32(boolean tapPay32) {isTapPay32 = tapPay32;}
    public void setTapPay33(boolean tapPay33) {isTapPay33 = tapPay33;}
    public void setTapPay34(boolean tapPay34) {isTapPay34 = tapPay34;}

    public boolean isPickupCode() {
        return isPickupCode;
    }

    public void setPickupCode(boolean pickupCode) {
        isPickupCode = pickupCode;
    }

    public boolean isPassCode() {
        return isPassCode;
    }

    public void setPassCode(boolean passCode) {
        isPassCode = passCode;
    }

    public boolean isDevCreditCard() { return isDevCreditCard; }
    public void setDevCreditCard(boolean devCreditCard) { isDevCreditCard = devCreditCard; }

    public boolean isDevMobilePay() { return isDevMobilePay; }
    public void setDevMobilePay(boolean devMobilePay) { isDevMobilePay = devMobilePay; }

    public boolean isDevCardPay() { return isDevCardPay; }
    public void setDevCardPay(boolean devCardPay) { isDevCardPay = devCardPay; }

    public boolean isDevScanPay() { return isDevScanPay; }
    public void setDevScanPay(boolean devScanPay) { isDevScanPay = devScanPay; }

    public boolean isPickupModule() { return isPickupModule; }
    public void setPickupModule(boolean pickupModule) { isPickupModule = pickupModule; }

    public boolean isPharmacyPickup() { return isPharmacyPickup; }
    public void setPharmacyPickup(boolean pharmacyPickup) { isPharmacyPickup = pharmacyPickup; }

    public boolean isWelcomeGift() { return isWelcomeGift; }
    public void setWelcomeGift(boolean welcomeGift) { isWelcomeGift = welcomeGift; }

    public boolean isMemberSystem() { return isMemberSystem; }
    public void setMemberSystem(boolean memberSystem) { isMemberSystem = memberSystem; }

    public boolean isAmbientTemp() { return isAmbientTemp; }
    public void setAmbientTemp(boolean ambientTemp) { isAmbientTemp = ambientTemp; }

    // ── 支付方式「母 && 子」便利判斷 ──────────────────────────────────────────
    // 各支付實際是否可用 = 母開關開啟 && 子項開啟。集中於此，讓 UI 顯示與入口防呆共用同一份真相，
    // 避免在多處（BuyDialog 購物車/單品/例外分支、changeCheckout 入口）各自拼湊而漏判。
    //   刷卡機（母 isDevNFCPay）→ 信用卡 / 電子票證(卡片) / 手機支付
    //   掃碼（母 isDevScanPay）→ 玉山 EsunPay / TapPay
    //   Line 官方支付、現金：獨立大項，無母開關（自身即為總開關）

    /** flowType 1 信用卡：刷卡機開啟且信用卡子項開啟。 */
    public boolean canCreditCard() { return isDevNFCPay && isDevCreditCard; }

    /** flowType 2 電子票證(卡片支付)：刷卡機開啟且卡片支付子項開啟。 */
    public boolean canCardPay() { return isDevNFCPay && isDevCardPay; }

    /** flowType 10 手機支付：刷卡機開啟且手機支付子項開啟。 */
    public boolean canMobilePay() { return isDevNFCPay && isDevMobilePay; }

    /** flowType 3 玉山 EsunPay：掃碼開啟且玉山子項開啟。 */
    public boolean canEsunPay() { return isDevScanPay && isDevEsunPay; }

    /** flowType 30 TapPay：掃碼開啟且 TapPay 子項開啟。 */
    public boolean canTapPay() { return isDevScanPay && isDevTapPay; }

    /** flowType 70 Line 官方支付：獨立大項，不從屬掃碼，只看自身開關。 */
    public boolean canLinePay() { return isDevLinePay; }

    /** flowType 9 現金：獨立大項，只看自身開關。 */
    public boolean canCash() { return isDevCash; }

}
