@@ -38,7 +38,7 @@ type (
|
||||
Source ProfileSource `db:"source"`
|
||||
State ProfileState `db:"state"`
|
||||
FullName string `db:"full_name"`
|
||||
Kind *MembershipProfileKind `db:"kind"`
|
||||
Kind *string `db:"kind"`
|
||||
AdditionalEmailAddresses mail.Addrs `db:"additional_email_addresses"`
|
||||
Position *string `db:"position"`
|
||||
ContractStartDate *time.Time `db:"contract_start_date"`
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package coredata
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type (
|
||||
MembershipProfileKind string
|
||||
)
|
||||
|
||||
const (
|
||||
MembershipProfileKindEmployee MembershipProfileKind = "EMPLOYEE"
|
||||
MembershipProfileKindContractor MembershipProfileKind = "CONTRACTOR"
|
||||
MembershipProfileKindServiceAccount MembershipProfileKind = "SERVICE_ACCOUNT"
|
||||
)
|
||||
|
||||
func MembershipProfileKinds() []MembershipProfileKind {
|
||||
return []MembershipProfileKind{
|
||||
MembershipProfileKindEmployee,
|
||||
MembershipProfileKindContractor,
|
||||
MembershipProfileKindServiceAccount,
|
||||
}
|
||||
}
|
||||
|
||||
func (mpk MembershipProfileKind) MarshalText() ([]byte, error) {
|
||||
return []byte(mpk), nil
|
||||
}
|
||||
|
||||
func (mpk *MembershipProfileKind) UnmarshalText(data []byte) error {
|
||||
*mpk = MembershipProfileKind(data)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (mpk MembershipProfileKind) String() string {
|
||||
return string(mpk)
|
||||
}
|
||||
|
||||
func (mpk *MembershipProfileKind) Scan(value any) error {
|
||||
switch v := value.(type) {
|
||||
case string:
|
||||
*mpk = MembershipProfileKind(v)
|
||||
case []byte:
|
||||
*mpk = MembershipProfileKind(v)
|
||||
default:
|
||||
return fmt.Errorf("unsupported type for MembershipProfileKind: %T", value)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (mpk MembershipProfileKind) Value() (driver.Value, error) {
|
||||
return string(mpk), nil
|
||||
}
|
||||
Reference in New Issue
Block a user