Update Partner

This commit is contained in:
aditya.siregar
2024-08-15 23:13:33 +07:00
parent 5907802908
commit 6fabd843d2
2 changed files with 6 additions and 3 deletions
+4 -2
View File
@@ -103,10 +103,12 @@ type PartnerLicense struct {
func (l *LicenseDB) ToPartnerLicense() PartnerLicense {
now := time.Now()
daysToExpire := int64(l.EndDate.Sub(now).Hours() / 24)
daysToExpire := int64(l.EndDate.Sub(now).Hours() / 24)
var licenseStatus string
if daysToExpire < 0 {
if now.Before(l.StartDate) {
licenseStatus = "INACTIVE"
} else if daysToExpire < 0 {
licenseStatus = "EXPIRED"
} else if daysToExpire <= 30 {
licenseStatus = "EXPIRING_SOON"