mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
Refactor[BE]: refactor expense category handling to use constants for BOP and NON-BOP
This commit is contained in:
@@ -135,6 +135,17 @@ const (
|
||||
SupplierCategorySapronak SupplierCategory = "SAPRONAK"
|
||||
)
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// ExpenseCategory
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
type ExpenseCategory string
|
||||
|
||||
const (
|
||||
ExpenseCategoryBOP ExpenseCategory = "BOP"
|
||||
ExpenseCategoryNonBOP ExpenseCategory = "NON-BOP"
|
||||
)
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Kandang Status
|
||||
// -------------------------------------------------------------------
|
||||
@@ -429,6 +440,14 @@ func IsValidSupplierCategory(v string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func IsValidExpenseCategory(v string) bool {
|
||||
switch ExpenseCategory(v) {
|
||||
case ExpenseCategoryBOP, ExpenseCategoryNonBOP:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// example use
|
||||
|
||||
// Recording helper
|
||||
|
||||
Reference in New Issue
Block a user