package com.brilliance.isc.swift.objmtconvert.model.mt4xx.tag.tag410;

import com.brilliance.isc.swift.objmtconvert.model.AbsMTCreator;
import com.brilliance.isc.swift.objmtconvert.model.AbsTagCreate;
import com.brilliance.isc.swift.objmtconvert.model.mt4xx.MT410Creator;
import com.brilliance.isc.swift.objmtconvert.model.mt4xx.mt4XXAbsCreator.MT410AbsCreator;

import java.util.List;

public class TagCycleCreator extends AbsTagCreate {

     private MT410Creator mt410Creator;

    public TagCycleCreator(AbsMTCreator absMTCreator)
    {
        super(absMTCreator);
        this.mt410Creator= (MT410Creator) absMTCreator;
    }


    public  void creator()
    {
        List<MT410AbsCreator> tagList = mt410Creator.getMt410AbsCreators();
        if(tagList!=null&&tagList.size()>0){
            for (MT410AbsCreator abs410:tagList) {
                mt410Creator.set("20",abs410.getSendingBankTRN());
                mt410Creator.set("21",abs410.getRelatedReference());
                mt410Creator.set("32"+abs410.getAmountAcknowledged().getTagResult().getTagEnd(),abs410.getAmountAcknowledged().getTagResult().getValue());
            }
        }

    }
}
