package com.brilliance.isc.swift.objmtconvert.model.mt9xx.tag.tag941;

import com.brilliance.isc.swift.objmtconvert.model.AbsMTCreator;
import com.brilliance.isc.swift.objmtconvert.model.AbsTagCreate;
import com.brilliance.isc.swift.objmtconvert.model.commontag.DcDateCurAmtTagXXX;
import com.brilliance.isc.swift.objmtconvert.model.mt9xx.MT941Creator;

import java.util.List;

/**
 * @author hedonghao
 * @date 2023/2/24
 */
public class Tag65Creator extends AbsTagCreate {

    private MT941Creator mt941Creator;

    public Tag65Creator(AbsMTCreator absMTCreator)
    {
        super(absMTCreator);
        this.mt941Creator= (MT941Creator) absMTCreator;
    }

    public void creator()
    {
        List<DcDateCurAmtTagXXX> forwardAvailableBalances = mt941Creator.getForwardAvailableBalance();
        if(forwardAvailableBalances!=null){
            for (DcDateCurAmtTagXXX forwardAvailableBalance : forwardAvailableBalances) {
                mt941Creator.set("65", forwardAvailableBalance.getTagResult().getValue());
            }
        }
    }
}
