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>
238 lines
5.5 KiB
GraphQL
238 lines
5.5 KiB
GraphQL
enum AssetType @goModel(model: "go.probo.inc/probo/pkg/coredata.AssetType") {
|
|
PHYSICAL @goEnum(value: "go.probo.inc/probo/pkg/coredata.AssetTypePhysical")
|
|
VIRTUAL @goEnum(value: "go.probo.inc/probo/pkg/coredata.AssetTypeVirtual")
|
|
}
|
|
|
|
enum AssetOrderField
|
|
@goModel(model: "go.probo.inc/probo/pkg/coredata.AssetOrderField") {
|
|
CREATED_AT
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.AssetOrderFieldCreatedAt"
|
|
)
|
|
AMOUNT
|
|
@goEnum(value: "go.probo.inc/probo/pkg/coredata.AssetOrderFieldAmount")
|
|
}
|
|
|
|
enum DatumOrderField
|
|
@goModel(model: "go.probo.inc/probo/pkg/coredata.DatumOrderField") {
|
|
CREATED_AT
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.DatumOrderFieldCreatedAt"
|
|
)
|
|
NAME @goEnum(value: "go.probo.inc/probo/pkg/coredata.DatumOrderFieldName")
|
|
DATA_CLASSIFICATION
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.DatumOrderFieldDataClassification"
|
|
)
|
|
}
|
|
|
|
enum DataClassification
|
|
@goModel(model: "go.probo.inc/probo/pkg/coredata.DataClassification") {
|
|
PUBLIC
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.DataClassificationPublic"
|
|
)
|
|
INTERNAL
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.DataClassificationInternal"
|
|
)
|
|
CONFIDENTIAL
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.DataClassificationConfidential"
|
|
)
|
|
SECRET
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.DataClassificationSecret"
|
|
)
|
|
}
|
|
|
|
input AssetOrder
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.AssetOrderBy"
|
|
) {
|
|
direction: OrderDirection!
|
|
field: AssetOrderField!
|
|
}
|
|
|
|
input DatumOrder
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.DatumOrderBy"
|
|
) {
|
|
direction: OrderDirection!
|
|
field: DatumOrderField!
|
|
}
|
|
|
|
type Asset implements Node {
|
|
id: ID!
|
|
name: String!
|
|
amount: Int!
|
|
owner: Profile! @goField(forceResolver: true)
|
|
vendors(
|
|
first: Int
|
|
after: CursorKey
|
|
last: Int
|
|
before: CursorKey
|
|
orderBy: VendorOrder
|
|
): VendorConnection! @goField(forceResolver: true)
|
|
assetType: AssetType!
|
|
dataTypesStored: String!
|
|
organization: Organization! @goField(forceResolver: true)
|
|
createdAt: Datetime!
|
|
updatedAt: Datetime!
|
|
|
|
permission(action: String!): Boolean! @goField(forceResolver: true)
|
|
}
|
|
|
|
type Datum implements Node
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.Datum"
|
|
) {
|
|
id: ID!
|
|
name: String!
|
|
dataClassification: DataClassification!
|
|
owner: Profile! @goField(forceResolver: true)
|
|
vendors(
|
|
first: Int
|
|
after: CursorKey
|
|
last: Int
|
|
before: CursorKey
|
|
orderBy: VendorOrder
|
|
): VendorConnection! @goField(forceResolver: true)
|
|
organization: Organization! @goField(forceResolver: true)
|
|
createdAt: Datetime!
|
|
updatedAt: Datetime!
|
|
|
|
permission(action: String!): Boolean! @goField(forceResolver: true)
|
|
}
|
|
|
|
type AssetConnection
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.AssetConnection"
|
|
) {
|
|
totalCount: Int! @goField(forceResolver: true)
|
|
edges: [AssetEdge!]!
|
|
pageInfo: PageInfo!
|
|
}
|
|
|
|
type AssetEdge {
|
|
cursor: CursorKey!
|
|
node: Asset!
|
|
}
|
|
|
|
type DatumConnection
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.DatumConnection"
|
|
) {
|
|
totalCount: Int! @goField(forceResolver: true)
|
|
edges: [DatumEdge!]!
|
|
pageInfo: PageInfo!
|
|
}
|
|
|
|
type DatumEdge {
|
|
cursor: CursorKey!
|
|
node: Datum!
|
|
}
|
|
|
|
extend type Mutation {
|
|
createAsset(input: CreateAssetInput!): CreateAssetPayload!
|
|
updateAsset(input: UpdateAssetInput!): UpdateAssetPayload!
|
|
deleteAsset(input: DeleteAssetInput!): DeleteAssetPayload!
|
|
createDatum(input: CreateDatumInput!): CreateDatumPayload!
|
|
updateDatum(input: UpdateDatumInput!): UpdateDatumPayload!
|
|
deleteDatum(input: DeleteDatumInput!): DeleteDatumPayload!
|
|
publishDataList(
|
|
input: PublishDataListInput!
|
|
): PublishDataListPayload!
|
|
publishAssetList(
|
|
input: PublishAssetListInput!
|
|
): PublishAssetListPayload!
|
|
}
|
|
|
|
input CreateAssetInput {
|
|
organizationId: ID!
|
|
name: String!
|
|
amount: Int!
|
|
ownerId: ID!
|
|
assetType: AssetType!
|
|
dataTypesStored: String!
|
|
vendorIds: [ID!]
|
|
}
|
|
|
|
input UpdateAssetInput {
|
|
id: ID!
|
|
name: String
|
|
amount: Int
|
|
ownerId: ID
|
|
assetType: AssetType
|
|
dataTypesStored: String
|
|
vendorIds: [ID!]
|
|
}
|
|
|
|
input DeleteAssetInput {
|
|
assetId: ID!
|
|
}
|
|
|
|
input CreateDatumInput {
|
|
organizationId: ID!
|
|
name: String!
|
|
dataClassification: DataClassification!
|
|
ownerId: ID!
|
|
vendorIds: [ID!]
|
|
}
|
|
|
|
input UpdateDatumInput {
|
|
id: ID!
|
|
name: String
|
|
dataClassification: DataClassification
|
|
ownerId: ID
|
|
vendorIds: [ID!]
|
|
}
|
|
|
|
input DeleteDatumInput {
|
|
datumId: ID!
|
|
}
|
|
|
|
type CreateAssetPayload {
|
|
assetEdge: AssetEdge!
|
|
}
|
|
|
|
type UpdateAssetPayload {
|
|
asset: Asset!
|
|
}
|
|
|
|
type DeleteAssetPayload {
|
|
deletedAssetId: ID!
|
|
}
|
|
|
|
type CreateDatumPayload {
|
|
datumEdge: DatumEdge!
|
|
}
|
|
|
|
type UpdateDatumPayload {
|
|
datum: Datum!
|
|
}
|
|
|
|
type DeleteDatumPayload {
|
|
deletedDatumId: ID!
|
|
}
|
|
|
|
input PublishDataListInput {
|
|
organizationId: ID!
|
|
approverIds: [ID!]
|
|
}
|
|
|
|
type PublishDataListPayload {
|
|
documentEdge: DocumentEdge!
|
|
documentVersionEdge: DocumentVersionEdge!
|
|
}
|
|
|
|
input PublishAssetListInput {
|
|
organizationId: ID!
|
|
approverIds: [ID!]
|
|
}
|
|
|
|
type PublishAssetListPayload {
|
|
documentEdge: DocumentEdge!
|
|
documentVersionEdge: DocumentVersionEdge!
|
|
}
|