Add subtask model and repository, implement webhook notification handling

fix Issue with Scheduler
Support NotificationPlatformWebhook
This commit is contained in:
Mo Tarbin 2025-02-25 23:56:49 -05:00
parent 41be361463
commit 8db572f1ec
13 changed files with 337 additions and 38 deletions

View file

@ -224,11 +224,25 @@ func TestScheduleNextDueDateDayOfMonth(t *testing.T) {
chore: chModel.Chore{
FrequencyType: chModel.FrequencyTypeDayOfTheMonth,
Frequency: 15,
IsRolling: true,
FrequencyMetadata: jsonPtr(`{ "unit": "days", "time": "2025-01-20T18:00:00-05:00", "days": [], "months": [ "january" ] }`),
},
completedDate: now.AddDate(1, 1, 0),
want: timePtr(time.Date(2027, 1, 15, 18, 0, 0, 0, location)),
},
// test if completed before the 15th of the month:
{
name: "Day of the month - 15th of January(isRolling)(Completed before due date)",
chore: chModel.Chore{
NextDueDate: timePtr(time.Date(2025, 1, 15, 18, 0, 0, 0, location)),
FrequencyType: chModel.FrequencyTypeDayOfTheMonth,
Frequency: 15,
IsRolling: true,
FrequencyMetadata: jsonPtr(`{ "unit": "days", "time": "2025-01-20T18:00:00-05:00", "days": [], "months": [ "january" ] }`),
},
completedDate: now.AddDate(0, 0, 2),
want: timePtr(time.Date(2026, 1, 15, 18, 0, 0, 0, location)),
},
}
executeTestTable(t, tests)