Repository navigation
6.5.0
CFONB 120 and 240 files are now checked for record order and valid dates: files that 6.4 parsed into wrong data now throw a ParseException. Read the upgrade note below before upgrading.
Upgrade note
6.5 rejects files that 6.4 accepted. The record order of CFONB 120 and 240 files and the dates are now checked, in
strict and non-strict mode alike: a file whose records are out of order, or that holds a zero-filled or out-of-range
mandatory date, now throws a ParseException where 6.4 returned wrong data silently. $strict = false does not restore
the 6.4 behaviour. Before upgrading, parse a sample of the files you receive with 6.5 and catch ParseException: the
troubleshooting guide lists the new messages.
Changed
Files that parsed with 6.4 can now throw a ParseException: every case below used to return wrong data silently.
- A zero-filled date (
000000) now throwsUnable to parse date "000000": the date is zero-filled (empty), but this field is mandatory, in strict and non-strict mode alike. Some banks write a date they do not have, e.g. the value date of an operation, as zeros: 6.4 read it as 30 November 1999. The CFONB 120 dates, the value date included, are mandatory, so their getters stay non-nullable: fix the file, or replace the date before parsing it. The CFONB 240 initial transaction settlement date, the only optional date, isnullinstead (see Fixed) - An out-of-range date (e.g. day 32 or month 13) now throws a
ParseExceptioninstead of overflowing into the next month - CFONB 120: the records of a statement must come in the order
01old balance,04operations with their05details,07new balance, in strict and non-strict mode alike. 6.4 paired the balance lines by their order, not by their code, so a07before any01became the old balance of a statement; it now throws, as does a04operation before any01(6.4 added it to the next statement), a01while a statement is still open (6.4 made it the new balance) and a statement still open at the end of the file (6.4 dropped it) - CFONB 240: a
34or39record after a39total and before the next31header now throws aParseExceptioninstead of being attached to the closed transfer - CFONB 240: a
31header while a transfer is still open, or a transfer still open at the end of the file, now throws aParseExceptioninstead of the transfer being dropped
Fixed
- CFONB 120: an amount with 0 decimals (position 20) is now parsed as an integer instead of a garbage value
- CFONB 240: a
34or39record before any31header now reports the missing header - CFONB 240: a zero-filled initial transaction settlement date (
000000) is nownull, like a blank one, instead of 30 November 1999
Added
- Support
\r(classic Mac OS) line endings
What's Changed
- chore: bump dev tools floors (Rector config and code already up to date) by @guillaume-sainthillier in #369
- fix(parser): reject out-of-range dates and stray CFONB 240 records, fix 0-decimal amounts by @guillaume-sainthillier in #371
- docs: add the documentation site on cfonb-parser.silarhi.dev by @guillaume-sainthillier in #370
- fix(deps): update dependency @silarhi/docs-kit to ^0.6.0 by @guillaume-sainthillier in #372
- fix(parser): validate the record sequence of CFONB 120 and 240 files, explain zero-filled dates by @guillaume-sainthillier in #373
- docs: fix documentation drift and document the unreleased 6.5 by @guillaume-sainthillier in #374
- chore(release): 6.5.0 by @guillaume-sainthillier in #375
Full Changelog: 6.4.2...6.5.0