You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Backend engineers should implement the logging and feeding logic.
Acceptance Criteria
Create new DB tables called MedicationCheckIn and MedicationLog.
Schemas:
MedicationCheckIn: {
_id: ObjectId
medicationId: ObjectId
expiration: date
}
MedicationLog: {
_id: ObjectId
medicationId: ObjectId
dateTaken: date
}
The following endpoints are implemented:
POST /api/v1/medication/{medicationId}/check-in
No Request Body
POST /api/v1/medication/{medicationId}/log
Request Body: {
"pin": string
}
PATCH /api/v1/pet/{petId}/feed
Service layer should contain business logic for when a user checks in to a medication and for actually logging it. When a user checks in, a new entity should be created, with a 15 min expiration to log the medication before they have to check in again.
Validate that the medicationId exists, and is not expired. If expired, delete that particular MedicationCheckIn entity. Do nothing if there's an already existing MedicationCheckIn entity for that medication and it hasn't expired.
If a user decides to log the medication, validate the pin by matching it with the pin set in the User's settings. Validate that the pin exists for the user. Validate that the expiration from check in has not expired. If logging is successful, delete the MedicationCheckIn entity. Add food to the pet. You may have to update the current entities / types / models to have a food attribute, that takes in some integer.
If a user feeds a pet, make sure the pet exists. If it does, then increase user xp by 50. (this number is tentative) Assume all xp level's threshold is 100 xp. If it overflows 100, increase the level of the pet/user.
DAO's should contain methods for creating MedicationCheckIn entities,MedicationLog entities, feeding pet entities, and updating user XP
Additional Notes
This is a lot. I tried my best to be thorough and clear, but whomever is working on this ticket will likely have questions. Please do not hesitate to reach out for clarifications or concerns!
The text was updated successfully, but these errors were encountered:
Description
Backend engineers should implement the logging and feeding logic.
Acceptance Criteria
MedicationCheckIn
andMedicationLog
.food
attribute, that takes in some integer.MedicationCheckIn
entities,MedicationLog
entities, feeding pet entities, and updating user XPAdditional Notes
This is a lot. I tried my best to be thorough and clear, but whomever is working on this ticket will likely have questions. Please do not hesitate to reach out for clarifications or concerns!
The text was updated successfully, but these errors were encountered: