Migrate some trust_center_access columns to profiles

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-03-04 17:01:55 +04:00
parent 9e106a8875
commit 909beeb606
12 changed files with 282 additions and 167 deletions

View File

@@ -2594,7 +2594,7 @@ type Profile implements Node {
source: String!
state: ProfileState!
additionalEmailAddresses: [EmailAddr!]!
kind: ProfileKind!
kind: ProfileKind
position: String
contractStartDate: Datetime
contractEndDate: Datetime
@@ -3127,7 +3127,7 @@ input CreateUserInput {
emailAddress: EmailAddr!
role: MembershipRole!
additionalEmailAddresses: [EmailAddr!]
kind: ProfileKind!
kind: ProfileKind
position: String
contractStartDate: Datetime @goField(omittable: true)
contractEndDate: Datetime @goField(omittable: true)
@@ -3152,7 +3152,7 @@ input UpdateUserInput {
id: ID!
fullName: String!
additionalEmailAddresses: [EmailAddr!]
kind: ProfileKind!
kind: ProfileKind
position: String
contractStartDate: Datetime @goField(omittable: true)
contractEndDate: Datetime @goField(omittable: true)
@@ -9404,9 +9404,9 @@ func (ec *executionContext) _Profile_kind(ctx context.Context, field graphql.Col
return obj.Kind, nil
},
nil,
ec.marshalNProfileKind2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind,
true,
ec.marshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind,
true,
false,
)
}
@@ -15295,7 +15295,7 @@ func (ec *executionContext) unmarshalInputCreateUserInput(ctx context.Context, o
it.AdditionalEmailAddresses = data
case "kind":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind"))
data, err := ec.unmarshalNProfileKind2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind(ctx, v)
data, err := ec.unmarshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind(ctx, v)
if err != nil {
return it, err
}
@@ -16246,7 +16246,7 @@ func (ec *executionContext) unmarshalInputUpdateUserInput(ctx context.Context, o
it.AdditionalEmailAddresses = data
case "kind":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind"))
data, err := ec.unmarshalNProfileKind2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind(ctx, v)
data, err := ec.unmarshalOProfileKind2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind(ctx, v)
if err != nil {
return it, err
}
@@ -18590,9 +18590,6 @@ func (ec *executionContext) _Profile(ctx context.Context, sel ast.SelectionSet,
}
case "kind":
out.Values[i] = ec._Profile_kind(ctx, field, obj)
if out.Values[i] == graphql.Null {
atomic.AddUint32(&out.Invalids, 1)
}
case "position":
out.Values[i] = ec._Profile_position(ctx, field, obj)
case "contractStartDate":
@@ -21683,36 +21680,6 @@ func (ec *executionContext) marshalNProfileEdge2ᚖgoᚗproboᚗincᚋproboᚋpk
return ec._ProfileEdge(ctx, sel, v)
}
func (ec *executionContext) unmarshalNProfileKind2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind(ctx context.Context, v any) (coredata.MembershipProfileKind, error) {
tmp, err := graphql.UnmarshalString(v)
res := unmarshalNProfileKind2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind[tmp]
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalNProfileKind2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind(ctx context.Context, sel ast.SelectionSet, v coredata.MembershipProfileKind) graphql.Marshaler {
_ = sel
res := graphql.MarshalString(marshalNProfileKind2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind[v])
if res == graphql.Null {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
}
return res
}
var (
unmarshalNProfileKind2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind = map[string]coredata.MembershipProfileKind{
"EMPLOYEE": coredata.MembershipProfileKindEmployee,
"CONTRACTOR": coredata.MembershipProfileKindContractor,
"SERVICE_ACCOUNT": coredata.MembershipProfileKindServiceAccount,
}
marshalNProfileKind2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind = map[coredata.MembershipProfileKind]string{
coredata.MembershipProfileKindEmployee: "EMPLOYEE",
coredata.MembershipProfileKindContractor: "CONTRACTOR",
coredata.MembershipProfileKindServiceAccount: "SERVICE_ACCOUNT",
}
)
func (ec *executionContext) unmarshalNProfileOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileOrderField(ctx context.Context, v any) (coredata.MembershipProfileOrderField, error) {
tmp, err := graphql.UnmarshalString(v)
res := unmarshalNProfileOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileOrderField[tmp]
@@ -22718,6 +22685,38 @@ 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 {
return nil, nil