Skip to content

Dynamic report audit layer#3386

Draft
gilgardosh wants to merge 4 commits into
mainfrom
dynamic-report-refactor-2
Draft

Dynamic report audit layer#3386
gilgardosh wants to merge 4 commits into
mainfrom
dynamic-report-refactor-2

Conversation

@gilgardosh

Copy link
Copy Markdown
Collaborator

No description provided.

gilgardosh and others added 4 commits April 21, 2026 15:29
Co-authored-by: Copilot <copilot@github.com>
@gilgardosh
gilgardosh temporarily deployed to accounter-fullstack April 22, 2026 08:06 — with GitHub Actions Inactive
@gilgardosh gilgardosh self-assigned this Apr 22, 2026
@gilgardosh
gilgardosh temporarily deployed to accounter-fullstack April 22, 2026 08:06 — with GitHub Actions Inactive

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +128 to +130
extend type Query {
linkedDocumentInfo(id: UUID!): LinkedDocumentInfo # returns null if not found
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

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"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Comment on lines +140 to +145
type: String! # "uuid" | "url"
value: String!
}

# additions to DynamicReportNodeData
status: String!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider using GraphQL enum types for the status and LinkedDocument.type fields instead of String!. This provides better type safety, self-documentation in the schema, and ensures that the API strictly adheres to the allowed values defined in the Zod schema and TypeScript types.

@gilgardosh
gilgardosh force-pushed the dynamic-report-refactor branch from 5666358 to 47bc57c Compare April 23, 2026 07:04
Base automatically changed from dynamic-report-refactor to main April 26, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant