55 lines
855 B
Go
Raw Normal View History

2023-10-08 15:59:42 +07:00
package constants
2025-03-08 00:35:23 +07:00
import (
"github.com/google/uuid"
"time"
)
2023-10-08 15:59:42 +07:00
const (
ContextRequestID string = "requestId"
)
type UserType string
func (u UserType) toString() string {
return string(u)
}
2025-03-08 00:35:23 +07:00
const (
StatusPending = "PENDING"
StatusPaid = "PAID"
StatusCanceled = "CANCELED"
StatusExpired = "EXPIRED"
StatusExecuted = "EXECUTED"
)
const (
PaymentCash = "CASH"
PaymentCreditCard = "CREDIT_CARD"
PaymentDebitCard = "DEBIT_CARD"
PaymentEWallet = "E_WALLET"
)
const (
SourcePOS = "POS"
SourceMobile = "MOBILE"
SourceWeb = "WEB"
)
const (
DefaultInquiryExpiryDuration = 30 * time.Minute
)
func GenerateUUID() string {
return uuid.New().String()
}
func GenerateRefID() string {
now := time.Now()
return now.Format("20060102") + "-" + uuid.New().String()[:8]
}
var TimeNow = func() time.Time {
return time.Now()
}