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.time.LocalDateTime;

@Data
@TableName("admin_audit_logs")
public class AdminAuditLog {

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

    private Long adminUserId;

    /** Redundant for traceability after account deletion. */
    private String adminUsername;

    /** TENANT_RECHARGE / TENANT_SUSPEND / PLAN_CHANGE / USER_DISABLE / IMPERSONATE_START / ... */
    private String action;

    private String resourceType;

    private String resourceId;

    /** JSON */
    private String beforeValue;

    /** JSON */
    private String afterValue;

    private String ip;

    private String userAgent;

    private String requestId;

    /** SUCCESS / FAILED */
    private String status;

    private String errorMessage;

    private LocalDateTime createdAt;
}
