import { PaymentRequest, BuildPayload } from './PaymentRequest';

export class PayOutQueryRequest extends PaymentRequest {
   merchantId?: string;
   businessType?: string;
   bankCode?: string;
   bankAccNo?: string;
   palmpayAccNo?: string;
   

  constructor(
    paymentRequest: PaymentRequest,
    merchantId?: string,
    businessType?: string,
    bankCode?: string,
    bankAccNo?: string,
    palmpayAccNo?: string,
   
  ) {
    super(paymentRequest.requestTime, paymentRequest.version, paymentRequest.nonceStr);
    this.merchantId = merchantId;
    this.businessType = businessType;
    this.bankCode = bankCode;
    this.bankAccNo = bankAccNo;
    this.palmpayAccNo = palmpayAccNo;
  }

  public toJSON(): object {
    return {
      requestTime: this.requestTime,
      version: this.version,
      nonceStr: this.nonceStr,
      merchantId: this.merchantId,
      businessType: this.businessType,
      bankCode: this.bankCode,
      bankAccNo: this.bankAccNo,
      palmpayAccNo: this.palmpayAccNo,
     
    };
  }
}


export class PayOutQueryRequestBuilder extends BuildPayload {
   
    private merchantId?: string;
    private businessType?: string;
    private bankCode?: string;
    private bankAccNo?: string;
    private palmpayAccNo?: string;
   
  
    constructor(requestTime: number, version: string, nonceStr: string) {
      super(requestTime, version, nonceStr);
      
    }
  
    public setMerchantId(merchantId: string): PayOutQueryRequestBuilder {
      this.merchantId = merchantId;
      return this;
    }
  
    public setBusinessType(businessType: string): PayOutQueryRequestBuilder {
      this.businessType = businessType;
      return this;
    }
  
    public setBankCode(bankCode: string): PayOutQueryRequestBuilder {
      this.bankCode = bankCode;
      return this;
    }
  
    public setBankAccNo(bankAccNo: string): PayOutQueryRequestBuilder {
      this.bankAccNo = bankAccNo;
      return this;
    }
  
    public setPalmpayAccNo(palmpayAccNo: string): PayOutQueryRequestBuilder {
      this.palmpayAccNo = palmpayAccNo;
      return this;
    }
  
    
  
    public build(): PayOutQueryRequest {
      return new PayOutQueryRequest(
        super.build(),
        this.merchantId,
        this.businessType,
        this.bankCode,
        this.bankAccNo,
        this.palmpayAccNo
      );
    }
  }
