package com.seeyon.apps.esign.po.signer;

import java.util.ArrayList;
import java.util.List;

public interface SignerBuilder {

    /**
     * 根据签署方信息构建 Signer
     */
    Signer build(List<String> fileIds, List<Object> keywordPos,SignParty party,String appId);

    /**
     * 批量构建（默认能力）
     */
    default List<Signer> buildAll(List<String> fileIds,List<Object> keywordPos,List<SignParty> parties,String appId) {
        List<Signer> signers = new ArrayList<>();
        for (SignParty party : parties) {
            Signer signer = build(fileIds,keywordPos, party, appId);
            if (signer != null) {
                signers.add(signer);
            }
        }
        return signers;
    }
}