package domain.dto.request;

import io.quarkus.runtime.annotations.RegisterForReflection;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@RegisterForReflection
public class CustomerRequest {

    @Valid
    @NotNull(message = "VDE01")
    private CustomerPositionState customerPositionState;

    @Valid
    @NotNull(message = "VDE01")
    private Device device;

    private TokenAssignmentInstance tokenAssignmentInstance;

    @Data
    public static class CustomerPositionState {
        private CustomerReference customerReference;

        @Data
        public static class CustomerReference {

            /**
             * Valida que sea una única letra del conjunto [V, E, P, G, J].
             */
            private String customerIdType;

            /**
             * Valida que sea numérico con un máximo de 9 dígitos.
             */
            private String customerId;

        }

    }

    @Data
    public static class Device {
        private String deviceType;
        private String deviceDescription;
        private String deviceIp;
        private String deviceSessionReference;
    }

    @Data
    public static class TokenAssignmentInstance {
        private String tokenIdentificationCode;
    }

}