init project

This commit is contained in:
aditya.siregar
2024-05-28 14:14:55 +07:00
commit 67f1dbc850
141 changed files with 16879 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
package product
type ProductStatus string
const (
Active ProductStatus = "Active"
Inactive ProductStatus = "Inactive"
)
func (b ProductStatus) toString() string {
return string(b)
}
type ProductType string
const (
Food ProductType = "FOOD"
Beverage ProductType = "BEVERAGE"
)
func (b ProductType) toString() string {
return string(b)
}
type ProductStock string
const (
Available ProductStock = "AVAILABLE"
Unavailable ProductStock = "UNAVAILABLE"
)
func (b ProductStock) toString() string {
return string(b)
}
func (i *ProductStock) IsAvailable() bool {
if i == nil {
return false
}
if *i == Available {
return true
}
return false
}
func (i *ProductStock) IsUnavailable() bool {
if i == nil {
return false
}
if *i == Unavailable {
return true
}
return false
}