package com.huimv.employment.service.contract;

import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

/**
 * 开发态电子签 Stub：不调用外部平台，生成可联调的 mock 签署链接。
 */
@Component
public class MockESignClient implements ESignClient {

    @Override
    public ESignCreateResult createPendingContract(String contractNo, String contractType, String title, String workerName) {
        String no = StringUtils.hasText(contractNo) ? contractNo.trim() : "UNKNOWN";
        String externalId = "MOCK-" + no;
        String signUrl = "https://mock-esign.local/sign?contractNo=" + no
                + "&type=" + (StringUtils.hasText(contractType) ? contractType : "labor");
        return new ESignCreateResult(externalId, signUrl);
    }
}
