Skip to content

Commit c812198

Browse files
committed
fix(backend): fix istemporarypassword
1 parent 36fe0de commit c812198

File tree

17 files changed

+106
-53
lines changed

17 files changed

+106
-53
lines changed

.talismanrc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ fileignoreconfig:
88
- filename: _docs/dev/0.run-local-env.md
99
checksum: 855b6f29ace746c86597d36382dbe7e40f771137734e3bf5eb53c948d6592a74
1010
- filename: _scripts/db/dumps/domifa_test.postgres.restore-data-only.sql
11-
checksum: 90f61b5faa4fd3da9b0722538c036ff58ca8f2d388091f22e8b348a3b09ef37b
11+
checksum: f106304727d41ce64bb581f8772896ed8664df3a5e41489587be64afab48f453
1212
- filename: _scripts/db/dumps/domifa_test.postgres.truncate-restore-data-only.sql
13-
checksum: c510b7ad49f07d80c5a4951ca86c62d55dab6a3fb5b2dcc6947f8022cb08eea7
13+
checksum: 4d2f01ba7fbd8c1109994a0831576e6341dc7e925fb75b9f447e2b3e1c9ef1c6
1414
- filename: packages/backend/package.json
1515
checksum: 2f5813dbc35cdc3659516beabf9f93e2978eb62d1b5403cfbb2907f22bb25355
16+
- filename: packages/backend/src/_migrations/1757532174131-auto-migration.ts
17+
checksum: 22a788509a5f08a8dbccbab49ed7b835df73ab56444b5c2a0e327fe51de2f748
18+
- filename: packages/backend/src/_migrations/_init-db/domifa_test_schema.sql
19+
checksum: 8b421c413bab4f2419972dec548a5399879f497a8c75c9b240bbf8c123cfab06
1620
- filename: packages/portail-admins/src/app/modules/admin-structures/components/admin-structures-list/admin-structures-list.component.spec.ts
1721
checksum: 8f66091255109d0da277819584c6c69d4a7f720256842851a49b0dda16af6651
1822
- filename: packages/portail-admins/src/app/modules/admin-structures/components/admin-structures-list/admin-structures-list.component.ts
264 Bytes
Binary file not shown.

_scripts/db/dumps/domifa_test.postgres.restore-data-only.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,9 @@ f1d8975b-e429-41db-9246-bb2b388aece6 2025-04-15 20:14:04.704668+02 2025-04-15 20
336336
-- Data for Name: user_usager; Type: TABLE DATA; Schema: public; Owner: -
337337
--
338338
339-
COPY public.user_usager (uuid, "createdAt", "updatedAt", version, id, "usagerUUID", "structureId", login, password, salt, "isTemporaryPassword", "lastLogin", "passwordLastUpdate", "lastPasswordResetDate", "lastPasswordResetStructureUser", "acceptTerms", "passwordType") FROM stdin;
340-
a657f4bd-e4d1-4c38-bdd0-ffd268b356df 2021-10-05 11:34:41.369505+02 2023-12-18 17:54:10.81286+01 19 1 b2c26e55-ab37-457d-b307-6fe161050a9b 1 WKYJBDXS $2a$10$1rKKqmxsaIKyNkyZpm5QHufHZ8JfCSgEtaLOv07oy2QE.O8msCVPO $2a$10$1rKKqmxsaIKyNkyZpm5QHu t 2021-11-30 15:02:07.69+01 \N 2021-10-05 11:34:41.365+02 {"userId": 1, "userName": "Patrick Roméro"} \N BIRTH_DATE
341-
a03a9a49-ae31-4160-9879-bab02dc46361 2021-11-30 14:50:26.278073+01 2023-11-20 16:40:58.362384+01 17 2 97b7e840-0e93-4bf4-ba7d-0a406aa898f2 1 LNQIFFBK $2a$10$/MxpSdJoHG59JaksJx5eSe4U1tHGcVoHEvlDRoi.AsVW2LlybKNnG $2a$10$zmuPXxUOuQJ7nE6ag4.x6e f 2023-11-20 16:40:58.36+01 2021-11-30 15:01:39.675+01 2021-11-30 14:50:26.275+01 {"userId": 1, "userName": "Patrick Roméro"} \N PERSONAL
339+
COPY public.user_usager (uuid, "createdAt", "updatedAt", version, id, "usagerUUID", "structureId", login, password, salt, "lastLogin", "passwordLastUpdate", "lastPasswordResetDate", "lastPasswordResetStructureUser", "acceptTerms", "passwordType") FROM stdin;
340+
a657f4bd-e4d1-4c38-bdd0-ffd268b356df 2021-10-05 11:34:41.369505+02 2023-12-18 17:54:10.81286+01 19 1 b2c26e55-ab37-457d-b307-6fe161050a9b 1 WKYJBDXS $2a$10$1rKKqmxsaIKyNkyZpm5QHufHZ8JfCSgEtaLOv07oy2QE.O8msCVPO $2a$10$1rKKqmxsaIKyNkyZpm5QHu 2021-11-30 15:02:07.69+01 \N 2021-10-05 11:34:41.365+02 {"userId": 1, "userName": "Patrick Roméro"} \N BIRTH_DATE
341+
a03a9a49-ae31-4160-9879-bab02dc46361 2021-11-30 14:50:26.278073+01 2023-11-20 16:40:58.362384+01 17 2 97b7e840-0e93-4bf4-ba7d-0a406aa898f2 1 LNQIFFBK $2a$10$/MxpSdJoHG59JaksJx5eSe4U1tHGcVoHEvlDRoi.AsVW2LlybKNnG $2a$10$zmuPXxUOuQJ7nE6ag4.x6e 2023-11-20 16:40:58.36+01 2021-11-30 15:01:39.675+01 2021-11-30 14:50:26.275+01 {"userId": 1, "userName": "Patrick Roméro"} \N PERSONAL
342342
\.
343343
344344

