package com.brilliance.isc.bo;

import com.brilliance.mda.runtime.mda.util.Decimals;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

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

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


/**
 * TABLE:smh:SMH - Structured Message Header
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class Smh implements Serializable {

    //Internal Unique ID of Message
    private String inr = NULLSTR;

    //Object Type of Owning Contract Optional
    private String objtyp = NULLSTR;

    //INR of Owning Contract Optional
    private String objinr = NULLSTR;

    //Type of Transaction
    private String trntyp = NULLSTR;

    //Transaction, which Handles the Document
    private String trninr = NULLSTR;

    //Counter within TRN
    private int trnsub;

    //External Key
    private String extkey = NULLSTR;

    //Name to Identify Document
    private String nam = NULLSTR;

    //Creating User
    private String creusr = NULLSTR;

    //Creating Transaction
    private String crefrm = NULLSTR;

    //Timestamp Created
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date credattim = NULLDATE;

    //Direction '>'=Outgoing, '<'=Incoming
    private String dir = NULLSTR;

    //Document Path Relative to Appl. or Data Root
    private String docpth = NULLSTR;

    //Document Name File ID
    private String docfil = NULLSTR;

    //Document Format RTF, TIF, TXT etc. Used to Created File Extension
    private String docfxt = NULLSTR;

    //MAC
    private String docmac = NULLSTR;

    //Position of Message in Document 1=Begin of Document, 0=Whole Document
    private long msgpos;

    //Length of Message in Document 0=Rest of Document
    private long msglen;

    //INR of the First Message of Split Messages/Secondary Messages
    private String grpinr = NULLSTR;

    //Sequence Number of Split Messages
    private int grpseq;

    //Structure/Syntax of Message SWT, LET, TLX, TCO
    private String cortyp = NULLSTR;

    //Subtype of Message Defines SRV
    private String cortypsub = NULLSTR;

    //Application Form
    private String apf = NULLSTR;

    //Receiver Key BIC/Telex#/Fax#/email
    private String sndkey = NULLSTR;

    //Count per Form
    private String apfcnt = NULLSTR;

    //PTA Receiving Documents
    private String ptainr = NULLSTR;

    //Type of Copy
    private String oriflg = NULLSTR;

    //Internal Unique ID of Original Message
    private String orismhinr = NULLSTR;

    //Counter of Partial Messages i.e. 1/2
    private String partflg = NULLSTR;

    //Message Type Optional
    private String msgtyp = NULLSTR;

    //Relevant Currency Optional
    private String relcur = NULLSTR;

    //Relevant Amount Optional
    private BigDecimal relamt = Decimals.ZERO_SCALE2;

    //STP Message
    private String stp = NULLSTR;

    //Entity holding Message
    private String etyextkey = NULLSTR;

    //清算报文的清算编号
    private String sysno = NULLSTR;

    //flag M 999加押，T  TELEX加押
    private String staflg = NULLSTR;

    //文件清理日期
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date clndat = NULLDATE;

    //ReferenceDZT
    private String f20 = NULLSTR;

    //系统通道标志
    private String chlflg = NULLSTR;

    //原ISO报文类型
    private String orimsgtyp = NULLSTR;

    private String mpiinr = NULLSTR;

    private String docmd5 = NULLSTR;

    private long doclen;

    private int xxxcnt;


    //清算模块用刀的 收报行
    private String rcvkey = NULLSTR;
}
