Dump changes
This commit is contained in:
parent
e12550a643
commit
aac2ea1b74
25 changed files with 129 additions and 76 deletions
42
pkg/brainbuffer/domain/appointment/entity.go
Normal file
42
pkg/brainbuffer/domain/appointment/entity.go
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
package appointment
|
||||
|
||||
import (
|
||||
"brainbuffer/pkg/brainbuffer/domain/scheduling"
|
||||
"time"
|
||||
)
|
||||
|
||||
type CompletionStatus int
|
||||
|
||||
const (
|
||||
None CompletionStatus = iota
|
||||
Missed
|
||||
Completed
|
||||
Skipped
|
||||
)
|
||||
|
||||
type TimeStatus int
|
||||
|
||||
const (
|
||||
Overdue TimeStatus = iota
|
||||
Upcoming
|
||||
)
|
||||
|
||||
type Appointment struct {
|
||||
ID int64
|
||||
TaskID int64
|
||||
CompletionStatus CompletionStatus
|
||||
SchedulingPattern scheduling.Pattern
|
||||
PlannedTime time.Time
|
||||
DurationOffset time.Duration
|
||||
CreationTime time.Time
|
||||
}
|
||||
|
||||
func (a *Appointment) TimeStatus() TimeStatus {
|
||||
if a.PlannedTime.Before(time.Now()) {
|
||||
return Overdue
|
||||
} else {
|
||||
return Upcoming
|
||||
}
|
||||
}
|
||||
|
||||
type Appointments []*Appointment
|
||||
Loading…
Add table
Add a link
Reference in a new issue