<?php

namespace App\Http\Services\ConstDef;

class GeneralConst
{
    
    // 封存標記
    const ARCHIVE_NO  = 'N'; // 無封存，可見
    const ARCHIVE_YES = 'Y'; // 已封存，不可見
    public static $archiveMap = array(
        self::ARCHIVE_NO  => '未封存',
        self::ARCHIVE_YES => '已封存',
    );
    
    // 附件標記
    const PHOTO_NO  = 'N'; // 不須提供
    const PHOTO_YES = 'Y'; // 必須提供
    public static $photoMap = array(
        self::PHOTO_NO  => '不須提供',
        self::PHOTO_YES => '必須提供',
    );
    
    // 去重複
    const DUPLICATE_POLICY_ALL       = 'A'; // 不去重複
    const DUPLICATE_POLICY_MAX_BY_ID = 'B'; // 相同身分證號取得最新一筆
    public static $duplicateMap = array(
        self::DUPLICATE_POLICY_ALL       => '不去重複',
        self::DUPLICATE_POLICY_MAX_BY_ID => '相同身分證號取得最新一筆',
    );
    
    // 附件型態
    const APPENDIX_IDENTITY_FRONT = 'ida'; // 身分證正面
    const APPENDIX_IDENTITY_BACK  = 'idb'; // 身分證背面
    const APPENDIX_PASSBOOK       = 'acc'; // 存摺
    const APPENDIX_DECLARE_PDF    = 'pdf'; // 申報用PDF
    public static $appendixMap         = array(
        self::APPENDIX_IDENTITY_FRONT => [
            'sql'      => 'p_ide_a',
            'web_path' => 'ide_a',
            'zip_file' => '_IDA_',
            'ext'      => '.jpg',
        ],
        self::APPENDIX_IDENTITY_BACK  => [
            'sql'      => 'p_ide_b',
            'web_path' => 'ide_b',
            'zip_file' => '_IDB_',
            'ext'      => '.jpg',
        ],
        self::APPENDIX_PASSBOOK       => [
            'sql'      => 'p_acc',
            'web_path' => 'acc',
            'zip_file' => '_ACC_',
            'ext'      => '.jpg',
        ],
        self::APPENDIX_DECLARE_PDF    => [
            'sql'      => 'p_pdf',
            'web_path' => 'pdf',
            'zip_file' => '_PDF_',
            'ext'      => '.pdf',
        ],
    );
    public static $appendixValidateMap = array(
        self::APPENDIX_IDENTITY_FRONT => 'ida',
        self::APPENDIX_IDENTITY_BACK  => 'idb',
        self::APPENDIX_PASSBOOK       => 'acc',
        //self::APPENDIX_DECLARE_PDF    => 'pdf',
    );
    
    // 封存標記
    const ACTIVE_YES = 'Y'; // 有效
    const ACTIVE_NO  = 'N'; // 無效
    public static $activeMap = array(
        self::ACTIVE_YES => '有效',
        self::ACTIVE_NO  => '無效',
    );
    
    // SYSLOG 紀錄型態
    const LOG_ADMIN = 'ADMIN';
    const LOG_USER  = 'USER';
    const LOG_ESI   = 'ESI';
    const LOG_ROBOT = 'ROBOT';
    public static $syslogMap    = array(
        self::LOG_ADMIN,
        self::LOG_USER,
        self::LOG_ESI,
        self::LOG_ROBOT,
    );
    public static $syslogactMap = array(
        self::LOG_ADMIN,
        self::LOG_USER,
        self::LOG_ESI,
        self::LOG_ROBOT,
    );
    public static $syslogtMap = array(
        self::LOG_ADMIN,
        self::LOG_USER,
        self::LOG_ESI,
        self::LOG_ROBOT,
    );
    
    // 封存標記
    const RSTATUS_INIT                          = 1;
    const RSTATUS_DRAW_FAIL                     = 2;
    const RSTATUS_DRAW_DONE                     = 3;
    const RSTATUS_DRAW_DONE_EXPIRED             = 7;
    const RSTATUS_DRAW_DONE_REDEEM              = 4;
    const RSTATUS_DRAW_DONE_REDEEM_FAIL         = 6;
    const RSTATUS_DRAW_DONE_REDEEM_DONE         = 5;
    const RSTATUS_DRAW_DONE_REDEEM_DONE_EXPIRED = 8;
    const RSTATUS_DRAW_DONE_REDEEM_DONE_GET     = 9;
    public static $rStatusMap = array(
        self::RSTATUS_INIT                          => [
            'back'  => '登錄完畢初期狀態',
            'front' => '未開獎',
            'btn'   => 'N',
        ],
        self::RSTATUS_DRAW_FAIL                     => [
            'back'  => '開獎後該號碼沒中獎',
            'front' => '未中獎',
            'btn'   => 'N',
        ],
        self::RSTATUS_DRAW_DONE                     => [
            'back'  => '開獎後該號碼已中獎但未送出驗證',
            'front' => '已中獎',
            'btn'   => 'Y',
        ],
        self::RSTATUS_DRAW_DONE_EXPIRED             => [
            'back'  => '開獎後該號碼已中獎但未送出驗證且已過期',
            'front' => '資料已過期，無法送出',
            'btn'   => 'Y',
        ],
        self::RSTATUS_DRAW_DONE_REDEEM              => [
            'back'  => '開獎後該號碼已中獎且已送出驗證',
            'front' => '交易資料驗證中',
            'btn'   => 'N',
        ],
        self::RSTATUS_DRAW_DONE_REDEEM_FAIL         => [
            'back'  => '開獎後該號碼已中獎且已送出驗證但驗證失敗',
            'front' => '驗證失敗',
            'btn'   => 'Y',
        ],
        self::RSTATUS_DRAW_DONE_REDEEM_DONE         => [
            'back'  => '開獎後該號碼已中獎且已送出驗證且驗證成功但未領獎',
            'front' => '驗證完成，領取獎金',
            'btn'   => 'Y',
        ],
        self::RSTATUS_DRAW_DONE_REDEEM_DONE_EXPIRED => [
            'back'  => '開獎後該號碼已中獎且已送出驗證且驗證成功但未領獎且已過期',
            'front' => '資料已過期，無法領取',
            'btn'   => 'Y',
        ],
        self::RSTATUS_DRAW_DONE_REDEEM_DONE_GET     => [
            'back'  => '開獎後該號碼已中獎且已送出驗證且驗證成功且已領獎',
            'front' => '已領取',
            'btn'   => 'N',
        ],
    );
    
    // 是否發放
    const CANGET_YES = 'Y';
    const CANGET_NO  = 'N';
    public static $canGetMap = array(
        self::CANGET_YES => '是',
        self::CANGET_NO  => '否',
    );
    
}