From f881488549178bfa3dae9c8e8ddfeebb3a1e2787 Mon Sep 17 00:00:00 2001 From: tristan Date: Fri, 23 Jan 2026 17:14:45 +0100 Subject: [PATCH] feat : ajout du bundle Malio ednotif pour l'utilisation des WS --- .idea/ferme.iml | 1 + .idea/php.xml | 138 +++---- .idea/workspace.xml | 161 ++++---- composer.json | 9 +- composer.lock | 449 +++++++++++----------- config/bundles.php | 4 + config/packages/ednotif.yaml | 13 + config/reference.php | 33 ++ docker-compose.yml | 2 + docker/php/Dockerfile | 5 + src/ApiResource/BovinIdentification.php | 44 +++ src/ApiResource/PresencePeriod.php | 14 + src/State/BovinIdentificationProvider.php | 70 ++++ symfony.lock | 16 + 14 files changed, 581 insertions(+), 378 deletions(-) create mode 100644 config/packages/ednotif.yaml create mode 100644 src/ApiResource/BovinIdentification.php create mode 100644 src/ApiResource/PresencePeriod.php create mode 100644 src/State/BovinIdentificationProvider.php diff --git a/.idea/ferme.iml b/.idea/ferme.iml index a590ed6..6a0c96f 100644 --- a/.idea/ferme.iml +++ b/.idea/ferme.iml @@ -147,6 +147,7 @@ + diff --git a/.idea/php.xml b/.idea/php.xml index 1a8c92c..18f7966 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -12,97 +12,53 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + @@ -156,8 +112,52 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 46513da..d24f2c2 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,7 +4,7 @@ - + @@ -12,12 +12,11 @@ - + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + @@ -208,8 +163,52 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { @@ -279,7 +278,7 @@ - + - @@ -587,7 +594,6 @@ - @@ -612,7 +618,8 @@ - diff --git a/composer.json b/composer.json index 6d1baf1..c54611c 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "doctrine/orm": "^3.6", "dompdf/dompdf": "^3.1", "lexik/jwt-authentication-bundle": "*", - "malio/ednotif-bundle": "*", + "malio/ednotif-bundle": "0.0.1", "nelmio/cors-bundle": "^2.6", "phpdocumentor/reflection-docblock": "^5.6", "phpstan/phpdoc-parser": "^2.3", @@ -97,11 +97,8 @@ }, "repositories": [ { - "type": "path", - "url": "ednotif-bundle", - "options": { - "symlink": true - } + "type": "vcs", + "url": "https://gitea.malio.fr/MALIO-DEV/ednotif-bundle" } ] } diff --git a/composer.lock b/composer.lock index 710379e..730e423 100644 --- a/composer.lock +++ b/composer.lock @@ -4,64 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "529cc00514b5b7165d7fdc980f7e2606", + "content-hash": "7610b5a8d12b9c2c21e4b3b404465b04", "packages": [ - { - "name": "Malio/ednotif-bundle", - "version": "0.0.1", - "dist": { - "type": "path", - "url": "ednotif-bundle", - "reference": "b279f1ac478bcbb81793dab216fe82b1139113db" - }, - "require": { - "ext-soap": "*", - "ext-xml": "*", - "php": "^8.4", - "psr/log": "^3.0", - "symfony/cache": "^8.0", - "symfony/config": "^8.0", - "symfony/dependency-injection": "^8.0", - "symfony/framework-bundle": "^8.0", - "symfony/http-kernel": "^8.0", - "symfony/options-resolver": "^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^12.0", - "symfony/phpunit-bridge": "^8.0" - }, - "type": "symfony-bundle", - "autoload": { - "psr-4": { - "Malio\\EdnotifBundle\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Malio\\EdnotifBundle\\Tests\\": "tests/" - } - }, - "license": [ - "MIT" - ], - "description": "Client EDNOTIF (Guichet + wsIpBNotif) pour Symfony", - "transport-options": { - "symlink": true, - "relative": true - } - }, { "name": "api-platform/doctrine-common", - "version": "v4.2.11", + "version": "v4.2.14", "source": { "type": "git", "url": "https://github.com/api-platform/doctrine-common.git", - "reference": "281f2ef1433253ec63a4f845622639665c1d68c5" + "reference": "a29e9015ecf4547485ec7fbce52da4ee95c282a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/api-platform/doctrine-common/zipball/281f2ef1433253ec63a4f845622639665c1d68c5", - "reference": "281f2ef1433253ec63a4f845622639665c1d68c5", + "url": "https://api.github.com/repos/api-platform/doctrine-common/zipball/a29e9015ecf4547485ec7fbce52da4ee95c282a0", + "reference": "a29e9015ecf4547485ec7fbce52da4ee95c282a0", "shasum": "" }, "require": { @@ -79,7 +35,7 @@ "doctrine/mongodb-odm": "^2.10", "doctrine/orm": "^2.17 || ^3.0", "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/type-info": "^7.3 || ^8.0" }, "suggest": { @@ -136,22 +92,22 @@ "rest" ], "support": { - "source": "https://github.com/api-platform/doctrine-common/tree/v4.2.11" + "source": "https://github.com/api-platform/doctrine-common/tree/v4.2.14" }, - "time": "2025-12-04T14:20:26+00:00" + "time": "2026-01-12T13:36:15+00:00" }, { "name": "api-platform/doctrine-orm", - "version": "v4.2.11", + "version": "v4.2.14", "source": { "type": "git", "url": "https://github.com/api-platform/doctrine-orm.git", - "reference": "6ea550f2db2db04979aefd654c115ecd6f897039" + "reference": "7a7c5cb7261ead50481a9a2d8ef721e21ea97945" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/api-platform/doctrine-orm/zipball/6ea550f2db2db04979aefd654c115ecd6f897039", - "reference": "6ea550f2db2db04979aefd654c115ecd6f897039", + "url": "https://api.github.com/repos/api-platform/doctrine-orm/zipball/7a7c5cb7261ead50481a9a2d8ef721e21ea97945", + "reference": "7a7c5cb7261ead50481a9a2d8ef721e21ea97945", "shasum": "" }, "require": { @@ -164,7 +120,7 @@ "require-dev": { "doctrine/doctrine-bundle": "^2.11 || ^3.1", "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "ramsey/uuid": "^4.7", "ramsey/uuid-doctrine": "^2.0", "symfony/cache": "^6.4 || ^7.0 || ^8.0", @@ -223,22 +179,22 @@ "rest" ], "support": { - "source": "https://github.com/api-platform/doctrine-orm/tree/v4.2.11" + "source": "https://github.com/api-platform/doctrine-orm/tree/v4.2.14" }, - "time": "2025-12-04T14:20:26+00:00" + "time": "2026-01-23T14:24:03+00:00" }, { "name": "api-platform/documentation", - "version": "v4.2.11", + "version": "v4.2.14", "source": { "type": "git", "url": "https://github.com/api-platform/documentation.git", - "reference": "8910f2a0aa7910ed807f128510553b24152e5ea5" + "reference": "873543a827df5c25b008bd730f2096701e1943b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/api-platform/documentation/zipball/8910f2a0aa7910ed807f128510553b24152e5ea5", - "reference": "8910f2a0aa7910ed807f128510553b24152e5ea5", + "url": "https://api.github.com/repos/api-platform/documentation/zipball/873543a827df5c25b008bd730f2096701e1943b8", + "reference": "873543a827df5c25b008bd730f2096701e1943b8", "shasum": "" }, "require": { @@ -246,7 +202,7 @@ "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "11.5.x-dev" + "phpunit/phpunit": "^12.2" }, "type": "project", "extra": { @@ -286,22 +242,22 @@ ], "description": "API Platform documentation controller.", "support": { - "source": "https://github.com/api-platform/documentation/tree/v4.2.11" + "source": "https://github.com/api-platform/documentation/tree/v4.2.14" }, - "time": "2025-11-30T12:55:42+00:00" + "time": "2025-12-27T22:15:57+00:00" }, { "name": "api-platform/http-cache", - "version": "v4.2.11", + "version": "v4.2.14", "source": { "type": "git", "url": "https://github.com/api-platform/http-cache.git", - "reference": "4bb2eab81407f493f54f51be7aa1918f362c14b5" + "reference": "04a9239b67425f68ed2d372c2c731f14342dea45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/api-platform/http-cache/zipball/4bb2eab81407f493f54f51be7aa1918f362c14b5", - "reference": "4bb2eab81407f493f54f51be7aa1918f362c14b5", + "url": "https://api.github.com/repos/api-platform/http-cache/zipball/04a9239b67425f68ed2d372c2c731f14342dea45", + "reference": "04a9239b67425f68ed2d372c2c731f14342dea45", "shasum": "" }, "require": { @@ -313,7 +269,7 @@ "require-dev": { "guzzlehttp/guzzle": "^6.0 || ^7.0 || ^8.0", "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/dependency-injection": "^6.4 || ^7.0 || ^8.0", "symfony/http-client": "^6.4 || ^7.0 || ^8.0", "symfony/type-info": "^7.3 || ^8.0" @@ -366,22 +322,22 @@ "rest" ], "support": { - "source": "https://github.com/api-platform/http-cache/tree/v4.2.11" + "source": "https://github.com/api-platform/http-cache/tree/v4.2.14" }, - "time": "2025-11-30T12:55:42+00:00" + "time": "2026-01-12T13:36:15+00:00" }, { "name": "api-platform/hydra", - "version": "v4.2.11", + "version": "v4.2.14", "source": { "type": "git", "url": "https://github.com/api-platform/hydra.git", - "reference": "80491f175647d0a63eb96035b2468fc1c2a76c37" + "reference": "866611a986f4f52da7807b04a0b2cf64e314ab56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/api-platform/hydra/zipball/80491f175647d0a63eb96035b2468fc1c2a76c37", - "reference": "80491f175647d0a63eb96035b2468fc1c2a76c37", + "url": "https://api.github.com/repos/api-platform/hydra/zipball/866611a986f4f52da7807b04a0b2cf64e314ab56", + "reference": "866611a986f4f52da7807b04a0b2cf64e314ab56", "shasum": "" }, "require": { @@ -401,7 +357,7 @@ "api-platform/doctrine-orm": "^4.2", "phpspec/prophecy": "^1.19", "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev" + "phpunit/phpunit": "^12.2" }, "type": "library", "extra": { @@ -453,22 +409,22 @@ "rest" ], "support": { - "source": "https://github.com/api-platform/hydra/tree/v4.2.11" + "source": "https://github.com/api-platform/hydra/tree/v4.2.14" }, - "time": "2025-12-18T14:34:13+00:00" + "time": "2025-12-27T22:15:57+00:00" }, { "name": "api-platform/json-schema", - "version": "v4.2.11", + "version": "v4.2.14", "source": { "type": "git", "url": "https://github.com/api-platform/json-schema.git", - "reference": "6a5f901a744018e48b8b94bbf798cd4f617cfcde" + "reference": "b69ebff7277655c1eb91bc0092fad4bc80aed4fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/api-platform/json-schema/zipball/6a5f901a744018e48b8b94bbf798cd4f617cfcde", - "reference": "6a5f901a744018e48b8b94bbf798cd4f617cfcde", + "url": "https://api.github.com/repos/api-platform/json-schema/zipball/b69ebff7277655c1eb91bc0092fad4bc80aed4fb", + "reference": "b69ebff7277655c1eb91bc0092fad4bc80aed4fb", "shasum": "" }, "require": { @@ -482,7 +438,7 @@ }, "require-dev": { "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev" + "phpunit/phpunit": "^12.2" }, "type": "library", "extra": { @@ -534,22 +490,22 @@ "swagger" ], "support": { - "source": "https://github.com/api-platform/json-schema/tree/v4.2.11" + "source": "https://github.com/api-platform/json-schema/tree/v4.2.14" }, - "time": "2025-12-02T13:32:19+00:00" + "time": "2026-01-23T14:31:09+00:00" }, { "name": "api-platform/jsonld", - "version": "v4.2.11", + "version": "v4.2.14", "source": { "type": "git", "url": "https://github.com/api-platform/jsonld.git", - "reference": "3889b185376198a182d2527c48ec0b29b604505f" + "reference": "ef0a361b0f29158243478d3fff5038ec2f5aa76c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/api-platform/jsonld/zipball/3889b185376198a182d2527c48ec0b29b604505f", - "reference": "3889b185376198a182d2527c48ec0b29b604505f", + "url": "https://api.github.com/repos/api-platform/jsonld/zipball/ef0a361b0f29158243478d3fff5038ec2f5aa76c", + "reference": "ef0a361b0f29158243478d3fff5038ec2f5aa76c", "shasum": "" }, "require": { @@ -559,7 +515,7 @@ "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/type-info": "^7.3 || ^8.0" }, "type": "library", @@ -614,22 +570,22 @@ "rest" ], "support": { - "source": "https://github.com/api-platform/jsonld/tree/v4.2.11" + "source": "https://github.com/api-platform/jsonld/tree/v4.2.14" }, - "time": "2025-12-18T14:34:13+00:00" + "time": "2026-01-12T13:36:15+00:00" }, { "name": "api-platform/metadata", - "version": "v4.2.11", + "version": "v4.2.14", "source": { "type": "git", "url": "https://github.com/api-platform/metadata.git", - "reference": "533774ca55a4f2be9da72da344d5e3e2982fbc86" + "reference": "590195d1038e66a039f1847b43040b7e6b78475f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/api-platform/metadata/zipball/533774ca55a4f2be9da72da344d5e3e2982fbc86", - "reference": "533774ca55a4f2be9da72da344d5e3e2982fbc86", + "url": "https://api.github.com/repos/api-platform/metadata/zipball/590195d1038e66a039f1847b43040b7e6b78475f", + "reference": "590195d1038e66a039f1847b43040b7e6b78475f", "shasum": "" }, "require": { @@ -647,7 +603,7 @@ "api-platform/state": "^4.2.4", "phpspec/prophecy-phpunit": "^2.2", "phpstan/phpdoc-parser": "^1.29 || ^2.0", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/config": "^6.4 || ^7.0 || ^8.0", "symfony/routing": "^6.4 || ^7.0 || ^8.0", "symfony/var-dumper": "^6.4 || ^7.0 || ^8.0", @@ -712,22 +668,22 @@ "swagger" ], "support": { - "source": "https://github.com/api-platform/metadata/tree/v4.2.11" + "source": "https://github.com/api-platform/metadata/tree/v4.2.14" }, - "time": "2025-12-18T14:34:13+00:00" + "time": "2026-01-12T13:36:15+00:00" }, { "name": "api-platform/openapi", - "version": "v4.2.11", + "version": "v4.2.14", "source": { "type": "git", "url": "https://github.com/api-platform/openapi.git", - "reference": "ea49d6d7170f8ecc1c239e7769708628183096b8" + "reference": "39ed78187a4a8e7c1c1fc9b5a3ef3913e3e914e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/api-platform/openapi/zipball/ea49d6d7170f8ecc1c239e7769708628183096b8", - "reference": "ea49d6d7170f8ecc1c239e7769708628183096b8", + "url": "https://api.github.com/repos/api-platform/openapi/zipball/39ed78187a4a8e7c1c1fc9b5a3ef3913e3e914e3", + "reference": "39ed78187a4a8e7c1c1fc9b5a3ef3913e3e914e3", "shasum": "" }, "require": { @@ -746,7 +702,7 @@ "api-platform/doctrine-odm": "^4.2", "api-platform/doctrine-orm": "^4.2", "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/type-info": "^7.3 || ^8.0" }, "type": "library", @@ -802,22 +758,22 @@ "swagger" ], "support": { - "source": "https://github.com/api-platform/openapi/tree/v4.2.11" + "source": "https://github.com/api-platform/openapi/tree/v4.2.14" }, - "time": "2025-11-30T12:55:42+00:00" + "time": "2026-01-17T19:34:53+00:00" }, { "name": "api-platform/serializer", - "version": "v4.2.11", + "version": "v4.2.14", "source": { "type": "git", "url": "https://github.com/api-platform/serializer.git", - "reference": "a511d4ba522c3ebbd78c9e1f05e0918978d72a43" + "reference": "006df770d82860922c7faee493d5d3c14906f810" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/api-platform/serializer/zipball/a511d4ba522c3ebbd78c9e1f05e0918978d72a43", - "reference": "a511d4ba522c3ebbd78c9e1f05e0918978d72a43", + "url": "https://api.github.com/repos/api-platform/serializer/zipball/006df770d82860922c7faee493d5d3c14906f810", + "reference": "006df770d82860922c7faee493d5d3c14906f810", "shasum": "" }, "require": { @@ -837,7 +793,7 @@ "api-platform/openapi": "^4.2", "doctrine/collections": "^2.1", "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/mercure-bundle": "*", "symfony/type-info": "^7.3 || ^8.0", "symfony/var-dumper": "^6.4 || ^7.0 || ^8.0", @@ -895,22 +851,22 @@ "serializer" ], "support": { - "source": "https://github.com/api-platform/serializer/tree/v4.2.11" + "source": "https://github.com/api-platform/serializer/tree/v4.2.14" }, - "time": "2025-12-18T14:36:58+00:00" + "time": "2026-01-12T13:36:15+00:00" }, { "name": "api-platform/state", - "version": "v4.2.11", + "version": "v4.2.14", "source": { "type": "git", "url": "https://github.com/api-platform/state.git", - "reference": "b9644669f953a76742c9f49d571ff42c68e581d1" + "reference": "fa3e7b41bcb54e7ba6d3078de224620e422d6732" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/api-platform/state/zipball/b9644669f953a76742c9f49d571ff42c68e581d1", - "reference": "b9644669f953a76742c9f49d571ff42c68e581d1", + "url": "https://api.github.com/repos/api-platform/state/zipball/fa3e7b41bcb54e7ba6d3078de224620e422d6732", + "reference": "fa3e7b41bcb54e7ba6d3078de224620e422d6732", "shasum": "" }, "require": { @@ -925,7 +881,7 @@ "require-dev": { "api-platform/serializer": "^4.2.4", "api-platform/validator": "^4.2.4", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/http-foundation": "^6.4.14 || ^7.0 || ^8.0", "symfony/object-mapper": "^7.4 || ^8.0", "symfony/type-info": "^7.4 || ^8.0", @@ -992,35 +948,35 @@ "swagger" ], "support": { - "source": "https://github.com/api-platform/state/tree/v4.2.11" + "source": "https://github.com/api-platform/state/tree/v4.2.14" }, - "time": "2025-12-17T15:10:17+00:00" + "time": "2026-01-12T13:36:15+00:00" }, { "name": "api-platform/symfony", - "version": "v4.2.11", + "version": "v4.2.14", "source": { "type": "git", "url": "https://github.com/api-platform/symfony.git", - "reference": "ab93a0043558beeb7ccd7f2c97304565d4872bb3" + "reference": "31539dc26bd88f54e43d2d8a24613ff988307da1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/api-platform/symfony/zipball/ab93a0043558beeb7ccd7f2c97304565d4872bb3", - "reference": "ab93a0043558beeb7ccd7f2c97304565d4872bb3", + "url": "https://api.github.com/repos/api-platform/symfony/zipball/31539dc26bd88f54e43d2d8a24613ff988307da1", + "reference": "31539dc26bd88f54e43d2d8a24613ff988307da1", "shasum": "" }, "require": { - "api-platform/documentation": "^4.2.3", - "api-platform/http-cache": "^4.2.3", - "api-platform/hydra": "^4.2.3", - "api-platform/json-schema": "^4.2.3", - "api-platform/jsonld": "^4.2.3", - "api-platform/metadata": "^4.2.3", - "api-platform/openapi": "^4.2.3", - "api-platform/serializer": "^4.2.4", - "api-platform/state": "^4.2.4", - "api-platform/validator": "^4.2.3", + "api-platform/documentation": "^4.2.12", + "api-platform/http-cache": "^4.2.12", + "api-platform/hydra": "^4.2.12", + "api-platform/json-schema": "^4.2.12", + "api-platform/jsonld": "^4.2.12", + "api-platform/metadata": "^4.2.12", + "api-platform/openapi": "^4.2.12", + "api-platform/serializer": "^4.2.12", + "api-platform/state": "^4.2.12", + "api-platform/validator": "^4.2.12", "php": ">=8.2", "symfony/asset": "^6.4 || ^7.0 || ^8.0", "symfony/finder": "^6.4 || ^7.0 || ^8.0", @@ -1031,14 +987,14 @@ "willdurand/negotiation": "^3.1" }, "require-dev": { - "api-platform/doctrine-common": "^4.2.3", - "api-platform/doctrine-odm": "^4.2.3", - "api-platform/doctrine-orm": "^4.2.3", - "api-platform/elasticsearch": "^4.2.3", - "api-platform/graphql": "^4.2.3", - "api-platform/hal": "^4.2.3", + "api-platform/doctrine-common": "^4.2.12", + "api-platform/doctrine-odm": "^4.2.12", + "api-platform/doctrine-orm": "^4.2.12", + "api-platform/elasticsearch": "^4.2.12", + "api-platform/graphql": "^4.2.12", + "api-platform/hal": "^4.2.12", "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev", + "phpunit/phpunit": "^12.2", "symfony/expression-language": "^6.4 || ^7.0 || ^8.0", "symfony/intl": "^6.4 || ^7.0 || ^8.0", "symfony/mercure-bundle": "*", @@ -1120,22 +1076,22 @@ "symfony" ], "support": { - "source": "https://github.com/api-platform/symfony/tree/v4.2.11" + "source": "https://github.com/api-platform/symfony/tree/v4.2.14" }, - "time": "2025-12-18T14:34:13+00:00" + "time": "2026-01-23T14:24:03+00:00" }, { "name": "api-platform/validator", - "version": "v4.2.11", + "version": "v4.2.14", "source": { "type": "git", "url": "https://github.com/api-platform/validator.git", - "reference": "850035ba6165e2452c1777bee2272205bf8c771e" + "reference": "346a5916d9706da9b0981ebec3d6278802e96ca9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/api-platform/validator/zipball/850035ba6165e2452c1777bee2272205bf8c771e", - "reference": "850035ba6165e2452c1777bee2272205bf8c771e", + "url": "https://api.github.com/repos/api-platform/validator/zipball/346a5916d9706da9b0981ebec3d6278802e96ca9", + "reference": "346a5916d9706da9b0981ebec3d6278802e96ca9", "shasum": "" }, "require": { @@ -1149,7 +1105,7 @@ }, "require-dev": { "phpspec/prophecy-phpunit": "^2.2", - "phpunit/phpunit": "11.5.x-dev" + "phpunit/phpunit": "^12.2" }, "type": "library", "extra": { @@ -1196,22 +1152,22 @@ "validator" ], "support": { - "source": "https://github.com/api-platform/validator/tree/v4.2.11" + "source": "https://github.com/api-platform/validator/tree/v4.2.14" }, - "time": "2025-12-04T14:20:26+00:00" + "time": "2026-01-16T13:22:15+00:00" }, { "name": "doctrine/collections", - "version": "2.4.0", + "version": "2.6.0", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "9acfeea2e8666536edff3d77c531261c63680160" + "reference": "7713da39d8e237f28411d6a616a3dce5e20d5de2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/9acfeea2e8666536edff3d77c531261c63680160", - "reference": "9acfeea2e8666536edff3d77c531261c63680160", + "url": "https://api.github.com/repos/doctrine/collections/zipball/7713da39d8e237f28411d6a616a3dce5e20d5de2", + "reference": "7713da39d8e237f28411d6a616a3dce5e20d5de2", "shasum": "" }, "require": { @@ -1268,7 +1224,7 @@ ], "support": { "issues": "https://github.com/doctrine/collections/issues", - "source": "https://github.com/doctrine/collections/tree/2.4.0" + "source": "https://github.com/doctrine/collections/tree/2.6.0" }, "funding": [ { @@ -1284,7 +1240,7 @@ "type": "tidelift" } ], - "time": "2025-10-25T09:18:13+00:00" + "time": "2026-01-15T10:01:58+00:00" }, { "name": "doctrine/common", @@ -1740,16 +1696,16 @@ }, { "name": "doctrine/event-manager", - "version": "2.0.1", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/event-manager.git", - "reference": "b680156fa328f1dfd874fd48c7026c41570b9c6e" + "reference": "c07799fcf5ad362050960a0fd068dded40b1e312" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/event-manager/zipball/b680156fa328f1dfd874fd48c7026c41570b9c6e", - "reference": "b680156fa328f1dfd874fd48c7026c41570b9c6e", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/c07799fcf5ad362050960a0fd068dded40b1e312", + "reference": "c07799fcf5ad362050960a0fd068dded40b1e312", "shasum": "" }, "require": { @@ -1759,10 +1715,10 @@ "doctrine/common": "<2.9" }, "require-dev": { - "doctrine/coding-standard": "^12", - "phpstan/phpstan": "^1.8.8", - "phpunit/phpunit": "^10.5", - "vimeo/psalm": "^5.24" + "doctrine/coding-standard": "^14", + "phpdocumentor/guides-cli": "^1.4", + "phpstan/phpstan": "^2.1.32", + "phpunit/phpunit": "^10.5.58" }, "type": "library", "autoload": { @@ -1811,7 +1767,7 @@ ], "support": { "issues": "https://github.com/doctrine/event-manager/issues", - "source": "https://github.com/doctrine/event-manager/tree/2.0.1" + "source": "https://github.com/doctrine/event-manager/tree/2.1.0" }, "funding": [ { @@ -1827,7 +1783,7 @@ "type": "tidelift" } ], - "time": "2024-05-22T20:47:39+00:00" + "time": "2026-01-17T22:40:21+00:00" }, { "name": "doctrine/inflector", @@ -1921,30 +1877,29 @@ }, { "name": "doctrine/instantiator", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" + "reference": "23da848e1a2308728fe5fdddabf4be17ff9720c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/23da848e1a2308728fe5fdddabf4be17ff9720c7", + "reference": "23da848e1a2308728fe5fdddabf4be17ff9720c7", "shasum": "" }, "require": { - "php": "^8.1" + "php": "^8.4" }, "require-dev": { - "doctrine/coding-standard": "^11", + "doctrine/coding-standard": "^14", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^10.5.58" }, "type": "library", "autoload": { @@ -1971,7 +1926,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.0.0" + "source": "https://github.com/doctrine/instantiator/tree/2.1.0" }, "funding": [ { @@ -1987,7 +1942,7 @@ "type": "tidelift" } ], - "time": "2022-12-30T00:23:10+00:00" + "time": "2026-01-05T06:47:08+00:00" }, { "name": "doctrine/lexer", @@ -2171,16 +2126,16 @@ }, { "name": "doctrine/orm", - "version": "3.6.0", + "version": "3.6.1", "source": { "type": "git", "url": "https://github.com/doctrine/orm.git", - "reference": "d4e9276e79602b1eb4c4029c6c999b0d93478e2f" + "reference": "2148940290e4c44b9101095707e71fb590832fa5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/orm/zipball/d4e9276e79602b1eb4c4029c6c999b0d93478e2f", - "reference": "d4e9276e79602b1eb4c4029c6c999b0d93478e2f", + "url": "https://api.github.com/repos/doctrine/orm/zipball/2148940290e4c44b9101095707e71fb590832fa5", + "reference": "2148940290e4c44b9101095707e71fb590832fa5", "shasum": "" }, "require": { @@ -2253,9 +2208,9 @@ ], "support": { "issues": "https://github.com/doctrine/orm/issues", - "source": "https://github.com/doctrine/orm/tree/3.6.0" + "source": "https://github.com/doctrine/orm/tree/3.6.1" }, - "time": "2025-12-19T20:36:14+00:00" + "time": "2026-01-09T05:28:15+00:00" }, { "name": "doctrine/persistence", @@ -2471,16 +2426,16 @@ }, { "name": "dompdf/php-font-lib", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/dompdf/php-font-lib.git", - "reference": "6137b7d4232b7f16c882c75e4ca3991dbcf6fe2d" + "reference": "a6e9a688a2a80016ac080b97be73d3e10c444c9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/6137b7d4232b7f16c882c75e4ca3991dbcf6fe2d", - "reference": "6137b7d4232b7f16c882c75e4ca3991dbcf6fe2d", + "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/a6e9a688a2a80016ac080b97be73d3e10c444c9a", + "reference": "a6e9a688a2a80016ac080b97be73d3e10c444c9a", "shasum": "" }, "require": { @@ -2488,7 +2443,7 @@ "php": "^7.1 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^3 || ^4 || ^5 || ^6" + "phpunit/phpunit": "^7.5 || ^8 || ^9 || ^10 || ^11 || ^12" }, "type": "library", "autoload": { @@ -2510,9 +2465,9 @@ "homepage": "https://github.com/dompdf/php-font-lib", "support": { "issues": "https://github.com/dompdf/php-font-lib/issues", - "source": "https://github.com/dompdf/php-font-lib/tree/1.0.1" + "source": "https://github.com/dompdf/php-font-lib/tree/1.0.2" }, - "time": "2024-12-02T14:37:59+00:00" + "time": "2026-01-20T14:10:26+00:00" }, { "name": "dompdf/php-svg-lib", @@ -2749,6 +2704,48 @@ ], "time": "2025-12-20T17:47:00+00:00" }, + { + "name": "malio/ednotif-bundle", + "version": "0.0.1", + "source": { + "type": "git", + "url": "https://gitea.malio.fr/MALIO-DEV/ednotif-bundle", + "reference": "7e0c084ebe81e210d8ea4c66eaa96a1fbabb4848" + }, + "require": { + "ext-soap": "*", + "ext-xml": "*", + "php": "^8.4", + "psr/log": "^3.0", + "symfony/cache": "^8.0", + "symfony/config": "^8.0", + "symfony/dependency-injection": "^8.0", + "symfony/framework-bundle": "^8.0", + "symfony/http-kernel": "^8.0", + "symfony/options-resolver": "^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.92", + "phpunit/phpunit": "^12.0", + "symfony/phpunit-bridge": "^8.0" + }, + "type": "symfony-bundle", + "autoload": { + "psr-4": { + "Malio\\EdnotifBundle\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Malio\\EdnotifBundle\\Tests\\": "tests/" + } + }, + "license": [ + "MIT" + ], + "description": "Client EDNOTIF (Guichet + wsIpBNotif) pour Symfony", + "time": "2026-01-23T15:19:50+00:00" + }, { "name": "masterminds/html5", "version": "2.10.0", @@ -2921,16 +2918,16 @@ }, { "name": "nelmio/cors-bundle", - "version": "2.6.0", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/nelmio/NelmioCorsBundle.git", - "reference": "530217472204881cacd3671909f634b960c7b948" + "reference": "3d80dbcd5d1eb5f8b20ed5199e1778d44c2e4d1c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nelmio/NelmioCorsBundle/zipball/530217472204881cacd3671909f634b960c7b948", - "reference": "530217472204881cacd3671909f634b960c7b948", + "url": "https://api.github.com/repos/nelmio/NelmioCorsBundle/zipball/3d80dbcd5d1eb5f8b20ed5199e1778d44c2e4d1c", + "reference": "3d80dbcd5d1eb5f8b20ed5199e1778d44c2e4d1c", "shasum": "" }, "require": { @@ -2980,9 +2977,9 @@ ], "support": { "issues": "https://github.com/nelmio/NelmioCorsBundle/issues", - "source": "https://github.com/nelmio/NelmioCorsBundle/tree/2.6.0" + "source": "https://github.com/nelmio/NelmioCorsBundle/tree/2.6.1" }, - "time": "2025-10-23T06:57:22+00:00" + "time": "2026-01-12T15:59:08+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -3161,16 +3158,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "2.3.0", + "version": "2.3.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495" + "reference": "16dbf9937da8d4528ceb2145c9c7c0bd29e26374" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1e0cd5370df5dd2e556a36b9c62f62e555870495", - "reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/16dbf9937da8d4528ceb2145c9c7c0bd29e26374", + "reference": "16dbf9937da8d4528ceb2145c9c7c0bd29e26374", "shasum": "" }, "require": { @@ -3202,9 +3199,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.1" }, - "time": "2025-08-30T15:50:23+00:00" + "time": "2026-01-12T11:33:04+00:00" }, { "name": "psr/cache", @@ -8214,16 +8211,16 @@ }, { "name": "webmozart/assert", - "version": "2.0.0", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "1b34b004e35a164bc5bb6ebd33c844b2d8069a54" + "reference": "ce6a2f100c404b2d32a1dd1270f9b59ad4f57649" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/1b34b004e35a164bc5bb6ebd33c844b2d8069a54", - "reference": "1b34b004e35a164bc5bb6ebd33c844b2d8069a54", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/ce6a2f100c404b2d32a1dd1270f9b59ad4f57649", + "reference": "ce6a2f100c404b2d32a1dd1270f9b59ad4f57649", "shasum": "" }, "require": { @@ -8270,9 +8267,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/2.0.0" + "source": "https://github.com/webmozarts/assert/tree/2.1.2" }, - "time": "2025-12-16T21:36:00+00:00" + "time": "2026-01-13T14:02:24+00:00" }, { "name": "willdurand/negotiation", @@ -8728,16 +8725,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.92.4", + "version": "v3.92.5", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "9e7488b19403423e02e8403cc1eb596baf4673b0" + "reference": "260cc8c4a1d2f6d2f22cd4f9c70aa72e55ebac58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/9e7488b19403423e02e8403cc1eb596baf4673b0", - "reference": "9e7488b19403423e02e8403cc1eb596baf4673b0", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/260cc8c4a1d2f6d2f22cd4f9c70aa72e55ebac58", + "reference": "260cc8c4a1d2f6d2f22cd4f9c70aa72e55ebac58", "shasum": "" }, "require": { @@ -8820,7 +8817,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.92.4" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.92.5" }, "funding": [ { @@ -8828,7 +8825,7 @@ "type": "github" } ], - "time": "2026-01-04T00:38:52+00:00" + "time": "2026-01-08T21:57:37+00:00" }, { "name": "myclabs/deep-copy", @@ -9402,16 +9399,16 @@ }, { "name": "phpunit/phpunit", - "version": "12.5.4", + "version": "12.5.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "4ba0e923f9d3fc655de22f9547c01d15a41fc93a" + "reference": "ab8e4374264bc65523d1458d14bf80261577e01f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4ba0e923f9d3fc655de22f9547c01d15a41fc93a", - "reference": "4ba0e923f9d3fc655de22f9547c01d15a41fc93a", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ab8e4374264bc65523d1458d14bf80261577e01f", + "reference": "ab8e4374264bc65523d1458d14bf80261577e01f", "shasum": "" }, "require": { @@ -9425,7 +9422,7 @@ "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=8.3", - "phpunit/php-code-coverage": "^12.5.1", + "phpunit/php-code-coverage": "^12.5.2", "phpunit/php-file-iterator": "^6.0.0", "phpunit/php-invoker": "^6.0.0", "phpunit/php-text-template": "^5.0.0", @@ -9479,7 +9476,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.4" + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.6" }, "funding": [ { @@ -9503,7 +9500,7 @@ "type": "tidelift" } ], - "time": "2025-12-15T06:05:34+00:00" + "time": "2026-01-16T16:28:10+00:00" }, { "name": "react/cache", @@ -11394,7 +11391,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": true, "prefer-lowest": false, "platform": { @@ -11402,6 +11399,6 @@ "ext-ctype": "*", "ext-iconv": "*" }, - "platform-dev": [], + "platform-dev": {}, "plugin-api-version": "2.9.0" } diff --git a/config/bundles.php b/config/bundles.php index 9af6e40..f7fa27d 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -6,11 +6,13 @@ use ApiPlatform\Symfony\Bundle\ApiPlatformBundle; use Doctrine\Bundle\DoctrineBundle\DoctrineBundle; use Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle; use Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle; +use Malio\EdnotifBundle\EdnotifBundle; use Nelmio\CorsBundle\NelmioCorsBundle; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\MonologBundle\MonologBundle; use Symfony\Bundle\SecurityBundle\SecurityBundle; use Symfony\Bundle\TwigBundle\TwigBundle; +use Symfony\Bundle\WebProfilerBundle\WebProfilerBundle; return [ FrameworkBundle::class => ['all' => true], @@ -22,4 +24,6 @@ return [ LexikJWTAuthenticationBundle::class => ['all' => true], ApiPlatformBundle::class => ['all' => true], MonologBundle::class => ['all' => true], + EdnotifBundle::class => ['all' => true], + WebProfilerBundle::class => ['dev' => true, 'test' => true], ]; diff --git a/config/packages/ednotif.yaml b/config/packages/ednotif.yaml new file mode 100644 index 0000000..bce226c --- /dev/null +++ b/config/packages/ednotif.yaml @@ -0,0 +1,13 @@ +ednotif: + guichet_wsdl: 'https://ws-reswel-elv.equade.fr/wsguichet/WsGuichet?wsdl' + metier_wsdl: 'https://ws-ednotif.equade.fr/wsIpBNotif/wsIpBNotif?wsdl' + entreprise: 'E860' + exploitation_number: '%env(string:EDNOTIF_EXPLOITATION_NUMERO)%' + exploitation_country_code: 'FR' + login: '%env(EDNOTIF_LOGIN)%' + password: '%env(EDNOTIF_PASSWORD)%' + token_ttl_seconds: 900 + soap_options: + trace: false + exceptions: true + connection_timeout: 15 diff --git a/config/reference.php b/config/reference.php index bd0651f..e89a2ef 100644 --- a/config/reference.php +++ b/config/reference.php @@ -1751,6 +1751,33 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param; * }, * }>, * } + * @psalm-type EdnotifConfig = array{ + * guichet_wsdl: scalar|null|Param, + * metier_wsdl: scalar|null|Param, + * entreprise: scalar|null|Param, + * zone?: scalar|null|Param, // Default: null + * application?: scalar|null|Param, // Default: null + * login: scalar|null|Param, + * password: scalar|null|Param, + * exploitation_number: scalar|null|Param, + * exploitation_country_code?: scalar|null|Param, // Default: "FR" + * token_ttl_seconds?: int|Param, // Default: 900 + * soap_options?: array{ + * trace?: bool|Param, // Default: false + * exceptions?: bool|Param, // Default: true + * connection_timeout?: int|Param, // Default: 15 + * cache_wsdl?: int|Param, // Default: 3 + * features?: int|Param, // Default: 1 + * }, + * } + * @psalm-type WebProfilerConfig = array{ + * toolbar?: bool|array{ // Profiler toolbar configuration + * enabled?: bool|Param, // Default: false + * ajax_replace?: bool|Param, // Replace toolbar on AJAX requests // Default: false + * }, + * intercept_redirects?: bool|Param, // Default: false + * excluded_ajax_paths?: scalar|null|Param, // Default: "^/((index|app(_[\\w]+)?)\\.php/)?_wdt" + * } * @psalm-type ConfigType = array{ * imports?: ImportsConfig, * parameters?: ParametersConfig, @@ -1764,6 +1791,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param; * lexik_jwt_authentication?: LexikJwtAuthenticationConfig, * api_platform?: ApiPlatformConfig, * monolog?: MonologConfig, + * ednotif?: EdnotifConfig, * "when@dev"?: array{ * imports?: ImportsConfig, * parameters?: ParametersConfig, @@ -1777,6 +1805,8 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param; * lexik_jwt_authentication?: LexikJwtAuthenticationConfig, * api_platform?: ApiPlatformConfig, * monolog?: MonologConfig, + * ednotif?: EdnotifConfig, + * web_profiler?: WebProfilerConfig, * }, * "when@prod"?: array{ * imports?: ImportsConfig, @@ -1791,6 +1821,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param; * lexik_jwt_authentication?: LexikJwtAuthenticationConfig, * api_platform?: ApiPlatformConfig, * monolog?: MonologConfig, + * ednotif?: EdnotifConfig, * }, * "when@test"?: array{ * imports?: ImportsConfig, @@ -1805,6 +1836,8 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param; * lexik_jwt_authentication?: LexikJwtAuthenticationConfig, * api_platform?: ApiPlatformConfig, * monolog?: MonologConfig, + * ednotif?: EdnotifConfig, + * web_profiler?: WebProfilerConfig, * }, * ... */ + public array $presencePeriods = []; +} diff --git a/src/ApiResource/PresencePeriod.php b/src/ApiResource/PresencePeriod.php new file mode 100644 index 0000000..ca20703 --- /dev/null +++ b/src/ApiResource/PresencePeriod.php @@ -0,0 +1,14 @@ + + */ +final class BovinIdentificationProvider implements ProviderInterface +{ + public function __construct( + private BovinApiInterface $bovinApi + ) {} + + public function provide(Operation $operation, array $uriVariables = [], array $context = []): ?BovinIdentification + { + $numeroNational = (string) ($uriVariables['numeroNational'] ?? ''); + if ('' === $numeroNational) { + return null; + } + + $animalFileDto = $this->bovinApi->getAnimalFile( + nationalNumber: $numeroNational, + countryCode: 'FR' + ); + + $identificationDto = $animalFileDto->identification; + + $resource = new BovinIdentification(); + $resource->numeroNational = $numeroNational; + + $resource->sex = $identificationDto?->sex; + $resource->breedType = $identificationDto?->breedType; + $resource->workNumber = $identificationDto?->workNumber; + + $resource->birthDate = $identificationDto?->birthDate?->date?->format('Y-m-d'); + $resource->birthDateCompletenessFlag = $identificationDto?->birthDate?->completenessFlag; + + $resource->isFilie = $identificationDto?->isFilie; + + $resource->motherNationalNumber = $identificationDto?->motherCarrier?->bovin?->nationalNumber; + $resource->motherBreedType = $identificationDto?->motherCarrier?->breedType; + + $resource->fatherNationalNumber = $identificationDto?->fatherIpg?->bovin?->nationalNumber; + $resource->fatherBreedType = $identificationDto?->fatherIpg?->breedType; + + $resource->birthExploitationNumber = $identificationDto?->birthExploitation?->exploitationNumber; + + foreach ($animalFileDto->presencePeriods as $presencePeriodDto) { + $presencePeriod = new PresencePeriod(); + + $presencePeriod->entryDate = $presencePeriodDto->entry?->date?->format('Y-m-d'); + $presencePeriod->entryCause = $presencePeriodDto->entry?->cause; + + $presencePeriod->exitDate = $presencePeriodDto->exit?->date?->format('Y-m-d'); + $presencePeriod->exitCause = $presencePeriodDto->exit?->cause; + + $resource->presencePeriods[] = $presencePeriod; + } + + return $resource; + } +} diff --git a/symfony.lock b/symfony.lock index db811f6..38273ee 100644 --- a/symfony.lock +++ b/symfony.lock @@ -73,6 +73,9 @@ "config/packages/lexik_jwt_authentication.yaml" ] }, + "malio/ednotif-bundle": { + "version": "0.0.1" + }, "nelmio/cors-bundle": { "version": "2.6", "recipe": { @@ -228,5 +231,18 @@ "files": [ "config/packages/validator.yaml" ] + }, + "symfony/web-profiler-bundle": { + "version": "8.0", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "7.3", + "ref": "a363460c1b0b4a4d0242f2ce1a843ca0f6ac9026" + }, + "files": [ + "config/packages/web_profiler.yaml", + "config/routes/web_profiler.yaml" + ] } }