package kr.co.accura.wtm.domain.audit.entity;

import jakarta.persistence.*;
import kr.co.accura.wbx.spring.common.BaseEntity;
import lombok.*;

@Entity
@Table(name = "sa_access_logs")
@Getter @Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class SaAccessLog extends BaseEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "user_id", nullable = false)
    private Long userId;

    @Column(nullable = false, length = 50)
    private String action;

    @Column(length = 100)
    private String resource;

    @Column(name = "resource_id")
    private Long resourceId;

    @Column(name = "ip_address", length = 50)
    private String ipAddress;

    @Column(name = "user_agent", length = 500)
    private String userAgent;

    @Column(length = 2000)
    private String detail;
}
