Skip to content

Add job SFN and account to reports, and move job code classification to Data Classification - #138

Merged
rmartinsen-ucd merged 12 commits into
mainfrom
rpm/job-sfn-and-job-code-classification
Nov 25, 2026
Merged

rmartinsen-ucd merged 12 commits into
mainfrom
rpm/job-sfn-and-job-code-classification

Conversation

@rmartinsen-ucd

@rmartinsen-ucd rmartinsen-ucd commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The "Not associated" tables on the 201, 202, 204, 205 and 220 tabs show Fund SFN, Job SFN and Account, in the table and the CSV.
  • Pre-association totals are grouped by job SFN as well, with Fund SFN, Fund SFN label and Job SFN columns.
  • data.ExpenseSummary has an Account column and BuildAutoAssociations groups by it. There are more summary rows and the dollar totals are unchanged.
  • FTE methodology change: the build keeps a summary row that has dollars or FTE. It used to drop every row whose dollars netted to zero, and its FTE with it. A kept row can have 0 dollars.
  • Data Classification has a seventh tab, Job Code, that lists every job code on reported payroll with a dropdown of FTE lines. Saving writes the staff type to data.Titles.
  • Unassigned job codes that carry reported dollars and FTE show a badge and block Continue. The server refuses to complete the stage too.
  • The Auto-Associations stage shows when the build ran and has a "Rebuild auto-associations" button with a confirmation. A rejected rebuild leaves the previous build in place.
  • The "Unmatched job codes" tab in Expense Review is removed along with its endpoint. The Job Code tab replaces it.

Changes after review

  • The build keeps FTE on rows whose dollars net to zero (see the FTE methodology change above). The job code gate uses the same rule, so a job code blocks when a row reports FTE or has 13U02 dollars. On the current cycle the only row with 0 dollars and FTE comes from rounding.
  • Every segment save, ERN included, reloads job codes and stays pending until they arrive, so Continue stays disabled meanwhile.
  • A rebuild cancels running report reads before reloading them.
  • Continue is disabled until a rebuild and its report reload finish, and Rebuild is disabled while completion is pending. This holds after leaving and reopening the stage.
  • A job code dropdown is locked while its save runs.
  • Assigning a job code no longer clears the Expense Review filter cache or reloads Expense Review.
  • Job code and auto-association reads forward the abort signal, so a cancelled read stops on the server.

Notes for review

  • Account is the last column of ExpenseSummary so publishing alters the table in place. It is blank on existing builds until someone clicks Rebuild or completes OrgR Review.
  • The job code query reads every included payroll row in the cycle. It runs when Data Classification loads, after each job code save and when the stage is completed. It has not been timed against a real cycle. If it is slow on ad419-test, the gate query can be narrowed to unassigned codes.
  • The rebuild runs inside the request, like the build on OrgR Review completion.
  • This will conflict with Report PI payroll on FTE line 241 instead of 242 #136 in ExpenseReviewService.cs, AutoAssociationReportService.cs, autoAssociationsTabs.ts and AutoAssociationsStage.tsx. The unmatched job codes query that Report PI payroll on FTE line 241 instead of 242 #136 edits is gone here. Its replacement is in JobCodeClassificationService.cs.

Not handled here

  • A rebuild after Manual Associations stores work would change expense IDs. The button will need a guard when that stage stores data.
  • Two rebuilds at the same time.
  • The assign endpoint accepts any 1 to 4 character job code, on payroll or not.

Test plan

  • Server tests, including the SQL integration tests (633 pass)
  • Client tests (260 pass), lint, type check and build
  • Publish the DACPAC to ad419-test and time GET /api/jobcodeclassifications on a real cycle
  • Assign a job code on the Job Code tab and confirm the badge clears and Continue unlocks
  • Rebuild auto-associations and confirm Account and Job SFN fill in on the SFN tabs

🤖 Generated with Claude Code

