Skip to content

fix: add info params + fix WO auth#88

Merged
tekwani merged 2 commits into
tetherto:developfrom
mukama:feat/wo-info-params
Jun 4, 2026
Merged

fix: add info params + fix WO auth#88
tekwani merged 2 commits into
tetherto:developfrom
mukama:feat/wo-info-params

Conversation

@mukama
Copy link
Copy Markdown
Contributor

@mukama mukama commented Jun 4, 2026

Summary

  • Schema: Add optional info sub-object to work order create and update schemas, accepting notes, remarks, site, and location fields
  • Handler: Destructure and merge info fields flat into the thing info (no nested info.info)
  • Auth fix: tokenHasPerms crashed with "required is not iterable" when route perms passed bare resource names (e.g. 'work_order'). _permsMatch expects resource:level format — splitting a bare name by : left required as undefined. Fix auto-qualifies bare perms with the appropriate level (rw/r) based on the write flag.

Impact

  • The auth bug blocked all permission-gated routes using the perms parameter (work-orders and spare-parts) on staging
  • The info params enable the UI to send notes, remarks, site, and location on work order create/update

mukama added 2 commits June 4, 2026 10:51
…schema

Accept optional info object with notes, remarks, site, and location
on POST /auth/work-orders and PATCH /auth/work-orders/:id. The handler
merges these into the thing info alongside the top-level fields.
tokenHasPerms received bare resource names (e.g. 'work_order') from
route perms, but _permsMatch expects 'resource:level' format. Splitting
a bare name by ':' left `required` as undefined, crashing on spread.
@mukama mukama changed the title feat: add info params to work order create/update schema feat: work order info params + fix auth perms crash Jun 4, 2026
@mukama mukama changed the title feat: work order info params + fix auth perms crash feat: add info params to work order create/update schema, fix WO auth Jun 4, 2026
@mukama mukama changed the title feat: add info params to work order create/update schema, fix WO auth fix: add info params + fix WO auth Jun 4, 2026
@tekwani tekwani merged commit 8c60883 into tetherto:develop Jun 4, 2026
6 checks passed
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.

4 participants