Skip to content

Release v0.0.8

Choose a tag to compare

@github-actions github-actions released this 09 Jan 08:56
· 290 commits to main since this release

Version 0.0.8: Optional Postal Address Support

Features:

  • Optional postal address support for creditor and debtor
  • Addresses included in XML only if provided
  • Support for camelCase and snake_case formats
  • Empty arrays ignored
  • Comprehensive test coverage

Breaking Changes: None
Migration: No action required

Changelog

Added

  • Postal Address Support (Optional): Added support for exporting creditor and debtor postal addresses in the generated XML
    • Addresses are completely optional - only included if provided in the array
    • Addresses are included using structured format (PstlAdr) with elements: StrtNm, TwnNm, PstCd, and Ctry
    • Addresses are automatically added to XML using DOM manipulation after generation
    • Both DirectDebitData and DirectDebitTransaction support address fields
    • Addresses can be set via object methods (setCreditorAddress(), setDebtorAddress()) or array input (both camelCase and snake_case)
    • Support for creditorAddress and debtorAddress in generateFromArray() method
    • Support for creditor_address and debtor_address in snake_case format
    • Support for individual address fields: creditor_street, creditor_city, creditor_postal_code, creditor_country, debtor_street, debtor_city, debtor_postal_code, debtor_country
    • Updated setCreditorAddress() and setDebtorAddress() methods to accept arrays directly
    • Empty address arrays are ignored and will not create address elements
    • At least one address field must be provided for the address to be included in XML
    • Updated documentation to reflect address support and optional nature

Changed

  • Updated DEPRECATED_FIELDS.md to clarify that addresses are now supported (as of v0.0.8)
  • Updated README examples to show address usage and clarify that addresses are optional
  • Address methods now accept arrays directly as first parameter for better usability

Test Coverage

  • Added 8 new tests for address functionality:
    • testGenerateXmlWithCreditorAddress() - Tests creditor address with object methods
    • testGenerateXmlWithDebtorAddress() - Tests debtor address with object methods
    • testGenerateXmlWithBothAddresses() - Tests both addresses together
    • testGenerateFromArrayWithCreditorAddressSnakeCase() - Tests creditor address in snake_case
    • testGenerateXmlWithoutAddresses() - Tests that addresses are not included when not provided
    • testGenerateXmlWithEmptyAddressArray() - Tests that empty address arrays are ignored
    • Updated testGenerateXml() - Verifies no address elements when addresses are not provided
    • Updated testGenerateFromArrayWithAddresses() - Enhanced assertions for address elements
    • Updated testGenerateFromArrayWithAddressesSnakeCase() - Enhanced assertions for address elements