From 66dec5c036e10a2a90de7673d81a007da52ec8cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Nov 2024 13:48:11 +0000 Subject: [PATCH 01/10] build: Bump alpinejs from 3.14.1 to 3.14.3 (#3825) Bumps [alpinejs](https://github.com/alpinejs/alpine/tree/HEAD/packages/alpinejs) from 3.14.1 to 3.14.3. - [Release notes](https://github.com/alpinejs/alpine/releases) - [Commits](https://github.com/alpinejs/alpine/commits/v3.14.3/packages/alpinejs) --- updated-dependencies: - dependency-name: alpinejs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index cd6506922..431e3baff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "license": "MIT", "dependencies": { "@alpinejs/collapse": "^3.14.1", - "alpinejs": "^3.14.1" + "alpinejs": "^3.14.3" }, "devDependencies": { "@fortawesome/fontawesome-free": "^6.6.0", @@ -1503,9 +1503,9 @@ } }, "node_modules/alpinejs": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/alpinejs/-/alpinejs-3.14.1.tgz", - "integrity": "sha512-ICar8UsnRZAYvv/fCNfNeKMXNoXGUfwHrjx7LqXd08zIP95G2d9bAOuaL97re+1mgt/HojqHsfdOLo/A5LuWgQ==", + "version": "3.14.3", + "resolved": "https://registry.npmjs.org/alpinejs/-/alpinejs-3.14.3.tgz", + "integrity": "sha512-cL8JBEDAm4UeVjTN5QnFl8QgMGUwxFn1GvQvu3RtfAHUrAPRahGihrsWpKnEK9L0QMqsAPk/R8MylMWKHaK33A==", "dependencies": { "@vue/reactivity": "~3.1.1" } diff --git a/package.json b/package.json index 39f9481eb..6cbf49135 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ }, "dependencies": { "@alpinejs/collapse": "^3.14.1", - "alpinejs": "^3.14.1" + "alpinejs": "^3.14.3" }, "type": "module" } From ee7f3f8ab92baa21c72c91a0c97f5d3a0fba27af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Nov 2024 13:48:29 +0000 Subject: [PATCH 02/10] build: Bump elliptic from 6.5.7 to 6.6.0 (#3843) Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.7 to 6.6.0. - [Commits](https://github.com/indutny/elliptic/compare/v6.5.7...v6.6.0) --- updated-dependencies: - dependency-name: elliptic dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 431e3baff..5d595e59b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2725,9 +2725,9 @@ "dev": true }, "node_modules/elliptic": { - "version": "6.5.7", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz", - "integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.0.tgz", + "integrity": "sha512-dpwoQcLc/2WLQvJvLRHKZ+f9FgOdjnq11rurqwekGQygGPsYSK29OMMD2WalatiqQ+XGFDglTNixpPfI+lpaAA==", "dev": true, "dependencies": { "bn.js": "^4.11.9", From 55a77b5065ad8a160efeb94d796385b6c1803ff6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Nov 2024 13:48:54 +0000 Subject: [PATCH 03/10] build: Bump symfony/mailgun-mailer from 7.1.3 to 7.1.6 (#3846) Bumps [symfony/mailgun-mailer](https://github.com/symfony/mailgun-mailer) from 7.1.3 to 7.1.6. - [Release notes](https://github.com/symfony/mailgun-mailer/releases) - [Changelog](https://github.com/symfony/mailgun-mailer/blob/7.1/CHANGELOG.md) - [Commits](https://github.com/symfony/mailgun-mailer/compare/v7.1.3...v7.1.6) --- updated-dependencies: - dependency-name: symfony/mailgun-mailer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 4d76de087..79e64c815 100644 --- a/composer.lock +++ b/composer.lock @@ -9751,16 +9751,16 @@ }, { "name": "symfony/mailgun-mailer", - "version": "v7.1.3", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/mailgun-mailer.git", - "reference": "dac02fe68e9306849703025511c56f10701696a8" + "reference": "b0117bf42b6dd8dfcfcab2a7e18508b594520b5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailgun-mailer/zipball/dac02fe68e9306849703025511c56f10701696a8", - "reference": "dac02fe68e9306849703025511c56f10701696a8", + "url": "https://api.github.com/repos/symfony/mailgun-mailer/zipball/b0117bf42b6dd8dfcfcab2a7e18508b594520b5a", + "reference": "b0117bf42b6dd8dfcfcab2a7e18508b594520b5a", "shasum": "" }, "require": { @@ -9800,7 +9800,7 @@ "description": "Symfony Mailgun Mailer Bridge", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailgun-mailer/tree/v7.1.3" + "source": "https://github.com/symfony/mailgun-mailer/tree/v7.1.6" }, "funding": [ { @@ -9816,7 +9816,7 @@ "type": "tidelift" } ], - "time": "2024-07-04T11:20:59+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/mime", From 139e59911b7b76886a65f1a9f37103f6ea9712ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Nov 2024 13:49:12 +0000 Subject: [PATCH 04/10] build: Bump symfony/http-client from 7.1.5 to 7.1.6 (#3848) Bumps [symfony/http-client](https://github.com/symfony/http-client) from 7.1.5 to 7.1.6. - [Release notes](https://github.com/symfony/http-client/releases) - [Changelog](https://github.com/symfony/http-client/blob/7.1/CHANGELOG.md) - [Commits](https://github.com/symfony/http-client/compare/v7.1.5...v7.1.6) --- updated-dependencies: - dependency-name: symfony/http-client dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 79e64c815..2342b5620 100644 --- a/composer.lock +++ b/composer.lock @@ -9308,16 +9308,16 @@ }, { "name": "symfony/http-client", - "version": "v7.1.5", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "abca35865118edf35a23f2f24978a1784c831cb4" + "reference": "274e2f6886b43a36f8bd5dfeb67215f7ebf9e291" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/abca35865118edf35a23f2f24978a1784c831cb4", - "reference": "abca35865118edf35a23f2f24978a1784c831cb4", + "url": "https://api.github.com/repos/symfony/http-client/zipball/274e2f6886b43a36f8bd5dfeb67215f7ebf9e291", + "reference": "274e2f6886b43a36f8bd5dfeb67215f7ebf9e291", "shasum": "" }, "require": { @@ -9382,7 +9382,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.1.5" + "source": "https://github.com/symfony/http-client/tree/v7.1.6" }, "funding": [ { @@ -9398,7 +9398,7 @@ "type": "tidelift" } ], - "time": "2024-09-20T13:35:23+00:00" + "time": "2024-10-22T09:40:50+00:00" }, { "name": "symfony/http-client-contracts", From 15524a41b0e8184374e60e99ee746d06f9ebd782 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Nov 2024 13:49:55 +0000 Subject: [PATCH 05/10] build: Bump filament/filament from 3.2.122 to 3.2.124 (#3872) Bumps [filament/filament](https://github.com/filamentphp/panels) from 3.2.122 to 3.2.124. - [Commits](https://github.com/filamentphp/panels/compare/v3.2.122...v3.2.124) --- updated-dependencies: - dependency-name: filament/filament dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.lock | 72 +++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/composer.lock b/composer.lock index 2342b5620..2b2c61351 100644 --- a/composer.lock +++ b/composer.lock @@ -2187,16 +2187,16 @@ }, { "name": "filament/actions", - "version": "v3.2.122", + "version": "v3.2.124", "source": { "type": "git", "url": "https://github.com/filamentphp/actions.git", - "reference": "3badf1a1589bf70fdc625130f6dfc1ca2146a32f" + "reference": "631b38a36f5209a3884182acee60a0db682c6d24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/actions/zipball/3badf1a1589bf70fdc625130f6dfc1ca2146a32f", - "reference": "3badf1a1589bf70fdc625130f6dfc1ca2146a32f", + "url": "https://api.github.com/repos/filamentphp/actions/zipball/631b38a36f5209a3884182acee60a0db682c6d24", + "reference": "631b38a36f5209a3884182acee60a0db682c6d24", "shasum": "" }, "require": { @@ -2236,20 +2236,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-10-31T13:38:12+00:00" + "time": "2024-11-13T16:35:31+00:00" }, { "name": "filament/filament", - "version": "v3.2.122", + "version": "v3.2.124", "source": { "type": "git", "url": "https://github.com/filamentphp/panels.git", - "reference": "076f5367a3dfe5f6864d117f6826ca7821586931" + "reference": "3f170b1c57033ad8e9e6bd71f3dc3f0665bf3ae9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/panels/zipball/076f5367a3dfe5f6864d117f6826ca7821586931", - "reference": "076f5367a3dfe5f6864d117f6826ca7821586931", + "url": "https://api.github.com/repos/filamentphp/panels/zipball/3f170b1c57033ad8e9e6bd71f3dc3f0665bf3ae9", + "reference": "3f170b1c57033ad8e9e6bd71f3dc3f0665bf3ae9", "shasum": "" }, "require": { @@ -2301,20 +2301,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-10-31T13:38:14+00:00" + "time": "2024-11-13T16:35:35+00:00" }, { "name": "filament/forms", - "version": "v3.2.122", + "version": "v3.2.124", "source": { "type": "git", "url": "https://github.com/filamentphp/forms.git", - "reference": "c863b5765b871485a2c624c43a0eb6e957a04b54" + "reference": "c73351c086036bd8de24e8671fd97018942d6d61" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/forms/zipball/c863b5765b871485a2c624c43a0eb6e957a04b54", - "reference": "c863b5765b871485a2c624c43a0eb6e957a04b54", + "url": "https://api.github.com/repos/filamentphp/forms/zipball/c73351c086036bd8de24e8671fd97018942d6d61", + "reference": "c73351c086036bd8de24e8671fd97018942d6d61", "shasum": "" }, "require": { @@ -2357,20 +2357,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-10-31T13:38:16+00:00" + "time": "2024-11-13T16:35:31+00:00" }, { "name": "filament/infolists", - "version": "v3.2.122", + "version": "v3.2.124", "source": { "type": "git", "url": "https://github.com/filamentphp/infolists.git", - "reference": "2d934d4d7f420fc1165ced33df0959a656163a0c" + "reference": "7946035f47746e69ff9d98bfed04b0248000ee2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/infolists/zipball/2d934d4d7f420fc1165ced33df0959a656163a0c", - "reference": "2d934d4d7f420fc1165ced33df0959a656163a0c", + "url": "https://api.github.com/repos/filamentphp/infolists/zipball/7946035f47746e69ff9d98bfed04b0248000ee2e", + "reference": "7946035f47746e69ff9d98bfed04b0248000ee2e", "shasum": "" }, "require": { @@ -2408,11 +2408,11 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-10-24T13:47:00+00:00" + "time": "2024-11-13T16:35:31+00:00" }, { "name": "filament/notifications", - "version": "v3.2.122", + "version": "v3.2.124", "source": { "type": "git", "url": "https://github.com/filamentphp/notifications.git", @@ -2464,16 +2464,16 @@ }, { "name": "filament/support", - "version": "v3.2.122", + "version": "v3.2.124", "source": { "type": "git", "url": "https://github.com/filamentphp/support.git", - "reference": "e7174cee7e1d08205f7120d0dcc0d00d9bdd4d32" + "reference": "13b1e485d3bc993950c9e61a3f6a8cb05efd2b96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/support/zipball/e7174cee7e1d08205f7120d0dcc0d00d9bdd4d32", - "reference": "e7174cee7e1d08205f7120d0dcc0d00d9bdd4d32", + "url": "https://api.github.com/repos/filamentphp/support/zipball/13b1e485d3bc993950c9e61a3f6a8cb05efd2b96", + "reference": "13b1e485d3bc993950c9e61a3f6a8cb05efd2b96", "shasum": "" }, "require": { @@ -2519,20 +2519,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-10-31T13:38:25+00:00" + "time": "2024-11-13T16:35:51+00:00" }, { "name": "filament/tables", - "version": "v3.2.122", + "version": "v3.2.124", "source": { "type": "git", "url": "https://github.com/filamentphp/tables.git", - "reference": "56a852f7992a01ad8d7b85034cdbb2ae8a21086a" + "reference": "5f1b04952080e71f3f72bae3801f2757619722e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/tables/zipball/56a852f7992a01ad8d7b85034cdbb2ae8a21086a", - "reference": "56a852f7992a01ad8d7b85034cdbb2ae8a21086a", + "url": "https://api.github.com/repos/filamentphp/tables/zipball/5f1b04952080e71f3f72bae3801f2757619722e7", + "reference": "5f1b04952080e71f3f72bae3801f2757619722e7", "shasum": "" }, "require": { @@ -2571,20 +2571,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-10-31T13:38:27+00:00" + "time": "2024-11-13T16:35:47+00:00" }, { "name": "filament/widgets", - "version": "v3.2.122", + "version": "v3.2.124", "source": { "type": "git", "url": "https://github.com/filamentphp/widgets.git", - "reference": "14ae503aae8265ddc48274debbf7b7aefc7afb0b" + "reference": "59a907af93c9027180e2bac5879f35b5fb11c96f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/widgets/zipball/14ae503aae8265ddc48274debbf7b7aefc7afb0b", - "reference": "14ae503aae8265ddc48274debbf7b7aefc7afb0b", + "url": "https://api.github.com/repos/filamentphp/widgets/zipball/59a907af93c9027180e2bac5879f35b5fb11c96f", + "reference": "59a907af93c9027180e2bac5879f35b5fb11c96f", "shasum": "" }, "require": { @@ -2615,7 +2615,7 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-10-08T14:24:26+00:00" + "time": "2024-11-13T16:35:48+00:00" }, { "name": "firebase/php-jwt", From 30ade46e89232d6a30113c2465a47c4439918f3e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Nov 2024 13:51:37 +0000 Subject: [PATCH 06/10] build: Bump laravel/passport from 12.3.0 to 12.3.1 (#3871) Bumps [laravel/passport](https://github.com/laravel/passport) from 12.3.0 to 12.3.1. - [Release notes](https://github.com/laravel/passport/releases) - [Changelog](https://github.com/laravel/passport/blob/12.x/CHANGELOG.md) - [Commits](https://github.com/laravel/passport/compare/v12.3.0...v12.3.1) --- updated-dependencies: - dependency-name: laravel/passport dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.lock | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/composer.lock b/composer.lock index 2b2c61351..0df9ca210 100644 --- a/composer.lock +++ b/composer.lock @@ -3753,16 +3753,16 @@ }, { "name": "laravel/passport", - "version": "v12.3.0", + "version": "v12.3.1", "source": { "type": "git", "url": "https://github.com/laravel/passport.git", - "reference": "ca63a86697a4fa091c7dcabe88ebba91d97c785d" + "reference": "0d95ca9cc9c80bdf64d04dcf04542720e3d5d55c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/passport/zipball/ca63a86697a4fa091c7dcabe88ebba91d97c785d", - "reference": "ca63a86697a4fa091c7dcabe88ebba91d97c785d", + "url": "https://api.github.com/repos/laravel/passport/zipball/0d95ca9cc9c80bdf64d04dcf04542720e3d5d55c", + "reference": "0d95ca9cc9c80bdf64d04dcf04542720e3d5d55c", "shasum": "" }, "require": { @@ -3825,7 +3825,7 @@ "issues": "https://github.com/laravel/passport/issues", "source": "https://github.com/laravel/passport" }, - "time": "2024-08-05T13:44:51+00:00" + "time": "2024-11-11T20:15:28+00:00" }, { "name": "laravel/prompts", @@ -4283,16 +4283,16 @@ }, { "name": "lcobucci/jwt", - "version": "5.4.0", + "version": "5.4.2", "source": { "type": "git", "url": "https://github.com/lcobucci/jwt.git", - "reference": "aac4fd512681fd5cb4b77d2105ab7ec700c72051" + "reference": "ea1ce71cbf9741e445a5914e2f67cdbb484ff712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/jwt/zipball/aac4fd512681fd5cb4b77d2105ab7ec700c72051", - "reference": "aac4fd512681fd5cb4b77d2105ab7ec700c72051", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/ea1ce71cbf9741e445a5914e2f67cdbb484ff712", + "reference": "ea1ce71cbf9741e445a5914e2f67cdbb484ff712", "shasum": "" }, "require": { @@ -4340,7 +4340,7 @@ ], "support": { "issues": "https://github.com/lcobucci/jwt/issues", - "source": "https://github.com/lcobucci/jwt/tree/5.4.0" + "source": "https://github.com/lcobucci/jwt/tree/5.4.2" }, "funding": [ { @@ -4352,7 +4352,7 @@ "type": "patreon" } ], - "time": "2024-10-08T22:06:45+00:00" + "time": "2024-11-07T12:54:35+00:00" }, { "name": "league/commonmark", @@ -10669,16 +10669,16 @@ }, { "name": "symfony/psr-http-message-bridge", - "version": "v7.1.4", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "405a7bcd872f1563966f64be19f1362d94ce71ab" + "reference": "f16471bb19f6685b9ccf0a2c03c213840ae68cd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/405a7bcd872f1563966f64be19f1362d94ce71ab", - "reference": "405a7bcd872f1563966f64be19f1362d94ce71ab", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/f16471bb19f6685b9ccf0a2c03c213840ae68cd6", + "reference": "f16471bb19f6685b9ccf0a2c03c213840ae68cd6", "shasum": "" }, "require": { @@ -10732,7 +10732,7 @@ "psr-7" ], "support": { - "source": "https://github.com/symfony/psr-http-message-bridge/tree/v7.1.4" + "source": "https://github.com/symfony/psr-http-message-bridge/tree/v7.1.6" }, "funding": [ { @@ -10748,7 +10748,7 @@ "type": "tidelift" } ], - "time": "2024-08-15T22:48:53+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/routing", From ee5136dad75890846fe84f97c536853882dc11f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:48:55 +0000 Subject: [PATCH 07/10] build: Bump @alpinejs/collapse from 3.14.1 to 3.14.3 (#3827) Bumps [@alpinejs/collapse](https://github.com/alpinejs/alpine/tree/HEAD/packages/collapse) from 3.14.1 to 3.14.3. - [Release notes](https://github.com/alpinejs/alpine/releases) - [Commits](https://github.com/alpinejs/alpine/commits/v3.14.3/packages/collapse) --- updated-dependencies: - dependency-name: "@alpinejs/collapse" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5d595e59b..21e974b5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "name": "vatsimukcore", "license": "MIT", "dependencies": { - "@alpinejs/collapse": "^3.14.1", + "@alpinejs/collapse": "^3.14.3", "alpinejs": "^3.14.3" }, "devDependencies": { @@ -46,9 +46,9 @@ } }, "node_modules/@alpinejs/collapse": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/@alpinejs/collapse/-/collapse-3.14.1.tgz", - "integrity": "sha512-aI0pq8SjK7c43/nMIVL1Lt8naowPRepqQGNSb9KaG7adEneOwj/vq4ZaeZYjuGbd8sq1LKPwWU+klIZIXXujUA==" + "version": "3.14.3", + "resolved": "https://registry.npmjs.org/@alpinejs/collapse/-/collapse-3.14.3.tgz", + "integrity": "sha512-gqyzDLf6i6GPzqJROClVXpq10q/5gYfmcnmBs+UGHkHHeu7VYkMJUzH/ukPmbRmnJnZ2xkjEZz6yRrjun6N88A==" }, "node_modules/@babel/parser": { "version": "7.23.9", diff --git a/package.json b/package.json index 6cbf49135..4541a7924 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "vue-template-compiler": "^2.7.16" }, "dependencies": { - "@alpinejs/collapse": "^3.14.1", + "@alpinejs/collapse": "^3.14.3", "alpinejs": "^3.14.3" }, "type": "module" From e9c7a34454ed49a72807e3bd8ccb93fe845ccc74 Mon Sep 17 00:00:00 2001 From: Max Brokman Date: Tue, 19 Nov 2024 12:09:22 +0000 Subject: [PATCH 08/10] refactor: Move WaitingListAccount to entity (#3852) * fix: Re-write ide helper doc blocks before more refactoring work * refactor: Large refactoring to WaitingListAccount, converting it from a pivot table to a full status entity This is quite a large commit that moves the AccountWaitingList from a `Pivot` to an `Entity` and changes some related functionality. Doing so allows further work on waiting lists in the future and enables some cleanups to waiting list code. As a result of this it is somewhat harder to jump up and down (e.g access WaitingLists from Accounts) but all functionality should remain the same. I tried to has laravels Has...Through type relationships but they don't work for this tree unfortunately * fix: Weird bug on my machine where blade is fine with undefined vars in test? Caught by CI --------- Co-authored-by: Dave Etheridge --- .../CheckWaitingListEligibilityCommand.php | 8 +- .../Training/AccountAddedToWaitingList.php | 8 +- .../Pages/ViewWaitingList.php | 6 +- app/Http/Controllers/Mship/WaitingLists.php | 28 ++-- .../UpdateAccountWaitingListEligibility.php | 2 +- .../Training/WaitingList/AssignFlags.php | 2 +- .../CheckWaitingListAccountInactivity.php | 8 +- .../CheckWaitingListAccountMshipState.php | 3 +- app/Models/Mship/Account.php | 7 +- app/Models/Mship/Concerns/HasWaitingLists.php | 45 +++++-- app/Models/Training/WaitingList.php | 61 +++++---- .../WaitingList/WaitingListAccount.php | 4 +- .../Training/CheckWaitingListFlags.php | 8 +- docs/waitinglists/index.md | 52 ++++++++ .../_waiting_lists_list.blade.php | 53 ++++---- .../views/mship/waiting-lists/index.blade.php | 14 +- .../Pages/ViewWaitingListPageTest.php | 18 +-- .../WaitingListInactivityIntegrationTest.php | 3 +- .../Relationships/AccountWaitingListsTest.php | 10 +- .../WaitingListAccountCtsTheoryTest.php | 124 ++++++------------ .../WaitingListAccountStateChangeTest.php | 4 +- .../WaitingList/WaitingListAccountTest.php | 10 +- .../WaitingListCheckFlagsServiceTest.php | 4 +- .../WaitingList/WaitingListFlagTest.php | 36 ++--- .../Training/WaitingList/WaitingListTest.php | 34 +---- .../WaitingListWriteEligibilityTest.php | 7 +- 26 files changed, 304 insertions(+), 255 deletions(-) create mode 100644 docs/waitinglists/index.md diff --git a/app/Console/Commands/Training/CheckWaitingListEligibilityCommand.php b/app/Console/Commands/Training/CheckWaitingListEligibilityCommand.php index 2c0bd22e2..9f4c403c8 100644 --- a/app/Console/Commands/Training/CheckWaitingListEligibilityCommand.php +++ b/app/Console/Commands/Training/CheckWaitingListEligibilityCommand.php @@ -44,8 +44,8 @@ public function handle() } if ($this->argument('account')) { - $activeWaitingLists = $activeWaitingLists->filter(function ($waitingList) { - return $waitingList->accounts->contains($this->argument('account')); + $activeWaitingLists = $activeWaitingLists->filter(function (WaitingList $waitingList) { + return $waitingList->includesAccount($this->argument('account')); }); if ($activeWaitingLists->isEmpty()) { @@ -56,8 +56,8 @@ public function handle() } foreach ($activeWaitingLists as $waitingList) { - foreach ($waitingList->accounts as $account) { - UpdateAccountWaitingListEligibility::dispatch($account); + foreach ($waitingList->waitingListAccounts as $waitingListAccount) { + UpdateAccountWaitingListEligibility::dispatch($waitingListAccount->account); } } diff --git a/app/Events/Training/AccountAddedToWaitingList.php b/app/Events/Training/AccountAddedToWaitingList.php index 665d0e13f..d0ebba069 100644 --- a/app/Events/Training/AccountAddedToWaitingList.php +++ b/app/Events/Training/AccountAddedToWaitingList.php @@ -5,6 +5,7 @@ use App\Contracts\AccountCentricEvent; use App\Models\Mship\Account; use App\Models\Training\WaitingList; +use App\Models\Training\WaitingList\WaitingListAccount; use Illuminate\Broadcasting\InteractsWithSockets; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; @@ -16,7 +17,12 @@ class AccountAddedToWaitingList implements AccountCentricEvent /** * Create a new event instance. */ - public function __construct(public Account $account, public WaitingList $waitingList, public Account $staffAccount) {} + public function __construct( + public Account $account, + public WaitingList $waitingList, + public Account $staffAccount, + public WaitingListAccount $waitingListAccount, + ) {} public function getAccount(): Account { diff --git a/app/Filament/Resources/WaitingListResource/Pages/ViewWaitingList.php b/app/Filament/Resources/WaitingListResource/Pages/ViewWaitingList.php index a7ea00258..6cf22ca0d 100644 --- a/app/Filament/Resources/WaitingListResource/Pages/ViewWaitingList.php +++ b/app/Filament/Resources/WaitingListResource/Pages/ViewWaitingList.php @@ -6,6 +6,7 @@ use App\Filament\Resources\WaitingListResource\Widgets\IndividualWaitingListOverview; use App\Models\Atc\PositionGroup; use App\Models\Mship\Account; +use App\Models\Training\WaitingList; use App\Models\Training\WaitingList\WaitingListFlag; use Carbon\Carbon; use Filament\Actions; @@ -16,6 +17,9 @@ use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Support\Arr; +/** + * @property WaitingList $record + */ class ViewWaitingList extends ViewRecord { protected static string $resource = WaitingListResource::class; @@ -45,7 +49,7 @@ protected function getHeaderActions(): array TextInput::make('account_id') ->label('Account CID') ->rule(fn () => function ($attribute, $value, $fail) { - if ($this->record->accounts->contains('id', $value)) { + if ($this->record->includesAccount($value)) { $fail('This account is already in this waiting list.'); } }) diff --git a/app/Http/Controllers/Mship/WaitingLists.php b/app/Http/Controllers/Mship/WaitingLists.php index b4a882ce1..a98054d1c 100644 --- a/app/Http/Controllers/Mship/WaitingLists.php +++ b/app/Http/Controllers/Mship/WaitingLists.php @@ -4,24 +4,34 @@ use App\Http\Controllers\BaseController; use App\Models\Training\WaitingList; +use App\Models\Training\WaitingList\WaitingListAccount; use Illuminate\Http\Request; +use Illuminate\Support\Collection; class WaitingLists extends BaseController { public function index(Request $request) { - $atcWaitingLists = $request->user()->currentWaitingLists() - ->withPivot([ - 'created_at', - ])->where('department', WaitingList::ATC_DEPARTMENT)->get(); - $pilotWaitingLists = $request->user()->currentWaitingLists()->withPivot([ - 'created_at', - ])->where('department', WaitingList::PILOT_DEPARTMENT)->get(); + /** @var Collection $waitingListAccounts */ + $waitingListAccounts = $request->user()->waitingListAccounts; + + $atcWaitingListAccounts = collect(); + $pilotWaitingListAccounts = collect(); + + foreach ($waitingListAccounts as $waitingListAccount) { + if ($waitingListAccount->waitingList->department == WaitingList::ATC_DEPARTMENT) { + $atcWaitingListAccounts->push($waitingListAccount); + } + + if ($waitingListAccount->waitingList->department == WaitingList::PILOT_DEPARTMENT) { + $pilotWaitingListAccounts->push($waitingListAccount); + } + } return view('mship.waiting-lists.index', [ 'isOBS' => $request->user()->qualification_atc->is_o_b_s, - 'atcLists' => $atcWaitingLists, - 'pilotLists' => $pilotWaitingLists, + 'atcWaitingListAccounts' => $atcWaitingListAccounts, + 'pilotWaitingListAccounts' => $pilotWaitingListAccounts, ]); } } diff --git a/app/Jobs/Training/UpdateAccountWaitingListEligibility.php b/app/Jobs/Training/UpdateAccountWaitingListEligibility.php index d9b9b7436..567802729 100644 --- a/app/Jobs/Training/UpdateAccountWaitingListEligibility.php +++ b/app/Jobs/Training/UpdateAccountWaitingListEligibility.php @@ -31,7 +31,7 @@ public function handle() { $service = new CheckWaitingListFlags($this->account); - $accountWaitingLists = $this->account->currentWaitingLists; + $accountWaitingLists = $this->account->currentWaitingLists(); foreach ($accountWaitingLists as $waitingList) { WriteWaitingListFlagSummary::handle($waitingList, $service); diff --git a/app/Listeners/Training/WaitingList/AssignFlags.php b/app/Listeners/Training/WaitingList/AssignFlags.php index 95d757c42..4694d7126 100644 --- a/app/Listeners/Training/WaitingList/AssignFlags.php +++ b/app/Listeners/Training/WaitingList/AssignFlags.php @@ -26,7 +26,7 @@ public function __construct() public function handle(AccountAddedToWaitingList $event) { /** @var WaitingListAccount $waitingList */ - $waitingListAccount = $event->waitingList->accounts()->findOrFail($event->account->id)->pivot; + $waitingListAccount = $event->waitingListAccount; $flags = $event->waitingList->flags(); diff --git a/app/Listeners/Training/WaitingList/CheckWaitingListAccountInactivity.php b/app/Listeners/Training/WaitingList/CheckWaitingListAccountInactivity.php index 52addce93..1dd908c26 100644 --- a/app/Listeners/Training/WaitingList/CheckWaitingListAccountInactivity.php +++ b/app/Listeners/Training/WaitingList/CheckWaitingListAccountInactivity.php @@ -24,20 +24,20 @@ public function handle(AccountAltered $event) return; } - if ($account->currentWaitingLists->count() == 0) { + if ($account->currentWaitingLists()->count() == 0) { Log::debug("Inactive account {$account->id} is not in a waiting list, skipping"); return; } - foreach ($account->currentWaitingLists as $waitingList) { + foreach ($account->currentWaitingLists() as $waitingList) { Log::info("Inactive account {$account->id} is in waiting list {$waitingList->id} - removing from waiting list"); $waitingList->removeFromWaitingList($account); } - Log::info("Account {$account->id} is in waiting lists {$account->currentWaitingLists->pluck('id')->join(', ')}, with inactive account state - (fake) notifying account"); + Log::info("Account {$account->id} is in waiting lists {$account->currentWaitingLists()->pluck('id')->join(', ')}, with inactive account state - (fake) notifying account"); - $account->notify(new RemovedFromWaitingListInactiveAccount($account->currentWaitingLists)); + $account->notify(new RemovedFromWaitingListInactiveAccount($account->currentWaitingLists())); } } diff --git a/app/Listeners/Training/WaitingList/CheckWaitingListAccountMshipState.php b/app/Listeners/Training/WaitingList/CheckWaitingListAccountMshipState.php index 5b3dc3783..db37c8d88 100644 --- a/app/Listeners/Training/WaitingList/CheckWaitingListAccountMshipState.php +++ b/app/Listeners/Training/WaitingList/CheckWaitingListAccountMshipState.php @@ -4,6 +4,7 @@ use App\Events\Mship\AccountAltered; use App\Models\Mship\State; +use App\Models\Training\WaitingList; use App\Notifications\Training\RemovedFromWaitingListNonHomeMember; use Illuminate\Support\Facades\Log; @@ -20,7 +21,7 @@ public function handle(AccountAltered $event) // ensure we have the latest data $account = $event->account->refresh(); - $accountsWaitingList = $account->currentWaitingLists->filter(function ($waitingList) { + $accountsWaitingList = $account->currentWaitingLists()->filter(function (WaitingList $waitingList) { return $waitingList->home_members_only; }); diff --git a/app/Models/Mship/Account.php b/app/Models/Mship/Account.php index c2100b27b..5dabce702 100644 --- a/app/Models/Mship/Account.php +++ b/app/Models/Mship/Account.php @@ -150,6 +150,7 @@ * @property-read int|null $permissions_count * @property-read \Illuminate\Database\Eloquent\Collection $pireps * @property-read int|null $pireps_count + * @property-read \App\Models\Training\WaitingList\WaitingListAccount $pivot * @property-read \Illuminate\Database\Eloquent\Collection $qualifications * @property-read int|null $qualifications_count * @property-read \Illuminate\Database\Eloquent\Collection $readSystemNotifications @@ -182,9 +183,9 @@ * @method static \Illuminate\Database\Eloquent\Builder|Account newQuery() * @method static \Illuminate\Database\Eloquent\Builder|Account notBanned() * @method static \Illuminate\Database\Eloquent\Builder|Account onlyTrashed() - * @method static \Illuminate\Database\Eloquent\Builder|Account permission($permissions) + * @method static \Illuminate\Database\Eloquent\Builder|Account permission($permissions, $without = false) * @method static \Illuminate\Database\Eloquent\Builder|Account query() - * @method static \Illuminate\Database\Eloquent\Builder|Account role($roles, $guard = null) + * @method static \Illuminate\Database\Eloquent\Builder|Account role($roles, $guard = null, $without = false) * @method static \Illuminate\Database\Eloquent\Builder|Account whereAge($value) * @method static \Illuminate\Database\Eloquent\Builder|Account whereCertCheckedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Account whereCreatedAt($value) @@ -214,6 +215,8 @@ * @method static \Illuminate\Database\Eloquent\Builder|Account whereVatsimRefreshToken($value) * @method static \Illuminate\Database\Eloquent\Builder|Account whereVatsimTokenExpires($value) * @method static \Illuminate\Database\Eloquent\Builder|Account withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Account withoutPermission($permissions) + * @method static \Illuminate\Database\Eloquent\Builder|Account withoutRole($roles, $guard = null) * @method static \Illuminate\Database\Eloquent\Builder|Account withoutTrashed() * * @mixin \Eloquent diff --git a/app/Models/Mship/Concerns/HasWaitingLists.php b/app/Models/Mship/Concerns/HasWaitingLists.php index 3379153a8..62bfca451 100644 --- a/app/Models/Mship/Concerns/HasWaitingLists.php +++ b/app/Models/Mship/Concerns/HasWaitingLists.php @@ -4,21 +4,50 @@ use App\Models\Training\WaitingList; use App\Models\Training\WaitingList\WaitingListAccount; +use Illuminate\Support\Collection; trait HasWaitingLists { + public function waitingListAccounts() + { + return $this->hasMany(WaitingListAccount::class)->with('waitingList'); + } + + /** + * Get *all* waiting lists for this account, including ones the account has been removed from + * + * @return Collection + */ public function waitingLists() { - return $this->belongsToMany( - WaitingList::class, - 'training_waiting_list_account', - 'account_id', - 'list_id' - )->using(WaitingListAccount::class)->withPivot(['id', 'deleted_at']); + return $this->waitingListAccounts() + ->withTrashed() + ->get() + ->mapWithKeys(function (WaitingListAccount $waitingListAccount) { + return [$waitingListAccount->waitingList->id => $waitingListAccount->waitingList]; + }) + ->values(); } - public function currentWaitingLists() + /** + * Get all "live" waiting lists for this account + * + * @return Collection + */ + public function currentWaitingLists(): Collection { - return $this->waitingLists()->wherePivot('deleted_at', null); + // waiting list accounts soft delete so this will exclude them + $waitingListAccounts = $this->waitingListAccounts() + ->with('waitingList') + ->get(); + + // @fixme maybe replace with mapWithKeys + $waitingLists = collect(); + foreach ($waitingListAccounts as $waitingListAccount) { + $waitingList = $waitingListAccount->waitingList; + $waitingLists->put($waitingList->id, $waitingList); + } + + return $waitingLists->values(); } } diff --git a/app/Models/Training/WaitingList.php b/app/Models/Training/WaitingList.php index 4832abe20..12370699c 100644 --- a/app/Models/Training/WaitingList.php +++ b/app/Models/Training/WaitingList.php @@ -112,6 +112,8 @@ public function staff() */ public function accounts(): BelongsToMany { + // this aint gonna work because the waitinglistaccount is no longer a pivot! + return $this->belongsToMany( Account::class, 'training_waiting_list_account', @@ -149,21 +151,7 @@ public function flags() } /** - * Get the position of an account in the eligible waiting list. - * - * @return int|null - */ - public function accountPosition(Account $account) - { - $key = $this->accounts->search(function ($accountItem) use ($account) { - return $accountItem->id == $account->id; - }); - - return ($key !== false) ? $key + 1 : null; - } - - /** - * Alternative to accountPosition for use with filament, beware N+1 issues + * Find the position of a WaitingListAccount on this waiting list. */ public function positionOf(WaitingListAccount $waitingListAccount): ?int { @@ -181,8 +169,8 @@ public function addFlag(WaitingListFlag $flag) { $savedFlag = $this->flags()->save($flag); - $this->accounts()->each(function ($account) use ($flag) { - $account->pivot->flags()->attach($flag); + $this->waitingListAccounts()->each(function (WaitingListAccount $listAccount) use ($flag) { + $listAccount->flags()->attach($flag); }); event(new FlagAddedToWaitingList($this)); @@ -202,21 +190,44 @@ public function removeFlag(WaitingListFlag $flag) /** * Add an Account to a waiting list. - * - * @fixme don't use pivot here, add the WaitingListAccount explicitly */ - public function addToWaitingList(Account $account, Account $staffAccount, ?Carbon $createdAt = null) + public function addToWaitingList(Account $account, Account $staffAccount, ?Carbon $createdAt = null): WaitingListAccount { $timestamp = $createdAt != null ? $createdAt : Carbon::now(); - $this->accounts()->attach($account, ['added_by' => $staffAccount->id]); + + $waitingListAccount = new WaitingListAccount; + $waitingListAccount->account_id = $account->id; + $waitingListAccount->added_by = $staffAccount->id; + + $waitingListAccount = $this->waitingListAccounts()->save($waitingListAccount); // the following code is required as the timestamp for created_at gets overridden during the creation // process, despite being disabled on the pivot!! - $pivot = $this->accounts()->find($account->id)->pivot; - $pivot->created_at = $timestamp; - $pivot->save(); + $waitingListAccount->created_at = $timestamp; + $waitingListAccount->save(); + + event(new AccountAddedToWaitingList($account, $this->fresh(), $staffAccount, $waitingListAccount)); + + return $waitingListAccount; + } + + public function includesAccount(int|Account $accountId): bool + { + if ($accountId instanceof Account) { + $accountId = $accountId->id; + } + + return $this->waitingListAccounts()->where('account_id', $accountId)->exists(); + } + + public function findWaitingListAccount(int|Account $accountId): ?WaitingListAccount + { + if ($accountId instanceof Account) { + $accountId = $accountId->id; + } - event(new AccountAddedToWaitingList($account, $this->fresh(), $staffAccount)); + /** @noinspection PhpIncompatibleReturnTypeInspection */ + return $this->waitingListAccounts()->where('account_id', $accountId)->first(); } /** diff --git a/app/Models/Training/WaitingList/WaitingListAccount.php b/app/Models/Training/WaitingList/WaitingListAccount.php index a082b79aa..0d5db29aa 100644 --- a/app/Models/Training/WaitingList/WaitingListAccount.php +++ b/app/Models/Training/WaitingList/WaitingListAccount.php @@ -3,6 +3,7 @@ namespace App\Models\Training\WaitingList; use App\Models\Cts\TheoryResult; +use App\Models\Model; use App\Models\Mship\Account; use App\Models\Training\WaitingList; use Illuminate\Database\Eloquent\Casts\Attribute; @@ -22,6 +23,7 @@ * @property \Illuminate\Support\Carbon|null $deleted_at * @property array|null $flags_status_summary * @property-read Account|null $account + * @property-read \App\Models\Training\WaitingList\WaitingListAccountFlag $pivot * @property-read \Illuminate\Database\Eloquent\Collection $flags * @property-read int|null $flags_count * @property-read mixed $atc_hour_check @@ -47,7 +49,7 @@ * * @mixin \Eloquent */ -class WaitingListAccount extends Pivot +class WaitingListAccount extends Model { use SoftDeletes; diff --git a/app/Services/Training/CheckWaitingListFlags.php b/app/Services/Training/CheckWaitingListFlags.php index 403581f57..25090eddc 100644 --- a/app/Services/Training/CheckWaitingListFlags.php +++ b/app/Services/Training/CheckWaitingListFlags.php @@ -4,6 +4,7 @@ use App\Models\Mship\Account; use App\Models\Training\WaitingList; +use App\Models\Training\WaitingList\WaitingListAccount; class CheckWaitingListFlags { @@ -19,7 +20,7 @@ public function __construct( */ public function checkWaitingListFlags(WaitingList $waitingList): array { - $waitingListAccount = $waitingList->accounts()->where('account_id', $this->account->id)->first()->pivot; + $waitingListAccount = $this->getWaitingListAccount($waitingList); if ($waitingList->flags()->doesntExist()) { return ['summary' => null]; @@ -32,8 +33,9 @@ public function checkWaitingListFlags(WaitingList $waitingList): array return ['summary' => $summaryByFlag->toArray()]; } - public function getWaitingListAccount(WaitingList $waitingList) + public function getWaitingListAccount(WaitingList $waitingList): WaitingListAccount { - return $waitingList->accounts()->where('account_id', $this->account->id)->first()->pivot; + /** @noinspection PhpIncompatibleReturnTypeInspection */ + return $waitingList->findWaitingListAccount($this->account); } } diff --git a/docs/waitinglists/index.md b/docs/waitinglists/index.md new file mode 100644 index 000000000..283c917f0 --- /dev/null +++ b/docs/waitinglists/index.md @@ -0,0 +1,52 @@ +# Waiting Lists Introduction + +Core manages Vatsim UK's waiting lists for pilot and ATC training. +Given the significant and ongoing demand for training it makes sense to have something purpose built +to track members' position in the queue. + +At time of writing Core is used to manage waiting lists for ATC ratings (excluding OBS -> S1), Endorsements and Pilot Training. + +## Waiting Lists + +Individual waiting lists are not defined explicitly in Core. Instead they are managed in the database. + +In addition to having a name and ID a waiting list: + +- Belongs to either the ATC or Pilot training departments. + This drives downstream functionality, including the way we show waiting list positions to members +- Has feature toggles + These control if the waiting list checks cts exam statuses or atc hours +- CTS exam level + For ATC training waiting lists store the id of the CTS exam used to check theory results. +- Can be marked as for home members only. + This is used to prevent addition of non division members and to automate removals of members transferring out of the division. + +Waiting lists also have a list of flags (also stored in the database) which are applied to members joining the list. +These are used by staff to manually *flag* members as having completed Moodle exams, met waiting list requirements etc. +Flags are a simple binary toggle. + +Waiting lists are associated with staff who can manage the list. + +## Waiting List Accounts + +Members are added to a waiting list through the creation of a `WaitingListAccount` object attached to the waiting list +and the member. + +Waiting List order is determined by the creation date of the `WaitingListAccount`. + +To remove a member to the `WaitingListAccount` is soft deleted. + +Waiting List Accounts have their flags synchronized from the parent waiting list and the state of these flags can then +be changed manually. + +Waiting List Accounts have their flag status cached onto the WaitingListAccount model. + +## Feature Run Down + +- Add + - Sync flags + - Log +- Check eligibility + - this appears somewhat mislabelled as it's actually doing the flag caching? +- Home member removal (processes on account state change) +- Manual removal (consider adding removal reason) diff --git a/resources/views/mship/waiting-lists/_waiting_lists_list.blade.php b/resources/views/mship/waiting-lists/_waiting_lists_list.blade.php index d3e83adf3..c4062e4cb 100644 --- a/resources/views/mship/waiting-lists/_waiting_lists_list.blade.php +++ b/resources/views/mship/waiting-lists/_waiting_lists_list.blade.php @@ -10,49 +10,54 @@ Waiting List Position Joined List - On Roster - Theory Exam Passed + + @if($department === \App\Models\Training\WaitingList::ATC_DEPARTMENT) + On Roster + Theory Exam Passed + @endif - @foreach($waitingLists as $waitingList) + @foreach($waitingListAccounts as $waitingListAccount) - {{$waitingList->name}} + {{$waitingListAccount->waitingList->name}} - @if($waitingList->pivot->position) - {{$waitingList->pivot->position}} + @if($waitingListAccount->position) + {{$waitingListAccount->position}} @else - @endif - {{$waitingList->pivot->created_at->format('d M Y')}} + {{$waitingListAccount->created_at->format('d M Y')}} - @if($waitingList->isAtcList()) + @if($department === \App\Models\Training\WaitingList::ATC_DEPARTMENT) + @if($waitingListAccount->waitingList->isAtcList()) + + @if ($waitingListAccount->account->onRoster()) + {!! HTML::img("tick_mark_circle", "png", 20) !!} + @else + {!! HTML::img("cross_mark_circle", "png", 20) !!} + @endif + + @else + + N/A + + @endif - @if ($waitingList->pivot->account->onRoster()) + @if ($waitingListAccount->waitingList->should_check_cts_theory_exam && $waitingListAccount->theory_exam_passed) {!! HTML::img("tick_mark_circle", "png", 20) !!} - @else + @elseif($waitingListAccount->waitingList->should_check_cts_theory_exam) {!! HTML::img("cross_mark_circle", "png", 20) !!} + @else + N/A @endif - @else - - N/A - @endif - - @if (($waitingList->feature_toggles['check_cts_theory_exam'] ?? true) && $waitingList->pivot->theory_exam_passed) - {!! HTML::img("tick_mark_circle", "png", 20) !!} - @elseif($waitingList->feature_toggles['check_cts_theory_exam'] ?? true) - {!! HTML::img("cross_mark_circle", "png", 20) !!} - @else - N/A - @endif - @endforeach - @if(count($waitingLists) == 0) + @if(count($waitingListAccounts) == 0) You aren't in any waiting lists at the moment. diff --git a/resources/views/mship/waiting-lists/index.blade.php b/resources/views/mship/waiting-lists/index.blade.php index f23b4a1e7..3737e4d49 100644 --- a/resources/views/mship/waiting-lists/index.blade.php +++ b/resources/views/mship/waiting-lists/index.blade.php @@ -14,7 +14,17 @@ @endif -@include('mship.waiting-lists._waiting_lists_list', ["title"=> "ATC Waiting Lists", "icon" => "fa-headset", "waitingLists" => $atcLists]) +@include('mship.waiting-lists._waiting_lists_list', [ + "title"=> "ATC Waiting Lists", + "icon" => "fa-headset", + "waitingListAccounts" => $atcWaitingListAccounts, + "department" => \App\Models\Training\WaitingList::ATC_DEPARTMENT, +]) -@include('mship.waiting-lists._waiting_lists_list', ["title"=> "Pilot Waiting Lists", "icon" => "fa-plane", "waitingLists" => $pilotLists]) +@include('mship.waiting-lists._waiting_lists_list', [ + "title"=> "Pilot Waiting Lists", + "icon" => "fa-plane", + "waitingListAccounts" => $pilotWaitingListAccounts, + "department" => \App\Models\Training\WaitingList::PILOT_DEPARTMENT, +]) @endsection diff --git a/tests/Feature/Admin/WaitingLists/Pages/ViewWaitingListPageTest.php b/tests/Feature/Admin/WaitingLists/Pages/ViewWaitingListPageTest.php index 00e5b596c..e635ebaa0 100644 --- a/tests/Feature/Admin/WaitingLists/Pages/ViewWaitingListPageTest.php +++ b/tests/Feature/Admin/WaitingLists/Pages/ViewWaitingListPageTest.php @@ -63,8 +63,6 @@ public function test_home_student_can_be_added() 'account_id' => $accountToAdd->id, ]); - $this->assertContains($accountToAdd->id, $waitingList->fresh()->accounts->pluck('id')); - $this->assertDatabaseHas('training_waiting_list_account', [ 'list_id' => $waitingList->id, 'account_id' => $accountToAdd->id, @@ -135,6 +133,7 @@ public function test_cannot_see_join_date_field_without_permission() public function test_admin_can_add_student_with_join_date_if_specified() { + /** @var WaitingList $waitingList */ $waitingList = factory(WaitingList::class)->create(['department' => 'atc']); $accountToAdd = Account::factory()->create(); $accountToAdd->addState(State::findByCode('DIVISION')); @@ -151,7 +150,7 @@ public function test_admin_can_add_student_with_join_date_if_specified() 'join_date' => '2020-01-01', ]); - $this->assertContains($accountToAdd->id, $waitingList->fresh()->accounts->pluck('id')); + $this->assertTrue($waitingList->includesAccount($accountToAdd->id)); $this->assertDatabaseHas('training_waiting_list_account', [ 'list_id' => $waitingList->id, @@ -254,13 +253,14 @@ public function test_can_view_account_in_waiting_list() Livewire::test(AccountsRelationManager::class, ['ownerRecord' => $waitingList, 'pageClass' => ViewWaitingList::class]) ->assertCanSeeTableRecords([$waitingList->waitingListAccounts()->first()]) - ->assertTableActionVisible('view', record: $waitingList->accounts->first()); + ->assertTableActionVisible('view', record: $waitingList->waitingListAccounts()->first()); } public function test_cannot_edit_account_in_waiting_list_without_permission() { Livewire::actingAs($this->adminUser); + /** @var WaitingList $waitingList */ $waitingList = factory(WaitingList::class)->create(['department' => 'atc']); $account = Account::factory()->create(); $account->addState(State::findByCode('DIVISION')); @@ -271,13 +271,14 @@ public function test_cannot_edit_account_in_waiting_list_without_permission() Livewire::test(AccountsRelationManager::class, ['ownerRecord' => $waitingList, 'pageClass' => ViewWaitingList::class]) ->assertCanSeeTableRecords([$waitingList->waitingListAccounts->first()]) - ->assertTableActionHidden('edit', record: $waitingList->accounts->first()); + ->assertTableActionHidden('edit', record: $waitingList->waitingListAccounts->first()); } public function test_can_open_edit_action_with_permission() { Livewire::actingAs($this->adminUser); + /** @var WaitingList $waitingList */ $waitingList = factory(WaitingList::class)->create(['department' => 'atc']); $account = Account::factory()->create(); $account->addState(State::findByCode('DIVISION')); @@ -289,7 +290,7 @@ public function test_can_open_edit_action_with_permission() Livewire::test(AccountsRelationManager::class, ['ownerRecord' => $waitingList, 'pageClass' => ViewWaitingList::class]) ->assertCanSeeTableRecords([$waitingList->waitingListAccounts->first()]) - ->assertTableActionVisible('edit', record: $waitingList->accounts->first()); + ->assertTableActionVisible('edit', record: $waitingList->waitingListAccounts->first()); } public function test_notes_can_be_added_to_waiting_list_account() @@ -352,6 +353,7 @@ public function test_can_modify_manual_flag_to_true() public function test_can_modify_manual_flag_to_false() { + /** @var WaitingList $waitingList */ $waitingList = factory(WaitingList::class)->create(['department' => 'atc']); $account = Account::factory()->create(); $account->addState(State::findByCode('DIVISION')); @@ -359,14 +361,14 @@ public function test_can_modify_manual_flag_to_false() 'list_id' => $waitingList->id, 'name' => 'Test Manual Flag', ]); - $waitingList->addToWaitingList($account, $this->adminUser); + $waitingListAccount = $waitingList->addToWaitingList($account, $this->adminUser); $this->adminUser->givePermissionTo('waiting-lists.view.atc'); $this->adminUser->givePermissionTo('waiting-lists.access'); $this->adminUser->givePermissionTo('waiting-lists.update-accounts.*'); // set flag to true - $waitingList->accounts->find($account->id)->pivot->flags()->sync($manualFlag->id, [ + $waitingListAccount->flags()->sync($manualFlag->id, [ 'marked_at' => now(), ]); diff --git a/tests/Feature/Training/WaitingListInactivityIntegrationTest.php b/tests/Feature/Training/WaitingListInactivityIntegrationTest.php index 5ed7142b1..03035a46b 100644 --- a/tests/Feature/Training/WaitingListInactivityIntegrationTest.php +++ b/tests/Feature/Training/WaitingListInactivityIntegrationTest.php @@ -74,10 +74,11 @@ public function itShouldReactToRealAccountAlteredEventForStateChanged() $account->addState(State::findByCode('DIVISION')); $account->refresh(); + /** @var WaitingList $waitingList */ $waitingList = factory(WaitingList::class)->create(); $waitingList->addToWaitingList($account, $this->privacc); - $this->assertTrue($waitingList->accounts->contains($account)); + $this->assertTrue($waitingList->includesAccount($account)); $account->addState(State::findByCode('REGION')); diff --git a/tests/Unit/Account/Relationships/AccountWaitingListsTest.php b/tests/Unit/Account/Relationships/AccountWaitingListsTest.php index 5d914d3eb..58f1750eb 100644 --- a/tests/Unit/Account/Relationships/AccountWaitingListsTest.php +++ b/tests/Unit/Account/Relationships/AccountWaitingListsTest.php @@ -36,15 +36,15 @@ public function setUp(): void /** @test */ public function itCanGetAllWaitingLists() { - $this->assertCount(2, $this->user->waitingLists); - $this->assertContains($this->oldWaitingList->id, $this->user->waitingLists->pluck('id')); - $this->assertContains($this->currentWaitingList->id, $this->user->waitingLists->pluck('id')); + $this->assertCount(2, $this->user->waitingLists()); + $this->assertContains($this->oldWaitingList->id, $this->user->waitingLists()->pluck('id')); + $this->assertContains($this->currentWaitingList->id, $this->user->waitingLists()->pluck('id')); } /** @test */ public function itCanGetAllCurrentWaitingLists() { - $this->assertCount(1, $this->user->fresh()->currentWaitingLists); - $this->assertContains($this->currentWaitingList->id, $this->user->fresh()->currentWaitingLists->pluck('id')); + $this->assertCount(1, $this->user->fresh()->currentWaitingLists()); + $this->assertContains($this->currentWaitingList->id, $this->user->fresh()->currentWaitingLists()->pluck('id')); } } diff --git a/tests/Unit/Training/WaitingList/WaitingListAccountCtsTheoryTest.php b/tests/Unit/Training/WaitingList/WaitingListAccountCtsTheoryTest.php index b48d95610..70d6ce0e9 100644 --- a/tests/Unit/Training/WaitingList/WaitingListAccountCtsTheoryTest.php +++ b/tests/Unit/Training/WaitingList/WaitingListAccountCtsTheoryTest.php @@ -31,137 +31,93 @@ public function setUp(): void $this->actingAs($this->privacc); } - /** @test */ - public function itShouldDetectWhenTheoryExamPassed() + private function setupWaitingList(?string $ctsLevel, ?string $department = WaitingList::ATC_DEPARTMENT): WaitingList\WaitingListAccount { - $waitingList = factory(WaitingList::class)->create([ - 'cts_theory_exam_level' => 'S3', - ]); - $waitingList->addToWaitingList($this->account->fresh(), $this->privacc); + $waitingList = factory(WaitingList::class)->create(['cts_theory_exam_level' => $ctsLevel, 'department' => $department]); + return $waitingList->addToWaitingList($this->account->fresh(), $this->privacc); + } + + private function createTheoryResult(string $ctsLevel, bool $pass) + { TheoryResult::factory()->create([ 'student_id' => $this->member->id, - 'exam' => 'S3', - 'pass' => true, + 'exam' => $ctsLevel, + 'pass' => $pass, ]); + } + + /** @test */ + public function itShouldDetectWhenTheoryExamPassed() + { + $waitingListAccount = $this->setupWaitingList('S3'); + $this->createTheoryResult('S3', true); - $this->assertTrue($waitingList->fresh()->accounts->find($this->account->id)->pivot->theoryExamPassed); + $this->assertTrue($waitingListAccount->theoryExamPassed); } /** @test */ public function itShouldDetectWhenTheoryExamFailed() { - $waitingList = factory(WaitingList::class)->create([ - 'cts_theory_exam_level' => 'S3', - ]); - $waitingList->addToWaitingList($this->account, $this->privacc); + $waitingListAccount = $this->setupWaitingList('S3'); + $this->createTheoryResult('S3', false); - TheoryResult::factory()->create([ - 'student_id' => $this->member->id, - 'exam' => 'S3', - 'pass' => false, - ]); - - $this->assertFalse($waitingList->accounts->find($this->account->id)->pivot->theoryExamPassed); + $this->assertFalse($waitingListAccount->theoryExamPassed); } /** @test */ public function itShouldReturnFalseWhenPilotWaitingList() { - $waitingList = factory(WaitingList::class)->create([ - 'cts_theory_exam_level' => null, - 'department' => WaitingList::PILOT_DEPARTMENT, - ]); - - $waitingList->addToWaitingList($this->account, $this->privacc); + $waitingListAccount = $this->setupWaitingList(null, WaitingList::PILOT_DEPARTMENT); - $this->assertFalse($waitingList->accounts->find($this->account->id)->pivot->theoryExamPassed); + $this->assertFalse($waitingListAccount->theoryExamPassed); } /** @test */ public function itShouldReturnNullWhenNoExamConfigured() { - $waitingList = factory(WaitingList::class)->create([ - 'cts_theory_exam_level' => null, - ]); - - $waitingList->addToWaitingList($this->account, $this->privacc); + $waitingListAccount = $this->setupWaitingList(null); + $this->createTheoryResult('S3', true); - $this->assertFalse($waitingList->accounts->find($this->account->id)->pivot->theoryExamPassed); + $this->assertFalse($waitingListAccount->theoryExamPassed); } /** @test */ public function itShouldReturnNullWhenNoTheoryResultFound() { - $waitingList = factory(WaitingList::class)->create([ - 'cts_theory_exam_level' => 'S3', - ]); + $waitingListAccount = $this->setupWaitingList('S3'); + // note no exam pass - $waitingList->addToWaitingList($this->account, $this->privacc); - - $this->assertFalse($waitingList->accounts->find($this->account->id)->pivot->theoryExamPassed); + $this->assertFalse($waitingListAccount->theoryExamPassed); } /** @test */ public function itShouldOnlyDetectPassesAtTheConfiguredExamLevel() { - $waitingList = factory(WaitingList::class)->create([ - 'cts_theory_exam_level' => 'S3', - ]); - $waitingList->addToWaitingList($this->account->fresh(), $this->privacc); + $waitingListAccount = $this->setupWaitingList('S3'); + $this->createTheoryResult('S2', true); - TheoryResult::factory()->create([ - 'student_id' => $this->member->id, - 'exam' => 'S2', - 'pass' => true, - ]); - - $this->assertFalse($waitingList->fresh()->accounts->find($this->account->id)->pivot->theoryExamPassed); + $this->assertFalse($waitingListAccount->theoryExamPassed); } /** @test */ public function itShouldDisregardMultipleFailuresAtConfiguredLevel() { - $waitingList = factory(WaitingList::class)->create([ - 'cts_theory_exam_level' => 'S3', - ]); - $waitingList->addToWaitingList($this->account->fresh(), $this->privacc); - - TheoryResult::factory()->create([ - 'student_id' => $this->member->id, - 'exam' => 'S3', - 'pass' => false, - ]); - - TheoryResult::factory()->create([ - 'student_id' => $this->member->id, - 'exam' => 'S3', - 'pass' => false, - ]); + $waitingListAccount = $this->setupWaitingList('S3'); + $this->createTheoryResult('S3', false); + $this->createTheoryResult('S3', false); - $this->assertFalse($waitingList->fresh()->accounts->find($this->account->id)->pivot->theoryExamPassed); + $this->assertFalse($waitingListAccount->theoryExamPassed); } /** @test */ public function itShouldDisplayPassedWithPreviousFailuresAndThenPass() { - $waitingList = factory(WaitingList::class)->create([ - 'cts_theory_exam_level' => 'S3', - ]); - $waitingList->addToWaitingList($this->account->fresh(), $this->privacc); - - TheoryResult::factory()->create([ - 'student_id' => $this->member->id, - 'exam' => 'S3', - 'pass' => false, - ]); - - TheoryResult::factory()->create([ - 'student_id' => $this->member->id, - 'exam' => 'S3', - 'pass' => true, - ]); + $waitingListAccount = $this->setupWaitingList('S3'); + $this->createTheoryResult('S3', false); + $this->createTheoryResult('S3', false); + $this->createTheoryResult('S3', true); - $this->assertTrue($waitingList->fresh()->accounts->find($this->account->id)->pivot->theoryExamPassed); + $this->assertTrue($waitingListAccount->theoryExamPassed); } } diff --git a/tests/Unit/Training/WaitingList/WaitingListAccountStateChangeTest.php b/tests/Unit/Training/WaitingList/WaitingListAccountStateChangeTest.php index c51044ad5..0eae6db59 100644 --- a/tests/Unit/Training/WaitingList/WaitingListAccountStateChangeTest.php +++ b/tests/Unit/Training/WaitingList/WaitingListAccountStateChangeTest.php @@ -95,7 +95,7 @@ public function itShouldNotRemoveFromListWhenDivisionStateDoesNotChange() $event = new AccountAltered($account->fresh()); (new CheckWaitingListAccountMshipState)->handle($event); - $this->assertTrue($this->waitingList->accounts->contains($account)); + $this->assertTrue($this->waitingList->includesAccount($account)); Notification::assertNotSentTo($account, RemovedFromWaitingListNonHomeMember::class); } @@ -129,7 +129,7 @@ public function itShouldRemoveFromListWhenUserBecomesInactiveWhenAltered() $event = new AccountAltered($account->fresh()); (new CheckWaitingListAccountInactivity)->handle($event); - $this->assertFalse($this->waitingList->accounts->contains($account)); + $this->assertFalse($this->waitingList->includesAccount($account)); Notification::assertSentTo($account, RemovedFromWaitingListInactiveAccount::class); } diff --git a/tests/Unit/Training/WaitingList/WaitingListAccountTest.php b/tests/Unit/Training/WaitingList/WaitingListAccountTest.php index af89bbf57..f4be7b736 100644 --- a/tests/Unit/Training/WaitingList/WaitingListAccountTest.php +++ b/tests/Unit/Training/WaitingList/WaitingListAccountTest.php @@ -27,11 +27,7 @@ public function itCanHaveNotesAdded() { $account = Account::factory()->create(); - $this->waitingList->addToWaitingList($account, $this->privacc); - - // grab the pivot model - $waitingListAccount = $this->waitingList->accounts->find($account->id)->pivot; - + $waitingListAccount = $this->waitingList->addToWaitingList($account, $this->privacc); $waitingListAccount->notes = 'This is a note'; $this->assertEquals('This is a note', $waitingListAccount->notes); @@ -69,8 +65,8 @@ public function itShouldKnowItsPosition() { /** @var Account $account */ $account = Account::factory()->create(); - $this->waitingList->addToWaitingList($account, $this->privacc); + $waitingListAccount = $this->waitingList->addToWaitingList($account, $this->privacc); - $this->assertEquals(1, $account->currentWaitingLists()->first()->pivot->position); + $this->assertEquals(1, $waitingListAccount->position); } } diff --git a/tests/Unit/Training/WaitingList/WaitingListCheckFlagsServiceTest.php b/tests/Unit/Training/WaitingList/WaitingListCheckFlagsServiceTest.php index f378a97e2..8400c7b5a 100644 --- a/tests/Unit/Training/WaitingList/WaitingListCheckFlagsServiceTest.php +++ b/tests/Unit/Training/WaitingList/WaitingListCheckFlagsServiceTest.php @@ -28,7 +28,7 @@ public function setUp(): void public function test_passes_checks_when_manual_flag_is_true_in_all_flags_config() { $waitingList = factory(WaitingList::class)->create(); - $waitingList->addToWaitingList($this->user, $this->privacc); + $waitingListAccount = $waitingList->addToWaitingList($this->user, $this->privacc); $flag = factory(WaitingListFlag::class)->create([ 'name' => 'manual', @@ -36,7 +36,7 @@ public function test_passes_checks_when_manual_flag_is_true_in_all_flags_config( 'default_value' => false, ]); $waitingList->addFlag($flag); - $waitingList->accounts()->first()->pivot->markFlag($flag); + $waitingListAccount->markFlag($flag); $result = (new CheckWaitingListFlags($this->user))->checkWaitingListFlags($waitingList->fresh()); diff --git a/tests/Unit/Training/WaitingList/WaitingListFlagTest.php b/tests/Unit/Training/WaitingList/WaitingListFlagTest.php index 990219688..6c467b696 100644 --- a/tests/Unit/Training/WaitingList/WaitingListFlagTest.php +++ b/tests/Unit/Training/WaitingList/WaitingListFlagTest.php @@ -2,11 +2,10 @@ namespace Tests\Unit\Training\WaitingList; -use App\Events\Training\AccountAddedToWaitingList; -use App\Listeners\Training\WaitingList\AssignFlags; use App\Models\Atc\PositionGroup; use App\Models\Mship\Account; use App\Models\Training\WaitingList; +use App\Models\Training\WaitingList\WaitingListAccount; use App\Models\Training\WaitingList\WaitingListFlag; use Illuminate\Foundation\Testing\DatabaseTransactions; use Tests\TestCase; @@ -15,14 +14,13 @@ class WaitingListFlagTest extends TestCase { use DatabaseTransactions; - /** @var WaitingListFlag */ - private $flag; + private WaitingListFlag $flag; - /** @var WaitingList */ - private $waitingList; + private WaitingList $waitingList; - /** @var PositionGroup */ - private $positionGroup; + private WaitingListAccount $waitingListAccount; + + private PositionGroup $positionGroup; protected function setUp(): void { @@ -34,7 +32,7 @@ protected function setUp(): void $this->waitingList = factory(WaitingList::class)->create(); $this->waitingList->addFlag($this->flag); - $this->waitingList->addToWaitingList($this->privacc, $this->privacc); + $this->waitingListAccount = $this->waitingList->addToWaitingList($this->privacc, $this->privacc); $this->positionGroup = factory(PositionGroup::class)->create(); @@ -47,13 +45,13 @@ public function itCanBeDeleted() // tests the flag has been deleted $this->assertFalse($this->waitingList->flags()->exists()); // tests that the data surrounding tha assignment of flags have been deleted on the pivot model. - $this->assertFalse($this->waitingList->accounts()->first()->pivot->flags()->exists()); + $this->assertFalse($this->waitingListAccount->flags()->exists()); } /** @test */ public function itCanBeMarked() { - $waitingListAccount = $this->waitingList->accounts()->first()->pivot; + $waitingListAccount = $this->waitingListAccount; $waitingListAccount->addFlag($this->flag); $waitingListAccount->fresh()->markFlag($this->flag); @@ -65,7 +63,7 @@ public function itCanBeMarked() /** @test */ public function itCanBeUnMarked() { - $waitingListAccount = $this->waitingList->accounts()->first()->pivot; + $waitingListAccount = $this->waitingListAccount; $waitingListAccount->addFlag($this->flag); $waitingListAccount->fresh()->unMarkFlag($this->flag); @@ -77,7 +75,7 @@ public function itCanBeUnMarked() /** @test */ public function itCantBeUnMarkedWhenAlreadyUnMarked() { - $waitingListAccount = $this->waitingList->accounts()->first()->pivot; + $waitingListAccount = $this->waitingListAccount; $waitingListAccount->addFlag($this->flag); $waitingListAccount->fresh()->unMarkFlag($this->flag); @@ -91,13 +89,7 @@ public function itAssignsDefaultFlagsOnAddingAccountToList() { $account = Account::factory()->create(); - $this->waitingList->addToWaitingList($account, $this->privacc); - - $listener = app()->make(AssignFlags::class); - $event = \Mockery::mock(AccountAddedToWaitingList::class, [$account, $this->waitingList->fresh(), $this->privacc]); - $listener->handle($event); - - $waitingListAccount = $this->waitingList->fresh()->accounts()->find($account->id)->pivot; + $waitingListAccount = $this->waitingList->addToWaitingList($account, $this->privacc); // checks that flags have been assigned. $this->assertTrue($waitingListAccount->flags()->exists()); @@ -117,8 +109,8 @@ public function itIsPropagatedToExistingAccountsWhenAFlagIsAdded() $this->waitingList->addFlag($flag); // assert that the flag which has been added is related to all the accounts which exists in the waiting list. - $this->assertTrue($this->waitingList->accounts()->each(function ($account) use ($flag) { - $this->assertTrue($account->pivot->flags->contains($flag)); + $this->assertTrue($this->waitingList->waitingListAccounts()->each(function (WaitingListAccount $waitingListAccount) use ($flag) { + $this->assertTrue($waitingListAccount->flags->contains($flag)); })); } } diff --git a/tests/Unit/Training/WaitingList/WaitingListTest.php b/tests/Unit/Training/WaitingList/WaitingListTest.php index 7bac80bda..d36fa20b0 100644 --- a/tests/Unit/Training/WaitingList/WaitingListTest.php +++ b/tests/Unit/Training/WaitingList/WaitingListTest.php @@ -64,43 +64,13 @@ public function itCanHaveStudents() $this->waitingList->addToWaitingList($account, $this->privacc); - $this->assertCount(1, $this->waitingList->accounts); + $this->assertCount(1, $this->waitingList->waitingListAccounts); $this->assertDatabaseHas('training_waiting_list_account', ['account_id' => $account->id, 'list_id' => $this->waitingList->id]); } - /** @test * */ - public function itCanFindAccountPosition() - { - $accounts_added_at = [Carbon::now()->subDays(10), Carbon::now()->subDays(1), Carbon::now()->subDays(4)]; - $accounts = []; - foreach ($accounts_added_at as $date) { - $accounts[] = Account::factory()->create(); - } - - $this->waitingList->department = WaitingList::PILOT_DEPARTMENT; - $this->waitingList->save(); - $flag = $this->waitingList->addFlag(factory(WaitingListFlag::class)->create(['default_value' => false])); - - // Add to list - foreach ($accounts as $i => $account) { - $this->waitingList->addToWaitingList($account, $this->privacc, $accounts_added_at[$i]); - WaitingList\WaitingListAccount::where('account_id', $account->id)->first()->markFlag($flag); - } - - $this->waitingList = $this->waitingList->fresh(); - - $this->assertNull($this->waitingList->accountPosition(Account::factory()->create())); // A user not in the list should return null - $this->assertEquals(1, $this->waitingList->accountPosition($accounts[0])); // First user is oldest, should be number 1 - $this->assertEquals(3, $this->waitingList->accountPosition($accounts[1])); // Second user is newest, should be number 3 - $this->assertEquals(2, $this->waitingList->accountPosition($accounts[2])); - } - - /** - * @test - * replacing accountPosition with positionOf - */ + /** @test */ public function itCanFindPositionOfAccount() { $accounts_added_at = [Carbon::now()->subDays(10), Carbon::now()->subDays(1), Carbon::now()->subDays(4)]; diff --git a/tests/Unit/Training/WaitingList/WaitingListWriteEligibilityTest.php b/tests/Unit/Training/WaitingList/WaitingListWriteEligibilityTest.php index a28b8f919..165ae13d6 100644 --- a/tests/Unit/Training/WaitingList/WaitingListWriteEligibilityTest.php +++ b/tests/Unit/Training/WaitingList/WaitingListWriteEligibilityTest.php @@ -28,11 +28,9 @@ public function setUp(): void /** @test */ public function itShouldWriteEligibilityTrueToWaitingListAccountWithNoFlags() { - $this->waitingList->addToWaitingList($this->user, $this->privacc); + $waitingListAccount = $this->waitingList->addToWaitingList($this->user, $this->privacc); $this->waitingList->refresh(); - $waitingListAccount = $this->waitingList->accounts()->where('account_id', $this->user->id)->first()->pivot; - factory(Atc::class)->create([ 'account_id' => $this->user->id, 'minutes_online' => 721, @@ -56,10 +54,9 @@ public function itShouldWriteEligibilityWithPassingManualFlags() $flag = factory(WaitingListFlag::class)->create(); $this->waitingList->addFlag($flag); - $this->waitingList->addToWaitingList($this->user, $this->privacc); + $waitingListAccount = $this->waitingList->addToWaitingList($this->user, $this->privacc); $this->waitingList->refresh(); - $waitingListAccount = $this->waitingList->accounts()->where('account_id', $this->user->id)->first()->pivot; $waitingListAccount->markFlag($flag); factory(Atc::class)->create([ From 6933042a7ee6a1eca9c6fc88fda9445c090f1808 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 12:27:49 +0000 Subject: [PATCH 09/10] build: Bump sentry/sentry-laravel from 4.9.0 to 4.10.0 (#3862) Bumps [sentry/sentry-laravel](https://github.com/getsentry/sentry-laravel) from 4.9.0 to 4.10.0. - [Release notes](https://github.com/getsentry/sentry-laravel/releases) - [Changelog](https://github.com/getsentry/sentry-laravel/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-laravel/compare/4.9.0...4.10.0) --- updated-dependencies: - dependency-name: sentry/sentry-laravel dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alex Toff --- composer.lock | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/composer.lock b/composer.lock index 0df9ca210..a14bc68bc 100644 --- a/composer.lock +++ b/composer.lock @@ -8200,16 +8200,16 @@ }, { "name": "sentry/sentry", - "version": "4.9.0", + "version": "4.10.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "788ec170f51ebb22f2809a1e3f78b19ccd39b70d" + "reference": "2af937d47d8aadb8dab0b1d7b9557e495dd12856" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/788ec170f51ebb22f2809a1e3f78b19ccd39b70d", - "reference": "788ec170f51ebb22f2809a1e3f78b19ccd39b70d", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/2af937d47d8aadb8dab0b1d7b9557e495dd12856", + "reference": "2af937d47d8aadb8dab0b1d7b9557e495dd12856", "shasum": "" }, "require": { @@ -8227,12 +8227,12 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.4", - "guzzlehttp/promises": "^1.0|^2.0", + "guzzlehttp/promises": "^2.0.3", "guzzlehttp/psr7": "^1.8.4|^2.1.1", "monolog/monolog": "^1.6|^2.0|^3.0", "phpbench/phpbench": "^1.0", "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^8.5.14|^9.4", + "phpunit/phpunit": "^8.5|^9.6", "symfony/phpunit-bridge": "^5.2|^6.0|^7.0", "vimeo/psalm": "^4.17" }, @@ -8273,7 +8273,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/4.9.0" + "source": "https://github.com/getsentry/sentry-php/tree/4.10.0" }, "funding": [ { @@ -8285,27 +8285,27 @@ "type": "custom" } ], - "time": "2024-08-08T14:40:50+00:00" + "time": "2024-11-06T07:44:19+00:00" }, { "name": "sentry/sentry-laravel", - "version": "4.9.0", + "version": "4.10.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-laravel.git", - "reference": "73078e1f26d57f7a10e3bee2a2f543a02f6493c3" + "reference": "cbdd224cc5a224528bf6b19507ad76187b3bccfa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/73078e1f26d57f7a10e3bee2a2f543a02f6493c3", - "reference": "73078e1f26d57f7a10e3bee2a2f543a02f6493c3", + "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/cbdd224cc5a224528bf6b19507ad76187b3bccfa", + "reference": "cbdd224cc5a224528bf6b19507ad76187b3bccfa", "shasum": "" }, "require": { "illuminate/support": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0", "nyholm/psr7": "^1.0", "php": "^7.2 | ^8.0", - "sentry/sentry": "^4.9", + "sentry/sentry": "^4.10", "symfony/psr-http-message-bridge": "^1.0 | ^2.0 | ^6.0 | ^7.0" }, "require-dev": { @@ -8362,7 +8362,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-laravel/issues", - "source": "https://github.com/getsentry/sentry-laravel/tree/4.9.0" + "source": "https://github.com/getsentry/sentry-laravel/tree/4.10.0" }, "funding": [ { @@ -8374,7 +8374,7 @@ "type": "custom" } ], - "time": "2024-09-19T12:58:53+00:00" + "time": "2024-11-07T08:05:24+00:00" }, { "name": "spatie/color", @@ -9905,16 +9905,16 @@ }, { "name": "symfony/options-resolver", - "version": "v7.1.1", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "47aa818121ed3950acd2b58d1d37d08a94f9bf55" + "reference": "85e95eeede2d41cd146146e98c9c81d9214cae85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/47aa818121ed3950acd2b58d1d37d08a94f9bf55", - "reference": "47aa818121ed3950acd2b58d1d37d08a94f9bf55", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/85e95eeede2d41cd146146e98c9c81d9214cae85", + "reference": "85e95eeede2d41cd146146e98c9c81d9214cae85", "shasum": "" }, "require": { @@ -9952,7 +9952,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.1.1" + "source": "https://github.com/symfony/options-resolver/tree/v7.1.6" }, "funding": [ { @@ -9968,7 +9968,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:57:53+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/polyfill-ctype", From fa038ad9b68470889fe34daa15c9a1067fda4f45 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 13:02:38 +0000 Subject: [PATCH 10/10] build: Bump symfony/http-client from 7.1.5 to 7.1.8 (#3865) Bumps [symfony/http-client](https://github.com/symfony/http-client) from 7.1.5 to 7.1.8. - [Release notes](https://github.com/symfony/http-client/releases) - [Changelog](https://github.com/symfony/http-client/blob/7.1/CHANGELOG.md) - [Commits](https://github.com/symfony/http-client/compare/v7.1.5...v7.1.8) --- updated-dependencies: - dependency-name: symfony/http-client dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index a14bc68bc..83fc85fdd 100644 --- a/composer.lock +++ b/composer.lock @@ -9308,16 +9308,16 @@ }, { "name": "symfony/http-client", - "version": "v7.1.6", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "274e2f6886b43a36f8bd5dfeb67215f7ebf9e291" + "reference": "c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/274e2f6886b43a36f8bd5dfeb67215f7ebf9e291", - "reference": "274e2f6886b43a36f8bd5dfeb67215f7ebf9e291", + "url": "https://api.github.com/repos/symfony/http-client/zipball/c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a", + "reference": "c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a", "shasum": "" }, "require": { @@ -9382,7 +9382,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.1.6" + "source": "https://github.com/symfony/http-client/tree/v7.1.8" }, "funding": [ { @@ -9398,7 +9398,7 @@ "type": "tidelift" } ], - "time": "2024-10-22T09:40:50+00:00" + "time": "2024-11-13T13:40:27+00:00" }, { "name": "symfony/http-client-contracts",