Add processing activity, DPIA and TIA publish to document system

Replace the old PDF/snapshot-based exports for processing activities,
Data Protection Impact Assessments and Transfer Impact Assessments with
the publish document system. Includes GraphQL mutations, MCP tools, CLI
commands, n8n operations, frontend publish dialogs, e2e tests, and
prosemirror register templates that mirror the previous PDF layouts.

Each 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
ProcessingActivities page exposes a Publish dropdown per register and a
Document link button per active tab, pre-fills the previous default
approvers, and navigates to the published document on success.

Remove snapshot mode entirely from these three entities: drop snapshotId
and sourceId from GraphQL schemas, types, filters, resolvers, MCP spec,
frontend routes and pages; remove SnapshotsTypeProcessingActivities from
the snapshot registry and delete the ProcessingActivities.Snapshot,
ProcessingActivitySnapshotter interface and *.InsertProcessingActivitySnapshots
methods. 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 each entity type
(ProcessingActivity, DataProtectionImpactAssessment,
TransferImpactAssessment) backed by new columns in the generated_documents
table, matching the Finding/Obligation pattern.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2026-04-28 16:07:18 +02:00
parent be294599ec
commit ba8bce2ad3
60 changed files with 5461 additions and 3601 deletions

View File

@@ -52,14 +52,6 @@ input TransferImpactAssessmentOrder
field: TransferImpactAssessmentOrderField!
}
input DataProtectionImpactAssessmentFilter {
snapshotId: ID
}
input TransferImpactAssessmentFilter {
snapshotId: ID
}
type DataProtectionImpactAssessment implements Node {
id: ID!
processingActivity: ProcessingActivity! @goField(forceResolver: true)
@@ -137,12 +129,12 @@ extend type Mutation {
deleteTransferImpactAssessment(
input: DeleteTransferImpactAssessmentInput!
): DeleteTransferImpactAssessmentPayload!
exportDataProtectionImpactAssessmentsPDF(
input: ExportDataProtectionImpactAssessmentsPDFInput!
): ExportDataProtectionImpactAssessmentsPDFPayload!
exportTransferImpactAssessmentsPDF(
input: ExportTransferImpactAssessmentsPDFInput!
): ExportTransferImpactAssessmentsPDFPayload!
publishDataProtectionImpactAssessmentList(
input: PublishDataProtectionImpactAssessmentListInput!
): PublishDataProtectionImpactAssessmentListPayload!
publishTransferImpactAssessmentList(
input: PublishTransferImpactAssessmentListInput!
): PublishTransferImpactAssessmentListPayload!
}
input CreateDataProtectionImpactAssessmentInput {
@@ -189,14 +181,14 @@ input DeleteTransferImpactAssessmentInput {
transferImpactAssessmentId: ID!
}
input ExportDataProtectionImpactAssessmentsPDFInput {
input PublishDataProtectionImpactAssessmentListInput {
organizationId: ID!
filter: DataProtectionImpactAssessmentFilter
approverIds: [ID!]
}
input ExportTransferImpactAssessmentsPDFInput {
input PublishTransferImpactAssessmentListInput {
organizationId: ID!
filter: TransferImpactAssessmentFilter
approverIds: [ID!]
}
type CreateDataProtectionImpactAssessmentPayload {
@@ -223,10 +215,12 @@ type DeleteTransferImpactAssessmentPayload {
deletedTransferImpactAssessmentId: ID!
}
type ExportDataProtectionImpactAssessmentsPDFPayload {
data: String!
type PublishDataProtectionImpactAssessmentListPayload {
documentEdge: DocumentEdge!
documentVersionEdge: DocumentVersionEdge!
}
type ExportTransferImpactAssessmentsPDFPayload {
data: String!
type PublishTransferImpactAssessmentListPayload {
documentEdge: DocumentEdge!
documentVersionEdge: DocumentVersionEdge!
}

View File

@@ -203,18 +203,21 @@ type Organization implements Node {
last: Int
before: CursorKey
orderBy: DataProtectionImpactAssessmentOrder
filter: DataProtectionImpactAssessmentFilter = { snapshotId: null }
): DataProtectionImpactAssessmentConnection! @goField(forceResolver: true)
dataProtectionImpactAssessmentsDocument: Document
@goField(forceResolver: true)
transferImpactAssessments(
first: Int
after: CursorKey
last: Int
before: CursorKey
orderBy: TransferImpactAssessmentOrder
filter: TransferImpactAssessmentFilter = { snapshotId: null }
): TransferImpactAssessmentConnection! @goField(forceResolver: true)
transferImpactAssessmentsDocument: Document @goField(forceResolver: true)
documents(
first: Int
after: CursorKey
@@ -265,9 +268,10 @@ type Organization implements Node {
last: Int
before: CursorKey
orderBy: ProcessingActivityOrder
filter: ProcessingActivityFilter = { snapshotId: null }
): ProcessingActivityConnection! @goField(forceResolver: true)
processingActivitiesDocument: Document @goField(forceResolver: true)
rightsRequests(
first: Int
after: CursorKey

View File

@@ -138,14 +138,8 @@ input ProcessingActivityOrder
field: ProcessingActivityOrderField!
}
input ProcessingActivityFilter {
snapshotId: ID
}
type ProcessingActivity implements Node {
id: ID!
snapshotId: ID
sourceId: ID
organization: Organization! @goField(forceResolver: true)
name: String!
purpose: String
@@ -207,9 +201,9 @@ extend type Mutation {
deleteProcessingActivity(
input: DeleteProcessingActivityInput!
): DeleteProcessingActivityPayload!
exportProcessingActivitiesPDF(
input: ExportProcessingActivitiesPDFInput!
): ExportProcessingActivitiesPDFPayload!
publishProcessingActivityList(
input: PublishProcessingActivityListInput!
): PublishProcessingActivityListPayload!
}
input CreateProcessingActivityInput {
@@ -265,9 +259,9 @@ input DeleteProcessingActivityInput {
processingActivityId: ID!
}
input ExportProcessingActivitiesPDFInput {
input PublishProcessingActivityListInput {
organizationId: ID!
filter: ProcessingActivityFilter
approverIds: [ID!]
}
type CreateProcessingActivityPayload {
@@ -282,6 +276,7 @@ type DeleteProcessingActivityPayload {
deletedProcessingActivityId: ID!
}
type ExportProcessingActivitiesPDFPayload {
data: String!
type PublishProcessingActivityListPayload {
documentEdge: DocumentEdge!
documentVersionEdge: DocumentVersionEdge!
}