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
+12
View File
@@ -0,0 +1,12 @@
package branch
type BranchStatus string
const (
Active BranchStatus = "Active"
Inactive BranchStatus = "Inactive"
)
func (b BranchStatus) toString() string {
return string(b)
}
+11
View File
@@ -0,0 +1,11 @@
package constants
const (
ContextRequestID string = "requestId"
)
type UserType string
func (u UserType) toString() string {
return string(u)
}
+12
View File
@@ -0,0 +1,12 @@
package device
type DeviceStatus string
const (
On DeviceStatus = "On"
Off DeviceStatus = "Off"
)
func (b DeviceStatus) toString() string {
return string(b)
}
@@ -0,0 +1,12 @@
package device
type DeviceConnectionStatus string
const (
Connected DeviceConnectionStatus = "Connected"
Disconnected DeviceConnectionStatus = "Disconnected"
)
func (b DeviceConnectionStatus) toString() string {
return string(b)
}
+79
View File
@@ -0,0 +1,79 @@
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
}
+9
View File
@@ -0,0 +1,9 @@
package constants
const (
OssLogLevelLogOff = "LogOff"
OssLogLevelDebug = "Debug"
OssLogLevelError = "Error"
OssLogLevelWarn = "Warn"
OssLogLevelInfo = "Info"
)
+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
}
+9
View File
@@ -0,0 +1,9 @@
package role
type Role int64
const (
SuperAdmin Role = 1
BranchAdmin Role = 2
CasheerAdmin Role = 3
)
+12
View File
@@ -0,0 +1,12 @@
package studio
type StudioStatus string
const (
Active StudioStatus = "Active"
Inactive StudioStatus = "Inactive"
)
func (b StudioStatus) toString() string {
return string(b)
}
@@ -0,0 +1,26 @@
package transaction
type PaymentStatus string
const (
New PaymentStatus = "NEW"
Paid PaymentStatus = "PAID"
Cancel PaymentStatus = "CANCEL"
)
func (b PaymentStatus) toString() string {
return string(b)
}
type PaymentMethod string
const (
Cash PaymentMethod = "CASH"
Debit PaymentMethod = "DEBIT"
Transfer PaymentMethod = "TRANSFER"
QRIS PaymentMethod = "QRIS"
)
func (b PaymentMethod) toString() string {
return string(b)
}
@@ -0,0 +1,12 @@
package userstatus
type UserStatus string
const (
Active UserStatus = "Active"
Inactive UserStatus = "Inactive"
)
func (u UserStatus) toString() string {
return string(u)
}