feat(types): adopt shared mokosh-types crate (MAPPS-378, rebased, supersedes #445) #463

Merged
nrupard merged 1 commit from feat/MAPPS-378-adopt-mokosh-types-rebased into main 2026-08-03 19:25:36 +02:00
Owner

Supersedes #445 (rebased onto current main; the stale branch could not be updated in place). Closes the remaining half of MAPPS-378.

What

Completes MAPPS-378: mokosh-apps now sources the auth/tenants/tickets DTOs from the shared mokosh-types crate instead of hand-copied structs, so drift becomes a compile error. Net: +33 −314 (deletes the hand copies, re-exports from the crate).

  • auth: CurrentUser, UserRole (drops the unused parse_role shim).
  • tenants: Tenant, TenantBranding, TenantStatus, CreateTenantRequest, UpdateTenantRequest, TenantResponse.
  • tickets: TicketNote, TicketNoteResponse.

contacts + time_tracking were already adopted on main via #457 (MAPPS-383); mileage_tracking has no client module. So after this, every shareable DTO is sourced from mokosh-types.

Why a new PR

The original #445 branch was based on an old main and its Cargo.lock change (mokosh-types a317a14) conflicts with main's #457 lock change (30cde30) - that is the "conflicting file: Cargo.lock" Forgejo shows. This branch is #445's single commit rebased onto current main (683e878), with that conflict resolved by keeping main's dep + lock: 30cde30 is newer than a317a14 (Aug 1 vs Jul 24, a superset), and this change adds no new crates (only re-exports), so the dependency graph is unchanged from main. The rebased commit therefore carries no Cargo.lock change and no conflict. Please close #445 in favour of this.

Verification

just pre-commit (dockerized) green: cargo fmt --all --check, cargo clippy --all-targets -- -D warnings, cargo check --target wasm32-unknown-unknown, cargo test --lib (252 passed, 0 failed). The wasm32 check confirms the auth/tenants/tickets models compile against the newer 30cde30 rev.

🤖 Generated with Claude Code

Supersedes #445 (rebased onto current main; the stale branch could not be updated in place). Closes the remaining half of MAPPS-378. ## What Completes MAPPS-378: mokosh-apps now sources the auth/tenants/tickets DTOs from the shared `mokosh-types` crate instead of hand-copied structs, so drift becomes a compile error. Net: +33 −314 (deletes the hand copies, re-exports from the crate). - **auth**: `CurrentUser`, `UserRole` (drops the unused `parse_role` shim). - **tenants**: `Tenant`, `TenantBranding`, `TenantStatus`, `CreateTenantRequest`, `UpdateTenantRequest`, `TenantResponse`. - **tickets**: `TicketNote`, `TicketNoteResponse`. contacts + time_tracking were already adopted on main via #457 (MAPPS-383); mileage_tracking has no client module. So after this, every shareable DTO is sourced from `mokosh-types`. ## Why a new PR The original #445 branch was based on an old main and its Cargo.lock change (mokosh-types `a317a14`) conflicts with main's #457 lock change (`30cde30`) - that is the "conflicting file: Cargo.lock" Forgejo shows. This branch is #445's single commit rebased onto current main (`683e878`), with that conflict resolved by keeping main's dep + lock: `30cde30` is newer than `a317a14` (Aug 1 vs Jul 24, a superset), and this change adds no new crates (only re-exports), so the dependency graph is unchanged from main. The rebased commit therefore carries **no Cargo.lock change** and no conflict. Please close #445 in favour of this. ## Verification `just pre-commit` (dockerized) green: `cargo fmt --all --check`, `cargo clippy --all-targets -- -D warnings`, `cargo check --target wasm32-unknown-unknown`, `cargo test --lib` (252 passed, 0 failed). The wasm32 check confirms the auth/tenants/tickets models compile against the newer `30cde30` rev. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(types): adopt shared mokosh-types crate via HTTPS git dep
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 1m27s
Create release / Create release from merged PR (pull_request) Has been skipped
daa5d133df
Completes MAPPS-378 by making mokosh-apps depend on the shared mokosh-types crate over an anonymously-readable HTTPS git URL pinned by rev, superseding the interim hand field-sync from #443 so the compiler enforces the client/server DTO contract instead of serde silently defaulting drifted fields.

The prior attempt failed only because an SSH git URL cannot be host-key-verified in CI/docker; the HTTPS URL fetches over anonymous read (the same way bunyip fetches dunite) and resolves plus wasm-compiles cleanly in the gate. mokosh-types is wasm-safe (serde, serde_json, chrono, chrono-tz 0.9, uuid, validator 0.19, rust_decimal, no sqlx).

Adopted (re-exported from mokosh-types, field- and behaviour-identical to the removed hand copies, so no construction site changes): auth CurrentUser and UserRole; tenants Tenant, TenantBranding, TenantStatus, CreateTenantRequest, UpdateTenantRequest, TenantResponse; tickets TicketNote and TicketNoteResponse. The unused local UserRole::parse_role shim (zero call sites) is dropped.

Deferred as local hand copies because they have diverged from the shared crate at this rev, so re-exporting them would be a behaviour change rather than a drop-in: contacts (mokosh-types Contact adds a company_name field and CompanyType adds an Internal variant) and time_tracking (mokosh-types TimeEntryResponse types billing_status and approval_status as enums and adds worked_minutes, task_id, and other fields the client subset omits). mileage_tracking has no client module. Reconciling that drift is a separate follow-up.

Gate: just pre-commit green (fmt, clippy -D warnings, wasm32 check, test --lib: 223 passed, 0 failed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nrupard deleted branch feat/MAPPS-378-adopt-mokosh-types-rebased 2026-08-03 19:25:37 +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-apps!463
No description provided.