aditya.siregar 09c9a4d59d update
2025-04-10 11:21:08 +07:00

85 lines
1.1 KiB
Go

package order
type OrderStatus string
const (
New OrderStatus = "NEW"
Paid OrderStatus = "PAID"
Cancel OrderStatus = "CANCEL"
Pending OrderStatus = "PENDING"
)
func (b OrderStatus) toString() string {
return string(b)
}
func (i *OrderStatus) IsNew() bool {
if i == nil {
return false
}
if *i == New {
return true
}
return false
}
func (i OrderStatus) String() string {
return string(i)
}
type ItemType string
const (
Product ItemType = "PRODUCT"
Studio ItemType = "STUDIO"
)
func (b ItemType) toString() string {
return string(b)
}
func (i *ItemType) IsProduct() bool {
if i == nil {
return false
}
if *i == Product {
return true
}
return false
}
func (i *ItemType) IsStudio() bool {
if i == nil {
return false
}
if *i == Studio {
return true
}
return false
}
type OrderSearchStatus string
const (
Active OrderSearchStatus = "ACTIVE"
Inactive OrderSearchStatus = "INACTIVE"
)
func (i *OrderSearchStatus) IsActive() bool {
if i == nil {
return false
}
if *i == Active {
return true
}
return false
}