Skip to content

docs(api): settle whether a create may name a chart the writer has no relationship with (#330) - #487

Open
aupyay wants to merge 1 commit into
devfrom
fix/330-patch-chart-relationship-gate
Open

aupyay wants to merge 1 commit into
devfrom
fix/330-patch-chart-relationship-gate

Conversation

@aupyay

@aupyay aupyay commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The PATCH half of May a write name a chart the writer has no relationship with? #330 was fixed in fix(api): gate the chart a patch names, not only the row it found #421 (gate on the row as patched). This settles the CREATE half, which the issue left as an explicit open question.
  • Decision: create stays ungated on the chart it names, "yes, as triage needs" - the inbox-fax triage workflow (POST /documents/:id/file) already relies on naming a chart with no prior relationship, and a create grants no read back on its own.
  • Recorded the decision as a comment at the omission site in crud.ts, and added a test in routes.orders.test.ts naming the decision so it isn't mistaken for an oversight later.

Test plan

  • pnpm --filter api lint
  • pnpm --filter api type-check
  • pnpm --filter api test (4171 passed, 14 skipped)
  • pnpm run format:check
  • pnpm verify
  • Mutation check: temporarily added a guardChart call to CREATE, new test failed as expected (404 vs 201), reverted

… relationship with (#330)

The PATCH half of #330 was fixed in #421: a patch that moves a chart-scoped
row to a chart the caller has no relationship with is refused, gated on the
row as patched. The issue left CREATE as an open question because the same
gate would break the one workflow that needs to name an unrelated chart -
triaging an inbox of unclaimed faxes, which by definition has no prior
relationship, the same argument `care-relationship.ts` already accepts for
reception and billing.

Settling it as "yes, as triage needs": create stays ungated on the chart it
names, `POST /documents/:id/file` already relies on exactly this, and a
create grants no read back on its own. Recorded where the omission is, in
`crud.ts`, and locked in with a test naming the decision so a later change
does not "fix" this into breaking the triage workflow without the question
being reopened.
@aupyay
aupyay requested a review from ankit-yc as a code owner September 12, 2026 23:14
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@ankit-yc ankit-yc 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.

Reviewed exact head a7cea5b. The test locks the deliberate create behavior from #330 at the generated seam, and the rationale matches the documented fax-triage workflow. Local API lint, type-check, full test suite, build, formatting, and diff check passed. The remaining CI failure is the repeated SonarCloud JRE-metadata HTTP 403 before analysis, also present on the prior API PR.

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.

2 participants