package com.bcxin.api.interfaces.identities.requests;

import com.bcxin.Infrastructures.enums.CredentialType;
import com.bcxin.api.interfaces.RequestAbstract;
import lombok.Getter;

import java.util.Collection;

@Getter
public class SignUpRequest extends RequestAbstract {
    private final String tenantUserId;
    private final String telephone;
    private final String idNum;
    private final String name;
    private final Collection<CredentialRequest> credentials;

    public SignUpRequest(String tenantUserId,String telephone,String idNum, String name,Collection<CredentialRequest> credentials) {
        this.tenantUserId = tenantUserId;
        this.telephone = telephone;
        this.idNum = idNum;
        this.name = name;
        this.credentials = credentials;
    }

    public static SignUpRequest create(String tenantUserId,String telephone,String idNum, String name,Collection<CredentialRequest> credentials) {
        return new SignUpRequest(tenantUserId, telephone,idNum, name, credentials);
    }

    @Getter
    public static class CredentialRequest extends RequestAbstract {
        private final CredentialType credentialType;

        private final String number;

        public CredentialRequest(CredentialType credentialType, String number) {
            this.credentialType = credentialType;
            this.number = number;

        }

        public static CredentialRequest create(CredentialType credentialType, String number) {
            return new CredentialRequest(credentialType, number);
        }
    }
}
