feat(models): source contacts + time_tracking DTOs from mokosh-types #457

Merged
Claude-Run merged 1 commit from feat/MAPPS-383-adopt-mokosh-types-contacts-time into main 2026-08-01 02:26:55 +02:00
Member

MAPPS-383 asked to finish an adoption that had not started. Its background says MAPPS-378 (PR #445) already added an HTTPS git dependency on mokosh-types and re-exported auth / tenants / tickets from it. The source of truth says otherwise: MAPPS-378 landed as PR #443 (commit cec5d47) and its own message records that crate adoption was feasibility-tested and rejected as not CI-viable, because it was tried over ssh://git@git.a8n.run and neither the pre-commit container nor the Forgejo check runner carries SSH credentials. Cargo.toml, Cargo.lock, and a grep of src/ all confirm the dependency was absent on main.

That blocker is specific to the SSH transport, not to the crate. dev.a8n.run serves mokosh-server over anonymous HTTPS, which needs no credentials at all. Verified before writing code: git ls-remote succeeds with an empty HOME, and cargo fetch against the HTTPS URL succeeds inside the rust-builder-glibc image the gate and CI use. So this change adds the dependency over HTTPS and does the adoption the issue actually asks for.

src/modules/contacts and src/modules/time_tracking are now one-line re-exports of mokosh_types::contacts and mokosh_types::time_tracking. Their models.rs hand copies are deleted, and so are the routes.rs / service.rs files beside them: those were byte-copies of server handlers gated behind a server feature that cannot compile here at all, since this crate depends on neither axum nor sqlx. Each module keeps a test that converts the shared type to the re-exported name through an identity fn, so re-introducing a hand copy fails to compile rather than silently drifting again.

The issue's usage counts do not match this repo: the SPA had zero references to the time_tracking types and exactly one to contacts (Address in pages/contacts.rs). Everything else reads purpose-built subset structs, the same pattern MAPPS-378 preserved for tickets. The two divergences that do reach real code are fixed. RemoteTimeEntry.billing_status is now mokosh_types::tickets::BillingStatus instead of String, so an unrecognized wire tag fails decoding instead of rendering; the row also stops printing the raw tag ("ready_to_bill") and gets a label. CompanyType::Internal now has a title-case arm in humanize_company_type, and the company form preserves a non-customer-facing type as its own option so editing an internal company cannot silently retype it to Client, mirroring the existing state_options idiom in the same file. The week-level approval_status stays String because the shared TimesheetSummaryResponse types it as String too.

Note for the reviewer: auth, tenants, and tickets are still hand-copied under src/modules/<module>/models.rs. They are out of scope here and want their own issue now that the HTTPS transport is proven.

Gate green via just pre-commit: fmt --check, clippy --all-targets -D warnings, cargo check --target wasm32-unknown-unknown, cargo test --lib (240 passed, 0 failed; was 232).

#MAPPS-383

MAPPS-383 asked to finish an adoption that had not started. Its background says MAPPS-378 (PR #445) already added an HTTPS git dependency on mokosh-types and re-exported auth / tenants / tickets from it. The source of truth says otherwise: MAPPS-378 landed as PR #443 (commit cec5d47) and its own message records that crate adoption was feasibility-tested and rejected as not CI-viable, because it was tried over ssh://git@git.a8n.run and neither the pre-commit container nor the Forgejo check runner carries SSH credentials. Cargo.toml, Cargo.lock, and a grep of src/ all confirm the dependency was absent on main. That blocker is specific to the SSH transport, not to the crate. dev.a8n.run serves mokosh-server over anonymous HTTPS, which needs no credentials at all. Verified before writing code: `git ls-remote` succeeds with an empty HOME, and `cargo fetch` against the HTTPS URL succeeds inside the rust-builder-glibc image the gate and CI use. So this change adds the dependency over HTTPS and does the adoption the issue actually asks for. `src/modules/contacts` and `src/modules/time_tracking` are now one-line re-exports of `mokosh_types::contacts` and `mokosh_types::time_tracking`. Their `models.rs` hand copies are deleted, and so are the `routes.rs` / `service.rs` files beside them: those were byte-copies of server handlers gated behind a `server` feature that cannot compile here at all, since this crate depends on neither axum nor sqlx. Each module keeps a test that converts the shared type to the re-exported name through an identity `fn`, so re-introducing a hand copy fails to compile rather than silently drifting again. The issue's usage counts do not match this repo: the SPA had zero references to the time_tracking types and exactly one to contacts (`Address` in pages/contacts.rs). Everything else reads purpose-built subset structs, the same pattern MAPPS-378 preserved for tickets. The two divergences that do reach real code are fixed. `RemoteTimeEntry.billing_status` is now `mokosh_types::tickets::BillingStatus` instead of `String`, so an unrecognized wire tag fails decoding instead of rendering; the row also stops printing the raw tag ("ready_to_bill") and gets a label. `CompanyType::Internal` now has a title-case arm in `humanize_company_type`, and the company form preserves a non-customer-facing type as its own option so editing an internal company cannot silently retype it to Client, mirroring the existing `state_options` idiom in the same file. The week-level `approval_status` stays `String` because the shared `TimesheetSummaryResponse` types it as `String` too. Note for the reviewer: auth, tenants, and tickets are still hand-copied under `src/modules/<module>/models.rs`. They are out of scope here and want their own issue now that the HTTPS transport is proven. Gate green via `just pre-commit`: fmt --check, clippy --all-targets -D warnings, cargo check --target wasm32-unknown-unknown, cargo test --lib (240 passed, 0 failed; was 232). #MAPPS-383
feat(models): source contacts + time_tracking DTOs from mokosh-types
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 4m57s
Create release / Create release from merged PR (pull_request) Has been skipped
f468d58968
MAPPS-383 asked to finish an adoption that had not started. Its background says MAPPS-378 (PR #445) already added an HTTPS git dependency on mokosh-types and re-exported auth / tenants / tickets from it. The source of truth says otherwise: MAPPS-378 landed as PR #443 (commit cec5d47) and its own message records that crate adoption was feasibility-tested and rejected as not CI-viable, because it was tried over ssh://git@git.a8n.run and neither the pre-commit container nor the Forgejo check runner carries SSH credentials. Cargo.toml, Cargo.lock, and a grep of src/ all confirm the dependency was absent on main.

That blocker is specific to the SSH transport, not to the crate. dev.a8n.run serves mokosh-server over anonymous HTTPS, which needs no credentials at all. Verified before writing code: `git ls-remote` succeeds with an empty HOME, and `cargo fetch` against the HTTPS URL succeeds inside the rust-builder-glibc image the gate and CI use. So this change adds the dependency over HTTPS and does the adoption the issue actually asks for.

`src/modules/contacts` and `src/modules/time_tracking` are now one-line re-exports of `mokosh_types::contacts` and `mokosh_types::time_tracking`. Their `models.rs` hand copies are deleted, and so are the `routes.rs` / `service.rs` files beside them: those were byte-copies of server handlers gated behind a `server` feature that cannot compile here at all, since this crate depends on neither axum nor sqlx. Each module keeps a test that converts the shared type to the re-exported name through an identity `fn`, so re-introducing a hand copy fails to compile rather than silently drifting again.

The issue's usage counts do not match this repo: the SPA had zero references to the time_tracking types and exactly one to contacts (`Address` in pages/contacts.rs). Everything else reads purpose-built subset structs, the same pattern MAPPS-378 preserved for tickets. The two divergences that do reach real code are fixed. `RemoteTimeEntry.billing_status` is now `mokosh_types:🎟️:BillingStatus` instead of `String`, so an unrecognized wire tag fails decoding instead of rendering; the row also stops printing the raw tag ("ready_to_bill") and gets a label. `CompanyType::Internal` now has a title-case arm in `humanize_company_type`, and the company form preserves a non-customer-facing type as its own option so editing an internal company cannot silently retype it to Client, mirroring the existing `state_options` idiom in the same file. The week-level `approval_status` stays `String` because the shared `TimesheetSummaryResponse` types it as `String` too.

Note for the reviewer: auth, tenants, and tickets are still hand-copied under `src/modules/<module>/models.rs`. They are out of scope here and want their own issue now that the HTTPS transport is proven.

Gate green via `just pre-commit`: fmt --check, clippy --all-targets -D warnings, cargo check --target wasm32-unknown-unknown, cargo test --lib (240 passed, 0 failed; was 232).

#MAPPS-383
Claude-Run deleted branch feat/MAPPS-383-adopt-mokosh-types-contacts-time 2026-08-01 02:26:55 +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!457
No description provided.