bysquare icon indicating copy to clipboard operation
bysquare copied to clipboard

feat: add data model validation

Open xseman opened this issue 2 years ago • 1 comments

xseman avatar Nov 03 '23 08:11 xseman

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Dec 04 '23 01:12 github-actions[bot]

  • is the usage of 3rd party libraries welcomed (f.e. for validation of IBAN)?
  • should the validation be arbitrary (configurable) or built-in?

lukasbicus avatar Aug 05 '24 11:08 lukasbicus

I'm going to implement this.

lukasbicus avatar Aug 06 '24 11:08 lukasbicus

After a moment of consideration, it makes sense for the first iteration to optionally validate ISO standards that have a strict format. This would be especially useful for applications that consume the generated code and are limited to serialization for ISO standards (banks mobile applications).

To start, we can focus on checking three types of information:

  • CurrencyCode (ISO 4217)
  • CountryCode (ISO 3166)
  • PaymentDueDate (ISO 8601)
  • bic (ISO 9362)
  • iban (ISO 13616:2003)

Maybe there are more fields with standards? @LukasBicus, could you take a look and see if I missed any? It seems like validator.js might be a good option for this task, since it supports all the standards I've identified so far.

xseman avatar Aug 13 '24 10:08 xseman

validator.js will be a great choice. I checked the references section of specification_v1.1.0.pdf. I will be a little more specific - the ISO 3166­1 alpha­3 will be used for country code validation (for example SVK).

I found no more ISO standards in the document.

lukasbicus avatar Aug 14 '24 06:08 lukasbicus