Skip to content

Commit

Permalink
feat: Add more paper data in autofill
Browse files Browse the repository at this point in the history
Numéro de passport
Numéro de carte vitale
Numéro de titre de séjour
Numéro de carte grise
Code ANTS
Plaque d'immatriculation
IBAN
BIC
Salaire brut
Salaire net
Numéro fiscal
Revenu fiscal de référence
  • Loading branch information
zatteo committed Aug 23, 2024
1 parent 780cc93 commit b119a1b
Show file tree
Hide file tree
Showing 8 changed files with 814 additions and 0 deletions.
83 changes: 83 additions & 0 deletions apps/browser/docs/T08.0-Identity-with-paper-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,95 @@ <h2>Identity form with paper data</h2>
<input placeholder="Nom de famille" required="required" type="text" value="" id="name">
</div>

<div class="editable-champ editable-champ-text" >
<label for="passeport">Numéro de passeport
</label>
<input placeholder="Numéro de passeport" required="required" type="text" value="" id="passeport">
</div>

<div class="editable-champ editable-champ-text" >
<label for="nir">Numéro de sécurité sociale
</label>
<input placeholder="Numéro de sécurité sociale" required="required" type="text" value="" id="nir">
</div>

<div class="editable-champ editable-champ-text" >
<label for="numCni">Numéro de carte d'identité
</label>
<input placeholder="Numéro de carte d'identité" required="required" type="text" value="" id="numCni">
</div>

<div class="editable-champ editable-champ-text" >
<label for="numCarteSejour">Numéro du titre de séjour
</label>
<input placeholder="Numéro du titre de séjour" required="required" type="text" value="" id="numCarteSejour">
</div>

<br>
Votre voiture
<br>

<div class="editable-champ editable-champ-text" >
<label for="numCarteGrise">Num carte grise
</label>
<input placeholder="Num carte grise" required="required" type="text" value="" id="numCarteGrise">
</div>

<div class="editable-champ editable-champ-text" >
<label for="codeAnts">Code ANTS
</label>
<input placeholder="Code ANTS" required="required" type="text" value="" id="codeAnts">
</div>

<div class="editable-champ editable-champ-text" >
<label for="licensePlate">Plaque d'immatriculation
</label>
<input placeholder="Plaque d'immatriculation" required="required" type="text" value="" id="licensePlate">
</div>

<br>
Votre compte bancaire
<br>

<div class="editable-champ editable-champ-text" >
<label for="iban">IBAN
</label>
<input placeholder="IBAN" required="required" type="text" value="" id="iban">
</div>

<div class="editable-champ editable-champ-text" >
<label for="bic">BIC
</label>
<input placeholder="BIC" required="required" type="text" value="" id="bic">
</div>

<br>
Vos finances
<br>

<div class="editable-champ editable-champ-text" >
<label for="taxNumber">Numéro fiscal
</label>
<input placeholder="Numéro fiscal" required="required" type="text" value="" id="taxNumber">
</div>

<div class="editable-champ editable-champ-text" >
<label for="grossSalary">Rémunération brute
</label>
<input placeholder="Rémunération brute" required="required" type="text" value="" id="grossSalary">
</div>

<div class="editable-champ editable-champ-text" >
<label for="netSalary">Montant net social
</label>
<input placeholder="Montant net social" required="required" type="text" value="" id="netSalary">
</div>

<div class="editable-champ editable-champ-text" >
<label for="RevenuFiscalRef">Revenu fiscal de référence
</label>
<input placeholder="Revenu fiscal de référence" required="required" type="text" value="" id="RevenuFiscalRef">
</div>
</form>

