opcn1214-generator: parse.derivedMismatch rejects a valid file with bank codes 277/278 but no 280
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend
Research direction
Start with packages/opcn1214-generator/src/validate/parse-rules.ts and trace derivedMismatches, then read the bank account parsing and generation paths in packages/opcn1214-generator. Run the parser and round-trip tests for codes 277, 278, and 280; add coverage for 277/278 without 280 and 280 without 277/278. Done means the specified behavior is decided and tested, and the unchanged-account case round-trips to identical bytes.
Written by the indexing model from the issue text.
Description
Problem
packages/opcn1214-generator/src/validate/parse-rules.ts:147-152 (parse.derivedMismatch) compares each derived code of a parsed 1000 record with the value the generator would write. That is wrong for code 280. Code 280 isn't derived from 277/278. It is the filer's mark that the bank account changed:
- PDF p.20, code 280: "מקבל ערכים: 1 (במקרה ששונה חשבון הבנק וצורפה אסמכתא מתאימה)". It is filled when the account changed and a supporting document is attached.
- PDF p.19, on 277/278: "רק אם שדה 280 מלא, נלקחים הערכים שמולאו בקודים 277 278, אחרת פרטי חשבון בנק נלקחים מהתל"ם". Without 280, SHAAM takes the account from its own records.
So a file with 277/278 and no 280 is valid, and other software could easily write one. parse1214 throws on it: "Code 280 of record 1000 is absent; derived from the file it is 1."
Repro:
- Generate
minimalInput({ bankAccount: { bank: '12', branch: '345', account: '123456' } }). - Remove the 280 pair from the 1000 code section: shift the rest left and pad with
0.
Before H1 (#5073) this file parsed; now parse1214 throws. The reverse case, 280 = 1 with no 277/278, parses with no issue.
A related case: a 277 longer than 9 digits (p.19 allows at most 9) produces three mismatches, on 277, 278 and 280. The main.bankAccount.format notice that would explain them is dropped.
The input model has the same gap
denormalize (from D3, #5058) builds a bankAccount whenever any of 277/278/280 is present, and reads missing codes as zeros. So:
- 280 = 1 on its own parses to the account
000000000, with no issue; - 277/278 without 280 regenerates with 280 = 1. That changes the file's meaning: it asks SHAAM to replace the account it has.
bankAccount has no way to say "account details given, no change requested".
Fix
-
In
derivedMismatches, skip an absent 280 but still flag any 280 other than 1. The existing "a bank code 280 other than 1" test still passes with this change:for (const code of codes) { const actual = record.codes.get(code); const wanted = expected.codes.get(code); // 280 marks a changed bank account (p.20); without it SHAAM takes the account from its own // records and ignores 277/278 (p.19), so a file may hold 277/278 and no 280. if (actual === wanted || (code === '280' && actual === undefined)) { continue; } -
Let the input model express "account given, unchanged", for example with an explicit flag on
bankAccountthat drives 280. Then parse → generate keeps such a file byte for byte. -
Decide whether 280 = 1 without 277/278 should be reported, instead of becoming an all-zero account.
Done when
- A file with 277/278 and no 280 parses with no issue.
- That file round-trips (parse → generate) to the same bytes.
- 280 = 1 without 277/278 has a decided, tested behaviour.
Raised in the review of #5073 (H1). The input-model part belongs to D3 (#5058). Neither was posted before the PRs merged. Re-checked on main at 31245bc7f.
- Dominant language
- TypeScript
- Stars
- 30
- Forks
- 10
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 276
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Urigo/accounter-fullstack
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Urigo/accounter-fullstack#5302 ·
Maintainers usually reply within 2 days
-
1214 annual-audit-workflow
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Urigo/accounter-fullstack#5257 ·
Maintainers usually reply within 2 days
-
1214 annual-audit-workflow
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Urigo/accounter-fullstack#5256 ·
Maintainers usually reply within 2 days
-
annual-audit-workflow
Difficulty 1/5 1-3 hours Newbie friendliness 87/100
Urigo/accounter-fullstack#5252 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Urigo/accounter-fullstack#4919 ·
Maintainers usually reply within 2 days
All issues in Urigo/accounter-fullstack
Similar issues
-
area: integrations documentation priority: P2 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eddiejaoude/StackDash#798 ·
Maintainers usually reply within 1 day
-
bot:ai-assisted component:midnight-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
midnightntwrk/midnight-js#1790 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
area:vscode bug has repro platform:macos platform:vscode regression
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDOpencheck:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 77/100
Maintainers usually reply within 1 day