Feat(BE-36,37,38,39): master area, customer, kandang, location, warehouse

This commit is contained in:
Hafizh A. Y
2025-10-02 10:51:15 +07:00
parent dbc1f79a36
commit e8905be856
79 changed files with 3745 additions and 169 deletions
+39
View File
@@ -9,6 +9,29 @@ const (
FlagIsActive FlagType = "IS_ACTIVE"
)
// -------------------------------------------------------------------
// WarehouseType
// -------------------------------------------------------------------
type WarehouseType string
const (
WarehouseTypeArea WarehouseType = "AREA"
WarehouseTypeLokasi WarehouseType = "LOKASI"
WarehouseTypeKandang WarehouseType = "KANDANG"
)
// -------------------------------------------------------------------
// WarehouseType
// -------------------------------------------------------------------
type CustomerSupplierType string
const (
CustomerSupplierTypeBisnis CustomerSupplierType = "BISNIS"
CustomerSupplierTypeIndividual CustomerSupplierType = "INDIVIDUAL"
)
// -------------------------------------------------------------------
// Validators
// -------------------------------------------------------------------
@@ -21,6 +44,22 @@ func IsValidFlagType(v string) bool {
return false
}
func IsValidWarehouseType(v string) bool {
switch WarehouseType(v) {
case WarehouseTypeArea, WarehouseTypeLokasi, WarehouseTypeKandang:
return true
}
return false
}
func IsValidCustomerSupplierType(v string) bool {
switch CustomerSupplierType(v) {
case CustomerSupplierTypeBisnis, CustomerSupplierTypeIndividual:
return true
}
return false
}
// example use
/**
+1 -1
View File
@@ -3,8 +3,8 @@ package utils
import (
"errors"
"gitlab.com/mbugroup/lti-api.git/internal/common/validation"
"gitlab.com/mbugroup/lti-api.git/internal/response"
"gitlab.com/mbugroup/lti-api.git/internal/validation"
"github.com/gofiber/fiber/v2"
)
+13
View File
@@ -0,0 +1,13 @@
package utils
import "strings"
// NormalizeTrim returns the input string without leading/trailing whitespace.
func NormalizeTrim(value string) string {
return strings.TrimSpace(value)
}
// NormalizeUpper returns the trimmed, upper-case version of value.
func NormalizeUpper(value string) string {
return strings.ToUpper(NormalizeTrim(value))
}