Repository navigation
feat: tell people and employers apart - #66
Merged
Merged
Conversation
Each payslip now carries its person, by the codice fiscale and the name it encodes, and its employer, by its fiscal code or VAT number and its name (ADR 0010, now accepted). The report is built per person: one person's name sits at the top, and payslips of several people make a report each, chosen with buttons at the top, in the web app and in the downloaded report alike. The page's script starts again for the person chosen, its listeners on the page ending with the person they were added for. A month is compared only with the previous one of the same person and employer, in the report and in the CLI's compare. When a person has several employers, each month names its employer, and the month picker does when a month has two payslips. The synthetic payslips can print an invented, check-valid fiscal code and VAT number (synth -person, -employer); only the first fifteen characters of a code are in the source.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements ADR 0010, included here and now Accepted. Until now the report assumed every payslip belonged to one person with one employer. When it got payslips of two people, or of one person who changed job, it mixed them: identical labels in the month picker, and comparisons between unrelated payslips.
Reading
internal/pii.Report
<template>s. The script now runs in aninit(signal): on a switch, the person's DOM is replaced andinitruns again. Page-level listeners carry anAbortSignal, so they end with the person they were added for.insights.Previous, used by both the report and the CLI'scompare. Deduplication also keys on person and employer.Synthetic payslips
synth -person "ROSSI MARIO" -employer "ALFA SRL"prints an invented, check-valid codice fiscale and VAT number.Type of change
Checklist
CHANGELOG.mdupdated underUnreleasedfor user-visible changesNotes for the reviewer
Tests
party_test.go:TestPreviousOfSameEmployercovers the comparison rule.TestPeoplecovers grouping, display names, the masked code, a payslip without a code, and employer labels.Checks
mainon a set of real payslips kept off the repository: identical apart from the new fields. Person and employer were read correctly on all of them, across four payroll layouts.go test -race, piiscan, the web unit tests and the 13 e2e tests in Chromium all pass. WebKit runs in CI.