@@ -131,6 +131,7 @@ func (r *accessReviewResolver) AccessSources(ctx context.Context, obj *types.Acc
|
||||
Field: coredata.AccessSourceOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.AccessSourceOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -159,6 +160,7 @@ func (r *accessReviewResolver) Campaigns(ctx context.Context, obj *types.AccessR
|
||||
Field: coredata.AccessReviewCampaignOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.AccessReviewCampaignOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -227,6 +229,7 @@ func (r *accessReviewCampaignResolver) Entries(ctx context.Context, obj *types.A
|
||||
Field: coredata.AccessEntryOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.AccessEntryOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -316,6 +319,7 @@ func (r *accessReviewCampaignScopeSourceResolver) Entries(ctx context.Context, o
|
||||
Field: coredata.AccessEntryOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.AccessEntryOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -362,6 +366,7 @@ func (r *accessSourceResolver) Connector(ctx context.Context, obj *types.AccessS
|
||||
}
|
||||
|
||||
scope := coredata.NewScopeFromObjectID(obj.ID)
|
||||
|
||||
connector, err := r.probo.Connectors.Get(ctx, scope, *obj.ConnectorID)
|
||||
if err != nil {
|
||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||
@@ -565,6 +570,7 @@ func (r *mutationResolver) UpdateAccessSource(ctx context.Context, input types.U
|
||||
req := accessreview.UpdateAccessSourceRequest{
|
||||
AccessSourceID: input.AccessSourceID,
|
||||
}
|
||||
|
||||
if input.Name.IsSet() {
|
||||
req.Name = input.Name.Value()
|
||||
}
|
||||
@@ -676,6 +682,7 @@ func (r *mutationResolver) UpdateAccessReviewCampaign(ctx context.Context, input
|
||||
req := accessreview.UpdateAccessReviewCampaignRequest{
|
||||
CampaignID: input.AccessReviewCampaignID,
|
||||
}
|
||||
|
||||
if input.Name.IsSet() {
|
||||
req.Name = input.Name.Value()
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ func (r *assetResolver) ThirdParties(ctx context.Context, obj *types.Asset, firs
|
||||
Field: coredata.ThirdPartyOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ThirdPartyOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -160,6 +161,7 @@ func (r *datumResolver) ThirdParties(ctx context.Context, obj *types.Datum, firs
|
||||
Field: coredata.ThirdPartyOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ThirdPartyOrderField]{
|
||||
Field: orderBy.Field,
|
||||
|
||||
@@ -125,6 +125,7 @@ func (r *auditResolver) Controls(ctx context.Context, obj *types.Audit, first *i
|
||||
Field: coredata.ControlOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ControlOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -159,6 +160,7 @@ func (r *auditResolver) Findings(ctx context.Context, obj *types.Audit, first *i
|
||||
Field: coredata.FindingOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.FindingOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -268,6 +270,7 @@ func (r *findingResolver) Audits(ctx context.Context, obj *types.Finding, first
|
||||
Field: coredata.AuditOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.AuditOrderField]{
|
||||
Field: orderBy.Field,
|
||||
|
||||
@@ -101,6 +101,7 @@ func (r *mutationResolver) CreateClientCredentialsConnector(ctx context.Context,
|
||||
ClientSecret: input.ClientSecret,
|
||||
TokenURL: input.TokenURL,
|
||||
}
|
||||
|
||||
if input.Scope != nil {
|
||||
oauth2Conn.Scope = *input.Scope
|
||||
}
|
||||
|
||||
@@ -113,6 +113,7 @@ func (r *controlResolver) Organization(ctx context.Context, obj *types.Control)
|
||||
// Regulatory is the resolver for the regulatory field.
|
||||
func (r *controlResolver) Regulatory(ctx context.Context, obj *types.Control) (bool, error) {
|
||||
scope := coredata.NewScopeFromObjectID(obj.ID)
|
||||
|
||||
hasRegulatory, err := r.probo.Controls.HasRegulatoryObligation(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot check regulatory obligation", log.Error(err))
|
||||
@@ -125,6 +126,7 @@ func (r *controlResolver) Regulatory(ctx context.Context, obj *types.Control) (b
|
||||
// Contractual is the resolver for the contractual field.
|
||||
func (r *controlResolver) Contractual(ctx context.Context, obj *types.Control) (bool, error) {
|
||||
scope := coredata.NewScopeFromObjectID(obj.ID)
|
||||
|
||||
hasContractual, err := r.probo.Controls.HasContractualObligation(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot check contractual obligation", log.Error(err))
|
||||
@@ -137,6 +139,7 @@ func (r *controlResolver) Contractual(ctx context.Context, obj *types.Control) (
|
||||
// RiskAssessment is the resolver for the riskAssessment field.
|
||||
func (r *controlResolver) RiskAssessment(ctx context.Context, obj *types.Control) (bool, error) {
|
||||
scope := coredata.NewScopeFromObjectID(obj.ID)
|
||||
|
||||
hasRisk, err := r.probo.Controls.HasRiskAssessment(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot check risk assessment", log.Error(err))
|
||||
@@ -179,6 +182,7 @@ func (r *controlResolver) Measures(ctx context.Context, obj *types.Control, firs
|
||||
Field: coredata.MeasureOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.MeasureOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -213,6 +217,7 @@ func (r *controlResolver) Documents(ctx context.Context, obj *types.Control, fir
|
||||
Field: coredata.DocumentOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.DocumentOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -250,6 +255,7 @@ func (r *controlResolver) Audits(ctx context.Context, obj *types.Control, first
|
||||
Field: coredata.AuditOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.AuditOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -279,6 +285,7 @@ func (r *controlResolver) Obligations(ctx context.Context, obj *types.Control, f
|
||||
Field: coredata.ObligationOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ObligationOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -842,6 +849,7 @@ func (r *statementOfApplicabilityResolver) ApplicabilityStatements(ctx context.C
|
||||
Field: coredata.ApplicabilityStatementOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionAsc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ApplicabilityStatementOrderField]{
|
||||
Field: coredata.ApplicabilityStatementOrderField(orderBy.Field),
|
||||
|
||||
@@ -60,6 +60,7 @@ func (r *documentResolver) Versions(ctx context.Context, obj *types.Document, fi
|
||||
Field: coredata.DocumentVersionOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.DocumentVersionOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -94,6 +95,7 @@ func (r *documentResolver) Controls(ctx context.Context, obj *types.Document, fi
|
||||
Field: coredata.ControlOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ControlOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -230,6 +232,7 @@ func (r *documentVersionResolver) Approvers(ctx context.Context, obj *types.Docu
|
||||
Field: coredata.MembershipProfileOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy.Field = coredata.MembershipProfileOrderField(orderBy.Field)
|
||||
pageOrderBy.Direction = page.OrderDirection(orderBy.Direction)
|
||||
@@ -257,6 +260,7 @@ func (r *documentVersionResolver) Signatures(ctx context.Context, obj *types.Doc
|
||||
Field: coredata.DocumentVersionSignatureOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.DocumentVersionSignatureOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -308,6 +312,7 @@ func (r *documentVersionResolver) ApprovalQuorums(ctx context.Context, obj *type
|
||||
Field: coredata.DocumentVersionApprovalQuorumOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.DocumentVersionApprovalQuorumOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -334,6 +339,7 @@ func (r *documentVersionResolver) Signed(ctx context.Context, obj *types.Documen
|
||||
}
|
||||
|
||||
identity := authn.IdentityFromContext(ctx)
|
||||
|
||||
signed, err := r.probo.Documents.IsVersionSignedByUserEmail(ctx, scope, obj.ID, identity.EmailAddress)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot check if document version is signed", log.Error(err))
|
||||
@@ -501,6 +507,7 @@ func (r *documentVersionApprovalQuorumResolver) Decisions(ctx context.Context, o
|
||||
Field: coredata.DocumentVersionApprovalDecisionOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.DocumentVersionApprovalDecisionOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -659,6 +666,7 @@ func (r *employeeDocumentResolver) Signed(ctx context.Context, obj *types.Employ
|
||||
}
|
||||
|
||||
identity := authn.IdentityFromContext(ctx)
|
||||
|
||||
signed, err := r.probo.Documents.IsSigned(ctx, scope, obj.ID, identity.EmailAddress)
|
||||
if err != nil {
|
||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||
@@ -682,6 +690,7 @@ func (r *employeeDocumentResolver) ApprovalState(ctx context.Context, obj *types
|
||||
identity := authn.IdentityFromContext(ctx)
|
||||
|
||||
scope := coredata.NewScopeFromObjectID(obj.ID)
|
||||
|
||||
state, err := r.probo.Documents.GetViewerApprovalState(ctx, scope, obj.ID, identity.ID)
|
||||
if err != nil {
|
||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||
@@ -707,6 +716,7 @@ func (r *employeeDocumentResolver) Versions(ctx context.Context, obj *types.Empl
|
||||
Field: coredata.DocumentVersionOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.DocumentVersionOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -769,6 +779,7 @@ func (r *employeeDocumentVersionResolver) Signed(ctx context.Context, obj *types
|
||||
}
|
||||
|
||||
identity := authn.IdentityFromContext(ctx)
|
||||
|
||||
signed, err := r.probo.Documents.IsVersionSignedByUserEmail(ctx, scope, obj.ID, identity.EmailAddress)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot check if version is signed", log.Error(err))
|
||||
@@ -786,6 +797,7 @@ func (r *employeeDocumentVersionResolver) ApprovalDecision(ctx context.Context,
|
||||
|
||||
identity := authn.IdentityFromContext(ctx)
|
||||
scope := coredata.NewScopeFromObjectID(obj.ID)
|
||||
|
||||
decision, err := r.probo.DocumentApprovals.GetViewerDecision(ctx, scope, obj.ID, identity.ID)
|
||||
if err != nil {
|
||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||
@@ -1054,6 +1066,7 @@ func (r *mutationResolver) PublishDocument(ctx context.Context, input types.Publ
|
||||
Document: types.NewDocument(result.Document),
|
||||
DocumentVersion: types.NewDocumentVersion(result.Version),
|
||||
}
|
||||
|
||||
if result.Quorum != nil {
|
||||
payload.ApprovalQuorum = types.NewDocumentVersionApprovalQuorum(result.Quorum)
|
||||
}
|
||||
@@ -1077,6 +1090,7 @@ func (r *mutationResolver) BulkPublishDocuments(ctx context.Context, input types
|
||||
}
|
||||
|
||||
scope := coredata.NewScopeFromObjectID(input.DocumentIds[0])
|
||||
|
||||
versions, documents, err := r.probo.DocumentApprovals.BulkPublishVersions(ctx, scope, probo.BulkPublishVersionsRequest{
|
||||
DocumentIDs: input.DocumentIds,
|
||||
Minor: input.Minor,
|
||||
@@ -1336,6 +1350,7 @@ func (r *mutationResolver) BulkRequestSignatures(ctx context.Context, input type
|
||||
}
|
||||
|
||||
scope := coredata.NewScopeFromObjectID(input.DocumentIds[0])
|
||||
|
||||
documentVersionSignatures, err := r.probo.Documents.BulkRequestSignatures(
|
||||
ctx, scope,
|
||||
probo.BulkRequestSignaturesRequest{
|
||||
@@ -1413,6 +1428,7 @@ func (r *mutationResolver) SignDocument(ctx context.Context, input types.SignDoc
|
||||
}
|
||||
|
||||
identity := authn.IdentityFromContext(ctx)
|
||||
|
||||
documentVersionSignature, err := r.probo.Documents.SignDocumentVersionByIdentity(ctx, scope, input.DocumentVersionID, identity.ID)
|
||||
if err != nil {
|
||||
if errors.Is(err, coredata.ErrResourceAlreadyExists) {
|
||||
@@ -1488,6 +1504,7 @@ func (r *mutationResolver) RejectDocumentVersion(ctx context.Context, input type
|
||||
}
|
||||
|
||||
identity := authn.IdentityFromContext(ctx)
|
||||
|
||||
decision, err := r.probo.DocumentApprovals.Reject(ctx, scope, probo.RejectDocumentVersionRequest{
|
||||
DocumentVersionID: input.DocumentVersionID,
|
||||
IdentityID: identity.ID,
|
||||
|
||||
@@ -57,6 +57,7 @@ func (r *frameworkResolver) Controls(ctx context.Context, obj *types.Framework,
|
||||
Field: coredata.ControlOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ControlOrderField]{
|
||||
Field: orderBy.Field,
|
||||
|
||||
@@ -31,6 +31,7 @@ func (r *measureResolver) Evidences(ctx context.Context, obj *types.Measure, fir
|
||||
Field: coredata.EvidenceOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.EvidenceOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -60,6 +61,7 @@ func (r *measureResolver) Tasks(ctx context.Context, obj *types.Measure, first *
|
||||
Field: coredata.TaskOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.TaskOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -89,6 +91,7 @@ func (r *measureResolver) Risks(ctx context.Context, obj *types.Measure, first *
|
||||
Field: coredata.RiskOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.RiskOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -123,6 +126,7 @@ func (r *measureResolver) Controls(ctx context.Context, obj *types.Measure, firs
|
||||
Field: coredata.ControlOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ControlOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -157,6 +161,7 @@ func (r *measureResolver) Documents(ctx context.Context, obj *types.Measure, fir
|
||||
Field: coredata.DocumentOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.DocumentOrderField]{
|
||||
Field: orderBy.Field,
|
||||
|
||||
@@ -131,6 +131,7 @@ func (r *organizationResolver) Profiles(ctx context.Context, obj *types.Organiza
|
||||
Field: coredata.MembershipProfileOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy.Field = coredata.MembershipProfileOrderField(orderBy.Field)
|
||||
pageOrderBy.Direction = page.OrderDirection(orderBy.Direction)
|
||||
@@ -174,6 +175,7 @@ func (r *organizationResolver) AccessSources(ctx context.Context, obj *types.Org
|
||||
Field: coredata.AccessSourceOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.AccessSourceOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -202,6 +204,7 @@ func (r *organizationResolver) AccessReviewCampaigns(ctx context.Context, obj *t
|
||||
Field: coredata.AccessReviewCampaignOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.AccessReviewCampaignOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -254,6 +257,7 @@ func (r *organizationResolver) Assets(ctx context.Context, obj *types.Organizati
|
||||
Field: coredata.AssetOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.AssetOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -307,6 +311,7 @@ func (r *organizationResolver) Data(ctx context.Context, obj *types.Organization
|
||||
Field: coredata.DatumOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.DatumOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -336,6 +341,7 @@ func (r *organizationResolver) Audits(ctx context.Context, obj *types.Organizati
|
||||
Field: coredata.AuditOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.AuditOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -433,6 +439,7 @@ func (r *organizationResolver) AuditLogEntries(ctx context.Context, obj *types.O
|
||||
Field: coredata.AuditLogEntryOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.AuditLogEntryOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -575,6 +582,7 @@ func (r *organizationResolver) Controls(ctx context.Context, obj *types.Organiza
|
||||
Field: coredata.ControlOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ControlOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -609,6 +617,7 @@ func (r *organizationResolver) StatementsOfApplicability(ctx context.Context, ob
|
||||
Field: coredata.StatementOfApplicabilityOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.StatementOfApplicabilityOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -760,6 +769,7 @@ func (r *organizationResolver) Documents(ctx context.Context, obj *types.Organiz
|
||||
Field: coredata.DocumentOrderFieldTitle,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.DocumentOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -803,6 +813,7 @@ func (r *organizationResolver) Frameworks(ctx context.Context, obj *types.Organi
|
||||
Field: coredata.FrameworkOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.FrameworkOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -832,6 +843,7 @@ func (r *organizationResolver) Measures(ctx context.Context, obj *types.Organiza
|
||||
Field: coredata.MeasureOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.MeasureOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -1011,6 +1023,7 @@ func (r *organizationResolver) Risks(ctx context.Context, obj *types.Organizatio
|
||||
Field: coredata.RiskOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.RiskOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -1076,6 +1089,7 @@ func (r *organizationResolver) RiskAssessments(ctx context.Context, obj *types.O
|
||||
Field: coredata.RiskAssessmentOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.RiskAssessmentOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -1105,6 +1119,7 @@ func (r *organizationResolver) RiskAssessmentScenarios(ctx context.Context, obj
|
||||
Field: coredata.RiskAssessmentScenarioOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.RiskAssessmentScenarioOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -1134,6 +1149,7 @@ func (r *organizationResolver) Tasks(ctx context.Context, obj *types.Organizatio
|
||||
Field: coredata.TaskOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.TaskOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -1208,6 +1224,7 @@ func (r *organizationResolver) TrustCenterFiles(ctx context.Context, obj *types.
|
||||
Field: coredata.TrustCenterFileOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.TrustCenterFileOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -1237,6 +1254,7 @@ func (r *organizationResolver) CookieBanners(ctx context.Context, obj *types.Org
|
||||
Field: coredata.CookieBannerOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.CookieBannerOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -1268,6 +1286,7 @@ func (r *organizationResolver) ThirdParties(ctx context.Context, obj *types.Orga
|
||||
Field: coredata.ThirdPartyOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ThirdPartyOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -1330,6 +1349,7 @@ func (r *organizationResolver) WebhookSubscriptions(ctx context.Context, obj *ty
|
||||
Field: coredata.WebhookSubscriptionOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.WebhookSubscriptionOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -1375,6 +1395,7 @@ func (r *profileConnectionResolver) TotalCount(ctx context.Context, obj *types.P
|
||||
return count, nil
|
||||
case *documentVersionResolver:
|
||||
scope := coredata.NewScopeFromObjectID(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))
|
||||
|
||||
@@ -207,6 +207,7 @@ func (r *processingActivityResolver) ThirdParties(ctx context.Context, obj *type
|
||||
Field: coredata.ThirdPartyOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ThirdPartyOrderField]{
|
||||
Field: orderBy.Field,
|
||||
|
||||
@@ -320,6 +320,7 @@ func (r *riskResolver) Measures(ctx context.Context, obj *types.Risk, first *int
|
||||
Field: coredata.MeasureOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.MeasureOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -354,6 +355,7 @@ func (r *riskResolver) Documents(ctx context.Context, obj *types.Risk, first *in
|
||||
Field: coredata.DocumentOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.DocumentOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -391,6 +393,7 @@ func (r *riskResolver) Controls(ctx context.Context, obj *types.Risk, first *int
|
||||
Field: coredata.ControlOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ControlOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -425,6 +428,7 @@ func (r *riskResolver) Obligations(ctx context.Context, obj *types.Risk, first *
|
||||
Field: coredata.ObligationOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ObligationOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -454,6 +458,7 @@ func (r *riskResolver) Scenarios(ctx context.Context, obj *types.Risk, first *in
|
||||
Field: coredata.RiskAssessmentScenarioOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.RiskAssessmentScenarioOrderField]{Field: orderBy.Field, Direction: orderBy.Direction}
|
||||
}
|
||||
|
||||
@@ -200,6 +200,7 @@ func (r *taskResolver) Evidences(ctx context.Context, obj *types.Task, first *in
|
||||
Field: coredata.EvidenceOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.EvidenceOrderField]{
|
||||
Field: orderBy.Field,
|
||||
|
||||
@@ -627,6 +627,7 @@ func (r *thirdPartyResolver) ComplianceReports(ctx context.Context, obj *types.T
|
||||
Field: coredata.ThirdPartyComplianceReportOrderFieldReportDate,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ThirdPartyComplianceReportOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -698,6 +699,7 @@ func (r *thirdPartyResolver) Contacts(ctx context.Context, obj *types.ThirdParty
|
||||
Field: coredata.ThirdPartyContactOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ThirdPartyContactOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -727,6 +729,7 @@ func (r *thirdPartyResolver) Services(ctx context.Context, obj *types.ThirdParty
|
||||
Field: coredata.ThirdPartyServiceOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ThirdPartyServiceOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -756,6 +759,7 @@ func (r *thirdPartyResolver) RiskAssessments(ctx context.Context, obj *types.Thi
|
||||
Field: coredata.ThirdPartyRiskAssessmentOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ThirdPartyRiskAssessmentOrderField]{
|
||||
Field: orderBy.Field,
|
||||
|
||||
@@ -734,6 +734,7 @@ func (r *trustCenterResolver) NdaFileURL(ctx context.Context, obj *types.TrustCe
|
||||
}
|
||||
|
||||
scope := coredata.NewScopeFromObjectID(obj.ID)
|
||||
|
||||
fileURL, err := r.probo.TrustCenters.GenerateNDAFileURL(ctx, scope, obj.ID, 15*time.Minute)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot generate NDA file URL", log.Error(err))
|
||||
@@ -781,6 +782,7 @@ func (r *trustCenterResolver) Accesses(ctx context.Context, obj *types.TrustCent
|
||||
Field: coredata.TrustCenterAccessOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.TrustCenterAccessOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -810,6 +812,7 @@ func (r *trustCenterResolver) References(ctx context.Context, obj *types.TrustCe
|
||||
Field: coredata.TrustCenterReferenceOrderFieldRank,
|
||||
Direction: page.OrderDirectionAsc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.TrustCenterReferenceOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -839,6 +842,7 @@ func (r *trustCenterResolver) ComplianceFrameworks(ctx context.Context, obj *typ
|
||||
Field: coredata.ComplianceFrameworkOrderFieldRank,
|
||||
Direction: page.OrderDirectionAsc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ComplianceFrameworkOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -868,6 +872,7 @@ func (r *trustCenterResolver) ExternalUrls(ctx context.Context, obj *types.Trust
|
||||
Field: coredata.ComplianceExternalURLOrderFieldRank,
|
||||
Direction: page.OrderDirectionAsc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ComplianceExternalURLOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -1002,6 +1007,7 @@ func (r *trustCenterAccessResolver) AvailableDocumentAccesses(ctx context.Contex
|
||||
Field: coredata.TrustCenterDocumentAccessOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.TrustCenterDocumentAccessOrderField]{
|
||||
Field: orderBy.Field,
|
||||
|
||||
@@ -31,6 +31,7 @@ func (r *viewerResolver) SignableDocuments(ctx context.Context, obj *types.Viewe
|
||||
Field: coredata.DocumentOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.DocumentOrderField]{
|
||||
Field: orderBy.Field,
|
||||
@@ -110,6 +111,7 @@ func (r *viewerResolver) ApprovableDocuments(ctx context.Context, obj *types.Vie
|
||||
Field: coredata.DocumentOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.DocumentOrderField]{
|
||||
Field: orderBy.Field,
|
||||
|
||||
@@ -164,6 +164,7 @@ func (r *webhookSubscriptionResolver) Events(ctx context.Context, obj *types.Web
|
||||
Field: coredata.WebhookEventOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.WebhookEventOrderField]{
|
||||
Field: orderBy.Field,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user