package com.jeesharp.business.modules.finance.platformrevenue.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.jeesharp.framework.mybatis.core.dataobject.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 平台收入日汇总实体，映射表 {@code biz_platform_revenue}。
 *
 * @author jeesharp
 * @since 2026-06-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("biz_platform_revenue")
@Schema(description = "平台收入日汇总")
public class PlatformRevenue extends BaseEntity<PlatformRevenue> {

    @Schema(description = "统计自然日")
    private LocalDate statDate;

    /**
     * @see com.jeesharp.business.modules.finance.platformrevenue.enums.PlatformRevenuePeriodTypeEnum
     */
    @Schema(description = "周期类型：DAY、MONTH")
    private String periodType;

    @Schema(description = "结算模式")
    private String settleMode;

    @Schema(description = "收款入账笔数")
    private Long payCount;

    @Schema(description = "退款冲减笔数")
    private Long refundCount;

    @Schema(description = "收款基数合计（元）")
    private BigDecimal payBaseAmount;

    @Schema(description = "退款冲减合计（元）")
    private BigDecimal refundBaseAmount;

    @Schema(description = "平台佣金净额（元）")
    private BigDecimal netCommissionAmount;

    @Schema(description = "商户应得净额（元）")
    private BigDecimal netMerchantAmount;

    @Schema(description = "最近一次汇总写入时间")
    private LocalDateTime rollupTime;
}
