package com.brilliance.isc.common.trndoc.vo;

import com.brilliance.mda.runtime.mda.IStream;
import com.brilliance.mda.runtime.mda.impl.StreamImpl;
import com.brilliance.mda.runtime.mda.util.Decimals;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;

@Data
public class DoceotVo extends AbstractCommonVo {

    //Row Identificator in Grid
    private  String id = NULLSTR;
    //Level
    private  String lev = NULLSTR;
    //ID of LEV 1 entry
    private  String idref = NULLSTR;
    //ID where this entry is attached to
    private  String idatt = NULLSTR;
    //Sort Field
    private  String srtkey = NULLSTR;
    //'Attached' Information
    private  String attlab = NULLSTR;
    //role of receiver
    private  String role = NULLSTR;
    //actual role of receiver
    private  String roladr = NULLSTR;
    //Delete Flag
    private  String delflg = NULLSTR;
    //primary document name
    private  String docnam = NULLSTR;
    //Type of Execution for DOCNAM
    private  String docexe = NULLSTR;
    //Structure of Document Protoyp
    private  String docstr = NULLSTR;
    //List of possible structures and implementations
    private  String docstrsea = NULLSTR;
    //Per Medium
    private  String cortyp = NULLSTR;
    //List of possible CORTYP
    private  String doccorsea = NULLSTR;
    //object module
    private  String objmod = NULLSTR;
    //description
    private  String pandsc = NULLSTR;
    //sending format
    private  String docsnf = NULLSTR;
    //language
    private  String docuil = NULLSTR;
    //Application Form for SMH
    private  String apf = NULLSTR;
    //original application form from defdoceot
    private  String oldapf = NULLSTR;
    //Message Priority /SWIFT/Telex
    private  String msgpri = NULLSTR;
    //Mandatory Flag 1=mandatory
    private  int mdtflg;
    //'used ' flag -1= not used
    private  int usdflg;
    //Record type of attachement
    private  String atttyp = NULLSTR;
    //INR of record type for attachement / Filename
    private  String attinr = NULLSTR;
    //PTA receiving doc
    private  String ptainr = NULLSTR;
    //PTA receiving doc as passed to defdoceot
    private  String argptainr = NULLSTR;
    //last PTAINR read
    private  String ptainrold = NULLSTR;
    //Address
    private  String adrblk = NULLSTR;
    //BIC
    private  String adrbic = NULLSTR;
    //Contract Reference of Receiver
    private  String adrref = NULLSTR;
    //BIC/S.W.I.F.T. Authenticator Exchanged
    private  String adrbicaut = NULLSTR;
    //Telexnumber
    private  String adrtlx = NULLSTR;
    //Faxnumber
    private  String adrfax = NULLSTR;
    //Email address
    private  String adreml = NULLSTR;
    //TradeConnect ID
    private  String adrtid = NULLSTR;
    //DTA Account
    private  String adrdtacid = NULLSTR;
    //Bolero Address RID
    private  String adrrid = NULLSTR;
    //DTE Account
    private  String adrdtecid = NULLSTR;
    //Contact
    private  String ptcnam = NULLSTR;
    //Additional text for letter
    private  String addtxt = NULLSTR;
    //Additional text for electronic message
    private  String addstr = NULLSTR;
    //Type of Copy
    private  String oriflg = NULLSTR;
    //Next Id for LEV 2
    private  int subcnt;
    //document as text
    private IStream doctxt = new StreamImpl();
    //BIC
    private  String oldadrbic = NULLSTR;
    //Address
    private  String oldadrblk = NULLSTR;
    //per medium
    private  String oldcortyp = NULLSTR;
    //APFCOD of triggering LEV 1
    private  String oldapfcod = NULLSTR;
    //PTY of triggering LEV 1
    private  String oldptyinr = NULLSTR;
    //Count per form
    private  String apfcnt = NULLSTR;
    //Label 1. APFTYP
    private  String apflab1 = NULLSTR;
    //Label 'Cover'
    private  String apflabcpycov = NULLSTR;
    //Label 'Original'
    private  String apflabcpyori = NULLSTR;
    //type 1
    private  String apftyp1 = NULLSTR;
    //no. of copies for type 1
    private  int apfcpy1;
    //Label 2. APFTYP
    private  String apflab2 = NULLSTR;
    //type 2
    private  String apftyp2 = NULLSTR;
    //no. of copies for type 2
    private  int apfcpy2;
    //no. of copies from mailing instructions
    private  int apfcpymli;
    //Label 3. APFTYP
    private  String apflab3 = NULLSTR;
    //type 3
    private  String apftyp3 = NULLSTR;
    //no. of copies for type 3
    private  int apfcpy3;
    //Label 4. APFTYP
    private  String apflab4 = NULLSTR;
    //type 4
    private  String apftyp4 = NULLSTR;
    //no. of copies for type 4
    private  int apfcpy4;
    //Label 5. APFTYP
    private  String apflab5 = NULLSTR;
    //type 5
    private  String apftyp5 = NULLSTR;
    //no. of copies Original CPY 2
    private  int apfcpy5;
    //no. of copies Original CPY 3
    private  int apfcpy6;
    //no. of copies Original CPY 4
    private  int apfcpy7;
    //no. originals for original for Send To
    private  int apfcpyori;
    //Label für SNDKEY-Entsprechung
    private  String smhsndkeylab = NULLSTR;
    //Label für SNDKEY-Entsprechung
    private  String smhsndkeylab1 = NULLSTR;
    //Label für SNDKEY-Entsprechung
    private  String smhsndkeylab2 = NULLSTR;
    //SMHINR of document after savdoc
    private  String smhinr = NULLSTR;
    //Telex Authenticator Exchanged
    private  String adrtlxaut = NULLSTR;
    //Telex Answerback
    private  String adrtlxans = NULLSTR;
    //Amount for Telex/SWIFT Key
    private BigDecimal keyamt = Decimals.ZERO_SCALE2;
    //Currency Telex/SWIFT for Key
    private  String keycur = NULLSTR;
    //Key Text for Telex/SWIFT Key
    private  String keytxt = NULLSTR;
    //Label1 for Telex/SWIFT Key
    private  String keylab1 = NULLSTR;
    //Label1 for Additional Text
    private  String keyadd1 = NULLSTR;
    //Label2 for Additional Text
    private  String keyadd2 = NULLSTR;
    //Label2 for Telex/SWIFT Key
    private  String keylab2 = NULLSTR;
    //allowed CORTYP
    private  String valcortyp = NULLSTR;
    //INR of Associated Address from PTA
    private  String ptaadrinr = NULLSTR;
    //INR of Associated Party from PTA
    private  String ptaptyinr = NULLSTR;
    //Buffer for Cacheread of PTA
    private  String ptainfo = NULLSTR;
    //allowed DOCUIL
    private  String valdocuil = NULLSTR;
    //Message type of electronic messages
    private  String mt = NULLSTR;
    //Flag, whether DOCEOT was triggered by MLI
    private  String mliflg = NULLSTR;
    //Suppress Cover Letter
    private  String supcovflg = NULLSTR;
    //Sequence Number of Split Messages
    private  int grpseq;
    //stream of ptm records of selected address
    private  IStream ptmstm = new StreamImpl();
    //Document Date
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date docdat;
    //M MT999加押;T TELEX加押;N 正常
    private  String staflg = NULLSTR;
    //Narrative for MT 730, MT752 and MT756
    private  String tag79z = NULLSTR;

    // MT 750
    private  String tag77jtxt = NULLSTR;

    //Cortypes for which tag 79Z is supported
    private  IStream usetag79z = new StreamImpl();
    //Label for Narrative
    private String keynar = NULLSTR;
    //message target
    private String msgtoo = NULLSTR;
    //备注（电证）
    private String remark = NULLSTR;
    //XMLPanel xmldoc的内置block
    private String xmldocblk = NULLSTR;
    //XMLPanel cover的内置block
    private String coverblk = NULLSTR;

    private PtsptaVo rcv;

    @Override
    public void reset() {
        if (keyamt == null) {
            keyamt = Decimals.ZERO_SCALE2;
        }
        if (rcv == null) {
            rcv = new PtsptaVo();
        }
        rcv.reset();
    }
}
