feat: implement task respository
This commit is contained in:
21
internal/repository/task.go
Normal file
21
internal/repository/task.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.ksdemosapps.com/kylesoda/pgx-learning/internal/models"
|
||||
)
|
||||
|
||||
type GetAllTaskFilters struct {
|
||||
Limit int
|
||||
Offset int
|
||||
Completed *bool
|
||||
}
|
||||
|
||||
type TaskRepository interface {
|
||||
Save(ctx context.Context, task *models.Task) error
|
||||
GetById(ctx context.Context, id int) (*models.Task, error)
|
||||
GetAll(ctx context.Context, filters GetAllTaskFilters) ([]models.Task, error)
|
||||
Update(ctx context.Context, id int, input *models.UpdateTaskInput) (*models.Task, error)
|
||||
Delete(ctx context.Context, id int) error
|
||||
}
|
||||
Reference in New Issue
Block a user