diff --git a/app/src/main/java/com/medmapper/v33001/dao/MedicineDAO.kt b/app/src/main/java/com/medmapper/v33001/dao/MedicineDAO.kt index 271f155..c45bd83 100644 --- a/app/src/main/java/com/medmapper/v33001/dao/MedicineDAO.kt +++ b/app/src/main/java/com/medmapper/v33001/dao/MedicineDAO.kt @@ -14,4 +14,7 @@ interface MedicineDAO { @Query("DELETE FROM Medicine") suspend fun deleteAll() -} \ No newline at end of file + + @Delete + suspend fun delete(medicine: Medicine) +} diff --git a/app/src/main/java/com/medmapper/v33001/dto/Medicine.kt b/app/src/main/java/com/medmapper/v33001/dto/Medicine.kt index 8094740..2a773c8 100644 --- a/app/src/main/java/com/medmapper/v33001/dto/Medicine.kt +++ b/app/src/main/java/com/medmapper/v33001/dto/Medicine.kt @@ -3,13 +3,21 @@ package com.medmapper.v33001.dto import androidx.room.ColumnInfo import androidx.room.Entity import androidx.room.PrimaryKey - +/** + * A data class representing Medicine + * + * @property name; the name of the medicine + * @property strength; the strength of the medicine + * @property start_date; the date the patient started the medicine + * @property preciscription_length; how long the patient should take the medicine + * + */ @Entity(tableName = "Medicine") data class Medicine( @PrimaryKey(autoGenerate = true) val medID: Int, @ColumnInfo(name = "name") val name: String?, @ColumnInfo(name = "strength") val strength: String?, - @ColumnInfo(name = "start date") val startDate: String?, - @ColumnInfo(name = "prescription length") val lengthInDays: Int + @ColumnInfo(name = "start_date") val startDate: String?, + @ColumnInfo(name = "prescription_length") val lengthInDays: Int //,@ColumnInfo() val endDate: Date = startDate -) \ No newline at end of file +)