Skip to content

[7183] Generate the JSON for the report#2

Draft
TechiRexach wants to merge 6 commits intomainfrom
7183-ftf-generate-the-json-for-the-report
Draft

[7183] Generate the JSON for the report#2
TechiRexach wants to merge 6 commits intomainfrom
7183-ftf-generate-the-json-for-the-report

Conversation

@TechiRexach
Copy link

@TechiRexach TechiRexach commented Mar 3, 2025

@TechiRexach TechiRexach self-assigned this Mar 3, 2025
@TechiRexach TechiRexach changed the title First approach [7183] Generate the JSON for the report Mar 3, 2025
# Data register 10 (product) ADD
{
"action": "A",
"type": "01", # cuenta corriente
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will probably never have other products, but I'm okay with passing them explicitly as they leave the door open.

Comment on lines 82 to 90
# Data register 30 (relationship product-holder) MODIFY
"relationships": [
{
"action": "M",
"type": "AUT", # New relationship
"created_at": "20250301",
"previous_type": "TIT" # Previous relationship
}
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if we will ever allow account holders with a type different than TIT, so it's still in the air if this will ever be used, but again, I'm ok with overspecifying to cover all potential scenarios.

Comment on lines 95 to 132
"holders": [
# Data register 20 - MODIFY holders data only (NO relationships)
{
"action": "M",
"name": "Aitor Garcia Rey",
"id_type": "01",
"id": "22754545R",
"country": "ES",
"created_at": "19790513",
"names": [
# Data register 21 - Changing / adding holder's name (type X only in complementary files)
{
"action": "A",
"name": "Aitor Perez", # New name to ADD
},
{
"action": "M",
"name": "Alberto Molpeceres", # New name that MODIFY the previous one
},
],
"ids": [
# Data register 22 - Changing / adding holder's identifier (type X only in complementary files)
{
"action": "A",
"id_type": "02", # Passport
"id": "ABC123456", # Passport ADDED to holder
"country": "ES"
},
{
"action": "M",
"id_type": "01", # DNI
"id": "12345678P", # New DNI (from NIE to DNI for example)
"country": "ES"
},
]
}
]
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What worries me more about the holders' declaration is that our system doesn't have "general" holders per se.

So, if the holder of account A in Company Alpha changes its name, we should report it here. But if the same company or person also holds account A in Company Beta, we will, by default, report it twice in this block, as if they were different people, while we should report it just once.

Anyway, that seems to be a problem for Devengo Payments, so I'm ok with this as a broad structure.

However, one change we have to make is the country. The field in my initial PoC was an oversimplification, but for holders, we need separate countries:

https://github.com/devengoapp/ftf/blob/main/lib/ftf/generator.rb#L71-L74

        expedition_country: holder.country.to_s.rjust(2, " "),
        nationality_country: holder.country.to_s.rjust(2, " "),
        residence_country: holder.country.to_s.rjust(2, " "),

Please cf. pages 34 and 35 of the official documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants