FEAT[BE] :add marketing type and conversion fields to marketing entities and services

This commit is contained in:
aguhh18
2026-02-03 13:32:37 +07:00
parent f75225b81b
commit f59cdd821a
9 changed files with 141 additions and 101 deletions
+40
View File
@@ -212,6 +212,30 @@ const (
KandangStatusActive KandangStatus = "ACTIVE"
)
// -------------------------------------------------------------------
// Marketing Type
// -------------------------------------------------------------------
type MarketingType string
const (
MarketingTypeAyam MarketingType = "AYAM"
MarketingTypeTelur MarketingType = "TELUR"
MarketingTypeTrading MarketingType = "TRADING"
MarketingTypeAyamPullet MarketingType = "AYAM PULLET"
)
// -------------------------------------------------------------------
// Convertion Unit
// -------------------------------------------------------------------
type ConvertionUnit string
const (
ConvertionUnitPeti ConvertionUnit = "PETI"
ConvertionUnitKG ConvertionUnit = "KG"
)
// -------------------------------------------------------------------
// ProjectFlockCategory
// -------------------------------------------------------------------
@@ -609,6 +633,22 @@ func IsValidPaymentParty(v string) bool {
return false
}
func IsValidMarketingType(v string) bool {
switch MarketingType(v) {
case MarketingTypeAyam, MarketingTypeTelur, MarketingTypeTrading, MarketingTypeAyamPullet:
return true
}
return false
}
func IsValidConvertionUnit(v string) bool {
switch ConvertionUnit(v) {
case ConvertionUnitPeti, ConvertionUnitKG:
return true
}
return false
}
// example use
// Recording helper