package com.mirna.hospitalmanagementapi.domain.dtos; import java.time.OffsetDateTime; import java.util.UUID; import com.mirna.hospitalmanagementapi.domain.entities.Prescription; import com.mirna.hospitalmanagementapi.domain.entities.inventory.InventoryItem; import com.mirna.hospitalmanagementapi.domain.entities.MedicalRecord; public record PrescriptionResponseDTO( UUID id, // เปลี่ยนจาก Long เป็น UUID Long medicalRecordId, UUID inventoryItemId, String itemName, Integer quantity, String instructions, OffsetDateTime createdAt, OffsetDateTime updatedAt ) { public PrescriptionResponseDTO(Prescription prescription) { this( prescription.getId(), prescription.getMedicalRecord().getId(), prescription.getInventoryItem().getId(), prescription.getInventoryItem().getItemName(), prescription.getQuantity(), prescription.getInstructions(), prescription.getCreatedAt(), prescription.getUpdatedAt() ); } }