Assets as document: replace snapshot with publish workflow
Remove assets from the snapshot system and replace with a publish-based document workflow that generates versioned ProseMirror documents. - Remove snapshot_id/source_id from asset and asset_vendor models - Delete AssetFilter (no longer needed without snapshot filtering) - Add PublishAssetList service, GraphQL mutation, MCP tool, CLI command, and n8n operation - Add asset_list_document_id column to generated_documents table - Generate ProseMirror documents with asset inventory tables (name, type, amount, data types stored, owner, vendors) - Add AssetListDocument resolver on Organization type - Update frontend to remove snapshot routes/params and add publish dialog - Add e2e tests for asset publish (immediate, with approvers, reuse, RBAC) - Add migration script for converting legacy asset snapshots to documents - Exclude ASSETS from snapshot type lists and e2e snapshot tests - Move generated_documents SQL to coredata methods on Datum and Asset - Clear generated document and SOA references on soft delete and archive Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -62,13 +62,8 @@ input DatumOrder
|
||||
field: DatumOrderField!
|
||||
}
|
||||
|
||||
input AssetFilter {
|
||||
snapshotId: ID
|
||||
}
|
||||
|
||||
type Asset implements Node {
|
||||
id: ID!
|
||||
snapshotId: ID
|
||||
name: String!
|
||||
amount: Int!
|
||||
owner: Profile! @goField(forceResolver: true)
|
||||
@@ -148,6 +143,9 @@ extend type Mutation {
|
||||
publishDataList(
|
||||
input: PublishDataListInput!
|
||||
): PublishDataListPayload!
|
||||
publishAssetList(
|
||||
input: PublishAssetListInput!
|
||||
): PublishAssetListPayload!
|
||||
}
|
||||
|
||||
input CreateAssetInput {
|
||||
@@ -227,3 +225,13 @@ type PublishDataListPayload {
|
||||
documentEdge: DocumentEdge!
|
||||
documentVersionEdge: DocumentVersionEdge!
|
||||
}
|
||||
|
||||
input PublishAssetListInput {
|
||||
organizationId: ID!
|
||||
approverIds: [ID!]
|
||||
}
|
||||
|
||||
type PublishAssetListPayload {
|
||||
documentEdge: DocumentEdge!
|
||||
documentVersionEdge: DocumentVersionEdge!
|
||||
}
|
||||
|
||||
@@ -121,13 +121,14 @@ type Organization implements Node {
|
||||
orderBy: AccessReviewCampaignOrder
|
||||
): AccessReviewCampaignConnection! @goField(forceResolver: true)
|
||||
|
||||
assetListDocument: Document @goField(forceResolver: true)
|
||||
|
||||
assets(
|
||||
first: Int
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: AssetOrder
|
||||
filter: AssetFilter = { snapshotId: null }
|
||||
): AssetConnection! @goField(forceResolver: true)
|
||||
|
||||
dataListDocument: Document @goField(forceResolver: true)
|
||||
|
||||
@@ -3,7 +3,6 @@ enum SnapshotsType
|
||||
RISKS @goEnum(value: "go.probo.inc/probo/pkg/coredata.SnapshotsTypeRisks")
|
||||
VENDORS
|
||||
@goEnum(value: "go.probo.inc/probo/pkg/coredata.SnapshotsTypeVendors")
|
||||
ASSETS @goEnum(value: "go.probo.inc/probo/pkg/coredata.SnapshotsTypeAssets")
|
||||
FINDINGS
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.SnapshotsTypeFindings"
|
||||
|
||||
Reference in New Issue
Block a user