</body>
Expand Down
12 changes: 12 additions & 0 deletions apps/browser/src/autofill/enums/autofill-field.enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ export const AutofillFieldQualifier = {
identityUsername: "identityUsername",
// Cozy customization
paperIdentityCardNumber: "paperIdentityCardNumber",
paperPassportNumber: "paperPassportNumber",
paperSocialSecurityNumber: "paperSocialSecurityNumber",
paperResidencePermitNumber: "paperResidencePermitNumber",
paperVehiculeRegistrationNumber: "paperVehiculeRegistrationNumber",
paperVehiculeRegistrationConfidentialCode: "paperVehiculeRegistrationConfidentialCode",
paperVehiculeRegistrationLicensePlateNumber: "paperVehiculeRegistrationLicensePlateNumber",
paperBankIbanNumber: "paperBankIbanNumber",
paperBankBicNumber: "paperBankBicNumber",
paperGrossSalaryAmount: "paperGrossSalaryAmount",
paperNetSalaryAmount: "paperNetSalaryAmount",
paperTaxNoticeNumber: "paperTaxNoticeNumber",
paperTaxNoticeRefTaxIncome: "paperTaxNoticeRefTaxIncome",
// Cozy customization end
} as const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,17 @@ export interface InlineMenuFieldQualificationService {
isFieldForIdentityUsername(field: AutofillField): boolean;
// Cozy customization
isFieldForPaperIdentityCardNumber(field: AutofillField): boolean;
isFieldForPaperPassportNumber(field: AutofillField): boolean;
isFieldForPaperSocialSecurityNumber(field: AutofillField): boolean;
isFieldForPaperResidencePermitNumber(field: AutofillField): boolean;
isFieldForPaperVehiculeRegistrationNumber(field: AutofillField): boolean;
isFieldForPaperVehiculeRegistrationConfidentialCode(field: AutofillField): boolean;
isFieldForPaperVehiculeRegistrationLicensePlateNumber(field: AutofillField): boolean;
isFieldForPaperBankIbanNumber(field: AutofillField): boolean;
isFieldForPaperBankBicNumber(field: AutofillField): boolean;
isFieldForPaperGrossSalaryAmount(field: AutofillField): boolean;
isFieldForPaperNetSalaryAmount(field: AutofillField): boolean;
isFieldForPaperTaxNoticeNumber(field: AutofillField): boolean;
isFieldForPaperTaxNoticeRefTaxIncome(field: AutofillField): boolean;
// Cozy customization end
}
183 changes: 183 additions & 0 deletions apps/browser/src/autofill/services/autofill-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,189 @@ export class PaperAutoFillConstants {
"Official identification number",
"Personal registration number",
];

static readonly PassportNumberFieldNames: string[] = [
"Numéro du passeport",
"Identifiant de passeport",
"passeport",
"numeropasseport",
"passeportnumero",
"numpasseport",
"passeportnum",
"Code de passeport",
"idpasseport",
"passeportid",
"Numéro d'identification de passeport",
"ID de passeport",
"Numéro d'enregistrement de passeport",
"Passport number",
"Passport identifier",
"Passport code",
"Passport identification number",
"Passport ID",
"Passport registration number",
];

static readonly SocialSecurityNumberFieldNames: string[] = [
"nir",
"Numéro carte vitale",
"Identifiant carte vitale",
"Numéro sécurité sociale",
"Numéro carte assurance maladie",
"Carte vitale number",
"Carte vitale identifier",
"Social security number",
"Health insurance card number",
];

static readonly ResidencePermitNumberFieldNames: string[] = [
"numCarteSejour",
"idCarteSejour",
"numeroTitreSejour",
"TitreSejourNum",
"TitreSejourId",
"IdSejour",
"Numéro du titre de séjour",
"Numéro de permis de séjour",
"Identifiant de titre de séjour",
"Numéro de carte de séjour",
"Identifiant de séjour",
"Numéro de séjour",
"Numéro d'autorisation de séjour",
"Code de séjour",
"Residence permit number",
"Residence permit number",
"Residence permit identifier",
"Residence permit number",
"Residence identifier",
"Residence permit number",
"Residence permit number",
"Residence code",
];

static readonly VehiculeRegistrationNumberFieldNames: string[] = [
"numCarteGrise",
"Numéro de la carte grise (VIN)",
"Numéro d'identification du véhicule",
"Numéro d'identification de la voiture",
"Numéro d'identification",
"Numéro d'identification",
"Numéro d'enregistrement du véhicule",
"Numéro d'enregistrement de la voiture",
"Numéro de série du véhicule",
"Numéro de série de la voiture",
"Numéro d'identification",
"Num carte grise",
"Numéro VIN",
"Vehicle registration number (VIN)",
"Vehicle identification number",
"Car identification number",
"Vehicle identification number",
"Vehicle identification number",
"Vehicle registration number",
"Car registration number",
"Vehicle serial number",
"Car serial number",
"Vehicle identification number",
"Vehicle registration number",
"VIN number",
];

static readonly VehiculeRegistrationConfidentialCodeFieldNames: string[] = [
"codeAnts",
"Code confidentiel",
"Code ANTS",
"Code de la carte grise",
"Confidential code",
"ANTS code",
"Grey card code",
];

