Repository navigation
Releases
Releases · TheBeardedBearSAS/urssaf-tierce-declaration-cesu
v0.1.0
First release.
Upgrading
- Driver
doctrine: generate and run the migration for theurssaf_cesu_*tables (doctrine:migrations:diff,
doctrine:migrations:migrate); the package ships no migration.urssaf:cesu:checkreports the missing tables.
Added
- Project skeleton: Docker tooling, quality gates (
make ci) and GitHub Actions CI, identical to the other URSSAF
packages. - Signed releases (workflow
release.yml): each GitHub release carries the distribution archive, itsSHA256SUMS
and a SLSA build provenance attestation (*.intoto.jsonl, Sigstore); see Verifying a release in SECURITY.md. - CodeQL analysis of the GitHub Actions workflows (workflow
codeql.yml) on every pull request and push tomain. - Specification and documentation: official OpenAPI contracts (
docs/openapi/), technical reference
(docs/api-reference.md, links to the official documentation, local copy in the git-ignoreddocs/reference/),
roadmap, architecture decision records (docs/adr/: the inherited architecture, ADR 0000, and the CESU-specific
decisions, ADR 0001 to 0015),docs/workflow.md,docs/integration-events.md,docs/standalone.md,
docs/symfony.md,docs/doctrine.mdanddocs/testing.md. - Domain layer (
src/Domain): shared value objects (tenant, external reference, calendar date, instant, money in cents,
half-days, e-mail, phone, country code, Cesu number), exception hierarchy and validation notification pattern;
employer registration input, address and bank details, 020 status snapshot; employee identification sum type;
declaration sum type (standard, Cesu+), incomes, supplements, paid leave, foster carer approval, result; contribution
estimate; local lifecycles of employers, mandates and declarations (ADR 0006); drafts and factories reporting every
violation; local pre-checks (ADR 0009). - Application ports and wire layer: ports for credentials, token store, clock, id generator, rate limiter, event
publisher, outbox and integration event sink, transactions and workflow statistics; theCesuGatewayport split per
operation (010 to 070) with its DTOs, raw API errors, their classification (ErrorKind,BusinessError, ADR 0005)
and the gateway exceptions includingOutcomeUnknown(ADR 0003); public integration events (Contract\Event,
ADR 0012); wire layer (Infrastructure\Urssaf\Wire) with float-free JSON encoding, date-only dates (ADR 0001),
amounts in cents,accordencoding (ADR 0008), request and response mappers of every operation, error payload parser
andERR_METIERclassifier. - HTTP gateway (
Infrastructure\Urssaf):UrssafHttpGatewayimplementing every CESU operation over PSR-18 / PSR-17,
built withUrssafGatewayFactory; OAuth2 client credentials with a shared token cache, one replay after a 401,
Retry-After, status mapping (ADR 0002), unknown outcomes for 010 / 050 / 060 / 070 (ADR 0003), optional request-id
and application-id headers, business time zone. Adapters: in-memory, PSR-6 and PSR-16 token stores, PSR-20 and frozen
clocks, UUID v4 generator, no-op and sliding-window rate limiters (2 500 calls per hour per tenant, ADR 0011),
in-memory credentials provider, PSR-3 failure reporter. Runtime dependencies onpsr/cache,psr/clock,
psr/event-dispatcher,psr/http-client,psr/http-factory,psr/http-message,psr/logandpsr/simple-cache. - Application layer (
src/Application):RegisterEmployer(010, synchronous, bank details never stored),
ImportEmployer,RegisterMandate(030),CancelMandate(031),SyncEmployerStatus/SyncEmployerStatuses/
SyncAllEmployerStatuses(020),ActivateCesuPlus(060),ActivateAici(070),DeclareSalary(050: idempotent per
tenant and external reference, mandate guard, atomic claim, unknown outcomes never resent),
ResolveDeclarationOutcome,ReconcileStaleDeclarations,RequeueAfterInvalidCredentials,RelayOutbox,
PurgeOutbox; queriesVerifyEmployer,VerifyEmployee,EstimateContributions,GetEmployerAccount,
GetDeclaration,FindDeclarations,GetWorkflowOverview;WorkflowPolicy;UnitOfWorkpublishing domain events
after commit and writing integration events to an outbox; in-memory repositories, statistics and outbox. - Framework-agnostic wiring (
src/Standalone):UrssafTierceDeclarationCesuBuilderandUrssafTierceDeclarationCesu
(one accessor per use case). Testing simulator (src/Testing):SimulatedCesuGateway, an in-memory CESU platform for
host test suites (scripted failures, refusals and lost answers, call inspection). - Symfony bundle (
UrssafTierceDeclarationCesuBundle, Symfony 6.4 and 7.x) and Flex recipe: configuration tree,
gateway, token pool, persistence drivers, outbox sinks,urssaf:cesu:*console commands, Messenger messages, locks,
Scheduler schedule, installation diagnostics, English / French translations of the violation codes, and
bin/build-flex-endpoint(ADR 0013). - Doctrine bridge (ORM 3 / DBAL 4): XML mapping (tables
urssaf_cesu_*), DBAL types, repositories with atomic claims and
optimistic locking, outbox, workflow statistics, transaction manager;withDoctrine()for the standalone builder; the
Symfonydoctrinepersistence driver with a database schema check. No IBAN, BIC nor NIR column (ADR 0007, 0014). - Sandbox contract tests (
tests/Contract,make test-contract, manual CI jobcontract): read-only checks and
opt-in writes (URSSAF_SANDBOX_ALLOW_WRITES=1), a redacted observation report (var/contract/sandbox-report.json)
for the open points of api-reference §5, optionalURSSAF_SANDBOX_TOKEN_URI. - GDPR employer erasure (ADR 0015):
ForgetEmployer/ForgetEmployerHandlererase an employer account, its mandates
and its declaration records from the local store in one transaction (EmployerErasurelists the erased ids), refuse
the erasures that would break the workflow guarantees withEmployerErasureRefused(submission in flight, unknown
outcome, active mandate; the two opt-ins default toWorkflowPolicy,workflow.erasure.allow_unknown_outcomesand
workflow.erasure.allow_active_mandatein the Symfony bundle), record the integration event
urssaf.cesu.employer.forgottenand never call URSSAF. Standalone accessorforgetEmployer()and console command
urssaf:cesu:employer:forget.
Changed
- Custom repositories (
custompersistence driver) must implementMandateRepository::delete(),
DeclarationRecordRepository::countByEmployer()andDeclarationRecordRepository::deleteByEmployer(). - CI: verifiable quality proofs (Codecov, Stryker Dashboard, SonarQube Cloud, OpenSSF Scorecard; active once the
repository is public), every GitHub Action pinned to a commit SHA and kept up to date by Dependabot, hadolint on the
Dockerfile (make hadolint, part ofmake ci) with a non-root development image, and benchmarks with PHPBench
(make bench, CI jobbenchmark, isolated intools/phpbench). - CI: the SonarQube Cloud analysis also requires the repository variable
SONARCLOUD=enabled, set once the
project is imported on SonarQube Cloud. - The package is open source under the MIT license (previously proprietary). Added
CONTRIBUTING.mdand
SECURITY.md, and a notice in the README stating that the package is unofficial and not affiliated with URSSAF. - README: maintainer (The Bearded Bear), the other URSSAF packages and professional support, architecture overview,
quick starts (standalone and Symfony) and the sandbox contract test variables; composerauthorsnow points to
https://the-bearded-bear.com. - PHPStan analyses against the lowest supported PHP version (
phpVersion: 80200inphpstan.neon.dist, composer
phpis>=8.2), so that PHP 8.3+ runtimes do not demand typed class constants, a feature the package cannot use.