Compare commits

...
5 Commits
Author SHA1 Message Date
fromme 3116d23199 fix: refuse deleting a document assigned to a season task 2026-10-15 13:02:13 +02:00
fromme 4aa2d7a5e6 fix: keep upload files until their deletion is committed 2026-10-15 12:49:48 +02:00
frommeandClaude Opus 5.5 7e182e3d51 feat: per-disposition feedback waiver
The overdue-feedback lists are a live query without stored state, so a
feedback nobody will provide any more could not be written off. The new
disposition.feedback_waived flag takes a placement out of the admin and
manager dashboards, the house-manager list and the reminder mail.

Statistics still count a waived placement as a missing feedback. The
flag has no UI yet and is set by SQL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 13:53:25 +02:00
fromme c04d9e0faf chore: update project dependencies 2026-10-13 12:53:44 +02:00
fromme 3188f5f3da feat: additional 'add' button on top of list view 2026-10-13 12:52:28 +02:00
18 changed files with 716 additions and 148 deletions

No files matched your search

Generated
+140 -118
View File
@@ -1149,16 +1149,16 @@
},
{
"name": "doctrine/migrations",
"version": "3.9.7",
"version": "3.9.8",
"source": {
"type": "git",
"url": "https://github.com/doctrine/migrations.git",
"reference": "96cb2a89b56c9efb0bac38e606dc0b0f13e650ec"
"reference": "eb0b9ce3f999d720fa73037bbd06977ea34b76a0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/migrations/zipball/96cb2a89b56c9efb0bac38e606dc0b0f13e650ec",
"reference": "96cb2a89b56c9efb0bac38e606dc0b0f13e650ec",
"url": "https://api.github.com/repos/doctrine/migrations/zipball/eb0b9ce3f999d720fa73037bbd06977ea34b76a0",
"reference": "eb0b9ce3f999d720fa73037bbd06977ea34b76a0",
"shasum": ""
},
"require": {
@@ -1232,7 +1232,7 @@
],
"support": {
"issues": "https://github.com/doctrine/migrations/issues",
"source": "https://github.com/doctrine/migrations/tree/3.9.7"
"source": "https://github.com/doctrine/migrations/tree/3.9.8"
},
"funding": [
{
@@ -1248,20 +1248,20 @@
"type": "tidelift"
}
],
"time": "2026-04-23T19:33:20+00:00"
"time": "2026-10-04T12:35:58+00:00"
},
{
"name": "doctrine/orm",
"version": "3.7.2",
"version": "3.7.5",
"source": {
"type": "git",
"url": "https://github.com/doctrine/orm.git",
"reference": "6b47a02cd1d7119ef4d8f90ca6d49651accef1a3"
"reference": "00c2fd70da291cca1ec75f4dae5344fe3df588fa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/orm/zipball/6b47a02cd1d7119ef4d8f90ca6d49651accef1a3",
"reference": "6b47a02cd1d7119ef4d8f90ca6d49651accef1a3",
"url": "https://api.github.com/repos/doctrine/orm/zipball/00c2fd70da291cca1ec75f4dae5344fe3df588fa",
"reference": "00c2fd70da291cca1ec75f4dae5344fe3df588fa",
"shasum": ""
},
"require": {
@@ -1336,22 +1336,22 @@
],
"support": {
"issues": "https://github.com/doctrine/orm/issues",
"source": "https://github.com/doctrine/orm/tree/3.7.2"
"source": "https://github.com/doctrine/orm/tree/3.7.5"
},
"time": "2026-09-23T05:28:00+00:00"
"time": "2026-10-09T05:58:13+00:00"
},
{
"name": "doctrine/persistence",
"version": "4.2.0",
"version": "4.2.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/persistence.git",
"reference": "49ab73e0d3e2ac8d1f5ecda3dd8acd5503781e8b"
"reference": "d8293831c5b99449b2f63eb1e1bbdc202118daa6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/persistence/zipball/49ab73e0d3e2ac8d1f5ecda3dd8acd5503781e8b",
"reference": "49ab73e0d3e2ac8d1f5ecda3dd8acd5503781e8b",
"url": "https://api.github.com/repos/doctrine/persistence/zipball/d8293831c5b99449b2f63eb1e1bbdc202118daa6",
"reference": "d8293831c5b99449b2f63eb1e1bbdc202118daa6",
"shasum": ""
},
"require": {
@@ -1416,7 +1416,7 @@
],
"support": {
"issues": "https://github.com/doctrine/persistence/issues",
"source": "https://github.com/doctrine/persistence/tree/4.2.0"
"source": "https://github.com/doctrine/persistence/tree/4.2.1"
},
"funding": [
{
@@ -1432,7 +1432,7 @@
"type": "tidelift"
}
],
"time": "2026-04-26T12:12:52+00:00"
"time": "2026-10-03T14:15:35+00:00"
},
{
"name": "doctrine/sql-formatter",
@@ -2462,31 +2462,30 @@
},
{
"name": "knplabs/knp-menu-bundle",
"version": "v3.7.0",
"version": "v3.8.0",
"source": {
"type": "git",
"url": "https://github.com/KnpLabs/KnpMenuBundle.git",
"reference": "aa22e57f8f41c34ad5e382aae4d0c12998c0eb5a"
"reference": "52407da3ac631077fc64f1c2641f35e06e07bbf8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/KnpLabs/KnpMenuBundle/zipball/aa22e57f8f41c34ad5e382aae4d0c12998c0eb5a",
"reference": "aa22e57f8f41c34ad5e382aae4d0c12998c0eb5a",
"url": "https://api.github.com/repos/KnpLabs/KnpMenuBundle/zipball/52407da3ac631077fc64f1c2641f35e06e07bbf8",
"reference": "52407da3ac631077fc64f1c2641f35e06e07bbf8",
"shasum": ""
},
"require": {
"knplabs/knp-menu": "^3.8",
"php": "^8.1",
"symfony/config": "^6.4 | ^7.0 | ^8.0",
"symfony/dependency-injection": "^6.4 | ^7.0 | ^8.0",
"symfony/deprecation-contracts": "^2.5 | ^3.3",
"symfony/http-kernel": "^6.4 | ^7.0 | ^8.0"
"php": "^8.2",
"symfony/config": "^6.4 || ^7.4 || ^8.0",
"symfony/dependency-injection": "^6.4 || ^7.4 || ^8.0",
"symfony/deprecation-contracts": "^2.5 || ^3.3",
"symfony/http-kernel": "^6.4 || ^7.4 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^10.5 | ^11.5 | ^12.4",
"symfony/expression-language": "^6.4 | ^7.0 | ^8.0",
"symfony/phpunit-bridge": "^7.0 | ^8.0",
"symfony/templating": "^6.4 | ^7.0 | ^8.0"
"phpunit/phpunit": "^11.5 || ^12.5 || ^13.2",
"symfony/expression-language": "^6.4 || ^7.4 || ^8.0",
"symfony/phpunit-bridge": "^7.4 || ^8.0"
},
"type": "symfony-bundle",
"extra": {
@@ -2523,9 +2522,9 @@
],
"support": {
"issues": "https://github.com/KnpLabs/KnpMenuBundle/issues",
"source": "https://github.com/KnpLabs/KnpMenuBundle/tree/v3.7.0"
"source": "https://github.com/KnpLabs/KnpMenuBundle/tree/v3.8.0"
},
"time": "2025-11-30T08:30:04+00:00"
"time": "2026-10-11T15:22:17+00:00"
},
{
"name": "knplabs/knp-paginator-bundle",
@@ -3169,22 +3168,22 @@
},
{
"name": "liip/imagine-bundle",
"version": "2.17.2",
"version": "2.18.1",
"source": {
"type": "git",
"url": "https://github.com/liip/LiipImagineBundle.git",
"reference": "548846e07d1b928890772d245c2e31aaa45706b5"
"reference": "3c799cf7c56b87166f82c6c48c082cd95977cf6c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/liip/LiipImagineBundle/zipball/548846e07d1b928890772d245c2e31aaa45706b5",
"reference": "548846e07d1b928890772d245c2e31aaa45706b5",
"url": "https://api.github.com/repos/liip/LiipImagineBundle/zipball/3c799cf7c56b87166f82c6c48c082cd95977cf6c",
"reference": "3c799cf7c56b87166f82c6c48c082cd95977cf6c",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"imagine/imagine": "^1.3.2",
"php": "^8.0",
"php": "^8.1",
"symfony/dependency-injection": "^5.4|^6.4|^7.4|^8.0",
"symfony/deprecation-contracts": "^2.5 || ^3",
"symfony/filesystem": "^5.4|^6.4|^7.3|^8.0",
@@ -3271,9 +3270,9 @@
],
"support": {
"issues": "https://github.com/liip/LiipImagineBundle/issues",
"source": "https://github.com/liip/LiipImagineBundle/tree/2.17.2"
"source": "https://github.com/liip/LiipImagineBundle/tree/2.18.1"
},
"time": "2026-08-05T12:56:26+00:00"
"time": "2026-10-07T20:50:10+00:00"
},
{
"name": "maennchen/zipstream-php",
@@ -3708,16 +3707,16 @@
},
{
"name": "nesbot/carbon",
"version": "3.14.1",
"version": "3.14.2",
"source": {
"type": "git",
"url": "https://github.com/CarbonPHP/carbon.git",
"reference": "34e9109535165bf1d7ff17a610492372ae73a896"
"reference": "94cfc34887f07ab5c0efa07914c8f527544e3224"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/34e9109535165bf1d7ff17a610492372ae73a896",
"reference": "34e9109535165bf1d7ff17a610492372ae73a896",
"url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/94cfc34887f07ab5c0efa07914c8f527544e3224",
"reference": "94cfc34887f07ab5c0efa07914c8f527544e3224",
"shasum": ""
},
"require": {
@@ -3737,7 +3736,7 @@
"doctrine/orm": "^2.15.2 || ^3.0",
"friendsofphp/php-cs-fixer": "^v3.87.1",
"kylekatarnls/multi-tester": "^2.5.3",
"phpmd/phpmd": "^2.15.0",
"phpmd/phpmd": "^3.0@dev",
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan": "^2.1.22",
"phpunit/phpunit": "^10.5.53",
@@ -3809,7 +3808,7 @@
"type": "tidelift"
}
],
"time": "2026-09-27T12:07:26+00:00"
"time": "2026-10-02T07:26:52+00:00"
},
{
"name": "nette/schema",
@@ -5345,21 +5344,21 @@
},
{
"name": "setasign/fpdi",
"version": "v2.6.8",
"version": "v2.6.9",
"source": {
"type": "git",
"url": "https://github.com/Setasign/FPDI.git",
"reference": "881945be29a4996ad3d008eb18ddc01fa3df890c"
"reference": "d97ade6368aa0b51b6316d5dc16a567e2bf60167"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Setasign/FPDI/zipball/881945be29a4996ad3d008eb18ddc01fa3df890c",
"reference": "881945be29a4996ad3d008eb18ddc01fa3df890c",
"url": "https://api.github.com/repos/Setasign/FPDI/zipball/d97ade6368aa0b51b6316d5dc16a567e2bf60167",
"reference": "d97ade6368aa0b51b6316d5dc16a567e2bf60167",
"shasum": ""
},
"require": {
"ext-zlib": "*",
"php": ">=7.2 <=8.5.99999"
"php": ">=7.2 <=8.6.99999"
},
"conflict": {
"setasign/tfpdf": "<1.31"
@@ -5368,7 +5367,6 @@
"phpunit/phpunit": "^8.5.52",
"setasign/fpdf": "^1.9.0",
"setasign/tfpdf": "~1.33",
"squizlabs/php_codesniffer": "^3.5",
"tecnickcom/tcpdf": "^6.8"
},
"suggest": {
@@ -5405,7 +5403,7 @@
],
"support": {
"issues": "https://github.com/Setasign/FPDI/issues",
"source": "https://github.com/Setasign/FPDI/tree/v2.6.8"
"source": "https://github.com/Setasign/FPDI/tree/v2.6.9"
},
"funding": [
{
@@ -5413,14 +5411,14 @@
"type": "tidelift"
}
],
"time": "2026-06-11T10:37:24+00:00"
"time": "2026-10-13T07:36:28+00:00"
},
{
"name": "setasign/fpdi_pdf-parser",
"version": "2.1.8",
"version": "2.1.9",
"dist": {
"type": "zip",
"url": "https://www.setasign.com/downloads/7144473/FPDI_PDF-Parser-2.1.8.zip"
"url": "https://www.setasign.com/downloads/7180958/FPDI_PDF-Parser-2.1.9.zip"
},
"require": {
"php": ">=7.2 <8.7",
@@ -5438,7 +5436,7 @@
"support": {
"email": "[email protected]"
},
"time": "2026-09-14T00:00:00+00:00"
"time": "2026-10-13T00:00:00+00:00"
},
{
"name": "spatie/blink",
@@ -12359,16 +12357,16 @@
},
{
"name": "webmozart/assert",
"version": "2.4.1",
"version": "2.5.0",
"source": {
"type": "git",
"url": "https://github.com/webmozarts/assert.git",
"reference": "2ccb7c2e821038c03a3e6e1700c570c158c55f70"
"reference": "8a163706bbcac613733dba03f51e13b5eb1bb819"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozarts/assert/zipball/2ccb7c2e821038c03a3e6e1700c570c158c55f70",
"reference": "2ccb7c2e821038c03a3e6e1700c570c158c55f70",
"url": "https://api.github.com/repos/webmozarts/assert/zipball/8a163706bbcac613733dba03f51e13b5eb1bb819",
"reference": "8a163706bbcac613733dba03f51e13b5eb1bb819",
"shasum": ""
},
"require": {
@@ -12419,9 +12417,9 @@
],
"support": {
"issues": "https://github.com/webmozarts/assert/issues",
"source": "https://github.com/webmozarts/assert/tree/2.4.1"
"source": "https://github.com/webmozarts/assert/tree/2.5.0"
},
"time": "2026-06-15T15:31:57+00:00"
"time": "2026-10-05T23:14:19+00:00"
},
{
"name": "zenstruck/schedule-bundle",
@@ -12574,16 +12572,16 @@
},
{
"name": "composer/semver",
"version": "3.5.0",
"version": "3.5.1",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
"reference": "f7a296f4c4cf8cb8bb83e35d6951a406bb11afa5"
"reference": "528948210cc46f967a4b98e83b19e76f2b504993"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/semver/zipball/f7a296f4c4cf8cb8bb83e35d6951a406bb11afa5",
"reference": "f7a296f4c4cf8cb8bb83e35d6951a406bb11afa5",
"url": "https://api.github.com/repos/composer/semver/zipball/528948210cc46f967a4b98e83b19e76f2b504993",
"reference": "528948210cc46f967a4b98e83b19e76f2b504993",
"shasum": ""
},
"require": {
@@ -12635,7 +12633,7 @@
"support": {
"irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/semver/issues",
"source": "https://github.com/composer/semver/tree/3.5.0"
"source": "https://github.com/composer/semver/tree/3.5.1"
},
"funding": [
{
@@ -12647,7 +12645,7 @@
"type": "github"
}
],
"time": "2026-09-24T14:38:51+00:00"
"time": "2026-10-05T13:12:12+00:00"
},
{
"name": "composer/xdebug-handler",
@@ -13116,16 +13114,16 @@
},
{
"name": "marcocesarato/php-conventional-changelog",
"version": "1.19.0",
"version": "1.19.1",
"source": {
"type": "git",
"url": "https://github.com/marcocesarato/php-conventional-changelog.git",
"reference": "78019bf73153945193b6e6e4e3067d9c9f548ae9"
"reference": "c0607937ea713134a294067b87db13082f1ec2c4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/marcocesarato/php-conventional-changelog/zipball/78019bf73153945193b6e6e4e3067d9c9f548ae9",
"reference": "78019bf73153945193b6e6e4e3067d9c9f548ae9",
"url": "https://api.github.com/repos/marcocesarato/php-conventional-changelog/zipball/c0607937ea713134a294067b87db13082f1ec2c4",
"reference": "c0607937ea713134a294067b87db13082f1ec2c4",
"shasum": ""
},
"require": {
@@ -13142,7 +13140,7 @@
"phpunit/phpunit": "^9.6"
},
"bin": [
"conventional-changelog"
"bin/conventional-changelog"
],
"type": "library",
"extra": {
@@ -13188,9 +13186,9 @@
],
"support": {
"issues": "https://github.com/marcocesarato/php-conventional-changelog/issues",
"source": "https://github.com/marcocesarato/php-conventional-changelog/tree/v1.19.0"
"source": "https://github.com/marcocesarato/php-conventional-changelog/tree/v1.19.1"
},
"time": "2026-09-06T14:25:24+00:00"
"time": "2026-10-04T15:06:10+00:00"
},
{
"name": "myclabs/deep-copy",
@@ -13429,11 +13427,11 @@
},
{
"name": "phpstan/phpstan",
"version": "2.2.16",
"version": "2.3.1",
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/46a6d9060e5a7763adfcc21ebcb8b504ebdbcb92",
"reference": "46a6d9060e5a7763adfcc21ebcb8b504ebdbcb92",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/6155239b488e95d26d1ebd95c6b4bb294d7f09db",
"reference": "6155239b488e95d26d1ebd95c6b4bb294d7f09db",
"shasum": ""
},
"require": {
@@ -13489,29 +13487,29 @@
"type": "github"
}
],
"time": "2026-09-25T09:31:51+00:00"
"time": "2026-10-08T21:09:11+00:00"
},
{
"name": "phpunit/php-code-coverage",
"version": "12.5.7",
"version": "12.5.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "186dab580576598076de6818596d12b61801880e"
"reference": "7440368d94738d54f2c1de24dbd3871793bbb0dd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/186dab580576598076de6818596d12b61801880e",
"reference": "186dab580576598076de6818596d12b61801880e",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7440368d94738d54f2c1de24dbd3871793bbb0dd",
"reference": "7440368d94738d54f2c1de24dbd3871793bbb0dd",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-libxml": "*",
"ext-xmlwriter": "*",
"nikic/php-parser": "^5.7.0",
"nikic/php-parser": "^5.9.0",
"php": ">=8.3",
"phpunit/php-text-template": "^5.0",
"phpunit/php-text-template": "^5.0.1",
"sebastian/complexity": "^5.0",
"sebastian/environment": "^8.1.2",
"sebastian/lines-of-code": "^4.0.1",
@@ -13519,7 +13517,7 @@
"theseer/tokenizer": "^2.0.1"
},
"require-dev": {
"phpunit/phpunit": "^12.5.28"
"phpunit/phpunit": "^12.5.37"
},
"suggest": {
"ext-pcov": "PHP extension that provides line coverage",
@@ -13557,7 +13555,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.5.7"
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.5.8"
},
"funding": [
{
@@ -13577,7 +13575,7 @@
"type": "tidelift"
}
],
"time": "2026-06-01T13:24:19+00:00"
"time": "2026-10-03T14:03:50+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -13718,23 +13716,23 @@
},
{
"name": "phpunit/php-text-template",
"version": "5.0.0",
"version": "5.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
"reference": "e1367a453f0eda562eedb4f659e13aa900d66c53"
"reference": "babab73b7ef9fae406f2eb3ee11323a61caa63d5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/e1367a453f0eda562eedb4f659e13aa900d66c53",
"reference": "e1367a453f0eda562eedb4f659e13aa900d66c53",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/babab73b7ef9fae406f2eb3ee11323a61caa63d5",
"reference": "babab73b7ef9fae406f2eb3ee11323a61caa63d5",
"shasum": ""
},
"require": {
"php": ">=8.3"
},
"require-dev": {
"phpunit/phpunit": "^12.0"
"phpunit/phpunit": "^12.5.37"
},
"type": "library",
"extra": {
@@ -13766,15 +13764,27 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-text-template/issues",
"security": "https://github.com/sebastianbergmann/php-text-template/security/policy",
"source": "https://github.com/sebastianbergmann/php-text-template/tree/5.0.0"
"source": "https://github.com/sebastianbergmann/php-text-template/tree/5.0.1"
},
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
},
{
"url": "https://liberapay.com/sebastianbergmann",
"type": "liberapay"
},
{
"url": "https://thanks.dev/u/gh/sebastianbergmann",
"type": "thanks_dev"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpunit/php-text-template",
"type": "tidelift"
}
],
"time": "2025-02-07T04:59:16+00:00"
"time": "2026-10-03T04:51:29+00:00"
},
{
"name": "phpunit/php-timer",
@@ -13838,16 +13848,16 @@
},
{
"name": "phpunit/phpunit",
"version": "12.5.37",
"version": "12.5.39",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "684340c1590e5f3f3b859f5e80619725d88b63ba"
"reference": "4e8cbead3741cc57f16d142f4c5dc73c2747820a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/684340c1590e5f3f3b859f5e80619725d88b63ba",
"reference": "684340c1590e5f3f3b859f5e80619725d88b63ba",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4e8cbead3741cc57f16d142f4c5dc73c2747820a",
"reference": "4e8cbead3741cc57f16d142f4c5dc73c2747820a",
"shasum": ""
},
"require": {
@@ -13861,10 +13871,10 @@
"phar-io/manifest": "^2.0.4",
"phar-io/version": "^3.2.1",
"php": ">=8.3",
"phpunit/php-code-coverage": "^12.5.7",
"phpunit/php-code-coverage": "^12.5.8",
"phpunit/php-file-iterator": "^6.0.2",
"phpunit/php-invoker": "^6.0.0",
"phpunit/php-text-template": "^5.0.0",
"phpunit/php-text-template": "^5.0.1",
"phpunit/php-timer": "^8.0.0",
"sebastian/cli-parser": "^4.2.1",
"sebastian/comparator": "^7.1.8",
@@ -13875,7 +13885,7 @@
"sebastian/object-enumerator": "^7.0.0",
"sebastian/recursion-context": "^7.0.1",
"sebastian/type": "^6.0.4",
"sebastian/version": "^6.0.0",
"sebastian/version": "^6.0.1",
"staabm/side-effects-detector": "^1.0.5"
},
"bin": [
@@ -13916,7 +13926,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.37"
"source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.39"
},
"funding": [
{
@@ -13924,7 +13934,7 @@
"type": "other"
}
],
"time": "2026-09-29T12:08:54+00:00"
"time": "2026-10-12T15:27:27+00:00"
},
{
"name": "react/cache",
@@ -14454,21 +14464,21 @@
},
{
"name": "rector/rector",
"version": "2.6.7",
"version": "2.7.0",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "f4aa224edb9b0630fb43826d4cb6a49b62e48d4c"
"reference": "4d6a39b7fff302cac0ce90cd959a53c2f6a32776"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/f4aa224edb9b0630fb43826d4cb6a49b62e48d4c",
"reference": "f4aa224edb9b0630fb43826d4cb6a49b62e48d4c",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/4d6a39b7fff302cac0ce90cd959a53c2f6a32776",
"reference": "4d6a39b7fff302cac0ce90cd959a53c2f6a32776",
"shasum": ""
},
"require": {
"php": "^7.4|^8.0",
"phpstan/phpstan": "^2.2.14"
"phpstan/phpstan": "^2.3.0"
},
"conflict": {
"rector/rector-doctrine": "*",
@@ -14499,7 +14509,7 @@
],
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/2.6.7"
"source": "https://github.com/rectorphp/rector/tree/2.7.0"
},
"funding": [
{
@@ -14507,7 +14517,7 @@
"type": "github"
}
],
"time": "2026-09-13T20:17:44+00:00"
"time": "2026-10-06T08:46:45+00:00"
},
{
"name": "sebastian/cli-parser",
@@ -15378,16 +15388,16 @@
},
{
"name": "sebastian/version",
"version": "6.0.0",
"version": "6.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/version.git",
"reference": "3e6ccf7657d4f0a59200564b08cead899313b53c"
"reference": "9e935a16187e14f39b0e79910dabd614972cdb26"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/3e6ccf7657d4f0a59200564b08cead899313b53c",
"reference": "3e6ccf7657d4f0a59200564b08cead899313b53c",
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/9e935a16187e14f39b0e79910dabd614972cdb26",
"reference": "9e935a16187e14f39b0e79910dabd614972cdb26",
"shasum": ""
},
"require": {
@@ -15420,15 +15430,27 @@
"support": {
"issues": "https://github.com/sebastianbergmann/version/issues",
"security": "https://github.com/sebastianbergmann/version/security/policy",
"source": "https://github.com/sebastianbergmann/version/tree/6.0.0"
"source": "https://github.com/sebastianbergmann/version/tree/6.0.1"
},
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
},
{
"url": "https://liberapay.com/sebastianbergmann",
"type": "liberapay"
},
{
"url": "https://thanks.dev/u/gh/sebastianbergmann",
"type": "thanks_dev"
},
{
"url": "https://tidelift.com/funding/github/packagist/sebastian/version",
"type": "tidelift"
}
],
"time": "2025-02-07T05:00:38+00:00"
"time": "2026-10-04T05:50:08+00:00"
},
{
"name": "staabm/side-effects-detector",
+36
View File
@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Adds the per-placement feedback waiver.
*
* The overdue-feedback lists are a live query without any stored state, so there was no way to
* write off a feedback nobody will provide any more. The flag takes a placement out of the
* dashboards' overdue lists, the house-manager list and the reminder mail.
*
* Written by hand rather than taken from doctrine:migrations:diff, which also carries the
* pre-existing drift of the dev database.
*/
final class Version20261013120000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add the feedback_waived flag to dispositions';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE disposition ADD feedback_waived TINYINT DEFAULT 0 NOT NULL');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE disposition DROP feedback_waived');
}
}
@@ -13,6 +13,7 @@ use Doctrine\ORM\EntityManagerInterface;
use Flagception\Manager\FeatureManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\FormError;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
@@ -49,6 +50,12 @@ class DocumentUploadController extends AbstractController
$form = $this->createFormBuilder()->getForm();
$form->handleRequest($request);
// Checked before processUpload() removes the existing document, which it replaces.
if ($form->isSubmitted()
&& true === $this->uploadHandler->getUploadSession()->getUploadsByType($type)->isEmpty()) {
$form->addError(new FormError('Bitte lade zuerst eine Datei hoch'));
}
if ($form->isSubmitted() && $form->isValid()) {
$this->processUpload($disposition, $type);
@@ -110,15 +117,17 @@ class DocumentUploadController extends AbstractController
$disposition->addDocument($upload);
$this->entityManager->flush();
$this->uploadHandler->moveUploadSessionFilesFromOrphanage($type, $uploadSession);
$this->uploadHandler->removeUploadSessionUploadsByType($type);
// Before the flush: converting a non-PDF renames the file, and the new filename has to
// be persisted with the row.
if (true === $this->featureManager->isActive('sanitize_uploads')) {
$this->uploadHandler->ensurePdf($upload);
}
$this->entityManager->flush();
$this->eventDispatcher->dispatch(new DocumentUploadedEvent($upload), DocumentUploadedEvent::NAME);
if (Upload::TYPE_CONTRACT === $type) {
$this->eventDispatcher->dispatch(new DocumentConfirmedEvent($upload), DocumentConfirmedEvent::NAME);
@@ -4,8 +4,10 @@ namespace App\Controller\Administrative\System\Document;
use App\Entity\Upload;
use App\Htmx\HxRedirectResponse;
use App\Repository\SeasonTaskDocumentRepository;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Bridge\Doctrine\Attribute\MapEntity;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -17,14 +19,32 @@ class DeleteController extends AbstractController
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly LoggerInterface $logger,
private readonly SeasonTaskDocumentRepository $seasonTaskDocumentRepository,
) {
}
#[Route('/administrative/system/document/delete/{uuid}', name: 'app_administrative_system_document_delete')]
#[IsGranted('ROLE_ADMINISTRATIVE')]
#[IsGranted('DELETE', subject: 'document')]
public function index(Upload $document, Request $request): Response
{
public function index(
#[MapEntity(mapping: ['uuid' => 'uuid'])]
Upload $document,
Request $request,
): Response {
// A document handed out for a season task is referenced by a NOT NULL foreign key, so
// deleting it fails in the database. It has to be replaced in that mapping first.
$seasonTaskDocuments = $this->seasonTaskDocumentRepository->findByDocument($document);
if (0 < count($seasonTaskDocuments) && true === $request->isMethod('POST')) {
$this->addFlash('error', 'Das Dokument ist als Saisonteam-Dokument hinterlegt und kann nicht gelöscht werden');
$this->logger->info('Refuse deleting document assigned to a season task', [
'document_id' => $document->getId(),
'document_filename' => $document->getOriginalFilename(),
]);
return new HxRedirectResponse($this->generateUrl('app_administrative_system_document_index'));
}
if (true === $request->isMethod('POST')) {
$this->entityManager->remove($document);
$this->entityManager->flush();
@@ -40,6 +60,7 @@ class DeleteController extends AbstractController
return $this->render('administrative/system/document/modal_delete.html.twig', [
'document' => $document,
'seasonTaskDocuments' => $seasonTaskDocuments,
]);
}
}
@@ -2,6 +2,7 @@
namespace App\Controller\Administrative\System\Document;
use App\Repository\SeasonTaskDocumentRepository;
use App\Repository\UploadRepository;
use Knp\Component\Pager\PaginatorInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
@@ -15,6 +16,7 @@ class IndexController extends AbstractController
public function __construct(
private readonly UploadRepository $uploadRepository,
private readonly PaginatorInterface $paginator,
private readonly SeasonTaskDocumentRepository $seasonTaskDocumentRepository,
) {
}
@@ -36,6 +38,7 @@ class IndexController extends AbstractController
return $this->render('administrative/system/document/index.html.twig', [
'pagination' => $pagination,
'seasonTaskDocuments' => $this->seasonTaskDocumentRepository->findGroupedByDocumentId(),
]);
}
}
@@ -79,6 +79,14 @@ class DetailController extends AbstractController
private function uploadContract(Disposition $disposition, UploadSessionDto $uploadSession): void
{
// The session can hold files of other types, so a non-empty session alone does not
// mean there is anything to replace the existing document with.
if (true === $uploadSession->getUploadsByType(Upload::TYPE_CONTRACT)->isEmpty()) {
$this->addFlash('error', 'Bitte lade zuerst den Honorarvertrag hoch');
return;
}
if (null !== $existingUpload = $disposition->getDocumentByType(Upload::TYPE_CONTRACT)) {
$this->entityManager->remove($existingUpload);
}
@@ -116,6 +124,14 @@ class DetailController extends AbstractController
private function uploadInvoice(Disposition $disposition, UploadSessionDto $uploadSession): void
{
// The session can hold files of other types, so a non-empty session alone does not
// mean there is anything to replace the existing document with.
if (true === $uploadSession->getUploadsByType(Upload::TYPE_INVOICE)->isEmpty()) {
$this->addFlash('error', 'Bitte lade zuerst die Honorarnote hoch');
return;
}
if (null !== $existingUpload = $disposition->getDocumentByType(Upload::TYPE_INVOICE)) {
$this->entityManager->remove($existingUpload);
}
+20
View File
@@ -72,6 +72,14 @@ class Disposition implements BlameableEntityInterface, TimestampableEntityInterf
#[ORM\Column(type: Types::BOOLEAN)]
private bool $syncedWithBusProNet = false;
/**
* The office no longer expects a feedback for this placement, so nothing chases one: not the
* dashboards' overdue lists, not the house-manager list, not the reminder mail. It still
* counts as missing in the statistics.
*/
#[ORM\Column(type: Types::BOOLEAN, options: ['default' => false])]
private bool $feedbackWaived = false;
public function __construct(Application $application)
{
$this->uuid = Uuid::v4();
@@ -353,4 +361,16 @@ class Disposition implements BlameableEntityInterface, TimestampableEntityInterf
return $this;
}
public function isFeedbackWaived(): bool
{
return $this->feedbackWaived;
}
public function setFeedbackWaived(bool $feedbackWaived): static
{
$this->feedbackWaived = $feedbackWaived;
return $this;
}
}
+49 -10
View File
@@ -5,31 +5,70 @@ namespace App\EventListener;
use App\Entity\Upload;
use App\Service\Upload\UploadHandler;
use Doctrine\Bundle\DoctrineBundle\Attribute\AsDoctrineListener;
use Doctrine\ORM\Event\PreRemoveEventArgs;
use Doctrine\ORM\Event\OnFlushEventArgs;
use Doctrine\ORM\Event\PostFlushEventArgs;
use Doctrine\ORM\Events;
use Liip\ImagineBundle\Imagine\Cache\CacheManager;
use Symfony\Contracts\Service\ResetInterface;
#[AsDoctrineListener(event: Events::preRemove)]
class DeleteUploadListener
/**
* Removes the files of deleted uploads from disk, once the deletion has been committed.
*
* Doctrine dispatches preRemove inside EntityManager::remove(), not at flush. Deleting the file
* there meant that a request which removed the old upload and then failed before its flush -
* a replacement that could not be built - lost the file while the row survived. The files are
* therefore collected at onFlush and only deleted at postFlush, which is reached only after the
* transaction has committed. A flush that throws never gets there, and the next onFlush drops
* what it collected.
*/
#[AsDoctrineListener(event: Events::onFlush)]
#[AsDoctrineListener(event: Events::postFlush)]
class DeleteUploadListener implements ResetInterface
{
/**
* @var array<int, Upload>
*/
private array $pending = [];
public function __construct(
private readonly UploadHandler $uploadHandler,
private readonly CacheManager $cacheManager,
) {
}
public function preRemove(PreRemoveEventArgs $eventArgs): void
public function onFlush(OnFlushEventArgs $args): void
{
$object = $eventArgs->getObject();
$this->pending = [];
if (!$object instanceof Upload) {
// Includes uploads removed by cascade, e.g. the documents of a deleted disposition.
foreach ($args->getObjectManager()->getUnitOfWork()->getScheduledEntityDeletions() as $entity) {
if ($entity instanceof Upload) {
$this->pending[] = $entity;
}
}
}
public function postFlush(PostFlushEventArgs $args): void
{
if (0 === count($this->pending)) {
return;
}
// Remove uploaded original
$this->uploadHandler->removeUploadedFile($object);
// Taken and cleared up front, in case anything downstream flushes again.
$pending = $this->pending;
$this->pending = [];
// Remove potential variants from public folders
$this->cacheManager->remove($object->getFilename());
foreach ($pending as $upload) {
// Remove uploaded original
$this->uploadHandler->removeUploadedFile($upload);
// Remove potential variants from public folders
$this->cacheManager->remove($upload->getFilename());
}
}
public function reset(): void
{
$this->pending = [];
}
}
+3
View File
@@ -225,9 +225,12 @@ class DispositionRepository extends ServiceEntityRepository
$qb->expr()->notIn('assignment.status', ':status'),
$qb->expr()->lte('destination.dateTo', ':dateTo'),
$qb->expr()->isNull('feedback'),
// waived placements are written off: nobody is asked for their feedback any more
$qb->expr()->eq('disposition.feedbackWaived', ':feedbackWaived'),
$this->excludesSkipFormalities($qb)
))
->setParameter('status', [Assignment::STATUS_CALLED_OFF, Assignment::STATUS_DELETED])
->setParameter('feedbackWaived', false)
;
$dateTo = new \DateTimeImmutable();
@@ -4,6 +4,7 @@ namespace App\Repository;
use App\Config\SeasonTask;
use App\Entity\SeasonTaskDocument;
use App\Entity\Upload;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
@@ -43,4 +44,31 @@ class SeasonTaskDocumentRepository extends ServiceEntityRepository
{
return $this->findOneBy(['taskKey' => $task->value]);
}
/**
* Every mapping that points at the document, including rows whose task key no longer
* resolves: those still hold the foreign key that blocks deleting the upload.
*
* @return array<int, SeasonTaskDocument>
*/
public function findByDocument(Upload $document): array
{
return $this->findBy(['document' => $document]);
}
/**
* The mappings grouped by the id of the document they point at, for the document list.
*
* @return array<int, array<int, SeasonTaskDocument>>
*/
public function findGroupedByDocumentId(): array
{
$grouped = [];
foreach ($this->findAll() as $seasonTaskDocument) {
$grouped[$seasonTaskDocument->getDocument()->getId()][] = $seasonTaskDocument;
}
return $grouped;
}
}
@@ -21,11 +21,17 @@
<span>Filter</span>
{% endif %}
</button>
{% if filterDto.active %}
<a href="{{ path('app_common_assignment_filter_reset', { 'r': return_url() }) }}" class="btn btn--small btn--secondary">
Reset
<div class="flex items-center space-x-2">
<a href="{{ path('app_administrative_assignment_create', { 'r': return_url() }) }}" class="btn btn--small">
Neu
</a>
{% endif %}
{% if filterDto.active %}
<a href="{{ path('app_common_assignment_filter_reset', { 'r': return_url() }) }}" class="btn btn--small btn--secondary">
Reset
</a>
{% endif %}
</div>
</div>
</div>
@@ -5,6 +5,7 @@
{% block content %}
{% set formAttr = stimulus_controller('form-upload-guard')|stimulus_action('form-upload-guard', 'guard', 'submit') %}
{{ form_start(form, { 'attr': { 'hx-post': app.request.uri, 'hx-target': '#htmx-modal', 'hx-swap': 'outerHTML' }|merge(formAttr.toArray()) }) }}
{{ form_errors(form) }}
<div class="pb-4">
{% include '_partials/_upload_collection_form.html.twig' with {
'endpoint_upload': path(endpointUpload),
@@ -31,6 +31,7 @@
</thead>
<tbody>
{% for document in pagination %}
{% set assignments = seasonTaskDocuments[document.id] ?? [] %}
<tr>
<td>
{{ document.displayName ? document.displayName : document.originalFilename }}
@@ -38,7 +39,10 @@
<td>
{# A slot belongs to exactly one document, so this is what tells staff
which file a feature actually picks up. #}
{{ document.token ? document.token.label() : '-' }}
{% set usages = (document.token ? [document.token.label()] : [])|merge(
assignments|filter(a => a.task)|map(a => 'Saisonteam: ' ~ a.task.label())
) %}
{{ usages is empty ? '-' : usages|join(', ') }}
</td>
<td>
{{ document.size|file_size }}
@@ -51,13 +55,21 @@
</td>
<td>
<div class="flex items-center space-x-2 justify-end">
<button type="button"
class="text-red-500"
hx-get="{{ path('app_administrative_system_document_delete', { 'uuid': document.uuid }) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('delete') }}
</button>
{% if assignments is empty %}
<button type="button"
class="text-red-500"
hx-get="{{ path('app_administrative_system_document_delete', { 'uuid': document.uuid }) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('delete') }}
</button>
{% else %}
{# Held by a NOT NULL foreign key; replace it under Saisonteam-Dokumente first. #}
<span class="text-gray-300 cursor-not-allowed"
title="Als Saisonteam-Dokument hinterlegt, kann nicht gelöscht werden">
{{ icon('delete') }}
</span>
{% endif %}
<button type="button"
hx-get="{{ path('app_administrative_system_document_replace', { 'uuid': document.uuid }) }}"
hx-target="body"
@@ -1,7 +1,25 @@
{% extends 'htmx_confirmation_modal.html.twig' %}
{% block title %}{{ seasonTaskDocuments is empty ? 'Bist du sicher?' : 'Löschen nicht möglich' }}{% endblock %}
{% block content %}
<div>
Möchtest du das Dokument <em>{{ document }}</em> wirklich löschen?
</div>
{% endblock %}
{% if seasonTaskDocuments is empty %}
<div>
Möchtest du das Dokument <em>{{ document }}</em> wirklich löschen?
</div>
{% else %}
<div>
Das Dokument <em>{{ document }}</em> ist als Saisonteam-Dokument hinterlegt
{%- set labels = seasonTaskDocuments|map(m => m.task ? m.task.label() : null)|filter(l => l is not null) -%}
{%- if labels is not empty %} ({{ labels|join(', ') }}){% endif %}
und kann deshalb nicht gelöscht werden. Ersetze es zuerst unter
<a class="underline" href="{{ path('app_administrative_system_season_task_document_index') }}">Saisonteam-Dokumente</a>.
</div>
{% endif %}
{% endblock %}
{% block confirm %}
{% if seasonTaskDocuments is empty %}{{ parent() }}{% endif %}
{% endblock %}
{% block button_cancel %}{{ seasonTaskDocuments is empty ? 'Abbrechen' : 'Schließen' }}{% endblock %}
@@ -14,9 +14,11 @@
</div>
{% block content %}{% endblock %}
<div class="mt-6 flex items-center justify-between">
{% block confirm %}
<button type="button" class="btn bg-red-500" {% block button_attribute %}hx-post="{{ app.request.uri }}"{% endblock %}>
{% block button_confirm %}Ja{% endblock %}
</button>
{% endblock %}
<button type="button" class="btn" {{ stimulus_action('modal', 'close') }}>
{% block button_cancel %}Abbrechen{% endblock %}
</button>
@@ -0,0 +1,173 @@
<?php
declare(strict_types=1);
namespace App\Tests\Controller\Administrative\System\Document;
use App\Config\SeasonTask;
use App\Entity\SeasonTaskDocument;
use App\Entity\Upload;
use App\Entity\User;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\HttpFoundation\Response;
/**
* A library document handed out for a season task is held by a NOT NULL foreign key. Deleting it
* used to end in a 500 that htmx swallowed, so the modal just stayed open; it now has to be
* refused before it reaches the database.
*/
class DeleteControllerTest extends WebTestCase
{
private const LIST_URL = '/administrative/system/document';
private KernelBrowser $client;
private EntityManagerInterface $entityManager;
protected function setUp(): void
{
$this->client = static::createClient(server: ['HTTPS' => true]);
$this->entityManager = self::getContainer()->get(EntityManagerInterface::class);
$this->entityManager->createQuery(sprintf('DELETE FROM %s', SeasonTaskDocument::class))->execute();
$this->entityManager->createQuery(sprintf('DELETE FROM %s', Upload::class))->execute();
$this->entityManager->createQuery(sprintf('DELETE FROM %s', User::class))->execute();
$this->client->loginUser($this->administrative());
}
/**
* The mapping holds a foreign key on upload; left behind, it breaks every later test that
* clears the upload table.
*/
protected function tearDown(): void
{
$this->entityManager->createQuery(sprintf('DELETE FROM %s', SeasonTaskDocument::class))->execute();
parent::tearDown();
}
public function testTheModalOffersNoConfirmationForAnAssignedDocument(): void
{
$document = $this->assigned($this->document('Vertrag.pdf'), SeasonTask::CONTRACT);
$crawler = $this->client->request('GET', $this->deleteUrl($document));
$this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode());
$this->assertStringContainsString('kann deshalb nicht gelöscht werden', $crawler->text());
$this->assertStringContainsString('Vertrag', $crawler->text());
$this->assertCount(0, $crawler->filter('button[hx-post]'));
}
public function testDeletingAnAssignedDocumentIsRefused(): void
{
$document = $this->assigned($this->document('Vertrag.pdf'), SeasonTask::CONTRACT);
$id = $document->getId();
$this->client->request('POST', $this->deleteUrl($document));
$this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode());
$this->assertSame(self::LIST_URL, $this->client->getResponse()->headers->get('HX-Redirect'));
$this->entityManager->clear();
$this->assertNotNull($this->entityManager->find(Upload::class, $id));
}
/**
* A row whose task key no longer resolves still holds the foreign key.
*/
public function testAnAssignmentToARemovedTaskStillBlocksDeletion(): void
{
$document = $this->document('Alt.pdf');
$this->entityManager->persist((new SeasonTaskDocument())->setTaskKey('removed_task')->setDocument($document));
$this->entityManager->flush();
$id = $document->getId();
$this->client->request('POST', $this->deleteUrl($document));
// Refused by the guard, not by the database: that would be the 500.
$this->assertSame(self::LIST_URL, $this->client->getResponse()->headers->get('HX-Redirect'));
$this->entityManager->clear();
$this->assertNotNull($this->entityManager->find(Upload::class, $id));
}
public function testAnUnassignedDocumentIsDeleted(): void
{
$document = $this->document('Handbuch.pdf');
$id = $document->getId();
$crawler = $this->client->request('GET', $this->deleteUrl($document));
$this->assertCount(1, $crawler->filter('button[hx-post]'));
$this->client->request('POST', $this->deleteUrl($document));
$this->assertSame(self::LIST_URL, $this->client->getResponse()->headers->get('HX-Redirect'));
$this->entityManager->clear();
$this->assertNull($this->entityManager->find(Upload::class, $id));
}
public function testTheListMarksAnAssignedDocumentAndOffersNoDelete(): void
{
$assigned = $this->assigned($this->document('Vertrag.pdf'), SeasonTask::CONTRACT);
$free = $this->document('Handbuch.pdf');
$crawler = $this->client->request('GET', self::LIST_URL);
$this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode());
$this->assertStringContainsString('Saisonteam: Vertrag', $crawler->text());
$this->assertCount(0, $crawler->filter(sprintf('button[hx-get="%s"]', $this->deleteUrl($assigned))));
$this->assertCount(1, $crawler->filter(sprintf('button[hx-get="%s"]', $this->deleteUrl($free))));
}
private function deleteUrl(Upload $document): string
{
return sprintf('/administrative/system/document/delete/%s', $document->getUuid());
}
private function assigned(Upload $document, SeasonTask $task): Upload
{
$this->entityManager->persist((new SeasonTaskDocument())->setTaskKey($task->value)->setDocument($document));
$this->entityManager->flush();
return $document;
}
private function document(string $filename): Upload
{
// No file on disk: neither the guard nor the list reads it, and deleting a missing file
// is a no-op for UploadHandler::removeUploadedFile().
$upload = (new Upload())
->setType(Upload::TYPE_DOCUMENT)
->setFilename(sprintf('test-%s-%s', bin2hex(random_bytes(4)), $filename))
->setOriginalFilename($filename)
->setMimeType('application/pdf')
->setSize(1024)
;
$this->entityManager->persist($upload);
$this->entityManager->flush();
return $upload;
}
private function administrative(): User
{
$user = (new User())
->setFirstName('Anna')
->setLastName('Administrative')
->setEmail('[email protected]')
->setRoles(['ROLE_ADMINISTRATIVE'])
->setBusProAddressId(1)
->setBusProPersonId(1)
;
$this->entityManager->persist($user);
$this->entityManager->flush();
return $user;
}
}
@@ -0,0 +1,144 @@
<?php
declare(strict_types=1);
namespace App\Tests\EventListener;
use App\Entity\Upload;
use App\Service\Upload\UploadHandler;
use Doctrine\DBAL\Exception as DBALException;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\Persistence\ManagerRegistry;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Filesystem\Filesystem;
/**
* Doctrine dispatches preRemove inside EntityManager::remove(), so a listener deleting the file
* there loses it whenever the request fails between remove() and flush() - the row survives and
* points at nothing. These tests pin that the file only goes once the deletion has committed.
*/
class DeleteUploadListenerTest extends KernelTestCase
{
private EntityManagerInterface $entityManager;
private UploadHandler $uploadHandler;
/**
* @var array<int, string>
*/
private array $createdFiles = [];
protected function setUp(): void
{
self::bootKernel();
$this->entityManager = self::getContainer()->get(EntityManagerInterface::class);
$this->uploadHandler = self::getContainer()->get(UploadHandler::class);
$this->entityManager->createQuery(sprintf('DELETE FROM %s', Upload::class))->execute();
}
protected function tearDown(): void
{
(new Filesystem())->remove($this->createdFiles);
parent::tearDown();
}
public function testTheFileIsRemovedOnceTheDeletionIsFlushed(): void
{
$upload = $this->storedUpload();
$this->entityManager->remove($upload);
$this->entityManager->flush();
$this->assertFileDoesNotExist($this->filepath($upload));
}
public function testTheFileIsKeptWhileTheDeletionIsNotFlushed(): void
{
$upload = $this->storedUpload();
$this->entityManager->remove($upload);
$this->assertFileExists($this->filepath($upload));
}
public function testTheFileIsKeptWhenTheFlushFails(): void
{
$upload = $this->storedUpload();
$filepath = $this->filepath($upload);
$this->entityManager->remove($upload);
// No filename: violates NOT NULL, so the flush rolls back.
$this->entityManager->persist((new Upload())
->setType(Upload::TYPE_DOCUMENT)
->setOriginalFilename('broken.pdf')
->setMimeType('application/pdf')
->setSize(1024)
);
try {
$this->entityManager->flush();
$this->fail('The flush was expected to fail');
} catch (DBALException) {
}
$this->assertFileExists($filepath);
}
public function testAFailedFlushDoesNotHandItsFilesToTheNextOne(): void
{
$upload = $this->storedUpload();
$filepath = $this->filepath($upload);
$this->entityManager->remove($upload);
$this->entityManager->persist((new Upload())
->setType(Upload::TYPE_DOCUMENT)
->setOriginalFilename('broken.pdf')
->setMimeType('application/pdf')
->setSize(1024)
);
try {
$this->entityManager->flush();
} catch (DBALException) {
}
/** @var EntityManagerInterface $entityManager */
$entityManager = self::getContainer()->get(ManagerRegistry::class)->resetManager();
$entityManager->persist($this->upload('unrelated.pdf'));
$entityManager->flush();
$this->assertFileExists($filepath);
}
private function storedUpload(): Upload
{
$upload = $this->upload(sprintf('test-delete-upload-%s.pdf', bin2hex(random_bytes(8))));
$this->entityManager->persist($upload);
$this->entityManager->flush();
$filepath = $this->filepath($upload);
(new Filesystem())->dumpFile($filepath, '%PDF-1.4');
$this->createdFiles[] = $filepath;
return $upload;
}
private function upload(string $filename): Upload
{
return (new Upload())
->setType(Upload::TYPE_DOCUMENT)
->setFilename($filename)
->setOriginalFilename($filename)
->setMimeType('application/pdf')
->setSize(1024)
;
}
private function filepath(Upload $upload): string
{
return $this->uploadHandler->getUploadFilepath($upload);
}
}
@@ -212,6 +212,21 @@ class DispositionRepositoryTest extends KernelTestCase
$this->assertFalse($query->getParameter('skipFormalities')->getValue());
}
/**
* A waived placement is written off by the office. The same query backs every surface that
* chases a feedback, so this is the one place the waiver has to be honoured.
*/
public function testPendingFeedbackSkipsWaivedDispositions(): void
{
$query = $this->repository()->getDispositionsWithPendingFeedbackQuery();
$this->assertStringContainsString(
'disposition.feedbackWaived = :feedbackWaived',
$query->getDQL()
);
$this->assertFalse($query->getParameter('feedbackWaived')->getValue());
}
/**
* Otherwise placements nobody is expected to rate would be counted as missingFeedbacks and
* drag every hotel's percentage down.