package de.effigenix.infrastructure.masterdata.web.dto;

import de.effigenix.domain.masterdata.productcategory.ProductCategory;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(requiredProperties = {"id", "name", "description"})
public record ProductCategoryResponse(
        String id,
        String name,
        String description
) {
    public static ProductCategoryResponse from(ProductCategory category) {
        return new ProductCategoryResponse(
                category.id().value(),
                category.name().value(),
                category.description()
        );
    }
}
