package com.gxwebsoft.common.system.entity;

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

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 代码仓库
 *
 * @author 科技小王子
 * @since 2024-10-19 18:08:51
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "CompanyGit对象", description = "代码仓库")
@TableName("sys_company_git")
public class CompanyGit implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "自增ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "仓库名称")
    private String title;

    @Schema(description = "厂商")
    private String brand;

    @Schema(description = "图标")
    private String icon;

    @Schema(description = "企业ID")
    private Integer companyId;

    @Schema(description = "仓库地址")
    private String domain;

    @Schema(description = "账号")
    private String account;

    @Schema(description = "密码")
    private String password;

    @Schema(description = "仓库描述")
    private String comments;

    @Schema(description = "排序(数字越小越靠前)")
    private Integer sortNumber;

    @Schema(description = "状态, 0正常, 1待确认")
    private Integer status;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "租户id")
    private Integer tenantId;

    /**
     * 用户余额变动明细表
     *
     * @author 科技小王子
     * @since 2023-04-21 15:59:09
     */
    @Data
    @EqualsAndHashCode(callSuper = false)
    @Schema(name = "UserBalanceLog对象", description = "用户余额变动明细表")
    @TableName("sys_user_balance_log")
    public static class UserBalanceLog implements Serializable {
        private static final long serialVersionUID = 1L;

        @Schema(description = "主键ID")
        @TableId(value = "log_id", type = IdType.AUTO)
        private Integer logId;

        @Schema(description = "用户ID")
        private Integer userId;

        @Schema(description = "余额变动场景(10用户充值 20用户消费 30管理员操作 40订单退款)")
        private Integer scene;

        @Schema(description = "变动金额")
        private BigDecimal money;

        @Schema(description = "变动后余额")
        private BigDecimal balance;

        @Schema(description = "订单编号")
        private String orderNo;

        @Schema(description = "支付流水号")
        private String transactionId;

        @Schema(description = "管理员备注")
        private String remark;

        @Schema(description = "排序(数字越小越靠前)")
        private Integer sortNumber;

        @Schema(description = "备注")
        private String comments;

        @Schema(description = "状态, 0正常, 1冻结")
        private Integer status;

        @Schema(description = "是否删除, 0否, 1是")
        @TableLogic
        private Integer deleted;

        @Schema(description = "商户编码")
        private String merchantCode;

        @Schema(description = "租户id")
        private Integer tenantId;

        @Schema(description = "注册时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime createTime;

        @Schema(description = "修改时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime updateTime;

        @Schema(description = "昵称")
        @TableField(exist = false)
        private String nickname;

        @Schema(description = "用户头像")
        @TableField(exist = false)
        private String avatar;

    }
}
