Skip to content

Commit

Permalink
Revert "dummy commit"
Browse files Browse the repository at this point in the history
This reverts commit bf73d49.
  • Loading branch information
Viczei committed Feb 18, 2025
1 parent 50cb84a commit 94ab1a5
Showing 1 changed file with 61 additions and 71 deletions.
132 changes: 61 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Préprod : <https://egapro-preprod.ovh.fabrique.social.gouv.fr/>

### Prérequis

- Node.js >= 18
- Yarn
- Python (pour les scripts optionnels)
- Node.js >= 18
- Yarn
- Python (pour les scripts optionnels)

### Installation des dépendances

Expand All @@ -27,7 +27,6 @@ yarn setup-python
### Variables d'environnement

Créer un fichier `.env` à la racine du projet :

```bash
# Configuration de la base de données
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/egapro
Expand All @@ -52,10 +51,9 @@ yarn dev:maildev
```

Accès aux services :

- Application : [http://localhost:3000](http://localhost:3000)
- API : [http://localhost:2626](http://localhost:2626)
- MailDev : [http://localhost:1080](http://localhost:1080)
- Application : [http://localhost:3000](http://localhost:3000)
- API : [http://localhost:2626](http://localhost:2626)
- MailDev : [http://localhost:1080](http://localhost:1080)

2. **Mode développement complet**

Expand All @@ -66,8 +64,8 @@ yarn dev

3. **Arrêter l'application**

- Utiliser `Ctrl+C` dans chaque terminal
- Pour l'API et maildev : `docker-compose down`
- Utiliser `Ctrl+C` dans chaque terminal
- Pour l'API et maildev : `docker-compose down`

### Tests et vérifications

Expand All @@ -83,14 +81,13 @@ yarn check-all

### Variables annuelles importantes

- `CURRENT_YEAR` (définie dans `packages/app/src/common/dict.ts`) :
- `CURRENT_YEAR` (définie dans `packages/app/src/common/dict.ts`) :
- Année de déclaration courante ouverte
- Détermine les années disponibles pour les déclarations

- Année de déclaration courante ouverte
- Détermine les années disponibles pour les déclarations

- `PUBLIC_CURRENT_YEAR` (définie dans `packages/app/src/common/dict.ts`) :
- Année de référence pour les calculs de statistiques publiques
- Utilisée pour l'affichage des données publiques et des indicateurs
- `PUBLIC_CURRENT_YEAR` (définie dans `packages/app/src/common/dict.ts`) :
- Année de référence pour les calculs de statistiques publiques
- Utilisée pour l'affichage des données publiques et des indicateurs

## Architecture

Expand All @@ -116,55 +113,49 @@ packages/app/src/
### Concepts clés

1. **Forms et Validation** :

- React Hook Form pour la gestion des formulaires
- Zod pour la validation des données côté client
- Exemple :

```tsx
const schema = z.object({
email: z.string().email(),
password: z.string().min(8),
});
```
- React Hook Form pour la gestion des formulaires
- Zod pour la validation des données côté client
- Exemple :
```tsx
const schema = z.object({
email: z.string().email(),
password: z.string().min(8)
});
```

2. **Server Actions** :

- Actions serveur dans `app/(default)/*/actions.ts`
- Utilisation des use cases du domaine
- Exemple :

```ts
// app/(default)/index-egapro/declaration/actions.ts
export async function saveDeclaration(declaration: CreateDeclarationDTO) {
const useCase = new SaveDeclaration(declarationRepo, entrepriseService);
return useCase.execute(declaration);
}
```
- Actions serveur dans `app/(default)/*/actions.ts`
- Utilisation des use cases du domaine
- Exemple :
```ts
// app/(default)/index-egapro/declaration/actions.ts
export async function saveDeclaration(declaration: CreateDeclarationDTO) {
const useCase = new SaveDeclaration(declarationRepo, entrepriseService);
return useCase.execute(declaration);
}
```

3. **Use Cases** :

- Implémentation des cas d'utilisation métier
- Validation des règles de gestion
- Exemple :

```ts
// api/core-domain/useCases/SaveDeclaration.ts
export class SaveDeclaration implements UseCase {
constructor(
private readonly declarationRepo: IDeclarationRepo,
private readonly entrepriseService: IEntrepriseService,
) {}
}
```
- Implémentation des cas d'utilisation métier
- Validation des règles de gestion
- Exemple :
```ts
// api/core-domain/useCases/SaveDeclaration.ts
export class SaveDeclaration implements UseCase {
constructor(
private readonly declarationRepo: IDeclarationRepo,
private readonly entrepriseService: IEntrepriseService
) {}
}
```

4. **Domain et Calculs** :
- Logique métier dans `core-domain`
- Calculs d'index dans `computers/`
- Indicateurs spécifiques :
- IndicateurUnComputer : Calcul écart rémunération
- IndicateurDeuxComputer : Calcul écart augmentations
- IndicateurTroisComputer : Calcul écart promotions
- Logique métier dans `core-domain`
- Calculs d'index dans `computers/`
- Indicateurs spécifiques :
- IndicateurUnComputer : Calcul écart rémunération
- IndicateurDeuxComputer : Calcul écart augmentations
- IndicateurTroisComputer : Calcul écart promotions

## FAQ

Expand All @@ -177,21 +168,21 @@ yarn workspace app run tsc

### Comment ajouter une librairie dans un workspace ?

```bash
````bash
yarn workspace app add moment
```
````

### Comment lancer un script dans un package ?

```bash
````bash
yarn workspace app run test
```
````

### Comment lancer un script dans tous les workspaces ?

```bash
````bash
yarn workspaces run lint
```
````

### Quel est le maildev pour un environnement de recette ?

Expand All @@ -209,10 +200,10 @@ Le fichier index-egalite-fh.csv est généré tous les jours et accessible sans

Les fichiers suivants, sont accessibles uniquement si authentifié ou pour certaines adresses IP (voir la liste blanche dans `.kontinuous/values.yaml`).

- dgt.xlsx
- dgt-representation.xlsx
- full.ndjson
- indexes.csv
- dgt.xlsx
- dgt-representation.xlsx
- full.ndjson
- indexes.csv

### Commandes pour générer les fichiers manuellement

Expand All @@ -238,4 +229,3 @@ yarn egapro --help
Les commandes vont se lancer dans l'environnement local.

Si l'on veut lancer ces commandes dans un container (ex: en prod, en préprod ou dans un environnement lié à une PR), il faut se connecter au container et lancer la commande egapro.
:)

0 comments on commit 94ab1a5

Please sign in to comment.