Move document type from document to document version

Follow the same pattern used for classification: document type now lives
exclusively on DocumentVersion. A migration copies existing values from
documents to their versions. The document filter uses a subquery on the
latest version. All three API surfaces (GraphQL, MCP, CLI), resolvers,
frontend, and e2e tests are updated accordingly.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2026-03-31 19:57:52 +02:00
parent 28cf3f167a
commit 9a418a7711
29 changed files with 396 additions and 314 deletions

View File

@@ -2543,7 +2543,6 @@ type Document implements Node {
id: ID!
title: String!
description: String
documentType: DocumentType!
currentPublishedMajor: Int
currentPublishedMinor: Int
trustCenterVisibility: TrustCenterVisibility!
@@ -2583,7 +2582,6 @@ type EmployeeDocument
id: ID!
title: String!
description: String
documentType: DocumentType!
signed: Boolean @goField(forceResolver: true)
approvalState: DocumentVersionApprovalDecisionState @goField(forceResolver: true)
@@ -2608,6 +2606,7 @@ type EmployeeDocumentVersion
minor: Int!
status: DocumentVersionStatus!
classification: DocumentClassification!
documentType: DocumentType!
signed: Boolean! @goField(forceResolver: true)
approvalDecision: DocumentVersionApprovalDecision @goField(forceResolver: true)
publishedAt: Datetime
@@ -4642,7 +4641,6 @@ input UpdateDocumentInput {
id: ID!
title: String
content: String
documentType: DocumentType
trustCenterVisibility: TrustCenterVisibility
}
@@ -5529,6 +5527,7 @@ type DocumentVersion implements Node {
changelog: String!
title: String!
classification: DocumentClassification!
documentType: DocumentType!
approvers(
first: Int
after: CursorKey
@@ -5900,6 +5899,7 @@ input UpdateDocumentVersionInput {
documentVersionId: ID!
content: String
classification: DocumentClassification
documentType: DocumentType
}
input CancelSignatureRequestInput {