static readonly VehiculeRegistrationLicensePlateNumberFieldNames: string[] = [
"Plaque d'immatriculation",
"Numéro d'immatriculation du véhicule",
"Numéro d'immatriculation de la voiture",
"Plaque d'immatriculation",
"Immatriculation",
"licensePlate",
"License plate",
"Vehicle registration number",
"Car registration number",
"License plate",
"License plate",
];

static readonly BankIbanNumberFieldNames: string[] = [
"iban",
"Numéro d'IBAN",
"Identifiant IBAN",
"IBAN",
"Numéro de compte IBAN",
"Numéro d'identification bancaire",
"Numéro de compte IBAN",
"IBAN number",
"IBAN identifier",
"IBAN",
"IBAN account number",
"Bank identification number",
"IBAN account number",
];

static readonly BankBicNumberFieldNames: string[] = [
"bic",
"Numéro BIC",
"Numéro de code banque BIC",
"Numéro d'identification bancaire BIC",
"BIC number ",
"BIC bank code number",
"BIC bank identification number",
];

static readonly GrossSalaryAmountFieldNames: string[] = [
"gross",
"Salaire",
"Revenu activité",
"Rémunération brute",
"Salaire brut",
"Montant brut rémunération",
"Salaire total",
"Montant brut versé",
"Gross compensation",
"Gross pay",
"Gross remuneration",
"Total salary",
"Gross payment",
];

static readonly NetSalaryAmountFieldNames: string[] = [
"net",
"Montant net social",
"Montant social net",
"Paiement social net",
"Net social contribution",
"Net social security amount",
"Net social security payment",
];

static readonly TaxNoticeNumberFieldNames: string[] = [
"taxNumber",
"Mon numéro fiscal",
"Numéro fiscal de référence",
"Identifiant fiscal de référence",
"Numéro d'identification fiscal",
"Numéro d'identification d'impôt",
"Tax reference number",
"Tax identification number",
];

static readonly TaxNoticeRefTaxIncomeFieldNames: string[] = [
"RevenuFiscalRef",
"Revenu fiscal de référence de l'année",
"Revenu fiscal de référence",
"Revenu fiscal annuel",
"Reference taxable income",
"Annual tax income",
];
}

// Cozy customization end
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,31 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
// Cozy customization
[AutofillFieldQualifier.paperIdentityCardNumber]:
this.inlineMenuFieldQualificationService.isFieldForPaperIdentityCardNumber,
[AutofillFieldQualifier.paperPassportNumber]:
this.inlineMenuFieldQualificationService.isFieldForPaperPassportNumber,
[AutofillFieldQualifier.paperSocialSecurityNumber]:
this.inlineMenuFieldQualificationService.isFieldForPaperSocialSecurityNumber,
[AutofillFieldQualifier.paperResidencePermitNumber]:
this.inlineMenuFieldQualificationService.isFieldForPaperResidencePermitNumber,
[AutofillFieldQualifier.paperVehiculeRegistrationNumber]:
this.inlineMenuFieldQualificationService.isFieldForPaperVehiculeRegistrationNumber,
[AutofillFieldQualifier.paperVehiculeRegistrationConfidentialCode]:
this.inlineMenuFieldQualificationService.isFieldForPaperVehiculeRegistrationConfidentialCode,
[AutofillFieldQualifier.paperVehiculeRegistrationLicensePlateNumber]:
this.inlineMenuFieldQualificationService
.isFieldForPaperVehiculeRegistrationLicensePlateNumber,
[AutofillFieldQualifier.paperBankIbanNumber]:
this.inlineMenuFieldQualificationService.isFieldForPaperBankIbanNumber,
[AutofillFieldQualifier.paperBankBicNumber]:
this.inlineMenuFieldQualificationService.isFieldForPaperBankBicNumber,
[AutofillFieldQualifier.paperGrossSalaryAmount]:
this.inlineMenuFieldQualificationService.isFieldForPaperGrossSalaryAmount,
[AutofillFieldQualifier.paperNetSalaryAmount]:
this.inlineMenuFieldQualificationService.isFieldForPaperNetSalaryAmount,
[AutofillFieldQualifier.paperTaxNoticeNumber]:
this.inlineMenuFieldQualificationService.isFieldForPaperTaxNoticeNumber,
[AutofillFieldQualifier.paperTaxNoticeRefTaxIncome]:
this.inlineMenuFieldQualificationService.isFieldForPaperTaxNoticeRefTaxIncome,
// Cozy customization end
};

Expand Down
Loading

0 comments on commit b119a1b

Please sign in to comment.