package com.tmerclub.cloud.supplier.mongo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.LocalDateTime;

/**
 * Mongo采购日志
 * @author gaozijie
 * @date 2023-08-28
 */
@Document("purchase_amount_log")
@CompoundIndexes({
        @CompoundIndex(name = "shop_idx", def = "{'shopId':1, 'supplierId':1}"),
        @CompoundIndex(name = "supplier_index", def = "{'supplierId':1, 'shopId':1}")
})
@Data
public class MongoPurchaseAmountLogBO {

    @Id
    @Schema(description = "采购日志Id")
    private Long purchaseLogId;

    @Schema(description = "商家Id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long shopId;

    @Schema(description = "供应商Id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long supplierId;

    @Schema(description = "采购金额类型", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer purchaseAmountType;

    @Schema(description = "采购订单编号")
    private Long purchaseOrderId;

    @Schema(description = "改变金额")
    private Long changeAmount;

    @Schema(description = "采购总价")
    private Long purchaseTotalAmount;

    @Schema(description = "采购商品数量")
    private Integer prodCount;

    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    public MongoPurchaseAmountLogBO() {
    }

}