_scripts/db/dumps/domifa_test.postgres.truncate-restore-data-only.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,9 @@ f1d8975b-e429-41db-9246-bb2b388aece6 2025-04-15 20:14:04.704668+02 2025-04-15 20
372372
-- Data for Name: user_usager; Type: TABLE DATA; Schema: public; Owner: -
373373
--
374374
375-
COPY public.user_usager (uuid, "createdAt", "updatedAt", version, id, "usagerUUID", "structureId", login, password, salt, "isTemporaryPassword", "lastLogin", "passwordLastUpdate", "lastPasswordResetDate", "lastPasswordResetStructureUser", "acceptTerms", "passwordType") FROM stdin;
376-
a657f4bd-e4d1-4c38-bdd0-ffd268b356df 2021-10-05 11:34:41.369505+02 2023-12-18 17:54:10.81286+01 19 1 b2c26e55-ab37-457d-b307-6fe161050a9b 1 WKYJBDXS $2a$10$1rKKqmxsaIKyNkyZpm5QHufHZ8JfCSgEtaLOv07oy2QE.O8msCVPO $2a$10$1rKKqmxsaIKyNkyZpm5QHu t 2021-11-30 15:02:07.69+01 \N 2021-10-05 11:34:41.365+02 {"userId": 1, "userName": "Patrick Roméro"} \N BIRTH_DATE
377-
a03a9a49-ae31-4160-9879-bab02dc46361 2021-11-30 14:50:26.278073+01 2023-11-20 16:40:58.362384+01 17 2 97b7e840-0e93-4bf4-ba7d-0a406aa898f2 1 LNQIFFBK $2a$10$/MxpSdJoHG59JaksJx5eSe4U1tHGcVoHEvlDRoi.AsVW2LlybKNnG $2a$10$zmuPXxUOuQJ7nE6ag4.x6e f 2023-11-20 16:40:58.36+01 2021-11-30 15:01:39.675+01 2021-11-30 14:50:26.275+01 {"userId": 1, "userName": "Patrick Roméro"} \N PERSONAL
375+
COPY public.user_usager (uuid, "createdAt", "updatedAt", version, id, "usagerUUID", "structureId", login, password, salt, "lastLogin", "passwordLastUpdate", "lastPasswordResetDate", "lastPasswordResetStructureUser", "acceptTerms", "passwordType") FROM stdin;
376+
a657f4bd-e4d1-4c38-bdd0-ffd268b356df 2021-10-05 11:34:41.369505+02 2023-12-18 17:54:10.81286+01 19 1 b2c26e55-ab37-457d-b307-6fe161050a9b 1 WKYJBDXS $2a$10$1rKKqmxsaIKyNkyZpm5QHufHZ8JfCSgEtaLOv07oy2QE.O8msCVPO $2a$10$1rKKqmxsaIKyNkyZpm5QHu 2021-11-30 15:02:07.69+01 \N 2021-10-05 11:34:41.365+02 {"userId": 1, "userName": "Patrick Roméro"} \N BIRTH_DATE
377+
a03a9a49-ae31-4160-9879-bab02dc46361 2021-11-30 14:50:26.278073+01 2023-11-20 16:40:58.362384+01 17 2 97b7e840-0e93-4bf4-ba7d-0a406aa898f2 1 LNQIFFBK $2a$10$/MxpSdJoHG59JaksJx5eSe4U1tHGcVoHEvlDRoi.AsVW2LlybKNnG $2a$10$zmuPXxUOuQJ7nE6ag4.x6e 2023-11-20 16:40:58.36+01 2021-11-30 15:01:39.675+01 2021-11-30 14:50:26.275+01 {"userId": 1, "userName": "Patrick Roméro"} \N PERSONAL
378378
\.
379379
380380
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { MigrationInterface, QueryRunner } from "typeorm";
2+
import { domifaConfig } from "../config";
3+
4+
export class AutoMigration1757532174131 implements MigrationInterface {
5+
name = "AutoMigration1757532174131";
6+
7+
public async up(queryRunner: QueryRunner): Promise<void> {
8+
if (
9+
domifaConfig().envId === "prod" ||
10+
domifaConfig().envId === "preprod" ||
11+
domifaConfig().envId === "local"
12+
) {
13+
await queryRunner.query(
14+
`ALTER TABLE "user_usager" DROP COLUMN "isTemporaryPassword"`
15+
);
16+
await queryRunner.query(
17+
`CREATE INDEX "IDX_b2ad525cbadf911e833bf61597" ON "open_data_places" ("cityCode") `
18+
);
19+
}
20+
}
21+
22+
public async down(queryRunner: QueryRunner): Promise<void> {
23+
if (
24+
domifaConfig().envId === "prod" ||
25+
domifaConfig().envId === "preprod" ||
26+
domifaConfig().envId === "local"
27+
) {
28+
await queryRunner.query(
29+
`DROP INDEX "public"."IDX_b2ad525cbadf911e833bf61597"`
30+
);
31+
32+
await queryRunner.query(
33+
`ALTER TABLE "user_usager" ADD "isTemporaryPassword" boolean NOT NULL DEFAULT false`
34+
);
35+
}
36+
}
37+
}

