Add document classification filter
Add classification as a filter-only field on documents, resolved from the latest document version. Expose in GraphQL, MCP, and document list UI with a selector alongside the document type filter. Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -2042,7 +2042,8 @@ func (r *Resolver) ListDocumentsTool(ctx context.Context, req *mcp.CallToolReque
|
||||
}
|
||||
|
||||
documentFilter = coredata.NewDocumentFilter(query).
|
||||
WithDocumentTypes(input.Filter.DocumentTypes)
|
||||
WithDocumentTypes(input.Filter.DocumentTypes).
|
||||
WithClassifications(input.Filter.Classifications)
|
||||
}
|
||||
|
||||
docPage, err := prb.Documents.ListByOrganizationID(ctx, input.OrganizationID, cursor, documentFilter)
|
||||
|
||||
@@ -5374,6 +5374,11 @@ components:
|
||||
items:
|
||||
$ref: "#/components/schemas/DocumentType"
|
||||
description: Document types
|
||||
classifications:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/DocumentClassification"
|
||||
description: Document classifications
|
||||
|
||||
ListDocumentsOutput:
|
||||
type: object
|
||||
|
||||
Reference in New Issue
Block a user