package com.erp.ai.model;

import lombok.Data;

import java.time.OffsetDateTime;

/**
 * AI API 키 (테이블: ai_agent_api_keys)
 * sk-pipe-* 형식 외부 API 인증.
 */
@Data
public class AiAgentApiKey {
    private Long id;
    private String name;
    /** SHA-256 hex */
    private String key_hash;
    /** sk-pipe-{8hex} 표시용 */
    private String key_prefix;
    private String user_id;
    private String company_code;
    private Long agent_id;
    /** JSONB string[] */
    private String permissions;
    private Integer rate_limit;
    private Long monthly_token_limit;
    /** active | revoked */
    private String status;
    private OffsetDateTime last_used_at;
    private Long usage_count;
    private Long total_tokens;
    private OffsetDateTime expires_at;
    private OffsetDateTime created_at;
}
