Skip to content

Commit

Permalink
fix(backend): clean npai
Browse files Browse the repository at this point in the history
  • Loading branch information
pYassine committed Sep 24, 2024
1 parent 32d1225 commit beb79c1
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fileignoreconfig:
- filename: packages/backend/src/_migrations/1727093929792-manual-migration.ts
checksum: 3c9e8d54f169d01f7c1d237c196c5b71cc392b3d1bf18b8b2e08237b1b60a43c
- filename: packages/backend/src/_migrations/_init-db/1603812391580-pr-env-create-database.ts
checksum: 9c4984cbb8b435b626b2b26fd1cba740542aed18aa568bd03af517651de1aacd
checksum: 2d5ee47c1a8176bc93a443ce3a3a01a1bc2d27d8cfc8f79a2c6ad56e8cd97fc3
- filename: packages/backend/src/modules/portail-usagers/controllers/portail-usagers-manager/portail-usagers-manager.controller.ts
checksum: 6cb66d899577621ac9f796b2fde88a68263b7422c3f369854d94236c15c0807f
- filename: packages/backend/src/stats/services/publicStats.service.ts
Expand Down
Binary file modified _scripts/db/dumps/domifa_test.postgres.custom.gz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export class ManualMigration1727093929792 implements MigrationInterface {
await writeFile(outputPath, fullCsvContent);

console.log(`Credentials exported to ${outputPath}`);
throw new Error("lll");
}

public async down(): Promise<void> {}
Expand Down
35 changes: 35 additions & 0 deletions packages/backend/src/_migrations/1727186783887-manual-migration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { MigrationInterface, QueryRunner } from "typeorm";

export class ManualMigration1727186783887 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
// Compter le nombre d'enregistrements qui seront affectés
const countResult = await queryRunner.query(`
SELECT COUNT(*) as count
FROM usager
WHERE statut != 'RADIE' AND options->'npai'->>'actif' = 'true';
`);

const count = parseInt(countResult[0].count);

console.log(`Nombre d'enregistrements qui seront mis à jour : ${count}`);

// Exécuter la mise à jour
await queryRunner.query(`
UPDATE usager
SET options = jsonb_set(
options,
'{npai}',
'{"actif": false, "dateDebut": null}'::jsonb,
true
)
WHERE statut != 'RADIE' AND options->'npai'->>'actif' = 'true';
`);

console.log(
`Mise à jour terminée. ${count} enregistrements ont été modifiés.`
);
}

public async down(): Promise<void> {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,23 @@ async function createTables(queryRunner: QueryRunner) {
);
-- public.spatial_ref_sys definition
-- Drop table
-- DROP TABLE public.spatial_ref_sys;
CREATE TABLE public.spatial_ref_sys (
srid int4 NOT NULL,
auth_name varchar(256) NULL,
auth_srid int4 NULL,
srtext varchar(2048) NULL,
proj4text varchar(2048) NULL,
CONSTRAINT spatial_ref_sys_pkey PRIMARY KEY (srid),
CONSTRAINT spatial_ref_sys_srid_check CHECK (((srid > 0) AND (srid <= 998999)))
);
-- public."structure" definition
-- Drop table
Expand Down Expand Up @@ -755,6 +772,7 @@ async function createTables(queryRunner: QueryRunner) {
CREATE INDEX "IDX_ef9fade8e5a6dac06ef5031986" ON public.interactions USING btree (type);
CREATE INDEX "IDX_f9c3ee379ce68d4acfe4199a33" ON public.interactions USING btree ("usagerUUID");
CREATE INDEX idx_interactions_date ON public.interactions USING btree ("structureId", "usagerUUID", "dateInteraction");
CREATE INDEX idx_interactions_type ON public.interactions USING btree ("structureId", "usagerUUID", type); `
CREATE INDEX idx_interactions_type ON public.interactions USING btree ("structureId", "usagerUUID", type);
`
);
}
20 changes: 20 additions & 0 deletions packages/frontend/src/assets/files/news.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
[
{
"date": "2024-09-24",
"description": "Nouveautés et améliorations diverses sur DomiFa",
"content": [
{
"type": "new",
"categorie": "SMS",
"message": [
"SMS de renouvellement Suite aux demandes de plusieurs structures, le délai d'envoi du sms de renouvellement de la domiciliation est réduit à 1 mois avant la date d'échéance."
]
},
{
"type": "bug",
"categorie": "Pli non distribuable",
"message": [
"Retrait de la mention PND pour les dossiers radiés dont la radiation est annulée En cas de renouvellement d'un dossier radié, ou de la suppression de la décision d'une radiation dans un dossier radié, la mention pli non distribuable sera automatiquement supprimée."
]
}
]
},
{
"date": "2024-07-08",
"description": "Nouveautés et améliorations diverses sur DomiFa",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ <h1 class="title">Connexion à Mon DomiFa</h1>
Vous avez peut-être bloqué votre compte en faisant plus de 3
tentatives de connexion avec un mauvais mot de passe.
<br />
<b>Attendez 24h pour retenter de vous connecter.</b>
<b>Veuillez réessayer dans une heure.</b>

<br />
<br />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export class UsagerLoginComponent implements OnInit, OnDestroy {
);
} else if (err?.error?.message === "TOO_MANY_ATTEMPTS") {
this.toastr.error(
"Après plusieurs tentatives de connexion, votre compte est temporairement inaccessible. Tentez de vous reconnecter dans 24h.",
"Après plusieurs tentatives de connexion, votre compte est temporairement inaccessible. Veuillez réessayer dans une heure",
);
} else {
this.toastr.error("Login et / ou mot de passe incorrect");
Expand Down

0 comments on commit beb79c1

Please sign in to comment.