Skip to content

Commit

Permalink
refactor(common): add common to portail admin
Browse files Browse the repository at this point in the history
  • Loading branch information
pYassine committed Nov 8, 2023
1 parent f4b13e5 commit 41b7d94
Show file tree
Hide file tree
Showing 49 changed files with 507 additions and 885 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,12 @@ jobs:
- name: Set up Yarn cache
uses: c-hive/gha-yarn-cache@v2

- name: Install dependencies
run: |
yarn --immutable
- name: Install dependencies
run: yarn workspaces focus @domifa/portail-usagers

- name: Build common dependencies
run: yarn workspace @domifa/common build

- name: Run "Mon DomiFa" tests
run: yarn workspace @domifa/portail-usagers test --coverage --detectOpenHandles --forceExit

Expand All @@ -141,15 +140,20 @@ jobs:
with:
node-version: "16.19"

- name: Change TimeZone
uses: szenius/[email protected]
with:
timezoneLinux: "Europe/Paris"

- name: Set up Yarn cache
uses: c-hive/gha-yarn-cache@v2

- name: Build common dependencies
run: yarn workspace @domifa/common build

- name: Install dependencies
run: yarn workspaces focus @domifa/portail-admins

- name: Build common dependencies
run: yarn workspace @domifa/common build

- name: Run "Portail Admin" tests
run: yarn workspace @domifa/portail-admins test --coverage --detectOpenHandles --forceExit

Expand Down
28 changes: 14 additions & 14 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@
"@nestjs/terminus": "^10.0.1",
"@nestjs/testing": "^10.0.5",
"@ntegral/nestjs-sentry": "^4.0.0",
"@opentelemetry/api": "^1.6.0",
"@opentelemetry/core": "^1.17.0",
"@opentelemetry/instrumentation-express": "^0.33.0",
"@opentelemetry/instrumentation-http": "^0.44.0",
"@opentelemetry/instrumentation-nestjs-core": "^0.33.0",
"@opentelemetry/instrumentation-net": "^0.32.0",
"@opentelemetry/instrumentation-pg": "^0.36.0",
"@opentelemetry/sdk-node": "^0.44.0",
"@opentelemetry/semantic-conventions": "^1.17.0",
"@sentry/node": "^7.77.0",
"@sentry/opentelemetry-node": "^7.77.0",
"@opentelemetry/api": "^1.7.0",
"@opentelemetry/core": "^1.18.1",
"@opentelemetry/instrumentation-express": "^0.33.2",
"@opentelemetry/instrumentation-http": "^0.45.1",
"@opentelemetry/instrumentation-nestjs-core": "^0.33.2",
"@opentelemetry/instrumentation-net": "^0.32.2",
"@opentelemetry/instrumentation-pg": "^0.36.2",
"@opentelemetry/sdk-node": "^0.45.1",
"@opentelemetry/semantic-conventions": "^1.18.1",
"@sentry/node": "^7.79.0",
"@sentry/opentelemetry-node": "^7.79.0",
"@socialgouv/streaming-file-encryption": "^1.1.0",
"@types/source-map-support": "^0.5.4",
"axios": "^1.4.0",
Expand All @@ -83,7 +83,7 @@
"nodemailer": "^6.9.1",
"nunjucks": "^3.2.3",
"passport": "^0.6.0",
"passport-jwt": "^4.0.0",
"passport-jwt": "^4.0.1",
"pg": "^8.7.1",
"pino": "^8.7.0",
"pino-pretty": "^10.0.1",
Expand All @@ -102,7 +102,7 @@
"typeorm": "^0.3.17",
"uuid": "^9.0.1",
"xlsx": "^0.18.5",
"yup": "^0.32.9",
"yup": "^0.32.11",
"yup-phone": "^1.3.2"
},
"devDependencies": {
Expand Down Expand Up @@ -149,7 +149,7 @@
"ts-jest": "^29.1.1",
"ts-node": "10.9.1",
"ts-node-dev": "^2.0.0",
"tsconfig-paths": "^4.0.0",
"tsconfig-paths": "^4.2.0",
"typescript": "4.9.5"
},
"lint-staged": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Telephone } from "./../telephone/Telephone.type";
import { UsagerOptions } from "..";
import { AppEntity } from "../_core";
import {
UsagerRdv,
UsagerSexe,
UsagerLastInteraction,
UsagerAyantDroit,
UsagerDecision,
UsagerOptions,
UsagerTypeDom,
} from "..";
import { AppEntity } from "../_core";
import { UsagerRdv, UsagerSexe, UsagerLastInteraction } from "@domifa/common";
} from "@domifa/common";

