package com.reading.platform.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 套餐课程包关联实体
 * 用于实现套餐与课程包的多对多关系
 */
@Data
@TableName("t_product_bundle_course_package")
@Schema(description = "套餐课程包关联")
public class ProductBundleCoursePackage {

    @Schema(description = "关联 ID", accessMode = Schema.AccessMode.READ_ONLY)
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    // === 关联字段 ===
    @Schema(description = "套餐 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1234567890")
    private String productBundleId;

    @Schema(description = "课程包 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "0987654321")
    private String coursePackageId;

    // === 业务字段 ===
    @Schema(description = "适用年级", example = "小班")
    private String gradeLevel;

    @Schema(description = "排序", example = "1")
    private Integer sortOrder;

    // === 系统字段 ===
    @Schema(description = "创建人用户名", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT)
    private String createdBy;

    @Schema(description = "更新人用户名", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;

    @Schema(description = "创建时间", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @Schema(description = "更新时间", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @Schema(description = "是否删除 0-未删除 1-已删除", accessMode = Schema.AccessMode.READ_ONLY)
    @TableLogic
    private Integer deleted;

    // === 关联查询 ===
    @TableField(exist = false)
    private CoursePackage coursePackage;
}
