Sync drifted shared DTO fields, drop vestigial ticket copies (MAPPS-378) #443
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/MAPPS-378-mokosh-types"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Repair the drift between the SPA's hand-copied shared DTOs and mokosh-server's
mokosh-typescrate, and delete the dead wrong-derive copies. This is the field-sync fallback for MAPPS-378; full crate-adoption is deferred (see Why).Why
mokosh-typessource of truth, so a future server field the SPA needs fails the build instead of deserializing to a default.mokosh-typesas a pinned git dependency and re-export from it) was feasibility-tested first against the real Dockerjust pre-commitgate and is NOT CI-viable: therust-builder-glibccontainer tries to fetchssh://git@git.a8n.run/psa-systems/mokosh-server.gitbut has no known-hosts entry and no SSH credentials (the gate mounts neither~/.sshnor an agent socket), socargo checkaborts at dependency resolution witherror: unknown SSH host key. The Forgejocheck.ymlrunner has no cross-repo deploy key either. Making the git dep work needs infra changes outside this repo (SSH host-key + deploy-key provisioning in both the local gate and CI, or publishingmokosh-typesto a registry), so it is not a quick fix.Changes
CurrentUser(src/modules/auth/models.rs) gainstheme_base_mode: Option<String>andtheme_accent_id: Option<String>(PMS-410), matchingmokosh_types::auth::CurrentUserfield names, types, and#[serde(default)]. All ten construction sites are updated:User::to_current_user, the two runtime builders in src/hooks/auth.rs, the OIDC-callback builder in src/pages/auth_callback.rs, and six test fixtures.TicketNoteandTicketNoteResponse(src/modules/tickets/models.rs) gaincreated_by_contact_id: Option<Uuid>(PMS-468 / PMS-449), matchingmokosh_types::ticketsincluding the#[serde(default)]and#[serde(default, skip_serializing_if = "Option::is_none")]attributes respectively. The SPA already consumes this field via its own portal subset struct (src/pages/portal.rs), so the copies were the only place missing it.CreateTicketRequest(derived onlyDeserialize) andTicketResponse(derived onlySerialize) were byte-copies of the server structs carrying client-inappropriate derives, referenced only in doc comments and never in code.TicketResponse's exclusive helper structsTicketStatusSummaryandTicketPrioritySummaryare removed with it (nothing else referenced them). The SPA renders tickets through its own purpose-built subset structsRemoteTicket/RemoteTicketDetail, which are untouched.Deferred / intentionally out of scope
mokosh-typescrate-adoption (the durable fix) is deferred until the crate is published to a registry or the Docker gate and Forgejo runner are provisioned with SSH access to the mokosh-server repo. This PR documents the blocker so the follow-up is tracked.TicketCategory/Upsert*TicketLookupDTO families that exist inmokosh-typesbut not in the SPA are intentionally NOT hand-added. They are not existing hand-copied structs, the SPA reads lookups via its ownRemoteTicketLookupsubset, and manufacturing unused copies would grow exactly the drift surface MAPPS-378 removes. They come in enforced (at zero maintenance cost) with the deferred full adoption.Tests
just pre-commitgate green (exit 0):cargo fmt --all --check,cargo clippy --all-targets -- -D warnings,cargo check --target wasm32-unknown-unknown, andcargo test --lib(223 passed, 0 failed).