fix(tickets,assets): asset_id update + AssetFilter.q so PMS-344 inline editor and picker work end to end #259

Merged
YousifShkara merged 1 commit from fix/pms-344-asset-filter-and-update-clearing-semantics into main 2026-06-16 10:46:17 +02:00
Owner

Two server-side gaps surfaced by the PMS-344 verification round.

update_ticket validated the incoming asset_id FK against the assets table but never executed an UPDATE for it, so the SPA's inline asset editor PUT round-tripped and emitted a bare "Updated" audit row with no actual mutation. Added the missing UPDATE block, gated on the new double-Option wire shape: Some(Some(uuid)) sets the association, Some(None) clears it to NULL (powering the Unassign affordance), and None leaves the column unchanged. The custom deserialize_double_option helper in mokosh-types lib.rs is the canonical PATCH-style "field absent vs explicit null" decoder; the AssetPicker is the first consumer and any future PATCH-nullable FK should follow the same shape.

AssetFilter had no q field, so the AssetPicker's ?q=... was silently dropped by axum's Query extractor and the list endpoint returned every asset regardless of typed text. Added the q field with the standard length-200 validator and wired an ILIKE-on-name predicate into list_assets, mirroring CompanyFilter.q. The client-side picker (PMS-371 fix) already issues the query parameter on every keystroke; this just makes the server honour it.

#PMS-344

Two server-side gaps surfaced by the PMS-344 verification round. update_ticket validated the incoming asset_id FK against the assets table but never executed an UPDATE for it, so the SPA's inline asset editor PUT round-tripped and emitted a bare "Updated" audit row with no actual mutation. Added the missing UPDATE block, gated on the new double-Option wire shape: Some(Some(uuid)) sets the association, Some(None) clears it to NULL (powering the Unassign affordance), and None leaves the column unchanged. The custom deserialize_double_option helper in mokosh-types lib.rs is the canonical PATCH-style "field absent vs explicit null" decoder; the AssetPicker is the first consumer and any future PATCH-nullable FK should follow the same shape. AssetFilter had no q field, so the AssetPicker's `?q=...` was silently dropped by axum's Query extractor and the list endpoint returned every asset regardless of typed text. Added the q field with the standard length-200 validator and wired an ILIKE-on-name predicate into list_assets, mirroring CompanyFilter.q. The client-side picker (PMS-371 fix) already issues the query parameter on every keystroke; this just makes the server honour it. #PMS-344
fix(tickets,assets): asset_id update + AssetFilter.q so PMS-344 inline editor and picker work end to end
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
E2E / Playwright against staging (pull_request) Successful in 46s
Check / fmt + clippy + compile + unit/doc tests (pull_request) Successful in 1m33s
Integration / integration tests (pull_request) Successful in 4m49s
fb4e7dc3f0
Two server-side gaps surfaced by the PMS-344 verification round.

update_ticket validated the incoming asset_id FK against the assets table but never executed an UPDATE for it, so the SPA's inline asset editor PUT round-tripped and emitted a bare "Updated" audit row with no actual mutation. Added the missing UPDATE block, gated on the new double-Option wire shape: Some(Some(uuid)) sets the association, Some(None) clears it to NULL (powering the Unassign affordance), and None leaves the column unchanged. The custom deserialize_double_option helper in mokosh-types lib.rs is the canonical PATCH-style "field absent vs explicit null" decoder; the AssetPicker is the first consumer and any future PATCH-nullable FK should follow the same shape.

AssetFilter had no q field, so the AssetPicker's `?q=...` was silently dropped by axum's Query extractor and the list endpoint returned every asset regardless of typed text. Added the q field with the standard length-200 validator and wired an ILIKE-on-name predicate into list_assets, mirroring CompanyFilter.q. The client-side picker (PMS-371 fix) already issues the query parameter on every keystroke; this just makes the server honour it.

#PMS-344
YousifShkara deleted branch fix/pms-344-asset-filter-and-update-clearing-semantics 2026-06-16 10:46:17 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!259
No description provided.