package com.trade.service.filestorage.enums;

/**
 * 文件类型枚举
 */
public enum FileTypeEnum {
    BUSINESS_LICENSE("businessLicense", "营业执照"),
    BUSINESS_PREMISES("businessPremises", "经营场所（含门头）现场照片"),
    BUSINESS_LOCATION_MAP("businessLocationMap", "经营地点定位图文件"),
    EXPORT_SPECIAL_LICENSES("exportSpecialLicenses", "特殊商品出口相关许可"),
    TRADE_COMMODITY_PHOTO("tradeCommodityPhoto", "贸易商品照片"),
    WAREHOUSE_STOCK_PHOTO("warehouseStockPhoto", "仓库存货照片"),
    IN_OUT_WAREHOUSE_LIST("inOutWarehouseList", "物料、成品进出库清单"),
    PRODUCE_BASE_PHOTO("produceBasePhoto", "生产车间或加工基地照片"),
    PRODUCE_EQUIPMENT_PHOTO("produceEquipmentPhoto", "主要生产设备照片"),
    BASIC_TECHNOLOGY_PROCESS_DOC("basicTechnologyProcessDoc", "基本工艺流程文档"),
    IDENTITY_CARD_FRONT("idCardFront", "身份证正面"),
    IDENTITY_CARD_BACK("idCardBack", "身份证反面"),
    CERT_TYPE_PASSPORT("passport", "护照"),
    AUTHORIZATION_FILE("authorizationFile", "授权委托书"),
    COMMODITY_SPECIAL_LICENSE("commoditySpecialQualification", "特殊商品经营许可"),
    SALES_CONTRACT("salesContract", "销售合同"),
    PURCHASE_CONTRACT("purchaseContractFile", "采购合同"),
    PROFORMA_INVOICE("proformaInvoice", "形式发票"),
    PURCHASE_ORDER_TRANS_PROVE("purchaseOrderTransProve", "采购订单运输凭证/运输发票文件"),
    PURCHASE_ORDER_INVOICE_NOTICE("purchaseOrderInvoiceNotice", "采购订单发票通知"),
    PURCHASE_ORDER_INVOICE("purchaseOrderInvoice", "采购订单发票"),
    PLATFORM_COMMITMENT_LETTER("platformCommitmentLetter", "承诺函-贸易公司"),
    TAX_REBATE_AGREEMENT("taxRebateAgreement", "退税服务协议"),
    DISBURSEMENT_ENTRY("disbursementEntry", "出入账管理"),
    PAYABLE_ACCOUNTS("payableAccounts", "应付账款")
    ;

    /**
     * 编码
     */
    private String code;
    /**
     * 名称
     */
    private String cname;

    FileTypeEnum(String code, String cname) {
        this.code = code;
        this.cname = cname;

    }

    public String getCode() {
        return code;
    }

    public String getCname() {
        return cname;
    }


    public static String getCnameByCode(String code) {
        FileTypeEnum[] enums = values();
        for (FileTypeEnum fileType : enums) {
            if (fileType.getCode().equals(code)) {
                return fileType.getCname();
            }
        }
        return null;
    }
}
