package com.yaoai.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

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

@Data
@TableName("billing_records")
public class BillingRecord {

    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    private Long tenantId;
    private Long projectId;

    /** 租户内发起此操作的用户 */
    private Long userId;

    /** 运营手动充值时记录运营 ID */
    private Long createdByAdminId;

    /** outline_generate / episode_generate / image_generate / video_generate / assembly / recharge */
    private String operation;

    /** TEXT / IMAGE / VIDEO / AUDIO / COMPOSE / RECHARGE */
    private String modality;

    /** volcengine / qwen / openai / ffmpeg */
    private String modelProvider;

    /** 模型唯一 ID，如 doubao-seedream-5-0-260128 */
    private String modelId;

    /** 模型展示名称 */
    private String modelName;

    /** 单次操作的单元数（图数 / 视频段数 / token 倍率） */
    private Integer unitCount;

    /** 1=成功 0=失败；失败也记一笔 credits=0 用于审计 */
    private Boolean success;

    /** JSON 元数据：尺寸、时长、token 数等 */
    private String billingMeta;

    private BigDecimal credits;

    /** SOFT / STRICT */
    private String billingMode;

    /** task ID / project ID 等外部引用 */
    private String refId;

    private LocalDateTime createdAt;
}
