@@ -33,8 +33,6 @@ func (r *mutationResolver) UpdateOrganizationContext(ctx context.Context, input
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
req := probo.UpdateOrganizationContextRequest{
|
||||
OrganizationID: input.OrganizationID,
|
||||
Product: gqlutils.UnwrapOmittable(input.Product),
|
||||
@@ -44,7 +42,7 @@ func (r *mutationResolver) UpdateOrganizationContext(ctx context.Context, input
|
||||
Customers: gqlutils.UnwrapOmittable(input.Customers),
|
||||
}
|
||||
|
||||
organizationContext, err := prb.Organizations.UpdateContext(ctx, scope, req)
|
||||
organizationContext, err := r.probo.Organizations.UpdateContext(ctx, scope, req)
|
||||
if err != nil {
|
||||
if validationErrors, ok := errors.AsType[validator.ValidationErrors](err); ok {
|
||||
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
||||
@@ -67,9 +65,7 @@ func (r *organizationResolver) LogoURL(ctx context.Context, obj *types.Organizat
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
logoURL, err := prb.Organizations.GenerateLogoURL(ctx, scope, obj.ID, 1*time.Hour)
|
||||
logoURL, err := r.probo.Organizations.GenerateLogoURL(ctx, scope, obj.ID, 1*time.Hour)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot generate logo url", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -85,9 +81,7 @@ func (r *organizationResolver) HorizontalLogoURL(ctx context.Context, obj *types
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
horizontalLogoURL, err := prb.Organizations.GenerateHorizontalLogoURL(ctx, scope, obj.ID, 1*time.Hour)
|
||||
horizontalLogoURL, err := r.probo.Organizations.GenerateHorizontalLogoURL(ctx, scope, obj.ID, 1*time.Hour)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot generate horizontal logo url", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -103,9 +97,7 @@ func (r *organizationResolver) Context(ctx context.Context, obj *types.Organizat
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
orgContext, err := prb.Organizations.GetContext(ctx, scope, obj.ID)
|
||||
orgContext, err := r.probo.Organizations.GetContext(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot load organization context", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -162,9 +154,7 @@ func (r *organizationResolver) MeasureCategories(ctx context.Context, obj *types
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
categories, err := prb.Measures.ListDistinctCategoriesForOrganizationID(ctx, scope, obj.ID)
|
||||
categories, err := r.probo.Measures.ListDistinctCategoriesForOrganizationID(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list measure categories", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -236,9 +226,7 @@ func (r *organizationResolver) AssetListDocument(ctx context.Context, obj *types
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
assetDocumentID, err := prb.GeneratedDocuments.GetAssetListDocumentID(ctx, scope, obj.ID)
|
||||
assetDocumentID, err := r.probo.GeneratedDocuments.GetAssetListDocumentID(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot get asset list document ID: %w", err)
|
||||
}
|
||||
@@ -247,7 +235,7 @@ func (r *organizationResolver) AssetListDocument(ctx context.Context, obj *types
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
doc, err := prb.Documents.Get(ctx, scope, *assetDocumentID)
|
||||
doc, err := r.probo.Documents.Get(ctx, scope, *assetDocumentID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot get asset list document: %w", err)
|
||||
}
|
||||
@@ -262,8 +250,6 @@ func (r *organizationResolver) Assets(ctx context.Context, obj *types.Organizati
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.AssetOrderField]{
|
||||
Field: coredata.AssetOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -277,7 +263,7 @@ func (r *organizationResolver) Assets(ctx context.Context, obj *types.Organizati
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := prb.Assets.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
page, err := r.probo.Assets.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization assets", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -293,9 +279,7 @@ func (r *organizationResolver) DataListDocument(ctx context.Context, obj *types.
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
dataDocumentID, err := prb.GeneratedDocuments.GetDataListDocumentID(ctx, scope, obj.ID)
|
||||
dataDocumentID, err := r.probo.GeneratedDocuments.GetDataListDocumentID(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot get data export document ID: %w", err)
|
||||
}
|
||||
@@ -304,7 +288,7 @@ func (r *organizationResolver) DataListDocument(ctx context.Context, obj *types.
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
doc, err := prb.Documents.Get(ctx, scope, *dataDocumentID)
|
||||
doc, err := r.probo.Documents.Get(ctx, scope, *dataDocumentID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot get data export document: %w", err)
|
||||
}
|
||||
@@ -319,8 +303,6 @@ func (r *organizationResolver) Data(ctx context.Context, obj *types.Organization
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.DatumOrderField]{
|
||||
Field: coredata.DatumOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -334,7 +316,7 @@ func (r *organizationResolver) Data(ctx context.Context, obj *types.Organization
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := prb.Data.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
page, err := r.probo.Data.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization data", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -350,8 +332,6 @@ func (r *organizationResolver) Audits(ctx context.Context, obj *types.Organizati
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.AuditOrderField]{
|
||||
Field: coredata.AuditOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -365,7 +345,7 @@ func (r *organizationResolver) Audits(ctx context.Context, obj *types.Organizati
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := prb.Audits.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
page, err := r.probo.Audits.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization audits", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -381,9 +361,7 @@ func (r *organizationResolver) FindingsDocument(ctx context.Context, obj *types.
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
findingDocumentID, err := prb.GeneratedDocuments.GetFindingsDocumentID(ctx, scope, obj.ID)
|
||||
findingDocumentID, err := r.probo.GeneratedDocuments.GetFindingsDocumentID(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot get finding list document ID: %w", err)
|
||||
}
|
||||
@@ -392,7 +370,7 @@ func (r *organizationResolver) FindingsDocument(ctx context.Context, obj *types.
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
doc, err := prb.Documents.Get(ctx, scope, *findingDocumentID)
|
||||
doc, err := r.probo.Documents.Get(ctx, scope, *findingDocumentID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot get finding list document: %w", err)
|
||||
}
|
||||
@@ -407,8 +385,6 @@ func (r *organizationResolver) Findings(ctx context.Context, obj *types.Organiza
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.FindingOrderField]{
|
||||
Field: coredata.FindingOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -438,7 +414,7 @@ func (r *organizationResolver) Findings(ctx context.Context, obj *types.Organiza
|
||||
|
||||
findingFilter := coredata.NewFindingFilter(kind, status, priority, ownerID)
|
||||
|
||||
page, err := prb.Findings.ListForOrganizationID(ctx, scope, obj.ID, cursor, findingFilter)
|
||||
page, err := r.probo.Findings.ListForOrganizationID(ctx, scope, obj.ID, cursor, findingFilter)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization findings", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -502,8 +478,6 @@ func (r *organizationResolver) SlackConnections(ctx context.Context, obj *types.
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
slackProvider := coredata.ConnectorProviderSlack
|
||||
filter := coredata.NewConnectorProviderFilter(&slackProvider)
|
||||
|
||||
@@ -514,7 +488,7 @@ func (r *organizationResolver) SlackConnections(ctx context.Context, obj *types.
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := prb.Connectors.ListForOrganizationID(ctx, scope, obj.ID, cursor, filter)
|
||||
page, err := r.probo.Connectors.ListForOrganizationID(ctx, scope, obj.ID, cursor, filter)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization slack connections", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -535,9 +509,7 @@ func (r *organizationResolver) Connectors(ctx context.Context, obj *types.Organi
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
connectors, err := prb.Connectors.ListAllForOrganizationID(ctx, scope, obj.ID)
|
||||
connectors, err := r.probo.Connectors.ListAllForOrganizationID(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot list organization connectors: %w", err))
|
||||
}
|
||||
@@ -599,8 +571,6 @@ func (r *organizationResolver) Controls(ctx context.Context, obj *types.Organiza
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.ControlOrderField]{
|
||||
Field: coredata.ControlOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -619,7 +589,7 @@ func (r *organizationResolver) Controls(ctx context.Context, obj *types.Organiza
|
||||
controlFilter = coredata.NewControlFilter(filter.Query)
|
||||
}
|
||||
|
||||
page, err := prb.Controls.ListForOrganizationID(ctx, scope, obj.ID, cursor, controlFilter)
|
||||
page, err := r.probo.Controls.ListForOrganizationID(ctx, scope, obj.ID, cursor, controlFilter)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list controls", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -635,8 +605,6 @@ func (r *organizationResolver) StatementsOfApplicability(ctx context.Context, ob
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.StatementOfApplicabilityOrderField]{
|
||||
Field: coredata.StatementOfApplicabilityOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -650,7 +618,7 @@ func (r *organizationResolver) StatementsOfApplicability(ctx context.Context, ob
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := prb.StatementsOfApplicability.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
page, err := r.probo.StatementsOfApplicability.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization statements_of_applicability", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -666,8 +634,6 @@ func (r *organizationResolver) DataProtectionImpactAssessments(ctx context.Conte
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.DataProtectionImpactAssessmentOrderField]{
|
||||
Field: coredata.DataProtectionImpactAssessmentOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -682,7 +648,7 @@ func (r *organizationResolver) DataProtectionImpactAssessments(ctx context.Conte
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := prb.DataProtectionImpactAssessments.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
page, err := r.probo.DataProtectionImpactAssessments.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization data protection impact assessments", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -698,9 +664,7 @@ func (r *organizationResolver) DataProtectionImpactAssessmentsDocument(ctx conte
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
documentID, err := prb.GeneratedDocuments.GetDataProtectionImpactAssessmentsDocumentID(ctx, scope, obj.ID)
|
||||
documentID, err := r.probo.GeneratedDocuments.GetDataProtectionImpactAssessmentsDocumentID(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot get DPIA list document ID", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -710,7 +674,7 @@ func (r *organizationResolver) DataProtectionImpactAssessmentsDocument(ctx conte
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
document, err := prb.Documents.Get(ctx, scope, *documentID)
|
||||
document, err := r.probo.Documents.Get(ctx, scope, *documentID)
|
||||
if err != nil {
|
||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||
return nil, nil
|
||||
@@ -731,8 +695,6 @@ func (r *organizationResolver) TransferImpactAssessments(ctx context.Context, ob
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.TransferImpactAssessmentOrderField]{
|
||||
Field: coredata.TransferImpactAssessmentOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -747,7 +709,7 @@ func (r *organizationResolver) TransferImpactAssessments(ctx context.Context, ob
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := prb.TransferImpactAssessments.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
page, err := r.probo.TransferImpactAssessments.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization transfer impact assessments", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -763,9 +725,7 @@ func (r *organizationResolver) TransferImpactAssessmentsDocument(ctx context.Con
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
documentID, err := prb.GeneratedDocuments.GetTransferImpactAssessmentsDocumentID(ctx, scope, obj.ID)
|
||||
documentID, err := r.probo.GeneratedDocuments.GetTransferImpactAssessmentsDocumentID(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot get TIA list document ID", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -775,7 +735,7 @@ func (r *organizationResolver) TransferImpactAssessmentsDocument(ctx context.Con
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
document, err := prb.Documents.Get(ctx, scope, *documentID)
|
||||
document, err := r.probo.Documents.Get(ctx, scope, *documentID)
|
||||
if err != nil {
|
||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||
return nil, nil
|
||||
@@ -796,8 +756,6 @@ func (r *organizationResolver) Documents(ctx context.Context, obj *types.Organiz
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.DocumentOrderField]{
|
||||
Field: coredata.DocumentOrderFieldTitle,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -820,7 +778,7 @@ func (r *organizationResolver) Documents(ctx context.Context, obj *types.Organiz
|
||||
WithStatus(filter.Status)
|
||||
}
|
||||
|
||||
page, err := prb.Documents.ListByOrganizationID(ctx, scope, obj.ID, cursor, documentFilter)
|
||||
page, err := r.probo.Documents.ListByOrganizationID(ctx, scope, obj.ID, cursor, documentFilter)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization documents", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -841,8 +799,6 @@ func (r *organizationResolver) Frameworks(ctx context.Context, obj *types.Organi
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.FrameworkOrderField]{
|
||||
Field: coredata.FrameworkOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -856,7 +812,7 @@ func (r *organizationResolver) Frameworks(ctx context.Context, obj *types.Organi
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := prb.Frameworks.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
page, err := r.probo.Frameworks.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization frameworks", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -872,8 +828,6 @@ func (r *organizationResolver) Measures(ctx context.Context, obj *types.Organiza
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.MeasureOrderField]{
|
||||
Field: coredata.MeasureOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -892,7 +846,7 @@ func (r *organizationResolver) Measures(ctx context.Context, obj *types.Organiza
|
||||
measureFilter = coredata.NewMeasureFilter(filter.Query, filter.State, filter.Category)
|
||||
}
|
||||
|
||||
page, err := prb.Measures.ListForOrganizationID(ctx, scope, obj.ID, cursor, measureFilter)
|
||||
page, err := r.probo.Measures.ListForOrganizationID(ctx, scope, obj.ID, cursor, measureFilter)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization measures", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -908,9 +862,7 @@ func (r *organizationResolver) ObligationsDocument(ctx context.Context, obj *typ
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
obligationDocumentID, err := prb.GeneratedDocuments.GetObligationsDocumentID(ctx, scope, obj.ID)
|
||||
obligationDocumentID, err := r.probo.GeneratedDocuments.GetObligationsDocumentID(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot get obligation list document ID: %w", err)
|
||||
}
|
||||
@@ -919,7 +871,7 @@ func (r *organizationResolver) ObligationsDocument(ctx context.Context, obj *typ
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
doc, err := prb.Documents.Get(ctx, scope, *obligationDocumentID)
|
||||
doc, err := r.probo.Documents.Get(ctx, scope, *obligationDocumentID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot get obligation list document: %w", err)
|
||||
}
|
||||
@@ -934,8 +886,6 @@ func (r *organizationResolver) Obligations(ctx context.Context, obj *types.Organ
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.ObligationOrderField]{
|
||||
Field: coredata.ObligationOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -950,7 +900,7 @@ func (r *organizationResolver) Obligations(ctx context.Context, obj *types.Organ
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := prb.Obligations.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
page, err := r.probo.Obligations.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization obligations", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -966,8 +916,6 @@ func (r *organizationResolver) ProcessingActivities(ctx context.Context, obj *ty
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.ProcessingActivityOrderField]{
|
||||
Field: coredata.ProcessingActivityOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -982,7 +930,7 @@ func (r *organizationResolver) ProcessingActivities(ctx context.Context, obj *ty
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := prb.ProcessingActivities.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
page, err := r.probo.ProcessingActivities.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization processing activities", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -998,9 +946,7 @@ func (r *organizationResolver) ProcessingActivitiesDocument(ctx context.Context,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
documentID, err := prb.GeneratedDocuments.GetProcessingActivitiesDocumentID(ctx, scope, obj.ID)
|
||||
documentID, err := r.probo.GeneratedDocuments.GetProcessingActivitiesDocumentID(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot get processing activities document ID", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -1010,7 +956,7 @@ func (r *organizationResolver) ProcessingActivitiesDocument(ctx context.Context,
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
document, err := prb.Documents.Get(ctx, scope, *documentID)
|
||||
document, err := r.probo.Documents.Get(ctx, scope, *documentID)
|
||||
if err != nil {
|
||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||
return nil, nil
|
||||
@@ -1031,8 +977,6 @@ func (r *organizationResolver) RightsRequests(ctx context.Context, obj *types.Or
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.RightsRequestOrderField]{
|
||||
Field: coredata.RightsRequestOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -1047,7 +991,7 @@ func (r *organizationResolver) RightsRequests(ctx context.Context, obj *types.Or
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := prb.RightsRequests.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
page, err := r.probo.RightsRequests.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization rights requests", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -1063,8 +1007,6 @@ func (r *organizationResolver) Risks(ctx context.Context, obj *types.Organizatio
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.RiskOrderField]{
|
||||
Field: coredata.RiskOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -1083,7 +1025,7 @@ func (r *organizationResolver) Risks(ctx context.Context, obj *types.Organizatio
|
||||
riskFilter = coredata.NewRiskFilter(filter.Query)
|
||||
}
|
||||
|
||||
page, err := prb.Risks.ListForOrganizationID(ctx, scope, obj.ID, cursor, riskFilter)
|
||||
page, err := r.probo.Risks.ListForOrganizationID(ctx, scope, obj.ID, cursor, riskFilter)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization risks", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -1099,9 +1041,7 @@ func (r *organizationResolver) RisksDocument(ctx context.Context, obj *types.Org
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
documentID, err := prb.GeneratedDocuments.GetRisksDocumentID(ctx, scope, obj.ID)
|
||||
documentID, err := r.probo.GeneratedDocuments.GetRisksDocumentID(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot get risks document ID", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -1111,7 +1051,7 @@ func (r *organizationResolver) RisksDocument(ctx context.Context, obj *types.Org
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
document, err := prb.Documents.Get(ctx, scope, *documentID)
|
||||
document, err := r.probo.Documents.Get(ctx, scope, *documentID)
|
||||
if err != nil {
|
||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||
return nil, nil
|
||||
@@ -1190,8 +1130,6 @@ func (r *organizationResolver) Tasks(ctx context.Context, obj *types.Organizatio
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.TaskOrderField]{
|
||||
Field: coredata.TaskOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -1205,7 +1143,7 @@ func (r *organizationResolver) Tasks(ctx context.Context, obj *types.Organizatio
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := prb.Tasks.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
page, err := r.probo.Tasks.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization tasks", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -1221,9 +1159,7 @@ func (r *organizationResolver) TrustCenter(ctx context.Context, obj *types.Organ
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
trustCenter, err := prb.TrustCenters.GetByOrganizationID(ctx, scope, obj.ID)
|
||||
trustCenter, err := r.probo.TrustCenters.GetByOrganizationID(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot get trust center", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -1231,7 +1167,7 @@ func (r *organizationResolver) TrustCenter(ctx context.Context, obj *types.Organ
|
||||
|
||||
var file *coredata.File
|
||||
if trustCenter.NonDisclosureAgreementFileID != nil {
|
||||
file, err = prb.Files.Get(ctx, scope, *trustCenter.NonDisclosureAgreementFileID)
|
||||
file, err = r.probo.Files.Get(ctx, scope, *trustCenter.NonDisclosureAgreementFileID)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot get NDA file", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -1248,9 +1184,7 @@ func (r *organizationResolver) CustomDomain(ctx context.Context, obj *types.Orga
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
domain, err := prb.CustomDomains.GetOrganizationCustomDomain(ctx, scope, obj.ID)
|
||||
domain, err := r.probo.CustomDomains.GetOrganizationCustomDomain(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot get custom domain", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -1270,8 +1204,6 @@ func (r *organizationResolver) TrustCenterFiles(ctx context.Context, obj *types.
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.TrustCenterFileOrderField]{
|
||||
Field: coredata.TrustCenterFileOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -1285,7 +1217,7 @@ func (r *organizationResolver) TrustCenterFiles(ctx context.Context, obj *types.
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
pageResult, err := prb.TrustCenterFiles.ListForOrganizationID(ctx, scope, obj.ID, cursor, &coredata.TrustCenterFileFilter{})
|
||||
pageResult, err := r.probo.TrustCenterFiles.ListForOrganizationID(ctx, scope, obj.ID, cursor, &coredata.TrustCenterFileFilter{})
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization trust center files", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -1332,8 +1264,6 @@ func (r *organizationResolver) ThirdParties(ctx context.Context, obj *types.Orga
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.ThirdPartyOrderField]{
|
||||
Field: coredata.ThirdPartyOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -1349,7 +1279,7 @@ func (r *organizationResolver) ThirdParties(ctx context.Context, obj *types.Orga
|
||||
|
||||
thirdPartyFilter := coredata.NewThirdPartyFilter(nil)
|
||||
|
||||
page, err := prb.ThirdParties.ListForOrganizationID(ctx, scope, obj.ID, cursor, thirdPartyFilter)
|
||||
page, err := r.probo.ThirdParties.ListForOrganizationID(ctx, scope, obj.ID, cursor, thirdPartyFilter)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization thirdParties", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -1365,9 +1295,7 @@ func (r *organizationResolver) ThirdPartiesDocument(ctx context.Context, obj *ty
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
documentID, err := prb.GeneratedDocuments.GetThirdPartiesDocumentID(ctx, scope, obj.ID)
|
||||
documentID, err := r.probo.GeneratedDocuments.GetThirdPartiesDocumentID(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot get thirdParties document ID", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -1377,7 +1305,7 @@ func (r *organizationResolver) ThirdPartiesDocument(ctx context.Context, obj *ty
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
document, err := prb.Documents.Get(ctx, scope, *documentID)
|
||||
document, err := r.probo.Documents.Get(ctx, scope, *documentID)
|
||||
if err != nil {
|
||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||
return nil, nil
|
||||
@@ -1398,8 +1326,6 @@ func (r *organizationResolver) WebhookSubscriptions(ctx context.Context, obj *ty
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.probo
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.WebhookSubscriptionOrderField]{
|
||||
Field: coredata.WebhookSubscriptionOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -1413,7 +1339,7 @@ func (r *organizationResolver) WebhookSubscriptions(ctx context.Context, obj *ty
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := prb.WebhookSubscriptions.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
page, err := r.probo.WebhookSubscriptions.ListForOrganizationID(ctx, scope, obj.ID, cursor)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list organization webhook subscriptions", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
@@ -1449,9 +1375,7 @@ func (r *profileConnectionResolver) TotalCount(ctx context.Context, obj *types.P
|
||||
return count, nil
|
||||
case *documentVersionResolver:
|
||||
scope := coredata.NewScopeFromObjectID(obj.ParentID)
|
||||
prb := r.probo
|
||||
|
||||
count, err := prb.Documents.CountVersionApprovers(ctx, scope, obj.ParentID)
|
||||
count, err := r.probo.Documents.CountVersionApprovers(ctx, scope, obj.ParentID)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot count document version approvers", log.Error(err))
|
||||
return 0, gqlutils.Internal(ctx)
|
||||
|
||||
Reference in New Issue
Block a user