package com.mvrent.carrental.model;

import jakarta.persistence.*;
import jakarta.validation.constraints.*;
import lombok.*;

/**
 * Admin-configurable master category for vehicles, drivers or customers.
 * Replaces hard-coded enums going forward; consumed by the Fleet/Driver/Customer
 * modules in their respective phases.
 */
@Entity
@Table(name = "categories",
        uniqueConstraints = @UniqueConstraint(columnNames = {"type", "name"}))
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Category {

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

    @Enumerated(EnumType.STRING)
    @NotNull
    @Column(nullable = false)
    private CategoryType type;

    @NotBlank
    @Column(nullable = false)
    private String name;

    private String description;

    @Builder.Default
    private boolean active = true;
}
