package cokr.xit.ens.modules.common.ctgy.intgrnbill.kko.entity;

import cokr.xit.ens.modules.common.ctgy.intgrnbill.support.entity.BillBaseEntity;
import cokr.xit.ens.modules.common.domain.support.FieldError;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;

import javax.persistence.*;

@Entity
@Getter
@ToString
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "ens_bill_kko", schema = "", catalog = "")
@Schema(name = "BillKkoPay")
public class BillKkoPay extends BillBaseEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "BillKko_Generator")
    @TableGenerator(table = "ens_seq_generator", name = "BillKko_Generator"
            , pkColumnName = "seq_name", pkColumnValue = "BillKko_id"
            , initialValue = 0, allocationSize = 200)
    @Schema(required = true, title = "PK", example = " ")
    private Long billId;               

    
    @Schema(required = false, title = "청구 연월", example = " ")
    @Column(name = "billed_year_month", nullable = true)
    @Setter
    private String billedYearMonth;
    @Schema(required = false, title = "동일 고객번호 구분 값", example = " ")
    @Column(name = "ordinal", nullable = true)
    @Setter
    private String ordinal;
    @Schema(required = false, title = "개별 청구서를 식별하는 키 값", example = " ")
    @Column(name = "biller_notice_key", nullable = true)
    @Setter
    private String billerNoticeKey;
    @Schema(required = false, title = "URL 만료일", example = "20200130235959")
    @Column(name = "expire_at", nullable = true)
    @Setter
    private String expireAt;
    @Schema(required = false, title = "API 호출 시 함께 전달할 JSON형태의 문자열", example = " ")
    @Column(name = "parameters", nullable = true)
    @Lob
    @Setter
    private String parameters;
    @Schema(required = false, title = "청구서조회/납부가능여부/납부결과 API Url정보 JSON형태의 문자열", example = " \"custom_url\": {\n" +
            "      \"notice_url\" : \" https://test-api.dozn.co.kr/kakao/notice\",\n" +
            "      \"prepay_url\": \"https://test-api.dozn.co.kr/kakao/prepay\",\n" +
            "      \"pay_result_url\": \" https://test-api.dozn.co.kr/kakao/pay-result\"\n" +
            "    }")
    @Column(name = "custom_url", nullable = true, length = 500)
    @Setter
    private String customUrl;
    @Schema(required = false, title = "청구서URL", example = " ")
    @Column(name = "url", nullable = true)
    @Setter
    private String url;
    /* =====================================
    * 결제진행 - PayNotice 단계
    ===================================== */
    @Schema(required = false, title = "청구서명", example = "테스트청구서")
    @Column(name = "title", nullable = true)
    @Setter
    private String title;
    @Schema(required = false, title = "납부 요청금액", example = "1000")
    @Column(name = "amount", nullable = true)
    @Setter
    private Integer amount;
    @Schema(required = false, title = "비과세 금액", example = "0")
    @Column(name = "tax_free_amount", nullable = true)
    @Setter
    private Integer taxFreeAmount;
    @Schema(required = false, title = "부가세 금액", example = "0")
    @Column(name = "vat_amount", nullable = true)
    @Setter
    private Integer vatAmount;
    @Schema(required = false, title = "납기 안내타입", example = "D1")
    @Column(name = "expire_type", nullable = true, length = 10)
    @Setter
    private String expireType;
    @Schema(required = false, title = "첫번째 납기일", example = "20230212")
    @Column(name = "pay_expire_date", nullable = true, length = 8)
    @Setter
    private String payExpireDate;
    @Schema(required = false, title = "두번째 납기일", example = "20230212")
    @Column(name = "second_pay_expire_date", nullable = true, length = 8)
    @Setter
    private String secondPayExpireDate;
    @Schema(required = false, title = "계좌송금수단 사용 시 계좌정보", example = " ")
    @Lob
    @Column(name = "bank_accounts", nullable = true)
    @Setter
    private String bankAccounts;
    @Schema(required = false, title = "청구서 상세정보", example = " ")
    @Lob
    @Column(name = "details", nullable = true)
    @Setter
    private String details;
    @Schema(required = false, title = "결제일시(YYYYMMDDHH24MISS)", example = "20190220161656")
    @Column(name = "last_paid_at", nullable = true, length = 14)
    @Setter
    private String lastPaidAt;
    @Schema(required = false, title = "결제번호", example = "2748877")
    @Column(name = "last_pay_id", nullable = true)
    @Setter
    private Integer lastPayId;

    @Embedded
    @Setter
    private FieldError error;


}
