Closed kasugaijin closed 7 months ago
Do we need design for this? Seems like staff needs some sort of UI to manage default tasks
I feel like there could be different scenarios for default pet tasks? ex. On add pet (draft mode) -> add tasks: fill in pet details (not recurring), vaccine reminders (recurring) On app submitted for pet -> add tasks: review application (not recurring)
@nsiwnf there’s already a default pet task flow in main for staff to add default pet tasks (see dashboard sidenav) so this issue shouldn’t need any design. These are used to create a new task on creation of a new pet.
I do like the idea of tethering other tasks to certain events too, though. But currently this flow is just for adding tasks to a Pet when the pet is created.
Anyone interested in this ticket - let me know if you have questions! Here or in slack.
I can work on this.
Just some clarification.
* Update the TaskService to create the first task. Due date will be Time.current + next_due_date_in_days
This is assuming an initial due date was not submitted? Would there be a scenario for example, where the staff would want the initial due date to be 5 days out then the recurrence would be every 10 days going forward?
Something along the lines of if task.due_date is nil then Time.current + next_due_date_in_days else task.due_date
Or would you prefer in the form to disable the due_date field if recurring is selected and enable the next_due_date_in_days?
Also the actual tasks allows for recurring to be true but with no due date. No sure of your thoughts on how that fits into all of this.
All yours!
So the Default Pet Task form/model doesn't have a due date. We use the due_in_days to calculate the Task's due date in the Service. But this does remind me that my initial ticket is incorrect as we do not need to include a next_due_in_days in the migration. We can use the existing due_in_days field to create the due date and set the next_due_in_days on the Task when it is created. I updated the issue description :) Does that make sense?
Yes! Thank you.
Staff can currently create Default Pet Tasks. These are tasks that are automatically created on new pet, when that pet is created. This is for common tasks that always apply, and saves the staff from having to manually create them on each pet.
Tasks now have recurring functionality. That is, staff can create/edit a task on a pet and set it as recurring, and also set a next_due_date_in_days value. When this recurring task is marked complete, a new, identical task is created, and its due date will be today + the next_due_date_in_days value.
This ticket is to add
twoa new attribute to Default Pet Tasks that will create recurring tasks on a pet.Acceptance criteria: Add to DefaultPetTask (table, model, form)
and next_due_date_in_days, integerto the default_pet_tasks tablenext_due_date_in_days, positive integer inputto the default pet tasks form