19 lines
556 B
Go
19 lines
556 B
Go
package appointment
|
|
|
|
import (
|
|
"brainbuffer/pkg/brainbuffer/domain/repository"
|
|
"time"
|
|
)
|
|
|
|
type Repository interface {
|
|
Save(appointment *Appointment) error
|
|
FindByID(id int64) (*Appointment, error)
|
|
GetAllByTask(taskId int64, page repository.Page) (Appointments, error)
|
|
GetAllByTasks(taskIds []int64, page repository.Page) (Appointments, error)
|
|
GetAllByTasksBefore(taskIds []int64, beforeTime time.Time, page repository.Page) (Appointments, error)
|
|
DeleteAllByTask(taskId int64) error
|
|
}
|
|
|
|
func NewRepository() Repository {
|
|
return &inMemoryRepository{}
|
|
}
|