package cloud.nstart.terravault.ordinis.restapi.dto;

import cloud.nstart.terravault.ordinis.domain.DataScope;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.JsonNode;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;

import java.util.List;

@JsonInclude(JsonInclude.Include.NON_NULL)
public record CreateDictionaryRequest(
    @NotBlank @Pattern(regexp = "^[a-z][a-z0-9_]{1,127}$") String name,
    String displayName,
    String description,
    @NotNull DataScope scope,
    @NotNull JsonNode schemaJson,
    String schemaVersion,
    String bundle,
    List<String> supportedLocales,
    String defaultLocale,
    /** CEO plan E2: opt-in materialization Redis projection. Null/missing = false. */
    Boolean redisProjectionEnabled,
    /** Approval Workflow v2: per-dict gate. Null/missing = no change. */
    Boolean approvalRequired,
    /** Optional Keycloak role для reviewer'а. Null = любой ordinis:approver. */
    String approvalMinRole) {}
