Dynamic report audit layer#3386
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a specification for an audit layer in dynamic reports, enabling per-node metadata such as status, notes, and linked documents. The proposed changes include UI indicators, a metadata management modal, and backend GraphQL schema updates. Feedback focuses on enhancing security through authorization checks on the new query, improving input validation for linked documents, and utilizing GraphQL enums for better type safety in the schema.
| extend type Query { | ||
| linkedDocumentInfo(id: UUID!): LinkedDocumentInfo # returns null if not found | ||
| } |
There was a problem hiding this comment.
The linkedDocumentInfo query is missing authorization directives. It should include @requiresAuth and appropriate role checks (e.g., @requiresAnyRole(roles: ["business_owner", "accountant"])) to ensure that only authorized users can resolve document information. Additionally, the resolver should verify that the requesting user has permission to access the specific document associated with the provided UUID.
|
|
||
| **Add document input** — a text input + "Add" button: | ||
| - Accepts either a valid UUID or a full URL (`http://` or `https://`) | ||
| - Type is auto-detected on submit: UUID format → `type: "uuid"`, otherwise → `type: "url"` |
There was a problem hiding this comment.
The auto-detection logic for the 'Add document' input is too permissive. Defaulting to type: "url" for any string that is not a valid UUID could result in invalid data being stored. It is recommended to explicitly validate the input as a valid URL (e.g., checking for a protocol prefix) and show a validation error if the input matches neither a UUID nor a valid URL format.
| type: String! # "uuid" | "url" | ||
| value: String! | ||
| } | ||
|
|
||
| # additions to DynamicReportNodeData | ||
| status: String! |
There was a problem hiding this comment.
5666358 to
47bc57c
Compare
No description provided.