Skip to content

RR-T50 Fixing Call Field Support, Call Number Support - #156

Merged
ucswift merged 1 commit into
masterfrom
develop
Oct 8, 2026
Merged

ucswift merged 1 commit into
masterfrom
develop

Conversation

@ucswift

@ucswift ucswift commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Create and edit calls with external, incident, and reference IDs, and schedule dispatch for a future time.
    • Call forms now reflect required fields, validate entries before saving, and identify fields rejected by the server.
    • Edit call locations using coordinates, what3words, plus codes, or the map, with clearer feedback for invalid entries.
  • Improvements
    • Time reports now display their issued report numbers, with consistent formatting for document numbers.
    • Photo attachment filenames are made safer for work-order numbers containing special characters.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 0a911f1d-e7d4-49a8-8069-1abe35ee6db1
📥 Commits

Reviewing files that changed from the base of the PR and between 5f7742e and e58ba8c.

📒 Files selected for processing (25)
  • src/api/calls/__tests__/saveCall.test.ts
  • src/api/calls/calls.ts
  • src/app/(app)/work-orders/[id].tsx
  • src/app/call/[id]/__tests__/field-policy.test.tsx
  • src/app/call/[id]/__tests__/save-submit-guard.test.tsx
  • src/app/call/[id]/edit.tsx
  • src/app/call/new/__tests__/field-policy.test.tsx
  • src/app/call/new/index.tsx
  • src/components/operations/scope-picker.tsx
  • src/components/operations/time-report-editor.tsx
  • src/lib/__tests__/call-field-policy.test.ts
  • src/lib/call-field-policy.ts
  • src/lib/operations/__tests__/time.test.ts
  • src/lib/operations/time.ts
  • src/models/v4/operations/index.ts
  • src/translations/ar.json
  • src/translations/de.json
  • src/translations/el.json
  • src/translations/en.json
  • src/translations/es.json
  • src/translations/fr.json
  • src/translations/it.json
  • src/translations/pl.json
  • src/translations/sv.json
  • src/translations/uk.json

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour. Your free on-demand review promotion remains active until October 9, 2026 at 6:00 PM UTC.


📝 Walkthrough

Walkthrough

Call creation and editing now apply field policies to form visibility, required fields, validation, and submission. Both flows support call identifiers and scheduled dispatch times. Time-report views format report numbers using display numbers when available. Work-order photo filenames sanitize work-order numbers.

Changes

Call Field Policy and Scheduling

Layer / File(s) Summary
Shared policy and API behavior
src/lib/call-field-policy.ts, src/lib/__tests__/call-field-policy.test.ts, src/api/calls/calls.ts, src/api/calls/__tests__/saveCall.test.ts, src/translations/*.json
Shared helpers handle policy labels, geolocation, schedule validation, pending states, and missing-field errors. Call API payloads support identifiers and optional dispatch times. Tests and translations cover these shared behaviors.
Policy-driven call creation
src/app/call/new/index.tsx, src/app/call/new/__tests__/field-policy.test.tsx
The new-call form follows field visibility and requiredness rules, validates schedules, and submits identifiers and optional UTC dispatch times. Tests cover rendering, validation, submissions, and errors.
Policy-driven call editing
src/app/call/[id]/edit.tsx, src/app/call/[id]/__tests__/field-policy.test.tsx, src/app/call/[id]/__tests__/save-submit-guard.test.tsx
The edit form follows field policy, preserves applicable hidden values, supports location lookups, and handles scheduled dispatch updates. Tests cover the policy and save behavior.

Time Report Number Display

Layer / File(s) Summary
Report number formatting
src/models/v4/operations/index.ts, src/lib/operations/time.ts, src/lib/operations/__tests__/time.test.ts, src/components/operations/scope-picker.tsx, src/components/operations/time-report-editor.tsx
Time reports can include an optional display number. Report views use it when present and otherwise fall back to the report number. Digit-only document numbers receive a # prefix.

Work-Order Photo Filename

Layer / File(s) Summary
Sanitize photo filename
src/app/(app)/work-orders/[id].tsx
The work-order number is sanitized before it is appended to the photo filename.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant NewCall
  participant EditCall
  participant CallFieldPolicy
  participant CallsAPI
  NewCall->>CallFieldPolicy: Validate policy fields and dispatch time
  EditCall->>CallFieldPolicy: Validate policy fields and dispatch time
  NewCall->>CallsAPI: createCall with identifiers and optional DispatchOnUtc
  EditCall->>CallsAPI: updateCall with identifiers and optional DispatchOnUtc
Loading

Merge Risk: ⚪ Minimal · up to e58ba

No confirmed issue blocks merging after normal checks. The effect of blank identifiers on the server remains unverified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 15 files. (10 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately identifies the two main changes: call field support and call number support.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 15 files. (10 skipped: 10 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@ucswift

ucswift commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

Approve

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is approved.

@ucswift
ucswift merged commit 16d85f4 into master Oct 8, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant