Move kind to string

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-11 10:18:59 +01:00
parent 764f61bfa7
commit e393411333
19 changed files with 52 additions and 238 deletions

View File

@@ -176,7 +176,7 @@ type Profile implements Node {
source: String!
state: ProfileState!
additionalEmailAddresses: [EmailAddr!]!
kind: ProfileKind
kind: String
position: String
contractStartDate: Datetime
contractEndDate: Datetime
@@ -214,17 +214,6 @@ enum ProfileSource
SCIM @goEnum(value: "go.probo.inc/probo/pkg/coredata.ProfileSourceSCIM")
}
enum ProfileKind @goModel(model: "go.probo.inc/probo/pkg/coredata.MembershipProfileKind") {
EMPLOYEE
@goEnum(value: "go.probo.inc/probo/pkg/coredata.MembershipProfileKindEmployee")
CONTRACTOR
@goEnum(value: "go.probo.inc/probo/pkg/coredata.MembershipProfileKindContractor")
SERVICE_ACCOUNT
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.MembershipProfileKindServiceAccount"
)
}
type Organization implements Node {
id: ID!
name: String!
@@ -709,7 +698,7 @@ input CreateUserInput {
emailAddress: EmailAddr!
role: MembershipRole!
additionalEmailAddresses: [EmailAddr!]
kind: ProfileKind
kind: String
position: String
contractStartDate: Datetime @goField(omittable: true)
contractEndDate: Datetime @goField(omittable: true)
@@ -734,7 +723,7 @@ input UpdateUserInput {
id: ID!
fullName: String!
additionalEmailAddresses: [EmailAddr!]
kind: ProfileKind
kind: String
position: String
contractStartDate: Datetime @goField(omittable: true)
contractEndDate: Datetime @goField(omittable: true)

View File

@@ -2594,7 +2594,7 @@ type Profile implements Node {
source: String!
state: ProfileState!
additionalEmailAddresses: [EmailAddr!]!
kind: ProfileKind
kind: String
position: String
contractStartDate: Datetime
contractEndDate: Datetime
@@ -2632,17 +2632,6 @@ enum ProfileSource
SCIM @goEnum(value: "go.probo.inc/probo/pkg/coredata.ProfileSourceSCIM")
}
enum ProfileKind @goModel(model: "go.probo.inc/probo/pkg/coredata.MembershipProfileKind") {
EMPLOYEE
@goEnum(value: "go.probo.inc/probo/pkg/coredata.MembershipProfileKindEmployee")
CONTRACTOR
@goEnum(value: "go.probo.inc/probo/pkg/coredata.MembershipProfileKindContractor")
SERVICE_ACCOUNT
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.MembershipProfileKindServiceAccount"
)
}
type Organization implements Node {
id: ID!
name: String!
@@ -3127,7 +3116,7 @@ input CreateUserInput {
emailAddress: EmailAddr!
role: MembershipRole!
additionalEmailAddresses: [EmailAddr!]
kind: ProfileKind
kind: String
position: String
contractStartDate: Datetime @goField(omittable: true)
contractEndDate: Datetime @goField(omittable: true)
@@ -3152,7 +3141,7 @@ input UpdateUserInput {
id: ID!
fullName: String!
additionalEmailAddresses: [EmailAddr!]
kind: ProfileKind
kind: String
position: String
contractStartDate: Datetime @goField(omittable: true)
contractEndDate: Datetime @goField(omittable: true)
@@ -9404,7 +9393,7 @@ func (ec *executionContext) _Profile_kind(ctx context.Context, field graphql.Col
return obj.Kind, nil
},
nil,
ec.marshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind,
ec.marshalOString2ᚖstring,
true,
false,
)
@@ -9417,7 +9406,7 @@ func (ec *executionContext) fieldContext_Profile_kind(_ context.Context, field g
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ProfileKind does not have child fields")
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
@@ -15295,7 +15284,7 @@ func (ec *executionContext) unmarshalInputCreateUserInput(ctx context.Context, o
it.AdditionalEmailAddresses = data
case "kind":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind"))
data, err := ec.unmarshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind(ctx, v)
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
if err != nil {
return it, err
}
@@ -16246,7 +16235,7 @@ func (ec *executionContext) unmarshalInputUpdateUserInput(ctx context.Context, o
it.AdditionalEmailAddresses = data
case "kind":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind"))
data, err := ec.unmarshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind(ctx, v)
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
if err != nil {
return it, err
}
@@ -22685,37 +22674,6 @@ func (ec *executionContext) unmarshalOProfileFilter2ᚖgoᚗproboᚗincᚋprobo
return &res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) unmarshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind(ctx context.Context, v any) (*coredata.MembershipProfileKind, error) {
if v == nil {
return nil, nil
}
tmp, err := graphql.UnmarshalString(v)
res := unmarshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind[tmp]
return &res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind(ctx context.Context, sel ast.SelectionSet, v *coredata.MembershipProfileKind) graphql.Marshaler {
if v == nil {
return graphql.Null
}
_ = sel
_ = ctx
res := graphql.MarshalString(marshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind[*v])
return res
}
var (
unmarshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind = map[string]coredata.MembershipProfileKind{
"EMPLOYEE": coredata.MembershipProfileKindEmployee,
"CONTRACTOR": coredata.MembershipProfileKindContractor,
"SERVICE_ACCOUNT": coredata.MembershipProfileKindServiceAccount,
}
marshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind = map[coredata.MembershipProfileKind]string{
coredata.MembershipProfileKindEmployee: "EMPLOYEE",
coredata.MembershipProfileKindContractor: "CONTRACTOR",
coredata.MembershipProfileKindServiceAccount: "SERVICE_ACCOUNT",
}
)
func (ec *executionContext) unmarshalOProfileOrder2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfileOrderBy(ctx context.Context, v any) (*types.ProfileOrderBy, error) {
if v == nil {

View File

@@ -129,7 +129,7 @@ type CreateUserInput struct {
EmailAddress mail.Addr `json:"emailAddress"`
Role coredata.MembershipRole `json:"role"`
AdditionalEmailAddresses []mail.Addr `json:"additionalEmailAddresses,omitempty"`
Kind *coredata.MembershipProfileKind `json:"kind,omitempty"`
Kind *string `json:"kind,omitempty"`
Position *string `json:"position,omitempty"`
ContractStartDate graphql.Omittable[*time.Time] `json:"contractStartDate,omitempty"`
ContractEndDate graphql.Omittable[*time.Time] `json:"contractEndDate,omitempty"`
@@ -313,7 +313,7 @@ type Profile struct {
Source string `json:"source"`
State coredata.ProfileState `json:"state"`
AdditionalEmailAddresses []mail.Addr `json:"additionalEmailAddresses"`
Kind *coredata.MembershipProfileKind `json:"kind,omitempty"`
Kind *string `json:"kind,omitempty"`
Position *string `json:"position,omitempty"`
ContractStartDate *time.Time `json:"contractStartDate,omitempty"`
ContractEndDate *time.Time `json:"contractEndDate,omitempty"`
@@ -589,7 +589,7 @@ type UpdateUserInput struct {
ID gid.GID `json:"id"`
FullName string `json:"fullName"`
AdditionalEmailAddresses []mail.Addr `json:"additionalEmailAddresses,omitempty"`
Kind *coredata.MembershipProfileKind `json:"kind,omitempty"`
Kind *string `json:"kind,omitempty"`
Position *string `json:"position,omitempty"`
ContractStartDate graphql.Omittable[*time.Time] `json:"contractStartDate,omitempty"`
ContractEndDate graphql.Omittable[*time.Time] `json:"contractEndDate,omitempty"`

View File

@@ -69,17 +69,6 @@ enum EvidenceState
@goEnum(value: "go.probo.inc/probo/pkg/coredata.EvidenceStateRequested")
}
enum ProfileKind @goModel(model: "go.probo.inc/probo/pkg/coredata.MembershipProfileKind") {
EMPLOYEE
@goEnum(value: "go.probo.inc/probo/pkg/coredata.MembershipProfileKindEmployee")
CONTRACTOR
@goEnum(value: "go.probo.inc/probo/pkg/coredata.MembershipProfileKindContractor")
SERVICE_ACCOUNT
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.MembershipProfileKindServiceAccount"
)
}
enum DocumentStatus
@goModel(model: "go.probo.inc/probo/pkg/coredata.DocumentStatus") {
DRAFT @goEnum(value: "go.probo.inc/probo/pkg/coredata.DocumentStatusDraft")
@@ -1943,7 +1932,7 @@ type Profile implements Node {
emailAddress: EmailAddr!
state: ProfileState!
additionalEmailAddresses: [EmailAddr!]!
kind: ProfileKind
kind: String
position: String
contractStartDate: Datetime
contractEndDate: Datetime

View File

@@ -11069,17 +11069,6 @@ enum EvidenceState
@goEnum(value: "go.probo.inc/probo/pkg/coredata.EvidenceStateRequested")
}
enum ProfileKind @goModel(model: "go.probo.inc/probo/pkg/coredata.MembershipProfileKind") {
EMPLOYEE
@goEnum(value: "go.probo.inc/probo/pkg/coredata.MembershipProfileKindEmployee")
CONTRACTOR
@goEnum(value: "go.probo.inc/probo/pkg/coredata.MembershipProfileKindContractor")
SERVICE_ACCOUNT
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.MembershipProfileKindServiceAccount"
)
}
enum DocumentStatus
@goModel(model: "go.probo.inc/probo/pkg/coredata.DocumentStatus") {
DRAFT @goEnum(value: "go.probo.inc/probo/pkg/coredata.DocumentStatusDraft")
@@ -12943,7 +12932,7 @@ type Profile implements Node {
emailAddress: EmailAddr!
state: ProfileState!
additionalEmailAddresses: [EmailAddr!]!
kind: ProfileKind
kind: String
position: String
contractStartDate: Datetime
contractEndDate: Datetime
@@ -47428,7 +47417,7 @@ func (ec *executionContext) _Profile_kind(ctx context.Context, field graphql.Col
return obj.Kind, nil
},
nil,
ec.marshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind,
ec.marshalOString2ᚖstring,
true,
false,
)
@@ -47441,7 +47430,7 @@ func (ec *executionContext) fieldContext_Profile_kind(_ context.Context, field g
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ProfileKind does not have child fields")
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
@@ -105089,37 +105078,6 @@ func (ec *executionContext) unmarshalOProfileFilter2ᚖgoᚗproboᚗincᚋprobo
return &res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) unmarshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind(ctx context.Context, v any) (*coredata.MembershipProfileKind, error) {
if v == nil {
return nil, nil
}
tmp, err := graphql.UnmarshalString(v)
res := unmarshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind[tmp]
return &res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind(ctx context.Context, sel ast.SelectionSet, v *coredata.MembershipProfileKind) graphql.Marshaler {
if v == nil {
return graphql.Null
}
_ = sel
_ = ctx
res := graphql.MarshalString(marshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind[*v])
return res
}
var (
unmarshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind = map[string]coredata.MembershipProfileKind{
"EMPLOYEE": coredata.MembershipProfileKindEmployee,
"CONTRACTOR": coredata.MembershipProfileKindContractor,
"SERVICE_ACCOUNT": coredata.MembershipProfileKindServiceAccount,
}
marshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind = map[coredata.MembershipProfileKind]string{
coredata.MembershipProfileKindEmployee: "EMPLOYEE",
coredata.MembershipProfileKindContractor: "CONTRACTOR",
coredata.MembershipProfileKindServiceAccount: "SERVICE_ACCOUNT",
}
)
func (ec *executionContext) unmarshalOProfileOrder2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐProfileOrderBy(ctx context.Context, v any) (*types.ProfileOrderBy, error) {
if v == nil {

View File

@@ -1651,7 +1651,7 @@ type Profile struct {
EmailAddress mail.Addr `json:"emailAddress"`
State coredata.ProfileState `json:"state"`
AdditionalEmailAddresses []mail.Addr `json:"additionalEmailAddresses"`
Kind *coredata.MembershipProfileKind `json:"kind,omitempty"`
Kind *string `json:"kind,omitempty"`
Position *string `json:"position,omitempty"`
ContractStartDate *time.Time `json:"contractStartDate,omitempty"`
ContractEndDate *time.Time `json:"contractEndDate,omitempty"`

View File

@@ -105,11 +105,6 @@ components:
ProfileKind:
type: string
enum:
- EMPLOYEE
- CONTRACTOR
- SERVICE_ACCOUNT
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.MembershipProfileKind
MembershipRole:
type: string

View File

@@ -1343,7 +1343,7 @@ type CreateUserInput struct {
// Full name
FullName string `json:"full_name"`
// User kind
Kind *coredata.MembershipProfileKind `json:"kind"`
Kind *string `json:"kind"`
// Organization ID
OrganizationID gid.GID `json:"organization_id"`
// Position
@@ -2919,7 +2919,7 @@ type Profile struct {
// Profile ID
ID gid.GID `json:"id"`
// Profile kind
Kind *coredata.MembershipProfileKind `json:"kind"`
Kind *string `json:"kind"`
// Organization ID
OrganizationID gid.GID `json:"organization_id"`
// Position
@@ -3533,7 +3533,7 @@ type UpdateProfileInput struct {
// Profile ID
ID gid.GID `json:"id"`
// Profile kind
Kind *coredata.MembershipProfileKind `json:"kind,omitempty"`
Kind *string `json:"kind,omitempty"`
// Position
Position mcp.Omittable[*string] `json:"position,omitempty"`
}
@@ -3642,7 +3642,7 @@ type UpdateUserInput struct {
// User (profile) ID
ID gid.GID `json:"id"`
// User kind
Kind *coredata.MembershipProfileKind `json:"kind"`
Kind *string `json:"kind"`
// Position
Position mcp.Omittable[*string] `json:"position,omitempty"`
}