package com.gnx.telemedicine.dto.prescription;

import com.gnx.telemedicine.model.enums.PrescriptionStatus;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;

import java.time.LocalDate;
import java.util.UUID;

public record PrescriptionRequestDto(
        @NotNull(message = "Patient ID cannot be null")
        UUID patientId,

        @NotNull(message = "Doctor ID cannot be null")
        UUID doctorId,

        UUID appointmentId, // Optional

        @NotBlank(message = "Medication name cannot be blank")
        String medicationName,

        String medicationCode, // NDC code

        @NotBlank(message = "Dosage cannot be blank")
        String dosage,

        @NotBlank(message = "Frequency cannot be blank")
        String frequency,

        @NotNull(message = "Quantity cannot be null")
        @Positive(message = "Quantity must be positive")
        Integer quantity,

        Integer refills, // Default 0

        String instructions,

        @NotNull(message = "Start date cannot be null")
        LocalDate startDate,

        LocalDate endDate,

        PrescriptionStatus status, // Default ACTIVE

        String pharmacyName,
        String pharmacyAddress,
        String pharmacyPhone
) {}

