Add custom domain graphql API

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-10-01 08:42:04 +02:00
parent ae6b8a3858
commit a525309b61
4 changed files with 2729 additions and 106 deletions

View File

@@ -139,17 +139,11 @@ enum AuditState
value: "github.com/getprobo/probo/pkg/coredata.AuditStateInProgress" value: "github.com/getprobo/probo/pkg/coredata.AuditStateInProgress"
) )
COMPLETED COMPLETED
@goEnum( @goEnum(value: "github.com/getprobo/probo/pkg/coredata.AuditStateCompleted")
value: "github.com/getprobo/probo/pkg/coredata.AuditStateCompleted"
)
REJECTED REJECTED
@goEnum( @goEnum(value: "github.com/getprobo/probo/pkg/coredata.AuditStateRejected")
value: "github.com/getprobo/probo/pkg/coredata.AuditStateRejected"
)
OUTDATED OUTDATED
@goEnum( @goEnum(value: "github.com/getprobo/probo/pkg/coredata.AuditStateOutdated")
value: "github.com/getprobo/probo/pkg/coredata.AuditStateOutdated"
)
} }
enum TrustCenterVisibility enum TrustCenterVisibility
@@ -169,7 +163,9 @@ enum TrustCenterVisibility
} }
enum NonconformityStatus enum NonconformityStatus
@goModel(model: "github.com/getprobo/probo/pkg/coredata.NonconformityStatus") { @goModel(
model: "github.com/getprobo/probo/pkg/coredata.NonconformityStatus"
) {
OPEN OPEN
@goEnum( @goEnum(
value: "github.com/getprobo/probo/pkg/coredata.NonconformityStatusOpen" value: "github.com/getprobo/probo/pkg/coredata.NonconformityStatusOpen"
@@ -201,7 +197,9 @@ enum ObligationStatus
} }
enum ContinualImprovementStatus enum ContinualImprovementStatus
@goModel(model: "github.com/getprobo/probo/pkg/coredata.ContinualImprovementStatus") { @goModel(
model: "github.com/getprobo/probo/pkg/coredata.ContinualImprovementStatus"
) {
OPEN OPEN
@goEnum( @goEnum(
value: "github.com/getprobo/probo/pkg/coredata.ContinualImprovementStatusOpen" value: "github.com/getprobo/probo/pkg/coredata.ContinualImprovementStatusOpen"
@@ -217,7 +215,9 @@ enum ContinualImprovementStatus
} }
enum ContinualImprovementPriority enum ContinualImprovementPriority
@goModel(model: "github.com/getprobo/probo/pkg/coredata.ContinualImprovementPriority") { @goModel(
model: "github.com/getprobo/probo/pkg/coredata.ContinualImprovementPriority"
) {
LOW LOW
@goEnum( @goEnum(
value: "github.com/getprobo/probo/pkg/coredata.ContinualImprovementPriorityLow" value: "github.com/getprobo/probo/pkg/coredata.ContinualImprovementPriorityLow"
@@ -233,7 +233,9 @@ enum ContinualImprovementPriority
} }
enum ProcessingActivitySpecialOrCriminalData enum ProcessingActivitySpecialOrCriminalData
@goModel(model: "github.com/getprobo/probo/pkg/coredata.ProcessingActivitySpecialOrCriminalData") { @goModel(
model: "github.com/getprobo/probo/pkg/coredata.ProcessingActivitySpecialOrCriminalData"
) {
YES YES
@goEnum( @goEnum(
value: "github.com/getprobo/probo/pkg/coredata.ProcessingActivitySpecialOrCriminalDataYes" value: "github.com/getprobo/probo/pkg/coredata.ProcessingActivitySpecialOrCriminalDataYes"
@@ -249,7 +251,9 @@ enum ProcessingActivitySpecialOrCriminalData
} }
enum ProcessingActivityLawfulBasis enum ProcessingActivityLawfulBasis
@goModel(model: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityLawfulBasis") { @goModel(
model: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityLawfulBasis"
) {
LEGITIMATE_INTEREST LEGITIMATE_INTEREST
@goEnum( @goEnum(
value: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityLawfulBasisLegitimateInterest" value: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityLawfulBasisLegitimateInterest"
@@ -277,7 +281,9 @@ enum ProcessingActivityLawfulBasis
} }
enum ProcessingActivityTransferSafeguards enum ProcessingActivityTransferSafeguards
@goModel(model: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityTransferSafeguards") { @goModel(
model: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityTransferSafeguards"
) {
STANDARD_CONTRACTUAL_CLAUSES STANDARD_CONTRACTUAL_CLAUSES
@goEnum( @goEnum(
value: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityTransferSafeguardsStandardContractualClauses" value: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityTransferSafeguardsStandardContractualClauses"
@@ -305,7 +311,9 @@ enum ProcessingActivityTransferSafeguards
} }
enum ProcessingActivityDataProtectionImpactAssessment enum ProcessingActivityDataProtectionImpactAssessment
@goModel(model: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityDataProtectionImpactAssessment") { @goModel(
model: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityDataProtectionImpactAssessment"
) {
NEEDED NEEDED
@goEnum( @goEnum(
value: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityDataProtectionImpactAssessmentNeeded" value: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityDataProtectionImpactAssessmentNeeded"
@@ -317,7 +325,9 @@ enum ProcessingActivityDataProtectionImpactAssessment
} }
enum ProcessingActivityTransferImpactAssessment enum ProcessingActivityTransferImpactAssessment
@goModel(model: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityTransferImpactAssessment") { @goModel(
model: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityTransferImpactAssessment"
) {
NEEDED NEEDED
@goEnum( @goEnum(
value: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityTransferImpactAssessmentNeeded" value: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityTransferImpactAssessmentNeeded"
@@ -1036,7 +1046,9 @@ enum AuditOrderField
} }
enum NonconformityOrderField enum NonconformityOrderField
@goModel(model: "github.com/getprobo/probo/pkg/coredata.NonconformityOrderField") { @goModel(
model: "github.com/getprobo/probo/pkg/coredata.NonconformityOrderField"
) {
CREATED_AT CREATED_AT
@goEnum( @goEnum(
value: "github.com/getprobo/probo/pkg/coredata.NonconformityOrderFieldCreatedAt" value: "github.com/getprobo/probo/pkg/coredata.NonconformityOrderFieldCreatedAt"
@@ -1060,7 +1072,9 @@ enum NonconformityOrderField
} }
enum ObligationOrderField enum ObligationOrderField
@goModel(model: "github.com/getprobo/probo/pkg/coredata.ObligationOrderField") { @goModel(
model: "github.com/getprobo/probo/pkg/coredata.ObligationOrderField"
) {
CREATED_AT CREATED_AT
@goEnum( @goEnum(
value: "github.com/getprobo/probo/pkg/coredata.ObligationOrderFieldCreatedAt" value: "github.com/getprobo/probo/pkg/coredata.ObligationOrderFieldCreatedAt"
@@ -1080,7 +1094,9 @@ enum ObligationOrderField
} }
enum ContinualImprovementOrderField enum ContinualImprovementOrderField
@goModel(model: "github.com/getprobo/probo/pkg/coredata.ContinualImprovementOrderField") { @goModel(
model: "github.com/getprobo/probo/pkg/coredata.ContinualImprovementOrderField"
) {
CREATED_AT CREATED_AT
@goEnum( @goEnum(
value: "github.com/getprobo/probo/pkg/coredata.ContinualImprovementOrderFieldCreatedAt" value: "github.com/getprobo/probo/pkg/coredata.ContinualImprovementOrderFieldCreatedAt"
@@ -1104,7 +1120,9 @@ enum ContinualImprovementOrderField
} }
enum ProcessingActivityOrderField enum ProcessingActivityOrderField
@goModel(model: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityOrderField") { @goModel(
model: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityOrderField"
) {
CREATED_AT CREATED_AT
@goEnum( @goEnum(
value: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityOrderFieldCreatedAt" value: "github.com/getprobo/probo/pkg/coredata.ProcessingActivityOrderFieldCreatedAt"
@@ -1116,7 +1134,9 @@ enum ProcessingActivityOrderField
} }
enum TrustCenterAccessOrderField enum TrustCenterAccessOrderField
@goModel(model: "github.com/getprobo/probo/pkg/coredata.TrustCenterAccessOrderField") { @goModel(
model: "github.com/getprobo/probo/pkg/coredata.TrustCenterAccessOrderField"
) {
CREATED_AT CREATED_AT
@goEnum( @goEnum(
value: "github.com/getprobo/probo/pkg/coredata.TrustCenterAccessOrderFieldCreatedAt" value: "github.com/getprobo/probo/pkg/coredata.TrustCenterAccessOrderFieldCreatedAt"
@@ -1132,7 +1152,9 @@ enum TrustCenterDocumentAccessOrderField
} }
enum TrustCenterReferenceOrderField enum TrustCenterReferenceOrderField
@goModel(model: "github.com/getprobo/probo/pkg/coredata.TrustCenterReferenceOrderField") { @goModel(
model: "github.com/getprobo/probo/pkg/coredata.TrustCenterReferenceOrderField"
) {
NAME NAME
@goEnum( @goEnum(
value: "github.com/getprobo/probo/pkg/coredata.TrustCenterReferenceOrderFieldName" value: "github.com/getprobo/probo/pkg/coredata.TrustCenterReferenceOrderFieldName"
@@ -1150,21 +1172,15 @@ enum TrustCenterReferenceOrderField
enum SnapshotsType enum SnapshotsType
@goModel(model: "github.com/getprobo/probo/pkg/coredata.SnapshotsType") { @goModel(model: "github.com/getprobo/probo/pkg/coredata.SnapshotsType") {
RISKS RISKS
@goEnum( @goEnum(value: "github.com/getprobo/probo/pkg/coredata.SnapshotsTypeRisks")
value: "github.com/getprobo/probo/pkg/coredata.SnapshotsTypeRisks"
)
VENDORS VENDORS
@goEnum( @goEnum(
value: "github.com/getprobo/probo/pkg/coredata.SnapshotsTypeVendors" value: "github.com/getprobo/probo/pkg/coredata.SnapshotsTypeVendors"
) )
ASSETS ASSETS
@goEnum( @goEnum(value: "github.com/getprobo/probo/pkg/coredata.SnapshotsTypeAssets")
value: "github.com/getprobo/probo/pkg/coredata.SnapshotsTypeAssets"
)
DATA DATA
@goEnum( @goEnum(value: "github.com/getprobo/probo/pkg/coredata.SnapshotsTypeData")
value: "github.com/getprobo/probo/pkg/coredata.SnapshotsTypeData"
)
NONCONFORMITIES NONCONFORMITIES
@goEnum( @goEnum(
value: "github.com/getprobo/probo/pkg/coredata.SnapshotsTypeNonconformities" value: "github.com/getprobo/probo/pkg/coredata.SnapshotsTypeNonconformities"
@@ -1648,6 +1664,13 @@ type Organization implements Node {
trustCenter: TrustCenter @goField(forceResolver: true) trustCenter: TrustCenter @goField(forceResolver: true)
customDomains(
first: Int
after: CursorKey
last: Int
before: CursorKey
): CustomDomainConnection! @goField(forceResolver: true)
createdAt: Datetime! createdAt: Datetime!
updatedAt: Datetime! updatedAt: Datetime!
} }
@@ -1700,7 +1723,8 @@ type Vendor implements Node {
orderBy: VendorComplianceReportOrder orderBy: VendorComplianceReportOrder
): VendorComplianceReportConnection! @goField(forceResolver: true) ): VendorComplianceReportConnection! @goField(forceResolver: true)
businessAssociateAgreement: VendorBusinessAssociateAgreement @goField(forceResolver: true) businessAssociateAgreement: VendorBusinessAssociateAgreement
@goField(forceResolver: true)
dataPrivacyAgreement: VendorDataPrivacyAgreement @goField(forceResolver: true) dataPrivacyAgreement: VendorDataPrivacyAgreement @goField(forceResolver: true)
contacts( contacts(
@@ -2281,7 +2305,8 @@ type TrustCenterReference implements Node {
updatedAt: Datetime! updatedAt: Datetime!
} }
type TrustCenterReferenceConnection @goModel( type TrustCenterReferenceConnection
@goModel(
model: "github.com/getprobo/probo/pkg/server/api/console/v1/types.TrustCenterReferenceConnection" model: "github.com/getprobo/probo/pkg/server/api/console/v1/types.TrustCenterReferenceConnection"
) { ) {
totalCount: Int! @goField(forceResolver: true) totalCount: Int! @goField(forceResolver: true)
@@ -2615,9 +2640,7 @@ type Mutation {
input: DeleteOrganizationInput! input: DeleteOrganizationInput!
): DeleteOrganizationPayload! ): DeleteOrganizationPayload!
updateTrustCenter( updateTrustCenter(input: UpdateTrustCenterInput!): UpdateTrustCenterPayload!
input: UpdateTrustCenterInput!
): UpdateTrustCenterPayload!
uploadTrustCenterNDA( uploadTrustCenterNDA(
input: UploadTrustCenterNDAInput! input: UploadTrustCenterNDAInput!
@@ -2669,14 +2692,26 @@ type Mutation {
deleteVendor(input: DeleteVendorInput!): DeleteVendorPayload! deleteVendor(input: DeleteVendorInput!): DeleteVendorPayload!
# Vendor Contact mutations # Vendor Contact mutations
createVendorContact(input: CreateVendorContactInput!): CreateVendorContactPayload! createVendorContact(
updateVendorContact(input: UpdateVendorContactInput!): UpdateVendorContactPayload! input: CreateVendorContactInput!
deleteVendorContact(input: DeleteVendorContactInput!): DeleteVendorContactPayload! ): CreateVendorContactPayload!
updateVendorContact(
input: UpdateVendorContactInput!
): UpdateVendorContactPayload!
deleteVendorContact(
input: DeleteVendorContactInput!
): DeleteVendorContactPayload!
# Vendor Service mutations # Vendor Service mutations
createVendorService(input: CreateVendorServiceInput!): CreateVendorServicePayload! createVendorService(
updateVendorService(input: UpdateVendorServiceInput!): UpdateVendorServicePayload! input: CreateVendorServiceInput!
deleteVendorService(input: DeleteVendorServiceInput!): DeleteVendorServicePayload! ): CreateVendorServicePayload!
updateVendorService(
input: UpdateVendorServiceInput!
): UpdateVendorServicePayload!
deleteVendorService(
input: DeleteVendorServiceInput!
): DeleteVendorServicePayload!
# Framework mutations # Framework mutations
createFramework(input: CreateFrameworkInput!): CreateFrameworkPayload! createFramework(input: CreateFrameworkInput!): CreateFrameworkPayload!
@@ -2867,15 +2902,9 @@ type Mutation {
): DeleteNonconformityPayload! ): DeleteNonconformityPayload!
# Obligation mutations # Obligation mutations
createObligation( createObligation(input: CreateObligationInput!): CreateObligationPayload!
input: CreateObligationInput! updateObligation(input: UpdateObligationInput!): UpdateObligationPayload!
): CreateObligationPayload! deleteObligation(input: DeleteObligationInput!): DeleteObligationPayload!
updateObligation(
input: UpdateObligationInput!
): UpdateObligationPayload!
deleteObligation(
input: DeleteObligationInput!
): DeleteObligationPayload!
# Continual Improvement mutations # Continual Improvement mutations
createContinualImprovement( createContinualImprovement(
@@ -2902,6 +2931,14 @@ type Mutation {
# Snapshot mutations # Snapshot mutations
createSnapshot(input: CreateSnapshotInput!): CreateSnapshotPayload! createSnapshot(input: CreateSnapshotInput!): CreateSnapshotPayload!
deleteSnapshot(input: DeleteSnapshotInput!): DeleteSnapshotPayload! deleteSnapshot(input: DeleteSnapshotInput!): DeleteSnapshotPayload!
# Custom Domain mutations
createCustomDomain(
input: CreateCustomDomainInput!
): CreateCustomDomainPayload!
deleteCustomDomain(
input: DeleteCustomDomainInput!
): DeleteCustomDomainPayload!
} }
# Input Types # Input Types
@@ -4385,3 +4422,82 @@ type CreateSnapshotPayload {
type DeleteSnapshotPayload { type DeleteSnapshotPayload {
deletedSnapshotId: ID! deletedSnapshotId: ID!
} }
enum SSLStatus
@goModel(
model: "github.com/getprobo/probo/pkg/coredata.CustomDomainSSLStatus"
) {
PENDING
@goEnum(
value: "github.com/getprobo/probo/pkg/coredata.CustomDomainSSLStatusPending"
)
PROVISIONING
@goEnum(
value: "github.com/getprobo/probo/pkg/coredata.CustomDomainSSLStatusProvisioning"
)
ACTIVE
@goEnum(
value: "github.com/getprobo/probo/pkg/coredata.CustomDomainSSLStatusActive"
)
RENEWING
@goEnum(
value: "github.com/getprobo/probo/pkg/coredata.CustomDomainSSLStatusRenewing"
)
EXPIRED
@goEnum(
value: "github.com/getprobo/probo/pkg/coredata.CustomDomainSSLStatusExpired"
)
FAILED
@goEnum(
value: "github.com/getprobo/probo/pkg/coredata.CustomDomainSSLStatusFailed"
)
}
type CustomDomain implements Node {
id: ID!
organization: Organization!
domain: String!
sslStatus: SSLStatus!
sslExpiresAt: Datetime
isActive: Boolean!
dnsRecords: [DNSRecordInstruction!]!
createdAt: Datetime!
updatedAt: Datetime!
verifiedAt: Datetime
}
type DNSRecordInstruction {
type: String!
name: String!
value: String!
ttl: Int!
purpose: String!
}
type CustomDomainConnection {
edges: [CustomDomainEdge!]!
pageInfo: PageInfo!
totalCount: Int!
}
type CustomDomainEdge {
cursor: CursorKey!
node: CustomDomain!
}
input CreateCustomDomainInput {
organizationId: ID!
domain: String!
}
input DeleteCustomDomainInput {
domainId: ID!
}
type CreateCustomDomainPayload {
customDomainEdge: CustomDomainEdge!
}
type DeleteCustomDomainPayload {
deletedCustomDomainId: ID!
}

File diff suppressed because it is too large Load Diff

View File

@@ -318,6 +318,15 @@ type CreateControlSnapshotMappingPayload struct {
SnapshotEdge *SnapshotEdge `json:"snapshotEdge"` SnapshotEdge *SnapshotEdge `json:"snapshotEdge"`
} }
type CreateCustomDomainInput struct {
OrganizationID gid.GID `json:"organizationId"`
Domain string `json:"domain"`
}
type CreateCustomDomainPayload struct {
CustomDomainEdge *CustomDomainEdge `json:"customDomainEdge"`
}
type CreateDatumInput struct { type CreateDatumInput struct {
OrganizationID gid.GID `json:"organizationId"` OrganizationID gid.GID `json:"organizationId"`
Name string `json:"name"` Name string `json:"name"`
@@ -626,6 +635,41 @@ type CreateVendorServicePayload struct {
VendorServiceEdge *VendorServiceEdge `json:"vendorServiceEdge"` VendorServiceEdge *VendorServiceEdge `json:"vendorServiceEdge"`
} }
type CustomDomain struct {
ID gid.GID `json:"id"`
Organization *Organization `json:"organization"`
Domain string `json:"domain"`
SslStatus coredata.CustomDomainSSLStatus `json:"sslStatus"`
SslExpiresAt *time.Time `json:"sslExpiresAt,omitempty"`
IsActive bool `json:"isActive"`
DNSRecords []*DNSRecordInstruction `json:"dnsRecords"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
VerifiedAt *time.Time `json:"verifiedAt,omitempty"`
}
func (CustomDomain) IsNode() {}
func (this CustomDomain) GetID() gid.GID { return this.ID }
type CustomDomainConnection struct {
Edges []*CustomDomainEdge `json:"edges"`
PageInfo *PageInfo `json:"pageInfo"`
TotalCount int `json:"totalCount"`
}
type CustomDomainEdge struct {
Cursor page.CursorKey `json:"cursor"`
Node *CustomDomain `json:"node"`
}
type DNSRecordInstruction struct {
Type string `json:"type"`
Name string `json:"name"`
Value string `json:"value"`
TTL int `json:"ttl"`
Purpose string `json:"purpose"`
}
type Datum struct { type Datum struct {
ID gid.GID `json:"id"` ID gid.GID `json:"id"`
SnapshotID *gid.GID `json:"snapshotId,omitempty"` SnapshotID *gid.GID `json:"snapshotId,omitempty"`
@@ -730,6 +774,14 @@ type DeleteControlSnapshotMappingPayload struct {
DeletedSnapshotID gid.GID `json:"deletedSnapshotId"` DeletedSnapshotID gid.GID `json:"deletedSnapshotId"`
} }
type DeleteCustomDomainInput struct {
DomainID gid.GID `json:"domainId"`
}
type DeleteCustomDomainPayload struct {
DeletedCustomDomainID gid.GID `json:"deletedCustomDomainId"`
}
type DeleteDatumInput struct { type DeleteDatumInput struct {
DatumID gid.GID `json:"datumId"` DatumID gid.GID `json:"datumId"`
} }
@@ -1273,6 +1325,7 @@ type Organization struct {
ProcessingActivities *ProcessingActivityConnection `json:"processingActivities"` ProcessingActivities *ProcessingActivityConnection `json:"processingActivities"`
Snapshots *SnapshotConnection `json:"snapshots"` Snapshots *SnapshotConnection `json:"snapshots"`
TrustCenter *TrustCenter `json:"trustCenter,omitempty"` TrustCenter *TrustCenter `json:"trustCenter,omitempty"`
CustomDomains *CustomDomainConnection `json:"customDomains"`
CreatedAt time.Time `json:"createdAt"` CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"` UpdatedAt time.Time `json:"updatedAt"`
} }

View File

@@ -3312,6 +3312,41 @@ func (r *mutationResolver) DeleteSnapshot(ctx context.Context, input types.Delet
}, nil }, nil
} }
// CreateCustomDomain is the resolver for the createCustomDomain field.
func (r *mutationResolver) CreateCustomDomain(ctx context.Context, input types.CreateCustomDomainInput) (*types.CreateCustomDomainPayload, error) {
prb := r.ProboService(ctx, input.OrganizationID.TenantID())
domain, err := prb.CustomDomains.CreateCustomDomain(ctx, probo.CreateCustomDomainRequest{
OrganizationID: input.OrganizationID,
Domain: input.Domain,
})
if err != nil {
return nil, fmt.Errorf("failed to create custom domain: %w", err)
}
edge := &types.CustomDomainEdge{
Node: types.NewCustomDomain(domain),
Cursor: page.NewCursorKey(domain.ID, domain.CreatedAt),
}
return &types.CreateCustomDomainPayload{
CustomDomainEdge: edge,
}, nil
}
// DeleteCustomDomain is the resolver for the deleteCustomDomain field.
func (r *mutationResolver) DeleteCustomDomain(ctx context.Context, input types.DeleteCustomDomainInput) (*types.DeleteCustomDomainPayload, error) {
prb := r.ProboService(ctx, input.DomainID.TenantID())
if err := prb.CustomDomains.DeleteCustomDomain(ctx, input.DomainID); err != nil {
return nil, fmt.Errorf("failed to delete custom domain: %w", err)
}
return &types.DeleteCustomDomainPayload{
DeletedCustomDomainID: input.DomainID,
}, nil
}
// Organization is the resolver for the organization field. // Organization is the resolver for the organization field.
func (r *nonconformityResolver) Organization(ctx context.Context, obj *types.Nonconformity) (*types.Organization, error) { func (r *nonconformityResolver) Organization(ctx context.Context, obj *types.Nonconformity) (*types.Organization, error) {
prb := r.ProboService(ctx, obj.ID.TenantID()) prb := r.ProboService(ctx, obj.ID.TenantID())
@@ -3981,6 +4016,25 @@ func (r *organizationResolver) TrustCenter(ctx context.Context, obj *types.Organ
return types.NewTrustCenter(trustCenter, file), nil return types.NewTrustCenter(trustCenter, file), nil
} }
// CustomDomains is the resolver for the customDomains field.
func (r *organizationResolver) CustomDomains(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey) (*types.CustomDomainConnection, error) {
prb := r.ProboService(ctx, obj.ID.TenantID())
pageOrderBy := page.OrderBy[coredata.CustomDomainOrderField]{
Field: coredata.CustomDomainOrderFieldCreatedAt,
Direction: page.OrderDirectionDesc,
}
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
page, err := prb.CustomDomains.ListOrganizationDomains(ctx, obj.ID, cursor)
if err != nil {
return nil, fmt.Errorf("failed to list custom domains: %w", err)
}
return types.NewCustomDomainConnection(page, r, obj.ID), nil
}
// TotalCount is the resolver for the totalCount field. // TotalCount is the resolver for the totalCount field.
func (r *peopleConnectionResolver) TotalCount(ctx context.Context, obj *types.PeopleConnection) (int, error) { func (r *peopleConnectionResolver) TotalCount(ctx context.Context, obj *types.PeopleConnection) (int, error) {
prb := r.ProboService(ctx, obj.ParentID.TenantID()) prb := r.ProboService(ctx, obj.ParentID.TenantID())