diff --git a/pkg/coredata/vendor_compliance_report.go b/pkg/coredata/vendor_compliance_report.go index 49936600b..b34a4ccff 100644 --- a/pkg/coredata/vendor_compliance_report.go +++ b/pkg/coredata/vendor_compliance_report.go @@ -269,6 +269,7 @@ WITH INSERT INTO vendor_compliance_reports ( tenant_id, id, + organization_id, snapshot_id, source_id, vendor_id, @@ -282,6 +283,7 @@ INSERT INTO vendor_compliance_reports ( SELECT @tenant_id, generate_gid(decode_base64_unpadded(@tenant_id), @vendor_compliance_report_entity_type), + @organization_id, @snapshot_id, vcr.id, sv.id, diff --git a/pkg/coredata/vendor_contact.go b/pkg/coredata/vendor_contact.go index 38caced57..8d25beef0 100644 --- a/pkg/coredata/vendor_contact.go +++ b/pkg/coredata/vendor_contact.go @@ -314,6 +314,7 @@ WITH INSERT INTO vendor_contacts ( tenant_id, id, + organization_id, snapshot_id, source_id, vendor_id, @@ -327,6 +328,7 @@ INSERT INTO vendor_contacts ( SELECT @tenant_id, generate_gid(decode_base64_unpadded(@tenant_id), @vendor_contact_entity_type), + @organization_id, @snapshot_id, vc.id, sv.id, diff --git a/pkg/server/api/mcp/v1/schema.resolvers.go b/pkg/server/api/mcp/v1/schema.resolvers.go index 622a656d0..8f7c7fb7f 100644 --- a/pkg/server/api/mcp/v1/schema.resolvers.go +++ b/pkg/server/api/mcp/v1/schema.resolvers.go @@ -2869,7 +2869,13 @@ func (r *Resolver) ListStatementsOfApplicabilityTool(ctx context.Context, req *m cursor := types.NewCursor(input.Size, input.Cursor, pageOrderBy) - pg, err := prb.StatementsOfApplicability.ListForOrganizationID(ctx, input.OrganizationID, cursor, coredata.NewStatementOfApplicabilityFilter(nil)) + noSnapshot := (*gid.GID)(nil) + filter := coredata.NewStatementOfApplicabilityFilter(&noSnapshot) + if input.Filter != nil { + filter = coredata.NewStatementOfApplicabilityFilter(&input.Filter.SnapshotID) + } + + pg, err := prb.StatementsOfApplicability.ListForOrganizationID(ctx, input.OrganizationID, cursor, filter) if err != nil { return nil, types.ListStatementsOfApplicabilityOutput{}, fmt.Errorf("failed to list statements of applicability: %w", err) } diff --git a/pkg/server/api/mcp/v1/specification.yaml b/pkg/server/api/mcp/v1/specification.yaml index 7209d9d58..2d78d5482 100644 --- a/pkg/server/api/mcp/v1/specification.yaml +++ b/pkg/server/api/mcp/v1/specification.yaml @@ -4996,7 +4996,7 @@ components: - OBLIGATIONS - CONTINUAL_IMPROVEMENTS - PROCESSING_ACTIVITIES - - STATES_OF_APPLICABILITY + - STATEMENTS_OF_APPLICABILITY go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.SnapshotsType SnapshotOrderField: @@ -6173,6 +6173,15 @@ components: cursor: $ref: "#/components/schemas/CursorKey" description: Page cursor + filter: + type: object + properties: + snapshot_id: + anyOf: + - $ref: "#/components/schemas/GID" + - type: "null" + description: Filter by snapshot ID. Defaults to null, which returns only statements of applicability with no snapshot (current live data). Pass a specific snapshot ID to retrieve statements of applicability as they were at that snapshot. + default: null ListStatementsOfApplicabilityOutput: type: object