Add true up review status history, add migration for persisting history, add store to create, get, and update true up review history entries, cleanup errors, etc.
Этот коммит содержится в:
@@ -16,6 +16,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v6/model"
|
||||
"github.com/mattermost/mattermost-server/v6/shared/mlog"
|
||||
@@ -34,6 +35,9 @@ hwIDAQAB
|
||||
|
||||
var LicenseValidator LicenseValidatorIface
|
||||
|
||||
const TrueUpReviewDueDay = 15
|
||||
const BusinessQuaterStep = 3
|
||||
|
||||
func init() {
|
||||
if LicenseValidator == nil {
|
||||
LicenseValidator = &LicenseValidatorImpl{}
|
||||
@@ -224,3 +228,21 @@ func GetSanitizedClientLicense(l map[string]string) map[string]string {
|
||||
|
||||
return sanitizedLicense
|
||||
}
|
||||
|
||||
func GetNextTrueUpReviewDueDate() string {
|
||||
now := time.Now().UTC()
|
||||
quaterEndMonths := []time.Month{time.March, time.June, time.September, time.December}
|
||||
|
||||
var nextQuaterEndMonth time.Month = time.March
|
||||
for _, month := range quaterEndMonths {
|
||||
if now.Month() <= month && now.Day() <= TrueUpReviewDueDay {
|
||||
nextQuaterEndMonth = month
|
||||
break
|
||||
} else if now.Month() <= month && now.Day() > TrueUpReviewDueDay {
|
||||
nextQuaterEndMonth = month + BusinessQuaterStep
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return time.Date(now.Year(), nextQuaterEndMonth, TrueUpReviewDueDay, 0, 0, 0, 0, now.Location()).Format("2006-01-02")
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user