mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
Feat(BE-36,37,38,39): master area, customer, kandang, location, warehouse
This commit is contained in:
@@ -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
|
||||
|
||||
/**
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
Reference in New Issue
Block a user