Replace the old snapshot-based system for vendors with the publish document system, mirroring the prior processing activity / DPIA / TIA migration. Includes the GraphQL mutation, MCP tool, CLI command, n8n operation, frontend publish dialog, e2e tests, and a prosemirror register template covering vendor profile fields plus per-vendor sections for services, contacts, risk assessments, compliance reports, BAA and DPA agreements. The vendor register lives as a generated DocumentTypeRegister document on the organization, reused across publishes (the major version bumps on every republish). Approvers can be passed in to create a draft pending approval; otherwise the version is published immediately. The frontend Vendors page exposes a Publish button and a Document link button when the document exists, and pre-fills the previous default approvers. Remove snapshot mode entirely from vendors and their sub-entities: drop snapshotId/sourceId from GraphQL Vendor type and VendorFilter; remove SnapshotsTypeVendors from the snapshot registry and delete Vendors.Snapshot, VendorSnapshotter interface and all *.InsertVendorSnapshots methods on contacts, services, risk assessments, compliance reports, BAA and DPA. Drop the snapshot routes and banner from the frontend. The snapshot_id columns remain in the database but are now filtered out with snapshot_id IS NULL. Add Get/Upsert/Clear GeneratedDocumentID methods on Vendor backed by a new vendors_document_id column on generated_documents, matching the ProcessingActivity/Finding/Obligation pattern. Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
84 lines
2.0 KiB
GraphQL
84 lines
2.0 KiB
GraphQL
enum SnapshotsType
|
|
@goModel(model: "go.probo.inc/probo/pkg/coredata.SnapshotsType") {
|
|
RISKS @goEnum(value: "go.probo.inc/probo/pkg/coredata.SnapshotsTypeRisks")
|
|
}
|
|
|
|
enum SnapshotOrderField
|
|
@goModel(model: "go.probo.inc/probo/pkg/coredata.SnapshotOrderField") {
|
|
CREATED_AT
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.SnapshotOrderFieldCreatedAt"
|
|
)
|
|
NAME
|
|
@goEnum(value: "go.probo.inc/probo/pkg/coredata.SnapshotOrderFieldName")
|
|
TYPE
|
|
@goEnum(value: "go.probo.inc/probo/pkg/coredata.SnapshotOrderFieldType")
|
|
}
|
|
|
|
input SnapshotOrder
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.SnapshotOrderBy"
|
|
) {
|
|
direction: OrderDirection!
|
|
field: SnapshotOrderField!
|
|
}
|
|
|
|
type Snapshot implements Node {
|
|
id: ID!
|
|
organization: Organization! @goField(forceResolver: true)
|
|
name: String!
|
|
description: String
|
|
type: SnapshotsType!
|
|
|
|
controls(
|
|
first: Int
|
|
after: CursorKey
|
|
last: Int
|
|
before: CursorKey
|
|
orderBy: ControlOrder
|
|
filter: ControlFilter
|
|
): ControlConnection! @goField(forceResolver: true)
|
|
|
|
createdAt: Datetime!
|
|
|
|
permission(action: String!): Boolean! @goField(forceResolver: true)
|
|
}
|
|
|
|
type SnapshotConnection
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.SnapshotConnection"
|
|
) {
|
|
totalCount: Int! @goField(forceResolver: true)
|
|
edges: [SnapshotEdge!]!
|
|
pageInfo: PageInfo!
|
|
}
|
|
|
|
type SnapshotEdge {
|
|
cursor: CursorKey!
|
|
node: Snapshot!
|
|
}
|
|
|
|
extend type Mutation {
|
|
createSnapshot(input: CreateSnapshotInput!): CreateSnapshotPayload!
|
|
deleteSnapshot(input: DeleteSnapshotInput!): DeleteSnapshotPayload!
|
|
}
|
|
|
|
input CreateSnapshotInput {
|
|
organizationId: ID!
|
|
name: String!
|
|
description: String
|
|
type: SnapshotsType!
|
|
}
|
|
|
|
input DeleteSnapshotInput {
|
|
snapshotId: ID!
|
|
}
|
|
|
|
type CreateSnapshotPayload {
|
|
snapshotEdge: SnapshotEdge!
|
|
}
|
|
|
|
type DeleteSnapshotPayload {
|
|
deletedSnapshotId: ID!
|
|
}
|