diff options
author | Mo Tarbin <mhed.t91@gmail.com> | 2024-08-10 00:31:54 -0400 |
---|---|---|
committer | Mo Tarbin <mhed.t91@gmail.com> | 2024-08-10 00:31:54 -0400 |
commit | bddb80b1349c517ceaeacb92f5f8be9f482f400a (patch) | |
tree | cbfd2d9432c9ae9f6b84fc2dcba352e03c09abff /internal/chore/model | |
parent | 8609a289b61de939366b31a8a7a67c2327e9f5d1 (diff) | |
parent | 4f22460313f21494442fbea5b1fcda49fb897df0 (diff) | |
download | donetick-bddb80b1349c517ceaeacb92f5f8be9f482f400a.tar.gz donetick-bddb80b1349c517ceaeacb92f5f8be9f482f400a.tar.bz2 donetick-bddb80b1349c517ceaeacb92f5f8be9f482f400a.zip |
Merge branch 'dev'
Diffstat (limited to '')
-rw-r--r-- | internal/chore/model/model.go | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/internal/chore/model/model.go b/internal/chore/model/model.go index 38d8354..b2633b3 100644 --- a/internal/chore/model/model.go +++ b/internal/chore/model/model.go @@ -6,10 +6,26 @@ import ( tModel "donetick.com/core/internal/thing/model" ) +type FrequencyType string + +const ( + FrequancyTypeOnce FrequencyType = "once" + FrequancyTypeDaily FrequencyType = "daily" + FrequancyTypeWeekly FrequencyType = "weekly" + FrequancyTypeMonthly FrequencyType = "monthly" + FrequancyTypeYearly FrequencyType = "yearly" + FrequancyTypeAdaptive FrequencyType = "adaptive" + FrequancyTypeIntervel FrequencyType = "interval" + FrequancyTypeDayOfTheWeek FrequencyType = "days_of_the_week" + FrequancyTypeDayOfTheMonth FrequencyType = "day_of_the_month" + FrequancyTypeTrigger FrequencyType = "trigger" + FrequancyTypeNoRepeat FrequencyType = "no_repeat" +) + type Chore struct { ID int `json:"id" gorm:"primary_key"` Name string `json:"name" gorm:"column:name"` // Chore description - FrequencyType string `json:"frequencyType" gorm:"column:frequency_type"` // "daily", "weekly", "monthly", "yearly", "adaptive",or "custom" + FrequencyType FrequencyType `json:"frequencyType" gorm:"column:frequency_type"` // "daily", "weekly", "monthly", "yearly", "adaptive",or "custom" Frequency int `json:"frequency" gorm:"column:frequency"` // Number of days, weeks, months, or years between chores FrequencyMetadata *string `json:"frequencyMetadata" gorm:"column:frequency_meta"` // Additional frequency information NextDueDate *time.Time `json:"nextDueDate" gorm:"column:next_due_date;index"` // When the chore is due |