feat: add scheduled maintenance tasks (#320)

* add scheduled maintenance tasks

* fix failing typecheck
This commit is contained in:
Hayden 2023-02-26 18:42:23 -09:00 committed by GitHub
parent 70297b9d27
commit 025521431e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 521 additions and 121 deletions

View file

@ -5,6 +5,7 @@ import (
"testing"
"time"
"github.com/hay-kot/homebox/backend/internal/data/types"
"github.com/stretchr/testify/assert"
)
@ -43,10 +44,10 @@ func TestMaintenanceEntryRepository_GetLog(t *testing.T) {
}
created[i] = MaintenanceEntryCreate{
Date: dt,
Name: "Maintenance",
Description: "Maintenance description",
Cost: 10,
CompletedDate: types.DateFromTime(dt),
Name: "Maintenance",
Description: "Maintenance description",
Cost: 10,
}
}
@ -58,7 +59,9 @@ func TestMaintenanceEntryRepository_GetLog(t *testing.T) {
}
// Get the log for the item
log, err := tRepos.MaintEntry.GetLog(context.Background(), item.ID)
log, err := tRepos.MaintEntry.GetLog(context.Background(), item.ID, MaintenanceLogQuery{
Completed: true,
})
if err != nil {
t.Fatalf("failed to get maintenance log: %v", err)
}