package de.effigenix.shared.security;

import java.util.UUID;

/**
 * Value Object representing a Branch's unique identifier.
 * Used for multi-branch authorization and filtering.
 */
public record BranchId(String value) implements ResourceId {

    public BranchId {
        if (value == null || value.isBlank()) {
            throw new IllegalArgumentException("BranchId cannot be null or empty");
        }
    }

    /**
     * Generates a new random BranchId.
     */
    public static BranchId generate() {
        return new BranchId(UUID.randomUUID().toString());
    }

    /**
     * Creates a BranchId from a string value.
     */
    public static BranchId of(String value) {
        return new BranchId(value);
    }
}