export type PortailUsagerPublic = AppEntity & {
customRef: string; // valeur par défaut: 'ref'
Expand Down
7 changes: 4 additions & 3 deletions packages/backend/src/_common/model/usager/Usager.type.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { AppEntity } from "../_core/AppEntity.type";
import { UsagerAyantDroit } from "./UsagerAyantDroit.type";
import { UsagerDecision } from "./UsagerDecision.type";

import { UsagerImport } from "./UsagerImport.type";
import { UsagerNote } from "./UsagerNote.type";
import { UsagerOptions } from "./options/UsagerOptions.type";

import { UsagerTypeDom } from "./UsagerTypeDom.type";
import { Telephone } from "../telephone/Telephone.type";
import {
UsagerLastInteraction,
UsagerEntretien,
UsagerRdv,
UsagerSexe,
UsagerAyantDroit,
UsagerTypeDom,
UsagerDecision,
} from "@domifa/common";

export type Usager = AppEntity & {
Expand Down

This file was deleted.

29 changes: 0 additions & 29 deletions packages/backend/src/_common/model/usager/UsagerDecision.type.ts

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions packages/backend/src/_common/model/usager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ export * from "./cerfa";
export * from "./history";
export * from "./options";
export * from "./Usager.type";
export * from "./UsagerAyantDroit.type";
export * from "./UsagerDecision.type";
export * from "./UsagerDoc.type";
export * from "./UsagerImport.type";
export * from "./UsagerLight.type";
export * from "./UsagerNote.type";
export * from "./UsagerTypeDom.type";

This file was deleted.

25 changes: 0 additions & 25 deletions packages/backend/src/_migrations/1699283083901-auto-migration.ts

This file was deleted.

29 changes: 0 additions & 29 deletions packages/backend/src/_migrations/1699283951968-auto-migration.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@ import {
OneToOne,
Unique,
} from "typeorm";
import {
Usager,
UsagerOptions,
UsagerTypeDom,
Telephone,
UsagerAyantDroit,
UsagerDecision,
} from "../../../_common/model";
import { Usager, UsagerOptions, Telephone } from "../../../_common/model";

import { UsagerNote } from "../../../_common/model/usager/UsagerNote.type";
import { StructureTable } from "../structure/StructureTable.typeorm";
Expand All @@ -28,6 +21,9 @@ import {
UsagerRdv,
UsagerSexe,
UsagerLastInteraction,
UsagerTypeDom,
UsagerAyantDroit,
UsagerDecision,
} from "@domifa/common";

// https://typeorm.io/#/entities/column-types-for-postgres
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { fakerFR as faker } from "@faker-js/faker";

import { appLogger } from "../../../../util";
import {
Usager,
UsagerAyantDroit,
UsagerDecision,
UsagerOptions,
} from "../../../../_common/model";
import { Usager, UsagerOptions } from "../../../../_common/model";
import {
usagerDocsRepository,
usagerEntretienRepository,
Expand All @@ -16,6 +11,7 @@ import {
import { usagerRepository } from "../../usager/usagerRepository.service";
import { dataGenerator } from "./dataGenerator.service";
import { dataStructureAnonymizer } from "./dataStructureAnonymizer";
import { UsagerAyantDroit, UsagerDecision } from "@domifa/common";

export const dataUsagerAnonymizer = {
anonymizeUsagers,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { Column, Workbook } from "exceljs";

import { COUNTRY_CODES, UsagerDecision } from "../../../_common/model";
import { COUNTRY_CODES } from "../../../_common/model";
import {
WorksheetRenderer,
xlFormater,
xlRenderer,
XlRowModel,
} from "../../xlLib";
import { StructureUsagersExportModel } from "../StructureUsagersExportModel.type";
import { generateMotifLabel } from "./../../../usagers/services/generateMotifLabel.service";
import { USAGER_DECISION_STATUT_LABELS } from "@domifa/common";
import {
USAGER_DECISION_STATUT_LABELS,
UsagerDecision,
generateMotifLabel,
} from "@domifa/common";

export const exportListeParticipantsWorksheetRenderer = {
renderWorksheet,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import { setHours } from "date-fns";

import {
Usager,
UsagerAyantDroit,
UsagerDecision,
UserStructure,
} from "../../../../_common/model";

import { Usager, UserStructure } from "../../../../_common/model";
import { v4 as uuidv4 } from "uuid";

import { UsagersImportUsager } from "../step2-validate-row/schema";
import {
UsagerDecisionMotif,
UsagerEntretien,
ETAPE_DOSSIER_COMPLET,
UsagerAyantDroit,
UsagerDecision,
} from "@domifa/common";

export const usagersImportBuilder = {
Expand Down
Loading

0 comments on commit 41b7d94

Please sign in to comment.