Laragear / Rut

Gracefully handle RUTs from within your Laravel application
https://patreon.com/packagesforlaravel
MIT License
6 stars 0 forks source link

Support for RUT over 100 million #25

Closed noquierouser closed 11 months ago

noquierouser commented 11 months ago

Please check these requirements

Description

According to the guidelines of the Ministry of Education, since 2016, migrant students awaiting regularization are assigned a RUT over 100 million. This RUT is temporary and allows them access to services provided by the ministry, known as the Temporary School Identifier (Identificador Provisorio Escolar, IPE).

A few months ago, I had to implement a system that registers children. There were a couple of cases with RUTs over 100 million, which the system considered invalid.

This would entail:

Code sample

$rut = Rut::parse('100.765.432-5');

$rut->isValid(); //returns true

$rut->isPerson(); //returns true
$rut->isCompany(); //returns false

$rut->isTemporary(); //returns true
$rut->isDefinitive(); //returns false
DarkGhostHunter commented 11 months ago

I will work on this once I have time early next month, unless there is a PR before it put my hands on this enhancement.

About the generator, it would also be to be updated so it's able to generate over 100M numbers.

I think that raising the validity to 200M would be enough, since I don't know exactly how is the pace of RUT assignations.

noquierouser commented 11 months ago

Based on what I've been able to find, the occupancy rate of RUTs is quite low. I couldn't locate official documents, only these journalistic notes (La Nación, Publimetro) that report on both the usage rate and the RUT assignment ranges.

I spent hours searching for an official document that indicates the assignment ranges of the RUTs, but I could only find some references to Resolutions from the SII on the matter:

DarkGhostHunter commented 11 months ago

From what you shared:

This package should follow suit.

DarkGhostHunter commented 11 months ago

Update! Version 2.0 coming out. Breaking change, most notably are the RUT types boundaries:

In other words, a RUT 54.XXX.XXX no longer will be validated as "person", but for "contingency", since these are reserved for special reasons.

DarkGhostHunter commented 11 months ago

Fixed on v2.0.0