rmartinsen-ucd and others added 9 commits November 17, 2026 11:35
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Job codes are assigned on the Job Code tab of Data Classification now.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Also pin that a rejected rebuild leaves the previous build in place.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1f4582ed-873e-48bb-a6c4-24f666db01c5
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment thread client/src/queries/autoAssociations.ts Resolved
Keep FTE on expense summary rows whose dollars net to zero. The build
drops a row only when it has neither dollars nor FTE, and the job code
gate follows the same rule.

Reload job codes after every segment save, cancelling a read that is
still running so it cannot stand in for the reload.

Cancel running report reads before reloading after a rebuild.

Disable Continue during a rebuild and Rebuild during completion. The
rebuild state is read by mutation key so it survives leaving the stage.

Lock a job code dropdown while its save is running.

Stop clearing the Expense Review filter cache when a job code is
assigned. A job SFN is not part of the inclusion rule.

Forward the abort signal on job code and auto-association reads.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@rmartinsen-ucd rmartinsen-ucd mentioned this pull request Nov 19, 2026
2 of 4 tasks
rmartinsen-ucd and others added 2 commits November 19, 2026 09:59
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Keeps the PI FTE to 241 tab from main. The unmatched job codes tab and
its query stay removed, since job code classification now lives in Data
Classification.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@sprucely sprucely left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A few more issues were identified...

Comment on lines 314 to 316
JOIN [data].[Titles] ti ON ti.[TitleCode] = e.[JobCode]
JOIN [data].[StaffTypes] st ON st.[StaffTypeCode] = ti.[StaffTypeCode]
WHERE e.[FteSfn] = '241' AND st.[FteSfn] = '242'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] Preserve the PI adjustment recorded by the build

The report compares the build’s stored FTE line with the job code’s current title mapping. After a build puts a non-PI on line 241, changing that job code to 242 makes the report list the employee as a 242-to-241 PI adjustment. The reverse edit can hide a genuine adjustment. Capture the original title line or adjustment flag during the build and use it to select report rows.

Comment on lines +163 to +165
onSuccess: async () => {
await queryClient.cancelQueries({ queryKey: ['autoAssociations'] });
await queryClient.invalidateQueries({ queryKey: ['autoAssociations'] });

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] Prevent exports from using the previous build’s rows

I opened tab 204, switched to 201, rebuilt, and returned to 204 after the new timestamp appeared and Continue was enabled. Export produced a CSV containing the old 204 rows while the replacement request was running. Invalidation retains inactive tabs’ cached data. Key the reports by build ID or discard the previous build’s rows before enabling export.

Comment on lines +60 to +62
export async function reloadJobCodeClassifications(queryClient: QueryClient) {
await queryClient.cancelQueries({ queryKey: JOB_CODE_CLASSIFICATIONS_KEY });
await queryClient.invalidateQueries({ queryKey: JOB_CODE_CLASSIFICATIONS_KEY });

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P3] Keep Continue disabled when a segment save finishes off-page

I classified the last fund, left Data Classification while the save was pending, and returned after it succeeded. The cached Job Code list was empty, so Continue sent the completion request before the refreshed list revealed a blocking code. Remove the inactive cached result after a segment save, or keep Continue disabled until the refreshed list arrives.

</span>
<button
className="btn btn-sm"
disabled={rebuilding || continueMutation.isPending}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P3] Keep Rebuild disabled across navigation during completion

After clicking Continue, I left Auto-Associations and returned while its completion request was pending. Both buttons were enabled. I could start a rebuild, then the original completion navigated to Manual Associations while that rebuild was still running. Track the completion mutation by key across mounts, as the stage already does for rebuilds.

Comment on lines +100 to +102
{rebuildMutation.isError ? (
<div className="alert alert-error" role="alert">
<span>{apiErrorMessage(rebuildMutation.error, 'Could not rebuild auto-associations.')}</span>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P3] Show a rejected rebuild after returning to the stage

I started a rebuild, left the stage, and returned before the server rejected it. The Rebuilding indicator cleared and Continue became available with the old timestamp, but the rejection message never appeared. The error display reads the newly mounted mutation observer. Read the latest rebuild outcome from shared mutation state so the reviewer sees the failure.

@rmartinsen-ucd
rmartinsen-ucd merged commit 86ce3e5 into main Nov 25, 2026
5 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.

2 participants