feat/BE/US-74/pengajuan-flock

This commit is contained in:
ragilap
2025-10-16 10:06:18 +07:00
parent 7392d8a679
commit 6c7ab8a0f8
37 changed files with 2038 additions and 99 deletions
+24
View File
@@ -59,6 +59,7 @@ var allFlagTypes = func() map[FlagType]struct{} {
return m
}()
func AllFlagTypes() map[FlagType]struct{} {
return allFlagTypes
}
@@ -75,6 +76,8 @@ const (
WarehouseTypeKandang WarehouseType = "KANDANG"
)
// -------------------------------------------------------------------
// WarehouseType
// -------------------------------------------------------------------
@@ -97,6 +100,19 @@ const (
SupplierCategorySapronak SupplierCategory = "SAPRONAK"
)
// -------------------------------------------------------------------
// Kandang Status
// -------------------------------------------------------------------
type KandangStatus string
const (
KandangStatusNonActive KandangStatus = "NON_ACTIVE"
KandangStatusPengajuan KandangStatus = "PENGAJUAN"
KandangStatusActive KandangStatus = "ACTIVE"
)
// -------------------------------------------------------------------
// Validators
// -------------------------------------------------------------------
@@ -191,6 +207,14 @@ func IsValidWarehouseType(v string) bool {
return false
}
func IsValidKandangStatus(v string) bool {
switch KandangStatus(v) {
case KandangStatusNonActive, KandangStatusPengajuan, KandangStatusActive:
return true
}
return false
}
func IsValidCustomerSupplierType(v string) bool {
switch CustomerSupplierType(v) {
case CustomerSupplierTypeBisnis, CustomerSupplierTypeIndividual: