package com.gnx.telemedicine.mappers;

import com.gnx.telemedicine.dto.prescription.MedicationIntakeLogRequestDto;
import com.gnx.telemedicine.dto.prescription.MedicationIntakeLogResponseDto;
import com.gnx.telemedicine.model.MedicationIntakeLog;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

@Mapper(componentModel = "spring")
public interface MedicationIntakeLogMapper {
    
    @Mapping(target = "prescription", ignore = true)
    @Mapping(target = "id", ignore = true)
    @Mapping(target = "createdAt", ignore = true)
    MedicationIntakeLog toMedicationIntakeLog(MedicationIntakeLogRequestDto dto);
    
    @Mapping(target = "prescriptionId", source = "prescription.id")
    MedicationIntakeLogResponseDto toMedicationIntakeLogResponseDto(MedicationIntakeLog log);
}

