80 lines
981 B
Go
Raw Normal View History

2023-10-08 15:59:42 +07:00
package order
type OrderStatus string
const (
New OrderStatus = "NEW"
Paid OrderStatus = "PAID"
Cancel OrderStatus = "CANCEL"
)
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
}
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
}