Add service account people kind

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-03-16 18:43:58 +01:00
parent 34ef38a0eb
commit 257ea563a9
11 changed files with 69 additions and 22 deletions

View File

@@ -0,0 +1 @@
ALTER TYPE people_kind ADD VALUE 'SERVICE_ACCOUNT';

View File

@@ -26,6 +26,7 @@ type (
const (
PeopleKindEmployee PeopleKind = iota
PeopleKindContractor
PeopleKindServiceAccount
)
func (ps PeopleKind) MarshalText() ([]byte, error) {
@@ -40,6 +41,8 @@ func (ps *PeopleKind) UnmarshalText(data []byte) error {
*ps = PeopleKindEmployee
case PeopleKindContractor.String():
*ps = PeopleKindContractor
case PeopleKindServiceAccount.String():
*ps = PeopleKindServiceAccount
default:
return fmt.Errorf("invalid PeopleKind value: %q", val)
}
@@ -55,6 +58,8 @@ func (ts PeopleKind) String() string {
val = "EMPLOYEE"
case PeopleKindContractor:
val = "CONTRACTOR"
case PeopleKindServiceAccount:
val = "SERVICE_ACCOUNT"
}
return val