packages/backend/src/_migrations/_init-db/domifa_test_schema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,6 @@ CREATE TABLE public.user_usager (
505505
login text NOT NULL,
506506
password text NOT NULL,
507507
salt text NOT NULL,
508-
"isTemporaryPassword" boolean DEFAULT false NOT NULL,
509508
"lastLogin" timestamp with time zone,
510509
"passwordLastUpdate" timestamp with time zone,
511510
"lastPasswordResetDate" timestamp with time zone,
@@ -670,6 +669,7 @@ CREATE INDEX "IDX_a52dec7d55b4a81a0af0136148" ON public.user_structure USING btr
670669
CREATE INDEX "IDX_aa19c17fc79f4e4a648643096f" ON public.usager_entretien USING btree ("usagerUUID");
671670
CREATE INDEX "IDX_b1db67565e53acec53d5f3aa92" ON public.usager_docs USING btree ("structureId");
672671
CREATE INDEX "IDX_b1dfa7ef1934657b38072e749e" ON public.structure_doc USING btree (id);
672+
CREATE INDEX "IDX_b2ad525cbadf911e833bf61597" ON public.open_data_places USING btree ("cityCode");
673673
CREATE INDEX "IDX_b36e92e49b2a68f8fea64ec8d5" ON public.structure USING btree (email);
674674
CREATE INDEX "IDX_b4d09870ec6cad2d2d98b7cc3a" ON public.usager USING btree (migrated);
675675
CREATE INDEX "IDX_b509fe905bf502e510cda57080" ON public.usager_options_history USING btree ("structureId");

packages/backend/src/modules/sms/services/senders/cron-sms-id-mon-domifa.service.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class CronSmsMonDomiFaService {
1414
private readonly messageSmsSenderService: MessageSmsSenderService
1515
) {}
1616

17-
@Cron(CronExpression.EVERY_10_MINUTES, {
17+
@Cron(CronExpression.EVERY_30_MINUTES, {
1818
timeZone: "Europe/Paris",
1919
disabled: !isCronEnabled() || !domifaConfig().sms.enabled,
2020
})
@@ -37,10 +37,9 @@ export class CronSmsMonDomiFaService {
3737
status: "TO_SEND",
3838
smsId: "idMonDomiFa",
3939
},
40-
take: 500,
40+
take: 200,
4141
});
4242

43-
console.log({ smsToSend });
4443
if (smsToSend.length === 0) {
4544
appLogger.info(
4645
"[SMS BATCH] Aucun SMS d'identifiants Mon DomiFa à envoyer"

packages/backend/src/modules/sms/sms.controller.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ export class SmsController {
2727
) {
2828
const queryBuilder = messageSmsRepository
2929
.createQueryBuilder("message_sms")
30-
.where("message_sms.structureId = :structureId", {
31-
structureId: currentUsager.structureId,
30+
.where(`"structureId" = :id`, {
31+
id: currentUsager.structureId,
3232
})
33-
.andWhere("message_sms.usagerRef = :usagerRef", {
34-
usagerRef: currentUsager.ref,
33+
.andWhere(`"usagerRef" = :ref`, {
34+
ref: currentUsager.ref,
3535
})
36-
.orderBy("createdAt", pageOptionsDto.order)
36+
.orderBy(`"createdAt"`, pageOptionsDto.order)
3737
.skip(pageOptionsDto.skip)
3838
.take(pageOptionsDto.take);
3939

packages/backend/src/modules/sms/sms.module.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { forwardRef, Module } from "@nestjs/common";
99
import { InteractionsModule } from "../interactions/interactions.module";
1010
import { StructuresModule } from "../structures/structure.module";
1111
import { UsagersModule } from "../../usagers/usagers.module";
12-
import { CronSmsMonDomiFaService } from "./services/senders/cron-sms-id-mon-domifa.service";
1312

1413
@Module({
1514
controllers: [SmsController],
@@ -18,7 +17,7 @@ import { CronSmsMonDomiFaService } from "./services/senders/cron-sms-id-mon-domi
1817
MessageSmsService,
1918
CronSmsInteractionSenderService,
2019
CronSmsFetchEndDomService,
21-
CronSmsMonDomiFaService,
20+
//CronSmsMonDomiFaService,
2221
],
2322
imports: [
2423
HttpModule,
@@ -31,7 +30,7 @@ import { CronSmsMonDomiFaService } from "./services/senders/cron-sms-id-mon-domi
3130
MessageSmsService,
3231
CronSmsInteractionSenderService,
3332
CronSmsFetchEndDomService,
34-
CronSmsMonDomiFaService,
33+
//CronSmsMonDomiFaService,
3534
],
3635
})
3736
export class SmsModule {}

packages/frontend/src/app/modules/usager-profil/components/_courriers/profil-edit-portail-usager-preference/profil-edit-portail-usager-preference.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ <h2>Accès au portail "Mon DomiFa"</h2>
4848
<p class="col-12 col-md-4 reponses">
4949
<span class="question">Compte activé par le domicilié</span>
5050
<span class="valeur">
51-
@if (portailUsagersInformations.passwordType === 'PERSONAL') {
51+
@if (portailUsagersInformations?.passwordType === 'PERSONAL') {
5252
<span class="label-info green-status">Compte actif</span>
5353
} @else { <span class="label-info red-status">Non</span>}
5454
</span>

0 commit comments

Comments
 (0)