feat: add salary privilege to privilege management system
Add support for the salary privilege in the privilege handler. Implement associated logic to process and validate the salary privilege in the test cases. Update the data structures to include the new privilege and ensure correct functionality in the privilege processing flow.
This commit is contained in:
@@ -23,6 +23,7 @@ const (
|
||||
PrivilegeInvoicing = "INVOICING"
|
||||
PrivilegeAccounting = "ACCOUNTING"
|
||||
PrivilegeSupplier = "SUPPLIER"
|
||||
PrivilegeSalary = "SALARY"
|
||||
)
|
||||
|
||||
var AllPrivilege = []Privilege{
|
||||
@@ -33,11 +34,12 @@ var AllPrivilege = []Privilege{
|
||||
PrivilegeInvoicing,
|
||||
PrivilegeAccounting,
|
||||
PrivilegeSupplier,
|
||||
PrivilegeSalary,
|
||||
}
|
||||
|
||||
func (e Privilege) IsValid() bool {
|
||||
switch e {
|
||||
case PrivilegeAdmin, PrivilegeCompany, PrivilegeConsumer, PrivilegeTime, PrivilegeInvoicing, PrivilegeAccounting, PrivilegeSupplier:
|
||||
case PrivilegeAdmin, PrivilegeCompany, PrivilegeConsumer, PrivilegeTime, PrivilegeInvoicing, PrivilegeAccounting, PrivilegeSupplier, PrivilegeSalary:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user