package cokr.xit.ens.modules.common.ctgy.intgrnbill.nv.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_nv_ep", schema = "", catalog = "")
@Schema(name = "BillNvEasyPay")
public class BillNvEasyPay extends BillBaseEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "BillNv_Generator")
    @TableGenerator(table = "ens_seq_generator", name = "BillNv_Generator"
            , pkColumnName = "seq_name", pkColumnValue = "BillNv_id"
            , initialValue = 0, allocationSize = 200)
    @Schema(required = true, title = "PK", example = " ")
    private Long billId;               


    @Schema(required = true, title = "결제 타입", example = "normal")
    @Column(name = "pay_type", nullable = false, length = 10)
    private String payType;

    @Schema(required = true, title = "결제창 Open 타입", example = "page")
    @Column(name = "open_type", nullable = false, length = 10)
    private String openType;

    /* =====================================
    * 결제진행 - PayNotice 단계
    ===================================== */
    @Schema(required = false, title = "상품명", example = "테스트상품")
    @Column(name = "product_name", nullable = true, length = 128)
    @Setter
    private String productName;
    @Schema(required = false, title = "총 결제 금액", example = "1000")
    @Column(name = "total_pay_amount", nullable = true)
    @Setter
    private Integer totalPayAmount;
    @Schema(required = false, title = "과세 대상 금액", example = "1000")
    @Column(name = "tax_scope_amount", nullable = true)
    @Setter
    private Integer taxScopeAmount;
    @Schema(required = false, title = "면세 대상 금액", example = "0")
    @Column(name = "tax_ex_scope_amount", nullable = true)
    @Setter
    private Integer taxExScopeAmount;
    @Schema(required = false, title = "컵 보증금 대상 금액", example = "0")
    @Column(name = "environment_deposit_amount", nullable = true)
    @Setter
    private Integer environmentDepositAmount;
    @Lob
    @Schema(required = false, title = "상품 목록", example = " ")
    @Column(name = "product_items", nullable = true)
    private String productItems;
    @Schema(required = false, title = "리턴URL(이용자 결제완료 후 네이버측에서 승인 하기전 오인결제,이중결제 등을 예방하기 위해 가맹점 검증을 위한 가맹점URL)", example = " ")
    @Column(name = "return_url", nullable = true, length = 1000)
    @Setter
    private String returnUrl;
    @Schema(required = false, title = "결제번호", example = "20170201NP1043587746")
    @Column(name = "last_payment_id", nullable = true, length = 100)
    @Setter
    private String lastPaymentId;
    @Schema(required = false, title = "결제취소번호", example = "20230208NP1041112193")
    @Column(name = "last_pay_hist_id", nullable = true, length = 100)
    @Setter
    private String lastPayHistId;
    @Schema(required = false, title = "취소 결제번호", example = "20170201NP1043587746")
    @Column(name = "last_cancel_payment_id", nullable = true, length = 100)
    @Setter
    private String lastCancelPaymentId;
    @Embedded
    @Setter
    private FieldError error;
}
