Skip to content

Commit 6bfa2fb

Browse files
feat: campaign organization csv export (#323)
* feat: campaign organization csv export * fix: removed unused class
1 parent e480e33 commit 6bfa2fb

23 files changed

Lines changed: 1343 additions & 162 deletions

File tree

.ai/project/archi.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Context : Pearl Jam — Architecture hexagonale (état & cible)
2+
3+
## Principes fondamentaux
4+
5+
1. **Direction des dépendances** : tout pointe vers le centre (Domain). Jamais l'inverse.
6+
2. **Ports** : interfaces définies dans le Domain pour communiquer avec l'extérieur.
7+
3. **Adaptateurs** : implémentations concrètes dans `infrastructure-*` ou `api`.
8+
9+
## Structure des modules Maven
10+
11+
```
12+
pearljam-back-office-parent/
13+
├── pearljam-domain-model/ # Value Objects, Enums partagés
14+
├── pearljam-domain/ # Cœur métier (AUCUNE dép. technique)
15+
│ └── fr.insee.pearljam.domain
16+
│ └── [bounded-context]/
17+
│ ├── port/
18+
│ │ ├── in/ # Use Cases (interfaces)
19+
│ │ └── out/ # Repositories, clients (interfaces)
20+
│ ├── service/ # Logique métier
21+
│ │ └── exception/ # Exceptions métier
22+
│ ├── model/ # Entités et Value Objects
23+
│ └── readmodel/ # Projections lecture seule
24+
├── pearljam-api/ # Adaptateurs entrants (REST)
25+
│ └── fr.insee.pearljam.api
26+
│ └── [bounded-context]/
27+
│ ├── controller/ # @RestController
28+
│ ├── presenter/ # Domain → Response
29+
│ └── response/ # DTOs de réponse (records)
30+
├── pearljam-infrastructure-persistence/# Adaptateurs sortants (DB)
31+
│ └── fr.insee.pearljam.infrastructure.persistence
32+
│ └── [bounded-context]/
33+
│ ├── adapter/ # Implémente les ports out
34+
│ ├── entity/ # Entités JPA (@Entity)
35+
│ ├── jpa/ # Spring Data JPA repositories
36+
│ └── mapper/ # Entity ↔ Domain
37+
├── pearljam-infrastructure-http/ # Adaptateurs sortants HTTP (@HttpExchange)
38+
├── pearljam-infrastructure-security/ # Auth OIDC (Spring Security 7)
39+
├── pearljam-shared-dto/ # DTOs partagés entre modules
40+
└── pearljam-shared-persistence-model/ # Entités persistence partagées
41+
```
42+
43+
## Bounded contexts
44+
45+
| Context | Package | Responsabilité |
46+
| ------------------ | ------------------------- | ----------------------------------------- |
47+
| `campaign` | `domain.campaign` | Gestion des campagnes d'enquête |
48+
| `surveyunit` | `domain.surveyunit` | Unités d'enquête et cycle de vie |
49+
| `reporting` | `domain.reporting` | Statistiques et rapports |
50+
| `organizationunit` | `domain.organizationunit` | Unités organisationnelles et utilisateurs |
51+
| `message` | `domain.message` | Messagerie interne |
52+
| `security` | `domain.security` | Autorisations métier |

.ai/skills/coding/SKILLS.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Role
2+
3+
4+
You're a senior software craft developper respecting SOLID, KISS, DRY.
5+
Make sure your code is easy to read and has no cognitive complexity.
6+
7+
# Java Spring Boot Skill
8+
9+
Build production-ready Spring Boot applications with modern best practices.
10+
11+
## ⚡ RÈGLES NON-NÉGOCIABLES
12+
13+
1. ❌ NEVER do N+1 query
14+
2. ✅ ALWAYS respect SOLID principles
15+
16+
## Overview
17+
18+
This skill covers Spring Boot development including REST APIs, security configuration, data access, actuator monitoring, and cloud integration. Follows Spring Boot 3.x patterns with emphasis on production readiness.
19+
20+
## When to Use This Skill
21+
22+
Use when you need to:
23+
- Create REST APIs with Spring MVC/WebFlux
24+
- Configure Spring Security (OAuth2, JWT)
25+
- Set up database access with Spring Data
26+
- Enable monitoring with Actuator
27+
- Integrate with Spring Cloud
28+
29+
## Topics Covered
30+
31+
### Spring Boot Core
32+
- Auto-configuration and starters
33+
- Application properties and profiles
34+
- Bean lifecycle and configuration
35+
- DevTools and hot reload
36+
37+
### REST API Development
38+
- @RestController and @RequestMapping
39+
- Request/response handling
40+
- Validation with Bean Validation
41+
- Exception handling with @ControllerAdvice
42+
43+
### Spring Security
44+
- SecurityFilterChain configuration
45+
- OAuth2 and JWT authentication
46+
- Method security (@PreAuthorize)
47+
- CORS and CSRF configuration
48+
49+
### Spring Data JPA
50+
- Repository pattern
51+
- Query methods and @Query
52+
- Pagination and sorting
53+
- Auditing and transactions
54+
55+
### Actuator & Monitoring
56+
- Health checks and probes
57+
- Metrics with Micrometer
58+
- Custom endpoints
59+
- Prometheus integration
60+
61+
## Quick Reference
62+
63+
```java
64+
// REST Controller
65+
@RestController
66+
@RequiredArgsConstructor
67+
@Slf4j
68+
@Validated
69+
@Tag(name = "02. Survey-units", description = "Endpoints for survey-units")
70+
public class SurveyUnitClosingController {
71+
72+
private final DomainFeaturePort domainFeaturePort;
73+
74+
// Example Post
75+
@PostMapping(API_PATH)
76+
public ResponseEntity<Void> addClosingCauseToMultipleSurveyUnits(
77+
@RequestBody @Valid ObjectRequest request) {
78+
79+
domainFeaturePort.domainMethod(request.getObject1(), request.getObject2());
80+
return ResponseEntity.ok().build();
81+
}
82+
}
83+
```
84+
85+
## Common Patterns
86+
87+
### Validation Patterns
88+
```java
89+
public record CreateUserRequest(
90+
@NotBlank @Size(max = 100) String name,
91+
@Email @NotBlank String email,
92+
@NotNull @Min(18) Integer age
93+
) {}
94+
```
95+
96+
## Troubleshooting
97+
98+
### Common Issues
99+
100+
| Problem | Cause | Solution |
101+
|---------|-------|----------|
102+
| Bean not found | Missing @Component | Add annotation or @Bean |
103+
| Circular dependency | Constructor injection | Use @Lazy or refactor |
104+
| Slow startup | Heavy auto-config | Exclude unused starters |
105+
106+
107+
### Debug Checklist
108+
```
109+
□ Check /actuator/conditions
110+
□ Verify active profiles
111+
□ Review security filter chain
112+
□ Check bean definitions
113+
□ Test health endpoints
114+
```

0 commit comments

Comments
 (0)