style(tests): rustfmt wrap on hash_password call #56
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pms-124-fmt-wrap"
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?
Post-merge
cargo fmt --all --checkonmain(kicked off by the PMS-124 merge in #55) failed ontests/common/mod.rs:110-111. rustfmt wants the assignment wrapped instead of the method chain. Pure formatting fix, no behavior change.#PMS-124
custom_fields: {}on create ticket, surface error bodyCI integration run hit "create ticket should 2xx, got 500 Internal Server Error" on the tickets lifecycle test. `CreateTicketRequest.custom_fields: serde_json::Value` defaults to `Value::Null`, which sqlx encodes as SQL NULL on the bind. The `tickets.custom_fields` column is `JSONB NOT NULL DEFAULT '{}'`, so the INSERT failed the NOT NULL constraint and the handler turned it into a 500. Send `custom_fields: {}` explicitly from the test body so the bind writes an empty JSONB object. While here, capture the response text before the status check so the next failure mode shows the actual error body in the panic message instead of just the status code. The host-side fix would be to default `CreateTicketRequest.custom_fields` to `serde_json::json!({})` (or wrap it in `Option`) in `src/modules/tickets/models.rs`. PMS-124's scope is just the test harness, so keep that change for a follow-up. #PMS-124 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>`TicketService::calculate_sla_dates` queried `sla_targets.first_response_hours` and `sla_targets.resolution_hours` as `(Option<f64>, Option<f64>)`, but the schema declares both columns as `DECIMAL(10, 2)`. sqlx refused to decode NUMERIC into `f64` and returned `ColumnDecode { Rust type Option<f64> is not compatible with SQL type NUMERIC }`, which got swallowed by the generic `Database operation failed` error message. End result: every ticket create against a tenant that had any default SLA policy seeded (i.e. every tenant created from migration 002) failed with a 500 once the post-INSERT SLA-calculation step ran. Cast the two columns to `float8` in the SQL projection so the existing `Option<f64>` decode shape keeps working. No type or behavior change in the calling code, which already multiplies the hours by 60.0 in floating point. Caught by the new `tests/tickets.rs` integration test wired up in PMS-124 #56. #PMS-124 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>