package com.bocloud.ims.entity.resource.azure.price;

import com.bocloud.common.utils.DateDeserializer;
import com.bocloud.common.utils.DateSerializer;
import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.meta.PKStrategy;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @Company: 博云 www.bocloud.com
 * @ClassName: BillSyncRecord
 * @Description:
 * @author: zhenpingLi/李振平
 * @date: 2021/3/29 14:04
 */
@Getter
@Setter
@Table("bill_sync_record")
public class BillSyncRecord {

    @PK(value = PKStrategy.AUTO)
    private Long id; // ID
    @Column("vendor_id")
    private Long vendorId;
    @Column("status")
    private String status;
    @Column("start_time")
    @JsonSerialize(
            using = DateSerializer.class
    )
    @JsonDeserialize(
            using = DateDeserializer.class
    )
    @DateTimeFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    private Date startTime;
    @Column("end_time")
    @JsonSerialize(
            using = DateSerializer.class
    )
    @JsonDeserialize(
            using = DateDeserializer.class
    )
    @DateTimeFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    private Date endTime;
    @Column("message")
    private String message;
    @Column("sync_type")
    private String syncType;

    public BillSyncRecord() {
    }

    public BillSyncRecord(Long vendorId, String status, Date startTime, String message, String syncType) {
        this.vendorId = vendorId;
        this.status = status;
        this.startTime = startTime;
        this.message = message;
        this.syncType = syncType;
    }
}