package com.mvrent.carrental.web;

import com.mvrent.carrental.model.Category;

/** Flat JSON view of a Category for the AJAX category master screen. */
public record CategoryDto(Long id, String type, String name, String description, boolean active) {
    public static CategoryDto from(Category c) {
        return new CategoryDto(c.getId(),
                c.getType() != null ? c.getType().name() : null,
                c.getName(), c.getDescription(), c.isActive());
    }
}
