mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
FIX[BE]: name duplicate flock,projectflock category change,menerapkan dto seperti warehouse di projectflock
This commit is contained in:
@@ -59,7 +59,6 @@ var allFlagTypes = func() map[FlagType]struct{} {
|
||||
return m
|
||||
}()
|
||||
|
||||
|
||||
func AllFlagTypes() map[FlagType]struct{} {
|
||||
return allFlagTypes
|
||||
}
|
||||
@@ -76,8 +75,6 @@ const (
|
||||
WarehouseTypeKandang WarehouseType = "KANDANG"
|
||||
)
|
||||
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// WarehouseType
|
||||
// -------------------------------------------------------------------
|
||||
@@ -100,19 +97,29 @@ const (
|
||||
SupplierCategorySapronak SupplierCategory = "SAPRONAK"
|
||||
)
|
||||
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Kandang Status
|
||||
// Kandang Status
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
type KandangStatus string
|
||||
|
||||
const (
|
||||
KandangStatusNonActive KandangStatus = "NON_ACTIVE"
|
||||
KandangStatusPengajuan KandangStatus = "PENGAJUAN"
|
||||
KandangStatusActive KandangStatus = "ACTIVE"
|
||||
KandangStatusNonActive KandangStatus = "NON_ACTIVE"
|
||||
KandangStatusPengajuan KandangStatus = "PENGAJUAN"
|
||||
KandangStatusActive KandangStatus = "ACTIVE"
|
||||
)
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// ProjectFlockCategory
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
type ProjectFlockCategory string
|
||||
|
||||
const (
|
||||
ProjectFlockCategoryGrowing ProjectFlockCategory = "GROWING"
|
||||
ProjectFlockCategoryLaying ProjectFlockCategory = "LAYING"
|
||||
)
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Validators
|
||||
// -------------------------------------------------------------------
|
||||
@@ -223,6 +230,21 @@ func IsValidCustomerSupplierType(v string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func NormalizeProjectFlockCategory(v string) (ProjectFlockCategory, bool) {
|
||||
normalized := ProjectFlockCategory(strings.ToUpper(strings.TrimSpace(v)))
|
||||
switch normalized {
|
||||
case ProjectFlockCategoryGrowing, ProjectFlockCategoryLaying:
|
||||
return normalized, true
|
||||
default:
|
||||
return "", false
|
||||
}
|
||||
}
|
||||
|
||||
func IsValidProjectFlockCategory(v string) bool {
|
||||
_, ok := NormalizeProjectFlockCategory(v)
|
||||
return ok
|
||||
}
|
||||
|
||||
func IsValidSupplierCategory(v string) bool {
|
||||
switch SupplierCategory(v) {
|
||||
case SupplierCategoryBOP, SupplierCategorySapronak:
|
||||
|
||||
Reference in New Issue
Block a user