diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 00000000..e0a7f846 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,6 @@ +# Browsers that we support + +last 3 version +> 0.3% +not dead # no browsers without security updates +not Firefox < 100 diff --git a/.dockerignore b/.dockerignore index fac5ce78..9a38c131 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,11 @@ -.git +.git/ +.gitlab/ +.gitlab-ci.yml *.md +.vscode/ +auth.json +Dockerfile +manifest.yaml +node_modules/ +production-resources.yaml +.env.example diff --git a/.editorconfig b/.editorconfig index 6537ca46..5395f614 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,13 +3,33 @@ root = true [*] charset = utf-8 end_of_line = lf -insert_final_newline = true +indent_size = 2 indent_style = space -indent_size = 4 +insert_final_newline = true trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false +[*.{php,json}] +indent_size = 4 + +[*.blade.php] +indent_size = 2 + [*.{yml,yaml}] indent_size = 2 + +[{compose,docker-compose}.{yml,yaml}] +indent_size = 2 + +[*.scss] +indent_size = 2 +quote_type = single + +[*.css] +indent_size = 2 +quote_type = single + +[*.vue] +indent_size = 2 diff --git a/.env.example b/.env.example index c5c08d48..567a5608 100644 --- a/.env.example +++ b/.env.example @@ -3,6 +3,7 @@ APP_ENV=local APP_KEY= APP_DEBUG=true APP_URL=http://localhost +APP_CURRENCY=EUR LOG_CHANNEL=stack LOG_LEVEL=debug @@ -15,22 +16,24 @@ DB_USERNAME=root DB_PASSWORD= BROADCAST_DRIVER=log -CACHE_DRIVER=file +CACHE_STORE=file QUEUE_CONNECTION=sync SESSION_DRIVER=file SESSION_LIFETIME=120 -MAIL_MAILER=smtp -MAIL_HOST=smtp.mailtrap.io +FILESYSTEM_DISK=local + +MAIL_MAILER=log +MAIL_SCHEME=null +MAIL_HOST=127.0.0.1 MAIL_PORT=2525 -MAIL_USERNAME= -MAIL_PASSWORD= -MAIL_ENCRYPTION= -MAIL_FROM_ADDRESS= +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_FROM_ADDRESS="hello@example.com" MAIL_FROM_NAME="${APP_NAME}" -MAIL_LIST_SERVICEWEB= -MAIL_LIST_INVALIDINCO= +MAIL_TO_CONTACT= +MAIL_TO_REGATE= # CRM CRM_ENDPOINT= @@ -48,3 +51,15 @@ MATOMO_SITE_ID= UWIL_ADMIN_SECURE_CIDR_LIST="" # - LIST SEPARATED WITH ',' (Optional) UWIL_ADMIN_SECURE_CIDR_PROJECT_ALLOWED_LIST="" + +# Arcadia API +ARCADIA_API_ENDPOINT= +ARCADIA_API_APIKEY= +ARCADIA_API_SECRET= +ARCADIA_API_IGNORE_SELF_SIGNED_CERT=false + +# Serial Caster +SERIAL_CASTER_SEED=12345 + +# LDC +LDC_HEADQUARTERS_PHONE_RECEPTION="02 43 62 70 00" diff --git a/.gitattributes b/.gitattributes index 967315dd..fcb21d39 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,11 @@ -* text=auto -*.css linguist-vendored -*.scss linguist-vendored -*.js linguist-vendored +* text=auto eol=lf + +*.blade.php diff=html +*.css diff=css +*.html diff=html +*.md diff=markdown +*.php diff=php + +/.github export-ignore CHANGELOG.md export-ignore +.styleci.yml export-ignore diff --git a/.gitignore b/.gitignore index 33d045e5..5bf70444 100644 --- a/.gitignore +++ b/.gitignore @@ -1,22 +1,51 @@ +.env +.env.testing +.env.backup +.env.production +.phpunit.result.cache +.stylelintcache +/.fleet +/.idea +/.phpunit.cache +/.vscode /node_modules +/bootstrap/cache +/public/build +/public/cache /public/hot +/public/sitemap.xml /public/storage -/public/images/content -/public/images/gammes -/public/images/produits -/public/images/slides -/public/b-o/ -/public/mix-manifest.json /storage/*.key /vendor -.env -.env.backup -.env.dev -.env.prod -.phpunit.result.cache +coverage/ +auth.json +docker-compose.override.yml Homestead.json Homestead.yaml npm-debug.log yarn-error.log -auth.json .npmrc +js.save +phpstan-report.xml + +# Ignore public favicon +/public/android-chrome-192x192.png +/public/android-chrome-512x512.png +/public/apple-touch-icon.png +/public/browserconfig.xml +/public/browserconfig.xml +/public/favicon-16x16.png +/public/favicon-32x32.png +/public/favicon.ico +/public/mstile-150x150.png +/public/safari-pinned-tab.svg +/public/site.webmanifest +/public/files + +develop +_ide_helper.php +.phpstorm.meta.php +phpstan-report.xml + +// Ignore PHPUnit cache files +cache diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5093f3fe..d3a74b38 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,23 +1,328 @@ -include: -- project: "ldc-web/shared-ci" - ref: "main" - file: "lint/lint7.3.yml" -- project: "ldc-web/shared-ci" - ref: "main" - file: "security/security7.3.yml" -- project: "ldc-web/shared-ci" - ref: "main" - file: "build/build7.3.yml" -- project: "ldc-web/shared-ci" - ref: "main" - file: "test/test.yml" -- project: "ldc-web/shared-ci" - ref: "main" - file: "deploy/deploy.yml" - stages: -- lint -- security -- build -- test -- deploy + - install + - lint + - test + - security + - build + - deploy + +include: + - project: "ldc-web/shared-ci" + ref: "main" + file: "security/composer.yml" + - project: "ldc-web/shared-ci" + ref: "main" + file: "build/composer.yml" + - project: "ldc-web/shared-ci" + ref: "main" + file: "build/docker-multistage.yml" + - project: "ldc-web/shared-ci" + ref: "main" + file: "test/test.yml" + - project: "ldc-web/shared-ci" + ref: "main" + file: "deploy/deploy.yml" + +# * LINT -------------------------------------------------------------------- + +.php-lint-base: &php-lint-base + image: $CI_REGISTRY/ldc-web/projets/ldc-web-images-docker/uwil-ci-8.5:latest + variables: + COMPOSER_CACHE_DIR: ".composer-cache" + cache: + key: + files: + - composer.lock + prefix: "composer" + policy: pull + paths: + - .composer-cache/ + - vendor/ + before_script: + - composer config gitlab-token.lab.s-web.fr $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD + - composer install --no-scripts --no-interaction --no-ansi --no-progress --prefer-dist + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH == "develop" + +parallel-lint: + <<: *php-lint-base + stage: lint + script: + - vendor/bin/parallel-lint --exclude vendor --exclude storage --exclude bootstrap --exclude node_modules . + allow_failure: false + +pint: + <<: *php-lint-base + stage: lint + script: + - vendor/bin/pint --test + allow_failure: false + +phpcs: + <<: *php-lint-base + stage: lint + script: + - vendor/bin/phpcs --standard=phpcs.xml --extensions=php --ignore=vendor/*,storage/*,bootstrap/*,node_modules/* --report=junit --report-file=phpcs-report.xml + artifacts: + when: on_failure + expose_as: 'phpcs' + paths: + - phpcs-report.xml + reports: + junit: phpcs-report.xml + allow_failure: false + +phpstan: + <<: *php-lint-base + stage: lint + variables: + PHP_MEMORY_LIMIT: "512M" + COMPOSER_CACHE_DIR: ".composer-cache" + script: + - php -d memory_limit=512M vendor/bin/phpstan --error-format=junit > phpstan-report.xml + artifacts: + when: on_failure + expose_as: 'phpstan' + paths: + - phpstan-report.xml + reports: + junit: phpstan-report.xml + allow_failure: false + +eslint: + stage: lint + image: oven/bun:1 + variables: + BUN_INSTALL_CACHE_DIR: ".bun-cache" + cache: + key: + files: + - bun.lock + prefix: "bun" + policy: pull + paths: + - .bun-cache/ + before_script: + - echo "@ldc-web:registry=https://${CI_SERVER_HOST}/api/v4/packages/npm/" >> .npmrc + - echo "//${CI_SERVER_HOST}/api/v4/packages/npm/:_authToken=${CI_DEPLOY_PASSWORD}" >> .npmrc + - echo "@uwil:registry=https://lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/" >> .npmrc + - echo "//lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/:_authToken=${CI_DEPLOY_PASSWORD}" >> .npmrc + - bun install --no-save + script: + - bun run eslint-ci --quiet --output-file=eslint-junit.xml + artifacts: + when: on_failure + expose_as: 'eslint' + paths: + - eslint-junit.xml + reports: + junit: eslint-junit.xml + allow_failure: false + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH == "develop" + +stylelint: + stage: lint + image: oven/bun:1 + variables: + BUN_INSTALL_CACHE_DIR: ".bun-cache" + cache: + key: + files: + - bun.lock + prefix: "bun" + policy: pull + paths: + - .bun-cache/ + before_script: + - echo "@ldc-web:registry=https://${CI_SERVER_HOST}/api/v4/packages/npm/" >> .npmrc + - echo "//${CI_SERVER_HOST}/api/v4/packages/npm/:_authToken=${CI_DEPLOY_PASSWORD}" >> .npmrc + - echo "@uwil:registry=https://lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/" >> .npmrc + - echo "//lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/:_authToken=${CI_DEPLOY_PASSWORD}" >> .npmrc + - bun install --no-save + script: + - bun run stylelint-ci --quiet --output-file=stylelint-junit.xml + artifacts: + when: on_failure + expose_as: 'stylelint' + paths: + - stylelint-junit.xml + reports: + junit: stylelint-junit.xml + allow_failure: false + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH == "develop" + +# * TESTS ------------------------------------------------------------------- + +bun-build-test: + stage: test + image: oven/bun:1 + variables: + BUN_INSTALL_CACHE_DIR: ".bun-cache" + cache: + key: + files: + - bun.lock + prefix: "bun" + policy: pull + paths: + - .bun-cache/ + before_script: + - echo "@ldc-web:registry=https://${CI_SERVER_HOST}/api/v4/packages/npm/" >> .npmrc + - echo "//${CI_SERVER_HOST}/api/v4/packages/npm/:_authToken=${CI_DEPLOY_PASSWORD}" >> .npmrc + - echo "@uwil:registry=https://lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/" >> .npmrc + - echo "//lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/:_authToken=${CI_DEPLOY_PASSWORD}" >> .npmrc + - bun install --no-save + script: + - timeout 300 bun run prod + artifacts: + expose_as: 'front-build-test' + paths: + - public/build/manifest.json + allow_failure: false + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH == "trunk" || $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "main" + - if: $CI_COMMIT_TAG != null + +tests_front: + stage: test + image: oven/bun:1 + variables: + BUN_INSTALL_CACHE_DIR: ".bun-cache" + cache: + key: + files: + - bun.lock + prefix: "bun" + policy: pull + paths: + - .bun-cache/ + before_script: + - echo "@ldc-web:registry=https://${CI_SERVER_HOST}/api/v4/packages/npm/" >> .npmrc + - echo "//${CI_SERVER_HOST}/api/v4/packages/npm/:_authToken=${CI_DEPLOY_PASSWORD}" >> .npmrc + - echo "@uwil:registry=https://lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/" >> .npmrc + - echo "//lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/:_authToken=${CI_DEPLOY_PASSWORD}" >> .npmrc + - bun install --no-save + script: + - bun run test:unit + artifacts: + when: always + expose_as: 'vitest' + paths: + - coverage/junit-vitest.xml + reports: + junit: coverage/junit-vitest.xml + allow_failure: false + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH == "trunk" || $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "main" + - if: $CI_COMMIT_TAG != null + +tests_laravel: + stage: test + image: $CI_REGISTRY/ldc-web/projets/ldc-web-images-docker/uwil-ci-8.5:latest + allow_failure: false + variables: + COMPOSER_CACHE_DIR: ".composer-cache" + # MYSQL SERVICE VARS + MYSQL_DATABASE: testing_db + MYSQL_ROOT_PASSWORD: password + + # LARAVEL VARS + DB_CONNECTION: mysql + DB_HOST: mysql + DB_PORT: 3306 + DB_DATABASE: testing_db + DB_USERNAME: root + DB_PASSWORD: password + cache: + - key: + files: + - composer.lock + prefix: "composer" + policy: pull + paths: + - .composer-cache/ + - vendor/ + services: + - name: mysql:8.0 + alias: mysql + before_script: + - composer config gitlab-token.lab.s-web.fr $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD + - composer install --no-scripts --no-interaction --no-ansi --no-progress --prefer-dist + script: + - cp .env.example .env + - php artisan key:generate + - php -r "while(true){try{new PDO('mysql:host=mysql;dbname=testing_db','root','password');break;}catch(Exception){sleep(1);}}" + - php artisan config:clear + - php artisan test --coverage --colors=never --log-junit=coverage/junit.xml --coverage-cobertura=coverage/cobertura.xml --coverage-html=coverage/html + after_script: + - if [ "$CI_JOB_STATUS" == "failed" ]; then cat storage/logs/laravel.log; fi + artifacts: + when: always + expose_as: 'coverage' + paths: + - coverage/html/ + reports: + junit: coverage/junit.xml + coverage_report: + coverage_format: cobertura + path: coverage/cobertura.xml + coverage: '/^\s*Total:\s*([\d\.]+)%/' + needs: + - job: bun-build-test + optional: false + artifacts: true + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH == "trunk" || $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "main" + - if: $CI_COMMIT_TAG != null + +# * SECURITY ---------------------------------------------------------------- + +bun-security: + stage: security + image: oven/bun:1 + before_script: + - echo "@ldc-web:registry=https://${CI_SERVER_HOST}/api/v4/packages/npm/" >> .npmrc + - echo "//${CI_SERVER_HOST}/api/v4/packages/npm/:_authToken=${CI_DEPLOY_PASSWORD}" >> .npmrc + - echo "@uwil:registry=https://lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/" >> .npmrc + - echo "//lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/:_authToken=${CI_DEPLOY_PASSWORD}" >> .npmrc + script: + - bun audit --json > bun-security-checker-report.json + artifacts: + when: on_failure + expose_as: 'bun-security-checker' + paths: + - bun-security-checker-report.json + allow_failure: true + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH == "trunk" || $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "main" + - if: $CI_COMMIT_TAG != null + +# * BUILD ------------------------------------------------------------------- + +npm-build: + stage: build + script: + - echo "Frontend is built directly within Docker multi-stage build" + +npm-security: + stage: security + script: + - echo "Npm security would run bun security" + dependencies: + - bun-security + needs: + - job: bun-security + optional: true + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH == "trunk" || $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "main" + - if: $CI_COMMIT_TAG != null diff --git a/.gitlab/issue_templates/bug.md b/.gitlab/issue_templates/bug.md index 242ebe75..95f4d7ee 100644 --- a/.gitlab/issue_templates/bug.md +++ b/.gitlab/issue_templates/bug.md @@ -8,4 +8,4 @@ ## Étapes pour la reproduction du bug -* \ No newline at end of file +* diff --git a/.intellipest/_pest-helper.php b/.intellipest/_pest-helper.php new file mode 100644 index 00000000..b9e6e723 --- /dev/null +++ b/.intellipest/_pest-helper.php @@ -0,0 +1,1058 @@ +|\Pest\PendingCalls\TestCall|mixed + */ + function afterEach(?Closure $closure = null): \Pest\PendingCalls\AfterEachCall {} + + /** + * Runs the given closure before each test in the current file. + * + * @param-closure-this \Tests\TestCase|\PHPUnit\Framework\TestCase $closure + * + * @return \Pest\Support\HigherOrderTapProxy<\Pest\Concerns\Expectable|\Pest\PendingCalls\TestCall|\Tests\TestCase|\PHPUnit\Framework\TestCase|mixed + */ + function beforeEach(?Closure $closure = null): \Pest\PendingCalls\BeforeEachCall {} + + /** + * Adds the given closure as a test. The first argument + * is the test description; the second argument is + * a closure that contains the test expectations. + * + * @param-closure-this \Tests\TestCase|\PHPUnit\Framework\TestCase $closure + * + * @return \Pest\Concerns\Expectable|\Pest\PendingCalls\TestCall|\Tests\TestCase|\PHPUnit\Framework\TestCase|mixed + */ + function test(?string $description = null, ?Closure $closure = null): \Pest\Support\HigherOrderTapProxy|\Pest\PendingCalls\TestCall {} + + /** + * Adds the given closure as a test. The first argument + * is the test description; the second argument is + * a closure that contains the test expectations. + * + * @param-closure-this \Tests\TestCase|\PHPUnit\Framework\TestCase $closure + * + * @return \Pest\Concerns\Expectable|\Pest\PendingCalls\TestCall|\Tests\TestCase|\PHPUnit\Framework\TestCase|mixed + */ + function it(string $description, ?Closure $closure = null): \Pest\PendingCalls\TestCall {} + +} + +namespace Pest { + + class Expectation + { + /** + * Asserts that two variables have the same type and + * value. Used on objects, it asserts that two + * variables reference the same object. + * + * @return self + */ + public function toBe(mixed $expected, string $message = ''): self {} + + /** + * Asserts that the value is empty. + * + * @return self + */ + public function toBeEmpty(string $message = ''): self {} + + /** + * Asserts that the value is true. + * + * @return self + */ + public function toBeTrue(string $message = ''): self {} + + /** + * Asserts that the value is truthy. + * + * @return self + */ + public function toBeTruthy(string $message = ''): self {} + + /** + * Asserts that the value is false. + * + * @return self + */ + public function toBeFalse(string $message = ''): self {} + + /** + * Asserts that the value is falsy. + * + * @return self + */ + public function toBeFalsy(string $message = ''): self {} + + /** + * Asserts that the value is greater than $expected. + * + * @return self + */ + public function toBeGreaterThan(int|float|string|\DateTimeInterface $expected, string $message = ''): self {} + + /** + * Asserts that the value is greater than or equal to $expected. + * + * @return self + */ + public function toBeGreaterThanOrEqual(int|float|string|\DateTimeInterface $expected, string $message = ''): self {} + + /** + * Asserts that the value is less than or equal to $expected. + * + * @return self + */ + public function toBeLessThan(int|float|string|\DateTimeInterface $expected, string $message = ''): self {} + + /** + * Asserts that the value is less than $expected. + * + * @return self + */ + public function toBeLessThanOrEqual(int|float|string|\DateTimeInterface $expected, string $message = ''): self {} + + /** + * Asserts that $needle is an element of the value. + * + * @return self + */ + public function toContain(mixed ...$needles): self {} + + /** + * Asserts that $needle equal an element of the value. + * + * @return self + */ + public function toContainEqual(mixed ...$needles): self {} + + /** + * Asserts that the value starts with $expected. + * + * @param non-empty-string $expected + * @return self + */ + public function toStartWith(string $expected, string $message = ''): self {} + + /** + * Asserts that the value ends with $expected. + * + * @param non-empty-string $expected + * @return self + */ + public function toEndWith(string $expected, string $message = ''): self {} + + /** + * Asserts that $number matches value's Length. + * + * @return self + */ + public function toHaveLength(int $number, string $message = ''): self {} + + /** + * Asserts that $count matches the number of elements of the value. + * + * @return self + */ + public function toHaveCount(int $count, string $message = ''): self {} + + /** + * Asserts that the size of the value and $expected are the same. + * + * @param \Countable|iterable $expected + * @return self + */ + public function toHaveSameSize(\Countable|iterable $expected, string $message = ''): self {} + + /** + * Asserts that the value contains the property $name. + * + * @return self + */ + public function toHaveProperty(string $name, mixed $value = new \Pest\Matchers\Any, string $message = ''): self {} + + /** + * Asserts that the value contains the provided properties $names. + * + * @param iterable|iterable $names + * @return self + */ + public function toHaveProperties(iterable $names, string $message = ''): self {} + + /** + * Asserts that two variables have the same value. + * + * @return self + */ + public function toEqual(mixed $expected, string $message = ''): self {} + + /** + * Asserts that two variables have the same value. + * The contents of $expected and the $this->value are + * canonicalized before they are compared. For instance, when the two + * variables $expected and $this->value are arrays, then these arrays + * are sorted before they are compared. When $expected and $this->value + * are objects, each object is converted to an array containing all + * private, protected and public attributes. + * + * @return self + */ + public function toEqualCanonicalizing(mixed $expected, string $message = ''): self {} + + /** + * Asserts that the absolute difference between the value and $expected + * is lower than $delta. + * + * @return self + */ + public function toEqualWithDelta(mixed $expected, float $delta, string $message = ''): self {} + + /** + * Asserts that the value is one of the given values. + * + * @param iterable $values + * @return self + */ + public function toBeIn(iterable $values, string $message = ''): self {} + + /** + * Asserts that the value is infinite. + * + * @return self + */ + public function toBeInfinite(string $message = ''): self {} + + /** + * Asserts that the value is an instance of $class. + * + * @param class-string $class + * @return self + */ + public function toBeInstanceOf(string $class, string $message = ''): self {} + + /** + * Asserts that the value is an array. + * + * @return self + */ + public function toBeArray(string $message = ''): self {} + + /** + * Asserts that the value is a list. + * + * @return self + */ + public function toBeList(string $message = ''): self {} + + /** + * Asserts that the value is of type bool. + * + * @return self + */ + public function toBeBool(string $message = ''): self {} + + /** + * Asserts that the value is of type callable. + * + * @return self + */ + public function toBeCallable(string $message = ''): self {} + + /** + * Asserts that the value is of type float. + * + * @return self + */ + public function toBeFloat(string $message = ''): self {} + + /** + * Asserts that the value is of type int. + * + * @return self + */ + public function toBeInt(string $message = ''): self {} + + /** + * Asserts that the value is of type iterable. + * + * @return self + */ + public function toBeIterable(string $message = ''): self {} + + /** + * Asserts that the value is of type numeric. + * + * @return self + */ + public function toBeNumeric(string $message = ''): self {} + + /** + * Asserts that the value contains only digits. + * + * @return self + */ + public function toBeDigits(string $message = ''): self {} + + /** + * Asserts that the value is of type object. + * + * @return self + */ + public function toBeObject(string $message = ''): self {} + + /** + * Asserts that the value is of type resource. + * + * @return self + */ + public function toBeResource(string $message = ''): self {} + + /** + * Asserts that the value is of type scalar. + * + * @return self + */ + public function toBeScalar(string $message = ''): self {} + + /** + * Asserts that the value is of type string. + * + * @return self + */ + public function toBeString(string $message = ''): self {} + + /** + * Asserts that the value is a JSON string. + * + * @return self + */ + public function toBeJson(string $message = ''): self {} + + /** + * Asserts that the value is NAN. + * + * @return self + */ + public function toBeNan(string $message = ''): self {} + + /** + * Asserts that the value is null. + * + * @return self + */ + public function toBeNull(string $message = ''): self {} + + /** + * Asserts that the value array has the provided $key. + * + * @return self + */ + public function toHaveKey(string|int $key, mixed $value = new \Pest\Matchers\Any, string $message = ''): self {} + + /** + * Asserts that the value array has the provided $keys. + * + * @param array> $keys + * @return self + */ + public function toHaveKeys(array $keys, string $message = ''): self {} + + /** + * Asserts that the value is a directory. + * + * @return self + */ + public function toBeDirectory(string $message = ''): self {} + + /** + * Asserts that the value is a directory and is readable. + * + * @return self + */ + public function toBeReadableDirectory(string $message = ''): self {} + + /** + * Asserts that the value is a directory and is writable. + * + * @return self + */ + public function toBeWritableDirectory(string $message = ''): self {} + + /** + * Asserts that the value is a file. + * + * @return self + */ + public function toBeFile(string $message = ''): self {} + + /** + * Asserts that the value is a file and is readable. + * + * @return self + */ + public function toBeReadableFile(string $message = ''): self {} + + /** + * Asserts that the value is a file and is writable. + * + * @return self + */ + public function toBeWritableFile(string $message = ''): self {} + + /** + * Asserts that the value array matches the given array subset. + * + * @param iterable $array + * @return self + */ + public function toMatchArray(iterable $array, string $message = ''): self {} + + /** + * Asserts that the value object matches a subset + * of the properties of an given object. + * + * @param iterable $object + * @return self + */ + public function toMatchObject(object|iterable $object, string $message = ''): self {} + + /** + * Asserts that the value "stringable" matches the given snapshot.. + * + * @return self + */ + public function toMatchSnapshot(string $message = ''): self {} + + /** + * Asserts that the value matches a regular expression. + * + * @return self + */ + public function toMatch(string $expression, string $message = ''): self {} + + /** + * Asserts that the value matches a constraint. + * + * @return self + */ + public function toMatchConstraint(\PHPUnit\Framework\Constraint\Constraint $constraint, string $message = ''): self {} + + /** + * @param class-string $class + * @return self + */ + public function toContainOnlyInstancesOf(string $class, string $message = ''): self {} + + /** + * Asserts that executing value throws an exception. + * + * @param (\Closure(\Throwable): mixed)|string $exception + * @return self + */ + public function toThrow(callable|string|\Throwable $exception, ?string $exceptionMessage = null, string $message = ''): self {} + + /** + * Asserts that the value is uppercase. + * + * @return self + */ + public function toBeUppercase(string $message = ''): self {} + + /** + * Asserts that the value is lowercase. + * + * @return self + */ + public function toBeLowercase(string $message = ''): self {} + + /** + * Asserts that the value is alphanumeric. + * + * @return self + */ + public function toBeAlphaNumeric(string $message = ''): self {} + + /** + * Asserts that the value is alpha. + * + * @return self + */ + public function toBeAlpha(string $message = ''): self {} + + /** + * Asserts that the value is snake_case. + * + * @return self + */ + public function toBeSnakeCase(string $message = ''): self {} + + /** + * Asserts that the value is kebab-case. + * + * @return self + */ + public function toBeKebabCase(string $message = ''): self {} + + /** + * Asserts that the value is camelCase. + * + * @return self + */ + public function toBeCamelCase(string $message = ''): self {} + + /** + * Asserts that the value is StudlyCase. + * + * @return self + */ + public function toBeStudlyCase(string $message = ''): self {} + + /** + * Asserts that the value is UUID. + * + * @return self + */ + public function toBeUuid(string $message = ''): self {} + + /** + * Asserts that the value is between 2 specified values + * + * @return self + */ + public function toBeBetween(int|float|\DateTimeInterface $lowestValue, int|float|\DateTimeInterface $highestValue, string $message = ''): self {} + + /** + * Asserts that the value is a url + * + * @return self + */ + public function toBeUrl(string $message = ''): self {} + + /** + * Asserts that the value can be converted to a slug + * + * @return self + */ + public function toBeSlug(string $message = ''): self {} + } + +} + +namespace Pest\Expectations { + + class OppositeExpectation + { + /** + * Asserts that two variables have the same type and + * value. Used on objects, it asserts that two + * variables reference the same object. + * + * @return self + */ + public function toBe(mixed $expected, string $message = ''): self {} + + /** + * Asserts that the value is empty. + * + * @return self + */ + public function toBeEmpty(string $message = ''): self {} + + /** + * Asserts that the value is true. + * + * @return self + */ + public function toBeTrue(string $message = ''): self {} + + /** + * Asserts that the value is truthy. + * + * @return self + */ + public function toBeTruthy(string $message = ''): self {} + + /** + * Asserts that the value is false. + * + * @return self + */ + public function toBeFalse(string $message = ''): self {} + + /** + * Asserts that the value is falsy. + * + * @return self + */ + public function toBeFalsy(string $message = ''): self {} + + /** + * Asserts that the value is greater than $expected. + * + * @return self + */ + public function toBeGreaterThan(int|float|string|\DateTimeInterface $expected, string $message = ''): self {} + + /** + * Asserts that the value is greater than or equal to $expected. + * + * @return self + */ + public function toBeGreaterThanOrEqual(int|float|string|\DateTimeInterface $expected, string $message = ''): self {} + + /** + * Asserts that the value is less than or equal to $expected. + * + * @return self + */ + public function toBeLessThan(int|float|string|\DateTimeInterface $expected, string $message = ''): self {} + + /** + * Asserts that the value is less than $expected. + * + * @return self + */ + public function toBeLessThanOrEqual(int|float|string|\DateTimeInterface $expected, string $message = ''): self {} + + /** + * Asserts that $needle is an element of the value. + * + * @return self + */ + public function toContain(mixed ...$needles): self {} + + /** + * Asserts that $needle equal an element of the value. + * + * @return self + */ + public function toContainEqual(mixed ...$needles): self {} + + /** + * Asserts that the value starts with $expected. + * + * @param non-empty-string $expected + * @return self + */ + public function toStartWith(string $expected, string $message = ''): self {} + + /** + * Asserts that the value ends with $expected. + * + * @param non-empty-string $expected + * @return self + */ + public function toEndWith(string $expected, string $message = ''): self {} + + /** + * Asserts that $number matches value's Length. + * + * @return self + */ + public function toHaveLength(int $number, string $message = ''): self {} + + /** + * Asserts that $count matches the number of elements of the value. + * + * @return self + */ + public function toHaveCount(int $count, string $message = ''): self {} + + /** + * Asserts that the size of the value and $expected are the same. + * + * @param \Countable|iterable $expected + * @return self + */ + public function toHaveSameSize(\Countable|iterable $expected, string $message = ''): self {} + + /** + * Asserts that the value contains the property $name. + * + * @return self + */ + public function toHaveProperty(string $name, mixed $value = new \Pest\Matchers\Any, string $message = ''): self {} + + /** + * Asserts that the value contains the provided properties $names. + * + * @param iterable|iterable $names + * @return self + */ + public function toHaveProperties(iterable $names, string $message = ''): self {} + + /** + * Asserts that two variables have the same value. + * + * @return self + */ + public function toEqual(mixed $expected, string $message = ''): self {} + + /** + * Asserts that two variables have the same value. + * The contents of $expected and the $this->value are + * canonicalized before they are compared. For instance, when the two + * variables $expected and $this->value are arrays, then these arrays + * are sorted before they are compared. When $expected and $this->value + * are objects, each object is converted to an array containing all + * private, protected and public attributes. + * + * @return self + */ + public function toEqualCanonicalizing(mixed $expected, string $message = ''): self {} + + /** + * Asserts that the absolute difference between the value and $expected + * is lower than $delta. + * + * @return self + */ + public function toEqualWithDelta(mixed $expected, float $delta, string $message = ''): self {} + + /** + * Asserts that the value is one of the given values. + * + * @param iterable $values + * @return self + */ + public function toBeIn(iterable $values, string $message = ''): self {} + + /** + * Asserts that the value is infinite. + * + * @return self + */ + public function toBeInfinite(string $message = ''): self {} + + /** + * Asserts that the value is an instance of $class. + * + * @param class-string $class + * @return self + */ + public function toBeInstanceOf(string $class, string $message = ''): self {} + + /** + * Asserts that the value is an array. + * + * @return self + */ + public function toBeArray(string $message = ''): self {} + + /** + * Asserts that the value is a list. + * + * @return self + */ + public function toBeList(string $message = ''): self {} + + /** + * Asserts that the value is of type bool. + * + * @return self + */ + public function toBeBool(string $message = ''): self {} + + /** + * Asserts that the value is of type callable. + * + * @return self + */ + public function toBeCallable(string $message = ''): self {} + + /** + * Asserts that the value is of type float. + * + * @return self + */ + public function toBeFloat(string $message = ''): self {} + + /** + * Asserts that the value is of type int. + * + * @return self + */ + public function toBeInt(string $message = ''): self {} + + /** + * Asserts that the value is of type iterable. + * + * @return self + */ + public function toBeIterable(string $message = ''): self {} + + /** + * Asserts that the value is of type numeric. + * + * @return self + */ + public function toBeNumeric(string $message = ''): self {} + + /** + * Asserts that the value contains only digits. + * + * @return self + */ + public function toBeDigits(string $message = ''): self {} + + /** + * Asserts that the value is of type object. + * + * @return self + */ + public function toBeObject(string $message = ''): self {} + + /** + * Asserts that the value is of type resource. + * + * @return self + */ + public function toBeResource(string $message = ''): self {} + + /** + * Asserts that the value is of type scalar. + * + * @return self + */ + public function toBeScalar(string $message = ''): self {} + + /** + * Asserts that the value is of type string. + * + * @return self + */ + public function toBeString(string $message = ''): self {} + + /** + * Asserts that the value is a JSON string. + * + * @return self + */ + public function toBeJson(string $message = ''): self {} + + /** + * Asserts that the value is NAN. + * + * @return self + */ + public function toBeNan(string $message = ''): self {} + + /** + * Asserts that the value is null. + * + * @return self + */ + public function toBeNull(string $message = ''): self {} + + /** + * Asserts that the value array has the provided $key. + * + * @return self + */ + public function toHaveKey(string|int $key, mixed $value = new \Pest\Matchers\Any, string $message = ''): self {} + + /** + * Asserts that the value array has the provided $keys. + * + * @param array> $keys + * @return self + */ + public function toHaveKeys(array $keys, string $message = ''): self {} + + /** + * Asserts that the value is a directory. + * + * @return self + */ + public function toBeDirectory(string $message = ''): self {} + + /** + * Asserts that the value is a directory and is readable. + * + * @return self + */ + public function toBeReadableDirectory(string $message = ''): self {} + + /** + * Asserts that the value is a directory and is writable. + * + * @return self + */ + public function toBeWritableDirectory(string $message = ''): self {} + + /** + * Asserts that the value is a file. + * + * @return self + */ + public function toBeFile(string $message = ''): self {} + + /** + * Asserts that the value is a file and is readable. + * + * @return self + */ + public function toBeReadableFile(string $message = ''): self {} + + /** + * Asserts that the value is a file and is writable. + * + * @return self + */ + public function toBeWritableFile(string $message = ''): self {} + + /** + * Asserts that the value array matches the given array subset. + * + * @param iterable $array + * @return self + */ + public function toMatchArray(iterable $array, string $message = ''): self {} + + /** + * Asserts that the value object matches a subset + * of the properties of an given object. + * + * @param iterable $object + * @return self + */ + public function toMatchObject(object|iterable $object, string $message = ''): self {} + + /** + * Asserts that the value "stringable" matches the given snapshot.. + * + * @return self + */ + public function toMatchSnapshot(string $message = ''): self {} + + /** + * Asserts that the value matches a regular expression. + * + * @return self + */ + public function toMatch(string $expression, string $message = ''): self {} + + /** + * Asserts that the value matches a constraint. + * + * @return self + */ + public function toMatchConstraint(\PHPUnit\Framework\Constraint\Constraint $constraint, string $message = ''): self {} + + /** + * @param class-string $class + * @return self + */ + public function toContainOnlyInstancesOf(string $class, string $message = ''): self {} + + /** + * Asserts that executing value throws an exception. + * + * @param (\Closure(\Throwable): mixed)|string $exception + * @return self + */ + public function toThrow(callable|string|\Throwable $exception, ?string $exceptionMessage = null, string $message = ''): self {} + + /** + * Asserts that the value is uppercase. + * + * @return self + */ + public function toBeUppercase(string $message = ''): self {} + + /** + * Asserts that the value is lowercase. + * + * @return self + */ + public function toBeLowercase(string $message = ''): self {} + + /** + * Asserts that the value is alphanumeric. + * + * @return self + */ + public function toBeAlphaNumeric(string $message = ''): self {} + + /** + * Asserts that the value is alpha. + * + * @return self + */ + public function toBeAlpha(string $message = ''): self {} + + /** + * Asserts that the value is snake_case. + * + * @return self + */ + public function toBeSnakeCase(string $message = ''): self {} + + /** + * Asserts that the value is kebab-case. + * + * @return self + */ + public function toBeKebabCase(string $message = ''): self {} + + /** + * Asserts that the value is camelCase. + * + * @return self + */ + public function toBeCamelCase(string $message = ''): self {} + + /** + * Asserts that the value is StudlyCase. + * + * @return self + */ + public function toBeStudlyCase(string $message = ''): self {} + + /** + * Asserts that the value is UUID. + * + * @return self + */ + public function toBeUuid(string $message = ''): self {} + + /** + * Asserts that the value is between 2 specified values + * + * @return self + */ + public function toBeBetween(int|float|\DateTimeInterface $lowestValue, int|float|\DateTimeInterface $highestValue, string $message = ''): self {} + + /** + * Asserts that the value is a url + * + * @return self + */ + public function toBeUrl(string $message = ''): self {} + + /** + * Asserts that the value can be converted to a slug + * + * @return self + */ + public function toBeSlug(string $message = ''): self {} + } + +} + +namespace Tests { + + class TestCase + { + use \Illuminate\Foundation\Testing\RefreshDatabase; + } + +} diff --git a/.styleci.yml b/.styleci.yml index 9231873a..9daadf16 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -5,9 +5,5 @@ php: finder: not-name: - index.php - - server.php -js: - finder: - not-name: - - webpack.mix.js +js: true css: true diff --git a/.stylelintrc.json b/.stylelintrc.json new file mode 100644 index 00000000..dbbca79d --- /dev/null +++ b/.stylelintrc.json @@ -0,0 +1,43 @@ +{ + "extends": [ + "stylelint-config-standard-scss", + "stylelint-config-sass-guidelines", + "stylelint-config-idiomatic-order" + ], + "plugins": [ + "stylelint-scss" + ], + "files": [ + "**/*.css", + "**/*.scss" + ], + "ignoreFiles": [ + "**/vendor/*.css", + "**/vendor/**/*.css", + "**/vendor/*.scss", + "**/vendor/**/*.scss", + "**/vendor/*.sass", + "**/vendor/**/*.sass", + "**/vendor/*.less", + "**/vendor/**/*.less" + ], + "customSyntax": "postcss-scss", + "rules": { + "declaration-property-value-no-unknown": true, + "selector-max-id": null, + "color-no-invalid-hex": true, + "order/properties-alphabetical-order": null, + "max-nesting-depth": 5, + "selector-max-compound-selectors": 5, + "scss/double-slash-comment-empty-line-before": [ + "always", + { + "ignore": [ + "between-comments", + "stylelint-commands", + "inside-block" + ] + } + ] + } +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 093b7af3..c53f3baf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "workbench.colorCustomizations": { "activityBar.activeBackground": "#920c7f", - "activityBar.activeBorder": "#1a1d02", + "activityBar.activeBorder": "#e7e7e7", "activityBar.background": "#920c7f", "activityBar.foreground": "#e7e7e7", "activityBar.inactiveForeground": "#e7e7e799", @@ -11,13 +11,100 @@ "statusBar.background": "#630856", "statusBar.foreground": "#e7e7e7", "statusBarItem.hoverBackground": "#920c7f", - "statusBarItem.remoteBackground": "#630856", + "statusBarItem.remoteBackground": "#66760a", "statusBarItem.remoteForeground": "#e7e7e7", "titleBar.activeBackground": "#630856", "titleBar.activeForeground": "#e7e7e7", "titleBar.inactiveBackground": "#63085699", "titleBar.inactiveForeground": "#e7e7e799", - "commandCenter.border": "#e7e7e799" + "commandCenter.border": "#e7e7e799", + "activityBarTop.activeBackground": "#920c7f", + "activityBarTop.activeBorder": "#e7e7e7", + "activityBarTop.background": "#920c7f", + "activityBarTop.foreground": "#e7e7e7", + "activityBarTop.inactiveForeground": "#e7e7e799", + "commandCenter.foreground": "#e7e7e7", + "statusBar.debuggingBackground": "#630856", + "statusBar.debuggingForeground": "#e7e7e7", + "statusBar.inactiveBackground": "#630856" }, - "peacock.remoteColor": "#630856" + "peacock.color": "#630856", + "peacock.remoteColor": "#630856", + // "php.validate.executablePath": "/usr/local/bin/php85", + // "php.executablePath": "/usr/local/bin/php85", + "intelephense.environment.phpVersion": "8.5.0", + "intelephense.environment.includePaths": [ + "./.intellipest", + "./vendor/pestphp", + "./vendor/phpunit/phpunit", + "./vendor/laravel" + ], + "phpstan.binCommand": [ + "${workspaceFolder}/vendor/bin/phpstan" + ], + "laravel-pint.enable": true, + "editor.formatOnSave": true, + "eslint.validate": ["javascript", "typescript", "html", "vue"], + "[html]": { + "editor.formatOnSave": true, + "editor.formatOnPaste": true, + "editor.defaultFormatter": "rvest.vs-code-prettier-eslint", + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "always" + } + }, + "[blade]": { + "editor.formatOnSave": true, + "editor.formatOnType": false + }, + "[javascript]": { + "editor.autoIndent": "full", + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "always" + }, + "editor.defaultFormatter": "dbaeumer.vscode-eslint", + "editor.detectIndentation": false, + "editor.formatOnSave": true + }, + "[scss]": { + "editor.defaultFormatter": "stylelint.vscode-stylelint", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll.stylelint": "always" + } + }, + "[typescript]": { + "editor.autoIndent": "full", + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "always" + }, + "editor.defaultFormatter": "dbaeumer.vscode-eslint", + "editor.detectIndentation": false, + "editor.formatOnSave": true, + "editor.formatOnSaveMode": "file" + }, + "[php]": { + "editor.formatOnSave": true, + "editor.formatOnSaveMode": "file" + }, + "[vue]": { + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "always" + } + }, + "conventionalCommits.scopes": [ + "migration" + ], + "emeraldwalk.runonsave": { + "autoClearConsole": false, + "commands": [ + { + "match": "\\.php$", + "isAsync": true, + "cmd": "${workspaceFolder}/vendor/bin/pint ${file}" + } + ] + }, +// "LaravelExtraIntellisense.phpCommand": "docker exec -w /app/srcs -t boutique-cnc-sable-$(whoami)-apache-php-1 php -r \"{code}\"", +// "LaravelExtraIntellisense.basePathForCode": "/app/srcs" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bb73a53..af8f5038 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,71 @@ +# (2026-04-23) + + +### Bug Fixes + +* :bug: delete ldcweb:statuschecker from the kernel 898104d +* :bug: error on removeFromCart dc8fa4d +* :bug: hide brands for unpublished products a5dbb9e +* :bug: set blade directives function in public #88 e7db2d4, closes #88 +* :bug: update promotion filtering system 0692ec7 +* :bug: use blade directives helper to prevent blade files from being cached #76 #77 ae54ee5, closes #76 #77 +* :bug: user->id null on SalarieExportJob + add public holiday with cron + condition on public holiday's calendar 79d9061 +* :chart_with_upwards_trend: update dashboard statistics #52 f454d35, closes #52 +* addToCart policy was broken in product #86 + homepage #85 7150dc1, closes #86 #85 +* Clean and fix cookie notice implementation 683e7fd +* Display the correct count of employee in the dashboard c07ff0d +* feedback on user basket a3b4a4b +* Fix check on salarie and customer relation 0366644 +* fixed variable name for previous commit - #96 f91a7d0, closes #96 +* hide prices in products.index > .npmrc && \ + echo "//lab.s-web.fr/api/v4/packages/npm/:_authToken=${GITLAB_PASSWORD}" >> .npmrc && \ + echo "@uwil:registry=https://lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/" >> .npmrc && \ + echo "//lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/:_authToken=${GITLAB_PASSWORD}" >> .npmrc + +RUN bun install --frozen-lockfile && bun run prod + +ARG PHP_8_5_TAG +FROM registry.s-web.fr/ldc-web/projets/ldc-web-images-docker/uwil-production-8.5:${PHP_8_5_TAG} + +ARG USER=www-data + +COPY --chown=${USER}:${USER} . /app/srcs +COPY --chown=${USER}:${USER} ./resources/favicon/ /app/srcs/public/ +COPY --from=vendor --chown=${USER}:${USER} /app/vendor/ /app/srcs/vendor/ +COPY --from=frontend --chown=${USER}:${USER} /app/public/build/ /app/srcs/public/build/ + USER root RUN chmod -R 755 /app/srcs/storage -USER www-data +USER ${USER} diff --git a/README.md b/README.md index 2b293dba..b4e082d6 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,80 @@ -## Boutique Click N Collect Sablé +# Boutique Click N Collect Sablé +## Table of contents + +- [Boutique Click N Collect Sablé](#boutique-click-n-collect-sablé) + - [Table of contents](#table-of-contents) + - [Frameworks, Platforms and Libraries](#frameworks-platforms-and-libraries) + - [Installation](#installation) + - [Tests](#tests) + - [Deployment](#deployment) + - [Available Commands](#available-commands) + - [Changelog](#changelog) + - [Architecture](#architecture) + - [Règles d'Or (Verrouillées par les tests)](#règles-dor-verrouillées-par-les-tests) + +## Frameworks, Platforms and Libraries + +[![SASS](https://img.shields.io/badge/SASS-hotpink.svg?style=for-the-badge&logo=SASS&logoColor=white)](https://sass-lang.com/) +[![TypeScript](https://img.shields.io/badge/TS-blue.svg?style=for-the-badge&logo=TYPESCRIPT&logoColor=white)](https://www.typescriptlang.org/) +[![Vite](https://img.shields.io/badge/vite-%23646CFF.svg?style=for-the-badge&logo=vite&logoColor=white)](https://vite.dev/) +[![PHP](https://img.shields.io/badge/php-%23777BB4.svg?style=for-the-badge&logo=php&logoColor=white)](https://www.php.net/) +[![Laravel](https://img.shields.io/badge/laravel-%23FF2D20.svg?style=for-the-badge&logo=laravel&logoColor=white)](https://laravel.com/docs/master) +[![Vue.js](https://img.shields.io/badge/vuejs-%234FC08D.svg?style=for-the-badge&logo=vue.js&logoColor=white)](https://vuejs.org/) ## Installation -``` +```bash +cp .env.example .env +vi .env composer install php artisan storage:link -cd ./ressources/views/front/ -mkdir -cd -git clone . -cd ./../../../../ -npm install && npm run prod - +npm i +npm run prod ``` -## Production -Put every min in PROD : -```php +## Tests + +```bash +cp .env.example .env.testing +vi .env.testing +composer install +php artisan storage:link +composer run test +``` + +## Deployment + +```bash php artisan schedule:run ``` ## Available Commands -``` -ldcweb:admin-secure-sync + +```bash +php artisan ldcweb:admin-secure-sync ``` -## Back-Office +**Créer un utilisateur :** -Création de compte - -``` +```bash php artisan create:admin ``` -URL : /bo +## Changelog + +See the [CHANGELOG.md](CHANGELOG.md) file for details. + +## Architecture + +Ce projet suit les principes de **l'Architecture Hexagonale (Ports et Adapteurs)** et du **Domain-Driven Design (DDD)**. +L'objectif est d'isoler au maximum la logique métier de l'infrastructure (framework Laravel, base de données, requêtes réseau) pour avoir un code robuste, pérenne et facile à tester. + +### Règles d'Or (Verrouillées par les tests) + +Afin de faciliter l'onboarding et d'assurer que l'architecture ne dérive pas, **Pest Arch** et **PHPStan (Level 9)** garantissent les principes suivants à chaque commit : + +1. **Isolation totale du Domaine (Le Cœur)** : Le code dans `domain/` ne doit **jamais** dépendre du Framework (`Illuminate\`), de `App\`, ou de `Infrastructure\`. Il ne dépend que de PHP natif. +2. **Inversion des Dépendances** : L'Application et l'Infrastructure dépendent du Domaine, et jamais l'inverse. Le domaine expose des `Ports` (Interfaces) que l'infrastructure implémente via ses `Adapters`. +3. **Entités et Objets-Valeurs Purs** : Le domaine manipule ses propres Entités et `ValueObjects` validés et typés fortement. L'utilisation directe des modèles Eloquent est strictement interdite dans le domaine. +4. **Conventions de Nommage** : Chaque composant a une place et un suffixe stricts : `*Service`, `*Repository`, `*Exception`, `*Dto`. Les tests échoueront si la convention n'est pas respectée. diff --git a/REGLES METIERS.md b/REGLES METIERS.md new file mode 100644 index 00000000..2fed1147 --- /dev/null +++ b/REGLES METIERS.md @@ -0,0 +1,33 @@ +# Règles Métiers du projet + +Les règles reposent sur le code de la partie **Domaine**. + +## 1. Planification des Retraits + +La sélection du retrait se fait désormais sur une journée complète et non plus par tranches horaires via `PickupSchedulingService`. + +- **Jour de retrait standard** : Uniquement le **Vendredi** (`PICKUP_DAY = WeekDay::Friday`). +- **Heure de clôture (Cutoff)** : **Lundi à 14h00** de la même semaine (`CUTOFF_DAY = Monday`, `CUTOFF_HOUR = 14`). + - *Comportement* : Une commande validée avant Lundi 14h00 est préparée pour le vendredi en cours. Passé ce délai, le premier jour disponible bascule automatiquement sur le vendredi de la semaine suivante. +- **Gestion des Exceptions** : + - Les fermetures et jours fériés sont gérés via des `ShopPickupException`. + - Une exception peut **fermer le retrait**, ou proposer un **jour de remplacement**. Ce jour de remplacement peut posséder sa propre limite de validation (`orderDeadlineAt`). + - Une tâche planifiée `UpsertShopsPickupExceptionsUsingApiForYear` est lancée pour provisionner les jours fériés de l'année pour toutes les boutiques + +## 2. Limites de Montants + +Les montants pouvant être commandés sont gérés par un service dédié `CustomerOrderLimitPolicy` + +- **Plafond par commande** : **200€ max** (`maxOrderAmountCents = 20000`). Lève une `OrderLimitExceededException`. +- **Plafond hebdomadaire** : **200€ max par client** sur l'ensemble de la semaine (`maxWeeklyAmountCents = 20000`). Lève une `WeeklyLimitExceededException`. + +## 3. Disponibilité des Produits + +Elle est géré par le service `ProductAvailabilityService`. + +- **Conditions d'ajout au panier** : + + - Le produit est actif (`status = true`). + - Il est éligible INCO (`hasInco = true`). + - La date actuelle est supérieure ou égale à `orderable_start` (si défini). + - La date actuelle est inférieure à `orderable_end` (si défini). diff --git a/RGPD.md b/RGPD.md new file mode 100644 index 00000000..19eeec71 --- /dev/null +++ b/RGPD.md @@ -0,0 +1,61 @@ +# RGPD + +## Site + + +### En base de données + +| Table | Colonne | Contenu | Utilisation | +| ----------- | -------------------------- | ----------------------------------------------- | -------------------------------------------------------- | +| customers | email | Adresse email | Identifiant du client | +| customers | hashcode | Code unique de l'utilisateur en CRM | Identifiant du client en CRM | +| customers | created_at | Date | Suivi d'activité | +| customers | updated_at | Date | Suivi d'activité | +| customers | last_login_at | Date | Suivi de la dernière connexion au compte client | +| --- | --- | --- | --- | +| orders | employee.matricule | Matricule de l'employé | Identifiant unique de l'employé lié à la commande | +| orders | employee.firstname | Prénom de l'employé | Affichage et personnalisation de la commande | +| orders | employee.lastname | Nom de l'employé | Affichage et personnalisation de la commande | +| orders | employee.facility | Établissement de l'employé | Localisation de l'employé pour la gestion de la commande | +| orders | employee.site | Site de l'employé | Localisation du site de l'employé | +| orders | employee.service | Service de l'employé | Service d'appartenance de l'employé | +| orders | delivery_address.name | Nom du lieu de livraison | Identification du contact ou lieu de livraison | +| orders | delivery_address.address | Adresse de livraison | Expédition et livraison de la commande | +| orders | delivery_address.postcode | Code postal de livraison | Routage de la livraison | +| orders | delivery_address.city | Ville de livraison | Routage de la livraison | +| orders | delivery_address.phone | Téléphone de contact pour la livraison | Contact en cas de problème de livraison | +| orders | delivery_address.latitude | Latitude de l'adresse de livraison | Géolocalisation pour optimiser la livraison | +| orders | delivery_address.longitude | Longitude de l'adresse de livraison | Géolocalisation pour optimiser la livraison | +| orders | employee_matricule | Matricule de l'employé (colonne virtuelle) | Indexation et recherche rapide des commandes par employé | +| --- | --- | --- | --- | +| order_lines | product_id | Identifiant du produit présent dans la commande | Détail de la commande | +| order_lines | quantité | Quantité du produit présent dans la commande | Détail de la commande | +| --- | --- | --- | --- | +| employees | customer_id | Identifiant client | Permet de relier un salarié à un compte client du site | +| employees | matricule | Matricule | Matricule du salarié | +| employees | nom | Nom | Nom du salarié | +| employees | prenom | Prénom | Prénom du salarié | +| employees | start_date | Date de début du contrat | Activation du compte | +| employees | end_date | Date de fin du contrat | Désactivation du compte | +| employees | etablissement | Identifiant établissement | Localiser l'employé pour le dépôt de la commande | +| employees | site | Identifiant site | Localiser l'employé pour le dépôt de la commande | +| employees | service | Identifiant service | Localiser l'employé pour le dépôt de la commande | +| --- | --- | --- | --- | +| users | first_name | Prénom | Affichage à différents endroits du BO | +| users | last_name | Nom | Affichage à différents endroits du BO | +| users | email | Adresse mail | Identifiant, sert à la connexion au BO | + +### Formulaire de contact (marketing) + +| Donnée | Contenu | +| -------------- | -------------------------------- | +| Nom | Nom de la personne | +| Prénom | Prénom de la personne | +| Adresse E-mail | Adresse email de la personne | +| Pièce jointe | Photo renseignée par la personne | + +## Cookies + +| Service | Utilité | +| ------- | ----------------- | +| Matomo | Mesure d'audience | diff --git a/app/Actions/Basket/AddToBasket.php b/app/Actions/Basket/AddToBasket.php new file mode 100644 index 00000000..8d4cfa67 --- /dev/null +++ b/app/Actions/Basket/AddToBasket.php @@ -0,0 +1,32 @@ + + */ +final class AddToBasket implements Action +{ + public function __construct( + private readonly BasketService $basketService, + ) { + } + + #[\Override] + public function __invoke(ActionInput $input): void + { + Assert::isInstanceOf($input, AddToBasketInput::class); + + $this->basketService->add( + $input->productId, + $input->qty + ); + } +} diff --git a/app/Actions/Basket/AddToBasketInput.php b/app/Actions/Basket/AddToBasketInput.php new file mode 100644 index 00000000..407dccc2 --- /dev/null +++ b/app/Actions/Basket/AddToBasketInput.php @@ -0,0 +1,19 @@ + + */ +final class EmptyBasket implements Action +{ + public function __construct( + private readonly BasketService $basketService, + ) { + } + + #[\Override] + public function __invoke(ActionInput $input): void + { + Assert::isInstanceOf( + $input, + ActionInputEmpty::class + ); + + $this->basketService->empty(); + } +} diff --git a/app/Actions/Basket/RemoveFromBasket.php b/app/Actions/Basket/RemoveFromBasket.php new file mode 100644 index 00000000..a612173e --- /dev/null +++ b/app/Actions/Basket/RemoveFromBasket.php @@ -0,0 +1,44 @@ + + */ +final class RemoveFromBasket implements Action +{ + public function __construct( + private readonly BasketService $basketService, + ) { + } + + #[\Override] + public function __invoke(ActionInput $input): void + { + Assert::isInstanceOfAny( + $input, + [ + RemoveQuantityFromBasketInput::class, + RemoveProductFromBasketInput::class, + ] + ); + + if ($input instanceof RemoveQuantityFromBasketInput) { + $this->basketService->remove( + $input->productId, + $input->qty + ); + } elseif ($input instanceof RemoveProductFromBasketInput) { + $this->basketService->removeLine( + $input->productId + ); + } + } +} diff --git a/app/Actions/Basket/RemoveProductFromBasketInput.php b/app/Actions/Basket/RemoveProductFromBasketInput.php new file mode 100644 index 00000000..79b35ba8 --- /dev/null +++ b/app/Actions/Basket/RemoveProductFromBasketInput.php @@ -0,0 +1,16 @@ + + */ +final class ChangeModelOrder implements Action +{ + private const int MAX_ORDER_VALUE = 4294967295; + + /** + * @param \App\Actions\Common\ChangeModelOrderInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): bool + { + Assert::isInstanceOf($input, ChangeModelOrderInput::class); + + $model = $input->model; + $goUp = $input->direction === SortDirection::Ascending; + $currentOrder = $model->getOrder(); + + $usesSoftDeletes = in_array(SoftDeletes::class, class_uses_recursive($model), true) + || method_exists($model, 'trashed'); + + /** @var Builder $baseQuery */ + $baseQuery = $usesSoftDeletes + // @phpstan-ignore method.notFound (withTrashed) + ? $model::query()->withTrashed() + : $model::query(); + + /** @var (Model&ModelWithOrder)|null $adjacentModel */ + $adjacentModel = $baseQuery + ->where('order', $goUp ? '<' : '>', $currentOrder) + ->orderBy('order', $goUp ? SortDirection::Descending : SortDirection::Ascending) + ->first(); + + if ($adjacentModel === null) { + return false; + } + + $this->permuteModelOrders($model, $adjacentModel); + + return true; + } + + private function permuteModelOrders(Model & ModelWithOrder $model1, Model & ModelWithOrder $model2): void + { + $order1 = $model1->getOrder(); + $order2 = $model2->getOrder(); + + // Deactivate timestamps to avoid updating updated_at + $model1->timestamps = false; + $model2->timestamps = false; + + $model1->setOrder(self::MAX_ORDER_VALUE); + $model1->saveQuietly(); + + $model2->setOrder($order1); + $model2->saveQuietly(); + + $model1->setOrder($order2); + $model1->saveQuietly(); + } +} diff --git a/app/Actions/Common/ChangeModelOrderInput.php b/app/Actions/Common/ChangeModelOrderInput.php new file mode 100644 index 00000000..a175026b --- /dev/null +++ b/app/Actions/Common/ChangeModelOrderInput.php @@ -0,0 +1,22 @@ +model, Model::class); + Assert::isInstanceOf($this->model, ModelWithOrder::class); + } +} diff --git a/app/Actions/Common/ChangeModelOrderPosition.php b/app/Actions/Common/ChangeModelOrderPosition.php new file mode 100644 index 00000000..a9f8ffaa --- /dev/null +++ b/app/Actions/Common/ChangeModelOrderPosition.php @@ -0,0 +1,102 @@ + + */ +final class ChangeModelOrderPosition implements Action +{ + private const int MAX_ORDER_VALUE = 4294967295; + + /** + * @param \App\Actions\Common\ChangeModelOrderPositionInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): bool + { + Assert::isInstanceOf($input, ChangeModelOrderPositionInput::class); + + $model = $input->model; + $currentOrder = $model->getOrder(); + $targetOrder = $input->targetOrder; + + if ($currentOrder === $targetOrder) { + return true; + } + + $usesSoftDeletes = in_array(SoftDeletes::class, class_uses_recursive($model), true) + || method_exists($model, 'trashed'); + + /** @var Builder $baseQuery */ + $baseQuery = $usesSoftDeletes + // @phpstan-ignore method.notFound (withTrashed) + ? $model::query()->withTrashed() + : $model::query(); + + /** @var int|null $maxOrder */ + $maxOrder = (clone $baseQuery)->max('order'); + if ($maxOrder !== null && $targetOrder > $maxOrder) { + $targetOrder = (int) $maxOrder; + } + + if ($currentOrder === $targetOrder) { + return true; + } + + // Deactivate timestamps + $model->timestamps = false; + + // Step 1: Temporarily park the moving model at MAX_ORDER_VALUE + $model->setOrder(self::MAX_ORDER_VALUE); + $model->saveQuietly(); + + if ($targetOrder < $currentOrder) { + // Moving UP + /** @var \Illuminate\Database\Eloquent\Collection $itemsToShift */ + $itemsToShift = (clone $baseQuery) + ->where('order', '>=', $targetOrder) + ->where('order', '<', $currentOrder) + ->whereKeyNot($model->getKey()) + ->orderBy('order', 'desc') + ->get(); + + foreach ($itemsToShift as $item) { + $item->timestamps = false; + $item->setOrder($item->getOrder() + 1); + $item->saveQuietly(); + } + } else { + // Moving DOWN + /** @var \Illuminate\Database\Eloquent\Collection $itemsToShift */ + $itemsToShift = (clone $baseQuery) + ->where('order', '>', $currentOrder) + ->where('order', '<=', $targetOrder) + ->whereKeyNot($model->getKey()) + ->orderBy('order', 'asc') + ->get(); + + foreach ($itemsToShift as $item) { + $item->timestamps = false; + $item->setOrder($item->getOrder() - 1); + $item->saveQuietly(); + } + } + + // Step 2: Set the moving model to the target order + $model->setOrder($targetOrder); + $model->saveQuietly(); + + return true; + } +} diff --git a/app/Actions/Common/ChangeModelOrderPositionInput.php b/app/Actions/Common/ChangeModelOrderPositionInput.php new file mode 100644 index 00000000..897a6bcd --- /dev/null +++ b/app/Actions/Common/ChangeModelOrderPositionInput.php @@ -0,0 +1,22 @@ +model, Model::class); + Assert::isInstanceOf($this->model, ModelWithOrder::class); + Assert::greaterThanEq($this->targetOrder, 1); + } +} diff --git a/app/Actions/Common/ExecuteMassAction.php b/app/Actions/Common/ExecuteMassAction.php new file mode 100644 index 00000000..056b53e2 --- /dev/null +++ b/app/Actions/Common/ExecuteMassAction.php @@ -0,0 +1,100 @@ + + */ +final class ExecuteMassAction implements Action +{ + /** + * @param \App\Actions\Common\ExecuteMassActionInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): int + { + Assert::isInstanceOf($input, ExecuteMassActionInput::class); + + $this->assertModelMatchesInput($input); + + return $this->updateModel($input); + } + + private function assertModelMatchesInput(ExecuteMassActionInput $input): void + { + $modelClass = $input->modelClass; + switch ($input->action) { + case MassActionType::Star: + case MassActionType::Unstar: + Assert::isAOf($modelClass, ModelWithStar::class); + break; + + case MassActionType::Publish: + case MassActionType::Unpublish: + Assert::isAOf($modelClass, ModelWithStatus::class); + break; + + default: + throw new \UnexpectedValueException('Unsupported mass action type: ' . $input->action->value); + } + } + + private function updateModel(ExecuteMassActionInput $input): int + { + $modelClass = $input->modelClass; + /** @var class-string $modelClass */ + $model = new $modelClass(); + + $models = $modelClass::query() + ->whereIn($model->getKeyName(), $input->modelKeyList) + ->get(); + + $updated = 0; + + foreach ($models as $foundModel) { + if (! $foundModel instanceof Model) { + continue; + } + + switch ($input->action) { + case MassActionType::Star: + /** @var Model&ModelWithStar $foundModel */ + $foundModel->setStar(true); + break; + + case MassActionType::Unstar: + /** @var Model&ModelWithStar $foundModel */ + $foundModel->setStar(false); + break; + + case MassActionType::Publish: + /** @var Model&ModelWithStatus $foundModel */ + $foundModel->setStatus(true); + break; + + case MassActionType::Unpublish: + /** @var Model&ModelWithStatus $foundModel */ + $foundModel->setStatus(false); + break; + + default: + throw new \UnexpectedValueException('Unsupported mass action type: ' . $input->action->value); + } + + $foundModel->saveOrFail(); + $updated++; + } + + return $updated; + } +} diff --git a/app/Actions/Common/ExecuteMassActionInput.php b/app/Actions/Common/ExecuteMassActionInput.php new file mode 100644 index 00000000..8818e3cb --- /dev/null +++ b/app/Actions/Common/ExecuteMassActionInput.php @@ -0,0 +1,32 @@ + $modelClass + * @param array $modelKeyList + */ + public function __construct( + public string $modelClass, + public MassActionType $action, + public array $modelKeyList, + ) { + Assert::classExists($this->modelClass); + Assert::isAOf($this->modelClass, Model::class); + Assert::notEmpty($this->modelKeyList); + Assert::allScalar($this->modelKeyList); + + foreach ($this->modelKeyList as $modelKey) { + Assert::stringNotEmpty((string) $modelKey); + } + } +} diff --git a/app/Actions/Common/ToggleModelStar.php b/app/Actions/Common/ToggleModelStar.php new file mode 100644 index 00000000..9ec546a7 --- /dev/null +++ b/app/Actions/Common/ToggleModelStar.php @@ -0,0 +1,32 @@ + + */ +final class ToggleModelStar implements Action +{ + /** + * @param \App\Actions\Common\ToggleModelStarInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): Model & ModelWithStar + { + Assert::isInstanceOf($input, ToggleModelStarInput::class); + + $model = $input->model; + $model->toggleStar(); + $model->saveOrFail(); + + return $model; + } +} diff --git a/app/Actions/Common/ToggleModelStarInput.php b/app/Actions/Common/ToggleModelStarInput.php new file mode 100644 index 00000000..0ce672da --- /dev/null +++ b/app/Actions/Common/ToggleModelStarInput.php @@ -0,0 +1,20 @@ +model, Model::class); + Assert::isInstanceOf($this->model, ModelWithStar::class); + } +} diff --git a/app/Actions/Common/ToggleModelStatus.php b/app/Actions/Common/ToggleModelStatus.php new file mode 100644 index 00000000..038d3484 --- /dev/null +++ b/app/Actions/Common/ToggleModelStatus.php @@ -0,0 +1,32 @@ + + */ +final class ToggleModelStatus implements Action +{ + /** + * @param \App\Actions\Common\ToggleModelStatusInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): Model & ModelWithStatus + { + Assert::isInstanceOf($input, ToggleModelStatusInput::class); + + $model = $input->model; + $model->toggleStatus(); + $model->saveOrFail(); + + return $model; + } +} diff --git a/app/Actions/Common/ToggleModelStatusInput.php b/app/Actions/Common/ToggleModelStatusInput.php new file mode 100644 index 00000000..deab9ef8 --- /dev/null +++ b/app/Actions/Common/ToggleModelStatusInput.php @@ -0,0 +1,20 @@ +model, Model::class); + Assert::isInstanceOf($this->model, ModelWithStatus::class); + } +} diff --git a/app/Actions/Crm/UnsubscribeFromNewsletter.php b/app/Actions/Crm/UnsubscribeFromNewsletter.php new file mode 100644 index 00000000..a317ba90 --- /dev/null +++ b/app/Actions/Crm/UnsubscribeFromNewsletter.php @@ -0,0 +1,39 @@ + + */ +final class UnsubscribeFromNewsletter implements Action +{ + public function __construct( + private readonly CrmService $crmService + ) { + } + + #[\Override] + public function __invoke(ActionInput $input): UnsubscribeFromNewsletterOutput + { + Assert::isInstanceOf($input, UnsubscribeFromNewsletterInput::class); + + try { + $isUnsubscribed = $this->crmService->unsubscribeCustomer( + $input->hashcode + ); + + return $isUnsubscribed ? UnsubscribeFromNewsletterOutput::SUCCESS : UnsubscribeFromNewsletterOutput::FAILURE; + } catch (\Throwable $e) { + report($e); + + return UnsubscribeFromNewsletterOutput::FAILURE; + } + } +} diff --git a/app/Actions/Crm/UnsubscribeFromNewsletterInput.php b/app/Actions/Crm/UnsubscribeFromNewsletterInput.php new file mode 100644 index 00000000..00f2d1e8 --- /dev/null +++ b/app/Actions/Crm/UnsubscribeFromNewsletterInput.php @@ -0,0 +1,16 @@ + + */ +final class UpdateCustomer implements Action +{ + public function __construct( + private readonly AppCustomerAuthService $authService, + private readonly CrmService $crmService + ) { + } + + #[\Override] + public function __invoke(ActionInput $input): UpdateCustomerOutput + { + Assert::isInstanceOf($input, UpdateCustomerInput::class); + + $customer = $this->authService->getCustomerAsMandatory(); + + try { + /** @var array{firstname:string,lastname:string,birth_date:string,phone?:string,address?:string,postcode:string,city:string,opt_in?:bool} $data */ + $data = [ + 'firstname' => $input->firstname, + 'lastname' => $input->lastname, + 'birth_date' => $input->birthDate, + 'postcode' => $input->postcode, + 'city' => $input->city, + 'opt_in' => $input->optIn, + ]; + + if ($input->phone !== null) { + $data['phone'] = $input->phone; + } + + if ($input->address !== null) { + $data['address'] = $input->address; + } + + $result = $this->crmService->updateCustomerInfos( + $customer, + $data + ); + + return new UpdateCustomerOutput($result); + } catch (\Throwable $e) { + report($e); + + return new UpdateCustomerOutput(false); + } + } +} diff --git a/app/Actions/Crm/UpdateCustomerInput.php b/app/Actions/Crm/UpdateCustomerInput.php new file mode 100644 index 00000000..51cf202e --- /dev/null +++ b/app/Actions/Crm/UpdateCustomerInput.php @@ -0,0 +1,22 @@ + + */ +final class UpdateCustomerPassword implements Action +{ + public function __construct( + private readonly AppCustomerAuthService $authService, + private readonly CrmService $crmService + ) { + } + + #[\Override] + public function __invoke(ActionInput $input): UpdateCustomerPasswordOutput + { + Assert::isInstanceOf($input, UpdateCustomerPasswordInput::class); + + $hashcode = $this->authService->getCustomerAsMandatory()->hashcode; + + $crmCustomer = $this->crmService->getCustomerFromHashCode( + $hashcode + ); + + if ($crmCustomer instanceof CrmCustomer === false) { + return new UpdateCustomerPasswordOutput(false); + } + + try { + $result = $this->crmService->changePassword( + $crmCustomer, + $input->currentPassword, + $input->newPassword, + ); + + return new UpdateCustomerPasswordOutput($result); + } catch (\Throwable $e) { + report($e); + + return new UpdateCustomerPasswordOutput(false); + } + } +} diff --git a/app/Actions/Crm/UpdateCustomerPasswordInput.php b/app/Actions/Crm/UpdateCustomerPasswordInput.php new file mode 100644 index 00000000..aea1a967 --- /dev/null +++ b/app/Actions/Crm/UpdateCustomerPasswordInput.php @@ -0,0 +1,22 @@ + + */ +final class RegisterCustomer implements Action +{ + public function __construct( + private readonly AppCustomerAuthService $authService, + private readonly CrmService $crmService, + private readonly EmployeeRepository $employeeRepository, + ) { + } + + /** + * @param \App\Actions\Customers\RegisterCustomerInput $input + * + * @throws ValidationException + * @throws \UnexpectedValueException + * @throws ModelNotFoundException + */ + #[\Override] + public function __invoke(ActionInput $input): Customer + { + Assert::isInstanceOf($input, RegisterCustomerInput::class); + + // * Persist and associate Customer + Employee + $customer = new Customer([ + 'email' => $input->email, + ]); + // * Temp hashcode to satisfy constraint + $customer->hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->saveOrFail(); + + $employee = $this->employeeRepository->findByMatriculeAndCode( + $input->matricule, + $input->code + ); + + if (! $employee) { + throw new ModelNotFoundException('Employee not found'); + } + + $employee->customer()->associate($customer); + $employee->saveOrFail(); + + $crmCustomer = new CrmCustomer( + hashcode: null, + email: $input->email->value, + password: $input->password, + firstname: $input->firstname, + lastname: $input->lastname, + birthDate: $input->birthDate->format('Y-m-d'), + phone: $input->phone?->value, + address: $input->address, + address2: null, + city: $input->city, + postcode: $input->postcode, + country: Country::france, + optIn: $input->optIn, + status: false, + lastConnection: null, + ); + + try { + $result = $this->crmService->persist($crmCustomer); + + if (! $result->hashcode) { + throw new \UnexpectedValueException( + 'CRM did not return a hashcode for the created customer' + ); + } + + $customer->hashcode = CrmHashcode::fromString($result->hashcode); + $customer->saveOrFail(); + + $customer->sendEmailVerificationNotification(); + + $this->authService->logIn($customer); + + return $customer; + } catch (CrmCustomerExistsException) { + throw ValidationException::withMessages([ + 'error' => trans('An account is already associated with this email address'), + ]); + } catch (CrmServiceException $e) { + report($e); + throw ValidationException::withMessages([ + 'error' => trans('An error has occurred. Please try again later'), + ]); + } + } +} diff --git a/app/Actions/Customers/RegisterCustomerInput.php b/app/Actions/Customers/RegisterCustomerInput.php new file mode 100644 index 00000000..9be0658d --- /dev/null +++ b/app/Actions/Customers/RegisterCustomerInput.php @@ -0,0 +1,43 @@ +firstname)); + Assert::maxLength($this->firstname, 255); + Assert::stringNotEmpty(trim($this->lastname)); + Assert::maxLength($this->lastname, 255); + Assert::stringNotEmpty(trim($this->password)); + Assert::stringNotEmpty(trim($this->postcode)); + Assert::maxLength($this->postcode, 20); + Assert::stringNotEmpty(trim($this->city)); + Assert::maxLength($this->city, 255); + if ($this->address !== null) { + Assert::maxLength($this->address, 255); + } + } +} diff --git a/app/Actions/Discounts/CreateDiscount.php b/app/Actions/Discounts/CreateDiscount.php new file mode 100644 index 00000000..d731e330 --- /dev/null +++ b/app/Actions/Discounts/CreateDiscount.php @@ -0,0 +1,56 @@ + + */ +final class CreateDiscount implements Action +{ + /** + * @param \App\Actions\Discounts\CreateDiscountInput $input + */ + public function __invoke(ActionInput $input): Discount + { + Assert::isInstanceOf($input, CreateDiscountInput::class); + + $discount = new Discount(); + $discount->type = $input->type; + $discount->value = $input->value; + $discount->is_old_price_displayed = $input->is_old_price_displayed; + $discount->date_start = $input->period->start !== null ? Carbon::instance($input->period->start) : null; + $discount->date_end = $input->period->end !== null ? Carbon::instance($input->period->end) : null; + + $discount->saveOrFail(); + + $this->syncAssociatedProducts($discount, $input->associatedProductsIds); + + return $discount; + } + + /** + * @param array $productIdList + */ + private function syncAssociatedProducts(Discount $discount, array $productIdList): void + { + Product::query() + ->where('discount_id', $discount->id) + ->whereNotIn('id', $productIdList) + ->update(['discount_id' => null]); + + if (! empty($productIdList)) { + Product::query() + ->whereIn('id', $productIdList) + ->update(['discount_id' => $discount->id]); + } + } +} diff --git a/app/Actions/Discounts/CreateDiscountInput.php b/app/Actions/Discounts/CreateDiscountInput.php new file mode 100644 index 00000000..4792a00f --- /dev/null +++ b/app/Actions/Discounts/CreateDiscountInput.php @@ -0,0 +1,28 @@ + $associatedProductsIds + */ + public function __construct( + public DiscountType $type, + public DiscountValue $value, + public bool $is_old_price_displayed, + public DatePeriod $period = new DatePeriod(), + public array $associatedProductsIds = [], + ) { + Assert::same($this->type, $this->value->type, 'The discount value type must match the discount type.'); + Assert::allString($this->associatedProductsIds); + } +} diff --git a/app/Actions/Discounts/DeleteDiscount.php b/app/Actions/Discounts/DeleteDiscount.php new file mode 100644 index 00000000..b4f91e46 --- /dev/null +++ b/app/Actions/Discounts/DeleteDiscount.php @@ -0,0 +1,25 @@ + + */ +final class DeleteDiscount implements Action +{ + /** + * @param \App\Actions\Discounts\DeleteDiscountInput $input + */ + public function __invoke(ActionInput $input): bool + { + Assert::isInstanceOf($input, DeleteDiscountInput::class); + + return (bool) $input->discount->deleteOrFail(); + } +} diff --git a/app/Actions/Discounts/DeleteDiscountInput.php b/app/Actions/Discounts/DeleteDiscountInput.php new file mode 100644 index 00000000..f256f40b --- /dev/null +++ b/app/Actions/Discounts/DeleteDiscountInput.php @@ -0,0 +1,16 @@ + + */ +final class UpdateDiscount implements Action +{ + /** + * @param \App\Actions\Discounts\UpdateDiscountInput $input + */ + public function __invoke(ActionInput $input): Discount + { + Assert::isInstanceOf($input, UpdateDiscountInput::class); + + $discount = $input->discount; + $discount->type = $input->type; + $discount->value = $input->value; + $discount->is_old_price_displayed = $input->is_old_price_displayed; + $discount->date_start = $input->period->start !== null ? Carbon::instance($input->period->start) : null; + $discount->date_end = $input->period->end !== null ? Carbon::instance($input->period->end) : null; + + $discount->saveOrFail(); + + $this->syncAssociatedProducts($discount, $input->associatedProductsIds); + + return $discount; + } + + /** + * @param array $productIdList + */ + private function syncAssociatedProducts(Discount $discount, array $productIdList): void + { + Product::query() + ->where('discount_id', $discount->id) + ->whereNotIn('id', $productIdList) + ->update(['discount_id' => null]); + + if (! empty($productIdList)) { + Product::query() + ->whereIn('id', $productIdList) + ->update(['discount_id' => $discount->id]); + } + } +} diff --git a/app/Actions/Discounts/UpdateDiscountInput.php b/app/Actions/Discounts/UpdateDiscountInput.php new file mode 100644 index 00000000..f8ed9d86 --- /dev/null +++ b/app/Actions/Discounts/UpdateDiscountInput.php @@ -0,0 +1,30 @@ + $associatedProductsIds + */ + public function __construct( + public Discount $discount, + public DiscountType $type, + public DiscountValue $value, + public bool $is_old_price_displayed, + public DatePeriod $period = new DatePeriod(), + public array $associatedProductsIds = [], + ) { + Assert::same($this->type, $this->value->type, 'The discount value type must match the discount type.'); + Assert::allString($this->associatedProductsIds); + } +} diff --git a/app/Actions/Employee/SynchronizeEmployeesWithArcadiaApi.php b/app/Actions/Employee/SynchronizeEmployeesWithArcadiaApi.php new file mode 100644 index 00000000..8e4492cd --- /dev/null +++ b/app/Actions/Employee/SynchronizeEmployeesWithArcadiaApi.php @@ -0,0 +1,34 @@ + + */ +final class SynchronizeEmployeesWithArcadiaApi implements Action +{ + public function __construct( + private readonly EmployeeRepository $employeeRepository, + private readonly EmployeeSyncService $syncService + ) { + } + + /** @param \App\Contracts\ActionInputEmpty $input */ + public function __invoke(ActionInput $input): void + { + Assert::isAOf($input, ActionInputEmpty::class); + + $wasLastSyncedAt = $this->employeeRepository->getMostRecentSyncDate(); + + $this->syncService->synchronize($wasLastSyncedAt); + } +} diff --git a/app/Actions/Faqs/CreateFaq.php b/app/Actions/Faqs/CreateFaq.php new file mode 100644 index 00000000..eb64470f --- /dev/null +++ b/app/Actions/Faqs/CreateFaq.php @@ -0,0 +1,34 @@ + + */ +final class CreateFaq implements Action +{ + /** + * @param \App\Actions\Faqs\CreateFaqInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): Faq + { + Assert::isInstanceOf($input, CreateFaqInput::class); + + $faq = new Faq(); + $faq->fill([ + 'question' => $input->question, + 'answer' => $input->answer, + ]); + $faq->saveOrFail(); + + return $faq; + } +} diff --git a/app/Actions/Faqs/CreateFaqInput.php b/app/Actions/Faqs/CreateFaqInput.php new file mode 100644 index 00000000..54c1a4df --- /dev/null +++ b/app/Actions/Faqs/CreateFaqInput.php @@ -0,0 +1,22 @@ +question), 'Question cannot be empty.'); + Assert::minLength(trim($this->question), 4); + Assert::maxLength($this->question, 255); + Assert::stringNotEmpty(trim($this->answer), 'Answer cannot be empty.'); + Assert::minLength(trim($this->answer), 4); + } +} diff --git a/app/Actions/Faqs/DeleteFaq.php b/app/Actions/Faqs/DeleteFaq.php new file mode 100644 index 00000000..ed107870 --- /dev/null +++ b/app/Actions/Faqs/DeleteFaq.php @@ -0,0 +1,26 @@ + + */ +final class DeleteFaq implements Action +{ + /** + * @param \App\Actions\Faqs\DeleteFaqInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): void + { + Assert::isInstanceOf($input, DeleteFaqInput::class); + + $input->faq->deleteOrFail(); + } +} diff --git a/app/Actions/Faqs/DeleteFaqInput.php b/app/Actions/Faqs/DeleteFaqInput.php new file mode 100644 index 00000000..df6851dc --- /dev/null +++ b/app/Actions/Faqs/DeleteFaqInput.php @@ -0,0 +1,16 @@ + + */ +final class UpdateFaq implements Action +{ + /** + * @param \App\Actions\Faqs\UpdateFaqInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): Faq + { + Assert::isInstanceOf($input, UpdateFaqInput::class); + + $faq = $input->faq; + $faq->fill([ + 'question' => $input->question, + 'answer' => $input->answer, + ]); + $faq->saveOrFail(); + + return $faq; + } +} diff --git a/app/Actions/Faqs/UpdateFaqInput.php b/app/Actions/Faqs/UpdateFaqInput.php new file mode 100644 index 00000000..8575c164 --- /dev/null +++ b/app/Actions/Faqs/UpdateFaqInput.php @@ -0,0 +1,24 @@ +question), 'Question cannot be empty.'); + Assert::minLength(trim($this->question), 4); + Assert::maxLength($this->question, 255); + Assert::stringNotEmpty(trim($this->answer), 'Answer cannot be empty.'); + Assert::minLength(trim($this->answer), 4); + } +} diff --git a/app/Actions/Orders/ApplyPickTimeSlot.php b/app/Actions/Orders/ApplyPickTimeSlot.php new file mode 100644 index 00000000..fb96685a --- /dev/null +++ b/app/Actions/Orders/ApplyPickTimeSlot.php @@ -0,0 +1,42 @@ + + */ +final class ApplyPickTimeSlot implements Action +{ + public function __construct( + private readonly OrderTunnelService $orderTunnelService, + ) { + } + + /** + * @param \App\Actions\Orders\ApplyPickTimeSlotInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): ?PickupTimeSlot + { + Assert::isInstanceOf($input, ApplyPickTimeSlotInput::class); + + $builder = $this->orderTunnelService->getBuilderFromBasketOrFail(); + $shop = $this->orderTunnelService->getShopForCustomer($input->shopperId); + $timeSlots = $this->orderTunnelService->getAvailableTimeSlots($shop); + + return $this->orderTunnelService->applyTimeSlot( + $builder, + $shop, + $input->timeslot, + $timeSlots + ); + } +} diff --git a/app/Actions/Orders/ApplyPickTimeSlotInput.php b/app/Actions/Orders/ApplyPickTimeSlotInput.php new file mode 100644 index 00000000..351f4662 --- /dev/null +++ b/app/Actions/Orders/ApplyPickTimeSlotInput.php @@ -0,0 +1,18 @@ + + */ +final class CancelOrder implements Action +{ + public function __construct( + private readonly DomainOrderService $domainOrderService, + ) { + } + + /** + * @param \App\Actions\Orders\CancelOrderInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): void + { + Assert::isInstanceOf($input, CancelOrderInput::class); + + $this->domainOrderService->cancelOrder($input->order->getId()); + } +} diff --git a/app/Actions/Orders/CancelOrderInput.php b/app/Actions/Orders/CancelOrderInput.php new file mode 100644 index 00000000..8382a31c --- /dev/null +++ b/app/Actions/Orders/CancelOrderInput.php @@ -0,0 +1,18 @@ +order->id)); + } +} diff --git a/app/Actions/Orders/FinalizeOrder.php b/app/Actions/Orders/FinalizeOrder.php new file mode 100644 index 00000000..d0a4545a --- /dev/null +++ b/app/Actions/Orders/FinalizeOrder.php @@ -0,0 +1,36 @@ + + */ +final class FinalizeOrder implements Action +{ + public function __construct( + private readonly OrderTunnelService $orderTunnelService, + ) { + } + + /** + * @param \App\Actions\Orders\FinalizeOrderInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): OrderReference + { + Assert::isInstanceOf($input, FinalizeOrderInput::class); + + $builder = $this->orderTunnelService->getBuilderCompletedOrFail(); + $order = $this->orderTunnelService->finalizeOrder($builder); + + return $order->reference; + } +} diff --git a/app/Actions/Orders/FinalizeOrderInput.php b/app/Actions/Orders/FinalizeOrderInput.php new file mode 100644 index 00000000..37f6ea0a --- /dev/null +++ b/app/Actions/Orders/FinalizeOrderInput.php @@ -0,0 +1,16 @@ + + */ +final class InitializeOrderTunnel implements Action +{ + public function __construct( + private readonly OrderTunnelService $orderTunnelService, + ) { + } + + /** + * @param \App\Actions\Orders\InitializeOrderTunnelInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): void + { + Assert::isInstanceOf($input, InitializeOrderTunnelInput::class); + + $this->orderTunnelService->initializeFromBasket( + $input->basket, + $input->shopperId + ); + } +} diff --git a/app/Actions/Orders/InitializeOrderTunnelInput.php b/app/Actions/Orders/InitializeOrderTunnelInput.php new file mode 100644 index 00000000..3bd31b09 --- /dev/null +++ b/app/Actions/Orders/InitializeOrderTunnelInput.php @@ -0,0 +1,18 @@ + + */ +final class UpdatePage implements Action +{ + /** + * @param \App\Actions\Pages\UpdatePageInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): Page + { + Assert::isInstanceOf($input, UpdatePageInput::class); + + $page = $input->page; + $page->fill([ + 'seo_title' => $input->seo->title, + 'seo_description' => $input->seo->description, + 'title' => $input->title, + 'content' => $input->content, + ]); + $page->saveOrFail(); + + return $page; + } +} diff --git a/app/Actions/Pages/UpdatePageInput.php b/app/Actions/Pages/UpdatePageInput.php new file mode 100644 index 00000000..15a88286 --- /dev/null +++ b/app/Actions/Pages/UpdatePageInput.php @@ -0,0 +1,27 @@ +content)); + + if ($this->title !== null) { + Assert::stringNotEmpty(trim($this->title)); + Assert::maxLength($this->title, 255); + } + } +} diff --git a/app/Actions/PickupExceptions/CreatePickupException.php b/app/Actions/PickupExceptions/CreatePickupException.php new file mode 100644 index 00000000..ba9ab622 --- /dev/null +++ b/app/Actions/PickupExceptions/CreatePickupException.php @@ -0,0 +1,37 @@ + + */ +final class CreatePickupException implements Action +{ + /** + * @param \App\Actions\PickupExceptions\CreatePickupExceptionInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): PickupException + { + Assert::isInstanceOf($input, CreatePickupExceptionInput::class); + + $pickupException = new PickupException(); + $pickupException->fill([ + 'date' => $input->date, + 'label' => $input->label, + 'repeatable' => $input->repeatable, + 'repeat_frequency' => $input->repeat_frequency, + ]); + $pickupException->setAsManuallySaved(); + $pickupException->saveOrFail(); + + return $pickupException; + } +} diff --git a/app/Actions/PickupExceptions/CreatePickupExceptionInput.php b/app/Actions/PickupExceptions/CreatePickupExceptionInput.php new file mode 100644 index 00000000..b32e2589 --- /dev/null +++ b/app/Actions/PickupExceptions/CreatePickupExceptionInput.php @@ -0,0 +1,23 @@ +date, '/^\d{4}-\d{2}-\d{2}$/', 'Date must be in Y-m-d format.'); + Assert::stringNotEmpty(trim($this->label), 'Label cannot be empty.'); + Assert::maxLength(trim($this->label), 255, 'Label cannot exceed 255 characters.'); + } +} diff --git a/app/Actions/PickupExceptions/DeletePickupException.php b/app/Actions/PickupExceptions/DeletePickupException.php new file mode 100644 index 00000000..f2f0b3bd --- /dev/null +++ b/app/Actions/PickupExceptions/DeletePickupException.php @@ -0,0 +1,26 @@ + + */ +final class DeletePickupException implements Action +{ + /** + * @param \App\Actions\PickupExceptions\DeletePickupExceptionInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): bool + { + Assert::isInstanceOf($input, DeletePickupExceptionInput::class); + + return (bool) $input->pickupException->deleteOrFail(); + } +} diff --git a/app/Actions/PickupExceptions/DeletePickupExceptionInput.php b/app/Actions/PickupExceptions/DeletePickupExceptionInput.php new file mode 100644 index 00000000..d303a5b5 --- /dev/null +++ b/app/Actions/PickupExceptions/DeletePickupExceptionInput.php @@ -0,0 +1,16 @@ + + */ +final class UpdatePickupException implements Action +{ + /** + * @param \App\Actions\PickupExceptions\UpdatePickupExceptionInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): PickupException + { + Assert::isInstanceOf($input, UpdatePickupExceptionInput::class); + + $input->pickupException->fill([ + 'date' => $input->date, + 'label' => $input->label, + 'repeatable' => $input->repeatable, + 'repeat_frequency' => $input->repeat_frequency, + ]); + $input->pickupException->setAsManuallySaved(); + $input->pickupException->saveOrFail(); + + return $input->pickupException; + } +} diff --git a/app/Actions/PickupExceptions/UpdatePickupExceptionInput.php b/app/Actions/PickupExceptions/UpdatePickupExceptionInput.php new file mode 100644 index 00000000..35f9a7e4 --- /dev/null +++ b/app/Actions/PickupExceptions/UpdatePickupExceptionInput.php @@ -0,0 +1,25 @@ +date, '/^\d{4}-\d{2}-\d{2}$/', 'Date must be in Y-m-d format.'); + Assert::stringNotEmpty(trim($this->label), 'Label cannot be empty.'); + Assert::maxLength(trim($this->label), 255, 'Label cannot exceed 255 characters.'); + } +} diff --git a/app/Actions/ProductIncos/AssociateProductInco.php b/app/Actions/ProductIncos/AssociateProductInco.php new file mode 100644 index 00000000..93789e5c --- /dev/null +++ b/app/Actions/ProductIncos/AssociateProductInco.php @@ -0,0 +1,59 @@ + + */ +final class AssociateProductInco implements Action +{ + public function __construct( + private readonly ArcadiaIncoService $arcadiaIncoService, + ) { + } + + /** + * @param \App\Actions\ProductIncos\AssociateProductIncoInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): ProductInco + { + Assert::isInstanceOf($input, AssociateProductIncoInput::class); + + $incoData = $this->arcadiaIncoService->fetchInco($input->no_art); + + if ($incoData === null) { + throw new \RuntimeException(sprintf('INCO sheet #%d was not found on Arcadia API.', $input->no_art)); + } + + // * Remove existing product_inco for this product if present + $existing = ProductInco::query()->where('product_id', $input->product->id)->first(); + if ($existing !== null) { + $existing->delete(); + } + + $inco = new ProductInco(); + $inco->product_id = (string) $input->product->id; + $inco->no_art = $incoData->noArt; + $inco->ingredients = $incoData->ingredients; + $inco->preparation = $incoData->preparation; + $inco->servings = $incoData->servings; + $inco->allergens = $incoData->allergens; + $inco->selling_argument = $incoData->sellingArgument; + $inco->nutriscore = $incoData->nutriscore; + $inco->nutriscore_args = $incoData->nutriscoreArgs; + $inco->nutrition = $incoData->nutrition; + + $inco->saveOrFail(); + + return $inco; + } +} diff --git a/app/Actions/ProductIncos/AssociateProductIncoInput.php b/app/Actions/ProductIncos/AssociateProductIncoInput.php new file mode 100644 index 00000000..e6eda895 --- /dev/null +++ b/app/Actions/ProductIncos/AssociateProductIncoInput.php @@ -0,0 +1,19 @@ +no_art, 1, 'The INCO article number must be greater than or equal to 1.'); + } +} diff --git a/app/Actions/ProductIncos/SyncProductInco.php b/app/Actions/ProductIncos/SyncProductInco.php new file mode 100644 index 00000000..ae2379d6 --- /dev/null +++ b/app/Actions/ProductIncos/SyncProductInco.php @@ -0,0 +1,54 @@ + + */ +final class SyncProductInco implements Action +{ + public function __construct( + private readonly ArcadiaIncoService $arcadiaIncoService, + ) { + } + + /** + * @param \App\Actions\ProductIncos\SyncProductIncoInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): ProductInco + { + Assert::isInstanceOf($input, SyncProductIncoInput::class); + + $inco = $input->product->inco; + if ($inco === null) { + throw new \RuntimeException('Product does not have an associated INCO sheet to sync.'); + } + + $incoData = $this->arcadiaIncoService->fetchInco($inco->no_art); + if ($incoData === null) { + throw new \RuntimeException(sprintf('INCO sheet #%d was not found on Arcadia API.', $inco->no_art)); + } + + $inco->ingredients = $incoData->ingredients; + $inco->preparation = $incoData->preparation; + $inco->servings = $incoData->servings; + $inco->allergens = $incoData->allergens; + $inco->selling_argument = $incoData->sellingArgument; + $inco->nutriscore = $incoData->nutriscore; + $inco->nutriscore_args = $incoData->nutriscoreArgs; + $inco->nutrition = $incoData->nutrition; + + $inco->saveOrFail(); + + return $inco; + } +} diff --git a/app/Actions/ProductIncos/SyncProductIncoInput.php b/app/Actions/ProductIncos/SyncProductIncoInput.php new file mode 100644 index 00000000..bcce4aff --- /dev/null +++ b/app/Actions/ProductIncos/SyncProductIncoInput.php @@ -0,0 +1,16 @@ + + */ +final class SynchronizeProductIncosWithArcadiaApi implements Action +{ + public function __construct( + private readonly ArcadiaIncoService $arcadiaIncoService, + private readonly LoggerInterface $logger, + ) { + } + + /** + * @param \App\Contracts\ActionInputEmpty $input + */ + #[\Override] + public function __invoke(ActionInput $input): int + { + Assert::isInstanceOf($input, ActionInputEmpty::class); + + $this->logger->info('Starting synchronization of all ProductIncos with Arcadia API.'); + $updatedCount = 0; + + /** @var \Illuminate\Database\Eloquent\Collection $incos */ + $incos = ProductInco::query()->get(); + + foreach ($incos as $inco) { + $incoData = $this->arcadiaIncoService->fetchInco($inco->no_art); + + if ($incoData === null) { + $this->logger->warning("Could not sync ProductInco #{$inco->id} (no_art: {$inco->no_art}): not found on Arcadia."); + + continue; + } + + $inco->ingredients = $incoData->ingredients; + $inco->preparation = $incoData->preparation; + $inco->servings = $incoData->servings; + $inco->allergens = $incoData->allergens; + $inco->selling_argument = $incoData->sellingArgument; + $inco->nutriscore = $incoData->nutriscore; + $inco->nutriscore_args = $incoData->nutriscoreArgs; + $inco->nutrition = $incoData->nutrition; + + $inco->saveOrFail(); + $updatedCount++; + } + + $this->logger->info("Completed synchronization of ProductIncos: {$updatedCount} updated."); + + return $updatedCount; + } +} diff --git a/app/Actions/Products/CreateProduct.php b/app/Actions/Products/CreateProduct.php new file mode 100644 index 00000000..175b83ae --- /dev/null +++ b/app/Actions/Products/CreateProduct.php @@ -0,0 +1,109 @@ + + */ +final class CreateProduct implements Action +{ + /** + * @param \App\Actions\Products\CreateProductInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): Product + { + Assert::isInstanceOf($input, CreateProductInput::class); + + $product = new Product(); + $product->name = $input->name; + $product->short_description = $input->shortDescription; + $product->description = $input->description; + $product->price = $input->price; + $product->invoicing_unit = $input->invoicingUnit; + $product->stock = $input->stock; + $product->range_id = $input->rangeId; + $product->sell_unit = $input->sellUnit; + $product->order_unit = $input->orderUnit; + $product->tax_rate = $input->taxRate; + $product->brand = $input->brand; + $product->weight = $input->weight; + $product->weight_variable = $input->weightVariable; + $product->orderable_start = $input->orderableStart !== null ? Date::instance($input->orderableStart) : null; + $product->orderable_end = $input->orderableEnd !== null ? Date::instance($input->orderableEnd) : null; + $product->star = $input->star; + $product->status = $input->status; + + if ($input->picture !== null) { + $product->setAttribute('picture', $input->picture); + } + $product->picture_alt = (string) $input->pictureAlt; + $product->picture_title = (string) $input->pictureTitle; + + if ($input->pictureLarge !== null) { + $product->setAttribute('picture_large', $input->pictureLarge); + } + $product->picture_large_alt = (string) $input->pictureLargeAlt; + $product->picture_large_title = (string) $input->pictureLargeTitle; + + $product->saveOrFail(); + + $this->syncTags($input->tags, $product); + $this->syncAssociatedProducts($input->associatedProductsIds, $product); + + return $product; + } + + /** + * @param array $tags + */ + private function syncTags(array $tags, Product $product): void + { + $tagIdList = []; + foreach ($tags as $tag) { + $tagIdList[] = empty($tag['id']) + ? $this->storeTag($tag) + : (int) $tag['id']; + } + + $product->tags()->sync($tagIdList); + } + + /** + * @param array{id?: int|string, label: string} $tag + */ + private function storeTag(array $tag): int + { + $slug = Str::slug($tag['label']); + $tagModel = Tag::query() + ->where('slug', $slug) + ->firstOrNew(); + $tagModel->setAttribute('label', $tag['label']); + $tagModel->saveOrFail(); + + return (int) $tagModel->id; + } + + /** + * @param list $productIdList + */ + private function syncAssociatedProducts(array $productIdList, Product $product): void + { + $syncData = []; + foreach ($productIdList as $index => $id) { + $syncData[$id] = ['sort_order' => $index + 1]; + } + + $product->products()->sync($syncData); + } +} diff --git a/app/Actions/Products/CreateProductInput.php b/app/Actions/Products/CreateProductInput.php new file mode 100644 index 00000000..1c3b5fc3 --- /dev/null +++ b/app/Actions/Products/CreateProductInput.php @@ -0,0 +1,55 @@ + $tags + * @param list $associatedProductsIds + */ + public function __construct( + public string $name, + public string $shortDescription, + public string $description, + public Money $price, + public InvoicingUnit $invoicingUnit, + public int $stock, + public int $rangeId, + public SellUnit $sellUnit, + public OrderUnit $orderUnit, + public TaxRate $taxRate, + public ProductBrand $brand, + public ?int $weight = null, + public bool $weightVariable = false, + public ?CarbonInterface $orderableStart = null, + public ?CarbonInterface $orderableEnd = null, + public bool $star = false, + public bool $status = false, + public mixed $picture = null, + public ?string $pictureAlt = null, + public ?string $pictureTitle = null, + public mixed $pictureLarge = null, + public ?string $pictureLargeAlt = null, + public ?string $pictureLargeTitle = null, + public array $tags = [], + public array $associatedProductsIds = [], + ) { + Assert::stringNotEmpty(trim($this->name)); + Assert::maxLength($this->name, 255); + Assert::greaterThanEq($this->stock, 0); + Assert::greaterThanEq($this->rangeId, 1); + } +} diff --git a/app/Actions/Products/DeleteProduct.php b/app/Actions/Products/DeleteProduct.php new file mode 100644 index 00000000..8b201e58 --- /dev/null +++ b/app/Actions/Products/DeleteProduct.php @@ -0,0 +1,26 @@ + + */ +final class DeleteProduct implements Action +{ + /** + * @param \App\Actions\Products\DeleteProductInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): bool + { + Assert::isInstanceOf($input, DeleteProductInput::class); + + return (bool) $input->product->deleteOrFail(); + } +} diff --git a/app/Actions/Products/DeleteProductInput.php b/app/Actions/Products/DeleteProductInput.php new file mode 100644 index 00000000..75a43027 --- /dev/null +++ b/app/Actions/Products/DeleteProductInput.php @@ -0,0 +1,16 @@ + + */ +final class UpdateProduct implements Action +{ + /** + * @param \App\Actions\Products\UpdateProductInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): Product + { + Assert::isInstanceOf($input, UpdateProductInput::class); + + $product = $input->product; + $product->name = $input->name; + $product->short_description = $input->shortDescription; + $product->description = $input->description; + $product->price = $input->price; + $product->invoicing_unit = $input->invoicingUnit; + $product->stock = $input->stock; + $product->range_id = $input->rangeId; + $product->sell_unit = $input->sellUnit; + $product->order_unit = $input->orderUnit; + $product->tax_rate = $input->taxRate; + $product->brand = $input->brand; + $product->weight = $input->weight; + $product->weight_variable = $input->weightVariable; + $product->orderable_start = $input->orderableStart !== null ? Date::instance($input->orderableStart) : null; + $product->orderable_end = $input->orderableEnd !== null ? Date::instance($input->orderableEnd) : null; + $product->star = $input->star; + $product->status = $input->status; + + if ($input->picture !== null) { + $product->setAttribute('picture', $input->picture); + } + $product->picture_alt = (string) $input->pictureAlt; + $product->picture_title = (string) $input->pictureTitle; + + if ($input->pictureLarge !== null) { + $product->setAttribute('picture_large', $input->pictureLarge); + } + $product->picture_large_alt = (string) $input->pictureLargeAlt; + $product->picture_large_title = (string) $input->pictureLargeTitle; + + $product->saveOrFail(); + + $this->syncTags($input->tags, $product); + $this->syncAssociatedProducts($input->associatedProductsIds, $product); + + return $product; + } + + /** + * @param array $tags + */ + private function syncTags(array $tags, Product $product): void + { + $tagIdList = []; + foreach ($tags as $tag) { + $tagIdList[] = empty($tag['id']) + ? $this->storeTag($tag) + : (int) $tag['id']; + } + + $product->tags()->sync($tagIdList); + } + + /** + * @param array{id?: int|string, label: string} $tag + */ + private function storeTag(array $tag): int + { + $slug = Str::slug($tag['label']); + $tagModel = Tag::query() + ->where('slug', $slug) + ->firstOrNew(); + $tagModel->setAttribute('label', $tag['label']); + $tagModel->saveOrFail(); + + return (int) $tagModel->id; + } + + /** + * @param list $productIdList + */ + private function syncAssociatedProducts(array $productIdList, Product $product): void + { + $syncData = []; + foreach ($productIdList as $index => $id) { + $syncData[$id] = ['sort_order' => $index + 1]; + } + + $product->products()->sync($syncData); + } +} diff --git a/app/Actions/Products/UpdateProductInput.php b/app/Actions/Products/UpdateProductInput.php new file mode 100644 index 00000000..fe488a21 --- /dev/null +++ b/app/Actions/Products/UpdateProductInput.php @@ -0,0 +1,57 @@ + $tags + * @param list $associatedProductsIds + */ + public function __construct( + public Product $product, + public string $name, + public string $shortDescription, + public string $description, + public Money $price, + public InvoicingUnit $invoicingUnit, + public int $stock, + public int $rangeId, + public SellUnit $sellUnit, + public OrderUnit $orderUnit, + public TaxRate $taxRate, + public ProductBrand $brand, + public ?int $weight = null, + public bool $weightVariable = false, + public ?CarbonInterface $orderableStart = null, + public ?CarbonInterface $orderableEnd = null, + public bool $star = false, + public bool $status = false, + public mixed $picture = null, + public ?string $pictureAlt = null, + public ?string $pictureTitle = null, + public mixed $pictureLarge = null, + public ?string $pictureLargeAlt = null, + public ?string $pictureLargeTitle = null, + public array $tags = [], + public array $associatedProductsIds = [], + ) { + Assert::stringNotEmpty(trim($this->name)); + Assert::maxLength($this->name, 255); + Assert::greaterThanEq($this->stock, 0); + Assert::greaterThanEq($this->rangeId, 1); + } +} diff --git a/app/Actions/Ranges/CreateRange.php b/app/Actions/Ranges/CreateRange.php new file mode 100644 index 00000000..306ec953 --- /dev/null +++ b/app/Actions/Ranges/CreateRange.php @@ -0,0 +1,43 @@ + + */ +final class CreateRange implements Action +{ + /** + * @param \App\Actions\Ranges\CreateRangeInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): Range + { + Assert::isInstanceOf($input, CreateRangeInput::class); + + $attributes = [ + 'name' => $input->name, + 'description' => $input->description, + 'picture_alt' => $input->pictureMetadata->alt ?? '', + 'picture_title' => $input->pictureMetadata->title ?? '', + 'status' => $input->status, + ]; + + if ($input->picture !== null) { + $attributes['picture'] = $input->picture; + } + + $range = new Range(); + $range->fill($attributes); + $range->saveOrFail(); + + return $range; + } +} diff --git a/app/Actions/Ranges/CreateRangeInput.php b/app/Actions/Ranges/CreateRangeInput.php new file mode 100644 index 00000000..c58dc9e2 --- /dev/null +++ b/app/Actions/Ranges/CreateRangeInput.php @@ -0,0 +1,33 @@ +name); + Assert::stringNotEmpty($trimmedName, 'The range name cannot be empty.'); + Assert::minLength($trimmedName, 2, 'The range name must be at least 2 characters.'); + Assert::maxLength($trimmedName, 45, 'The range name cannot exceed 45 characters.'); + + if ($this->picture !== null) { + Assert::notNull($this->pictureMetadata->alt, 'Picture alt is required when picture is provided.'); + Assert::stringNotEmpty(trim($this->pictureMetadata->alt), 'Picture alt cannot be empty when picture is provided.'); + Assert::notNull($this->pictureMetadata->title, 'Picture title is required when picture is provided.'); + Assert::stringNotEmpty(trim($this->pictureMetadata->title), 'Picture title cannot be empty when picture is provided.'); + } + } +} diff --git a/app/Actions/Ranges/DeleteRange.php b/app/Actions/Ranges/DeleteRange.php new file mode 100644 index 00000000..07c78765 --- /dev/null +++ b/app/Actions/Ranges/DeleteRange.php @@ -0,0 +1,26 @@ + + */ +final class DeleteRange implements Action +{ + /** + * @param \App\Actions\Ranges\DeleteRangeInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): bool + { + Assert::isInstanceOf($input, DeleteRangeInput::class); + + return (bool) $input->range->deleteOrFail(); + } +} diff --git a/app/Actions/Ranges/DeleteRangeInput.php b/app/Actions/Ranges/DeleteRangeInput.php new file mode 100644 index 00000000..d35a9811 --- /dev/null +++ b/app/Actions/Ranges/DeleteRangeInput.php @@ -0,0 +1,16 @@ + + */ +final class UpdateRange implements Action +{ + /** + * @param \App\Actions\Ranges\UpdateRangeInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): Range + { + Assert::isInstanceOf($input, UpdateRangeInput::class); + + $attributes = [ + 'name' => $input->name, + 'description' => $input->description, + 'picture_alt' => $input->pictureMetadata->alt ?? '', + 'picture_title' => $input->pictureMetadata->title ?? '', + 'status' => $input->status, + ]; + + if ($input->picture !== null) { + $attributes['picture'] = $input->picture; + } + + $range = $input->range; + $range->fill($attributes); + $range->saveOrFail(); + + return $range; + } +} diff --git a/app/Actions/Ranges/UpdateRangeInput.php b/app/Actions/Ranges/UpdateRangeInput.php new file mode 100644 index 00000000..d12b046f --- /dev/null +++ b/app/Actions/Ranges/UpdateRangeInput.php @@ -0,0 +1,35 @@ +name); + Assert::stringNotEmpty($trimmedName, 'The range name cannot be empty.'); + Assert::minLength($trimmedName, 2, 'The range name must be at least 2 characters.'); + Assert::maxLength($trimmedName, 45, 'The range name cannot exceed 45 characters.'); + + if ($this->picture !== null) { + Assert::notNull($this->pictureMetadata->alt, 'Picture alt is required when picture is provided.'); + Assert::stringNotEmpty(trim($this->pictureMetadata->alt), 'Picture alt cannot be empty when picture is provided.'); + Assert::notNull($this->pictureMetadata->title, 'Picture title is required when picture is provided.'); + Assert::stringNotEmpty(trim($this->pictureMetadata->title), 'Picture title cannot be empty when picture is provided.'); + } + } +} diff --git a/app/Actions/Settings/UpdateSettings.php b/app/Actions/Settings/UpdateSettings.php new file mode 100644 index 00000000..219b1799 --- /dev/null +++ b/app/Actions/Settings/UpdateSettings.php @@ -0,0 +1,39 @@ + + */ +final class UpdateSettings implements Action +{ + /** + * @param \App\Actions\Settings\UpdateSettingsInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): Setting + { + Assert::isInstanceOf($input, UpdateSettingsInput::class); + + $setting = Setting::getSingleton(); + $setting->fill([ + 'employee_sites' => array_values( + array_map( + static fn (ShopperSiteCode $siteCode): string => $siteCode->value, + $input->employeeSites + ) + ), + ]); + $setting->saveOrFail(); + + return $setting; + } +} diff --git a/app/Actions/Settings/UpdateSettingsInput.php b/app/Actions/Settings/UpdateSettingsInput.php new file mode 100644 index 00000000..28b113f1 --- /dev/null +++ b/app/Actions/Settings/UpdateSettingsInput.php @@ -0,0 +1,21 @@ + $employeeSites + */ + public function __construct( + public array $employeeSites = [], + ) { + Assert::allIsInstanceOf($this->employeeSites, ShopperSiteCode::class); + } +} diff --git a/app/Actions/Shops/CreateShop.php b/app/Actions/Shops/CreateShop.php new file mode 100644 index 00000000..00f2779a --- /dev/null +++ b/app/Actions/Shops/CreateShop.php @@ -0,0 +1,42 @@ + + */ +final class CreateShop implements Action +{ + /** + * @param \App\Actions\Shops\CreateShopInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): Shop + { + Assert::isInstanceOf($input, CreateShopInput::class); + + $attributes = [ + 'name' => $input->name, + 'address' => $input->address, + 'postcode' => $input->postcode, + 'city' => $input->city, + 'phone' => $input->phone?->value, + 'latitude' => $input->coordinates !== null ? (string) $input->coordinates->latitude : null, + 'longitude' => $input->coordinates !== null ? (string) $input->coordinates->longitude : null, + ]; + + $shop = new Shop(); + $shop->fill($attributes); + $shop->default = $input->default; + $shop->saveOrFail(); + + return $shop; + } +} diff --git a/app/Actions/Shops/CreateShopInput.php b/app/Actions/Shops/CreateShopInput.php new file mode 100644 index 00000000..3adb5556 --- /dev/null +++ b/app/Actions/Shops/CreateShopInput.php @@ -0,0 +1,39 @@ +name); + Assert::stringNotEmpty($trimmedName, 'Shop name cannot be empty.'); + Assert::maxLength($trimmedName, 255, 'Shop name cannot exceed 255 characters.'); + + $trimmedAddress = trim($this->address); + Assert::stringNotEmpty($trimmedAddress, 'Shop address cannot be empty.'); + Assert::maxLength($trimmedAddress, 255, 'Shop address cannot exceed 255 characters.'); + + $trimmedPostcode = trim($this->postcode); + Assert::stringNotEmpty($trimmedPostcode, 'Shop postcode cannot be empty.'); + Assert::maxLength($trimmedPostcode, 255, 'Shop postcode cannot exceed 255 characters.'); + + $trimmedCity = trim($this->city); + Assert::stringNotEmpty($trimmedCity, 'Shop city cannot be empty.'); + Assert::maxLength($trimmedCity, 255, 'Shop city cannot exceed 255 characters.'); + } +} diff --git a/app/Actions/Shops/DeleteShop.php b/app/Actions/Shops/DeleteShop.php new file mode 100644 index 00000000..751a3f18 --- /dev/null +++ b/app/Actions/Shops/DeleteShop.php @@ -0,0 +1,26 @@ + + */ +final class DeleteShop implements Action +{ + /** + * @param \App\Actions\Shops\DeleteShopInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): bool + { + Assert::isInstanceOf($input, DeleteShopInput::class); + + return (bool) $input->shop->deleteOrFail(); + } +} diff --git a/app/Actions/Shops/DeleteShopInput.php b/app/Actions/Shops/DeleteShopInput.php new file mode 100644 index 00000000..43ced6c3 --- /dev/null +++ b/app/Actions/Shops/DeleteShopInput.php @@ -0,0 +1,16 @@ + + */ +final class UpdateShop implements Action +{ + /** + * @param \App\Actions\Shops\UpdateShopInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): Shop + { + Assert::isInstanceOf($input, UpdateShopInput::class); + + $attributes = [ + 'name' => $input->name, + 'address' => $input->address, + 'postcode' => $input->postcode, + 'city' => $input->city, + 'phone' => $input->phone?->value, + 'latitude' => $input->coordinates !== null ? (string) $input->coordinates->latitude : null, + 'longitude' => $input->coordinates !== null ? (string) $input->coordinates->longitude : null, + ]; + + $shop = $input->shop; + $shop->fill($attributes); + $shop->default = $input->default; + $shop->saveOrFail(); + + return $shop; + } +} diff --git a/app/Actions/Shops/UpdateShopInput.php b/app/Actions/Shops/UpdateShopInput.php new file mode 100644 index 00000000..83e932d9 --- /dev/null +++ b/app/Actions/Shops/UpdateShopInput.php @@ -0,0 +1,41 @@ +name); + Assert::stringNotEmpty($trimmedName, 'Shop name cannot be empty.'); + Assert::maxLength($trimmedName, 255, 'Shop name cannot exceed 255 characters.'); + + $trimmedAddress = trim($this->address); + Assert::stringNotEmpty($trimmedAddress, 'Shop address cannot be empty.'); + Assert::maxLength($trimmedAddress, 255, 'Shop address cannot exceed 255 characters.'); + + $trimmedPostcode = trim($this->postcode); + Assert::stringNotEmpty($trimmedPostcode, 'Shop postcode cannot be empty.'); + Assert::maxLength($trimmedPostcode, 255, 'Shop postcode cannot exceed 255 characters.'); + + $trimmedCity = trim($this->city); + Assert::stringNotEmpty($trimmedCity, 'Shop city cannot be empty.'); + Assert::maxLength($trimmedCity, 255, 'Shop city cannot exceed 255 characters.'); + } +} diff --git a/app/Actions/Shops/UpdateShopPickupExceptions.php b/app/Actions/Shops/UpdateShopPickupExceptions.php new file mode 100644 index 00000000..40828e28 --- /dev/null +++ b/app/Actions/Shops/UpdateShopPickupExceptions.php @@ -0,0 +1,28 @@ + + */ +final class UpdateShopPickupExceptions implements Action +{ + /** + * @param \App\Actions\Shops\UpdateShopPickupExceptionsInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): bool + { + Assert::isInstanceOf($input, UpdateShopPickupExceptionsInput::class); + + $input->shop->pickupExceptions()->sync($input->syncData); + + return true; + } +} diff --git a/app/Actions/Shops/UpdateShopPickupExceptionsInput.php b/app/Actions/Shops/UpdateShopPickupExceptionsInput.php new file mode 100644 index 00000000..2a48b2d9 --- /dev/null +++ b/app/Actions/Shops/UpdateShopPickupExceptionsInput.php @@ -0,0 +1,45 @@ + $syncData + */ + public function __construct( + public Shop $shop, + public array $syncData, + ) { + foreach ($this->syncData as $item) { + Assert::isArray($item, 'Each sync item must be an array.'); + Assert::keyExists($item, 'replacement_date', 'Sync item must contain replacement_date key.'); + Assert::keyExists($item, 'order_deadline_at', 'Sync item must contain order_deadline_at key.'); + Assert::nullOrString($item['replacement_date'], 'replacement_date must be a string or null.'); + Assert::nullOrString($item['order_deadline_at'], 'order_deadline_at must be a string or null.'); + + if ($item['order_deadline_at'] !== null) { + Assert::notNull( + $item['replacement_date'], + 'A replacement date is required when an order deadline is set.' + ); + } + + if ($item['replacement_date'] !== null && $item['order_deadline_at'] !== null) { + $replacementDate = new \DateTimeImmutable($item['replacement_date']); + $orderDeadlineAt = new \DateTimeImmutable($item['order_deadline_at']); + + Assert::true( + $orderDeadlineAt < $replacementDate, + 'Order deadline must be strictly before the replacement date.' + ); + } + } + } +} diff --git a/app/Actions/Slides/CreateSlide.php b/app/Actions/Slides/CreateSlide.php new file mode 100644 index 00000000..f6bdf4a7 --- /dev/null +++ b/app/Actions/Slides/CreateSlide.php @@ -0,0 +1,49 @@ + + */ +final class CreateSlide implements Action +{ + /** + * @param \App\Actions\Slides\CreateSlideInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): Slide + { + Assert::isInstanceOf($input, CreateSlideInput::class); + + $attributes = [ + 'title' => $input->title, + 'text' => $input->text, + 'picture_alt' => $input->pictureAlt, + 'picture_title' => $input->pictureTitle, + 'link' => $input->link, + 'link_label' => $input->linkLabel, + 'link_new_tab' => $input->linkNewTab, + 'connected' => $input->connected, + 'date_start' => $input->period->start !== null ? Carbon::instance($input->period->start) : null, + 'date_end' => $input->period->end !== null ? Carbon::instance($input->period->end) : null, + ]; + + if ($input->picture !== null) { + $attributes['picture'] = $input->picture; + } + + $slide = new Slide(); + $slide->fill($attributes); + $slide->saveOrFail(); + + return $slide; + } +} diff --git a/app/Actions/Slides/CreateSlideInput.php b/app/Actions/Slides/CreateSlideInput.php new file mode 100644 index 00000000..a0232444 --- /dev/null +++ b/app/Actions/Slides/CreateSlideInput.php @@ -0,0 +1,50 @@ +title)); + Assert::maxLength($this->title, 75); + + Assert::true( + $this->picture !== null || ($this->text !== null && trim($this->text) !== ''), + 'A slide must have either a picture or text.' + ); + + if ($this->pictureAlt !== null) { + Assert::maxLength($this->pictureAlt, 75); + } + + if ($this->pictureTitle !== null) { + Assert::maxLength($this->pictureTitle, 75); + } + + if ($this->link !== null) { + Assert::maxLength($this->link, 255); + } + + if ($this->linkLabel !== null) { + Assert::maxLength($this->linkLabel, 255); + } + } +} diff --git a/app/Actions/Slides/DeleteSlide.php b/app/Actions/Slides/DeleteSlide.php new file mode 100644 index 00000000..c18847bf --- /dev/null +++ b/app/Actions/Slides/DeleteSlide.php @@ -0,0 +1,26 @@ + + */ +final class DeleteSlide implements Action +{ + /** + * @param \App\Actions\Slides\DeleteSlideInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): bool + { + Assert::isInstanceOf($input, DeleteSlideInput::class); + + return (bool) $input->slide->deleteOrFail(); + } +} diff --git a/app/Actions/Slides/DeleteSlideInput.php b/app/Actions/Slides/DeleteSlideInput.php new file mode 100644 index 00000000..fc57ab1d --- /dev/null +++ b/app/Actions/Slides/DeleteSlideInput.php @@ -0,0 +1,16 @@ + + */ +final class UpdateSlide implements Action +{ + /** + * @param \App\Actions\Slides\UpdateSlideInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): Slide + { + Assert::isInstanceOf($input, UpdateSlideInput::class); + + $attributes = [ + 'title' => $input->title, + 'text' => $input->text, + 'picture_alt' => $input->pictureAlt, + 'picture_title' => $input->pictureTitle, + 'link' => $input->link, + 'link_label' => $input->linkLabel, + 'link_new_tab' => $input->linkNewTab, + 'connected' => $input->connected, + 'date_start' => $input->period->start !== null ? Carbon::instance($input->period->start) : null, + 'date_end' => $input->period->end !== null ? Carbon::instance($input->period->end) : null, + ]; + + if ($input->picture !== null) { + $attributes['picture'] = $input->picture; + } + + $slide = $input->slide; + $slide->fill($attributes); + $slide->saveOrFail(); + + return $slide; + } +} diff --git a/app/Actions/Slides/UpdateSlideInput.php b/app/Actions/Slides/UpdateSlideInput.php new file mode 100644 index 00000000..5cf8845d --- /dev/null +++ b/app/Actions/Slides/UpdateSlideInput.php @@ -0,0 +1,52 @@ +title)); + Assert::maxLength($this->title, 75); + + Assert::true( + $this->picture !== null || ! empty($this->slide->picture) || ($this->text !== null && trim($this->text) !== ''), + 'A slide must have either a picture or text.' + ); + + if ($this->pictureAlt !== null) { + Assert::maxLength($this->pictureAlt, 75); + } + + if ($this->pictureTitle !== null) { + Assert::maxLength($this->pictureTitle, 75); + } + + if ($this->link !== null) { + Assert::maxLength($this->link, 255); + } + + if ($this->linkLabel !== null) { + Assert::maxLength($this->linkLabel, 255); + } + } +} diff --git a/app/Actions/Tags/CreateTag.php b/app/Actions/Tags/CreateTag.php new file mode 100644 index 00000000..89152292 --- /dev/null +++ b/app/Actions/Tags/CreateTag.php @@ -0,0 +1,34 @@ + + */ +final class CreateTag implements Action +{ + /** + * @param \App\Actions\Tags\CreateTagInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): Tag + { + Assert::isInstanceOf($input, CreateTagInput::class); + + $tag = new Tag(); + $tag->fill([ + 'label' => $input->label, + 'status' => $input->status, + ]); + $tag->saveOrFail(); + + return $tag; + } +} diff --git a/app/Actions/Tags/CreateTagInput.php b/app/Actions/Tags/CreateTagInput.php new file mode 100644 index 00000000..a333f1a1 --- /dev/null +++ b/app/Actions/Tags/CreateTagInput.php @@ -0,0 +1,19 @@ +label), 'Tag label cannot be empty.'); + Assert::maxLength($this->label, 255); + } +} diff --git a/app/Actions/Tags/DeleteTag.php b/app/Actions/Tags/DeleteTag.php new file mode 100644 index 00000000..33b80771 --- /dev/null +++ b/app/Actions/Tags/DeleteTag.php @@ -0,0 +1,26 @@ + + */ +final class DeleteTag implements Action +{ + /** + * @param \App\Actions\Tags\DeleteTagInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): void + { + Assert::isInstanceOf($input, DeleteTagInput::class); + + $input->tag->deleteOrFail(); + } +} diff --git a/app/Actions/Tags/DeleteTagInput.php b/app/Actions/Tags/DeleteTagInput.php new file mode 100644 index 00000000..500d8083 --- /dev/null +++ b/app/Actions/Tags/DeleteTagInput.php @@ -0,0 +1,16 @@ + + */ +final class UpdateTag implements Action +{ + /** + * @param \App\Actions\Tags\UpdateTagInput $input + */ + #[\Override] + public function __invoke(ActionInput $input): Tag + { + Assert::isInstanceOf($input, UpdateTagInput::class); + + $tag = $input->tag; + $tag->fill([ + 'label' => $input->label, + 'status' => $input->status, + ]); + $tag->saveOrFail(); + + return $tag; + } +} diff --git a/app/Actions/Tags/UpdateTagInput.php b/app/Actions/Tags/UpdateTagInput.php new file mode 100644 index 00000000..e5cc0786 --- /dev/null +++ b/app/Actions/Tags/UpdateTagInput.php @@ -0,0 +1,21 @@ +label), 'Tag label cannot be empty.'); + Assert::maxLength($this->label, 255); + } +} diff --git a/app/Auth/CrmUserProvider.php b/app/Auth/CrmUserProvider.php new file mode 100644 index 00000000..85df1ec6 --- /dev/null +++ b/app/Auth/CrmUserProvider.php @@ -0,0 +1,150 @@ + $model + */ + public function __construct( + Hasher $hasher, + string $model, + private readonly CrmService $crmService + ) { + parent::__construct($hasher, $model); + } + + /** + * The model to use, specified in auth config guard. + * + * @var class-string<\App\Models\Customer> + */ + private $usedModel = Customer::class; + + /** + * Retrieve a user by the given credentials. + * + * @param array $credentials + * + * @throws \RuntimeException If connection to server fails. + * @throws \LDC\LDCCRM\Exceptions\CrmException On CRM call error. + * @throws \Exception On CRM call error. + */ + #[\Override] + public function retrieveByCredentials(array $credentials): ?Authenticatable + { + $model = parent::retrieveByCredentials($credentials); + $result = $this->crmService->getCustomerFromEmail(Arr::string($credentials, 'email')); + + if ($result instanceof CrmServiceException) { + report($result); + throw ValidationException::withMessages([ + \trans('An error has occurred. Please try again later'), + ]); + } + + $this->crmCustomer = $result; + + if ($this->crmCustomer instanceof CrmCustomer && $model === null) { + $model = $this->createLocalCustomer($this->crmCustomer); + } + + return $this->crmCustomer !== null ? $model : null; + } + + /** + * Validate a user against the given credentials. + * + * @param array $credentials + * + * @throws \RuntimeException If model provided is not a Customer or connection to server fails. + * @throws \LDC\LDCCRM\Exceptions\CrmException On CRM call error. + * @throws \Exception On CRM call error. + */ + #[\Override] + public function validateCredentials(Authenticatable $model, array $credentials): bool + { + if ($model::class !== $this->usedModel) { + throw new UnexpectedValueException("Cannot authenticate any thing else than '{$this->usedModel}'"); + } + + if (! in_array(MustVerifyEmail::class, \class_implements($model))) { + throw new UnexpectedValueException("Model '{$this->usedModel}' should implement 'MustVerifyEmail'"); + } + /** @var \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Contracts\Auth\MustVerifyEmail $model */ + $requestEmail = Arr::string($credentials, 'email'); + $requestPassword = Arr::string($credentials, 'password'); + + try { + $this->crmService->login( + $requestEmail, + $requestPassword + ); + + return true; + } catch (CrmCustomerNotActivatedException) { + $model->sendEmailVerificationNotification(); + + return true; + } catch (CrmAuthenticationFailedException) { + return false; + } catch (CrmServiceException $e) { + report($e); + throw ValidationException::withMessages([ + trans('An error has occurred. Please try again later'), + ]); + } + } + + /** @param array $credentials */ + #[\Override] + public function rehashPasswordIfRequired(Authenticatable $user, #[\SensitiveParameter] array $credentials, bool $force = false): void + { + // No hashing. + } + + private function createLocalCustomer(CrmCustomer $crmCustomer): Model & Authenticatable + { + $email = $crmCustomer->email ? + new Email($crmCustomer->email) : + throw new UnexpectedValueException('Email is required ti create a customer'); + + $hashcode = $crmCustomer->hashcode ? + $crmCustomer->hashcode : + throw new UnexpectedValueException('Hashcode is required to create a customer'); + + /** @var \App\Models\Customer&\Illuminate\Contracts\Auth\Authenticatable $model */ + $model = $this->usedModel::query() + ->where('email', $crmCustomer->email) + ->firstOrNew(); + + $model->email = $email; + $model->hashcode = CrmHashcode::fromString($hashcode); + $model->saveOrFail(); + + return $model; + } +} diff --git a/app/Casts/CodeCast.php b/app/Casts/CodeCast.php new file mode 100644 index 00000000..d5a52e1c --- /dev/null +++ b/app/Casts/CodeCast.php @@ -0,0 +1,34 @@ + */ +class CodeCast implements CastsAttributes +{ + /** @param array $attributes */ + public function get(Model $model, string $key, mixed $value, array $attributes): Code + { + if ($value === null || ! is_string($value)) { + throw new \UnexpectedValueException('Code must be a string.'); + } + + return new Code($value); + } + + /** @param array $attributes */ + public function set(Model $model, string $key, mixed $value, array $attributes): string + { + + if (! $value instanceof Code) { + throw new \UnexpectedValueException('The given value is not an instance of Code.'); + } + + return $value->value; + } +} diff --git a/app/Casts/CrmHashcodeCast.php b/app/Casts/CrmHashcodeCast.php new file mode 100644 index 00000000..91d8beeb --- /dev/null +++ b/app/Casts/CrmHashcodeCast.php @@ -0,0 +1,44 @@ + */ +class CrmHashcodeCast implements CastsAttributes +{ + /** @param array $attributes */ + public function get(Model $model, string $key, $value, array $attributes): CrmHashcode + { + if ($value === null || ! is_string($value)) { + throw new \UnexpectedValueException('CrmHashcode must be a string.'); + } + + $uuid = Uuid::fromString($value); + + return new CrmHashcode($uuid); + } + + /** @param array $attributes */ + public function set(Model $model, string $key, $value, array $attributes): string + { + if ($value === null) { + throw new \InvalidArgumentException('CrmHashcode cannot be null.'); + } + + if (is_string($value)) { + $value = new CrmHashcode(Uuid::fromString($value)); + } + + if (! ($value instanceof CrmHashcode)) { + throw new \InvalidArgumentException('The given value is not an instance of CrmHashcode.'); + } + + return $value->value; + } +} diff --git a/app/Casts/DeliveryAddressCast.php b/app/Casts/DeliveryAddressCast.php new file mode 100644 index 00000000..f456872e --- /dev/null +++ b/app/Casts/DeliveryAddressCast.php @@ -0,0 +1,61 @@ + */ +class DeliveryAddressCast implements CastsAttributes +{ + private const string DEFAULT_STRING = 'Non renseigné'; + + private const string DEFAULT_POSTCODE = '00000'; + + /** @param array $attributes */ + public function get(Model $model, string $key, mixed $value, array $attributes): DeliveryAddress + { + if ($value === null) { + return new DeliveryAddress( + name: self::DEFAULT_STRING, + address: self::DEFAULT_STRING, + postcode: self::DEFAULT_POSTCODE, + city: self::DEFAULT_STRING, + ); + } + + if (! is_string($value)) { + throw new \InvalidArgumentException('The value must be a string.'); + } + + $data = Arr::wrap(json_decode($value, true)); + + return new DeliveryAddress( + name: Arr::string($data, 'name', self::DEFAULT_STRING), + address: Arr::string($data, 'address', self::DEFAULT_STRING), + postcode: Arr::string($data, 'postcode', self::DEFAULT_POSTCODE), + city: Arr::string($data, 'city', self::DEFAULT_STRING), + phone: ! empty(Arr::get($data, 'phone')) ? + Arr::string($data, 'phone') : null, + latitude: ! empty(Arr::get($data, 'latitude')) ? + Arr::string($data, 'latitude') : null, + longitude: ! empty(Arr::get($data, 'longitude')) ? + Arr::string($data, 'longitude') : null, + ); + } + + /** @param array $attributes */ + public function set(Model $model, string $key, mixed $value, array $attributes): string + { + if (! $value instanceof DeliveryAddress) { + throw new \InvalidArgumentException('The value must be an instance of DeliveryAddress.'); + } + + return json_encode($value->toArray(), JSON_UNESCAPED_UNICODE) ?: + throw new \InvalidArgumentException('Cannot encode DeliveryAddress to JSON.'); + } +} diff --git a/app/Casts/DiscountValueCast.php b/app/Casts/DiscountValueCast.php new file mode 100644 index 00000000..6f6d144c --- /dev/null +++ b/app/Casts/DiscountValueCast.php @@ -0,0 +1,65 @@ + */ +class DiscountValueCast implements CastsAttributes +{ + /** @param array $attributes */ + public function get(Model $model, string $key, mixed $value, array $attributes): DiscountValue + { + $typeRaw = $attributes['type'] ?? null; + + if ($typeRaw === null || (! is_int($typeRaw) && ! is_string($typeRaw))) { + throw new \UnexpectedValueException('The discount type attribute is missing to cast the value.'); + } + + if ($value === null || (! is_int($value) && ! (is_string($value) && ctype_digit($value)))) { + throw new \UnexpectedValueException('The discount value must be an integer or a numeric string.'); + } + + $type = DiscountType::tryFrom((int) $typeRaw); + + if ($type === null) { + throw new \UnexpectedValueException("Unknown discount type raw value: {$typeRaw}"); + } + + // Instanciation selon le type + if ($type === DiscountType::PERCENT) { + return DiscountValue::fromPercentage(intval($value)); + } + + return DiscountValue::fromAmount( + new Money($value, resolve(Currency::class)) + ); + } + + /** @param array $attributes */ + public function set(Model $model, string $key, mixed $value, array $attributes): int + { + if ($value === null) { + throw new \InvalidArgumentException('The value cannot be null.'); + } + + if (! ($value instanceof DiscountValue)) { + throw new \InvalidArgumentException('The value must be an instance of DiscountValue.'); + } + + $discountValue = $value->value(); + + if ($discountValue instanceof Money) { + return (int) $discountValue->getAmount(); + } + + return $discountValue; + } +} diff --git a/app/Casts/EmailCast.php b/app/Casts/EmailCast.php new file mode 100644 index 00000000..9cfdcc93 --- /dev/null +++ b/app/Casts/EmailCast.php @@ -0,0 +1,37 @@ + */ +class EmailCast implements CastsAttributes +{ + /** @param array $attributes */ + public function get(Model $model, string $key, $value, array $attributes): Email + { + if ($value === null || ! is_string($value)) { + throw new \UnexpectedValueException('Email must be a string.'); + } + + return new Email($value); + } + + /** @param array $attributes */ + public function set(Model $model, string $key, $value, array $attributes): string + { + if ($value === null) { + throw new \InvalidArgumentException('Email cannot be null.'); + } + + if (! ($value instanceof Email)) { + throw new \InvalidArgumentException('The given value is not an instance of Email.'); + } + + return $value->value; + } +} diff --git a/app/Casts/EmployeeSitesCast.php b/app/Casts/EmployeeSitesCast.php new file mode 100644 index 00000000..f9e139e6 --- /dev/null +++ b/app/Casts/EmployeeSitesCast.php @@ -0,0 +1,81 @@ +, array|string|null> + */ +class EmployeeSitesCast implements CastsAttributes +{ + /** + * Cast the given value. + * + * @param array $attributes + * @return string[] + */ + public function get(Model $model, string $key, mixed $value, array $attributes) + { + if ($value === null || $value === '') { + return []; + } + + if (is_string($value)) { + $decoded = json_decode($value, true); + $value = is_array($decoded) ? $decoded : []; + } + + if (! is_array($value)) { + return []; + } + + $sites = []; + foreach ($value as $item) { + if (is_string($item)) { + $sites[] = $item; + } elseif (is_scalar($item) || $item instanceof \Stringable) { + $sites[] = (string) $item; + } + } + + return $sites; + } + + /** + * Prepare the given value for storage. + * + * @param array $attributes + */ + public function set(Model $model, string $key, mixed $value, array $attributes): string + { + if ($value === null) { + return (string) json_encode([]); + } + + if (is_string($value)) { + $decoded = json_decode($value, true); + $value = is_array($decoded) ? $decoded : [$value]; + } + + if (! is_array($value)) { + throw new \UnexpectedValueException('Employee sites must be an array, string or null.'); + } + + $sites = []; + foreach ($value as $item) { + if (is_string($item)) { + $sites[] = $item; + } elseif (is_scalar($item) || $item instanceof \Stringable) { + $sites[] = (string) $item; + } else { + throw new \UnexpectedValueException('Each employee site must be convertable to string.'); + } + } + + return (string) json_encode($sites); + } +} diff --git a/app/Casts/MatriculeCast.php b/app/Casts/MatriculeCast.php new file mode 100644 index 00000000..fc241280 --- /dev/null +++ b/app/Casts/MatriculeCast.php @@ -0,0 +1,33 @@ + */ +class MatriculeCast implements CastsAttributes +{ + /** @param array $attributes */ + public function get(Model $model, string $key, mixed $value, array $attributes): Matricule + { + if ($value === null || ! is_string($value)) { + throw new \UnexpectedValueException('Matricule must be a string.'); + } + + return new Matricule($value); + } + + /** @param array $attributes */ + public function set(Model $model, string $key, mixed $value, array $attributes): string + { + if (! $value instanceof Matricule) { + throw new \UnexpectedValueException('The given value is not an instance of Matricule.'); + } + + return $value->value; + } +} diff --git a/app/Casts/MoneyCast.php b/app/Casts/MoneyCast.php new file mode 100644 index 00000000..41feb33c --- /dev/null +++ b/app/Casts/MoneyCast.php @@ -0,0 +1,45 @@ + */ +class MoneyCast implements CastsAttributes +{ + /** @param array $attributes */ + public function get(Model $model, string $key, mixed $value, array $attributes): Money + { + $currency = $this->getCurrency(); + + if (! is_numeric($value)) { + throw new \InvalidArgumentException('The given value is not numeric.'); + } + + if (! is_string($value) && ! is_int($value)) { + throw new \InvalidArgumentException('The given value must be a string or integer.'); + } + + return new Money($value, $currency); + } + + /** @param array $attributes */ + public function set(Model $model, string $key, mixed $value, array $attributes): string + { + if ($value instanceof Money) { + return $value->getAmount(); + } + + throw new \InvalidArgumentException('The given value is not an instance of Money.'); + } + + protected function getCurrency(): Currency + { + return resolve(Currency::class); + } +} diff --git a/app/Casts/NutritionalValuesCast.php b/app/Casts/NutritionalValuesCast.php new file mode 100644 index 00000000..51d93b2f --- /dev/null +++ b/app/Casts/NutritionalValuesCast.php @@ -0,0 +1,88 @@ + */ +class NutritionalValuesCast implements CastsAttributes +{ + /** @param array $attributes */ + public function get(Model $model, string $key, mixed $value, array $attributes): NutritionalValues + { + return new NutritionalValues( + refWeightG: $this->getFloatOrNull($attributes, 'nv_ref_weight_g'), + kj: $this->getFloatOrNull($attributes, 'nv_kj'), + kcal: $this->getFloatOrNull($attributes, 'nv_kcal'), + fatG: $this->getFloatOrNull($attributes, 'nv_fat_g'), + satFatG: $this->getFloatOrNull($attributes, 'nv_sat_fat_g'), + carbG: $this->getFloatOrNull($attributes, 'nv_carb_g'), + sugarG: $this->getFloatOrNull($attributes, 'nv_sugar_g'), + fiberG: $this->getFloatOrNull($attributes, 'nv_fiber_g'), + proteinG: $this->getFloatOrNull($attributes, 'nv_protein_g'), + saltG: $this->getFloatOrNull($attributes, 'nv_salt_g'), + servingSizeG: $this->getFloatOrNull($attributes, 'nv_serving_size_g'), + servingKj: $this->getFloatOrNull($attributes, 'nv_serving_kj'), + servingKcal: $this->getFloatOrNull($attributes, 'nv_serving_kcal'), + servingFatG: $this->getFloatOrNull($attributes, 'nv_serving_fat_g'), + servingSatFatG: $this->getFloatOrNull($attributes, 'nv_serving_sat_fat_g'), + servingCarbG: $this->getFloatOrNull($attributes, 'nv_serving_carb_g'), + servingSugarG: $this->getFloatOrNull($attributes, 'nv_serving_sugar_g'), + servingFiberG: $this->getFloatOrNull($attributes, 'nv_serving_fiber_g'), + servingProteinG: $this->getFloatOrNull($attributes, 'nv_serving_protein_g'), + servingSaltG: $this->getFloatOrNull($attributes, 'nv_serving_salt_g'), + dailyEnergy: $this->getFloatOrNull($attributes, 'nv_daily_energy'), + dailyFat: $this->getFloatOrNull($attributes, 'nv_daily_fat'), + dailySatFat: $this->getFloatOrNull($attributes, 'nv_daily_sat_fat'), + dailyCarb: $this->getFloatOrNull($attributes, 'nv_daily_carb'), + dailySugar: $this->getFloatOrNull($attributes, 'nv_daily_sugar'), + dailyFiber: $this->getFloatOrNull($attributes, 'nv_daily_fiber'), + dailyProtein: $this->getFloatOrNull($attributes, 'nv_daily_protein'), + dailySalt: $this->getFloatOrNull($attributes, 'nv_daily_salt'), + ); + } + + /** + * @param array $attributes + * @return array + */ + public function set(Model $model, string $key, mixed $value, array $attributes): array + { + if ($value === null) { + return new NutritionalValues()->toArray(); + } + + if (! $value instanceof NutritionalValues) { + throw new \InvalidArgumentException('The given value is not a NutritionalValues instance.'); + } + + return $value->toArray(); + } + + /** + * @param array $attributes + * + * @throws \InvalidArgumentException + */ + private function getFloatOrNull(array $attributes, string $key): ?float + { + $value = Arr::get($attributes, $key); + + if ((is_string($value) && ctype_digit($value)) || is_float($value)) { + return (float) $value; + } + + throw_if( + $value !== null, + \InvalidArgumentException::class, + "Expected `{$key}` to be numeric of null" + ); + + return null; + } +} diff --git a/app/Casts/OrderEmployeeCast.php b/app/Casts/OrderEmployeeCast.php new file mode 100644 index 00000000..8ded1fb5 --- /dev/null +++ b/app/Casts/OrderEmployeeCast.php @@ -0,0 +1,62 @@ + */ +class OrderEmployeeCast implements CastsAttributes +{ + /** @param array $attributes */ + public function get(Model $model, string $key, mixed $value, array $attributes): ?OrderEmployee + { + if (is_null($value)) { + return null; + } + + if (! is_string($value)) { + throw new \InvalidArgumentException('The value must be a string.'); + } + + $data = Arr::wrap(json_decode($value, true)); + + return new OrderEmployee( + matricule: new Matricule(Arr::string($data, 'matricule')), + firstname: Arr::string($data, 'firstname'), + lastname: Arr::string($data, 'lastname'), + facility: new ShopperEstablishmentCode(Arr::string($data, 'facility')), + site: new ShopperSiteCode(Arr::string($data, 'site')), + service: new ShopperServiceCode(Arr::string($data, 'service')), + ); + } + + /** @param array $attributes */ + public function set(Model $model, string $key, mixed $value, array $attributes): ?string + { + if ($value === null) { + return null; + } + + if (! $value instanceof OrderEmployee) { + throw new \InvalidArgumentException('The given value is not an instance of OrderEmployee.'); + } + + return json_encode([ + 'matricule' => $value->matricule->value, + 'firstname' => $value->firstname, + 'lastname' => $value->lastname, + 'facility' => $value->facility->value, + 'site' => $value->site->value, + 'service' => $value->service->value, + ], JSON_THROW_ON_ERROR); + } +} diff --git a/app/Casts/OrderLineProductCast.php b/app/Casts/OrderLineProductCast.php new file mode 100644 index 00000000..916c5e2f --- /dev/null +++ b/app/Casts/OrderLineProductCast.php @@ -0,0 +1,105 @@ + + */ +class OrderLineProductCast implements CastsAttributes +{ + /** @param array $attributes */ + public function get(Model $model, string $key, mixed $value, array $attributes): OrderLineProduct + { + if (is_null($value)) { + throw new \InvalidArgumentException('The value cannot be null.'); + } + + if (! is_string($value)) { + throw new \InvalidArgumentException('The value must be a string.'); + } + + $data = Arr::wrap(json_decode($value, true)); + + $taxRate = Arr::get($data, 'tax_rate'); + $taxRate = is_numeric($taxRate) ? (float) $taxRate : null; + + if (is_null($taxRate)) { + throw new \InvalidArgumentException('The tax rate cannot be null.'); + } + + return new OrderLineProduct( + incoId: new IncoId(Arr::integer($data, 'inco_id')), + originalId: new ProductId(Uuid::fromString( + SymfonyUuid::fromString(Arr::string($data, 'original_id'))->toRfc4122() + )), + name: Arr::string($data, 'name'), + weight: new ProductWeight( + value: Arr::integer($data, 'weight'), + isVariable: Arr::boolean($data, 'weight_variable'), + ), + brand: ProductBrand::from(Arr::string($data, 'brand')), + orderUnit: OrderUnit::from(Arr::string($data, 'order_unit')), + price: new MoneyCast()->get($model, 'price', Arr::get($data, 'price'), []), + discountedPrice: new MoneyCast()->get($model, 'discounted_price', Arr::get($data, 'discounted_price'), []), + priceKgTtc: new MoneyCast()->get($model, 'price_kg_ttc', Arr::get($data, 'price_kg_ttc'), []), + taxRate: TaxRate::fromPercent($taxRate), + picture: is_string($picture = Arr::get($data, 'picture')) ? $picture : null, + ); + } + + /** @param array $attributes */ + public function set(Model $model, string $key, mixed $value, array $attributes): string + { + + if (! ($value instanceof OrderLineProduct)) { + throw new \InvalidArgumentException('The given value is not an instance of OrderLineProduct.'); + } + + /** @var OrderLineProduct $value */ + + return json_encode([ + 'inco_id' => $value->incoId->value, + 'original_id' => $value->originalId->value, + 'name' => $value->name, + 'weight' => $value->weight->value, + 'weight_variable' => $value->weight->isVariable, + 'brand' => $value->brand->value, + 'order_unit' => $value->orderUnit->value, + 'price' => new MoneyCast()->set( + $model, + 'price', + $value->price, + [] + ), + 'discounted_price' => new MoneyCast()->set( + $model, + 'discounted_price', + $value->discountedPrice, + [] + ), + 'price_kg_ttc' => new MoneyCast()->set( + $model, + 'price_kg_ttc', + $value->priceKgTtc, + [] + ), + 'tax_rate' => $value->taxRate->percent(), + 'picture' => $value->picture, + ], \JSON_THROW_ON_ERROR | \JSON_UNESCAPED_SLASHES); + } +} diff --git a/app/Casts/OrderReferenceCast.php b/app/Casts/OrderReferenceCast.php new file mode 100644 index 00000000..563ed2a0 --- /dev/null +++ b/app/Casts/OrderReferenceCast.php @@ -0,0 +1,34 @@ + + */ +class OrderReferenceCast implements CastsAttributes +{ + /** @param array $attributes */ + public function get($model, string $key, $value, array $attributes): OrderReference + { + if ($value === null || ! is_string($value)) { + throw new \UnexpectedValueException('OrderReference cannot be null.'); + } + + return OrderReference::fromString($value); + } + + /** @param array $attributes */ + public function set($model, string $key, $value, array $attributes): string + { + if (! $value instanceof OrderReference) { + throw new \UnexpectedValueException('The given value is not an instance of OrderReference.'); + } + + return (string) $value; + } +} diff --git a/app/Casts/ShopperEstablishmentCodeCast.php b/app/Casts/ShopperEstablishmentCodeCast.php new file mode 100644 index 00000000..2ebb77b8 --- /dev/null +++ b/app/Casts/ShopperEstablishmentCodeCast.php @@ -0,0 +1,37 @@ + */ +class ShopperEstablishmentCodeCast implements CastsAttributes +{ + /** @param array $attributes */ + public function get(Model $model, string $key, mixed $value, array $attributes): ShopperEstablishmentCode + { + if ($value === null || ! is_string($value)) { + throw new \UnexpectedValueException('ShopperEstablishmentCode must be a string.'); + } + + return new ShopperEstablishmentCode($value); + } + + /** @param array $attributes */ + public function set(Model $model, string $key, mixed $value, array $attributes): string + { + if (is_string($value)) { + $value = new ShopperEstablishmentCode($value); + } + + if (! $value instanceof ShopperEstablishmentCode) { + throw new \UnexpectedValueException('The given value is not an instance of ShopperEstablishmentCode.'); + } + + return $value->value; + } +} diff --git a/app/Casts/ShopperServiceCodeCast.php b/app/Casts/ShopperServiceCodeCast.php new file mode 100644 index 00000000..41aa91f2 --- /dev/null +++ b/app/Casts/ShopperServiceCodeCast.php @@ -0,0 +1,37 @@ + */ +class ShopperServiceCodeCast implements CastsAttributes +{ + /** @param array $attributes */ + public function get(Model $model, string $key, mixed $value, array $attributes): ShopperServiceCode + { + if ($value === null || ! is_string($value)) { + throw new \UnexpectedValueException('ShopperServiceCode must be a string.'); + } + + return new ShopperServiceCode($value); + } + + /** @param array $attributes */ + public function set(Model $model, string $key, mixed $value, array $attributes): string + { + if (is_string($value)) { + $value = new ShopperServiceCode($value); + } + + if (! $value instanceof ShopperServiceCode) { + throw new \UnexpectedValueException('The given value is not an instance of ShopperServiceCode.'); + } + + return $value->value; + } +} diff --git a/app/Casts/ShopperSiteCodeCast.php b/app/Casts/ShopperSiteCodeCast.php new file mode 100644 index 00000000..9dd50137 --- /dev/null +++ b/app/Casts/ShopperSiteCodeCast.php @@ -0,0 +1,37 @@ + */ +class ShopperSiteCodeCast implements CastsAttributes +{ + /** @param array $attributes */ + public function get(Model $model, string $key, mixed $value, array $attributes): ShopperSiteCode + { + if ($value === null || ! is_string($value)) { + throw new \UnexpectedValueException('ShopperSiteCode must be a string.'); + } + + return new ShopperSiteCode($value); + } + + /** @param array $attributes */ + public function set(Model $model, string $key, mixed $value, array $attributes): string + { + if (is_string($value)) { + $value = new ShopperSiteCode($value); + } + + if (! $value instanceof ShopperSiteCode) { + throw new \UnexpectedValueException('The given value is not an instance of ShopperSiteCode.'); + } + + return $value->value; + } +} diff --git a/app/Console/Commands/GetPublicHolidayNextYear.php b/app/Console/Commands/GetPublicHolidayNextYear.php deleted file mode 100644 index 38ed4fd2..00000000 --- a/app/Console/Commands/GetPublicHolidayNextYear.php +++ /dev/null @@ -1,35 +0,0 @@ -argument('year'); - (new GetPublicHolidayForNextYear($year))->handle(); - $this->info("Les jours fériés de l'année " . ($year ?? (now()->year + 1)) . " ont été récupéré."); - } -} diff --git a/app/Console/Commands/MailTest.php b/app/Console/Commands/MailTest.php new file mode 100644 index 00000000..d5cc5554 --- /dev/null +++ b/app/Console/Commands/MailTest.php @@ -0,0 +1,32 @@ +arguments(), [ + 'email' => ['required', 'email:rfc,strict'], + ])->validate(); + + Mail::raw('This is a test mail', function ($message): void { + $message->to($this->argument('email')); + $message->subject('Test mail'); + }); + } +} diff --git a/app/Console/Commands/SyncProductIncosCommand.php b/app/Console/Commands/SyncProductIncosCommand.php new file mode 100644 index 00000000..4216f118 --- /dev/null +++ b/app/Console/Commands/SyncProductIncosCommand.php @@ -0,0 +1,38 @@ +option('queue')) { + $this->info('Dispatching FetchAndUpsertArcadiaProductIncos job to queue...'); + FetchAndUpsertArcadiaProductIncos::dispatch(); + $this->info('Job dispatched.'); + + return self::SUCCESS; + } + + $this->info('Starting synchronous INCO synchronization with Arcadia API...'); + /** @var int $count */ + $count = $executor->execute($action, new ActionInputEmpty()); + $this->info("Successfully synchronized {$count} INCO sheets."); + + return self::SUCCESS; + } +} diff --git a/app/Console/Commands/UpsertPublicHolydaysOnShopsPickupExceptions.php b/app/Console/Commands/UpsertPublicHolydaysOnShopsPickupExceptions.php new file mode 100644 index 00000000..0e5916c6 --- /dev/null +++ b/app/Console/Commands/UpsertPublicHolydaysOnShopsPickupExceptions.php @@ -0,0 +1,36 @@ +argument('year'); + + if (is_numeric($year) === false) { + $this->error('The year must be a number'); + + return; + } + + $this->info('Fetching hollidays upsert shops exceptions using Api'); + dispatch(new UpsertShopsPickupExceptionsUsingApiForYear(intval($year))); + + $this->info('Done'); + } +} diff --git a/app/Console/Commands/UserCreate.php b/app/Console/Commands/UserCreate.php index 752b28cd..c2ea690d 100644 --- a/app/Console/Commands/UserCreate.php +++ b/app/Console/Commands/UserCreate.php @@ -1,39 +1,33 @@ ask('What is the firstname?', 'Equipe'); - $lastname = $this->ask('What is the lastname?', 'Web'); - $email = $this->ask('What is the email?', 'equipe.web@ldc.fr'); - $pwd = $this->secret('What is the password?'); - $role = $this->ask('What is the role? (1 = SuperAdmin, 2 = Admin)', 2); + $firstname = $this->askString('What is the firstname?', 'Equipe'); + $lastname = $this->askString('What is the lastname?', 'Web'); + $email = $this->askEmail('What is the email?', 'equipe.web@ldc.fr'); + $pwd = $this->askPassword('What is the password?'); + $role = $this->askRole(); $user = new User(); $user->firstname = $firstname; @@ -45,5 +39,101 @@ class UserCreate extends Command $user->save(); $this->info('User created.'); + + return self::SUCCESS; + } + + private function askString( + string $wants, + ?string $default + ): string { + $response = $this->ask($wants, $default); + $response = is_string($response) ? $response : ''; + $strlen = mb_strlen(trim($response)); + + if ($strlen >= 3 && $strlen <= 255) { + return $response; + } + + $this->warn('Answer has to be between 3 and 255 chars'); + + return $this->askString($wants, $default); + } + + private function askEmail( + string $wants, + ?string $default + ): string { + $response = $this->ask($wants, $default); + $response = is_string($response) ? $response : ''; + $validator = Validator::make([ + 'email' => $response, + ], [ + 'email' => ['required', 'email:rfc,strict,spoof', 'unique:users,email'], + ]); + + if ($validator->passes()) { + return $response; + } + + $this->warn($validator->messages()->first('email')); + + return $this->askEmail($wants, $default); + } + + private function askPassword( + string $wants + ): string { + $response = $this->secret($wants); + $responseConfirmed = $this->secret("Confirm : {$wants}"); + $response = is_string($response) ? $response : ''; + $responseConfirmed = is_string($responseConfirmed) ? $responseConfirmed : ''; + $validator = Validator::make([ + 'password' => $response, + 'password_confirmation' => $responseConfirmed, + ], [ + 'password' => ['required', 'confirmed', Password::min(8)->letters()->mixedCase()->numbers()->symbols()], + ]); + + if ($validator->passes()) { + return $response; + } + + $this->warn($validator->messages()->first('password')); + + return $this->askPassword($wants); + } + + private function askRole(): UserRole + { + $role = null; + $possibles = collect(UserRole::cases()) + ->map(fn ($role) => $this->roleToString($role)) + ->all(); + + $response = Arr::wrap( + $this->choice( + question: 'What is the role ?', + choices: $possibles, + default: $this->roleToString(UserRole::Admin), + multiple: false + ) + ); + $role = UserRole::tryFrom( + intval(mb_strcut((string) $response[0], 0, 1)) + ); + + if (! is_null($role)) { + return $role; + } + + $this->warn('Need a valid role, try again'); + + return $this->askRole(); + } + + private function roleToString(UserRole $role): string + { + return "{$role->value()} : {$role->label()}"; } } diff --git a/app/Console/Commands/XmlIncoReader.php b/app/Console/Commands/XmlIncoReader.php deleted file mode 100644 index aee08989..00000000 --- a/app/Console/Commands/XmlIncoReader.php +++ /dev/null @@ -1,37 +0,0 @@ -info('Running the Job, this could take some time.'); - $job = new JobsXmlIncoReader(); - $job->console = $this; - $job->handle(); - $this->info('Job completed'); - } -} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php deleted file mode 100644 index b2d71b57..00000000 --- a/app/Console/Kernel.php +++ /dev/null @@ -1,44 +0,0 @@ -job(JobsXmlIncoReader::class)->name('xml-inco-reader')->onOneServer()->dailyAt('15:00'); - $schedule->job(SendReminderMail::class)->onOneServer()->dailyAt('10:00'); - $schedule->job(GetPublicHolidayForNextYear::class)->onOneServer()->yearlyOn(11, 1, '7:30'); - } - - /** - * Register the commands for the application. - * - * @return void - */ - protected function commands() - { - $this->load(__DIR__ . '/Commands'); - - require base_path('routes/console.php'); - } -} diff --git a/app/Contracts/Action.php b/app/Contracts/Action.php new file mode 100644 index 00000000..0d9f1436 --- /dev/null +++ b/app/Contracts/Action.php @@ -0,0 +1,18 @@ + */ +interface CustomerDirectory extends Directory +{ + public function find(UuidInterface $id): ?Customer; + + public function getCustomerByEmail(Email $email): ?Customer; +} diff --git a/app/Contracts/Directories/EmployeeDirectory.php b/app/Contracts/Directories/EmployeeDirectory.php new file mode 100644 index 00000000..aac4182b --- /dev/null +++ b/app/Contracts/Directories/EmployeeDirectory.php @@ -0,0 +1,23 @@ + */ +interface EmployeeDirectory extends Directory +{ + public function find(int $id): ?Employee; + + public function countActiveEmployees(): int; + + public function countActiveRegisteredEmployees(): int; + + public function countActiveEmployeesWithin(CarbonInterface $start, CarbonInterface $end): int; + + public function countActiveRegisteredEmployeesWithin(CarbonInterface $start, CarbonInterface $end): int; +} diff --git a/app/Contracts/Directories/OrderDirectory.php b/app/Contracts/Directories/OrderDirectory.php new file mode 100644 index 00000000..ed8d2c21 --- /dev/null +++ b/app/Contracts/Directories/OrderDirectory.php @@ -0,0 +1,48 @@ + */ +interface OrderDirectory extends Directory +{ + public function find(UuidInterface $id): ?Order; + + /** @return \Illuminate\Pagination\LengthAwarePaginator */ + public function getPaginatedOrdersOf( + Customer $customer, + Pagination $pagination, + bool $orderByDate = false + ): PaginationLengthAwarePaginator; + + public function findOf(Customer $customer, UuidInterface $id): ?Order; + + /** @return Collection*/ + public function getValidatedOrders(CarbonInterface $start, CarbonInterface $end): Collection; + + /** @return Collection */ + public function getOrdersByStatus(OrderStatus $status, CarbonInterface $start, CarbonInterface $end): Collection; + + public function getNbActiveClients(CarbonInterface $start, CarbonInterface $end): int; + + public function getNbCmdWith7DayDelay(CarbonInterface $start, CarbonInterface $end): int; + + public function getNbCmdWith14DayDelay(CarbonInterface $start, CarbonInterface $end): int; + + public function getCaHt(CarbonInterface $start, CarbonInterface $end): float; + + public function getCaTtc(CarbonInterface $start, CarbonInterface $end): float; + + public function getTotalQuantity(CarbonInterface $start, CarbonInterface $end): int; +} diff --git a/app/Contracts/Directory.php b/app/Contracts/Directory.php new file mode 100644 index 00000000..d18e5406 --- /dev/null +++ b/app/Contracts/Directory.php @@ -0,0 +1,15 @@ +|\App\Contracts\Action $executable + * @param TInputAction|TInputQuery $input + * @return TResult + */ + public function execute(Action | Query $executable, ActionInput | QueryInput $input): mixed; +} diff --git a/app/Contracts/Query.php b/app/Contracts/Query.php new file mode 100644 index 00000000..2df738ac --- /dev/null +++ b/app/Contracts/Query.php @@ -0,0 +1,18 @@ + + */ +interface EmployeeRepository extends Repository +{ + public function find(UuidInterface $id): ?Employee; + + public function persist(Employee $employee): void; + + public function delete(Employee $employee): void; + + /** @return array */ + public function getAll(): array; + + public function findByMatriculeAndCode(Matricule $matricule, Code $code): ?Employee; + + public function findByMatricule(Matricule $matricule): ?Employee; + + /** + * @param array|Collection $matricules + * @return array + */ + public function getWhereMatriculeIn(array | Collection $matricules): array; + + /** + * @param array|Collection $matricules + * @return array + */ + public function getWithCustomerWhereMatriculeIn(array | Collection $matricules): array; + + /** + * @param array|Collection $excludedMatricules + * @return array + */ + public function getWithCustomerWhereMatriculeNotIn(array | Collection $excludedMatricules): array; + + public function getMostRecentSyncDate(): ?\DateTimeInterface; +} diff --git a/app/Contracts/Repositories/OrderRepository.php b/app/Contracts/Repositories/OrderRepository.php new file mode 100644 index 00000000..6803ef0a --- /dev/null +++ b/app/Contracts/Repositories/OrderRepository.php @@ -0,0 +1,34 @@ + + */ +interface OrderRepository extends Repository +{ + public function find(UuidInterface $id): ?Order; + + public function persist(Order $order): void; + + public function delete(Order $order): void; + + /** @return array */ + public function getAll(): array; + + /** @return array */ + public function getValidatedOrdersForPickupDay(CarbonInterface $pickupDay): array; + + public function hasValidatedOrderForPickupDay(Matricule $matricule, CarbonInterface $pickupDay): bool; + + /** @return array */ + public function getOrdersWithLinesAndShopForPickupDay(CarbonInterface $pickupDay): array; +} diff --git a/app/Contracts/Repositories/UserRepository.php b/app/Contracts/Repositories/UserRepository.php new file mode 100644 index 00000000..843a46b5 --- /dev/null +++ b/app/Contracts/Repositories/UserRepository.php @@ -0,0 +1,20 @@ + + */ +interface UserRepository extends Repository +{ + public function find(int $id): ?User; + + public function persist(User $user): void; + + public function delete(User $user): void; +} diff --git a/app/Contracts/Repository.php b/app/Contracts/Repository.php new file mode 100644 index 00000000..9ac81658 --- /dev/null +++ b/app/Contracts/Repository.php @@ -0,0 +1,17 @@ +toString()); + } + + public function getCustomerByEmail(Email $email): ?Customer + { + return Customer::where('email', $email->value)->first(); + } +} diff --git a/app/Directories/EloquentEmployeeDirectory.php b/app/Directories/EloquentEmployeeDirectory.php new file mode 100644 index 00000000..89042363 --- /dev/null +++ b/app/Directories/EloquentEmployeeDirectory.php @@ -0,0 +1,53 @@ +where('id', $id) + ->first(); + } + + public function countActiveEmployees(): int + { + return Employee::query() + ->active() + ->count(); + } + + public function countActiveRegisteredEmployees(): int + { + return Employee::query() + ->active() + ->whereHas('customer') + ->count(); + } + + public function countActiveEmployeesWithin(CarbonInterface $start, CarbonInterface $end): int + { + return Employee::query() + ->active() + ->whereDate('created_at', '>=', $start) + ->whereDate('created_at', '<=', $end) + ->count(); + } + + public function countActiveRegisteredEmployeesWithin(CarbonInterface $start, CarbonInterface $end): int + { + return Employee::query() + ->active() + ->whereHas('customer') + ->whereDate('created_at', '>=', $start) + ->whereDate('created_at', '<=', $end) + ->count(); + } +} diff --git a/app/Directories/EloquentOrderDirectory.php b/app/Directories/EloquentOrderDirectory.php new file mode 100644 index 00000000..048f17be --- /dev/null +++ b/app/Directories/EloquentOrderDirectory.php @@ -0,0 +1,185 @@ + */ + public function getPaginatedOrdersOf( + Customer $customer, + Pagination $pagination, + bool $orderByDate = false + ): PaginationLengthAwarePaginator { + $query = $this->orderByQueryFor($customer); + + if ($query === null) { + return new LengthAwarePaginator( + items: [], + total: 0, + perPage: $pagination->pageSize()->value(), + currentPage: $pagination->pageNumber()->value(), + ); + } + + if ($orderByDate) { + $query->orderBy('id', SortDirection::Descending); + } + + return $query->paginate( + perPage: $pagination->pageSize()->value(), + page: $pagination->pageNumber()->value(), + ); + } + + public function find(UuidInterface $id): ?Order + { + return Order::query() + ->where('id', $id->toString()) + ->first(); + } + + public function findOf(Customer $customer, UuidInterface $id): ?Order + { + $query = $this->orderByQueryFor($customer); + if ($query === null) { + return null; + } + + return $query->where('id', $id->toString())->first(); + } + + /** @return \Illuminate\Database\Eloquent\Builder<\App\Models\Order>|null */ + private function orderByQueryFor(Customer $customer): ?Builder + { + /** @var \Domain\Models\ValueObjects\Matricule | null */ + $employeeMatricule = $customer->employee()->value('matricule'); + + if ($employeeMatricule === null) { + return null; + } + + return Order::query() + ->where('employee_matricule', $employeeMatricule->value); + } + + /** + * @return Collection + */ + public function getValidatedOrders(CarbonInterface $start, CarbonInterface $end): Collection + { + return Order::query() + ->whereIn('status', [OrderStatus::VALIDATED->value]) + ->whereCreatedAtBetween($start, $end) + ->get(); + } + + /** + * @return Collection + */ + public function getOrdersByStatus(OrderStatus $status, CarbonInterface $start, CarbonInterface $end): Collection + { + return Order::query() + ->where('status', $status->value) + ->whereCreatedAtBetween($start, $end) + ->get(); + } + + public function getNbActiveClients(CarbonInterface $start, CarbonInterface $end): int + { + $matricules = Order::query() + ->whereCreatedAtBetween($start, $end) + ->get(['employee']) + ->map(fn (Order $order) => $order->employee->matricule->value) + ->filter() + ->unique(); + + if ($matricules->isEmpty()) { + return 0; + } + + return Customer::query() + ->whereHas('employee', function (Builder $query) use ($matricules): void { + $query->whereIn('matricule', $matricules); + })->count(); + } + + public function getNbCmdWith7DayDelay(CarbonInterface $start, CarbonInterface $end): int + { + return Order::query() + ->whereIn('status', [OrderStatus::VALIDATED->value]) + ->whereCreatedAtBetween($start, $end) + ->get() + ->filter(function (Order $order) { + if (is_null($order->pickup_day) || is_null($order->created_at)) { + return false; + } + + return $order->pickup_day->lessThanOrEqualTo($order->created_at->modify('+7 day')); + })->count(); + } + + public function getNbCmdWith14DayDelay(CarbonInterface $start, CarbonInterface $end): int + { + return Order::query() + ->whereIn('status', [OrderStatus::VALIDATED->value]) + ->whereCreatedAtBetween($start, $end) + ->get() + ->filter(function (Order $order) { + if (is_null($order->pickup_day) || is_null($order->created_at)) { + return false; + } + + return Date::create($order->pickup_day)->betweenIncluded( + Date::create($order->created_at->modify('+8 day')), + Date::create($order->created_at->modify('+14 day')) + ); + })->count(); + } + + public function getCaHt(CarbonInterface $start, CarbonInterface $end): float + { + $totalCaHt = OrderLine::query()->whereHas('order', function (Builder $query) use ($start, $end): void { + $query->whereIn('status', [OrderStatus::VALIDATED->value]) + ->whereCreatedAtBetween($start, $end); + })->sum('total_ht'); + + return ((float) (new Money((int) $totalCaHt, resolve(Currency::class)))->getAmount()) / 100; + } + + public function getCaTtc(CarbonInterface $start, CarbonInterface $end): float + { + $totalCaTtc = OrderLine::query()->whereHas('order', function (Builder $query) use ($start, $end): void { + $query->whereIn('status', [OrderStatus::VALIDATED->value]) + ->whereCreatedAtBetween($start, $end); + })->sum('total_ttc'); + + return ((float) (new Money((int) $totalCaTtc, resolve(Currency::class)))->getAmount()) / 100; + } + + public function getTotalQuantity(CarbonInterface $start, CarbonInterface $end): int + { + return (int) OrderLine::query()->whereHas('order', function (Builder $query) use ($start, $end): void { + $query->where('status', OrderStatus::VALIDATED->value) + ->whereCreatedAtBetween($start, $end); + })->sum('quantity'); + } +} diff --git a/app/Dto/ArcadiaIncoDataDto.php b/app/Dto/ArcadiaIncoDataDto.php new file mode 100644 index 00000000..67bee069 --- /dev/null +++ b/app/Dto/ArcadiaIncoDataDto.php @@ -0,0 +1,27 @@ + + */ + public function toArray(): array + { + return [ + 'no_art' => $this->noArt, + 'name' => $this->name, + 'libelle' => $this->libelle, + 'brand' => $this->brand, + 'nutriscore' => $this->nutriscore, + 'servings' => $this->servings, + 'allergens' => $this->allergens, + 'ingredients' => $this->ingredients, + 'preparation' => $this->preparation, + 'energy_kcal' => $this->energyKcal, + 'energy_kj' => $this->energyKj, + 'fat' => $this->fat, + 'sat_fat' => $this->satFat, + 'carbs' => $this->carbs, + 'sugar' => $this->sugar, + 'fiber' => $this->fiber, + 'protein' => $this->protein, + 'salt' => $this->salt, + ]; + } + + #[\Override] + public function jsonSerialize(): mixed + { + return $this->toArray(); + } +} diff --git a/app/Dto/DiscountDto.php b/app/Dto/DiscountDto.php new file mode 100644 index 00000000..b6270404 --- /dev/null +++ b/app/Dto/DiscountDto.php @@ -0,0 +1,86 @@ + + */ +final readonly class DiscountDto implements Arrayable, UrlRoutable +{ + public function __construct( + public int $id, + public DiscountType $type, + public DiscountValue $value, + public bool $is_old_price_displayed, + public ?Carbon $date_start = null, + public ?Carbon $date_end = null, + public ?Carbon $created_at = null, + public ?Carbon $updated_at = null, + ) { + } + + public static function fromModel(Discount $discount): self + { + return new self( + id: $discount->id, + type: $discount->type, + value: $discount->value, + is_old_price_displayed: $discount->is_old_price_displayed, + date_start: $discount->date_start, + date_end: $discount->date_end, + created_at: $discount->created_at, + updated_at: $discount->updated_at, + ); + } + + #[\Override] + public function getRouteKey(): mixed + { + return $this->id; + } + + #[\Override] + public function getRouteKeyName(): string + { + return 'id'; + } + + #[\Override] + public function resolveRouteBinding($value, $field = null): mixed + { + return null; + } + + #[\Override] + public function resolveChildRouteBinding($childType, $value, $field): mixed + { + return null; + } + + /** + * @return array + */ + #[\Override] + public function toArray(): array + { + return [ + 'id' => $this->id, + 'type' => $this->type->value(), + 'value' => $this->value->value(), + 'is_old_price_displayed' => $this->is_old_price_displayed, + 'date_start' => $this->date_start, + 'date_end' => $this->date_end, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at, + ]; + } +} diff --git a/app/Dto/DiscountProductDto.php b/app/Dto/DiscountProductDto.php new file mode 100644 index 00000000..432866d7 --- /dev/null +++ b/app/Dto/DiscountProductDto.php @@ -0,0 +1,52 @@ + + */ +final readonly class DiscountProductDto implements \JsonSerializable, Arrayable +{ + public function __construct( + public string $id, + public string $name, + public ?string $picture, + ) { + } + + public static function fromModel(Product $product): self + { + return new self( + id: (string) $product->id, + name: (string) $product->name, + picture: $product->picture, + ); + } + + /** + * @return array{id: string, name: string} + */ + #[\Override] + public function toArray(): array + { + return [ + 'id' => $this->id, + 'name' => $this->name, + 'picture' => $this->picture, + ]; + } + + /** + * @return array{id: string, name: string} + */ + #[\Override] + public function jsonSerialize(): array + { + return $this->toArray(); + } +} diff --git a/app/Dto/FaqDto.php b/app/Dto/FaqDto.php new file mode 100644 index 00000000..d57ce031 --- /dev/null +++ b/app/Dto/FaqDto.php @@ -0,0 +1,53 @@ +id, + question: $faq->question, + answer: $faq->answer, + order: $faq->order, + ); + } + + #[\Override] + public function getRouteKey(): mixed + { + return $this->id; + } + + #[\Override] + public function getRouteKeyName(): string + { + return 'id'; + } + + #[\Override] + public function resolveRouteBinding($value, $field = null): mixed + { + return null; + } + + #[\Override] + public function resolveChildRouteBinding($childType, $value, $field): mixed + { + return null; + } +} diff --git a/app/Dto/IcsContentDto.php b/app/Dto/IcsContentDto.php new file mode 100644 index 00000000..e17d56ae --- /dev/null +++ b/app/Dto/IcsContentDto.php @@ -0,0 +1,20 @@ + + */ +final readonly class OrderDto implements Arrayable, UrlRoutable +{ + /** + * @param Collection $lines + */ + public function __construct( + public string $id, + public OrderReference $reference, + public Money $total, + public OrderStatus $status, + public ?CarbonInterface $created_at = null, + public ?CarbonInterface $pickup_day = null, + public ?OrderEmployee $employee = null, + public ?ShopDto $shop = null, + public ?string $shop_id = null, + public ?DeliveryAddress $delivery_address = null, + public ?string $employee_matricule = null, + public Collection $lines = new Collection(), + ) { + } + + public static function fromModel(Order $order): self + { + /** @var Collection $lines */ + $lines = $order->relationLoaded('lines') + ? $order->lines->map(fn (OrderLine $line): OrderLineDto => OrderLineDto::fromModel($line)) + : new Collection(); + + return new self( + id: (string) $order->id, + reference: $order->reference, + total: $order->total, + status: $order->status, + created_at: $order->created_at, + pickup_day: $order->pickup_day, + employee: $order->employee, + shop: $order->relationLoaded('shop') && $order->shop ? ShopDto::fromModel($order->shop) : null, + shop_id: $order->shop_id !== null ? (string) $order->shop_id : null, + delivery_address: $order->delivery_address, + employee_matricule: $order->employee_matricule, + lines: $lines, + ); + } + + #[\Override] + public function getRouteKey(): mixed + { + return $this->id; + } + + #[\Override] + public function getRouteKeyName(): string + { + return 'id'; + } + + #[\Override] + public function resolveRouteBinding($value, $field = null): mixed + { + return null; + } + + #[\Override] + public function resolveChildRouteBinding($childType, $value, $field): mixed + { + return null; + } + + /** + * @return array + */ + #[\Override] + public function toArray(): array + { + return [ + 'id' => $this->id, + 'reference' => (string) $this->reference, + 'total' => $this->total->getAmount(), + 'status' => $this->status->value, + 'created_at' => $this->created_at?->toISOString(), + 'pickup_day' => $this->pickup_day?->toISOString(), + 'employee' => $this->employee !== null ? [ + 'matricule' => $this->employee->matricule->value, + 'firstname' => $this->employee->firstname, + 'lastname' => $this->employee->lastname, + 'facility' => $this->employee->facility, + 'site' => $this->employee->site, + 'service' => $this->employee->service, + ] : null, + 'shop' => $this->shop?->toArray(), + 'shop_id' => $this->shop_id, + 'delivery_address' => $this->delivery_address?->toArray(), + 'employee_matricule' => $this->employee_matricule, + 'lines' => $this->lines->map(fn (OrderLineDto $line): array => $line->toArray())->all(), + ]; + } +} diff --git a/app/Dto/OrderLineDto.php b/app/Dto/OrderLineDto.php new file mode 100644 index 00000000..8610cc52 --- /dev/null +++ b/app/Dto/OrderLineDto.php @@ -0,0 +1,76 @@ + + */ +final readonly class OrderLineDto implements Arrayable +{ + public function __construct( + public int $id, + public string $order_id, + public OrderLineProduct $product, + public int $quantity, + public Money $unit_price, + public Money $unit_tax, + public Money $unit_discount, + public TaxRate $tax_rate, + public Money $total_ttc, + public Money $total_ht, + public Money $total_tax, + public Money $total_discount, + public Money $unitPriceDiscountedHt, + public Money $totalGrossHt, + ) { + } + + public static function fromModel(OrderLine $line): self + { + return new self( + id: (int) $line->id, + order_id: (string) $line->order_id, + product: $line->product, + quantity: (int) $line->quantity, + unit_price: $line->unit_price, + unit_tax: $line->unit_tax, + unit_discount: $line->unit_discount, + tax_rate: $line->tax_rate, + total_ttc: $line->total_ttc, + total_ht: $line->total_ht, + total_tax: $line->total_tax, + total_discount: $line->total_discount, + unitPriceDiscountedHt: $line->unitPriceDiscountedHt, + totalGrossHt: $line->totalGrossHt, + ); + } + + /** + * @return array + */ + #[\Override] + public function toArray(): array + { + return [ + 'id' => $this->id, + 'order_id' => $this->order_id, + 'quantity' => $this->quantity, + 'unit_price' => $this->unit_price->getAmount(), + 'unit_tax' => $this->unit_tax->getAmount(), + 'unit_discount' => $this->unit_discount->getAmount(), + 'tax_rate' => $this->tax_rate->value, + 'total_ttc' => $this->total_ttc->getAmount(), + 'total_ht' => $this->total_ht->getAmount(), + 'total_tax' => $this->total_tax->getAmount(), + 'total_discount' => $this->total_discount->getAmount(), + ]; + } +} diff --git a/app/Dto/OrderReminderDto.php b/app/Dto/OrderReminderDto.php new file mode 100644 index 00000000..77ded0bd --- /dev/null +++ b/app/Dto/OrderReminderDto.php @@ -0,0 +1,25 @@ + $lines + */ + public function __construct( + public string $firstname, + public string $lastname, + public string $reference, + public string $total, + public string $pickupDayFormatted, + public array $lines, + public string $shopName, + public string $shopAddress, + public string $shopPostcode, + public string $shopCity, + ) { + } +} diff --git a/app/Dto/OrderReminderLineDto.php b/app/Dto/OrderReminderLineDto.php new file mode 100644 index 00000000..26a3eb23 --- /dev/null +++ b/app/Dto/OrderReminderLineDto.php @@ -0,0 +1,16 @@ + + */ +final readonly class PageDto implements Arrayable, UrlRoutable +{ + public function __construct( + public int $id, + public StaticPageSlug $slug, + public string $seo_title, + public string $seo_description, + public ?string $title, + public string $content, + ) { + } + + public static function fromModel(Page $page): self + { + return new self( + id: $page->id, + slug: $page->slug, + seo_title: $page->seo_title, + seo_description: $page->seo_description, + title: $page->title, + content: $page->content, + ); + } + + #[\Override] + public function getRouteKey(): mixed + { + return $this->slug->value; + } + + #[\Override] + public function getRouteKeyName(): string + { + return 'slug'; + } + + #[\Override] + public function resolveRouteBinding($value, $field = null): mixed + { + return null; + } + + #[\Override] + public function resolveChildRouteBinding($childType, $value, $field): mixed + { + return null; + } + + /** + * @return array{id: int, slug: StaticPageSlug, seo_title: string, seo_description: string, title: string|null, content: string} + */ + #[\Override] + public function toArray(): array + { + return [ + 'id' => $this->id, + 'slug' => $this->slug, + 'seo_title' => $this->seo_title, + 'seo_description' => $this->seo_description, + 'title' => $this->title, + 'content' => $this->content, + ]; + } +} diff --git a/app/Dto/PickupExceptionDto.php b/app/Dto/PickupExceptionDto.php new file mode 100644 index 00000000..a747baf9 --- /dev/null +++ b/app/Dto/PickupExceptionDto.php @@ -0,0 +1,93 @@ + + */ +final readonly class PickupExceptionDto implements Arrayable, UrlRoutable +{ + public function __construct( + public string $id, + public CarbonInterface $date, + public string $label, + public bool $repeatable, + public RepeatFrequency $repeat_frequency, + public bool $auto_updated, + public ?ShopPickupExceptionPivotDto $pivot = null, + ) { + } + + public static function fromModel(PickupException $pickupException): self + { + $pivot = null; + if ($pickupException->relationLoaded('pivot') && $pickupException->getRelation('pivot') instanceof ShopPickupExceptionPivot) { + /** @var ShopPickupExceptionPivot $pivotModel */ + $pivotModel = $pickupException->getRelation('pivot'); + $pivot = new ShopPickupExceptionPivotDto( + replacement_date: $pivotModel->replacement_date, + order_deadline_at: $pivotModel->order_deadline_at, + ); + } + + return new self( + id: $pickupException->id, + date: $pickupException->date, + label: $pickupException->label, + repeatable: (bool) $pickupException->repeatable, + repeat_frequency: $pickupException->repeat_frequency, + auto_updated: (bool) $pickupException->auto_updated, + pivot: $pivot, + ); + } + + #[\Override] + public function getRouteKey(): mixed + { + return $this->id; + } + + #[\Override] + public function getRouteKeyName(): string + { + return 'id'; + } + + #[\Override] + public function resolveRouteBinding($value, $field = null): mixed + { + return null; + } + + #[\Override] + public function resolveChildRouteBinding($childType, $value, $field): mixed + { + return null; + } + + /** + * @return array + */ + #[\Override] + public function toArray(): array + { + return [ + 'id' => $this->id, + 'date' => $this->date->toIso8601String(), + 'label' => $this->label, + 'repeatable' => $this->repeatable, + 'repeat_frequency' => $this->repeat_frequency->value, + 'auto_updated' => $this->auto_updated, + 'pivot' => $this->pivot?->toArray(), + ]; + } +} diff --git a/app/Dto/ProductDto.php b/app/Dto/ProductDto.php new file mode 100644 index 00000000..2aa359e9 --- /dev/null +++ b/app/Dto/ProductDto.php @@ -0,0 +1,125 @@ + + */ +final readonly class ProductDto implements Arrayable, UrlRoutable +{ + public function __construct( + public string $id, + public string $name, + public string $slug, + public ?ProductBrand $brand = null, + public ?ProductIncoDto $inco = null, + public ?string $picture = null, + public ?string $picture_alt = null, + public ?string $picture_title = null, + public ?string $picture_large = null, + public ?string $picture_large_alt = null, + public ?string $picture_large_title = null, + public ?Money $price = null, + public ?DiscountDto $discount = null, + public int $stock = 0, + public ?SellUnit $sell_unit = null, + public ?RangeDto $range = null, + public int $order = 0, + public bool $status = false, + public bool $star = false, + public ?string $short_description = null, + public ?string $description = null, + ) { + } + + public static function fromModel(Product $product): self + { + return new self( + id: (string) $product->id, + name: $product->name, + slug: (string) $product->slug, + brand: $product->brand, + inco: $product->relationLoaded('inco') && $product->inco ? ProductIncoDto::fromModel($product->inco) : null, + picture: is_string($product->picture) ? $product->picture : null, + picture_alt: $product->picture_alt, + picture_title: $product->picture_title, + picture_large: is_string($product->picture_large) ? $product->picture_large : null, + picture_large_alt: $product->picture_large_alt, + picture_large_title: $product->picture_large_title, + price: $product->price instanceof Money ? $product->price : null, + discount: $product->relationLoaded('discount') && $product->discount ? DiscountDto::fromModel($product->discount) : null, + stock: (int) $product->stock, + sell_unit: $product->sell_unit, + range: $product->relationLoaded('range') && $product->range ? RangeDto::fromModel($product->range) : null, + order: (int) $product->order, + status: (bool) $product->status, + star: (bool) $product->star, + short_description: $product->short_description, + description: $product->description, + ); + } + + #[\Override] + public function getRouteKey(): mixed + { + return $this->slug; + } + + #[\Override] + public function getRouteKeyName(): string + { + return 'slug'; + } + + #[\Override] + public function resolveRouteBinding($value, $field = null): mixed + { + return null; + } + + #[\Override] + public function resolveChildRouteBinding($childType, $value, $field): mixed + { + return null; + } + + /** + * @return array + */ + #[\Override] + public function toArray(): array + { + return [ + 'id' => $this->id, + 'name' => $this->name, + 'slug' => $this->slug, + 'brand' => $this->brand?->value, + 'inco' => $this->inco?->toArray(), + 'picture' => $this->picture, + 'picture_alt' => $this->picture_alt, + 'picture_title' => $this->picture_title, + 'picture_large' => $this->picture_large, + 'picture_large_alt' => $this->picture_large_alt, + 'picture_large_title' => $this->picture_large_title, + 'price' => $this->price?->getAmount(), + 'discount' => $this->discount?->toArray(), + 'stock' => $this->stock, + 'sell_unit' => $this->sell_unit?->value, + 'range' => $this->range?->toArray(), + 'order' => $this->order, + 'status' => $this->status, + 'star' => $this->star, + 'short_description' => $this->short_description, + 'description' => $this->description, + ]; + } +} diff --git a/app/Dto/ProductFormDataDto.php b/app/Dto/ProductFormDataDto.php new file mode 100644 index 00000000..b3121d85 --- /dev/null +++ b/app/Dto/ProductFormDataDto.php @@ -0,0 +1,39 @@ + $brands + * @param list $taxes + * @param list $invoicingUnits + * @param list $sellUnits + * @param list $orderUnits + * @param Collection $ranges + * @param Collection $tags + * @param Collection $existingProds + * @param Collection $selectedProds + */ + public function __construct( + public array $brands, + public array $taxes, + public array $invoicingUnits, + public array $sellUnits, + public array $orderUnits, + public Collection $ranges, + public Collection $tags, + public Collection $existingProds, + public Collection $selectedProds, + ) { + } +} diff --git a/app/Dto/ProductIncoDto.php b/app/Dto/ProductIncoDto.php new file mode 100644 index 00000000..859b723a --- /dev/null +++ b/app/Dto/ProductIncoDto.php @@ -0,0 +1,94 @@ + + */ +final readonly class ProductIncoDto implements Arrayable, UrlRoutable +{ + public function __construct( + public int $id, + public int $no_art, + public string $product_id, + public ?string $ingredients, + public ?string $preparation, + public ?string $servings, + public ?string $allergens, + public ?string $selling_argument, + public ?Nutriscore $nutriscore, + public ?string $nutriscore_args, + public NutritionalValues $nutrition, + ) { + } + + public static function fromModel(ProductInco $inco): self + { + return new self( + id: $inco->id, + no_art: $inco->no_art, + product_id: (string) $inco->product_id, + ingredients: $inco->ingredients, + preparation: $inco->preparation, + servings: $inco->servings, + allergens: $inco->allergens, + selling_argument: $inco->selling_argument, + nutriscore: $inco->nutriscore, + nutriscore_args: $inco->nutriscore_args, + nutrition: $inco->nutrition, + ); + } + + #[\Override] + public function getRouteKey(): mixed + { + return $this->id; + } + + #[\Override] + public function getRouteKeyName(): string + { + return 'id'; + } + + #[\Override] + public function resolveRouteBinding($value, $field = null): mixed + { + return null; + } + + #[\Override] + public function resolveChildRouteBinding($childType, $value, $field): mixed + { + return null; + } + + /** + * @return array + */ + #[\Override] + public function toArray(): array + { + return [ + 'id' => $this->id, + 'no_art' => $this->no_art, + 'product_id' => $this->product_id, + 'ingredients' => $this->ingredients, + 'preparation' => $this->preparation, + 'servings' => $this->servings, + 'allergens' => $this->allergens, + 'selling_argument' => $this->selling_argument, + 'nutriscore' => $this->nutriscore?->value, + 'nutriscore_args' => $this->nutriscore_args, + 'nutrition' => $this->nutrition->toArray(), + ]; + } +} diff --git a/app/Dto/ProductWithPricingDto.php b/app/Dto/ProductWithPricingDto.php new file mode 100644 index 00000000..2dfc199a --- /dev/null +++ b/app/Dto/ProductWithPricingDto.php @@ -0,0 +1,17 @@ + + */ +final readonly class RangeDto implements Arrayable, UrlRoutable +{ + public function __construct( + public int $id, + public string $name, + public string $slug, + public ?string $description, + public ?string $picture, + public string $picture_alt, + public string $picture_title, + public int $order, + public bool $status, + ) { + } + + public static function fromModel(Range $range): self + { + return new self( + id: $range->id, + name: $range->name, + slug: $range->slug, + description: $range->description, + picture: is_string($range->picture) ? $range->picture : null, + picture_alt: $range->picture_alt, + picture_title: $range->picture_title, + order: $range->order, + status: $range->status, + ); + } + + #[\Override] + public function getRouteKey(): mixed + { + return $this->slug; + } + + #[\Override] + public function getRouteKeyName(): string + { + return 'slug'; + } + + #[\Override] + public function resolveRouteBinding($value, $field = null): mixed + { + return null; + } + + #[\Override] + public function resolveChildRouteBinding($childType, $value, $field): mixed + { + return null; + } + + /** + * @return array + */ + #[\Override] + public function toArray(): array + { + return [ + 'id' => $this->id, + 'name' => $this->name, + 'slug' => $this->slug, + 'description' => $this->description, + 'picture' => $this->picture, + 'picture_alt' => $this->picture_alt, + 'picture_title' => $this->picture_title, + 'order' => $this->order, + 'status' => $this->status, + ]; + } +} diff --git a/app/Dto/SettingDto.php b/app/Dto/SettingDto.php new file mode 100644 index 00000000..be99389e --- /dev/null +++ b/app/Dto/SettingDto.php @@ -0,0 +1,85 @@ + + */ +final readonly class SettingDto implements Arrayable, UrlRoutable +{ + /** + * @param array $employeeSites + */ + public function __construct( + public int $id, + public array $employeeSites = [], + ) { + } + + public static function fromModel(Setting $setting): self + { + return new self( + id: $setting->id, + employeeSites: $setting->employee_sites ?? [], + ); + } + + public function employeeSitesAsString(): string + { + return implode(', ', $this->employeeSites); + } + + /** + * @return array + */ + public function getShopperSiteCodes(): array + { + return array_map( + static fn (string $site): ShopperSiteCode => new ShopperSiteCode($site), + $this->employeeSites + ); + } + + #[\Override] + public function getRouteKey(): mixed + { + return $this->id; + } + + #[\Override] + public function getRouteKeyName(): string + { + return 'setting'; + } + + #[\Override] + public function resolveRouteBinding($value, $field = null): mixed + { + return null; + } + + #[\Override] + public function resolveChildRouteBinding($childType, $value, $field): mixed + { + return null; + } + + /** + * @return array{id: int, employee_sites: array} + */ + #[\Override] + public function toArray(): array + { + return [ + 'id' => $this->id, + 'employee_sites' => $this->employeeSites, + ]; + } +} diff --git a/app/Dto/ShopDto.php b/app/Dto/ShopDto.php new file mode 100644 index 00000000..250c8010 --- /dev/null +++ b/app/Dto/ShopDto.php @@ -0,0 +1,116 @@ + + */ +final readonly class ShopDto implements Arrayable, UrlRoutable +{ + /** + * @param \Illuminate\Support\Collection|null $pickupExceptions + */ + public function __construct( + public string $id, + public string $name, + public string $address, + public string $postcode, + public string $city, + public ?string $phone, + public ?string $latitude, + public ?string $longitude, + public bool $default, + public ?Collection $pickupExceptions = null, + ) { + } + + public static function fromModel(Shop $shop): self + { + $pickupExceptions = null; + if ($shop->relationLoaded('pickupExceptions')) { + $pickupExceptions = $shop->pickupExceptions->map( + fn (PickupException $pe): PickupExceptionDto => PickupExceptionDto::fromModel($pe) + ); + } + + return new self( + id: $shop->id, + name: $shop->name, + address: $shop->address, + postcode: $shop->postcode, + city: $shop->city, + phone: $shop->phone, + latitude: $shop->latitude, + longitude: $shop->longitude, + default: (bool) $shop->default, + pickupExceptions: $pickupExceptions, + ); + } + + public static function fromDomain(DomainShop $shop): self + { + return new self( + id: $shop->id->value->toString(), + name: $shop->name, + address: $shop->address, + postcode: $shop->postcode, + city: $shop->city, + phone: $shop->phone, + latitude: $shop->latitude, + longitude: $shop->longitude, + default: $shop->isDefault, + ); + } + + #[\Override] + public function getRouteKey(): mixed + { + return $this->id; + } + + #[\Override] + public function getRouteKeyName(): string + { + return 'id'; + } + + #[\Override] + public function resolveRouteBinding($value, $field = null): mixed + { + return null; + } + + #[\Override] + public function resolveChildRouteBinding($childType, $value, $field): mixed + { + return null; + } + + /** + * @return array + */ + #[\Override] + public function toArray(): array + { + return [ + 'id' => $this->id, + 'name' => $this->name, + 'address' => $this->address, + 'postcode' => $this->postcode, + 'city' => $this->city, + 'phone' => $this->phone, + 'latitude' => $this->latitude, + 'longitude' => $this->longitude, + 'default' => $this->default, + ]; + } +} diff --git a/app/Dto/ShopPickupExceptionPivotDto.php b/app/Dto/ShopPickupExceptionPivotDto.php new file mode 100644 index 00000000..9908c58d --- /dev/null +++ b/app/Dto/ShopPickupExceptionPivotDto.php @@ -0,0 +1,32 @@ + + */ +final readonly class ShopPickupExceptionPivotDto implements Arrayable +{ + public function __construct( + public ?CarbonInterface $replacement_date, + public ?CarbonInterface $order_deadline_at, + ) { + } + + /** + * @return array + */ + #[\Override] + public function toArray(): array + { + return [ + 'replacement_date' => $this->replacement_date?->toIso8601String(), + 'order_deadline_at' => $this->order_deadline_at?->toIso8601String(), + ]; + } +} diff --git a/app/Dto/SlideDto.php b/app/Dto/SlideDto.php new file mode 100644 index 00000000..83827884 --- /dev/null +++ b/app/Dto/SlideDto.php @@ -0,0 +1,110 @@ + + */ +final readonly class SlideDto implements Arrayable, UrlRoutable +{ + public function __construct( + public int $id, + public string $title, + public ?string $text, + public ?string $picture, + public ?string $picture_alt, + public ?string $picture_title, + public ?string $link, + public ?string $link_label, + public bool $link_new_tab, + public bool $connected, + public ?Carbon $date_start, + public ?Carbon $date_end, + public int $order, + public bool $status, + public bool $isVisible = false, + ) { + } + + public static function fromModel(Slide $slide): self + { + return new self( + id: $slide->id, + title: $slide->title, + text: $slide->text, + picture: is_string($slide->picture) ? $slide->picture : null, + picture_alt: $slide->picture_alt, + picture_title: $slide->picture_title, + link: $slide->link, + link_label: $slide->link_label, + link_new_tab: $slide->link_new_tab, + connected: $slide->connected, + date_start: $slide->date_start, + date_end: $slide->date_end, + order: $slide->order, + status: $slide->status, + isVisible: $slide->isVisible(), + ); + } + + public function isVisible(): bool + { + return $this->isVisible; + } + + #[\Override] + public function getRouteKey(): mixed + { + return $this->id; + } + + #[\Override] + public function getRouteKeyName(): string + { + return 'id'; + } + + #[\Override] + public function resolveRouteBinding($value, $field = null): mixed + { + return null; + } + + #[\Override] + public function resolveChildRouteBinding($childType, $value, $field): mixed + { + return null; + } + + /** + * @return array + */ + #[\Override] + public function toArray(): array + { + return [ + 'id' => $this->id, + 'title' => $this->title, + 'text' => $this->text, + 'picture' => $this->picture, + 'picture_alt' => $this->picture_alt, + 'picture_title' => $this->picture_title, + 'link' => $this->link, + 'link_label' => $this->link_label, + 'link_new_tab' => $this->link_new_tab, + 'connected' => $this->connected, + 'date_start' => $this->date_start, + 'date_end' => $this->date_end, + 'order' => $this->order, + 'status' => $this->status, + 'is_visible' => $this->isVisible, + ]; + } +} diff --git a/app/Dto/TagDto.php b/app/Dto/TagDto.php new file mode 100644 index 00000000..556714f1 --- /dev/null +++ b/app/Dto/TagDto.php @@ -0,0 +1,55 @@ +id, + label: $tag->label, + slug: $tag->slug, + order: $tag->order, + status: $tag->status, + ); + } + + #[\Override] + public function getRouteKey(): mixed + { + return $this->id; + } + + #[\Override] + public function getRouteKeyName(): string + { + return 'id'; + } + + #[\Override] + public function resolveRouteBinding($value, $field = null): mixed + { + return null; + } + + #[\Override] + public function resolveChildRouteBinding($childType, $value, $field): mixed + { + return null; + } +} diff --git a/app/Enums/ExceptionDayType.php b/app/Enums/ExceptionDayType.php deleted file mode 100644 index 761b29be..00000000 --- a/app/Enums/ExceptionDayType.php +++ /dev/null @@ -1,42 +0,0 @@ - 'Jour férié', - 'other' => 'Autre', - ]; - } - - /** - * Enum labels - * - * @return array - */ - protected static function labels(): array - { - return [ - 'ferie' => __('Jour férié'), - 'other' => __('Autre'), - ]; - } -} diff --git a/app/Enums/InvoicingUnit.php b/app/Enums/InvoicingUnit.php deleted file mode 100644 index 22eb0e0a..00000000 --- a/app/Enums/InvoicingUnit.php +++ /dev/null @@ -1,50 +0,0 @@ - 'PCE', - 'kgm' => 'KGM', - 'colis' => 'COLIS', - ]; - } - - /** - * Enum labels - * - * @return array - */ - protected static function labels(): array - { - return [ - 'pce' => __('Pièce'), - 'kgm' => __('Kg'), - 'colis' => __('Colis'), - ]; - } - - /** - * Output the value as a string - * @return string - */ - public function __toString(): string - { - return (string)$this->label; - } -} diff --git a/app/Enums/LogType.php b/app/Enums/LogType.php deleted file mode 100644 index a2c8c4c7..00000000 --- a/app/Enums/LogType.php +++ /dev/null @@ -1,17 +0,0 @@ - 'PCE', - 'kgm' => 'KGM', - 'colis' => 'COLIS', - ]; - } - - /** - * Enum labels - * - * @return array - */ - protected static function labels(): array - { - return [ - 'pce' => __('Pièce'), - 'kgm' => __('Kg'), - 'colis' => __('Colis'), - ]; - } - - /** - * Output the value as a string - * @return string - */ - public function __toString(): string - { - return (string)$this->label; - } -} diff --git a/app/Enums/PriceShowingMode.php b/app/Enums/PriceShowingMode.php deleted file mode 100644 index e45a2415..00000000 --- a/app/Enums/PriceShowingMode.php +++ /dev/null @@ -1,42 +0,0 @@ - 'authenticated', - 'guest' => 'guest', - ]; - } - - /** - * Enum labels - * - * @return array - */ - protected static function labels(): array - { - return [ - 'authenticated' => __('Client Connecté'), - 'guest' => __('Public'), - ]; - } -} diff --git a/app/Enums/ProductBrand.php b/app/Enums/ProductBrand.php deleted file mode 100644 index 88d3278b..00000000 --- a/app/Enums/ProductBrand.php +++ /dev/null @@ -1,49 +0,0 @@ - 'Sans marque', - 'loue' => 'Loué', - 'legaulois' => 'Le Gaulois', - 'legauloispro' => 'Le Gaulois Professionnel', - 'marie' => 'Marie', - 'tregalette' => 'Trégalette', - 'esprirestauration' => 'Espri Restauration', - 'lepetitmarchedeloue' => 'Le petit marché de Loué', - 'lesaccessibles' => 'Les Accessibles', - 'legauloisvegetal' => 'Le Gaulois végétal', - 'natureandrespect' => 'Nature & Respect', - 'reghalal' => 'Réghalal' - ]; - } -} diff --git a/app/Enums/SalarieSite.php b/app/Enums/SalarieSite.php deleted file mode 100644 index b7016718..00000000 --- a/app/Enums/SalarieSite.php +++ /dev/null @@ -1,80 +0,0 @@ - 'SLHP', - 'ldcser' => 'LDCSER', - 'ldcvol' => 'LDCVOL', - 'ldcter' => 'LDCTER', - 'ldctra' => 'LDCTRA', - 'ldccav' => 'LDCCAV', - 'ldchol' => 'LDCHOL', - 'cepacpe' => 'CEPACP', - 'dde' => 'DDE', - 'dpe' => 'DPE', - 'sl' => 'SL', - 'gdfroi' => 'GDFROI', - 'ldcplb' => 'LDCPLB', - 'slela' => 'SLELA', - 'tpwiss' => 'TPWISS' - ]; - } - - /** - * Enum labels - * - * @return array - */ - public static function labels() - { - return [ - 'slhp' => 'Holdings', - 'ldcser' => 'LDC Services', - 'ldcvol' => 'LDC Sablé', - 'ldcter' => 'LDC Intenational', - 'ldctra' => 'LDC Traiteur', - 'ldccav' => 'Cavol', - 'ldchol' => 'LDC Holding', - 'cepacpe' => 'CPE-CEPA', - 'dde' => 'Unité Dinde', - 'dpe' => 'DPE', - 'sl' => 'Saint-Laurent', - 'gdfroi' => 'Grand Froid', - 'ldcplb' => 'LDC PLB', - 'slela' => 'SLELA', - 'tpwiss' => 'TPWISS' - ]; - } -} diff --git a/app/Enums/SellUnit.php b/app/Enums/SellUnit.php deleted file mode 100644 index ec6a1cef..00000000 --- a/app/Enums/SellUnit.php +++ /dev/null @@ -1,50 +0,0 @@ - 'PCE', - 'kgm' => 'KGM', - 'colis' => 'COLIS', - ]; - } - - /** - * Enum labels - * - * @return array - */ - protected static function labels(): array - { - return [ - 'pce' => __('Pièce'), - 'kgm' => __('Kg'), - 'colis' => __('Colis'), - ]; - } - - /** - * Output the value as a string - * @return string - */ - public function __toString(): string - { - return (string)$this->label; - } -} diff --git a/app/Enums/SettingRegisterMode.php b/app/Enums/SettingRegisterMode.php deleted file mode 100644 index 83c76970..00000000 --- a/app/Enums/SettingRegisterMode.php +++ /dev/null @@ -1,47 +0,0 @@ - 'public', - 'salaries' => 'salaries', - ]; - } - - /** - * Enum labels - * - * @return array - */ - protected static function labels(): array - { - return [ - 'public' => __('Public'), - 'salaries' => __('Salaries'), - ]; - } - - /** - * Output the value as a string - * @return string - */ - public function __toString(): string - { - return (string)$this->label; - } -} diff --git a/app/Enums/StatsCustomerType.php b/app/Enums/StatsCustomerType.php deleted file mode 100644 index ea74bd83..00000000 --- a/app/Enums/StatsCustomerType.php +++ /dev/null @@ -1,41 +0,0 @@ - 1, - 'nbSalarieWithAccount' => 2, - 'membershipRate' => 3, - ]; - } - /** - * Enum labels - * - * @return array - */ - protected static function labels(): array - { - return [ - 'nbSalarie' => trans('Nombre de salariés'), - 'nbSalarieWithAccount' => trans('Nombre de salariés ayant créé un compte'), - 'membershipRate' => trans('Taux d\'adhésion'), - ]; - } -} diff --git a/app/Enums/StatsShopType.php b/app/Enums/StatsShopType.php deleted file mode 100644 index 506f7fe0..00000000 --- a/app/Enums/StatsShopType.php +++ /dev/null @@ -1,71 +0,0 @@ - 1, - 'nbValidateCmd' => 2, - 'nbWaitingCmd' => 3, - 'nbCanceledCmd' => 4, - 'nbCmdWith7DayDelay' => 5, - 'nbCmdWith14DayDelay' => 6, - 'canceledRate' => 7, - 'orderFrequency' => 8, - 'purchaseFrequency' => 9, - 'averageBasketHt' => 10, - 'averageProductCountPerOrder' => 11, - 'caHt' => 12, - 'caTtc' => 13, - ]; - } - /** - * Enum labels - * - * @return array - */ - protected static function labels(): array - { - return [ - 'nbActiveClients' => trans('Nombre de clients actifs'), - 'nbValidateCmd' => trans('Commandes validées'), - 'nbWaitingCmd' => trans('Commandes en attente'), - 'nbCanceledCmd' => trans('Commandes annulées'), - 'nbCmdWith7DayDelay' => trans('Nombre de commandes à J+7'), - 'nbCmdWith14DayDelay' => trans('Nombre de commandes à J+14'), - 'canceledRate' => trans('Taux d\'abandon'), - 'orderFrequency' => trans('Fréquence de commande'), - 'purchaseFrequency' => trans('Fréquence d\'achat'), - 'averageBasketHt' => trans('Prix du panier moyen'), - 'averageProductCountPerOrder' => trans('Nombre d\'article moyen par commande'), - 'caHt' => trans('Montant total HT'), - 'caTtc' => trans('Montant total TTC'), - ]; - } -} diff --git a/app/Enums/WeightUnit.php b/app/Enums/WeightUnit.php deleted file mode 100644 index 92c93cf1..00000000 --- a/app/Enums/WeightUnit.php +++ /dev/null @@ -1,65 +0,0 @@ - 'G', - 'kg' => 'KG', - 'ton' => 'T', - ]; - } - - /** - * Enum labels - * - * @return array - */ - protected static function labels(): array - { - return [ - 'g' => __('Gramme'), - 'kg' => __('Kg'), - 'ton' => __('Tonne'), - ]; - } - - /** - * conversion values - * base kg() - * - * @return array - */ - public static function convert(): array - { - return [ - 'G' => 0.001, - 'KG' => 1, - 'T' => 1000, - ]; - } - - /** - * Output the value as a string - * @return string - */ - public function __toString(): string - { - return (string)$this->label; - } -} diff --git a/app/Events/CustomerPasswordUpdated.php b/app/Events/CustomerPasswordUpdated.php new file mode 100644 index 00000000..0f773942 --- /dev/null +++ b/app/Events/CustomerPasswordUpdated.php @@ -0,0 +1,34 @@ + */ + public function broadcastOn(): array + { + return [ + new PrivateChannel('default'), + ]; + } +} diff --git a/app/Exceptions/AbortCsvImportException.php b/app/Exceptions/AbortCsvImportException.php deleted file mode 100644 index a913d04e..00000000 --- a/app/Exceptions/AbortCsvImportException.php +++ /dev/null @@ -1,9 +0,0 @@ -render( + fn (MissingOrderBuilderException $_, Request $__) => to_route('fo.sales.summary') + ->withErrors(['tunnel' => trans( + 'Your order session has expired or is invalid. Please review your basket.' + )]) + ); + + $exceptions->render(function (CustomerNotEmployedException $_, Request $request) { + Auth::guard('frontend')->logout(); + $request->session()->invalidate(); + $request->session()->regenerateToken(); + + return to_route('fo.pages.home')->withErrors( + trans('Account blocked. Please contact your HR department or the St Laurent switchboard at :phone', [ + 'phone' => Config::string('ldc.headquarters_phone_reception'), + ]) + ); + }); + } +} diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php deleted file mode 100644 index 860f3569..00000000 --- a/app/Exceptions/Handler.php +++ /dev/null @@ -1,68 +0,0 @@ -reportable(function (Throwable $e) { - if (app()->bound('sentry')) { - app('sentry')->captureException($e); - } - }); - } - - /** - * Handle unauthenticated as exception - * - * @param mixed $request - * @param AuthenticationException $exception - * @return \Illuminate\Http\RedirectResponse - */ - protected function unauthenticated($request, AuthenticationException $exception) - { - if ($request->expectsJson()) { - return response()->json(['error' => 'Unauthenticated.'], 401); - } - $guard = $exception->guards()[0]; - switch ($guard) { - case 'customer': - $login = 'auth.connexion'; - break; - default: - $login = 'auth.login'; - break; - } - // Cf. issue : - // Https://stackoverflow.com/questions/52417438/laravel-unauthenticated-redirect-issue-with-multiple-authentication. - // Session::forget('url.intented'); . - return redirect()->guest(route($login)); - } -} diff --git a/app/Exceptions/Helpers/FileStorageOperationException.php b/app/Exceptions/Helpers/FileStorageOperationException.php new file mode 100644 index 00000000..b75c0b3c --- /dev/null +++ b/app/Exceptions/Helpers/FileStorageOperationException.php @@ -0,0 +1,18 @@ +salariesImport = $salariesImport; - } - - /** - * Set the header of the .csv. - * - * @return array - */ - public function headings(): array - { - return [ - 'Matricule', - 'Nom', - 'Prenom', - 'Site', - 'Code', - ]; - } - - /** - * Set data to specific column. - * - * @param \App\Models\Salarie $salaries - * @return array - * @phpcs:disable Squiz.Commenting.FunctionComment.TypeHintMissing - */ - public function map($salaries): array - { - //phpcs:enable - return [ - $salaries->matricule, - $salaries->nom, - $salaries->prenom, - $salaries->site, - $salaries->code, - ]; - } - - /** - * Surchage defaults config of Laravel. - * - * @return array - */ - public function getCsvSettings(): array - { - return [ - 'delimiter' => ';' - ]; - } - - /** - * - * @return \Illuminate\Support\Collection - */ - public function collection() - { - $salaries = Salarie::query(); - foreach ($this->salariesImport as $salarieImport) { - $salaries->orWhere('matricule', $salarieImport); - } - - return $salaries->get(); - } -} diff --git a/app/Helpers/BladeDirectivesHelper.php b/app/Helpers/BladeDirectivesHelper.php deleted file mode 100644 index 8f4d118c..00000000 --- a/app/Helpers/BladeDirectivesHelper.php +++ /dev/null @@ -1,80 +0,0 @@ -check()) - || config('bosettings.show_prices_guest') == "guest"; - } - - /** - * Format the sales unit according to configuration. - * Used for blade directive @fmt_sellunit. - * - * @param mixed $expression - * @return string - */ - public static function formatSellUnit($expression): string - { - if (config('bosettings.sell_unit_management') == "strict") { - return !empty($expression) ? sprintf('/ %s', SellUnit::make($expression)->label) : ''; - } - return !empty($expression) ? sprintf('/ %s', $expression) : ''; - } - - /** - * Extract a title produced according to the theme configuration. - * Used for blade directive @excerpt_product_title. - * - * @param string $expression - * @param int|null $limit - * @return string - */ - public static function excerptTitle(string $expression, $limit = null): string - { - $limit = $limit ?? config('theme.max_product_title_length'); - return Str::limit($expression, $limit); - } -} diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php deleted file mode 100644 index 343e7e9e..00000000 --- a/app/Http/Controllers/Auth/LoginController.php +++ /dev/null @@ -1,70 +0,0 @@ -validate([ - 'email' => 'required', - 'password' => 'required' - ]); - - $credentials = $request->only(['email', 'password']); - - if (Auth::attempt($credentials)) { - $user = Auth::user(); - if ($user->role === 1 || $user->role === 2) { - return redirect()->route('bo.dashboard'); - } else { - if ($user->email_verified_at === null) { - Auth::logout(); - return view('auth.login')->withErrors('Compte non activé.'); - } - return redirect()->intended('/'); - } - } - return view('auth.login')->withErrors('Informations incorrectes.'); - } - - /** - * logout - * - * @param Request $request - * @return \Illuminate\Contracts\View\View - * - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass - */ - public function logout(Request $request) - { - // @phpcs:enable - Auth::logout(); - return redirect()->route('home'); - } -} diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php deleted file mode 100644 index 91aed333..00000000 --- a/app/Http/Controllers/Auth/RegisterController.php +++ /dev/null @@ -1,56 +0,0 @@ -validate([ - 'lastname' => 'required|string|max:255', - 'firstname' => 'required|string|max:255', - 'date_of_birth' => 'required|date|before_or_equal:' . Carbon::now()->subYears(18)->toDateString(), - 'email' => 'required|string|email|max:255|unique:users|confirmed', - 'password' => 'required|string|min:8', - ]); - - User::create([ - 'firstname' => $request->firstname, - 'lastname' => $request->lastname, - 'date_of_birth' => $request->date_of_birth, - 'email' => $request->email, - 'password' => Hash::make($request->password), - 'role' => 3 - ]); - - // Envoi mail activation. - return redirect()->route('auth.register')->with('success', 'Mail envoyé pour confirmation'); - } -} diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php deleted file mode 100644 index c5f387bc..00000000 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ /dev/null @@ -1,23 +0,0 @@ -instance ?? "panier"; - $product = Product::find($request->id); - Cart::instance($instance); - Cart::add($product, $request->qty); - return $this->getCart($instance); - } - - /** - * ajout de plusieurs produits au panier - * - * @param \Illuminate\Http\Request $request - * - * @return array - */ - public function addToCartLot(Request $request) - { - $instance = $request->instance ?? "panier"; - Cart::instance($instance); - $lot = $request->items; - foreach ($lot as $item) { - $product = Product::find($item["cartItem"]["id"]); - Cart::add($product, $item["cartItem"]["qty"]); - } - return $this->getCart($instance); - } - - /** - * suppression de produit du panier - * - * @param \Illuminate\Http\Request $request - * - * @return array - */ - public function removeFromCart(Request $request) - { - $instance = $request->instance ?? "panier"; - $rowId = $request->rowId; - Cart::instance($instance); - try { - if (Cart::content()->get($rowId)) { - Cart::remove($rowId); - } - } catch (\Gloudemans\Shoppingcart\Exceptions\InvalidRowIDException $e) { - // Attempted to remove a Row which is not in cart anymore. - report($e); - } - return $this->getCart($instance); - } - - /** - * vidage de panier - * - * @param \Illuminate\Http\Request $request - * - * @return array - */ - public function emptyCart(Request $request) - { - $instance = $request->instance ?? "panier"; - Cart::instance($instance); - Cart::destroy(); - return $this->getCart($instance); - } - - /** - * récupération du panier - * - * @param \Illuminate\Http\Request $request - * - * @return array - */ - public function getCartRequest(Request $request) - { - $instance = $request->instance ?? "panier"; - Cart::instance($instance); - return $this->getCart($instance); - } - - /** - * return cart data array - * - * @param string $instance - * @return array - */ - public function getCart(string $instance = "panier") - { - Cart::instance($instance); - $dbpanier = new Collection(); - foreach (Cart::content() as $row) { - $product = $row->model; - - $product->calculatedPrices = $product->getCalcPrices(); - - $row->setTaxRate($product->tax->rate); - $row->setDiscountRate($product->discountRate); - - $cartextendedItem = array( - 'cartItem' => $row, - 'product' => $product - ); - $dbpanier->add($cartextendedItem); - } - - $cartInfos = array( - "totalTTC" => Cart::total(), - // Total des taxes. - 'totalTVA' => Cart::tax(), - // Total sans les taxes. - 'totalHT' => Cart::subtotal(), - // Poids total des items. - 'totalweight' => Cart::weight(), - // Total avant taxes et remises. - 'totalHTbefore' => Cart::priceTotal(), - // Total des remises. - 'totaldiscount' => Cart::discount(), - // Nb de produits dans le cart. - 'countItems' => Cart::count(), - ); - - $cartInfosNoPrice = array( - "totalTTC" => "-.--", - // Total des taxes. - 'totalTVA' => "-.--", - // Total sans les taxes. - 'totalHT' => "-.--", - // Poids total des items. - 'totalweight' => Cart::weight(), - // Total avant taxes et remises. - 'totalHTbefore' => "-.--", - // Total des remises. - 'totaldiscount' => "-.--", - // Nb de produits dans le cart. - 'countItems' => Cart::count(), - ); - - $cartReturn = array($dbpanier, $cartInfosNoPrice); - if (config('bosettings.show_prices_authenticated') == "authenticated") { - if (Auth::guard('customer')->check()) { - $cartReturn = array($dbpanier, $cartInfos); - } - } - - if (config('bosettings.show_prices_guest') == "guest") { - $cartReturn = array($dbpanier, $cartInfos); - } - - return $cartReturn; - } -} diff --git a/app/Http/Controllers/Bo/Auth/LoginController.php b/app/Http/Controllers/Bo/Auth/LoginController.php new file mode 100644 index 00000000..bd1096c1 --- /dev/null +++ b/app/Http/Controllers/Bo/Auth/LoginController.php @@ -0,0 +1,54 @@ +middleware('guest:backend')->except('logout'); + $this->middleware('auth:backend')->only('logout'); + } + + protected function guard(): StatefulGuard + { + return Auth::guard('backend'); + } + + public function showLoginForm(): View + { + return view('bo.auth.login'); + } + + protected function authenticated(Request $request, User $user): RedirectResponse + { + Session::flash('success', \trans('You are logged in!')); + + return redirect()->route('bo.dashboard'); + } + + protected function loggedOut(Request $request): RedirectResponse + { + return to_route('fo.pages.home') + ->with('info', trans('You are logged out!')); + } + + protected function redirectTo(): string + { + return route('bo.dashboard'); + } +} diff --git a/app/Http/Controllers/Bo/ContentController.php b/app/Http/Controllers/Bo/ContentController.php deleted file mode 100644 index 64b19e72..00000000 --- a/app/Http/Controllers/Bo/ContentController.php +++ /dev/null @@ -1,56 +0,0 @@ -first(); - - if ($_SERVER["REQUEST_METHOD"] === "POST") { - $banner = $request->banner; - $title = $request->title; - $chapeau = $request->chapeau; - $maintext = $request->value; - - $request->validate([ - 'banner' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:max_width=' . - config('theme.content_banner_maxwidth') . - ',max_height=' . config('theme.content_banner_maxheight'), - 'value' => 'required', - ]); - - if ($banner !== null) { - if ($content->banner !== null && file_exists(storage_path('app/public/images/content/') . $content->banner)) { - unlink(storage_path('app/public/images/content/') . $content->banner); - } - $imageName = $content->id . '.' . $banner->extension(); - $banner->move(storage_path('app/public/images/content'), $imageName); - $content->banner = $imageName; - } - - $content->title = $title; - $content->chapeau = $chapeau; - $content->value = $maintext; - $content->save(); - - return redirect()->route('bo.content', ['key' => $content->key, 'content' => $content]) - ->with('success', 'Modifications enregistrés !'); - }//end if - - return view('bo.content.manage', compact('content')); - } -} diff --git a/app/Http/Controllers/Bo/CreneauxController.php b/app/Http/Controllers/Bo/CreneauxController.php deleted file mode 100644 index 4df21a5f..00000000 --- a/app/Http/Controllers/Bo/CreneauxController.php +++ /dev/null @@ -1,80 +0,0 @@ -timeslotSettings; - if ($timeslotSettings->count() === 0) { - // Aucun settings pour ce magasin. - $timeslotSettings = $this->makeCreneauxSettings($id); - } - - return view('bo.creneaux.settings', compact('timeslotSettings', 'magasin')); - } - - /** - * Retrieve creneaux settings - * - * @param integer $id - * @return mixed - */ - public function makeCreneauxSettings(int $id) - { - for ($i = 0; $i < 7; $i++) { - $dayset = new TimeslotSetting(); - $dayset->magasin_id = $id; - $dayset->day_index = '' . $i; - $dayset->save(); - } - return Magasin::findOrFail($id)->timeslotSettings; - } - - /** - * save settings - * - * @param Request $request - * @param integer $id - * @return \Illuminate\Http\RedirectResponse - */ - public function updateSettings(Request $request, int $id) - { - $plage = $request->plage; - $magasin_id = $id; - - foreach ($plage as $index => $day) { - $setting = TimeslotSetting::where('day_index', '' . $index) - ->where('magasin_id', $magasin_id) - ->firstOrFail(); - // $setting->magasin_id = $magasin_id; ne doit pas changer - $setting->morning_start = $day['morning_start']; - $setting->morning_end = $day['morning_end']; - $setting->afternoon_start = $day['afternoon_start']; - $setting->afternoon_end = $day['afternoon_end']; - $setting->interval = $day['interval']; - $setting->max_orders_per_interval = $day['max_orders_per_interval']; - $setting->min_order_preparation = $day['min_order_preparation']; - $setting->save(); - } - - return redirect()->route('bo.creneaux.settings', $magasin_id)->with('success', 'Modifications enregistrées !'); - } -} diff --git a/app/Http/Controllers/Bo/DashboardController.php b/app/Http/Controllers/Bo/DashboardController.php index 801f11e4..fbbc7c3f 100644 --- a/app/Http/Controllers/Bo/DashboardController.php +++ b/app/Http/Controllers/Bo/DashboardController.php @@ -1,42 +1,39 @@ executor->execute( + $query, + $request->toGetBoDashboardQueryInput(), + ); - if ($request->has('start') && $request->has('end')) { - $start = new Carbon($request->start); - $end = new Carbon($request->end); - - $prevDates = StatsHelper::getPreviousPeriod($start, $end); - $statsShop = StatsHelper::getStats(StatsShopType::toArray(), $start, $end); - $statsCustomer = StatsHelper::getStats(StatsCustomerType::toArray(), $start, $end); - } - return view('bo.dashboard', compact( - 'prevDates', - 'statsShop', - 'statsCustomer', - 'adhesion' - )); + return view('bo.dashboard', [ + 'prevDates' => $output->prevDates, + 'statsShop' => $output->statsShop, + 'statsCustomer' => $output->statsCustomer, + 'adhesion' => $output->adhesion, + 'employeeCount' => $output->employeeCount, + 'customersLinkedToEmployeeCount' => $output->customersLinkedToEmployeeCount, + ]); } } diff --git a/app/Http/Controllers/Bo/DiscountsController.php b/app/Http/Controllers/Bo/DiscountsController.php new file mode 100644 index 00000000..fa664670 --- /dev/null +++ b/app/Http/Controllers/Bo/DiscountsController.php @@ -0,0 +1,126 @@ +authorize('viewAny', Discount::class); + + $pagination = RequestHelper::pagination($request); + + $discounts = $this->executor->execute( + $query, + new GetPaginatedDiscountsQueryInput( + pagination: $pagination, + ) + ); + + return view('bo.discounts.index', compact('discounts')); + } + + public function create(GetDiscountFormDataQuery $query): View + { + $this->authorize('create', Discount::class); + + $formData = $this->executor->execute( + $query, + new GetDiscountFormDataQueryInput() + ); + + return view('bo.discounts.create', [ + 'discountTypes' => $formData->discountTypes, + 'existingProds' => $formData->existingProds, + 'selectedProds' => $formData->selectedProds, + ]); + } + + public function store(StoreDiscountRequest $request, CreateDiscount $action): RedirectResponse + { + $this->authorize('create', Discount::class); + + $discount = $this->executor->execute( + $action, + $request->toCreateDiscountInput(), + ); + + return to_route('bo.discounts.edit', $discount) + ->with('success', trans('crud.messages.has_been_created', [ + 'model' => Str::ucfirst(trans_choice('models.classes.discounts', 1)), + ])); + } + + public function edit(Discount $discount, GetDiscountFormDataQuery $query): View + { + $this->authorize('update', $discount); + + $formData = $this->executor->execute( + $query, + new GetDiscountFormDataQueryInput($discount) + ); + + return view('bo.discounts.edit', [ + 'discount' => $formData->discount, + 'discountTypes' => $formData->discountTypes, + 'existingProds' => $formData->existingProds, + 'selectedProds' => $formData->selectedProds, + ]); + } + + public function update(UpdateDiscountRequest $request, Discount $discount, UpdateDiscount $action): RedirectResponse + { + $this->authorize('update', $discount); + + $this->executor->execute( + $action, + $request->toUpdateDiscountInput($discount), + ); + + return to_route('bo.discounts.edit', $discount) + ->with('success', trans('crud.messages.has_been_updated', [ + 'model' => Str::ucfirst(trans_choice('models.classes.discounts', 1)), + ])); + } + + public function destroy(Discount $discount, DeleteDiscount $action): RedirectResponse + { + $this->authorize('delete', $discount); + + $this->executor->execute( + $action, + new DeleteDiscountInput(discount: $discount), + ); + + return to_route('bo.discounts.index') + ->with('warning', trans('crud.messages.has_been_deleted', [ + 'model' => Str::ucfirst(trans_choice('models.classes.discounts', 1)), + ])); + } +} diff --git a/app/Http/Controllers/Bo/EmployeesController.php b/app/Http/Controllers/Bo/EmployeesController.php new file mode 100644 index 00000000..740096dc --- /dev/null +++ b/app/Http/Controllers/Bo/EmployeesController.php @@ -0,0 +1,41 @@ +authorize('dispatchArcadiaRefreshJob', FetchAndUpsertArcadiaEmployees::class); + + $uniqueLock = new UniqueLock($this->cacheRepository); + + if (! $uniqueLock->acquire($syncJob)) { + $this->flashMessageService->warning(__('An employee sync is already in progress.')); + + return to_route('bo.dashboard'); + } + + $this->dispatcher->dispatchAfterResponse($syncJob); + $this->flashMessageService->success(__('The employee sync job has been dispatched')); + + return to_route('bo.dashboard'); + } +} diff --git a/app/Http/Controllers/Bo/FaqController.php b/app/Http/Controllers/Bo/FaqController.php deleted file mode 100644 index ef713005..00000000 --- a/app/Http/Controllers/Bo/FaqController.php +++ /dev/null @@ -1,70 +0,0 @@ -faq; - - $looplimit = count($faq); - for ($i = 0; $i < $looplimit; $i++) { - $faqToInsert = !empty($faq[$i]["question"]) && !empty($faq[$i]["answer"]); - if (isset($faq[$i]["id"]) && $faq[$i]["id"] !== null && $faqToInsert) { - $f = Faq::findOrFail($faq[$i]["id"]); - $f->question = $faq[$i]["question"]; - $f->answer = $faq[$i]["answer"]; - $f->save(); - } else { - if ($faqToInsert) { - $c = Faq::updateOrCreate([ - 'question' => $faq[$i]["question"], - 'answer' => $faq[$i]["answer"] - ]); - $faq[$i]["id"] = $c->id; - } else { - unset($faq[$i]); - $i--; - } - } - } - - return $faq; - } - - /** - * Remove the specified resource from storage. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response - */ - public function destroy(Request $request) - { - $faq = Faq::findOrFail($request->id); - $faq->delete(); - - return "Suppression terminée !"; - } -} diff --git a/app/Http/Controllers/Bo/FaqsController.php b/app/Http/Controllers/Bo/FaqsController.php new file mode 100644 index 00000000..14266538 --- /dev/null +++ b/app/Http/Controllers/Bo/FaqsController.php @@ -0,0 +1,104 @@ +authorize('viewAny', Faq::class); + $pagination = RequestHelper::pagination($request); + + $faqs = $this->executor->execute( + $query, + new GetPaginatedFaqsQueryInput( + pagination: $pagination, + ) + ); + + return view('bo.faqs.index', compact('faqs')); + } + + public function create(): View + { + $this->authorize('create', Faq::class); + + return view('bo.faqs.create'); + } + + public function store(StoreFaqRequest $request, CreateFaq $action): RedirectResponse + { + $this->authorize('create', Faq::class); + + $faq = $this->executor->execute( + $action, + $request->toCreateFaqInput(), + ); + + return to_route('bo.faqs.edit', $faq) + ->with('success', trans('crud.messages.has_been_created', [ + 'model' => Str::ucfirst(trans_choice('models.classes.faqs', 1)), + ])); + } + + public function edit(Faq $faq): View + { + $this->authorize('update', $faq); + + return view('bo.faqs.edit', compact('faq')); + } + + public function update(UpdateFaqRequest $request, Faq $faq, UpdateFaq $action): RedirectResponse + { + $this->authorize('update', $faq); + + $this->executor->execute( + $action, + $request->toUpdateFaqInput($faq), + ); + + return to_route('bo.faqs.edit', $faq) + ->with('success', trans('crud.messages.has_been_updated', [ + 'model' => Str::ucfirst(trans_choice('models.classes.faqs', 1)), + ])); + } + + public function destroy(Faq $faq, DeleteFaq $action): RedirectResponse + { + $this->authorize('delete', $faq); + + $this->executor->execute($action, new DeleteFaqInput(faq: $faq)); + + return to_route('bo.faqs.index') + ->with('warning', trans('crud.messages.has_been_deleted', [ + 'model' => Str::ucfirst(trans_choice('models.classes.faqs', \INF)), + ])); + } +} diff --git a/app/Http/Controllers/Bo/MagasinsController.php b/app/Http/Controllers/Bo/MagasinsController.php deleted file mode 100644 index a77dd801..00000000 --- a/app/Http/Controllers/Bo/MagasinsController.php +++ /dev/null @@ -1,206 +0,0 @@ -validate([ - 'name' => 'required|string|max:255', - 'address' => 'required|string|max:255', - 'postcode' => 'required', - 'city' => 'required|string|max:255', - ]); - - $shop = Magasin::create($request->except('_token')); - return redirect()->route('bo.magasins.edit', $shop->id)->with('success', 'Nouveau Magasin enregistré !'); - } - - /** - * Show the form for editing the specified resource. - * - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function edit(int $id) - { - $magasin = Magasin::findOrFail($id); - $exceptionsCollecte = $magasin->collecteExceptions()->orderBy('date')->get(); - return view('bo.magasins.edit', compact('magasin', 'exceptionsCollecte')); - } - - /** - * Update the specified resource in storage. - * - * @param \Illuminate\Http\Request $request - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function update(Request $request, int $id) - { - $request->validate([ - 'name' => 'required|string|max:255', - 'address' => 'required|string|max:255', - 'postcode' => 'required', - 'city' => 'required|string|max:255', - ]); - - $shop = Magasin::findOrFail($id); - $shop->fill($request->except('_token'))->save(); - return redirect()->route('bo.magasins.edit', $shop->id)->with('success', 'Modifications enregistrés !'); - } - - /** - * Remove the specified resource from storage. - * - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function destroy(int $id) - { - $shop = Magasin::findOrFail($id); - - $count = Magasin::count(); - - if ($count === 1) { - return redirect()->back() - ->withErrors("Suppression impossible : Vous devez conserver au moins 1 point de retrait."); - } - $shop->delete(); - return redirect()->route('bo.magasins.index'); - } - - /** - * bo - * ajx : affichage d'infos sur un magasin - * - * @param integer $id - * @param string|null $mode - * @return \Illuminate\Contracts\View\View - */ - public function getMagasinInfo(int $id, string $mode = null) - { - $magasin = Magasin::findOrFail($id); - if (!is_null($mode)) { - if ($mode == "tippy") { - return view('bo.magasins.tippy-card', compact('magasin')); - } - if ($mode == "json") { - return $magasin; - } - return view('bo.magasins.info-card', compact('magasin')); - } - return view('bo.magasins.info-popup', compact('magasin')); - } - - /** - * Save collect exceptions - * - * @param Request $request - * @return array - */ - public function saveExceptions(Request $request) - { - $collecteException = $request->collecte_exception; - - $looplimit = count($collecteException); - for ($i = 0; $i < $looplimit; $i++) { - $collecteExceptionToInsert = !empty($collecteException[$i]["date"]); - if ( - isset($collecteException[$i]["id"]) && - $collecteException[$i]["id"] !== null && - $collecteExceptionToInsert - ) { - $ce = CollecteException::findOrFail($collecteException[$i]["id"]); - $ce->date = $collecteException[$i]["date"]; - $ce->comment = $collecteException[$i]["comment"]; - $ce->type = $collecteException[$i]["type"]; - $ce->magasin_id = $collecteException[$i]["magasin_id"]; - $ce->save(); - } else { - if ($collecteExceptionToInsert) { - $ce = CollecteException::updateOrCreate([ - 'date' => $collecteException[$i]["date"], - 'comment' => $collecteException[$i]["comment"], - 'type' => $collecteException[$i]["type"], - 'magasin_id' => $collecteException[$i]["magasin_id"] - ]); - $collecteException[$i]["id"] = $ce->id; - } else { - unset($collecteException[$i]); - $i--; - } - } - } //end for - - // Remet dans l'ordre avant de renvoyer. - $this->arraySortByColumn($collecteException, "date"); - return $collecteException; - } - - /** - * helper function - * - * @param array $array - * @param string $column - * @param integer $direction - * @return void - */ - public function arraySortByColumn(array &$array, string $column, int $direction = SORT_ASC) - { - $reference_array = array(); - - foreach ($array as $key => $row) { - $reference_array[$key] = $row[$column]; - } - - array_multisort($reference_array, $direction, $array); - } - - /** - * delete collecte exception - * - * @param Request $request - * @return string - */ - public function destroyExceptions(Request $request) - { - $collecteException = CollecteException::findOrFail($request->id); - $collecteException->delete(); - - return "Suppression terminée !"; - } -} diff --git a/app/Http/Controllers/Bo/OrdersController.php b/app/Http/Controllers/Bo/OrdersController.php index 757f90f1..cc248703 100644 --- a/app/Http/Controllers/Bo/OrdersController.php +++ b/app/Http/Controllers/Bo/OrdersController.php @@ -1,236 +1,90 @@ sortOrders($request); + public function __construct( + private readonly Executor $executor, + ) { + } - /** @var string $search Search field */ - $search = $request->search; - if ($search) { - $this->searchQuery( - $query, - $search, - function (Builder $q) use ($search) { - $q->orWhereHas('timeslot.magasin', function (Builder $q) use ($search) { - $q->where('name', 'LIKE', "%{$search}%"); - }); - }, - 'reference' - ); - } - $searchFields = \implode(', ', [ - trans('Référence, Point de retrait'), + public function index(IndexOrdersRequest $request, GetBoPaginatedOrdersQuery $query): View + { + $this->authorize('viewAny', Order::class); + + $output = $this->executor->execute( + $query, + $request->toGetBoPaginatedOrdersQueryInput(), + ); + + return view('bo.orders.index', [ + 'orders' => $output->orders, + 'searchFields' => $output->searchFields, + 'orderStatusList' => $output->orderStatusList, ]); - - // * Dates Filter - if (!empty($request->input('date-order-start'))) { - if (!empty($request->input('date-order-end'))) { - $query->whereBetween('date', [ - $request->input('date-order-start'), - $request->input('date-order-end'), - ]); - } else { - $query->where('date', $request->input('date-order-start')); - } - } - if (!empty($request->input('date-retrait-start'))) { - if (!empty($request->input('date-retrait-end'))) { - $query->whereHas('timeslot', function (Builder $q) use ($request) { - $q->whereBetween('day', [ - $request->input('date-retrait-start'), - $request->input('date-retrait-end'), - ]); - }); - } else { - $query->whereHas('timeslot', function (Builder $q) use ($request) { - $q->where('day', $request->input('date-retrait-start')); - }); - } - } - - $orders = $query->paginate(10); - - return view('bo.orders.index', compact('orders', 'searchFields')); } - /** - * orders that ship today - * - * @param SortOrders $request - * @return \Illuminate\Contracts\View\View - */ - public function today(SortOrders $request) + public function today(Request $request, GetBoTodayOrdersQuery $query): View { - $query = $this->sortOrders($request); + $this->authorize('viewAnyToday', Order::class); - /** @var string $search Search field */ - $search = $request->search; - if ($search) { - $this->searchQuery( - $query, - $search, - function (Builder $q) use ($search) { - $q->orWhereHas('timeslot.magasin', function (Builder $q) use ($search) { - $q->where('name', 'LIKE', "%{$search}%"); - }); - }, - 'reference' - ); - } - $searchFields = \implode(', ', [ - trans('Référence, Point de retrait'), + $orders = $this->executor->execute( + $query, + new GetBoTodayOrdersQueryInput(RequestHelper::pagination($request)), + ); + + return view('bo.orders.index-today', compact('orders')); + } + + public function show(Order $order, GetBoOrderDetailQuery $query): View + { + $this->authorize('view', $order); + + $output = $this->executor->execute( + $query, + new GetBoOrderDetailQueryInput($order), + ); + + return view('bo.orders.view', [ + 'order' => $output->order, + 'shop' => $output->shop, + 'employee' => $output->employee, + 'crmCustomer' => $output->crmCustomer, ]); - - // Filter today. - $today = CarbonImmutable::now()->startOfDay(); - $query = $query->whereHas('timeslot', function ($q) use ($today) { - $q->where('day', $today); - }); - - $orders = $query->get(); - return view('bo.orders.index', compact('orders', 'today', 'searchFields')); } - /** - * Filter orders - * - * @param Request $request - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function sortOrders(Request $request) + public function cancel(Order $order, CancelOrder $action): RedirectResponse { - $query = Order::query(); + $this->authorize('cancel', $order); - - if ($request->input('rst')) { - Session::remove('orders.sort_col'); - Session::remove('orders.sort_way'); - } - if ($request->input('sort_col')) { - Session::put('orders.sort_col', $request->input('sort_col')); - Session::save(); - } - if ($request->input('sort_way')) { - Session::put('orders.sort_way', $request->input('sort_way')); - Session::save(); + try { + $this->executor->execute( + $action, + new CancelOrderInput($order), + ); + } catch (\Throwable) { + return back()->with('error', trans('Action failed')); } - if (Session::has('orders.sort_col') and Session::has('orders.sort_way')) { - switch (Session::get('orders.sort_col')) { - case 'date': - $query = $query->orderBy('date', Session::get('orders.sort_way')); - break; - case 'status_id': - $query = $query->orderBy('status_id', Session::get('orders.sort_way')); - break; - case 'magasin_id': - $query = $query->select('orders.*'); - $query = $query->leftJoin('timeslots', 'timeslots.order_id', '=', 'orders.id'); - $query = $query->leftJoin('magasins', 'timeslots.magasin_id', '=', 'magasins.id'); - $query = $query->orderBy('magasins.id', Session::get('orders.sort_way')); - break; - case 'date_retrait': - $query = $query->select('orders.*'); - $query = $query->leftJoin('timeslots', 'timeslots.order_id', '=', 'orders.id'); - $query = $query->orderBy('timeslots.day', Session::get('orders.sort_way')); - $query = $query->orderBy('timeslots.time', Session::get('orders.sort_way')); - break; - case 'customer_id': - $query = $query->orderBy('customer_id', Session::get('orders.sort_way')); - break; - } //end switch - } //end if - - return $query; - } - - /** - * action de changement de statut vers l'avant - * envoi de mails transctionnels - * - * @param string $reference Reference de la commande. - * @return \Illuminate\Http\RedirectResponse - */ - public function changeStatus(string $reference) - { - $order = Order::where('reference', $reference)->first(); - $order->status_id = $order->status_id + 1; - $order->save(); - - // Send confirm mail. - Mail::to($order->customer->email)->send(new OrderStatusMail($order)); - - return back()->with('success', "Changement de status enregistré pour la commande " . $order->reference . "."); - } - - /** - * mise au statut annulé d'une commande - * - * @param string $reference - * @return \Illuminate\Http\RedirectResponse - */ - public function cancelOrder(string $reference) - { - $order = Order::where('reference', $reference)->first(); - $order->status_id = 7; - $order->save(); - - return back()->with('success', "La commande " . $order->reference . " à été annulée."); - } - - /** - * bo - * ajx : affichage d'infos sur un client - * - * @param integer $id - * @param string|null $mode - * @return \Illuminate\Contracts\View\View - */ - public function getCustomerInfo(int $id, string $mode = null) - { - $cust = Customers::findOrFail($id); - if (!is_null($mode)) { - if ($mode == "tippy") { - return view('bo.customer.tippy-card', compact('cust')); - } - if ($mode == "json") { - return $cust->apiData; - } - return view('bo.customer.info-card', compact('cust')); - } - return view('bo.customer.info-popup', compact('cust')); - } - - /** - * bo : page détail commande - * - * @param string $reference - * @return \Illuminate\Contracts\View\View - */ - public function orderDetail(string $reference) - { - $order = Order::where('reference', '=', $reference)->firstOrFail(); - return view('bo.orders.detail', compact('order')); + return back()->with('warning', trans('Order cancelled')); } } diff --git a/app/Http/Controllers/Bo/PageController.php b/app/Http/Controllers/Bo/PageController.php new file mode 100644 index 00000000..d7b54129 --- /dev/null +++ b/app/Http/Controllers/Bo/PageController.php @@ -0,0 +1,47 @@ +authorize('update', $page); + + return view('bo.pages.edit', [ + 'page' => PageDto::fromModel($page), + ]); + } + + public function update(PagesUpdatePageRequest $request, Page $page, UpdatePage $action): RedirectResponse + { + $this->authorize('update', $page); + + $this->executor->execute( + $action, + $request->toUpdatePageInput($page), + ); + + return to_route('bo.pages.edit', $page->slug->value()) + ->with('success', trans('crud.messages.has_been_updated', [ + 'model' => Str::ucfirst(trans_choice('models.classes.pages', 1)), + ])); + } +} diff --git a/app/Http/Controllers/Bo/PickupExceptionsController.php b/app/Http/Controllers/Bo/PickupExceptionsController.php new file mode 100644 index 00000000..6f1cef58 --- /dev/null +++ b/app/Http/Controllers/Bo/PickupExceptionsController.php @@ -0,0 +1,106 @@ +authorize('viewAny', PickupException::class); + + $pickupExceptions = $this->executor->execute( + $query, + new GetPaginatedPickupExceptionsQueryInput( + pagination: RequestHelper::pagination($request), + ), + ); + + return view('bo.pickup-exceptions.index', compact('pickupExceptions')); + } + + public function create(): View + { + $this->authorize('create', PickupException::class); + + return view('bo.pickup-exceptions.create'); + } + + public function store(StorePickupExceptionRequest $request, CreatePickupException $action): RedirectResponse + { + $this->authorize('create', PickupException::class); + + $pickupException = $this->executor->execute( + $action, + $request->toCreatePickupExceptionInput(), + ); + + return to_route('bo.pickup-exceptions.edit', $pickupException) + ->with('success', trans('crud.messages.has_been_created', [ + 'model' => Str::ucfirst(trans_choice('models.classes.pickup-exceptions', 1)), + ])); + } + + public function edit(PickupException $pickupException): View + { + $this->authorize('update', $pickupException); + + $pickupException = PickupExceptionDto::fromModel($pickupException); + + return view('bo.pickup-exceptions.edit', compact('pickupException')); + } + + public function update(UpdatePickupExceptionRequest $request, PickupException $pickupException, UpdatePickupException $action): RedirectResponse + { + $this->authorize('update', $pickupException); + + $this->executor->execute( + $action, + $request->toUpdatePickupExceptionInput($pickupException), + ); + + return to_route('bo.pickup-exceptions.edit', $pickupException) + ->with('success', trans('crud.messages.has_been_updated', [ + 'model' => Str::ucfirst(trans_choice('models.classes.pickup-exceptions', 1)), + ])); + } + + public function destroy(PickupException $pickupException, DeletePickupException $action): RedirectResponse + { + $this->authorize('delete', $pickupException); + + $this->executor->execute( + $action, + new DeletePickupExceptionInput(pickupException: $pickupException), + ); + + return to_route('bo.pickup-exceptions.index') + ->with('warning', trans('crud.messages.has_been_deleted', [ + 'model' => Str::ucfirst(trans_choice('models.classes.pickup-exceptions', 1)), + ])); + } +} diff --git a/app/Http/Controllers/Bo/ProductIncosController.php b/app/Http/Controllers/Bo/ProductIncosController.php new file mode 100644 index 00000000..308053ca --- /dev/null +++ b/app/Http/Controllers/Bo/ProductIncosController.php @@ -0,0 +1,106 @@ +authorize('associateInco', $product); + + try { + $preview = $this->executor->execute( + $query, + $request->toGetArcadiaIncoPreviewQueryInput(), + ); + } catch (\RuntimeException $e) { + return response()->json([ + 'message' => __('Arcadia API error: :error', ['error' => $e->getMessage()]), + ], 502); + } + + if ($preview === null) { + return response()->json([ + 'message' => __('No INCO sheet found on Arcadia for this article number.'), + ], 404); + } + + return response()->json($preview); + } + + public function associate(AssociateProductIncoRequest $request, Product $product, AssociateProductInco $action): RedirectResponse + { + $this->authorize('associateInco', $product); + + try { + $inco = $this->executor->execute( + $action, + $request->toAssociateProductIncoInput($product), + ); + } catch (\RuntimeException $e) { + return back()->with('danger', __('Arcadia API error: :error', ['error' => $e->getMessage()])); + } + + return to_route('bo.products.incos.edit', compact('product', 'inco')) + ->with('success', __('The INCO sheet has been successfully associated with the product.')); + } + + public function sync(SyncProductIncoRequest $request, Product $product, SyncProductInco $action): RedirectResponse + { + $this->authorize('syncInco', $product); + + try { + $inco = $this->executor->execute( + $action, + $request->toSyncProductIncoInput($product), + ); + } catch (\RuntimeException $e) { + return back()->with('danger', __('Arcadia API error: :error', ['error' => $e->getMessage()])); + } + + return to_route('bo.products.incos.edit', compact('product', 'inco')) + ->with('success', __('The INCO sheet has been successfully synchronized from Arcadia.')); + } + + public function create(Product $product): View + { + return $this->edit($product); + } + + public function edit(Product $product, ?ProductInco $inco = null): View + { + $this->authorize('associateInco', $product); + + $productDto = ProductDto::fromModel($product); + $incoModel = $inco ?? $product->inco; + $incoDto = $incoModel instanceof ProductInco ? ProductIncoDto::fromModel($incoModel) : null; + + return view('bo.product-incos.edit', [ + 'product' => $productDto, + 'inco' => $incoDto, + ]); + } +} diff --git a/app/Http/Controllers/Bo/ProductsController.php b/app/Http/Controllers/Bo/ProductsController.php index fee2b36b..5e5ed076 100644 --- a/app/Http/Controllers/Bo/ProductsController.php +++ b/app/Http/Controllers/Bo/ProductsController.php @@ -1,912 +1,158 @@ query('filter_range'); - $filter_brand = $request->query('filter_brand'); - $filter_name = $request->query('filter_name'); - $filter_code_product = $request->query('filter_code_product'); - - $products = (new Product())::query(); - - if (!empty($filter_code_product)) { - $products = $products->whereHas('foodProduct', function (Builder $q) use ($filter_code_product) { - $q->where('no_art', 'like', $filter_code_product); - }); - } - if (!empty($filter_name)) { - $products = $products->where('name', 'like', '%' . $filter_name . '%'); - } - if (!empty($filter_range)) { - $products = $products->where('range_id', $filter_range); - } - if (!empty($filter_brand)) { - $products = $products->where('brand', $filter_brand); - } - $products = $products->orderBy('order', 'ASC')->paginate(10); - - // Ici récupération des infos additionnelles pour affichage dans la liste. - foreach ($products as &$product) { - if (!empty($product->product_type)) { - $product->additionnalProductInfo = $product->additionnalProductInfo($product->product_type); - if ($product->additionnalProductInfo === null) { - // N'existe pas on renseigne un vide. - $product_type = $product->product_type; - $modelClass = 'App\Models\\' . ucfirst($product_type); - $product->$product_type = new $modelClass(); - } - } - } - unset($product); - return view('bo.products.index', compact( - 'products', - 'ranges', - 'filter_name', - 'filter_range', - 'filter_brand', - 'filter_code_product' - )); + public function __construct( + private readonly Executor $executor, + ) { } - /** - * Show the form for creating a new resource. - * @param string $product_type - * @return \Illuminate\Http\Response - */ - public function create(string $product_type = null) + #[\Override] + public function getModelClass(): string { - if (!empty($product_type) && !array_key_exists($product_type, config('theme.enum_product_types'))) { - abort(404, "Cette page n'existe pas."); - } - $modelClass = 'App\Models\\' . ucfirst($product_type); - $product = new Product(); - if (!empty($product_type)) { - $product->$product_type = new $modelClass(); - } - $ranges = Range::all(); - $taxes = TaxRate::all(); - $existingTags = Tag::all(); - $selectedtags = array(); - - $existingProds = Product::all(); - $selectedProds = array(); - - return view('bo.products.create', compact( - 'product_type', - 'product', - 'ranges', - 'taxes', - 'existingTags', - 'selectedtags', - 'existingProds', - 'selectedProds' - )); + return Product::class; } - /** - * store a new product - * - * @param ProductRequest $request - * @return \Illuminate\Http\Response - */ - public function store(ProductRequest $request) + public function starred(IndexProductRequest $request, GetBoPaginatedProductsQuery $query): View { - // Products fields. - $name = $request->name; - $brand = $request->brand; - $description = $request->description; - $picture = $request->picture; - $picture_large = $request->picture_large; - $price = $request->price; - $invoicing_unit = $request->invoicing_unit; - $priceBuy = $request->price_buy; - $order_unit = $request->order_unit; - $stock = $request->stock; - $reference = $request->reference; - $sell_unit = $request->sell_unit; - $weight = $request->weight; - $weight_unit = $request->weight_unit; - $weight_variable = $request->weight_variable; - $status = $request->status; - $orderable_start = $request->orderable_start_date === null ? null - : $request->orderable_start_date . " " . $request->orderable_start_time; - $orderable_end = $request->orderable_end_date === null ? null - : $request->orderable_end_date . " " . $request->orderable_end_time; - $star = $request->star; - $slug = Str::slug($name); - $rangeId = $request->range_id; - $taxRateId = $request->tax_rate_id; + $this->authorize('viewStarred', Product::class); - $this->checkSlugExistsWithinRange($request, $rangeId, $slug); - - $product = new Product(); - $product->name = $name; - $product->brand = $brand; - $product->description = $description; - $product->price = $price; - $product->invoicing_unit = $invoicing_unit; - $product->price_buy = $priceBuy; - $product->order_unit = $order_unit; - $product->stock = $stock; - $product->reference = $reference; - $product->sell_unit = $sell_unit; - $product->weight = $weight; - $product->weight_unit = $weight_unit; - $product->weight_variable = $weight_variable; - $product->slug = $slug; - $product->status = $status; - $product->orderable_start = $orderable_start; - $product->orderable_end = $orderable_end; - $product->star = $star; - $product->range_id = $rangeId; - $product->tax_rate_id = $taxRateId; - $product->save(); - - // Check si le slug existe dans la table old_slugs, auquel cas il est nettoyé car ce n'est plus un old_slug. - $this->cleanOldSlug($slug); - - $str_random = Str::random(5); - - if ($picture !== null) { - $imageName = $product->id . '_' . $str_random . '.' . $picture->extension(); - $picture->move(storage_path('app/public/images/produits'), $imageName); - $product->picture = $imageName; - $product->save(); - } - - if ($picture_large !== null) { - $imageName = $product->id . '_' . $str_random . '_large.' . $picture_large->extension(); - $picture_large->move(storage_path('app/public/images/produits'), $imageName); - $product->picture_large = $imageName; - $product->save(); - } - - // Ajout des infos additionnelles. - $product_type = $request->product_type; - - if ($product_type !== null) { - $product->product_type = $product_type; - $product->save(); - $methodName = "save" . ucfirst($product_type); - $this->$methodName($request, $product->id); - } - - // Tags associés. - $this->syncTags($request->tags, $product); - - // Produits associés. - $this->syncProduitsAssocies($request->prods, $product); - - // Additionnal product info (foodProduct). - return redirect()->route('bo.products.index'); + return $this->renderIndex($request, $query, starred: true); } - /** - * Show the form for editing the specified resource. - * - * @param App\Models\Product $product - * @return \Illuminate\Http\Response - */ - public function edit(Product $product) + public function index(IndexProductRequest $request, GetBoPaginatedProductsQuery $query, bool $starred = false): View { - if (!empty($product->product_type)) { - $product->additionnalProductInfo = $product->additionnalProductInfo($product->product_type); - /** - * Above lines equivalent to - * $product = Product::with('additionnalProductInfo')->findOrFail($id); - */ - if ($product->additionnalProductInfo === null) { - // N'existe pas on renseigne un vide. - $product_type = $product->product_type; - $modelClass = 'App\Models\\' . ucfirst($product_type); - $product->$product_type = new $modelClass(); - } - } + $this->authorize('viewAny', Product::class); - $ranges = Range::all(); - $taxes = TaxRate::all(); - $existingTags = Tag::all(); - $selectedtags = $product->tags; - - $existingProds = Product::all(); - $selectedProds = $product->products; - $existingProds = $existingProds->diff($selectedProds); - - return view('bo.products.edit', compact( - 'product', - 'ranges', - 'taxes', - 'existingTags', - 'selectedtags', - 'existingProds', - 'selectedProds' - )); + return $this->renderIndex($request, $query, $starred); } - /** - * Check if slug already exists, if so redirect - * - * @param Request $request - * @param integer $rangeId - * @param string $slug - * @param integer|null $productId - * @return \Illuminate\Http\RedirectResponse|void - */ - private function checkSlugExistsWithinRange(Request $request, int $rangeId, string $slug, int $productId = null) + private function renderIndex(IndexProductRequest $request, GetBoPaginatedProductsQuery $query, bool $starred = false): View { - // Check si le slug existe déjà dans cette gamme de produits. - $slugExist = Product::where([ - ['range_id', $rangeId], - ['slug', $slug], - ['id', '<>', $productId] - ])->first(); + $output = $this->executor->execute($query, $request->toGetBoPaginatedProductsQueryInput($starred)); - if ($slugExist) { - return redirect()->back() - ->withInput($request->input()) - ->withErrors("Erreur : un produit avec le slug d'accès \"" . $slug . - "\" éxiste déjà. Veuillez changer le nom du produit."); - } + return view('bo.products.index', [ + 'products' => $output->products, + 'brands' => $output->brands, + 'ranges' => $output->ranges, + 'tags' => $output->tags, + 'discounts' => $output->discounts, + 'searchFields' => $output->searchFields, + ]); } - /** - * If new slug for product then save oldslug - * - * @param Product $product - * @param string $slug - * @return void - */ - private function saveNewSlugForProduct(Product $product, string $slug) + public function create(GetProductFormDataQuery $query): View { - if ($product->slug != $slug) { - $exist = OldSlug::where('slug', $product->slug)->first(); - if ($exist === null) { - $oldSlug = new OldSlug(); - $oldSlug->product_id = $product->id; - $oldSlug->slug = $product->slug; - $oldSlug->save(); - } - } + $this->authorize('create', Product::class); + + $formData = $this->executor->execute($query, new GetProductFormDataQueryInput()); + + return view('bo.products.create', [ + 'brands' => $formData->brands, + 'taxes' => $formData->taxes, + 'invoicingUnits' => $formData->invoicingUnits, + 'sellUnits' => $formData->sellUnits, + 'orderUnits' => $formData->orderUnits, + 'ranges' => $formData->ranges, + 'tags' => $formData->tags, + 'existingProds' => $formData->existingProds, + 'selectedProds' => $formData->selectedProds, + ]); } - /** - * clean oldslug if exists - * - * @param string $slug - * @return void - */ - private function cleanOldSlug(string $slug) + public function store(StoreProductRequest $request, CreateProduct $action): RedirectResponse { - // Check si le slug existe dans la table old_slug, auquel cas il est nettoyé. - $oldSlug = OldSlug::where('slug', $slug)->first(); - if ($oldSlug) { - $oldSlug->delete(); - } - } + $this->authorize('create', Product::class); - /** - * Store and update saved images on product - * - * @param UploadedFile|null $picture - * @param Product $product - * @param UploadedFile|null $picture_large - * @return void - */ - private function manageProductImages($picture, Product &$product, $picture_large) - { - - $str_random = Str::random(5); - - if ($picture !== null) { - if ( - $product->picture !== null && - file_exists(storage_path('app/public/images/produits/') . $product->picture) - ) { - unlink(storage_path('app/public/images/produits/') . $product->picture); - } - $imageName = $product->id . '_' . $str_random . '.' . $picture->extension(); - $picture->move(storage_path('app/public/images/produits'), $imageName); - $product->picture = $imageName; - } - - if ($picture_large !== null) { - if ( - $product->picture_large !== null && - file_exists(storage_path('app/public/images/produits/') . $product->picture_large) - ) { - unlink(storage_path('app/public/images/produits/') . $product->picture_large); - } - $imageName = $product->id . '_' . $str_random . '_large.' . $picture_large->extension(); - $picture_large->move(storage_path('app/public/images/produits'), $imageName); - $product->picture_large = $imageName; - } - } - - /** - * sync tags to product - * - * @param array|null $tags - * @param Product $product - * @return void - */ - private function syncTags(array $tags = null, Product &$product) - { - if (!empty($tags)) { - $arTagIds = array(); - foreach ($tags as $tag) { - $oTag = json_decode($tag); - if (empty($oTag->id)) { - // We need a new tag. - $arTagIds[] = $this->storeTag($oTag); - } else { - $arTagIds[] = $oTag->id; - } - } - // Prise en charge de la liaison avec les produits. - $product->tags()->sync($arTagIds); - } else { - $product->tags()->sync(array()); - } - } - - /** - * sync associated products to product - * - * @param string|null $prods - * @param Product $product - * @return void - */ - private function syncProduitsAssocies(string $prods = null, Product $product) - { - if (!empty($prods)) { - $productIds = explode(",", $prods); - // Prise en charge de la liaison avec les produits. - $product->products()->sync($productIds); - } else { - $product->products()->sync(array()); - } - } - - /** - * Update the specified resource. - * - * @param \App\Models\Product $product - * @param ProductRequest $request - * @return \Illuminate\Http\Response - */ - public function update(Product $product, ProductRequest $request) - { - $orderable_end_time = $request->orderable_end_time === null ? "23:59" : $request->orderable_end_time; - - $name = $request->name; - $brand = $request->brand; - $description = $request->description; - $price = $request->price; - $invoicing_unit = $request->invoicing_unit; - $priceBuy = $request->price_buy; - $order_unit = $request->order_unit; - $stock = $request->stock; - $reference = $request->reference; - $sell_unit = $request->sell_unit; - $weight = $request->weight; - $weight_unit = $request->weight_unit; - $weight_variable = $request->weight_variable; - $status = $request->status; - $orderable_start = $request->orderable_start_date === null ? null - : $request->orderable_start_date . " " . $request->orderable_start_time; - $orderable_end = $request->orderable_end_date === null ? null - : $request->orderable_end_date . " " . $orderable_end_time; - $star = $request->star; - $slug = Str::slug($name); - $rangeId = $request->range_id; - $taxRateId = $request->tax_rate_id; - - $this->checkSlugExistsWithinRange($request, $rangeId, $slug, $product->id); - - $this->manageProductImages($request->picture, $product, $request->picture_large); - - $product->name = $name; - - $this->saveNewSlugForProduct($product, $slug); - - $product->brand = $brand; - $product->description = $description; - $product->price = $price; - $product->invoicing_unit = $invoicing_unit; - $product->price_buy = $priceBuy; - $product->order_unit = $order_unit; - $product->stock = $stock; - $product->reference = $reference; - $product->sell_unit = $sell_unit; - $product->weight = $weight; - $product->weight_unit = $weight_unit; - $product->weight_variable = $weight_variable; - $product->slug = $slug; - $product->status = $status; - $product->orderable_start = $orderable_start; - $product->orderable_end = $orderable_end; - $product->star = $star; - $product->range_id = $rangeId; - $product->tax_rate_id = $taxRateId; - $product->save(); - - // Check si le slug existe dans la table old_slug, auquel cas il est supprimé. - $this->cleanOldSlug($slug); - - // Ajout des infos additionnelles. - $product_type = $request->product_type; - - // Save additionnal. - if ($product_type !== null) { - $methodName = "save" . ucfirst($product_type); - $this->$methodName($request, $product->id); - } - - // Tags associés. - $this->syncTags($request->tags, $product); - - // Produits associés. - $this->syncProduitsAssocies($request->prods, $product); - - return redirect()->route('bo.products.edit', $product->id)->with('success', 'Modifications enregistrés !'); - } - - /** - * Helper method to store a new tag if necessary - * Otherwise retreive an existing tag to associate its id - * - * @param \App\Models\Tag $oTag - * @return integer - */ - public function storeTag(Tag $oTag) - { - $slug = Str::slug($oTag->label); - $tag = Tag::where('slug', $slug)->first(); - if ($tag === null) { - // Si on pas encore ce tag on le crée. - $tag = new Tag(); - $tag->label = $oTag->label; - $tag->slug = Str::slug($oTag->label); - // A new tag is published by default. - $tag->status = 1; - $tag->order = TagsController::getLastOrder(); - $tag->save(); - } - return $tag->id; - } - - /** - * destroy a product (soft delete) - * - * @param App\Models\Product $product - * @return \Illuminate\Http\Response - */ - public function destroy(Product $product) - { - if ($product->picture !== null && file_exists(storage_path('app/public/images/produits/') . $product->picture)) { - unlink(storage_path('app/public/images/produits/') . $product->picture); - } - if ( - $product->picture_large !== null && - file_exists(storage_path('app/public/images/produits/') . $product->picture_large) - ) { - unlink(storage_path('app/public/images/produits/') . $product->picture_large); - } - - OldSlug::where('product_id', $product->id)->delete(); - - $product->delete(); - return redirect()->route('bo.products.index'); - } - - /** - * check if inco data exists - * - * @param \Illuminate\Http\Request $request - * @return mixed - */ - public function checkIncoData(Request $request) - { - $id = $request->id; - $xmlInco = XmlInco::find($id); - - if (!empty($xmlInco)) { - // We have data. - $hasInco = __("Des données Inco sont disponibles, souhaitez vous les associer à ce produit ?"); - $preparedImages = $this->prepareIncoImages($xmlInco->picture); - return view('bo.products.load-inco', compact('hasInco', 'xmlInco', 'preparedImages')); - } else { - return array("data" => array()); - } - } - - /** - * Show prepared images - * - * @param Request $request - * @return \Illuminate\Contracts\View\View - */ - public function getPrepareIncoImages(Request $request) - { - $picture = $request->picture; - $preparedImages = $this->prepareIncoImages($picture); - return view('bo.products.inco-images', compact('preparedImages')); - } - - /** - * prepared images - * - * @param array $picture - * @return \Illuminate\Contracts\View\View - */ - public function prepareIncoImages(array $picture) - { - $preparedImages = array(); - - foreach ($picture as $incoImage) { - // Charge. - if (File::exists(storage_path($incoImage))) { - $imagePath = storage_path($incoImage); - // Redimensionne. - // Create mask. - // Resize original image into mask. - $this->resizeImg( - $imagePath, - config('theme.product_image_large_maxwidth'), - config('theme.product_image_large_maxheight'), - File::name($incoImage) . "_large.png" - ); - - $this->resizeImg( - $imagePath, - config('theme.product_image_maxwidth'), - config('theme.product_image_maxheight'), - File::name($incoImage) . "_small.png" - ); - - - $preparedImages[] = "inco/images/" . File::name($incoImage) . "_large.png"; - }//end if - }//end foreach - return $preparedImages; - } - - /** - * redimensionne une image dans un masque - */ - /** - * redimensionne une image dans un masque - * - * @param string $imagePath - * @param integer $maskWidth - * @param integer $maskHeight - * @param string $resizedName - * @return boolean|void - */ - private function resizeImg(string $imagePath, int $maskWidth, int $maskHeight, string $resizedName) - { - // ---- création du masque - $mask = imagecreatetruecolor($maskWidth, $maskHeight); - imagesavealpha($mask, true); - $color = imagecolorallocatealpha($mask, 0, 0, 0, 127); - imagefill($mask, 0, 0, $color); - - // ---- Récupère le mime type de l'image - $info = getimagesize($imagePath); - $mime = $info['mime']; - - // ---- Défini les fonctions à appeler selon le type de fichier - switch ($mime) { - case 'image/jpeg': - $image_create_func = 'imagecreatefromjpeg'; - break; - - case 'image/png': - $image_create_func = 'imagecreatefrompng'; - break; - default: - return false; - } - - // ---- Chargement de l'image source - $img = $image_create_func($imagePath); - list($imgWidth, $imgHeight) = getimagesize($imagePath); - - // ---- Calcul les nouvelles dimensions de l'image - if ($imgWidth > $imgHeight) { - $finalWidth = $maskWidth; - $finalHeight = ($finalWidth * $imgHeight) / $imgWidth; - } else { - $finalHeight = $maskHeight; - $finalWidth = ($finalHeight * $imgWidth) / $imgHeight; - } - - // ---- Redimensionne l'image source - $resizeImg = imagecreatetruecolor($finalWidth, $finalHeight); - imagealphablending($resizeImg, false); - imagesavealpha($resizeImg, true); - imagecopyresampled($resizeImg, $img, 0, 0, 0, 0, $finalWidth, $finalHeight, $imgWidth, $imgHeight); - - // Copie l'image redimensionnée dans le mask. - imagecopy( - $mask, - $resizeImg, - ($maskWidth - $finalWidth) / 2, - ($maskHeight - $finalHeight) / 2, - 0, - 0, - imagesx($resizeImg), - imagesy($resizeImg) + $product = $this->executor->execute( + $action, + $request->toCreateProductInput() ); - imagealphablending($mask, false); - imagesavealpha($mask, true); - // Ecrit dans storage/app/public. - // Créer le fichier final. - imagepng($mask, storage_path('app/public/inco/images/' . $resizedName), 5); - - // Libère la mémoire associée aux images manipulées. - imagedestroy($img); - imagedestroy($resizeImg); - imagedestroy($mask); + return to_route('bo.products.edit', $product) + ->with('success', trans('crud.messages.has_been_created', [ + 'model' => Str::ucfirst(trans_choice('models.classes.products', 1)), + ])); } - /** - * set une image préparée comme image du produit - */ - /** - * set une image préparée comme image du produit - * - * @param Request $request - * @return \App\Models\Product - */ - public function setIncoImage(Request $request) + public function edit(Product $product, GetProductFormDataQuery $query): View { - $imagePath = $request->picture; + $this->authorize('update', $product); - $imagePath = storage_path("app/public/" . $imagePath); + $formData = $this->executor->execute($query, new GetProductFormDataQueryInput(product: $product)); - $product_id = $request->product; - $product = Product::findOrFail($product_id); - - $str_random = Str::random(5); - // Default is large image. - $finalImageName = $product->id . '_' . $str_random . '_large.' . File::extension($imagePath); - - $productimagespath = storage_path('app/public/images/produits'); - - if (!File::isDirectory($productimagespath)) { - File::makeDirectory($productimagespath, 0644, true); - } - - File::copy($imagePath, $productimagespath . "/" . $finalImageName); - - // Suppression de l'ancien fichier. - if ( - $product->picture_large !== null && - file_exists(storage_path('app/public/images/produits/') . $product->picture_large) - ) { - unlink(storage_path('app/public/images/produits/') . $product->picture_large); - } - - $product->picture_large = $finalImageName; - - - // Now set small image. - $imagePath = str_replace("_large", "_small", $imagePath); - $finalImageName = $product->id . '_' . $str_random . '.' . File::extension($imagePath); - File::copy($imagePath, $productimagespath . "/" . $finalImageName); - - // Suppression de l'ancien fichier. - if ($product->picture !== null && file_exists(storage_path('app/public/images/produits/') . $product->picture)) { - unlink(storage_path('app/public/images/produits/') . $product->picture); - } - - $product->picture = $finalImageName; - - $product->save(); - - return $product; - } - - /** - * helper method to update additionnal product info - * - * @param Request $request - * @param integer $product_id - * @return void - */ - public function saveFoodProduct(Request $request, int $product_id) - { - $foodProduct = FoodProduct::firstOrNew([ - 'product_id' => $product_id, + return view('bo.products.edit', [ + 'product' => $product, + 'brands' => $formData->brands, + 'taxes' => $formData->taxes, + 'invoicingUnits' => $formData->invoicingUnits, + 'sellUnits' => $formData->sellUnits, + 'orderUnits' => $formData->orderUnits, + 'ranges' => $formData->ranges, + 'tags' => $formData->tags, + 'existingProds' => $formData->existingProds, + 'selectedProds' => $formData->selectedProds, ]); - - if (!empty($request->no_art)) { - $foodProduct->no_art = $request->no_art; - } - $foodProduct->ingredients = $request->ingredients; - $foodProduct->preparation = $request->preparation; - $foodProduct->servings = $request->servings; - $foodProduct->allergens = $request->allergens; - $foodProduct->selling_argument = $request->selling_argument; - $foodProduct->nv_ref_weight_g = $request->nv_ref_weight_g; - $foodProduct->nv_kj = $request->nv_kj; - $foodProduct->nv_kcal = $request->nv_kcal; - $foodProduct->nv_fat_g = $request->nv_fat_g; - $foodProduct->nv_sat_fat_g = $request->nv_sat_fat_g; - $foodProduct->nv_carb_g = $request->nv_carb_g; - $foodProduct->nv_sugar_g = $request->nv_sugar_g; - $foodProduct->nv_fiber_g = $request->nv_fiber_g; - $foodProduct->nv_protein_g = $request->nv_protein_g; - $foodProduct->nv_salt_g = $request->nv_salt_g; - $foodProduct->nv_serving_size_g = $request->nv_serving_size_g; - $foodProduct->nv_serving_kj = $request->nv_serving_kj; - $foodProduct->nv_serving_kcal = $request->nv_serving_kcal; - $foodProduct->nv_serving_fat_g = $request->nv_serving_fat_g; - $foodProduct->nv_serving_sat_fat_g = $request->nv_serving_sat_fat_g; - $foodProduct->nv_serving_carb_g = $request->nv_serving_carb_g; - $foodProduct->nv_serving_sugar_g = $request->nv_serving_sugar_g; - $foodProduct->nv_serving_fiber_g = $request->nv_serving_fiber_g; - $foodProduct->nv_serving_protein_g = $request->nv_serving_protein_g; - $foodProduct->nv_serving_salt_g = $request->nv_serving_salt_g; - $foodProduct->nv_daily_energy = $request->nv_daily_energy; - $foodProduct->nv_daily_fat = $request->nv_daily_fat; - $foodProduct->nv_daily_sat_fat = $request->nv_daily_sat_fat; - $foodProduct->nv_daily_carb = $request->nv_daily_carb; - $foodProduct->nv_daily_sugar = $request->nv_daily_sugar; - $foodProduct->nv_daily_fiber = $request->nv_daily_fiber; - $foodProduct->nv_daily_protein = $request->nv_daily_protein; - $foodProduct->nv_daily_salt = $request->nv_daily_salt; - $foodProduct->nutriscore = $request->nutriscore; - $foodProduct->nutriscore_args = $request->nutriscore_args; - - $foodProduct->product_id = $product_id; - - - $foodProduct->save(); } - /** - * helper method to update toolproduct info - * - * @param Request $request - * @param integer $product_id - * @return void - * - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed - */ - public function saveToolProduct(Request $request, int $product_id) + public function update(UpdateProductRequest $request, Product $product, UpdateProduct $action): RedirectResponse { - // phpcs:enable - $toolProduct = ToolProduct::firstOrNew([ - 'product_id' => $product_id, - ]); + $this->authorize('update', $product); - $toolProduct->save(); + $this->executor->execute( + $action, + $request->toUpdateProductInput($product) + ); + + return to_route('bo.products.edit', $product) + ->with('success', trans('crud.messages.has_been_updated', [ + 'model' => Str::ucfirst(trans_choice('models.classes.products', 1)), + ])); } - /** - * helper method to update anifoodProduct info - * - * @param Request $request - * @param integer $product_id - * @return void - */ - public function saveAnifoodProduct(Request $request, int $product_id) + public function destroy(Product $product, DeleteProduct $action): RedirectResponse { - $anifoodProduct = AnifoodProduct::firstOrNew([ - 'product_id' => $product_id, - ]); + $this->authorize('delete', $product); - $anifoodProduct->composition = $request->composition; - $anifoodProduct->servings = $request->servings; - $anifoodProduct->save(); - } + $this->executor->execute( + $action, + new DeleteProductInput($product) + ); - /** - * helper method to update garmentProduct info - * - * @param Request $request - * @param integer $product_id - * @return void - */ - public function saveGarmentProduct(Request $request, int $product_id) - { - $garmentProduct = GarmentProduct::firstOrNew([ - 'product_id' => $product_id, - ]); - - $garmentProduct->size = $request->size; - $garmentProduct->color = $request->color; - $garmentProduct->material = $request->material; - $garmentProduct->save(); - } - - /** - * index des produits mis en avant - * - * @return * @return \Illuminate\Contracts\View\View - */ - public function starred() - { - $products = Product::where('star', 1)->paginate(10); - return view('bo.products.starred', compact('products')); - } - - /** - * Swap product order with the product at the target order. - * - * @param UpdateProductOrderRequest $request - * @param Product $product - * @return \Illuminate\Http\RedirectResponse - */ - public function changeSelectedOrder(UpdateProductOrderRequest $request, Product $product) - { - $newOrder = (int) $request->getOrder(); - $oldOrder = (int) $product->order; - - if ($oldOrder === $newOrder) { - return redirect()->back(); - } - - return DB::transaction(function () use ($product, $oldOrder, $newOrder) { - $targetProduct = Product::withTrashed() - ->where('order', $newOrder) - ->where('id', '!=', $product->id) - ->first(); - - if ($targetProduct) { - $targetProduct->order = -1; - $targetProduct->saveOrFail(); - - $product->order = $newOrder; - $product->saveOrFail(); - - $targetProduct->order = $oldOrder; - $targetProduct->saveOrFail(); - } else { - $product->order = $newOrder; - $product->saveOrFail(); - } - - return redirect()->back()->with('success', trans('crud.messages.order_changed')); - }); + return to_route('bo.products.index') + ->with('warning', trans('crud.messages.has_been_deleted', [ + 'model' => Str::ucfirst(trans_choice('models.classes.products', 1)), + ])); } } diff --git a/app/Http/Controllers/Bo/PromotionsController.php b/app/Http/Controllers/Bo/PromotionsController.php deleted file mode 100644 index 309eccc9..00000000 --- a/app/Http/Controllers/Bo/PromotionsController.php +++ /dev/null @@ -1,143 +0,0 @@ -products; - return view('bo.promotions.create', compact('discTypes', 'existingProds', 'selectedProds')); - } - - /** - * Store a newly created resource in storage. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response - */ - public function store(Request $request) - { - - $request->validate([ - 'product_id' => 'required', - ]); - - $productIds = explode(",", $request->product_id); - $discType = $request->discount_type_id; - $value = $request->discount_value; - $isOldPriceDisplayed = $request->boolean('is_old_price_displayed'); - $date_start = $request->date_start_date . " " . $request->date_start_time; - $date_end = $request->date_end_date . " " . $request->date_end_time; - - $promotion = new Promotion(); - $promotion->discount_type_id = $discType; - $promotion->discount_value = $value; - $promotion->is_old_price_displayed = $isOldPriceDisplayed; - $promotion->date_start = $date_start; - $promotion->date_end = $date_end; - $promotion->save(); - - // Prise en charge de la liaison avec les produits. - $promotion->products()->sync($productIds); - - return redirect()->route('bo.promotions.index'); - } - - /** - * Show the form for editing the specified resource. - * - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function edit(int $id) - { - $promotion = Promotion::findOrFail($id); - $discTypes = DiscountType::all(); - - $existingProds = Product::all(); - $selectedProds = $promotion->products; - $existingProds = $existingProds->diff($selectedProds); - - return view('bo.promotions.edit', compact('promotion', 'discTypes', 'existingProds', 'selectedProds')); - } - - /** - * Update the specified resource in storage. - * - * @param \Illuminate\Http\Request $request - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function update(Request $request, int $id) - { - $promotion = Promotion::findOrFail($id); - - $request->validate([ - 'product_id' => 'required', - ]); - - $productIds = explode(",", $request->product_id); - $discType = $request->discount_type_id; - $value = $request->discount_value; - $isOldPriceDisplayed = $request->boolean('is_old_price_displayed'); - $date_start = $request->date_start_date . " " . $request->date_start_time; - $date_end = $request->date_end_date . " " . $request->date_end_time; - - $promotion->discount_type_id = $discType; - $promotion->discount_value = $value; - $promotion->is_old_price_displayed = $isOldPriceDisplayed; - $promotion->date_start = $date_start; - $promotion->date_end = $date_end; - $promotion->save(); - - // Prise en charge de la liaison avec les produits. - $promotion->products()->sync($productIds); - - return redirect()->route('bo.promotions.edit', $promotion->id)->with('success', 'Modifications enregistrés !'); - } - - /** - * Remove the specified resource from storage. - * - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function destroy(int $id) - { - $p = Promotion::findOrFail($id); - - // Prise en charge de la liaison avec les produits. - $p->products()->detach(); - - $p->delete(); - - return redirect()->route('bo.promotions.index'); - } -} diff --git a/app/Http/Controllers/Bo/RangesController.php b/app/Http/Controllers/Bo/RangesController.php index 2a6441e8..c6955ee8 100644 --- a/app/Http/Controllers/Bo/RangesController.php +++ b/app/Http/Controllers/Bo/RangesController.php @@ -1,169 +1,114 @@ authorize('viewAny', Range::class); + + $pagination = RequestHelper::pagination($request); + + $ranges = $this->executor->execute( + $query, + new GetPaginatedRangesQueryInput( + pagination: $pagination, + ) + ); + return view('bo.ranges.index', compact('ranges')); } - /** - * Show the form for creating a new resource. - * - * @return \Illuminate\Http\Response - */ - public function create() + public function create(): View { + $this->authorize('create', Range::class); + return view('bo.ranges.create'); } - /** - * Store a newly created resource in storage. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response - */ - public function store(Request $request) + public function store(StoreRangeRequest $request, CreateRange $action): RedirectResponse { - $name = $request->name; - $slug = Str::slug($name); - $description = $request->description != null ? $request->description : null; - $picture = $request->picture; - $status = $request->status === null ? 0 : 1; + $this->authorize('create', Range::class); - $request->validate([ - 'name' => 'required|string|max:255', - 'description' => 'sometimes|nullable', - 'picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:max-width=' . - config('theme.range_image_maxwidth') . ',max-height=' . - config('theme.range_image_maxheight'), - ]); + $range = $this->executor->execute( + $action, + $request->toCreateRangeInput(), + ); - $range = new Range(); - $range->name = $name; - $range->slug = $slug; - $range->description = $description; - $range->status = $status; - $range->save(); - - if ($picture !== null) { - $imageName = $range->id . '_' . $slug . '_' . Str::random(5) . '.' . $picture->extension(); - $picture->move(storage_path('app/public/images/gammes'), $imageName); - $range->picture = $imageName; - $range->save(); - } - - return redirect()->route('bo.ranges.index'); + return to_route('bo.ranges.edit', $range) + ->with('success', trans('crud.messages.has_been_created', [ + 'model' => Str::ucfirst(trans_choice('models.classes.ranges', 1)), + ])); } - /** - * Show the form for editing the specified resource. - * - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function edit(int $id) + public function edit(Range $range): View { - $range = Range::findOrFail($id); + $this->authorize('update', $range); + + $range = RangeDto::fromModel($range); + return view('bo.ranges.edit', compact('range')); } - /** - * Update the specified resource in storage. - * - * @param \Illuminate\Http\Request $request - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function update(Request $request, int $id) + public function update(UpdateRangeRequest $request, Range $range, UpdateRange $action): RedirectResponse { - $name = $request->name; - $slug = Str::slug($name); - $description = $request->description != null ? $request->description : null; - $picture = $request->picture; - $status = $request->status === null ? 0 : 1; + $this->authorize('update', $range); - $request->validate([ - 'name' => 'required|string|max:255', - 'description' => 'sometimes|nullable', - 'picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:max-width=' . - config('theme.range_image_maxwidth') . ',max-height=' . - config('theme.range_image_maxheight'), - ]); + $this->executor->execute( + $action, + $request->toUpdateRangeInput($range), + ); - $range = Range::findOrFail($id); - - if ($picture !== null) { - if ($range->picture !== null && file_exists(storage_path('app/public/images/gammes/') . $range->picture)) { - unlink(storage_path('app/public/images/gammes/') . $range->picture); - } - $imageName = $range->id . '_' . $slug . '_' . Str::random(5) . '.' . $picture->extension(); - $picture->move(storage_path('app/public/images/gammes'), $imageName); - } - - $range->name = $name; - - if ($range->slug != $slug) { - $exist = OldSlug::where('slug', $range->slug)->first(); - if ($exist === null) { - $oldSlug = new OldSlug(); - $oldSlug->range_id = $range->id; - $oldSlug->slug = $range->slug; - $oldSlug->save(); - } - } - - $range->slug = $slug; - $range->description = $description; - if ($picture !== null) { - $range->picture = $imageName; - } - $range->status = $status; - $range->save(); - - return redirect()->route('bo.ranges.edit', $range->id)->with('success', 'Modifications enregistrés !'); + return to_route('bo.ranges.edit', $range) + ->with('success', trans('crud.messages.has_been_updated', [ + 'model' => Str::ucfirst(trans_choice('models.classes.ranges', 1)), + ])); } - /** - * Remove the specified resource from storage. - * - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function destroy(int $id) + public function destroy(Range $range, DeleteRange $action): RedirectResponse { - $range = Range::findOrFail($id); + $this->authorize('delete', $range); - $product = Product::where('range_id', $range->id)->count(); - if ($product !== 0) { - return redirect()->back() - ->withErrors("Suppression impossible : \"" . $range->name . "\" contient encore des produits."); - } + $this->executor->execute( + $action, + new DeleteRangeInput(range: $range), + ); - if ($range->picture !== null) { - if (file_exists(storage_path('app/public/images/gammes/') . $range->picture)) { - unlink(storage_path('app/public/images/gammes/') . $range->picture); - } - } - - OldSlug::where('range_id', $range->id)->delete(); - - $range->delete(); - return redirect()->route('bo.ranges.index'); + return to_route('bo.ranges.index') + ->with('warning', trans( + 'crud.messages.has_been_deleted', + ['model' => Str::ucfirst(trans_choice('models.classes.ranges', 1))] + )); } } diff --git a/app/Http/Controllers/Bo/SalariesController.php b/app/Http/Controllers/Bo/SalariesController.php deleted file mode 100644 index 7e49a7bd..00000000 --- a/app/Http/Controllers/Bo/SalariesController.php +++ /dev/null @@ -1,54 +0,0 @@ -import, null, \Maatwebsite\Excel\Excel::CSV); - $this->export($salariesImport->salariesImport); - - return redirect()->route('bo.salaries.index')->with('success', 'Import terminé.'); - } - - /** - * Exporter l'ensemble des salariés dans un fichier .csv, - * au format matricule | code. - * - * @param array $salariesImport - * @return \Illuminate\Http\Response|\Illuminate\Contracts\Routing\ResponseFactory - */ - public function export(array $salariesImport) - { - $this->dispatch(new SalariesExportJob($salariesImport, Auth::user())); - return redirect()->route('bo.salaries.index')->with('success', 'Export terminé.'); - } -} diff --git a/app/Http/Controllers/Bo/SettingsController.php b/app/Http/Controllers/Bo/SettingsController.php index 86be884a..04e6ebdc 100644 --- a/app/Http/Controllers/Bo/SettingsController.php +++ b/app/Http/Controllers/Bo/SettingsController.php @@ -1,114 +1,50 @@ key] = $setting->value; - } - - if ($_SERVER["REQUEST_METHOD"] === "POST") { - $input = $request->all(); - - // Comparer les settingsToPrint (en base) avec les inputs (pour trouver un nouveau). - foreach ($input as $key => $value) { - if ( - !isset($settingsToPrint[$key]) - && $key != "_method" - && $key != "_token" - ) { - // New setting. - $setting = new Setting(); - $setting->key = $key; - $setting->value = $value ?? 0; - $setting->save(); - } - } - - $looplimit = count($settings); - for ($i = 0; $i < $looplimit; $i++) { - if (is_array($request->input($settings[$i]->key))) { - $settings[$i]->value = implode(',', $request->input($settings[$i]->key)); - } else { - $settings[$i]->value = $request->input($settings[$i]->key) === null ? 0 - : $request->input($settings[$i]->key); - } - $settings[$i]->save(); - } - - // Store redirector to keep flash message from being wipe pby artisan call below. - $redirector = redirect()->route('bo.settings')->with('success', 'Modifications enregistrés !'); - - // All settings saved : cache routes. - Artisan::call('route:clear'); - // Clear view cache - Artisan::call('view:clear'); - // Programmer un php artisan optimize ? (une fois par jour la nuit par exemple). - return $redirector; - }//end if - - return view('bo.settings', compact('settingsToPrint')); + public function __construct( + private readonly Executor $executor, + ) { } - /** - * Manage Theme settings page - * Management des settings dont la clé est préfixée theme_ - * - * @param Request $request - * @return \Illuminate\Http\Response - * - */ - public function manageTheme(Request $request) + public function edit(GetSettingsQuery $query): View { - $settings = Setting::where('key', 'LIKE', 'theme_%')->get(); - $settingsToPrint = []; - foreach ($settings as $setting) { - $settingsToPrint[$setting->key] = $setting->value; - } + $this->authorize('view', Setting::class); - $config_settings = Config::get(('theme.bo_theme_settings')); + $setting = $this->executor->execute($query, new QueryInputEmpty()); - // Check if, for each of the theme defined settings we have a database setting. - foreach ($config_settings as $onekey => $params) { - if (!isset($settingsToPrint['theme_' . $onekey])) { - $dbsetting = new Setting(); - $dbsetting->key = 'theme_' . $onekey; - $dbsetting->value = $params['default_value']; - $dbsetting->save(); - // Injection dans settings to print. - $settingsToPrint[$dbsetting->key] = $dbsetting->value; - } - } + return view('bo.settings.edit', [ + 'setting' => $setting, + ]); + } - if ($_SERVER["REQUEST_METHOD"] === "POST") { - $looplimit = count($settings); - for ($i = 0; $i < $looplimit; $i++) { - // Attention pour les booléens/checkbox on enregistre 'on'. - $settings[$i]->value = $request->input($settings[$i]->key) === null ? 0 - : $request->input($settings[$i]->key); - $settings[$i]->save(); - } - return redirect()->route('bo.themesettings')->with('success', 'Modifications enregistrés !'); - } + public function update(UpdateSettingsRequest $request, UpdateSettings $action): RedirectResponse + { + $this->authorize('update', Setting::class); - return view('bo.settings.theme', compact('settingsToPrint', 'config_settings')); + $this->executor->execute( + $action, + $request->toUpdateSettingsInput(), + ); + + return to_route('bo.settings.edit') + ->with('success', trans('crud.messages.has_been_updated', [ + 'model' => Str::ucfirst(trans_choice('models.classes.settings', 1)), + ])); } } diff --git a/app/Http/Controllers/Bo/ShopsController.php b/app/Http/Controllers/Bo/ShopsController.php new file mode 100644 index 00000000..e2b19882 --- /dev/null +++ b/app/Http/Controllers/Bo/ShopsController.php @@ -0,0 +1,148 @@ +authorize('viewAny', Shop::class); + + $output = $this->executor->execute( + $query, + new GetPaginatedShopsQueryInput( + pagination: RequestHelper::pagination($request), + pickupExceptionId: $request->toPickupExceptionId(), + ), + ); + + return view('bo.shops.index', [ + 'shops' => $output->shops, + 'pickupExceptions' => $output->pickupExceptions, + ]); + } + + public function create(): View + { + $this->authorize('create', Shop::class); + + return view('bo.shops.create'); + } + + public function store(StoreShopRequest $request, CreateShop $action): RedirectResponse + { + $this->authorize('create', Shop::class); + + $shop = $this->executor->execute( + $action, + $request->toCreateShopInput(), + ); + + return to_route('bo.shops.edit', $shop) + ->with('success', trans('crud.messages.has_been_created', [ + 'model' => Str::ucfirst(trans_choice('models.classes.shops', 1)), + ])); + } + + public function edit(Shop $shop): View + { + $this->authorize('update', $shop); + + $shop = ShopDto::fromModel($shop); + + return view('bo.shops.edit', compact('shop')); + } + + public function update(UpdateShopRequest $request, Shop $shop, UpdateShop $action): RedirectResponse + { + $this->authorize('update', $shop); + + $this->executor->execute( + $action, + $request->toUpdateShopInput($shop), + ); + + return to_route('bo.shops.edit', $shop) + ->with('success', trans('crud.messages.has_been_updated', [ + 'model' => Str::ucfirst(trans_choice('models.classes.shops', 1)), + ])); + } + + public function destroy(Shop $shop, DeleteShop $action): RedirectResponse + { + $this->authorize('delete', $shop); + + $this->executor->execute( + $action, + new DeleteShopInput(shop: $shop), + ); + + return to_route('bo.shops.index') + ->with('warning', trans('crud.messages.has_been_deleted', [ + 'model' => Str::ucfirst(trans_choice('models.classes.shops', 1)), + ])); + } + + public function pickupExceptionsEdit(Shop $shop, GetShopPickupExceptionsQuery $query): View + { + $this->authorize('pickupExceptionUpdate', $shop); + + $output = $this->executor->execute( + $query, + new GetShopPickupExceptionsQueryInput(shop: $shop), + ); + + return view('bo.shops.pickup-exceptions', [ + 'shop' => $output->shop, + 'pickupExceptions' => $output->pickupExceptions, + 'pickupDay' => $output->pickupDay, + 'pickupPeriod' => $output->pickupPeriod, + ]); + } + + public function pickupExceptionsUpdate( + UpdateShopPickupExceptionsRequest $request, + Shop $shop, + UpdateShopPickupExceptions $action + ): RedirectResponse { + $this->authorize('pickupExceptionUpdate', $shop); + + $this->executor->execute( + $action, + $request->toUpdateShopPickupExceptionsInput($shop), + ); + + return back()->with('success', trans('crud.messages.has_been_updated', [ + 'model' => Str::ucfirst(trans_choice('models.classes.shops', 1)), + ])); + } +} diff --git a/app/Http/Controllers/Bo/SlidersController.php b/app/Http/Controllers/Bo/SlidersController.php deleted file mode 100644 index 98e6b2e9..00000000 --- a/app/Http/Controllers/Bo/SlidersController.php +++ /dev/null @@ -1,120 +0,0 @@ -label; - $slug = $request->slug; - if (empty($slug)) { - $slug = Str::slug($label); - } - $commentaire = $request->commentaire; - - - $request->validate([ - 'label' => 'required|string|max:255', - 'slug' => 'sometimes|unique:sliders', - ]); - - $slider = new Slider(); - $slider->label = $label; - $slider->slug = $slug; - $slider->commentaire = $commentaire; - $slider->save(); - return redirect()->route('bo.sliders.edit', $slider->id)->with('success', 'Slider créé !'); - } - - /** - * Show the form for editing the specified resource. - * - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function edit(int $id) - { - $slider = Slider::findOrFail($id); - return view('bo.sliders.edit', compact('slider')); - } - - /** - * Update the specified resource in storage. - * - * @param \Illuminate\Http\Request $request - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function update(Request $request, int $id) - { - $slider = Slider::findOrFail($id); - $label = $request->label; - $slug = $request->slug; - $commentaire = $request->commentaire; - - - $request->validate([ - 'label' => 'required|string|max:255', - 'slug' => 'required|unique:sliders,slug,' . $slider->id, - ]); - - $slider->label = $label; - $slider->slug = $slug; - $slider->commentaire = $commentaire; - $slider->save(); - - return redirect()->route('bo.sliders.edit', $slider->id)->with('success', 'Modifications enregistrées !'); - } - - /** - * Remove the specified resource from storage. - * - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function destroy(int $id) - { - $slider = Slider::findOrFail($id); - - $count = Slider::count(); - - if ($count === 1) { - return redirect()->back()->withErrors("Suppression impossible : Vous devez conserver au moins 1 Slider"); - } - $slider->delete(); - return redirect()->route('bo.sliders.index'); - } -} diff --git a/app/Http/Controllers/Bo/SlidesController.php b/app/Http/Controllers/Bo/SlidesController.php index 3d2072c6..1c35c5ad 100644 --- a/app/Http/Controllers/Bo/SlidesController.php +++ b/app/Http/Controllers/Bo/SlidesController.php @@ -1,245 +1,111 @@ get(); + $this->authorize('viewAny', Slide::class); + + $slides = $this->executor->execute( + $query, + new GetPaginatedSlidesQueryInput( + pagination: RequestHelper::pagination($request), + ), + ); + return view('bo.slides.index', compact('slides')); } - /** - * Show the form for creating a new resource. - * - * @return \Illuminate\Http\Response - */ - public function create() + public function create(): View { - $sliders = Slider::all(); - return view('bo.slides.create', compact('sliders')); + $this->authorize('create', Slide::class); + + return view('bo.slides.create'); } - /** - * Store a newly created resource in storage. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response - */ - public function store(Request $request) + public function store(StoreSlideRequest $request, CreateSlide $action): RedirectResponse { - $title = $request->title; - $picture = $request->picture; - $text = $request->text; - $linkLabel = $request->link_label; - $link = $request->link; - $newTab = $request->link_new_tab === null ? 0 : 1; - $sliderId = $request->slider_id; - $connected = $request->connected === null ? 0 : 1; + $this->authorize('create', Slide::class); - if (empty($request->date_start_date)) { - $date_start = null; - } else { - if (empty($request->date_start_time)) { - $date_start = $request->date_start_date . " 00:00"; - } else { - $date_start = $request->date_start_date . " " . $request->date_start_time; - } - } + $slide = $this->executor->execute( + $action, + $request->toCreateSlideInput(), + ); - if (empty($request->date_end_date)) { - $date_end = null; - } else { - if (empty($request->date_end_time)) { - $date_end = $request->date_end_date . " 23:59"; - } else { - $date_end = $request->date_end_date . " " . $request->date_end_time; - } - } + return to_route('bo.slides.edit', $slide) + ->with('success', trans('crud.messages.has_been_created', [ + 'model' => Str::ucfirst(trans_choice('models.classes.slides', 1)), + ])); + } - $request->validate([ - 'title' => 'required|max:255', - 'picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:max-width=' . - config('theme.slide_image_maxwidth') . ',max-height=' . - config('theme.slide_image_maxheight'), - 'link_label' => 'sometimes|max:255', - 'link' => 'sometimes|max:255', + public function edit(Slide $slide): View + { + $this->authorize('update', $slide); + + return view('bo.slides.edit', [ + 'slide' => SlideDto::fromModel($slide), ]); - - $slide = new Slide(); - $slide->title = $title; - $slide->text = $text; - $slide->link_label = $linkLabel; - $slide->link = $link; - $slide->link_new_tab = $newTab; - $slide->connected = $connected; - $slide->date_start = $date_start; - $slide->date_end = $date_end; - $slide->slider_id = $sliderId; - $slide->order = $this->getLastOrder(); - $slide->save(); - - if ($picture !== null) { - $imageName = $slide->id . '_' . Str::random(5) . '.' . $picture->extension(); - $picture->move(storage_path('app/public/images/slides'), $imageName); - $slide->picture = $imageName; - $slide->save(); - } - - return redirect()->route('bo.slides.edit', $slide->id)->with('success', 'Slide créé !'); } - /** - * Show the form for editing the specified resource. - * - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function edit(int $id) + public function update(UpdateSlideRequest $request, Slide $slide, UpdateSlide $action): RedirectResponse { - $slide = Slide::findOrFail($id); - $sliders = Slider::all(); - return view('bo.slides.edit', compact('slide', 'sliders')); + $this->authorize('update', $slide); + + $this->executor->execute( + $action, + $request->toUpdateSlideInput($slide), + ); + + return to_route('bo.slides.edit', $slide) + ->with('success', trans('crud.messages.has_been_updated', [ + 'model' => Str::ucfirst(trans_choice('models.classes.slides', 1)), + ])); } - /** - * Update the specified resource in storage. - * - * @param \Illuminate\Http\Request $request - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function update(Request $request, int $id) + public function destroy(Slide $slide, DeleteSlide $action): RedirectResponse { - $title = $request->title; - $picture = $request->picture; - $text = $request->text; - $linkLabel = $request->link_label; - $link = $request->link; - $newTab = $request->link_new_tab === null ? 0 : 1; - $sliderId = $request->slider_id; - $connected = $request->connected === null ? 0 : 1; + $this->authorize('delete', $slide); - if (empty($request->date_start_date)) { - $date_start = null; - } else { - if (empty($request->date_start_time)) { - $date_start = $request->date_start_date . " 00:00"; - } else { - $date_start = $request->date_start_date . " " . $request->date_start_time; - } - } + $this->executor->execute( + $action, + new DeleteSlideInput(slide: $slide), + ); - if (empty($request->date_end_date)) { - $date_end = null; - } else { - if (empty($request->date_end_time)) { - $date_end = $request->date_end_date . " 23:59"; - } else { - $date_end = $request->date_end_date . " " . $request->date_end_time; - } - } - - $request->validate([ - 'title' => 'required|max:255', - 'picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:max-width=' . - config('theme.slide_image_maxwidth') . ',max-height=' . - config('theme.slide_image_maxheight'), - 'link_label' => 'sometimes|max:255', - 'link' => 'sometimes|max:255', - ]); - - $slide = Slide::findOrFail($id); - $slide->title = $title; - $slide->text = $text; - $slide->link_label = $linkLabel; - $slide->link = $link; - $slide->link_new_tab = $newTab; - $slide->connected = $connected; - $slide->date_start = $date_start; - $slide->date_end = $date_end; - $slide->slider_id = $sliderId; - $slide->save(); - - if ($picture !== null) { - if (file_exists(public_path() . 'images/slides/' . $slide->picture)) { - unlink(public_path() . 'images/slides/' . $slide->picture); - } - $imageName = $slide->id . '_' . Str::random(5) . '.' . $picture->extension(); - $picture->move(storage_path('app/public/images/slides'), $imageName); - $slide->picture = $imageName; - $slide->save(); - } - - return redirect()->route('bo.slides.edit', $slide->id)->with('success', 'Modifications enregistrées !'); - } - - /** - * Remove the specified resource from storage. - * - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function destroy(int $id) - { - $s = Slide::findOrFail($id); - - $s->delete(); - - return redirect()->route('bo.slides.index'); - } - - /** - * Change Slide Order - * - * @param integer $id - * @param string $action - * @return \Illuminate\Http\Response - */ - public function changeOrder(int $id, string $action) - { - $current = Slide::findOrFail($id); - - if ($action === 'up') { - $tmp = Slide::where('order', '<', $current->order)->orderBy('order', 'DESC')->first(); - $newOrder = $tmp->order; - $tmp->order = $current->order; - $current->order = $newOrder; - } else { - $tmp = Slide::where('order', '>', $current->order)->orderBy('order', 'ASC')->first(); - $newOrder = $tmp->order; - $tmp->order = $current->order; - $current->order = $newOrder; - } - $tmp->save(); - $current->save(); - - return back(); - } - - /** - * retreive order position to put a new slide to - * - * @return integer - */ - private function getLastOrder() - { - $order = Slide::select('order')->orderBy('order', 'DESC')->first(); - if ($order === null) { - return 1; - } - return $order->order + 1; + return to_route('bo.slides.index') + ->with('warning', trans('crud.messages.has_been_deleted', [ + 'model' => Str::ucfirst(trans_choice('models.classes.slides', 1)), + ])); } } diff --git a/app/Http/Controllers/Bo/TagsController.php b/app/Http/Controllers/Bo/TagsController.php index db57a3eb..d92cd093 100644 --- a/app/Http/Controllers/Bo/TagsController.php +++ b/app/Http/Controllers/Bo/TagsController.php @@ -1,174 +1,107 @@ get(); + $this->authorize('viewAny', Tag::class); + + $pagination = RequestHelper::pagination($request); + + $tags = $this->executor->execute( + $query, + new GetPaginatedTagsQueryInput( + pagination: $pagination, + ) + ); + return view('bo.tags.index', compact('tags')); } - /** - * Show the form for creating a new resource. - * - * @return \Illuminate\Http\Response - */ - public function create() + public function create(): View { + $this->authorize('create', Tag::class); + return view('bo.tags.create'); } - /** - * Store a newly created resource in storage. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response - */ - public function store(Request $request) + public function store(StoreTagRequest $request, CreateTag $action): RedirectResponse { - $label = $request->label; - $slug = Str::slug($label); - $status = $request->status === null ? 0 : 1; + $this->authorize('create', Tag::class); - $request->validate([ - 'label' => 'required|string|max:255', - ]); + $tag = $this->executor->execute( + $action, + $request->toCreateTagInput(), + ); - $tag = new Tag(); - $tag->label = $label; - $tag->slug = $slug; - $tag->status = $status; - $tag->order = $this->getLastOrder(); - $tag->save(); - - return redirect()->route('bo.tags.index'); + return to_route('bo.tags.edit', $tag) + ->with('success', trans('crud.messages.has_been_created', [ + 'model' => Str::ucfirst(trans_choice('models.classes.tags', 1)), + ])); } - /** - * Show the form for editing the specified resource. - * - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function edit(int $id) + public function edit(Tag $tag): View { - $tag = Tag::findOrFail($id); + $this->authorize('update', $tag); + return view('bo.tags.edit', compact('tag')); } - /** - * Update the specified resource in storage. - * - * @param \Illuminate\Http\Request $request - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function update(Request $request, int $id) + public function update(UpdateTagRequest $request, Tag $tag, UpdateTag $action): RedirectResponse { - $label = $request->label; - $slug = Str::slug($label); - $status = $request->status === null ? 0 : 1; + $this->authorize('update', $tag); - $request->validate([ - 'label' => 'required|string|max:255', - ]); + $this->executor->execute( + $action, + $request->toUpdateTagInput($tag), + ); - $tag = Tag::findOrFail($id); - - $tag->label = $label; - $tag->slug = $slug; - $tag->status = $status; - $tag->save(); - - return redirect()->route('bo.tags.edit', $tag->id)->with('success', 'Modifications enregistrés !'); + return to_route('bo.tags.edit', $tag) + ->with('success', trans('crud.messages.has_been_updated', [ + 'model' => Str::ucfirst(trans_choice('models.classes.tags', 1)), + ])); } - /** - * Remove the specified resource from storage. - * - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function destroy(int $id) + public function destroy(Tag $tag, DeleteTag $action): RedirectResponse { - $tag = Tag::findOrFail($id); + $this->authorize('delete', $tag); - $products = $tag->products()->count(); - if ($products !== 0) { - return redirect()->back() - ->withErrors("Suppression impossible : \"" . $tag->label . "\" est associé à des produits."); - } + $this->executor->execute($action, new DeleteTagInput(tag: $tag)); - $tag->delete(); - return redirect()->route('bo.tags.index'); - } - - /** - * Change Tag Order - * - * @param integer $id - * @param string $action - * @return \Illuminate\Http\Response - */ - public function changeOrder(int $id, string $action) - { - $current = Tag::findOrFail($id); - - if ($action === 'up') { - $tmp = Tag::where('order', '<', $current->order)->orderBy('order', 'DESC')->first(); - $newOrder = $tmp->order; - $tmp->order = $current->order; - $current->order = $newOrder; - } else { - $tmp = Tag::where('order', '>', $current->order)->orderBy('order', 'ASC')->first(); - $newOrder = $tmp->order; - $tmp->order = $current->order; - $current->order = $newOrder; - } - $tmp->save(); - $current->save(); - - return back(); - } - - /** - * Toggle tag status - * - * @param integer $id - * @return \Illuminate\Http\Response - */ - public function toggleStatus(int $id) - { - $tag = Tag::findOrFail($id); - $tag->status = !($tag->status); - $tag->save(); - return back(); - } - - - /** - * retreive order position to put a new slide to - * - * @return integer - */ - public static function getLastOrder() - { - $order = Tag::select('order')->orderBy('order', 'DESC')->first(); - if ($order === null) { - return 1; - } - return $order->order + 1; + return to_route('bo.tags.index') + ->with('warning', trans('crud.messages.has_been_deleted', [ + 'model' => Str::ucfirst(trans_choice('models.classes.tags', 1)), + ])); } } diff --git a/app/Http/Controllers/ContactController.php b/app/Http/Controllers/ContactController.php deleted file mode 100644 index 198c703a..00000000 --- a/app/Http/Controllers/ContactController.php +++ /dev/null @@ -1,54 +0,0 @@ -session()->get('status'); - - // 1er magasin en base pour le moment - $magasin = Magasin::firstOrFail(); - $content = Content::where('key', 'contact')->first(); - - return view('contact', compact('status', 'magasin', 'content')); - } - - /** - * submit contact form - * - * @param ContactFormRequest $request - * @return \Illuminate\Http\Response - */ - public function contactSubmit(ContactFormRequest $request) - { - $data = $request->all(); - - $toMailSetting = Setting::where('key', 'send_contact_mail_to')->first(); - if (empty($toMailSetting->value)) { - $toMail = config('mail.from.address'); - } else { - $toMail = $toMailSetting->value; - } - // Envoi du mail d'alerte. - Mail::to($toMail)->send(new SendContactMail($request)); - - return back()->with('status', true); - } -} diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 0964a0d0..f3d25c0a 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -1,141 +1,17 @@ where(function ($query) use ($searchQuery, $words, $search, $fields) { - foreach ($words as $word) { - if (!strlen($word)) { - continue; - } - $this->searchOnFields($query, $word, $fields); - } //end foreach - // Search whole using whole sentence. - $this->searchOnFields($query, $search, $fields); - if ($searchQuery) { - $searchQuery($query); - } - }); - } //end if - return $query; - } - - /** - * Build query search on all fields - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param string $search - * @param array $fields - * @return \Illuminate\Database\Eloquent\Builder - */ - private function searchOnFields( - Builder $query, - string $search, - array $fields - ): Builder { - $table = $query->getModel()->getTable(); - foreach ($fields as $field) { - $field = str_replace('?', '\?', $field); - if (is_array($field)) { - $query->orWhereRaw( - sprintf("UPPER(CONCAT(%s)) LIKE UPPER(?)", collect($field)->map(function ($q) use ($table) { - return "`$table`.`$q`"; - })->implode(', \' \', ')), - ['%' . htmlspecialchars($search) . '%'] - ); - return $query; - } - // Get models woth enum's label. - if (is_array($this->getSearchValue($query, $search, $field))) { - foreach ($this->getSearchValue($query, $search, $field) as $array) { - $query->orWhereRaw( - "UPPER(`$table`.`$field`) LIKE UPPER(?)", - ['%' . htmlspecialchars($array->value) . '%'] - ); - } - return $query; - } - // Get models with relation's name/label. - if (Str::endsWith($field, '_id')) { - $query->orWhereHas(Str::remove('_id', $field), function ($queryRelation) use ($field, $search) { - if (Schema::hasColumn(Str::remove('_id', $field) . 's', 'name')) { - $queryRelation->where('name', 'like', '%' . $search . '%'); - } elseif (Schema::hasColumn(Str::remove('_id', $field) . 's', 'label')) { - $queryRelation->where('label', 'like', '%' . $search . '%'); - } - }); - return $query; - } - $query->orWhereRaw( - "UPPER(`$table`.`$field`) LIKE UPPER(?)", - ['%' . htmlspecialchars($this->getSearchValue($query, $search, $field)) . '%'] - ); - } //end foreach - return $query; - } - - /** - * Get the search value (on string or Enum). - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param string $search - * @param string $field - * @return string|array - */ - protected function getSearchValue(Builder $query, string $search, string $field) - { - $cast = $query->getModel()->getCasts()[$field] ?? null; - if ( - count($query->getModel()->getCasts()) and // Check if the model has casts. - // Check if there is cast about specific field. - is_string($cast) and - class_exists($cast) and - // Check if the cast is an enum. - in_array(\Kwaadpepper\Enum\BaseEnum::class, class_parents(\App\Enums\PriceShowingMode::class)) - ) { - /** @var \Kwaadpepper\Enum\BaseEnum $cast */ - // @phpstan-ignore-next-line - $cases = collect($cast::toArray()); - $enum = $cases->filter(function ($item) use ($search) { - return preg_match('/' . Str::lower($search) . '/', Str::lower($item->label)); - }); - return $enum->toArray(); - } else { - return $search; - } - } } diff --git a/app/Http/Controllers/CustomerController.php b/app/Http/Controllers/CustomerController.php deleted file mode 100644 index 8f16e7e6..00000000 --- a/app/Http/Controllers/CustomerController.php +++ /dev/null @@ -1,688 +0,0 @@ -check()) { - return redirect()->route('home'); - } - - return view('auth.register'); - } - - /** - * Enregistre le customer dans la base de données - * et CRM - * - * @param CustomerRegisterRequest $request - * @return \Illuminate\Http\RedirectResponse - */ - public function register(CustomerRegisterRequest $request) - { - try { - return DB::transaction(function () use ($request) { - $crmCustomer = new CrmCustomer(\array_intersect_key( - $request->validated(), - [ - 'firstname' => '', - 'lastname' => '', - 'birth_date' => '', - 'address' => '', - 'postcode' => '', - 'country' => '', - 'city' => '', - 'phone' => '', - 'email' => '', - 'password' => '', - 'opt_in' => '', - ] - )); - - $crmCustomer->city = $request->town; - $crmCustomer->postcode = $request->postal_code; - $crmCustomer->opt_in = $request->optin ? true : false; - - // * Country Is forced to france - $crmCustomer->country = Country::france(); - $crmCustomer->save(); - - // * Enrregistrement du Hashcode - /** @var \App\Models\Customers $customer */ - $customer = new Customers($request->all()); - $customer->hashcode = $crmCustomer->hashcode; - $customer->saveOrFail(); - - // * liaison éventuelle avec la table salaries - if ($request->matricule && $request->code) { - /** @var \App\Models\Salarie $salarie */ - $salarie = Salarie::where('matricule', '=', $request->matricule) - ->where('code', '=', $request->code) - ->firstOrFail(); - $salarie->customer()->associate($customer); - $salarie->saveOrFail(); - } - - Mail::to($request->email)->send(new RegisterConfirmMail($customer, $request->firstname)); - - return view('auth.register-success', ['mail' => $request->email]); - }); - } catch (ApiErrorException $e) { - if ($e->getApiError()->equals(ApiError::customerExists())) { - return back()->withInput()->withErrors('Un compte est déjà associé à cette adresse email.'); - } - if ($e->getApiError()->equals(ApiError::validationFailed())) { - return back()->withInput()->withErrors($e->getMessage()); - } - report($e); - return back()->withErrors('Une erreur est survenue, merci de réessayer ultérieurement.'); - } catch (ModelNotFoundException $e) { - return back()->withErrors("Salarié $request->matricule, $request->code introuvable."); - } catch (ValidationException $e) { - return back()->withErrors($e->getMessage()); - } catch (\Exception | \TypeError | CrmException $e) { - report($e); - // * Une erreur critique est survenue avec la CRM - return back()->withErrors('Une erreur est survenue, merci de réessayer ultérieurement.'); - } //end try - return back()->withErrors('Une erreur est survenue, merci de réessayer ultérieurement.'); - } - - /** - * Retourne la page de connexion - * - * @param Request $request - * @return \Illuminate\Http\Response - */ - public function authenticateForm(Request $request) - { - if (Auth::guard('customer')->check()) { - return redirect()->route('account.dashboard'); - } - if ($request->get('url')) { - Session::put('url.intended', $request->get('url')); - Session::save(); - } - return view('auth.login'); - } - - /** - * Gère l'authentification des customers - * - * @param LoginRequest $request - * @return \Illuminate\Http\RedirectResponse - */ - public function authenticate(LoginRequest $request) - { - /** @var Customers|null */ - $customer = Customers::where('email', $request->email)->first(); - - if ($customer and $customer->isNoLongerEmployed()) { - $customer->remember_token = null; - $customer->saveOrFail(); - return back()->withErrors( - 'Compte bloqué. Veuillez contacter votre RH ou le standard St Laurent au 02 43 62 70 00' - ); - } - - try { - /** @var \LDC\LDCCRM\CrmApiV2 */ - $crm = app('crmAPI'); - // * Ne devrait pas survenir, $crm->login throws ApiError::authFailed() - if (!$crm->login($request->email, $request->password)) { - // * mauvais identifiants - return back()->withErrors('Email ou mot de passe incorrect.'); - } - - // Dans tout les cas : récupérer le crm user. - $crmCustomer = $crm->getCustomer($request->email); - - // Si pas de compte local mais existe en CRM. - if (!$customer) { - $customer = $this->createLocalCustomer($crmCustomer); - } - - return $this->processLogin($customer, $request->remember); - } catch (ApiErrorException $e) { - return $this->handleLoginApiErrorException($e, $request); - } catch (CrmException | \Exception $e) { - report($e); - // Une erreur critique est survenue avec la CRM. - return back()->withErrors('Une erreur est survenue, merci de réessayer ultérieurement.'); - } //end try - } - - /** - * Active le compte d'un customer - * - * @param mixed $hashcode - * @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory - */ - public function activate($hashcode) - { - $hashcode = filter_var($hashcode, FILTER_SANITIZE_STRING); - if (!($customer = Customers::select('hashcode')->where('hashcode', $hashcode)->first())) { - return view('auth.activate')->with('message', 'Ce lien d\'activation n\'est pas valide.'); - } - try { - /** @var \LDC\LDCCRM\Models\Customer $crmCustomer */ - $crmCustomer = $customer->apiData; - if ($crmCustomer->activate()) { - return view('auth.activate') - ->with('message', 'Votre compte a bien été activé, vous pouvez désormais vous connecter.'); - } - } catch (ApiErrorException $e) { - if ($e->getApiError()->equals(ApiError::customerAlreadyActive())) { - // phpcs:disable Generic.Files.LineLength.TooLong - return view('auth.activate') - ->with('message', 'Votre compte est déjà activé, vous pouvez dès à présent vous connecter avec celui-ci.'); - } - report($e); - // Une erreur critique est survenue avec la CRM. - return view('auth.activate') - ->with('message', 'Une erreur est survenue, merci de réessayer ultérieurement.'); - } catch (CrmException $e) { - report($e); - // Une erreur critique est survenue avec la CRM. - return view('auth.activate') - ->with('message', 'Une erreur est survenue, merci de réessayer ultérieurement.'); - } //end try - return view('auth.activate')->with('message', 'Ce lien d\'activation n\'est pas valide.'); - } - - /** - * deconnexion customer - * - * @return \Illuminate\Http\RedirectResponse - */ - public function logout() - { - if (Auth::guard('customer')->check()) { - Auth::guard('customer')->logout(); - return redirect()->route('home'); - } - } - - /** - * page d'accès à la procédure mdp oublié - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Contracts\View\View - * - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass - */ - public function forgotPasswordForm(Request $request) - { - // @phpcs:enable - return view('auth.passwords.forgot'); - } - - /** - * initialisation de la procédure de mdp oublié - * - * @param Request $request - * @return \Illuminate\Http\RedirectResponse - */ - public function passwordReset(Request $request) - { - $request->validate([ - 'email' => 'required|email:rfc|max:255', - ]); - - $email = filter_var($request->email, FILTER_SANITIZE_EMAIL); - - $customerExist = Customers::where('email', $email)->count() === 0 ? false : true; - - if ($customerExist) { - // Suppression des anciens tokens. - PasswordReset::where('email', $email)->delete(); - - $token = Str::random(80); - - $passwordReset = new PasswordReset(); - $passwordReset->email = $email; - $passwordReset->token = $token; - $passwordReset->created_at = now(); - $passwordReset->save(); - - Mail::to($email)->send(new PasswordResetMail($token)); - return back()->with( - 'success', - __("La procédure pour changer votre mot de passe a été envoyée sur votre email.") - ); - } else { - return back()->withErrors(__("Cette adresse email n'est pas enregistrée dans nos services.")); - } - } - - /** - * Print the view used to change the password of a user when he required it - * @param string $token Token used to identificate the user to change the password. - * @return \Illuminate\Contracts\View\View The view to print - */ - public function viewChangePassword(string $token) - { - $pwdReset = PasswordReset::where('token', $token)->first(); - if (!$pwdReset) { - abort(419); - } - $customer = Customers::where('email', $pwdReset->email)->first(); - if (!$customer) { - abort(404); - } - - return view('auth.passwords.reset', compact('customer'))->with('token', $token); - } - - /** - * changement de mot de passe (depuis la procédure de mdp oublié) - * - * @param Request $request - * @param mixed $token - * @return \Illuminate\Http\RedirectResponse|\Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory - */ - public function changePassword(Request $request, $token) - { - $request->validate([ - 'password' => 'required|confirmed|min:8|max:255' - ]); - - /** @var \App\Models\PasswordReset $passwordReset */ - $passwordReset = PasswordReset::where('token', $token)->first(); - /** @var \App\Models\Customers $customer */ - $customer = Customers::where('email', optional($passwordReset)->email)->firstOrFail(); - - /** @var \LDC\LDCCRM\CrmApiV2 */ - $crm = app('crmAPI'); - - try { - if ($crm->login($customer->email, $request->password)) { - return back()->withErrors('Vous ne pouvez pas utiliser un de vos anciens mot de passe.'); - } - // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch - } catch (ApiErrorException $e) { - // * continue - } - - try { - if (!($crmCustomer = $crm->getCustomer($customer->hashcode))) { - return back() - ->withErrors('Changement impossible, compte inexistant.'); - } - $crmCustomer->password = $request->password; - $crmCustomer->save(); - } catch (\TypeError | CrmException | ApiErrorException $e) { - report($e); - // Une erreur critique est survenue avec la CRM. - return back()->withErrors('Une erreur est survenue, merci de réessayer ultérieurement.'); - } catch (ValidationException $e) { - return back()->withErrors(sprintf('Nouveau mot de passe : %s', $e->getMessage())); - } - - $passwordReset->deleteOrFail(); - - return view('auth.passwords.reset-ok', compact('customer')); - } - - /** - * profil client (mon compte) - * - * @param Request $request - * @return \Illuminate\Contracts\View\View - * - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass - */ - public function dashboard(Request $request) - { - // @phpcs:enable - // Show Profile. - /** @var \App\Models\Customers|null $customer */ - $customer = Auth::guard('customer')->user(); - if (!$customer) { - abort(404); - } - - /** @var \LDC\LDCCRM\Models\Customer $crmCustomer */ - $crmCustomer = $customer->apiData; - - /** @var object $crmInfos */ - $crmInfos = \json_decode(\json_encode($crmCustomer)); - $birthDate = explode('-', $crmCustomer->birth_date); - - return view('customer.dashboard', compact('customer', 'crmInfos', 'birthDate')); - } - - - /** - * Send a request to the CRM to change the given customer's informations - * @param UpdateInfosRequest $request - * @return \Illuminate\Http\RedirectResponse - */ - public function updateInfos(UpdateInfosRequest $request) - { - if (($result = $this->updateUserInfo($request)) === true) { - return back()->with('success', trans( - 'Vos informations ont bien été enregistrées.' - )); - } - return back()->withInput()->withErrors( - $result !== false ? $result : trans( - 'Une erreur est survenue, merci de réessayer ultérieurement.' - ) - ); - } - - /** - * changement de mot de passe depuis le profil - * - * @param CustomerUpdatePassword $request - * @return \Illuminate\Http\RedirectResponse - */ - public function changePasswordWhenAuthenticated(CustomerUpdatePassword $request) - { - /** @var \App\Models\Customers */ - $customer = Auth::guard('customer')->user(); - - /** @var \LDC\LDCCRM\CrmApiV2 */ - $crm = app('crmAPI'); - - // Test old password. - try { - // Ne devrait pas survenir, $crm->login throws ApiError::authFailed(). - if (!$crm->login($customer->email, $request->password_old)) { - // Mauvais identifiants. - return back()->withErrors('L\'ancien mot de passe ne correspond pas.'); - } - - $crmCustomer = $crm->getCustomer($customer->hashcode); - - $crmCustomer->password = $request->password; - $crmCustomer->save(); - } catch (ApiErrorException $e) { - if ($e->getApiError()->equals(ApiError::authFailed())) { - return back()->withErrors('L\'ancien mot de passe ne correspond pas.'); - } - report($e); - // Une erreur critique est survenue avec la CRM. - return back()->withErrors('Une erreur est survenue, merci de réessayer ultérieurement.'); - } catch (\TypeError | CrmException $e) { - report($e); - // Une erreur critique est survenue avec la CRM. - return back()->withErrors('Une erreur est survenue, merci de réessayer ultérieurement.'); - } catch (ValidationException $e) { - return back()->withErrors(sprintf('Nouveau mot de passe : %s', $e->getMessage())); - } //end try - return back()->with('success', __("Modifications enregistrés !")); - } - - /** - * affichage des commandes du customer connecté - * - * @param Request $request - * @return \Illuminate\Contracts\View\View - * - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass - */ - public function myOrders(Request $request) - { - // @phpcs:enable - $orders = Order::where('customer_id', Auth::guard('customer')->user()->id)->orderBy('date', 'DESC')->get(); - return view('customer.my-orders', compact('orders')); - } - - /** - * Show detail commande - * - * @param string $reference - * @return \Illuminate\Contracts\View\View - */ - public function orderDetail(string $reference) - { - $order = Order::where('reference', '=', $reference) - ->where('customer_id', Auth::guard('customer')->user()->id) - ->firstOrFail(); - - if ($order->status_id == 1) { - $magasin = null; - } else { - $magasin = Magasin::find($order->timeslot->magasin->id); - } - - return view('customer.order-detail', compact('order', 'magasin')); - } - - /** - * delete customers - * - * @param integer $id - * @return void - */ - public function delete(int $id) - { - dump('deleting' . $id); - die('Not implemented yet'); - } - - /** - * Create a local customer - * - * @param CrmCustomer $crmCustomer - * @return \app\Models\Customers - * @throws \Throwable If saving to DB failed. - */ - private function createLocalCustomer(CrmCustomer $crmCustomer): Customers - { - /** @var \App\Models\Customers $customer */ - $customer = Customers::firstOrNew([ - 'email' => $crmCustomer->email - ]); - $customer->hashcode = $crmCustomer->hashcode; - $customer->saveOrFail(); - - return $customer; - } - - /** - * Handle Api error exception - * - * @param ApiErrorException $e - * @param LoginRequest $request - * @return \Illuminate\Http\RedirectResponse - */ - private function handleLoginApiErrorException(ApiErrorException $e, LoginRequest $request) - { - /** @var Customers|null */ - $customer = Customers::where('email', $request->email)->first(); - /** @var \LDC\LDCCRM\CrmApiV2 */ - $crm = app('crmAPI'); - - switch ($e->getApiError()) { - case ApiError::authFailed(): - // * mauvais identifiants - return back()->withErrors('Email ou mot de passe incorrect.'); - case ApiError::customerNotActivated(): - // * le compte n'est pas activé - if (!$customer) { - try { - if (!($crmCustomer = $crm->getCustomer($request->email))) { - Log::critical(sprintf('Customer %s coulnd not be retrieved from crm', $request->email)); - return back()->withErrors( - trans('Une erreur est survenue, merci de réessayer ultérieurement.') - ); - } - $customer = $this->createLocalCustomer($crmCustomer); - } catch (CrmException | ApiErrorException $e) { - report($e); - // Une erreur critique est survenue avec la CRM. - return back()->withErrors('Une erreur est survenue, merci de réessayer ultérieurement.'); - } - } - Mail::to($request->email)->send(new RegisterConfirmMail($customer, null)); - return back() - ->withErrors( - trans('Votre compte n\'est pas activé, vérifiez dans vos emails pour y trouver - le mail de confirmation. Un lien d\'activation vous a été renvoyé.') - ); - default: - report($e); - // * une erreur non gérée - return back()->withErrors('Une erreur est survenue, merci de réessayer ultérieurement.'); - } //end switch - } - - /** - * Login a customer - * - * @param Customers $customer - * @param boolean $remember - * @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse - */ - private function processLogin(Customers $customer, bool $remember) - { - /** @var \Illuminate\Auth\SessionGuard */ - $guard = auth('customer'); - $guard->login($customer, $remember); - $url = Session::pull('url.intended'); - Session::forget('url.intended'); - Session::save(); - return !empty($url) ? redirect()->to($url) : redirect()->route('products'); - } - - /** - * Updates user info - * - * @param UpdateInfosRequest $request - * @return boolean|string return strictly true if success, - * false il failed, could be a string with message error if failed - */ - private function updateUserInfo(UpdateInfosRequest $request) - { - /** @var \App\Models\Customers */ - $customer = auth('customer')->user(); - if (!$customer) { - return \redirect()->back(); - } - - /** @var \LDC\LDCCRM\Models\Customer */ - $crmCustomer = $customer->apiData; - - $data = [ - 'firstname' => $request->firstname, - 'lastname' => $request->lastname, - 'birth_date' => $request->year . '-' . $request->month . '-' . $request->day, - 'address' => $request->address, - 'postcode' => $request->postcode, - 'city' => $request->city, - 'phone' => \strval($request->phone), - 'opt_in' => \boolval($request->optin), - ]; - - // * remove phone if empty - if (isset($data['phone']) and !strlen($data['phone'])) { - unset($data['phone']); - } - - try { - $crmCustomer->fill($data); - $crmCustomer->save(); - } catch (ValidationException $e) { - return $e->getMessage(); - } catch (ApiErrorException $e) { - if ($e->getApiError()->equals(ApiError::validationFailed())) { - return $e->getMessage(); - } - report($e); - return false; - } catch (CrmException | \TypeError $e) { - report($e); - return false; - } - return true; - } - - /** - * Unsubscribe from newsletter - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory - */ - public function unsubscribeNewsletter(Request $request) - { - $message = null; - - try { - // ? Is hashcode valid ? - Validator::validate([ - 'hashcode' => $request->hashcode - ], [ - 'hashcode' => 'required|uuid' - ]); - if ($customer = CrmCustomer::find($request->hashcode)) { - $customer->opt_in = false; - // ! Les données peuvent être parsés en retour de la crm et inconsitantes (Héritage vielle crm). - try { - $customer->save(); - } catch (ValidationException $e) { - $message = null; - } - $message = trans('Votre désinscription à la newsletter a été prise en compte'); - } - } catch (IlluminateValidationException $e) { - // Les données peuvent être parsés en retour de la crm et sont inconsitantes. - $message = null; - } catch (ApiErrorException $e) { - if (!$e->getApiError()->equals(ApiError::singleOptinCustomerExists())) { - if (app()->bound('sentry')) { - app('sentry')->captureException($e); - } - $message = trans('Une erreur est survenue, merci de réessayer ultérieurement'); - } - } catch (CrmException $e) { - if (app()->bound('sentry')) { - app('sentry')->captureException($e); - } - $message = trans('Une erreur est survenue, merci de réessayer ultérieurement'); - } //end try - - if (!$message) { - $message = trans('Le lien de désinscription est invalide'); - } - - return view('front.sable.customer.singleoptin-unsubscribe', compact('message')); - } -} diff --git a/app/Http/Controllers/Fo/Ajax/BasketController.php b/app/Http/Controllers/Fo/Ajax/BasketController.php new file mode 100644 index 00000000..d7dd27bf --- /dev/null +++ b/app/Http/Controllers/Fo/Ajax/BasketController.php @@ -0,0 +1,66 @@ +executor->execute( + $query, + new QueryInputEmpty() + ); + + return new BasketResource($basket); + } + + public function add(AddBasketRequest $request, AddToBasket $action): JsonResponse + { + $this->executor->execute( + $action, + $request->toAddToBasketInput() + ); + + return response()->json(); + } + + public function remove(RemoveBasketRequest $request, RemoveFromBasket $action): JsonResponse + { + $this->executor->execute( + $action, + $request->toRemoveFromBasketInput() + ); + + return response()->json(); + } + + public function empty(EmptyBasket $action): JsonResponse + { + $this->executor->execute( + $action, + new ActionInputEmpty() + ); + + return response()->json(); + } +} diff --git a/app/Http/Controllers/Fo/Ajax/PickupController.php b/app/Http/Controllers/Fo/Ajax/PickupController.php new file mode 100644 index 00000000..341c71ae --- /dev/null +++ b/app/Http/Controllers/Fo/Ajax/PickupController.php @@ -0,0 +1,38 @@ +authorize('viewPickupTimeslots', $shop); + + $result = $this->executor->execute( + $action, + new GetAvailableTimeslotsQueryInput( + $shop->getId() + ) + ); + + return TimeSlotResource::collection( + $result->timeslotList + ); + } +} diff --git a/app/Http/Controllers/Fo/Ajax/ProductsController.php b/app/Http/Controllers/Fo/Ajax/ProductsController.php new file mode 100644 index 00000000..2b132413 --- /dev/null +++ b/app/Http/Controllers/Fo/Ajax/ProductsController.php @@ -0,0 +1,30 @@ +executor->execute( + $query, + $request->toGetFoFilteredProductsQueryInput(), + ); + + return FilteredProductResource::collection($productList); + } +} diff --git a/app/Http/Controllers/Fo/Auth/AuthController.php b/app/Http/Controllers/Fo/Auth/AuthController.php new file mode 100644 index 00000000..c8c71152 --- /dev/null +++ b/app/Http/Controllers/Fo/Auth/AuthController.php @@ -0,0 +1,69 @@ +createResetUrl(...); + VerifyEmail::$createUrlCallback = $this->createValidationUrl(...); + } + + public function createValidationUrl(Customer $notifiable): string + { + $appKey = Config::string('app.key'); + + if (empty(trim($appKey))) { + throw new \UnexpectedValueException('App key is not set.'); + } + + return url( + URL::temporarySignedRoute( + 'fo.auth.verification.verify', + Date::now()->addMinutes(Config::integer( + 'auth.verification.expire', + 60 + )), + [ + 'id' => $notifiable->getKey(), + 'hash' => hash_hmac( + 'sha256', + $notifiable->getEmailForVerification(), + $appKey + ), + ], + false + ) + ); + } + + public function createResetUrl(mixed $notifiable, string $token): string + { + if (! is_object($notifiable) || ! ($notifiable instanceof Customer)) { + throw new \InvalidArgumentException('Invalid notifiable provided.'); + } + + return url( + URL::temporarySignedRoute( + 'fo.auth.reset-password', + Date::now()->addMinutes(Config::integer('auth.reset.expire', 60)), + [ + 'token' => $token, + 'email' => $notifiable->getEmailForPasswordReset(), + ], + false + ) + ); + } +} diff --git a/app/Http/Controllers/Fo/Auth/ForgotPasswordController.php b/app/Http/Controllers/Fo/Auth/ForgotPasswordController.php new file mode 100644 index 00000000..ac38c492 --- /dev/null +++ b/app/Http/Controllers/Fo/Auth/ForgotPasswordController.php @@ -0,0 +1,85 @@ +middleware('guest:frontend'); + parent::__construct(); + } + + public function showLinkRequestForm(): View + { + return view('fo.auth.passwords.email'); + } + + public function sendResetLinkEmail(Request $request, GetCustomerByEmailQuery $query): JsonResponse | RedirectResponse + { + $this->validateEmail($request); + + $shopperId = $this->executor->execute( + $query, + new GetCustomerByEmailQueryInput(new Email($request->string('email')->toString())), + ); + + if ($shopperId instanceof ShopperId) { + $shopper = $this->shopperService->getShopperFor($shopperId); + if (! $shopper || ! $shopper->isActive()) { + throw new CustomerNotEmployedException(); + } + } + + return $this->traitSendResetLinkEmail($request); + } + + protected function sendResetLinkResponse(Request $request, string $response): JsonResponse | RedirectResponse + { + return $this->sendResponse($request->wantsJson()); + } + + protected function sendResetLinkFailedResponse(Request $request, string $response): JsonResponse | RedirectResponse + { + return $this->sendResponse($request->wantsJson()); + } + + protected function sendResponse(bool $wantsJson): JsonResponse | RedirectResponse + { + $message = trans( + 'Please check your email, if we know you you should receive a reset link' + ); + + return $wantsJson + ? new JsonResponse(['message' => $message], 202) + : back()->with('status', $message); + } + + public function broker(): PasswordBroker + { + return Password::broker('customers'); + } +} diff --git a/app/Http/Controllers/Fo/Auth/LoginController.php b/app/Http/Controllers/Fo/Auth/LoginController.php new file mode 100644 index 00000000..7e86456e --- /dev/null +++ b/app/Http/Controllers/Fo/Auth/LoginController.php @@ -0,0 +1,61 @@ +middleware('guest:frontend')->except('logout'); + $this->middleware('auth:frontend')->only('logout'); + parent::__construct(); + } + + protected function guard(): StatefulGuard + { + return Auth::guard('frontend'); + } + + public function showLoginForm(): View + { + return view('fo.auth.login'); + } + + protected function authenticated(Request $request, Customer $user): void + { + $shopper = $this->shopperService->getShopperFor($user->getId()); + + if (! $shopper || ! $shopper->isActive()) { + throw new CustomerNotEmployedException(); + } + + Session::flash('success', \trans('You are logged in!')); + } + + protected function loggedOut(Request $request): RedirectResponse + { + return to_route('fo.pages.home') + ->with('info', trans('You are logged out!')); + } + + protected function redirectTo(): string + { + return route('fo.pages.home'); + } +} diff --git a/app/Http/Controllers/Fo/Auth/RegisterController.php b/app/Http/Controllers/Fo/Auth/RegisterController.php new file mode 100644 index 00000000..62df13c8 --- /dev/null +++ b/app/Http/Controllers/Fo/Auth/RegisterController.php @@ -0,0 +1,31 @@ +executor->execute($action, $request->toRegisterCustomerInput()); + + return view('fo.auth.verify'); + } +} diff --git a/app/Http/Controllers/Fo/Auth/ResetPasswordController.php b/app/Http/Controllers/Fo/Auth/ResetPasswordController.php new file mode 100644 index 00000000..de0d7ebb --- /dev/null +++ b/app/Http/Controllers/Fo/Auth/ResetPasswordController.php @@ -0,0 +1,66 @@ +route()?->parameter('token'); + + return view('fo.auth.passwords.reset')->with( + ['token' => $token, 'email' => $request->email] + ); + } + + protected function setUserPassword(Customer $customer, string $password): void + { + $result = $this->authService->resetPasswordFor($customer, $password); + + if ($result instanceof ValidationException) { + throw ValidationException::withMessages([ + 'error' => sprintf( + '%s : %s', + trans('validation.attributes.password'), + $result->getMessage() + ), + ]); + } + } + + public function broker(): PasswordBroker + { + return Password::broker('customers'); + } + + protected function guard(): StatefulGuard + { + return Auth::guard('frontend'); + } + + protected function redirectTo(): string + { + return route('fo.pages.home'); + } +} diff --git a/app/Http/Controllers/Fo/Auth/VerificationController.php b/app/Http/Controllers/Fo/Auth/VerificationController.php new file mode 100644 index 00000000..4c76f9d7 --- /dev/null +++ b/app/Http/Controllers/Fo/Auth/VerificationController.php @@ -0,0 +1,105 @@ +middleware('auth:frontend'); + $this->middleware('is-employed'); + $this->middleware('signed:relative')->only('verify'); + $this->middleware('throttle:6,1')->only(['verify', 'resend']); + parent::__construct(); + } + + public function show(Request $request): RedirectResponse | View + { + $customer = $this->getRequestCustomerFrom($request); + $isActivated = $this->authService->hasVerifiedEmail($customer); + + return $isActivated + ? redirect($this->redirectPath()) + : view('fo.auth.verify'); + } + + public function verify(Request $request): View | RedirectResponse + { + $customer = $this->getRequestCustomerFrom($request); + $requestId = Str::of($request->route('id')); + $requestHash = Str::of($request->route('hash')); + + throw_unless( + hash_equals($requestId->value(), strval($customer->id)), + AuthorizationException::class + ); + + throw_unless( + hash_equals( + $requestHash->value(), + hash_hmac( + 'sha256', + $customer->email->value, + Config::string('app.key') + ) + ), + AuthorizationException::class + ); + + if ($this->authService->hasVerifiedEmail($customer)) { + return redirect($this->redirectPath()); + } + + if ($this->authService->verifyEmail($customer)) { + event(new Verified($customer)); + + return redirect($this->redirectPath()) + ->with('success', trans('Your account is now verified, you can start using the site.')); + } + + return view('fo.auth.verify')->with( + 'error', + trans('The verification link is invalid or the customer account was not found.') + ); + } + + public function resend(Request $request): RedirectResponse + { + $customer = $this->getRequestCustomerFrom($request); + $isActivated = $this->authService->hasVerifiedEmail($customer); + + if ($isActivated) { + return redirect($this->redirectPath()); + } + + $customer->sendEmailVerificationNotification(); + + return back()->with('resent', true); + } + + protected function redirectTo(): string + { + return route('fo.pages.home'); + } + + private function getRequestCustomerFrom(Request $request): Customer + { + return $request->user('frontend') ?? throw new AuthorizationException('Unauthenticated.'); + } +} diff --git a/app/Http/Controllers/Fo/Customers/CustomerController.php b/app/Http/Controllers/Fo/Customers/CustomerController.php new file mode 100644 index 00000000..69d3df33 --- /dev/null +++ b/app/Http/Controllers/Fo/Customers/CustomerController.php @@ -0,0 +1,73 @@ +authorize('manageOwnProfile', Customer::class); + + return view('fo.customer.dashboard'); + } + + public function editInfos(GetCrmCustomerQuery $getCrmCustomerQuery): View + { + $this->authorize('manageOwnProfile', Customer::class); + + $output = $this->executor->execute( + $getCrmCustomerQuery, + new GetCrmCustomerQueryInput() + ); + + abort_unless( + $output->customer instanceof CrmCustomer, + 503, + trans('An error occurred, please try again later.') + ); + + return view('fo.customer.edit.infos', [ + 'crmCustomer' => $output->customer, + ]); + } + + public function editInfosSubmit(UpdateInfosRequest $request, UpdateCustomer $updateCustomer): RedirectResponse + { + $this->authorize('manageOwnProfile', Customer::class); + + $output = $this->executor->execute( + $updateCustomer, + $request->toUpdateCustomerInput() + ); + + return match (true) { + $output->result instanceof CrmCustomer => back() + ->with('success', trans('Your information has been saved.')), + $output->result instanceof ValidationException => back() + ->withInput() + ->withErrors($output->result->getMessage()), + default => back() + ->withInput() + ->withErrors(trans('An error occurred, please try again later.')), + }; + } +} diff --git a/app/Http/Controllers/Fo/Customers/OrderController.php b/app/Http/Controllers/Fo/Customers/OrderController.php new file mode 100644 index 00000000..0a664343 --- /dev/null +++ b/app/Http/Controllers/Fo/Customers/OrderController.php @@ -0,0 +1,58 @@ +authorize('viewAnyOwn', Order::class); + + $customer = $this->authService->getCustomerAsMandatory(); + + $orders = $this->executor->execute( + $query, + new GetFoCustomerPaginatedOrdersQueryInput( + customer: $customer, + pagination: RequestHelper::pagination($request), + ), + ); + + return view('fo.customer.orders.index', compact('orders')); + } + + public function show(Order $order, GetFoCustomerOrderDetailQuery $query): View + { + $this->authorize('viewOwn', $order); + + $output = $this->executor->execute( + $query, + new GetFoCustomerOrderDetailQueryInput($order), + ); + + return view('fo.customer.orders.show', [ + 'order' => $output->order, + 'mapUrl' => $output->mapUrl, + ]); + } +} diff --git a/app/Http/Controllers/Fo/Customers/PasswordController.php b/app/Http/Controllers/Fo/Customers/PasswordController.php new file mode 100644 index 00000000..ed7005da --- /dev/null +++ b/app/Http/Controllers/Fo/Customers/PasswordController.php @@ -0,0 +1,49 @@ +authorize('manageOwnProfile', Customer::class); + + return view('fo.customer.edit.password'); + } + + public function editPasswordSubmit(UpdatePasswordRequest $request, UpdateCustomerPassword $updateCustomerPassword): RedirectResponse + { + $this->authorize('manageOwnProfile', Customer::class); + + $result = $this->executor->execute( + $updateCustomerPassword, + $request->toUpdateCustomerPasswordInput() + ); + + return match (true) { + $result->result instanceof CrmCustomer => back() + ->with('success', trans('Password updated')), + $result->result instanceof ValidationException => back() + ->withErrors($result->result->errors()), + $result->result === false => back() + ->withErrors(trans('An error occurred, please try again later.')), + }; + } +} diff --git a/app/Http/Controllers/Fo/NewsletterController.php b/app/Http/Controllers/Fo/NewsletterController.php new file mode 100644 index 00000000..b302ca0f --- /dev/null +++ b/app/Http/Controllers/Fo/NewsletterController.php @@ -0,0 +1,42 @@ +getHashcode()) { + $isUnsubscribed = $this->executor->execute( + $action, + new UnsubscribeFromNewsletterInput( + hashcode: $request->getHashcode() + ) + ); + } + + $message = match ($isUnsubscribed) { + UnsubscribeFromNewsletterOutput::SUCCESS => trans('Your newsletter unsubscription has been taken into account.'), + UnsubscribeFromNewsletterOutput::FAILURE => trans('An error occurred, please try again later.'), + UnsubscribeFromNewsletterOutput::INVALIDLINK => trans('The unsubscription link is invalid.'), + }; + + return view('fo.news.singleoptin-unsubscribe', compact('message')); + } +} diff --git a/app/Http/Controllers/Fo/Pages/ContactController.php b/app/Http/Controllers/Fo/Pages/ContactController.php new file mode 100644 index 00000000..c7643df4 --- /dev/null +++ b/app/Http/Controllers/Fo/Pages/ContactController.php @@ -0,0 +1,73 @@ +mailToContact = new Address( + Config::string('mail.to.contact') + ); + } + + public function showForm(Request $request, GetShopQuery $getShopQuery, GetPageQuery $getPageQuery): View + { + $status = $request->session()->get(self::SESSION_STATUS_KEY); + + $magasin = $this->executor->execute( + $getShopQuery, + new GetShopQueryInput(), + ); + + $page = $this->executor->execute( + $getPageQuery, + new GetPageQueryInput( + new Slug(strval(StaticPageSlug::CONTACT->value())) + ), + ); + + return view('fo.pages.contact', compact( + 'status', + 'magasin', + 'page' + )); + } + + public function submitForm(ContactFormRequest $request): RedirectResponse + { + $contactData = $request->toValueObject(); + + Mail::to($this->mailToContact) + ->send(new SendContactMail($contactData)); + + return back()->with(self::SESSION_STATUS_KEY, true); + } +} diff --git a/app/Http/Controllers/Fo/Pages/HomeController.php b/app/Http/Controllers/Fo/Pages/HomeController.php new file mode 100644 index 00000000..54e9b4f4 --- /dev/null +++ b/app/Http/Controllers/Fo/Pages/HomeController.php @@ -0,0 +1,66 @@ +executor->execute( + $productsAction, + new GetPaginatedProductsQueryInput( + Pagination::firstPage(), + starOnly: true, + publishedOnly: true, + withPricing: true, + ) + )->items(); + + $slideList = $this->executor->execute( + $slidesAction, + new GetPaginatedSlidesQueryInput( + Pagination::firstPage(), + publishedOnly: true, + forConnectedCustomers: $this->authService->check() + ) + )->items(); + + $rangeList = $this->executor->execute( + $rangesAction, + new GetPaginatedRangesQueryInput( + Pagination::firstPage(), + publishedOnly: true + ) + )->items(); + + return view('fo.pages.home', compact( + 'starProductList', + 'slideList', + 'rangeList' + )); + } +} diff --git a/app/Http/Controllers/Fo/Pages/PageController.php b/app/Http/Controllers/Fo/Pages/PageController.php new file mode 100644 index 00000000..3efc1e5d --- /dev/null +++ b/app/Http/Controllers/Fo/Pages/PageController.php @@ -0,0 +1,77 @@ +getPageBySlug(StaticPageSlug::LEGALS); + + return view('fo.pages.legal-notice', compact( + 'page' + )); + } + + public function terms(): View + { + $page = $this->getPageBySlug(StaticPageSlug::TERMS); + + return view('fo.pages.terms', compact( + 'page' + )); + } + + public function privacy(): View + { + $page = $this->getPageBySlug(StaticPageSlug::PRIVACY); + + return view('fo.pages.privacy', compact( + 'page' + )); + } + + public function faq(GetFaqsQuery $getFaqsQuery): View + { + $page = $this->getPageBySlug(StaticPageSlug::FAQ); + $faqs = $this->executor->execute( + $getFaqsQuery, + new QueryInputEmpty() + ); + + return view('fo.pages.faq', compact( + 'faqs', + 'page' + )); + } + + private function getPageBySlug(StaticPageSlug $pageSlug): PageDto + { + $slug = new Slug(strval($pageSlug->value())); + $pageSlugInput = new GetPageQueryInput($slug); + + return $this->executor->execute( + $this->getPageQuery, + $pageSlugInput + ); + } +} diff --git a/app/Http/Controllers/Fo/Pages/ProductsController.php b/app/Http/Controllers/Fo/Pages/ProductsController.php new file mode 100644 index 00000000..43e77812 --- /dev/null +++ b/app/Http/Controllers/Fo/Pages/ProductsController.php @@ -0,0 +1,65 @@ +executor->execute( + $query, + new GetFoProductIndexPageQueryInput( + pagination: Pagination::firstPage(new PageSize(self::PER_PAGE_PRODUCTS)) + ), + ); + + $productListResource = FilteredProductResource::collection($output->paginatedProducts) + ->toArray($request); + + return view('fo.pages.products.index', [ + 'productListResource' => $productListResource, + 'brandList' => $output->brandList, + 'rangeList' => $output->rangeList, + 'tagList' => $output->tagList, + 'discountList' => $output->discountList, + 'perPage' => $output->perPage, + ]); + } + + public function view(Request $request, ProductWithPricingDto $productWithPricing): View + { + $this->authorize('viewPublished', $productWithPricing->product); + + $associated = $productWithPricing->product->products; + $associated->loadMissing(['inco', 'validDiscount']); + + $associatedProducts = FilteredProductResource::collection( + $associated + )->toArray($request); + + return view('fo.pages.products.show', [ + 'productWithPricing' => $productWithPricing, + 'associatedProducts' => $associatedProducts, + ]); + } +} diff --git a/app/Http/Controllers/Fo/TunnelController.php b/app/Http/Controllers/Fo/TunnelController.php new file mode 100644 index 00000000..b10bf74d --- /dev/null +++ b/app/Http/Controllers/Fo/TunnelController.php @@ -0,0 +1,169 @@ +authorize('canReviewBasketSummary', OrderTunnelStep::class); + + $output = $this->executor->execute( + $query, + new GetBasketSummaryQueryInput() + ); + + return view('fo.tunnel.basket-summary', [ + 'step' => $output->step, + 'basket' => $output->basket, + ]); + } + + public function basketSummarySubmit( + ValidateSummaryRequest $request, + InitializeOrderTunnel $action + ): RedirectResponse { + $this->authorize('canReviewBasketSummary', OrderTunnelStep::class); + + $this->executor->execute( + $action, + $request->toInitializeOrderTunnelInput() + ); + + return to_route('fo.sales.pick-time-slot'); + } + + // * -- STEP 2 -- * + + public function pickTimeSlot(GetPickTimeSlotQuery $query): View + { + $this->authorize('canPickTimeSlot', OrderTunnelStep::class); + + $customer = $this->authService->getCustomerAsMandatory(); + + $output = $this->executor->execute( + $query, + new GetPickTimeSlotQueryInput($customer->getId()) + ); + + return view('fo.tunnel.pick-time-slot', [ + 'step' => $output->step, + 'shop' => $output->shop, + 'mapUrl' => $output->mapUrl, + 'timeSlots' => $output->timeSlots, + ]); + } + + public function pickTimeSlotSubmit( + PickTimeSlotRequest $request, + ApplyPickTimeSlot $action + ): RedirectResponse { + $this->authorize('canPickTimeSlot', OrderTunnelStep::class); + + $matchedSlot = $this->executor->execute( + $action, + $request->toApplyPickTimeSlotInput() + ); + + if ($matchedSlot === null) { + return back()->withErrors([ + 'timeslot' => trans('Invalid or unavailable time slot'), + ])->withInput(); + } + + return to_route('fo.sales.confirmation'); + } + + // * -- STEP 3 -- * + + public function confirmation(GetOrderConfirmationQuery $query): View + { + $this->authorize('canFinalizeOrder', OrderTunnelStep::class); + + $output = $this->executor->execute( + $query, + new GetOrderConfirmationQueryInput() + ); + + return view('fo.tunnel.confirmation', [ + 'step' => $output->step, + 'basket' => $output->basket, + 'builder' => $output->builder, + 'shop' => $output->shop, + ]); + } + + public function confirmationSubmit( + ConfirmOrderRequest $request, + FinalizeOrder $action + ): RedirectResponse { + $this->authorize('canFinalizeOrder', OrderTunnelStep::class); + + try { + /** @var \Domain\Models\ValueObjects\OrderReference $orderReference */ + $orderReference = $this->executor->execute( + $action, + $request->toFinalizeOrderInput() + ); + } catch (WeeklyLimitExceededException | OrderLimitExceededException $e) { + return back()->with('message', $e->getMessage()); + } + + return to_route('fo.sales.confirmation.show-confirmed', (string) $orderReference); + } + + // * -- CONFIRMATION -- * + + public function confirmed( + Order $order, + GetTunnelOrderConfirmedQuery $query + ): View { + $this->authorize('viewOwn', $order); + + $output = $this->executor->execute( + $query, + new GetTunnelOrderConfirmedQueryInput($order) + ); + + return view('fo.tunnel.confirmed', [ + 'step' => $output->step, + 'order' => $output->order, + 'shop' => $output->shop, + 'mapUrl' => $output->mapUrl, + ]); + } +} diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php deleted file mode 100644 index b13e1b01..00000000 --- a/app/Http/Controllers/HomeController.php +++ /dev/null @@ -1,47 +0,0 @@ -first(); - // Star products. - $products = Product::where('status', 1)->where('star', 1)->get(); - - $slider = Slider::where('slug', 'home')->first(); - $slides = $slider->showableSlides; - - // Display only slides visible to connected customers. - $isCustomerConnected = Auth::guard('customer')->check(); - if (!$isCustomerConnected) { - $slides = $slides->where('connected', false); - } - - $quickorder_ranges = Range::where('status', 1)->get(); - foreach ($quickorder_ranges as $range) { - foreach ($range->products()->where('status', 1) as $product) { - $product->calculatedPrices = $product->getCalcPrices(); - } - } - - return view('home', compact('content', 'products', 'slides', 'quickorder_ranges')); - } -} diff --git a/app/Http/Controllers/IndexController.php b/app/Http/Controllers/IndexController.php deleted file mode 100644 index 51fcc328..00000000 --- a/app/Http/Controllers/IndexController.php +++ /dev/null @@ -1,71 +0,0 @@ -first(); - return view('legal-notice', compact('content')); - } - - /** - * terms and conditions page - * - * @param Request $request - * @return \Illuminate\Contracts\View\View - * - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass - */ - public function terms(Request $request) - { - // @phpcs:enable - $content = Content::where('key', 'cgv')->first(); - return view('terms', compact('content')); - } - - /** - * privacy page - * - * @param Request $request - * @return \Illuminate\Contracts\View\View - * - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass - */ - public function privacy(Request $request) - { - // @phpcs:enable - $content = Content::where('key', 'confidentialite')->first(); - return view('privacy', compact('content')); - } - - /** - * faq page - * - * @param Request $request - * @return \Illuminate\Contracts\View\View - * - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass - */ - public function faq(Request $request) - { - // @phpcs:enable - $content = Content::where('key', 'faq')->first(); - $faq = Faq::all(); - return view('faq', compact('faq', 'content')); - } -} diff --git a/app/Http/Controllers/OrderTunnelController.php b/app/Http/Controllers/OrderTunnelController.php deleted file mode 100644 index 2d84c28b..00000000 --- a/app/Http/Controllers/OrderTunnelController.php +++ /dev/null @@ -1,526 +0,0 @@ -user()->isNoLongerEmployed()) { - auth()->logout(); - return redirect()->route('auth.connexion')->withErrors( - 'Compte bloqué. Veuillez contacter votre RH ou le standard St Laurent au 02 43 62 70 00' - ); - } - - $activestep = 1; - Cart::instance('panier'); - $cart = Cart::content(); - - $cartInfos = array( - "totalTTC" => Cart::total(), - // Total des taxes. - 'totalTVA' => Cart::tax(), - // Total sans les taxes. - 'totalHT' => Cart::subtotal(), - // Poids total des items. - 'totalweight' => Cart::weight(), - // Total avant taxes et remises. - 'totalHTbefore' => Cart::priceTotal(), - // Total des remises. - 'totaldiscount' => Cart::discount(), - // Nb de produits dans le cart. - 'countItems' => Cart::count(), - ); - - return view('sales.recap', compact('activestep', 'cart', 'cartInfos')); - } - - /** - * front - * Storing order from sales tunnel - * - * @return \Illuminate\Http\RedirectResponse - */ - public function store() - { - Cart::instance('panier'); - - $cart = Cart::content(); - - // Check that we have products in cart before saving. - if (Cart::count() <= 0) { - // Then redirect to empty recap. - return redirect()->route('sales.recap')->with( - 'message', - 'Le nombre total de produits dans cette commande ne peut être négatif.' - ); - } - - // Save. - $order = new Order(); - // Generate order ref. - $order->reference = $this->generateOrderRef(); - $order->date = Carbon::now(); - $order->status_id = 1; - $order->total = str_replace(',', '.', str_replace(' ', '', Cart::total())); - $order->customer_id = Auth::user()->id; - - $order->save(); - - // Order_id. - foreach ($cart as $cartItem) { - $order_line = new OrderLine(); - $order_line->order_id = $order->id; - $order_line->product_id = $cartItem->model->id; - $order_line->quantity = $cartItem->qty; - // Gross unit price. - $order_line->unit_price = $cartItem->model->priceHt; - // Discount per unit. - $order_line->unit_discount = $cartItem->model->discountAmount; - // Tax rate for this line. - $order_line->tax_rate = $cartItem->taxRate; - // Tax amount par unit. - $order_line->unit_tax = round( - (($order_line->unit_price - $order_line->unit_discount) * ($order_line->tax_rate / 100)) * 100 - ) / 100; - // Discount amount for the line. - $order_line->total_discount = $order_line->unit_discount * $order_line->quantity; - // Gross amount for the line. - $order_line->total_ht = ($order_line->unit_price - $order_line->unit_discount) * $order_line->quantity; - // Tax amount for the line. - $order_line->total_tax = $order_line->unit_tax * $order_line->quantity; - // Total TTC avec remises de la ligne. - $order_line->total_ttc = $order_line->total_ht + $order_line->total_tax; - - $order_line->save(); - } //end foreach - - // Then redirect. - return redirect()->route('sales.pick-slot', ['reference' => $order->reference]); - } - - /** - * generate order Reference - * for a new order - * - * @return string - */ - public function generateOrderRef() - { - - // Format : YYYYMMDDHHMM000. - $now = Carbon::now(); - // Count todays orders. - $countorders = Order::whereDate('created_at', Carbon::today())->count(); - // Add one. - $countorders++; - $ref = $now->isoFormat('YYYYMMDDHHmm') . str_pad($countorders, 3, "0", STR_PAD_LEFT); - return $ref; - } - - /** - * front tunnel de commande étape 3 : choix de créneau - * - * @param string $reference - * @return \Illuminate\Contracts\View\View - */ - public function timeSlotPick(string $reference) - { - $activestep = 2; - - /* - * Il faut diriger les salariés vers le bon magasin sans leur - * laisser le choix - * Dans la gestion des thèmes antérieure il était possible d'avoir 2 cas : - * theme.multi_relay : on ou off, ici cela ne sera plus le cas - * (thème non interchangeable pour cette boutique spécifique) - */ - - // Si Magasin n'est pas référencé, on ne sait pas ou va le salarié. - if (Auth::user()->salarie->magasin) { - $magasin = Auth::user()->salarie->magasin; - } - $availCreneaux = array(); - $order = Order::where('reference', '=', $reference)->firstOrFail(); - - return view('sales.pick-slot', compact('activestep', 'availCreneaux', 'order', 'magasin')); - } - - /** - * add timeslot by interval between start and end hour - * - * @param array $plage - * @param integer $weekDay - * @param CarbonImmutable $current - * @param Magasin $magasin - * @param CarbonImmutable $now - * @param CarbonImmutable $today - * @param CarbonInterval $delaiPrepa - * @param CarbonInterval $interval - * @param Carbon $currentTime - * @param Carbon $endTime - * @return array - */ - private function addCreneaux( - array $plage, - int $weekDay, - CarbonImmutable $current, - Magasin $magasin, - CarbonImmutable $now, - CarbonImmutable $today, - CarbonInterval $delaiPrepa, - CarbonInterval $interval, - Carbon $currentTime, - Carbon $endTime, - bool $hasPublicHolidayNextWeekButNoFriday, - bool $afterThursdayNight - ) { - $retArray = array(); - do { - $creneau = $currentTime->format('H:i'); - $nbtakens = $magasin->timeslots() - ->where('day', $current->format('Y-m-d')) - ->where('time', $creneau)->count(); - - if ($nbtakens >= $plage[$weekDay]['max_orders_per_interval']) { - $isDispo = false; - } else { - $isDispo = true; - } - - /** - * On utilise les méthodes de Carbon pour la comparaison de date, parce que c'est fait pour... - */ - if ( - $current->addHours($currentTime->format('H')) - ->addMinutes($currentTime->format('i')) - ->lessThan($now->add($delaiPrepa)) - ) { - $isDispo = false; - } - // Attention si la date est passée (today mais avant maintenant) : pas de créneau. - if ($current > $today || $currentTime >= $now) { - // Si un jour de la semaine prochaine est férié et qu'on passe commande un jeudi après 23h59...alors le vendredi de la semaine suivante n'est pas dispo. - $nextFriday = $now->addWeek()->startOfWeek(Carbon::MONDAY)->addDays(4); - if ($hasPublicHolidayNextWeekButNoFriday && $afterThursdayNight && $current->isSameDay($nextFriday)) { - $isDispo = false; - } - $retArray[] = array($creneau, $isDispo); - } - $currentTime->add($interval); - } while ($currentTime <= $endTime); - return $retArray; - } - - /** - * give array of available crenaux - * - * @param integer $id - * @return array - */ - public function getAvailableCreneauxByShop(int $id) - { - // Setting à stocker et réutiliser. - $plage_days = Setting::where('key', 'order_withdrawal_period')->firstOrFail()->value; - $magasin = Magasin::findOrFail($id); - $timeslotSettings = $magasin->timeslotSettings; - // $timeslotSettings = TimeslotSetting::all(); - // Fabriquons un tableau recap. - $plage = array(); - foreach ($timeslotSettings as $day) { - $plage[$day->day_index] = array( - 'morning_start' => $day->morning_start, - 'morning_end' => $day->morning_end, - 'afternoon_start' => $day->afternoon_start, - 'afternoon_end' => $day->afternoon_end, - 'interval' => $day->interval, - 'min_order_preparation' => $day->min_order_preparation, - 'max_orders_per_interval' => $day->max_orders_per_interval - ); - } - // Génération des plages. - // On commence le calcul à aujourd'hui + 1 - // car on ne va pas afficher de créaneaux pour aujourd'hui dans l'interface... - $today = CarbonImmutable::now()->addDay()->startOfDay(); - $weekDay = $today->weekday(); - // Final boundary (permet de limiter la liste des jours d'exception). - $finalday = $today->add($plage_days, 'day'); - $now = CarbonImmutable::now(); - - // Jours exceptions. - $noCollectDays = $magasin->collecteExceptions() - ->whereDate('date', '>', $now) - ->whereDate('date', '<=', $finalday) - ->orderBy('date')->get(); - - - // On effectue des vérifications pour récupérer des jours de la semaine suivante - // =/= de vendredi qui seraient fériés. - $thursdayNight = $now->startOfWeek(Carbon::MONDAY)->addDays(3)->setTime(23, 59); - $afterThursdayNight = $now->greaterThanOrEqualTo($thursdayNight); - $currentweekStartDate = $now->startOfWeek(); - $currentweekEndDate = $now->endOfWeek(); - $nextWeekStartDate = $currentweekStartDate->addWeek(); - $nextWeekEndDate = $currentweekEndDate->addWeek(); - - $hasPublicHolidayNextWeekButNoFriday = $magasin->collecteExceptions() - ->whereDate('date', '>=', $nextWeekStartDate) - ->whereDate('date', '<=', $nextWeekEndDate) - ->where('type', '=', ExceptionDayType::ferie()) - ->whereRaw('DAYOFWEEK(date) != ?', 6) - ->count() > 0; - - $delaiPrepa = CarbonInterval::createFromFormat('h:i', $plage[$weekDay]['min_order_preparation'] ?? '01:00'); - - $availCreneaux = array(); - - for ($i = 0; $i < $plage_days; $i++) { - $current = $today->add($i, 'day'); - /** - * On gère le décalage par rapport au tableau de settings... - * Dans le tableau lundi = 0 - * Dans Carbon dimanche = 0 - */ - $weekDay = $current->weekday() - 1 !== -1 ? $current->weekday() - 1 : 6; - $interval = CarbonInterval::createFromFormat('h:i', $plage[$weekDay]['interval'] ?? '00:15'); - - // Si c'est un jour exception skip. - // ah ? mais on skip quoi et ou ? et pourquoi ? - $skip = false; - foreach ($noCollectDays as $not_today) { - if ($current->isSameDay($not_today->date)) { - $skip = true; - } - } - if ($skip) { - continue; - } - - $availCreneaux[$current->format('d/m/Y')] = array(); - - // Matinée. - if (!empty($plage[$weekDay]['morning_start'])) { - $currentTime = Carbon::createFromTimeString($plage[$weekDay]['morning_start']); - $endTime = Carbon::createFromTimeString($plage[$weekDay]['morning_end']); - - $morningCreneaux = $this->addCreneaux( - $plage, - $weekDay, - $current, - $magasin, - $now, - $today, - $delaiPrepa, - $interval, - $currentTime, - $endTime, - $hasPublicHolidayNextWeekButNoFriday, - $afterThursdayNight, - ); - // Cela sert à rien d'afficher un jour avec des créneaux sur lesquels le conso ne peut pas cliquer... - if ($this->hasCreneauAvailableTime($morningCreneaux)) { - $availCreneaux[$current->format('d/m/Y')] = array_merge( - $availCreneaux[$current->format('d/m/Y')], - $morningCreneaux - ); - } - } //end if - // Aprem. - if (!empty($plage[$weekDay]['afternoon_start'])) { - $currentTime = Carbon::createFromTimeString($plage[$weekDay]['afternoon_start']); - $endTime = Carbon::createFromTimeString($plage[$weekDay]['afternoon_end']); - - $afternoonCreneaux = $this->addCreneaux( - $plage, - $weekDay, - $current, - $magasin, - $now, - $today, - $delaiPrepa, - $interval, - $currentTime, - $endTime, - $hasPublicHolidayNextWeekButNoFriday, - $afterThursdayNight, - ); - // Cela sert à rien d'afficher un jour avec des créneaux sur lesquels le conso ne peut pas cliquer... - if ($this->hasCreneauAvailableTime($afternoonCreneaux)) { - $availCreneaux[$current->format('d/m/Y')] = array_merge( - $availCreneaux[$current->format('d/m/Y')], - $afternoonCreneaux - ); - } - } //end if - } //end for - return $availCreneaux; - } - - /** - * hasCreneauAvailableTime - * - * @param array $creneaux - * - * @return boolean - */ - private function hasCreneauAvailableTime(array $creneaux): bool - { - foreach ($creneaux as $creneau) { - if ($creneau[1]) { - return true; - } - } - return false; - } - - /** - * Call ajax pour le composant vue de timeslots. - * - * @param Request $request - * @return array - */ - public function getAvailableCreneaux(Request $request) - { - return $this->getAvailableCreneauxByShop($request->id); - } - - /** - * front - * enregistrement du créneau de collect - * et validation de la commande - * - * @param Request $request - * @return \Illuminate\Http\RedirectResponse - */ - public function setTimeSlot(Request $request) - { - $request->validate([ - 'selectedmagasin' => 'required', - 'selectedcreneau' => 'required', - 'ok_cgv' => 'accepted', - ]); - - $tsday = explode('-', $request->selectedcreneau)[0]; - $tstime = explode('-', $request->selectedcreneau)[1]; - $magasin_id = $request->selectedmagasin; - $reference = $request->order_ref; - $order = Order::where('reference', '=', $reference)->firstOrFail(); - - // Check total price of this customer commands for a specific delivery day. - $date = CarbonImmutable::create( - explode('/', $tsday)[2], - explode('/', $tsday)[1], - explode('/', $tsday)[0] - ); - $start = $date->startOfWeek(Carbon::MONDAY); - $end = $date->endOfWeek(Carbon::SUNDAY); - $customerOrders = Order::where('customer_id', '=', $order->customer_id) - ->where('status_id', '=', 3) - ->get(); - $totalPrice = 0; - foreach ($customerOrders as $key => $customerOrder) { - $timeslot_day = $customerOrder->timeslot->day; - if ( - $timeslot_day >= $start && - $timeslot_day <= $end - ) { - $totalPrice += $customerOrder->total; - } - } - if ($totalPrice > 200) { - return redirect()->route('account.order-detail', ['reference' => $order->reference]) - ->with('message', 'Le montant total pour cette date de livraison est dépassé (200€ maximum). - Veuillez modifier cette dernière pour la valider.'); - } - if ($order->total > 200) { - return redirect()->route('account.order-detail', ['reference' => $order->reference]) - ->with('message', 'Le montant total de cette commande est dépassé (200€ maximum). - Veuillez modifier cette dernière pour la valider.'); - } - - if ($order->status_id == 1) { - // On ne traite l'enregistrement que pour les commandes en attente venant de l'étape de récap. - // Save timeslot. - $timeslot = Timeslot::firstOrNew(['order_id' => $order->id]); - $timeslot->order_id = $order->id; - $timeslot->magasin_id = $magasin_id; - $timeslot->day = $date; - $timeslot->time = $tstime; - $timeslot->save(); - - // Save order status. - $order->status_id = 3; - $order->save(); - - // Send confirm mail. - Mail::to($order->customer->email)->queue(new OrderConfirmMail($order)); - - // Envoi du mail de confirmation aux admins site. - $toMailSetting = Setting::where('key', 'send_order_confirm_mail_to')->first(); - if (empty($toMailSetting->value)) { - $toMail = config('mail.from.address'); - } else { - $toMail = $toMailSetting->value; - } - Mail::to($toMail)->queue(new OrderConfirmAdminMail($order)); - - // Export commande. - if (config('bosettings.regate_orders')) { - Notification::route('mail', config('mail.to.regate'))->notify(new AnOrderWasPlaced($order)); - } - } //end if - - // Redirect to final confirmation. - return redirect()->route('sales.confirm', ['reference' => $order->reference]); - } - - /** - * front - * page de confirmation de commande - * - * @param string $reference - * @return \Illuminate\Contracts\View\View - */ - public function confirmOrder(string $reference) - { - $activestep = 3; - - $idcommande = Session::get('idcommande'); - $order = Order::where('reference', '=', $reference)->firstOrFail(); - - // 1 seul magasin en base pour le moment - $magasin = Magasin::find($order->timeslot->magasin->id); - - // Empty cart. - Cart::instance('panier')->destroy(); - - return view('sales.confirm', compact('activestep', 'order', 'magasin')); - } -} diff --git a/app/Http/Controllers/ProductsController.php b/app/Http/Controllers/ProductsController.php deleted file mode 100644 index ef4505dd..00000000 --- a/app/Http/Controllers/ProductsController.php +++ /dev/null @@ -1,139 +0,0 @@ -first(); - if (!$product || !$product->status) { - abort(404); - } - $product->additionnalProductInfo = $product->additionnalProductInfo($product->product_type); - if ($product->additionnalProductInfo === null && !empty($product_type)) { - // N'existe pas on renseigne un vide. - $product_type = $product->product_type; - $modelClass = 'App\Models\\' . ucfirst($product_type); - $product->$product_type = new $modelClass(); - } - - $associated = $product->products; - - return view('product', compact('product', 'associated')); - } - - /** - * tous les produits filtrés - * - * @param \App\Http\Requests\ProductsFilterRequest $request - * @return \Illuminate\Http\JsonResponse|\Illuminate\Contracts\View\View - */ - public function allProductsFiltered(ProductsFilterRequest $request) - { - $filtersMenuIsOpen = (intval($request->filtersMenuIsOpen)) ? true : false; - $productfilters = array(); - - if (!empty($request->search)) { - $productfilters['search'] = $request->search; - } - - if (!empty($request->ranges)) { - $productfilters['ranges'] = $request->ranges; - } - - if (!empty($request->promotion)) { - $productfilters['promotions'] = $request->promotion; - } - - if (!empty($request->tags)) { - $productfilters['tags'] = $request->tags; - } - - if (!empty($request->brands)) { - $productfilters['brands'] = $request->brands; - } - - if (!$request->ajax()) { - if (\session()->has("productfilters")) { - $sessionFilter = \session()->get("productfilters"); - $productfilters = \array_merge((array)$sessionFilter, $productfilters); - } - } - - \session()->put("productfilters", (object)$productfilters); - \session()->save(); - $sessionFilter = \session()->get("productfilters"); - - /** @var Illuminate\Database\Eloquent\Builder */ - $productsQuery = $this->buildFilterQuery($sessionFilter); - - /** @var \Illuminate\Database\Eloquent\Collection<\App\Models\Product> */ - $products = $productsQuery->orderBy('order', 'ASC')->paginate(6); - - $brands = \collect(\App\Enums\ProductBrand::toArray())->filter( - function (\App\Enums\ProductBrand $case) { - return Product::query()->where('status', 1)->pluck('brand')->contains($case->value); - } - )->values(); - - if ($request->ajax()) { - return \response()->json([ProductResource::collection($products), $products->total()]); - } else { - $ranges = Range::all(); - $tags = Tag::where('status', true)->get(); - return view('ranges', compact('products', 'ranges', 'tags', 'sessionFilter', 'filtersMenuIsOpen', 'brands')); - } - } - - /** - * Build filtering Query - * - * @param object $sessionFilter - * @return Illuminate\Database\Eloquent\Builder - */ - public function buildFilterQuery(object $sessionFilter) - { - /** @var Illuminate\Database\Eloquent\Builder */ - $productsQuery = Product::where('status', true); - if (!empty($sessionFilter->search)) { - $productsQuery->where('name', 'LIKE', '%' . $sessionFilter->search . '%'); - } - if (!empty($sessionFilter->promotions)) { - $productsQuery->whereHas('promotions'); - } - if (!empty($sessionFilter->ranges)) { - $productsQuery->whereHas('range', function ($q) use ($sessionFilter) { - $q->whereIn('id', $sessionFilter->ranges); - }); - } - if (!empty($sessionFilter->tags)) { - $productsQuery->whereHas('tags', function ($q) use ($sessionFilter) { - $q->whereIn('id', $sessionFilter->tags); - }); - } - if (!empty($sessionFilter->brands)) { - $productsQuery->whereIn('brand', $sessionFilter->brands); - } - - return $productsQuery; - } -} diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php deleted file mode 100644 index e780bc63..00000000 --- a/app/Http/Kernel.php +++ /dev/null @@ -1,68 +0,0 @@ - [ - \App\Http\Middleware\EncryptCookies::class, - \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, - \Illuminate\Session\Middleware\StartSession::class, - \Illuminate\View\Middleware\ShareErrorsFromSession::class, - \App\Http\Middleware\VerifyCsrfToken::class, - \Illuminate\Routing\Middleware\SubstituteBindings::class, - ], - - 'api' => [ - 'throttle:api', - \Illuminate\Routing\Middleware\SubstituteBindings::class, - ], - ]; - - /** - * The application's route middleware. - * - * These middleware may be assigned to groups or used individually. - * - * @var array - */ - protected $routeMiddleware = [ - 'auth' => \App\Http\Middleware\Authenticate::class, - 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, - 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, - 'can' => \Illuminate\Auth\Middleware\Authorize::class, - 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, - 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, - 'redirect-slugs' => \App\Http\Middleware\RedirectOldSlugs::class, - 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, - 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, - 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, - 'is-admin' => \App\Http\Middleware\IsAdmin::class, - 'is-super-admin' => \App\Http\Middleware\IsSuperAdmin::class, - 'admin-secure' => \App\Http\Middleware\AdminSecureMiddleware::class, - ]; -} diff --git a/app/Http/Middleware/AdminSecureMiddleware.php b/app/Http/Middleware/AdminSecureMiddleware.php deleted file mode 100644 index a2ac87f5..00000000 --- a/app/Http/Middleware/AdminSecureMiddleware.php +++ /dev/null @@ -1,50 +0,0 @@ -getCidrList()) - ->reduce(function ($initial, $ip_range) use ($client_ip) { - return $initial || IP::contains( - $ip_range, - $client_ip - )->unwrap(); - }); - - $ip_is_allowed_by_config = \collect(AdminSecure::getOptions()->getCidrAllowedList()) - ->reduce(function ($initial, $ip_range) use ($client_ip) { - return $initial || IP::contains( - $ip_range, - $client_ip - )->unwrap(); - }); - - if ($ip_is_allowed or $ip_is_allowed_by_config or AdminSecure::ipIsPrivate($client_ip)) { - return $next($request); - } - - abort(403, \trans('Denied IP')); - } -} - diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php deleted file mode 100644 index 67e01e75..00000000 --- a/app/Http/Middleware/Authenticate.php +++ /dev/null @@ -1,21 +0,0 @@ -expectsJson()) { - return route('auth.login'); - } - } -} diff --git a/app/Http/Middleware/CustomerIsEmployed.php b/app/Http/Middleware/CustomerIsEmployed.php new file mode 100644 index 00000000..59661ffc --- /dev/null +++ b/app/Http/Middleware/CustomerIsEmployed.php @@ -0,0 +1,38 @@ +authService->getCustomerAsMandatory(); + $shopper = $this->shopperService->getShopperFor($customer->getId()); + + if (! $shopper || ! $shopper->isActive()) { + throw new CustomerNotEmployedException(); + } + + return $next($request); + } +} diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php deleted file mode 100644 index 20c50392..00000000 --- a/app/Http/Middleware/EncryptCookies.php +++ /dev/null @@ -1,16 +0,0 @@ -authService->getCustomer(); + + if ($customer && ! $this->authService->hasVerifiedEmail($customer)) { + $redirectRoute = URL::route($redirectToRoute ?: 'fo.auth.verification.notice'); + + return $request->expectsJson() + ? abort(403, 'Your email address is not verified.') + : Redirect::guest($redirectRoute); + } + + return $next($request); + } +} diff --git a/app/Http/Middleware/HtmlSanitizer.php b/app/Http/Middleware/HtmlSanitizer.php new file mode 100644 index 00000000..56fa2da1 --- /dev/null +++ b/app/Http/Middleware/HtmlSanitizer.php @@ -0,0 +1,106 @@ +all(); + + \array_walk($inputs, function (null | string | array | UploadedFile &$input, string $name) use ($params): void { + $this->cleanInput($input, $name, null, $params); + }); + $request->merge($inputs); + + return $next($request); + } + + /** + * @param null|string|array|\Illuminate\Http\UploadedFile $input + * @param string[] $params + */ + private function cleanInput( + null | string | array | UploadedFile &$input, + string $name, + ?string $rootName, + array $params + ): void { + if (is_array($input)) { + array_walk_recursive( + $input, + function (null | string | array | UploadedFile &$nestedInput, string $nestedName) use ($name, $params): void { + $this->cleanInput($nestedInput, $nestedName, $name, $params); + } + ); + } + + if (! is_string($input)) { + return; + } + + if ($this->shouldApplyRichSanitization($name, $rootName, $params)) { + $this->sanitizeRichInput($input); + + return; + } + + $input = strip_tags($input); + } + + /** + * @param array $params + */ + private function shouldApplyRichSanitization(string $name, ?string $rootName, array $params): bool + { + return in_array($name, $params) || in_array($rootName ?? $name, $params); + } + + private function sanitizeRichInput(string &$input): void + { + $isJson = \json_decode($input, true); + if ($isJson && is_array($isJson)) { + \array_walk_recursive($isJson, function (string | array &$item): void { + if (\is_string($item)) { + $item = $this->purifyString($item); + } + }); + + $input = json_encode($isJson, \JSON_THROW_ON_ERROR) ?: throw new \UnexpectedValueException('Failed to encode JSON after sanitization.'); + + return; + } + + $input = $this->purifyString($input); + } + + private function purifyString(string $input): string + { + $cleaned = $this->purifierService->clean($input); + + if (! is_string($cleaned)) { + throw new \UnexpectedValueException('Purifier should return a string when input is a string.'); + } + + return ToolboxHelper::stripCkEditorSchemesOnMediaInputs($cleaned); + } +} diff --git a/app/Http/Middleware/IsAdmin.php b/app/Http/Middleware/IsAdmin.php deleted file mode 100644 index 8bece334..00000000 --- a/app/Http/Middleware/IsAdmin.php +++ /dev/null @@ -1,26 +0,0 @@ -role; - if ($role === 1 || $role === 2) { - return $next($request); - } - abort(404, "Cette page n'existe pas."); - } -} diff --git a/app/Http/Middleware/IsSuperAdmin.php b/app/Http/Middleware/IsSuperAdmin.php deleted file mode 100644 index a523914a..00000000 --- a/app/Http/Middleware/IsSuperAdmin.php +++ /dev/null @@ -1,26 +0,0 @@ -role; - if ($role === 1) { - return $next($request); - } - abort(404, "Cette page n'existe pas."); - } -} diff --git a/app/Http/Middleware/PreventRequestsDuringMaintenance.php b/app/Http/Middleware/PreventRequestsDuringMaintenance.php deleted file mode 100644 index 402ea324..00000000 --- a/app/Http/Middleware/PreventRequestsDuringMaintenance.php +++ /dev/null @@ -1,16 +0,0 @@ -check()) { - return redirect(RouteServiceProvider::HOME); - } - } - - return $next($request); - } -} diff --git a/app/Http/Middleware/RedirectOldSlugs.php b/app/Http/Middleware/RedirectOldSlugs.php deleted file mode 100644 index c5c3fdf0..00000000 --- a/app/Http/Middleware/RedirectOldSlugs.php +++ /dev/null @@ -1,49 +0,0 @@ -route('productSlug'); - $rangeSlug = $request->route('rangeSlug'); - - if ($productSlug !== null) { - $product = Product::where('slug', $productSlug)->first(); - if (!$product) { - $productOldSlug = OldSlug::where('slug', $productSlug)->first(); - if ($productOldSlug) { - $product = Product::where('id', $productOldSlug->product_id)->first(); - return redirect()->route('product', $product->slug); - } - } - } - - if ($rangeSlug !== null) { - $range = Range::where('slug', $rangeSlug)->first(); - if (!$range) { - $rangeOldSlug = OldSlug::where('slug', $rangeSlug)->first(); - if ($rangeOldSlug) { - $range = Range::where('id', $rangeOldSlug->range_id)->first(); - return redirect()->route('range', $range->slug); - } - } - } - - return $next($request); - } -} diff --git a/app/Http/Middleware/SecureHeaders.php b/app/Http/Middleware/SecureHeaders.php new file mode 100644 index 00000000..59227c81 --- /dev/null +++ b/app/Http/Middleware/SecureHeaders.php @@ -0,0 +1,142 @@ +instance('csp_nonce', $nonce); + + $jsBo = $request->routeIs('bo*') ? "'unsafe-eval'" : ''; + $cspReportUri = route('cspReportUri'); + $reportUri = + \sprintf(' report-to default; report-uri %s ;', \parse_url($cspReportUri, \PHP_URL_PATH)); + + $jsdelivrUrl = 'https://cdn.jsdelivr.net'; + $openStreetMapTiles = 'https://*.tile.openstreetmap.org'; + + $this->removeUnwantedHeaders($this->unwantedHeaderList); + $response = $next($request); + + $response->headers->set('Referrer-Policy', 'no-referrer-when-downgrade'); + $response->headers->set('X-Content-Type-Options', 'nosniff'); + $response->headers->set('X-XSS-Protection', '1; mode=block'); + $response->headers->set('X-Frame-Options', 'SAMEORIGIN'); + $response->headers->set('Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload'); + + // * Ignore CSP on some conditions. + if ( + $appDebug && ( + $response->isClientError() || // Ignition + $response->isServerError() || // Ignition + Vite::isRunningHot() || // Vite + ($telescopeEnabled && str_starts_with($request->path(), 'telescope')) // Telescope + ) + ) { + return $response; + } + + $cspPolicies = [ + "default-src 'none';", + "base-uri 'self';", + "manifest-src 'self';", + // * CKEDITOR Specific https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/csp.html + "connect-src 'self' " . implode(' ', [ + 'https://yl.s-web.fr/', + // * BAN address autocomplete (api-adresse.data.gouv.fr) + 'https://api-adresse.data.gouv.fr', + // * VITE DEV + $viteDevSocket, + $viteDevOrigin, + ]) . ';', + "img-src 'self' data: blob: " . implode(' ', [ + $viteDevOrigin, + $openStreetMapTiles, + ]) . ' data:;', + 'child-src ' . implode(' ', []) . ';', + "object-src 'none';", + "font-src 'self' data: " . \implode(' ', [ + // * VITE DEV + $viteDevOrigin, + ]) . ';', + // ! Using CKEditor will must have unsafe-inline style + "style-src 'self' 'unsafe-inline' " . \implode(' ', [ + $jsdelivrUrl, + // * File Manager + $jsdelivrUrl, + // * VITE DEV + $viteDevOrigin, + ]) . ';', + + // ! If you dont use ckeditor use this + // "style-src 'self' 'nonce-$nonce';", + "script-src 'self' 'nonce-$nonce' 'strict-dynamic' " . \implode(' ', [ + 'https: blob:', + $jsBo, + // * VITE DEV + $viteDevOrigin, + ]) . ';', + ]; + $response->headers->set( + 'Content-Security-Policy', + implode(' ', $cspPolicies) . $reportUri + ); + $response->headers->set('Feature-Policy', 'fullscreen \'self\'; geolocation \'self\';'); + $response->headers->set('Reporting-Endpoints', 'default="' . $cspReportUri . '"'); + + return $response; + } + + /** + * Remove unwanted headers + * + * @param string[] $headerList List of headers to remove from the response + * @return void + */ + private function removeUnwantedHeaders(array $headerList) + { + foreach ($headerList as $header) { + header_remove($header); + } + } +} diff --git a/app/Http/Middleware/TrimStrings.php b/app/Http/Middleware/TrimStrings.php deleted file mode 100644 index 5a50e7b5..00000000 --- a/app/Http/Middleware/TrimStrings.php +++ /dev/null @@ -1,18 +0,0 @@ -allSubdomainsOfApplicationUrl(), - ]; - } -} diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php deleted file mode 100644 index 03b78905..00000000 --- a/app/Http/Middleware/TrustProxies.php +++ /dev/null @@ -1,23 +0,0 @@ -hasUser(), AuthenticationException::class); + + $user = $guard->user(); + + throw_unless( + $user instanceof User, + \UnexpectedValueException::class, + 'Expected User object' + ); + + abort_if($user->role->value() > $minRole->value(), 403); + + return $next($request); + } +} diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php deleted file mode 100644 index ed591f20..00000000 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ /dev/null @@ -1,16 +0,0 @@ -where('id', $this->input('rowId')) + ->first(); + + return $product !== null && Gate::allows('addToBasket', $product); + } + + public function toAddToBasketInput(): AddToBasketInput + { + return new AddToBasketInput( + $this->getProductId(), + $this->integer('qty') + ); + } + + public function getProductId(): ProductId + { + return new ProductId( + Uuid::fromString( + $this->string('rowId')->value() + ) + ); + } + + /** @return array */ + public function rules(): array + { + return [ + 'rowId' => ['required', 'string', 'uuid', 'exists:products,id'], + 'qty' => ['required', 'integer', 'min:1'], + ]; + } +} diff --git a/app/Http/Requests/Basket/RemoveBasketRequest.php b/app/Http/Requests/Basket/RemoveBasketRequest.php new file mode 100644 index 00000000..0ad38811 --- /dev/null +++ b/app/Http/Requests/Basket/RemoveBasketRequest.php @@ -0,0 +1,53 @@ +integer('qty'); + + if ($qty >= 1) { + return new RemoveQuantityFromBasketInput( + $this->getProductId(), + $qty + ); + } + + return new RemoveProductFromBasketInput( + $this->getProductId() + ); + } + + public function getProductId(): ProductId + { + return new ProductId( + Uuid::fromString( + $this->string('rowId')->value() + ) + ); + } + + /** @return array */ + public function rules(): array + { + return [ + 'rowId' => ['required', 'string', 'uuid'], + 'qty' => ['sometimes', 'integer', 'gt:0'], + ]; + } +} diff --git a/app/Http/Requests/Bo/ChangeOrderRequest.php b/app/Http/Requests/Bo/ChangeOrderRequest.php new file mode 100644 index 00000000..e45ba779 --- /dev/null +++ b/app/Http/Requests/Bo/ChangeOrderRequest.php @@ -0,0 +1,52 @@ +authService->check(); + } + + #[\Override] + protected function prepareForValidation() + { + $this->merge([ + 'action' => $this->route('action'), + ]); + } + + #[\Override] + protected function passedValidation() + { + $this->merge([ + 'direction' => strval($this->route('action')) === 'up', + ]); + } + + /** @return array*/ + public function rules(): array + { + return [ + 'action' => ['required', 'string', 'in:up,down'], + ]; + } + + public function getSortDirection(): \SortDirection + { + return strval($this->route('action')) === 'up' + ? \SortDirection::Ascending + : \SortDirection::Descending; + } +} diff --git a/app/Http/Requests/Bo/ChangeSelectedOrderRequest.php b/app/Http/Requests/Bo/ChangeSelectedOrderRequest.php new file mode 100644 index 00000000..993ff37d --- /dev/null +++ b/app/Http/Requests/Bo/ChangeSelectedOrderRequest.php @@ -0,0 +1,42 @@ +authService->check(); + } + + /** + * @return array + */ + public function rules(): array + { + return [ + 'order' => ['required', 'integer', 'min:1'], + ]; + } + + public function toChangeModelOrderPositionInput(Model & ModelWithOrder $model): ChangeModelOrderPositionInput + { + return new ChangeModelOrderPositionInput( + model: $model, + targetOrder: $this->integer('order'), + ); + } +} diff --git a/app/Http/Requests/Bo/Dashboard/DashboardRequest.php b/app/Http/Requests/Bo/Dashboard/DashboardRequest.php new file mode 100644 index 00000000..6c634ce0 --- /dev/null +++ b/app/Http/Requests/Bo/Dashboard/DashboardRequest.php @@ -0,0 +1,53 @@ +getStart(), + end: $this->getEnd(), + ); + } + + public function authorize(): bool + { + return $this->authService->check(); + } + + public function getStart(): ?CarbonInterface + { + return $this->has('start') ? + Date::parse($this->string('start')->value()) : null; + } + + public function getEnd(): ?CarbonInterface + { + return $this->has('end') ? + Date::parse($this->string('end')->value()) : null; + } + + /** @return array */ + public function rules(): array + { + return [ + 'start' => ['required_with:end', 'date'], + 'end' => ['required_with:start', 'date'], + ]; + } +} diff --git a/app/Http/Requests/Bo/DashboardRequest.php b/app/Http/Requests/Bo/DashboardRequest.php deleted file mode 100644 index 29e7406c..00000000 --- a/app/Http/Requests/Bo/DashboardRequest.php +++ /dev/null @@ -1,31 +0,0 @@ -check(); - } - - /** - * Get the validation rules that apply to the request. - * - * @return array - */ - public function rules() - { - return [ - 'start' => ['required_with:end', 'date'], - 'end' => ['required_with:start', 'date'], - ]; - } -} diff --git a/app/Http/Requests/Bo/Discounts/StoreDiscountRequest.php b/app/Http/Requests/Bo/Discounts/StoreDiscountRequest.php new file mode 100644 index 00000000..288a2726 --- /dev/null +++ b/app/Http/Requests/Bo/Discounts/StoreDiscountRequest.php @@ -0,0 +1,178 @@ +toDiscountType(), + value: $this->toDiscountValue(), + is_old_price_displayed: $this->boolean('is_old_price_displayed'), + period: $this->toDatePeriod(), + associatedProductsIds: $this->toAssociatedProductsIds(), + ); + } + + public function authorize(): bool + { + return $this->authService->check(); + } + + #[\Override] + protected function prepareForValidation(): void + { + $this->merge([ + 'is_old_price_displayed' => $this->boolean('is_old_price_displayed'), + 'associated_products' => $this->array('associated_products'), + ]); + } + + /** @return array */ + public function getAssociatedProductsIds(): array + { + return array_map( + fn ($id) => (string) $id, + $this->array('associated_products') + ); + } + + /** @return array */ + public function toAssociatedProductsIds(): array + { + return $this->getAssociatedProductsIds(); + } + + public function toDiscountType(): DiscountType + { + /** @var DiscountType */ + return $this->enum('type', DiscountType::class); + } + + public function getDiscountValue(): DiscountValue + { + $type = $this->enum('type', DiscountType::class); + + if ($type === DiscountType::PERCENT) { + return DiscountValue::fromPercentage( + $this->integer('value') + ); + } + + return DiscountValue::fromAmount( + new Money( + intval($this->integer('value')), + resolve(Currency::class) + ) + ); + } + + public function toDiscountValue(): DiscountValue + { + return $this->getDiscountValue(); + } + + public function toDatePeriod(): DatePeriod + { + $start = $this->filled('date_start') + ? new \DateTimeImmutable($this->string('date_start')->value(), new \DateTimeZone('UTC')) + : null; + $end = $this->filled('date_end') + ? new \DateTimeImmutable($this->string('date_end')->value(), new \DateTimeZone('UTC')) + : null; + + return new DatePeriod($start, $end); + } + + /** @return array */ + public function rules(): array + { + return [ + 'type' => ['required', new Enum(DiscountType::class)], + 'value' => [ + 'required', + 'integer', + 'min:0', + Rule::when( + $this->input('type') == DiscountType::PERCENT->value(), + ['max:100'] + ), + ], + 'is_old_price_displayed' => ['required', 'boolean'], + 'date_start' => ['nullable', 'date_format:Y-m-d\TH:i'], + 'date_end' => ['nullable', 'date_format:Y-m-d\TH:i', 'after:date_start'], + 'client_timezone' => ['required', 'timezone'], + + 'associated_products' => ['present', 'array'], + 'associated_products.*' => ['string', 'exists:products,id'], + ]; + } + + #[\Override] + protected function passedValidation() + { + if ($this->filled('date_start')) { + $inputValue = Date::createFromFormat( + 'Y-m-d\TH:i', + $this->string('date_start')->value(), + $this->string('client_timezone')->value() + )?->setTimezone('UTC'); + + if (! $inputValue) { + throw new \UnexpectedValueException('Invalid date_start value'); + } + + $this->merge([ + 'date_start' => $inputValue->format('Y-m-d H:i:s'), + ]); + } + if ($this->filled('date_end')) { + $inputValue = Date::createFromFormat( + 'Y-m-d\TH:i', + $this->string('date_end')->value(), + $this->string('client_timezone')->value() + )?->setTimezone('UTC'); + + if (! $inputValue) { + throw new \UnexpectedValueException('Invalid date_end value'); + } + + $this->merge([ + 'date_end' => $inputValue->format('Y-m-d H:i:s'), + ]); + } + } + + #[\Override] + public function attributes(): array + { + return [ + 'type' => trans('validation.custom.attributes.discount_type'), + 'value' => trans('validation.custom.attributes.discount_value'), + 'is_old_price_displayed' => trans('validation.custom.attributes.is_old_price_displayed'), + 'date_start' => trans('validation.custom.attributes.date_start_show'), + 'date_end' => trans('validation.custom.attributes.date_end_show'), + 'associated_products' => trans('validation.custom.attributes.associated_products'), + ]; + } +} diff --git a/app/Http/Requests/Bo/Discounts/UpdateDiscountRequest.php b/app/Http/Requests/Bo/Discounts/UpdateDiscountRequest.php new file mode 100644 index 00000000..1b3c8086 --- /dev/null +++ b/app/Http/Requests/Bo/Discounts/UpdateDiscountRequest.php @@ -0,0 +1,23 @@ +toDiscountType(), + value: $this->toDiscountValue(), + is_old_price_displayed: $this->boolean('is_old_price_displayed'), + period: $this->toDatePeriod(), + associatedProductsIds: $this->toAssociatedProductsIds(), + ); + } +} diff --git a/app/Http/Requests/Bo/Faqs/StoreFaqRequest.php b/app/Http/Requests/Bo/Faqs/StoreFaqRequest.php new file mode 100644 index 00000000..7311bff3 --- /dev/null +++ b/app/Http/Requests/Bo/Faqs/StoreFaqRequest.php @@ -0,0 +1,48 @@ +authService->check(); + } + + /** @return array */ + public function rules(): array + { + return [ + 'question' => ['required', 'string', 'min:4', 'max:255'], + 'answer' => ['required', 'string', 'min:4'], + ]; + } + + #[\Override] + public function attributes(): array + { + return [ + 'question' => trans('validation.custom.attributes.question'), + 'answer' => trans('validation.custom.attributes.answer'), + ]; + } + + public function toCreateFaqInput(): CreateFaqInput + { + return new CreateFaqInput( + question: $this->string('question')->value(), + answer: $this->string('answer')->value(), + ); + } +} diff --git a/app/Http/Requests/Bo/Faqs/UpdateFaqRequest.php b/app/Http/Requests/Bo/Faqs/UpdateFaqRequest.php new file mode 100644 index 00000000..aeac3218 --- /dev/null +++ b/app/Http/Requests/Bo/Faqs/UpdateFaqRequest.php @@ -0,0 +1,20 @@ +string('question')->value(), + answer: $this->string('answer')->value(), + ); + } +} diff --git a/app/Http/Requests/Bo/FoodProductRequest.php b/app/Http/Requests/Bo/FoodProductRequest.php deleted file mode 100644 index d33a3b8d..00000000 --- a/app/Http/Requests/Bo/FoodProductRequest.php +++ /dev/null @@ -1,113 +0,0 @@ -check(); - } - - /** - * Get the validation rules that apply to the request. - * - * @return array - */ - public function rules() - { - return [ - 'no_art' => 'sometimes|nullable|integer', - 'ingredients' => 'sometimes|nullable|string|min:15', - 'preparation' => 'sometimes|nullable|string|min:15', - 'servings' => 'sometimes|nullable|string|max:20', - 'allergens' => 'sometimes|nullable|string|min:15', - 'selling_argument' => 'sometimes|nullable|string|min:15', - 'nv_ref_weight_g' => 'sometimes|nullable|numeric|max:9999', - 'nv_kj' => 'sometimes|nullable|numeric|max:9999', - 'nv_kcal' => 'sometimes|nullable|numeric|max:9999', - 'nv_fat_g' => 'sometimes|nullable|numeric|max:9999', - 'nv_sat_fat_g' => 'sometimes|nullable|numeric|max:9999', - 'nv_carb_g' => 'sometimes|nullable|numeric|max:9999', - 'nv_sugar_g' => 'sometimes|nullable|numeric|max:9999', - 'nv_fiber_g' => 'sometimes|nullable|numeric|max:9999', - 'nv_protein_g' => 'sometimes|nullable|numeric|max:9999', - 'nv_salt_g' => 'sometimes|nullable|numeric|max:9999', - 'nv_serving_size_g' => 'sometimes|nullable|numeric|max:9999', - 'nv_serving_kj' => 'sometimes|nullable|numeric|max:9999', - 'nv_serving_kcal' => 'sometimes|nullable|numeric|max:9999', - 'nv_serving_fat_g' => 'sometimes|nullable|numeric|max:9999', - 'nv_serving_sat_fat_g' => 'sometimes|nullable|numeric|max:9999', - 'nv_serving_carb_g' => 'sometimes|nullable|numeric|max:9999', - 'nv_serving_sugar_g' => 'sometimes|nullable|numeric|max:9999', - 'nv_serving_fiber_g' => 'sometimes|nullable|numeric|max:9999', - 'nv_serving_protein_g' => 'sometimes|nullable|numeric|max:9999', - 'nv_serving_salt_g' => 'sometimes|nullable|numeric|max:9999', - 'nv_daily_energy' => 'sometimes|nullable|numeric|max:9999', - 'nv_daily_fat' => 'sometimes|nullable|numeric|max:9999', - 'nv_daily_sat_fat' => 'sometimes|nullable|numeric|max:9999', - 'nv_daily_carb' => 'sometimes|nullable|numeric|max:9999', - 'nv_daily_sugar' => 'sometimes|nullable|numeric|max:9999', - 'nv_daily_fiber' => 'sometimes|nullable|numeric|max:9999', - 'nv_daily_protein' => 'sometimes|nullable|numeric|max:9999', - 'nv_daily_salt' => 'sometimes|nullable|numeric|max:9999', - 'nutriscore' => 'sometimes|nullable|string|min:1|max:1', - 'nutriscore_args' => 'sometimes|nullable|string|min:15', - ]; - } - - /** - * Get custom attributes for validator errors. - * - * @return array - */ - public function attributes() - { - return [ - 'product_type' => \trans('type du produit'), - 'no_art' => \trans('numéro article du produit'), - 'ingredients' => \trans('ingredients du produit'), - 'preparation' => \trans('preparation du produit'), - 'servings' => \trans('portions du produit'), - 'allergens' => \trans('allergènes du produit'), - 'selling_argument' => \trans('argument de vente du produit'), - 'nv_ref_weight_g' => \trans('poids de référence du produit'), - 'nv_kj' => \trans('énergie en Kj du produit'), - 'nv_kcal' => \trans('énergie en Kcal du produit'), - 'nv_fat_g' => \trans('graisses du produit'), - 'nv_sat_fat_g' => \trans('dont acides gras saturés du produit'), - 'nv_carb_g' => \trans('glucides du produit'), - 'nv_sugar_g' => \trans('dont sucres du produit'), - 'nv_fiber_g' => \trans('fibres alimentaires du produit'), - 'nv_protein_g' => \trans('protéines du produit'), - 'nv_salt_g' => \trans('sel du produit'), - 'nv_serving_size_g' => \trans('par portion - portion du produit'), - 'nv_serving_kj' => \trans('par portion - énergie en Kj du produit'), - 'nv_serving_kcal' => \trans('par portion - énergie en Kcal du produit'), - 'nv_serving_fat_g' => \trans('par portion - graisses du produit'), - 'nv_serving_sat_fat_g' => \trans('par portion - dont acides gras saturés du produit'), - 'nv_serving_carb_g' => \trans('par portion - glucides du produit'), - 'nv_serving_sugar_g' => \trans('par portion - dont sucres du produit'), - 'nv_serving_fiber_g' => \trans('par portion - fibres alimentaires du produit'), - 'nv_serving_protein_g' => \trans('par portion - protéines du produit'), - 'nv_serving_salt_g' => \trans('par portion - sel du produit'), - 'nv_daily_energy' => \trans('% de APR - énergie du produit'), - 'nv_daily_fat' => \trans('% de APR - graisses du produit'), - 'nv_daily_sat_fat' => \trans('% de APR - dont acides gras saturés du produit'), - 'nv_daily_carb' => \trans('% de APR - glucides du produit'), - 'nv_daily_sugar' => \trans('% de APR - dont sucres du produit'), - 'nv_daily_fiber' => \trans('% de APR - fibres alimentaires du produit'), - 'nv_daily_protein' => \trans('% de APR - protéines'), - 'nv_daily_salt' => \trans('% de APR - sel'), - 'nutriscore' => \trans('nutriscore du produit'), - 'nutriscore_args' => \trans('arguments nutriscore du produit'), - ]; - } -} diff --git a/app/Http/Requests/Bo/ImportRequest.php b/app/Http/Requests/Bo/ImportRequest.php deleted file mode 100644 index 794aed45..00000000 --- a/app/Http/Requests/Bo/ImportRequest.php +++ /dev/null @@ -1,52 +0,0 @@ - [ - 'required', - 'file', - 'mimes:csv,txt', - // phpcs:ignore Generic.Files.LineLength.TooLong - 'mimetypes:text/csv,text/plain,application/csv,text/comma-separated-values,text/anytext,application/octet-stream,application/txt', - // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed - function ($attribute, $value, $fail) { - /** @var \Illuminate\Http\UploadedFile */ - $uploadedFile = $this->file('import'); - $content = $uploadedFile->get(); - if ( - $uploadedFile->getClientMimeType() !== 'text/csv' - && $uploadedFile->getClientMimeType() !== 'application/vnd.ms-excel' - ) { - $fail(__('Le fichier doit être d\'un mime type text/csv ou application/vnd.ms-excel')); - } - if (!$content or mb_detect_encoding($content, ['ISO-8859-1'], true) !== 'ISO-8859-1') { - $fail(__('Le fichier doit etre encodé en ISO-8859-1')); - } - } - ] - ]; - } -} diff --git a/app/Http/Requests/Bo/MassActionRequest.php b/app/Http/Requests/Bo/MassActionRequest.php new file mode 100644 index 00000000..91800716 --- /dev/null +++ b/app/Http/Requests/Bo/MassActionRequest.php @@ -0,0 +1,51 @@ +authService->check(); + } + + /** @return array */ + public function rules(): array + { + return [ + 'action' => ['required', new Enum(MassActionType::class)], + 'models' => ['required', 'array', 'min:1'], + 'models.*' => ['required', 'string', 'min:1'], + ]; + } + + public function getMassActionType(): MassActionType + { + return MassActionType::from($this->string('action')->value()); + } + + /** + * @param class-string<\Illuminate\Database\Eloquent\Model> $modelClass + */ + public function toExecuteMassActionInput(string $modelClass): ExecuteMassActionInput + { + return new ExecuteMassActionInput( + modelClass: $modelClass, + action: $this->getMassActionType(), + modelKeyList: array_values(array_filter($this->array('models'), 'is_string')), + ); + } +} diff --git a/app/Http/Requests/Bo/Orders/IndexOrdersRequest.php b/app/Http/Requests/Bo/Orders/IndexOrdersRequest.php new file mode 100644 index 00000000..0c71bd40 --- /dev/null +++ b/app/Http/Requests/Bo/Orders/IndexOrdersRequest.php @@ -0,0 +1,143 @@ +hasSession() ? $this->session() : null; + $status = $this->getStatus(); + + if ($session !== null) { + if ($this->isNotFilled('status')) { + $session->forget('orders.filter.status'); + } + + if ($this->has('status')) { + $session->forget('orders.filter.status'); + $session->put('orders.filter.status', $status); + } + } + + $search = $this->filled('search') ? $this->string('search')->value() : null; + + return new GetBoPaginatedOrdersQueryInput( + pagination: RequestHelper::pagination($this), + search: $search, + status: $status, + orderDateStart: $this->getOrderDateStart(), + orderDateEnd: $this->getOrderDateEnd(), + orderPickupStart: $this->getOrderPickupStart(), + orderPickupEnd: $this->getOrderPickupEnd(), + ); + } + + public function authorize(): bool + { + return $this->authService->check(); + } + + #[\Override] + protected function prepareForValidation(): void + { + // * Remove empty filter values to prevent date and enum validation failures on empty strings. + foreach ( + [ + 'order_date_start', + 'order_date_end', + 'order_pickup_start', + 'order_pickup_end', + 'status', + ] as $inputName + ) { + if ($this->has($inputName) && empty($this->input($inputName))) { + $this->request->remove($inputName); + $this->query->remove($inputName); + } + } + } + + public function getStatus(): ?OrderStatus + { + if ($this->isNotFilled('status')) { + return null; + } + + $value = $this->input('status'); + + if (is_numeric($value)) { + return OrderStatus::tryFrom((int) $value); + } + + return $this->enum('status', OrderStatus::class); + } + + public function getOrderDateStart(): ?CarbonInterface + { + return $this->has('order_date_start') ? + Date::parse($this->string('order_date_start')->value()) : + null; + } + + public function getOrderDateEnd(): ?CarbonInterface + { + return $this->has('order_date_end') ? + Date::parse($this->string('order_date_end')->value()) : + null; + } + + public function getOrderPickupStart(): ?CarbonInterface + { + return $this->has('order_pickup_start') ? + Date::parse($this->string('order_pickup_start')->value()) : + null; + } + + public function getOrderPickupEnd(): ?CarbonInterface + { + return $this->has('order_pickup_end') ? + Date::parse($this->string('order_pickup_end')->value()) : + null; + } + + /** @return array */ + public function rules(): array + { + return [ + 'status' => ['sometimes', 'nullable', new Enum(OrderStatus::class)], + 'order_date_start' => ['required_with:order_date_end', 'sometimes', 'date'], + 'order_date_end' => ['sometimes', 'date', 'after:order_date_start'], + 'order_pickup_start' => ['required_with:order_pickup_end', 'sometimes', 'date'], + 'order_pickup_end' => ['sometimes', 'date', 'after:order_pickup_start'], + ]; + } + + #[\Override] + public function attributes(): array + { + return [ + 'status' => trans('validation.custom.attributes.order_status'), + 'order_date_start' => trans('validation.custom.attributes.order_date_start'), + 'order_date_end' => trans('validation.custom.attributes.order_date_end'), + 'order_pickup_start' => trans('validation.custom.attributes.order_pickup_start'), + 'order_pickup_end' => trans('validation.custom.attributes.order_pickup_end'), + ]; + } +} diff --git a/app/Http/Requests/Bo/Pages/UpdatePageRequest.php b/app/Http/Requests/Bo/Pages/UpdatePageRequest.php new file mode 100644 index 00000000..e6ac734a --- /dev/null +++ b/app/Http/Requests/Bo/Pages/UpdatePageRequest.php @@ -0,0 +1,59 @@ +authService->check(); + } + + public function toUpdatePageInput(Page $page): UpdatePageInput + { + return new UpdatePageInput( + page: $page, + seo: new SeoMetadata( + title: $this->string('seo_title')->value(), + description: $this->string('seo_description')->value(), + ), + title: $this->filled('title') ? $this->string('title')->value() : null, + content: $this->string('content')->value(), + ); + } + + /** @return array */ + public function rules(): array + { + return [ + 'seo_title' => ['required', 'string', 'between:45,70'], + 'seo_description' => ['required', 'string', 'between:50,160'], + 'title' => ['nullable', 'string', 'min:3', 'max:255'], + 'content' => ['required', 'string'], + ]; + } + + #[\Override] + public function attributes(): array + { + return [ + 'seo_title' => trans('validation.custom.attributes.seo_title'), + 'seo_description' => trans('validation.custom.attributes.seo_description'), + 'title' => trans('validation.attributes.title'), + 'content' => trans('validation.attributes.content'), + ]; + } +} diff --git a/app/Http/Requests/Bo/PickupExceptions/StorePickupExceptionRequest.php b/app/Http/Requests/Bo/PickupExceptions/StorePickupExceptionRequest.php new file mode 100644 index 00000000..0c62e0d1 --- /dev/null +++ b/app/Http/Requests/Bo/PickupExceptions/StorePickupExceptionRequest.php @@ -0,0 +1,84 @@ +authService->check(); + } + + public function toRepeatFrequency(): RepeatFrequency + { + $val = $this->input('repeat_frequency'); + + return $val instanceof RepeatFrequency + ? $val + : RepeatFrequency::from($this->string('repeat_frequency')->value()); + } + + public function toCreatePickupExceptionInput(): CreatePickupExceptionInput + { + return new CreatePickupExceptionInput( + date: $this->string('date')->value(), + label: $this->string('label')->value(), + repeatable: $this->boolean('repeatable'), + repeat_frequency: $this->toRepeatFrequency(), + ); + } + + #[\Override] + protected function prepareForValidation(): void + { + $this->merge([ + 'repeatable' => $this->boolean('repeatable'), + ]); + } + + /** @return array */ + public function rules(): array + { + return [ + 'date' => ['required', 'date_format:Y-m-d'], + 'label' => ['required', 'string', 'max:255'], + 'repeatable' => ['present', 'boolean:strict'], + + 'repeat_frequency' => ['nullable', 'required_if:repeatable,true', new Enum(RepeatFrequency::class)], + ]; + } + + #[\Override] + protected function passedValidation(): void + { + if (! $this->boolean('repeatable')) { + $this->merge([ + 'repeat_frequency' => RepeatFrequency::WEEKLY->value, + ]); + } + } + + #[\Override] + public function attributes(): array + { + return [ + 'date' => trans('validation.attributes.date'), + 'label' => trans('validation.custom.attributes.label'), + 'repeatable' => trans('validation.custom.attributes.repeatable'), + 'repeat_frequency' => trans('validation.custom.attributes.repeat_frequency'), + ]; + } +} diff --git a/app/Http/Requests/Bo/PickupExceptions/UpdatePickupExceptionRequest.php b/app/Http/Requests/Bo/PickupExceptions/UpdatePickupExceptionRequest.php new file mode 100644 index 00000000..45b49699 --- /dev/null +++ b/app/Http/Requests/Bo/PickupExceptions/UpdatePickupExceptionRequest.php @@ -0,0 +1,22 @@ +string('date')->value(), + label: $this->string('label')->value(), + repeatable: $this->boolean('repeatable'), + repeat_frequency: $this->toRepeatFrequency(), + ); + } +} diff --git a/app/Http/Requests/Bo/ProductIncos/AssociateProductIncoRequest.php b/app/Http/Requests/Bo/ProductIncos/AssociateProductIncoRequest.php new file mode 100644 index 00000000..ffd102b0 --- /dev/null +++ b/app/Http/Requests/Bo/ProductIncos/AssociateProductIncoRequest.php @@ -0,0 +1,39 @@ +authService->check(); + } + + /** @return array */ + public function rules(): array + { + return [ + 'no_art' => ['required', 'integer', 'min:1'], + ]; + } + + public function toAssociateProductIncoInput(Product $product): AssociateProductIncoInput + { + return new AssociateProductIncoInput( + product: $product, + no_art: $this->integer('no_art') + ); + } +} diff --git a/app/Http/Requests/Bo/ProductIncos/PreviewArcadiaIncoRequest.php b/app/Http/Requests/Bo/ProductIncos/PreviewArcadiaIncoRequest.php new file mode 100644 index 00000000..b99805ee --- /dev/null +++ b/app/Http/Requests/Bo/ProductIncos/PreviewArcadiaIncoRequest.php @@ -0,0 +1,45 @@ +authService->check(); + } + + #[\Override] + protected function prepareForValidation(): void + { + if (! $this->has('no_art') && $this->route('no_art') !== null) { + $this->merge(['no_art' => $this->route('no_art')]); + } + } + + /** @return array */ + public function rules(): array + { + return [ + 'no_art' => ['required', 'integer', 'min:1'], + ]; + } + + public function toGetArcadiaIncoPreviewQueryInput(): GetArcadiaIncoPreviewQueryInput + { + return new GetArcadiaIncoPreviewQueryInput( + noArt: $this->integer('no_art') + ); + } +} diff --git a/app/Http/Requests/Bo/ProductIncos/SyncProductIncoRequest.php b/app/Http/Requests/Bo/ProductIncos/SyncProductIncoRequest.php new file mode 100644 index 00000000..254b8f37 --- /dev/null +++ b/app/Http/Requests/Bo/ProductIncos/SyncProductIncoRequest.php @@ -0,0 +1,36 @@ +authService->check(); + } + + /** @return array */ + public function rules(): array + { + return []; + } + + public function toSyncProductIncoInput(Product $product): SyncProductIncoInput + { + return new SyncProductIncoInput( + product: $product + ); + } +} diff --git a/app/Http/Requests/Bo/ProductRequest.php b/app/Http/Requests/Bo/ProductRequest.php deleted file mode 100644 index 0017c96c..00000000 --- a/app/Http/Requests/Bo/ProductRequest.php +++ /dev/null @@ -1,118 +0,0 @@ -check(); - } - - /** - * Prepare the data for validation. - * - * @return void - */ - protected function prepareForValidation() - { - $this->merge([ - 'slug' => Str::slug(strip_tags($this->name)), - 'weight_variable' => $this->weight_variable ? true : false, - 'star' => $this->star ? true : false, - 'status' => $this->status ? true : false - ]); - $this->foodProductRules = ($this->product_type !== null) ? FoodProductRequest::rules() : []; - } - - /** - * Get the validation rules that apply to the request. - * - * @return array - */ - public function rules() - { - $rules = [ - 'product_type' => 'sometimes|nullable|string|min:3|max:255', - 'name' => 'required|string|min:3|max:255', - 'brand' => 'sometimes|nullable|string|min:3|max:255', - 'description' => 'required|string|min:15', - 'picture' => 'sometimes|nullable|image|mimes:jpeg,png,jpg|max:2048|dimensions:max_width=' . - config('theme.product_image_maxwidth') . ',max_height=' . - config('theme.product_image_maxheight'), - 'picture_large' => 'sometimes|nullable|image|mimes:jpeg,png,jpg|max:2048|dimensions:max_width=' . - config('theme.product_image_large_maxwidth') . ',max_height=' . - config('theme.product_image_large_maxheight'), - 'price' => 'required|min:0|numeric', - 'invoicing_unit' => 'sometimes|nullable|string|min:3|max:255', - 'price_buy' => 'sometimes|nullable|min:0|numeric', - 'tax_rate_id' => 'required|integer|exists:tax_rates,id', - 'stock' => 'sometimes|nullable|integer', - 'sell_unit' => 'sometimes|nullable|string|min:3|max:255', - 'order_unit' => 'sometimes|nullable|string|min:3|max:255', - 'weight' => 'sometimes|nullable|numeric', - 'weight_unit' => 'sometimes|nullable|string|min:1|max:255', - 'weight_variable' => 'required|boolean', - 'reference' => 'sometimes|nullable|string|min:1|max:255', - 'slug' => 'required|string|min:3|max:255', - 'star' => 'required|boolean', - 'status' => 'required|boolean', - 'orderable_start' => 'sometimes|nullable|date', - 'orderable_end' => 'sometimes|nullable|date', - 'range_id' => 'required|integer|exists:ranges,id', - 'margin' => 'sometimes|nullable|integer', - ]; - return \array_merge( - $rules, - $this->foodProductRules, - ); - } - - /** - * Get custom attributes for validator errors. - * - * @return array - */ - public function attributes() - { - return [ - 'product_type' => \trans('type du produit'), - 'name' => \trans('nom du produit'), - 'brand' => \trans('marque du produit'), - 'description' => \trans('description du produit'), - 'picture' => \trans('image du produit'), - 'picture_large' => \trans('image laaaaarge du produit'), - 'price' => \trans('prix du produit'), - 'invoicing_unit' => \trans('unité de facturation du produit'), - 'price_buy' => \trans('prix d\'achat du produit'), - 'tax_rate_id' => \trans('taux d\'imposition du produit'), - 'stock' => \trans('stock du produit'), - 'sell_unit' => \trans('unité de vente du produit'), - 'order_unit' => \trans('unité de commande du produit'), - 'weight' => \trans('poids du produit'), - 'weight_unit' => \trans('unité de poids du produit'), - 'weight_variable' => \trans('poids variable du produit'), - 'reference' => \trans('reference du produit'), - 'slug' => \trans('slug du produit'), - 'star' => \trans('mis en avant du produit'), - 'status' => \trans('publication du produit'), - 'orderable_start' => \trans('début de commande du produit'), - 'orderable_end' => \trans('fin de commande du produit'), - 'range_id' => \trans('gamme du produit'), - 'margin' => \trans('margin du produit'), - ]; - } -} diff --git a/app/Http/Requests/Bo/Products/IndexProductRequest.php b/app/Http/Requests/Bo/Products/IndexProductRequest.php new file mode 100644 index 00000000..a3b9f6b1 --- /dev/null +++ b/app/Http/Requests/Bo/Products/IndexProductRequest.php @@ -0,0 +1,112 @@ +hasSession() ? $this->session() : null; + + $brand = $this->resolveFilterValue('brand', $session); + $tag = $this->resolveFilterValue('tag', $session); + $range = $this->resolveFilterValue('range', $session); + + $discount = $this->resolveFilterValue('discount', $session); + $star = $this->resolveBooleanFilter('star', $starred, $session); + + $search = $this->filled('search') ? $this->string('search')->value() : null; + + return new GetBoPaginatedProductsQueryInput( + pagination: RequestHelper::pagination($this), + search: $search, + brand: $brand, + starred: $star, + discount: $discount, + tag: $tag, + range: $range, + ); + } + + private function resolveFilterValue(string $key, ?Session $session): ?string + { + if ($session === null) { + $val = $this->filled($key) ? $this->string($key)->value() : null; + + return is_string($val) && $val !== '' ? $val : null; + } + + if ($this->has($key)) { + $val = $this->filled($key) ? $this->string($key)->value() : null; + if ($val === null) { + $session->forget("products.filter.{$key}"); + } else { + $session->put("products.filter.{$key}", $val); + } + } + + $sessionVal = $session->get("products.filter.{$key}"); + + return is_string($sessionVal) && $sessionVal !== '' ? $sessionVal : null; + } + + private function resolveBooleanFilter(string $key, bool $default, ?Session $session): bool + { + $val = $default || $this->boolean($key); + if ($session !== null) { + $session->forget("products.filter.{$key}"); + if ($val) { + $session->put("products.filter.{$key}", true); + } + } + + return $val; + } + + public function authorize(): bool + { + return $this->authService->check(); + } + + #[\Override] + protected function prepareForValidation(): void + { + $this->merge([ + 'star' => $this->boolean('star'), + ]); + } + + /** @return array */ + public function rules(): array + { + + return [ + 'discount' => ['sometimes', 'nullable', 'string', 'max:255'], + 'star' => ['required', 'boolean'], + 'brand' => ['sometimes', 'nullable', 'string', 'min:3', 'max:255'], + ]; + } + + #[\Override] + public function attributes(): array + { + return [ + 'discount' => trans_choice('models.classes.discounts', 1), + 'star' => trans('crud.helpers.starred'), + 'description' => trans('validation.attributes.description'), + ]; + } +} diff --git a/app/Http/Requests/Bo/Products/StoreProductRequest.php b/app/Http/Requests/Bo/Products/StoreProductRequest.php new file mode 100644 index 00000000..748678dd --- /dev/null +++ b/app/Http/Requests/Bo/Products/StoreProductRequest.php @@ -0,0 +1,235 @@ +authService->check(); + } + + #[\Override] + protected function prepareForValidation(): void + { + $this->merge([ + 'status' => $this->boolean('status'), + 'star' => $this->boolean('star'), + 'weight_variable' => $this->boolean('weight_variable'), + 'tags' => $this->array('tags'), + 'associated_products' => $this->array('associated_products'), + ]); + } + + public function getPrice(): Money + { + return new Money( + intval($this->integer('price')), + resolve(Currency::class) + ); + } + + /** @return list */ + public function getAssociatedProductsIds(): array + { + return array_values(array_map( + fn ($id) => (string) $id, + $this->array('associated_products') + )); + } + + public function toCreateProductInput(): CreateProductInput + { + return new CreateProductInput( + name: $this->string('name')->value(), + shortDescription: $this->string('short_description')->value(), + description: $this->string('description')->value(), + price: $this->getPrice(), + invoicingUnit: InvoicingUnit::from($this->string('invoicing_unit')->value()), + stock: $this->integer('stock'), + rangeId: $this->integer('range_id'), + sellUnit: SellUnit::from($this->string('sell_unit')->value()), + orderUnit: OrderUnit::from($this->string('order_unit')->value()), + taxRate: TaxRate::from($this->integer('tax_rate')), + brand: ProductBrand::from($this->string('brand')->value()), + weight: $this->filled('weight') ? $this->integer('weight') : null, + weightVariable: $this->boolean('weight_variable'), + orderableStart: $this->filled('orderable_start') ? CarbonImmutable::parse($this->string('orderable_start')->value()) : null, + orderableEnd: $this->filled('orderable_end') ? CarbonImmutable::parse($this->string('orderable_end')->value()) : null, + star: $this->boolean('star'), + status: $this->boolean('status'), + picture: $this->file('picture') ?? $this->input('picture'), + pictureAlt: $this->filled('picture_alt') ? $this->string('picture_alt')->value() : null, + pictureTitle: $this->filled('picture_title') ? $this->string('picture_title')->value() : null, + pictureLarge: $this->file('picture_large') ?? $this->input('picture_large'), + pictureLargeAlt: $this->filled('picture_large_alt') ? $this->string('picture_large_alt')->value() : null, + pictureLargeTitle: $this->filled('picture_large_title') ? $this->string('picture_large_title')->value() : null, + tags: $this->array('tags'), + associatedProductsIds: $this->getAssociatedProductsIds(), + ); + } + + /** @return array */ + public function rules(): array + { + $maxWidth = 200; + $maxHeight = 200; + $maxWidthLarge = 500; + $maxHeightLarge = 500; + + return array_merge( + [ + 'name' => ['required', 'string', 'min:3', 'max:255'], + 'brand' => ['sometimes', 'nullable', 'string', 'min:3', 'max:255'], + 'short_description' => ['required', 'string', 'min:15', 'max:100'], + 'description' => ['required', 'string', 'min:15'], + 'price' => ['required', 'min:0', 'numeric'], + 'invoicing_unit' => ['required', new Enum(InvoicingUnit::class)], + 'stock' => ['required', 'integer', 'min:0'], + 'weight' => ['sometimes', 'nullable', 'numeric'], + + 'orderable_start' => ['nullable', 'date_format:Y-m-d\TH:i'], + 'orderable_end' => ['nullable', 'date_format:Y-m-d\TH:i', 'after:orderable_start'], + 'client_timezone' => ['required', 'timezone'], + + 'range_id' => ['required', 'integer', 'exists:ranges,id'], + + 'tags' => ['present', 'array'], + 'tags.*.id' => ['sometimes', 'exists:tags,id'], + 'tags.*.label' => ['required', 'string', 'min:2', 'max:45'], + 'star' => ['required', 'boolean'], + 'status' => ['required', 'boolean'], + 'weight_variable' => ['required', 'boolean'], + + 'sell_unit' => ['required', new Enum(SellUnit::class)], + 'order_unit' => ['required', new Enum(OrderUnit::class)], + 'tax_rate' => ['required', new Enum(TaxRate::class)], + + 'associated_products' => ['present', 'array'], + 'associated_products.*' => ['string', 'exists:products,id'], + ], + $this->pictureRules( + 'picture', + $maxWidth, + $maxHeight, + $maxWidth, + $maxHeight, + true + ), + $this->pictureRules( + 'picture_large', + $maxWidthLarge, + $maxHeightLarge, + $maxWidthLarge, + $maxHeightLarge, + true + ) + ); + } + + #[\Override] + protected function passedValidation() + { + if ($this->filled('orderable_start')) { + $inputValue = Date::createFromFormat( + 'Y-m-d\TH:i', + $this->string('orderable_start')->value(), + $this->string('client_timezone')->value() + )?->setTimezone('UTC'); + + if (! $inputValue) { + throw new \UnexpectedValueException('Invalid orderable_start value'); + } + + $this->merge([ + 'orderable_start' => $inputValue->format('Y-m-d H:i:s'), + ]); + } + if ($this->filled('orderable_end')) { + $inputValue = Date::createFromFormat( + 'Y-m-d\TH:i', + $this->string('orderable_end')->value(), + $this->string('client_timezone')->value() + )?->setTimezone('UTC'); + + if (! $inputValue) { + throw new \UnexpectedValueException('Invalid orderable_end value'); + } + + $this->merge([ + 'orderable_end' => $inputValue->format('Y-m-d H:i:s'), + ]); + } + + // * Convert to gram + if ($this->filled('weight')) { + $this->merge([ + 'weight' => (int) round($this->float('weight') * 1000), + ]); + } + } + + #[\Override] + public function attributes(): array + { + return [ + 'name' => trans('validation.attributes.name'), + 'short_description' => trans('validation.custom.attributes.short_description'), + 'description' => trans('validation.attributes.description'), + 'status' => trans('validation.custom.attributes.status'), + 'star' => trans('validation.custom.attributes.star'), + 'picture' => trans('validation.attributes.image'), + 'picture_alt' => trans('validation.custom.attributes.picture_alt'), + 'picture_title' => trans('validation.custom.attributes.picture_title'), + 'picture_large' => trans('validation.custom.attributes.picture_large'), + 'picture_large_alt' => trans('validation.custom.attributes.picture_large_alt'), + 'picture_large_title' => trans('validation.custom.attributes.picture_large_title'), + + 'stock' => trans('validation.custom.attributes.stock'), + 'brand' => trans('validation.custom.attributes.brand'), + 'tax_rate' => trans('validation.custom.attributes.tax_rate'), + + 'sell_unit' => trans('validation.custom.attributes.sell_unit'), + 'order_unit' => trans('validation.custom.attributes.order_unit'), + 'invoicing_unit' => trans('validation.custom.attributes.invoicing_unit'), + + 'weight_variable' => trans('validation.custom.attributes.weight_variable'), + + 'price' => trans('validation.attributes.price'), + 'weight' => trans('validation.custom.attributes.weight'), + + 'orderable_start' => trans('validation.custom.attributes.date_start_orderable'), + 'orderable_end' => trans('validation.custom.attributes.date_end_orderable'), + + 'range_id' => trans_choice('models.classes.ranges', 1), + + 'tags' => trans_choice('models.classes.tags', \INF), + + 'associated_products' => trans('validation.custom.attributes.associated_products'), + ]; + } +} diff --git a/app/Http/Requests/Bo/Products/UpdateProductRequest.php b/app/Http/Requests/Bo/Products/UpdateProductRequest.php new file mode 100644 index 00000000..1d104b51 --- /dev/null +++ b/app/Http/Requests/Bo/Products/UpdateProductRequest.php @@ -0,0 +1,49 @@ +string('name')->value(), + shortDescription: $this->string('short_description')->value(), + description: $this->string('description')->value(), + price: $this->getPrice(), + invoicingUnit: InvoicingUnit::from($this->string('invoicing_unit')->value()), + stock: $this->integer('stock'), + rangeId: $this->integer('range_id'), + sellUnit: SellUnit::from($this->string('sell_unit')->value()), + orderUnit: OrderUnit::from($this->string('order_unit')->value()), + taxRate: TaxRate::from($this->integer('tax_rate')), + brand: ProductBrand::from($this->string('brand')->value()), + weight: $this->filled('weight') ? $this->integer('weight') : null, + weightVariable: $this->boolean('weight_variable'), + orderableStart: $this->filled('orderable_start') ? CarbonImmutable::parse($this->string('orderable_start')->value()) : null, + orderableEnd: $this->filled('orderable_end') ? CarbonImmutable::parse($this->string('orderable_end')->value()) : null, + star: $this->boolean('star'), + status: $this->boolean('status'), + picture: $this->file('picture') ?? $this->input('picture'), + pictureAlt: $this->filled('picture_alt') ? $this->string('picture_alt')->value() : null, + pictureTitle: $this->filled('picture_title') ? $this->string('picture_title')->value() : null, + pictureLarge: $this->file('picture_large') ?? $this->input('picture_large'), + pictureLargeAlt: $this->filled('picture_large_alt') ? $this->string('picture_large_alt')->value() : null, + pictureLargeTitle: $this->filled('picture_large_title') ? $this->string('picture_large_title')->value() : null, + tags: $this->array('tags'), + associatedProductsIds: $this->getAssociatedProductsIds(), + ); + } +} diff --git a/app/Http/Requests/Bo/Ranges/StoreRangeRequest.php b/app/Http/Requests/Bo/Ranges/StoreRangeRequest.php new file mode 100644 index 00000000..b55c9d0a --- /dev/null +++ b/app/Http/Requests/Bo/Ranges/StoreRangeRequest.php @@ -0,0 +1,89 @@ +authService->check(); + } + + #[\Override] + protected function prepareForValidation(): void + { + $this->merge([ + 'status' => $this->boolean('status'), + ]); + } + + /** @return array */ + public function rules(): array + { + $maxWidth = 500; + $maxHeight = 500; + + return array_merge( + [ + 'name' => ['required', 'string', 'min:2', 'max:45'], + 'description' => ['nullable', 'string', 'min:2'], + 'picture_alt' => ['required_with:picture', 'string', 'min:4', 'max:75'], + 'picture_title' => ['required_with:picture', 'string', 'min:4', 'max:75'], + 'status' => ['present', 'boolean:strict'], + ], + $this->pictureRules( + 'picture', + $maxWidth, + $maxHeight, + $maxWidth, + $maxHeight, + true + ) + ); + } + + #[\Override] + public function attributes(): array + { + return [ + 'name' => trans('validation.attributes.name'), + 'description' => trans('validation.attributes.description'), + 'status' => trans('validation.custom.attributes.status'), + 'picture' => trans('validation.attributes.image'), + 'picture_alt' => trans('validation.custom.attributes.picture_alt'), + 'picture_title' => trans('validation.custom.attributes.picture_title'), + ]; + } + + public function toCreateRangeInput(): CreateRangeInput + { + $pictureAlt = $this->filled('picture_alt') ? $this->string('picture_alt')->value() : null; + $pictureTitle = $this->filled('picture_title') ? $this->string('picture_title')->value() : null; + + return new CreateRangeInput( + name: $this->string('name')->value(), + description: $this->filled('description') ? $this->string('description')->value() : null, + picture: $this->file('picture'), + pictureMetadata: new PictureMetadata( + alt: $pictureAlt, + title: $pictureTitle, + ), + status: $this->boolean('status'), + ); + } +} diff --git a/app/Http/Requests/Bo/Ranges/UpdateRangeRequest.php b/app/Http/Requests/Bo/Ranges/UpdateRangeRequest.php new file mode 100644 index 00000000..f8c39523 --- /dev/null +++ b/app/Http/Requests/Bo/Ranges/UpdateRangeRequest.php @@ -0,0 +1,30 @@ +filled('picture_alt') ? $this->string('picture_alt')->value() : null; + $pictureTitle = $this->filled('picture_title') ? $this->string('picture_title')->value() : null; + + return new UpdateRangeInput( + range: $range, + name: $this->string('name')->value(), + description: $this->filled('description') ? $this->string('description')->value() : null, + picture: $this->file('picture'), + pictureMetadata: new PictureMetadata( + alt: $pictureAlt, + title: $pictureTitle, + ), + status: $this->boolean('status'), + ); + } +} diff --git a/app/Http/Requests/Bo/SalariesImportRequest.php b/app/Http/Requests/Bo/SalariesImportRequest.php deleted file mode 100644 index 0e88e993..00000000 --- a/app/Http/Requests/Bo/SalariesImportRequest.php +++ /dev/null @@ -1,46 +0,0 @@ -role === 1); - } - - /** - * Get the validation rules that apply to the request. - * - * @return array - */ - public function rules() - { - return [ - 'import' => [ - 'required', - 'file', - 'mimes:csv,txt', - // phpcs:ignore Generic.Files.LineLength.TooLong - 'mimetypes:text/csv,text/plain,application/csv,text/comma-separated-values,text/anytext,application/octet-stream,application/txt', - // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed - function ($attribute, $value, $fail) { - if ( - $this->import->getClientMimeType() !== 'text/csv' - && $this->import->getClientMimeType() !== 'application/vnd.ms-excel' - ) { - $fail(__('Le fichier doit être d\'un mime type text/csv ou application/vnd.ms-excel')); - } - } - ] - ]; - } -} diff --git a/app/Http/Requests/Bo/Settings/UpdateSettingsRequest.php b/app/Http/Requests/Bo/Settings/UpdateSettingsRequest.php new file mode 100644 index 00000000..8e2f6c5a --- /dev/null +++ b/app/Http/Requests/Bo/Settings/UpdateSettingsRequest.php @@ -0,0 +1,94 @@ +authService->check(); + } + + #[\Override] + protected function prepareForValidation(): void + { + $rawSites = $this->input('employee_sites'); + + if (is_string($rawSites)) { + $split = preg_split('/[\s,]+/', $rawSites) ?: []; + $filtered = array_filter( + array_map(static fn (string $s): string => strtoupper(trim($s)), $split), + static fn (string $s): bool => $s !== '' + ); + $sites = array_values(array_unique($filtered)); + } elseif (is_array($rawSites)) { + $filtered = array_filter( + array_map(static fn (mixed $s): string => is_string($s) ? strtoupper(trim($s)) : '', $rawSites), + static fn (string $s): bool => $s !== '' + ); + $sites = array_values(array_unique($filtered)); + } else { + $sites = []; + } + + $this->merge([ + 'employee_sites' => $sites, + ]); + } + + /** + * @return array + */ + public function rules(): array + { + return [ + 'employee_sites' => ['present', 'array'], + 'employee_sites.*' => ['string', 'regex:/^[A-Z]{2,}$/'], + ]; + } + + #[\Override] + public function attributes(): array + { + return [ + 'employee_sites' => 'Sites des salariés', + 'employee_sites.*' => 'Code de site des salariés', + ]; + } + + /** + * @return array + */ + #[\Override] + public function messages(): array + { + return [ + 'employee_sites.*.regex' => 'Chaque code de site doit être composé d\'au moins 2 lettres majuscules (ex: PA, NA, LY).', + ]; + } + + public function toUpdateSettingsInput(): UpdateSettingsInput + { + /** @var array $sites */ + $sites = $this->validated('employee_sites', []); + + return new UpdateSettingsInput( + employeeSites: array_map( + static fn (string $site): ShopperSiteCode => new ShopperSiteCode($site), + $sites + ) + ); + } +} diff --git a/app/Http/Requests/Bo/Shops/IndexShopRequest.php b/app/Http/Requests/Bo/Shops/IndexShopRequest.php new file mode 100644 index 00000000..b157ec67 --- /dev/null +++ b/app/Http/Requests/Bo/Shops/IndexShopRequest.php @@ -0,0 +1,68 @@ +authService->check(); + } + + #[\Override] + protected function prepareForValidation(): void + { + if ($this->has('pickup-exception')) { + $filterValue = $this->string('pickup-exception'); + + if ($filterValue->isEmpty()) { + $this->session()->forget(self::SESSION_KEY); + } else { + $this->session()->put(self::SESSION_KEY, (string) $filterValue); + } + } + } + + public function toPickupExceptionId(): ?PickupExceptionId + { + $raw = $this->session()->get(self::SESSION_KEY); + if ($raw === null || ! is_string($raw) || $raw === '' || ! Uuid::isValid($raw)) { + return null; + } + + $uuid = Uuid::fromString($raw); + if (! UuidHelper::isV7($uuid)) { + return null; + } + + return new PickupExceptionId($uuid); + } + + public function getPickupExceptionId(): ?PickupExceptionId + { + return $this->toPickupExceptionId(); + } + + /** @return array */ + public function rules(): array + { + return [ + 'pickup-exception' => ['sometimes', 'nullable', 'string', 'uuid'], + ]; + } +} diff --git a/app/Http/Requests/Bo/Shops/StoreShopRequest.php b/app/Http/Requests/Bo/Shops/StoreShopRequest.php new file mode 100644 index 00000000..74c70c35 --- /dev/null +++ b/app/Http/Requests/Bo/Shops/StoreShopRequest.php @@ -0,0 +1,129 @@ +string('name')->value(), + address: $this->string('address')->value(), + postcode: $this->string('postcode')->value(), + city: $this->string('city')->value(), + phone: $this->toPhoneNumber(), + coordinates: $this->toCoordinates(), + default: $this->boolean('default'), + ); + } + + public function authorize(): bool + { + return $this->authService->check(); + } + + public function toCoordinates(): ?Coordinates + { + /** @var float|null $latitude */ + $latitude = $this->whenHas( + 'latitude', + fn ($value) => is_numeric($value) ? (float) $value : null, + fn () => null, + ); + /** @var float|null $longitude */ + $longitude = $this->whenHas( + 'longitude', + fn ($value) => is_numeric($value) ? (float) $value : null, + fn () => null, + ); + + if ($latitude !== null && $longitude !== null) { + return new Coordinates($latitude, $longitude); + } + + return null; + } + + public function toPhoneNumber(): ?DomainPhoneNumber + { + $phone = $this->input('phone'); + + if ($phone !== null && $phone !== '') { + /** @var LaravelPhoneNumber $phone */ + $phone = $phone instanceof LaravelPhoneNumber + ? $phone + : new LaravelPhoneNumber($this->string('phone')->value(), 'FR'); + + return new DomainPhoneNumber($phone->formatRFC3966()); + } + + return null; + } + + #[\Override] + protected function prepareForValidation(): void + { + $this->merge([ + 'default' => $this->boolean('default'), + ]); + } + + /** @return array */ + public function rules(): array + { + return [ + 'name' => ['required', 'string', 'max:255'], + 'address' => ['required', 'string', 'max:255'], + 'postcode' => ['required', 'postal_code:FR', 'max:255'], + 'city' => ['required', 'string', 'max:255'], + 'default' => ['required', 'boolean'], + 'phone' => ['sometimes', 'nullable', 'phone:FR', 'max:255'], + 'latitude' => ['sometimes', 'nullable', 'numeric'], + 'longitude' => ['sometimes', 'nullable', 'numeric'], + ]; + } + + #[\Override] + protected function passedValidation() + { + if ($this->filled('phone')) { + $inputValue = new LaravelPhoneNumber( + $this->string('phone')->value(), + 'FR' + ); + + $this->merge([ + 'phone' => $inputValue->formatE164(), + ]); + } + } + + #[\Override] + public function attributes(): array + { + return [ + 'name' => trans('validation.attributes.name'), + 'address' => trans('validation.custom.attributes.postal_address'), + 'postcode' => trans('validation.attributes.postal_code'), + 'city' => trans('validation.attributes.city'), + 'phone' => trans('validation.attributes.phone'), + 'latitude' => trans('validation.custom.attributes.latitude'), + 'longitude' => trans('validation.custom.attributes.longitude'), + 'default' => trans('validation.custom.attributes.default'), + ]; + } +} diff --git a/app/Http/Requests/Bo/Shops/UpdateShopPickupExceptionsRequest.php b/app/Http/Requests/Bo/Shops/UpdateShopPickupExceptionsRequest.php new file mode 100644 index 00000000..8072f7e8 --- /dev/null +++ b/app/Http/Requests/Bo/Shops/UpdateShopPickupExceptionsRequest.php @@ -0,0 +1,130 @@ +toSyncData(), + ); + } + + public function authorize(): bool + { + return $this->authService->check(); + } + + #[\Override] + protected function prepareForValidation(): void + { + $this->merge([ + 'pickup-exceptions' => $this->input('pickup-exceptions', []), + 'replacement_date' => $this->input('replacement_date', []), + 'order_deadline_at' => $this->input('order_deadline_at', []), + ]); + } + + /** @return array */ + public function rules(): array + { + return [ + 'pickup-exceptions' => ['array'], + 'pickup-exceptions.*' => ['required', 'string', 'uuid', 'exists:pickup_exceptions,id'], + + 'replacement_date' => ['array'], + 'replacement_date.*' => [ + 'nullable', + 'date_format:Y-m-d', + 'required_with:order_deadline_at.*', + ], + + 'order_deadline_at' => ['array'], + 'order_deadline_at.*' => [ + 'nullable', + 'date_format:Y-m-d\TH:i', + 'before:replacement_date.*', + ], + + 'client_timezone' => ['required', 'timezone'], + ]; + } + + #[\Override] + protected function passedValidation(): void + { + $deadlines = $this->array('order_deadline_at'); + $timezone = $this->string('client_timezone')->value(); + + foreach ($deadlines as $id => $deadline) { + if (! empty($deadline)) { + $deadlines[$id] = Date::createFromFormat( + 'Y-m-d\TH:i', + $deadline, + $timezone + ) + ?->setTimezone('UTC') + ?->format('Y-m-d H:i:s'); + } + } + + $this->merge([ + 'order_deadline_at' => $deadlines, + ]); + } + + #[\Override] + public function attributes(): array + { + return [ + 'pickup-exceptions' => Str::lower(trans_choice('models.classes.pickup-exceptions', \INF)), + 'pickup-exceptions.*' => Str::lower(trans_choice('models.classes.pickup-exceptions', 1)), + 'replacement_date' => trans('validation.custom.attributes.replacement_date'), + 'replacement_date.*' => trans('validation.custom.attributes.replacement_date'), + 'order_deadline_at' => trans('validation.custom.attributes.order_deadline_at'), + 'order_deadline_at.*' => trans('validation.custom.attributes.order_deadline_at'), + 'client_timezone' => trans('validation.attributes.timezone'), + ]; + } + + /** + * @return array + */ + public function toSyncData(): array + { + $pickupExceptions = $this->array('pickup-exceptions'); + $replacementDates = $this->array('replacement_date'); + $orderDeadlines = $this->array('order_deadline_at'); + + $syncData = []; + + foreach ($pickupExceptions as $exceptionId) { + $exceptionId = (string) $exceptionId; + $replacementDate = ! empty($replacementDates[$exceptionId]) ? (string) $replacementDates[$exceptionId] : null; + $orderDeadline = ! empty($orderDeadlines[$exceptionId]) ? (string) $orderDeadlines[$exceptionId] : null; + + $syncData[$exceptionId] = [ + 'replacement_date' => $replacementDate, + 'order_deadline_at' => $orderDeadline, + ]; + } + + return $syncData; + } +} diff --git a/app/Http/Requests/Bo/Shops/UpdateShopRequest.php b/app/Http/Requests/Bo/Shops/UpdateShopRequest.php new file mode 100644 index 00000000..a69e6ec8 --- /dev/null +++ b/app/Http/Requests/Bo/Shops/UpdateShopRequest.php @@ -0,0 +1,25 @@ +string('name')->value(), + address: $this->string('address')->value(), + postcode: $this->string('postcode')->value(), + city: $this->string('city')->value(), + phone: $this->toPhoneNumber(), + coordinates: $this->toCoordinates(), + default: $this->boolean('default'), + ); + } +} diff --git a/app/Http/Requests/Bo/Slides/StoreSlideRequest.php b/app/Http/Requests/Bo/Slides/StoreSlideRequest.php new file mode 100644 index 00000000..77186fb2 --- /dev/null +++ b/app/Http/Requests/Bo/Slides/StoreSlideRequest.php @@ -0,0 +1,155 @@ +authService->check(); + } + + public function resolvePicture(): UploadedFile | string | null + { + $file = $this->file('picture'); + if ($file instanceof UploadedFile) { + return $file; + } + + return $this->has('picture') && is_string($this->input('picture')) + ? $this->input('picture') + : null; + } + + public function toDatePeriod(): DatePeriod + { + return new DatePeriod( + start: $this->filled('date_start') ? new \DateTimeImmutable($this->string('date_start')->value()) : null, + end: $this->filled('date_end') ? new \DateTimeImmutable($this->string('date_end')->value()) : null, + ); + } + + public function toCreateSlideInput(): CreateSlideInput + { + return new CreateSlideInput( + title: $this->string('title')->value(), + text: $this->filled('text') ? $this->string('text')->value() : null, + picture: $this->resolvePicture(), + pictureAlt: $this->filled('picture_alt') ? $this->string('picture_alt')->value() : null, + pictureTitle: $this->filled('picture_title') ? $this->string('picture_title')->value() : null, + link: $this->filled('link') ? $this->string('link')->value() : null, + linkLabel: $this->filled('link_label') ? $this->string('link_label')->value() : null, + linkNewTab: $this->boolean('link_new_tab'), + connected: $this->boolean('connected'), + period: $this->toDatePeriod(), + ); + } + + #[\Override] + protected function prepareForValidation(): void + { + $text = $this->input('text'); + if (is_string($text) && trim(html_entity_decode(strip_tags($text), ENT_QUOTES | ENT_HTML5, 'UTF-8')) === '') { + $text = null; + } + + $this->merge([ + 'text' => $text, + 'connected' => $this->boolean('connected'), + 'link_new_tab' => $this->boolean('link_new_tab'), + ]); + } + + /** @return array */ + public function rules(): array + { + $maxWidth = 1440; + $maxHeight = 960; + + return array_merge( + [ + 'title' => ['required', 'string', 'min:4', 'max:75'], + 'picture_alt' => ['required_with:picture', 'string', 'min:4', 'max:75'], + 'picture_title' => ['required_with:picture', 'string', 'min:4', 'max:75'], + 'text' => ['nullable', 'required_without:picture', 'string', 'min:4'], + 'link' => ['nullable', 'url:https', 'max:255'], + 'link_label' => ['nullable', 'string', 'min:5', 'max:255'], + 'link_new_tab' => ['present', 'boolean:strict'], + 'connected' => ['present', 'boolean:strict'], + 'date_start' => ['nullable', 'date_format:Y-m-d\TH:i'], + 'date_end' => ['nullable', 'date_format:Y-m-d\TH:i', 'after:date_start'], + 'client_timezone' => ['required', 'timezone'], + ], + $this->pictureRules( + 'picture', + $maxWidth, + $maxHeight, + $maxWidth, + $maxHeight, + true + ) + ); + } + + #[\Override] + protected function passedValidation() + { + if ($this->filled('date_start')) { + $inputValue = Date::createFromFormat( + 'Y-m-d\TH:i', + $this->string('date_start')->value(), + $this->string('client_timezone')->value() + )?->setTimezone('UTC'); + + $this->merge([ + 'date_start' => $inputValue?->format('Y-m-d H:i:s'), + ]); + } + if ($this->filled('date_end')) { + $inputValue = Date::createFromFormat( + 'Y-m-d\TH:i', + $this->string('date_end')->value(), + $this->string('client_timezone')->value() + )?->setTimezone('UTC'); + + $this->merge([ + 'date_end' => $inputValue?->format('Y-m-d H:i:s'), + ]); + } + } + + #[\Override] + public function attributes(): array + { + return [ + 'title' => trans('validation.attributes.title'), + 'text' => trans('validation.attributes.text'), + 'date_start' => trans('validation.custom.attributes.date_start_show'), + 'date_end' => trans('validation.custom.attributes.date_end_show'), + 'connected' => trans('validation.custom.attributes.connected'), + 'link' => trans('validation.custom.attributes.link'), + 'link_label' => trans('validation.custom.attributes.link_label'), + 'link_new_tab' => trans('validation.custom.attributes.link_new_tab'), + 'picture' => trans('validation.attributes.image'), + 'picture_alt' => trans('validation.custom.attributes.picture_alt'), + 'picture_title' => trans('validation.custom.attributes.picture_title'), + ]; + } +} diff --git a/app/Http/Requests/Bo/Slides/UpdateSlideRequest.php b/app/Http/Requests/Bo/Slides/UpdateSlideRequest.php new file mode 100644 index 00000000..bfd7247e --- /dev/null +++ b/app/Http/Requests/Bo/Slides/UpdateSlideRequest.php @@ -0,0 +1,42 @@ +string('title')->value(), + text: $this->filled('text') ? $this->string('text')->value() : null, + picture: $this->resolvePicture(), + pictureAlt: $this->filled('picture_alt') ? $this->string('picture_alt')->value() : null, + pictureTitle: $this->filled('picture_title') ? $this->string('picture_title')->value() : null, + link: $this->filled('link') ? $this->string('link')->value() : null, + linkLabel: $this->filled('link_label') ? $this->string('link_label')->value() : null, + linkNewTab: $this->boolean('link_new_tab'), + connected: $this->boolean('connected'), + period: $this->toDatePeriod(), + ); + } + + #[\Override] + public function rules(): array + { + $rules = parent::rules(); + + /** @var \App\Models\Slide|null $slide */ + $slide = $this->route('slide'); + if ($slide && ! empty($slide->picture)) { + $rules['text'] = ['nullable', 'string', 'min:4']; + } + + return $rules; + } +} diff --git a/app/Http/Requests/Bo/Tags/StoreTagRequest.php b/app/Http/Requests/Bo/Tags/StoreTagRequest.php new file mode 100644 index 00000000..5abff206 --- /dev/null +++ b/app/Http/Requests/Bo/Tags/StoreTagRequest.php @@ -0,0 +1,56 @@ +authService->check(); + } + + #[\Override] + protected function prepareForValidation(): void + { + $this->merge([ + 'status' => $this->boolean('status'), + ]); + } + + /** @return array */ + public function rules(): array + { + return [ + 'label' => ['required', 'string', 'min:2', 'max:45'], + 'status' => ['present', 'boolean:strict'], + ]; + } + + #[\Override] + public function attributes(): array + { + return [ + 'label' => trans('validation.custom.attributes.label'), + 'status' => trans('validation.custom.attributes.status'), + ]; + } + + public function toCreateTagInput(): CreateTagInput + { + return new CreateTagInput( + label: $this->string('label')->value(), + status: $this->boolean('status'), + ); + } +} diff --git a/app/Http/Requests/Bo/Tags/UpdateTagRequest.php b/app/Http/Requests/Bo/Tags/UpdateTagRequest.php new file mode 100644 index 00000000..5b06b028 --- /dev/null +++ b/app/Http/Requests/Bo/Tags/UpdateTagRequest.php @@ -0,0 +1,20 @@ +string('label')->value(), + status: $this->boolean('status'), + ); + } +} diff --git a/app/Http/Requests/Bo/UpdateChangeOrderRequest.php b/app/Http/Requests/Bo/UpdateChangeOrderRequest.php deleted file mode 100644 index b88283e4..00000000 --- a/app/Http/Requests/Bo/UpdateChangeOrderRequest.php +++ /dev/null @@ -1,42 +0,0 @@ -check(); - } - - /** - * Prepare the data for validation. - * - * @return void - */ - protected function prepareForValidation(): void - { - $this->merge([ - 'direction' => $this->direction === 'up' ? true : false - ]); - } - - /** - * Get the validation rules that apply to the request. - * - * @return array - */ - public function rules(): array - { - return [ - 'direction' => 'required|boolean', - ]; - } -} diff --git a/app/Http/Requests/Bo/UpdateProductOrderRequest.php b/app/Http/Requests/Bo/UpdateProductOrderRequest.php deleted file mode 100644 index 98613707..00000000 --- a/app/Http/Requests/Bo/UpdateProductOrderRequest.php +++ /dev/null @@ -1,58 +0,0 @@ -check(); - } - - public function getOrder(): int - { - return (int) $this->input('order'); - } - - /** - * Prepare the data for validation. - * - * @return void - */ - protected function prepareForValidation(): void - { - $this->merge([ - 'order' => $this->input('order') - ]); - } - - /** - * Get the validation rules that apply to the request. - * - * @return array - */ - public function rules(): array - { - return [ - 'order' => [ - 'required', - 'integer', - 'min:1', - function ($attribute, $value, $fail) { - if ($this->product && intval($value) === $this->product->order) { - $fail("La valeur de {$attribute} doit être différente de la valeur actuelle."); - } - }, - ], - ]; - } -} diff --git a/app/Http/Requests/ContactFormRequest.php b/app/Http/Requests/ContactFormRequest.php deleted file mode 100644 index 9e99e133..00000000 --- a/app/Http/Requests/ContactFormRequest.php +++ /dev/null @@ -1,51 +0,0 @@ - 'required|min:2', - 'first_name' => 'required|min:2', - 'email' => 'required|email:rfc,dns,spoof', - 'subject' => 'required|min:2', - 'order_ref' => 'sometimes', - 'message' => 'required|min:20|max:1900', - 'file' => 'nullable|mimes:jpg,jpeg,png,pdf|max:5120', - 'ok_cgv' => 'accepted', - ]; - } - - /** - * Get the error messages for the defined validation rules. - * - * @return array - */ - public function messages() - { - return [ - 'ok_cgv.accepted' => __('You must accept the terms and conditions and the privacy policy'), - 'file.max' => __('La taille du fichier ne peut pas dépasser :max kilo-octets.'), - 'file.mimes' => __('Le fichier doit être de type : :values.'), - ]; - } -} diff --git a/app/Http/Requests/CustomerRegisterRequest.php b/app/Http/Requests/CustomerRegisterRequest.php deleted file mode 100644 index 73432ea9..00000000 --- a/app/Http/Requests/CustomerRegisterRequest.php +++ /dev/null @@ -1,79 +0,0 @@ -where('matricule', data_get($this->all(), 'matricule')) - ]; - } elseif (config('bosettings.register_salaries') && !config('bosettings.register_public')) { - // * si register autorisé pour salarié seulement - $matriculeRule = 'required|exists:salaries,matricule'; - $codeRule = [ - 'required', - Rule::exists('salaries', 'code') - ->where('matricule', data_get($this->all(), 'matricule')) - ]; - } else { - // * rien de précisé ou public seulement alors - $matriculeRule = 'sometimes'; - $codeRule = 'sometimes'; - } - - return [ - 'matricule' => $matriculeRule, - 'code' => $codeRule, - 'lastname' => 'required|string|max:255', - 'firstname' => 'required|string|max:255', - 'phone' => 'sometimes|max:255', - 'address' => 'sometimes|max:255', - 'postal_code' => 'required', - 'town' => 'required|string|max:255', - 'email' => 'required|unique:customers,email|email:rfc,dns,spoof|max:255', - 'password' => [ - 'required', 'required_with:password_confirmation', 'confirmed', 'max:255', - Password::min(8) - ->mixedCase() - ->letters() - ->numbers() - ->symbols() - ->uncompromised() - ], - 'ok_cgv' => 'accepted', - 'optin' => 'sometimes', - 'birth_date' => ['required',new Adult()], - ]; - } -} diff --git a/app/Http/Requests/CustomerUpdatePassword.php b/app/Http/Requests/CustomerUpdatePassword.php deleted file mode 100644 index ef28c7f0..00000000 --- a/app/Http/Requests/CustomerUpdatePassword.php +++ /dev/null @@ -1,40 +0,0 @@ -check(); - } - - /** - * Get the validation rules that apply to the request. - * - * @return array - */ - public function rules() - { - return [ - 'password_old' => 'required', - 'password' => [ - 'required', 'required_with:password_confirmation', 'confirmed', 'max:255', - Password::min(8) - ->mixedCase() - ->letters() - ->numbers() - ->symbols() - ->uncompromised() - ], - ]; - } -} diff --git a/app/Http/Requests/Fo/Ajax/FilterProductsRequest.php b/app/Http/Requests/Fo/Ajax/FilterProductsRequest.php new file mode 100644 index 00000000..d06897bd --- /dev/null +++ b/app/Http/Requests/Fo/Ajax/FilterProductsRequest.php @@ -0,0 +1,75 @@ +integer('page', 1)), + new PageSize($this->integer('perPage', 6)), + ), + search: $this->filled('search') ? $this->string('search')->value() : '', + ranges: array_map('intval', $this->array('ranges')), + tags: array_map('intval', $this->array('tags')), + brands: array_map('strval', $this->array('brands')), + isDiscounted: $this->boolean('isDiscounted'), + ); + } + + #[\Override] + protected function prepareForValidation(): void + { + $this->merge([ + 'ranges' => $this->array('ranges'), + 'tags' => $this->array('tags'), + 'brands' => $this->array('brands'), + 'isDiscounted' => $this->boolean('isDiscounted'), + 'page' => $this->integer('page', 1), + 'perPage' => $this->integer('perPage', 6), + ]); + } + + /** + * @return array + */ + public function rules(): array + { + return [ + 'search' => ['nullable', 'string', 'min:1'], + 'ranges' => ['present', 'array'], + 'ranges.*' => ['exists:ranges,id'], + 'tags' => ['present', 'array'], + 'tags.*' => ['exists:tags,id'], + 'brands' => ['present', 'array'], + 'brands.*' => [new Enum((ProductBrand::class))], + 'page' => ['required', 'min:1'], + 'perPage' => ['required', 'min:1', 'max:50'], + ]; + } + + #[\Override] + public function attributes(): array + { + return [ + 'search' => trans('Search'), + 'tags' => trans_choice('models.classes.tags', \INF), + 'ranges' => trans_choice('models.classes.ranges', \INF), + 'brands' => trans_choice('models.classes.brands', \INF), + 'page' => trans('validation.custom.attributes.page'), + 'perPage' => trans('validation.custom.attributes.per_page'), + ]; + } +} diff --git a/app/Http/Requests/Fo/Auth/RegisterRequest.php b/app/Http/Requests/Fo/Auth/RegisterRequest.php new file mode 100644 index 00000000..f0c35ce6 --- /dev/null +++ b/app/Http/Requests/Fo/Auth/RegisterRequest.php @@ -0,0 +1,119 @@ +authService->guest(); + } + + #[\Override] + public function prepareForValidation() + { + $this->merge([ + 'optin' => $this->boolean('optin'), + ]); + } + + public function toRegisterCustomerInput(): RegisterCustomerInput + { + $birthDate = \DateTimeImmutable::createFromFormat( + 'Y-m-d', + $this->string('birth_date')->value() + ) ?: throw new \InvalidArgumentException('Invalid birth date format'); + + $phone = $this->filled('phone') + ? new PhoneNumber($this->string('phone')->value()) + : null; + + return new RegisterCustomerInput( + matricule: new Matricule($this->string('matricule')->value()), + code: new Code($this->string('code')->value()), + firstname: $this->string('firstname')->value(), + lastname: $this->string('lastname')->value(), + email: new Email($this->string('email')->value()), + password: $this->string('password')->value(), + birthDate: $birthDate, + phone: $phone, + address: $this->filled('address') ? $this->string('address')->value() : null, + postcode: $this->string('postal_code')->value(), + city: $this->string('city')->value(), + optIn: $this->boolean('optin'), + ); + } + + /** @return array */ + public function rules(): array + { + return [ + 'matricule' => ['required', 'exists:employees,matricule'], + 'code' => [ + 'required', + Rule::exists('employees', 'code') + ->where('matricule', $this->string('matricule')->value()), + ], + 'lastname' => ['required', 'string', 'max:255'], + 'firstname' => ['required', 'string', 'max:255'], + 'phone' => ['sometimes', 'phone:FR', 'max:255'], + 'address' => ['sometimes', 'max:255'], + 'postal_code' => ['required', 'postal_code:FR'], + 'city' => ['required', 'string', 'max:255'], + 'email' => ['required', 'unique:customers,email', 'email:rfc,dns,spoof', 'max:255'], + 'password' => [ + 'required', + 'required_with:password_confirmation', + 'confirmed', + 'max:255', + Password::min(8) + ->mixedCase() + ->letters() + ->numbers() + ->symbols() + ->uncompromised(), + ], + 'ok_cgv' => ['accepted'], + 'optin' => ['sometimes', 'boolean'], + 'birth_date' => ['required', new Adult()], + ]; + } + + /** @return array */ + #[\Override] + public function attributes(): array + { + return [ + 'firstname' => trans('validation.attributes.first_name'), + 'lastname' => trans('validation.attributes.last_name'), + 'birth_date' => trans('validation.attributes.date_of_birth'), + 'address' => trans('validation.custom.attributes.postal_address'), + 'phone' => trans('validation.attributes.phone'), + 'city' => trans('validation.attributes.city'), + 'postcode' => trans('validation.attributes.postal_code'), + 'password' => trans('validation.attributes.password'), + 'matricule' => trans('validation.attributes.matricule'), + 'code' => trans('validation.attributes.code'), + 'ok_cgv' => trans('validation.custom.attributes.ok_cgv'), + 'optin' => trans('validation.custom.attributes.optin'), + ]; + } +} diff --git a/app/Http/Requests/Fo/ContactFormRequest.php b/app/Http/Requests/Fo/ContactFormRequest.php new file mode 100644 index 00000000..d7fcb469 --- /dev/null +++ b/app/Http/Requests/Fo/ContactFormRequest.php @@ -0,0 +1,91 @@ + */ + public function rules(): array + { + return [ + 'last_name' => ['required', 'string', 'min:2'], + 'first_name' => ['required', 'string', 'min:2'], + 'email' => [ + 'required', + Rule::email() + ->rfcCompliant() + ->preventSpoofing() + ->validateMxRecord(), + ], + 'subject' => ['required', 'string', 'min:2'], + 'order_ref' => ['nullable', 'string', 'regex:/^[0-9]+$/'], + 'message' => ['required', 'string', 'min:20', 'max:1900'], + 'file' => [ + 'nullable', + Rule::file() + ->max(5120) + ->types(['jpg', 'jpeg', 'png', 'pdf']), + ], + 'ok_cgv' => ['accepted'], + ]; + } + + /** @return array */ + #[\Override] + public function messages(): array + { + return [ + 'ok_cgv.accepted' => trans('validation.custom.ok_cgv.accepted'), + 'file.max' => trans('validation.custom.file.max'), + 'file.mimes' => trans('validation.custom.file.mimes'), + ]; + } + + public function toValueObject(): ContactFormData + { + $attachedFile = null; + + if ($this->hasFile('file') && $this->file('file')->isValid()) { + $uploadedFile = $this->file('file'); + $storedPath = $uploadedFile->store('contact-attachments', 'private'); + + if ($storedPath !== false) { + $fullPath = Storage::disk('private')->path($storedPath); + + $attachedFile = new AttachedFile( + path: $fullPath, + originalName: $uploadedFile->getClientOriginalName(), + mimeType: $uploadedFile->getMimeType() ?? 'application/octet-stream', + ); + } + } + + return new ContactFormData( + lastName: $this->string('last_name')->value(), + firstName: $this->string('first_name')->value(), + email: $this->string('email')->value(), + subject: $this->string('subject')->value(), + message: $this->string('message')->value(), + orderRef: empty($this->input('order_ref')) ? + null : $this->string('order_ref')->value(), + file: $attachedFile, + ); + } + + /** @return array */ + #[\Override] + public function attributes(): array + { + return [ + 'subject' => trans('validation.custom.attributes.object'), + ]; + } +} diff --git a/app/Http/Requests/Fo/Customer/UpdateInfosRequest.php b/app/Http/Requests/Fo/Customer/UpdateInfosRequest.php new file mode 100644 index 00000000..0281488e --- /dev/null +++ b/app/Http/Requests/Fo/Customer/UpdateInfosRequest.php @@ -0,0 +1,95 @@ +authService->check(); + } + + #[\Override] + protected function prepareForValidation() + { + $this->merge([ + 'opt_in' => $this->boolean('opt_in'), + ]); + } + + public function toUpdateCustomerInput(): UpdateCustomerInput + { + return new UpdateCustomerInput( + firstname: $this->string('firstname')->value(), + lastname: $this->string('lastname')->value(), + birthDate: $this->string('birth_date')->value(), + phone: ! $this->string('phone')->isEmpty() ? + $this->string('phone')->value() : null, + city: $this->string('city')->value(), + postcode: $this->string('postcode')->value(), + address: ! $this->string('address')->isEmpty() ? + $this->string('address')->value() : null, + optIn: $this->boolean('opt_in'), + ); + } + + /** @return array */ + public function rules(): array + { + $majorityDate = Date::now()->subYears(18)->format('Y-m-d'); + + return [ + 'firstname' => ['required', 'string', 'max:255'], + 'lastname' => ['required', 'string', 'max:255'], + 'birth_date' => [ + 'required', + 'date', + 'date_format:Y-m-d', + 'before_or_equal:' . $majorityDate, + ], + 'address' => ['nullable', 'string', 'max:255'], + 'phone' => ['nullable', 'phone:FR'], + 'city' => ['required', 'string', 'max:255'], + 'postcode' => ['required', 'postal_code:FR'], + 'opt_in' => ['boolean'], + ]; + } + + /** @return array */ + #[\Override] + public function messages(): array + { + return [ + 'birth_date.before_or_equal' => trans('validation.custom.birth_date.before_or_equal'), + 'birth_date.date' => trans('validation.custom.birth_date.date'), + 'birth_date.date_format' => trans('validation.custom.birth_date.date_format'), + ]; + } + + /** @return array */ + #[\Override] + public function attributes(): array + { + return [ + 'firstname' => trans('validation.attributes.first_name'), + 'lastname' => trans('validation.attributes.last_name'), + 'birth_date' => trans('validation.attributes.date_of_birth'), + 'address' => trans('validation.custom.attributes.postal_address'), + 'phone' => trans('validation.attributes.phone'), + 'city' => trans('validation.attributes.city'), + 'postcode' => trans('validation.attributes.postal_code'), + ]; + } +} diff --git a/app/Http/Requests/Fo/Customer/UpdatePasswordRequest.php b/app/Http/Requests/Fo/Customer/UpdatePasswordRequest.php new file mode 100644 index 00000000..9ad06405 --- /dev/null +++ b/app/Http/Requests/Fo/Customer/UpdatePasswordRequest.php @@ -0,0 +1,51 @@ +authService->check(); + } + + public function toUpdateCustomerPasswordInput(): UpdateCustomerPasswordInput + { + return new UpdateCustomerPasswordInput( + $this->string('password_old')->value(), + $this->string('password')->value() + ); + } + + /** @return array */ + public function rules(): array + { + return [ + 'password_old' => ['required'], + 'password' => [ + 'required', + 'required_with:password_confirmation', + 'confirmed', + 'max:255', + Password::min(8) + ->mixedCase() + ->letters() + ->numbers() + ->symbols() + ->uncompromised(), + ], + ]; + } +} diff --git a/app/Http/Requests/Fo/Orders/ConfirmOrderRequest.php b/app/Http/Requests/Fo/Orders/ConfirmOrderRequest.php new file mode 100644 index 00000000..9399e55c --- /dev/null +++ b/app/Http/Requests/Fo/Orders/ConfirmOrderRequest.php @@ -0,0 +1,41 @@ +authService->check(); + } + + public function toFinalizeOrderInput(): FinalizeOrderInput + { + $customer = $this->authService->getCustomerAsMandatory(); + + return new FinalizeOrderInput( + shopperId: $customer->getId(), + ); + } + + /** + * @return array + */ + public function rules(): array + { + return [ + 'ok_cgv' => ['accepted'], + ]; + } +} diff --git a/app/Http/Requests/Fo/Orders/PickTimeSlotRequest.php b/app/Http/Requests/Fo/Orders/PickTimeSlotRequest.php new file mode 100644 index 00000000..7799d40d --- /dev/null +++ b/app/Http/Requests/Fo/Orders/PickTimeSlotRequest.php @@ -0,0 +1,95 @@ +authService->getCustomerAsMandatory(); + + return new ApplyPickTimeSlotInput( + shopperId: $customer->getId(), + timeslot: $this->getTimeslot(), + ); + } + + public function authorize(): bool + { + return $this->authService->check(); + } + + #[\Override] + protected function prepareForValidation(): void + { + $this->merge([ + 'basketTotal' => $this->basketService + ->getBasket() + ->totalTaxIncluded() + ->getAmount(), + ]); + } + + public function getTimeslot(): CarbonInterface + { + return CarbonImmutable::createFromFormat( + 'Y-m-d', + $this->string('timeslot')->value() + )?->startOfDay() ?? throw new \InvalidArgumentException('Invalid timeslot format'); + } + + /** @return array */ + public function rules(): array + { + return [ + 'timeslot' => ['required', 'string', 'date_format:Y-m-d'], + 'basketTotal' => [ + function (string $_, mixed $__, \Closure $fail) { + try { + $customer = $this->authService->getCustomerAsMandatory(); + $shopper = $this->shopperRepository->getByIdOrFail($customer->getId()); + $atDate = $this->getTimeslot(); + $basket = $this->basketService->getBasket(); + + $this->orderTunnelService->assertBasketWeeklyAmountWithinLimitFor( + shopper: $shopper, + withBasket: $basket, + atDate: $atDate + ); + } catch (WeeklyLimitExceededException) { + $fail(trans('You will reach the maximum weekly order limit with this basket.')); + } + }, + ], + ]; + } + + /** @return array */ + #[\Override] + public function attributes(): array + { + return [ + 'timeslot' => trans('validation.custom.attributes.timeslot'), + ]; + } +} diff --git a/app/Http/Requests/Fo/Orders/ValidateSummaryRequest.php b/app/Http/Requests/Fo/Orders/ValidateSummaryRequest.php new file mode 100644 index 00000000..5adc0b3b --- /dev/null +++ b/app/Http/Requests/Fo/Orders/ValidateSummaryRequest.php @@ -0,0 +1,70 @@ +authService->getCustomerAsMandatory(); + $basket = $this->basketService->getBasket(); + + return new InitializeOrderTunnelInput( + basket: $basket, + shopperId: $customer->getId(), + ); + } + + public function authorize(): bool + { + return $this->authService->check(); + } + + #[\Override] + protected function prepareForValidation(): void + { + $this->merge([ + 'basketTotal' => $this->basketService + ->getBasket() + ->totalTaxIncluded() + ->getAmount(), + ]); + } + + /** + * Get the validation rules that apply to the request. + * + * @return array + */ + public function rules(): array + { + return [ + 'basketTotal' => [ + function (string $_, mixed $__, \Closure $fail) { + try { + $basket = $this->basketService->getBasket(); + $this->orderTunnelService->assertBasketAmountWithinLimit($basket); + } catch (OrderLimitExceededException) { + $fail(trans('You have reached the maximum order limit for this basket.')); + } + }, + ], + ]; + } +} diff --git a/app/Http/Requests/Fo/UnsubscribeNewsletterRequest.php b/app/Http/Requests/Fo/UnsubscribeNewsletterRequest.php new file mode 100644 index 00000000..c44703c6 --- /dev/null +++ b/app/Http/Requests/Fo/UnsubscribeNewsletterRequest.php @@ -0,0 +1,33 @@ + */ + public function rules(): array + { + return [ + 'hashcode' => ['required', 'uuid'], + ]; + } + + public function getHashcode(): ?CrmHashcode + { + $hashcode = null; + + $this->string('hashcode')->whenIsUuid( + function (string $value) use (&$hashcode) { + $hashcode = new CrmHashcode(Uuid::fromString($value)); + } + ); + + return $hashcode; + } +} diff --git a/app/Http/Requests/LoginRequest.php b/app/Http/Requests/LoginRequest.php deleted file mode 100644 index 0526dbb8..00000000 --- a/app/Http/Requests/LoginRequest.php +++ /dev/null @@ -1,35 +0,0 @@ -merge([ - 'remember' => $this->remember ? true : false - ]); - return true; - } - - /** - * Get the validation rules that apply to the request. - * - * @return array - */ - public function rules() - { - return [ - 'email' => 'required|email:rfc,filter', - 'password' => 'required', - 'remember' => 'required|boolean' - ]; - } -} diff --git a/app/Http/Requests/ProductsFilterRequest.php b/app/Http/Requests/ProductsFilterRequest.php deleted file mode 100644 index b1b9e415..00000000 --- a/app/Http/Requests/ProductsFilterRequest.php +++ /dev/null @@ -1,57 +0,0 @@ -merge([ - 'promotion' => $this->promotion ? true : false, - 'ranges' => $this->ranges ?? [], - 'tags' => $this->tags ?? [], - 'brands' => $this->brands ?? [], - ]); - } - - /** - * Get the validation rules that apply to the request. - * - * @return array - */ - public function rules() - { - return [ - 'promotion' => 'required|boolean', - 'ranges' => 'present|array', - 'ranges.*' => 'numeric|min:1|exists:ranges,id', - 'tags' => 'present|array', - 'tags.*' => 'numeric|min:1|exists:tags,id', - 'brands' => 'present|array', - 'brands.*' => [ - 'string', - 'min:1', - new EnumIsValidRule(ProductBrand::class) - ] - ]; - } -} diff --git a/app/Http/Requests/SortOrders.php b/app/Http/Requests/SortOrders.php deleted file mode 100644 index 2f241864..00000000 --- a/app/Http/Requests/SortOrders.php +++ /dev/null @@ -1,57 +0,0 @@ - 'sometimes|in:asc,desc', - ]; - if ($this->routeIs('bo.orders')) { - $rules = array_merge($rules, [ - 'date-order-start' => - 'required_with:date-order-end|nullable|date_format:Y-m-d|before:date-order-end', - 'date-order-end' => 'nullable|date_format:Y-m-d|after:date-order-start', - - 'date-retrait-start' => - 'required_with:date-retrait-end|nullable|date_format:Y-m-d|before:date-retrait-end', - 'date-retrait-end' => 'nullable|date_format:Y-m-d|after:date-retrait-end', - ]); - } - return $rules; - } - - /** - * Get custom attributes for validator errors. - * - * @return array - */ - public function attributes(): array - { - return [ - 'date-order-start' => trans('Date de commande'), - 'date-order-end' => trans('Jusqu\'au'), - 'date-retrait-start' => trans('Date de retrait'), - 'date-retrait-end' => trans('Jusqu\'au'), - ]; - } -} diff --git a/app/Http/Requests/UpdateInfosRequest.php b/app/Http/Requests/UpdateInfosRequest.php deleted file mode 100644 index d44979fb..00000000 --- a/app/Http/Requests/UpdateInfosRequest.php +++ /dev/null @@ -1,58 +0,0 @@ -check(); - } - - /** - * Get the validation rules that apply to the request. - * - * @return array - */ - public function rules() - { - return [ - 'firstname' => 'required|string|max:255', - 'lastname' => 'required|string|max:255', - 'day' => 'required|numeric|gt:0|lt:32', - 'month' => 'required|numeric|gt:0|lt:13', - 'year' => [ - 'required', - 'numeric', - 'gt:' . (date('Y') - 101), 'lt:' . (date('Y') + 1), - // @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed - function ($attr, $value, $fail) { - $MJ = Carbon::now()->subYears(18); - $dateTest = Carbon::createFromDate($this->year, $this->month, $this->day); - if ( - $dateTest->format('dmY') !== $this->day . $this->month . $this->year || - $dateTest->getTimestamp() > time() - ) { - $fail(__('Veuillez entrer une date de naissance valide')); - } - if (!$dateTest->lessThanOrEqualTo($MJ)) { - $fail(__("Vous devez être majeur pour vous inscrire.")); - } - } - ], - 'address' => 'max:255', - 'phone' => 'max:255', - 'city' => 'required|string|max:255', - 'postcode' => 'required' - ]; - } -} diff --git a/app/Http/Resources/CustomerCrmResource.php b/app/Http/Resources/CustomerCrmResource.php deleted file mode 100644 index b794f479..00000000 --- a/app/Http/Resources/CustomerCrmResource.php +++ /dev/null @@ -1,46 +0,0 @@ -customer = $customer; - } - /** - * Transform the resource into an array. - * - * @param mixed $request - * @return array - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass - */ - public function toArray($request) - { - /** @var \LDC\LDCCRM\Models\Customer */ - $crmCustomer = (object)$this->customer->apiData; - return [ - 'hashcode' => $this->customer->hashcode, - 'firstname' => $crmCustomer->firstname, - 'lastname' => $crmCustomer->lastname, - 'opt_in' => $crmCustomer->opt_in, - 'birthdate' => $crmCustomer->birth_date, - 'phone' => $crmCustomer->phone, - 'address' => $crmCustomer->address, - 'address2' => $crmCustomer->address2, - 'city' => $crmCustomer->city, - 'postcode' => $crmCustomer->postcode - ]; - } -} diff --git a/app/Http/Resources/Fo/Ajax/BasketProductResource.php b/app/Http/Resources/Fo/Ajax/BasketProductResource.php new file mode 100644 index 00000000..21ae3f89 --- /dev/null +++ b/app/Http/Resources/Fo/Ajax/BasketProductResource.php @@ -0,0 +1,55 @@ + */ + #[\Override] + public function toArray(Request $request): array + { + return [ + 'id' => $this->basketProduct->id->value, + 'name' => $this->basketProduct->name, + 'qty' => $this->basketProduct->qty, + + 'unitPriceHt' => Gate::allows('viewPrices', $this->basketProduct) ? + MoneyHelper::serialized($this->basketProduct->unitPriceHt()) : null, + 'discountTotal' => Gate::allows('viewPrices', $this->basketProduct) ? + MoneyHelper::serialized($this->basketProduct->discountTotal()) : null, + 'taxTotal' => Gate::allows('viewPrices', $this->basketProduct) ? + MoneyHelper::serialized($this->basketProduct->taxTotal()) : null, + 'subtotalHt' => Gate::allows('viewPrices', $this->basketProduct) ? + MoneyHelper::serialized($this->basketProduct->subtotalHt()) : null, + 'totalTtc' => Gate::allows('viewPrices', $this->basketProduct) ? + MoneyHelper::serialized($this->basketProduct->totalTtc()) : null, + + 'discountedPriceTtc' => Gate::allows('viewPrices', $this->basketProduct) ? + MoneyHelper::serialized($this->basketProduct->unitTtc()) : null, + 'priceKgTtc' => Gate::allows('viewPrices', $this->basketProduct) ? + MoneyHelper::serialized($this->basketProduct->priceKgTtc) : null, + + 'slug' => $this->basketProduct->slug, + 'picture' => $this->basketProduct->picture ? + url($this->basketProduct->picture) : null, + 'description' => $this->basketProduct->description, + 'weight_variable' => $this->basketProduct->weightVariable, + 'discountRate' => $this->basketProduct->discountRate->ratio(), + + 'taxRate' => $this->basketProduct->taxRate->percent(), + 'weightGrams' => $this->basketProduct->weightGrams, + ]; + } +} diff --git a/app/Http/Resources/Fo/Ajax/BasketResource.php b/app/Http/Resources/Fo/Ajax/BasketResource.php new file mode 100644 index 00000000..b40d0921 --- /dev/null +++ b/app/Http/Resources/Fo/Ajax/BasketResource.php @@ -0,0 +1,38 @@ + */ + #[\Override] + public function toArray(Request $request): array + { + return [ + 'items' => BasketProductResource::collection(array_values($this->basket->items())), + + 'totalTTC' => Gate::allows('viewTotal', $this->basket) ? + MoneyHelper::serialized($this->basket->totalTaxIncluded()) : null, + 'totalTVA' => Gate::allows('viewTotal', $this->basket) ? + MoneyHelper::serialized($this->basket->totalVat()) : null, + 'totalHT' => Gate::allows('viewTotal', $this->basket) ? + MoneyHelper::serialized($this->basket->totalRaw()) : null, + 'totaldiscount' => Gate::allows('viewTotal', $this->basket) ? + MoneyHelper::serialized($this->basket->totalDiscount()) : null, + 'totalweight' => $this->basket->totalWeight(), + 'countItems' => $this->basket->countItems(), + ]; + } +} diff --git a/app/Http/Resources/Fo/Ajax/FilteredProductResource.php b/app/Http/Resources/Fo/Ajax/FilteredProductResource.php new file mode 100644 index 00000000..e46f5207 --- /dev/null +++ b/app/Http/Resources/Fo/Ajax/FilteredProductResource.php @@ -0,0 +1,53 @@ + */ + #[\Override] + public function toArray(Request $request): array + { + $productRepository = resolve(EloquentProductRepository::class); + + $domainProduct = $productRepository->toEntity($this->product); + $productPricing = $domainProduct->pricing(); + $discount = $productPricing->hasDiscount ? $productPricing->discountedPriceTtc() : null; + + return [ + 'id' => $this->product->id, + 'slug' => $this->product->slug, + 'name' => $this->product->name, + 'picture' => url($this->product->picture), + 'picture_alt' => $this->product->picture_alt, + 'picture_title' => $this->product->picture_title, + 'weight_variable' => $this->product->weight_variable, + 'sell_unit' => $this->product->sell_unit, + 'sell_unit_label' => $this->product->sell_unit->label(), + 'shortDescription' => $this->product->short_description, + 'priceTtc' => Gate::allows('viewPrices', $this->product) ? + MoneyHelper::serialized($productPricing->basePriceTtc()) : null, + 'priceKgTtc' => Gate::allows('viewPrices', $this->product) ? + MoneyHelper::serialized($productPricing->priceKgTtc()) : null, + 'discountedPriceTtc' => Gate::allows('viewPrices', $this->product) ? + MoneyHelper::serialized($discount) : null, + 'is_available' => $domainProduct->isOrderable(), + 'can_add_to_basket' => Gate::allows('addToBasket', $this->product), + 'showStrippedPrice' => (bool) $this->product->validDiscount?->is_old_price_displayed, + 'nutriscore' => $this->product->inco?->nutriscore?->value(), + ]; + } +} diff --git a/app/Http/Resources/Fo/Ajax/TimeSlotResource.php b/app/Http/Resources/Fo/Ajax/TimeSlotResource.php new file mode 100644 index 00000000..ed1d316d --- /dev/null +++ b/app/Http/Resources/Fo/Ajax/TimeSlotResource.php @@ -0,0 +1,28 @@ + */ + #[\Override] + public function toArray(Request $request): array + { + return [ + 'start_at' => $this->timeSlot->getAt()->format(\DateTimeInterface::RFC3339), + 'end_at' => $this->timeSlot->getEndsAt()->format(\DateTimeInterface::RFC3339), + 'duration' => CarbonInterval::instance($this->timeSlot->getFor())->spec(), + ]; + } +} diff --git a/app/Http/Resources/ProductResource.php b/app/Http/Resources/ProductResource.php deleted file mode 100644 index 0b73f45d..00000000 --- a/app/Http/Resources/ProductResource.php +++ /dev/null @@ -1,67 +0,0 @@ - 0, - 'slug' => '', - 'name' => '', - 'description' => '', - 'picture' => '', - 'orderable_start' => '', - 'orderable_end' => '', - 'weight_variable' => false, - 'sell_unit' => '', - 'is_available' => false - ]; - - /** - * ProductResource - * - * @param \App\Models\Product $product - */ - public function __construct(Product $product) - { - $this->product = $product; - } - - /** - * Transform the resource into an array. - * - * @param \Illuminate\Http\Request|null $request - * @return array - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass - */ - public function toArray($request = null) - { - // @phpcs:enable - $data = array_merge( - \array_intersect_key( - $this->product->toArray(), - self::$skeleton - ), - ['priceTtc' => $this->product->priceTtc], - ['priceKgTtc' => $this->product->priceKgTtc], - ['discountedPriceTtc' => $this->product->discountedPriceTtc], - ['promotion' => (isset($this->product->promotions[0])) ? $this->product->promotions : null], - [ - 'nutriscore' => (isset($this->product->foodProduct->nutriscore)) ? - $this->product->foodProduct->nutriscore : - null - ] - ); - - $data['description'] = clean($data['description']); - - return $data; - } -} diff --git a/app/Imports/SalariesImport.php b/app/Imports/SalariesImport.php deleted file mode 100644 index 2378e281..00000000 --- a/app/Imports/SalariesImport.php +++ /dev/null @@ -1,83 +0,0 @@ - ";", - 'input_encoding' => 'ISO-8859-1' - ]; - } - - /** - * @param array $row - * - * @return \Illuminate\Database\Eloquent\Model|null - */ - public function model(array $row) - { - /** @var string|null */ - $end_date = Arr::get($row, 'date_fin', Arr::get($row, 'date_fin_prevue')); - - if (is_string($end_date)) { - $end_date = Carbon::createFromFormat('d/m/Y', $end_date); - } - - $matricule = Salarie::getFormattedMatricule(Arr::get($row, 'matricule')); - - $salarie = Salarie::firstOrNew( - ['matricule' => $matricule] - ); - $salarie->matricule = $matricule; - $salarie->nom = Arr::get($row, 'nom'); - $salarie->prenom = Arr::get($row, 'prenom'); - $salarie->start_date = Carbon::createFromFormat('d/m/Y', Arr::get($row, 'date_debut')); - $salarie->end_date = $end_date; - $salarie->etablissement = Arr::get($row, 'etablissement'); - $salarie->site = Arr::get($row, 'site'); - $salarie->service = Arr::get($row, 'service'); - $salarie->code = $salarie->code ?? Salarie::generateRandomString(8, Salarie::query()); - $salarie->setMagasin(); - $salarie->saveOrFail(); - $this->salariesImport = array_merge($this->salariesImport, [$matricule]); - return $salarie; - } - - /** - * Validation - * - * @return array - */ - public function rules(): array - { - return [ - 'matricule' => 'required|numeric', - 'nom' => 'required|string|max:255', - 'prenom' => 'required|string|max:255', - 'etablissement' => 'required|string|max:255', - 'site' => 'required|string|max:255', - 'service' => 'required|string|max:255', - 'date_fin' => 'sometimes|nullable|date_format:d/m/Y', - 'date_fin_prevue' => 'sometimes|nullable|date_format:d/m/Y' - ]; - } -} diff --git a/app/Interfaces/CsvImportError.php b/app/Interfaces/CsvImportError.php new file mode 100644 index 00000000..173c11a7 --- /dev/null +++ b/app/Interfaces/CsvImportError.php @@ -0,0 +1,11 @@ + */ + public function getModelClass(): string; +} diff --git a/app/Interfaces/ModelWithOrder.php b/app/Interfaces/ModelWithOrder.php new file mode 100644 index 00000000..1e839844 --- /dev/null +++ b/app/Interfaces/ModelWithOrder.php @@ -0,0 +1,12 @@ +where('created_at', '<=', now()->subDays(7)) + ->forceDelete(); + } +} diff --git a/app/Jobs/FetchAndUpsertArcadiaEmployees.php b/app/Jobs/FetchAndUpsertArcadiaEmployees.php new file mode 100644 index 00000000..d1e4b77d --- /dev/null +++ b/app/Jobs/FetchAndUpsertArcadiaEmployees.php @@ -0,0 +1,35 @@ +execute($action, new ActionInputEmpty()); + } +} diff --git a/app/Jobs/FetchAndUpsertArcadiaProductIncos.php b/app/Jobs/FetchAndUpsertArcadiaProductIncos.php new file mode 100644 index 00000000..8a80b69f --- /dev/null +++ b/app/Jobs/FetchAndUpsertArcadiaProductIncos.php @@ -0,0 +1,35 @@ +execute($action, new ActionInputEmpty()); + } +} diff --git a/app/Jobs/GetPublicHolidayForNextYear.php b/app/Jobs/GetPublicHolidayForNextYear.php deleted file mode 100644 index f22ad725..00000000 --- a/app/Jobs/GetPublicHolidayForNextYear.php +++ /dev/null @@ -1,64 +0,0 @@ -year = is_numeric($year) ? (int)$year : null; - } - - /** - * Execute the job. - * - * @return void - */ - public function handle() - { - $targetYear = $this->year ?? now()->year + 1; - $url = "https://calendrier.api.gouv.fr/jours-feries/metropole/{$targetYear}.json"; - $response = Http::get($url); - if ($response->successful()) { - $publicHolidays = $response->json(); - $magasins = Magasin::with('collecteExceptions')->get(); - foreach ($magasins as $magasin) { - foreach ($publicHolidays as $date => $holidayName) { - $existingException = $magasin->collecteExceptions()->where('date', $date)->first(); - if (!$existingException) { - $magasin->collecteExceptions()->create([ - 'date' => $date, - 'comment' => $holidayName, - 'type' => ExceptionDayType::ferie() - ]); - } - } - } - } - } -} diff --git a/app/Jobs/SalariesExportJob.php b/app/Jobs/SalariesExportJob.php deleted file mode 100644 index 660e98ad..00000000 --- a/app/Jobs/SalariesExportJob.php +++ /dev/null @@ -1,59 +0,0 @@ -salariesImport = $salariesImport; - $this->user = $user; - } - - /** - * Create the export salaries file in the salarie disk. - * - * @return void - */ - public function handle() - { - $disk = Storage::disk('salaries'); - $csv_file = Carbon::now()->format('d_m_Y-H_i_s') . '-' . $this->user->id . '-export_salaries.csv'; - - Excel::store(new SalariesExport($this->salariesImport), $csv_file, 'salaries'); - - Mail::to($this->user->email)->send(new SendSalariesCSVMail($this->user, $csv_file)); - - if ($disk->exists($csv_file)) { - $disk->delete($csv_file); - } - } -} diff --git a/app/Jobs/SendMissingOrderReminderJob.php b/app/Jobs/SendMissingOrderReminderJob.php new file mode 100644 index 00000000..f7101316 --- /dev/null +++ b/app/Jobs/SendMissingOrderReminderJob.php @@ -0,0 +1,64 @@ +next($schedulingService->getPickupDay()->value); + $employees = $this->getEmployeesToNotify($pickupDay, $orderRepository, $employeeRepository); + + foreach ($employees as $employee) { + $employee->notify(new MissingOrderReminderNotification($pickupDay)); + } + } + + /** @return Collection */ + private function getEmployeesToNotify( + CarbonInterface $pickupDay, + OrderRepository $orderRepository, + EmployeeRepository $employeeRepository + ): Collection { + $orders = $orderRepository->getValidatedOrdersForPickupDay($pickupDay); + + /** @var array $excludedMatricules */ + $excludedMatricules = collect($orders) + ->map(fn ($order) => $order->employee->matricule) + ->uniqueValues() + ->all(); + + return collect($employeeRepository->getWithCustomerWhereMatriculeNotIn($excludedMatricules)) + ->filter(fn ($employee) => $this->canNotifyEmployee($employee)); + } + + private function canNotifyEmployee(Employee $employee): bool + { + $customer = $employee->customer; + + return $customer && Gate::check('customerPassOrders', $customer); + } +} diff --git a/app/Jobs/SendReminderMail.php b/app/Jobs/SendReminderMail.php index 9dc8c81e..db2e31e7 100644 --- a/app/Jobs/SendReminderMail.php +++ b/app/Jobs/SendReminderMail.php @@ -1,37 +1,96 @@ where('day', now()->format('Y-m-d')); - })->get(); + public function handle( + OrderRepository $orderRepository, + EmployeeRepository $employeeRepository + ) { + $orders = $orderRepository->getOrdersWithLinesAndShopForPickupDay(now()); + + $matricules = collect($orders) + ->map(fn ($order) => $order->employee->matricule) + ->filter() + ->uniqueValues(); + + /** @var array $matriculesArray */ + $matriculesArray = $matricules->values()->toArray(); + $employees = collect($employeeRepository->getWithCustomerWhereMatriculeIn($matriculesArray)); foreach ($orders as $order) { - Mail::to($order->customer->email)->queue(new OrderTodayReminderMail($order)); + $matricule = $order->employee->matricule->value; + + if (! $employees->has($matricule)) { + continue; + } + $employee = $employees->get($matricule); + + if (! $employee) { + continue; + } + + $this->notifyEmployee( + $employee, + $this->toDto($order, $employee) + ); } } + + private function notifyEmployee(Employee $employee, OrderReminderDto $dto): void + { + $employee->notify(new OrderTodayReminderNotification($dto)); + } + + private function toDto(Order $order, Employee $employee): OrderReminderDto + { + $linesDto = []; + foreach ($order->lines as $line) { + $linesDto[] = new OrderReminderLineDto( + name: $line->product->name ?? '', + quantity: $line->quantity, + priceKgTtc: $this->moneyFormatter->format($line->product->priceKgTtc), + totalTtc: $this->moneyFormatter->format($line->total_ttc), + ); + } + + return new OrderReminderDto( + firstname: $employee->prenom, + lastname: $employee->nom, + reference: (string) $order->reference, + total: $this->moneyFormatter->format($order->total), + pickupDayFormatted: $order->pickup_day ? $order->pickup_day->translatedFormat('l j F Y') : '', + lines: $linesDto, + shopName: $order->shop ? $order->shop->name : '', + shopAddress: $order->shop ? $order->shop->address : '', + shopPostcode: $order->shop ? $order->shop->postcode : '', + shopCity: $order->shop ? $order->shop->city : '' + ); + } } diff --git a/app/Jobs/UpdateSlidesStatus.php b/app/Jobs/UpdateSlidesStatus.php new file mode 100644 index 00000000..ef5f23e6 --- /dev/null +++ b/app/Jobs/UpdateSlidesStatus.php @@ -0,0 +1,55 @@ +where('date_end', '<=', $now) + ->whereNotNull('date_end') + ->where('status', true); + + $unpublishCount = $unpublishQuery->count(); + Log::debug(self::class . ' slides to unpublish ' . $unpublishCount); + + if ($unpublishCount > 0) { + $unpublishQuery->update([ + 'date_start' => null, + 'date_end' => null, + 'status' => false, + ]); + } + + $publishQuery = Slide::query() + ->where('date_start', '<=', $now) + ->whereNotNull('date_start') + ->where('status', false); + + $publishCount = $publishQuery->count(); + Log::debug(self::class . ' slides to publish ' . $publishCount); + + if ($publishCount > 0) { + $publishQuery->update([ + 'date_start' => null, + 'status' => true, + ]); + } + } +} diff --git a/app/Jobs/UpsertShopsPickupExceptionsUsingApiForYear.php b/app/Jobs/UpsertShopsPickupExceptionsUsingApiForYear.php new file mode 100644 index 00000000..0548794b --- /dev/null +++ b/app/Jobs/UpsertShopsPickupExceptionsUsingApiForYear.php @@ -0,0 +1,117 @@ +year = $year ?? Date::now()->addYear()->year; + + throw_if( + $this->year < 2026, + \InvalidArgumentException::class + ); + } + + public function handle(): void + { + $hollydayList = $this->getHollydaysForYear($this->year); + + foreach ($hollydayList as $holiday) { + $exception = PickupException::query() + ->firstOrNew(['label' => $holiday->label]); + $exception->fill([ + 'date' => $holiday->date->format('Y-m-d'), + 'repeatable' => true, + 'repeat_frequency' => RepeatFrequency::YEARLY, + ]); + $exception->setAttribute('auto_updated', true); + $exception->save(); + } + + // * Sync repeatables api pickup exception for all shops + $repeatablesFromApi = PickupException::query() + ->whereIn('label', array_map( + fn ($v) => $v->label, + $hollydayList + ))->get(); + + Shop::query()->get() + ->each(fn ($shop) => $shop->pickupExceptions() + ->syncWithoutDetaching($repeatablesFromApi)); + } + + /** @return object{date:\DateTimeInterface,label:string}[] */ + private function getHollydaysForYear(int $year): array + { + $url = $this->getCalendarApiUrlFor($year); + + $response = Http::timeout(self::API_CALL_TIMEOUT)->get($url); + throw_unless( + $response->successful(), + \UnexpectedValueException::class, + 'Failed to fetch calendar from api' + ); + + $outputList = $response + ->collect() + ->map(fn ($label, $date) => [ + 'date' => $date, + 'label' => $label, + ])->all(); + + $rules = [ + '*' => 'array', + '*.date' => ['required', 'date'], + '*.label' => ['required', 'string'], + ]; + + $validator = Validator::make($outputList, $rules); + + if ($validator->fails()) { + $errors = $validator->errors(); + throw new \UnexpectedValueException( + 'Invalid response: ' . + json_encode($errors->messages()) + ); + } + + return array_map(fn (array $entry) => (object) [ + 'date' => Date::parse( + $entry['date'], + new \DateTimeZone('Europe/Paris') + ), + 'label' => Arr::string($entry, 'label'), + ], $outputList); + } + + private function getCalendarApiUrlFor(int $year): string + { + return str_replace( + ':year', + strval($year), + self::CALENDAR_API_URL + ); + } +} diff --git a/app/Jobs/XArcadiaFlux.php b/app/Jobs/XArcadiaFlux.php deleted file mode 100644 index 2108f0c2..00000000 --- a/app/Jobs/XArcadiaFlux.php +++ /dev/null @@ -1,210 +0,0 @@ -archiveFolderName, $filename); - if ($this->getDisk()->exists($archiveFile)) { - $this->log( - sprintf( - 'File %s exists, and therefore must be delete before archive', - $archiveFile - ), - LogType::info() - ); - if (!$this->getDisk()->delete($archiveFile)) { - Log::critical(sprintf('%s : Could not delete file %s', get_class($this), $archiveFile)); - }; - } - - if (!$this->getDisk()->move($filename, sprintf('%s/%s', $this->archiveFolderName, $filename))) { - $this->log( - sprintf( - 'File %s could not be moved to archives', - $filename - ), - LogType::warning() - ); - } - } - - /** - * Suppression des fichiers dans - * archives qui ont plus de 30j - * - * @return void - */ - protected function clearOldArchives(): void - { - $disk = $this->getDisk(); - $archives = $disk->files($this->archiveFolderName); - - // /** @var File */ - foreach ($archives as $archive) { - $pi = \pathinfo($archive, \PATHINFO_BASENAME); - if (in_array($pi, $this->ignoreFiles)) { - continue; - } - - if ($disk->lastModified($archive) < strtotime(Carbon::now()->subDays(30))) { - if (!$disk->delete($archive)) { - Log::critical(sprintf('%s : Could not delete file %s', get_class($this), $archive)); - }; - } - } - } - - /** - * Get the concerned disk - * - * @return Filesystem - */ - protected function getDisk(): Filesystem - { - return Storage::disk($this->disk); - } - - /** - * Logs data - * - * @param string $message - * @param LogType $logtype - * @return void - * @throws \ErrorException If logtype is not handled. - */ - protected function log(string $message, LogType $logtype = null): void - { - if (!$logtype) { - $logtype = LogType::debug(); - } - $message = sprintf('%s : %s', get_class($this), $message); - switch ($logtype->value) { - case LogType::debug()->value: - Log::debug($message); - break; - case LogType::info()->value: - Log::info($message); - break; - case LogType::log()->value: - Log::log($message); - break; - case LogType::warning()->value: - Log::warning($message); - break; - case LogType::error()->value: - Log::error($message); - break; - case LogType::critical()->value: - Log::critical($message); - break; - default: - throw new \ErrorException(sprintf('%s : unhandled log type %s', get_class($this), $logtype->label)); - }//end switch - $this->consolePrint($message, $logtype); - } - - /** - * Prints to the console - * - * @param string $message - * @param LogType $logtype - * @return void - * @throws \ErrorException If logtype is not handled. - */ - protected function consolePrint(string $message, LogType $logtype): void - { - if ($this->console) { - switch ($logtype->value) { - case LogType::debug()->value: - case LogType::info()->value: - case LogType::log()->value: - $this->console->info($message); - break; - case LogType::warning()->value: - $this->console->comment($message); - break; - case LogType::error()->value: - case LogType::critical()->value: - $this->console->error($message); - break; - default: - throw new \ErrorException(sprintf('%s : unhandled log type %s', get_class($this), $logtype->label)); - } - } - } -} diff --git a/app/Jobs/XmlIncoReader.php b/app/Jobs/XmlIncoReader.php deleted file mode 100644 index 3b40bcab..00000000 --- a/app/Jobs/XmlIncoReader.php +++ /dev/null @@ -1,570 +0,0 @@ - 'parent', // Consider this sub array - * puis: - * "PARENT.LEAF" => 'leaf', // extract this data in the line - * Note : Xmljobs iterates the PARENT with RecursiveIteratorIterator::LEAVES_ONLY - * intermediate nodes are therefore ignored - * example : nodes : - * how to extract leaves : - * 'EXPLOITANT' => 'exploitant', // Consider this sub array - * 'EXPLOITANT.ID_SOCIETE' => 'id_societe', - * 'EXPLOITANT.NOM_SOCIETE' => 'nom_societe', - */ - protected $takeColumns = [ - 'NO_ART' => 'id', - // Primary key on model. - // This wil not return anything cf doc above. - 'ID_SOCIETE' => 'id_societe', - 'NOM_SOCIETE' => 'nom_societe', - - 'PROD_SAISON' => 'prod_saison', - 'NOM' => 'nom', - 'NUMERO' => 'numero', - 'TAILLE_REF' => 'taille_ref', -// $poidsRef censé être dans INCO_COMPO (et généralement 100g) - 'ALLEGATIONS' => 'allegations', - 'CONSEIL_PREPA' => 'conseil_prepa', - 'ASTUCES' => 'astuces', - 'DESCRIPTIF' => 'descriptif', -// $descriptif - 'ARG_VENTE' => 'arg_vente', - 'NB_PORTION' => 'nb_portion', - 'TYP_PORTION' => 'typ_portion', - 'PDS_MOY_THEO' => 'pds_moy_theo', - 'LIB_CONSO' => 'lib_conso', - 'LST_ING' => 'lst_ing', -// $ingredients - // List alergene. - 'LST_ALLERGENE' => 'lst_allergene', -// Consider this sub array. - 'LST_ALLERGENE.LIB_ALLERGENE' => 'lib_allergene', - - // Allegations. - 'ALLEGAT_SANTE' => 'allegat_sante', - 'ALLEGAT_NUTRIT' => 'allegat_nutrit', - 'ALLEGAT_AUTRE' => 'allegat_autre', - - - 'INCO_COMPO' => 'inco_compo', -// Consider this sub array. - 'INCO_COMPO.NOM' => 'nom', - 'INCO_COMPO.TAILLE_REF' => 'taille_ref', - 'INCO_COMPO.VAL_ENERG_KJ_NUT' => 'val_energ_kj_nut', - 'INCO_COMPO.VAL_ENERG_KJ_R' => 'val_energ_kj_r', -// _R apports de la taille_ref - 'INCO_COMPO.VAL_ENERG_KCAL_R' => 'val_energ_kcal_r', - 'INCO_COMPO.VAL_ENERG_KCAL_NUT' => 'val_energ_kcal_nut', - 'INCO_COMPO.MAT_GRASS_R' => 'mat_grass_r', - 'INCO_COMPO.MAT_GRASS_NUT' => 'mat_grass_nut', - 'INCO_COMPO.AGS_R' => 'ags_r', - 'INCO_COMPO.AGS_NUT' => 'ags_nut', - 'INCO_COMPO.GLUCIDES_R' => 'glucides_r', - 'INCO_COMPO.GLUCIDES_NUT' => 'glucides_nut', - 'INCO_COMPO.SUCRE_NUT' => 'sucre_nut', - 'INCO_COMPO.SUCRE_R' => 'sucre_r', - 'INCO_COMPO.FIB_ALIM_NUT' => 'fib_alim_nut', - 'INCO_COMPO.FIB_ALIM_R' => 'fib_alim_r', - 'INCO_COMPO.PROTEINE_R' => 'proteine_r', - 'INCO_COMPO.PROTEINE_NUT' => 'proteine_nut', - 'INCO_COMPO.SEL_R' => 'sel_r', - 'INCO_COMPO.SEL_NUT' => 'sel_nut', - 'INCO_COMPO.SODIUM_R' => 'sodium_r', - 'INCO_COMPO.ENER_E14_R' => 'ener_e14_r', - 'INCO_COMPO.FRUITS_R' => 'fruits_r', - 'INCO_COMPO.FRUITS_COQUE_SECH_R' => 'fruits_coque_sech_r', - 'INCO_COMPO.POURCENT_APPORT_REF_E14_R' => 'pourcent_apport_ref_e14_r', -// POURCENT_*_P apports journaliers par portion. - 'INCO_COMPO.ENER_KJO_R' => 'ener_kjo_r', - 'INCO_COMPO.POURCENT_APPORT_REF_KJO_R' => 'pourcent_apport_ref_kjo_r', - 'INCO_COMPO.POURCENT_APPORT_REF_FAT_R' => 'pourcent_apport_ref_fat_r', - 'INCO_COMPO.FATSAT_R' => 'fatsat_r', - 'INCO_COMPO.POURCENT_APPORT_REF_FATSAT_R' => 'pourcent_apport_ref_fatsat_r', - 'INCO_COMPO.CHOVAL_R' => 'choval_r', - 'INCO_COMPO.POURCENT_APPORT_REF_CHOVAL_R' => 'pourcent_apport_ref_choval_r', - 'INCO_COMPO.SUGAR_R' => 'sugar_r', - 'INCO_COMPO.POURCENT_APPORT_REF_SUGAR_R' => 'pourcent_apport_ref_sugar_r', - 'INCO_COMPO.FIBTG_R' => 'fibtg_r', - 'INCO_COMPO.POURCENT_APPORT_REF_FIBTG_R' => 'pourcent_apport_ref_fibtg_r', - 'INCO_COMPO.PRO_R' => 'pro_r', - 'INCO_COMPO.POURCENT_APPORT_REF_PRO_R' => 'pourcent_apport_ref_pro_r', - 'INCO_COMPO.SALTEQ_R' => 'salteq_r', - 'INCO_COMPO.POURCENT_APPORT_REF_SALTEQ_R' => 'pourcent_apport_ref_salteq_r', - 'INCO_COMPO.APPORT_REF' => 'apport_ref', - 'INCO_COMPO.TAILLE_PORT' => 'taille_port', -// $poidsPortion - 'INCO_COMPO.VAL_ENERG_KJ_P' => 'val_energ_kj_p', -// _P apports par portion - 'INCO_COMPO.VAL_ENERG_KCAL_P' => 'val_energ_kcal_p', - 'INCO_COMPO.MAT_GRASS_P' => 'mat_grass_p', - 'INCO_COMPO.AGS_P' => 'ags_p', - 'INCO_COMPO.GLUCIDES_P' => 'glucides_p', - 'INCO_COMPO.SUCRE_P' => 'sucre_p', - 'INCO_COMPO.FIB_ALIM_P' => 'fib_alim_p', - 'INCO_COMPO.PROTEINE_P' => 'proteine_p', - 'INCO_COMPO.SODIUM_P' => 'sodium_p', - 'INCO_COMPO.FRUITS_P' => 'fruits_p', - 'INCO_COMPO.SEL_P' => 'sel_p', - 'INCO_COMPO.FRUITS_COQUE_SECH_P' => 'fruits_coque_sech_p', - 'INCO_COMPO.ENER_E14_P' => 'ener_e14_p', - 'INCO_COMPO.POURCENT_APPORT_REF_E14_P' => 'pourcent_apport_ref_e14_p', - 'INCO_COMPO.ENER_KJO_P' => 'ener_kjo_p', - 'INCO_COMPO.POURCENT_APPORT_REF_KJO_P' => 'pourcent_apport_ref_kjo_p', - 'INCO_COMPO.FAT_P' => 'fat_p', - 'INCO_COMPO.POURCENT_APPORT_REF_FAT_P' => 'pourcent_apport_ref_fat_p', - 'INCO_COMPO.FATSAT_P' => 'fatsat_p', - 'INCO_COMPO.POURCENT_APPORT_REF_FATSAT_P' => 'pourcent_apport_ref_fatsat_p', - 'INCO_COMPO.CHOVAL_P' => 'CHOVAL_P', - 'INCO_COMPO.POURCENT_APPORT_REF_CHOVAL_P' => 'pourcent_apport_ref_choval_p', - 'INCO_COMPO.SUGAR_P' => 'SUGAR_P', - 'INCO_COMPO.POURCENT_APPORT_REF_SUGAR_P' => 'pourcent_apport_ref_sugar_p', - 'INCO_COMPO.FIBTG_P' => 'fibtg_p', - 'INCO_COMPO.POURCENT_APPORT_REF_FIBTG_P' => 'pourcent_apport_ref_fibtg_p', - 'INCO_COMPO.PRO_P' => 'pro_p', - 'INCO_COMPO.POURCENT_APPORT_REF_PRO_P' => 'pourcent_apport_ref_pro_p', - 'INCO_COMPO.SALTEQ_P' => 'salteq_p', - 'INCO_COMPO.POURCENT_APPORT_REF_SALTEQ_P' => 'pourcent_apport_ref_salteq_p', - 'INCO_COMPO.APPORT_PORT' => 'apport_port', - 'INCO_COMPO.PART_P' => 'part_p', - 'INCO_COMPO.PART_G' => 'part_g', - 'INCO_COMPO.PART_L' => 'part_l', - 'INCO_COMPO.P_SUR_L' => 'p_sur_l', - 'INCO_COMPO.POURCENT_AGS' => 'pourcent_ags', - 'INCO_COMPO.POURCENT_AGI' => 'pourcent_agi', - 'INCO_COMPO.POURCENT_SS' => 'pourcent_ss', - 'INCO_COMPO.POURCENT_AMIDON' => 'pourcent_amidon', - 'INCO_COMPO.COMPOSANTE_N' => 'composante_n', - 'INCO_COMPO.COMPOSANTE_P' => 'composante_p', - 'INCO_COMPO.POURCENT_FRUITS' => 'pourcent_fruits', - 'INCO_COMPO.SCORE_NUTRI' => 'score_nutri', - // Du coup nutriscore ?. - 'INCO_COMPO.CLASSEMENT' => 'classement', - // $nutriscore mais pas censé être dans INCO_COMPO - 'INCO_COMPO.MAT_GRASS_R_PREC' => 'mat_grass_r_prec', - 'INCO_COMPO.AGS_R_PREC' => 'ags_r_prec', - 'INCO_COMPO.GLUCIDES_R_PREC' => 'glucides_r_prec', - 'INCO_COMPO.SUCRE_R_PREC' => 'sucre_r_prec', - 'INCO_COMPO.FIB_ALIM_R_PREC' => 'fib_alim_r_prec', - 'INCO_COMPO.PROTEINE_R_PREC' => 'proteine_r_prec', - 'INCO_COMPO.SEL_R_PREC' => 'sel_r_prec', - 'INCO_COMPO.SODIUM_R_PREC' => 'sodium_r_prec', - 'INCO_COMPO.FRUITS_R_PREC' => 'fruits_r_prec', - 'INCO_COMPO.FRUITS_COQUE_SECH_R_PREC' => 'fruits_coque_sech_r_prec', - ]; - - /** - * The columns allowed to be null - * - * @var array - */ - protected $nullableFields = [ - 'taille_ref', - 'conseil_prepa', - 'typ_portion', - 'nb_portion', - 'descriptif', - 'prod_saison', - 'allegations', - 'astuces', 'arg_vente', - 'pds_moy_theo', - 'lib_conso', 'lst_ing', 'lst_allergene', - 'allegat_sante', 'allegat_nutrit', 'allegat_autre', - 'inco_compo', - 'inco_compo.nom', - 'inco_compo.numero', - 'inco_compo.taille', - 'inco_compo.taille_ref', - 'inco_compo.val_energ_kj_nut', - 'inco_compo.val_energ_kj_r', - 'inco_compo.val_energ_kcal_r', - 'inco_compo.val_energ_kcal_nut', - 'inco_compo.mat_grass_r', - 'inco_compo.mat_grass_nut', - 'inco_compo.ags_r', - 'inco_compo.ags_nut', - 'inco_compo.glucides_r', - 'inco_compo.glucides_nut', - 'inco_compo.sucre_nut', - 'inco_compo.sucre_r', - 'inco_compo.fib_alim_nut', - 'inco_compo.fib_alim_r', - 'inco_compo.proteine_r', - 'inco_compo.proteine_nut', - 'inco_compo.sel_r', - 'inco_compo.sel_nut', - 'inco_compo.sodium_r', - 'inco_compo.ener_e14_r', - 'inco_compo.fruits_r', - 'inco_compo.fruits_coque_sech_r', - 'inco_compo.pourcent_apport_ref_e14_r', - 'inco_compo.ener_kjo_r', - 'inco_compo.pourcent_apport_ref_kjo_r', - 'inco_compo.pourcent_apport_ref_fat_r', - 'inco_compo.fatsat_r', - 'inco_compo.pourcent_apport_ref_fatsat_r', - 'inco_compo.choval_r', - 'inco_compo.pourcent_apport_ref_choval_r', - 'inco_compo.sugar_r', - 'inco_compo.pourcent_apport_ref_sugar_r', - 'inco_compo.fibtg_r', - 'inco_compo.pourcent_apport_ref_fibtg_r', - 'inco_compo.pro_r', - 'inco_compo.pourcent_apport_ref_pro_r', - 'inco_compo.salteq_r', - 'inco_compo.pourcent_apport_ref_salteq_r', - 'inco_compo.apport_ref', - 'inco_compo.taille_port', - 'inco_compo.val_energ_kj_p', - 'inco_compo.val_energ_kcal_p', - 'inco_compo.mat_grass_p', - 'inco_compo.ags_p', - 'inco_compo.glucides_p', - 'inco_compo.sucre_p', - 'inco_compo.fib_alim_p', - 'inco_compo.proteine_p', - 'inco_compo.sodium_p', - 'inco_compo.fruits_p', - 'inco_compo.sel_p', - 'inco_compo.fruits_coque_sech_p', - 'inco_compo.ener_e14_p', - 'inco_compo.pourcent_apport_ref_e14_p', - 'inco_compo.ener_kjo_p', - 'inco_compo.pourcent_apport_ref_kjo_p', - 'inco_compo.fat_p', - 'inco_compo.pourcent_apport_ref_fat_p', - 'inco_compo.fatsat_p', - 'inco_compo.pourcent_apport_ref_fatsat_p', - 'inco_compo.choval_p', - 'inco_compo.pourcent_apport_ref_choval_p', - 'inco_compo.sugar_p', - 'inco_compo.pourcent_apport_ref_sugar_p', - 'inco_compo.fibtg_p', - 'inco_compo.pourcent_apport_ref_fibtg_p', - 'inco_compo.pro_p', - 'inco_compo.pourcent_apport_ref_pro_p', - 'inco_compo.salteq_p', - 'inco_compo.pourcent_apport_ref_salteq_p', - 'inco_compo.apport_port', - 'inco_compo.part_p', - 'inco_compo.part_g', - 'inco_compo.part_l', - 'inco_compo.p_sur_l', - 'inco_compo.pourcent_ags', - 'inco_compo.pourcent_agi', - 'inco_compo.pourcent_ss', - 'inco_compo.pourcent_amidon', - 'inco_compo.composante_n', - 'inco_compo.composante_p', - 'inco_compo.pourcent_fruits', - 'inco_compo.score_nutri', - 'inco_compo.classement', - 'inco_compo.mat_grass_r_prec', - 'inco_compo.ags_r_prec', - 'inco_compo.glucides_r_prec', - 'inco_compo.sucre_r_prec', - 'inco_compo.fib_alim_r_prec', - 'inco_compo.proteine_r_prec', - 'inco_compo.sel_r_prec', - 'inco_compo.sodium_r_prec', - 'inco_compo.fruits_r_prec', - 'inco_compo.fruits_coque_sech_r_prec' - ]; - - /** - * Unique keys for updating rows - * - * @var array - */ - protected $uniqueKeyField = ['id']; - - /** - * Columns to merge in - * - * @var array - */ - protected $mergeColumns = [ - 'allegations' => [ - 'allegat_sante', - 'allegat_nutrit', - 'allegat_autre' - ], - 'nutritional_values' => [ - 'taille_ref', - 'val_energ_kj_nut', - 'val_energ_kj_r', - 'val_energ_kcal_r', - 'val_energ_kcal_nut', - 'mat_grass_r', - 'mat_grass_nut', - 'ags_r', - 'ags_nut', - 'glucides_r', - 'glucides_nut', - 'sucre_nut', - 'sucre_r', - 'fib_alim_nut', - 'fib_alim_r', - 'proteine_r', - 'proteine_nut', - 'sel_r', - 'sel_nut', - 'sodium_r', - 'ener_e14_r', - 'fruits_r', - 'fruits_coque_sech_r', - 'pourcent_apport_ref_e14_r', - 'ener_kjo_r', - 'pourcent_apport_ref_kjo_r', - 'pourcent_apport_ref_fat_r', - 'fatsat_r', - 'pourcent_apport_ref_fatsat_r', - 'choval_r', - 'pourcent_apport_ref_choval_r', - 'sugar_r', - 'pourcent_apport_ref_sugar_r', - 'fibtg_r', - 'pourcent_apport_ref_fibtg_r', - 'pro_r', - 'pourcent_apport_ref_pro_r', - 'salteq_r', - 'pourcent_apport_ref_salteq_r', - 'apport_ref', - 'taille_port', - 'val_energ_kj_p', - 'val_energ_kcal_p', - 'mat_grass_p', - 'ags_p', - 'glucides_p', - 'sucre_p', - 'fib_alim_p', - 'proteine_p', - 'sodium_p', - 'fruits_p', - 'sel_p', - 'fruits_coque_sech_p', - 'ener_e14_p', - 'pourcent_apport_ref_e14_p', - 'ener_kjo_p', - 'pourcent_apport_ref_kjo_p', - 'fat_p', - 'pourcent_apport_ref_fat_p', - 'fatsat_p', - 'pourcent_apport_ref_fatsat_p', - 'choval_p', - 'pourcent_apport_ref_choval_p', - 'sugar_p', - 'pourcent_apport_ref_sugar_p', - 'fibtg_p', - 'pourcent_apport_ref_fibtg_p', - 'pro_p', - 'pourcent_apport_ref_pro_p', - 'salteq_p', - 'pourcent_apport_ref_salteq_p', - 'apport_port', - 'part_p', - 'part_g', - 'part_l', - 'p_sur_l', - 'pourcent_ags', - 'pourcent_agi', - 'pourcent_ss', - 'pourcent_amidon', - 'composante_n', - 'composante_p', - 'pourcent_fruits', - 'score_nutri', - 'classement', - 'mat_grass_r_prec', - 'ags_r_prec', - 'glucides_r_prec', - 'sucre_r_prec', - 'fib_alim_r_prec', - 'proteine_r_prec', - 'sel_r_prec', - 'sodium_r_prec', - 'fruits_r_prec', - 'fruits_coque_sech_r_prec', - ] - ]; - - /** - * Execute the job. - * - * @return void - */ - public function handle() - { - - $this->parseData('INCO', XmlInco::class, function (SimpleXMLElement $xmlData, array &$line) { - - // Merge columns. - foreach ($this->mergeColumns as $key => $values) { - $line[$key] = []; - // Merge columns and remove merged columns from line. - array_map(function ($kValue) use (&$line, $key) { - if (array_key_exists($kValue, $line)) { - $line[$key][$kValue] = $line[$kValue]; - unset($line[$kValue]); - } - }, $values); - if ($key == 'allegations') { - $line[$key] = implode(',', array_filter($line[$key])); - $line[$key] = strlen($line[$key]) ? $line[$key] : null; - } - } - - // Boolean cast prod_saison. - $line['prod_saison'] = isset($line['prod_saison']) ? - (strtolower($line['prod_saison']) == 'non' ? false : true) : false; - - $arImgPaths = $this->parseImage($xmlData); - $line['picture'] = $arImgPaths; - }); - } - - /** - * Extract Image form XML file - * - * @param SimpleXMLElement $xmlData - * @return array - * @throws AbortXmlImportException When media tag does not contain an image. - */ - private function parseImage(SimpleXMLElement $xmlData) - { - $list_media = $xmlData->INCO->MEDIA_VISUEL_EAI->MEDIA_VISUEL_EAI; - $arImgPaths = array(); - $index = 1; - - foreach ($list_media as $media) { - $image = $media->img; - $imageData = trim((string)$image); - if (strlen($imageData)) { - $imageData = base64_decode($imageData); - $imgName = strval($xmlData->INCO->INCO_COMPO->TBL_INCO_COMPO->ID_INCO); - if (empty($imgName)) { - $imgName = strval($xmlData->INCO->NO_ART); - } - $imgName = $imgName . "_" . $index; - $imgNamePath = sprintf('%s/%s', rtrim($this->imagesPath, '/'), $imgName); - - $disk = $this->getDisk(); - - $info = getimagesizefromstring($imageData); - if ($info !== false) { - $mime = $info['mime']; - switch ($mime) { - case 'image/jpeg': - $imgExtension = 'jpg'; - break; - case 'image/png': - $imgExtension = 'png'; - break; - case 'image/gif': - $imgExtension = 'gif'; - break; - default: - throw new AbortXmlImportException(sprintf('Unknown image type %s', $imgName)); - } - - $imgNamePath = sprintf('%s.%s', $imgNamePath, $imgExtension); - - if (!$disk->put($imgNamePath, $imageData)) { - throw new AbortXmlImportException(sprintf('The image %s could not be saved', $imgNamePath)); - } - - $arImgPaths[$index] = sprintf('%s/%s', $this->disk, $imgNamePath); - $index++; - }//end if - }//end if - }//end foreach - - return $arImgPaths; - } - - - /** - * Recursive extract to array - * introduce sort of Hook to transform - * - * - * - * - * extracted as "TYP_PORTION" => array:1 [ - * 0 => array:2 [ - * "code" => "2" - * "libelle" => "Approximatif" - * ] - * ] - * into this - * - * extracted as "TYP_PORTION" => "Approximatif" - * - * - * @param \SimpleXMLElement|false $sxe - * @return array - */ - protected function extract($sxe = null): array - { - - if (!$sxe instanceof SimpleXMLElement) { - return array(); - } - $extract = array(); - foreach ($sxe->children() as $key => $value) { - if ($value->count()) { - $extraction = $this->extract($value); - - if ( - count($extraction) - && array_key_exists("code", $extraction) - && array_key_exists("libelle", $extraction) - ) { - $val = strval($extraction['libelle']); - $extract[$key] = strlen($val) ? $val : null; - continue; - } - - $extract[$key][] = $extraction; - continue; - } - $value = strval($value); - if (array_key_exists($key, $extract) and is_array($extract[$key])) { - $extract[$key][] = strlen($value) ? $value : null; - } else { - $extract[$key] = strlen($value) ? $value : null; - } - }//end foreach - return $extract; - } -} diff --git a/app/Jobs/XmlJobs.php b/app/Jobs/XmlJobs.php deleted file mode 100644 index 56acac36..00000000 --- a/app/Jobs/XmlJobs.php +++ /dev/null @@ -1,391 +0,0 @@ -getDisk(); - $this->log('Démarrage du traitement'); - $files = $disk->files(); - - $progress = 1; - $total = count(array_filter($files, function ($filename) { - if ($this->fileHasToBeIgnored($filename)) { - return false; - } - return true; - })); - - foreach ($files as $filename) { - if ($this->fileHasToBeIgnored($filename)) { - continue; - } - - $this->log(sprintf(' traitement %d sur %s ', $progress++, $total)); - - try { - /** @var string $data */ - $data = $disk->get($filename); - try { - if ($this->encapsulate) { - $data = sprintf('%s', $data); - /** @var SimpleXMLElement|false */ - $xmlContent = simplexml_load_string($data); - } else { - /** @var SimpleXMLElement|false */ - $xmlContent = simplexml_load_string($data, null, LIBXML_NOCDATA | LIBXML_PARSEHUGE); - } - - if ($xmlContent === false) { - throw new InvalidXmlException('XML is Invalid (simplexml_load_string returned false)'); - } - } catch (ErrorException $e) { - throw new InvalidXmlException('XML is Invalid', 0, $e); - }//end try - - $data = $this->extract($xmlContent); - - $lines = []; - foreach ($data[$entityName] as $traca) { - $line = $this->processFields($traca); - if ($callback) { - $callback($xmlContent, $line); - } - $lines[] = $line; - } - - // Mise en base des données. - foreach ($lines as $line) { - /** @var array Unique Key columns */ - $uniqueColumnsKey = []; - foreach ($this->uniqueKeyField as $uField) { - $uniqueColumnsKey[$uField] = $line[$uField]; - } - $savedData = forward_static_call_array( - [$modelClass, 'updateOrCreate'], - [$uniqueColumnsKey, $line] - ); - $savedData->updateLocalProductInfo(); - } - } catch (InvalidXmlException $e) { - $message = $e->getMessage(); - if (get_class($e) === QueryException::class) { - $message = implode(' ', $e->errorInfo); - } - $this->log( - sprintf( - 'File %s could not be parsed => %s on line %d', - $filename, - $message, - $e->getLine() - ), - LogType::critical() - ); - $this->sendInvalidXmlEmail($filename, $e); - $this->moveToInvalid($filename); - continue; - } catch (ErrorException | TypeError $e) { - $this->log( - sprintf( - 'CRITICAL: File %s could not be parsed => %s on line %d', - $filename, - $e->getMessage(), - $e->getLine() - ), - LogType::critical() - ); - $this->sendErrorParseEmailToServiceWeb($e); - continue; -// Ignore the file. - } catch (AbortXmlImportException $e) { - $this->log( - sprintf( - 'ERROR: File %s could not be parsed => %s on line %d', - $filename, - $e->getMessage(), - $e->getLine() - ), - LogType::error() - ); - $this->sendErrorParseEmailToServiceWeb($e); - $this->moveToInvalid($filename); - continue; -// Ignore the file. - } catch (FileNotFoundException | QueryException $e) { - // This happens because of concurent xml jobs read. - $message = $e->getMessage(); - if (get_class($e) === QueryException::class) { - $message = implode(' ', $e->errorInfo); - } - $this->log( - sprintf( - 'ERROR: File %s could not be read (not found) => %s on line %d', - $filename, - $message, - $e->getLine() - ), - LogType::debug() - ); - continue; -// Ignore the file. - }//end try - $this->moveToArchives($filename); - }//end foreach - - // Clear old archives. - $this->clearOldArchives(); - } - - /** - * Recursive extract to array - * - * @param \SimpleXMLElement|false $sxe - * @return array - */ - protected function extract($sxe = null): array - { - if (!$sxe instanceof SimpleXMLElement) { - return array(); - } - $extract = array(); - foreach ($sxe->children() as $key => $value) { - if ($value->count()) { - $extract[$key][] = $this->extract($value); - continue; - } - $value = strval($value); - if (array_key_exists($key, $extract) and is_array($extract[$key])) { - $extract[$key][] = strlen($value) ? $value : null; - } else { - $extract[$key] = strlen($value) ? $value : null; - } - } - return $extract; - } - - /** - * Process fields to gather data - * - * @param array $fields - * @return array - * @throws AbortXmlImportException When field should not be null. - */ - protected function processFields(array $fields): array - { - $result = []; - foreach ($fields as $key => $field) { - if (!($key = $this->shouldFieldBeConsidered($key))) { - continue; - } - if (!$this->isFieldNullable($key) && is_null($field)) { - throw new AbortXmlImportException(sprintf('The field %s is not allowed to be null', $key)); - } - if (is_array($field)) { - // Flatten data. - $it = new RecursiveIteratorIterator(new RecursiveArrayIterator($field)); - foreach ($it as $k => $f) { - $ko = strtolower(sprintf('%s.%s', $key, $k)); - if (!$this->isFieldNullable($ko) && is_null($f)) { - throw new AbortXmlImportException(sprintf( - '%s : The field %s is not allowed to be null', - get_class($this), - $ko - )); - } - if (!($k = $this->shouldFieldBeConsidered($ko))) { - continue; - } - $result[$k] = $f; - } - } else { - $result[$key] = $field; - } - }//end foreach - return $result; - } - - /** - * Is the filed nullable - * - * @param string $key - * @return boolean - */ - private function isFieldNullable(string $key): bool - { - if (in_array($key, $this->nullableFields)) { - return true; - } - return false; - } - - /** - * - replace key name with the corresponding alias - * - strtolower the key - * - snake_case the key - * - * @param string $key - * @return string|false - */ - private function shouldFieldBeConsidered(string $key) - { - $key = strtolower($key); - foreach ($this->takeColumns as $k => $alias) { - if (strtolower($k) === $key) { - return Str::snake(strtolower($alias)); - } - } - return false; - } - - /** - * Is the file to be ignored - * - * @param string $filename - * @return boolean - */ - protected function fileHasToBeIgnored(string $filename): bool - { - return in_array($filename, $this->ignoreFiles) or !$this->checkExtension($filename, 'xml'); - } - - /** - * Check if the file is an xml file - * - * @param string $filename - * @return boolean - */ - protected function isFileXml(string $filename): bool - { - $isXml = strtolower(pathinfo($filename, \PATHINFO_EXTENSION)) === 'xml'; - if (!$isXml) { - Log::warning(sprintf('%s : unwanted file type in %s', get_class($this), $filename)); - } - return $isXml; - } - - /** - * Send Error Mail - * - * @param Throwable $e - * @return void - */ - protected function sendErrorParseEmailToServiceWeb(Throwable $e) - { - Mail::send('emails.exception', [ - 'exception' => $e, - 'appName' => config('app.name'), - ], function ($m) { - $m->to( - config('mail.contactsList.serviceweb'), - sprintf('%s Exception Handler', config('app.name')) - )->subject('Could not eat INCO, because of its toxicity !'); - }); - } - - /** - * Send Mail Invalid XML - * - * @param string $filename - * @param Throwable $e - * @return void - */ - protected function sendInvalidXmlEmail(string $filename, Throwable $e) - { - $message = $e->getPrevious()->getMessage(); - Mail::send('emails.invalidxml', [ - 'strError' => sprintf( - 'File %s could not be parsed => %s on line %d', - $filename, - $message, - $e->getLine() - ), - 'appName' => config('app.name'), - 'filename' => $filename, - 'exception' => $e->getPrevious() - ], function ($m) { - $m->to( - config('mail.contactsList.invalidInco'), - sprintf('%s Exception Handler', config('app.name')) - )->subject('You sent me an invalid XML file, please check its validity before resend ASAP.'); - }); - } - - /** - * Move the file to invalid folder - * - * @param string $filename - * @return void - */ - protected function moveToInvalid(string $filename): void - { - if (!$this->getDisk()->move($filename, sprintf('%s/%s', $this->invalidFolderName, $filename))) { - $this->log( - sprintf( - 'File %s could not be moved to invalid folder name', - $filename - ), - LogType::warning() - ); - } - } -} diff --git a/app/Lib/AdminSecure.php b/app/Lib/AdminSecure.php deleted file mode 100644 index cc05a579..00000000 --- a/app/Lib/AdminSecure.php +++ /dev/null @@ -1,131 +0,0 @@ -server('HTTP_X_FORWARDED_FOR') ?? request()->getClientIp(); - $ip = IPAddress::Make($ip); - - if ($ip->isErr()) { - throw new \Exception(\trans('Client IP not valid ') . $ip->getErr()); - } - return $ip->unwrap(); - } - - /** - * Check if ipV4 is private - * - * @param \Dxw\CIDR\IPv4Address $ipv4_address - * @return boolean - */ - private static function ipV4IsPrivate(IPv4Address $ipv4_address): bool - { - return \collect(self::$private_ip_v4_cidr_list) - ->concat([self::$private_ip_v4_loopback_cidr]) - ->map(function (string $ipv4_cidr) { - return IPv4Range::Make($ipv4_cidr)->unwrap(); - }) - ->reduce(function ($initial, IPv4Range $ipv4_range) use ($ipv4_address) { - return $initial || $ipv4_range->containsAddress($ipv4_address); - }); - } - - /** - * Check if ipV6 is private - * - * @param \Dxw\CIDR\IPv6Address $ipv6_address - * @return boolean - */ - private static function ipV6IsPrivate(IPv6Address $ipv6_address): bool - { - return \collect(self::$private_ip_v6_cidr_list) - ->concat([self::$private_ip_v6_loopback_cidr]) - ->map(function (string $ipv6_cidr) { - return IPv6Range::Make($ipv6_cidr)->unwrap(); - }) - ->reduce(function ($initial, IPv6Range $ipv6_range) { - return $initial || $ipv6_range->containsAddress($ipv6_address); - }); - } - - /** - * Get Admin secure options - * - * @return \App\Lib\Options - */ - public static function getOptions(): Options - { - if (!self::$options) { - self::$options = new Options(\config('admin-secure')); - } - return self::$options; - } -} diff --git a/app/Lib/Helpers/ExceptionsHelper.php b/app/Lib/Helpers/ExceptionsHelper.php index 11a829bd..5f129afe 100644 --- a/app/Lib/Helpers/ExceptionsHelper.php +++ b/app/Lib/Helpers/ExceptionsHelper.php @@ -1,190 +1,157 @@ setModules([]); $event->setOsContext(null); - /** @var \Sentry\ExceptionDataBag[] */ - $exceptionBag = []; - foreach ($event->getExceptions() as $exceptionDataBag) { - $exceptionBag[] = self::getAnonymizedSentryException($exceptionDataBag); - } - $event->setExceptions($exceptionBag); + $exceptions = array_map( + [self::class, 'getAnonymizedSentryException'], + $event->getExceptions() + ); + + $event->setExceptions($exceptions); + return $event; } /** - * Anonimize Sentry Exception bag - * - * @param \Sentry\ExceptionDataBag $exceptionDataBag - * @return \Sentry\ExceptionDataBag + * Anonymize Sentry Exception bag. */ - private static function getAnonymizedSentryException( - \Sentry\ExceptionDataBag $exceptionDataBag - ): \Sentry\ExceptionDataBag { - $exceptionDataBag->setValue(self::getAnonymizedMessage($exceptionDataBag->getValue())); - if ($stackTrace = $exceptionDataBag->getStacktrace()) { - $exceptionDataBag->setStacktrace(self::getAnonymizedSentryStackTrace($stackTrace)); - } - return $exceptionDataBag; - } - - /** - * Anonymise sentry stacktrace - * - * @param \Sentry\Stacktrace $stackTrace - * @return \Sentry\Stacktrace - */ - private static function getAnonymizedSentryStackTrace(\Sentry\Stacktrace $stackTrace): \Sentry\Stacktrace + private static function getAnonymizedSentryException(ExceptionDataBag $exceptionBag): ExceptionDataBag { - /** @var \Sentry\Frame[] */ - $frames = \array_reverse($stackTrace->getFrames(), true); - $i = \count($frames) - 1; - // * Remove all but keep first (index.php). - while ($i-- > 0) { - $stackTrace->removeFrame(count($stackTrace->getFrames()) - 1); + $exceptionBag->setValue(self::getAnonymizedMessage($exceptionBag->getValue())); + + if ($stackTrace = $exceptionBag->getStacktrace()) { + $exceptionBag->setStacktrace(self::getAnonymizedSentryStackTrace($stackTrace)); } - foreach ($frames as $index => $frame) { - $frame->setPostContext([]); - $frame->setPreContext([]); - $frame->setContextLine(''); - $frame->setVars(self::getAnonymizedSentryParams($frame->getVars())); - $stackTrace->addFrame($frame); - if ($index === 0) { - $stackTrace->removeFrame(count($stackTrace->getFrames()) - 1); - } - } - return $stackTrace; + + return $exceptionBag; } /** - * Get anonymized sentry params + * Anonymize sentry stacktrace. + */ + private static function getAnonymizedSentryStackTrace(Stacktrace $stackTrace): Stacktrace + { + $frames = $stackTrace->getFrames(); + if (empty($frames)) { + return $stackTrace; + } + + $firstFrame = $frames[0]; + + $firstFrame->setPostContext([]); + $firstFrame->setPreContext([]); + $firstFrame->setContextLine(''); + $firstFrame->setVars(self::getAnonymizedSentryParams($firstFrame->getVars())); + + return new Stacktrace([$firstFrame]); + } + + /** + * Get anonymized sentry params. * - * @param mixed[] $params - * @return string[] + * @template T of mixed + * + * @param array $params + * @return array */ private static function getAnonymizedSentryParams(array $params): array { foreach ($params as &$param) { - $type = \strtolower(\gettype($param)); - if (\is_string($param)) { - $type = \explode(' ', \trim($param))[0] ?? null; - } - switch ($type) { - case 'Lambda': - case 'Object': - continue 2; - case 'array': - $param = sprintf('Array(%d)', \count($param)); - continue 2; - default: - if (\is_numeric($param)) { - $param = \ucfirst($type); - continue 2; - } - if (\is_string($param)) { - $param = sprintf('String(%d)', \strlen($param)); - continue 2; - } - } //end switch - } //end foreach + $type = gettype($param); + + $param = match (true) { + is_object($param) => $param, + is_array($param) => sprintf('Array(%d)', count($param)), + is_int($param), is_float($param) => ucfirst($type), + is_string($param) => str_starts_with(trim(strtolower($param)), 'lambda') + ? $param + : sprintf('String(%d)', strlen($param)), + default => ucfirst($type), + }; + } + return $params; } - /** - * Anonymize at least Sql queries - * - * @param string $message - * @return string + * Anonymize at least Sql queries. */ public static function getAnonymizedMessage(string $message): string { - $message = \preg_replace('/^(.*)( \(SQL:.*\))$/', '$1', $message) ?? $message; - if ($sqlPos = \strpos($message, 'to use near')) { - $message = \mb_strcut($message, 0, $sqlPos); + $message = preg_replace('/^(.*)( \(SQL:.*\))$/', '$1', $message) ?? $message; + + if (($sqlPos = strpos($message, 'to use near')) !== false) { + $message = mb_strcut($message, 0, $sqlPos); } + return $message; } /** - * Anonymize stack trace - * - * @param \Throwable $e - * @return string + * Anonymize standard PHP stack trace. */ public static function getAnonymizedStackTrace(\Throwable $e): string { - $projectPath = \realpath(\sprintf('%s/../', \app_path())); - $traceStack = $e->getTrace(); - $traceStr = ''; - $maxStackStage = 0; - foreach ($traceStack as $stackStage => $stack) { - $maxStackStage = $stackStage; - $traceStr .= \sprintf( - '#%s %s(%d): ', - $stackStage, - str_replace($projectPath, '', $stack['file'] ?? ''), - $stack['line'] ?? '' - ); + $projectPath = realpath(app_path('../')) ?: ''; + $traceStr = ''; + + foreach ($e->getTrace() as $stage => $stack) { + $file = str_replace($projectPath, '', $stack['file'] ?? ''); + $line = $stack['line'] ?? ''; + + $traceStr .= "#{$stage} {$file}({$line}): "; + if (isset($stack['class'])) { - $traceStr .= "{$stack['class']}->{$stack['function']}("; - if (isset($stack['args'])) { - $traceStr .= self::handleArgs($stack); - } - $traceStr .= ")\n"; - } elseif (isset($stack['function'])) { - $traceStr .= "{$stack['function']}("; - if (isset($stack['args'])) { - $traceStr .= self::handleArgs($stack); - } - $traceStr .= ")\n"; + $traceStr .= "{$stack['class']}->"; } - } //end foreach - $maxStackStage++; - $traceStr .= "#$maxStackStage {main}"; - return $traceStr; + + $traceStr .= "{$stack['function']}("; + $traceStr .= isset($stack['args']) ? self::handleArgs($stack['args']) : ''; + $traceStr .= ")\n"; + } + + $nextStage = count($e->getTrace()); + + return $traceStr . "#{$nextStage} {main}"; } /** - * Handle Args + * Handle Args. * - * @param array $stack - * @return string + * @param array $args */ - public static function handleArgs(array $stack): string + public static function handleArgs(array $args): string { - $traceArgs = ''; - $argsCount = count($stack['args']); - for ($i = 0; $i < $argsCount; $i++) { - $type = \gettype($stack['args'][$i]); - switch ($type) { - case 'object': - $traceArgs .= sprintf('Object(%s)', \get_class($stack['args'][$i])); - break; - case 'array': - $traceArgs .= sprintf('Array(%d)', \count($stack['args'][$i])); - break; - case 'string': - $traceArgs .= sprintf('String(%d)', \strlen($stack['args'][$i])); - break; - default: - $traceArgs .= \gettype($stack['args'][$i]); - } - $traceArgs .= ($i !== ($argsCount - 1) ? ',' : ''); - } - return $traceArgs; + $formattedArgs = array_map(function ($arg) { + $type = gettype($arg); + + return match (true) { + is_object($arg) => sprintf('Object(%s)', $arg::class), + is_array($arg) => sprintf('Array(%d)', count($arg)), + is_string($arg) => sprintf('String(%d)', strlen((string) $arg)), + default => $type, + }; + }, $args); + + return implode(',', $formattedArgs); } } diff --git a/app/Lib/Helpers/FileStorageHelper.php b/app/Lib/Helpers/FileStorageHelper.php new file mode 100644 index 00000000..4f3cb6a9 --- /dev/null +++ b/app/Lib/Helpers/FileStorageHelper.php @@ -0,0 +1,525 @@ +path($path); + } + + /** + * Destroy the file associate with the attribute. + */ + public static function removeFile(Model $model, string $attribute): void + { + $path = \ltrim(\urldecode((string) $model->{$attribute}), '/'); + if (! str_starts_with($path, 'storage')) { + return; + } + $path = Str::replace(self::STORAGE_PREFIX, '', $path); + if (Storage::disk('public')->exists($path)) { + Storage::disk('public')->delete($path); + } + } + + /** + * Destroy the file associate with the attribute old value (before updated to DB). + */ + public static function removeOldFile(Model $model, string $attribute, bool $onlyIfUpdated = true): void + { + $originalValue = ToolboxHelper::getOriginal($model, $attribute); + // * Ignore If removal has to be done only if the field has changed and it actually hasnt. + if ($onlyIfUpdated && $model->{$attribute} === $originalValue) { + return; + } + + if (! is_string($originalValue)) { + return; + } + + $originalPath = \ltrim(\urldecode($originalValue), '/'); + if (! str_starts_with($originalPath, 'storage')) { + return; + } + $originalPath = Str::replace(self::STORAGE_PREFIX, '', $originalPath); + if (Storage::disk('public')->exists($originalPath)) { + Storage::disk('public')->delete($originalPath); + } + } + + /** + * Store a file using optimized storage strategy + * + * You can use filename param to overload file name. + * + * @param Model $model The model that will hold the picture. + * @param UploadedFile|\SplFileInfo|string $file The file, will just return itself is string. + * @param bool $slugify Force filename slugification. + * @param string|null $filename This string may be used to store the file. + * @param bool $private To store the file in a private space. + * + * @throws FileStorageOperationException If file copy fails. + * + * @phpcs:disable Generic.Metrics.CyclomaticComplexity.TooHigh + */ + public static function storeFile( + Model $model, + UploadedFile | \SplFileInfo | string | null $file, + bool $slugify = false, + ?string $filename = null, + bool $private = false + ): string { + // phpcs:enable + $tableName = $model->getTable(); + if ($file instanceof UploadedFile) { + return self::storeUploadedFile($file, $tableName, $slugify, $filename, $private); + } + + if ($file instanceof \SplFileInfo) { + return self::storeSplFileInfo($file, $tableName, $slugify, $filename, $private); + } + + return (string) $file; + } + + private static function storeUploadedFile( + UploadedFile $file, + string $tableName, + bool $slugify, + ?string $filename, + bool $private + ): string { + $filename = $filename ?: $file->getClientOriginalName(); + $filename = $slugify ? self::slugifyFileName($filename) : $filename; + $disk = $private ? 'private' : 'public'; + $newPath = str_replace( + storage_path("app/{$disk}"), + '', + self::prepareMoveFile($tableName, $filename, $private) + ); + + $directory = pathinfo($newPath, \PATHINFO_DIRNAME); + $basename = pathinfo($newPath, \PATHINFO_BASENAME); + + if (! $private) { + $file->storePubliclyAs( + $directory, + $basename, + ['disk' => $disk] + ); + } else { + $file->storeAs( + $directory, + $basename, + ['disk' => $disk] + ); + } + + return "storage{$newPath}"; + } + + private static function storeSplFileInfo( + \SplFileInfo $file, + string $tableName, + bool $slugify, + ?string $filename, + bool $private + ): string { + $filename = $filename ?: $file->getBaseName(); + $filename = $slugify ? self::slugifyFileName($filename) : $filename; + $newPath = self::prepareMoveFile($tableName, $filename, $private); + + if (! File::copy($file->getRealPath(), $newPath)) { + throw FileStorageOperationException::copyFailed($file->getRealPath(), $newPath); + } + + if ($private) { + return \ltrim(str_replace(\storage_path('app/private'), '/storage/app/private', $newPath), '/'); + } + + return \ltrim(str_replace(\storage_path('app/public'), '/storage', $newPath), '/'); + } + + /** + * Store all files from string attribute html + * If oldHtmlString is passed, a diff is done with new and old files + * to keep only files that are present in the new html string. + * + * @param Model $model The model that will hold the picture. + * @param string|null $htmlString The html string to parse and modify files. + * @param string|null $oldHtmlString The old html string with alreadyParsed + * files using storeModelFilesFromHtml. + * @return string|null Html with files pathes replaced using storage strategy. + */ + public static function storeModelFilesFromHtml( + Model $model, + ?string $htmlString, + ?string $oldHtmlString = null + ): ?string { + if (is_null($htmlString)) { + return null; + } + + Collection::make(self::onlyUploadedFilesWithFileManager(self::findFilesInHtml($htmlString))) + ->each(function (string $path) use ($model, &$htmlString): void { + /** @var \Illuminate\Filesystem\FilesystemAdapter */ + $disk = Storage::disk('private'); + $fileInfo = new \SplFileInfo($disk->path( + ToolboxHelper::mbReplaceSingle('/uploads/', '', \urldecode($path)) + )); + $htmlString = ToolboxHelper::mbReplaceSingle( + $path, + '/' . self::storeFile($model, $fileInfo, true), + $htmlString + ); + }); + + if ($oldHtmlString) { + self::removeOldModelFilesFromHtml($htmlString, $oldHtmlString); + } + + return $htmlString; + } + + /** + * Remove all old files from string attribute html that are stored in public that + * are nove present anymore on new html string + * + * @param string $newHtmlString The html string with alreadyParsed files using storeModelFilesFromHtml. + * @param string $oldHtmlString The old html string with alreadyParsed files using storeModelFilesFromHtml. + */ + public static function removeOldModelFilesFromHtml(string $newHtmlString, string $oldHtmlString): void + { + self::removeOldFiles(self::findFilesInHtml($oldHtmlString), self::findFilesInHtml($newHtmlString)); + } + + /** + * Remove all old files that are stored in public that + * are not present anymore on new array files + * + * @param string[] $oldFiles The old array files. + * @param string[] $newFiles The new array files. + */ + public static function removeOldFiles(array $oldFiles, array $newFiles): void + { + $oldFiles = Collection::make(self::onlyUploadedFilesWithFileStorageHelper($oldFiles)); + $filesToKeep = Collection::make(self::onlyUploadedFilesWithFileStorageHelper($newFiles)); + $filesToRemove = $oldFiles->diff($filesToKeep); + $filesToRemove->each(function (string $publicStorageFilePath): void { + $path = Str::replace(self::STORAGE_PREFIX, '', \ltrim(\urldecode($publicStorageFilePath), '/')); + if (Storage::disk('public')->exists($path)) { + Storage::disk('public')->delete($path); + } + }); + } + + /** + * Remove all files from string attribute html that are stored in public + * + * @param string $htmlString The html string with alreadyParsed files using storeModelFilesFromHtml. + */ + public static function removeModelFilesOfHtml(string $htmlString): void + { + $filesToRemove = Collection::make(self::onlyUploadedFilesWithFileStorageHelper(self::findFilesInHtml($htmlString))); + $filesToRemove->each(function (string $publicStorageFilePath): void { + $path = Str::replace(self::STORAGE_PREFIX, '', \ltrim(\urldecode($publicStorageFilePath), '/')); + if (Storage::disk('public')->exists($path)) { + Storage::disk('public')->delete($path); + } + }); + } + + /** + * Find all occurence of files in html + * + * @param string $html The html string to parse and find files. + * @return string[] The array of files found in html. + */ + public static function findFilesInHtml(string $html): array + { + preg_match_all( + '/(?:href|src|url)="([^"]*)"/Ui', + $html, + $matches + ); + + return Collection::make($matches[1])->unique()->filter()->values()->all(); + } + + /** + * Filter array to get only uploaded files that exists + * on disk 'public' (using helper storage strategy) + * + * @param string[] $urls The array of urls to filter + * @return string[] The filtered array with only uploaded files that exists on disk 'public + */ + public static function onlyUploadedFilesWithFileStorageHelper(array $urls): array + { + return Collection::make($urls)->unique() + // * Filter to get only /uploads and using app url or empty + ->filter(function (string $url) { + $path = (string) (\parse_url($url, \PHP_URL_PATH) ?? ''); + + return str_starts_with(\ltrim($path, '/'), 'storage/modelfiles'); + })->filter(function (string $url) { + $path = (string) (\parse_url($url, \PHP_URL_PATH) ?? ''); + + return Storage::disk('public') + ->exists(Str::replace(self::STORAGE_PREFIX, '', \ltrim(\urldecode($path), '/'))); + })->all(); + } + + /** + * Filter array to get only uploaded files that exist on disk 'private' + * + * @param string[] $urls The array of urls to filter + * @return string[] The filtered array + */ + private static function onlyUploadedFilesWithFileManager(array $urls): array + { + $appUrl = Config::string('app.url'); + + if (empty($appUrl)) { + throw new \UnexpectedValueException('App URL must be set in config to filter uploaded files with file manager'); + } + $appHost = parse_url((string) $appUrl, PHP_URL_HOST); + + return Collection::make($urls)->unique()->filter(function (string $url) use ($appHost) { + $host = parse_url($url, PHP_URL_HOST); + + // 1. Validation du domaine (Doit être identique à l'app ou être un chemin relatif) + if ($host !== null && $host !== $appHost) { + return false; + } + + // 2. Extraction et nettoyage du chemin + $path = ltrim(urldecode((string) parse_url($url, PHP_URL_PATH)), '/'); + + // 3. Vérification du préfixe 'uploads/' et existence sur le disque + if (! str_starts_with($path, 'uploads/')) { + return false; + } + + // On retire 'uploads/' pour tester l'existence sur le disque 'private' + $diskPath = substr($path, strlen('uploads/')); + + return Storage::disk('private')->exists($diskPath); + })->values()->all(); + } + + /** + * Prepare storage path and return + * the file full path + * + * @param string $tableName Model table name. + * @param string $filename The basename for the file. + * @param bool $private May the file be stored in a private dir. + */ + private static function prepareMoveFile(string $tableName, string $filename, bool $private = false): string + { + // * Security filter + $filename = \htmlspecialchars($filename); + // * Security filter + beautifier + $filename = self::sanitizeFileName($filename); + // * Slugify filename + $ext = \pathinfo($filename, \PATHINFO_EXTENSION); + $filename = Str::slug(\pathinfo($filename, \PATHINFO_FILENAME)) . + (\strlen($ext) ? ".{$ext}" : ''); + + $folderPath = self::getStoragePath( + $private ? 'app/private/modelfiles' : 'app/public/modelfiles', + $tableName, + $filename + ); + $filename = self::getFileUniqueName($folderPath, $filename); + + return "{$folderPath}/{$filename}"; + } + + /** + * Create sub folders to store files using pattern + * storage/modelfiles/posts/10/04/19/5f + * year/month/day/sha256 first 2 letters + */ + private static function getStoragePath(string $storage_dir, string $table, string $filename): string + { + $filenameHash = \hash('sha256', $filename); + $pathFolder = \storage_path(sprintf( + '%s/%s/%s/%s/%s/%s', + $storage_dir, + $table, + gmdate('y'), + gmdate('m'), + gmdate('d'), + substr($filenameHash, 0, 2) + )); + if (! File::exists($pathFolder)) { + File::makeDirectory($pathFolder, 0755, true); + } + + return $pathFolder; + } + + /** + * Get unique filename if the path is already occupied + * + * @throws FileStorageOperationException If a unique filename cannot be obtained. + */ + private static function getFileUniqueName(string $folderPath, string $filename): string + { + $attempts = 0; + $maxAttempts = 20; + while (File::exists("{$folderPath}/{$filename}")) { + if ($attempts++ >= $maxAttempts) { + throw FileStorageOperationException::cannotGenerateUniqueFilename($folderPath, $filename); + } + $filename = Str::of(pathinfo($filename, \PATHINFO_FILENAME)) + ->append(Str::random(8) . '-') + ->append('.') + ->append(pathinfo($filename, \PATHINFO_EXTENSION)) + ->toString(); + } + + return $filename; + } + + /** + * Slugify the filename + */ + public static function slugifyFileName(string $filename): string + { + return Str::slug(pathinfo($filename, \PATHINFO_FILENAME)) . '.' . pathinfo($filename, \PATHINFO_EXTENSION); + } + + /** + * Sanitize File name for uploaded files + * + * @param string $filename The original uploaded client file name. + * @param bool $beautify Beautify the filename. + * @return string The sanitized file name. + */ + public static function sanitizeFileName(string $filename, bool $beautify = true): string + { + $filename = preg_replace('/[<>:"\/\\|?*\x00-\x1F\x7F\xA0\xAD#\[\]@!$&\'()+,;={}^~`]/u', '-', $filename) ?? $filename; + // * Avoids '.' '..' or '.hiddenFiles' . + $filename = (string) Str::of($filename)->ltrim('.-'); + // * Optional beautification + if ($beautify) { + $filename = self::beautifyFilename($filename); + } + // * Maximize filename length to 255 bytes http://serverfault.com/a/9548/44086 + /** @var string */ + $extension = pathinfo($filename, \PATHINFO_EXTENSION); + /** @var string */ + $filename = pathinfo($filename, \PATHINFO_FILENAME); + + $encoding = mb_detect_encoding($filename); + $encoding = $encoding ?: null; + + return \mb_strcut( + $filename, + 0, + 255 - (! empty($extension) ? strlen($extension) + 1 : 0), + $encoding + ) . (! empty($extension) ? ".$extension" : ''); + } + + /** + * Beautify a filename + */ + private static function beautifyFilename(string $filename): string + { + // Reduce consecutive characters. + $filename = preg_replace([ + // * "file name.zip" becomes 'file-name.zip' + '/ +/', + // * "file___name.zip" becomes 'file-name.zip' + '/_+/', + // * "file---name.zip" becomes 'file-name.zip' + '/-+/', + ], '-', $filename) ?? $filename; + $filename = preg_replace([ + // * "file--.--.-.--name.zip" becomes "file.name.zip" + '/-*\.-*/', + // * "file...name..zip" becomes "file.name.zip" + '/\.{2,}/', + ], '.', $filename) ?? $filename; + // Lowercase for windows/unix interoperability http://support.microsoft.com/kb/100625 . + $encoding = mb_detect_encoding($filename); + $filename = mb_strtolower($filename, $encoding ?: 'UTF-8'); + // * ".file-name.-" becomes "file-name" + $filename = trim($filename, '.-'); + + return $filename; + } + + /** + * Remove all model files for the given Model. + */ + public static function removeModelFiles(Model $model): void + { + $tableName = $model::query()->getModel()->getTable(); + + if (! empty(Storage::disk('public')->allFiles("modelfiles/{$tableName}"))) { + Storage::disk('public')->deleteDirectory("modelfiles/{$tableName}"); + } + if (! empty(Storage::disk('private')->allFiles("modelfiles/{$tableName}"))) { + Storage::disk('private')->deleteDirectory("modelfiles/{$tableName}"); + } + } + + public static function isMimeType(string $mimeType, \SplFileInfo $file): bool + { + if (! $file->getRealPath()) { + return false; + } + + $actualMime = File::mimeType($file->getRealPath()); + + return $actualMime ? Str::is($mimeType, $actualMime) : false; + } +} diff --git a/app/Lib/Helpers/MoneyHelper.php b/app/Lib/Helpers/MoneyHelper.php new file mode 100644 index 00000000..17b1bbe3 --- /dev/null +++ b/app/Lib/Helpers/MoneyHelper.php @@ -0,0 +1,40 @@ +formatCurrency( + $amount->getAmount() / 100, + $amount->getCurrency()->getCode() + ) ?: $amount->getAmount() / 100 . ' ' . $amount->getCurrency()->getCode(); + } + + /** @return array{amount:string,currency:string,formatted:string}|null */ + public static function serialized( + ?Money $amount, + ): ?array { + if ($amount === null) { + return null; + } + + return [ + 'amount' => $amount->getAmount(), + 'currency' => $amount->getCurrency()->getCode(), + 'formatted' => self::formatted($amount), + ]; + } +} diff --git a/app/Lib/Helpers/RequestHelper.php b/app/Lib/Helpers/RequestHelper.php new file mode 100644 index 00000000..ea16c636 --- /dev/null +++ b/app/Lib/Helpers/RequestHelper.php @@ -0,0 +1,49 @@ +has('offset') || $request->has('limit')) { + return Pagination::ofOffsetAndLimit( + $request->integer('offset', 0), + $request->integer('limit', $defaultPageSize) + ); + } + + $pageSize = $request->integer( + 'pageSize', + $request->integer('per_page', $request->integer('pagination', $defaultPageSize)) + ); + + return Pagination::ofPage( + new PageNumber($request->integer('page', 1)), + new PageSize($pageSize) + ); + } + + public static function toUri(HttpRequest $request): Uri + { + return new Uri($request->url()); + } + + public static function toFullUri(HttpRequest $request): Uri + { + return new Uri($request->fullUrl()); + } +} diff --git a/app/Lib/Helpers/StatsHelper.php b/app/Lib/Helpers/StatsHelper.php deleted file mode 100644 index ddc7083e..00000000 --- a/app/Lib/Helpers/StatsHelper.php +++ /dev/null @@ -1,421 +0,0 @@ -getDefinition())), $start, $end); - $current = self::{sprintf('get%s', ucfirst($type->getDefinition()))}($start, $end); - - $stats[$type->value] = [ - 'previous' => $previous, - 'current' => $current, - 'diff' => $current - $previous, - ]; - } - return $stats; - } - - /** - * getPrevious - * - * @param string $method - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getPrevious(string $method, Carbon $start, Carbon $end) - { - $previousDates = self::getPreviousPeriod($start, $end); - return self::{$method}($previousDates->start, $previousDates->end); - } - - /** - * getDiff - * - * @param string $method - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return integer|float - */ - private function getDiff(string $method, Carbon $start, Carbon $end) - { - return self::{$method}($start, $end) - self::getPrevious($method, $start, $end); - } - - /** - * Get all validated orders. - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getNbSalarie(Carbon $start, Carbon $end) - { - return Salarie::query() - ->whereDate('created_at', '>=', $start) - ->whereDate('created_at', '<=', $end) - ->count(); - } - - /** - * Get all validated orders. - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getNbSalarieWithAccount(Carbon $start, Carbon $end) - { - return self::getNumberSalaries($start, $end); - } - - /** - * Get the percentage of registered people / people with a generated code - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return integer - */ - public static function getNumberCustomers(Carbon $start, Carbon $end): int - { - return Customers::query() - ->whereDate('created_at', '>=', $start) - ->whereDate('created_at', '<=', $end) - ->count(); - } - - /** - * Get the percentage of registered people / people with a generated code - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return integer - */ - public static function getNumberSalaries(Carbon $start, Carbon $end): int - { - return Customers::query() - ->has('salarie') - ->whereDate('created_at', '>=', $start) - ->whereDate('created_at', '<=', $end) - ->count(); - } - - /** - * Get the percentage of registered people / people with a generated code - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return integer|float - */ - public static function getMembershipRate(Carbon $start, Carbon $end): int - { - $registered = self::getNumberSalaries($start, $end); - $employee = Salarie::query() - ->whereDate('created_at', '>=', $start) - ->whereDate('created_at', '<=', $end) - ->count(); - - return $employee ? round($registered / $employee * 100, 2) : 0; - } - - /** - * Get all validated orders. - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getValidatedOrders(Carbon $start, Carbon $end) - { - return Order::whereHas('status', function (Builder $query) { - $query->whereIn('id', [3, 4, 5, 6]); - })->whereBetween('date', [$start->toDateString(), $end->toDateString()])->get(); - } - - /** - * Get the number of validated command. - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getNbValidateCmd(Carbon $start, Carbon $end) - { - return self::getValidatedOrders($start, $end)->count(); - } - - /** - * Get the number of waiting command. - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getNbWaitingCmd(Carbon $start, Carbon $end) - { - return Order::whereHas('status', function (Builder $query) { - $query->where('id', 1); - })->whereBetween('date', [$start->toDateString(), $end->toDateString()])->count(); - } - - /** - * Get the number of canceled command. - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getNbCanceledCmd(Carbon $start, Carbon $end) - { - return Order::whereHas('status', function (Builder $query) { - $query->where('id', 7); - })->whereBetween('date', [$start->toDateString(), $end->toDateString()])->count(); - } - - /** - * Get the canceled command rate. - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getCanceledRate(Carbon $start, Carbon $end) - { - $nbWaitingCmd = self::getNbWaitingCmd($start, $end); - $nbCanceledCmd = self::getNbCanceledCmd($start, $end); - $nbValidateCmd = self::getNbValidateCmd($start, $end); - - // Prevent division by 0. - if (($nbValidateCmd + $nbWaitingCmd + $nbCanceledCmd) !== 0) { - return round( - (($nbWaitingCmd + $nbCanceledCmd) / ($nbValidateCmd + $nbWaitingCmd + $nbCanceledCmd)) * 100, - 2 - ); - } else { - return 0; - } - } - - /** - * Get the order frequency. - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getOrderFrequency(Carbon $start, Carbon $end) - { - $nbValidateCmd = self::getNbValidateCmd($start, $end); - $period = (new CarbonPeriod($start, $end))->count(); - return round($nbValidateCmd / $period, 2); - } - - /** - * Get the order frequency. - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getPurchaseFrequency(Carbon $start, Carbon $end) - { - $activeClients = self::getNbActiveClients($start, $end); - if (!$activeClients) { - return 0; - } - $nbValidateCmd = self::getNbValidateCmd($start, $end); - return round($nbValidateCmd / $activeClients, 2); - } - - /** - * Get the number of active clients (ordered in the period). - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getNbActiveClients(Carbon $start, Carbon $end) - { - return Customers::whereHas('orders', function (Builder $query) use ($start, $end) { - $query->whereBetween('date', [$start->toDateString(), $end->toDateString()]); - })->count(); - } - - /** - * Get the number command where the collect day is 7 days after the order. - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getNbCmdWith7DayDelay(Carbon $start, Carbon $end) - { - return Order::with('timeslot')->whereHas('status', function (Builder $query) { - $query->whereIn('id', [3, 4, 5, 6]); - })->whereBetween('date', [$start, $end])->get()->filter(function (Order $order) { - return Carbon::create($order->timeslot->day) - ->lessThanOrEqualTo(Carbon::create($order->date)->modify('+7 day')); - })->count(); - } - - /** - * Get the number command where the collect day is 14 days after the order. - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getNbCmdWith14DayDelay(Carbon $start, Carbon $end) - { - return Order::with('timeslot')->whereHas('status', function (Builder $query) { - $query->whereIn('id', [3, 4, 5, 6]); - })->whereBetween('date', [$start, $end])->get()->filter(function (Order $order) { - return Carbon::create($order->timeslot->day)->betweenIncluded( - Carbon::create($order->date)->modify('+8 day'), - Carbon::create($order->date)->modify('+14 day') - ); - })->count(); - } - - /** - * Get the CA HT. - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getCaHt(Carbon $start, Carbon $end) - { - $orderedProducts = OrderLine::whereHas('order', function (Builder $query) use ($start, $end) { - $query->whereHas('status', function (Builder $query) { - $query->whereIn('id', [3, 4, 5, 6]); - })->whereBetween('date', [$start->toDateString(), $end->toDateString()]); - })->get(); - - $totalCaHt = 0; - $orderedProducts->map(function ($item) use (&$totalCaHt) { - $totalCaHt += $item->total_ht; - }); - - return $totalCaHt; - } - - /** - * Get the CA TTC. - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getCaTtc(Carbon $start, Carbon $end) - { - $orderedProducts = OrderLine::whereHas('order', function (Builder $query) use ($start, $end) { - $query->whereHas('status', function (Builder $query) { - $query->whereIn('id', [3, 4, 5, 6]); - })->whereBetween('date', [$start->toDateString(), $end->toDateString()]); - })->get(); - - $totalCaTtc = 0; - $orderedProducts->map(function ($item) use (&$totalCaTtc) { - $totalCaTtc += $item->total_ttc; - }); - - return $totalCaTtc; - } - - - /** - * Get the average basket HT. - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getAverageBasketHt(Carbon $start, Carbon $end) - { - // Prevent division by 0. - if (self::getNbValidateCmd($start, $end) !== 0) { - return round(self::getCaHt($start, $end) / self::getNbValidateCmd($start, $end), 2); - } else { - return 0; - } - } - - /** - * Get the average product count per order. - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return mixed - */ - private function getAverageProductCountPerOrder(Carbon $start, Carbon $end) - { - $nbValidateCmd = self::getNbValidateCmd($start, $end); - - // Prevent division by 0. - if ($nbValidateCmd !== 0) { - $orderedProducts = OrderLine::whereHas('order', function (Builder $query) use ($start, $end) { - $query->whereHas('status', function (Builder $query) { - $query->where('id', 3); - })->whereBetween('date', [$start->toDateString(), $end->toDateString()]); - })->get(); - - $totalQty = 0; - $orderedProducts->map(function ($item) use (&$totalQty) { - $totalQty += $item->quantity; - }); - return round($totalQty / $nbValidateCmd, 2); - } else { - return 0; - } - } - - /** - * Get the previous period of the selected date. - * - * @param \Carbon\Carbon $start - * @param \Carbon\Carbon $end - * @return \Carbon\Carbon[$previousStart, $previousEnd] - */ - public static function getPreviousPeriod(Carbon $start, Carbon $end) - { - $diffDays = $start->copy()->diffInDays($end); - return (object)[ - 'start' => $start->copy()->subDays($diffDays + 1), - 'end' => $start->copy()->subDay() - ]; - } - - /** - * Get the percentage of registered people / people with a generated code - * - * @return integer|float - */ - public static function getMembershipPercentage() - { - $employee = Salarie::count(); - $registered = Customers::has('salarie')->count(); - return round($registered / $employee * 100, 2); - } -} diff --git a/app/Lib/Helpers/StringEncoder.php b/app/Lib/Helpers/StringEncoder.php new file mode 100644 index 00000000..34e22a5e --- /dev/null +++ b/app/Lib/Helpers/StringEncoder.php @@ -0,0 +1,320 @@ + + */ + private const array CANONICAL_ENCODINGS = [ + 'UTF-8', + 'Windows-1252', + 'ISO-8859-15', + ]; + + /** + * Lowercase alias -> canonical name. + * + * Windows-1252 absorbs ISO-8859-1/Latin-1 because it is a strict superset: + * bytes 0xA0-0xFF are identical, and 0x80-0x9F are defined in Win-1252 + * but undefined (and useless) in ISO-8859-1. + * + * @var array + */ + private const array ENCODING_ALIASES = [ + // UTF-8 + 'utf8' => 'UTF-8', + 'utf-8' => 'UTF-8', + + // Windows-1252 (absorbs Latin-1 / ISO-8859-1) + 'win1252' => 'Windows-1252', + 'windows1252' => 'Windows-1252', + 'cp1252' => 'Windows-1252', + 'latin1' => 'Windows-1252', + 'latin-1' => 'Windows-1252', + 'iso-8859-1' => 'Windows-1252', + + // ISO-8859-15 (Latin-9) + 'latin9' => 'ISO-8859-15', + 'latin-9' => 'ISO-8859-15', + 'iso-8859-15' => 'ISO-8859-15', + ]; + + /** + * Windows-1252 specific codepoints (0x80-0x9F) absent from ISO-8859-1. + * + * Bytes 0x81, 0x8D, 0x8F, 0x90, 0x9D are officially undefined in Windows-1252. + * They are intentionally absent - encountering them triggers the + * Latin-1 fallback (Unicode codepoint = byte value). + * + * @var array Byte value -> UTF-8 character. + */ + private const array WIN1252_SPECIAL_BYTES = [ + 0x80 => "\u{20AC}", // € + 0x82 => "\u{201A}", // ‚ + 0x83 => "\u{0192}", // ƒ + 0x84 => "\u{201E}", // „ + 0x85 => "\u{2026}", // … + 0x86 => "\u{2020}", // † + 0x87 => "\u{2021}", // ‡ + 0x88 => "\u{02C6}", // ˆ + 0x89 => "\u{2030}", // ‰ + 0x8A => "\u{0160}", // Š + 0x8B => "\u{2039}", // ‹ + 0x8C => "\u{0152}", // Œ + 0x8E => "\u{017D}", // Ž + 0x91 => "\u{2018}", // ' + 0x92 => "\u{2019}", // ' + 0x93 => "\u{201C}", // " + 0x94 => "\u{201D}", // " + 0x95 => "\u{2022}", // • + 0x96 => "\u{2013}", // – + 0x97 => "\u{2014}", // — + 0x98 => "\u{02DC}", // ˜ + 0x99 => "\u{2122}", // ™ + 0x9A => "\u{0161}", // š + 0x9B => "\u{203A}", // › + 0x9C => "\u{0153}", // œ + 0x9E => "\u{017E}", // ž + 0x9F => "\u{0178}", // Ÿ + ]; + + /** + * ISO-8859-15 bytes that differ from ISO-8859-1. + * Only 8 codepoints differ between Latin-1 and Latin-9. + * + * @var array Byte value -> UTF-8 character. + */ + private const array LATIN9_OVERRIDES = [ + 0xA4 => "\u{20AC}", // € (replaces ¤) + 0xA6 => "\u{0160}", // Š (replaces ¦) + 0xA8 => "\u{0161}", // š (replaces ¨) + 0xB4 => "\u{017D}", // Ž (replaces ´) + 0xB8 => "\u{017E}", // ž (replaces ¸) + 0xBC => "\u{0152}", // Œ (replaces ¼) + 0xBD => "\u{0153}", // œ (replaces ½) + 0xBE => "\u{0178}", // Ÿ (replaces ¾) + ]; + + /** + * Converts a string from a known encoding to UTF-8. + * + * @param bool $stripBom Remove UTF-8 BOM from the result if present. + * + * @throws \ValueError If encoding is unsupported or the string is invalid. + */ + public static function toUtf8( + string $string, + string $sourceEncoding, + bool $stripBom = true, + ): string { + if ($string === '') { + return ''; + } + + $canonical = self::resolveEncoding($sourceEncoding); + + $result = match ($canonical) { + 'UTF-8' => self::ensureValidUtf8($string), + 'Windows-1252' => self::fromSingleByte($string, self::WIN1252_SPECIAL_BYTES), + 'ISO-8859-15' => self::fromSingleByte($string, self::LATIN9_OVERRIDES), + default => throw new \ValueError(sprintf( + 'Unsupported encoding "%s". Supported: %s', + $canonical, + implode(', ', self::supportedEncodings()), + )) + }; + + return $stripBom ? self::stripUtf8Bom($result) : $result; + } + + /** + * Attempts to detect the encoding and convert to UTF-8. + * + * Detection strategy: + * 1. If the string is valid UTF-8, it is treated as UTF-8. + * 2. Otherwise, the configured fallback encoding is used. + * + * This two-step approach is more reliable than mb_detect_encoding + * for single-byte encodings (which accept any byte sequence). + * + * @param string $fallbackEncoding Encoding to assume when the string is not valid UTF-8. + * Defaults to 'Windows-1252' (covers most Western European legacy data). + * @param bool $stripBom Remove UTF-8 BOM from the result if present. + * + * @throws \ValueError If fallbackEncoding is unsupported or is 'UTF-8'. + */ + public static function detectAndConvertToUtf8( + string $string, + string $fallbackEncoding = 'Windows-1252', + bool $stripBom = true, + ): string { + if ($string === '') { + return ''; + } + + $canonical = self::resolveEncoding($fallbackEncoding); + + throw_if($canonical === 'UTF-8', \ValueError::class, 'Fallback encoding cannot be UTF-8. Use toUtf8() for explicit UTF-8 validation.'); + + // UTF-8 is the only encoding we can reliably detect: + // it has strict byte sequence rules that reject invalid sequences. + if (mb_check_encoding($string, 'UTF-8')) { + $result = $string; + } else { + $result = self::toUtf8($string, $canonical, stripBom: false); + } + + return $stripBom ? self::stripUtf8Bom($result) : $result; + } + + /** + * Converts an array of strings to UTF-8 from a known encoding. + * + * @param list $strings + * @return list + */ + public static function arrayToUtf8( + array $strings, + string $sourceEncoding, + bool $stripBom = true, + ): array { + return array_map( + static fn (string $s): string => self::toUtf8($s, $sourceEncoding, $stripBom), + $strings, + ); + } + + /** + * Returns all supported encoding names (canonical + aliases). + * + * @return list + */ + public static function supportedEncodings(): array + { + return array_values(array_unique([ + ...self::CANONICAL_ENCODINGS, + ...array_keys(self::ENCODING_ALIASES), + ])); + } + + /** + * Resolves a user-supplied encoding name to its canonical form. + * + * @throws \ValueError If encoding is unknown. + */ + private static function resolveEncoding(string $encoding): string + { + $normalized = strtolower(trim($encoding)); + + if (isset(self::ENCODING_ALIASES[$normalized])) { + return self::ENCODING_ALIASES[$normalized]; + } + + $match = array_find( + self::CANONICAL_ENCODINGS, + static fn (string $canonical): bool => strtolower($canonical) === $normalized, + ); + + if ($match !== null) { + return $match; + } + + throw new \ValueError(sprintf( + 'Unsupported encoding "%s". Supported: %s', + $encoding, + implode(', ', self::supportedEncodings()), + )); + } + + /** + * Validates that a string is well-formed UTF-8. + * + * @throws \ValueError If the string contains invalid UTF-8 sequences. + */ + private static function ensureValidUtf8(string $string): string + { + throw_unless(mb_check_encoding($string, 'UTF-8'), \ValueError::class, 'String is not valid UTF-8.'); + + return $string; + } + + /** + * Converts a single-byte encoded string to UTF-8. + * + * All supported single-byte encodings share the same base: + * - 0x00-0x7F: ASCII (identity) + * - 0x80-0xFF: Encoding-specific - use overrides map first, then Latin-1 identity. + * + * @param array $overrides Byte -> UTF-8 mapping for encoding-specific codepoints. + * For Windows-1252: the 0x80-0x9F special range. + * For ISO-8859-15: the 8 bytes that differ from Latin-1. + */ + private static function fromSingleByte(string $string, array $overrides): string + { + /** @var array $bytes keyed from 1 (unpack behavior) */ + $bytes = unpack('C*', $string); + $parts = []; + + foreach ($bytes as $byte) { + $parts[] = match (true) { + // @phpstan-ignore argument.type (ASCII range check) + $byte <= 0x7F => chr($byte), + isset($overrides[$byte]) => $overrides[$byte], + default => self::encodeLatin1ByteAsUtf8($byte), + }; + } + + return implode('', $parts); + } + + /** + * Encodes a single byte (0x80-0xFF) as a two-byte UTF-8 sequence. + * + * For Latin-1 / ISO-8859-1, the Unicode codepoint equals the byte value, + * so the UTF-8 encoding is: 110xxxxx 10xxxxxx. + * + * @throws \ValueError If the byte is outside the expected range. + */ + private static function encodeLatin1ByteAsUtf8(int $byte): string + { + if ($byte < 0x80 || $byte > 0xFF) { + throw new \ValueError( + sprintf('Byte must be in range 0x80-0xFF, got 0x%02X.', $byte), + ); + } + + return chr(0xC0 | ($byte >> 6)) . chr(0x80 | ($byte & 0x3F)); + } + + /** + * Strips the UTF-8 BOM (EF BB BF) if present at the start of the string. + */ + private static function stripUtf8Bom(string $string): string + { + if (str_starts_with($string, self::UTF8_BOM)) { + return substr($string, 3); + } + + return $string; + } +} diff --git a/app/Lib/Helpers/ToolboxHelper.php b/app/Lib/Helpers/ToolboxHelper.php new file mode 100644 index 00000000..85a3a1f1 --- /dev/null +++ b/app/Lib/Helpers/ToolboxHelper.php @@ -0,0 +1,447 @@ + $array1 + * @param array $array2 + * @return array + */ + public static function arrayMergeRecursiveDistinct(array &$array1, array &$array2): array + { + $merged = $array1; + foreach ($array2 as $key => &$value) { + if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) { + $merged[$key] = self::arrayMergeRecursiveDistinct($merged[$key], $value); + } else { + $merged[$key] = $value; + } + } + + return $merged; + } + + /** + * Strip scheme (https) on oembed urls + * Only embed allowed are for MP4 self hosted videos right now + * + * https is force by ckeditor MediaElements which natively supports + * only cloud hosted medias (youtube, spotify etc..) + */ + public static function stripCkEditorSchemesOnMediaInputs(string $input): string + { + return Str::of($input) + ->replaceMatches('/(?<=)/m', '') + ->toString(); + } + + /** + * Asserts that the field is unique. + * + * @param array|string|int|float|bool|null $value + * + * @throws \Illuminate\Validation\ValidationException If the field is not unique. + */ + public static function assertFieldIsUnique( + string $table, + string $field, + string | int | float | bool | null | array $value, + null | int | string $id = null, + \Closure | string | null $query = null + ): void { + if (! $query) { + Validator::make([$field => $value], [ + (string) str_replace('.', '\.', $field) => Rule::unique($table, $field)->ignore($id), + ], [ + (string) str_replace('.', '\.', "{$field}.unique") => trans( + 'crud.libs.toolbox.assertFieldIsUnique', + ['attribute' => $field, 'value' => is_array($value) ? json_encode($value) : $value] + ), + ])->validate(); + + return; + } + Validator::make([$field => $value], [ + $field => Rule::unique($table)->where($query)->ignore($id), + ], [ + $field . '.unique' => trans( + 'crud.libs.toolbox.assertFieldIsUnique', + ['attribute' => $field, 'value' => is_array($value) ? json_encode($value) : $value] + ), + ])->validate(); + } + + /** + * Assert That no Back Office url is present on txt + * + * @throws \Illuminate\Validation\ValidationException If url is a bo url. + */ + public static function assertNoInternalBoUrls(string $field, string $text): string + { + $routes = Route::getRoutes(); + + return self::replaceUrlsInText($text, function (string $url) use ($routes, $field): void { + $request = Request::create($url); + if (! self::isInternalHost($url)) { + return; + } + + if (trim($routes->match($request)->getPrefix() ?? '', '/') === 'bo') { + throw ValidationException::withMessages([ + $field => trans( + 'crud.libs.toolbox.assertNoInternalBoUrls', + ['attribute' => $field] + ), + ]); + } + }); + } + + /** + * Assert That only external url is present on txt + * + * @throws \Illuminate\Validation\ValidationException If url is a bo url. + */ + public static function assertNoInternalUrls(string $field, string $text): string + { + self::assertNoInternalBoUrls($field, $text); + $routes = Route::getRoutes(); + + return self::replaceUrlsInText($text, function (string $url) use ($routes, $field): void { + $request = Request::create($url); + $routes->match($request); + + if (! self::isInternalHost($url)) { + return; + } + + throw ValidationException::withMessages([ + $field => trans( + 'crud.libs.toolbox.assertNoInternalUrls', + ['attribute' => $field, 'appname' => Config::string('app.name')] + ), + ]); + }); + } + + private static function isInternalHost(string $url): bool + { + return \parse_url((string) Config::string('app.url'), \PHP_URL_HOST) === \parse_url($url, \PHP_URL_HOST); + } + + private static function replaceUrlsInText(string $text, callable $onMatchedUrl): string + { + $result = preg_replace_callback( + // phpcs:ignore Generic.Files.LineLength.TooLong + '/(?P(?:https?:\/\/)?(?:www\.)?[-a-zA-Z0-9@%._+~#=]{2,256}\.[a-z]{2,6}\b[-a-zA-Z0-9@:%_.+~#?&\/=]*)/', + function (array $matches) use ($onMatchedUrl): string { + $match = collect($matches)->first() ?? ''; + $url = (string) $match; + + try { + $onMatchedUrl($url); + } catch (NotFoundHttpException) { + return (string) $match; + } + + return (string) $match; + }, + $text + ); + + return is_string($result) ? $result : $text; + } + + /** + * Get original polyfill with autotranslate behavior + */ + public static function getOriginal(Model $model, string $attribute): mixed + { + + // @phpstan-ignore method.notFound (\Spatie\Translatable\HasTranslations could be absent) + if (\in_array('Spatie\Translatable\HasTranslations', \class_uses_recursive($model)) && $model->isTranslatableAttribute($attribute)) { + // @phpstan-ignore method.notFound (\Spatie\Translatable\HasTranslations could be absent) + return $model->getTranslation( + $attribute, + // @phpstan-ignore method.notFound (\Spatie\Translatable\HasTranslations could be absent) + $model->getLocale(), + // @phpstan-ignore method.notFound (\Spatie\Translatable\HasTranslations could be absent) + $model->useFallbackLocale() + ); + } + + return $model->getOriginal($attribute); + } + + /** + * Dynamic model query + */ + public static function queryColumnWithLocales( + string $defaultLocale, + Builder $q, + string $column, + string $value + ): Builder { + $columnRegex = '/^[A-Za-z0-9_.]+$/'; + $localeRegex = '/^[A-Za-z0-9_-]+$/'; + + throw_unless(preg_match($columnRegex, $column), \InvalidArgumentException::class, 'Invalid column identifier.'); + + throw_unless(preg_match($localeRegex, $defaultLocale), \InvalidArgumentException::class, 'Invalid locale identifier.'); + + $currentLocale = app()->currentLocale(); + throw_unless(preg_match($localeRegex, $currentLocale), \InvalidArgumentException::class, 'Invalid locale identifier.'); + + /** @var array $locales */ + $locales = Config::array('app.locales', []); + $locales = Collection::make($locales) + ->filter(fn (string $locale) => (bool) preg_match($localeRegex, $locale)) + ->mapWithKeys(fn (string $locale) => [$locale => $locale]); + + if (! $locales->has($defaultLocale)) { + // * Remove default locale. + $locales->pull($defaultLocale); + } + if (! $locales->has($currentLocale)) { + // * Remove current locale. + $locales->pull($currentLocale); + } + + return $q->where(function (Builder $q) use ($defaultLocale, $currentLocale, $locales, $column, $value): void { + // * Query default locale + $q->where("{$column}->{$defaultLocale}", $value); + if ($defaultLocale !== $currentLocale) { + // * Query current locale + $q->orWhere("{$column}->{$currentLocale}", $value); + } + // * Query any other locale + $locales->each(fn (string $locale) => $q->orWhere( + "{$column}->{$locale}", + $value + )); + }); + } + + /** + * Generates an array from a dot separated string + * + * @param string $path The dot separated string to convert to an array. + * @param mixed $value The value to set at the end of the array. + * @param string $separator The separator used in the path (default is '.'). + * @return array The generated array. + */ + public static function dotStringToNestedArray(string $path, mixed $value, string $separator = '.'): array + { + throw_if($separator === '', \InvalidArgumentException::class, 'Separator cannot be an empty string.'); + + $arr = $value; + $keys = explode($separator, $path); + $keys = array_reverse($keys); + + foreach ($keys as $key) { + $arr = [$key => $arr]; + } + + return $arr; + } + + /** + * Validate picture + * + * @param callable(string):void $fail A callback that should be called if the validation fails. + * @param object{ + * minWidth: int, + * maxWidth: int, + * minHeight: int, + * maxHeight: int + * }&\stdClass $sizes An object containing the minimum and maximum width and height for the picture. + * + * @throws \Illuminate\Validation\ValidationException If the picture is invalid. + */ + public static function validatePicture(string $attribute, ?string $value, callable $fail, object $sizes): void + { + if ($value === null) { + return; + } + + if (! ($useStorage = Storage::exists($value)) && ! File::exists($value)) { + $fail(trans('validation.custom.has_picture.file_does_not_exist', [ + 'attribute' => $attribute, + ])); + + return; + } + $fileFullPath = self::getUploadedFileFullPath($value, $useStorage); + if ( + ! \in_array(self::getUploadedFileMimeType($value, $useStorage), [ + 'image/jpeg', + 'image/jpg', + 'image/png', + 'image/gif', + ]) + ) { + $fail(trans('validation.mimetypes', [ + 'attribute' => $attribute, + 'values' => 'image/jpeg, image/jpg, image/png, image/gif', + ])); + } + if (! ($dimensions = \getimagesize($fileFullPath))) { + $fail(trans('validation.dimensions', [ + 'attribute' => $attribute, + ])); + + return; + } + + $width = intval($dimensions[0]); + $height = intval($dimensions[1]); + + $xMessage = trans('validation.custom.has_picture.width_between', [ + 'attribute' => $attribute, + 'min' => "{$sizes->minWidth}px", + 'max' => "{$sizes->maxWidth}px", + ]); + if ($sizes->minWidth === $sizes->maxWidth) { + $xMessage = trans('validation.custom.has_picture.width_equal', [ + 'attribute' => $attribute, + 'value' => "{$sizes->minWidth}px", + ]); + } + $yMessage = trans('validation.custom.has_picture.height_between', [ + 'attribute' => $attribute, + 'min' => "{$sizes->minHeight}px", + 'max' => "{$sizes->maxHeight}px", + ]); + if ($sizes->minHeight === $sizes->maxHeight) { + $yMessage = trans('validation.custom.has_picture.height_equal', [ + 'attribute' => $attribute, + 'value' => "{$sizes->minHeight}px", + ]); + } + + if (($width < $sizes->minWidth) || ($width > $sizes->maxWidth)) { + $fail($xMessage); + } + if (($height < $sizes->minHeight) || ($height > $sizes->maxHeight)) { + $fail($yMessage); + } + } + + /** + * Fetch class list from a specific namespace + * + * @return array An array of classe namespaces + */ + public static function getClassesUsingNamespace(string $namespace): array + { + return collect(File::files(\app_path((string) Str::of($namespace)->replaceFirst('\App', '')))) + ->filter(fn (SplFileInfo $splFileInfo) => $splFileInfo->getExtension() === 'php') + ->map(fn (SplFileInfo $splFileInfo) => (string) Str::of($splFileInfo->getBasename()) + ->replace('.' . $splFileInfo->getExtension(), '')->prepend("{$namespace}\\"))->all(); + } + + /** + * Get all classes from a specific namespace that implement a specific interface + * + * @return array An array of classe namespaces + */ + public static function getClassesUsingInterface(string $namespace, string $interface): array + { + return Arr::where( + static::getClassesUsingNamespace($namespace), + fn (string $class_namespace) => \collect(class_implements($class_namespace, true) ?: [])->filter() + ->contains(fn (string $class_interface) => $class_interface === $interface) + ); + } + + /** + * Convert Hex color to RGB + * + * @return int[] + */ + public static function hexToRgb(string $hexcolor): array + { + $hexcolor = (string) str($hexcolor)->replaceStart('#', ''); + $r = (int) hexdec(substr($hexcolor, 0, 2)); + $g = (int) hexdec(substr($hexcolor, 2, 2)); + $b = (int) hexdec(substr($hexcolor, 4, 2)); + + return [$r, $g, $b]; + } + + /** + * Get text color contrast for a hex background color + * + * @return string "black" or "white" + */ + public static function getContrastYiq(string $hexcolor): string + { + [$r, $g, $b] = self::hexToRgb($hexcolor); + $yiq = (($r * 299) + ($g * 587) + ($b * 114)) / 1000; + + return ($yiq >= 128) ? 'black' : 'white'; + } + + /** + * Parse a phone number and return a PhoneNumber instance + * + * @param string $phoneNumber The phone number to parse + * @param string $countryCode The country code (default is 'FR' for France) + * @return \Propaganistas\LaravelPhone\PhoneNumber|null Returns the formatted phone number or null if invalid + */ + public static function parsePhoneNumber(string $phoneNumber, string $countryCode = 'FR'): ?PhoneNumber + { + $phoneNumber = new PhoneNumber($phoneNumber, $countryCode); + if (! $phoneNumber->isValid()) { + return null; + } + + return $phoneNumber; + } + + /** + * Convert an HTML string to plain text with proper word spacing. + * + * Replaces HTML tags with spaces, strips remaining tags, + * normalises whitespace and trims the result. + * + * @param string|null $html The HTML content to convert. + * @param int|null $limit Optional character limit (uses Str::limit). + */ + public static function htmlToText(?string $html, ?int $limit = null): string + { + if ($html === null || $html === '') { + return ''; + } + + $text = strip_tags((string) preg_replace('/<[^>]*>/', ' ', $html)); + $text = trim((string) preg_replace('/\s+/', ' ', $text)); + + if ($limit !== null) { + return Str::limit($text, $limit); + } + + return $text; + } +} diff --git a/app/Lib/Helpers/ToolboxHelperCore.php b/app/Lib/Helpers/ToolboxHelperCore.php new file mode 100644 index 00000000..3e3e3d65 --- /dev/null +++ b/app/Lib/Helpers/ToolboxHelperCore.php @@ -0,0 +1,191 @@ +|string $search + * @param array|string $replace + * @param array|string $subject + * @return array|string|false + */ + public static function mbReplace( + array | string $search, + array | string $replace, + array | string $subject, + int &$count = 0, + ): array | string | false { + if (is_array($subject)) { + return self::mbReplaceInArraySubject($search, $replace, $subject, $count); + } + + return self::mbReplaceScalar($search, $replace, $subject, $count); + } + + /** + * Dispatch for scalar subject. + * Returns false when $replace is array but $search is a scalar string. + * + * @param array|string $search + * @param array|string $replace + */ + private static function mbReplaceScalar( + array | string $search, + array | string $replace, + string $subject, + int &$count = 0, + ): string | false { + if (! is_array($search) && is_array($replace)) { + return false; + } + + if (is_array($search)) { + return self::mbReplaceWithSearchArray($search, $replace, $subject, $count); + } + + if (! is_string($replace)) { + throw new \InvalidArgumentException('Replace must be a string when search is a string.'); + } + + return self::mbReplaceSingle($search, $replace, $subject, $count); + } + + /** + * @param string[]|string $search + * @param string[]|string $replace + * @param array $subject + * @return array + */ + public static function mbReplaceInArraySubject(array | string $search, array | string $replace, array $subject, int &$count = 0): array + { + foreach ($subject as &$value) { + if (is_array($value)) { + $value = self::mbReplaceInArraySubject($search, $replace, $value, $count); + } elseif (is_array($search) && is_string($value)) { + $value = self::mbReplaceWithSearchArray($search, $replace, $value, $count); + } elseif (! is_array($replace) && is_string($value)) { + $value = self::mbReplaceSingle($search, $replace, $value, $count); + } + } + unset($value); + + return $subject; + } + + /** + * @param string[] $search + * @param array|string $replace + */ + public static function mbReplaceWithSearchArray(array $search, array | string $replace, string $subject, int &$count = 0): string + { + if (! is_array($replace)) { + foreach ($search as $searchItem) { + $subject = (string) self::mbReplaceSingle($searchItem, $replace, $subject, $count); + } + + return $subject; + } + + $iterations = max(count($search), count($replace)); + $searchItem = reset($search); + $replaceItem = reset($replace); + + while ($iterations--) { + $subject = (string) self::mbReplaceSingle((string) $searchItem, (string) $replaceItem, $subject, $count); + $searchItem = next($search); + $replaceItem = next($replace); + } + + return $subject; + } + + public static function mbReplaceSingle(string $search, string $replace, string $subject, int &$count = 0): string + { + $parts = mb_split(preg_quote($search), $subject) ?: []; + $count = count($parts) - 1; + + return implode($replace, $parts); + } + + /** + * Convert deeply an object to array + * + * @return array + * + * @throws \App\Exceptions\Helpers\UnsupportedStructureConversionException If $input var is a scalar value. + */ + public static function objectToArray(mixed $input): array + { + if (! (is_object($input) || is_array($input))) { + throw UnsupportedStructureConversionException::fromType($input); + } + + $ret = (array) $input; + foreach ($ret as &$item) { + $item = (is_object($item) || is_array($item)) ? self::objectToArray($item) : $item; + } + + return $ret; + } + + /** + * Convert deeply an array to object + * + * @throws \App\Exceptions\Helpers\UnsupportedStructureConversionException If $input var is a scalar value. + */ + public static function arrayToObject(mixed $input): object + { + if (! (is_object($input) || is_array($input))) { + throw UnsupportedStructureConversionException::fromType($input); + } + + $ret = (object) $input; + $retArray = (array) $ret; + foreach ($retArray as &$item) { + $item = (is_object($item) || is_array($item)) ? self::arrayToObject($item) : $item; + } + unset($item); + + return (object) $retArray; + } + + /** + * Get the file full path + */ + protected static function getUploadedFileFullPath(string $value, bool $useStorage): string + { + /** @var \Illuminate\Filesystem\FilesystemAdapter */ + $disk = Storage::disk(); + + if ($useStorage) { + return $disk->path($value); + } + + return realpath($value) ?: $value; + } + + /** + * Get the file mimetype + * + * @return string|false + */ + protected static function getUploadedFileMimeType(string $value, bool $useStorage) + { + if ($useStorage) { + return Storage::mimeType($value); + } + + return File::mimeType($value); + } +} diff --git a/app/Lib/LDC/CartCalculator.php b/app/Lib/LDC/CartCalculator.php deleted file mode 100644 index f77b2a8b..00000000 --- a/app/Lib/LDC/CartCalculator.php +++ /dev/null @@ -1,50 +0,0 @@ -price * ($cartItem->getDiscountRate() / 100) * 100) / 100; - case 'tax': - return round($cartItem->priceTarget * ($cartItem->taxRate / 100), $decimals); - case 'priceTax': - return round($cartItem->priceTarget + $cartItem->tax, $decimals); - case 'discountTotal': - return round($cartItem->discount * $cartItem->qty, $decimals); - case 'priceTotal': - return round($cartItem->price * $cartItem->qty, $decimals); - case 'subtotal': - return max(round($cartItem->priceTotal - $cartItem->discountTotal, $decimals), 0); - case 'priceTarget': - return round(($cartItem->priceTotal - $cartItem->discountTotal) / $cartItem->qty, $decimals); - case 'taxTotal': - // Taxe pour un item multiplié par la quantité. - $unit_price = max($cartItem->price - $cartItem->discount, 0); - $unit_tax = round($unit_price * ($cartItem->taxRate / 100), $decimals); - $taxTotal = round($unit_tax * $cartItem->qty, $decimals); - return $taxTotal; - case 'total': - return round($cartItem->subtotal + $cartItem->taxTotal, $decimals); - default: - return; - }//end switch - } -} diff --git a/app/Lib/Options.php b/app/Lib/Options.php deleted file mode 100644 index b627087a..00000000 --- a/app/Lib/Options.php +++ /dev/null @@ -1,159 +0,0 @@ - The configuration options - */ - private $options; - - /** - * @var \Symfony\Component\OptionsResolver\OptionsResolver The options resolver - */ - private $resolver; - - /** - * The cache key where to store config cidr list. - * - * @var string - */ - private static $cache_config_key = 'uwil_ip_cidr_config_list'; - - /** - * Class constructor. - * - * @param array $options The configuration options. - */ - public function __construct(array $options = []) - { - $this->resolver = new OptionsResolver(); - - $this->configureOptions($this->resolver); - - $this->options = $this->resolver->resolve($options); - } - - /** - * Get cidr list - * - * @return array<\Dxw\CIDR\IPv4Range|\Dxw\CIDR\IPv6Range> - */ - public function getCidrList(): array - { - return $this->options['cidrList']; - } - - /** - * Get cidr project allowed list - * - * @return array<\Dxw\CIDR\IPv4Range|\Dxw\CIDR\IPv6Range> - */ - public function getCidrAllowedList(): array - { - return $this->options['cidrProjectAllowedList']; - } - - /** - * Configures the options of the client. - * - * @param \Symfony\Component\OptionsResolver\OptionsResolver $resolver The resolver for the options. - * @return void - */ - private function configureOptions(OptionsResolver $resolver): void - { - $resolver->setDefaults([ - 'cidrList' => [], - 'cidrProjectAllowedList' => [] - ]); - - $resolver->setNormalizer('cidrList', \Closure::fromCallable([$this, 'normalizeCidrList'])); - $resolver->setNormalizer('cidrProjectAllowedList', \Closure::fromCallable([$this, 'normalizeCidrProjectList'])); - } - - /** - * Normalise Cidr list for cidrList option - * - * @param \Symfony\Component\OptionsResolver\Options $options - * @param string|null $value - * @return array - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed - */ - private function normalizeCidrList( - \Symfony\Component\OptionsResolver\Options $options, - ?string $value - ): array { - // phpcs:enable - return $this->doNormalizeCidrList($value, 'cidrList'); - } - - /** - * Normalise Cidr list for cidrProjectAllowedList option - * - * @param \Symfony\Component\OptionsResolver\Options $options - * @param string|null $value - * @return array - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed - */ - private function normalizeCidrProjectList( - \Symfony\Component\OptionsResolver\Options $options, - ?string $value - ): array { - // phpcs:enable - return $this->doNormalizeCidrList($value, 'cidrProjectAllowedList'); - } - - /** - * Normalize CIDR list with specific cache key. - * - * @param string|null $value - * @param string $optionName - * @return array<\Dxw\CIDR\IPv4Range|\Dxw\CIDR\IPv6Range> - */ - private function doNormalizeCidrList(?string $value, string $optionName): array - { - $cacheConfigKey = self::$cache_config_key . '_' . $optionName; - $allowed_cidr_config_list = collect(explode(',', strval($value)))->filter(); - $allowed_cidr_config_list_hash = \md5($allowed_cidr_config_list->implode(',')); - $allowed_cidr_list = []; - - // Flush cache if config hash changed - if ($allowed_cidr_config_list_hash !== \collect(Cache::get($cacheConfigKey))->get('hash')) { - Cache::forget($cacheConfigKey); - - /** @var array<\Dxw\CIDR\IPv4Range|\Dxw\CIDR\IPv6Range> $allowed_cidr_list */ - $allowed_cidr_list = $allowed_cidr_config_list - ->map(function (string $cidr) { - $ip_range = !IPv4Range::Make($cidr)->isErr() ? IPv4Range::Make($cidr) : IPv6Range::Make($cidr); - if ($ip_range->isErr()) { - throw new \Exception(\trans( - 'CIDR LIST not valid (ipv4 or ipv6 cidr) :cidr', - [ - 'cidr' => $cidr - ] - )); - } - return $ip_range->unwrap(); - })->all(); - } - - /** @var array<\Dxw\CIDR\IPv4Range|\Dxw\CIDR\IPv6Range> $allowed_cidr_list */ - return \collect(Cache::rememberForever($cacheConfigKey, function() use ($allowed_cidr_list, $allowed_cidr_config_list_hash) { - return [ - 'list' => $allowed_cidr_list, - 'hash' => $allowed_cidr_config_list_hash - ]; - }))->get('list'); - } -} diff --git a/app/Listeners/CustomerPasswordUpdatedListener.php b/app/Listeners/CustomerPasswordUpdatedListener.php new file mode 100644 index 00000000..71b82019 --- /dev/null +++ b/app/Listeners/CustomerPasswordUpdatedListener.php @@ -0,0 +1,20 @@ +email->value)) + ->queue(new CustomerPasswordHasReset()); + } +} diff --git a/app/Listeners/Orders/ProcessRegateOrderExport.php b/app/Listeners/Orders/ProcessRegateOrderExport.php new file mode 100644 index 00000000..5d8be2f0 --- /dev/null +++ b/app/Listeners/Orders/ProcessRegateOrderExport.php @@ -0,0 +1,28 @@ +regateService->processOrder( + $event->reference, + $event->byMatricule, + CarbonImmutable::instance($event->pickupDay), + $event->lines + ); + } +} diff --git a/app/Listeners/Orders/SendAdminOrderConfirmation.php b/app/Listeners/Orders/SendAdminOrderConfirmation.php new file mode 100644 index 00000000..a4479760 --- /dev/null +++ b/app/Listeners/Orders/SendAdminOrderConfirmation.php @@ -0,0 +1,32 @@ +contactMail = new Address(Config::string('mail.to.contact')); + } + + public function handle(AnOrderHasBeenPlaced $event): void + { + Mail::to($this->contactMail) + ->queue(new OrderConfirmAdminMail($event)); + } +} diff --git a/app/Listeners/Orders/SendCustomerOrderConfirmation.php b/app/Listeners/Orders/SendCustomerOrderConfirmation.php new file mode 100644 index 00000000..a8ca5f5d --- /dev/null +++ b/app/Listeners/Orders/SendCustomerOrderConfirmation.php @@ -0,0 +1,28 @@ +employeeRepository + ->findByMatricule($event->byMatricule); + + if ($employee) { + $employee->notify(new OrderConfirmed($event)); + } + } +} diff --git a/app/Listeners/SendRegateOrderMail.php b/app/Listeners/SendRegateOrderMail.php new file mode 100644 index 00000000..2a207dab --- /dev/null +++ b/app/Listeners/SendRegateOrderMail.php @@ -0,0 +1,35 @@ +regateEmail = new Address(Config::string('mail.to.regate')); + } + + public function handle(RegateOrderCsvGenerated $event): void + { + Mail::to($this->regateEmail) + ->send(new RegateOrderMail( + $event->csvContent, + $event->fileName + )); + } +} diff --git a/app/Listeners/UpdateCustomerLastLogin.php b/app/Listeners/UpdateCustomerLastLogin.php new file mode 100644 index 00000000..0d639963 --- /dev/null +++ b/app/Listeners/UpdateCustomerLastLogin.php @@ -0,0 +1,23 @@ +user instanceof Customer) { + $event->user->last_login_at = now(); + $event->user->save(); + } + } +} diff --git a/app/Mail/CustomerPasswordHasReset.php b/app/Mail/CustomerPasswordHasReset.php new file mode 100644 index 00000000..748cc124 --- /dev/null +++ b/app/Mail/CustomerPasswordHasReset.php @@ -0,0 +1,71 @@ + + */ + public function backoff(): array + { + return [10, 30, 60, 300]; + } + + private string $siteName; + + /** + * Create a new message instance. + */ + public function __construct() + { + $this->siteName = Config::string('app.name'); + } + + /** + * Get the message envelope. + */ + public function envelope(): Envelope + { + return new Envelope( + subject: trans('Your password has been changed - :appname', ['appname' => $this->siteName]), + ); + } + + /** + * Get the message content definition. + */ + public function content(): Content + { + return new Content( + markdown: 'emails.password-has-reset', + ); + } + + /** + * Get the attachments for the message. + * + * @return \Illuminate\Mail\Mailables\Attachment[] + */ + public function attachments(): array + { + return []; + } +} diff --git a/app/Mail/OrderConfirmAdminMail.php b/app/Mail/OrderConfirmAdminMail.php index e9f72afe..4d20a20f 100644 --- a/app/Mail/OrderConfirmAdminMail.php +++ b/app/Mail/OrderConfirmAdminMail.php @@ -1,55 +1,69 @@ order = $order; + return $this->orderEvent->pickupDay; } /** - * Build the message. - * - * @return $this + * Get the message envelope. */ - public function build() + public function envelope(): Envelope { - $order = $this->order; - $magasin = Magasin::find($order->timeslot->magasin->id); + return new Envelope( + subject: trans('New order from :firstname :lastname - :appname', [ + 'firstname' => $this->orderEvent->employee->firstname, + 'lastname' => $this->orderEvent->employee->lastname, + 'appname' => Config::string('app.name'), + ]), + ); + } - return $this->subject( - \sprintf( - 'Nouvelle commande de %s %s - %s', - $order->customer->salarie->prenom, - Str::upper($order->customer->salarie->nom), - config('theme.site_name') - ) - )->view('emails.order-confirm-admin', compact('order', 'magasin')); + /** + * Get the message content definition. + */ + public function content(): Content + { + return new Content( + markdown: 'emails.order-confirm-admin', + with: [ + 'order' => $this->orderEvent, + 'magasin' => $this->orderEvent->shop, + ], + ); + } + + /** + * Get the attachments for the message. + * + * @return \Illuminate\Mail\Mailables\Attachment[] + */ + public function attachments(): array + { + return []; } } diff --git a/app/Mail/OrderConfirmMail.php b/app/Mail/OrderConfirmMail.php deleted file mode 100644 index ef1c796e..00000000 --- a/app/Mail/OrderConfirmMail.php +++ /dev/null @@ -1,49 +0,0 @@ -order = $order; - } - - /** - * Build the message. - * - * @return $this - */ - public function build() - { - $order = $this->order; - $magasin = Magasin::find($order->timeslot->magasin->id); - - return $this->subject( - "Votre commande - " . config('theme.site_name') - )->view('mails.order-confirm', compact('order', 'magasin')); - } -} diff --git a/app/Mail/OrderStatusMail.php b/app/Mail/OrderStatusMail.php deleted file mode 100644 index 15d3e038..00000000 --- a/app/Mail/OrderStatusMail.php +++ /dev/null @@ -1,48 +0,0 @@ -order = $order; - } - - /** - * Build the message. - * - * @return $this - */ - public function build() - { - $order = $this->order; - $magasin = Magasin::find($order->timeslot->magasin->id); - - return $this->subject( - "Votre commande - " . config('theme.site_name') - )->view('mails.order-status', compact('order', 'magasin')); - } -} diff --git a/app/Mail/OrderTodayReminderMail.php b/app/Mail/OrderTodayReminderMail.php deleted file mode 100644 index c4b6d65d..00000000 --- a/app/Mail/OrderTodayReminderMail.php +++ /dev/null @@ -1,48 +0,0 @@ -order = $order; - } - - /** - * Build the message. - * - * @return $this - */ - public function build() - { - $order = $this->order; - $magasin = Magasin::find($order->timeslot->magasin->id); - - return $this->subject( - "Vous avez une commande à retirer aujourd'hui - " . config('theme.site_name') - )->view('emails.order-reminder', compact('order', 'magasin')); - } -} diff --git a/app/Mail/PasswordResetMail.php b/app/Mail/PasswordResetMail.php deleted file mode 100644 index 586b61cd..00000000 --- a/app/Mail/PasswordResetMail.php +++ /dev/null @@ -1,45 +0,0 @@ -token = $token; - } - - /** - * Build the message. - * - * @return $this - */ - public function build() - { - $token = $this->token; - return $this->subject( - "Réinitialiser votre accès - " . config('theme.site_name') - )->view('mails.password-reset', compact('token')); - } -} diff --git a/app/Mail/RegateOrderMail.php b/app/Mail/RegateOrderMail.php new file mode 100644 index 00000000..3001f941 --- /dev/null +++ b/app/Mail/RegateOrderMail.php @@ -0,0 +1,63 @@ +fileName + ), + ); + } + + /** + * Get the attachments for the message. + * + * @return array + */ + public function attachments(): array + { + return [ + Attachment::fromData(fn () => $this->csvContent, $this->fileName) + ->withMime('text/csv'), + ]; + } +} diff --git a/app/Mail/RegisterConfirmMail.php b/app/Mail/RegisterConfirmMail.php deleted file mode 100644 index b2595e06..00000000 --- a/app/Mail/RegisterConfirmMail.php +++ /dev/null @@ -1,55 +0,0 @@ -firstname = $firstname; - $this->customer = $customer; - } - - /** - * Build the message. - * - * @return $this - */ - public function build() - { - $customer = $this->customer; - $firstname = $this->firstname; - return $this->subject("Confirmation d'inscription " . config('theme.site_name')) - ->view('mails.register-ok', compact('customer', 'firstname')); - } -} diff --git a/app/Mail/SendContactMail.php b/app/Mail/SendContactMail.php index ef860a06..3c992e0c 100644 --- a/app/Mail/SendContactMail.php +++ b/app/Mail/SendContactMail.php @@ -1,76 +1,97 @@ */ - protected $joinedFileName; - + public function backoff(): array + { + return [10, 30, 60, 300]; + } /** * Create a new message instance. - * - * @param \App\Http\Requests\ContactFormRequest $data - * @return void */ - public function __construct(ContactFormRequest $data) - { - $this->data = $data; + public function __construct( + public readonly ContactFormData $data + ) { } /** - * Build the message. - * - * @return $this + * Get the message envelope. */ - public function build() + public function envelope(): Envelope { - $data = $this->data; - $this->joinFileIfProvided(); - - return $this->subject("Contact - " . config('theme.site_name', 'Boutique') . " - " . $data->subject) - ->from($data->email) - ->view('mails.send-contact', compact('data')); + return new Envelope( + subject: trans('Contact') . + ' - ' . Config::string('app.name') . + ' - ' . e($this->data->subject), + replyTo: [ + new Address( + $this->data->email, + $this->data->firstName . ' ' . $this->data->lastName + ), + ], + ); } + /** + * Get the message content definition. + */ + public function content(): Content + { + return new Content( + markdown: 'emails.send-contact', + ); + } /** - * Attach a joined file if given in data + * Get the attachments for the message. * - * @return void + * @return \Illuminate\Mail\Mailables\Attachment[] */ - protected function joinFileIfProvided(): void + public function attachments(): array { - if ($this->data->file) { - $this->joinedFileName = sprintf( - 'BOUTIQUE_MESSAGE-PJ-%s.%s', - date("YmdHis"), - $this->data->file->extension() - ); - $this->attach($this->data->file, [ - 'as' => $this->joinedFileName, - 'mime' => $this->data->file->getMimeType() - ]); + if ($this->data->file === null) { + return []; } + + $extension = pathinfo($this->data->file->originalName, PATHINFO_EXTENSION); + $joinedFileName = sprintf( + 'BOUTIQUE_MESSAGE-PJ-%s.%s', + date('YmdHis'), + $extension + ); + + return [ + Attachment::fromPath($this->data->file->path) + ->as($joinedFileName) + ->withMime($this->data->file->mimeType), + ]; } } diff --git a/app/Mail/SendSalariesCSVMail.php b/app/Mail/SendSalariesCSVMail.php deleted file mode 100644 index 77841a10..00000000 --- a/app/Mail/SendSalariesCSVMail.php +++ /dev/null @@ -1,53 +0,0 @@ -model = $model; - $this->file = $file; - } - - /** - * Build the message. - * - * @return $this - */ - public function build() - { - return $this->subject("Export salariés - " . config('theme.site_name', 'Boutique')) - ->attach(storage_path('salaries') . "/" . $this->file) - ->markdown('mails.send-csv', ['model' => $this->model]); - } -} diff --git a/app/Models/AnifoodProduct.php b/app/Models/AnifoodProduct.php deleted file mode 100644 index c9f14c68..00000000 --- a/app/Models/AnifoodProduct.php +++ /dev/null @@ -1,10 +0,0 @@ - 'date', - ]; - - /** - * Format a date - * - * @param DateTimeInterface $date - * @return string - */ - protected function serializeDate(DateTimeInterface $date) - { - return $date->format('Y-m-d'); - } - - /** - * BelongsTo magasin relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function magasin() - { - return $this->belongsTo(Magasin::class); - } -} diff --git a/app/Models/Content.php b/app/Models/Content.php deleted file mode 100644 index 0628f8f5..00000000 --- a/app/Models/Content.php +++ /dev/null @@ -1,11 +0,0 @@ - $notifications + * @property-read \App\Models\PasswordReset|null $resetToken + * + * @mixin \Eloquent + */ +#[Fillable([ + 'email', + 'username', +])] +class Customer extends Authenticatable implements CustomerDetails, MustVerifyEmail +{ + use HasUuidV7AsPrimaryKey; + use Notifiable; + + #[\Override] + protected function casts(): array + { + return [ + 'email' => EmailCast::class, + 'hashcode' => CrmHashcodeCast::class, + 'last_login_at' => 'datetime', + ]; + } + + #[\Override] + public function getAuthPassword(): string + { + return $this->hashcode->value; + } + + #[\Override] + public function getEmailForVerification() + { + return $this->email->value; + } + + #[\Override] + public function getEmailForPasswordReset() + { + return $this->email->value; + } + + /** NOTE: Overload \Illuminate\Notifications\Notifiable trait */ + public function routeNotificationForMail(): string + { + return $this->email->value; + } + + public function getId(): ShopperId + { + return new ShopperId(Uuid::fromString($this->id)); + } + + /** @return \Illuminate\Database\Eloquent\Relations\HasOne<\App\Models\Employee,$this> */ + public function employee(): HasOne + { + return $this->hasOne(Employee::class, 'customer_id'); + } + + /** @return \Illuminate\Database\Eloquent\Relations\HasOne<\App\Models\PasswordReset,$this> */ + public function resetToken(): HasOne + { + return $this->hasOne(PasswordReset::class, 'email', 'email'); + } +} diff --git a/app/Models/Customers.php b/app/Models/Customers.php deleted file mode 100644 index 96f349f2..00000000 --- a/app/Models/Customers.php +++ /dev/null @@ -1,140 +0,0 @@ -hasOne(Salarie::class, 'customer_id'); - } - - /** - * Get the crm Data of a customer - * - * @return \LDC\LDCCRM\Models\Customer - * @throws \LDC\LDCCRM\Exceptions\CrmException If cannot fetch data from crm. - * @author Jérémy Munsch - */ - public function getApiDataAttribute(): CrmCustomer - { - /** @var \LDC\LDCCRM\CrmApiV2 */ - $crm = app('crmAPI'); - $crmCustomer = $crm->getCustomer($this->hashcode); - if (!$crmCustomer) { - throw new CrmException('CRM get Customer returned null'); - } - return $crmCustomer; - } - - /** - * Set the crm Data of a customer - * @param CustomerCrmResource $resource - * - * @return CrmCustomer - * - * @throws \LDC\LDCCRM\Exceptions\CrmException If an error occurs on server side or on getting response. - * @throws \LDC\LDCCRM\Exceptions\ApiErrorException If any error or \LDC\LDCCRM\Enums\ApiError occurs. - * @author Jérémy Munsch - * @phpcs:disable Squiz.Commenting.FunctionCommentThrowTag.WrongNumber - */ - public function updateApiData(CustomerCrmResource $resource): CrmCustomer - { - $data = $resource->toArray(null); - - /** @var \LDC\LDCCRM\CrmApiV2 */ - $crm = app('crmAPI'); - $crmCustomer = $crm->getCustomer($data['hashcode']); - if (!$crmCustomer) { - throw new CrmException('CRM get Customer returned null'); - } - - $crmCustomer->fill($data); - $crmCustomer->save(); - - return $crmCustomer; - } - - /** - * This mutate Customer attributes to array - * including only non critical properties and crm values - * (One that can be send to front office without security breach) - * - * @return array - */ - public function toArray() - { - if ($this->hashcode) { - return collect(array_merge( - parent::toArray(), - (array)$this->apiData - ))->intersectByKeys([ - 'email' => '', - 'firstname' => '', - 'lastname' => '', - 'address' => '', - 'address2' => '', - 'postcode' => '', - 'birth_date' => '', - 'city' => '', - 'country' => '', - 'opt_in' => '', - 'phone' => '' - ])->toArray(); - } else { - return parent::toArray(); - } - } - - /** - * HasMany orders relation - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function orders() - { - return $this->hasMany(Order::class, 'customer_id'); - } - - /** - * Check if customer is no longer employed - * - * @return boolean - */ - public function isNoLongerEmployed() - { - if (!$this->salarie or !$this->salarie->end_date) { - return false; - } - return Carbon::parse($this->salarie->end_date)->lessThanOrEqualTo(Carbon::now()); - } -} diff --git a/app/Models/Discount.php b/app/Models/Discount.php new file mode 100644 index 00000000..2d3bb81d --- /dev/null +++ b/app/Models/Discount.php @@ -0,0 +1,70 @@ + $products + * + * @method static Builder|Discount published() + * + * @mixin \Eloquent + */ +#[Fillable([ + 'type', + 'is_old_price_displayed', + 'date_start', + 'date_end', +])] +class Discount extends Model +{ + #[\Override] + protected function casts(): array + { + return [ + 'type' => DiscountType::class, + 'value' => DiscountValueCast::class, + 'is_old_price_displayed' => 'bool', + 'date_start' => 'datetime', + 'date_end' => 'datetime', + ]; + } + + /** + * @param \Illuminate\Database\Eloquent\Builder $query + * @return \Illuminate\Database\Eloquent\Builder + */ + protected function scopePublished(Builder $query): Builder + { + return $query + ->where(function (Builder $q): void { + $q->whereNull('date_start')->orWhere('date_start', '<=', Date::now()); + }) + ->where(function (Builder $q): void { + $q->whereNull('date_end')->orWhere('date_end', '>=', Date::now()); + }); + } + + /** @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Product,$this> */ + public function products(): HasMany + { + return $this->hasMany(Product::class); + } +} diff --git a/app/Models/DiscountType.php b/app/Models/DiscountType.php deleted file mode 100644 index 3710e726..00000000 --- a/app/Models/DiscountType.php +++ /dev/null @@ -1,28 +0,0 @@ -hasMany(Promotion::class, 'discount_type_id'); - } -} diff --git a/app/Models/Employee.php b/app/Models/Employee.php new file mode 100644 index 00000000..f7dcd6bc --- /dev/null +++ b/app/Models/Employee.php @@ -0,0 +1,112 @@ + $notifications + * + * @method static Builder|Employee active() + * + * @mixin \Eloquent + */ +#[Fillable([ + 'matricule', + 'nom', + 'prenom', + 'code', + 'start_date', + 'end_date', + 'etablissement', + 'site', + 'service', +])] +class Employee extends Model +{ + use Notifiable; + + /** @return \Illuminate\Database\Eloquent\Casts\Attribute */ + protected function fullName(): Attribute + { + return Attribute::make(get: fn () => Str::title("{$this->nom} {$this->prenom}")); + } + + /** @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Customer,$this> */ + public function customer(): BelongsTo + { + return $this->belongsTo(Customer::class); + } + + #[\Override] + protected function casts(): array + { + return [ + 'code' => CodeCast::class, + 'matricule' => MatriculeCast::class, + 'last_sync' => 'datetime', + 'start_date' => 'datetime', + 'end_date' => 'datetime', + 'etablissement' => ShopperEstablishmentCodeCast::class, + 'site' => ShopperSiteCodeCast::class, + 'service' => ShopperServiceCodeCast::class, + ]; + } + + /** @return \Illuminate\Database\Eloquent\Casts\Attribute */ + protected function isActive(): Attribute + { + return Attribute::make( + get: fn (): bool => $this->end_date?->greaterThanOrEqualTo(Date::now()) ?? true + ); + } + + /** + * @param \Illuminate\Database\Eloquent\Builder $query + * @return \Illuminate\Database\Eloquent\Builder + */ + protected function scopeActive(Builder $query): Builder + { + return $query->where( + fn ($q) => $q + ->where('end_date', '>=', Date::now()) + ->orWhereNull('end_date') + ); + } + + public function routeNotificationForMail(): string + { + return $this->customer?->email->value ?? ''; + } +} diff --git a/app/Models/Faq.php b/app/Models/Faq.php index 12b3c43e..d0116092 100644 --- a/app/Models/Faq.php +++ b/app/Models/Faq.php @@ -1,18 +1,49 @@ order)) { + $maxOrder = self::query()->max('order'); + $model->order = is_numeric($maxOrder) ? (int) $maxOrder + 1 : 0; + } + } } diff --git a/app/Models/FoodProduct.php b/app/Models/FoodProduct.php deleted file mode 100644 index 0ee9f1ed..00000000 --- a/app/Models/FoodProduct.php +++ /dev/null @@ -1,40 +0,0 @@ -belongsTo(Product::class); - } - - /** - * hasOne product relation - * - * @return \Illuminate\Database\Eloquent\Relations\HasOne - */ - public function xmlInco() - { - return $this->hasOne(XmlInco::class, 'id', 'no_art'); - } -} diff --git a/app/Models/GarmentProduct.php b/app/Models/GarmentProduct.php deleted file mode 100644 index 9f3102b7..00000000 --- a/app/Models/GarmentProduct.php +++ /dev/null @@ -1,10 +0,0 @@ -hasMany(TimeslotSetting::class); - } - - /** - * hasMany collecte exceptions relation - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function collecteExceptions() - { - return $this->hasMany(CollecteException::class); - } - - /** - * hasMany timeslots relation - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function timeslots() - { - return $this->hasMany(Timeslot::class); - } -} diff --git a/app/Models/OldSlug.php b/app/Models/OldSlug.php deleted file mode 100644 index 10dca74a..00000000 --- a/app/Models/OldSlug.php +++ /dev/null @@ -1,31 +0,0 @@ -belongsTo('App\Model\Product', 'product_id'); - } - - /** - * BelongsTo range relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function range() - { - return $this->belongsTo('App\Model\Range', 'range_id'); - } -} diff --git a/app/Models/Order.php b/app/Models/Order.php index 606580b5..00500d77 100644 --- a/app/Models/Order.php +++ b/app/Models/Order.php @@ -1,75 +1,86 @@ $lines + * @property-read \App\Models\Shop|null $shop + * + * @method static Builder|Order whereCreatedAtBetween(\Carbon\CarbonInterface $start, \Carbon\CarbonInterface $end) + * + * @mixin \Eloquent + */ +#[Fillable([])] class Order extends Model { - use HasFactory; + use HasUuidV7AsPrimaryKey; - /** - * BelongsToMany products relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function products() + public const CREATED_AT = null; + + public function getId(): OrderId { - return $this->belongsToMany(Product::class, 'order_lines', 'order_id', 'product_id'); + return new OrderId(Uuid::fromString($this->id)); } - /** - * hasMany lines relation - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function lines() + /** @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\OrderLine,$this> */ + public function lines(): HasMany { return $this->hasMany(OrderLine::class); } - /** - * BelongsTo order_status relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function status() + /** @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Shop,$this> */ + public function shop(): BelongsTo { - return $this->belongsTo('App\Models\OrdersStatus', 'status_id'); + return $this->belongsTo(Shop::class); } - /** - * BelongsTo customer relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function customer() + /** @param Builder $query */ + protected function scopeWhereCreatedAtBetween(Builder $query, CarbonInterface $start, CarbonInterface $end): void { - return $this->belongsTo(Customers::class); + $minUuid = (string) Uuid::uuid7($start->copy()->startOfDay()); + $maxUuid = (string) Uuid::uuid7($end->copy()->endOfDay()); + + $query->whereBetween('id', [$minUuid, $maxUuid]); } - /** - * hasOne timeslot relation - * - * @return \Illuminate\Database\Eloquent\Relations\HasOne - */ - public function timeslot() + #[\Override] + protected function casts(): array { - return $this->hasOne(Timeslot::class); - } - - /** - * Custom Attribute - * - * @return string - */ - public function getFormattedTotalTtcAttribute() - { - $this->attributes['formattedTotalTtc'] = sprintf( - '%s €', - number_format($this->attributes['total'], 2, ',', ' ') - ); - return $this->attributes['formattedTotalTtc']; + return [ + 'pickup_day' => 'date', + 'employee' => OrderEmployeeCast::class, + 'total' => MoneyCast::class, + 'status' => OrderStatus::class, + 'delivery_address' => DeliveryAddressCast::class, + 'reference' => OrderReferenceCast::class, + ]; } } diff --git a/app/Models/OrderLine.php b/app/Models/OrderLine.php index 46f66a7b..6dadfc94 100644 --- a/app/Models/OrderLine.php +++ b/app/Models/OrderLine.php @@ -1,45 +1,76 @@ */ + public function order(): BelongsTo { return $this->belongsTo(Order::class); } - /** - * BelongsTo product relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function product() + /** @return \Illuminate\Database\Eloquent\Casts\Attribute */ + protected function unitPriceDiscountedHt(): Attribute { - return $this->belongsTo(Product::class); + return Attribute::make( + get: fn (): Money => $this->unit_price->subtract($this->unit_discount) + ); } - /** - * Getter for formattedTotalTtc - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function getFormattedTotalTtcAttribute() + /** @return \Illuminate\Database\Eloquent\Casts\Attribute */ + protected function totalGrossHt(): Attribute { - $this->attributes['formattedTotalTtc'] = sprintf( - '%s €', - number_format($this->attributes['total_ttc'], 2, ',', ' ') + return Attribute::make( + get: fn (): Money => $this->total_ht->add($this->total_discount) ); - return $this->attributes['formattedTotalTtc']; + } + + #[\Override] + protected function casts(): array + { + return [ + 'quantity' => 'integer', + 'unit_price' => MoneyCast::class, + 'unit_tax' => MoneyCast::class, + 'unit_discount' => MoneyCast::class, + 'tax_rate' => TaxRate::class, + 'total_ttc' => MoneyCast::class, + 'total_ht' => MoneyCast::class, + 'total_tax' => MoneyCast::class, + 'total_discount' => MoneyCast::class, + 'product' => OrderLineProductCast::class, + ]; } } diff --git a/app/Models/OrdersProducts.php b/app/Models/OrdersProducts.php deleted file mode 100644 index 3cdce83e..00000000 --- a/app/Models/OrdersProducts.php +++ /dev/null @@ -1,14 +0,0 @@ -hasMany('App\Models\Order', 'status_id'); - } -} diff --git a/app/Models/Page.php b/app/Models/Page.php new file mode 100644 index 00000000..bdec942a --- /dev/null +++ b/app/Models/Page.php @@ -0,0 +1,52 @@ + */ + use IsCachedAsCollection; + + #[\Override] + public function getRouteKeyName(): string + { + return 'slug'; + } + + #[\Override] + protected function casts(): array + { + return [ + 'slug' => StaticPageSlug::class, + ]; + } +} diff --git a/app/Models/PasswordReset.php b/app/Models/PasswordReset.php index db3c2c3c..e4c16b86 100644 --- a/app/Models/PasswordReset.php +++ b/app/Models/PasswordReset.php @@ -1,22 +1,32 @@ 'date', + ]; + } } diff --git a/app/Models/PickupException.php b/app/Models/PickupException.php new file mode 100644 index 00000000..a6dbf271 --- /dev/null +++ b/app/Models/PickupException.php @@ -0,0 +1,87 @@ + $shops + * + * @method static \Database\Factories\PickupExceptionFactory factory($count = null, $state = []) + * + * @mixin \Eloquent + */ +#[Fillable([ + 'date', + 'label', + 'repeatable', + 'repeat_frequency', +])] +#[Guarded([ + 'auto_updated', +])] +class PickupException extends Model +{ + /** @use HasFactory<\Database\Factories\PickupExceptionFactory> */ + use HasFactory; + + use HasUuidV7AsPrimaryKey; + + public function getId(): PickupExceptionId + { + return new PickupExceptionId(Uuid::fromString($this->id)); + } + + public function setAsManuallySaved(): void + { + $this->setAttribute('auto_updated', false); + } + + /** + * Format a date + */ + #[\Override] + protected function serializeDate(DateTimeInterface $date): string + { + return $date->format('Y-m-d'); + } + + /** @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<\App\Models\Shop,$this,\App\Models\ShopPickupExceptionPivot> */ + public function shops(): BelongsToMany + { + return $this->belongsToMany(Shop::class, 'shop_pickup_exception') + ->using(ShopPickupExceptionPivot::class) + ->withPivot(['replacement_date', 'order_deadline_at']); + } + + #[\Override] + protected function casts(): array + { + return [ + 'date' => 'date', + 'repeatable' => 'bool', + 'auto_updated' => 'bool', + 'repeat_frequency' => RepeatFrequency::class, + ]; + } +} diff --git a/app/Models/Product.php b/app/Models/Product.php index a8a92fdd..1921efa3 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -1,601 +1,329 @@ $products + * @property-read \App\Models\Range $range + * @property-read \Illuminate\Database\Eloquent\Collection $stats + * @property-read \Illuminate\Database\Eloquent\Collection $tags + * @property-read \App\Models\Discount|null $validDiscount + * @property-read float $weight_grams + * + * @method static Builder|Product onlyTrashed() + * @method static Builder|Product orderable() + * @method static Builder|Product published() + * @method static Builder|Product withTrashed(bool $withTrashed = true) + * @method static Builder|Product withoutTrashed() + * + * @mixin \Eloquent + */ +#[Fillable([ + 'name', + 'brand', + 'description', + 'invoicing_unit', + 'stock', + 'weight', + 'orderable_start', + 'orderable_end', + 'range_id', + 'star', + 'status', + 'weight_variable', + 'sell_unit', + 'order_unit', + 'tax_rate', + 'picture', + 'short_description', + 'picture_alt', + 'picture_title', + 'picture_large_alt', + 'picture_large_title', + 'picture_large', +])] +class Product extends Model implements ModelWithOrder, ModelWithStar, ModelWithStatus, RedirectableInterface { - use HasFactory; + use HasOrder; + use HasStar; + use HasStatus; + use HasUuidV7AsPrimaryKey; + use IsRedirectable; use SoftDeletes; - use CanBeBought; - use CastsEnums; - /** - * The attributes that should be cast to native types. - * - * @var array - */ - protected $casts = [ - 'orderable_start' => 'datetime', - 'orderable_end' => 'datetime', - 'price' => 'float' - ]; + public const CREATED_AT = null; - /** - * Map attribute names to enum classes. - * - * @var array - */ - public $enumCasts = [ - 'brand' => ProductBrand::class - ]; - - /** - * Store in protected variables instead of attributes - * Because those are not set in attributes, Laravel will not try to save it to database - */ - - /** - * Base Price - * - * @var float - */ - protected $priceHt; - - /** - * Base Price - * - * @var float - */ - protected $priceKgTtc; - - /** - * Base Price after discount - * - * @var float - */ - protected $discountedPriceHt; - - /** - * Price VAT included - * - * @var float - */ - protected $priceTtc; - - /** - * Price after discount VAT included - * - * @var float - */ - protected $discountedPriceTtc; - - /** - * Discount amount - * - * @var float - */ - protected $discountAmount; - - /** - * Dsicount rate - * - * @var float - */ - protected $discountRate; - - /** - * The accessors to append to the model's array form. - * - * @var string[] - */ - protected $appends = ['is_available']; - - /** - * Bootstrap the model and its traits. - * - * @return void - */ - protected static function boot() + public function getId(): ProductId { - parent::boot(); + return new ProductId(Uuid::fromString($this->id)); + } - // On data retrived from DB. - static::retrieved(function ($model) { - $model->priceHt = $model->getPriceHtAttribute(); - $model->priceKgTtc = $model->getPriceKgTtcAttribute(); - $model->priceTtc = $model->getPriceTtcAttribute(); - $model->discountAmount = $model->getDiscountAmountAttribute(); - $model->discountRate = $model->getDiscountRateAttribute(); - $model->discountedPriceHt = $model->getDiscountedPriceHtAttribute(); - $model->discountedPriceTtc = $model->getDiscountedPriceTtcAttribute(); + #[\Override] + protected static function booted(): void + { + static::saving(function (self $model): void { + self::manageFields($model); + self::makeStatusSense($model); + self::makeStarSense($model); + }); + + static::deleting(function (self $model): void { + FileStorageHelper::removeFile($model, 'picture'); + FileStorageHelper::removeFile($model, 'picture_large'); }); } - // * METHODS - - /** - * Check if product is available - * - * @return boolean - */ - public function getIsAvailableAttribute() + private static function manageFields(self $model): void { - $start = ($this->orderable_start) ? Carbon::now()->gt($this->orderable_start) : true; - $end = ($this->orderable_end) ? Carbon::now()->lt($this->orderable_end) : true; + self::assertNameIsUnique($model->name, $model->id); - return ($start && $end); - } + $model->slug = Str::slug($model->name); + $model->picture = FileStorageHelper::storeFile($model, $model->picture, true); + $model->picture_large = FileStorageHelper::storeFile($model, $model->picture_large, true); - /** - * Price calculations - * We need : gross price (prix avant taxe et remises) - * discounted price (prix avant taxe avec remises) - * net price (prix avec taxe) - * net discounted proice (prix avec taxe et remises) - */ - - /** - * Utility to bring prices as a pseudo relation - * - * @return array - */ - public function getCalcPrices() - { - $prices = array( - 'priceHt' => $this->priceHt, - 'priceKgTtc' => $this->priceKgTtc, - 'discountAmount' => $this->discountAmount, - 'discountRate' => $this->discountRate, - 'discountedPriceHt' => $this->discountedPriceHt, - 'priceTtc' => $this->priceTtc, - 'discountedPriceTtc' => $this->discountedPriceTtc, - ); - return $prices; - } - - /** - * Mutator method to set priceHt's value gross price - * - * @param float $value - * @return void - */ - public function setPriceHtAttribute(float $value) - { - $this->priceHt = $value; - } - - /** - * Get the gross price - * Accessor method for priceHt - * - * @author Olivier Legat - * - * @return float - */ - public function getPriceHtAttribute() - { - if (isset($this->priceHt)) { - return $this->priceHt; - } else { - /** Tenir compte de l'unité de facturation et de l'unité de vente (qui doit être stricte) - * si facturation KG et vente piece - * prendre le poids, convertir en KG => pre-requis l'unité de poids doit être un enum - * multiplier le $this->attributes['price'] par les KG - * sinon - * value => value - */ - if (config('bosettings.sell_unit_management') == "strict") { - $calculate = ($this->invoicing_unit == InvoicingUnit::kgm()->value - && $this->sell_unit == SellUnit::pce()->value); - } else { - $calculate = false; - } - - if ($calculate) { - // Weight converter. - $weighted_price = $this->attributes['price'] - * ($this->weight * WeightUnit::convert()[$this->weight_unit]); - $this->priceHt = round($weighted_price * 1000) / 1000; - return $this->priceHt; - } else { - // No calculations, alias of db property. - $this->priceHt = $this->attributes['price']; - return $this->priceHt; - } - } //end if - } - - /** - * getter for price by weight - * - * @return float - */ - public function getPriceKgTtcAttribute() - { - if (isset($this->priceKgTtc)) { - $showPrice = $this->priceKgTtc; - } else { - $discountedPriceKgTtc = $this->price; - if ($this->promotions->count()) { - $applicablePromotion = $this->promotions->first(); - if ($applicablePromotion->discountType->id == 1) { - $discountedPriceKgTtc = $this->price - $applicablePromotion->discount_value; - } else { - $discountedPriceKgTtc = $this->price - ($this->price * $applicablePromotion->discount_value / 100); - } - } - $priceKgTtc = $discountedPriceKgTtc * (1 + ($this->tax->rate / 100)); - - /** - * On travaille avec des centimes puis on redivise par 100 pour avoir des unités monetaires - * on augmente la précision à 3 digits, l'affichage formate les prix sur 2 décimales - */ - $this->priceKgTtc = round($priceKgTtc * 1000) / 1000; - - // Calc price/kg when the invoicing unit is PCE only if status is 'published'. - $weight = $this->weight; - if ($this->status) { - if ($this->weight_unit === \App\Enums\WeightUnit::kg()->value) { - $weight = $this->weight * 1000; - } - if ($this->invoicing_unit === \App\Enums\InvoicingUnit::pce()->value) { - /** - * We need to round the price because if there's more than 2 decimals, - * the result is not exactly related to the price. - */ - $discountedPriceKgTtc = round($discountedPriceKgTtc * (1 + ($this->tax->rate / 100)), 2); - $this->priceKgTtc = 1000 / $weight * $discountedPriceKgTtc; - } - } - $showPrice = $this->priceKgTtc; - } //end if - - return $showPrice; - } - - /** - * setter for dicounted price - * - * @param float $value - * @return void - */ - public function setDiscountedPriceHtAttribute(float $value) - { - $this->discountedPriceHt = $value; - } - - /** - * getter for discounted price - * - * @return float - */ - public function getDiscountedPriceHtAttribute() - { - if (isset($this->discountedPriceHt)) { - return $this->discountedPriceHt; - } else { - $discountedPriceHt = $this->priceHt - $this->discountAmount; - $roundingdiscountedPriceHt = round($discountedPriceHt * 1000) / 1000; - $this->discountedPriceHt = $roundingdiscountedPriceHt; - return $this->discountedPriceHt; + if ($model->order === null) { + $max = self::query()->max('order'); + $model->order = is_scalar($max) ? intval($max) + 1 : 1; } } - /** - * setter for net price - * - * @param float $value - * @return void - */ - public function setPriceTtcAttribute(float $value) + private static function assertNameIsUnique(?string $name, ?string $id = null): void { - $this->priceTtc = $value; + $table = new self()->getTable(); + ToolboxHelper::assertFieldIsUnique($table, 'name', $name, $id); + ToolboxHelper::assertFieldIsUnique($table, 'slug', Str::slug($name ?? ''), $id); + } + + #[\Override] + protected function casts(): array + { + return [ + 'orderable_start' => 'datetime', + 'orderable_end' => 'datetime', + 'price' => MoneyCast::class, + 'brand' => ProductBrand::class, + 'invoicing_unit' => InvoicingUnit::class, + 'sell_unit' => SellUnit::class, + 'order_unit' => OrderUnit::class, + 'weight_variable' => 'bool', + 'star' => 'bool', + 'status' => 'bool', + 'deleted_at' => 'datetime', + 'tax_rate' => TaxRate::class, + ]; + } + + #[\Override] + public function getRouteKeyName(): string + { + return 'slug'; + } + + #[\Override] + public function getFrontUrl(string $modelKey): string + { + return route('fo.products.show', $modelKey); } /** - * getter for net price - * - * @return float + * @param \Illuminate\Database\Eloquent\Builder $query + * @return \Illuminate\Database\Eloquent\Builder */ - public function getPriceTtcAttribute() + protected function scopePublished(Builder $query): Builder { - if (isset($this->priceTtc)) { - return $this->priceTtc; - } else { - $priceTtc = $this->priceHt * (1 + ($this->tax->rate / 100)); - /** - * On travaille avec des centimes puis on redivise par 100 pour avoir des unités monetaires - * on augmente la précision à 3 digits, l'affichage formate les prix sur 2 décimales - */ - $roundingPriceTtc = round($priceTtc * 1000) / 1000; - $this->priceTtc = $roundingPriceTtc; - return $this->priceTtc; - } + return $query->where('status', true); } /** - * setter for net dscounted price - * - * @param float $value - * @return void + * @param \Illuminate\Database\Eloquent\Builder $query + * @return \Illuminate\Database\Eloquent\Builder */ - public function setDiscountedPriceTtcAttribute(float $value) + protected function scopeOrderable(Builder $query): Builder { - $this->discountedPriceTtc = $value; + $now = Date::now(); + + // NOTE: Scopes should be layed down to a repository. + return $query + // * Must have an associated inco + ->has('inco') + // * Orderable + ->where(function (Builder $q) use ($now): void { + $q->whereNull('orderable_start') + ->orWhere('orderable_start', '<', $now); + }) + ->where(function (Builder $q) use ($now): void { + $q->whereNull('orderable_end') + ->orWhere('orderable_end', '>', $now); + }) + // * Available + ->published(); } - /** - * getter for net dscounted price - * - * @return float - */ - public function getDiscountedPriceTtcAttribute() + // * -- RELATIONSHIPS + + /** @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Range,$this> */ + public function range(): BelongsTo { - if (isset($this->discountedPriceTtc)) { - $showPrice = $this->discountedPriceTtc; - } else { - $discountedPriceTtc = $this->discountedPriceHt * (1 + ($this->tax->rate / 100)); - // On travaille avec des centimes puis on redivise par 100 pour avoir des unités monetaires. - $roundingDiscountedPriceTTC = round($discountedPriceTtc * 1000) / 1000; - $this->discountedPriceTtc = $roundingDiscountedPriceTTC; - $showPrice = $this->discountedPriceTtc; - } - // Prix transmis en fonction du setting show_prices. - if (config('bosettings.show_prices_authenticated') == "authenticated") { - if (Auth::guard('customer')->check()) { - return $showPrice; - } - } - if (config('bosettings.show_prices_guest') == "guest") { - return $showPrice; - } - return "-.--"; + return $this->belongsTo(Range::class); } - /** - * Discount calculators - */ - - /** - * set discoutn amount - * - * @param float $value - * @return void - */ - public function setDiscountAmountAttribute(float $value) + /** @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Stat,$this> */ + public function stats(): HasMany { - $this->discountAmount = $value; + return $this->hasMany(Stat::class, 'product_id'); } - /** - * Getter for discount amount - * - * @return float - */ - public function getDiscountAmountAttribute() + /** @return \Illuminate\Database\Eloquent\Relations\HasOne<\App\Models\ProductInco,$this> */ + public function inco(): HasOne { - if (isset($this->discountAmount)) { - return $this->discountAmount; - } else { - $applicablePromotion = $this->promotions->first(); - if (null !== $applicablePromotion) { - $promo_type = $applicablePromotion->discount_type_id; - if ($promo_type == 1) { - $discountAmount = $applicablePromotion->discount_value; - } else { - // On augmente la précision à 3 digits, l'affichage formate les prix sur 2 décimales. - $discountAmount = $this->priceHt * ($applicablePromotion->discount_value / 100); - $discountAmount = round($discountAmount * 1000) / 1000; - } - } else { - $discountAmount = 0; - } - $this->discountAmount = $discountAmount; - return $this->discountAmount; - } + return $this->hasOne(ProductInco::class); } - /** - * set discount rate - * - * @param float $value - * @return void - */ - public function setDiscountRateAttribute(float $value) + /** @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ + public function products(): BelongsToMany { - $this->discountRate = $value; + return $this->belongsToMany( + Product::class, + 'product_product', + 'product_id', + 'associated_id' + ) + ->withPivot('sort_order') + ->orderBy('pivot_sort_order', 'asc'); } - /** - * get discount rate - * - * @return float - */ - public function getDiscountRateAttribute() + /** @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Discount,$this> */ + public function discount(): BelongsTo { - if (isset($this->discountRate)) { - return $this->discountRate; - } else { - $applicablePromotion = $this->promotions->first(); - if (null !== $applicablePromotion) { - $promo_type = $applicablePromotion->discount_type_id; - if ($promo_type == 1) { - // On veut un pourcentage. - $discountRate = ($applicablePromotion->discount_value / $this->priceHt) * 100; - } else { - $discountRate = $applicablePromotion->discount_value; - } - } else { - $discountRate = 0; - } - $this->discountRate = $discountRate; - return $this->discountRate; - } + return $this->belongsTo(Discount::class, 'discount_id'); } - // * RELATIONSHIPS - - /** - * buyablePrice attribute alias - * - * @param mixed $options - * @return float - * - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass - */ - public function getBuyablePrice($options = null) + /** @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Discount,$this> */ + public function validDiscount(): BelongsTo { - // @phpcs:enable - return $this->priceHt; + return $this->discount() + ->where(function ($q) { + $q->whereNull('date_start')->orWhere('date_start', '<=', Date::now()); + }) + ->where(function ($q) { + $q->whereNull('date_end')->orWhere('date_end', '>=', Date::now()); + }); } - /** - * BelongsTo range relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function range() - { - return $this->belongsTo('App\Models\Range', 'range_id'); - } - - /** - * hasMany old_slugs relation - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function oldSlugs() - { - return $this->hasMany('App\Model\OldSlug', 'product_id'); - } - - /** - * hasMany stats relation - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function stats() - { - return $this->hasMany('App\Models\Stat', 'product_id'); - } - - /** - * belongsToMany orders relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function orders() - { - return $this->belongsToMany('App\Models\Order', 'orders_products', 'product_id', 'order_id') - ->withPivot('quantity'); - } - - /** - * Pseudo relationship to additionnal product info - * - * @param string $productType - * @return \Illuminate\Database\Eloquent\Relations\HasOne - */ - public function additionnalProductInfo(string $productType) - { - return $this->$productType; - } - - /** - * hasOne foodProduct relation - * - * @return \Illuminate\Database\Eloquent\Relations\HasOne - */ - public function foodProduct() - { - return $this->hasOne(FoodProduct::class, 'product_id'); - } - - /** - * hasOne anifoodProduct relation - * - * @return \Illuminate\Database\Eloquent\Relations\HasOne - */ - public function anifoodProduct() - { - return $this->hasOne(AnifoodProduct::class, 'product_id'); - } - - /** - * hasOne toolProduct relation - * - * @return \Illuminate\Database\Eloquent\Relations\HasOne - */ - public function toolProduct() - { - return $this->hasOne(ToolProduct::class, 'product_id'); - } - - /** - * hasOne garmentProduct relation - * - * @return \Illuminate\Database\Eloquent\Relations\HasOne - */ - public function garmentProduct() - { - return $this->hasOne(GarmentProduct::class, 'product_id'); - } - - - - /** - * belongsToMany products relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function products() - { - return $this->belongsToMany(Product::class, 'products_products', 'product_id', 'associated_id'); - } - - /** - * belongsToMany promotions relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function promotions() - { - $now = Carbon::now(); - return $this->belongsToMany(Promotion::class) - ->whereDate('date_start', '<=', $now) - ->whereDate('date_end', '>=', $now); - } - - /** - * belongsTo tax relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function tax() - { - return $this->belongsTo(TaxRate::class, 'tax_rate_id'); - } - - /** - * belongsToMany tags relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function tags() + /** @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<\App\Models\Tag,$this> */ + public function tags(): BelongsToMany { return $this->belongsToMany(Tag::class); } + + // * -- GETTERS + + /** @return \Illuminate\Database\Eloquent\Casts\Attribute */ + protected function weightGrams(): Attribute + { + return Attribute::make( + get: fn (): float => $this->product_weight ? (float) $this->product_weight->toGrams() : 0.0 + ); + } + + /** @return \Illuminate\Database\Eloquent\Casts\Attribute<\Domain\Models\ValueObjects\ProductWeight|null,\Domain\Models\ValueObjects\ProductWeight|null> */ + protected function productWeight(): Attribute + { + return Attribute::make( + get: function (mixed $_, array $attributes): ?ProductWeight { + if (! isset($attributes['weight'])) { + return null; + } + + if (! is_int($attributes['weight'])) { + throw new \UnexpectedValueException('Invalid weight attribute'); + } + + return new ProductWeight( + (int) $attributes['weight'], + (bool) ($attributes['weight_variable'] ?? false) + ); + }, + set: function (?ProductWeight $value): array { + if ($value === null) { + return [ + 'weight' => null, + 'weight_variable' => false, + ]; + } + + return [ + 'weight' => $value->value, + 'weight_variable' => $value->isVariable, + ]; + } + ); + } } diff --git a/app/Models/ProductInco.php b/app/Models/ProductInco.php new file mode 100644 index 00000000..e572d224 --- /dev/null +++ b/app/Models/ProductInco.php @@ -0,0 +1,118 @@ +id); + } + + /** @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Product,$this> */ + public function product(): BelongsTo + { + return $this->belongsTo(Product::class); + } + + #[\Override] + protected function casts(): array + { + return [ + 'nutriscore' => Nutriscore::class, + 'nutrition' => NutritionalValuesCast::class, + ]; + } +} diff --git a/app/Models/ProductType.php b/app/Models/ProductType.php deleted file mode 100644 index dc3894bc..00000000 --- a/app/Models/ProductType.php +++ /dev/null @@ -1,30 +0,0 @@ -belongsTo(Product::class); - } -} diff --git a/app/Models/ProductsProducts.php b/app/Models/ProductsProducts.php deleted file mode 100644 index 3369d6b1..00000000 --- a/app/Models/ProductsProducts.php +++ /dev/null @@ -1,13 +0,0 @@ - 'boolean', - 'date_start' => 'datetime', - 'date_end' => 'datetime', - ]; - - /** - * BelongsToMany products relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function products() - { - return $this->belongsToMany(Product::class); - } - - /** - * BelongsTo discountType relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function discountType() - { - return $this->belongsTo(DiscountType::class, 'discount_type_id'); - } -} diff --git a/app/Models/Range.php b/app/Models/Range.php index 226504c1..ec72dd69 100644 --- a/app/Models/Range.php +++ b/app/Models/Range.php @@ -1,31 +1,111 @@ $products + * + * @mixin \Eloquent + */ +#[Fillable([ + 'name', + 'description', + 'picture', + 'picture_alt', + 'picture_title', + 'status', +])] +class Range extends Model implements ModelWithOrder, ModelWithStatus, RedirectableInterface { - use HasFactory; + use HasOrder; + use HasStatus; + use IsRedirectable; - /** - * hasMany customer relation - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function products() + #[\Override] + protected static function booted() { - return $this->hasMany('App\Models\Product', 'range_id'); + static::creating(function (self $model): void { + self::manageFields($model); + }); + static::updating(function (self $model): void { + self::manageFields($model); + }); + static::deleting(function (self $model): void { + FileStorageHelper::removeFile($model, 'picture'); + }); } - /** - * hasMany old_slugs relation - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function oldSlugs() + #[\Override] + public function getRouteKeyName(): string { - return $this->hasMany('App\Model\OldSlug', 'range_id'); + return 'slug'; + } + + /** @return string[]|string */ + #[\Override] + public function getFrontUrl(string $modelKey): array | string + { + return route('fo.products.index') . '#' . http_build_query([ + 'ranges' => [$modelKey], + ]); + } + + private static function manageFields(self $model): void + { + self::assertNameIsUnique($model->name, $model->id); + $model->slug = Str::slug($model->name); + + $model->picture = FileStorageHelper::storeFile($model, $model->picture, true); + if (is_null($model->order)) { + $maxOrder = self::query()->max('order'); + $model->order = is_numeric($maxOrder) ? (int) $maxOrder + 1 : 0; + } + } + + private static function assertNameIsUnique(?string $name, ?int $id = null): void + { + $table = new self()->getTable(); + ToolboxHelper::assertFieldIsUnique($table, 'name', $name, $id); + ToolboxHelper::assertFieldIsUnique($table, 'slug', Str::slug($name ?? ''), $id); + } + + /** @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Product,$this> */ + public function products(): HasMany + { + return $this->hasMany(Product::class, 'range_id'); + } + + #[\Override] + protected function casts(): array + { + return [ + 'status' => 'bool', + ]; } } diff --git a/app/Models/Salarie.php b/app/Models/Salarie.php deleted file mode 100644 index 17b65aff..00000000 --- a/app/Models/Salarie.php +++ /dev/null @@ -1,138 +0,0 @@ -site) { - case SalarieSite::ldccav(): - // Cavol. - $magasin = Magasin::find(3); - break; - case SalarieSite::dde(): - // Dinde. - $magasin = Magasin::find(8); - break; - case SalarieSite::dpe(): - // DPE. - $magasin = Magasin::find(9); - break; - case SalarieSite::cepacpe(): - if (in_array($this->service, ["CEPACP060", "CEPACP070", "CEPACP072"])) { - // CPE. - $magasin = Magasin::find(6); - } elseif (in_array($this->service, ["CEPACP065", "CEPACP066"])) { - // PLB. - $magasin = Magasin::find(11); - } else { - // CEPA. - $magasin = Magasin::find(10); - } - break; - case SalarieSite::ldcplb(): - // PLB. - $magasin = Magasin::find(11); - break; - case SalarieSite::tpwiss(): - // Wissous. - $magasin = Magasin::find(7); - break; - case SalarieSite::sl(): - case SalarieSite::gdfroi(): - case SalarieSite::slela(): - default: - // Saint Laurent. - $magasin = Magasin::find(1); - } //end switch - - $this->magasin()->associate($magasin); - } - - /** - * Simple Custom Random string generator - * - * @param integer $length - * @param object|null $model - * @param string $characters - * @return string - */ - public static function generateRandomString( - int $length = 10, - object $model = null, - string $characters = 'abcdefghjkmnpqrstuwxyzABCDEFGHJKMNPQRSTUWXYZ123456789' - ) { - $charactersLength = strlen($characters); - $randomString = ''; - for ($i = 0; $i < $length; $i++) { - $randomString .= $characters[rand(0, $charactersLength - 1)]; - } - if (isset($model) && $model->where('code', $randomString)->count()) { - self::generateRandomString(); - } - return $randomString; - } - - /** - * getFormattedMatricule method - * - * @param string $matricule - * @return string Digits only without leading zeros. - */ - public static function getFormattedMatricule(string $matricule): string - { - return str_pad(ltrim(preg_replace('/[^\d]/', '', $matricule), '0'), 7, "0", STR_PAD_LEFT); - } - - // * RELATIONSHIPS - - /** - * BelongsTo customer relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function customer() - { - return $this->belongsTo(Customers::class); - } - - /** - * belongsTo magasin relation - * - * @return \Illuminate\Database\Eloquent\Relations\belongsTo - */ - public function magasin() - { - return $this->belongsTo(Magasin::class); - } -} diff --git a/app/Models/Setting.php b/app/Models/Setting.php index 0fe60afd..38a37906 100644 --- a/app/Models/Setting.php +++ b/app/Models/Setting.php @@ -1,11 +1,46 @@ + */ + #[\Override] + protected function casts(): array + { + return [ + 'employee_sites' => EmployeeSitesCast::class, + ]; + } + + public static function getSingleton(): self + { + return self::query()->firstOrCreate( + ['id' => self::SINGLETON_ID], + [ + 'employee_sites' => [], + ] + ); + } } diff --git a/app/Models/Shop.php b/app/Models/Shop.php new file mode 100644 index 00000000..e0ecca4e --- /dev/null +++ b/app/Models/Shop.php @@ -0,0 +1,82 @@ + $orders + * @property-read \App\Models\ShopPickupExceptionPivot|null $pivot + * @property-read \Illuminate\Database\Eloquent\Collection $pickupExceptions + * + * @method static \Database\Factories\ShopFactory factory($count = null, $state = []) + * + * @mixin \Eloquent + */ +#[Fillable([ + 'name', + 'address', + 'postcode', + 'city', + 'phone', + 'latitude', + 'longitude', +])] +#[Guarded([ + 'default', +])] +class Shop extends Model +{ + /** @use HasFactory<\Database\Factories\ShopFactory> */ + use HasFactory; + + use HasUuidV7AsPrimaryKey; + + public function getId(): ShopId + { + return new ShopId(Uuid::fromString($this->id)); + } + + /** @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<\App\Models\PickupException,$this,\App\Models\ShopPickupExceptionPivot> */ + public function pickupExceptions(): BelongsToMany + { + return $this->belongsToMany(PickupException::class, 'shop_pickup_exception') + ->using(ShopPickupExceptionPivot::class) + ->withPivot(['replacement_date', 'order_deadline_at']); + } + + /** @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Order,$this> */ + public function orders(): HasMany + { + return $this->hasMany(Order::class); + } + + #[\Override] + protected function casts(): array + { + return [ + 'default' => 'bool', + ]; + } +} diff --git a/app/Models/ShopPickupExceptionPivot.php b/app/Models/ShopPickupExceptionPivot.php new file mode 100644 index 00000000..1df55184 --- /dev/null +++ b/app/Models/ShopPickupExceptionPivot.php @@ -0,0 +1,27 @@ + 'date', + 'order_deadline_at' => 'datetime', + ]; + } +} diff --git a/app/Models/Slide.php b/app/Models/Slide.php index 4f8ffa3e..bef0dd62 100644 --- a/app/Models/Slide.php +++ b/app/Models/Slide.php @@ -1,31 +1,131 @@ */ use HasFactory; - /** - * The attributes that should be cast to native types. - * - * @var array - */ - protected $casts = [ - 'date_start' => 'datetime', - 'date_end' => 'datetime', - ]; + use HasOrder; + use HasStatus; - /** - * BelongsTo slider relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function slider() + #[\Override] + protected static function booted() { - return $this->belongsTo(Slider::class); + static::creating(function (self $model): void { + self::manageFields($model); + self::makeStatusSense($model); + }); + static::updating(function (self $model): void { + self::manageFields($model); + self::makeStatusSense($model); + }); + static::deleting(function (self $model): void { + FileStorageHelper::removeFile($model, 'picture'); + }); + } + + public function isVisible(): bool + { + return DatesHelper::isIn($this->date_start, $this->date_end); + } + + /** @return \Illuminate\Database\Eloquent\Casts\Attribute */ + protected function planificatedStatus(): Attribute + { + return Attribute::get(fn (): bool => $this->isVisible()); + } + + private static function manageFields(self $model): void + { + $model->picture = FileStorageHelper::storeFile($model, $model->picture, true); + + if ($model->order === null) { + $max = self::query()->max('order'); + $model->order = is_scalar($max) ? intval($max) + 1 : 1; + } + } + + private static function makeStatusSense(self $model): void + { + $actualStatus = $model->status; + $model->status = $model->planificatedStatus; + + if ($actualStatus !== $model->status) { + resolve(Session::class)->flash('bo.info', \trans( + 'The publication status is updated according to the scheduled dates. ' + . 'To change the publication status, please edit or remove the corresponding dates.' + )); + } + } + + #[\Override] + protected function casts(): array + { + return [ + 'link_new_tab' => 'bool', + 'connected' => 'bool', + 'status' => 'bool', + 'order' => 'int', + 'date_start' => 'datetime', + 'date_end' => 'datetime', + ]; } } diff --git a/app/Models/Slider.php b/app/Models/Slider.php deleted file mode 100644 index ee882fdc..00000000 --- a/app/Models/Slider.php +++ /dev/null @@ -1,40 +0,0 @@ -hasMany(Slide::class, 'slider_id')->orderBy('order', 'ASC'); - } - - /** - * filtered slides relation by showable date - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function showableSlides() - { - $now = Carbon::now(); - return $this->hasMany(Slide::class, 'slider_id') - ->orderBy('order', 'ASC')->where(function ($q) use ($now) { - $q->whereDate('date_start', '<=', $now) - ->orWhereNull('date_start'); - })->where(function ($q) use ($now) { - $q->whereDate('date_end', '>=', $now) - ->orWhereNull('date_end'); - }); - } -} diff --git a/app/Models/Stat.php b/app/Models/Stat.php index ebea83e6..04ee1ed3 100644 --- a/app/Models/Stat.php +++ b/app/Models/Stat.php @@ -1,21 +1,39 @@ */ + public function product(): BelongsTo { - return $this->belongsTo('App\Models\Product', 'product_id'); + return $this->belongsTo(Product::class); + } + + #[\Override] + protected function casts(): array + { + return [ + 'date' => 'datetime', + 'margin' => 'float', + 'nb_sale' => 'int', + ]; } } diff --git a/app/Models/Tag.php b/app/Models/Tag.php index 77f193c6..fb01be54 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -1,28 +1,100 @@ $products + * + * @method static \Database\Factories\TagFactory factory($count = null, $state = []) + * @method static Builder|Tag published() + * + * @mixin \Eloquent + */ +#[Fillable([ + 'label', + 'status', +])] +#[WithoutTimestamps] +class Tag extends Model implements ModelWithOrder, ModelWithStatus { + /** @use HasFactory<\Database\Factories\TagFactory> */ use HasFactory; - /** - * Indicates if the model should be timestamped. - * - * @var boolean - */ - public $timestamps = false; + use HasOrder; + use HasStatus; + + #[\Override] + protected static function booted() + { + static::creating(function (self $model): void { + self::manageFields($model); + self::makeStatusSense($model); + }); + static::updating(function (self $model): void { + self::manageFields($model); + self::makeStatusSense($model); + }); + } /** - * belongsToMany products relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany + * @param \Illuminate\Database\Eloquent\Builder $query + * @return \Illuminate\Database\Eloquent\Builder */ - public function products() + protected function scopePublished(Builder $query): Builder + { + return $query->where('status', true); + } + + /** @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<\App\Models\Product,$this> */ + public function products(): BelongsToMany { return $this->belongsToMany(Product::class); } + + private static function manageFields(self $model): void + { + self::assertLabelIsUnique($model->label, $model->id); + $model->slug = Str::slug($model->label); + + if ($model->order === null) { + $max = self::query()->max('order'); + $model->order = is_scalar($max) ? intval($max) + 1 : 1; + } + } + + private static function assertLabelIsUnique(?string $label, ?int $id = null): void + { + $table = new self()->getTable(); + ToolboxHelper::assertFieldIsUnique($table, 'label', $label, $id); + ToolboxHelper::assertFieldIsUnique($table, 'slug', Str::slug($label ?? ''), $id); + } + + #[\Override] + protected function casts(): array + { + return [ + 'order' => 'int', + 'status' => 'bool', + ]; + } } diff --git a/app/Models/TaxRate.php b/app/Models/TaxRate.php deleted file mode 100644 index babd0ea1..00000000 --- a/app/Models/TaxRate.php +++ /dev/null @@ -1,28 +0,0 @@ -hasMany(Product::class, 'tax_rate_id'); - } -} diff --git a/app/Models/Timeslot.php b/app/Models/Timeslot.php deleted file mode 100644 index c4dbe796..00000000 --- a/app/Models/Timeslot.php +++ /dev/null @@ -1,49 +0,0 @@ - 'date', - ]; - - /** - * BelongsTo order relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function order() - { - return $this->belongsTo(Order::class); - } - - /** - * BelongsTo magasin relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function magasin() - { - return $this->belongsTo(Magasin::class); - } -} diff --git a/app/Models/TimeslotSetting.php b/app/Models/TimeslotSetting.php deleted file mode 100644 index ca3d8d20..00000000 --- a/app/Models/TimeslotSetting.php +++ /dev/null @@ -1,21 +0,0 @@ -belongsTo(Magasin::class); - } -} diff --git a/app/Models/ToolProduct.php b/app/Models/ToolProduct.php deleted file mode 100644 index 7f8ebbb4..00000000 --- a/app/Models/ToolProduct.php +++ /dev/null @@ -1,10 +0,0 @@ - $notifications + * @property-read \Illuminate\Database\Eloquent\Collection $orders + * + * @method static \Database\Factories\UserFactory factory($count = null, $state = []) + * + * @mixin \Eloquent + */ +#[Fillable([ + 'firstname', + 'lastname', + 'email', + 'password', + 'date_of_birth', + 'role', +])] +#[Hidden([ + 'password', + 'remember_token', +])] +class User extends Authenticatable implements AdminDetails { + /** @use HasFactory<\Database\Factories\UserFactory> */ use HasFactory; + use Notifiable; - /** - * The attributes that are mass assignable. - * - * @var array - */ - protected $fillable = [ - 'firstname', - 'lastname', - 'email', - 'password', - 'date_of_birth', - 'role' - ]; - - /** - * The attributes that should be hidden for arrays. - * - * @var array - */ - protected $hidden = [ - 'password', - 'remember_token', - ]; - - /** - * The attributes that should be cast to native types. - * - * @var array - */ - protected $casts = [ - 'email_verified_at' => 'datetime', - ]; - - /** - * hasMany order relation - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function orders() + /** @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Order,$this> */ + public function orders(): HasMany { - return $this->hasMany('App\Models\Order', 'user_id'); + return $this->hasMany(Order::class, 'user_id'); + } + + #[\Override] + protected function casts(): array + { + return [ + 'email_verified_at' => 'datetime', + 'role' => UserRole::class, + ]; } } diff --git a/app/Models/XmlInco.php b/app/Models/XmlInco.php deleted file mode 100644 index 6c19cbc6..00000000 --- a/app/Models/XmlInco.php +++ /dev/null @@ -1,293 +0,0 @@ - 'array', - 'nutritional_values' => 'array', - ]; - - /** - * The Laravel disk name - * - * @var string - */ - protected $disk = 'inco'; - - /** - * Storage path - * - * @var string - */ - protected $imagesPath = 'images'; - - /** - * The files to ignore - * - * @var array - */ - protected $ignoreFiles = [ - '.gitignore', '.gitkeep' - ]; - - /** - * retrieve a collection of medias - * - * @return Collection - */ - public function getMediasAttribute() - { - /** @var Filesystem */ - $disk = $this->getDisk(); - $files = $disk->files($this->imagesPath); - - $collFiles = new Collection(); - // /** @var File */ - foreach ($files as $file) { - $pi = \pathinfo($file, \PATHINFO_BASENAME); - if (in_array($pi, $this->ignoreFiles)) { - continue; - } - if (!in_array($pi, array($this->id))) { - continue; - } - $image = base64_encode($disk->get($file)); - $element = array( - "filename" => $pi, - "imgdata" => $image - ); - $collFiles->add($element); - } - return $collFiles; - } - - /** - * Get the concerned disk - * - * @return Filesystem - */ - protected function getDisk(): Filesystem - { - return Storage::disk($this->disk); - } - - /** - * getter - * - * @return string - */ - public function getNiceStringAttribute() - { - return sprintf('%s - %s', $this->id, $this->descriptif); - } - - /** - * update local info - * - * @return void - */ - public function updateLocalProductInfo() - { - $foodProduct = FoodProduct::where('no_art', $this->id)->first(); - - if (!empty($foodProduct)) { - /** Info produits à suggerer lors de l'édition - * this->descriptif (doit aller dans la table products) - * $table->text('preparation')->nullable(); => $this->conseil_prepa - * $table->text('selling_argument')->nullable(); => $this->arg_vente - * infos produit maj automatique - */ - $foodProduct->ingredients = $this->lst_ing; - $foodProduct->allergens = $this->lib_allergene; - /** Les types de correspondent pas - * numeric ($foodProduct->servings) = string (exemple this->nb_portion = '1/2'). - */ - $nutri_values = $this->nutritional_values; - if (!empty($nutri_values)) { - // Maj des info nutri locales. - // Pour la ref. - $foodProduct->nv_ref_weight_g = $nutri_values["taille_ref"]; - // Energie Kj. - $foodProduct->nv_kj = $nutri_values["val_energ_kj_r"]; - // Energie Kcal. - $foodProduct->nv_kcal = $nutri_values["val_energ_kcal_r"]; - // Graisses. - $foodProduct->nv_fat_g = $nutri_values["mat_grass_r"]; - // Dont acides gras saturés. - $foodProduct->nv_sat_fat_g = $nutri_values["ags_r"]; - // Glucides. - $foodProduct->nv_carb_g = $nutri_values["glucides_r"]; - // Dont sucres. - $foodProduct->nv_sugar_g = $nutri_values["sucre_r"]; - // Fibres alimentaires. - $foodProduct->nv_fiber_g = $nutri_values["fib_alim_r"]; - // Protéines. - $foodProduct->nv_protein_g = $nutri_values["proteine_r"]; - // Sel. - $foodProduct->nv_salt_g = $nutri_values["sel_r"]; - - /** Autres valeurs dispos - * $nutri_values["sodium_r"]; - * $nutri_values["ener_e14_r"]; - * $nutri_values["fruits_r"]; - * $nutri_values["fruits_coque_sech_r"]; - * $nutri_values["ener_kjo_r"]; - * $nutri_values["fatsat_r"]; - * $nutri_values["choval_r"]; - * $nutri_values["sugar_r"]; - * $nutri_values["fibtg_r"]; - * $nutri_values["pro_r"]; - * $nutri_values["salteq_r"]; - */ - // Valeurs nutritionnelles par portion. - // Taille portion en grammes. - $foodProduct->nv_serving_size_g = $nutri_values["taille_port"]; - // Energie Kj. - $foodProduct->nv_serving_kj = $nutri_values["val_energ_kj_p"]; - // Energie Kcal. - $foodProduct->nv_serving_kcal = $nutri_values["val_energ_kcal_p"]; - // Graisses. - $foodProduct->nv_serving_fat_g = $nutri_values["mat_grass_p"]; - // Dont acides gras saturés. - $foodProduct->nv_serving_sat_fat_g = $nutri_values["ags_p"]; - // Glucides. - $foodProduct->nv_serving_carb_g = $nutri_values["glucides_p"]; - // Dont sucres. - $foodProduct->nv_serving_sugar_g = $nutri_values["sucre_p"]; - // Fibres alimentaires. - $foodProduct->nv_serving_fiber_g = $nutri_values["fib_alim_p"]; - // Protéines. - $foodProduct->nv_serving_protein_g = $nutri_values["proteine_p"]; - // Sel. - $foodProduct->nv_serving_salt_g = $nutri_values["sel_p"]; - - /** - * autres valeurs disponibles - * $nutri_values["sodium_p"]; - * $nutri_values["fruits_p"]; - */ - - // Apports journaliers. - // Energie % recommandé. - $foodProduct->nv_daily_energy = $nutri_values["pourcent_apport_ref_kjo_r"]; - // Graisses. - $foodProduct->nv_daily_fat = $nutri_values["pourcent_apport_ref_fat_r"]; - // Dont acides gras saturés. - $foodProduct->nv_daily_sat_fat = $nutri_values["pourcent_apport_ref_fatsat_r"]; - // Glucides. - $foodProduct->nv_daily_carb = $nutri_values["pourcent_apport_ref_choval_r"]; - // Dont sucres. - $foodProduct->nv_daily_sugar = $nutri_values["pourcent_apport_ref_sugar_r"]; - // Fibres alimentaires. - $foodProduct->nv_daily_fiber = $nutri_values["pourcent_apport_ref_fibtg_r"]; - // Protéines. - $foodProduct->nv_daily_protein = $nutri_values["pourcent_apport_ref_pro_r"]; - // Sel. - $foodProduct->nv_daily_salt = $nutri_values["pourcent_apport_ref_salteq_r"]; - - // Autre valeur dispo $nutri_values["pourcent_apport_ref_e14_r"] . - // Nutriscore. - $foodProduct->nutriscore = $nutri_values["classement"]; - - /** - * Infos n'ayant pas de mapping - * - * $nutri_values["val_energ_kj_nut"]; - * $nutri_values["val_energ_kcal_nut"]; - * $nutri_values["mat_grass_nut"]; - * $nutri_values["ags_nut"]; - * $nutri_values["glucides_nut"]; - * $nutri_values["sucre_nut"]; - * $nutri_values["sucre_r"]; - * $nutri_values["fib_alim_nut"]; - * $nutri_values["proteine_nut"]; - * $nutri_values["sel_nut"]; - * $nutri_values["apport_ref"]; - * $nutri_values["fruits_coque_sech_p"]; - * $nutri_values["ener_e14_p"]; - * $nutri_values["pourcent_apport_ref_e14_p"]; - * $nutri_values["ener_kjo_p"]; - * $nutri_values["pourcent_apport_ref_kjo_p"]; - * $nutri_values["fat_p"]; - * $nutri_values["pourcent_apport_ref_fat_p"]; - * $nutri_values["fatsat_p"]; - * $nutri_values["pourcent_apport_ref_fatsat_p"]; - * $nutri_values["choval_p"]; - * $nutri_values["pourcent_apport_ref_choval_p"]; - * $nutri_values["sugar_p"]; - * $nutri_values["pourcent_apport_ref_sugar_p"]; - * $nutri_values["fibtg_p"]; - * $nutri_values["pourcent_apport_ref_fibtg_p"]; - * $nutri_values["pro_p"]; - * $nutri_values["pourcent_apport_ref_pro_p"]; - * $nutri_values["salteq_p"]; - * $nutri_values["pourcent_apport_ref_salteq_p"]; - * $nutri_values["apport_port"]; - * $nutri_values["part_p"]; - * $nutri_values["part_g"]; - * $nutri_values["part_l"]; - * $nutri_values["p_sur_l"]; - * $nutri_values["pourcent_ags"]; - * $nutri_values["pourcent_agi"]; - * $nutri_values["pourcent_ss"]; - * $nutri_values["pourcent_amidon"]; - * $nutri_values["composante_n"]; - * $nutri_values["composante_p"]; - * $nutri_values["pourcent_fruits"]; - * $nutri_values["mat_grass_r_prec"]; - * $nutri_values["ags_r_prec"]; - * $nutri_values["glucides_r_prec"]; - * $nutri_values["sucre_r_prec"]; - * $nutri_values["fib_alim_r_prec"]; - * $nutri_values["proteine_r_prec"]; - * $nutri_values["sel_r_prec"]; - * $nutri_values["sodium_r_prec"]; - * $nutri_values["fruits_r_prec"]; - * $nutri_values["fruits_coque_sech_r_prec"]; - * $nutri_values["score_nutri"]; - */ - }//end if - $foodProduct->save(); - }//end if - } -} diff --git a/app/Notifications/MissingOrderReminderNotification.php b/app/Notifications/MissingOrderReminderNotification.php new file mode 100644 index 00000000..71e5e929 --- /dev/null +++ b/app/Notifications/MissingOrderReminderNotification.php @@ -0,0 +1,133 @@ +appUrl = $appUrl; + $this->appHost = $appHost; + $this->appName = Config::string('app.name', 'La Boutique de Cocotte'); + } + + /** + * Determine if the notification should be sent. + */ + public function shouldSend(Employee $notifiable, string $channel): bool + { + /** @var OrderRepository $orderRepository */ + $orderRepository = app(OrderRepository::class); + + return ! $orderRepository->hasValidatedOrderForPickupDay( + $notifiable->matricule, + $this->pickupDay + ); + } + + /** + * @return array + */ + public function via(mixed $notifiable): array + { + return ['mail']; + } + + public function toMail(mixed $notifiable): MailMessage + { + /** @var Employee $notifiable */ + $icsGenerator = app(IcsGeneratorService::class); + $schedulingService = app(PickupSchedulingService::class); + + $cutoffDate = $schedulingService->getPeriodForPickupDate($this->pickupDay)->getStartDate(); + + $closureTime = $cutoffDate->format('G') . 'h'; + $reminderDay = $cutoffDate->translatedFormat('l'); + $reminderTime = $cutoffDate->copy()->subHours(2)->format('G') . 'h'; + + // The reminder event starts 2 hours before the cutoff on the cutoff day + $eventStart = CarbonImmutable::instance($cutoffDate)->subHours(2); + $eventEnd = $eventStart->addMinutes(15); + + $icsContent = $this->generateIcsContent( + $icsGenerator, + $eventStart, + $eventEnd, + $closureTime + ); + + return (new MailMessage()) + ->subject(trans(':time before order taking closes - :appname', [ + 'time' => SendMissingOrderReminderJob::HOURS_BEFORE_CUTOFF . 'h', + 'appname' => $this->appName, + ])) + ->markdown('emails.missing-order-reminder', [ + 'employee' => $notifiable, + 'deliveryDate' => $this->pickupDay->translatedFormat('d/m/Y'), + 'closureTime' => $closureTime, + 'reminderDay' => $reminderDay, + 'reminderTime' => $reminderTime, + 'appHost' => $this->appHost, + 'appUrl' => $this->appUrl, + ]) + ->attachData($icsContent, 'rappel-commande.ics', [ + 'mime' => 'text/calendar', + ]); + } + + private function generateIcsContent( + IcsGeneratorService $icsGenerator, + CarbonInterface $eventStart, + CarbonInterface $eventEnd, + string $closureTime + ): string { + + $eventDto = new IcsContentDto( + uid: 'reminder-' . $eventStart->format('Y-m-d') . '@' . $this->appHost, + summary: trans('Place my order :appname', [ + 'appname' => $this->appName, + ]), + description: trans('Remember to validate your order before :closureTime on :url', [ + 'closureTime' => $closureTime, + 'url' => $this->appHost, + ]), + startsAt: $eventStart, + endsAt: $eventEnd, + url: $this->appUrl + ); + + return $icsGenerator->generate($eventDto); + } +} diff --git a/app/Notifications/OrderConfirmed.php b/app/Notifications/OrderConfirmed.php new file mode 100644 index 00000000..99f3b993 --- /dev/null +++ b/app/Notifications/OrderConfirmed.php @@ -0,0 +1,44 @@ +orderEvent->pickupDay; + } + + /** @return string[] */ + public function via(object $notifiable): array + { + return ['mail']; + } + + public function toMail(object $notifiable): MailMessage + { + $order = $this->orderEvent; + $shop = $order->shop; + + return new MailMessage() + ->subject(trans('Your order - :appname', [ + 'appname' => config()->string('app.name'), + ])) + ->markdown('emails.order-confirm', compact('order', 'shop')); + } +} diff --git a/app/Notifications/OrderTodayReminderNotification.php b/app/Notifications/OrderTodayReminderNotification.php new file mode 100644 index 00000000..f7d9c127 --- /dev/null +++ b/app/Notifications/OrderTodayReminderNotification.php @@ -0,0 +1,61 @@ + + */ + public function backoff(): array + { + return [10, 30, 60, 300]; + } + + public function __construct( + private readonly OrderReminderDto $dto + ) { + } + + /** + * Get the notification's delivery channels. + * + * @return array + */ + public function via(mixed $notifiable): array + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + */ + public function toMail(mixed $notifiable): MailMessage + { + return new MailMessage() + ->subject(trans('You have an order to collect today - :appname', [ + 'appname' => config()->string('app.name'), + ])) + ->markdown('emails.order-reminder', [ + 'dto' => $this->dto, + ]); + } +} diff --git a/app/Notifications/Regate/AnOrderWasPlaced.php b/app/Notifications/Regate/AnOrderWasPlaced.php deleted file mode 100644 index 2d85a830..00000000 --- a/app/Notifications/Regate/AnOrderWasPlaced.php +++ /dev/null @@ -1,157 +0,0 @@ - "UEA", - "KGM" => "KGM", - "PCE" => "UB" - ]; - - /** - * The Order to be exported - * - * @var \App\Models\Order - * */ - private $order; - - /** - * Create a new notification instance. - * - * @param \App\Models\Order $order - * @return void - */ - public function __construct(Order $order) - { - $this->order = $order; - } - - /** - * Get the notification's delivery channels. - * - * @param mixed $notifiable - * @return array - */ - // phpcs:ignore - public function via($notifiable) - { - return ['mail']; - } - - /** - * Get the mail representation of the notification. - * - * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage - */ - // phpcs:ignore - public function toMail($notifiable) - { - $fileName = sprintf( - 'BTQ-%s-%s%s.csv', - $this->order->reference, - date('Ymd_His'), - \microtime(true) - ); - - return (new MailMessage())->subject( - sprintf( - "%s - %s", - config('app.name'), - __('An order was placed') - ) - ) - ->line( - sprintf( - "%s. %s : %s", - __("An order was placed"), - __("Attachement filename"), - $fileName - ) - ) - ->attachData( - $this->makeCsv(), - $fileName, - ['mime' => 'text/csv'] - ); - } - - /** - * Render Regate CSV for order. - * - * @return string - */ - private function makeCsv(): string - { - /** - * Formatted array to make CSV - * - * @var array $csvlines - */ - $csvlines = []; - - foreach ($this->order->lines as $orderline) { - array_push( - $csvlines, - [ - $orderline->product->foodProduct->no_art, - // 21/01/2022 : suppression du pcb ici - $this->order->customer->salarie->matricule, - $orderline->product->reference, - "commande ferme", - $orderline->product->order_unit ?? 'PCE', - // UEA,KGM,UB (respectivement selon le champ précédent). - $this->mode_commande[$orderline->product->order_unit ?? 'PCE'], - // On vide la colonne pcb comme demandé. - "", - $this->order->timeslot->day->format('d/m/Y'), - $orderline->quantity, - $this->order->reference, - ] - ); - } - - // Add header line. - array_unshift($csvlines, $this->header); - - $f = fopen('php://temp', 'w'); - foreach ($csvlines as $item) { - fputcsv($f, $item, ";", '"', "\\"); - } - rewind($f); - return stream_get_contents($f); - } -} diff --git a/app/Policies/Backend/DiscountPolicy.php b/app/Policies/Backend/DiscountPolicy.php new file mode 100644 index 00000000..633514c7 --- /dev/null +++ b/app/Policies/Backend/DiscountPolicy.php @@ -0,0 +1,59 @@ +role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function view(Customer | User $user, Discount | DiscountDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function create(Customer | User $user): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function update(Customer | User $user, Discount | DiscountDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function delete(Customer | User $user, Discount | DiscountDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } +} diff --git a/app/Policies/Backend/EmployeePolicy.php b/app/Policies/Backend/EmployeePolicy.php new file mode 100644 index 00000000..e8c19be8 --- /dev/null +++ b/app/Policies/Backend/EmployeePolicy.php @@ -0,0 +1,23 @@ +role->isAtLeastEqualsTo(UserRole::Admin); + } +} diff --git a/app/Policies/Backend/FaqPolicy.php b/app/Policies/Backend/FaqPolicy.php new file mode 100644 index 00000000..3034b214 --- /dev/null +++ b/app/Policies/Backend/FaqPolicy.php @@ -0,0 +1,59 @@ +role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function view(User | Customer $user, Faq | FaqDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function create(User | Customer $user): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function update(User | Customer $user, Faq | FaqDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function delete(User | Customer $user, Faq | FaqDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } +} diff --git a/app/Policies/Backend/OrderPolicy.php b/app/Policies/Backend/OrderPolicy.php new file mode 100644 index 00000000..3a5f6d02 --- /dev/null +++ b/app/Policies/Backend/OrderPolicy.php @@ -0,0 +1,51 @@ +role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function viewAny(User | Customer $user): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function view(User | Customer $user, Order | OrderDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function cancel(User | Customer $user, Order | OrderDto $order): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin) && ! $order->status->equals(OrderStatus::CANCELED); + } +} diff --git a/app/Policies/Backend/PagePolicy.php b/app/Policies/Backend/PagePolicy.php new file mode 100644 index 00000000..3179a448 --- /dev/null +++ b/app/Policies/Backend/PagePolicy.php @@ -0,0 +1,23 @@ +role->isAtLeastEqualsTo(UserRole::Admin); + } +} diff --git a/app/Policies/Backend/PickupExceptionPolicy.php b/app/Policies/Backend/PickupExceptionPolicy.php new file mode 100644 index 00000000..286acdfb --- /dev/null +++ b/app/Policies/Backend/PickupExceptionPolicy.php @@ -0,0 +1,59 @@ +role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function view(User | Customer $user, PickupException | PickupExceptionDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function create(User | Customer $user): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function update(User | Customer $user, PickupException | PickupExceptionDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function delete(User | Customer $user, PickupException | PickupExceptionDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } +} diff --git a/app/Policies/Backend/ProductPolicy.php b/app/Policies/Backend/ProductPolicy.php new file mode 100644 index 00000000..9d039b53 --- /dev/null +++ b/app/Policies/Backend/ProductPolicy.php @@ -0,0 +1,132 @@ +role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function create(Customer | User $user): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function update(Customer | User $user, Product | ProductDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function delete(Customer | User $user, Product | ProductDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function createInco(Customer | User $user, Product | ProductDto $product): bool + { + if ($user instanceof Customer) { + return false; + } + + $hasInco = $product instanceof ProductDto ? $product->inco !== null : $product->inco()->exists(); + + return $user->role->isAtLeastEqualsTo(UserRole::Admin) && ! $hasInco; + } + + public function updateInco(Customer | User $user, Product | ProductDto $product): bool + { + if ($user instanceof Customer) { + return false; + } + + $hasInco = $product instanceof ProductDto ? $product->inco !== null : $product->inco()->exists(); + + return $user->role->isAtLeastEqualsTo(UserRole::Admin) && $hasInco; + } + + public function associateInco(Customer | User $user, Product | ProductDto $product): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function syncInco(Customer | User $user, Product | ProductDto $product): bool + { + return $this->updateInco($user, $product); + } + + public function toggleStatus(Customer | User $user): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function toggleStar(Customer | User $user): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function viewStarred(Customer | User $user): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function viewPublished(null | Customer | User $_, Product | ProductDto $product): bool + { + $productId = $product instanceof ProductDto + ? new ProductId(Uuid::fromString($product->id)) + : $product->getId(); + + $domainProduct = $this->productRepository->find($productId); + + return $domainProduct && $domainProduct->isPublished(); + } +} diff --git a/app/Policies/Backend/RangePolicy.php b/app/Policies/Backend/RangePolicy.php new file mode 100644 index 00000000..d4bb59b6 --- /dev/null +++ b/app/Policies/Backend/RangePolicy.php @@ -0,0 +1,68 @@ +role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function view(User | Customer $user, Range | RangeDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function create(User | Customer $user): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function update(User | Customer $user, Range | RangeDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function delete(User | Customer $user, Range | RangeDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function toggleStatus(User | Customer $user): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } +} diff --git a/app/Policies/Backend/SettingPolicy.php b/app/Policies/Backend/SettingPolicy.php new file mode 100644 index 00000000..ddf64159 --- /dev/null +++ b/app/Policies/Backend/SettingPolicy.php @@ -0,0 +1,37 @@ +role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function update(User | Customer $user, Setting | SettingDto | null $_ = null): bool + { + // FIXME: The Arcadia refresh job dispatching is currently disabled and needs to be enabled when api will be available. + return false; + + // if ($user instanceof Customer) { + // return false; + // } + + // return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } +} diff --git a/app/Policies/Backend/ShopPolicy.php b/app/Policies/Backend/ShopPolicy.php new file mode 100644 index 00000000..4fcc9c7c --- /dev/null +++ b/app/Policies/Backend/ShopPolicy.php @@ -0,0 +1,68 @@ +role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function view(User | Customer $user, Shop | ShopDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function create(User | Customer $user): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function update(User | Customer $user, Shop | ShopDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function delete(User | Customer $user, Shop | ShopDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function pickupExceptionUpdate(User | Customer $user, Shop | ShopDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } +} diff --git a/app/Policies/Backend/SlidePolicy.php b/app/Policies/Backend/SlidePolicy.php new file mode 100644 index 00000000..8fc6f3da --- /dev/null +++ b/app/Policies/Backend/SlidePolicy.php @@ -0,0 +1,68 @@ +role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function view(User | Customer $user, Slide | SlideDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function create(User | Customer $user): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function update(User | Customer $user, Slide | SlideDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function delete(User | Customer $user, Slide | SlideDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function toggleStatus(User | Customer $user): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } +} diff --git a/app/Policies/Backend/TagPolicy.php b/app/Policies/Backend/TagPolicy.php new file mode 100644 index 00000000..fb6683b3 --- /dev/null +++ b/app/Policies/Backend/TagPolicy.php @@ -0,0 +1,68 @@ +role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function view(User | Customer $user, Tag | TagDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function create(User | Customer $user): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function update(User | Customer $user, Tag | TagDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function delete(User | Customer $user, Tag | TagDto $_): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } + + public function toggleStatus(User | Customer $user): bool + { + if ($user instanceof Customer) { + return false; + } + + return $user->role->isAtLeastEqualsTo(UserRole::Admin); + } +} diff --git a/app/Policies/Frontend/BasketPolicy.php b/app/Policies/Frontend/BasketPolicy.php new file mode 100644 index 00000000..9e7570dc --- /dev/null +++ b/app/Policies/Frontend/BasketPolicy.php @@ -0,0 +1,34 @@ +productRepository->find($product->id); + + return $domainProduct && $domainProduct->isPublished(); + } +} diff --git a/app/Policies/Frontend/CustomerPolicy.php b/app/Policies/Frontend/CustomerPolicy.php new file mode 100644 index 00000000..2d45198d --- /dev/null +++ b/app/Policies/Frontend/CustomerPolicy.php @@ -0,0 +1,20 @@ +orderService->isOrderOwnedBy( + $order, + $user, + ); + } +} diff --git a/app/Policies/Frontend/OrderTunnelStepPolicy.php b/app/Policies/Frontend/OrderTunnelStepPolicy.php new file mode 100644 index 00000000..c6b65cbe --- /dev/null +++ b/app/Policies/Frontend/OrderTunnelStepPolicy.php @@ -0,0 +1,58 @@ +orderTunnelService + ->canAccessStep(OrderTunnelStep::REVIEW); + } + + public function canPickTimeSlot(User | Customer $user): bool + { + if ($user instanceof User) { + return false; + } + + return Gate::allows( + 'customerPassOrders', + $user + ) && $this->orderTunnelService + ->canAccessStep(OrderTunnelStep::BOOKING); + } + + public function canFinalizeOrder(User | Customer $user): bool + { + if ($user instanceof User) { + return false; + } + + return Gate::allows( + 'customerPassOrders', + $user + ) && $this->orderTunnelService + ->canAccessStep(OrderTunnelStep::CONFIRMATION); + } +} diff --git a/app/Policies/Frontend/ProductPolicy.php b/app/Policies/Frontend/ProductPolicy.php new file mode 100644 index 00000000..3e22e638 --- /dev/null +++ b/app/Policies/Frontend/ProductPolicy.php @@ -0,0 +1,43 @@ +productRepository->find($product->getId()); + + return $domainProduct && $domainProduct->isPublished(); + } + + public function addToBasket(null | User | Customer $_, Product $product): bool + { + $domainProduct = $this->productRepository->find($product->getId()); + + return $domainProduct && $domainProduct->isOrderable(); + } + + public function viewPrices(null | User | Customer $_, Product $product): bool + { + if (! ($_ instanceof Customer || $_ instanceof User)) { + return false; + } + + $domainProduct = $this->productRepository->find($product->getId()); + + return $domainProduct && $domainProduct->isPublished(); + } +} diff --git a/app/Policies/Frontend/ShopPolicy.php b/app/Policies/Frontend/ShopPolicy.php new file mode 100644 index 00000000..bf4fed49 --- /dev/null +++ b/app/Policies/Frontend/ShopPolicy.php @@ -0,0 +1,21 @@ +orderable_start === null or $product->orderable_start <= $now) { - // On est entré dans la période commandable ou c'est commandable depuis toujours. - if ($product->orderable_end === null or $product->orderable_end >= $now) { - // Il n'y a pas de limite dans le temps ou elle n'est pas encore passée. - return Response::allow(); - } - return Response::deny('Ce produit n\'est pas disponible pour le moment'); - } - return Response::deny('Commande à partir du ' . $product->orderable_start->formatLocalized('%d %B %Y à %H:%M')); - } -} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 1e64db1b..0d41a518 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -1,17 +1,31 @@ app->singleton( + Purifier::class, + fn () => resolve('purifier') + ); + + $this->app->singleton('clientIp', function () { + return request()->ip() ?? request()->getClientIp(); + }); + + $this->app->bind(EmployeeRepository::class, EloquentEmployeeRepository::class); + $this->app->bind(OrderRepository::class, EloquentOrderRepository::class); + $this->app->bind(UserRepository::class, EloquentUserRepository::class); + + $this->app->bind(CustomerDirectory::class, EloquentCustomerDirectory::class); + $this->app->bind(EmployeeDirectory::class, EloquentEmployeeDirectory::class); + $this->app->bind(OrderDirectory::class, EloquentOrderDirectory::class); + $this->app->bind(Executor::class, ActionExecutorService::class); } /** @@ -31,64 +63,89 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { + $this->laravelGlobalSetup(); + $this->dateSetup(); + $this->dateMacro(); + $this->collectionMacro(); + } + + private function laravelGlobalSetup(): void + { + Model::shouldBeStrict(app()->environment('local')); + + Vite::useCspNonce(); + URL::forceScheme('https'); - if (config('app.env') !== 'local') { - setlocale(LC_TIME, config('app.locale') . "_" . strtoupper(config('app.locale')) . '.utf8'); + } + + private function dateSetup(): void + { + foreach ([\LC_TIME, \LC_MESSAGES, \LC_COLLATE, \LC_CTYPE, \LC_MONETARY] as $constant) { + setlocale( + $constant, + sprintf( + '%s_%s.UTF-8', + config()->string('app.locale'), + strtoupper(config()->string('app.locale')) + ) + ); } + Date::setLocale(config()->string('app.locale')); + Date::setFallbackLocale(config()->string('app.fallback_locale')); + } - if (config('app.env') === 'local') { - setlocale(LC_TIME, strtoupper(config('app.locale')) . "_" . config('app.locale') . '.utf8'); - } + private function dateMacro(): void + { + Date::macro('toLocalInput', function ($date) { + if (! $date) { + return null; + } - if (Schema::hasTable('settings')) { - // The "settings" table exists... - config([ - 'bosettings' => Setting::all() - ->keyBy('key') - // Key every setting by its name. - ->transform(function ($setting) { - return $setting->value; - // Return only the value. - }) - ->toArray() - // Make it an array. - ]); + $timezone = request()->string( + 'client_timezone', + request()->string( + 'client_timezone', + 'Europe/Paris' + )->value() + )->value(); - $front_settings = Setting::where('key', 'LIKE', 'theme_%')->get(); - // Front theme settings. - View::share('front_settings', $front_settings); - } - - if (Schema::hasTable('ranges')) { - // On partage les ranges (gammes produit). - $ranges = Range::where('status', '1')->get(); - View::share('published_ranges', $ranges); - } - - if (Schema::hasTable('tags')) { - // On partage les tags. - $tags = Tag::where('status', '1')->orderBy('order', 'ASC')->get(); - View::share('published_tags', $tags); - } - - // Use blade directives helper to prevent blade files from being cached. - Blade::directive('fmt_currency_without_auth', function ($expression) { - return ""; - }); - Blade::directive('fmt_currency', function ($expression) { - return ""; - }); - Blade::directive('fmt_currency_without_ttc', function ($expression) { - return ""; - }); - Blade::directive('fmt_sellunit', function ($expression) { - return ""; - }); - Blade::directive('excerpt_product_title', function ($expression) { - return ""; + return Date::parse($date) + ->setTimezone($timezone) + ->format('Y-m-d\TH:i'); }); - // Default paginator template for back Office. - Paginator::useBootstrap(); + Date::macro('forHumans', function ($date) { + if (! $date) { + return null; + } + + $timezone = request()->string( + 'client_timezone', + request()->string( + 'client_timezone', + 'Europe/Paris' + )->value() + )->value(); + + return Date::parse($date) + ->setTimezone($timezone) + ->isoFormat('ddd DD/MM/Y \à HH:mm'); + }); + } + + private function collectionMacro(): void + { + Collection::macro('uniqueValues', function () { + return $this->unique(function ($item) { + if ($item instanceof Equatable) { + return $item instanceof \Stringable ? (string) $item : json_encode($item); + } + if ($item instanceof \Stringable) { + return (string) $item; + } + + return $item; + }); + }); } } diff --git a/app/Providers/ArcadiaApiProvider.php b/app/Providers/ArcadiaApiProvider.php new file mode 100644 index 00000000..e35e18d4 --- /dev/null +++ b/app/Providers/ArcadiaApiProvider.php @@ -0,0 +1,72 @@ +app->singleton( + ApiConfig::class, + fn (Application $app) => $this->apiConfig($app->make(LoggerInterface::class)) + ); + $this->app->singleton( + LibEmployeeService::class, + fn (Application $app) => $app->make(ArcadiaApiClient::class)->employees() + ); + $this->app->singleton( + LibIncoService::class, + fn (Application $app) => $app->make(ArcadiaApiClient::class)->incoSheets() + ); + } + + /** + * Bootstrap any application services. + * + * @return void + */ + public function boot() + { + } + + private function apiConfig(LoggerInterface $logger): ApiConfig + { + $endpoint = new Uri(Config::string('services.arcadia_api.endpoint')); + $clientIdentifier = new ClientIdentifier( + Config::string('services.arcadia_api.api_key') + ); + $clientSecret = new ClientSecret( + Config::string('services.arcadia_api.api_secret') + ); + + $ignoreSelfSignedCert = Config::boolean('services.arcadia_api.ignore_self_signed_cert', true); + + return new ApiConfig( + endpoint: $endpoint, + apiKey: $clientIdentifier, + secret: $clientSecret, + ignoreSelfSignedCert: $ignoreSelfSignedCert, + logger: $logger + ); + } +} diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index fd683196..4f76bc1a 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -1,20 +1,68 @@ */ + #[\Override] protected $policies = [ - Product::class => ProductPolicy::class, + // * Policies Exceptions + BasketProduct::class => BasketPolicy::class, + DiscountDto::class => DiscountPolicy::class, + FaqDto::class => FaqPolicy::class, + PageDto::class => PagePolicy::class, + PickupExceptionDto::class => PickupExceptionPolicy::class, + ProductDto::class => ProductPolicy::class, + RangeDto::class => RangePolicy::class, + Setting::class => SettingPolicy::class, + SettingDto::class => SettingPolicy::class, + ShopDto::class => ShopPolicy::class, + SlideDto::class => SlidePolicy::class, + TagDto::class => TagPolicy::class, + FetchAndUpsertArcadiaEmployees::class => EmployeePolicy::class, ]; /** @@ -24,6 +72,50 @@ class AuthServiceProvider extends ServiceProvider */ public function boot() { + $this->app->singleton( + AppAdminAuthService::class, + fn ($app): AppAdminAuthService => new AppAdminAuthService( + Auth::guard('backend') + ) + ); + + $this->app->singleton( + AppCustomerAuthService::class, + fn ($app): AppCustomerAuthService => new AppCustomerAuthService( + Auth::guard('frontend'), + $app->make(CrmService::class) + ) + ); + + Auth::shouldUse($this->currentRouteGuard()); + + Gate::define( + 'customerPassOrders', + fn (Customer $customer): bool => resolve(ShopperService::class) + ->canCustomerPassOrdersApp($customer->getId()) + ); + $this->registerPolicies(); + + Gate::guessPolicyNamesUsing(function (string $modelClass) { + $context = $this->currentRouteGuard() === 'frontend' ? 'Frontend' : 'Backend'; + $classBasename = str_replace('Dto', '', class_basename($modelClass)); + + $policyClass = "App\\Policies\\{$context}\\{$classBasename}Policy"; + + return class_exists($policyClass) ? $policyClass : null; + }); + } + + private function currentRouteGuard(): string + { + $request = $this->app->make(Request::class); + $defaultGuard = Config::string('auth.defaults.guard', 'frontend'); + + return match (true) { + $request->is('bo', 'bo/*') => 'backend', + $request->is('api', 'api/*') => 'api', + default => $defaultGuard, + }; } } diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 395c518b..9bd27861 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -1,5 +1,7 @@ new CrmService( + $app->make(CrmApiV4::class), + $app->make(Repository::class), + )); + + Auth::provider(CrmUserProvider::class, function (Application $app, array $config) { + $hasher = $app->make(Hasher::class); + $crmService = $app->make(CrmService::class); + + return new CrmUserProvider($hasher, $config['model'], $crmService); }); } } diff --git a/app/Providers/DomainServiceProvider.php b/app/Providers/DomainServiceProvider.php new file mode 100644 index 00000000..651a0b98 --- /dev/null +++ b/app/Providers/DomainServiceProvider.php @@ -0,0 +1,130 @@ +app->singleton( + DomainEventDispatcher::class, + LaravelDomainEventDispatcher::class + ); + + $this->app->bind( + OrderRepository::class, + EloquentOrderRepository::class + ); + + $this->app->bind( + PickupExceptionRepository::class, + EloquentPickupExceptionRepository::class + ); + + $this->app->bind( + ShopperRepository::class, + EloquentShopperRepository::class + ); + + $this->app->bind( + ShopRepository::class, + EloquentShopRepository::class + ); + + $this->app->bind( + EmployeeStatisticsService::class, + EloquentEmployeeStatisticsService::class + ); + + $this->app->bind( + ShopDirectory::class, + EloquentShopDirectory::class + ); + + $this->app->bind( + AdminAuthenticationService::class, + AppAdminAuthService::class + ); + + $this->app->bind( + CustomerAuthenticationService::class, + AppCustomerAuthService::class + ); + + $this->app->bind( + ProductRepository::class, + EloquentProductRepository::class + ); + + $this->app->bind( + BasketRepository::class, + SessionBasketRepository::class + ); + + $this->app->bind( + TransactionManager::class, + LaravelTransactionManager::class + ); + + $this->app->bind( + CodeDirectory::class, + EloquentCodeDirectory::class + ); + + $this->app->bind( + EmployeeImportStorageService::class, + EloquentEmployeeImportStorageService::class + ); + + $this->app->bind( + CsvGenerator::class, + CsvGeneratorImpl::class + ); + } + + /** + * Bootstrap any application services. + */ + public function boot(): void + { + // + } +} diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php deleted file mode 100644 index 89dff61f..00000000 --- a/app/Providers/EventServiceProvider.php +++ /dev/null @@ -1,30 +0,0 @@ - [ - SendEmailVerificationNotification::class, - ], - ]; - - /** - * Register any events for your application. - * - * @return void - */ - public function boot() - { - } -} diff --git a/app/Providers/MoneyServiceProvider.php b/app/Providers/MoneyServiceProvider.php new file mode 100644 index 00000000..6ed2bee5 --- /dev/null +++ b/app/Providers/MoneyServiceProvider.php @@ -0,0 +1,81 @@ +app->singleton( + DecimalMoneyFormatter::class, + fn () => new DecimalMoneyFormatter(new ISOCurrencies()) + ); + + $this->app->singleton( + Currency::class, + fn () => new Currency( + // @phpstan-ignore argument.type (Should throw if not provided) + Config::string( + 'app.currency', + 'EUR' + ) + ) + ); + + $this->app->singleton( + \NumberFormatter::class, + fn () => new \NumberFormatter( + Config::string('app.locale', 'fr_FR'), + \NumberFormatter::CURRENCY + ) + ); + + $this->app->singleton(IntlMoneyFormatter::class, function () { + $numberFormatter = $this->app->make(\NumberFormatter::class); + + $currency = $this->app->make(Currency::class); + $numberFormatter->setTextAttribute( + \NumberFormatter::CURRENCY_CODE, + $currency->getCode() + ); + + return new IntlMoneyFormatter($numberFormatter, new ISOCurrencies()); + }); + } + + /** + * Bootstrap any application services. + * + * @return void + */ + public function boot() + { + $this->sharetoView(); + } + + private function sharetoView(): void + { + Blade::directive('money', function ($expression): string { + return "format($expression); ?>"; + }); + Blade::directive('currency', function ($_): string { + return "getCode(); ?>"; + }); + } +} diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index d9023ba4..bc93b955 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -1,16 +1,50 @@ configureRateLimiting(); - $this->routes(function () { - Route::prefix('api') - ->middleware('api') - ->namespace($this->namespace) - ->group(base_path('routes/api.php')); - - Route::middleware('web') - ->namespace($this->namespace) - ->group(base_path('routes/web-bo.php')); - - Route::middleware('web') - ->namespace($this->namespace) - ->group(base_path('routes/web-fo.php')); + Request::macro('pagination', function (int $defaultPageSize = 25): Pagination { + /** @var \Illuminate\Http\Request $this */ + return RequestHelper::pagination($this, $defaultPageSize); }); + $this->routes(function (): void { + Route::middleware([ + self::ROUTE_GROUP_WEB, + 'admin-secure', + 'throttle:' . self::ROUTE_GROUP_WEB, + ])->name('bo.')->prefix('bo') + ->group(base_path('routes/web-bo.php')); + + Route::middleware([ + self::ROUTE_GROUP_WEB, + 'throttle:' . self::ROUTE_GROUP_WEB, + ])->name('fo.') + ->group(base_path('routes/web-fo.php')); + + Route::middleware([ + self::ROUTE_GROUP_WEB_AJAX, + 'throttle:' . self::ROUTE_GROUP_WEB_AJAX, + ])->name('ajax.')->prefix('ajax') + ->group(base_path('routes/ajax-fo.php')); + + Route::middleware([ + self::ROUTE_GROUP_API, + 'throttle:' . self::ROUTE_GROUP_API, + ])->name('api.')->prefix('api') + ->group(base_path('routes/api.php')); + }); + + Route::model('inco', ProductInco::class); + Route::model('faq', Faq::class); + Route::model('tag', Tag::class); + Route::model('slide', Slide::class); + Route::model('range', Range::class); + Route::model('discount', Discount::class); Route::model('product', Product::class); + Route::bind( + 'productWithPricingPublished', + fn (string $value) => $this->resolvePublishedProductWithPricing($value) + ); + + $this->cspReportRoute(); } /** * Configure the rate limiters for the application. - * - * @return void */ - protected function configureRateLimiting() + protected function configureRateLimiting(): void { - RateLimiter::for('api', function (Request $request) { - return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); - }); + RateLimiter::for( + self::ROUTE_GROUP_WEB_CREDENTIALS, + fn (Request $request) => Limit::perMinute(self::RATE_LIMIT_PER_MINUTE_FOR_CREDENTIALS) + ->by($request->user()?->id ?: resolve('clientIp')) + ); + RateLimiter::for( + self::ROUTE_GROUP_WEB, + fn (Request $request) => Limit::perMinute(self::RATE_LIMIT_PER_MINUTE_FOR_WEB) + ->by($request->user()?->id ?: resolve('clientIp')) + ); + RateLimiter::for( + self::ROUTE_GROUP_WEB_AJAX, + fn (Request $request) => Limit::perMinute(self::RATE_LIMIT_PER_MINUTE_FOR_AJAX) + ->by($request->user()?->id ?: resolve('clientIp')) + ); + RateLimiter::for( + self::ROUTE_GROUP_API, + fn (Request $request) => Limit::perMinute(self::RATE_LIMIT_PER_MINUTE_FOR_API) + ->by($request->user()?->id ?: resolve('clientIp')) + ); + } + + private function resolvePublishedProductWithPricing(string $value): ProductWithPricingDto + { + $domainProductRepository = resolve(ProductRepository::class); + $product = Product::query() + ->where('slug', $value) + ->published() + ->firstOrFail(); + + if (Gate::denies('viewPublished', $product)) { + throw new NotFoundHttpException(); + } + + $product->load(['inco', 'validDiscount', 'products']); + + $domainProduct = $domainProductRepository->find($product->getId()); + $pricing = $domainProduct?->pricing(); + + if (! $pricing) { + throw new NotFoundHttpException(); + } + + return new ProductWithPricingDto($product, $pricing); + } + + /** + * * Register CSP report URI + * + * Put this function inside RouteServiceProvider, + * and call it in RouteServiceProvider::boot + */ + private function cspReportRoute(): void + { + // * CSP REPORT URI, Please add /csp-report to VerifyCsrfToken $except middleware + Route::post('/csp-report', function (Request $request): void { + $isCspRequest = in_array( + request()->header('Content-Type'), + [ + 'application/reports+json', + 'application/csp-report', + ] + ); + + abort_if(! $isCspRequest, 401); + + $cspReport = (function (array $data): array { + // Format Reporting API moderne + if (isset($data[0]['type']) && $data[0]['type'] === 'csp-violation') { + return (array) ($data[0]['body'] ?? []); + } + + // Format CSP classique + if (isset($data['csp-report'])) { + return (array) $data['csp-report']; + } + + return []; + })((array) $request->json()->all()); + + // * Filter array keys + $cspReport = Collection::make([ + 'document-uri' => Arr::string($cspReport, 'documentURL', Arr::string($cspReport, 'document-uri', 'unknown')), + 'referrer' => Arr::string($cspReport, 'referrer', ''), + 'blocked-uri' => Arr::string($cspReport, 'blockedURL', Arr::string($cspReport, 'blocked-uri', '')), + 'effective-directive' => Arr::string($cspReport, 'effectiveDirective', Arr::string($cspReport, 'effective-directive', 'unknown')), + 'original-policy' => Arr::string($cspReport, 'originalPolicy', Arr::string($cspReport, 'original-policy', 'unknown')), + 'disposition' => Arr::string($cspReport, 'disposition', 'enforce'), + 'status-code' => Arr::integer( + $cspReport, + 'statusCode', + Arr::integer($cspReport, 'status-code', 200) + ), + 'line-number' => Arr::integer($cspReport, 'lineNumber'), + 'column-number' => Arr::integer($cspReport, 'columnNumber'), + 'source-file' => Arr::string($cspReport, 'sourceFile'), + ]); + Log::warning(sprintf( + "CSP REPORT : \n %s", + $cspReport->transform(fn ($value, $key) => "\t{$key} -> {$value}")->join("\n") + )); + })->middleware('throttle:5,2') + ->withoutMiddleware(PreventRequestForgery::class) + ->name('cspReportUri'); } } diff --git a/app/Providers/SerialCasterServiceProvider.php b/app/Providers/SerialCasterServiceProvider.php new file mode 100644 index 00000000..c90ea8e8 --- /dev/null +++ b/app/Providers/SerialCasterServiceProvider.php @@ -0,0 +1,56 @@ +app->singleton( + BaseConverter::class, + fn () => match (true) { + extension_loaded('bcmath') => new BCMathBaseConverter(), + extension_loaded('gmp') => new GmpBaseConverter(), + default => new NativeBaseConverter(), + } + ); + + $this->app->singleton( + Shuffler::class, + fn () => new FisherYatesShuffler() + ); + + $this->app->singleton( + SerialCasterBuilder::class, + function (Application $app) { + $converter = $app->make(BaseConverter::class); + $shuffler = $app->make(Shuffler::class); + + $seed = Config::integer('serial-caster.seed'); + + return new SerialCasterBuilder($converter) + ->withShuffler($shuffler) + ->withSeed($seed); + } + ); + } +} diff --git a/app/Providers/ShoppingServiceProvider.php b/app/Providers/ShoppingServiceProvider.php new file mode 100644 index 00000000..69494155 --- /dev/null +++ b/app/Providers/ShoppingServiceProvider.php @@ -0,0 +1,52 @@ + new AppSessionService('domain_session_uuid')); + + App::singleton(BasketRepository::class, fn () => new SessionBasketRepository( + resolve(Session::class), + self::BASKET_SESSION_KEY_PREFIX, + resolve(BasketSerializer::class) + )); + + App::singleton(BasketService::class, fn () => new BasketService( + resolve(BasketRepository::class), + resolve(ProductRepository::class), + resolve(SessionService::class) + )); + + App::singleton(OrderBuilderSessionManager::class, fn () => new SessionOrderBuilderManager( + resolve(Session::class), + self::ORDER_BUILDER_SESSION_KEY + )); + } +} diff --git a/app/Providers/TranslationServiceProvider.php b/app/Providers/TranslationServiceProvider.php new file mode 100644 index 00000000..7d7d169d --- /dev/null +++ b/app/Providers/TranslationServiceProvider.php @@ -0,0 +1,104 @@ +app->runningInConsole() && ! $this->app->runningUnitTests()) { + return; + } + + foreach ($this->collectLocalesStrings() as $locale) { + // * Suported locales. + Cache::rememberForever(sprintf('translations.%s', $locale), function () use ($locale) { + $phpTransFallback = $this->phpTranslations(config()->string('app.fallback_locale')); + $phpTransLocale = $this->phpTranslations($locale); + $jsonTransFallback = $this->jsonTranslations(config()->string('app.fallback_locale')); + $jsonTransLocale = $this->jsonTranslations($locale); + + return [ + 'php' => ToolboxHelper::arrayMergeRecursiveDistinct( + $phpTransFallback, + $phpTransLocale, + ), + 'json' => ToolboxHelper::arrayMergeRecursiveDistinct( + $jsonTransFallback, + $jsonTransLocale, + ), + ]; + }); + } // End foreach. + } + + /** + * Gather provided langs checking from files. + * + * @return \Illuminate\Support\Collection + */ + private function collectLocalesStrings(): Collection + { + // * En dur dans ->keys array. + /** @var array */ + $locales = config('app.locales', []); + $files = File::allFiles(base_path('lang/')); + + return Collection::make($files)->flatMap(function (SplFileInfo $file) { + if ($file->getRelativePath() && ! str_starts_with($file->getRelativePath(), 'vendor')) { + return [$file->getRelativePath() => '']; + } + })->keys()->merge($locales); + } + + /** + * Gather all php translations. + * + * @return array + */ + private function phpTranslations(string $locale): array + { + $path = base_path("lang/$locale"); + + if (! File::exists($path) || ! File::isReadable($path)) { + return []; + } + + $files = File::allFiles($path); + + return Collection::make($files)->flatMap(function ($file) use ($locale) { + $translation = $file->getBasename('.php'); + + return [$translation => trans($translation, [], $locale)]; + })->all(); + } + + /** + * Gather json translations. + * + * @return array + */ + private function jsonTranslations(string $locale): array + { + $path = base_path("lang/$locale.json"); + + if (! File::exists($path) || ! File::isReadable($path)) { + return []; + } + + return Arr::wrap(json_decode(File::get($path), true)); + } +} diff --git a/app/Providers/ViewServiceProvider.php b/app/Providers/ViewServiceProvider.php new file mode 100644 index 00000000..3c10a3da --- /dev/null +++ b/app/Providers/ViewServiceProvider.php @@ -0,0 +1,60 @@ +setUpBladeMacros($productRepository); + + if ($this->app->runningInConsole() && ! $this->app->runningUnitTests()) { + return; + } + + $this->setupPaginator(); + } + + private function setupPaginator(): void + { + // * PAGINATOR + if (collect(explode('/', \request()->getPathInfo()))->get(1) === 'bo') { + Paginator::defaultView('bo.modules.pagination'); + } else { + Paginator::defaultView('fo.modules.pagination'); + } + + // * PAGE LIST + View::composer('*', function ($view) { + $view->with('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + $view->with('EmployeeSyncService', resolve(EmployeeSyncService::class)); + }); + } + + private function setUpBladeMacros(EloquentProductRepository $productRepository): void + { + Blade::if( + 'orderable', + fn (Product $product) => $productRepository->toEntity($product)->isOrderable() + ); + } +} diff --git a/app/Queries/Basket/GetBasketQuery.php b/app/Queries/Basket/GetBasketQuery.php new file mode 100644 index 00000000..2e23b43e --- /dev/null +++ b/app/Queries/Basket/GetBasketQuery.php @@ -0,0 +1,33 @@ + + */ +final readonly class GetBasketQuery implements Query +{ + public function __construct( + private BasketService $basketService, + ) { + } + + public function __invoke(QueryInput $input): Basket + { + Assert::isAOf( + $input, + QueryInputEmpty::class, + ); + + return $this->basketService->getBasket(); + } +} diff --git a/app/Queries/Crm/GetCrmCustomerQuery.php b/app/Queries/Crm/GetCrmCustomerQuery.php new file mode 100644 index 00000000..13ce06ec --- /dev/null +++ b/app/Queries/Crm/GetCrmCustomerQuery.php @@ -0,0 +1,39 @@ + + */ +final readonly class GetCrmCustomerQuery implements Query +{ + public function __construct( + private CrmService $crmService, + private AppCustomerAuthService $authService, + ) { + } + + public function __invoke(QueryInput $input): GetCrmCustomerQueryOutput + { + Assert::isAOf( + $input, + GetCrmCustomerQueryInput::class, + ); + + $hashcode = $input->fromHashcodeOrAuthenticatedUserHashcode ?? $this->authService->getCustomerAsMandatory()->hashcode; + + $crmCustomer = $this->crmService->getCustomerFromHashCode( + $hashcode + ); + + return new GetCrmCustomerQueryOutput($crmCustomer); + } +} diff --git a/app/Queries/Crm/GetCrmCustomerQueryInput.php b/app/Queries/Crm/GetCrmCustomerQueryInput.php new file mode 100644 index 00000000..9e0d26de --- /dev/null +++ b/app/Queries/Crm/GetCrmCustomerQueryInput.php @@ -0,0 +1,16 @@ +success = $this->customer !== null && $this->customer instanceof CrmCustomer; + } +} diff --git a/app/Queries/Customers/GetCustomerByEmailQuery.php b/app/Queries/Customers/GetCustomerByEmailQuery.php new file mode 100644 index 00000000..e9043aab --- /dev/null +++ b/app/Queries/Customers/GetCustomerByEmailQuery.php @@ -0,0 +1,29 @@ + + */ +final readonly class GetCustomerByEmailQuery implements Query +{ + public function __invoke(QueryInput $input): ?ShopperId + { + Assert::isInstanceOf($input, GetCustomerByEmailQueryInput::class); + + /** @var Customer|null $customer */ + $customer = Customer::query() + ->where('email', $input->email->value) + ->first(); + + return $customer?->getId(); + } +} diff --git a/app/Queries/Customers/GetCustomerByEmailQueryInput.php b/app/Queries/Customers/GetCustomerByEmailQueryInput.php new file mode 100644 index 00000000..6dcfdc56 --- /dev/null +++ b/app/Queries/Customers/GetCustomerByEmailQueryInput.php @@ -0,0 +1,16 @@ + + */ +final readonly class GetBoDashboardQuery implements Query +{ + public function __construct( + private StatsService $statsService, + ) { + } + + #[\Override] + public function __invoke(QueryInput $input): GetBoDashboardQueryOutput + { + Assert::isInstanceOf($input, GetBoDashboardQueryInput::class); + + $statsShop = []; + $adhesion = $this->statsService->getMembershipPercentage(); + $statsCustomer = []; + $prevDates = null; + + if ($input->start !== null && $input->end !== null) { + $prevDates = $this->statsService->getPreviousPeriod($input->start, $input->end); + $statsShop = $this->statsService->getStats(StatsShopType::cases(), $input->start, $input->end); + $statsCustomer = $this->statsService->getStats(StatsCustomerType::cases(), $input->start, $input->end); + } + + $employeeCount = Employee::query()->active()->count(); + $customersLinkedToEmployeeCount = Employee::query()->active()->whereHas('customer')->count(); + + return new GetBoDashboardQueryOutput( + employeeCount: $employeeCount, + customersLinkedToEmployeeCount: $customersLinkedToEmployeeCount, + adhesion: $adhesion, + prevDates: $prevDates, + statsShop: $statsShop, + statsCustomer: $statsCustomer, + ); + } +} diff --git a/app/Queries/Dashboard/GetBoDashboardQueryInput.php b/app/Queries/Dashboard/GetBoDashboardQueryInput.php new file mode 100644 index 00000000..4aca7faa --- /dev/null +++ b/app/Queries/Dashboard/GetBoDashboardQueryInput.php @@ -0,0 +1,17 @@ + $statsShop + * @param array $statsCustomer + */ + public function __construct( + public int $employeeCount, + public int $customersLinkedToEmployeeCount, + public float | int $adhesion, + public ?CarbonPeriod $prevDates = null, + public array $statsShop = [], + public array $statsCustomer = [], + ) { + } +} diff --git a/app/Queries/Discounts/GetDiscountFormDataQuery.php b/app/Queries/Discounts/GetDiscountFormDataQuery.php new file mode 100644 index 00000000..3975f1d3 --- /dev/null +++ b/app/Queries/Discounts/GetDiscountFormDataQuery.php @@ -0,0 +1,64 @@ + + */ +final readonly class GetDiscountFormDataQuery implements Query +{ + /** + * @param \App\Queries\Discounts\GetDiscountFormDataQueryInput $input + */ + #[\Override] + public function __invoke(QueryInput $input): GetDiscountFormDataQueryOutput + { + Assert::isInstanceOf($input, GetDiscountFormDataQueryInput::class); + + $discountTypes = DiscountType::cases(); + + if ($input->discount !== null) { + $selectedProds = Product::query() + ->select(['id', 'name', 'picture']) + ->where('discount_id', $input->discount->id) + ->orderBy('name') + ->get() + ->map(fn (Product $p): DiscountProductDto => DiscountProductDto::fromModel($p)); + + $existingProds = Product::query() + ->select(['id', 'name', 'picture']) + ->whereNotIn('id', $selectedProds->pluck('id')) + ->orderBy('name') + ->get() + ->map(fn (Product $p): DiscountProductDto => DiscountProductDto::fromModel($p)); + + $discountDto = DiscountDto::fromModel($input->discount); + } else { + $selectedProds = collect(); + $existingProds = Product::query() + ->select(['id', 'name', 'picture']) + ->orderBy('name') + ->get() + ->map(fn (Product $p): DiscountProductDto => DiscountProductDto::fromModel($p)); + + $discountDto = null; + } + + return new GetDiscountFormDataQueryOutput( + discount: $discountDto, + discountTypes: $discountTypes, + existingProds: $existingProds, + selectedProds: $selectedProds, + ); + } +} diff --git a/app/Queries/Discounts/GetDiscountFormDataQueryInput.php b/app/Queries/Discounts/GetDiscountFormDataQueryInput.php new file mode 100644 index 00000000..1d283ed1 --- /dev/null +++ b/app/Queries/Discounts/GetDiscountFormDataQueryInput.php @@ -0,0 +1,16 @@ + $discountTypes + * @param Collection $existingProds + * @param Collection $selectedProds + */ + public function __construct( + public ?DiscountDto $discount, + public array $discountTypes, + public Collection $existingProds, + public Collection $selectedProds, + ) { + } +} diff --git a/app/Queries/Discounts/GetPaginatedDiscountsQuery.php b/app/Queries/Discounts/GetPaginatedDiscountsQuery.php new file mode 100644 index 00000000..a7e799de --- /dev/null +++ b/app/Queries/Discounts/GetPaginatedDiscountsQuery.php @@ -0,0 +1,45 @@ + + * > + */ +final readonly class GetPaginatedDiscountsQuery implements Query +{ + public function __construct( + private DataTableService $dataTable, + ) { + } + + /** + * @param \App\Queries\Discounts\GetPaginatedDiscountsQueryInput $input + * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator + */ + #[\Override] + public function __invoke(QueryInput $input): LengthAwarePaginator + { + Assert::isInstanceOf($input, GetPaginatedDiscountsQueryInput::class); + + $query = Discount::query(); + + $this->dataTable->sortQuery(Discount::class, $query); + + $paginator = $this->dataTable->paginateQuery($query, $input->pagination); + + return $paginator->through(fn (Discount $discount): DiscountDto => DiscountDto::fromModel($discount)); + } +} diff --git a/app/Queries/Discounts/GetPaginatedDiscountsQueryInput.php b/app/Queries/Discounts/GetPaginatedDiscountsQueryInput.php new file mode 100644 index 00000000..4db3b7c4 --- /dev/null +++ b/app/Queries/Discounts/GetPaginatedDiscountsQueryInput.php @@ -0,0 +1,16 @@ +> + */ +final readonly class GetFaqsQuery implements Query +{ + /** + * @return \Illuminate\Support\Collection + */ + public function __invoke(QueryInput $input): Collection + { + Assert::isAOf( + $input, + QueryInputEmpty::class, + ); + + return Faq::query() + ->orderBy('order', 'asc') + ->get() + ->map(fn (Faq $faq): FaqDto => FaqDto::fromModel($faq)); + } +} diff --git a/app/Queries/Faqs/GetPaginatedFaqsQuery.php b/app/Queries/Faqs/GetPaginatedFaqsQuery.php new file mode 100644 index 00000000..d654859c --- /dev/null +++ b/app/Queries/Faqs/GetPaginatedFaqsQuery.php @@ -0,0 +1,42 @@ +> + */ +final readonly class GetPaginatedFaqsQuery implements Query +{ + public function __construct( + private DataTableService $dataTable, + ) { + } + + public function __invoke(QueryInput $input): LengthAwarePaginator + { + Assert::isAOf( + $input, + GetPaginatedFaqsQueryInput::class, + ); + + $query = Faq::query(); + + $this->dataTable->sortQuery(Faq::class, $query); + + $paginator = $this->dataTable->paginateQuery($query, $input->pagination); + + return $paginator->through(fn (Faq $faq): FaqDto => FaqDto::fromModel($faq)); + } +} diff --git a/app/Queries/Faqs/GetPaginatedFaqsQueryInput.php b/app/Queries/Faqs/GetPaginatedFaqsQueryInput.php new file mode 100644 index 00000000..bb667224 --- /dev/null +++ b/app/Queries/Faqs/GetPaginatedFaqsQueryInput.php @@ -0,0 +1,16 @@ + + */ +final readonly class GetBasketSummaryQuery implements Query +{ + public function __construct( + private BasketService $basketService, + ) { + } + + /** + * @param \App\Queries\Orders\GetBasketSummaryQueryInput $input + */ + #[\Override] + public function __invoke(QueryInput $input): GetBasketSummaryQueryOutput + { + Assert::isInstanceOf($input, GetBasketSummaryQueryInput::class); + + return new GetBasketSummaryQueryOutput( + step: OrderTunnelStep::REVIEW, + basket: $this->basketService->getBasket(), + ); + } +} diff --git a/app/Queries/Orders/GetBasketSummaryQueryInput.php b/app/Queries/Orders/GetBasketSummaryQueryInput.php new file mode 100644 index 00000000..6c2e4c51 --- /dev/null +++ b/app/Queries/Orders/GetBasketSummaryQueryInput.php @@ -0,0 +1,14 @@ + + */ +final readonly class GetBoOrderDetailQuery implements Query +{ + public function __construct( + private CrmService $crmService, + ) { + } + + #[\Override] + public function __invoke(QueryInput $input): GetBoOrderDetailQueryOutput + { + Assert::isInstanceOf($input, GetBoOrderDetailQueryInput::class); + + $order = $input->order; + $order->load(['lines', 'shop']); + + $orderDto = OrderDto::fromModel($order); + $shop = $orderDto->shop; + $employee = $orderDto->employee; + + $linkedCustomer = $employee !== null + ? Customer::query() + ->whereHas('employee', fn (Builder $q) => $q->where( + 'matricule', + $employee->matricule->value + ))->first() + : null; + + $crmCustomerResult = $linkedCustomer !== null + ? $this->crmService->getCustomerFromHashCode($linkedCustomer->hashcode) + : null; + + $crmCustomer = $crmCustomerResult instanceof CrmCustomer ? $crmCustomerResult : null; + + return new GetBoOrderDetailQueryOutput( + order: $orderDto, + shop: $shop, + employee: $employee, + crmCustomer: $crmCustomer, + ); + } +} diff --git a/app/Queries/Orders/GetBoOrderDetailQueryInput.php b/app/Queries/Orders/GetBoOrderDetailQueryInput.php new file mode 100644 index 00000000..fe2afd32 --- /dev/null +++ b/app/Queries/Orders/GetBoOrderDetailQueryInput.php @@ -0,0 +1,18 @@ +order->id); + } +} diff --git a/app/Queries/Orders/GetBoOrderDetailQueryOutput.php b/app/Queries/Orders/GetBoOrderDetailQueryOutput.php new file mode 100644 index 00000000..c248cc7a --- /dev/null +++ b/app/Queries/Orders/GetBoOrderDetailQueryOutput.php @@ -0,0 +1,21 @@ + + */ +final readonly class GetBoPaginatedOrdersQuery implements Query +{ + public function __construct( + private DataTableService $dataTable, + ) { + } + + #[\Override] + public function __invoke(QueryInput $input): GetBoPaginatedOrdersQueryOutput + { + Assert::isInstanceOf($input, GetBoPaginatedOrdersQueryInput::class); + + $query = Order::query()->with(['shop']); + + if (! empty($input->search)) { + $this->dataTable->searchQuery( + Order::class, + $query, + $input->search, + fn ($q) => $q->orWhereHas( + 'shop', + fn ($q) => $q->whereLike('name', "%{$input->search}%") + ), + 'reference', + ); + } + + // * Date Order filter + if ($input->orderDateStart !== null) { + if ($input->orderDateEnd !== null) { + $query->whereCreatedAtBetween($input->orderDateStart, $input->orderDateEnd); + } else { + $query->whereCreatedAtBetween($input->orderDateStart, $input->orderDateStart); + } + } + + // * Date Pickup filter + if ($input->orderPickupStart !== null) { + if ($input->orderPickupEnd !== null) { + $query->whereBetween('pickup_day', [ + $input->orderPickupStart, + $input->orderPickupEnd, + ]); + } else { + $query->where('pickup_day', $input->orderPickupStart); + } + } + + if ($input->status !== null) { + $query->where('status', $input->status); + } + + $this->dataTable->sortQuery( + Order::class, + $query, + defaultSortCol: 'date', + defaultSortWay: \SortDirection::Descending, + columnMap: ['date' => 'id'], + ); + + $paginator = $this->dataTable->paginateQuery($query, $input->pagination); + /** @var LengthAwarePaginator $ordersDtoPaginator */ + $ordersDtoPaginator = $paginator->through(fn (Order $order): OrderDto => OrderDto::fromModel($order)); + + $searchFields = str(collect([ + trans('validation.custom.attributes.reference'), + trans_choice('models.classes.shops', 1), + ])->implode(', '))->title()->value(); + + $orderStatusList = OrderStatus::cases(); + + return new GetBoPaginatedOrdersQueryOutput( + orders: $ordersDtoPaginator, + searchFields: $searchFields, + orderStatusList: $orderStatusList, + ); + } +} diff --git a/app/Queries/Orders/GetBoPaginatedOrdersQueryInput.php b/app/Queries/Orders/GetBoPaginatedOrdersQueryInput.php new file mode 100644 index 00000000..1cac9dc3 --- /dev/null +++ b/app/Queries/Orders/GetBoPaginatedOrdersQueryInput.php @@ -0,0 +1,24 @@ + $orders + * @param list $orderStatusList + */ + public function __construct( + public LengthAwarePaginator $orders, + public string $searchFields, + public array $orderStatusList, + ) { + } +} diff --git a/app/Queries/Orders/GetBoTodayOrdersQuery.php b/app/Queries/Orders/GetBoTodayOrdersQuery.php new file mode 100644 index 00000000..dbe7507c --- /dev/null +++ b/app/Queries/Orders/GetBoTodayOrdersQuery.php @@ -0,0 +1,54 @@ + + * > + */ +final readonly class GetBoTodayOrdersQuery implements Query +{ + public function __construct( + private DataTableService $dataTable, + ) { + } + + /** + * @param \App\Queries\Orders\GetBoTodayOrdersQueryInput $input + * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator + */ + #[\Override] + public function __invoke(QueryInput $input): LengthAwarePaginator + { + Assert::isInstanceOf($input, GetBoTodayOrdersQueryInput::class); + + $query = Order::query()->with(['shop']); + + $query->whereCreatedAtBetween(Date::now(), Date::now()); + + $this->dataTable->sortQuery( + Order::class, + $query, + defaultSortCol: 'date', + defaultSortWay: \SortDirection::Descending, + columnMap: ['date' => 'id'], + ); + + $paginator = $this->dataTable->paginateQuery($query, $input->pagination); + + return $paginator->through(fn (Order $order): OrderDto => OrderDto::fromModel($order)); + } +} diff --git a/app/Queries/Orders/GetBoTodayOrdersQueryInput.php b/app/Queries/Orders/GetBoTodayOrdersQueryInput.php new file mode 100644 index 00000000..89d46004 --- /dev/null +++ b/app/Queries/Orders/GetBoTodayOrdersQueryInput.php @@ -0,0 +1,16 @@ + + */ +final readonly class GetFoCustomerOrderDetailQuery implements Query +{ + public function __construct( + private MapUrlService $mapUrlService, + ) { + } + + #[\Override] + public function __invoke(QueryInput $input): GetFoCustomerOrderDetailQueryOutput + { + Assert::isInstanceOf($input, GetFoCustomerOrderDetailQueryInput::class); + + $order = $input->order; + $order->load(['lines']); + + $orderDto = OrderDto::fromModel($order); + $mapUrl = $order->delivery_address !== null + ? $this->mapUrlService->generateUrl($order->delivery_address) + : null; + + return new GetFoCustomerOrderDetailQueryOutput( + order: $orderDto, + mapUrl: $mapUrl, + ); + } +} diff --git a/app/Queries/Orders/GetFoCustomerOrderDetailQueryInput.php b/app/Queries/Orders/GetFoCustomerOrderDetailQueryInput.php new file mode 100644 index 00000000..2e89a3ff --- /dev/null +++ b/app/Queries/Orders/GetFoCustomerOrderDetailQueryInput.php @@ -0,0 +1,18 @@ +order->id); + } +} diff --git a/app/Queries/Orders/GetFoCustomerOrderDetailQueryOutput.php b/app/Queries/Orders/GetFoCustomerOrderDetailQueryOutput.php new file mode 100644 index 00000000..faa206f6 --- /dev/null +++ b/app/Queries/Orders/GetFoCustomerOrderDetailQueryOutput.php @@ -0,0 +1,16 @@ + + * > + */ +final readonly class GetFoCustomerPaginatedOrdersQuery implements Query +{ + /** + * @param \App\Queries\Orders\GetFoCustomerPaginatedOrdersQueryInput $input + * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator + */ + #[\Override] + public function __invoke(QueryInput $input): LengthAwarePaginator + { + Assert::isInstanceOf($input, GetFoCustomerPaginatedOrdersQueryInput::class); + + /** @var \Domain\Models\ValueObjects\Matricule|null $employeeMatricule */ + $employeeMatricule = $input->customer->employee()->value('matricule'); + + if ($employeeMatricule === null) { + return new ConcreteLengthAwarePaginator( + items: [], + total: 0, + perPage: $input->pagination->pageSize()->value(), + currentPage: $input->pagination->pageNumber()->value(), + ); + } + + $paginator = Order::query() + ->where('employee_matricule', $employeeMatricule->value) + ->orderBy('id', SortDirection::Descending) + ->paginate( + perPage: $input->pagination->pageSize()->value(), + page: $input->pagination->pageNumber()->value(), + ); + + return $paginator->through(fn (Order $order): OrderDto => OrderDto::fromModel($order)); + } +} diff --git a/app/Queries/Orders/GetFoCustomerPaginatedOrdersQueryInput.php b/app/Queries/Orders/GetFoCustomerPaginatedOrdersQueryInput.php new file mode 100644 index 00000000..245bf405 --- /dev/null +++ b/app/Queries/Orders/GetFoCustomerPaginatedOrdersQueryInput.php @@ -0,0 +1,20 @@ +customer->id); + } +} diff --git a/app/Queries/Orders/GetOrderConfirmationQuery.php b/app/Queries/Orders/GetOrderConfirmationQuery.php new file mode 100644 index 00000000..8a1202d5 --- /dev/null +++ b/app/Queries/Orders/GetOrderConfirmationQuery.php @@ -0,0 +1,53 @@ + + */ +final readonly class GetOrderConfirmationQuery implements Query +{ + public function __construct( + private OrderTunnelService $orderTunnelService, + private ShopRepository $shopRepository, + ) { + } + + /** + * @param \App\Queries\Orders\GetOrderConfirmationQueryInput $input + */ + #[\Override] + public function __invoke(QueryInput $input): GetOrderConfirmationQueryOutput + { + Assert::isInstanceOf($input, GetOrderConfirmationQueryInput::class); + + $builder = $this->orderTunnelService->getBuilderCompletedOrFail(); + $basket = $builder->getBasket(); + + $shop = $this->shopRepository->find($builder->getShopId()); + + if (! $shop) { + throw new NotFoundHttpException('Shop not found'); + } + + $shopDto = ShopDto::fromDomain($shop); + + return new GetOrderConfirmationQueryOutput( + step: OrderTunnelStep::CONFIRMATION, + basket: $basket, + builder: $builder, + shop: $shopDto, + ); + } +} diff --git a/app/Queries/Orders/GetOrderConfirmationQueryInput.php b/app/Queries/Orders/GetOrderConfirmationQueryInput.php new file mode 100644 index 00000000..b2585d9e --- /dev/null +++ b/app/Queries/Orders/GetOrderConfirmationQueryInput.php @@ -0,0 +1,14 @@ + + */ +final readonly class GetPickTimeSlotQuery implements Query +{ + public function __construct( + private OrderTunnelService $orderTunnelService, + private MapUrlService $mapUrlService, + ) { + } + + /** + * @param \App\Queries\Orders\GetPickTimeSlotQueryInput $input + */ + #[\Override] + public function __invoke(QueryInput $input): GetPickTimeSlotQueryOutput + { + Assert::isInstanceOf($input, GetPickTimeSlotQueryInput::class); + + $shop = $this->orderTunnelService->getShopForCustomer($input->shopperId); + $timeSlots = $this->orderTunnelService->getAvailableTimeSlots($shop); + $shopDto = ShopDto::fromDomain($shop); + $mapUrl = $this->mapUrlService->generateUrl($shopDto); + + return new GetPickTimeSlotQueryOutput( + step: OrderTunnelStep::BOOKING, + shop: $shopDto, + timeSlots: $timeSlots, + mapUrl: $mapUrl, + ); + } +} diff --git a/app/Queries/Orders/GetPickTimeSlotQueryInput.php b/app/Queries/Orders/GetPickTimeSlotQueryInput.php new file mode 100644 index 00000000..3266d40e --- /dev/null +++ b/app/Queries/Orders/GetPickTimeSlotQueryInput.php @@ -0,0 +1,16 @@ + $timeSlots + */ + public function __construct( + public OrderTunnelStep $step, + public ShopDto $shop, + public array $timeSlots, + public string $mapUrl, + ) { + } +} diff --git a/app/Queries/Orders/GetTunnelOrderConfirmedQuery.php b/app/Queries/Orders/GetTunnelOrderConfirmedQuery.php new file mode 100644 index 00000000..cec60aca --- /dev/null +++ b/app/Queries/Orders/GetTunnelOrderConfirmedQuery.php @@ -0,0 +1,52 @@ + + */ +final readonly class GetTunnelOrderConfirmedQuery implements Query +{ + public function __construct( + private MapUrlService $mapUrlService, + ) { + } + + /** + * @param \App\Queries\Orders\GetTunnelOrderConfirmedQueryInput $input + */ + #[\Override] + public function __invoke(QueryInput $input): GetTunnelOrderConfirmedQueryOutput + { + Assert::isInstanceOf($input, GetTunnelOrderConfirmedQueryInput::class); + + $order = $input->order; + $order->loadMissing(['shop', 'lines']); + + $shop = $order->shop; + if (! $shop) { + throw new \UnexpectedValueException('Shop not found for order ' . $order->getId()); + } + + $shopDto = ShopDto::fromModel($shop); + $mapUrl = $this->mapUrlService->generateUrl($shopDto); + $orderDto = OrderDto::fromModel($order); + + return new GetTunnelOrderConfirmedQueryOutput( + step: OrderTunnelStep::CONFIRMATION, + order: $orderDto, + shop: $shopDto, + mapUrl: $mapUrl, + ); + } +} diff --git a/app/Queries/Orders/GetTunnelOrderConfirmedQueryInput.php b/app/Queries/Orders/GetTunnelOrderConfirmedQueryInput.php new file mode 100644 index 00000000..d28a06c4 --- /dev/null +++ b/app/Queries/Orders/GetTunnelOrderConfirmedQueryInput.php @@ -0,0 +1,16 @@ + + */ +final readonly class GetPageQuery implements Query +{ + public function __invoke(QueryInput $input): PageDto + { + Assert::isAOf($input, GetPageQueryInput::class); + + $page = Page::query() + ->where('slug', $input->name->value) + ->firstOrFail(); + + return PageDto::fromModel($page); + } +} diff --git a/app/Queries/Pages/GetPageQueryInput.php b/app/Queries/Pages/GetPageQueryInput.php new file mode 100644 index 00000000..23bb3ba6 --- /dev/null +++ b/app/Queries/Pages/GetPageQueryInput.php @@ -0,0 +1,16 @@ + + * > + */ +final readonly class GetPaginatedPickupExceptionsQuery implements Query +{ + public function __construct( + private DataTableService $dataTable, + ) { + } + + /** + * @param \App\Queries\PickupExceptions\GetPaginatedPickupExceptionsQueryInput $input + * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator + */ + #[\Override] + public function __invoke(QueryInput $input): LengthAwarePaginator + { + Assert::isInstanceOf($input, GetPaginatedPickupExceptionsQueryInput::class); + + $query = PickupException::query(); + + $this->dataTable->sortQuery(PickupException::class, $query); + + $paginator = $this->dataTable->paginateQuery($query, $input->pagination); + + return $paginator->through(fn (PickupException $pe): PickupExceptionDto => PickupExceptionDto::fromModel($pe)); + } +} diff --git a/app/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryInput.php b/app/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryInput.php new file mode 100644 index 00000000..e2726f7f --- /dev/null +++ b/app/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryInput.php @@ -0,0 +1,16 @@ + + */ +final readonly class GetArcadiaIncoPreviewQuery implements Query +{ + public function __construct( + private ArcadiaIncoService $arcadiaIncoService, + ) { + } + + #[\Override] + public function __invoke(QueryInput $input): ?ArcadiaIncoPreviewDto + { + Assert::isInstanceOf($input, GetArcadiaIncoPreviewQueryInput::class); + + return $this->arcadiaIncoService->getPreview($input->noArt); + } +} diff --git a/app/Queries/ProductIncos/GetArcadiaIncoPreviewQueryInput.php b/app/Queries/ProductIncos/GetArcadiaIncoPreviewQueryInput.php new file mode 100644 index 00000000..2d3f6af4 --- /dev/null +++ b/app/Queries/ProductIncos/GetArcadiaIncoPreviewQueryInput.php @@ -0,0 +1,17 @@ +noArt, 1, 'The INCO article number must be greater than or equal to 1.'); + } +} diff --git a/app/Queries/Products/GetBoPaginatedProductsQuery.php b/app/Queries/Products/GetBoPaginatedProductsQuery.php new file mode 100644 index 00000000..a1bc1c27 --- /dev/null +++ b/app/Queries/Products/GetBoPaginatedProductsQuery.php @@ -0,0 +1,123 @@ + + */ +final readonly class GetBoPaginatedProductsQuery implements Query +{ + public function __construct( + private DataTableService $dataTable, + private IntlMoneyFormatter $moneyFormatter, + ) { + } + + #[\Override] + public function __invoke(QueryInput $input): GetBoPaginatedProductsQueryOutput + { + Assert::isAOf($input, GetBoPaginatedProductsQueryInput::class); + + $query = Product::query()->with(['inco', 'range', 'discount', 'validDiscount']); + + if (! empty($input->search)) { + $this->dataTable->searchQuery( + Product::class, + $query, + $input->search, + fn ($q) => $q->orWhereHas( + 'inco', + fn ($q) => $q->whereLike('no_art', "%{$input->search}%") + ), + 'name', + ); + } + + if (! empty($input->brand)) { + $query->where('brand', $input->brand); + } + + if ($input->starred) { + $query->where('star', true); + } + + if ($input->discount !== null && $input->discount !== '') { + if ($input->discount === '0') { + $query->whereHas('discount'); + } else { + $query->where('discount_id', $input->discount); + } + } + + if (! empty($input->tag)) { + $query->whereHas('tags', fn (Builder $q) => $q->where('id', $input->tag)); + } + + if (! empty($input->range)) { + $query->whereHas('range', fn (Builder $q) => $q->where('id', $input->range)); + } + + $this->dataTable->sortQuery(Product::class, $query, ['inco']); + + $paginator = $this->dataTable->paginateQuery($query, $input->pagination); + /** @var \Illuminate\Contracts\Pagination\LengthAwarePaginator $productsDtoPaginator */ + $productsDtoPaginator = $paginator->through(fn (Product $product): ProductDto => ProductDto::fromModel($product)); + + $brands = ProductBrand::cases(); + $ranges = Range::query()->pluck('name', 'id'); + $tags = Tag::query()->pluck('label', 'id'); + $discounts = Discount::query() + ->orderByDesc('id') + ->get() + ->mapWithKeys(fn (Discount $d): array => [ + $d->id => $this->formatDiscountLabel($d), + ]); + $searchFields = str(collect([ + trans('validation.attributes.name'), + trans('validation.custom.attributes.inco_id'), + ])->implode(', '))->title()->value(); + + return new GetBoPaginatedProductsQueryOutput( + products: $productsDtoPaginator, + brands: $brands, + ranges: $ranges, + tags: $tags, + discounts: $discounts, + searchFields: $searchFields, + ); + } + + private function formatDiscountLabel(Discount $discount): string + { + $formattedValue = $discount->value->isPercentage() + ? $discount->value->getPercentage() . ' %' + : $this->moneyFormatter->format($discount->value->getAmount()); + + $label = "#{$discount->id} - {$discount->type->label()} ({$formattedValue})"; + + if ($discount->date_start !== null && $discount->date_end !== null) { + $label .= " [{$discount->date_start->format('d/m/Y')} - {$discount->date_end->format('d/m/Y')}]"; + } elseif ($discount->date_start !== null) { + $label .= ' [' . __('from :date', ['date' => $discount->date_start->format('d/m/Y')]) . ']'; + } elseif ($discount->date_end !== null) { + $label .= ' [' . __('until :date', ['date' => $discount->date_end->format('d/m/Y')]) . ']'; + } + + return $label; + } +} diff --git a/app/Queries/Products/GetBoPaginatedProductsQueryInput.php b/app/Queries/Products/GetBoPaginatedProductsQueryInput.php new file mode 100644 index 00000000..c6ceb52e --- /dev/null +++ b/app/Queries/Products/GetBoPaginatedProductsQueryInput.php @@ -0,0 +1,22 @@ + $products + * @param list $brands + * @param Collection $ranges + * @param Collection $tags + * @param Collection $discounts + */ + public function __construct( + public LengthAwarePaginator $products, + public array $brands, + public Collection $ranges, + public Collection $tags, + public Collection $discounts, + public string $searchFields, + ) { + } +} diff --git a/app/Queries/Products/GetFoFilteredProductsQuery.php b/app/Queries/Products/GetFoFilteredProductsQuery.php new file mode 100644 index 00000000..08c2b13a --- /dev/null +++ b/app/Queries/Products/GetFoFilteredProductsQuery.php @@ -0,0 +1,67 @@ + + * > + */ +final readonly class GetFoFilteredProductsQuery implements Query +{ + #[\Override] + public function __invoke(QueryInput $input): LengthAwarePaginator + { + Assert::isAOf($input, GetFoFilteredProductsQueryInput::class); + + /** @var \Illuminate\Database\Eloquent\Builder $query */ + $query = Product::query() + ->with(['inco', 'validDiscount']) + ->orderBy('order', SortDirection::Ascending) + ->published(); + + if (! empty($input->search)) { + $query->whereLike('name', "%{$input->search}%"); + } + + if ($input->isDiscounted) { + $query->whereHas('validDiscount'); + } + + if (! empty($input->ranges)) { + $query->whereHas( + 'range', + fn ($q) => $q->whereIn('id', $input->ranges) + ); + } + + if (! empty($input->tags)) { + $query->whereHas( + 'tags', + fn ($q) => $q->whereIn('tags.id', $input->tags) + ); + } + + if (! empty($input->brands)) { + $query->whereIn( + 'brand', + $input->brands + ); + } + + return $query->paginate( + perPage: $input->pagination->pageSize()->value(), + page: $input->pagination->pageNumber()->value() + ); + } +} diff --git a/app/Queries/Products/GetFoFilteredProductsQueryInput.php b/app/Queries/Products/GetFoFilteredProductsQueryInput.php new file mode 100644 index 00000000..b965ac61 --- /dev/null +++ b/app/Queries/Products/GetFoFilteredProductsQueryInput.php @@ -0,0 +1,26 @@ + $ranges + * @param array $tags + * @param array $brands + */ + public function __construct( + public Pagination $pagination, + public string $search = '', + public array $ranges = [], + public array $tags = [], + public array $brands = [], + public bool $isDiscounted = false, + ) { + } +} diff --git a/app/Queries/Products/GetFoProductIndexPageQuery.php b/app/Queries/Products/GetFoProductIndexPageQuery.php new file mode 100644 index 00000000..083c985f --- /dev/null +++ b/app/Queries/Products/GetFoProductIndexPageQuery.php @@ -0,0 +1,79 @@ + + */ +final readonly class GetFoProductIndexPageQuery implements Query +{ + #[\Override] + public function __invoke(QueryInput $input): GetFoProductIndexPageQueryOutput + { + Assert::isAOf($input, GetFoProductIndexPageQueryInput::class); + + /** @var \Illuminate\Database\Eloquent\Builder $query */ + $query = Product::query() + ->with(['inco', 'validDiscount']) + ->orderBy('order', SortDirection::Ascending) + ->published(); + + $paginatedProducts = $query->paginate( + perPage: $input->pagination->pageSize()->value(), + page: $input->pagination->pageNumber()->value() + ); + + /** @var \Illuminate\Support\Collection $publishedBrandStringList */ + $publishedBrandStringList = Product::query() + ->published() + ->select(['brand']) + ->distinct() + ->pluck('brand'); + + /** @var Collection $brandList */ + $brandList = Collection::make(ProductBrand::cases())->filter( + fn (ProductBrand $case) => $publishedBrandStringList->contains($case) + )->values(); + + $rangeList = Range::query() + ->orderBy('order') + ->get() + ->map(fn (Range $range): RangeDto => RangeDto::fromModel($range)); + + $tagList = Tag::query() + ->published() + ->orderBy('order') + ->get() + ->map(fn (Tag $tag): TagDto => TagDto::fromModel($tag)); + + $discountList = Discount::query() + ->published() + ->get() + ->map(fn (Discount $discount): DiscountDto => DiscountDto::fromModel($discount)); + + return new GetFoProductIndexPageQueryOutput( + paginatedProducts: $paginatedProducts, + brandList: $brandList, + rangeList: $rangeList, + tagList: $tagList, + discountList: $discountList, + perPage: $input->pagination->pageSize()->value(), + ); + } +} diff --git a/app/Queries/Products/GetFoProductIndexPageQueryInput.php b/app/Queries/Products/GetFoProductIndexPageQueryInput.php new file mode 100644 index 00000000..ae96464b --- /dev/null +++ b/app/Queries/Products/GetFoProductIndexPageQueryInput.php @@ -0,0 +1,16 @@ + $paginatedProducts + * @param Collection $brandList + * @param Collection $rangeList + * @param Collection $tagList + * @param Collection $discountList + */ + public function __construct( + public LengthAwarePaginator $paginatedProducts, + public Collection $brandList, + public Collection $rangeList, + public Collection $tagList, + public Collection $discountList, + public int $perPage, + ) { + } +} diff --git a/app/Queries/Products/GetPaginatedProductsQuery.php b/app/Queries/Products/GetPaginatedProductsQuery.php new file mode 100644 index 00000000..2e58785d --- /dev/null +++ b/app/Queries/Products/GetPaginatedProductsQuery.php @@ -0,0 +1,78 @@ + + * > + */ +final readonly class GetPaginatedProductsQuery implements Query +{ + public function __construct( + private DataTableService $dataTable, + private ProductRepository $domainProductRepository, + ) { + } + + #[\Override] + public function __invoke(QueryInput $input): LengthAwarePaginator + { + Assert::isAOf( + $input, + GetPaginatedProductsQueryInput::class, + ); + + $query = Product::query(); + + if ($input->publishedOnly) { + $query->where('status', true); + } + + if ($input->starOnly) { + $query->where('star', true); + } + + if ($input->withPricing) { + $query->with(['inco', 'validDiscount']); + } + + $this->dataTable->sortQuery(Product::class, $query); + + $paginator = $this->dataTable->paginateQuery($query, $input->pagination); + + if ($input->withPricing) { + /** @var \Illuminate\Contracts\Pagination\LengthAwarePaginator $result */ + $result = $paginator->through(function (Product $product): ProductWithPricingDto { + $domainProduct = $this->domainProductRepository->find($product->getId()); + Assert::notNull($domainProduct, "Domain product not found for ID {$product->id}"); + $pricing = $domainProduct->pricing(); + + return new ProductWithPricingDto( + product: $product, + pricing: $pricing, + ); + }); + + return $result; + } + + /** @var \Illuminate\Contracts\Pagination\LengthAwarePaginator $result */ + $result = $paginator->through(fn (Product $product): ProductDto => ProductDto::fromModel($product)); + + return $result; + } +} diff --git a/app/Queries/Products/GetPaginatedProductsQueryInput.php b/app/Queries/Products/GetPaginatedProductsQueryInput.php new file mode 100644 index 00000000..c27ae829 --- /dev/null +++ b/app/Queries/Products/GetPaginatedProductsQueryInput.php @@ -0,0 +1,19 @@ + + */ +final readonly class GetProductFormDataQuery implements Query +{ + #[\Override] + public function __invoke(QueryInput $input): ProductFormDataDto + { + Assert::isAOf($input, GetProductFormDataQueryInput::class); + + $brands = ProductBrand::cases(); + $taxes = TaxRate::cases(); + $invoicingUnits = InvoicingUnit::cases(); + $sellUnits = SellUnit::cases(); + $orderUnits = OrderUnit::cases(); + $ranges = Range::query()->pluck('name', 'id'); + $tags = Tag::query() + ->select(['id', 'label', 'slug', 'status', 'order']) + ->get() + ->map(fn (Tag $tag): TagDto => TagDto::fromModel($tag)); + + if ($input->product !== null) { + $input->product->loadMissing(['tags', 'inco']); + $selectedProds = $input->product->products() + ->select(['products.*']) + ->get() + ->map(fn (Product $p): ProductDto => ProductDto::fromModel($p)); + + $existingProds = Product::query() + ->where('id', '!=', $input->product->id) + ->whereNotIn('id', $selectedProds->pluck('id')) + ->orderBy('name') + ->get() + ->map(fn (Product $p): ProductDto => ProductDto::fromModel($p)); + } else { + /** @var Collection $selectedProds */ + $selectedProds = Collection::empty(); + $existingProds = Product::query() + ->orderBy('name') + ->get() + ->map(fn (Product $p): ProductDto => ProductDto::fromModel($p)); + } + + return new ProductFormDataDto( + brands: $brands, + taxes: $taxes, + invoicingUnits: $invoicingUnits, + sellUnits: $sellUnits, + orderUnits: $orderUnits, + ranges: $ranges, + tags: $tags, + existingProds: $existingProds, + selectedProds: $selectedProds, + ); + } +} diff --git a/app/Queries/Products/GetProductFormDataQueryInput.php b/app/Queries/Products/GetProductFormDataQueryInput.php new file mode 100644 index 00000000..44825238 --- /dev/null +++ b/app/Queries/Products/GetProductFormDataQueryInput.php @@ -0,0 +1,16 @@ +> + */ +final readonly class GetPaginatedRangesQuery implements Query +{ + public function __construct( + private DataTableService $dataTable, + ) { + } + + public function __invoke(QueryInput $input): LengthAwarePaginator + { + Assert::isAOf( + $input, + GetPaginatedRangesQueryInput::class, + ); + + $query = Range::query(); + + if ($input->publishedOnly) { + $query->where('status', true); + } + + $this->dataTable->sortQuery(Range::class, $query); + + $paginator = $this->dataTable->paginateQuery($query, $input->pagination); + + return $paginator->through(fn (Range $range): RangeDto => RangeDto::fromModel($range)); + } +} diff --git a/app/Queries/Ranges/GetPaginatedRangesQueryInput.php b/app/Queries/Ranges/GetPaginatedRangesQueryInput.php new file mode 100644 index 00000000..c6663f06 --- /dev/null +++ b/app/Queries/Ranges/GetPaginatedRangesQueryInput.php @@ -0,0 +1,17 @@ + + */ +final readonly class GetSettingsQuery implements Query +{ + public function __invoke(QueryInput $input): SettingDto + { + Assert::isAOf( + $input, + QueryInputEmpty::class, + ); + + $setting = Setting::getSingleton(); + + return SettingDto::fromModel($setting); + } +} diff --git a/app/Queries/Shops/GetPaginatedShopsQuery.php b/app/Queries/Shops/GetPaginatedShopsQuery.php new file mode 100644 index 00000000..66628484 --- /dev/null +++ b/app/Queries/Shops/GetPaginatedShopsQuery.php @@ -0,0 +1,58 @@ + + */ +final readonly class GetPaginatedShopsQuery implements Query +{ + public function __construct( + private DataTableService $dataTable, + ) { + } + + /** + * @param \App\Queries\Shops\GetPaginatedShopsQueryInput $input + */ + #[\Override] + public function __invoke(QueryInput $input): GetPaginatedShopsQueryOutput + { + Assert::isInstanceOf($input, GetPaginatedShopsQueryInput::class); + + $query = Shop::query(); + + if ($input->pickupExceptionId !== null) { + $query->whereHas( + 'pickupExceptions', + fn (Builder $q) => $q->where('id', (string) $input->pickupExceptionId) + ); + } + + $this->dataTable->sortQuery(Shop::class, $query); + + $paginator = $this->dataTable->paginateQuery($query, $input->pagination); + $shops = $paginator->through(fn (Shop $shop): ShopDto => ShopDto::fromModel($shop)); + + $pickupExceptions = PickupException::query() + ->get() + ->map(fn (PickupException $pe): PickupExceptionDto => PickupExceptionDto::fromModel($pe)); + + return new GetPaginatedShopsQueryOutput( + shops: $shops, + pickupExceptions: $pickupExceptions, + ); + } +} diff --git a/app/Queries/Shops/GetPaginatedShopsQueryInput.php b/app/Queries/Shops/GetPaginatedShopsQueryInput.php new file mode 100644 index 00000000..e05f1d66 --- /dev/null +++ b/app/Queries/Shops/GetPaginatedShopsQueryInput.php @@ -0,0 +1,18 @@ + $shops + * @param \Illuminate\Support\Collection $pickupExceptions + */ + public function __construct( + public LengthAwarePaginator $shops, + public Collection $pickupExceptions, + ) { + } +} diff --git a/app/Queries/Shops/GetShopPickupExceptionsQuery.php b/app/Queries/Shops/GetShopPickupExceptionsQuery.php new file mode 100644 index 00000000..18dcfee0 --- /dev/null +++ b/app/Queries/Shops/GetShopPickupExceptionsQuery.php @@ -0,0 +1,54 @@ + + */ +final readonly class GetShopPickupExceptionsQuery implements Query +{ + public function __construct( + private ShopRepository $shopRepository, + private PickupSchedulingService $pickupService, + ) { + } + + /** + * @param \App\Queries\Shops\GetShopPickupExceptionsQueryInput $input + */ + #[\Override] + public function __invoke(QueryInput $input): GetShopPickupExceptionsQueryOutput + { + Assert::isInstanceOf($input, GetShopPickupExceptionsQueryInput::class); + + $shop = $input->shop; + $shop->load('pickupExceptions'); + + $domainShop = $this->shopRepository->find($shop->getId()); + + if ($domainShop === null) { + throw new NotFoundHttpException('Shop not found in domain'); + } + + $pickupExceptions = $this->pickupService->getEditablePickupExceptionsFor($domainShop); + $pickupDay = $this->pickupService->getPickupDay(); + $pickupPeriod = $this->pickupService->getPeriodFromPickUpDay(); + + return new GetShopPickupExceptionsQueryOutput( + shop: ShopDto::fromModel($shop), + pickupExceptions: $pickupExceptions, + pickupDay: $pickupDay, + pickupPeriod: $pickupPeriod, + ); + } +} diff --git a/app/Queries/Shops/GetShopPickupExceptionsQueryInput.php b/app/Queries/Shops/GetShopPickupExceptionsQueryInput.php new file mode 100644 index 00000000..4be2d8d4 --- /dev/null +++ b/app/Queries/Shops/GetShopPickupExceptionsQueryInput.php @@ -0,0 +1,16 @@ + $pickupExceptions + */ + public function __construct( + public ShopDto $shop, + public array $pickupExceptions, + public WeekDay $pickupDay, + public CarbonPeriod $pickupPeriod, + ) { + } +} diff --git a/app/Queries/Shops/GetShopQuery.php b/app/Queries/Shops/GetShopQuery.php new file mode 100644 index 00000000..44932580 --- /dev/null +++ b/app/Queries/Shops/GetShopQuery.php @@ -0,0 +1,103 @@ + + */ +final readonly class GetShopQuery implements Query +{ + public function __construct( + private ShopRepository $shopRepository, + private PickupExceptionRepository $pickupExceptionRepository, + ) { + } + + /** + * @param \App\Queries\Shops\GetShopQueryInput $input + */ + #[\Override] + public function __invoke(QueryInput $input): ShopDto + { + Assert::isInstanceOf($input, GetShopQueryInput::class); + + $domainShop = $this->shopRepository->getDefaultShop(); + + $pickupExceptionList = $this->pickupExceptionRepository->getExceptionsAssociatedWithShop($domainShop->id); + $mappedExceptions = Collection::make( + array_map( + fn (ShopPickupOverride $pickupOverride): PickupExceptionDto => $this->mapDomainPickupExceptionToDto( + $pickupOverride, + ), + $pickupExceptionList + ) + ); + + return $this->mapDomainShopToDto( + $domainShop, + $mappedExceptions + ); + } + + /** @param \Illuminate\Support\Collection $pickupExceptionList */ + private function mapDomainShopToDto( + Shop $domainShop, + Collection $pickupExceptionList, + ): ShopDto { + return new ShopDto( + id: $domainShop->id->value->toString(), + name: $domainShop->name, + address: $domainShop->address, + postcode: $domainShop->postcode, + city: $domainShop->city, + phone: $domainShop->phone, + latitude: $domainShop->latitude, + longitude: $domainShop->longitude, + default: $domainShop->isDefault, + pickupExceptions: $pickupExceptionList, + ); + } + + private function mapDomainPickupExceptionToDto(ShopPickupOverride $shopPickupOverride): PickupExceptionDto + { + $exception = $shopPickupOverride->exception; + + return new PickupExceptionDto( + id: $exception->id->value->toString(), + date: $exception->date, + label: $exception->label, + repeatable: $exception->repeatable, + repeat_frequency: $exception->repeatFrequency, + auto_updated: $exception->autoUpdated, + pivot: $this->mapShopPickupExceptionPivotDto( + $shopPickupOverride->replacementDate, + $shopPickupOverride->orderDeadlineAt, + ), + ); + } + + private function mapShopPickupExceptionPivotDto( + ?CarbonInterface $replacementDate, + ?CarbonInterface $orderDeadlineAt, + ): ShopPickupExceptionPivotDto { + return new ShopPickupExceptionPivotDto( + $replacementDate, + $orderDeadlineAt + ); + } +} diff --git a/app/Queries/Shops/GetShopQueryInput.php b/app/Queries/Shops/GetShopQueryInput.php new file mode 100644 index 00000000..50cfbcac --- /dev/null +++ b/app/Queries/Shops/GetShopQueryInput.php @@ -0,0 +1,11 @@ +> + */ +final readonly class GetPaginatedSlidesQuery implements Query +{ + public function __construct( + private DataTableService $dataTable, + ) { + } + + public function __invoke(QueryInput $input): LengthAwarePaginator + { + Assert::isAOf( + $input, + GetPaginatedSlidesQueryInput::class, + ); + + $query = Slide::query(); + + if ($input->publishedOnly) { + $now = Date::now(); + $query->where(function ($q) use ($now): void { + $q->whereNull('date_start') + ->orWhere('date_start', '<=', $now); + })->where(function ($q) use ($now): void { + $q->whereNull('date_end') + ->orWhere('date_end', '>=', $now); + }); + } + + if ($input->forConnectedCustomers === false) { + $query->where('connected', false); + } + + $this->dataTable->sortQuery(Slide::class, $query); + + $paginator = $this->dataTable->paginateQuery($query, $input->pagination); + + return $paginator->through(fn (Slide $slide): SlideDto => SlideDto::fromModel($slide)); + } +} diff --git a/app/Queries/Slides/GetPaginatedSlidesQueryInput.php b/app/Queries/Slides/GetPaginatedSlidesQueryInput.php new file mode 100644 index 00000000..4b93fc68 --- /dev/null +++ b/app/Queries/Slides/GetPaginatedSlidesQueryInput.php @@ -0,0 +1,18 @@ +> + */ +final readonly class GetPaginatedTagsQuery implements Query +{ + public function __construct( + private DataTableService $dataTable, + ) { + } + + public function __invoke(QueryInput $input): LengthAwarePaginator + { + Assert::isAOf( + $input, + GetPaginatedTagsQueryInput::class, + ); + + $query = Tag::query()->with('products.range'); + + $this->dataTable->sortQuery(Tag::class, $query); + + $paginator = $this->dataTable->paginateQuery( + $query, + $input->pagination + ); + + return $paginator->through(fn (Tag $tag): TagDto => TagDto::fromModel($tag)); + } +} diff --git a/app/Queries/Tags/GetPaginatedTagsQueryInput.php b/app/Queries/Tags/GetPaginatedTagsQueryInput.php new file mode 100644 index 00000000..e36e6046 --- /dev/null +++ b/app/Queries/Tags/GetPaginatedTagsQueryInput.php @@ -0,0 +1,16 @@ + + */ +final readonly class GetAvailableTimeslotsQuery implements Query +{ + private const int TIMESLOTS_DAY_TARGET = 28; + + public function __construct( + private readonly PickupSchedulingService $pickupService, + private readonly ShopRepository $shopRepository + ) { + } + + public function __invoke(QueryInput $input): GetAvailableTimeslotsQueryOutput + { + Assert::isAOf( + $input, + GetAvailableTimeslotsQueryInput::class, + ); + + $domainShop = $this->shopRepository->find($input->forShop); + + /** @var \Domain\Models\ValueObjects\PickupTimeSlot[] */ + $timeslotList = []; + + if ($domainShop !== null) { + $timeslotList = $this->pickupService->getTimeSlotsFor( + $domainShop, + $this->getUntil() + ); + } + + return new GetAvailableTimeslotsQueryOutput( + timeslotList: $timeslotList + ); + } + + private function getUntil(): CarbonInterface + { + return CarbonImmutable::now()->addDays(self::TIMESLOTS_DAY_TARGET); + } +} diff --git a/app/Queries/Timeslots/GetAvailableTimeslotsQueryInput.php b/app/Queries/Timeslots/GetAvailableTimeslotsQueryInput.php new file mode 100644 index 00000000..4d9a2ebf --- /dev/null +++ b/app/Queries/Timeslots/GetAvailableTimeslotsQueryInput.php @@ -0,0 +1,16 @@ +timeslotList, + fn ($value) => $value instanceof PickupTimeSlot, + 'All elements of $timeslotList must be instances of PickupTimeSlot' + ); + } +} diff --git a/app/Repositories/EloquentEmployeeRepository.php b/app/Repositories/EloquentEmployeeRepository.php new file mode 100644 index 00000000..90c37dfd --- /dev/null +++ b/app/Repositories/EloquentEmployeeRepository.php @@ -0,0 +1,102 @@ + */ + public function getAll(): array + { + return Employee::query() + ->get() + ->all(); + } + + public function find(UuidInterface $id): ?Employee + { + return Employee::query() + ->where('id', $id->toString()) + ->first(); + } + + public function persist(Employee $employee): void + { + $employee->save(); + } + + public function delete(Employee $employee): void + { + $employee->delete(); + } + + public function findByMatriculeAndCode(Matricule $matricule, Code $code): ?Employee + { + return Employee::query() + ->where('matricule', $matricule->value) + ->where('code', $code->value) + ->first(); + } + + public function findByMatricule(Matricule $matricule): ?Employee + { + return Employee::query() + ->where('matricule', $matricule->value) + ->first(); + } + + /** + * @param array|Collection $matricules + * @return array + */ + public function getWhereMatriculeIn(array | Collection $matricules): array + { + return Employee::query() + ->whereIn('matricule', $matricules) + ->get() + ->all(); + } + + /** + * @param array|Collection $matricules + * @return array + */ + public function getWithCustomerWhereMatriculeIn(array | Collection $matricules): array + { + return Employee::query() + ->with('customer') + ->whereIn('matricule', $matricules) + ->get() + ->keyBy('matricule') + ->all(); + } + + /** + * @param array|Collection $excludedMatricules + * @return array + */ + public function getWithCustomerWhereMatriculeNotIn(array | Collection $excludedMatricules): array + { + return Employee::query() + ->with('customer') + ->whereNotIn('matricule', $excludedMatricules) + ->get() + ->all(); + } + + public function getMostRecentSyncDate(): ?\DateTimeInterface + { + return Employee::query() + ->orderBy('last_sync', 'desc') + ->limit(1) + ->first('last_sync')?->last_sync; + } +} diff --git a/app/Repositories/EloquentOrderRepository.php b/app/Repositories/EloquentOrderRepository.php new file mode 100644 index 00000000..a4f78c5b --- /dev/null +++ b/app/Repositories/EloquentOrderRepository.php @@ -0,0 +1,65 @@ + */ + public function getAll(): array + { + return Order::query()->get()->all(); + } + + public function find(UuidInterface $id): ?Order + { + return Order::query()->find($id->toString()); + } + + public function persist(Order $order): void + { + $order->save(); + } + + public function delete(Order $order): void + { + $order->delete(); + } + + /** @return array */ + public function getValidatedOrdersForPickupDay(CarbonInterface $pickupDay): array + { + return Order::query() + ->whereDate('pickup_day', $pickupDay->format('Y-m-d')) + ->where('status', OrderStatus::VALIDATED) + ->get() + ->all(); + } + + public function hasValidatedOrderForPickupDay(Matricule $matricule, CarbonInterface $pickupDay): bool + { + return Order::query() + ->where('employee_matricule', $matricule->value) + ->whereDate('pickup_day', $pickupDay->format('Y-m-d')) + ->where('status', OrderStatus::VALIDATED) + ->exists(); + } + + /** @return array */ + public function getOrdersWithLinesAndShopForPickupDay(CarbonInterface $pickupDay): array + { + return Order::query() + ->with(['lines', 'shop']) + ->whereDate('pickup_day', $pickupDay->format('Y-m-d')) + ->get() + ->all(); + } +} diff --git a/app/Repositories/EloquentUserRepository.php b/app/Repositories/EloquentUserRepository.php new file mode 100644 index 00000000..d3cc4293 --- /dev/null +++ b/app/Repositories/EloquentUserRepository.php @@ -0,0 +1,27 @@ +find($id); + } + + public function persist(User $user): void + { + $user->save(); + } + + public function delete(User $user): void + { + $user->delete(); + } +} diff --git a/app/Rules/Adult.php b/app/Rules/Adult.php index 84a40a1a..85233812 100644 --- a/app/Rules/Adult.php +++ b/app/Rules/Adult.php @@ -1,98 +1,62 @@ subYears(18); - - if ($this->isSqlDate($value)) { - $d = Carbon::createFromFormat('Y-m-d', $value); - if (!$d->lessThanOrEqualTo($MJ)) { - $this->error_messages = __("Vous devez être majeur pour vous inscrire."); - return false; - } - } elseif ($this->isFormDate($value)) { - $d = Carbon::createFromFormat('d/m/Y', $value); - if (!$d->lessThanOrEqualTo($MJ)) { - $this->error_messages = __("Vous devez être majeur pour vous inscrire."); - return false; - } - } else { - $this->error_messages = __("Erreur sur le champs : date de naissance."); - return false; + return; } - // Pass. - return true; - } + $majorityLimit = Date::now()->subYears(18); - /** - * Get the validation error message. - * - * @return string - */ - public function message() - { - return $this->error_messages; + if ($this->isSqlDate($value)) { + $d = Date::createFromFormat('Y-m-d', $value); + if (! $d?->lessThanOrEqualTo($majorityLimit)) { + $fail('Vous devez être majeur pour vous inscrire.'); + } + } elseif ($this->isFormDate($value)) { + $d = Date::createFromFormat('d/m/Y', $value); + if (! $d?->lessThanOrEqualTo($majorityLimit)) { + $fail('Vous devez être majeur pour vous inscrire.'); + } + } else { + $fail('Erreur sur le champs : date de naissance.'); + } } /** * Check if provided string is formatted for mysql - * - * @param string $date - * @return boolean */ - private function isSqlDate(string $date) + private function isSqlDate(string $date): bool { - if (preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/", $date)) { + if (preg_match('/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/', $date)) { return true; } + return false; } /** * Check if provided string is formatted DD/MM/AAAA - * - * @param string $date - * @return boolean */ - private function isFormDate(string $date) + private function isFormDate(string $date): bool { if (preg_match("/^(0[1-9]|[1-2][0-9]|3[0-1])\/(0[1-9]|1[0-2])\/[0-9]{4}$/", $date)) { return true; } + return false; } } diff --git a/app/Rules/IncoId.php b/app/Rules/IncoId.php new file mode 100644 index 00000000..802f8ac2 --- /dev/null +++ b/app/Rules/IncoId.php @@ -0,0 +1,28 @@ +logger?->info("[{$type}] Executing {$actionName}", [ + 'action' => $executableClass, + 'input' => $input::class, + ]); + + try { + if ($executable instanceof Action) { + $this->assertInputIsAction($input); + + return $this->executeWithinTransaction( + $executable, + $input, + $actionName + ); + } + + $this->assertInputIsQuery($input); + + return $this->executeWithoutTransaction( + $executable, + $input, + $actionName + ); + } catch (\Throwable $e) { + $this->logger?->error("[{$type}] Failed {$actionName}: {$e->getMessage()}", [ + 'action' => $executableClass, + 'input' => $input::class, + 'message' => $e->getMessage(), + 'exception' => $e, + ]); + + throw $e; + } + } + + /** + * @template TQuery of Query + * @template TQueryInput of QueryInput + * + * @param TQuery $executable + * @param TQueryInput $input + */ + private function executeWithoutTransaction(Query $executable, QueryInput $input, string $actionName): mixed + { + $result = $executable($input); + + $this->logger?->info("[Query] Succeeded {$actionName}"); + + return $result; + } + + /** + * @template TAction of Action + * @template TActionInput of ActionInput + * + * @param TAction $executable + * @param TActionInput $input + */ + private function executeWithinTransaction(Action $executable, ActionInput $input, string $actionName): mixed + { + return DB::transaction(function () use ($executable, $input, $actionName): mixed { + $result = $executable($input); + + $this->logger?->info("[Action] Succeeded {$actionName}"); + + return $result; + }); + } + + /** + * @psalm-assert QueryInput $input + */ + private function assertInputIsQuery(mixed $input): void + { + if (! $input instanceof QueryInput) { + throw new \InvalidArgumentException('Input must be an instance of QueryInput.'); + } + } + + /** + * @psalm-assert ActionInput $input + */ + private function assertInputIsAction(mixed $input): void + { + if (! $input instanceof ActionInput) { + throw new \InvalidArgumentException('Input must be an instance of ActionInput.'); + } + } +} diff --git a/app/Services/ArcadiaEmployee.php b/app/Services/ArcadiaEmployee.php new file mode 100644 index 00000000..e256c055 --- /dev/null +++ b/app/Services/ArcadiaEmployee.php @@ -0,0 +1,31 @@ +value}' since '{$since->format(\DATE_ATOM)}'"; + + $this->logger->debug("Fetching {$action}"); + + $result = $this->employeeService->streamAllOfSitesSince( + sites: $this->mapSiteCodeToLib($site), + pageSize: new LibPageSize(self::DEFAULT_PAGE_SIZE), + since: $since + ); + + $this->logger->debug("Succeed fetching {$action}"); + + /** @var \App\Services\ArcadiaEmployee[] $output */ + $output = []; + $apiError = $result->each( + function (LibEmployee $libEmployee) use (&$output) { + $output[] = $this->mapLibEmployees($libEmployee); + } + ); + + if ($apiError instanceof ApiError) { + $message = "Failed to fetch {$action}, reason {$apiError->message()}"; + $this->logger->error($message); + report(new \RuntimeException($message)); + + return false; + } + + return $output; + } + + /** @return \App\Services\ArcadiaEmployee|null|false Returns false when fetching fails. */ + public function employeeExists(Matricule $matricule): ArcadiaEmployee | null | false + { + $action = 'specific employee using matricule'; + + $this->logger->debug("Fetching {$action}"); + + $arcadiaEmployeeId = $this->mapMatriculeToLib($matricule); + + $result = $this->employeeService->findBy($arcadiaEmployeeId); + + if ($result instanceof ApiError) { + $message = "Failed to fetch {$action}, reason {$result->message()}"; + $this->logger->error($message); + report(new \RuntimeException($message)); + + return false; + } + + if ($result instanceof LibEmployee) { + return $this->mapLibEmployees($result); + } + + $this->logger->debug("Succeed fething {$action}"); + + return null; + } + + private function mapLibEmployees(LibEmployee $libEmployee): ArcadiaEmployee + { + return new ArcadiaEmployee( + new Matricule($libEmployee->matriculePublique->value), + $libEmployee->lastname, + $libEmployee->firstname, + $libEmployee->start_date, + $libEmployee->end_date, + new ShopperEstablishmentCode($libEmployee->establishment->value), + new ShopperSiteCode($libEmployee->site->value), + new ShopperServiceCode($libEmployee->service->value), + ); + } + + private function mapSiteCodeToLib(ShopperSiteCode $site): LibSiteId + { + return new LibSiteId($site->value); + } + + private function mapMatriculeToLib(Matricule $value): LibArcadiaEmployeeId + { + return new LibArcadiaEmployeeId($value->value); + } +} diff --git a/app/Services/ArcadiaIncoService.php b/app/Services/ArcadiaIncoService.php new file mode 100644 index 00000000..3d0109b5 --- /dev/null +++ b/app/Services/ArcadiaIncoService.php @@ -0,0 +1,203 @@ +logger->debug("Fetching {$action} from Arcadia API"); + + try { + $incoId = new IncoId((string) $noArt); + } catch (\DomainException $e) { + $this->logger->warning("Invalid IncoId format for #{$noArt}: {$e->getMessage()}"); + + return null; + } + + $inco = $this->incoService->findBy($incoId); + + if ($inco instanceof ApiError) { + $this->logger->error("Failed to fetch {$action}: {$inco->message()}"); + + throw new \RuntimeException($inco->message()); + } + + if (! ($inco instanceof LibInco)) { + $this->logger->info("{$action} not found on Arcadia API (404)"); + + return null; + } + + $compo = $this->incoService->findCompo($incoId); + if ($compo instanceof ApiError) { + $this->logger->warning("Failed to fetch composition for {$action}: {$compo->message()}"); + $compo = null; + } + + return $this->mapToDataDto($inco, $compo instanceof LibIncoCompo ? $compo : null); + } + + public function getPreview(int $noArt): ?ArcadiaIncoPreviewDto + { + $data = $this->fetchInco($noArt); + + if ($data === null) { + return null; + } + + return new ArcadiaIncoPreviewDto( + noArt: $data->noArt, + name: $data->name, + libelle: $data->libelle, + brand: $data->brand, + nutriscore: $data->nutriscore?->value, + servings: $data->servings, + allergens: $data->allergens, + ingredients: $data->ingredients, + preparation: $data->preparation, + energyKcal: $data->nutrition->kcal, + energyKj: $data->nutrition->kj, + fat: $data->nutrition->fatG, + satFat: $data->nutrition->satFatG, + carbs: $data->nutrition->carbG, + sugar: $data->nutrition->sugarG, + fiber: $data->nutrition->fiberG, + protein: $data->nutrition->proteinG, + salt: $data->nutrition->saltG, + ); + } + + private function mapToDataDto(LibInco $inco, ?LibIncoCompo $compo): ArcadiaIncoDataDto + { + $ingredientsHtml = $this->buildIngredientsHtml($inco); + + $preparationHtml = ! empty($inco->preparationAdvices) + ? '

' . nl2br(e(trim($inco->preparationAdvices))) . '

' + : null; + + $sellingArgumentHtml = ! empty($inco->sellArguments) + ? '

' . nl2br(e(trim($inco->sellArguments))) . '

' + : null; + + $servings = $inco->portions !== null ? (string) $inco->portions : null; + if ($servings !== null && mb_strlen($servings) > 20) { + $servings = mb_substr($servings, 0, 20); + } + + $allergens = ! empty($inco->allergens) + ? implode(', ', array_map(fn ($a) => $a->label, $inco->allergens)) + : null; + + $nutriscore = $this->resolveNutriscore($inco, $compo); + $nutrition = $compo !== null ? $this->mapNutrition($compo) : new NutritionalValues(); + + return new ArcadiaIncoDataDto( + noArt: (int) $inco->id->value, + name: $inco->name, + libelle: $inco->libelle, + brand: $inco->brand->label !== '' ? $inco->brand->label : $inco->brand->code->value, + ingredients: $ingredientsHtml, + preparation: $preparationHtml, + servings: $servings, + allergens: $allergens, + sellingArgument: $sellingArgumentHtml, + nutriscore: $nutriscore, + nutriscoreArgs: null, + nutrition: $nutrition, + ); + } + + private function buildIngredientsHtml(LibInco $inco): ?string + { + if ($inco->ingredients->isEmpty()) { + return null; + } + + $paragraphs = []; + foreach ($inco->ingredients->groups as $title => $lines) { + $text = implode(', ', $lines); + if (is_string($title) && ! is_numeric($title) && $title !== '') { + $paragraphs[] = '

' . e($title) . ' : ' . e($text) . '

'; + } else { + $paragraphs[] = '

' . e($text) . '

'; + } + } + + return implode('', $paragraphs); + } + + private function resolveNutriscore(LibInco $inco, ?LibIncoCompo $compo): ?Nutriscore + { + $nutriscoreStr = $inco->nutriscore?->grade; + if (empty($nutriscoreStr) && $compo !== null && ! empty($compo->nutriScore->classement)) { + $nutriscoreStr = $compo->nutriScore->classement; + } + + return ! empty($nutriscoreStr) ? Nutriscore::tryFrom(mb_strtoupper(trim($nutriscoreStr))) : null; + } + + private function mapNutrition(LibIncoCompo $compo): NutritionalValues + { + $parseFloat = static function (?string $val): ?float { + if ($val === null || trim($val) === '' || ! is_numeric(trim($val))) { + return null; + } + $floatVal = (float) trim($val); + + return $floatVal >= 0 ? $floatVal : null; + }; + + return new NutritionalValues( + refWeightG: $parseFloat($compo->energie->tailleReference), + kj: $parseFloat($compo->energie->valEnergKjReference), + kcal: $parseFloat($compo->energie->valEnergKcalReference), + fatG: $parseFloat($compo->macronutrimentsRef->matGrassReference), + satFatG: $parseFloat($compo->macronutrimentsRef->acideGrasSatureReference), + carbG: $parseFloat($compo->macronutrimentsRef->glucidesReference), + sugarG: $parseFloat($compo->macronutrimentsRef->sucreReference), + fiberG: $parseFloat($compo->macronutrimentsRef->fibAlimReference), + proteinG: $parseFloat($compo->macronutrimentsRef->proteineReference), + saltG: $parseFloat($compo->macronutrimentsRef->selReference), + servingSizeG: $parseFloat($compo->energie->taillePortion), + servingKj: $parseFloat($compo->energie->valEnergKjPortion), + servingKcal: $parseFloat($compo->energie->valEnergKcalPortion), + servingFatG: $parseFloat($compo->macronutrimentsPortion->matGrassPortion), + servingSatFatG: $parseFloat($compo->macronutrimentsPortion->acideGrasSaturePortion), + servingCarbG: $parseFloat($compo->macronutrimentsPortion->glucidesPortion), + servingSugarG: $parseFloat($compo->macronutrimentsPortion->sucrePortion), + servingFiberG: $parseFloat($compo->macronutrimentsPortion->fibAlimPortion), + servingProteinG: $parseFloat($compo->macronutrimentsPortion->proteinePortion), + servingSaltG: $parseFloat($compo->macronutrimentsPortion->selPortion), + dailyEnergy: $parseFloat($compo->apportsReference->pourcentApportRefKjoP), + dailyFat: $parseFloat($compo->apportsReference->pourcentApportRefFatP), + dailySatFat: $parseFloat($compo->apportsReference->pourcentApportRefFatsatP), + dailyCarb: $parseFloat($compo->apportsReference->pourcentApportRefChovalP), + dailySugar: $parseFloat($compo->apportsReference->pourcentApportRefSugarP), + dailyFiber: null, + dailyProtein: $parseFloat($compo->apportsReference->pourcentApportRefProP), + dailySalt: $parseFloat($compo->apportsReference->pourcentApportRefSalteqP), + ); + } +} diff --git a/app/Services/CodeGenerationService.php b/app/Services/CodeGenerationService.php new file mode 100644 index 00000000..14d239fc --- /dev/null +++ b/app/Services/CodeGenerationService.php @@ -0,0 +1,46 @@ +serialCaster = $serialCasterBuilder + ->withChars(Code::ALLOWED_CHARACTERS) + ->withLength(Code::LENGTH) + ->build(); + } + + public function generateFrom(Matricule $matricule): Code + { + return $this->generateCodeFromMatricule($matricule); + } + + private function generateCodeFromMatricule(Matricule $value): Code + { + $integerValue = $this->matriculeToInteger($value); + $codeValue = $this->serialCaster->encode($integerValue); + + return new Code($codeValue); + } + + private function matriculeToInteger(Matricule $matricule): int + { + if (! ctype_digit($matricule->value)) { + throw new \InvalidArgumentException('Matricule must be numeric'); + } + + return (int) $matricule->value; + } +} diff --git a/app/Services/CrmService.php b/app/Services/CrmService.php new file mode 100644 index 00000000..0572f7d4 --- /dev/null +++ b/app/Services/CrmService.php @@ -0,0 +1,493 @@ + + */ + private array $customerByHashcodeCache = []; + + /** + * Request-level cache to avoid duplicate CRM calls for the same customer. + * + * @var array + */ + private array $customerByEmailCache = []; + + public function __construct( + private readonly CrmApiV4 $crmApi, + private readonly CacheRepository $cacheRepository + ) { + } + + /** + * @throws \App\Exceptions\CrmServiceException In case of an unhandled error + * @throws \App\Exceptions\Crm\CrmAuthenticationFailedException + * @throws \App\Exceptions\Crm\CrmCustomerNotActivatedException + */ + public function login( + #[\SensitiveParameter] + string $login, + #[\SensitiveParameter] + string $password + ): void { + try { + $result = $this->crmApi->login($login, $password); + if ($result !== true) { + throw new CrmAuthenticationFailedException(); + } + } catch (ApiErrorException $e) { + switch ($e->getApiError()) { + case ApiError::authFailed: + throw new CrmAuthenticationFailedException($e->getMessage()); + case ApiError::customerNotActivated: + throw new CrmCustomerNotActivatedException($e->getMessage()); + default: + report($e); + throw CrmServiceException::of(cause: $e); + } + } catch (CrmException | \Exception $e) { + report($e); + throw CrmServiceException::of(cause: $e); + } + } + + public function resetPasswordFor(Email $email, string $newPassword): bool | IlluminateValidationException + { + try { + $this->login($email->value, $newPassword); + + return IlluminateValidationException::withMessages([ + trans('Your new password must be different from the old one'), + ]); + // phpcs:ignore + } catch (CrmAuthenticationFailedException | CrmCustomerNotActivatedException) { + // Expected: the new password does not match the current one + } + + $crmCustomer = $this->getCustomerFromEmail($email->value); + + if ($crmCustomer === null) { + return IlluminateValidationException::withMessages([ + trans('No account was found for this email address'), + ]); + } + + if ($crmCustomer instanceof CrmServiceException) { + throw $crmCustomer; + } + + $updatedCrmCustomer = $this->newAppCustomerFrom( + $crmCustomer, + ['password' => $newPassword] + ); + + try { + $this->persist($updatedCrmCustomer); + event(new CustomerPasswordUpdated($email)); + + return true; + } catch (IlluminateValidationException $e) { + return $e; + } catch (CrmCustomerExistsException $e) { + throw CrmServiceException::of('Unexpected CrmCustomerExistsException', $e); + } + } + + public function changePassword(CrmCustomer $crmCustomer, string $oldPassword, string $newPassword): CrmCustomer | IlluminateValidationException + { + throw_if( + $crmCustomer->email === null, + new UnexpectedValueException('CRM customer email is required for password change') + ); + + try { + $this->login($crmCustomer->email, $oldPassword); + } catch (CrmAuthenticationFailedException | CrmCustomerNotActivatedException) { + return IlluminateValidationException::withMessages([ + 'password_old' => trans('Your old password does not match.'), + ]); + } + + $updatedCrmCustomer = $this->newAppCustomerFrom( + $crmCustomer, + ['password' => $newPassword] + ); + + try { + $result = $this->persist($updatedCrmCustomer); + throw_if( + ! $result->email, + new UnexpectedValueException('CRM customer email is required for password change event') + ); + event(new CustomerPasswordUpdated(new Email($result->email))); + + return $result; + } catch (IlluminateValidationException $e) { + return $e; + } catch (CrmCustomerExistsException $e) { + throw CrmServiceException::of('Unexpected CrmCustomerExistsException during password change', $e); + } + } + + /** + * @param array{firstname:string,lastname:string,birth_date:string,phone?:string,address?:string,postcode:string,city:string,opt_in?:bool} $data + * + * @throws \App\Exceptions\CrmServiceException In case of an unhandled error + */ + public function updateCustomerInfos(ModelsCustomer $customer, array $data): CrmCustomer | IlluminateValidationException + { + $crmCustomer = $this->getCustomerFromHashCode($customer->hashcode); + + if (! $crmCustomer instanceof CrmCustomer) { + throw $crmCustomer instanceof \Throwable + ? $crmCustomer + : new UnexpectedValueException('CRM customer not found for hashcode: ' . (string) $customer->hashcode); + } + + $updatedData = [ + 'firstname' => $data['firstname'], + 'lastname' => $data['lastname'], + 'birthDate' => $data['birth_date'], + 'address' => $data['address'] ?? null, + 'postcode' => $data['postcode'], + 'city' => $data['city'], + 'phone' => ! empty($data['phone']) ? $data['phone'] : null, + 'optIn' => $data['opt_in'] ?? false, + ]; + + try { + $newCrmCustomer = $this->newAppCustomerFrom( + $crmCustomer, + $updatedData + ); + + return $this->persist($newCrmCustomer); + } catch (IlluminateValidationException $e) { + return $e; + } catch (CrmCustomerExistsException $e) { + throw CrmServiceException::of('Unexpected CrmCustomerExistsException during customer update', $e); + } + } + + public function unsubscribeCustomer(CrmHashcode $hashcode): bool + { + $crmCustomer = $this->getCustomerFromHashCode($hashcode); + + if (! $crmCustomer instanceof CrmCustomer) { + return false; + } + + $updatedCrmCustomer = $this->newAppCustomerFrom( + $crmCustomer, + ['optIn' => false] + ); + + try { + $this->persist($updatedCrmCustomer); + + return true; + } catch (IlluminateValidationException) { + return false; + } catch (CrmCustomerExistsException | CrmServiceException $e) { + throw $e; + } + } + + public function getCustomerFromHashCode(CrmHashcode $hashcode): null | CrmCustomer | CrmServiceException + { + if (array_key_exists($hashcode->value, $this->customerByHashcodeCache)) { + return $this->customerByHashcodeCache[$hashcode->value]; + } + + $cacheKey = $this->getCustomerHashcodeCacheKey($hashcode->value); + + /** @var null|CrmCustomer|CrmServiceException $result */ + $result = $this->cacheRepository->remember( + $cacheKey, + now()->addMinutes(15), + function () use ($hashcode): null | CrmCustomer | CrmServiceException { + try { + $customer = $this->crmApi->getCustomer($hashcode->value); + + return $customer ? + $this->toAppCrmCustomer($customer) : + null; + } catch (ApiErrorException $e) { + if ($e->getApiError()->equals(ApiError::modelNotFound)) { + return null; + } + + return CrmServiceException::of(cause: $e); + } + } + ); + + $this->customerByHashcodeCache[$hashcode->value] = $result; + + return $result; + } + + public function getCustomerFromEmail(string $email): null | CrmCustomer | CrmServiceException + { + $normalizedEmail = strtolower(trim($email)); + + if (array_key_exists($normalizedEmail, $this->customerByEmailCache)) { + return $this->customerByEmailCache[$normalizedEmail]; + } + + $cacheKey = $this->getCustomerEmailCacheKey($normalizedEmail); + + /** @var null|CrmCustomer|CrmServiceException $result */ + $result = $this->cacheRepository->remember( + $cacheKey, + now()->addMinutes(15), + function () use ($normalizedEmail): null | CrmCustomer | CrmServiceException { + try { + $customer = $this->crmApi->getCustomer($normalizedEmail); + + return $customer ? + $this->toAppCrmCustomer($customer) : + null; + } catch (ApiErrorException $e) { + if ($e->getApiError()->equals(ApiError::modelNotFound)) { + return null; + } + + return CrmServiceException::of(cause: $e); + } + } + ); + + $this->customerByEmailCache[$normalizedEmail] = $result; + + return $result; + } + + /** + * @return object{result:bool,message:string} + */ + public function activate(CrmCustomer $customer): object + { + if ($customer->hashcode) { + $this->cacheRepository->delete($this->getCustomerHashcodeCacheKey($customer->hashcode)); + unset($this->customerByHashcodeCache[$customer->hashcode]); + } + if ($customer->email) { + $this->cacheRepository->delete($this->getCustomerEmailCacheKey($customer->email)); + unset($this->customerByEmailCache[strtolower(trim($customer->email))]); + } + + try { + $libCustomer = $this->toLibCrmCustomer($customer); + + return $libCustomer->activate() ? (object) [ + 'result' => true, + 'message' => trans('Your account has been successfully activated, you can now log in.'), + ] : (object) [ + 'result' => false, + 'message' => trans('This activation link is not valid'), + ]; + } catch (\Throwable $e) { + if ($e instanceof ApiErrorException && $e->getApiError()->equals(ApiError::customerAlreadyActive)) { + return (object) [ + 'result' => false, + 'message' => trans('Your account is already activated, you can log in with it now.'), + ]; + } + + report($e); + + return (object) [ + 'result' => false, + 'message' => trans('An error has occurred. Please try again later'), + ]; + } + } + + /** + * @throws \Illuminate\Validation\ValidationException + * @throws \App\Exceptions\Crm\CrmCustomerExistsException + * @throws \App\Exceptions\CrmServiceException + */ + public function persist(CrmCustomer $customer): CrmCustomer + { + if ($customer->hashcode) { + $this->cacheRepository->delete($this->getCustomerHashcodeCacheKey($customer->hashcode)); + unset($this->customerByHashcodeCache[$customer->hashcode]); + } + if ($customer->email) { + $this->cacheRepository->delete($this->getCustomerEmailCacheKey($customer->email)); + unset($this->customerByEmailCache[strtolower(trim($customer->email))]); + } + + try { + $customer = $this->toLibCrmCustomer($customer); + + if (! is_null($customer->hashcode)) { + $this->forceCrmCustomerNotNew($customer); + } + + if (! $customer->save()) { + throw CrmServiceException::of('Failed to save customer into CRM'); + } + + return $this->toAppCrmCustomer($customer); + } catch (ApiErrorException $e) { + $apiError = $e->getApiError(); + if ($apiError->equals(ApiError::validationFailed)) { + throw IlluminateValidationException::withMessages(['error' => $e->getMessage()]); + } + if ($apiError->equals(ApiError::customerExists)) { + throw new CrmCustomerExistsException($e->getMessage()); + } + + throw CrmServiceException::of(cause: $e); + } catch (ValidationException $e) { + throw IlluminateValidationException::withMessages(['error' => $e->getMessage()]); + } catch (CrmException $e) { + throw CrmServiceException::of(cause: $e); + } + } + + /** @param array $andWith */ + public function newAppCustomerFrom(CrmCustomer $existing, array $andWith = []): CrmCustomer + { + $data = array_merge($existing->toArray(), $andWith); + + return new CrmCustomer( + hashcode: $this->stringOrNull($data, 'hashcode'), + email: $this->stringOrNull($data, 'email'), + password: $this->stringOrNull($data, 'password'), + firstname: $this->stringOrNull($data, 'firstname'), + lastname: $this->stringOrNull($data, 'lastname'), + birthDate: $this->stringOrNull($data, 'birthDate'), + phone: $this->stringOrNull($data, 'phone'), + address: $this->stringOrNull($data, 'address'), + address2: $this->stringOrNull($data, 'address2'), + city: $this->stringOrNull($data, 'city'), + postcode: $this->stringOrNull($data, 'postcode'), + country: $data['country'] instanceof Country ? + $data['country'] : + Country::from(Arr::string($data, 'country')), + optIn: Arr::boolean($data, 'optIn'), + status: Arr::boolean($data, 'status'), + lastConnection: $existing->lastConnection, + ); + } + + /** @param array $data */ + private function stringOrNull(array $data, string $key): ?string + { + $value = Arr::get($data, $key); + + return is_string($value) ? $value : null; + } + + private function toAppCrmCustomer(Customer $customer): CrmCustomer + { + return new CrmCustomer( + $customer->hashcode, + $customer->email, + $customer->password, + $customer->firstname, + $customer->lastname, + $customer->birth_date, + $customer->phone, + $customer->address, + $customer->address2, + $customer->city, + $customer->postcode, + $this->toAppCountry($customer->country), + $customer->opt_in, + $customer->status, + $customer->last_connection ? + new \DateTimeImmutable($customer->last_connection) : null + ); + } + + private function toLibCrmCustomer(CrmCustomer $crmCustomer): Customer + { + return new Customer(array_filter([ + 'hashcode' => $crmCustomer->hashcode, + 'email' => $crmCustomer->email, + 'password' => $crmCustomer->password, + 'firstname' => $crmCustomer->firstname, + 'lastname' => $crmCustomer->lastname, + 'birth_date' => $crmCustomer->birthDate, + 'phone' => $crmCustomer->phone, + 'address' => $crmCustomer->address, + 'address2' => $crmCustomer->address2, + 'city' => $crmCustomer->city, + 'postcode' => $crmCustomer->postcode, + 'country' => $this->toLibCountry($crmCustomer->country), + 'opt_in' => $crmCustomer->optIn, + 'status' => $crmCustomer->status, + ], fn ($value) => $value !== null)); + } + + private function toAppCountry(EnumsCountry $country): Country + { + return Country::from($country->value()); + } + + private function toLibCountry(Country $country): EnumsCountry + { + return EnumsCountry::from($country->value()); + } + + /** + * WORKAROUND: Force a Customer model from LDC CRM to not be considered "new" + * by modifying its internal state via Reflection. + * This is needed because the SDK does not provide an update() method + * or a way to mark an entity as existing. + * + * @see https://github.com/ldc/ldccrm-php-sdk/issues/XX + */ + private function forceCrmCustomerNotNew(Customer $customer): void + { + $refClass = new \ReflectionClass($customer::class); + $refProp = $refClass->getProperty('isNew'); + $refProp->setValue($customer, false); + } + + private function getCustomerHashcodeCacheKey(string $hashcode): string + { + return "crm_customer_hashcode_{$hashcode}"; + } + + private function getCustomerEmailCacheKey(string $email): string + { + $hashedEmail = hash('sha256', strtolower(trim($email))); + + return "crm_customer_email_{$hashedEmail}"; + } +} diff --git a/app/Services/DataTableService.php b/app/Services/DataTableService.php new file mode 100644 index 00000000..dfbff089 --- /dev/null +++ b/app/Services/DataTableService.php @@ -0,0 +1,277 @@ + $modelClass + * @param TBuilder $query + * @param (\Closure(TBuilder):(void|TBuilder))|null $searchQuery + */ + public function searchQuery( + string $modelClass, + Builder $query, + string $search, + ?\Closure $searchQuery = null, + string ...$fields + ): Builder { + if (empty($fields)) { + return $query; + } + + $words = array_filter(explode(' ', $search)); + + $query->where(function ($q) use ($modelClass, $searchQuery, $words, $search, $fields): void { + // * Searching words + foreach ($words as $word) { + $this->searchOnFields($modelClass, $q, $word, ...$fields); + } + + // * Searching whole sentence + $this->searchOnFields($modelClass, $q, $search, ...$fields); + + if ($searchQuery) { + $searchQuery($q); + } + }); + + return $query; + } + + /** @var array> */ + private static array $columnsCache = []; + + public static function clearColumnsCache(): void + { + self::$columnsCache = []; + } + + private function hasTableColumn(string $table, string $column): bool + { + if (! isset(self::$columnsCache[$table])) { + self::$columnsCache[$table] = Schema::getColumnListing($table); + } + + return in_array($column, self::$columnsCache[$table], true); + } + + /** + * Sort columns with a query + * + * @template TModel of \Illuminate\Database\Eloquent\Model + * @template TBuilder of \Illuminate\Contracts\Database\Query\Builder + * + * @param class-string $modelClass + * @param TBuilder $query + * @param array $ignore Columns to ignore for sorting. + * @param array $columnMap Map virtual column names to database columns. + */ + public function sortQuery( + string $modelClass, + Builder $query, + array $ignore = [], + ?string $defaultSortCol = null, + SortDirection $defaultSortWay = SortDirection::Ascending, + array $columnMap = [], + ): Builder { + $table = (new $modelClass())->getTable(); + $rName = $this->request->route()?->getName() ?? 'noroute'; + + if ($this->request->has(self::RESET_SORT_KEY)) { + $this->resetSortSession($rName); + } + + $sort = $this->getSortRequest(); + $sort_col = $sort['sort_col']; + $sort_way = $sort['sort_way']; + + if ((! $sort_col || $sort_col === 'undefined') && $defaultSortCol !== null) { + $sort_col = $defaultSortCol; + $sort_way = $defaultSortWay; + } + + $this->persistSortSession($rName, $sort_col, $sort_way); + + $dbCol = $columnMap[$sort_col] ?? $sort_col; + + if ($sort_col && $sort_col !== 'undefined' && $sort_way && ! in_array($sort_col, $ignore) && $this->hasTableColumn($table, $dbCol)) { + $direction = match ($sort_way) { + SortDirection::Descending => 'desc', + default => 'asc', + }; + + $query->orderBy("{$table}.{$dbCol}", $direction); + } elseif ($this->hasTableColumn($table, self::ORDER_COLUMN)) { + $query->orderBy(self::ORDER_COLUMN, 'asc'); + + $this->persistSortSession( + $rName, + self::ORDER_COLUMN, + SortDirection::Ascending + ); + } + + return $query; + } + + /** + * @template TModel of \Illuminate\Database\Eloquent\Model + * + * @param class-string $modelClass + */ + private function searchOnFields( + string $modelClass, + Builder $query, + string $search, + string ...$fields + ): Builder { + $table = (new $modelClass())->getTable(); + $searchTerm = "%{$search}%"; + + foreach ($fields as $field) { + $field = str_replace('?', '\?', $field); + + $searchValue = $this->getSearchValue( + $modelClass, + $search, + $field + ); + + if (is_array($searchValue)) { + foreach ($searchValue as $enumItem) { + $query->orWhereLike( + "{$table}.{$field}", + "%{$enumItem->value}%" + ); + } + + continue; + } + + $query->orWhereLike("{$table}.{$field}", $searchTerm); + } + + return $query; + } + + /** + * @template TModel of \Illuminate\Database\Eloquent\Model + * + * @param class-string $modelClass + * @return string|array + */ + private function getSearchValue( + string $modelClass, + string $search, + string $field + ) { + $cast = (new $modelClass())->getCasts()[$field] ?? null; + + if ($cast && class_exists($cast) && is_subclass_of($cast, BaseEnum::class)) { + $searchLower = mb_strtolower($search); + + return array_values(array_filter( + $cast::cases(), + fn ($item): bool => str_contains( + // @phpstan-ignore method.notFound (PhpStan cannot detect the label() method on BaseEnum cases) + mb_strtolower((string) $item->label()), + $searchLower + ) + )); + } + + return $search; + } + + /** @return array{sort_col:string,sort_way:\SortDirection} */ + public function getSortRequest(): array + { + $rName = $this->request->route()?->getName() ?? 'noroute'; + + return [ + 'sort_col' => $this->request->string( + self::CACHE_SORT_COL_KEY, + $this->session->get("{$rName}." . self::CACHE_SORT_COL_KEY, 'undefined') + )->value(), + 'sort_way' => $this->request->input( + self::CACHE_SORT_WAY_KEY, + $this->session->get("{$rName}." . self::CACHE_SORT_WAY_KEY) + ) === 'desc' ? SortDirection::Descending : SortDirection::Ascending, + ]; + } + + public function persistSortSession(string $rName, ?string $sortCol, ?SortDirection $sortWay): void + { + if ($this->request->has(self::CACHE_SORT_COL_KEY)) { + $this->session->put("{$rName}." . self::CACHE_SORT_COL_KEY, $sortCol); + } + + if ($this->request->has(self::CACHE_SORT_WAY_KEY)) { + $direction = match ($sortWay) { + SortDirection::Descending => 'desc', + default => 'asc', + }; + + $this->session->put("{$rName}." . self::CACHE_SORT_WAY_KEY, $direction); + } + } + + public function resetSortSession(string $rName): void + { + $this->session->forget([ + "{$rName}." . self::CACHE_SORT_COL_KEY, + "{$rName}." . self::CACHE_SORT_WAY_KEY, + "{$rName}." . self::CACHE_SORTED_KEY, + ]); + } + + /** + * Helper to easily paginate and keep query parameters. + * + * @template TModel of \Illuminate\Database\Eloquent\Model + * + * @param \Illuminate\Database\Eloquent\Builder $query + * @return \Illuminate\Pagination\LengthAwarePaginator + */ + public function paginateQuery(\Illuminate\Database\Eloquent\Builder $query, Pagination $pagination): LengthAwarePaginator + { + return $query->paginate( + perPage: $pagination->pageSize()->value(), + page: $pagination->pageNumber()->value() + )->withQueryString(); + } +} diff --git a/app/Services/EmployeeSyncService.php b/app/Services/EmployeeSyncService.php new file mode 100644 index 00000000..e4f99f75 --- /dev/null +++ b/app/Services/EmployeeSyncService.php @@ -0,0 +1,198 @@ +|null $sites + */ + public function synchronize( + ?\DateTimeInterface $since = null, + ?array $sites = null + ): void { + $sitesToSync = $sites ?? ($this->getSettingsQuery)(new QueryInputEmpty())->getShopperSiteCodes(); + $sinceDate = $since ?? Carbon::createFromTimestamp(0); + + $this->logger->info('Starting employee synchronization.', [ + 'since' => $sinceDate->format(Carbon::RFC3339), + 'sites_count' => count($sitesToSync), + ]); + + $totalInserted = 0; + $totalUpdated = 0; + + foreach ($sitesToSync as $siteCode) { + $siteIdentifier = method_exists($siteCode, 'value') ? $siteCode->value : (string) $siteCode; + + $this->logger->debug("Fetching employees for site: {$siteIdentifier}", [ + 'site' => $siteIdentifier, + 'since' => $sinceDate->format(Carbon::RFC3339), + ]); + + $employees = $this->arcadiaEmployeeService->getEmployeesOfSiteSince( + $siteCode, + $sinceDate + ); + + if ($employees === false) { + $this->logger->warning("Failed to fetch employees from Arcadia for site: {$siteIdentifier}", [ + 'site' => $siteIdentifier, + ]); + + continue; + } + + $this->logger->debug("Retrieved employees for site {$siteIdentifier}.", [ + 'site' => $siteIdentifier, + 'count' => count($employees), + ]); + + $result = $this->upsertEmployees($employees); + + $totalInserted += $result->insertedCount; + $totalUpdated += $result->updatedCount; + } + + $this->markLastSync(); + + $this->logger->info('Employee synchronization completed successfully.', [ + 'total_inserted' => $totalInserted, + 'total_updated' => $totalUpdated, + ]); + } + + public function getLastSync(): ?CarbonInterface + { + $timestamp = $this->cacheRepository->get(self::SYNC_TIMESTAMP_CACHE); + + if (! is_string($timestamp)) { + $this->logger->debug('No last synchronization timestamp found in cache.'); + + return null; + } + + return Carbon::parse($timestamp); + } + + private function markLastSync(): void + { + $now = Carbon::now()->format(Carbon::RFC3339); + + $this->cacheRepository->put( + self::SYNC_TIMESTAMP_CACHE, + $now, + 3600 * 36 // Cache for 36 hours + ); + + $this->logger->debug('Last sync timestamp updated in cache.', [ + 'timestamp' => $now, + ]); + } + + /** @param \App\Services\ArcadiaEmployee[] $employeeList */ + private function upsertEmployees(array $employeeList): EmployeeSyncServiceResult + { + $matriculesToInsert = []; + $errors = []; + $upsertData = []; + $importStartTime = CarbonImmutable::now()->subSecond(); + + foreach ($employeeList as $employeeImport) { + $matricule = $employeeImport->matricule->value; + + if (in_array($matricule, $matriculesToInsert, true)) { + $errorMsg = "Duplicate detected in the file: The matricule {$matricule} appears multiple times."; + $errors[] = $errorMsg; + + $this->logger->warning($errorMsg, [ + 'matricule' => $matricule, + ]); + + continue; + } + + $matriculesToInsert[] = $matricule; + + // NOTE: We generate a new code for each row, but only insert it for new records. + $code = $this->codeService->generateFrom(new Matricule($matricule)); + + $upsertData[] = new EmployeeUpsertData( + matricule: $employeeImport->matricule, + firstname: $employeeImport->firstname, + lastname: $employeeImport->lastname, + etablissement: $employeeImport->etablissement, + service: $employeeImport->service, + site: $employeeImport->site, + startDate: $employeeImport->startDate, + endDate: $employeeImport->endDate, + code: $code + ); + } + + if (empty($upsertData) && empty($errors)) { + $errors[] = 'The file contains no valid data.'; + $this->logger->notice('Upsert skipped: No valid employee data found in list.'); + } + + if (! empty($upsertData)) { + $this->logger->debug('Dispatching upsert batch to storage service.', [ + 'batch_size' => count($upsertData), + ]); + + $this->employeeImportStorageService->upsertEmployees($upsertData); + + $result = $this->employeeImportStorageService + ->getImportedAfter( + array_map( + fn ($m) => new Matricule($m), + $matriculesToInsert + ), + $importStartTime + ); + + $insertedCount = $result->insertedCount; + $updatedCount = $result->updatedCount; + + $this->logger->info('Batch upsert completed.', [ + 'inserted' => $insertedCount, + 'updated' => $updatedCount, + 'errors' => count($errors), + ]); + } else { + $insertedCount = 0; + $updatedCount = 0; + } + + return new EmployeeSyncServiceResult( + insertedCount: $insertedCount, + updatedCount: $updatedCount, + errors: $errors, + ); + } +} diff --git a/app/Services/EmployeeSyncServiceResult.php b/app/Services/EmployeeSyncServiceResult.php new file mode 100644 index 00000000..4f41d902 --- /dev/null +++ b/app/Services/EmployeeSyncServiceResult.php @@ -0,0 +1,16 @@ +add('info', $message); + } + + public function success(string $message): void + { + $this->add('success', $message); + } + + public function error(string $message): void + { + $this->add('error', $message); + } + + public function warning(string $message): void + { + $this->add('warning', $message); + } +} diff --git a/app/Services/IcsGeneratorService.php b/app/Services/IcsGeneratorService.php new file mode 100644 index 00000000..28925cbc --- /dev/null +++ b/app/Services/IcsGeneratorService.php @@ -0,0 +1,55 @@ +appName)) { + throw new \InvalidArgumentException('App name must be provided for ICS generation.'); + } + } + + public function generate(IcsContentDto $event): string + { + $dateFormat = 'Ymd\THis\Z'; + $lines = [ + 'BEGIN:VCALENDAR', + 'VERSION:2.0', + 'PRODID:-//' . $this->appName . '//NONSGML v1.0//EN', + 'BEGIN:VEVENT', + 'UID:' . $event->uid, + 'DTSTAMP:' . now()->setTimezone('UTC')->format($dateFormat), + 'DTSTART:' . $event->startsAt->setTimezone('UTC')->format($dateFormat), + 'DTEND:' . $event->endsAt->setTimezone('UTC')->format($dateFormat), + 'SUMMARY:' . $this->escape($event->summary), + 'DESCRIPTION:' . $this->escape($event->description), + ]; + + if ($event->url) { + $lines[] = 'URL:' . $this->escape($event->url); + } + + $lines[] = 'END:VEVENT'; + $lines[] = 'END:VCALENDAR'; + + // NOTE: ICS files must have CRLF line endings + return implode("\r\n", $lines) . "\r\n"; + } + + private function escape(string $text): string + { + $text = str_replace('\\', '\\\\', $text); + $text = str_replace(';', '\;', $text); + $text = str_replace(',', '\,', $text); + $text = str_replace("\n", '\n', $text); + + return $text; + } +} diff --git a/app/Services/MapUrlService.php b/app/Services/MapUrlService.php new file mode 100644 index 00000000..d0402910 --- /dev/null +++ b/app/Services/MapUrlService.php @@ -0,0 +1,23 @@ +name} {$addressable->address} {$addressable->postcode} {$addressable->city}"); + + return ($addressable->latitude && $addressable->longitude) ? + "https://www.openstreetmap.org/?mlat={$addressable->latitude}&mlon={$addressable->longitude}" . + "#map=16/{$addressable->latitude}/{$addressable->longitude}" : + "https://maps.google.com/?q={$query}"; + } +} diff --git a/app/Services/OrderService.php b/app/Services/OrderService.php new file mode 100644 index 00000000..621b6a8f --- /dev/null +++ b/app/Services/OrderService.php @@ -0,0 +1,32 @@ +employee()->value('matricule'); + + if ($employeeMatricule === null) { + return false; + } + + $matriculeValue = $employeeMatricule instanceof Matricule + ? $employeeMatricule->value + : (string) $employeeMatricule; + + return Order::query() + ->where('id', (string) $order->id) + ->where('employee_matricule', $matriculeValue) + ->exists(); + } +} diff --git a/app/Services/StatsService.php b/app/Services/StatsService.php new file mode 100644 index 00000000..c512c235 --- /dev/null +++ b/app/Services/StatsService.php @@ -0,0 +1,329 @@ + $statsType + * @return array + * + * @phpcs:disable Generic.Metrics.CyclomaticComplexity + */ + public function getStats(array $statsType, CarbonInterface $start, CarbonInterface $end): array + { + // phpcs:enable + $stats = []; + foreach ($statsType as $type) { + $previousPeriod = $this->getPreviousPeriod($start, $end); + $previousStart = $previousPeriod->getStartDate(); + $previousEnd = $previousPeriod->getIncludedEndDate(); + + switch ($type) { + case StatsShopType::canceledRate: + $previous = $this->getCanceledRate($previousStart, $previousEnd); + $current = $this->getCanceledRate($start, $end); + break; + case StatsShopType::orderFrequency: + $previous = $this->getOrderFrequency($previousStart, $previousEnd); + $current = $this->getOrderFrequency($start, $end); + break; + case StatsShopType::purchaseFrequency: + $previous = $this->getPurchaseFrequency($previousStart, $previousEnd); + $current = $this->getPurchaseFrequency($start, $end); + break; + case StatsShopType::averageBasketHt: + $previous = $this->getAverageBasketHt($previousStart, $previousEnd); + $current = $this->getAverageBasketHt($start, $end); + break; + case StatsShopType::averageProductCountPerOrder: + $previous = $this->getAverageProductCountPerOrder($previousStart, $previousEnd); + $current = $this->getAverageProductCountPerOrder($start, $end); + break; + case StatsShopType::caHt: + $previous = $this->getCaHt($previousStart, $previousEnd); + $current = $this->getCaHt($start, $end); + break; + case StatsShopType::caTtc: + $previous = $this->getCaTtc($previousStart, $previousEnd); + $current = $this->getCaTtc($start, $end); + break; + case StatsShopType::nbCmdWith7DayDelay: + $previous = $this->getNbCmdWith7DayDelay($previousStart, $previousEnd); + $current = $this->getNbCmdWith7DayDelay($start, $end); + break; + case StatsShopType::nbCmdWith14DayDelay: + $previous = $this->getNbCmdWith14DayDelay($previousStart, $previousEnd); + $current = $this->getNbCmdWith14DayDelay($start, $end); + break; + case StatsShopType::nbActiveClients: + $previous = $this->getNbActiveClients($previousStart, $previousEnd); + $current = $this->getNbActiveClients($start, $end); + break; + case StatsShopType::nbValidateCmd: + $previous = $this->getNbValidateCmd($previousStart, $previousEnd); + $current = $this->getNbValidateCmd($start, $end); + break; + case StatsShopType::nbWaitingCmd: + $previous = $this->getNbWaitingCmd($previousStart, $previousEnd); + $current = $this->getNbWaitingCmd($start, $end); + break; + case StatsShopType::nbCanceledCmd: + $previous = $this->getNbCanceledCmd($previousStart, $previousEnd); + $current = $this->getNbCanceledCmd($start, $end); + break; + case StatsCustomerType::nbSalarie: + $previous = $this->getActiveEmployeesCount($previousStart, $previousEnd); + $current = $this->getActiveEmployeesCount($start, $end); + break; + case StatsCustomerType::nbSalarieWithAccount: + $previous = $this->getActiveEmployeesCountWithAnAccount($previousStart, $previousEnd); + $current = $this->getActiveEmployeesCountWithAnAccount($start, $end); + break; + case StatsCustomerType::membershipRate: + $previous = $this->getMembershipRate($previousStart, $previousEnd); + $current = $this->getMembershipRate($start, $end); + break; + default: + throw new \InvalidArgumentException("Unknown stats type: {$type->label()}"); + } + + $stats[$type->value] = [ + 'previous' => $previous, + 'current' => $current, + 'diff' => $current - $previous, + ]; + } + + return $stats; + } + + /** + * Get the percentage of active registered people / people with a generated code + */ + public function getMembershipRate(CarbonInterface $start, CarbonInterface $end): float + { + $registered = $this->getActiveEmployeesCountWithAnAccount($start, $end); + $employee = $this->getActiveEmployeesCount($start, $end); + + return $employee ? round($registered / $employee * 100, 2) : 0.0; + } + + /** + * Get the previous period of the selected date. + */ + public function getPreviousPeriod(CarbonInterface $start, CarbonInterface $end): CarbonPeriod + { + $diffDays = $start->copy()->diffInDays($end); + + return CarbonPeriod::create( + $start->copy()->subDays($diffDays + 1), + $start->copy()->subDay() + ); + } + + /** + * Get the percentage of registered people / people with a generated code + */ + public function getMembershipPercentage(): float + { + $employee = $this->employeeDirectory->countActiveEmployees(); + $registered = $this->employeeDirectory->countActiveRegisteredEmployees(); + + return $employee ? round($registered / $employee * 100, 2) : 0.0; + } + + /** + * Get the number of active employees within the date range. + */ + private function getActiveEmployeesCount(CarbonInterface $start, CarbonInterface $end): int + { + return $this->employeeDirectory->countActiveEmployeesWithin($start, $end); + } + + /** + * Get the number of active registered employees within the date range. + */ + private function getActiveEmployeesCountWithAnAccount(CarbonInterface $start, CarbonInterface $end): int + { + return $this->employeeDirectory->countActiveRegisteredEmployeesWithin($start, $end); + } + + /** + * Get all validated orders. + * + * @return Collection + */ + private function getValidatedOrders(CarbonInterface $start, CarbonInterface $end): Collection + { + return $this->orderDirectory->getValidatedOrders($start, $end); + } + + /** + * Get the number of validated command. + */ + private function getNbValidateCmd(CarbonInterface $start, CarbonInterface $end): int + { + return $this->getValidatedOrders($start, $end)->count(); + } + + /** + * Get the number of waiting command. + */ + private function getNbWaitingCmd(CarbonInterface $start, CarbonInterface $end): int + { + return $this->getOrdersByStatus(OrderStatus::WAITING, $start, $end)->count(); + } + + /** + * Get the number of canceled command. + */ + private function getNbCanceledCmd(CarbonInterface $start, CarbonInterface $end): int + { + return $this->getOrdersByStatus(OrderStatus::CANCELED, $start, $end)->count(); + } + + /** + * Get orders by status. + * + * @return Collection + */ + private function getOrdersByStatus(OrderStatus $statusId, CarbonInterface $start, CarbonInterface $end): Collection + { + return $this->orderDirectory->getOrdersByStatus($statusId, $start, $end); + } + + /** + * Get the canceled command rate. + */ + private function getCanceledRate(CarbonInterface $start, CarbonInterface $end): float + { + $nbWaitingCmd = $this->getNbWaitingCmd($start, $end); + $nbCanceledCmd = $this->getNbCanceledCmd($start, $end); + $nbValidateCmd = $this->getNbValidateCmd($start, $end); + + // Prevent division by 0. + if (($nbValidateCmd + $nbWaitingCmd + $nbCanceledCmd) !== 0) { + return round( + (($nbWaitingCmd + $nbCanceledCmd) / ($nbValidateCmd + $nbWaitingCmd + $nbCanceledCmd)) * 100, + 2 + ); + } + + return 0.0; + } + + /** + * Get the order frequency. + */ + private function getOrderFrequency(CarbonInterface $start, CarbonInterface $end): float + { + $nbValidateCmd = $this->getNbValidateCmd($start, $end); + $period = new CarbonPeriod($start, $end)->count(); + + return round($nbValidateCmd / $period, 2); + } + + /** + * Get the order frequency. + */ + private function getPurchaseFrequency(CarbonInterface $start, CarbonInterface $end): float + { + $activeClients = $this->getNbActiveClients($start, $end); + if (! $activeClients) { + return 0.0; + } + $nbValidateCmd = $this->getNbValidateCmd($start, $end); + + return round($nbValidateCmd / $activeClients, 2); + } + + /** + * Get the number of active clients (ordered in the period). + */ + private function getNbActiveClients(CarbonInterface $start, CarbonInterface $end): int + { + return $this->orderDirectory->getNbActiveClients($start, $end); + } + + /** + * Get the number command where the collect day is 7 days after the order. + */ + private function getNbCmdWith7DayDelay(CarbonInterface $start, CarbonInterface $end): int + { + return $this->orderDirectory->getNbCmdWith7DayDelay($start, $end); + } + + /** + * Get the number command where the collect day is 14 days after the order. + */ + private function getNbCmdWith14DayDelay(CarbonInterface $start, CarbonInterface $end): int + { + return $this->orderDirectory->getNbCmdWith14DayDelay($start, $end); + } + + /** + * Get the CA HT. + */ + private function getCaHt(CarbonInterface $start, CarbonInterface $end): float + { + return $this->orderDirectory->getCaHt($start, $end); + } + + /** + * Get the CA TTC. + */ + private function getCaTtc(CarbonInterface $start, CarbonInterface $end): float + { + return $this->orderDirectory->getCaTtc($start, $end); + } + + /** + * Get the average basket HT. + */ + private function getAverageBasketHt(CarbonInterface $start, CarbonInterface $end): float + { + // Prevent division by 0. + if ($this->getNbValidateCmd($start, $end) !== 0) { + return round($this->getCaHt($start, $end) / $this->getNbValidateCmd($start, $end), 2); + } + + return 0.0; + } + + /** + * Get the average product count per order. + */ + private function getAverageProductCountPerOrder(CarbonInterface $start, CarbonInterface $end): float + { + $nbValidateCmd = $this->getNbValidateCmd($start, $end); + + // Prevent division by 0. + if ($nbValidateCmd !== 0) { + $totalQty = $this->orderDirectory->getTotalQuantity($start, $end); + + return round((float) $totalQty / $nbValidateCmd, 2); + } + + return 0.0; + } +} diff --git a/app/Traits/Controllers/ChangesModelOrder.php b/app/Traits/Controllers/ChangesModelOrder.php index 374bf7bc..cb0b4b23 100644 --- a/app/Traits/Controllers/ChangesModelOrder.php +++ b/app/Traits/Controllers/ChangesModelOrder.php @@ -1,55 +1,64 @@ route()->parameterNames); - $className = Str::ucfirst(Str::lower($params->get($params->count() - 2))); - $className = "\\App\\Models\\$className"; + public function changeOrder( + Model & ModelWithOrder $model, + ChangeOrderRequest $request, + ChangeModelOrder $action, + Executor $executor, + FlashMessageService $flashMessageService + ): RedirectResponse { + $direction = $request->getSortDirection(); - if (!class_exists($className)) { - throw new \RuntimeException("The $className class doesn't exist."); + $changed = $executor->execute($action, new ChangeModelOrderInput($model, $direction)); + + if (! $changed) { + $flashMessageService->error(trans('crud.messages.order_not_changed')); + + return back(); } - /** @var \Illuminate\Database\Eloquent\Model|null */ - $model = $className::where('id', $model->id)->first(); + $flashMessageService->success(trans('crud.messages.order_changed')); - if (!$model) { - return redirect()->back()->with('error', trans('crud.messages.order_not_changed')); + return back(); + } + + public function changeSelectedOrder( + Model & ModelWithOrder $model, + ChangeSelectedOrderRequest $request, + ChangeModelOrderPosition $action, + Executor $executor, + FlashMessageService $flashMessageService + ): RedirectResponse { + $changed = $executor->execute( + $action, + $request->toChangeModelOrderPositionInput($model) + ); + + if (! $changed) { + $flashMessageService->error(trans('crud.messages.order_not_changed')); + + return back(); } - return DB::transaction(function () use ($request, $className, $model) { - /** @var \Illuminate\Database\Eloquent\Model|null */ - $tmp = $className::where('order', $request->direction ? '<' : '>', $model->order) - ->orderBy('order', $request->direction ? 'DESC' : 'ASC')->first(); + $flashMessageService->success(trans('crud.messages.order_changed')); - if (!$tmp) { - return redirect()->back()->with('error', trans('crud.messages.order_not_changed')); - } - - $newOrder = $tmp->order; - $tmp->order = $model->order; - $model->order = $newOrder; - $tmp->saveOrFail(); - $model->saveOrFail(); - - return redirect()->back()->with('success', trans('crud.messages.order_changed')); - }); + return back(); } } diff --git a/app/Traits/Controllers/HasMassActions.php b/app/Traits/Controllers/HasMassActions.php new file mode 100644 index 00000000..de5ed57d --- /dev/null +++ b/app/Traits/Controllers/HasMassActions.php @@ -0,0 +1,50 @@ +getModelClass(); + $model = new $modelClass(); + $type = $request->getMassActionType(); + + if (in_array($type, [MassActionType::Star, MassActionType::Unstar], true)) { + $this->authorize('toggleStar', $model); + } + + if (in_array($type, [MassActionType::Publish, MassActionType::Unpublish], true)) { + $this->authorize('toggleStatus', $model); + } + + $executor->execute($action, $request->toExecuteMassActionInput($modelClass)); + + $message = match ($type) { + MassActionType::Star, MassActionType::Unstar => trans('crud.messages.star_saved'), + MassActionType::Publish, MassActionType::Unpublish => trans('crud.messages.publish_status_saved'), + }; + + return back()->with('info', $message); + } +} diff --git a/app/Traits/Controllers/TogglesModelStar.php b/app/Traits/Controllers/TogglesModelStar.php new file mode 100644 index 00000000..3e4bff68 --- /dev/null +++ b/app/Traits/Controllers/TogglesModelStar.php @@ -0,0 +1,36 @@ +authorize('toggleStar', $model); + + $executor->execute($action, new ToggleModelStarInput($model)); + + return back()->with('success', trans('crud.messages.has_been_updated', [ + 'model' => Str::ucfirst(trans_choice('models.classes.' . $model->getTable(), 1)), + ])); + } +} diff --git a/app/Traits/Controllers/TogglesModelStatus.php b/app/Traits/Controllers/TogglesModelStatus.php new file mode 100644 index 00000000..31e2ab3d --- /dev/null +++ b/app/Traits/Controllers/TogglesModelStatus.php @@ -0,0 +1,36 @@ +authorize('toggleStatus', $model); + + $executor->execute($action, new ToggleModelStatusInput($model)); + + return back()->with('success', trans('crud.messages.has_been_updated', [ + 'model' => Str::ucfirst(trans_choice('models.classes.' . $model->getTable(), 1)), + ])); + } +} diff --git a/app/Traits/Controllers/UpdateModelStatus.php b/app/Traits/Controllers/UpdateModelStatus.php deleted file mode 100644 index 33156887..00000000 --- a/app/Traits/Controllers/UpdateModelStatus.php +++ /dev/null @@ -1,30 +0,0 @@ -status = !$model->status; - $model->saveOrFail(); - - if (!$model->saveOrFail()) { - return redirect()->back()->with('error', __('The status could not be changed')); - } - return redirect()->back()->with('success', __('The status has been changed')); - } -} diff --git a/app/Traits/Models/HasOrder.php b/app/Traits/Models/HasOrder.php new file mode 100644 index 00000000..bbc7dcfd --- /dev/null +++ b/app/Traits/Models/HasOrder.php @@ -0,0 +1,21 @@ +getAttribute('order'); + + return is_numeric($order) ? (int) $order : 0; + } + + public function setOrder(int $order): void + { + $this->setAttribute('order', $order); + } +} diff --git a/app/Traits/Models/HasStar.php b/app/Traits/Models/HasStar.php new file mode 100644 index 00000000..53de9f0d --- /dev/null +++ b/app/Traits/Models/HasStar.php @@ -0,0 +1,32 @@ +setAttribute('star', $value); + } + + public function toggleStar(): void + { + $star = boolval($this->getAttribute('star')); + $this->setAttribute('star', ! $star); + } + + protected static function makeStarSense(self $model): void + { + if ($model->isDirty('star')) { + $session = resolve(Session::class); + $session->flash('info', \trans( + 'crud.messages.star_saved' + )); + } + } +} diff --git a/app/Traits/Models/HasStatus.php b/app/Traits/Models/HasStatus.php new file mode 100644 index 00000000..d7ee975d --- /dev/null +++ b/app/Traits/Models/HasStatus.php @@ -0,0 +1,32 @@ +setAttribute('status', $value); + } + + public function toggleStatus(): void + { + $status = boolval($this->getAttribute('status')); + $this->setAttribute('status', ! $status); + } + + protected static function makeStatusSense(self $model): void + { + if ($model->isDirty('status')) { + $session = resolve(Session::class); + $session->flash('info', \trans( + 'crud.messages.publish_status_saved' + )); + } + } +} diff --git a/app/Traits/Models/HasUuidV7AsPrimaryKey.php b/app/Traits/Models/HasUuidV7AsPrimaryKey.php new file mode 100644 index 00000000..3ab37bb1 --- /dev/null +++ b/app/Traits/Models/HasUuidV7AsPrimaryKey.php @@ -0,0 +1,46 @@ +keyType = 'string'; + $this->incrementing = false; + } + + public function newUniqueId(): string + { + return (string) Uuid::uuid7(); + } + + public function getCreatedAtColumn() + { + return null; + } + + /** + * @return \Illuminate\Database\Eloquent\Casts\Attribute<\Carbon\CarbonInterface|null,never> + */ + protected function createdAt(): Attribute + { + return Attribute::make( + get: fn (): ?CarbonInterface => $this->{$this->getKeyName()} + ? CarbonImmutable::instance(UuidV7::fromString($this->{$this->getKeyName()})->getDateTime()) + : null, + ); + } +} diff --git a/app/Traits/Models/IsCachedAsCollection.php b/app/Traits/Models/IsCachedAsCollection.php new file mode 100644 index 00000000..212b618f --- /dev/null +++ b/app/Traits/Models/IsCachedAsCollection.php @@ -0,0 +1,77 @@ + $cacheConditions + * + * @mixin \Illuminate\Database\Eloquent\Model + */ +trait IsCachedAsCollection +{ + public static function bootIsCachedAsCollection(): void + { + $flush = fn () => static::removeCached(); + + static::saved($flush); + static::deleted($flush); + } + + /** + * @return \Illuminate\Database\Eloquent\Collection + */ + public static function getCached(): Collection + { + /** @var \Illuminate\Database\Eloquent\Collection */ + return Cache::remember(static::getCacheKeyName(), 48 * 60 * 60, function () { + $query = static::query(); + + if (property_exists(static::class, 'cacheConditions')) { + // @phpstan-ignore property.staticAccess + $query->where(static::$cacheConditions); + } + + $results = static::queryCached($query)->get(); + + return static::filterQuery($results); + }); + } + + public static function removeCached(): void + { + Cache::forget(static::getCacheKeyName()); + } + + /** + * @param \Illuminate\Database\Eloquent\Builder $query + * @return \Illuminate\Database\Eloquent\Builder + */ + protected static function queryCached(Builder $query): Builder + { + return $query; + } + + /** + * @param \Illuminate\Database\Eloquent\Collection $results + * @return \Illuminate\Database\Eloquent\Collection + */ + protected static function filterQuery(Collection $results): Collection + { + return $results; + } + + protected static function getCacheKeyName(): string + { + return 'model_cache_' . strtolower(class_basename(static::class)); + } +} diff --git a/app/Traits/Requests/HasPicture.php b/app/Traits/Requests/HasPicture.php new file mode 100644 index 00000000..d041f683 --- /dev/null +++ b/app/Traits/Requests/HasPicture.php @@ -0,0 +1,290 @@ +> + */ + public function pictureRules( + string $name = 'picture', + ?int $minWith = null, + ?int $minHeight = null, + ?int $maxWith = null, + ?int $maxHeight = null, + bool $nullable = false + ): array { + $sizes = (object) [ + 'minWith' => $minWith ?? $this->minWith, + 'minHeight' => $minHeight ?? $this->minHeight, + 'maxWith' => $maxWith ?? $this->maxWith, + 'maxHeight' => $maxHeight ?? $this->maxHeight, + ]; + + return [ + $name => [ + ! $nullable ? 'required' : 'nullable', + function (string $attribute, $value, callable $fail) use ($sizes): void { + /** @var UploadedFile|string $value */ + $valuePath = is_string($value) ? $value : $value->getPathname(); + $this->validatePicture($attribute, $valuePath, $fail, $sizes); + }, + ], + ]; + } + + /** + * Images rules + * + * @return array> + */ + public function picturesRules( + string $name = 'pictures', + ?int $minWith = null, + ?int $minHeight = null, + ?int $maxWith = null, + ?int $maxHeight = null + ): array { + $sizes = (object) [ + 'minWith' => $minWith ?? $this->minWith, + 'minHeight' => $minHeight ?? $this->minHeight, + 'maxWith' => $maxWith ?? $this->maxWith, + 'maxHeight' => $maxHeight ?? $this->maxHeight, + ]; + + return [ + $name => 'sometimes|array', + "{$name}Validate" => "required_with:{$name}|array", + "{$name}Validate.*" => [ + 'required', + function (string $attribute, $value, callable $fail) use ($sizes): void { + /** @var UploadedFile|string $value */ + $valuePath = is_string($value) ? $value : $value->getPathname(); + $this->validatePicture($attribute, $valuePath, $fail, $sizes); + }, + ], + ]; + } + + /** + * Validate picture + * + * @param callable(string):void $fail + * @param object{minWith:int,minHeight:int,maxWith:int,maxHeight:int} $sizes + * + * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed + */ + private function validatePicture(string $_attribute, string $value, callable $fail, object $sizes): void + { + unset($_attribute); + if (! ($useStorage = Storage::exists($value)) && ! File::exists($value)) { + $fail(trans('validation.custom.has_picture.file_does_not_exist')); + + return; + } + /** @var string */ + $fileFullPath = $this->getUploadedFileFullPath($value, $useStorage); + if ( + ! \in_array($this->getUploadedFileMimeType($value, $useStorage), [ + 'image/jpeg', + 'image/jpg', + 'image/png', + 'image/gif', + ]) + ) { + $fail(trans('validation.mimetypes', [ + 'values' => 'image/jpeg, image/jpg, image/png, image/gif', + ])); + } + if (! is_readable($fileFullPath)) { + $fail(trans('validation.custom.has_picture.file_not_readable')); + + return; + } + + if (! ($dimensions = \getimagesize($fileFullPath))) { + $fail(trans('validation.dimensions')); + + return; + } + $width = intval($dimensions[0]); + $height = intval($dimensions[1]); + + $xMessage = trans('validation.custom.has_picture.width_between', [ + 'min' => "{$sizes->minWith}px", + 'max' => "{$sizes->maxWith}px", + ]); + if ($sizes->minWith === $sizes->maxWith) { + $xMessage = trans('validation.custom.has_picture.width_equal', [ + 'value' => "{$sizes->minWith}px", + ]); + } + $yMessage = trans( + 'validation.custom.has_picture.height_between', + [ + 'min' => "{$sizes->minHeight}px", + 'max' => "{$sizes->maxHeight}px", + ] + ); + if ($sizes->minHeight === $sizes->maxHeight) { + $yMessage = trans('validation.custom.has_picture.height_equal', [ + 'value' => "{$sizes->minHeight}px", + ]); + } + + if (($width < $sizes->minWith) || ($width > $sizes->maxWith)) { + $fail($xMessage); + } + if (($height < $sizes->minHeight) || ($height > $sizes->maxHeight)) { + $fail($yMessage); + } + if (\filesize($fileFullPath) > ($this->maxWeight * 1024)) { + $fail(trans('validation.custom.has_picture.weight_max', [ + 'value' => $this->maxWeight, + ])); + } + } + + /** + * Merges products pictures fields with request data + */ + protected function mergePicture(string $name = 'picture'): void + { + /** @var UploadedFile|string|null */ + $picturePath = $this->{$name}; + if (is_string($picturePath) || $picturePath instanceof UploadedFile) { + $this->merge(["{$name}Validate" => []]); + // ! Empty picture. + if ($picturePath === 'false') { + // * Empty picture and exit + $this->merge([$name => []]); + + return; + } + $decodedPath = \urldecode(is_string($picturePath) ? $picturePath : $picturePath->getPathname()); + + $this->merge([ + "{$name}Validate" => array_merge( + $this->{"{$name}Validate"}, + [\public_path(ltrim($decodedPath, '/'))] + ), + ]); + $changedPicture = ltrim($decodedPath, '/'); + $this->merge([ + $name => $changedPicture, + ]); + } // End if. + } + + /** + * Merges products pictures fields with request data + */ + protected function mergePictures(string $name = 'pictures'): void + { + // Allows to empty pictures. + $pictures = $this->array($name); + $this->merge([ + $name => $pictures, + ]); + $this->merge(["{$name}Validate" => []]); + foreach ($pictures as $key => $picturePath) { + // ! Empty picture. + if ($picturePath === 'false') { + // * Empty picture and exit + $this->merge([$name => []]); + + return; + } + $decodedPath = \urldecode((! is_string($picturePath) && $picturePath) ? $picturePath->getPathname() : $picturePath); + $this->merge([ + "{$name}Validate" => array_merge( + $this->{"{$name}Validate"}, + [is_string($picturePath) ? \public_path(ltrim($decodedPath, '/')) : $picturePath] + ), + ]); + $changedPictures = $this->{$name}; + if (is_string($picturePath)) { + $changedPictures[$key] = ltrim($decodedPath, '/'); + } + $this->merge([ + $name => $changedPictures, + ]); + } // End foreach. + } + + /** + * Get the file full path + */ + private static function getUploadedFileFullPath(string $value, bool $useStorage): string + { + /** @var FilesystemAdapter */ + $disk = Storage::disk(); + + if (! $useStorage) { + return realpath($value) ?: $value; + } + + return $disk->path($value); + } + + /** + * Get the file mimetype + * + * @return string|false + */ + private function getUploadedFileMimeType(string $value, bool $useStorage) + { + return ! $useStorage ? File::mimeType($value) : Storage::mimeType($value); + } +} diff --git a/bootstrap/app.php b/bootstrap/app.php index 037e17df..70f686e7 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -1,55 +1,17 @@ singleton( - Illuminate\Contracts\Http\Kernel::class, - App\Http\Kernel::class -); - -$app->singleton( - Illuminate\Contracts\Console\Kernel::class, - App\Console\Kernel::class -); - -$app->singleton( - Illuminate\Contracts\Debug\ExceptionHandler::class, - App\Exceptions\Handler::class -); - -/* -|-------------------------------------------------------------------------- -| Return The Application -|-------------------------------------------------------------------------- -| -| This script returns the application instance. The instance is given to -| the calling script so we can separate the building of the instances -| from the actual running of the application and sending responses. -| -*/ - -return $app; +return Application::configure(Env::get('APP_BASE_PATH', dirname(__DIR__))) + ->withRouting( + commands: __DIR__ . '/../routes/console.php', + channels: __DIR__ . '/../routes/channels.php', + health: '/up', + ) + ->withSchedule(require __DIR__ . '/jobs.php') + ->withMiddleware(require __DIR__ . '/middlewares.php') + ->withExceptions(require __DIR__ . '/exceptions.php') + ->create(); diff --git a/bootstrap/exceptions.php b/bootstrap/exceptions.php new file mode 100644 index 00000000..157feb4d --- /dev/null +++ b/bootstrap/exceptions.php @@ -0,0 +1,17 @@ +reportable(function (\Throwable $e): void { + if (app()->bound(HubInterface::class)) { + resolve(HubInterface::class)->captureException($e); + } + }); + + GlobalHandler::afterAppBootstrap($exceptions); +}; diff --git a/bootstrap/jobs.php b/bootstrap/jobs.php new file mode 100644 index 00000000..f83dddf0 --- /dev/null +++ b/bootstrap/jobs.php @@ -0,0 +1,40 @@ +job(DeleteOldResetTokens::class)->everyMinute(); + $schedule->job(UpdateSlidesStatus::class)->everyMinute(); + + // FIXME: The Arcadia jobs are currently disabled and need to be enabled when api will be available. + // $schedule->job(FetchAndUpsertArcadiaEmployees::class)->onOneServer()->dailyAt('00:00'); + // $schedule->job(FetchAndUpsertArcadiaProductIncos::class)->onOneServer()->dailyAt('02:00'); + + $schedule->job(SendReminderMail::class)->onOneServer()->dailyAt('10:00'); + $schedule->job(SendMissingOrderReminderJob::class) + ->onOneServer() + ->hourly() + ->when(function () { + $schedulingService = app(PickupSchedulingService::class); + + $now = Date::now(); + $currentCutoffAt = $schedulingService->currentCutoff(); + $pickupReminderAt = $currentCutoffAt->copy() + ->subDays(SendMissingOrderReminderJob::DAYS_BEFORE_CUTOFF) + ->subHours(SendMissingOrderReminderJob::HOURS_BEFORE_CUTOFF); + + return $now->isSameHour($pickupReminderAt); + }); + $schedule->job(UpsertShopsPickupExceptionsUsingApiForYear::class) + ->onOneServer() + ->yearlyOn(11, 1, '7:30'); +}; diff --git a/bootstrap/middlewares.php b/bootstrap/middlewares.php new file mode 100644 index 00000000..c0a5e3e2 --- /dev/null +++ b/bootstrap/middlewares.php @@ -0,0 +1,103 @@ + route('bo.auth.login'), + 'frontend' => route('fo.auth.connexion'), + ]; + + app(FlashMessageService::class)->warning(__('Please log in to continue.')); + + foreach ($request->route()->gatherMiddleware() as $middleware) { + if (\is_string($middleware) && str_contains($middleware, 'auth:')) { + $route = $logins[str_replace('auth:', '', $middleware)] ?? null; + if ($route) { + return $route; + } + } + } + + return $logins['frontend']; +}; + +$redirectUsers = function (Request $request) { + $logins = [ + 'backend' => route('bo.dashboard'), + 'frontend' => route('fo.pages.home'), + ]; + foreach ($request->route()->gatherMiddleware() as $middleware) { + if (\is_string($middleware) && str_contains($middleware, 'auth:')) { + $route = $logins[str_replace('auth:', '', $middleware)] ?? null; + if ($route) { + return $route; + } + } + } + + return $logins['frontend']; +}; + +return function (Middleware $middleware) use ($redirectGuests, $redirectUsers): void { + $middleware->trustProxies(at: '*'); + $middleware->redirectGuestsTo($redirectGuests); + $middleware->redirectUsersTo($redirectUsers); + + $middleware->alias([ + 'has-role' => UserHasRole::class, + 'is-employed' => CustomerIsEmployed::class, + 'verified' => EnsureCustomerEmailIsVerified::class, + 'htmlsanitize' => HtmlSanitizer::class, + ]); + + $middleware->group( + RouteServiceProvider::ROUTE_GROUP_API, + [ + SubstituteBindings::class, + ] + ); + $middleware->group( + RouteServiceProvider::ROUTE_GROUP_WEB_AJAX, + [ + EncryptCookies::class, + AddQueuedCookiesToResponse::class, + StartSession::class, + AuthenticateSession::class, + PreventRequestForgery::class, + SubstituteBindings::class, + SecureHeaders::class, + ] + ); + $middleware->group( + RouteServiceProvider::ROUTE_GROUP_WEB, + [ + HtmlSanitizer::class, + EncryptCookies::class, + AddQueuedCookiesToResponse::class, + StartSession::class, + AuthenticateSession::class, + ShareErrorsFromSession::class, + PreventRequestForgery::class, + SubstituteBindings::class, + SecureHeaders::class, + ] + ); +}; diff --git a/bootstrap/providers.php b/bootstrap/providers.php new file mode 100644 index 00000000..d59eef64 --- /dev/null +++ b/bootstrap/providers.php @@ -0,0 +1,29 @@ +=10.5.0", + "js-yaml": ">=4.1.1", + "minimatch": ">=10.2.3", + }, + "packages": { + "@asamuzakjp/css-color": ["@asamuzakjp/css-color@5.1.11", "", { "dependencies": { "@asamuzakjp/generational-cache": "^1.0.1", "@csstools/css-calc": "^3.2.0", "@csstools/css-color-parser": "^4.1.0", "@csstools/css-parser-algorithms": "^4.0.0", "@csstools/css-tokenizer": "^4.0.0" } }, "sha512-KVw6qIiCTUQhByfTd78h2yD1/00waTmm9uy/R7Ck/ctUyAPj+AEDLkQIdJW0T8+qGgj3j5bpNKK7Q3G+LedJWg=="], + + "@asamuzakjp/dom-selector": ["@asamuzakjp/dom-selector@7.1.1", "", { "dependencies": { "@asamuzakjp/generational-cache": "^1.0.1", "@asamuzakjp/nwsapi": "^2.3.9", "bidi-js": "^1.0.3", "css-tree": "^3.2.1", "is-potential-custom-element-name": "^1.0.1" } }, "sha512-67RZDnYRc8H/8MLDgQCDE//zoqVFwajkepHZgmXrbwybzXOEwOWGPYGmALYl9J2DOLfFPPs6kKCqmbzV895hTQ=="], + + "@asamuzakjp/generational-cache": ["@asamuzakjp/generational-cache@1.0.1", "", {}, "sha512-wajfB8KqzMCN2KGNFdLkReeHncd0AslUSrvHVvvYWuU8ghncRJoA50kT3zP9MVL0+9g4/67H+cdvBskj9THPzg=="], + + "@asamuzakjp/nwsapi": ["@asamuzakjp/nwsapi@2.3.9", "", {}, "sha512-n8GuYSrI9bF7FFZ/SjhwevlHc8xaVlb/7HmHelnc/PZXBD2ZR49NnN9sMMuDdEGPeeRQ5d0hqlSlEpgCX3Wl0Q=="], + + "@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "@babel/helper-string-parser": ["@babel/helper-string-parser@7.29.11", "", {}, "sha512-snZbO7MEDOof+hvNa97EjEY7qD7h2kwvQr5AJC3ZhQudKW5dnej6k3kP9NQV88hJwaS8vDqRLFo9rivLEhle2g=="], + + "@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.29.7", "", {}, "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg=="], + + "@babel/parser": ["@babel/parser@7.29.11", "", { "dependencies": { "@babel/types": "^7.29.11" }, "bin": "./bin/babel-parser.js" }, "sha512-OZ6+oaK7GMyg3IfCpj8JOmn8n+w2rJbDT0LLfVDTLb1ZFeKDh3AiNELgCMUw175IJHSkLl74hG0M0VLsvx+gag=="], + + "@babel/types": ["@babel/types@7.29.11", "", { "dependencies": { "@babel/helper-string-parser": "^7.29.11", "@babel/helper-validator-identifier": "^7.29.7" } }, "sha512-WCsemW40Cpc6gouC1SrY6PBaZ+oLRlEVY9XBvZBI7il/HyUrb2nJ505wE1MHEFyDZNnrWDEuy4jL50WVHfTTSQ=="], + + "@bcoe/v8-coverage": ["@bcoe/v8-coverage@1.0.2", "", {}, "sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA=="], + + "@bramus/specificity": ["@bramus/specificity@2.4.3", "", { "dependencies": { "css-tree": "^3.2.1" }, "bin": { "specificity": "bin/cli.js" } }, "sha512-0GEz8qJWokkUVYQYRukmkSHIFNoBH8QTreeHrAFbvz1XFYc3Y+puhMs8PQ5x8GNugiC2l5jvDBXKLbBIByeSBw=="], + + "@bufbuild/protobuf": ["@bufbuild/protobuf@2.16.0", "", {}, "sha512-FWa0sPlqYGJgpTs6OxBRcL/AW4JT0OIO+W1ajerluoTVh8CV0B7XM1qsNCRgnkSCkRCgOICKHRQlY17jrsm0+Q=="], + + "@cacheable/memory": ["@cacheable/memory@2.2.0", "", { "dependencies": { "@cacheable/utils": "^2.5.0", "@keyv/bigmap": "^1.3.1", "hookified": "^1.15.1", "keyv": "^5.6.0" } }, "sha512-CTLKqLItRCEixEAewD3/j9DB3/o96gpTPD4eJ1v+DGOlxZRZncRQkGYqqnAGCscYd6RNeXfGeiuCphsPtqyIfQ=="], + + "@cacheable/utils": ["@cacheable/utils@2.5.0", "", { "dependencies": { "hashery": "^1.5.1", "keyv": "^5.6.0" } }, "sha512-buipgOVDkkPXNR5+xBpDw7Zk2n1EvU7qBJCNUcL7rhQ//kfpOXPAvQ511Os0vpLYJ1pZnvudNytkQt2hst3wqA=="], + + "@ckeditor/ckeditor5-adapter-ckfinder": ["@ckeditor/ckeditor5-adapter-ckfinder@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-upload": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-5cERu9uprG3CZseo2OLRPUn3JPWD1A8cIivwuEW8FPi83XLZVUucufVIyFJD3UH1K1466fvWewHmy1h5CfJAOw=="], + + "@ckeditor/ckeditor5-alignment": ["@ckeditor/ckeditor5-alignment@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-CpHwFzf7ZJyipkWKat1sOdYIw1yyVOmIJGYtt0qBuAGwIyqlkuNpqQKi6MH4mW3tsJw3mMUMHKgSqIAh8rZAcQ=="], + + "@ckeditor/ckeditor5-autoformat": ["@ckeditor/ckeditor5-autoformat@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-heading": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-E8qRoDt1D/Jc85bt7ecd8nFmydzvhrGXIPX60uk1eZzp17irpS4z7hYtE91r3DaUl9FCPn/YH+ZOk5Xl/ReweQ=="], + + "@ckeditor/ckeditor5-autosave": ["@ckeditor/ckeditor5-autosave@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-USYgCIQFH1/2QLAlpHVNIyQqgFMux/lcP1Dk5tWlnMp05jBzd7PClhJIYiilkwiAMwSsn7/jme6HVFgMdTzF3A=="], + + "@ckeditor/ckeditor5-basic-styles": ["@ckeditor/ckeditor5-basic-styles@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-qkeH2I1yRTJQnH1Pg7mZjFSe8VFXfvQzOlUDRTnnml1cz3c6NWxFbMX+nhHx+/UeaSJaPaIWLyL/gc+YH3DlkQ=="], + + "@ckeditor/ckeditor5-block-quote": ["@ckeditor/ckeditor5-block-quote@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-enter": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-ALPcJpehZcGgPA9oYTr4NQ/nwl2f+HQV9g2aMXqE4J3loWHHjFEG7dUJoO4ba9iqpCSj/A4T2jLhtd8EKIVkzg=="], + + "@ckeditor/ckeditor5-bookmark": ["@ckeditor/ckeditor5-bookmark@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-link": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "@ckeditor/ckeditor5-widget": "48.5.3" } }, "sha512-vKMSQZqWLfGWwppnrRNqJmKQ68oKTGsqLmVNsIDMVUsZ3+G2N7eOp5H/zbQeWFg60rN6j9iX6iPe0s7HjgSoKA=="], + + "@ckeditor/ckeditor5-ckbox": ["@ckeditor/ckeditor5-ckbox@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-cloud-services": "48.5.3", "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-image": "48.5.3", "@ckeditor/ckeditor5-link": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-upload": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "blurhash": "2.0.5", "es-toolkit": "1.52.0" } }, "sha512-5/MhSAekhpix3CMXw1kBw3g7TBF4qOzhXrvIpRLqVe9gpZiXYaz1WQB/UUPP/siwlrCIlpESHPYbLubbSOh3sQ=="], + + "@ckeditor/ckeditor5-ckfinder": ["@ckeditor/ckeditor5-ckfinder@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-adapter-ckfinder": "48.5.3", "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-image": "48.5.3", "@ckeditor/ckeditor5-link": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-qkoArvvkyaroCQWpiOMkss+ys4quIklVuHnzNWbC8SxYAF9KVeW43hkQXaLOHdufgrwlcoQPl0b6YxFgL6NO3w=="], + + "@ckeditor/ckeditor5-clipboard": ["@ckeditor/ckeditor5-clipboard@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "@ckeditor/ckeditor5-widget": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-aSNb2xph9MDzCbhZX7XAwMHUO9wuLByhRfjAv1d24MqmDHWNVt2YkxL5DPpjG1NT70yQw/DTHX8YrGCYYS4z3g=="], + + "@ckeditor/ckeditor5-cloud-services": ["@ckeditor/ckeditor5-cloud-services@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-upload": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-6TOqdFIQuJLdYvYrlVeanSbqIr3b3NAuAgkYdxAzlNlX03Hnlpt/a0/RQ6kiknNoCTuUMKbDOgxkvST3stAzMw=="], + + "@ckeditor/ckeditor5-code-block": ["@ckeditor/ckeditor5-code-block@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-clipboard": "48.5.3", "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-enter": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-cfL86sM+DVcBfj8lgEKG4gLN0nsER8DTkbisew8uU1HcP+aOKetBoy4ZzYNcnpFwpXfCsJNn4aUh2JqeX4//nQ=="], + + "@ckeditor/ckeditor5-core": ["@ckeditor/ckeditor5-core@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "@ckeditor/ckeditor5-watchdog": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-yEmYPBmipbFTd0EJQMyARui7Mmd0lHFIJubrPsota47OkOnwPlzHl5fzEZo8GyfNz1PPj7MprRF+JfpfC4nAGg=="], + + "@ckeditor/ckeditor5-easy-image": ["@ckeditor/ckeditor5-easy-image@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-cloud-services": "48.5.3", "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-image": "48.5.3", "@ckeditor/ckeditor5-upload": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-eL4byp9tZz0o3NSHecZDvx+huMWOADxZSf0KPKeQKAQBMuaw+EBImRxeU+rKHHWrMCup5s9W/BI+UX6daBdLpg=="], + + "@ckeditor/ckeditor5-editor-balloon": ["@ckeditor/ckeditor5-editor-balloon@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-fIIl7PqWP8e4wz4zH3jcBz2WRRNg+uCQgBlJoV0a3e6dFb0DcaaUETbMB2heKMdHdtnxWtoENRV1cXHoiW6VoQ=="], + + "@ckeditor/ckeditor5-editor-classic": ["@ckeditor/ckeditor5-editor-classic@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-8Qiaiuoh9vtWH+tSX8wbUokQF+Oc6mB8XaPF0+V0PsvD6MLDjuODc9kbDZ0h3h15dUjksORMYF7AGCgW5PsypQ=="], + + "@ckeditor/ckeditor5-editor-decoupled": ["@ckeditor/ckeditor5-editor-decoupled@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-qxaGmJB0DttTA2nkVoGOl0vS96MT0NWPrYD6iTyCO/fDUjMprM22oNiYGpa29AKMJCAR4bSzu23dz/mjQJpwzQ=="], + + "@ckeditor/ckeditor5-editor-inline": ["@ckeditor/ckeditor5-editor-inline@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-p9lY+1rflT/s+6k1Md4LiRaLnhk66PimNUwkTWkwDQuuFRQeoppqPxWYX65qfuxEvEhMm8EW7g2QUFGe4LeVKw=="], + + "@ckeditor/ckeditor5-editor-multi-root": ["@ckeditor/ckeditor5-editor-multi-root@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-ZbmQz/t+WiemCgDG2fbhE6Ssv5InzZ3Tbm3Yy4CmME+A4rBMtWJGEbvH+mEKLl9IP1CYDGHf8EdMmiaFWdUBxg=="], + + "@ckeditor/ckeditor5-emoji": ["@ckeditor/ckeditor5-emoji@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-mention": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "es-toolkit": "1.52.0", "fuzzysort": "3.1.0" } }, "sha512-mnWTFp7/JueCr98TEJ6WrQLfOkYzuDmzYVzSmwF6f3XPpLAZBat7aLdKj5uUxrDD4QbNCRZuCDvUlbfAGPaVKw=="], + + "@ckeditor/ckeditor5-engine": ["@ckeditor/ckeditor5-engine@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-utils": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-eS2Nzvf5vr6yMcvhlwUzeR8xvn9rSU808HexaLUkvHu2AC9kZqBjYBNzO2+VWt5V5mTZVZMuRJEYYFrK6hd2BQ=="], + + "@ckeditor/ckeditor5-enter": ["@ckeditor/ckeditor5-enter@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-2Sittq5h5jGE9aljOA+22AFx3Jyio6sYnW3PhOaMGVmK++0k+aX0ETmxAkeVxK+k+M+UTnp+8n/tFgS+hyCisg=="], + + "@ckeditor/ckeditor5-essentials": ["@ckeditor/ckeditor5-essentials@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-clipboard": "48.5.3", "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-enter": "48.5.3", "@ckeditor/ckeditor5-select-all": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-undo": "48.5.3" } }, "sha512-2m6RKpcGBCr8navnNL9PTzS8VUwjo4RCxehVim6zE9yDH1NBgPdT2xSeTtBbuyB9Ntxsxf3j5TA0yoqn8Ba1Qw=="], + + "@ckeditor/ckeditor5-find-and-replace": ["@ckeditor/ckeditor5-find-and-replace@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-jm+wO8fUcqRHKIWVaSpz+4ij56UpafsW9BVXGrcFHRRr1vXqshDgmc8NYGyFl00GePWi0aAJaC2HOwoQhLW7LQ=="], + + "@ckeditor/ckeditor5-font": ["@ckeditor/ckeditor5-font@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-82AuEbaGn2hbKtsKZT7GWmkEEHHbXb8WrMhQ6CDMYZkuBIKG3XrfE87gxLOrQ5opJe38aXdlIl0gtsfKLAFwjw=="], + + "@ckeditor/ckeditor5-fullscreen": ["@ckeditor/ckeditor5-fullscreen@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-editor-classic": "48.5.3", "@ckeditor/ckeditor5-editor-decoupled": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-DBjvZ8mLbKQVzWMPK7zUh3yb5Km07FB0/xL+Wpkw+njSaRxv29FDJzpOXj4EXeIvJgMk4mY0YSvr75I6cS7Mbg=="], + + "@ckeditor/ckeditor5-heading": ["@ckeditor/ckeditor5-heading@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-enter": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-paragraph": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-6QNzkmPBP6NzCkS/8q6M1haiPSCRDUG/hXO5xPVRo7/Yz25NsedXxFPwRgK78Z0yUU1779uSgEufviuP9wKskA=="], + + "@ckeditor/ckeditor5-highlight": ["@ckeditor/ckeditor5-highlight@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-NUF7RESQYNthdlTkU4tiYLTXurtvjij+Bi93G1bZf4SU/O/ZZ8BAqand63GZuu2zuPhKeNuLtYMNsE3foifr4A=="], + + "@ckeditor/ckeditor5-horizontal-line": ["@ckeditor/ckeditor5-horizontal-line@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "@ckeditor/ckeditor5-widget": "48.5.3" } }, "sha512-lF2RsuBQtH1+uzXZbKkiOrLqnvCjvYpPa3LGqJcCq9RivM2gRaB702Dz+ROHNVOQH3goAZC71xLuOI8Ou+Q5AA=="], + + "@ckeditor/ckeditor5-html-embed": ["@ckeditor/ckeditor5-html-embed@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "@ckeditor/ckeditor5-widget": "48.5.3" } }, "sha512-S/twTxtWBEEH5hb93G/rE6V5wiY79cacswK1PZphozKctlAB5w0r4R9CcclC/voncaw+DCXCq5PGdRn6L6WMhQ=="], + + "@ckeditor/ckeditor5-html-support": ["@ckeditor/ckeditor5-html-support@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-clipboard": "48.5.3", "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-enter": "48.5.3", "@ckeditor/ckeditor5-heading": "48.5.3", "@ckeditor/ckeditor5-image": "48.5.3", "@ckeditor/ckeditor5-list": "48.5.3", "@ckeditor/ckeditor5-remove-format": "48.5.3", "@ckeditor/ckeditor5-table": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "@ckeditor/ckeditor5-widget": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-XyXcSolQWgv1VqHqACO84hxFbx1+qg3ESP7ixYmcErRg1TWFqbvOSD+dmUBnO0NvVuGNYVULLXaRcp/k/ankSA=="], + + "@ckeditor/ckeditor5-icons": ["@ckeditor/ckeditor5-icons@48.5.3", "", {}, "sha512-AUi+1fztKgwSnaS6K7wTCO3tfbLPGfa16BTI0ad/f4Nj+uJJRQ6u/njznaaUF2+Yyp78N3u48MYt4QYzFKZr9g=="], + + "@ckeditor/ckeditor5-image": ["@ckeditor/ckeditor5-image@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-clipboard": "48.5.3", "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-undo": "48.5.3", "@ckeditor/ckeditor5-upload": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "@ckeditor/ckeditor5-widget": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-3NwdE1AyZ0wOeEsG0cbn3uggBs9voAwXTUC1LpFN0QtLb7FauDVVUqN7eDDTrILFcJRFX6HCTg2CPcs8hQYjqA=="], + + "@ckeditor/ckeditor5-indent": ["@ckeditor/ckeditor5-indent@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-heading": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-list": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-NA8QJS5vYhiH/Hdo4WXuO+ZqCyyZCqMURPm6b343qHux55lgAdG6BbpRKsfeFcG/+0GUQ6xFrnKEUwgBBJI0Gw=="], + + "@ckeditor/ckeditor5-language": ["@ckeditor/ckeditor5-language@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-Jm4OtXCF5ZyfQ4SqNAaAHv1LPU06k3IAu6Cdp+39nS6ClsKQLK+oB3RYwwUCavFipsLNvwms9r9Tv3nJvmT0tw=="], + + "@ckeditor/ckeditor5-link": ["@ckeditor/ckeditor5-link@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-clipboard": "48.5.3", "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-enter": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-image": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "@ckeditor/ckeditor5-widget": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-2ECKg0OoZCRJk0OHdtFVwKZNCihWkBEjH+55ic2gFtuamwjeKq3DmLdOtsVnOZX1Y5nfaZTkrNzOU/zm112ZUQ=="], + + "@ckeditor/ckeditor5-list": ["@ckeditor/ckeditor5-list@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-clipboard": "48.5.3", "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-enter": "48.5.3", "@ckeditor/ckeditor5-font": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-TKTriKNIIbxutLVS3tX5cvthwdR/OMIMO8SiOLqU/LCkpxesCsto8x8iuZkL0r1kUi6ZEqn7VOrlUimzmKI29Q=="], + + "@ckeditor/ckeditor5-markdown-gfm": ["@ckeditor/ckeditor5-markdown-gfm@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-clipboard": "48.5.3", "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "hast-util-from-dom": "5.0.1", "hast-util-to-html": "9.0.5", "hastscript": "9.0.1", "rehype-dom-parse": "5.0.2", "rehype-dom-stringify": "4.0.2", "rehype-remark": "10.0.1", "remark-breaks": "4.0.0", "remark-gfm": "4.0.1", "remark-parse": "11.0.0", "remark-rehype": "11.1.2", "remark-stringify": "11.0.0", "unified": "11.0.5", "unist-util-visit": "5.0.0" } }, "sha512-opDRb3LYX37l1dmgBZDnT2P8YgoQmByRQ5l5WJzMLwaeVrR++t3g0RpFtX7bCjYRggvxzkW5ij9AePBuEipiUQ=="], + + "@ckeditor/ckeditor5-media-embed": ["@ckeditor/ckeditor5-media-embed@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-clipboard": "48.5.3", "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-undo": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "@ckeditor/ckeditor5-widget": "48.5.3" } }, "sha512-+wukfr50hslwgFNC80ZLzFHLEcoxEBG9Gz/U2scPo/Fldr0eJ857Ht8jP46ZboCYyrBkXRoNnfG3WgXDn8KCyg=="], + + "@ckeditor/ckeditor5-mention": ["@ckeditor/ckeditor5-mention@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-j41aiPqYLeE+NEeU697V2kaNRa45X54rgPSU5/jJNzqJ5JlqlypesAzbsN4sUj8aIpXqPqqu1OJYKcgtMwg/ig=="], + + "@ckeditor/ckeditor5-minimap": ["@ckeditor/ckeditor5-minimap@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-5w9vLr2C2kJu+lbCsXj1cL4cJJxKKgtLyzTkzl2M8exEdLBSK/ymelVcERyVW6PyAWkUs1wpsgtfOlCQ3CZ5eg=="], + + "@ckeditor/ckeditor5-page-break": ["@ckeditor/ckeditor5-page-break@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "@ckeditor/ckeditor5-widget": "48.5.3" } }, "sha512-ffRvYxWe4FosRKMr9yUS1TX/DNqWxb5yH7sfEiHr/S9Ft6Uea3SEhXMpzjtflFO1dK4hKf85u9fU5PW2rnvhMA=="], + + "@ckeditor/ckeditor5-paragraph": ["@ckeditor/ckeditor5-paragraph@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-iXs+fKXQxxIDOChligo37SoRXicvPLuoIhvrnvUNn8LyZZM/b8GI2NMKR9Mz2nFZKjZ5TEPt2H7Z/XElR+12uA=="], + + "@ckeditor/ckeditor5-paste-from-office": ["@ckeditor/ckeditor5-paste-from-office@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-clipboard": "48.5.3", "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-/oW9FgKi6WVKJD74+cWDcdswuQhH98/7TzmAKl4UAckeqBnozEnzWKk5YpLtvyEi2LOhrH1urn1SqNvC371Mxw=="], + + "@ckeditor/ckeditor5-remove-format": ["@ckeditor/ckeditor5-remove-format@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-6iAWUOKWH/D9ZhRVNIB3XCJc8mloQB8bFtNnYKaYLKzuB3dYOw58nct9xpaxQdfoldEnD/Cg+Ghj/Yphwt9JTQ=="], + + "@ckeditor/ckeditor5-restricted-editing": ["@ckeditor/ckeditor5-restricted-editing@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-clipboard": "48.5.3", "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-X9IAYFHXujgJIYpVkCWAYKECEuDkp9U4yVbxexd6NHxvqPZvaFinhgtFMO5UvmEduvsnJNikBLazickp6E63Kw=="], + + "@ckeditor/ckeditor5-select-all": ["@ckeditor/ckeditor5-select-all@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-REFV9DQfKoFIDX044tXSe0OMZ0JxdPQsTE2lPdFTjArELv54rkVaTR2saY0WXsO3GeOZP6wHWNiED5HpuMPaLg=="], + + "@ckeditor/ckeditor5-show-blocks": ["@ckeditor/ckeditor5-show-blocks@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-9yGsFg8+gS89JoGTxO1Xy/kw1HNZCYc3J3mAXjeaeoKMEymh6BQiKTH7tvskrmETOvs7s80CvTG3iAlS6BDfOw=="], + + "@ckeditor/ckeditor5-source-editing": ["@ckeditor/ckeditor5-source-editing@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-CTIm+T0xAow/JXQkZzq6GQdMc/SvBvoQRJCk0IK1GV63D6vOe8QzI6QLc1YBkGj0ouySb782gsYLqh7Tmx21Zg=="], + + "@ckeditor/ckeditor5-special-characters": ["@ckeditor/ckeditor5-special-characters@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-zT8531z9r2VSBGshlPZxlAjWdU3uvQGvQOtGSVoMDQ0K6YIZNwPn5vyOTT6UjxUaq4EG18eO4ER6W75XrhFDsA=="], + + "@ckeditor/ckeditor5-style": ["@ckeditor/ckeditor5-style@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-html-support": "48.5.3", "@ckeditor/ckeditor5-list": "48.5.3", "@ckeditor/ckeditor5-table": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-nG/RJmR2So8QyxkHy3UxYmNkYN6NSh1VNGwEjyVOl0sf8DioB3F9Xx6G0cQDXVY0FpSakmpNy437xq0PPbJG2A=="], + + "@ckeditor/ckeditor5-table": ["@ckeditor/ckeditor5-table@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-clipboard": "48.5.3", "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-enter": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "@ckeditor/ckeditor5-widget": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-uB9dsuKuu8H5468eG0iRwateux5XghoGH9ZrquMFNq7LdSaj6YQhwa9cexo0DzWaAuMAU4ypgwHL3uGXOGPbWA=="], + + "@ckeditor/ckeditor5-typing": ["@ckeditor/ckeditor5-typing@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-xB50Ab14hPCJGFQDDqP6Lj4bVEfSaa8RFOOJ/VplEwseMRHTFQj4iAFsDpVIkaP41rePF8/kXKMTE/aQTq6SWg=="], + + "@ckeditor/ckeditor5-ui": ["@ckeditor/ckeditor5-ui@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-editor-multi-root": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "@types/color-convert": "2.0.4", "color-convert": "3.1.0", "color-parse": "2.0.2", "es-toolkit": "1.52.0", "vanilla-colorful": "0.7.2" } }, "sha512-/K9/SVEzjwmg7RICTotd9CzGZKMkashGILHx+IWM/riW8ftsmrEKyUC8t+QWXIiFjh1xrpzFUFK99i6+1GDY4g=="], + + "@ckeditor/ckeditor5-undo": ["@ckeditor/ckeditor5-undo@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-9DlSZ81xsk3WwidB5h1UVx/MFsUZ5YKcpciHI5svupK8saeUDUqNpVcG+eiVwKd90VihoLSJok0XzZibHKlAiw=="], + + "@ckeditor/ckeditor5-upload": ["@ckeditor/ckeditor5-upload@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3" } }, "sha512-r09RKttNI0DXlZfL+Q3QQBZQgIzmpP7NHCpOe1Jd97QJ/ifZWUyB+0mrM0Xf3lq/H0KWbO5TJK68eTLaTZEBOw=="], + + "@ckeditor/ckeditor5-utils": ["@ckeditor/ckeditor5-utils@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-ui": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-3rYucbvFqYLKNbeG01u3SQSTopj8JglqoszNc+qXTeUUSUaNE4h1nyPfBWYM2v1CZDfIzJS2pVkvA0LVO1886w=="], + + "@ckeditor/ckeditor5-watchdog": ["@ckeditor/ckeditor5-watchdog@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-jiwwrwO+6zr165W8NUgycrj62+L4L2sPPrz7QEl1yYzJScHPSR4F1dbN8wS1EIaSQdaKmQdXDkEqr9Lt7BhskQ=="], + + "@ckeditor/ckeditor5-widget": ["@ckeditor/ckeditor5-widget@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-enter": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-wb8wiZ/BBY4116MZCmTNqTu6RwGqMwH+H7/Z4LH6/ZSfyCHg3DJxeiD4JUcSkHTKwZ0OZoI5+BEqJ4KzZydyRA=="], + + "@ckeditor/ckeditor5-word-count": ["@ckeditor/ckeditor5-word-count@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "es-toolkit": "1.52.0" } }, "sha512-NbquSKsx21HX1BS6KUDJE6WsSFLyPDn+USypZD/eLwjWvpBR/uRnFMWzyJIC2sEgELuB6Xw7jEdjWQ+N038Wyg=="], + + "@cropper/element": ["@cropper/element@2.3.1", "", { "dependencies": { "@cropper/utils": "^2.3.1" } }, "sha512-CgrLOx0qERWlfJK1Ed6ePq7SXcB6gLHtj3mtDVypyzti70fJdmNxrFm5Ucbq8vpp2Yo3tW2L6uDI0IBDoiT17A=="], + + "@cropper/element-canvas": ["@cropper/element-canvas@2.3.1", "", { "dependencies": { "@cropper/element": "^2.3.1", "@cropper/utils": "^2.3.1" } }, "sha512-UH3VMyjn58PdwYkPiTHuvRUjGzmyKr6E2pYWxTxN/04wnjgYLA77B5u5c1HhV6vD1ZKSvxJ/i9TkiySR9P1D6A=="], + + "@cropper/element-crosshair": ["@cropper/element-crosshair@2.3.1", "", { "dependencies": { "@cropper/element": "^2.3.1", "@cropper/utils": "^2.3.1" } }, "sha512-Vz2heRwr2nd2rZ161vKyE4JwYV3eSodGCGGZq39TR0LICGOOeggLq0R664Af/eFB9PU8+tfJ42lWLoUdxQlVJQ=="], + + "@cropper/element-grid": ["@cropper/element-grid@2.3.1", "", { "dependencies": { "@cropper/element": "^2.3.1", "@cropper/utils": "^2.3.1" } }, "sha512-6LDaUDxH2xdA7biTcqnihPQVHjlT4bXysA403s9rU4jo5f4pPnFHtNbB+FQTYKNz5EKun52WgVtR+6oWbmbxlg=="], + + "@cropper/element-handle": ["@cropper/element-handle@2.3.1", "", { "dependencies": { "@cropper/element": "^2.3.1", "@cropper/utils": "^2.3.1" } }, "sha512-ygLw89PWu9k8SuKW7rjRBpD6ZfmtVr5ayWux9YKHU7PxX0SeL5kbCD+PpOxQB1ycW4UcyH0tHt77EWnsdSoOHw=="], + + "@cropper/element-image": ["@cropper/element-image@2.3.1", "", { "dependencies": { "@cropper/element": "^2.3.1", "@cropper/element-canvas": "^2.3.1", "@cropper/utils": "^2.3.1" } }, "sha512-rPE7OX/BPTw66+DjpN5aOuPb1xSAjQMgAJZXdRgmeJnn0YcDDhfGQm8VwcL8/PMLxtWFcKEM+aUiezbO01j4fg=="], + + "@cropper/element-selection": ["@cropper/element-selection@2.3.1", "", { "dependencies": { "@cropper/element": "^2.3.1", "@cropper/element-canvas": "^2.3.1", "@cropper/element-image": "^2.3.1", "@cropper/utils": "^2.3.1" } }, "sha512-b8sabaFbHeQYY459uItDIeDY0IisZBO/wF+SYhKvAgI8TExj/f2mNcBZXjPHYCkWel2+1BSUTTNZxy+tR8sDEA=="], + + "@cropper/element-shade": ["@cropper/element-shade@2.3.1", "", { "dependencies": { "@cropper/element": "^2.3.1", "@cropper/element-canvas": "^2.3.1", "@cropper/element-selection": "^2.3.1", "@cropper/utils": "^2.3.1" } }, "sha512-X5ceZsy7iBxuIRhsL05H9+cPYzxZuvM7/9j5irXIbNsDiNwTedxIHdjhEhPbUYa+FaNn9wsKId24AEyH43JTGw=="], + + "@cropper/element-viewer": ["@cropper/element-viewer@2.3.1", "", { "dependencies": { "@cropper/element": "^2.3.1", "@cropper/element-canvas": "^2.3.1", "@cropper/element-image": "^2.3.1", "@cropper/element-selection": "^2.3.1", "@cropper/utils": "^2.3.1" } }, "sha512-EdrYDbnkj0IOl/kyWKzzvcDRobr7Tfzho7FkVu8mpSk1ILDHmVf8pfZrYVwou8l4znLqp8ZqwuabAezJPfC2Yg=="], + + "@cropper/elements": ["@cropper/elements@2.3.1", "", { "dependencies": { "@cropper/element": "^2.3.1", "@cropper/element-canvas": "^2.3.1", "@cropper/element-crosshair": "^2.3.1", "@cropper/element-grid": "^2.3.1", "@cropper/element-handle": "^2.3.1", "@cropper/element-image": "^2.3.1", "@cropper/element-selection": "^2.3.1", "@cropper/element-shade": "^2.3.1", "@cropper/element-viewer": "^2.3.1" } }, "sha512-+D5rFlfFlWSL1lp0vPYI59/R6XM2vMnTSX0/B1zKRvmkc0t0N0m9lxVsaDb+9RkHx6PwAkBBNPZSRUeau33jMg=="], + + "@cropper/utils": ["@cropper/utils@2.3.1", "", {}, "sha512-b5qFTwws/osx0asIGLK1V//hdL08frGvfpi6s+p6zj5XH05ofVcz0Xl+Tot7sUx12pbfhhAlsquQTOJ1IsOoFw=="], + + "@csstools/color-helpers": ["@csstools/color-helpers@6.1.2", "", {}, "sha512-grhRy3OKmniaAEKXMjua5z/EODX0MSqBGjunw8+j/3HQjOnahs2AGhvEOIYVUWcU6ScApbhLhVrQTX8XqrMrow=="], + + "@csstools/css-calc": ["@csstools/css-calc@3.4.3", "", { "peerDependencies": { "@csstools/css-parser-algorithms": "^4.0.2", "@csstools/css-tokenizer": "^4.0.2" } }, "sha512-iex20d8CHVkyvg6B7UKV7uHnI2Bqo9g+EFfT9E0y+GvTvhZ/DwONJ+9aKb1dlqm0ZiGsL5RXjp0fCoJYnkeDjA=="], + + "@csstools/css-color-parser": ["@csstools/css-color-parser@4.2.6", "", { "dependencies": { "@csstools/color-helpers": "^6.1.2", "@csstools/css-calc": "^3.4.3" }, "peerDependencies": { "@csstools/css-parser-algorithms": "^4.0.2", "@csstools/css-tokenizer": "^4.0.2" } }, "sha512-iiPQ3iRWwnJkeEn6RIu6SJPr7hYrLz6XZ9s/QZl+2/LI5KQVjpl2fdmDSZKuD4xP6GMmMPgHFFXg6k1Wkz0Trg=="], + + "@csstools/css-parser-algorithms": ["@csstools/css-parser-algorithms@4.0.2", "", { "peerDependencies": { "@csstools/css-tokenizer": "^4.0.2" } }, "sha512-40cSKyMvK+tq4qz6Awrlye2WGuOKt3FwPgtGg6KTfbHOWNw+Rk1rzbAtZnZ6IBhsY491HLRnDXwoyBAijmmILA=="], + + "@csstools/css-syntax-patches-for-csstree": ["@csstools/css-syntax-patches-for-csstree@1.1.15", "", { "peerDependencies": { "css-tree": "^3.2.1" }, "optionalPeers": ["css-tree"] }, "sha512-J0u7HkVl2nzSlhsiTOp4AmwcUQ3D+mGEEKfBy/7To5/y7F2OHwyLrXfrhR0SMgr4p5Lo+eaMVSeai24zUcBIxA=="], + + "@csstools/css-tokenizer": ["@csstools/css-tokenizer@4.0.2", "", {}, "sha512-OoKoR0f76dCY666JlcbhmVTs2drYj1GUXZTYTcbUgJjh9Nv41aFfZ21bPQTERm5+L5cBDo466NltB2lplS5GBw=="], + + "@csstools/media-query-list-parser": ["@csstools/media-query-list-parser@5.0.2", "", { "peerDependencies": { "@csstools/css-parser-algorithms": "^4.0.2", "@csstools/css-tokenizer": "^4.0.2" } }, "sha512-qx19O8AbbLLbDSAcI6YOby/Vq8rV51psgIvlF5OZT/L8fQJDCyQifL6k+kYU4a8ySpzJ4RBzZkIs530bAn8y4Q=="], + + "@csstools/selector-resolve-nested": ["@csstools/selector-resolve-nested@4.0.2", "", { "peerDependencies": { "postcss-selector-parser": "^7.1.1" } }, "sha512-JpjNBJFA+4OnAHKRK4AMp8xrYyLhI9XapOeBlP2PhRU/IylSw+1ep3BFNTksBJnrTS3KT6kqKNVfpzLLwZUW5Q=="], + + "@csstools/selector-specificity": ["@csstools/selector-specificity@6.0.1", "", { "peerDependencies": { "postcss-selector-parser": "^7.1.1" } }, "sha512-MBuqFIIvqk4S593MGAskTkPpEUUzZNvGzh8mMxEwl3oHwjQlXmqHEDxNbN3Y0Tsh+xjmem4GZjeg7I0qkwBivg=="], + + "@emnapi/core": ["@emnapi/core@1.10.0", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.1", "tslib": "^2.4.0" } }, "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw=="], + + "@emnapi/runtime": ["@emnapi/runtime@1.10.0", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA=="], + + "@emnapi/wasi-threads": ["@emnapi/wasi-threads@1.2.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w=="], + + "@erbelion/vite-plugin-laravel-purgecss": ["@erbelion/vite-plugin-laravel-purgecss@0.4.8", "", { "dependencies": { "purgecss": "^8.0.0" }, "peerDependencies": { "vite": ">=3" } }, "sha512-HrhBUoJjoKe9CqHMo3PaB/qm0OzEeGDppKqitNLiaqzrIzmvPu6VR16K3kw/ZyZVaNk22rVNuuOU8fMwc68Wfw=="], + + "@eslint-community/eslint-utils": ["@eslint-community/eslint-utils@4.10.1", "", { "dependencies": { "eslint-visitor-keys": "^3.4.3" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg=="], + + "@eslint-community/regexpp": ["@eslint-community/regexpp@4.12.2", "", {}, "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew=="], + + "@eslint/config-array": ["@eslint/config-array@0.23.5", "", { "dependencies": { "@eslint/object-schema": "^3.0.5", "debug": "^4.3.1", "minimatch": "^10.2.4" } }, "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA=="], + + "@eslint/config-helpers": ["@eslint/config-helpers@0.7.0", "", { "dependencies": { "@eslint/core": "^1.2.1" } }, "sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw=="], + + "@eslint/core": ["@eslint/core@1.2.1", "", { "dependencies": { "@types/json-schema": "^7.0.15" } }, "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ=="], + + "@eslint/object-schema": ["@eslint/object-schema@3.0.5", "", {}, "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw=="], + + "@eslint/plugin-kit": ["@eslint/plugin-kit@0.7.3", "", { "dependencies": { "@eslint/core": "^1.2.1", "levn": "^0.4.1" } }, "sha512-IkO+/KEUvwbVpiURZg+P7zF74z5Jxe0UgJxVni+RtoHQ6IZieXaO02kmadomap/q+l6bc/jdPGGqTjhuZnuz1Q=="], + + "@exodus/bytes": ["@exodus/bytes@1.16.0", "", { "peerDependencies": { "@noble/hashes": "^1.8.0 || ^2.0.0" }, "optionalPeers": ["@noble/hashes"] }, "sha512-IcpW84uEn3N7ETtNZMlxKhfl6Pec8rUNGOTBtWbK1FKhJxIFAptZyVrvVRVBimAJxJCgc3PxepxkdWWG4DVzfA=="], + + "@fortawesome/fontawesome-common-types": ["@fortawesome/fontawesome-common-types@7.3.1", "", {}, "sha512-k0C0sdHmZtAo6dRDtd1Z/qcpyHbL0CKsjV8seMY/21xGhY5Wsv0XRmiI/xEEH4y2c9b1+jvgNs/3EqhV27yUEA=="], + + "@fortawesome/fontawesome-free": ["@fortawesome/fontawesome-free@7.3.1", "", {}, "sha512-wmglKKPDIkgV3aWlZzWECCPoGIkYCulzBwxG9+w7rc5BGapZ6cPMpoPOT8k36J0Ni7PPX6c/rsoMWfS4d1MUMg=="], + + "@fortawesome/fontawesome-svg-core": ["@fortawesome/fontawesome-svg-core@7.3.1", "", { "dependencies": { "@fortawesome/fontawesome-common-types": "7.3.1" } }, "sha512-BoxVN3PKnMbgStHhjoaky/oWdxHomDqmBVA24IA3KEmssFGeI7u9YT/BJceOjIum/t6TpPa/vcMKaVYQeIQ/3Q=="], + + "@fortawesome/free-brands-svg-icons": ["@fortawesome/free-brands-svg-icons@7.3.1", "", { "dependencies": { "@fortawesome/fontawesome-common-types": "7.3.1" } }, "sha512-8eiNzycuFhy3mZsi5EVO8JpO3H8l7/kSCl4Gk4iUew9hJuzYFqAAD6kqgeEup3+YZ9hL+5cjjorGzrRLkYuURg=="], + + "@fortawesome/free-regular-svg-icons": ["@fortawesome/free-regular-svg-icons@7.3.1", "", { "dependencies": { "@fortawesome/fontawesome-common-types": "7.3.1" } }, "sha512-q1EsmL7Q8DDnkRBUjSvrxbq7c9oVwwVjCn/xa5apKmdp65YSgzUg2y0Ltnd5aDbT6GdAQQdXql5Ha90ArqIReQ=="], + + "@fortawesome/free-solid-svg-icons": ["@fortawesome/free-solid-svg-icons@7.3.1", "", { "dependencies": { "@fortawesome/fontawesome-common-types": "7.3.1" } }, "sha512-v0BLa0eqg7ubvVWeNSHVBs8fWH/GJicERZoJaxJ3FE/lj67VSqzoMg9pzfZVOfLMX10y0pGwQAuxoRVVH2patg=="], + + "@fortawesome/vue-fontawesome": ["@fortawesome/vue-fontawesome@3.3.3", "", { "peerDependencies": { "@fortawesome/fontawesome-svg-core": "~1 || ~6 || ~7", "vue": ">= 3.0.0 < 4" } }, "sha512-Jbjze98gGcVBSdkscLbnDlHECumMAFVWDarMtycctn9qL3p92ApnV36VW4PwVrcm9IWrHnnE6ZL9x7MXStSCfA=="], + + "@humanfs/core": ["@humanfs/core@0.19.2", "", { "dependencies": { "@humanfs/types": "^0.15.0" } }, "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA=="], + + "@humanfs/node": ["@humanfs/node@0.16.8", "", { "dependencies": { "@humanfs/core": "^0.19.2", "@humanfs/types": "^0.15.0", "@humanwhocodes/retry": "^0.4.0" } }, "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ=="], + + "@humanfs/types": ["@humanfs/types@0.15.0", "", {}, "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q=="], + + "@humanwhocodes/module-importer": ["@humanwhocodes/module-importer@1.0.1", "", {}, "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA=="], + + "@humanwhocodes/retry": ["@humanwhocodes/retry@0.4.3", "", {}, "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ=="], + + "@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="], + + "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.6.0", "", {}, "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw=="], + + "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="], + + "@keyv/bigmap": ["@keyv/bigmap@1.3.1", "", { "dependencies": { "hashery": "^1.4.0", "hookified": "^1.15.0" }, "peerDependencies": { "keyv": "^5.6.0" } }, "sha512-WbzE9sdmQtKy8vrNPa9BRnwZh5UF4s1KTmSK0KUVLo3eff5BlQNNWDnFOouNpKfPKDnms9xynJjsMYjMaT/aFQ=="], + + "@keyv/serialize": ["@keyv/serialize@1.1.1", "", {}, "sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA=="], + + "@ldc-web/cookie-notice": ["@ldc-web/cookie-notice@6.1.1", "https://lab.s-web.fr/api/v4/projects/50/packages/npm/@ldc-web/cookie-notice/-/@ldc-web/cookie-notice-6.1.1.tgz", {}, "sha1-VzAHzvPedfR1OXVLIJXHwaWYeUA="], + + "@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.2.6", "", { "dependencies": { "@tybys/wasm-util": "^0.10.3" }, "peerDependencies": { "@emnapi/core": "^1.7.1 || 2.0.0-beta.2", "@emnapi/runtime": "^1.7.1 || 2.0.0-beta.2" } }, "sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw=="], + + "@nodelib/fs.scandir": ["@nodelib/fs.scandir@2.1.5", "", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="], + + "@nodelib/fs.stat": ["@nodelib/fs.stat@2.0.5", "", {}, "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A=="], + + "@nodelib/fs.walk": ["@nodelib/fs.walk@1.2.8", "", { "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg=="], + + "@oxc-project/types": ["@oxc-project/types@0.155.0", "", {}, "sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q=="], + + "@parcel/watcher": ["@parcel/watcher@2.6.0", "", { "dependencies": { "detect-libc": "^2.0.3", "is-glob": "^4.0.3", "node-addon-api": "^7.0.0", "picomatch": "^4.0.4" }, "optionalDependencies": { "@parcel/watcher-android-arm64": "2.6.0", "@parcel/watcher-darwin-arm64": "2.6.0", "@parcel/watcher-darwin-x64": "2.6.0", "@parcel/watcher-freebsd-x64": "2.6.0", "@parcel/watcher-linux-arm-glibc": "2.6.0", "@parcel/watcher-linux-arm-musl": "2.6.0", "@parcel/watcher-linux-arm64-glibc": "2.6.0", "@parcel/watcher-linux-arm64-musl": "2.6.0", "@parcel/watcher-linux-x64-glibc": "2.6.0", "@parcel/watcher-linux-x64-musl": "2.6.0", "@parcel/watcher-win32-arm64": "2.6.0", "@parcel/watcher-win32-x64": "2.6.0" }, "hasInstallScript": true }, "sha512-7FNeNl8NCE7aINx7WXiKQrPYZWC/hvrTsmk6zmxbI7LTXE7hVek/n8AfVgpe2y82zl3w0HvCHN0bVKMBoJcC0w=="], + + "@parcel/watcher-android-arm64": ["@parcel/watcher-android-arm64@2.6.0", "", { "os": "android", "cpu": "arm64" }, "sha512-trgpLSCKRC/huFjXX/Smh+0sWe4+YtKfktIToiMl59ghz7z+qkH6kMvNnUbLyRs9N11t8l4svSCs1+5B3rOAhA=="], + + "@parcel/watcher-darwin-arm64": ["@parcel/watcher-darwin-arm64@2.6.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Y3QV0gl7Q1zbfueunkWIERICbEojQFCgpyG7YqOGNFLsckXyI1xu9mAIUpKY9QBYzBtSkN8dBPwd3yiAO9ovMw=="], + + "@parcel/watcher-darwin-x64": ["@parcel/watcher-darwin-x64@2.6.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-Ohv6OpzhUfKYD7Beb8kDvG0jbIxORCYY1JRdZnaBtnjjkJxgD7ZVL0nw2sCYd0yTMKTvz3nnTnOF3cDifK+kvw=="], + + "@parcel/watcher-freebsd-x64": ["@parcel/watcher-freebsd-x64@2.6.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-5HmXvDgs8VK+74jF9y9/2FE3/OnlcKmc56tjmSrEuZjpSZOGL+fvAu+HKJBdPs9uwoP2hE6TlSUpXZ/C5jUFmQ=="], + + "@parcel/watcher-linux-arm-glibc": ["@parcel/watcher-linux-arm-glibc@2.6.0", "", { "os": "linux", "cpu": "arm", "libc": "glibc" }, "sha512-Ps/hui3A+vMbjdqlqAowK2ZL8+BO8dBjxeWXj6npTBs3jx4wWmbPpaLuqwrQrSqIVMCnpWo238bJ1U37GhQOYg=="], + + "@parcel/watcher-linux-arm-musl": ["@parcel/watcher-linux-arm-musl@2.6.0", "", { "os": "linux", "cpu": "arm", "libc": "musl" }, "sha512-9c6AUHgHoG+IY88MRIHupztQiQnrbqHYQjkM2btA+Bf/wQnQMuiD0Wfk1EVv3TlNT3x41uU71rn6E4xh/+zvkw=="], + + "@parcel/watcher-linux-arm64-glibc": ["@parcel/watcher-linux-arm64-glibc@2.6.0", "", { "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha512-yHRqS2owEXe6Hic9z6Mh1ECsCd+ODVOGvZDyciqRd21+v+o+DnXMOrw50DSpIG2sb8GPEaPPmfeCAWKPJdq46g=="], + + "@parcel/watcher-linux-arm64-musl": ["@parcel/watcher-linux-arm64-musl@2.6.0", "", { "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha512-WhB2e/V7rqdHHWZusBSPuy5Ei8S6lSz6FE5TKKQz5h3a0O+C+mhY7vxU9b/stqvMb8beLnPY82ZrFTLKs+SrKA=="], + + "@parcel/watcher-linux-x64-glibc": ["@parcel/watcher-linux-x64-glibc@2.6.0", "", { "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-ulGE6x6Oz6iAwg75T8YQSoguBWasniIbX+QWpaYPcCnDOpdWX3k+4xbEYPZVLxOuoJI+svJJPD3sEj8G7lrQ3A=="], + + "@parcel/watcher-linux-x64-musl": ["@parcel/watcher-linux-x64-musl@2.6.0", "", { "os": "linux", "cpu": "x64", "libc": "musl" }, "sha512-tkBYKt7YQrjIJWYDnto2YgO8MRkjlMTSNoRHzsXinBqbLdeOM3L32wPZJvIZxqaLMfSlS/4sUjH/6STVP/XDLw=="], + + "@parcel/watcher-win32-arm64": ["@parcel/watcher-win32-arm64@2.6.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-gIZAP23jaHjGWasY/TY6yL7NHFClf0Ga7FN+iINvk+KN94rhm94lYZhFsbYFNcA04/onvGD9kKmiJLJB2HbNwQ=="], + + "@parcel/watcher-win32-x64": ["@parcel/watcher-win32-x64@2.6.0", "", { "os": "win32", "cpu": "x64" }, "sha512-cA+/pXV2YkfxlIcXOQ5fSWqAzzPyD78/x5qbK/I0vUkrlYHA8TIz+MXjAbGouguKVSI4bOmkTSJ1/poVSsgt+A=="], + + "@popperjs/core": ["@popperjs/core@2.11.8", "", {}, "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A=="], + + "@rolldown/binding-android-arm-eabi": ["@rolldown/binding-android-arm-eabi@1.2.15", "", { "os": "android", "cpu": "arm" }, "sha512-aLcgK9gIJ3YRvrrtfSBbRa27F5WrpiTaPulnFpsHPxpUHgFlSgnU4854MHwoRGEBhfRJDWCS2WQ7lIjskE9Olw=="], + + "@rolldown/binding-android-arm64": ["@rolldown/binding-android-arm64@1.2.15", "", { "os": "android", "cpu": "arm64" }, "sha512-xD7DdZCrbThKuxNg7ooQmvp07ys4J/pnSEMTG3/OdOWl6daC67m/Q4fL78sRHMxTH/N4fGUbYhcPM0MF5WFHkg=="], + + "@rolldown/binding-darwin-arm64": ["@rolldown/binding-darwin-arm64@1.2.15", "", { "os": "darwin", "cpu": "arm64" }, "sha512-m2WuQ6r0B4OTYxyPpNLtXaMRbRDUbG8YQV2Q3KTdSSK8Th6KHCnC8jVCJt8bvYeSB5WivkkNbc85mKadaSdOxA=="], + + "@rolldown/binding-darwin-x64": ["@rolldown/binding-darwin-x64@1.2.15", "", { "os": "darwin", "cpu": "x64" }, "sha512-5RtnsHM36nodM9WbMy+zip0LGS/G+y5wro5RHrpOlr4ac24+1zSi9kiV2MP1myZeZ/ifEHfulQcWjnAXzc2C2A=="], + + "@rolldown/binding-freebsd-x64": ["@rolldown/binding-freebsd-x64@1.2.15", "", { "os": "freebsd", "cpu": "x64" }, "sha512-g3l09pyFqhu+135JKkbkwiKGQmwU5hUMUPJ4VdBADvuqR8d33L6H578rh8m7rtxbdp+VmX/+nzI7nvhSZlzpUQ=="], + + "@rolldown/binding-linux-arm-gnueabihf": ["@rolldown/binding-linux-arm-gnueabihf@1.2.15", "", { "os": "linux", "cpu": "arm" }, "sha512-nIe3VugI97nGQtspPxDqA4sXMUpeiocKIP/CqpY/u/vgbT+alX+cVxu1C/oVBPKg4feNTmYovE91v4DgXvXNwQ=="], + + "@rolldown/binding-linux-arm64-gnu": ["@rolldown/binding-linux-arm64-gnu@1.2.15", "", { "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha512-iTBjXx+B5QSvgI89lJfmqh4wTh8NabR1YZIIN3hNx4zSG0EVfVqkOvLulNpG4251pbd6/IAmZ/LefVk1Y4rPhw=="], + + "@rolldown/binding-linux-arm64-musl": ["@rolldown/binding-linux-arm64-musl@1.2.15", "", { "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha512-uN26XOnVR7rqQupG3V9oAG2EGGatWjcJHOeDOHUFCh4TBWmP2tHTFoVN13aYbwfm0aHqJAEmcwhAu6sooIjfqQ=="], + + "@rolldown/binding-linux-ppc64-gnu": ["@rolldown/binding-linux-ppc64-gnu@1.2.15", "", { "os": "linux", "cpu": "ppc64", "libc": "glibc" }, "sha512-9nWkcdd+H+XhaA3fQIwpHnKIrfx/PQ6rO0pivr78Og07tXlUlctBBJoEYLPfhTmCR/QxEVdn6uPjHV5SymPhdw=="], + + "@rolldown/binding-linux-s390x-gnu": ["@rolldown/binding-linux-s390x-gnu@1.2.15", "", { "os": "linux", "cpu": "s390x", "libc": "glibc" }, "sha512-Ggh0ciFjLwIusLSLz7LZYEaGdxOAUJXI+Qu5JCbhPJJHEt8vP+IjRATTJheiJsdzzTYgUiHUiw3X1Ea3ZpMBdA=="], + + "@rolldown/binding-linux-x64-gnu": ["@rolldown/binding-linux-x64-gnu@1.2.15", "", { "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-FHg60rS6DBePAYZ9X9F67x+JObFdmgn6tupA1C/a3B+CufFmTD4mX+e8M75tCiAO3foR/6xwVBI0KQiI7sn/rw=="], + + "@rolldown/binding-linux-x64-musl": ["@rolldown/binding-linux-x64-musl@1.2.15", "", { "os": "linux", "cpu": "x64", "libc": "musl" }, "sha512-/cvV/7v5VGz/moiz0XKRj2dE8DzsKyhIu1KpOvJGPjRywg3yscON889UGvAe8zfiJLHup7VLjBduoGWi3HusWQ=="], + + "@rolldown/binding-openharmony-arm64": ["@rolldown/binding-openharmony-arm64@1.2.15", "", { "os": "none", "cpu": "arm64" }, "sha512-MyzC5Hrv/sm+Z7TSGKP/j8001RO2xQm1zOpCNVL4j0cY/VhBZviludA2YFQ7i4lH6ZAXxQm0lcMdBzM+99mE7w=="], + + "@rolldown/binding-win32-arm64-msvc": ["@rolldown/binding-win32-arm64-msvc@1.2.15", "", { "os": "win32", "cpu": "arm64" }, "sha512-+PgYiS+AH5omy6L45ZLxybasauJaj3M8buoT83D+nzPmCayXlxUV9hydhciCKVyIg0B/v0BtXPDE1uGqNwCPpg=="], + + "@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.2.15", "", { "os": "win32", "cpu": "x64" }, "sha512-HFZd2QNQYn1JbIi+Hpd7H+r/lkWxcfIu28nirZ6eCn2LafuvmExMlb/P96Sfx5tf7pPArw39IdhmCF8vmV+NhQ=="], + + "@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.1", "", {}, "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw=="], + + "@rollup/pluginutils": ["@rollup/pluginutils@5.5.1", "", { "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", "picomatch": "^4.0.2" }, "peerDependencies": { "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "optionalPeers": ["rollup"] }, "sha512-P9ZvnfouRu4MSC+ilERaw6FmZs8zqKhpHxEs4aGDGWQAMzQGXnhvCSvoNwokfNvdt7t3Y5Y4p6gStQgezeIqug=="], + + "@sindresorhus/merge-streams": ["@sindresorhus/merge-streams@4.0.0", "", {}, "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ=="], + + "@standard-schema/spec": ["@standard-schema/spec@1.1.0", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="], + + "@stylistic/stylelint-plugin": ["@stylistic/stylelint-plugin@5.3.1", "", { "dependencies": { "@csstools/css-parser-algorithms": "^4.0.0", "@csstools/css-tokenizer": "^4.0.0", "@csstools/media-query-list-parser": "^5.0.0", "postcss": "^8.5.26", "postcss-selector-parser": "^7.1.5", "postcss-value-parser": "^4.2.0", "style-search": "^0.1.0" }, "peerDependencies": { "stylelint": "^17.6.0" } }, "sha512-w6WFLYzQS6nhbcoq8pwYP+OJYYhsdGEiCxY+eINi2+ouDwRLXTucXZj6IrDzkY4di+vsGOPVvJ4/gXChSeOtlw=="], + + "@tybys/wasm-util": ["@tybys/wasm-util@0.10.4", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A=="], + + "@types/bootstrap": ["@types/bootstrap@5.2.11", "", { "dependencies": { "@popperjs/core": "^2.9.2" } }, "sha512-69ykbLiNzQxi6Q/y/aYJLrlzI5QkLQjhIYW2U+cxujBxAmaBtmXKtxnFes59Ttfpt936as6xJU0dYnmVpcwIwg=="], + + "@types/chai": ["@types/chai@5.2.3", "", { "dependencies": { "@types/deep-eql": "*", "assertion-error": "^2.0.1" } }, "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA=="], + + "@types/color-convert": ["@types/color-convert@2.0.4", "", { "dependencies": { "@types/color-name": "^1.1.0" } }, "sha512-Ub1MmDdyZ7mX//g25uBAoH/mWGd9swVbt8BseymnaE18SU4po/PjmCrHxqIIRjBo3hV/vh1KGr0eMxUhp+t+dQ=="], + + "@types/color-name": ["@types/color-name@1.1.5", "", {}, "sha512-j2K5UJqGTxeesj6oQuGpMgifpT5k9HprgQd8D1Y0lOFqKHl3PJu5GMeS4Y5EgjS55AE6OQxf8mPED9uaGbf4Cg=="], + + "@types/debug": ["@types/debug@4.1.13", "", { "dependencies": { "@types/ms": "*" } }, "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw=="], + + "@types/deep-eql": ["@types/deep-eql@4.0.2", "", {}, "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw=="], + + "@types/esrecurse": ["@types/esrecurse@4.3.1", "", {}, "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw=="], + + "@types/estree": ["@types/estree@1.0.9", "", {}, "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg=="], + + "@types/geojson": ["@types/geojson@7946.0.16", "", {}, "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg=="], + + "@types/hast": ["@types/hast@3.0.5", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="], + + "@types/json-schema": ["@types/json-schema@7.0.15", "", {}, "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA=="], + + "@types/leaflet": ["@types/leaflet@1.9.22", "", { "dependencies": { "@types/geojson": "*" } }, "sha512-h3lhECYEKDasG7LFHu+GiHqAvsgLuQvlJvVZzJDGONo3sEL+wUOqSFLnwkZlK0qVxnxbuGFW8iBlJNYs5wgndA=="], + + "@types/mdast": ["@types/mdast@4.0.4", "", { "dependencies": { "@types/unist": "*" } }, "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA=="], + + "@types/ms": ["@types/ms@2.1.0", "", {}, "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA=="], + + "@types/node": ["@types/node@25.9.9", "", { "dependencies": { "undici-types": ">=7.24.0 <7.24.7" } }, "sha512-b4e2xxj/yMeT2hNlD6x7zNFiQK2Dlmkb9CQ6v3/1G2RezKN4YS2lcEv8lzGm1mhs4f2lM4yNAMI/zUDBZBBt7w=="], + + "@types/unist": ["@types/unist@3.0.3", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="], + + "@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.72.1", "", { "dependencies": { "@eslint-community/regexpp": "^4.12.2", "@typescript-eslint/scope-manager": "8.72.1", "@typescript-eslint/type-utils": "8.72.1", "@typescript-eslint/utils": "8.72.1", "@typescript-eslint/visitor-keys": "8.72.1", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.72.1", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-5CokTWXpmbylfFabsbvHC0CAw3XLaGnoa+nFJX5FR592h/LoZsENUE6p/rg5xvkKrFEXz6pYmgI29AgXc2N3BQ=="], + + "@typescript-eslint/parser": ["@typescript-eslint/parser@8.72.1", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.72.1", "@typescript-eslint/types": "8.72.1", "@typescript-eslint/typescript-estree": "8.72.1", "@typescript-eslint/visitor-keys": "8.72.1", "debug": "^4.4.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-ZGwZP4OCfyA0AQTpEAMWz+rtX01DRhQWW5hB0ucKDEIX5U7jdmPSaMx94rQfaPAQzIYz2BimOgKOJtjfpRFQ9g=="], + + "@typescript-eslint/project-service": ["@typescript-eslint/project-service@8.72.1", "", { "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.72.1", "@typescript-eslint/types": "^8.72.1", "debug": "^4.4.3" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-fAuVMkwdO/huI8nyo/WKnNKf6Gag93S56Rh3Ts5mGcavwSdaN8tRg1gCeIGX8PF+nzp1BjGfO4gHhGzW1J6jTg=="], + + "@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.72.1", "", { "dependencies": { "@typescript-eslint/types": "8.72.1", "@typescript-eslint/visitor-keys": "8.72.1" } }, "sha512-lC/t6eMCZZQAAKZEYGL6RDVSuFehpdmMT6h+nJIjIa6oylN/PwDgDVtEIbB7O9xFfZYtZAYLoLlDNWKJhtF+uQ=="], + + "@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.72.1", "", { "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-e4D5R5vpeAEPBxT2BAzsFQL3sbwyeeeo5+aczgNSRK1V734jE7pTqaGFU+fXapWEQwnZbpFaTn32+Z8DwS6OTg=="], + + "@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@8.72.1", "", { "dependencies": { "@typescript-eslint/types": "8.72.1", "@typescript-eslint/typescript-estree": "8.72.1", "@typescript-eslint/utils": "8.72.1", "debug": "^4.4.3", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-iY2wlmyrXJmx4yxUGP3aYCFF3cA/6ShddOKmLU2dx7LnEykbAM8WThlxZEfd1NddqceF6eJmZUayxx9oKIYNlg=="], + + "@typescript-eslint/types": ["@typescript-eslint/types@8.72.1", "", {}, "sha512-LmE5IhQet1BWOWEXqBrVtBPsMAOQ6Nzk35d+WLh3mk4EUF33sqlfxjio1MdYeSvKSG5skactKKuixBIKXhL4Rw=="], + + "@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.72.1", "", { "dependencies": { "@typescript-eslint/project-service": "8.72.1", "@typescript-eslint/tsconfig-utils": "8.72.1", "@typescript-eslint/types": "8.72.1", "@typescript-eslint/visitor-keys": "8.72.1", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-DAlUoUV93hIvrtIQLwCbmZQYVZwOMhiHJrOVUUIWicFZaIYjTRqlY3I/NZevfkLmSqkNHRu2qYDcq9lrn16oOQ=="], + + "@typescript-eslint/utils": ["@typescript-eslint/utils@8.72.1", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", "@typescript-eslint/scope-manager": "8.72.1", "@typescript-eslint/types": "8.72.1", "@typescript-eslint/typescript-estree": "8.72.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-5v5liypurJBFHCBNqh/RjsymAD+VWcE0djuGY/BUqp5fC3Qn+luWDEksjuTtWjPn6i5zQlUtkZCRG/CYG0yCkA=="], + + "@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.72.1", "", { "dependencies": { "@typescript-eslint/types": "8.72.1", "eslint-visitor-keys": "^5.0.0" } }, "sha512-SB8xqipSzZHUePCCLNeYxqnxq83X61/qzNhjQGbTfjxGZIeOEP7tBgWYX05Tcd6CgE02WdTJnh5b8kMZJ/+bnQ=="], + + "@ungap/structured-clone": ["@ungap/structured-clone@1.4.0", "", {}, "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ=="], + + "@unrs/resolver-binding-android-arm-eabi": ["@unrs/resolver-binding-android-arm-eabi@1.12.2", "", { "os": "android", "cpu": "arm" }, "sha512-g5T90pqg1bo/7mytQx6F4iBNC0Wsh9cu+z9veDbFjc7HjpesJFWD7QMS0NGStXM075+7dJPPVvBbpZlnrdpi/w=="], + + "@unrs/resolver-binding-android-arm64": ["@unrs/resolver-binding-android-arm64@1.12.2", "", { "os": "android", "cpu": "arm64" }, "sha512-YGCRZv/9GLhwmz6mYDeTsm/92BAyR28l6c2ReweVW5pWgfsitWLY8upvfRlGdoyD8HjeTHSYJWyZGD4KJA/nFQ=="], + + "@unrs/resolver-binding-darwin-arm64": ["@unrs/resolver-binding-darwin-arm64@1.12.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-u9DiNT1auQMO20A9SyTuG3wUgQWB9Z7KjAg0uFuCDR1FsAY8A0CG2S6JpHS1xwm/w1G08bjXZDcyOCjv1WAm2w=="], + + "@unrs/resolver-binding-darwin-x64": ["@unrs/resolver-binding-darwin-x64@1.12.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-f7rPLi/T1HVKZu/u6t87lroib16n8vrSzcyxI7lg4BGO9UF26KhQL44sd9eOUgrTYhvRXtWOIZT5PejdPyJfUA=="], + + "@unrs/resolver-binding-freebsd-x64": ["@unrs/resolver-binding-freebsd-x64@1.12.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-BpcOjWCJub6nRZUS2zA20pmLvjtqAtGejETaIyRLiZiQf++cbrjltLA5NN/xaXfqeOBOSlMFbemIl5/S5tljmg=="], + + "@unrs/resolver-binding-linux-arm-gnueabihf": ["@unrs/resolver-binding-linux-arm-gnueabihf@1.12.2", "", { "os": "linux", "cpu": "arm" }, "sha512-vZTDvdSISZjJx66OzJqtsOhzifbqRjbmI1Mnu49fQDwog5GtDI4QidRiEAYbZCRj9C8YZEW+3ZjqsyS9GR4k2A=="], + + "@unrs/resolver-binding-linux-arm-musleabihf": ["@unrs/resolver-binding-linux-arm-musleabihf@1.12.2", "", { "os": "linux", "cpu": "arm" }, "sha512-BiPI+IrIlwcW4nLLMM21+B1dFPzd55yAVgVGrdgDjNef+ch03GdxrcyaIz8X9SsQirh/kCQ7mviyWlMxdh2D7g=="], + + "@unrs/resolver-binding-linux-arm64-gnu": ["@unrs/resolver-binding-linux-arm64-gnu@1.12.2", "", { "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha512-zJc0H99FEPoFfSrNpa91HYfxzfAJCr502oxNK1cfdC9hlaFI43RT+JFCann9JUgZmLzzntChHyn13Sgn9ljHNg=="], + + "@unrs/resolver-binding-linux-arm64-musl": ["@unrs/resolver-binding-linux-arm64-musl@1.12.2", "", { "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha512-KQ3Lki6l+Pz1k/eBipN41ES+YUK30beLGb9YqcB1O542cyLCNE6GaxrfcY3T6EezmGGk84wb5XyO9loTM9tkcA=="], + + "@unrs/resolver-binding-linux-loong64-gnu": ["@unrs/resolver-binding-linux-loong64-gnu@1.12.2", "", { "os": "linux", "cpu": "none", "libc": "glibc" }, "sha512-3SJGEh1DborhG6pyxvhPzCT4bbSIVihsvgJc13P1bHG7KLdNDaF9T3gsTwFc7Jw/5Y5/iWOjkEx7Zy0NvCGX3Q=="], + + "@unrs/resolver-binding-linux-loong64-musl": ["@unrs/resolver-binding-linux-loong64-musl@1.12.2", "", { "os": "linux", "cpu": "none", "libc": "musl" }, "sha512-jiuG/Obbel7uw1PwHNFfrkiKhLAF6mnyZ6aWlOAVN9WqKm8v0OFGnciJIHu8+CMvXLQ8AD51LPzAoUfT21D5Ew=="], + + "@unrs/resolver-binding-linux-ppc64-gnu": ["@unrs/resolver-binding-linux-ppc64-gnu@1.12.2", "", { "os": "linux", "cpu": "ppc64", "libc": "glibc" }, "sha512-q7xRvVpmcfeL+LlZg8Pbbo6QaTZwDU5BaGZbwfhkEsXJn3Was8xYfE0RBH266xZt0rM6B7i8xAYIvjthuUIWHg=="], + + "@unrs/resolver-binding-linux-riscv64-gnu": ["@unrs/resolver-binding-linux-riscv64-gnu@1.12.2", "", { "os": "linux", "cpu": "none", "libc": "glibc" }, "sha512-0CVdx6lcnT3Q9inOH8tsMIOJ6ImndllMjqJHg8RLVdB7Vq4SfkEXl9mCSsVNuNA4MCYycRicCUxPCabVHJRr6A=="], + + "@unrs/resolver-binding-linux-riscv64-musl": ["@unrs/resolver-binding-linux-riscv64-musl@1.12.2", "", { "os": "linux", "cpu": "none", "libc": "musl" }, "sha512-iOwlRo9vnp6R6ohHQS11n0NnfdXx/omhkocmIfaPRpQhKZ+3BDMkkdRVh53qjkFkpPddf+FETA28NwGN7l5l+w=="], + + "@unrs/resolver-binding-linux-s390x-gnu": ["@unrs/resolver-binding-linux-s390x-gnu@1.12.2", "", { "os": "linux", "cpu": "s390x", "libc": "glibc" }, "sha512-HYJtLfXq94q8iZNFT1lknx258wlkkWhZeUXJRqzKBBUJ00CvZ+N33zgbCqimLjsyw5Va6uUxhVa12mI+kaveEw=="], + + "@unrs/resolver-binding-linux-x64-gnu": ["@unrs/resolver-binding-linux-x64-gnu@1.12.2", "", { "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-mPsUhunKKDih5O96Y6enDQyHc1SqBPlY1E/SfMWDM3EdJ95Z9CArPeCVwCCqbP45ljvivdEk8Fxn+SIb1rDAJQ=="], + + "@unrs/resolver-binding-linux-x64-musl": ["@unrs/resolver-binding-linux-x64-musl@1.12.2", "", { "os": "linux", "cpu": "x64", "libc": "musl" }, "sha512-azrt6+5ydLd8Vt210AAFis/lZevSfPw93EJRIJG+xPu4WCJ8K0kppCTpMyLPcKT7H15M4Jnt2tMp5bOvCkRC6A=="], + + "@unrs/resolver-binding-openharmony-arm64": ["@unrs/resolver-binding-openharmony-arm64@1.12.2", "", { "os": "none", "cpu": "arm64" }, "sha512-YZ9hP4O0X9PQb8eO980qmLNGH4zT3I9+SZTdt0Pr0YyuGQhYKoOZkV02VzrzyOZJ5xIJ3UFIenKkUkGg8GjgWQ=="], + + "@unrs/resolver-binding-wasm32-wasi": ["@unrs/resolver-binding-wasm32-wasi@1.12.2", "", { "dependencies": { "@emnapi/core": "1.10.0", "@emnapi/runtime": "1.10.0", "@napi-rs/wasm-runtime": "^1.1.4" }, "cpu": "none" }, "sha512-tYFDIkMxSflfEc/h92ZWNsZlHSwgimbNHSO3PL2JWQHfCuC2q316jMyYU9TIWZsFK2bQwyK5VAdYgn8ygPj69A=="], + + "@unrs/resolver-binding-win32-arm64-msvc": ["@unrs/resolver-binding-win32-arm64-msvc@1.12.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-qzNyg3xL0VPQmCaUh+N5jSitce6k+uCBfMDesWRnlULOZaqUkaJ0ybdT+UqlAWJoQjuqfIU/0Ptx9bteN4D82g=="], + + "@unrs/resolver-binding-win32-ia32-msvc": ["@unrs/resolver-binding-win32-ia32-msvc@1.12.2", "", { "os": "win32", "cpu": "ia32" }, "sha512-WD9sY00OfpHVGfsnHZoA8jVT+esS/Bg8z8jzxp5BnDCjjwsuKsPQrzswwpFy4J1AUJbXPRfkpcX0mXrzeXW79g=="], + + "@unrs/resolver-binding-win32-x64-msvc": ["@unrs/resolver-binding-win32-x64-msvc@1.12.2", "", { "os": "win32", "cpu": "x64" }, "sha512-nAB74NfSNKknqQ1RrYj6uz8FcXEomu/MATJZxh/x+BArzN2U3JbOYC0APYzUIGhVY3m5hRxA8VPNdPBoG8txlA=="], + + "@vitejs/plugin-basic-ssl": ["@vitejs/plugin-basic-ssl@2.3.0", "", { "peerDependencies": { "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-bdyo8rB3NnQbikdMpHaML9Z1OZPBu6fFOBo+OtxsBlvMJtysWskmBcnbIDhUqgC8tcxNv/a+BcV5U+2nQMm1OQ=="], + + "@vitejs/plugin-vue": ["@vitejs/plugin-vue@6.0.10", "", { "dependencies": { "@rolldown/pluginutils": "^1.0.1" }, "peerDependencies": { "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0", "vue": "^3.2.25 || ^3.6.0-rc.10" } }, "sha512-b80aUQh3n+qEzzZm5oQp3rT2QImeCx58K6eFl/RkJ3d65KW0kTuv5lNsLRVAjbW9YRUpo/wzmvzMgV34bTAItA=="], + + "@vitest/coverage-v8": ["@vitest/coverage-v8@4.1.12", "", { "dependencies": { "@bcoe/v8-coverage": "^1.0.2", "@vitest/utils": "4.1.12", "ast-v8-to-istanbul": "^1.0.0", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.2.0", "magicast": "^0.5.2", "obug": "^2.1.1", "std-env": "^4.0.0-rc.1", "tinyrainbow": "^3.1.0" }, "peerDependencies": { "@vitest/browser": "4.1.12", "vitest": "4.1.12" }, "optionalPeers": ["@vitest/browser"] }, "sha512-6S7/iVknKglLAxMFxQGNppBI0iqJS2NgM6FBxavitj7KaDq/vywOWGf6dGu7F2L1Qy0G6S3uTp7aGshHrzK8JA=="], + + "@vitest/expect": ["@vitest/expect@4.1.12", "", { "dependencies": { "@standard-schema/spec": "^1.1.0", "@types/chai": "^5.2.2", "@vitest/spy": "4.1.12", "@vitest/utils": "4.1.12", "chai": "^6.2.2", "tinyrainbow": "^3.1.0" } }, "sha512-vFlTt+YEu9WBpNjdGayNmlMVzrWPi1+sv853/7t2FU7hpO5gAFBKHzQmkCq5Xjpr+evegF2994LQT3hF3mRlqQ=="], + + "@vitest/mocker": ["@vitest/mocker@4.1.12", "", { "dependencies": { "@vitest/spy": "4.1.12", "estree-walker": "^3.0.3", "magic-string": "^0.30.21" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "optionalPeers": ["msw", "vite"] }, "sha512-fKShNpKZzupWZuY0z7egydvL0sqW4INEZBEExMBMAa6izlENEVHwoXgdaTCaBZ5fwlr4xf2o1wXC83n9RpO+NA=="], + + "@vitest/pretty-format": ["@vitest/pretty-format@4.1.12", "", { "dependencies": { "tinyrainbow": "^3.1.0" } }, "sha512-XW9O8+Mxx4VpCtkYdMJLZQQwsVryP9wk7cPKDxtXFfwSak6yRh5+2fep/Y0XF/ElBvJHq8bcYdi6aeuai0opZA=="], + + "@vitest/runner": ["@vitest/runner@4.1.12", "", { "dependencies": { "@vitest/utils": "4.1.12", "pathe": "^2.0.3" } }, "sha512-NKlVKCr5QnCe8jijdMnmkpHHU+WTqiLFR6G0pHji9uRjXK9xJl1k1nTw6F3pOOj2PDcsDt2GKQMI7wIsaT491w=="], + + "@vitest/snapshot": ["@vitest/snapshot@4.1.12", "", { "dependencies": { "@vitest/pretty-format": "4.1.12", "@vitest/utils": "4.1.12", "magic-string": "^0.30.21", "pathe": "^2.0.3" } }, "sha512-ko1y1Qgb/slzQ9mr+b89Cuqud8WG1TKtsPD8r7ZUBdvVOGt85Af2HwCqHujrhwJq95hs/9RM7fcAPg57o1vlzw=="], + + "@vitest/spy": ["@vitest/spy@4.1.12", "", {}, "sha512-RGq9x4JNGNTZHEJxvN0oSiJjeSCExm0n2gZKKJZHY9cX5AVA6M7VJILBT3ZJ/tJ/0J9uWT7fETV9/btoi//vSg=="], + + "@vitest/utils": ["@vitest/utils@4.1.12", "", { "dependencies": { "@vitest/pretty-format": "4.1.12", "convert-source-map": "^2.0.0", "tinyrainbow": "^3.1.0" } }, "sha512-Q3awXrwOfEV+qc3WmO5ONyE0yO7Q1gQ9/oyHxGLZ/pl7N3NO/ZztqQwKLuwMkV+CA1JYSIeO3gkHnRDIo4AVaA=="], + + "@voerro/vue-tagsinput": ["@voerro/vue-tagsinput@2.7.1", "", {}, "sha512-G7ClILHgtc/D1vEw9qp6dlsAstlhwLDkPvEp6w1iY/dmSzu4hhxaMk8jyahjxQRDgiLlrAikESOsfkVhy18YwQ=="], + + "@volar/language-core": ["@volar/language-core@2.4.28", "", { "dependencies": { "@volar/source-map": "2.4.28" } }, "sha512-w4qhIJ8ZSitgLAkVay6AbcnC7gP3glYM3fYwKV3srj8m494E3xtrCv6E+bWviiK/8hs6e6t1ij1s2Endql7vzQ=="], + + "@volar/source-map": ["@volar/source-map@2.4.28", "", {}, "sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ=="], + + "@volar/typescript": ["@volar/typescript@2.4.28", "", { "dependencies": { "@volar/language-core": "2.4.28", "path-browserify": "^1.0.1", "vscode-uri": "^3.0.8" } }, "sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw=="], + + "@vue/compiler-core": ["@vue/compiler-core@3.5.44", "", { "dependencies": { "@babel/parser": "^7.29.9", "@vue/shared": "3.5.44", "entities": "^7.0.1", "estree-walker": "^2.0.2", "source-map-js": "^1.2.2" } }, "sha512-k34nCytbK8PQ1gR2mGROYOw6Pnv/mumqIdrZ3x2tbyXZDWm7ViKGLTfdB+DRrWqEQsLgGJvn0WN9jBif5zCTLQ=="], + + "@vue/compiler-dom": ["@vue/compiler-dom@3.5.44", "", { "dependencies": { "@vue/compiler-core": "3.5.44", "@vue/shared": "3.5.44" } }, "sha512-W5AoBFWdw1lQAKiHowkfgFKFab82oSRT6sGsPfw/q1GRjsy/ZJFLHGhJyBRIFN9APLTUduDH9U2JAiPOIyKuYg=="], + + "@vue/compiler-sfc": ["@vue/compiler-sfc@3.5.44", "", { "dependencies": { "@babel/parser": "^7.29.9", "@vue/compiler-core": "3.5.44", "@vue/compiler-dom": "3.5.44", "@vue/compiler-ssr": "3.5.44", "@vue/shared": "3.5.44", "estree-walker": "^2.0.2", "magic-string": "^0.30.21", "postcss": "^8.5.29", "source-map-js": "^1.2.2" } }, "sha512-dzHmQ4jXTpdr5FjIQUeykVakN/uzqFbUo9/C5ikBFg3a3PeM6uRxeczx1ZbXBML0/zJstEh3ygYipzR5Z7b2Pw=="], + + "@vue/compiler-ssr": ["@vue/compiler-ssr@3.5.44", "", { "dependencies": { "@vue/compiler-dom": "3.5.44", "@vue/shared": "3.5.44" } }, "sha512-xr5gb1JVHlfXJwSlRz1FeP6uxoazdzHuMTVLE7up+4Vrqxk219CvxLPxD9NXBt47yvZW7+p4DXfyp4O1fkByIA=="], + + "@vue/devtools-api": ["@vue/devtools-api@7.7.10", "", { "dependencies": { "@vue/devtools-kit": "^7.7.10" } }, "sha512-KxtEpUOOpFz/qOGRrAwA36QF7DqIA+FXgCYit9mk9wjbaZt0sXOFz81ElOZtKA4HbWHUdwNjZHBFsFFyp5BZiA=="], + + "@vue/devtools-kit": ["@vue/devtools-kit@7.7.10", "", { "dependencies": { "@vue/devtools-shared": "^7.7.10", "birpc": "^2.3.0", "hookable": "^5.5.3", "mitt": "^3.0.1", "perfect-debounce": "^1.0.0", "speakingurl": "^14.0.1", "superjson": "^2.2.2" } }, "sha512-3WNi2Kq4tbpVbmhml7RiphmAt0279oh3fKNeWMQIrltfX8Q91b4i5PL8DtyNKdwmcsGrV4fg+erwWOmD05CLIw=="], + + "@vue/devtools-shared": ["@vue/devtools-shared@7.7.10", "", { "dependencies": { "rfdc": "^1.4.1" } }, "sha512-wOPslzB8vTvpxwdaOcR2qAbwmuSP0L+rhpoC6Cf56V3Jip+HWb7PQQXOUPgBNQARpXsbQX/+mvi8kKucmBGRwQ=="], + + "@vue/eslint-config-typescript": ["@vue/eslint-config-typescript@14.9.0", "", { "dependencies": { "@typescript-eslint/utils": "^8.60.0", "fast-glob": "^3.3.3", "typescript-eslint": "^8.60.0", "vue-eslint-parser": "^10.4.0" }, "peerDependencies": { "eslint": "^9.10.0 || ^10.0.0", "eslint-plugin-vue": "^9.28.0 || ^10.0.0", "typescript": ">=4.8.4" }, "optionalPeers": ["typescript"], "bin": { "vue-eslint-config-typescript": "./dist/bin.js" } }, "sha512-E3j9hDlfVf10F30MRcLTPY2IIhWIx1nsvkVukk14kTcuA+oBVot9zsP1hzsO+PAMDxV3Fd9FimBJtUBNBL5KFA=="], + + "@vue/language-core": ["@vue/language-core@3.3.13", "", { "dependencies": { "@volar/language-core": "2.4.28", "@vue/compiler-dom": "^3.5.0", "@vue/shared": "^3.5.0", "alien-signals": "^3.2.1", "muggle-string": "^0.4.1", "path-browserify": "^1.0.1", "picomatch": "^4.0.4" } }, "sha512-axA0Xemn5LuUKuKWob0/kVq7xQ2mJJM6VqA9Exvt35nM9yRC31goWVve/G/Zb2ZCLsXC8FHYjjfXlnshknSCew=="], + + "@vue/reactivity": ["@vue/reactivity@3.5.44", "", { "dependencies": { "@vue/shared": "3.5.44" } }, "sha512-u+QJdKeBBEADkPdevsL+6E12QlYVfBD8Zcw5qjDQKtamI6l14KyqazJMobhCKelhWN5zpyKUiEDoTyHE93cqWw=="], + + "@vue/runtime-core": ["@vue/runtime-core@3.5.44", "", { "dependencies": { "@vue/reactivity": "3.5.44", "@vue/shared": "3.5.44" } }, "sha512-uEa/ndwjhrrhnOfb2p+sZy6zeoamJOISqaLSJGk/8R6nABT1ZldpzcJoPzKj+zHVomVBPcmQYyC2r4LtvDV6CQ=="], + + "@vue/runtime-dom": ["@vue/runtime-dom@3.5.44", "", { "dependencies": { "@vue/reactivity": "3.5.44", "@vue/runtime-core": "3.5.44", "@vue/shared": "3.5.44", "csstype": "^3.2.3" } }, "sha512-3fc4ARcXVhVBaJ3ujWiNZJARD6pkyRcwG+ZYhMzjKtKUp7MAY0HLwr7r3Smep3Li6ZaWT6ewdmx8XqdaD5oNZg=="], + + "@vue/server-renderer": ["@vue/server-renderer@3.5.44", "", { "dependencies": { "@vue/compiler-ssr": "3.5.44", "@vue/runtime-dom": "3.5.44", "@vue/shared": "3.5.44" } }, "sha512-R4S1UoH4h5Frrauv8Z5XE5TxV9oBiUSgWIC4TyVK1FK+RocRnOLwFA5Xcmo2011RlgJp+AbZCnw6afrhlgRuUQ=="], + + "@vue/shared": ["@vue/shared@3.5.44", "", {}, "sha512-H82XLH0DjmSOdbEwO15x3QTo1f5PWEtv237eLpYKc0mqLu+B8hnq16lFWmuBmNurkeiG3wr+oM1FhOll/YVFRg=="], + + "@vue/tsconfig": ["@vue/tsconfig@0.9.1", "", { "peerDependencies": { "typescript": ">= 5.8", "vue": "^3.4.0" }, "optionalPeers": ["typescript", "vue"] }, "sha512-buvjm+9NzLCJL29KY1j1991YYJ5e6275OiK+G4jtmfIb+z4POywbdm0wXusT9adVWqe0xqg70TbI7+mRx4uU9w=="], + + "@vueform/multiselect": ["@vueform/multiselect@2.6.11", "", {}, "sha512-iG4TGfqE3baftbSGF0PhoS+xZOCnV0ChkDo9rwhJ/Qi2YlCdb6tyQCjvyug3jnzncga8+d85kx0WvG7rDYFqiA=="], + + "acorn": ["acorn@8.19.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw=="], + + "acorn-jsx": ["acorn-jsx@5.3.2", "", { "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="], + + "agent-base": ["agent-base@6.0.2", "", { "dependencies": { "debug": "4" } }, "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ=="], + + "ajv": ["ajv@6.15.0", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw=="], + + "alien-signals": ["alien-signals@3.2.1", "", {}, "sha512-I8FjmltrfnDFoZedi5CG8DghVYNhzb/Ijluz7tCSJH0xpd0484Kowhbb1XDYOxfJpU1p5wnM2X54dA+IfGyD1g=="], + + "ansi-regex": ["ansi-regex@6.4.0", "", {}, "sha512-KzTVk2tCWAHtYrvvvaP8bJKJq2pVinhLcGEQdtLIYPbmNGNyYe8QwNaTUYQp2J7/vIsUKt5QCqAfUkYyG9DkOw=="], + + "ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], + + "anymatch": ["anymatch@3.1.3", "", { "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" } }, "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw=="], + + "argparse": ["argparse@3.0.4", "", {}, "sha512-fwWK3Zq22l4XJJjx5mcBHGikIk+hJqO+32dPm0Jur7+rtG5x1scOjSfdT9ZKeWHPpsya/l0HHK4tDImBkTrtvA=="], + + "assertion-error": ["assertion-error@2.0.1", "", {}, "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA=="], + + "ast-v8-to-istanbul": ["ast-v8-to-istanbul@1.0.7", "", { "dependencies": { "@jridgewell/trace-mapping": "^0.3.31", "estree-walker": "^3.0.3", "js-tokens": "^10.0.0" } }, "sha512-kFL68AG6ajd8fg248zwM9GQrUWEp79gsmjum34OEXjs4yHuUMZfYKwOLW9GMmB4oNvVrj+EAGxsP7ye2UR9UlA=="], + + "astral-regex": ["astral-regex@2.0.0", "", {}, "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ=="], + + "asynckit": ["asynckit@0.4.0", "", {}, "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="], + + "autoprefixer": ["autoprefixer@10.6.2", "", { "dependencies": { "browserslist": "^4.28.9", "caniuse-lite": "^1.0.30001810", "fraction.js": "^5.3.4", "picocolors": "^1.1.1", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.1.0" }, "bin": { "autoprefixer": "bin/autoprefixer" } }, "sha512-VOw9/yGTGwPPgzFcODtcv6zhEPIeIWkRSe10L2ri2f5vZ7ID7lCt6jZzRF5/ubgOZ+szYydmEF5AYsA5jxX1tA=="], + + "axios": ["axios@1.21.0", "", { "dependencies": { "follow-redirects": "^1.16.0", "form-data": "^4.0.6", "https-proxy-agent": "^5.0.1", "proxy-from-env": "^2.1.0" } }, "sha512-YCzXMB53Q9PZBsh7yN7wtapit4WepwcHS2fP8QhGsBxSz5YtgYobV7GGlWlAJi+RxfU77GQTQi2DSLUma42EYA=="], + + "bail": ["bail@2.0.2", "", {}, "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw=="], + + "balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="], + + "baseline-browser-mapping": ["baseline-browser-mapping@2.11.33", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-yiVKDX+qCMRKBE084lXvq9EcwFUhKZ2nU8TK1EQQuOgPNR/lmbGxXOeDdlGUqC2Zz11Cs9rk1d/8NfgBmlkt0w=="], + + "bidi-js": ["bidi-js@1.1.0", "", { "dependencies": { "require-from-string": "^2.0.2" } }, "sha512-fX1Onk0tdVPC7obPWB5EbJ1z7NVhLq4m2xZLq2YXBkxzMXIGRpNMU88n0EPgWseKl12J7zXs7qrDxPK4sRs2fg=="], + + "binary-extensions": ["binary-extensions@2.3.0", "", {}, "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw=="], + + "birpc": ["birpc@2.9.0", "", {}, "sha512-KrayHS5pBi69Xi9JmvoqrIgYGDkD6mcSe/i6YKi3w5kekCLzrX4+nawcXqrj2tIp50Kw/mT/s3p+GVK0A0sKxw=="], + + "blurhash": ["blurhash@2.0.5", "", {}, "sha512-cRygWd7kGBQO3VEhPiTgq4Wc43ctsM+o46urrmPOiuAe+07fzlSB9OJVdpgDL0jPqXUVQ9ht7aq7kxOeJHRK+w=="], + + "boolbase": ["boolbase@1.0.0", "", {}, "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww=="], + + "bootstrap": ["bootstrap@5.3.8", "", { "peerDependencies": { "@popperjs/core": "^2.11.8" } }, "sha512-HP1SZDqaLDPwsNiqRqi5NcP0SSXciX2s9E+RyqJIIqGo+vJeN5AJVM98CXmW/Wux0nQ5L7jeWUdplCEf0Ee+tg=="], + + "brace-expansion": ["brace-expansion@5.0.12", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ=="], + + "braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="], + + "browserslist": ["browserslist@4.29.5", "", { "dependencies": { "baseline-browser-mapping": "^2.11.33", "caniuse-lite": "^1.0.30001819", "electron-to-chromium": "^1.5.464", "node-releases": "^2.0.60", "update-browserslist-db": "^1.3.4" }, "bin": { "browserslist": "cli.js" } }, "sha512-khTmKu5NGYTotqcYo8Bew2k4RAE9PuXRSFRXG2lQBrCEQHyeQ/vX6gKMxfokwywBsLiXZMnHsmWMG1pnO8J7uQ=="], + + "cacheable": ["cacheable@2.5.0", "", { "dependencies": { "@cacheable/memory": "^2.2.0", "@cacheable/utils": "^2.5.0", "hookified": "^1.15.0", "keyv": "^5.6.0", "qified": "^0.10.1" } }, "sha512-60cyAOytib/OzBw1JNSoSV/boK1AtHryDIjvVBk7XbN4ugfkM3+Sry7fEjNgPMGgOjuaZPAp8ruZ0Cxafwyq9g=="], + + "call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="], + + "callsites": ["callsites@3.1.0", "", {}, "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="], + + "caniuse-lite": ["caniuse-lite@1.0.30001819", "", {}, "sha512-LFUqIIAwpzsIuevnKnsR9qnStBcgzPShTX61lBwN9uFkkf8o8zLiebEjbW8AYtZiF+1YKDWfdt/pWDtMuG8Xwg=="], + + "ccount": ["ccount@2.0.1", "", {}, "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg=="], + + "chai": ["chai@6.3.0", "", {}, "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg=="], + + "character-entities": ["character-entities@2.0.2", "", {}, "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ=="], + + "character-entities-html4": ["character-entities-html4@2.1.0", "", {}, "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA=="], + + "character-entities-legacy": ["character-entities-legacy@3.0.0", "", {}, "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ=="], + + "chokidar": ["chokidar@4.0.3", "", { "dependencies": { "readdirp": "^4.0.1" } }, "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA=="], + + "ckeditor5": ["ckeditor5@48.5.3", "", { "dependencies": { "@ckeditor/ckeditor5-adapter-ckfinder": "48.5.3", "@ckeditor/ckeditor5-alignment": "48.5.3", "@ckeditor/ckeditor5-autoformat": "48.5.3", "@ckeditor/ckeditor5-autosave": "48.5.3", "@ckeditor/ckeditor5-basic-styles": "48.5.3", "@ckeditor/ckeditor5-block-quote": "48.5.3", "@ckeditor/ckeditor5-bookmark": "48.5.3", "@ckeditor/ckeditor5-ckbox": "48.5.3", "@ckeditor/ckeditor5-ckfinder": "48.5.3", "@ckeditor/ckeditor5-clipboard": "48.5.3", "@ckeditor/ckeditor5-cloud-services": "48.5.3", "@ckeditor/ckeditor5-code-block": "48.5.3", "@ckeditor/ckeditor5-core": "48.5.3", "@ckeditor/ckeditor5-easy-image": "48.5.3", "@ckeditor/ckeditor5-editor-balloon": "48.5.3", "@ckeditor/ckeditor5-editor-classic": "48.5.3", "@ckeditor/ckeditor5-editor-decoupled": "48.5.3", "@ckeditor/ckeditor5-editor-inline": "48.5.3", "@ckeditor/ckeditor5-editor-multi-root": "48.5.3", "@ckeditor/ckeditor5-emoji": "48.5.3", "@ckeditor/ckeditor5-engine": "48.5.3", "@ckeditor/ckeditor5-enter": "48.5.3", "@ckeditor/ckeditor5-essentials": "48.5.3", "@ckeditor/ckeditor5-find-and-replace": "48.5.3", "@ckeditor/ckeditor5-font": "48.5.3", "@ckeditor/ckeditor5-fullscreen": "48.5.3", "@ckeditor/ckeditor5-heading": "48.5.3", "@ckeditor/ckeditor5-highlight": "48.5.3", "@ckeditor/ckeditor5-horizontal-line": "48.5.3", "@ckeditor/ckeditor5-html-embed": "48.5.3", "@ckeditor/ckeditor5-html-support": "48.5.3", "@ckeditor/ckeditor5-icons": "48.5.3", "@ckeditor/ckeditor5-image": "48.5.3", "@ckeditor/ckeditor5-indent": "48.5.3", "@ckeditor/ckeditor5-language": "48.5.3", "@ckeditor/ckeditor5-link": "48.5.3", "@ckeditor/ckeditor5-list": "48.5.3", "@ckeditor/ckeditor5-markdown-gfm": "48.5.3", "@ckeditor/ckeditor5-media-embed": "48.5.3", "@ckeditor/ckeditor5-mention": "48.5.3", "@ckeditor/ckeditor5-minimap": "48.5.3", "@ckeditor/ckeditor5-page-break": "48.5.3", "@ckeditor/ckeditor5-paragraph": "48.5.3", "@ckeditor/ckeditor5-paste-from-office": "48.5.3", "@ckeditor/ckeditor5-remove-format": "48.5.3", "@ckeditor/ckeditor5-restricted-editing": "48.5.3", "@ckeditor/ckeditor5-select-all": "48.5.3", "@ckeditor/ckeditor5-show-blocks": "48.5.3", "@ckeditor/ckeditor5-source-editing": "48.5.3", "@ckeditor/ckeditor5-special-characters": "48.5.3", "@ckeditor/ckeditor5-style": "48.5.3", "@ckeditor/ckeditor5-table": "48.5.3", "@ckeditor/ckeditor5-typing": "48.5.3", "@ckeditor/ckeditor5-ui": "48.5.3", "@ckeditor/ckeditor5-undo": "48.5.3", "@ckeditor/ckeditor5-upload": "48.5.3", "@ckeditor/ckeditor5-utils": "48.5.3", "@ckeditor/ckeditor5-watchdog": "48.5.3", "@ckeditor/ckeditor5-widget": "48.5.3", "@ckeditor/ckeditor5-word-count": "48.5.3" } }, "sha512-TmS7pCAeZHTfV3vBFG5zerdZCwmV7uceEeKolcvxO8J55pThJRygO/siDVXW26qo0zNQKZk5o7PJbHSYF5pFsg=="], + + "color-convert": ["color-convert@3.1.0", "", { "dependencies": { "color-name": "^2.0.0" } }, "sha512-TVoqAq8ZDIpK5lsQY874DDnu65CSsc9vzq0wLpNQ6UMBq81GSZocVazPiBbYGzngzBOIRahpkTzCLVe2at4MfA=="], + + "color-name": ["color-name@2.1.1", "", {}, "sha512-p2FdgwVx1a9yWBHP2wI0VgShkDpgN4kZISkxdNipGBJWpa5G6b04OINlVWCyJj0JmfvcPrgqt95E9k8yvaOJFg=="], + + "color-parse": ["color-parse@2.0.2", "", { "dependencies": { "color-name": "^2.0.0" } }, "sha512-eCtOz5w5ttWIUcaKLiktF+DxZO1R9KLNY/xhbV6CkhM7sR3GhVghmt6X6yOnzeaM24po+Z9/S1apbXMwA3Iepw=="], + + "colord": ["colord@2.10.0", "", {}, "sha512-AidJptpBJmjTclAp9BkLwJi0T93fo5epJnbaZslpg6QVzpHjAiveF55mE9AcUJiGMqRHgMDY8soMsQtuNYMHfw=="], + + "colorjs.io": ["colorjs.io@0.7.1", "", {}, "sha512-LY7OHnJZxHwT5UlzNa9bbhHHDbzB6yE5+3MIPwJEQKRvSCt/T4G7epsj+9j2BExUIIfXFIJGsIXUKdfrK9Q5tA=="], + + "combined-stream": ["combined-stream@1.0.8", "", { "dependencies": { "delayed-stream": "~1.0.0" } }, "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="], + + "comma-separated-tokens": ["comma-separated-tokens@2.0.3", "", {}, "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg=="], + + "commander": ["commander@12.1.0", "", {}, "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA=="], + + "comment-parser": ["comment-parser@1.4.9", "", {}, "sha512-+2AvZKjJaNq9GQljm3tr0utwrig5BL+jgJGvz5rDpGKNIp+ojcRXWUwBbh/sGIi1QCprR6PsKFakub+w1v+4hQ=="], + + "convert-source-map": ["convert-source-map@2.0.0", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="], + + "copy-anything": ["copy-anything@4.1.5", "", {}, "sha512-vePst2VLTSqPglW7Q98VwFpGiGpOHTyXIo81MO5VyLecA5zMbZw/P/V1vmwD1jksa2iJpn/YkDrJ3XhTfzUyhQ=="], + + "cosmiconfig": ["cosmiconfig@9.0.2", "", { "dependencies": { "env-paths": "^2.2.1", "import-fresh": "^3.3.0", "js-yaml": "^4.1.0", "parse-json": "^5.2.0" }, "peerDependencies": { "typescript": ">=4.9.5" }, "optionalPeers": ["typescript"] }, "sha512-gtTZxTDau1wL7Y7zifc2dd8jHSK/k6BTx/2Xp/BpdlAdnlYWFVt7qhJqgwi7637yRwRQ3qL4ZidbB4I8tA5VOg=="], + + "cropperjs": ["cropperjs@2.3.1", "", { "dependencies": { "@cropper/elements": "^2.3.1", "@cropper/utils": "^2.3.1" } }, "sha512-bgy+iHRFjsBxBCriXkTuFuHRJGSGZISuqDGhDQG7gLK0F7qOzhH06bdXzGf4b0bZSQ+mApakybiW9xvKnS9dbg=="], + + "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], + + "css-functions-list": ["css-functions-list@3.3.3", "", {}, "sha512-8HFEBPKhOpJPEPu70wJJetjKta86Gw9+CCyCnB3sui2qQfOvRyqBy4IKLKKAwdMpWb2lHXWk9Wb4Z6AmaUT1Pg=="], + + "css-tree": ["css-tree@3.2.1", "", { "dependencies": { "mdn-data": "2.27.1", "source-map-js": "^1.2.1" } }, "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA=="], + + "cssesc": ["cssesc@3.0.0", "", { "bin": "bin/cssesc" }, "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg=="], + + "csstype": ["csstype@3.2.3", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="], + + "data-urls": ["data-urls@7.0.0", "", { "dependencies": { "whatwg-mimetype": "^5.0.0", "whatwg-url": "^16.0.0" } }, "sha512-23XHcCF+coGYevirZceTVD7NdJOqVn+49IHyxgszm+JIiHLoB2TkmPtsYkNWT1pvRSGkc35L6NHs0yHkN2SumA=="], + + "debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], + + "decimal.js": ["decimal.js@10.6.0", "", {}, "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg=="], + + "decode-named-character-reference": ["decode-named-character-reference@1.3.0", "", { "dependencies": { "character-entities": "^2.0.0" } }, "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q=="], + + "deep-is": ["deep-is@0.1.4", "", {}, "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="], + + "delayed-stream": ["delayed-stream@1.0.0", "", {}, "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="], + + "dequal": ["dequal@2.0.3", "", {}, "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA=="], + + "detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], + + "devlop": ["devlop@1.1.0", "", { "dependencies": { "dequal": "^2.0.0" } }, "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA=="], + + "dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="], + + "electron-to-chromium": ["electron-to-chromium@1.5.465", "", {}, "sha512-zg4iUpbeGw7YNZsswc2xKr2uiBex2d8dELAXo92Icw3but1ULbrvK8USe6wVLaWjgJnKBARv0pchx9Owktx6wQ=="], + + "emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], + + "entities": ["entities@8.1.0", "", {}, "sha512-kxL7msIffSuh9aaFAMD7rxAIuTRMAHMeBtgHW2yUdWw732ZNh4MehkF2gdjvtdmikkaIP9bFDDJOPlsvm7avrA=="], + + "env-paths": ["env-paths@2.2.1", "", {}, "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A=="], + + "error-ex": ["error-ex@1.3.4", "", { "dependencies": { "is-arrayish": "^0.2.1" } }, "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ=="], + + "es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="], + + "es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="], + + "es-module-lexer": ["es-module-lexer@2.3.2", "", {}, "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw=="], + + "es-object-atoms": ["es-object-atoms@1.1.2", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw=="], + + "es-set-tostringtag": ["es-set-tostringtag@2.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA=="], + + "es-toolkit": ["es-toolkit@1.52.0", "", {}, "sha512-XTNEJQh1tY1ZJVcf6ayP/2n4ZPyaHlW2FWs7xvw5ddPuhUVjLD3olQVQS7kf58JbAB48iL0uL/jerTrjtV3lDA=="], + + "escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="], + + "escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="], + + "eslint": ["eslint@10.13.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.2", "@eslint/config-array": "^0.23.5", "@eslint/config-helpers": "^0.7.0", "@eslint/core": "^1.2.1", "@eslint/plugin-kit": "^0.7.3", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "ajv": "^6.14.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^9.1.2", "eslint-visitor-keys": "^5.0.1", "espree": "^11.2.0", "esquery": "^1.7.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "11.1.5 || >11.1.6 <12", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "minimatch": "^10.2.5", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, "peerDependencies": { "jiti": "*" }, "optionalPeers": ["jiti"], "bin": { "eslint": "bin/eslint.js" } }, "sha512-UohDjD4zSzEwhf58M3O7vc/ycc8O1I7dNlhtD0WxE8Px8EHNJKtUwzBqrzeGhisRuv2ag4sAYswszCJRgKXYUg=="], + + "eslint-formatter-junit": ["eslint-formatter-junit@9.0.1", "", {}, "sha512-0MrNGXg2C46M/ImjWuClHSGKHBR0eSBPfYHqPgYmB0utq7Jog3YyLBmbshNvo/Ba/Al3zClPWdd6/jnxk2F+9Q=="], + + "eslint-import-context": ["eslint-import-context@0.1.9", "", { "dependencies": { "get-tsconfig": "^4.10.1", "stable-hash-x": "^0.2.0" }, "peerDependencies": { "unrs-resolver": "^1.0.0" }, "optionalPeers": ["unrs-resolver"] }, "sha512-K9Hb+yRaGAGUbwjhFNHvSmmkZs9+zbuoe3kFQ4V1wYjrepUFYM2dZAfNtjbbj3qsPfUfsA68Bx/ICWQMi+C8Eg=="], + + "eslint-import-resolver-typescript": ["eslint-import-resolver-typescript@4.4.5", "", { "dependencies": { "debug": "^4.4.1", "eslint-import-context": "^0.1.8", "get-tsconfig": "^4.10.1", "is-bun-module": "^2.0.0", "stable-hash-x": "^0.2.0", "tinyglobby": "^0.2.14", "unrs-resolver": "^1.7.11" }, "peerDependencies": { "eslint": "*", "eslint-plugin-import": "*", "eslint-plugin-import-x": "*" }, "optionalPeers": ["eslint-plugin-import", "eslint-plugin-import-x"] }, "sha512-nbE5XLph6TLtGYcu/U6e6ZVXyKBhbDWK5cLGk76eJ7NdZpwf1P9EFkpt1Z01mNZNrrilsAYWKH6zUkL4reoXbw=="], + + "eslint-plugin-import-x": ["eslint-plugin-import-x@4.17.1", "", { "dependencies": { "@typescript-eslint/types": "^8.56.0", "comment-parser": "^1.4.1", "debug": "^4.4.1", "eslint-import-context": "^0.1.9", "is-glob": "^4.0.3", "minimatch": "^9.0.3 || ^10.1.2", "semver": "^7.7.2", "stable-hash-x": "^0.2.0", "unrs-resolver": "^1.9.2" }, "peerDependencies": { "@typescript-eslint/utils": "^8.56.0", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "eslint-import-resolver-node": "*" }, "optionalPeers": ["@typescript-eslint/utils", "eslint-import-resolver-node"] }, "sha512-4cdstYkKCyjumM2Q9NSI03K8D2a9F4Ssz33K2lv2hQa4KmR9jPLwk3uWGtNvclfqBrPGfGuMBwsGMbe6dMRbfg=="], + + "eslint-plugin-vue": ["eslint-plugin-vue@10.12.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", "natural-compare": "^1.4.0", "nth-check": "^2.1.1", "postcss-selector-parser": "^7.1.4", "semver": "^7.8.5", "xml-name-validator": "^5.0.0" }, "peerDependencies": { "@stylistic/eslint-plugin": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0", "@typescript-eslint/parser": "^7.0.0 || ^8.0.0", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "vue-eslint-parser": "^10.3.0" }, "optionalPeers": ["@stylistic/eslint-plugin", "@typescript-eslint/parser"] }, "sha512-YsrHHtMaxjWqmxr/Kv9yXUfakUlbTCWtIBvr9eounzj6ZsGJdz1I4UuTIHkhzKHes793Cwo3PGTcvsoBqNyzCA=="], + + "eslint-scope": ["eslint-scope@9.1.2", "", { "dependencies": { "@types/esrecurse": "^4.3.1", "@types/estree": "^1.0.8", "esrecurse": "^4.3.0", "estraverse": "^5.2.0" } }, "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ=="], + + "eslint-visitor-keys": ["eslint-visitor-keys@5.0.1", "", {}, "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA=="], + + "espree": ["espree@11.2.0", "", { "dependencies": { "acorn": "^8.16.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^5.0.1" } }, "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw=="], + + "esquery": ["esquery@1.7.0", "", { "dependencies": { "estraverse": "^5.1.0" } }, "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g=="], + + "esrecurse": ["esrecurse@4.3.0", "", { "dependencies": { "estraverse": "^5.2.0" } }, "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag=="], + + "estraverse": ["estraverse@5.3.0", "", {}, "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA=="], + + "estree-walker": ["estree-walker@3.0.3", "", { "dependencies": { "@types/estree": "^1.0.0" } }, "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g=="], + + "esutils": ["esutils@2.0.3", "", {}, "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="], + + "expect-type": ["expect-type@1.4.0", "", {}, "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA=="], + + "extend": ["extend@3.0.2", "", {}, "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="], + + "fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="], + + "fast-glob": ["fast-glob@3.3.3", "", { "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.8" } }, "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg=="], + + "fast-json-stable-stringify": ["fast-json-stable-stringify@2.1.0", "", {}, "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="], + + "fast-levenshtein": ["fast-levenshtein@2.0.6", "", {}, "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="], + + "fast-uri": ["fast-uri@3.1.9", "", {}, "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ=="], + + "fastest-levenshtein": ["fastest-levenshtein@1.0.16", "", {}, "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg=="], + + "fastq": ["fastq@1.20.3", "", { "dependencies": { "reusify": "^1.0.4" } }, "sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw=="], + + "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" } }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], + + "file-entry-cache": ["file-entry-cache@11.1.5", "", { "dependencies": { "flat-cache": "^6.1.23" } }, "sha512-+PFTHITI08JIGhnNpGNI8T8inUpgZfk3GNEqfT9R2zZV2iFXg3CvqzSl/uEhs7TSGujYRELEANyDvS8Fj7+S7Q=="], + + "fill-range": ["fill-range@7.1.1", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="], + + "find-up": ["find-up@5.0.0", "", { "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng=="], + + "flat-cache": ["flat-cache@6.1.23", "", { "dependencies": { "cacheable": "^2.5.0", "flatted": "^3.4.2", "hookified": "^1.15.0" } }, "sha512-f++BY9pTk+983xK1FLzlLpmM0i0z+jHmx3QESGkURMXujQZz1k5wzwX6hjnQ8goaD0B+sYnDK1yZ6MTyZfUaqA=="], + + "flatted": ["flatted@3.4.4", "", {}, "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q=="], + + "follow-redirects": ["follow-redirects@1.16.2", "", { "peerDependencies": { "debug": "*" }, "optionalPeers": ["debug"] }, "sha512-/kVP2U8z596Ia0gwFrwyIeo74ta5aVmSeU1FfAUMAmcEP5EP7zydmag3SLiN64NaRKef3lxsq7i/g7ltJQDGow=="], + + "form-data": ["form-data@4.0.6", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "hasown": "^2.0.4", "mime-types": "^2.1.35" } }, "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ=="], + + "fraction.js": ["fraction.js@5.3.4", "", {}, "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ=="], + + "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], + + "function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="], + + "fuzzysort": ["fuzzysort@3.1.0", "", {}, "sha512-sR9BNCjBg6LNgwvxlBd0sBABvQitkLzoVY9MYYROQVX/FvfJ4Mai9LsGhDgd8qYdds0bY77VzYd5iuB+v5rwQQ=="], + + "get-east-asian-width": ["get-east-asian-width@1.7.0", "", {}, "sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q=="], + + "get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="], + + "get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="], + + "get-tsconfig": ["get-tsconfig@4.14.3", "", { "dependencies": { "resolve-pkg-maps": "^1.0.0" } }, "sha512-++QEw4DIY7WGoukz+/+A/8dGYPT9l9yIadnmSgZ8Rjr3YVSVDipQSO9CdnJo9ePqFqUUqh+wk9uIaoiAwsiPkA=="], + + "glob-parent": ["glob-parent@6.0.2", "", { "dependencies": { "is-glob": "^4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="], + + "global-modules": ["global-modules@2.0.0", "", { "dependencies": { "global-prefix": "^3.0.0" } }, "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A=="], + + "global-prefix": ["global-prefix@3.0.0", "", { "dependencies": { "ini": "^1.3.5", "kind-of": "^6.0.2", "which": "^1.3.1" } }, "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg=="], + + "globby": ["globby@16.2.4", "", { "dependencies": { "@sindresorhus/merge-streams": "^4.0.0", "fast-glob": "^3.3.3", "ignore": "^7.0.5", "is-path-inside": "^4.0.0", "micromatch": "^4.0.8", "slash": "^5.1.0", "unicorn-magic": "^0.4.0" } }, "sha512-c8B/VNLmxRcmqqenRA9t+9IyOjf9+V6lTxPaUJLqOCONdQkWZ0ETYgX0qbtJqPsgCNusT9MZ5Jeidw8Eb9tn2g=="], + + "globjoin": ["globjoin@0.1.4", "", {}, "sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg=="], + + "gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="], + + "graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="], + + "has-flag": ["has-flag@4.0.0", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="], + + "has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="], + + "has-tostringtag": ["has-tostringtag@1.0.2", "", { "dependencies": { "has-symbols": "^1.0.3" } }, "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw=="], + + "hashery": ["hashery@1.5.1", "", { "dependencies": { "hookified": "^1.15.0" } }, "sha512-iZyKG96/JwPz1N55vj2Ie2vXbhu440zfUfJvSwEqEbeLluk7NnapfGqa7LH0mOsnDxTF85Mx8/dyR6HfqcbmbQ=="], + + "hasown": ["hasown@2.0.4", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A=="], + + "hast-util-embedded": ["hast-util-embedded@3.0.0", "", { "dependencies": { "@types/hast": "^3.0.0", "hast-util-is-element": "^3.0.0" } }, "sha512-naH8sld4Pe2ep03qqULEtvYr7EjrLK2QHY8KJR6RJkTUjPGObe1vnx585uzem2hGra+s1q08DZZpfgDVYRbaXA=="], + + "hast-util-from-dom": ["hast-util-from-dom@5.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "hastscript": "^9.0.0", "web-namespaces": "^2.0.0" } }, "sha512-N+LqofjR2zuzTjCPzyDUdSshy4Ma6li7p/c3pA78uTwzFgENbgbUrm2ugwsOdcjI1muO+o6Dgzp9p8WHtn/39Q=="], + + "hast-util-has-property": ["hast-util-has-property@3.0.0", "", { "dependencies": { "@types/hast": "^3.0.0" } }, "sha512-MNilsvEKLFpV604hwfhVStK0usFY/QmM5zX16bo7EjnAEGofr5YyI37kzopBlZJkHD4t887i+q/C8/tr5Q94cA=="], + + "hast-util-is-body-ok-link": ["hast-util-is-body-ok-link@3.0.1", "", { "dependencies": { "@types/hast": "^3.0.0" } }, "sha512-0qpnzOBLztXHbHQenVB8uNuxTnm/QBFUOmdOSsEn7GnBtyY07+ENTWVFBAnXd/zEgd9/SUG3lRY7hSIBWRgGpQ=="], + + "hast-util-is-element": ["hast-util-is-element@3.0.0", "", { "dependencies": { "@types/hast": "^3.0.0" } }, "sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g=="], + + "hast-util-minify-whitespace": ["hast-util-minify-whitespace@1.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "hast-util-embedded": "^3.0.0", "hast-util-is-element": "^3.0.0", "hast-util-whitespace": "^3.0.0", "unist-util-is": "^6.0.0" } }, "sha512-L96fPOVpnclQE0xzdWb/D12VT5FabA7SnZOUMtL1DbXmYiHJMXZvFkIZfiMmTCNJHUeO2K9UYNXoVyfz+QHuOw=="], + + "hast-util-parse-selector": ["hast-util-parse-selector@4.0.0", "", { "dependencies": { "@types/hast": "^3.0.0" } }, "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A=="], + + "hast-util-phrasing": ["hast-util-phrasing@3.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "hast-util-embedded": "^3.0.0", "hast-util-has-property": "^3.0.0", "hast-util-is-body-ok-link": "^3.0.0", "hast-util-is-element": "^3.0.0" } }, "sha512-6h60VfI3uBQUxHqTyMymMZnEbNl1XmEGtOxxKYL7stY2o601COo62AWAYBQR9lZbYXYSBoxag8UpPRXK+9fqSQ=="], + + "hast-util-to-dom": ["hast-util-to-dom@4.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "property-information": "^7.0.0", "web-namespaces": "^2.0.0" } }, "sha512-z1VE7sZ8uFzS2baF3LEflX1IPw2gSzrdo3QFEsyoi23MkCVY3FoE9x6nLgOgjwJu8VNWgo+07iaxtONhDzKrUQ=="], + + "hast-util-to-html": ["hast-util-to-html@9.0.5", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", "ccount": "^2.0.0", "comma-separated-tokens": "^2.0.0", "hast-util-whitespace": "^3.0.0", "html-void-elements": "^3.0.0", "mdast-util-to-hast": "^13.0.0", "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0", "stringify-entities": "^4.0.0", "zwitch": "^2.0.4" } }, "sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw=="], + + "hast-util-to-mdast": ["hast-util-to-mdast@10.1.2", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "@ungap/structured-clone": "^1.0.0", "hast-util-phrasing": "^3.0.0", "hast-util-to-html": "^9.0.0", "hast-util-to-text": "^4.0.0", "hast-util-whitespace": "^3.0.0", "mdast-util-phrasing": "^4.0.0", "mdast-util-to-hast": "^13.0.0", "mdast-util-to-string": "^4.0.0", "rehype-minify-whitespace": "^6.0.0", "trim-trailing-lines": "^2.0.0", "unist-util-position": "^5.0.0", "unist-util-visit": "^5.0.0" } }, "sha512-FiCRI7NmOvM4y+f5w32jPRzcxDIz+PUqDwEqn1A+1q2cdp3B8Gx7aVrXORdOKjMNDQsD1ogOr896+0jJHW1EFQ=="], + + "hast-util-to-text": ["hast-util-to-text@4.0.3", "", { "dependencies": { "@types/hast": "^3.0.0" } }, "sha512-5yrlWOvGFs6CqHriUpSsNrjzT/Tdo+IOQudbznxOn8K5qblp18MJyzOg8IgDOKQ8MYgQcJA7SusuCjSpDr8mSA=="], + + "hast-util-whitespace": ["hast-util-whitespace@3.0.0", "", { "dependencies": { "@types/hast": "^3.0.0" } }, "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw=="], + + "hastscript": ["hastscript@9.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", "hast-util-parse-selector": "^4.0.0", "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0" } }, "sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w=="], + + "hookable": ["hookable@5.5.3", "", {}, "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ=="], + + "hookified": ["hookified@1.15.1", "", {}, "sha512-MvG/clsADq1GPM2KGo2nyfaWVyn9naPiXrqIe4jYjXNZQt238kWyOGrsyc/DmRAQ+Re6yeo6yX/yoNCG5KAEVg=="], + + "html-encoding-sniffer": ["html-encoding-sniffer@6.0.0", "", { "dependencies": { "@exodus/bytes": "^1.6.0" } }, "sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg=="], + + "html-escaper": ["html-escaper@2.0.2", "", {}, "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg=="], + + "html-tags": ["html-tags@5.1.0", "", {}, "sha512-n6l5uca7/y5joxZ3LUePhzmBFUJ+U2YWzhMa8XUTecSeSlQiZdF5XAd/Q3/WUl0VsXgUwWi8I7CNIwdI5WN1SQ=="], + + "html-void-elements": ["html-void-elements@3.0.0", "", {}, "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg=="], + + "https-proxy-agent": ["https-proxy-agent@5.0.1", "", { "dependencies": { "agent-base": "6", "debug": "4" } }, "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA=="], + + "ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="], + + "immutable": ["immutable@5.1.9", "", {}, "sha512-m8nVez3rwrgmWxtLMt1ZYXB2Lv7OKYn/disyxAlSDYAlKSlFoPPfIAmAM/M5xqL4m4C/wAPw7S2/CNaUii1Hxg=="], + + "import-fresh": ["import-fresh@3.3.1", "", { "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" } }, "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ=="], + + "import-meta-resolve": ["import-meta-resolve@4.2.0", "", {}, "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg=="], + + "imurmurhash": ["imurmurhash@0.1.4", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="], + + "ini": ["ini@1.3.8", "", {}, "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="], + + "is-arrayish": ["is-arrayish@0.2.1", "", {}, "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="], + + "is-binary-path": ["is-binary-path@2.1.0", "", { "dependencies": { "binary-extensions": "^2.0.0" } }, "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw=="], + + "is-bun-module": ["is-bun-module@2.0.0", "", { "dependencies": { "semver": "^7.7.1" } }, "sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ=="], + + "is-extglob": ["is-extglob@2.1.1", "", {}, "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI="], + + "is-fullwidth-code-point": ["is-fullwidth-code-point@3.0.0", "", {}, "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="], + + "is-glob": ["is-glob@4.0.3", "", { "dependencies": { "is-extglob": "^2.1.1" } }, "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg=="], + + "is-number": ["is-number@7.0.0", "", {}, "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="], + + "is-path-inside": ["is-path-inside@4.0.0", "", {}, "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA=="], + + "is-plain-obj": ["is-plain-obj@4.1.0", "", {}, "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg=="], + + "is-plain-object": ["is-plain-object@5.1.0", "", {}, "sha512-bUi/yjmtKYcRVUtWRGr0UA6xEFh2I6zWUwMrUXB3s7bmYCaZ8a+0ZsTRkrawh/mzlSD1Y0Ph8bp/U+TvBpWDNw=="], + + "is-potential-custom-element-name": ["is-potential-custom-element-name@1.0.1", "", {}, "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ=="], + + "isexe": ["isexe@2.0.0", "", {}, "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="], + + "istanbul-lib-coverage": ["istanbul-lib-coverage@3.2.2", "", {}, "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg=="], + + "istanbul-lib-report": ["istanbul-lib-report@3.0.1", "", { "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^4.0.0", "supports-color": "^7.1.0" } }, "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw=="], + + "istanbul-reports": ["istanbul-reports@3.2.0", "", { "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" } }, "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA=="], + + "js-tokens": ["js-tokens@10.0.0", "", {}, "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q=="], + + "js-yaml": ["js-yaml@5.5.0", "", { "dependencies": { "argparse": "^3.0.3" }, "bin": { "js-yaml": "bin/js-yaml.mjs" } }, "sha512-paNr4LFIFPjeeSmwNYdrb8FafLLG/Cr2Af3GjbsHJ5CxIjH4r0c2emlmRdAtpPAieP1gRVzk6buBbVP5gBMGAg=="], + + "jsdom": ["jsdom@29.1.1", "", { "dependencies": { "@asamuzakjp/css-color": "^5.1.11", "@asamuzakjp/dom-selector": "^7.1.1", "@bramus/specificity": "^2.4.2", "@csstools/css-syntax-patches-for-csstree": "^1.1.3", "@exodus/bytes": "^1.15.0", "css-tree": "^3.2.1", "data-urls": "^7.0.0", "decimal.js": "^10.6.0", "html-encoding-sniffer": "^6.0.0", "is-potential-custom-element-name": "^1.0.1", "lru-cache": "^11.3.5", "parse5": "^8.0.1", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", "tough-cookie": "^6.0.1", "undici": "^7.25.0", "w3c-xmlserializer": "^5.0.0", "webidl-conversions": "^8.0.1", "whatwg-mimetype": "^5.0.0", "whatwg-url": "^16.0.1", "xml-name-validator": "^5.0.0" }, "peerDependencies": { "canvas": "^3.0.0" }, "optionalPeers": ["canvas"] }, "sha512-ECi4Fi2f7BdJtUKTflYRTiaMxIB0O6zfR1fX0GXpUrf6flp8QIYn1UT20YQqdSOfk2dfkCwS8LAFoJDEppNK5Q=="], + + "json-parse-even-better-errors": ["json-parse-even-better-errors@2.3.1", "", {}, "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="], + + "json-schema-traverse": ["json-schema-traverse@0.4.1", "", {}, "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="], + + "json-stable-stringify-without-jsonify": ["json-stable-stringify-without-jsonify@1.0.1", "", {}, "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw=="], + + "keyv": ["keyv@5.6.0", "", { "dependencies": { "@keyv/serialize": "^1.1.1" } }, "sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw=="], + + "kind-of": ["kind-of@6.0.3", "", {}, "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw=="], + + "known-css-properties": ["known-css-properties@0.37.0", "", {}, "sha512-JCDrsP4Z1Sb9JwG0aJ8Eo2r7k4Ou5MwmThS/6lcIe1ICyb7UBJKGRIUUdqc2ASdE/42lgz6zFUnzAIhtXnBVrQ=="], + + "laravel-vite-plugin": ["laravel-vite-plugin@3.2.0", "", { "dependencies": { "picocolors": "^1.0.0", "tinyglobby": "^0.2.12", "vite-plugin-full-reload": "^1.1.0" }, "peerDependencies": { "fontaine": "^0.8.0", "vite": "^8.0.0" }, "optionalPeers": ["fontaine"], "bin": { "clean-orphaned-assets": "bin/clean.js" } }, "sha512-xSxY9Gzeb/eancd8WeK09piAFP+a6i5QIBqNCKNv9L0Eq6wziwzSem7F1GvMSrtjMh5F/QVKFxn8t9naGOA66A=="], + + "leaflet": ["leaflet@1.9.4", "", {}, "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA=="], + + "levn": ["levn@0.4.1", "", { "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" } }, "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ=="], + + "lightningcss": ["lightningcss@1.33.0", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.33.0", "lightningcss-darwin-arm64": "1.33.0", "lightningcss-darwin-x64": "1.33.0", "lightningcss-freebsd-x64": "1.33.0", "lightningcss-linux-arm-gnueabihf": "1.33.0", "lightningcss-linux-arm64-gnu": "1.33.0", "lightningcss-linux-arm64-musl": "1.33.0", "lightningcss-linux-x64-gnu": "1.33.0", "lightningcss-linux-x64-musl": "1.33.0", "lightningcss-win32-arm64-msvc": "1.33.0", "lightningcss-win32-x64-msvc": "1.33.0" } }, "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA=="], + + "lightningcss-android-arm64": ["lightningcss-android-arm64@1.33.0", "", { "os": "android", "cpu": "arm64" }, "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg=="], + + "lightningcss-darwin-arm64": ["lightningcss-darwin-arm64@1.33.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg=="], + + "lightningcss-darwin-x64": ["lightningcss-darwin-x64@1.33.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ=="], + + "lightningcss-freebsd-x64": ["lightningcss-freebsd-x64@1.33.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg=="], + + "lightningcss-linux-arm-gnueabihf": ["lightningcss-linux-arm-gnueabihf@1.33.0", "", { "os": "linux", "cpu": "arm" }, "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ=="], + + "lightningcss-linux-arm64-gnu": ["lightningcss-linux-arm64-gnu@1.33.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg=="], + + "lightningcss-linux-arm64-musl": ["lightningcss-linux-arm64-musl@1.33.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ=="], + + "lightningcss-linux-x64-gnu": ["lightningcss-linux-x64-gnu@1.33.0", "", { "os": "linux", "cpu": "x64" }, "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg=="], + + "lightningcss-linux-x64-musl": ["lightningcss-linux-x64-musl@1.33.0", "", { "os": "linux", "cpu": "x64" }, "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw=="], + + "lightningcss-win32-arm64-msvc": ["lightningcss-win32-arm64-msvc@1.33.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA=="], + + "lightningcss-win32-x64-msvc": ["lightningcss-win32-x64-msvc@1.33.0", "", { "os": "win32", "cpu": "x64" }, "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA=="], + + "lines-and-columns": ["lines-and-columns@1.2.4", "", {}, "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="], + + "locate-path": ["locate-path@6.0.0", "", { "dependencies": { "p-locate": "^5.0.0" } }, "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw=="], + + "lodash": ["lodash@4.18.1", "", {}, "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q=="], + + "lodash.truncate": ["lodash.truncate@4.4.2", "", {}, "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw=="], + + "longest-streak": ["longest-streak@3.1.0", "", {}, "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g=="], + + "lru-cache": ["lru-cache@11.5.3", "", {}, "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg=="], + + "magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="], + + "magicast": ["magicast@0.5.5", "", { "dependencies": { "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7", "source-map-js": "^1.2.1" } }, "sha512-UicdXN8zQ3JHlxVq+28afMXPr1z7WNY6+7EJnzTdQWkTAlMLF5fNCCKxJHBQwGaNGR11581EiQmQzx73+MvszA=="], + + "make-dir": ["make-dir@4.0.0", "", { "dependencies": { "semver": "^7.5.3" } }, "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw=="], + + "markdown-table": ["markdown-table@3.0.4", "", {}, "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw=="], + + "math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="], + + "mathml-tag-names": ["mathml-tag-names@4.0.0", "", {}, "sha512-aa6AU2Pcx0VP/XWnh8IGL0SYSgQHDT6Ucror2j2mXeFAlN3ahaNs8EZtG1YiticMkSLj3Gt6VPFfZogt7G5iFQ=="], + + "mdast-util-find-and-replace": ["mdast-util-find-and-replace@3.0.4", "", { "dependencies": { "@types/mdast": "^4.0.0", "escape-string-regexp": "^5.0.0", "unist-util-is": "^6.0.0", "unist-util-visit-parents": "^6.1.0" } }, "sha512-z4B5c6jrnJ1ltOQemhWYPBSAo6y42Z8Gt2yEgfgNTMcLSU59B8bfj8Z8AnAlJrBGLnqkdAUZ7jdDEqQw3KuipQ=="], + + "mdast-util-from-markdown": ["mdast-util-from-markdown@2.1.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", "mdast-util-to-string": "^4.0.0", "micromark": "^4.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", "micromark-util-decode-string": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0", "unist-util-stringify-position": "^4.0.0" } }, "sha512-KRLgmPaP2H1ul2bpoJkOS+9pAcDAAj9Nu1mqLnh8NLeJG5tlvj42TH80PIGBpROWlRXLk0lDrWNuZCFy/tsB4A=="], + + "mdast-util-gfm": ["mdast-util-gfm@3.1.0", "", { "dependencies": { "mdast-util-from-markdown": "^2.0.0", "mdast-util-gfm-autolink-literal": "^2.0.0", "mdast-util-gfm-footnote": "^2.0.0", "mdast-util-gfm-strikethrough": "^2.0.0", "mdast-util-gfm-table": "^2.0.0", "mdast-util-gfm-task-list-item": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" } }, "sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ=="], + + "mdast-util-gfm-autolink-literal": ["mdast-util-gfm-autolink-literal@2.0.1", "", { "dependencies": { "@types/mdast": "^4.0.0", "ccount": "^2.0.0", "devlop": "^1.0.0", "mdast-util-find-and-replace": "^3.0.0", "micromark-util-character": "^2.0.0" } }, "sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ=="], + + "mdast-util-gfm-footnote": ["mdast-util-gfm-footnote@2.1.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.1.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0" } }, "sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ=="], + + "mdast-util-gfm-strikethrough": ["mdast-util-gfm-strikethrough@2.0.1", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" } }, "sha512-OuJHqvr455pwu2OaOrir7dbzqs4jlWKOtlu9L6GjcIjjQwNyw02VntQsr/Ek6/A13vgnXfUhBekWRUP1OkNivw=="], + + "mdast-util-gfm-table": ["mdast-util-gfm-table@2.0.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "markdown-table": "^3.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" } }, "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg=="], + + "mdast-util-gfm-task-list-item": ["mdast-util-gfm-task-list-item@2.0.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" } }, "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ=="], + + "mdast-util-newline-to-break": ["mdast-util-newline-to-break@2.0.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-find-and-replace": "^3.0.0" } }, "sha512-MbgeFca0hLYIEx/2zGsszCSEJJ1JSCdiY5xQxRcLDDGa8EPvlLPupJ4DSajbMPAnC0je8jfb9TiUATnxxrHUog=="], + + "mdast-util-phrasing": ["mdast-util-phrasing@4.1.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "unist-util-is": "^6.0.0" } }, "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w=="], + + "mdast-util-to-hast": ["mdast-util-to-hast@13.2.1", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "@ungap/structured-clone": "^1.0.0", "devlop": "^1.0.0", "micromark-util-sanitize-uri": "^2.0.0", "trim-lines": "^3.0.0", "unist-util-position": "^5.0.0", "unist-util-visit": "^5.0.0", "vfile": "^6.0.0" } }, "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA=="], + + "mdast-util-to-markdown": ["mdast-util-to-markdown@2.2.1", "", { "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", "longest-streak": "^3.0.0", "mdast-util-phrasing": "^4.0.0", "mdast-util-to-string": "^4.0.0", "micromark-util-character": "^2.0.0", "micromark-util-classify-character": "^2.0.0", "micromark-util-decode-string": "^2.0.0", "micromark-util-html-tag-name": "^2.0.0", "unist-util-visit": "^5.0.0", "zwitch": "^2.0.0" } }, "sha512-ThatlCBxG2GE+mljhNSfZPv56d3QrGiRh97jjYgIk80IzS4uU6d7cHAaexCYSAmUCCcOs3grJ07kX3oTGsFUOw=="], + + "mdast-util-to-string": ["mdast-util-to-string@4.0.0", "", { "dependencies": { "@types/mdast": "^4.0.0" } }, "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg=="], + + "mdn-data": ["mdn-data@2.27.1", "", {}, "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ=="], + + "meow": ["meow@14.1.0", "", {}, "sha512-EDYo6VlmtnumlcBCbh1gLJ//9jvM/ndXHfVXIFrZVr6fGcwTUyCTFNTLCKuY3ffbK8L/+3Mzqnd58RojiZqHVw=="], + + "merge2": ["merge2@1.4.1", "", {}, "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg=="], + + "micromark": ["micromark@4.0.3", "", { "dependencies": { "@types/debug": "^4.0.0", "debug": "^4.0.0", "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", "micromark-core-commonmark": "^2.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-combine-extensions": "^2.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", "micromark-util-edit-map": "^1.0.0", "micromark-util-encode": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-resolve-all": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", "micromark-util-subtokenize": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-oGYfQzHSG5dOMovQcJ3fyTmZlWAWpi0XA0sJwJs+i6OT88o1+Jtw/8z0CmdowSLxGhhFK89rQ/oXph/wN02PNw=="], + + "micromark-core-commonmark": ["micromark-core-commonmark@2.0.4", "", { "dependencies": { "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", "micromark-factory-destination": "^2.0.0", "micromark-factory-label": "^2.0.0", "micromark-factory-space": "^2.1.0", "micromark-factory-title": "^2.0.0", "micromark-factory-whitespace": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-classify-character": "^2.0.0", "micromark-util-edit-map": "^1.0.0", "micromark-util-html-tag-name": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-resolve-all": "^2.0.0", "micromark-util-subtokenize": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.3" } }, "sha512-wxEeE8v8XVvOrxn1TZj74qYhAtTQsSqufHVS3uNVyT1MupXxhyaHk8/9xDNPh9BmL77QNDgWTkZ3RsYHB2ry7w=="], + + "micromark-extension-gfm": ["micromark-extension-gfm@3.0.0", "", { "dependencies": { "micromark-extension-gfm-autolink-literal": "^2.0.0", "micromark-extension-gfm-footnote": "^2.0.0", "micromark-extension-gfm-strikethrough": "^2.0.0", "micromark-extension-gfm-table": "^2.0.0", "micromark-extension-gfm-tagfilter": "^2.0.0", "micromark-extension-gfm-task-list-item": "^2.0.0", "micromark-util-combine-extensions": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w=="], + + "micromark-extension-gfm-autolink-literal": ["micromark-extension-gfm-autolink-literal@2.1.0", "", { "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw=="], + + "micromark-extension-gfm-footnote": ["micromark-extension-gfm-footnote@2.1.0", "", { "dependencies": { "devlop": "^1.0.0", "micromark-core-commonmark": "^2.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw=="], + + "micromark-extension-gfm-strikethrough": ["micromark-extension-gfm-strikethrough@2.1.0", "", { "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-classify-character": "^2.0.0", "micromark-util-resolve-all": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw=="], + + "micromark-extension-gfm-table": ["micromark-extension-gfm-table@2.1.2", "", { "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-pRzm4kDTu0MjlmBkxmS9yYhw60nncfcEwu9NNdPFSQEFXS95ZKyIIyTSHu/o3ReBUrLKYEq+7YaXCRn/bPB4MA=="], + + "micromark-extension-gfm-tagfilter": ["micromark-extension-gfm-tagfilter@2.0.0", "", { "dependencies": { "micromark-util-types": "^2.0.0" } }, "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg=="], + + "micromark-extension-gfm-task-list-item": ["micromark-extension-gfm-task-list-item@2.1.0", "", { "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw=="], + + "micromark-factory-destination": ["micromark-factory-destination@2.0.1", "", { "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA=="], + + "micromark-factory-label": ["micromark-factory-label@2.0.1", "", { "dependencies": { "devlop": "^1.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg=="], + + "micromark-factory-space": ["micromark-factory-space@2.1.0", "", { "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-fS8hnLIjnjvdQIj39Geug8wWsR0HrYZ43KShKxNfwT7t2LOHo/LbWZEzEaSOjwtjdCsjoE6syHhonEzW0zv0+Q=="], + + "micromark-factory-title": ["micromark-factory-title@2.0.1", "", { "dependencies": { "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw=="], + + "micromark-factory-whitespace": ["micromark-factory-whitespace@2.0.1", "", { "dependencies": { "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ=="], + + "micromark-util-character": ["micromark-util-character@2.1.1", "", { "dependencies": { "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q=="], + + "micromark-util-chunked": ["micromark-util-chunked@2.0.1", "", { "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA=="], + + "micromark-util-classify-character": ["micromark-util-classify-character@2.0.1", "", { "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q=="], + + "micromark-util-combine-extensions": ["micromark-util-combine-extensions@2.0.1", "", { "dependencies": { "micromark-util-chunked": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg=="], + + "micromark-util-decode-numeric-character-reference": ["micromark-util-decode-numeric-character-reference@2.0.2", "", { "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw=="], + + "micromark-util-decode-string": ["micromark-util-decode-string@2.0.1", "", { "dependencies": { "decode-named-character-reference": "^1.0.0", "micromark-util-character": "^2.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", "micromark-util-symbol": "^2.0.0" } }, "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ=="], + + "micromark-util-edit-map": ["micromark-util-edit-map@1.0.0", "", { "dependencies": { "micromark-util-types": "^2.0.0" } }, "sha512-Pa2ljlsEL6sVwFaYeyrOLSYbQt73JvGbPOYFq+9AElXiSnfI5Q4465RRZ1sHv7lDjDOnGRDDaqPXqClqWK/q1Q=="], + + "micromark-util-encode": ["micromark-util-encode@2.0.1", "", {}, "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw=="], + + "micromark-util-html-tag-name": ["micromark-util-html-tag-name@2.0.1", "", {}, "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA=="], + + "micromark-util-normalize-identifier": ["micromark-util-normalize-identifier@2.0.1", "", { "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q=="], + + "micromark-util-resolve-all": ["micromark-util-resolve-all@2.0.1", "", { "dependencies": { "micromark-util-types": "^2.0.0" } }, "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg=="], + + "micromark-util-sanitize-uri": ["micromark-util-sanitize-uri@2.0.1", "", { "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-encode": "^2.0.0", "micromark-util-symbol": "^2.0.0" } }, "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ=="], + + "micromark-util-subtokenize": ["micromark-util-subtokenize@2.1.0", "", { "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA=="], + + "micromark-util-symbol": ["micromark-util-symbol@2.0.1", "", {}, "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q=="], + + "micromark-util-types": ["micromark-util-types@2.0.3", "", {}, "sha512-oxB2Ik03hI0gv+VNn9tnh1t1YEe9MDPptViAEgfdf3YQHsn0pzGTgCdlSCJXcwhqm8phaEuM7zeEu3QQzVBrPg=="], + + "micromatch": ["micromatch@4.0.8", "", { "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" } }, "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA=="], + + "mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="], + + "mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="], + + "minimatch": ["minimatch@10.2.6", "", { "dependencies": { "brace-expansion": "^5.0.8" } }, "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A=="], + + "mitt": ["mitt@3.0.1", "", {}, "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw=="], + + "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], + + "muggle-string": ["muggle-string@0.4.1", "", {}, "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ=="], + + "nanoid": ["nanoid@3.3.20", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ=="], + + "napi-postinstall": ["napi-postinstall@0.3.7", "", { "bin": { "napi-patch": "./lib/patch.js", "napi-postinstall": "./lib/cli.js" } }, "sha512-jyU4cU4kVAmy/3qjP+DcoQTNXfINHc+dFw54gGqWC8nu0mpV0kOnk7kff+J+Q18SbX0k3Np8Rm7yFjd3phatNQ=="], + + "natural-compare": ["natural-compare@1.4.0", "", {}, "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="], + + "node-addon-api": ["node-addon-api@7.1.1", "", {}, "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ=="], + + "node-releases": ["node-releases@2.0.60", "", {}, "sha512-OmO8+GM1JUZqXET720VrJCwkjUCXmCMQm0Z3UDDRbfNLHS4NEAvY60j5jiFv0tkKw2PNNlqOLhahVmwJIOLDIQ=="], + + "normalize-path": ["normalize-path@3.0.0", "", {}, "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA=="], + + "npm-run-path": ["npm-run-path@6.0.0", "", { "dependencies": { "path-key": "^4.0.0", "unicorn-magic": "^0.3.0" } }, "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA=="], + + "nth-check": ["nth-check@2.1.1", "", { "dependencies": { "boolbase": "^1.0.0" } }, "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w=="], + + "obug": ["obug@2.2.1", "", {}, "sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q=="], + + "optionator": ["optionator@0.9.4", "", { "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.5" } }, "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g=="], + + "p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="], + + "p-locate": ["p-locate@5.0.0", "", { "dependencies": { "p-limit": "^3.0.2" } }, "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw=="], + + "p-map": ["p-map@7.1.1", "", {}, "sha512-6Lh3jQPLthYujSrlw6ccWXBGZTkoTCz27Hd92g79LH/kjAbgoEu0t442cCCNbegPSJsA0lwDX8z0bcKtkpA32g=="], + + "parent-module": ["parent-module@1.0.1", "", { "dependencies": { "callsites": "^3.0.0" } }, "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g=="], + + "parse-json": ["parse-json@5.2.0", "", { "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg=="], + + "parse5": ["parse5@8.0.1", "", { "dependencies": { "entities": "^8.0.0" } }, "sha512-z1e/HMG90obSGeidlli3hj7cbocou0/wa5HacvI3ASx34PecNjNQeaHNo5WIZpWofN9kgkqV1q5YvXe3F0FoPw=="], + + "path-browserify": ["path-browserify@1.0.1", "", {}, "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="], + + "path-exists": ["path-exists@4.0.0", "", {}, "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="], + + "path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="], + + "pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="], + + "perfect-debounce": ["perfect-debounce@1.0.0", "", {}, "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA=="], + + "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], + + "picomatch": ["picomatch@4.0.7", "", {}, "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA=="], + + "pinia": ["pinia@3.0.4", "", { "dependencies": { "@vue/devtools-api": "^7.7.7" }, "peerDependencies": { "typescript": ">=4.5.0", "vue": "^3.5.11" }, "optionalPeers": ["typescript"] }, "sha512-l7pqLUFTI/+ESXn6k3nu30ZIzW5E2WZF/LaHJEpoq6ElcLD+wduZoB2kBN19du6K/4FDpPMazY2wJr+IndBtQw=="], + + "postcss": ["postcss@8.5.32", "", { "dependencies": { "nanoid": "^3.3.20", "picocolors": "^1.1.1", "source-map-js": "^1.2.2" } }, "sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g=="], + + "postcss-discard-comments": ["postcss-discard-comments@7.0.8", "", { "dependencies": { "postcss-selector-parser": "^7.1.1" }, "peerDependencies": { "postcss": "^8.5.13" } }, "sha512-CvvS5S9WrXblFXCEJ9nVo+4z+eA7zSC7Z88V1HEJuwlQhlFnYTIjg1xJY+BCUiG2bvICap2tXii4mP22BD108Q=="], + + "postcss-media-query-parser": ["postcss-media-query-parser@0.2.3", "", {}, "sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig=="], + + "postcss-resolve-nested-selector": ["postcss-resolve-nested-selector@0.1.7", "", {}, "sha512-lFcugRCQXWManq7nyZ0dDtir52wc7gKYJfWpSuz4GxvnGc7dtlpXcZYX4A0asatzTuqpQ3ngDdyD+QG/szeXWw=="], + + "postcss-safe-parser": ["postcss-safe-parser@7.1.0", "", { "peerDependencies": { "postcss": "^8.4.31" } }, "sha512-1WzZxRLaAFwEh6Do+zyGpjWV3nGJNxxhuh7Ubu/q1ICImMgZJnLwhoaEpRbG4pJppp2Y1ncL9ffA2f+LhrefQg=="], + + "postcss-scss": ["postcss-scss@4.0.9", "", { "peerDependencies": { "postcss": "^8.4.29" } }, "sha512-AjKOeiwAitL/MXxQW2DliT28EKukvvbEWx3LBmJIRN8KfBGZbRTxNYW0kSqi1COiTZ57nZ9NW06S6ux//N1c9A=="], + + "postcss-selector-parser": ["postcss-selector-parser@7.1.7", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-wWBro/7hJ40ye6TPiXkUQoXKCw23xSsjriUvqd7Uls9Sso3oLiON1flc18cCdnjgCRXw4fBVqUJJeOdDTh3P3g=="], + + "postcss-sorting": ["postcss-sorting@8.0.2", "", { "peerDependencies": { "postcss": "^8.4.20" } }, "sha512-M9dkSrmU00t/jK7rF6BZSZauA5MAaBW4i5EnJXspMwt4iqTh/L9j6fgMnbElEOfyRyfLfVbIHj/R52zHzAPe1Q=="], + + "postcss-value-parser": ["postcss-value-parser@4.2.0", "", {}, "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="], + + "prelude-ls": ["prelude-ls@1.2.1", "", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="], + + "proper-lockfile": ["proper-lockfile@4.1.2", "", { "dependencies": { "graceful-fs": "^4.2.4", "retry": "^0.12.0", "signal-exit": "^3.0.2" } }, "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA=="], + + "property-information": ["property-information@7.2.0", "", {}, "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg=="], + + "proxy-from-env": ["proxy-from-env@2.1.0", "", {}, "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA=="], + + "punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="], + + "purgecss": ["purgecss@8.0.0", "", { "dependencies": { "commander": "^12.1.0", "fast-glob": "^3.3.2", "postcss": "^8.4.47", "postcss-selector-parser": "^7.0.0" }, "bin": { "purgecss": "bin/purgecss.js" } }, "sha512-QFJyps9y5oHeXnNA3Ql1EaAqWBivNwQn19Pw1lt9RxfB+4e+bIyqCyuombk79D6Fxe+lPXggVfI1WtRGEBwgbQ=="], + + "qified": ["qified@0.10.1", "", { "dependencies": { "hookified": "^2.1.1" } }, "sha512-+Owyggi9IxT1ePKGafcI87ubSmxol6smwJ+RAHDQlx9+9cPwFWDiKFFCPuWhr9ignlGpZ9vDQLw67N4dcTVFEA=="], + + "queue-microtask": ["queue-microtask@1.2.3", "", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="], + + "readdirp": ["readdirp@4.1.2", "", {}, "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg=="], + + "rehype-dom-parse": ["rehype-dom-parse@5.0.2", "", { "dependencies": { "@types/hast": "^3.0.0", "hast-util-from-dom": "^5.0.0", "unified": "^11.0.0" } }, "sha512-8CqP11KaqvtWsMqVEC2yM3cZWZsDNqqpr8nPvogjraLuh45stabgcpXadCAxu1n6JaUNJ/Xr3GIqXP7okbNqLg=="], + + "rehype-dom-stringify": ["rehype-dom-stringify@4.0.2", "", { "dependencies": { "@types/hast": "^3.0.0", "hast-util-to-dom": "^4.0.0", "unified": "^11.0.0" } }, "sha512-2HVFYbtmm5W3C2j8QsV9lcHdIMc2Yn/ytlPKcSC85/tRx2haZbU8V67Wxyh8STT38ZClvKlZ993Me/Hw8g88Aw=="], + + "rehype-minify-whitespace": ["rehype-minify-whitespace@6.0.2", "", { "dependencies": { "@types/hast": "^3.0.0", "hast-util-minify-whitespace": "^1.0.0" } }, "sha512-Zk0pyQ06A3Lyxhe9vGtOtzz3Z0+qZ5+7icZ/PL/2x1SHPbKao5oB/g/rlc6BCTajqBb33JcOe71Ye1oFsuYbnw=="], + + "rehype-remark": ["rehype-remark@10.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "hast-util-to-mdast": "^10.0.0", "unified": "^11.0.0", "vfile": "^6.0.0" } }, "sha512-EmDndlb5NVwXGfUa4c9GPK+lXeItTilLhE6ADSaQuHr4JUlKw9MidzGzx4HpqZrNCt6vnHmEifXQiiA+CEnjYQ=="], + + "remark-breaks": ["remark-breaks@4.0.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-newline-to-break": "^2.0.0", "unified": "^11.0.0" } }, "sha512-IjEjJOkH4FuJvHZVIW0QCDWxcG96kCq7An/KVH2NfJe6rKZU2AsHeB3OEjPNRxi4QC34Xdx7I2KGYn6IpT7gxQ=="], + + "remark-gfm": ["remark-gfm@4.0.1", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-gfm": "^3.0.0", "micromark-extension-gfm": "^3.0.0", "remark-parse": "^11.0.0", "remark-stringify": "^11.0.0", "unified": "^11.0.0" } }, "sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg=="], + + "remark-parse": ["remark-parse@11.0.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-from-markdown": "^2.0.0", "micromark-util-types": "^2.0.0", "unified": "^11.0.0" } }, "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA=="], + + "remark-rehype": ["remark-rehype@11.1.2", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "mdast-util-to-hast": "^13.0.0", "unified": "^11.0.0", "vfile": "^6.0.0" } }, "sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw=="], + + "remark-stringify": ["remark-stringify@11.0.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-to-markdown": "^2.0.0", "unified": "^11.0.0" } }, "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw=="], + + "require-from-string": ["require-from-string@2.0.2", "", {}, "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="], + + "resolve-from": ["resolve-from@4.0.0", "", {}, "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="], + + "resolve-pkg-maps": ["resolve-pkg-maps@1.0.0", "", {}, "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw=="], + + "retry": ["retry@0.12.0", "", {}, "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow=="], + + "reusify": ["reusify@1.1.0", "", {}, "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw=="], + + "rfdc": ["rfdc@1.4.1", "", {}, "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA=="], + + "rolldown": ["rolldown@1.2.15", "", { "dependencies": { "@oxc-project/types": "=0.155.0", "@rolldown/pluginutils": "^1.0.0" }, "optionalDependencies": { "@rolldown/binding-android-arm-eabi": "1.2.15", "@rolldown/binding-android-arm64": "1.2.15", "@rolldown/binding-darwin-arm64": "1.2.15", "@rolldown/binding-darwin-x64": "1.2.15", "@rolldown/binding-freebsd-x64": "1.2.15", "@rolldown/binding-linux-arm-gnueabihf": "1.2.15", "@rolldown/binding-linux-arm64-gnu": "1.2.15", "@rolldown/binding-linux-arm64-musl": "1.2.15", "@rolldown/binding-linux-ppc64-gnu": "1.2.15", "@rolldown/binding-linux-s390x-gnu": "1.2.15", "@rolldown/binding-linux-x64-gnu": "1.2.15", "@rolldown/binding-linux-x64-musl": "1.2.15", "@rolldown/binding-openharmony-arm64": "1.2.15", "@rolldown/binding-win32-arm64-msvc": "1.2.15", "@rolldown/binding-win32-x64-msvc": "1.2.15" }, "bin": { "rolldown": "./bin/cli.mjs" } }, "sha512-6odND+fel5zVw3I4Yc2e69gvguDnX0CAAGiNDZSq4ik5WUcaLrkD2GLuog0XcODbor31hZ5ayEMgVDno+KPV5g=="], + + "run-parallel": ["run-parallel@1.2.0", "", { "dependencies": { "queue-microtask": "^1.2.2" } }, "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="], + + "rxjs": ["rxjs@7.8.2", "", { "dependencies": { "tslib": "^2.1.0" } }, "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA=="], + + "sass": ["sass@1.106.1", "", { "dependencies": { "chokidar": "^5.0.0", "immutable": "^5.1.5", "source-map-js": ">=0.6.2 <2.0.0" }, "optionalDependencies": { "@parcel/watcher": "^2.4.1" }, "bin": { "sass": "sass.js" } }, "sha512-kD+Gi66vycZcbJt+42NC4z4PXNMcCajVrJPhqoKKXy5cOBMmJQt052CxIBcRjwYXeImHYOpu/ydWWGZQIenl7A=="], + + "sass-embedded": ["sass-embedded@1.106.1", "", { "dependencies": { "@bufbuild/protobuf": "^2.5.0", "colorjs.io": "^0.7.0", "immutable": "^5.1.5", "rxjs": "^7.4.0", "supports-color": "^8.1.1", "sync-child-process": "^1.0.2", "varint": "^6.0.0" }, "optionalDependencies": { "sass-embedded-all-unknown": "1.106.1", "sass-embedded-android-arm": "1.106.1", "sass-embedded-android-arm64": "1.106.1", "sass-embedded-android-riscv64": "1.106.1", "sass-embedded-android-x64": "1.106.1", "sass-embedded-darwin-arm64": "1.106.1", "sass-embedded-darwin-x64": "1.106.1", "sass-embedded-linux-arm": "1.106.1", "sass-embedded-linux-arm64": "1.106.1", "sass-embedded-linux-musl-arm": "1.106.1", "sass-embedded-linux-musl-arm64": "1.106.1", "sass-embedded-linux-musl-riscv64": "1.106.1", "sass-embedded-linux-musl-x64": "1.106.1", "sass-embedded-linux-riscv64": "1.106.1", "sass-embedded-linux-x64": "1.106.1", "sass-embedded-unknown-all": "1.106.1", "sass-embedded-win32-arm64": "1.106.1", "sass-embedded-win32-x64": "1.106.1" }, "bin": { "sass": "dist/bin/sass.js" } }, "sha512-OoaTjMm7PcQnCo/AZNSKM/KdAeaX57edhmOp2bH8hcGNph2VDIg404gOSMZxGKNL+lbc7Ng0S/IYLAbs0YmgfA=="], + + "sass-embedded-all-unknown": ["sass-embedded-all-unknown@1.106.1", "", { "dependencies": { "sass": "1.106.1" }, "cpu": [ "!arm", "!x64", "!arm64", ] }, "sha512-5jUnX+WVeovsbORYHBfPMiAtb5/qTnWpuLrlg0ZEjo4AKLjkM3gXkRCReYBEi/bLC3JhBcWWwG/yPqJwd8/lLw=="], + + "sass-embedded-android-arm": ["sass-embedded-android-arm@1.106.1", "", { "os": "android", "cpu": "arm" }, "sha512-xtLTJzkh2/oGI0kZ787ef55zKzmk6UO6nsIMV8CE9n2qMG3JvyU91EU+BxjvknRR9BTVvbQOCLqW5j0psFOeAQ=="], + + "sass-embedded-android-arm64": ["sass-embedded-android-arm64@1.106.1", "", { "os": "android", "cpu": "arm64" }, "sha512-USQo5LkotweQnofhTCZYBtI35HkbIRUx+YfI6AvNN/Wr45ewCbUnTOYvQc+DLFFcm+g9cp64kLrySPdLbkuPzQ=="], + + "sass-embedded-android-riscv64": ["sass-embedded-android-riscv64@1.106.1", "", { "os": "android", "cpu": "none" }, "sha512-OyEAsl8q6xpZgsK4zupwfhVUYvjJaMPgILyXtx326DSPc5lKOwWpXa8rhI2H3eAB76xU61C/5RavIkH1iaqQeQ=="], + + "sass-embedded-android-x64": ["sass-embedded-android-x64@1.106.1", "", { "os": "android", "cpu": "x64" }, "sha512-cczQbbtwex6mtaXS/8UwCSx6613EHiVLQNpkeVmk5oN08HpzPsWMoyzuGa2hdfh0by9mHXismdLk8fh9wdEQ+w=="], + + "sass-embedded-darwin-arm64": ["sass-embedded-darwin-arm64@1.106.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-j8p5iM8v0lGFwfO6sagHkrokD7/zlEkCpfRiBDzvW+FdD/JqOW1nemVz/CexHeeR28ULrUNnE1fKJ/FN9TjTEw=="], + + "sass-embedded-darwin-x64": ["sass-embedded-darwin-x64@1.106.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-WMszbY07IZ/GOaRlrMI3o+h7eiiOKBppLT+GSunSQsVcr2N4rlmM2rXlLsfub1praplLB4FWqMY1St8kLSjmZg=="], + + "sass-embedded-linux-arm": ["sass-embedded-linux-arm@1.106.1", "", { "os": "linux", "cpu": "arm", "libc": "glibc" }, "sha512-EfhuxqURaMpP/eG4bg3fk4XZvRzMJBIw2iSVNRRbpwMOZLhDce8Eys95rTuOuU2R9/pHMwcVwpj/ZU3mZyLHog=="], + + "sass-embedded-linux-arm64": ["sass-embedded-linux-arm64@1.106.1", "", { "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha512-CBUcLDCBUiB6vlMO5VwtTywpapeE8cmr/UJ//xwNwByNGxc6JvoBru5XA1bhPquRjgNNMs90u89ybgap8gN31Q=="], + + "sass-embedded-linux-musl-arm": ["sass-embedded-linux-musl-arm@1.106.1", "", { "os": "linux", "cpu": "arm", "libc": "musl" }, "sha512-ToaDrOiunMuD64XLelRqjC0LWuEKt8q6vpqPsHdSN8T5paJWrAXP8EXMcuR/iIBigsssifAPym/MHEWLkLSTlg=="], + + "sass-embedded-linux-musl-arm64": ["sass-embedded-linux-musl-arm64@1.106.1", "", { "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha512-yDUGDnNbPOoVaeEapLomFnwQkLQF4pveitqjq3J9Oi7qmg8mM/PXJYWOqCOq1ifXSbnnWppfuylUSkGTwnO1Hg=="], + + "sass-embedded-linux-musl-riscv64": ["sass-embedded-linux-musl-riscv64@1.106.1", "", { "os": "linux", "cpu": "none", "libc": "musl" }, "sha512-mQwiwXzfYlT/3Tb7TAvly9eoJc6Q6z+PC2e8mtuajr77DWAGa+8Ibte1umkG/F6o9jFNG8k752A4EAlSRTXfNg=="], + + "sass-embedded-linux-musl-x64": ["sass-embedded-linux-musl-x64@1.106.1", "", { "os": "linux", "cpu": "x64", "libc": "musl" }, "sha512-GwVa+GJGeu8ACw06aGXz8uuc9rFXRJsceMHHi02fpuv3qsy2asMgy9xgN4GPVJLac4yjCBmf09sUUqWpOCrkzw=="], + + "sass-embedded-linux-riscv64": ["sass-embedded-linux-riscv64@1.106.1", "", { "os": "linux", "cpu": "none", "libc": "glibc" }, "sha512-biV7fnrlTBAfl+bzIMTgGUHaW803NJti4XcKpX70ukOOKOgxsEwwvk21tI0w8VLKIyXFuLKM3TJxe3Ze1DR0tQ=="], + + "sass-embedded-linux-x64": ["sass-embedded-linux-x64@1.106.1", "", { "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-Ev2UktLmdFVvCFeSNyow0HNdxmNHqcXLRgEeesKpw4mtcuLN5HHocOJw9LrHiTbcpMPsfxgymS4jJBg43AptaA=="], + + "sass-embedded-unknown-all": ["sass-embedded-unknown-all@1.106.1", "", { "dependencies": { "sass": "1.106.1" }, "os": [ "!linux", "!win32", "!darwin", "!android", ] }, "sha512-uaeOeGCaHnhqpfZnjy5wGMcuyYbnDyXhzWCniGctqCj/Inlst4eDZaweowo+sJLExRvmToBhQ8seZyEvfGMQ4g=="], + + "sass-embedded-win32-arm64": ["sass-embedded-win32-arm64@1.106.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-EiDwpthGDIX25B4d5lVEYgxzqRSdSFoi8czHHesXFYinroDHmgTpqgv7MhYmGogTCvei3o8AahX2Wl1BanWJQg=="], + + "sass-embedded-win32-x64": ["sass-embedded-win32-x64@1.106.1", "", { "os": "win32", "cpu": "x64" }, "sha512-j3OIOIXrNqbggtWlht7M/mkYybmGeGtvP7FRUx0NTDC6yeRhc16QTOoHb+z8S6NO9x0frg8eQS+F5qF7+DCKBQ=="], + + "saxes": ["saxes@6.0.0", "", { "dependencies": { "xmlchars": "^2.2.0" } }, "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA=="], + + "semver": ["semver@7.8.5", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA=="], + + "shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="], + + "shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="], + + "siginfo": ["siginfo@2.0.0", "", {}, "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g=="], + + "signal-exit": ["signal-exit@4.1.0", "", {}, "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw=="], + + "slash": ["slash@5.1.0", "", {}, "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg=="], + + "slice-ansi": ["slice-ansi@4.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", "is-fullwidth-code-point": "^3.0.0" } }, "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ=="], + + "slugify": ["slugify@1.6.9", "", {}, "sha512-vZ7rfeehZui7wQs438JXBckYLkIIdfHOXsaVEUMyS5fHo1483l1bMdo0EDSWYclY0yZKFOipDy4KHuKs6ssvdg=="], + + "smooth-dnd": ["smooth-dnd@0.12.1", "", {}, "sha512-Dndj/MOG7VP83mvzfGCLGzV2HuK1lWachMtWl/Iuk6zV7noDycIBnflwaPuDzoaapEl3Pc4+ybJArkkx9sxPZg=="], + + "sortablejs": ["sortablejs@1.14.0", "", {}, "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w=="], + + "source-map-js": ["source-map-js@1.2.2", "", {}, "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw=="], + + "space-separated-tokens": ["space-separated-tokens@2.0.2", "", {}, "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q=="], + + "speakingurl": ["speakingurl@14.0.1", "", {}, "sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ=="], + + "stable-hash-x": ["stable-hash-x@0.2.0", "", {}, "sha512-o3yWv49B/o4QZk5ZcsALc6t0+eCelPc44zZsLtCQnZPDwFpDYSWcDnrv2TtMmMbQ7uKo3J0HTURCqckw23czNQ=="], + + "stackback": ["stackback@0.0.2", "", {}, "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw=="], + + "std-env": ["std-env@4.3.0", "", {}, "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag=="], + + "string-width": ["string-width@8.3.0", "", { "dependencies": { "get-east-asian-width": "^1.5.0", "strip-ansi": "^7.1.2" } }, "sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ=="], + + "stringify-entities": ["stringify-entities@4.0.4", "", { "dependencies": { "character-entities-html4": "^2.0.0", "character-entities-legacy": "^3.0.0" } }, "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg=="], + + "strip-ansi": ["strip-ansi@7.2.0", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="], + + "style-search": ["style-search@0.1.0", "", {}, "sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg=="], + + "stylelint": ["stylelint@17.16.0", "", { "dependencies": { "@csstools/css-calc": "^3.3.0", "@csstools/css-parser-algorithms": "^4.0.0", "@csstools/css-syntax-patches-for-csstree": "^1.1.9", "@csstools/css-tokenizer": "^4.0.0", "@csstools/media-query-list-parser": "^5.0.0", "@csstools/selector-resolve-nested": "^4.0.1", "@csstools/selector-specificity": "^6.0.0", "colord": "^2.10.0", "cosmiconfig": "^9.0.2", "css-functions-list": "^3.3.3", "css-tree": "^3.2.1", "debug": "^4.4.3", "fast-glob": "^3.3.3", "fastest-levenshtein": "^1.0.16", "file-entry-cache": "^11.1.5", "global-modules": "^2.0.0", "globby": "^16.2.4", "globjoin": "^0.1.4", "html-tags": "^5.1.0", "ignore": "^7.0.6", "import-meta-resolve": "^4.2.0", "mathml-tag-names": "^4.0.0", "meow": "^14.1.0", "micromatch": "^4.0.8", "normalize-path": "^3.0.0", "picocolors": "^1.1.1", "postcss": "^8.5.26", "postcss-safe-parser": "^7.0.1", "postcss-selector-parser": "^7.1.5", "postcss-value-parser": "^4.2.0", "string-width": "^8.2.2", "supports-hyperlinks": "^4.5.0", "svg-tags": "^1.0.0", "table": "^6.9.0", "write-file-atomic": "^7.0.1" }, "bin": { "stylelint": "bin/stylelint.mjs" } }, "sha512-ejlWnbJ13x1GU32+zZXa6sYQJsKKkwSdv2B4rAdO3OWdEmvhSJKcXi5pOphQYSzyaj1kXpuGJr7pcMBNfDIuPw=="], + + "stylelint-config-idiomatic-order": ["stylelint-config-idiomatic-order@github:ream88/stylelint-config-idiomatic-order#2b45652", { "dependencies": { "stylelint-order": "^6.0.2" }, "peerDependencies": { "stylelint": ">=11" } }, "ream88-stylelint-config-idiomatic-order-2b45652", "sha512-bHkja+lSfs4/KuYR+AQy4+EcX12CkrthXu9+qIHsmiMwfA3gdauHxW8dM1STaSnAcVaeml1RLDIcLRofTAWfpw=="], + + "stylelint-config-recommended": ["stylelint-config-recommended@18.0.0", "", { "peerDependencies": { "stylelint": "^17.0.0" } }, "sha512-mxgT2XY6YZ3HWWe3Di8umG6aBmWmHTblTgu/f10rqFXnyWxjKWwNdjSWkgkwCtxIKnqjSJzvFmPT5yabVIRxZg=="], + + "stylelint-config-recommended-scss": ["stylelint-config-recommended-scss@17.0.1", "", { "dependencies": { "postcss-scss": "^4.0.9", "stylelint-config-recommended": "^18.0.0", "stylelint-scss": "^7.0.0" }, "peerDependencies": { "postcss": "^8.3.3", "stylelint": "^17.0.0" }, "optionalPeers": ["postcss"] }, "sha512-x5DVehzJudcwF0od3sGpgkln2PLLranFE7twwbp7dqDINCyZvwzFkMc6TLhNOvazRiVBJYATQLouJY0xPGB8WA=="], + + "stylelint-config-sass-guidelines": ["stylelint-config-sass-guidelines@13.0.0", "", { "dependencies": { "@stylistic/stylelint-plugin": "^5.0.1", "postcss-scss": "^4.0.9", "stylelint-scss": "^7.0.0" }, "peerDependencies": { "postcss": "^8.4.21", "stylelint": "^17.1.0" } }, "sha512-YJT0X8h0OqyEo7ys3EycV5CGWt2rrkEYE8sHSN6sFnrxbXvHiy4KJFHDOWfyb3eWR6wtYpM+yIyvR2Plc8+pCg=="], + + "stylelint-config-standard": ["stylelint-config-standard@40.0.0", "", { "dependencies": { "stylelint-config-recommended": "^18.0.0" }, "peerDependencies": { "stylelint": "^17.0.0" } }, "sha512-EznGJxOUhtWck2r6dJpbgAdPATIzvpLdK9+i5qPd4Lx70es66TkBPljSg4wN3Qnc6c4h2n+WbUrUynQ3fanjHw=="], + + "stylelint-config-standard-scss": ["stylelint-config-standard-scss@17.0.0", "", { "dependencies": { "stylelint-config-recommended-scss": "^17.0.0", "stylelint-config-standard": "^40.0.0" }, "peerDependencies": { "postcss": "^8.3.3", "stylelint": "^17.0.0" }, "optionalPeers": ["postcss"] }, "sha512-uLJS6xgOCBw5EMsDW7Ukji8l28qRoMnkRch15s0qwZpskXvWt9oPzMmcYM307m9GN4MxuWLsQh4I6hU9yI53cQ=="], + + "stylelint-junit-formatter": ["stylelint-junit-formatter@0.2.2", "", { "dependencies": { "xmlbuilder": "^13.0.2" } }, "sha512-8Yx0sG5vYKf+wBbFKibbuiuydKezBwo2M9svoNYtvYTKvSiMYVhZSvVJh9hMAWeSPImcVP9OwTq+Ku/00j9/Ng=="], + + "stylelint-order": ["stylelint-order@6.0.4", "", { "dependencies": { "postcss": "^8.4.32", "postcss-sorting": "^8.0.2" }, "peerDependencies": { "stylelint": "^14.0.0 || ^15.0.0 || ^16.0.1" } }, "sha512-0UuKo4+s1hgQ/uAxlYU4h0o0HS4NiQDud0NAUNI0aa8FJdmYHA5ZZTFHiV5FpmE3071e9pZx5j0QpVJW5zOCUA=="], + + "stylelint-scss": ["stylelint-scss@7.4.0", "", { "dependencies": { "@csstools/css-calc": "^3.4.3", "@csstools/css-parser-algorithms": "^4.0.0", "@csstools/css-syntax-patches-for-csstree": "^1.1.15", "@csstools/css-tokenizer": "^4.0.0", "css-tree": "^3.2.1", "is-plain-object": "^5.1.0", "known-css-properties": "^0.37.0", "postcss-media-query-parser": "^0.2.3", "postcss-resolve-nested-selector": "^0.1.7", "postcss-selector-parser": "^7.1.6", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "stylelint": "^16.8.2 || ^17.0.0" } }, "sha512-OvN+AestcvtB/IFvde1kpFLq2mpIsPaeB8E+Cjlxu7qjf0ja7NCoTrDW97tuNeXFlYGUdwqGq5cXaByLpNwuxA=="], + + "superjson": ["superjson@2.2.6", "", { "dependencies": { "copy-anything": "^4" } }, "sha512-H+ue8Zo4vJmV2nRjpx86P35lzwDT3nItnIsocgumgr0hHMQ+ZGq5vrERg9kJBo5AWGmxZDhzDo+WVIJqkB0cGA=="], + + "supports-color": ["supports-color@8.1.1", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q=="], + + "supports-hyperlinks": ["supports-hyperlinks@4.6.0", "", { "dependencies": { "has-flag": "^5.0.1", "supports-color": "^10.2.2" } }, "sha512-FL/q/YePS4tFFTNiBOR+zPk2ZrKheqNtmTJ/9OUZ4e1wKHJofDbGQSmSsxS0XNnabSkqexryCaXGvEKz1vf9UQ=="], + + "svg-tags": ["svg-tags@1.0.0", "", {}, "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA=="], + + "sweetalert2": ["sweetalert2@11.26.25", "", {}, "sha512-+hunCOJdJ6FLj04T9YSLvvZXRjsvIkTeTKP2e4VF8CaBias961BTnWiSFAy7F/CM5eq3QK2Rraoc5Gzftslvkg=="], + + "symbol-tree": ["symbol-tree@3.2.4", "", {}, "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw=="], + + "sync-child-process": ["sync-child-process@1.1.1", "", { "dependencies": { "sync-message-port": "^1.0.0" } }, "sha512-54zMOnH5qgjdKW8SGpCx3daSP+v+TtTfOxgPdhUE3P0hytMMpknZfP67S4JeRcx5IQRWJERz6890yO4dkTywww=="], + + "sync-message-port": ["sync-message-port@1.2.0", "", {}, "sha512-gAQ9qrUN/UCypHtGFbbe7Rc/f9bzO88IwrG8TDo/aMKAApKyD6E3W4Cm0EfhfBb6Z6SKt59tTCTfD+n1xmAvMg=="], + + "table": ["table@6.9.0", "", { "dependencies": { "ajv": "^8.0.1", "lodash.truncate": "^4.4.2", "slice-ansi": "^4.0.0", "string-width": "^4.2.3", "strip-ansi": "^6.0.1" } }, "sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A=="], + + "tiny-invariant": ["tiny-invariant@1.3.3", "", {}, "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg=="], + + "tinybench": ["tinybench@2.9.0", "", {}, "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg=="], + + "tinyexec": ["tinyexec@1.3.1", "", {}, "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA=="], + + "tinyglobby": ["tinyglobby@0.2.17", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g=="], + + "tinyrainbow": ["tinyrainbow@3.2.0", "", {}, "sha512-LgO3D9yZJjApUiuUfl9iFAwrtaX4+lok3wJIqttGoKCHlWUqHqbQpnxCf82L8FjgKsh4iGo78hqJwgL8F6To2A=="], + + "tldts": ["tldts@7.4.19", "", { "dependencies": { "tldts-core": "^7.4.19" }, "bin": { "tldts": "bin/cli.js" } }, "sha512-48dH6aSpQnpbzDUc4vIQZ1VjB8tkK+e8c1yx05/SZK+rkssgjEOlxDd/yU8/a4vGYQ9vRgJr9dwMq9TJ0b3X2Q=="], + + "tldts-core": ["tldts-core@7.4.19", "", {}, "sha512-goNXV6Ho9TIOfpJZanTd6CKG5DyYgYAL+k+22T0SLh8l6+KHIfBUPFuePuSZv05UttIaaLmI9tb7TmGIdK5AkQ=="], + + "to-regex-range": ["to-regex-range@5.0.1", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="], + + "tough-cookie": ["tough-cookie@6.0.2", "", { "dependencies": { "tldts": "^7.0.5" } }, "sha512-exgYmnmL/sJpR3upZfXG5PoatXQii55xAiXGXzY+sROLZ/Y+SLcp9PgJNI9Vz37HpQ74WvDcLT8eqm+kV3FzrA=="], + + "tr46": ["tr46@6.0.0", "", { "dependencies": { "punycode": "^2.3.1" } }, "sha512-bLVMLPtstlZ4iMQHpFHTR7GAGj2jxi8Dg0s2h2MafAE4uSWF98FC/3MomU51iQAMf8/qDUbKWf5GxuvvVcXEhw=="], + + "trim-lines": ["trim-lines@3.0.1", "", {}, "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg=="], + + "trim-trailing-lines": ["trim-trailing-lines@2.1.0", "", {}, "sha512-5UR5Biq4VlVOtzqkm2AZlgvSlDJtME46uV0br0gENbwN4l5+mMKT4b9gJKqWtuL2zAIqajGJGuvbCbcAJUZqBg=="], + + "trough": ["trough@2.2.0", "", {}, "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw=="], + + "ts-api-utils": ["ts-api-utils@2.5.0", "", { "peerDependencies": { "typescript": ">=4.8.4" } }, "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA=="], + + "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], + + "type-check": ["type-check@0.4.0", "", { "dependencies": { "prelude-ls": "^1.2.1" } }, "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew=="], + + "typescript": ["typescript@6.0.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw=="], + + "typescript-eslint": ["typescript-eslint@8.72.1", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.72.1", "@typescript-eslint/parser": "8.72.1", "@typescript-eslint/typescript-estree": "8.72.1", "@typescript-eslint/utils": "8.72.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-3Li9FfPmQp45nxEtFD1ZCrYFI3cYK5kpyNtmm1H7lMagm8u9sy6PTjy3ytwQZs7KNukOyKFHAZ6z6GjYFeaeXw=="], + + "undici": ["undici@7.30.1", "", {}, "sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg=="], + + "undici-types": ["undici-types@7.24.6", "", {}, "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg=="], + + "unicorn-magic": ["unicorn-magic@0.4.1", "", {}, "sha512-lzlXPoVB0Uy/FvTaUgX39RbixYiSKoc3JSoSf01+0c2B6FR3qdYIPN7Qjo/AV7n6sqLCk0509cT3LRj1oSZ1+A=="], + + "unified": ["unified@11.0.5", "", { "dependencies": { "@types/unist": "^3.0.0", "bail": "^2.0.0", "devlop": "^1.0.0", "extend": "^3.0.0", "is-plain-obj": "^4.0.0", "trough": "^2.0.0", "vfile": "^6.0.0" } }, "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA=="], + + "unist-util-is": ["unist-util-is@6.0.1", "", { "dependencies": { "@types/unist": "^3.0.0" } }, "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g=="], + + "unist-util-position": ["unist-util-position@5.0.0", "", { "dependencies": { "@types/unist": "^3.0.0" } }, "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA=="], + + "unist-util-stringify-position": ["unist-util-stringify-position@4.0.0", "", { "dependencies": { "@types/unist": "^3.0.0" } }, "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ=="], + + "unist-util-visit": ["unist-util-visit@5.0.0", "", { "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0", "unist-util-visit-parents": "^6.0.0" } }, "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg=="], + + "unist-util-visit-parents": ["unist-util-visit-parents@6.1.0", "", { "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0" } }, "sha512-vKXxz6O38sKDj1mtx/k2cWvkkFBuYGx6uGrlzBkVeWCRF/F8sdI0j3Wbkz/5rVNRRuVc8UrgRdbCxNhmYXgP3w=="], + + "unrs-resolver": ["unrs-resolver@1.12.2", "", { "dependencies": { "napi-postinstall": "^0.3.4" }, "optionalDependencies": { "@unrs/resolver-binding-android-arm-eabi": "1.12.2", "@unrs/resolver-binding-android-arm64": "1.12.2", "@unrs/resolver-binding-darwin-arm64": "1.12.2", "@unrs/resolver-binding-darwin-x64": "1.12.2", "@unrs/resolver-binding-freebsd-x64": "1.12.2", "@unrs/resolver-binding-linux-arm-gnueabihf": "1.12.2", "@unrs/resolver-binding-linux-arm-musleabihf": "1.12.2", "@unrs/resolver-binding-linux-arm64-gnu": "1.12.2", "@unrs/resolver-binding-linux-arm64-musl": "1.12.2", "@unrs/resolver-binding-linux-loong64-gnu": "1.12.2", "@unrs/resolver-binding-linux-loong64-musl": "1.12.2", "@unrs/resolver-binding-linux-ppc64-gnu": "1.12.2", "@unrs/resolver-binding-linux-riscv64-gnu": "1.12.2", "@unrs/resolver-binding-linux-riscv64-musl": "1.12.2", "@unrs/resolver-binding-linux-s390x-gnu": "1.12.2", "@unrs/resolver-binding-linux-x64-gnu": "1.12.2", "@unrs/resolver-binding-linux-x64-musl": "1.12.2", "@unrs/resolver-binding-openharmony-arm64": "1.12.2", "@unrs/resolver-binding-wasm32-wasi": "1.12.2", "@unrs/resolver-binding-win32-arm64-msvc": "1.12.2", "@unrs/resolver-binding-win32-ia32-msvc": "1.12.2", "@unrs/resolver-binding-win32-x64-msvc": "1.12.2" }, "hasInstallScript": true }, "sha512-dmlRxBJJayXjqTwC+JtF1HhJmgf3ftQ3YejFcZrf4+KKtJv0qDsK1pjqaaVjG7wJ5NJ6UVP1OqRMQ71Z4C3rxQ=="], + + "update-browserslist-db": ["update-browserslist-db@1.3.4", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A=="], + + "uri-js": ["uri-js@4.4.1", "", { "dependencies": { "punycode": "^2.1.0" } }, "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="], + + "util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="], + + "vanilla-colorful": ["vanilla-colorful@0.7.2", "", {}, "sha512-z2YZusTFC6KnLERx1cgoIRX2CjPRP0W75N+3CC6gbvdX5Ch47rZkEMGO2Xnf+IEmi3RiFLxS18gayMA27iU7Kg=="], + + "varint": ["varint@6.0.0", "", {}, "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg=="], + + "vfile": ["vfile@6.0.3", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="], + + "vfile-message": ["vfile-message@4.0.3", "", { "dependencies": { "@types/unist": "^3.0.0", "unist-util-stringify-position": "^4.0.0" } }, "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw=="], + + "vite": ["vite@8.3.5", "", { "dependencies": { "lightningcss": "^1.33.0", "picomatch": "^4.0.7", "postcss": "^8.5.30", "rolldown": "~1.2.14", "tinyglobby": "^0.2.17" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "@vitejs/devtools": "^0.7.1 || ^0.8.0", "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "@vitejs/devtools", "esbuild", "jiti", "less", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-z1YpjieJ9g0ebTmQpLBv/oq9E3F9EIlOe+7LahW8SrE3LTiG3udBRUXQOlYXP9b+IC2q2phHeVxj9xGlw34OEQ=="], + + "vite-plugin-checker": ["vite-plugin-checker@0.13.0", "", { "dependencies": { "@babel/code-frame": "^7.27.1", "chokidar": "^4.0.3", "npm-run-path": "^6.0.0", "picocolors": "^1.1.1", "picomatch": "^4.0.4", "proper-lockfile": "^4.1.2", "tiny-invariant": "^1.3.3", "tinyglobby": "^0.2.15", "vscode-uri": "^3.1.0" }, "peerDependencies": { "@biomejs/biome": ">=1.7", "eslint": ">=9.39.4", "meow": "^13.2.0 || ^14.0.0", "optionator": "^0.9.4", "oxlint": ">=1", "stylelint": ">=16.26.1", "typescript": "*", "vite": ">=5.4.21", "vls": "*", "vti": "*", "vue-tsc": "~2.2.10 || ^3.0.0" }, "optionalPeers": ["@biomejs/biome", "eslint", "meow", "optionator", "oxlint", "stylelint", "typescript", "vls", "vti", "vue-tsc"] }, "sha512-14EkOZmfinVZNxRmg2uCNDwtqGc/33lU/UEJansHgu27+ad+r6mMBf1Xtnq57jGZWiO/xzwtiEKPYsganw7ZFQ=="], + + "vite-plugin-eslint2": ["vite-plugin-eslint2@5.3.0", "", { "dependencies": { "@rollup/pluginutils": "^5.4.0", "debug": "^4.4.3" }, "peerDependencies": { "@types/eslint": "^7.0.0 || ^8.0.0 || ^9.0.0", "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0", "rolldown": "^1.0.0-0 || ^1.0.0", "rollup": "^2.0.0 || ^3.0.0 || ^4.0.0", "vite": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" }, "optionalPeers": ["@types/eslint", "rolldown", "rollup"] }, "sha512-6Bq21StuWrlkVNW/MjNfHyGqaHSLpGZ7FUfG4MWOg6x1mNRtUCI6ZRG5ZptbGlCKT5NNE9+fT31dmQajxuRUYA=="], + + "vite-plugin-full-reload": ["vite-plugin-full-reload@1.2.0", "", { "dependencies": { "picocolors": "^1.0.0", "picomatch": "^2.3.1" } }, "sha512-kz18NW79x0IHbxRSHm0jttP4zoO9P9gXh+n6UTwlNKnviTTEpOlum6oS9SmecrTtSr+muHEn5TUuC75UovQzcA=="], + + "vite-plugin-static-copy": ["vite-plugin-static-copy@4.1.1", "", { "dependencies": { "chokidar": "^3.6.0", "p-map": "^7.0.4", "picocolors": "^1.1.1", "tinyglobby": "^0.2.17" }, "peerDependencies": { "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-GrlA8YklrAfSyxJ4M3fdQLOo9oNkp56IM9FYgX/WtEgeIFkPwhu4wzpufBCIuNKCa6Fn77FkRdYxkHqV0FwjAw=="], + + "vitest": ["vitest@4.1.12", "", { "dependencies": { "@vitest/expect": "4.1.12", "@vitest/mocker": "4.1.12", "@vitest/pretty-format": "4.1.12", "@vitest/runner": "4.1.12", "@vitest/snapshot": "4.1.12", "@vitest/spy": "4.1.12", "@vitest/utils": "4.1.12", "es-module-lexer": "^2.0.0", "expect-type": "^1.3.0", "magic-string": "^0.30.21", "obug": "^2.1.1", "pathe": "^2.0.3", "picomatch": "^4.0.3", "std-env": "^4.0.0-rc.1", "tinybench": "^2.9.0", "tinyexec": "^1.0.2", "tinyglobby": "^0.2.15", "tinyrainbow": "^3.1.0", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", "why-is-node-running": "^2.3.0" }, "peerDependencies": { "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", "@vitest/browser-playwright": "4.1.12", "@vitest/browser-preview": "4.1.12", "@vitest/browser-webdriverio": "^4.1.11", "@vitest/coverage-istanbul": "4.1.12", "@vitest/coverage-v8": "4.1.12", "@vitest/ui": "4.1.12", "happy-dom": "*", "jsdom": "*" }, "optionalPeers": ["@edge-runtime/vm", "@opentelemetry/api", "@types/node", "@vitest/browser-playwright", "@vitest/browser-preview", "@vitest/browser-webdriverio", "@vitest/coverage-istanbul", "@vitest/coverage-v8", "@vitest/ui", "happy-dom", "jsdom"], "bin": { "vitest": "./vitest.mjs" } }, "sha512-5eWdz2yb3ajxWF3C8C4TjkXl7FGm3n2E/VlazALrQHzK7nYMSGFnCZto0bbPNl77AwkOZVLk0YnBAejUu0NiWA=="], + + "vscode-uri": ["vscode-uri@3.2.0", "", {}, "sha512-m2gXo3bn0G1kT9InzMf07fTbqMbGtyckj3bH5ktLO+1Ssv+yiATZ4dhwaQv9UZWxJh6E9IFGnQyjgWVDWVBDrg=="], + + "vue": ["vue@3.5.44", "", { "dependencies": { "@vue/compiler-dom": "3.5.44", "@vue/compiler-sfc": "3.5.44", "@vue/runtime-dom": "3.5.44", "@vue/server-renderer": "3.5.44", "@vue/shared": "3.5.44" }, "peerDependencies": { "typescript": "*" }, "optionalPeers": ["typescript"] }, "sha512-dvvmaOCG7lAMkJTPqPwWeGMsPS6DIsFsfZDUgBp9V6mHf9b3+/wyVwYR4Es+WV6uJC0FKRxp81Obcq0ZwUcGFQ=="], + + "vue-content-placeholders": ["vue-content-placeholders@0.2.1", "", {}, "sha512-Q+HPjuY98R0fLQ45eOOCYeMY7vpjU1H/Qqs0ptdBI6xe3nDDsPE4r/kN5YA9rVxQFP/PKhG5qQR4rqy02xPabw=="], + + "vue-eslint-parser": ["vue-eslint-parser@10.4.1", "", { "dependencies": { "debug": "^4.4.0", "eslint-scope": "^8.2.0 || ^9.0.0", "eslint-visitor-keys": "^4.2.0 || ^5.0.0", "espree": "^10.3.0 || ^11.0.0", "esquery": "^1.6.0", "semver": "^7.6.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0" } }, "sha512-Gk6gRDj0n/fkRa3C3l0bBheoBckUq/Rs0F/TvMWIS6nzzx67amAViMe9CkNgsP2tXyQONvGiHQESHwFtZ3aYDA=="], + + "vue-smooth-dnd": ["vue-smooth-dnd@0.8.1", "", { "dependencies": { "smooth-dnd": "0.12.1" } }, "sha512-eZVVPTwz4A1cs0+CjXx/ihV+gAl3QBoWQnU6+23Gp59t0WBU99z7ducBQ4FvjBamqOlg8SDOE5eFHQedxwB4Wg=="], + + "vue-tsc": ["vue-tsc@3.3.13", "", { "dependencies": { "@volar/typescript": "2.4.28", "@vue/language-core": "3.3.13" }, "peerDependencies": { "typescript": ">=5.0.0" }, "bin": { "vue-tsc": "bin/vue-tsc.js" } }, "sha512-jE4/bXdOMSHVxEGgQCqNllJy+9N3Gx6tfSAsg0yhFK/MAN6eXqISihupnDEKSCt12VVnjN2gI3AqLYcqoh5x/A=="], + + "vuedraggable": ["vuedraggable@4.1.0", "", { "dependencies": { "sortablejs": "1.14.0" }, "peerDependencies": { "vue": "^3.0.1" } }, "sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww=="], + + "w3c-xmlserializer": ["w3c-xmlserializer@5.0.0", "", { "dependencies": { "xml-name-validator": "^5.0.0" } }, "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA=="], + + "web-namespaces": ["web-namespaces@2.0.1", "", {}, "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ=="], + + "webidl-conversions": ["webidl-conversions@8.0.1", "", {}, "sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ=="], + + "whatwg-mimetype": ["whatwg-mimetype@5.0.0", "", {}, "sha512-sXcNcHOC51uPGF0P/D4NVtrkjSU2fNsm9iog4ZvZJsL3rjoDAzXZhkm2MWt1y+PUdggKAYVoMAIYcs78wJ51Cw=="], + + "whatwg-url": ["whatwg-url@16.0.1", "", { "dependencies": { "@exodus/bytes": "^1.11.0", "tr46": "^6.0.0", "webidl-conversions": "^8.0.1" } }, "sha512-1to4zXBxmXHV3IiSSEInrreIlu02vUOvrhxJJH5vcxYTBDAx51cqZiKdyTxlecdKNSjj8EcxGBxNf6Vg+945gw=="], + + "which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="], + + "why-is-node-running": ["why-is-node-running@2.3.0", "", { "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" }, "bin": { "why-is-node-running": "cli.js" } }, "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w=="], + + "word-wrap": ["word-wrap@1.2.5", "", {}, "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA=="], + + "write-file-atomic": ["write-file-atomic@7.0.1", "", { "dependencies": { "signal-exit": "^4.0.1" } }, "sha512-OTIk8iR8/aCRWBqvxrzxR0hgxWpnYBblY1S5hDWBQfk/VFmJwzmJgQFN3WsoUKHISv2eAwe+PpbUzyL1CKTLXg=="], + + "xml-name-validator": ["xml-name-validator@5.0.0", "", {}, "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg=="], + + "xmlbuilder": ["xmlbuilder@13.0.2", "", {}, "sha512-Eux0i2QdDYKbdbA6AM6xE4m6ZTZr4G4xF9kahI2ukSEMCzwce2eX9WlTI5J3s+NU7hpasFsr8hWIONae7LluAQ=="], + + "xmlchars": ["xmlchars@2.2.0", "", {}, "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw=="], + + "yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="], + + "zod": ["zod@4.6.7", "", {}, "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg=="], + + "zwitch": ["zwitch@2.0.4", "", {}, "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A=="], + + "@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "@eslint-community/eslint-utils/eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="], + + "@rollup/pluginutils/estree-walker": ["estree-walker@2.0.2", "", {}, "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="], + + "@typescript-eslint/eslint-plugin/ignore": ["ignore@7.0.14", "", {}, "sha512-wCBiZ77u1tuWde6G/nfOtLaCTYcFDU5yCzARzK10y+rLhzYoL7a7yEemcopcc2Mzow7gZOIjnV2ym1NYmdiJOQ=="], + + "@vue/compiler-core/entities": ["entities@7.0.1", "", {}, "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA=="], + + "@vue/compiler-core/estree-walker": ["estree-walker@2.0.2", "", {}, "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="], + + "@vue/compiler-sfc/estree-walker": ["estree-walker@2.0.2", "", {}, "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="], + + "ansi-styles/color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="], + + "anymatch/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], + + "fast-glob/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], + + "global-prefix/which": ["which@1.3.1", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "which": "./bin/which" } }, "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ=="], + + "globby/ignore": ["ignore@7.0.14", "", {}, "sha512-wCBiZ77u1tuWde6G/nfOtLaCTYcFDU5yCzARzK10y+rLhzYoL7a7yEemcopcc2Mzow7gZOIjnV2ym1NYmdiJOQ=="], + + "istanbul-lib-report/supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="], + + "mdast-util-find-and-replace/escape-string-regexp": ["escape-string-regexp@5.0.0", "", {}, "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw=="], + + "micromatch/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], + + "npm-run-path/path-key": ["path-key@4.0.0", "", {}, "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ=="], + + "npm-run-path/unicorn-magic": ["unicorn-magic@0.3.0", "", {}, "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA=="], + + "proper-lockfile/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], + + "qified/hookified": ["hookified@2.2.0", "", {}, "sha512-p/LgFzRN5FeoD3DLS6bkUapeye6E4SI6yJs6KetENd18S+FBthqYq2amJUWpt5z0EQwwHemidjY5OqJGEKm5uA=="], + + "sass/chokidar": ["chokidar@5.0.0", "", { "dependencies": { "readdirp": "^5.0.0" } }, "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw=="], + + "stylelint/ignore": ["ignore@7.0.14", "", {}, "sha512-wCBiZ77u1tuWde6G/nfOtLaCTYcFDU5yCzARzK10y+rLhzYoL7a7yEemcopcc2Mzow7gZOIjnV2ym1NYmdiJOQ=="], + + "supports-hyperlinks/has-flag": ["has-flag@5.0.1", "", {}, "sha512-CsNUt5x9LUdx6hnk/E2SZLsDyvfqANZSUq4+D3D8RzDJ2M+HDTIkF60ibS1vHaK55vzgiZw1bEPFG9yH7l33wA=="], + + "supports-hyperlinks/supports-color": ["supports-color@10.2.2", "", {}, "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g=="], + + "table/ajv": ["ajv@8.20.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA=="], + + "table/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], + + "table/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + + "vite-plugin-full-reload/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], + + "vite-plugin-static-copy/chokidar": ["chokidar@3.6.0", "", { "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw=="], + + "ansi-styles/color-convert/color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="], + + "sass/chokidar/readdirp": ["readdirp@5.1.1", "", {}, "sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA=="], + + "table/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="], + + "table/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], + + "vite-plugin-static-copy/chokidar/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], + + "vite-plugin-static-copy/chokidar/readdirp": ["readdirp@3.6.0", "", { "dependencies": { "picomatch": "^2.2.1" } }, "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA=="], + + "vite-plugin-static-copy/chokidar/readdirp/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], + } +} diff --git a/commitlint.config.cjs b/commitlint.config.cjs new file mode 100644 index 00000000..5703cf99 --- /dev/null +++ b/commitlint.config.cjs @@ -0,0 +1,33 @@ +const baseConfig = require("@uwil/husky-config/commitlint.config.cjs"); + +module.exports = { + ...baseConfig, + rules: { + ...baseConfig.rules, + // * Disable Emoji rule + "emoji-valid": [0], + }, + plugins: [ + { + rules: { + ...baseConfig.plugins[0].rules, + "message-valid": (parsed) => { + const { header } = parsed; + + const contentMatch = header.match(/^[^:]+:\s*(.*)$/); + const fullContent = contentMatch ? contentMatch[1].trim() : ""; + + const textOnly = fullContent.replace(/^([\p{Emoji}]|:\w+:)\s*/u, "").trim(); + + if (!textOnly || textOnly.length < 3 || textOnly.length > 255) { + return [ + false, + "message must be between 3 and 255 characters \x1b[90m(ex: resolve errors)\x1b[0m", + ]; + } + return [true]; + }, + } + }, + ], +}; diff --git a/composer.json b/composer.json index d09a148b..9a684abd 100644 --- a/composer.json +++ b/composer.json @@ -8,38 +8,52 @@ ], "license": "MIT", "require": { - "php": "^7.3", - "bumbummen99/shoppingcart": "^4.0", - "diglactic/laravel-breadcrumbs": "^6.1", - "dxw/cidr": "^3.1", - "fideloper/proxy": "^4.4", - "fruitcake/laravel-cors": "^2.0", - "guzzlehttp/guzzle": "^7.0.1", - "kwaadpepper/enum": "^2.0.0", - "laravel/framework": "^8.12", - "laravel/tinker": "^2.5", - "ldc/ldccrmv2client": "^3.0", - "maatwebsite/excel": "^3.1", + "php": "^8.5", + "axlon/laravel-postal-code-validation": "^3.9", + "diglactic/laravel-breadcrumbs": "^10.1", + "kwaadpepper/serial-int-caster": "^2.0", + "laravel/framework": "^13.0", + "laravel/tinker": "^3.0", + "laravel/ui": "^4.6", + "ldc/ldccrmv4client": "^4.0", + "maatwebsite/excel": "4.x-dev", "mews/purifier": "^3.3", - "sentry/sentry-laravel": "^3.7", - "spatie/laravel-sitemap": "^5.8", - "uwil/k8s-laravel": "^1.4" + "moneyphp/money": "^4.9", + "propaganistas/laravel-phone": "^6.0", + "sentry/sentry-laravel": "^4.18", + "uwil/arcadia-api-php-client": "^1.0", + "uwil/k8s-laravel": "^3.0", + "uwil/laravel-admin-secure": "^6.0", + "uwil/laravel-redirections": "^3.0", + "uwil/sitemap-generator": "^7.0", + "webmozart/assert": "^2.4" }, "require-dev": { - "doctrine/dbal": "^3.0", - "facade/ignition": "^2.5", + "ace-of-aces/intellipest": "^0.4.0", + "barryvdh/laravel-ide-helper": "^3.7", + "driftingly/rector-laravel": "^2.3", "fakerphp/faker": "^1.9.1", - "mockery/mockery": "^1.4.2", - "nunomaduro/collision": "^5.0", - "phpunit/phpunit": "^9.3.3", - "slevomat/coding-standard": "^7.1" + "larastan/larastan": "^3.4", + "laravel-lang/common": "^6.6", + "laravel/pint": "^1.22", + "mockery/mockery": "^1.6", + "nunomaduro/collision": "^8.6", + "nunomaduro/mock-final-classes": "^1.2", + "pestphp/pest": "^4.0", + "pestphp/pest-plugin-faker": "^4.0", + "pestphp/pest-plugin-laravel": "^4.0", + "pestphp/pest-plugin-type-coverage": "^4.0", + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpunit/phpunit": "^12.5", + "slevomat/coding-standard": "^8.30", + "spatie/laravel-ignition": "^2.0" }, - "repositories": { - "lab.s-web.fr": { + "repositories": [ + { "type": "composer", "url": "https://lab.s-web.fr/api/v4/group/23/-/packages/composer/packages.json" } - }, + ], "config": { "optimize-autoloader": true, "preferred-install": "dist", @@ -47,7 +61,9 @@ "allow-plugins": { "composer/package-versions-deprecated": true, "dealerdirect/phpcodesniffer-composer-installer": true, - "php-http/discovery": true + "pestphp/pest-plugin": true, + "php-http/discovery": true, + "tbachert/spi": true }, "gitlab-domains": [ "lab.s-web.fr" @@ -61,6 +77,9 @@ "autoload": { "psr-4": { "App\\": "app/", + "Domain\\": "domain/", + "Infrastructure\\": "infra/", + "Shared\\": "shared/", "Database\\Factories\\": "database/factories/", "Database\\Seeders\\": "database/seeders/" } @@ -70,13 +89,30 @@ "Tests\\": "tests/" } }, - "minimum-stability": "dev", + "minimum-stability": "stable", "prefer-stable": true, "scripts": { + "test": [ + "@php artisan config:clear --ansi @no_additional_args", + "@php artisan test --parallel --compact --processes=6" + ], + "test-coverage": [ + "@php artisan config:clear --ansi @no_additional_args", + "@php artisan test --coverage --parallel --compact --processes=6 --passthru-php=\"-d pcov.directory=. -dpcov.exclude=~vendor~\"" + ], + "analyse": "vendor/bin/phpstan analyse", + "format": "vendor/bin/pint", "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover --ansi" ], + "post-update-cmd": [ + "Illuminate\\Foundation\\ComposerScripts::postUpdate", + "@php artisan lang:update", + "@php artisan ide-helper:generate", + "@php artisan ide-helper:models -RW", + "./vendor/bin/pint app/Models" + ], "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], diff --git a/composer.lock b/composer.lock index bc77d0c9..922b4456 100644 --- a/composer.lock +++ b/composer.lock @@ -4,40 +4,47 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d53d0cc95f99b7d1705ef16b912f287d", + "content-hash": "3f044c48be0d10e5c41f0efb0efcbb99", "packages": [ { - "name": "asm89/stack-cors", - "version": "v2.2.0", + "name": "axlon/laravel-postal-code-validation", + "version": "v3.10.0", "source": { "type": "git", - "url": "https://github.com/asm89/stack-cors.git", - "reference": "50f57105bad3d97a43ec4a485eb57daf347eafea" + "url": "https://github.com/axlon/laravel-postal-code-validation.git", + "reference": "ad5b9f08acd7c3a07aaebfa29e98e9c04c2ba110" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/asm89/stack-cors/zipball/50f57105bad3d97a43ec4a485eb57daf347eafea", - "reference": "50f57105bad3d97a43ec4a485eb57daf347eafea", + "url": "https://api.github.com/repos/axlon/laravel-postal-code-validation/zipball/ad5b9f08acd7c3a07aaebfa29e98e9c04c2ba110", + "reference": "ad5b9f08acd7c3a07aaebfa29e98e9c04c2ba110", "shasum": "" }, "require": { - "php": "^7.3|^8.0", - "symfony/http-foundation": "^5.3|^6|^7", - "symfony/http-kernel": "^5.3|^6|^7" + "illuminate/contracts": "^5.5 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0", + "illuminate/support": "^5.5 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0", + "illuminate/validation": "^5.5 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0", + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^9", - "squizlabs/php_codesniffer": "^3.5" + "guzzlehttp/guzzle": "^7.8", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5", + "symfony/var-exporter": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "2.2-dev" + "laravel": { + "aliases": { + "PostalCodes": "\\Axlon\\PostalCodeValidation\\Support\\Facades\\PostalCodes" + }, + "providers": [ + "\\Axlon\\PostalCodeValidation\\ValidationServiceProvider" + ] } }, "autoload": { "psr-4": { - "Asm89\\Stack\\": "src/" + "Axlon\\PostalCodeValidation\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -46,44 +53,46 @@ ], "authors": [ { - "name": "Alexander", - "email": "iam.asm89@gmail.com" + "name": "Choraimy Kroonstuiver", + "homepage": "https://github.com/axlon" } ], - "description": "Cross-origin resource sharing library and stack middleware", - "homepage": "https://github.com/asm89/stack-cors", + "description": "Worldwide postal code validation for Laravel and Lumen", "keywords": [ - "cors", - "stack" + "laravel", + "lumen", + "post code", + "postal code", + "validation", + "zip code" ], "support": { - "issues": "https://github.com/asm89/stack-cors/issues", - "source": "https://github.com/asm89/stack-cors/tree/v2.2.0" + "issues": "https://github.com/axlon/laravel-postal-code-validation/issues", + "source": "https://github.com/axlon/laravel-postal-code-validation/tree/v3.10.0" }, - "time": "2023-11-14T13:51:46+00:00" + "time": "2026-08-09T20:25:46+00:00" }, { "name": "brick/math", - "version": "0.9.3", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/brick/math.git", - "reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae" + "reference": "2effe05d2177c451b86c6a073196a4034c02f211" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/ca57d18f028f84f777b2168cd1911b0dee2343ae", - "reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae", + "url": "https://api.github.com/repos/brick/math/zipball/2effe05d2177c451b86c6a073196a4034c02f211", + "reference": "2effe05d2177c451b86c6a073196a4034c02f211", "shasum": "" }, "require": { - "ext-json": "*", - "php": "^7.1 || ^8.0" + "php": "^8.2" }, "require-dev": { - "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.0", - "vimeo/psalm": "4.9.2" + "phpstan/phpstan": "2.2.13", + "phpstan/phpstan-phpunit": "2.0.18", + "phpunit/phpunit": "^11.5" }, "type": "library", "autoload": { @@ -103,122 +112,57 @@ "arithmetic", "bigdecimal", "bignum", + "bignumber", "brick", - "math" + "decimal", + "integer", + "math", + "mathematics", + "rational" ], "support": { "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.9.3" + "source": "https://github.com/brick/math/tree/1.0.0" }, "funding": [ { "url": "https://github.com/BenMorel", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/brick/math", - "type": "tidelift" } ], - "time": "2021-08-15T20:50:18+00:00" - }, - { - "name": "bumbummen99/shoppingcart", - "version": "4.2.0", - "source": { - "type": "git", - "url": "https://github.com/bumbummen99/LaravelShoppingcart.git", - "reference": "1c50fb564826b6ee748d2d9afad7447b6884166e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/bumbummen99/LaravelShoppingcart/zipball/1c50fb564826b6ee748d2d9afad7447b6884166e", - "reference": "1c50fb564826b6ee748d2d9afad7447b6884166e", - "shasum": "" - }, - "require": { - "illuminate/events": "5.4.*||5.5.*||5.6.*||5.7.*||5.8.*||^6.0||^7.0||^8.0||^9.0", - "illuminate/session": "5.4.*||5.5.*||5.6.*||5.7.*||5.8.*||^6.0||^7.0||^8.0||^9.0", - "illuminate/support": "5.4.*||5.5.*||5.6.*||5.7.*||5.8.*||^6.0||^7.0||^8.0||^9.0", - "nesbot/carbon": "~1.20||^1.26.3||^2.0" - }, - "require-dev": { - "mockery/mockery": "^1.0", - "orchestra/testbench": "^3.4|^4.0|^5.0|^6.0", - "phpunit/phpunit": "~5.0||~6.0||~7.0||~8.0||~9.0" - }, - "suggest": { - "gloudemans/notify": "Simple flash notifications for Laravel" - }, - "type": "library", - "extra": { - "laravel": { - "aliases": { - "Cart": "Gloudemans\\Shoppingcart\\Facades\\Cart" - }, - "providers": [ - "Gloudemans\\Shoppingcart\\ShoppingcartServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Gloudemans\\Shoppingcart\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Rob Gloudemans", - "email": "info@robgloudemans.nl", - "homepage": "http://robgloudemans.nl/" - }, - { - "name": "Patrick Henninger", - "email": "privat@skyraptor.eu", - "homepage": "https://skyraptor.eu/" - } - ], - "description": "Laravel Shoppingcart", - "keywords": [ - "laravel", - "shoppingcart" - ], - "support": { - "issues": "https://github.com/bumbummen99/LaravelShoppingcart/issues", - "source": "https://github.com/bumbummen99/LaravelShoppingcart/tree/4.2.0" - }, - "time": "2022-05-15T15:32:38+00:00" + "time": "2026-09-12T10:28:18+00:00" }, { "name": "carbonphp/carbon-doctrine-types", - "version": "1.0.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", - "reference": "3c430083d0b41ceed84ecccf9dac613241d7305d" + "reference": "5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/3c430083d0b41ceed84ecccf9dac613241d7305d", - "reference": "3c430083d0b41ceed84ecccf9dac613241d7305d", + "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc", + "reference": "5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc", "shasum": "" }, "require": { - "php": "^7.1.8 || ^8.0" + "php": "^8.1" }, "conflict": { - "doctrine/dbal": ">=3.7.0" + "doctrine/dbal": "<4.0.0 || >=5.0.0" }, "require-dev": { - "doctrine/dbal": ">=2.0.0", + "doctrine/dbal": "^4.0.0", "nesbot/carbon": "^2.71.0 || ^3.0.0", "phpunit/phpunit": "^10.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "autoload": { "psr-4": { "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" @@ -244,7 +188,7 @@ ], "support": { "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", - "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/1.0.0" + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.1" }, "funding": [ { @@ -260,35 +204,48 @@ "type": "tidelift" } ], - "time": "2023-10-01T12:35:29+00:00" + "time": "2026-09-06T14:11:38+00:00" }, { - "name": "clue/stream-filter", - "version": "v1.7.0", + "name": "composer/pcre", + "version": "3.4.0", "source": { "type": "git", - "url": "https://github.com/clue/stream-filter.git", - "reference": "049509fef80032cb3f051595029ab75b49a3c2f7" + "url": "https://github.com/composer/pcre.git", + "reference": "d5a341b3fb61f3001970940afb1d332968a183ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/clue/stream-filter/zipball/049509fef80032cb3f051595029ab75b49a3c2f7", - "reference": "049509fef80032cb3f051595029ab75b49a3c2f7", + "url": "https://api.github.com/repos/composer/pcre/zipball/d5a341b3fb61f3001970940afb1d332968a183ed", + "reference": "d5a341b3fb61f3001970940afb1d332968a183ed", "shasum": "" }, "require": { - "php": ">=5.3" + "php": "^7.4 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<2.2.2" }, "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + "phpstan/phpstan": "^2", + "phpstan/phpstan-deprecation-rules": "^2", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "^9" }, "type": "library", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { - "Clue\\StreamFilter\\": "src/" + "Composer\\Pcre\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -297,49 +254,46 @@ ], "authors": [ { - "name": "Christian Lück", - "email": "christian@clue.engineering" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "A simple and modern approach to stream filtering in PHP", - "homepage": "https://github.com/clue/stream-filter", + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", "keywords": [ - "bucket brigade", - "callback", - "filter", - "php_user_filter", - "stream", - "stream_filter_append", - "stream_filter_register" + "PCRE", + "preg", + "regex", + "regular expression" ], "support": { - "issues": "https://github.com/clue/stream-filter/issues", - "source": "https://github.com/clue/stream-filter/tree/v1.7.0" + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.4.0" }, "funding": [ { - "url": "https://clue.engineering/support", + "url": "https://packagist.com", "type": "custom" }, { - "url": "https://github.com/clue", + "url": "https://github.com/composer", "type": "github" } ], - "time": "2023-12-20T15:40:13+00:00" + "time": "2026-06-07T11:47:49+00:00" }, { "name": "composer/semver", - "version": "3.4.3", + "version": "3.5.1", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" + "reference": "528948210cc46f967a4b98e83b19e76f2b504993" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "url": "https://api.github.com/repos/composer/semver/zipball/528948210cc46f967a4b98e83b19e76f2b504993", + "reference": "528948210cc46f967a4b98e83b19e76f2b504993", "shasum": "" }, "require": { @@ -381,7 +335,7 @@ "homepage": "http://robbast.nl" } ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", + "description": "Version comparison library that offers utilities, version constraint parsing and validation.", "keywords": [ "semantic", "semver", @@ -391,7 +345,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.3" + "source": "https://github.com/composer/semver/tree/3.5.1" }, "funding": [ { @@ -401,41 +355,111 @@ { "url": "https://github.com/composer", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" } ], - "time": "2024-09-19T14:15:21+00:00" + "time": "2026-10-05T13:12:12+00:00" }, { - "name": "diglactic/laravel-breadcrumbs", - "version": "v6.1.1", + "name": "dflydev/dot-access-data", + "version": "v3.0.3", "source": { "type": "git", - "url": "https://github.com/diglactic/laravel-breadcrumbs.git", - "reference": "8f73674f9c5403625154768f8e123a620fc2d7a5" + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/diglactic/laravel-breadcrumbs/zipball/8f73674f9c5403625154768f8e123a620fc2d7a5", - "reference": "8f73674f9c5403625154768f8e123a620fc2d7a5", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/a23a2bf4f31d3518f3ecb38660c95715dfead60f", + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.42", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.3", + "scrutinizer/ocular": "1.6.0", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Dflydev\\DotAccessData\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + }, + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "support": { + "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues", + "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.3" + }, + "time": "2024-07-08T12:26:09+00:00" + }, + { + "name": "diglactic/laravel-breadcrumbs", + "version": "v10.1.0", + "source": { + "type": "git", + "url": "https://github.com/diglactic/laravel-breadcrumbs.git", + "reference": "64245821155ccfe721832898840408ee6136db31" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/diglactic/laravel-breadcrumbs/zipball/64245821155ccfe721832898840408ee6136db31", + "reference": "64245821155ccfe721832898840408ee6136db31", "shasum": "" }, "require": { "facade/ignition-contracts": "^1.0", - "laravel/framework": "^6.0 || ^7.0 || ^8.0", - "php": "^7.2 || ^8.0" + "laravel/framework": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "php": "^8.1" }, "conflict": { "davejamesmiller/laravel-breadcrumbs": "*" }, "require-dev": { - "orchestra/testbench": "^4.10 || ^5.9 || ^6.4", - "php-coveralls/php-coveralls": "^2.4", - "phpunit/phpunit": "^8.5 || ^9.4", - "spatie/phpunit-snapshot-assertions": "^2.2 || ^4.2" + "orchestra/testbench": "^8.0 || ^9.0 || ^10.0 || ^11.0", + "phpunit/phpunit": "^10.5 || ^11.5 || ^12.5", + "spatie/phpunit-snapshot-assertions": "^5.1" }, "type": "library", "extra": { @@ -449,9 +473,6 @@ } }, "autoload": { - "files": [ - "src/deprecated.php" - ], "psr-4": { "Diglactic\\Breadcrumbs\\": "src/" } @@ -479,39 +500,38 @@ ], "support": { "issues": "https://github.com/diglactic/laravel-breadcrumbs/issues", - "source": "https://github.com/diglactic/laravel-breadcrumbs/tree/v6.1.1" + "source": "https://github.com/diglactic/laravel-breadcrumbs/tree/v10.1.0" }, - "time": "2021-04-12T18:06:07+00:00" + "time": "2026-03-30T05:25:07+00:00" }, { "name": "doctrine/inflector", - "version": "2.0.10", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc" + "reference": "6d6c96277ea252fc1304627204c3d5e6e15faa3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/5817d0659c5b50c9b950feb9af7b9668e2c436bc", - "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/6d6c96277ea252fc1304627204c3d5e6e15faa3b", + "reference": "6d6c96277ea252fc1304627204c3d5e6e15faa3b", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^11.0", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.3", - "phpunit/phpunit": "^8.5 || ^9.5", - "vimeo/psalm": "^4.25 || ^5.4" + "doctrine/coding-standard": "^12.0 || ^13.0", + "phpstan/phpstan": "^1.12 || ^2.0", + "phpstan/phpstan-phpunit": "^1.4 || ^2.0", + "phpstan/phpstan-strict-rules": "^1.6 || ^2.0", + "phpunit/phpunit": "^8.5 || ^12.2" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" + "Doctrine\\Inflector\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -556,7 +576,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.10" + "source": "https://github.com/doctrine/inflector/tree/2.1.0" }, "funding": [ { @@ -572,35 +592,34 @@ "type": "tidelift" } ], - "time": "2024-02-18T20:23:39+00:00" + "time": "2025-08-10T19:31:58+00:00" }, { "name": "doctrine/lexer", - "version": "1.2.3", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" + "reference": "71d305eaa6480d3d3460c7d053d1da7749fa9cca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/71d305eaa6480d3d3460c7d053d1da7749fa9cca", + "reference": "71d305eaa6480d3d3460c7d053d1da7749fa9cca", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.11" + "doctrine/coding-standard": "^14", + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^10.5.58 || ^12.5.4" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + "Doctrine\\Common\\Lexer\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -632,7 +651,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.3" + "source": "https://github.com/doctrine/lexer/tree/3.0.3" }, "funding": [ { @@ -648,33 +667,32 @@ "type": "tidelift" } ], - "time": "2022-02-28T11:07:21+00:00" + "time": "2026-10-01T06:59:29+00:00" }, { "name": "dragonmantank/cron-expression", - "version": "v3.4.0", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "8c784d071debd117328803d86b2097615b457500" + "reference": "d61a8a9604ec1f8c3d150d09db6ce98b32675013" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/8c784d071debd117328803d86b2097615b457500", - "reference": "8c784d071debd117328803d86b2097615b457500", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/d61a8a9604ec1f8c3d150d09db6ce98b32675013", + "reference": "d61a8a9604ec1f8c3d150d09db6ce98b32675013", "shasum": "" }, "require": { - "php": "^7.2|^8.0", - "webmozart/assert": "^1.0" + "php": "^8.2|^8.3|^8.4|^8.5" }, "replace": { "mtdowling/cron-expression": "^1.0" }, "require-dev": { - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.0", - "phpunit/phpunit": "^7.0|^8.0|^9.0" + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.32|^2.1.31", + "phpunit/phpunit": "^8.5.48|^9.0" }, "type": "library", "extra": { @@ -705,7 +723,7 @@ ], "support": { "issues": "https://github.com/dragonmantank/cron-expression/issues", - "source": "https://github.com/dragonmantank/cron-expression/tree/v3.4.0" + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.6.0" }, "funding": [ { @@ -713,34 +731,31 @@ "type": "github" } ], - "time": "2024-10-09T13:47:03+00:00" + "time": "2025-10-31T18:51:33+00:00" }, { "name": "dxw/cidr", - "version": "v3.1.2", + "version": "v4.0.0", "source": { "type": "git", "url": "https://github.com/dxw/cidr.git", - "reference": "9cb82cb70f0d4a4a32b1b2e3e1ae005fba84d581" + "reference": "6c96a03163bdb513e6f3924bb1d48919bf510c6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dxw/cidr/zipball/9cb82cb70f0d4a4a32b1b2e3e1ae005fba84d581", - "reference": "9cb82cb70f0d4a4a32b1b2e3e1ae005fba84d581", + "url": "https://api.github.com/repos/dxw/cidr/zipball/6c96a03163bdb513e6f3924bb1d48919bf510c6a", + "reference": "6c96a03163bdb513e6f3924bb1d48919bf510c6a", "shasum": "" }, "require": { "dxw/result": "^1.0", - "php": "^7.2", - "phpseclib/phpseclib": "^2.0" + "php": "^8.1", + "phpseclib/phpseclib": "~3.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16", - "mockery/mockery": "^1.3", - "peridot-php/leo": "^1.6", - "peridot-php/peridot": "^1.19", - "peridot-php/peridot-dot-reporter": "^1.0", - "vimeo/psalm": "^4.7" + "dxw/php-cs-fixer-config": "^2.0", + "kahlan/kahlan": "^5.2", + "vimeo/psalm": "^5.26" }, "type": "library", "autoload": { @@ -763,33 +778,31 @@ "homepage": "https://github.com/dxw/cidr", "support": { "issues": "https://github.com/dxw/cidr/issues", - "source": "https://github.com/dxw/cidr/tree/v3.1.2" + "source": "https://github.com/dxw/cidr/tree/v4.0.0" }, - "time": "2021-04-13T15:13:30+00:00" + "time": "2026-09-30T09:40:52+00:00" }, { "name": "dxw/result", - "version": "v1.0.4", + "version": "v1.0.6", "source": { "type": "git", "url": "https://github.com/dxw/result.git", - "reference": "5b9d3988c215dc95e17cd082a33bc2c02b6007ca" + "reference": "d554bb10f0cf74056ccd26526688e194652eef79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dxw/result/zipball/5b9d3988c215dc95e17cd082a33bc2c02b6007ca", - "reference": "5b9d3988c215dc95e17cd082a33bc2c02b6007ca", + "url": "https://api.github.com/repos/dxw/result/zipball/d554bb10f0cf74056ccd26526688e194652eef79", + "reference": "d554bb10f0cf74056ccd26526688e194652eef79", "shasum": "" }, "require": { - "php": "^7.2" + "php": "^7.4||^8.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16", - "peridot-php/leo": "^1.6", - "peridot-php/peridot": "^1.19", - "peridot-php/peridot-dot-reporter": "^1.0", - "vimeo/psalm": "^3.2" + "dxw/php-cs-fixer-config": "^2.1", + "kahlan/kahlan": "^5.2", + "vimeo/psalm": "^4" }, "type": "library", "autoload": { @@ -812,33 +825,32 @@ "homepage": "https://github.com/dxw/result", "support": { "issues": "https://github.com/dxw/result/issues", - "source": "https://github.com/dxw/result/tree/master" + "source": "https://github.com/dxw/result/tree/v1.0.6" }, - "time": "2020-06-12T16:01:47+00:00" + "time": "2023-07-19T11:14:28+00:00" }, { "name": "egulias/email-validator", - "version": "2.1.25", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4" + "reference": "d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/0dbf5d78455d4d6a41d186da50adc1122ec066f4", - "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa", + "reference": "d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa", "shasum": "" }, "require": { - "doctrine/lexer": "^1.0.1", - "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.10" + "doctrine/lexer": "^2.0 || ^3.0", + "php": ">=8.1", + "symfony/polyfill-intl-idn": "^1.26" }, "require-dev": { - "dominicsayers/isemail": "^3.0.7", - "phpunit/phpunit": "^4.8.36|^7.5.15", - "satooshi/php-coveralls": "^1.0.1" + "phpunit/phpunit": "^10.2", + "vimeo/psalm": "^5.12" }, "suggest": { "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" @@ -846,7 +858,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { @@ -874,7 +886,7 @@ ], "support": { "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/2.1.25" + "source": "https://github.com/egulias/EmailValidator/tree/4.0.4" }, "funding": [ { @@ -882,24 +894,24 @@ "type": "github" } ], - "time": "2020-12-29T14:50:06+00:00" + "time": "2025-03-06T22:45:56+00:00" }, { "name": "ezyang/htmlpurifier", - "version": "v4.18.0", + "version": "v4.19.1", "source": { "type": "git", "url": "https://github.com/ezyang/htmlpurifier.git", - "reference": "cb56001e54359df7ae76dc522d08845dc741621b" + "reference": "5e0539132d934f936fbae2c88b55d58f9438623f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/cb56001e54359df7ae76dc522d08845dc741621b", - "reference": "cb56001e54359df7ae76dc522d08845dc741621b", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/5e0539132d934f936fbae2c88b55d58f9438623f", + "reference": "5e0539132d934f936fbae2c88b55d58f9438623f", "shasum": "" }, "require": { - "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" + "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0" }, "require-dev": { "cerdic/css-tidy": "^1.7 || ^2.0", @@ -941,9 +953,9 @@ ], "support": { "issues": "https://github.com/ezyang/htmlpurifier/issues", - "source": "https://github.com/ezyang/htmlpurifier/tree/v4.18.0" + "source": "https://github.com/ezyang/htmlpurifier/tree/v4.19.1" }, - "time": "2024-11-01T03:51:45+00:00" + "time": "2026-09-15T15:42:51+00:00" }, { "name": "facade/ignition-contracts", @@ -999,98 +1011,32 @@ "time": "2020-10-16T08:27:54+00:00" }, { - "name": "fideloper/proxy", - "version": "4.4.2", + "name": "fruitcake/php-cors", + "version": "v1.4.0", "source": { "type": "git", - "url": "https://github.com/fideloper/TrustedProxy.git", - "reference": "a751f2bc86dd8e6cfef12dc0cbdada82f5a18750" + "url": "https://github.com/fruitcake/php-cors.git", + "reference": "38aaa6c3fd4c157ffe2a4d10aa8b9b16ba8de379" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/a751f2bc86dd8e6cfef12dc0cbdada82f5a18750", - "reference": "a751f2bc86dd8e6cfef12dc0cbdada82f5a18750", + "url": "https://api.github.com/repos/fruitcake/php-cors/zipball/38aaa6c3fd4c157ffe2a4d10aa8b9b16ba8de379", + "reference": "38aaa6c3fd4c157ffe2a4d10aa8b9b16ba8de379", "shasum": "" }, "require": { - "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0|^9.0", - "php": ">=5.4.0" + "php": "^8.1", + "symfony/http-foundation": "^5.4|^6.4|^7.3|^8" }, "require-dev": { - "illuminate/http": "^5.0|^6.0|^7.0|^8.0|^9.0", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^8.5.8|^9.3.3" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Fideloper\\Proxy\\TrustedProxyServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Fideloper\\Proxy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Chris Fidao", - "email": "fideloper@gmail.com" - } - ], - "description": "Set trusted proxies for Laravel", - "keywords": [ - "load balancing", - "proxy", - "trusted proxy" - ], - "support": { - "issues": "https://github.com/fideloper/TrustedProxy/issues", - "source": "https://github.com/fideloper/TrustedProxy/tree/4.4.2" - }, - "time": "2022-02-09T13:33:34+00:00" - }, - { - "name": "fruitcake/laravel-cors", - "version": "v2.2.0", - "source": { - "type": "git", - "url": "https://github.com/fruitcake/laravel-cors.git", - "reference": "783a74f5e3431d7b9805be8afb60fd0a8f743534" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fruitcake/laravel-cors/zipball/783a74f5e3431d7b9805be8afb60fd0a8f743534", - "reference": "783a74f5e3431d7b9805be8afb60fd0a8f743534", - "shasum": "" - }, - "require": { - "asm89/stack-cors": "^2.0.1", - "illuminate/contracts": "^6|^7|^8|^9", - "illuminate/support": "^6|^7|^8|^9", - "php": ">=7.2" - }, - "require-dev": { - "laravel/framework": "^6|^7.24|^8", - "orchestra/testbench-dusk": "^4|^5|^6|^7", - "phpunit/phpunit": "^6|^7|^8|^9", - "squizlabs/php_codesniffer": "^3.5" + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^9", + "squizlabs/php_codesniffer": "^4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" - }, - "laravel": { - "providers": [ - "Fruitcake\\Cors\\CorsServiceProvider" - ] + "dev-master": "1.3-dev" } }, "autoload": { @@ -1108,20 +1054,20 @@ "homepage": "https://fruitcake.nl" }, { - "name": "Barry vd. Heuvel", + "name": "Barryvdh", "email": "barryvdh@gmail.com" } ], - "description": "Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application", + "description": "Cross-origin resource sharing library for the Symfony HttpFoundation", + "homepage": "https://github.com/fruitcake/php-cors", "keywords": [ - "api", "cors", - "crossdomain", - "laravel" + "laravel", + "symfony" ], "support": { - "issues": "https://github.com/fruitcake/laravel-cors/issues", - "source": "https://github.com/fruitcake/laravel-cors/tree/v2.2.0" + "issues": "https://github.com/fruitcake/php-cors/issues", + "source": "https://github.com/fruitcake/php-cors/tree/v1.4.0" }, "funding": [ { @@ -1133,29 +1079,106 @@ "type": "github" } ], - "abandoned": true, - "time": "2022-02-23T14:25:13+00:00" + "time": "2025-12-03T09:33:47+00:00" }, { - "name": "graham-campbell/result-type", - "version": "v1.1.3", + "name": "giggsey/libphonenumber-for-php-lite", + "version": "9.0.41", "source": { "type": "git", - "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "3ba905c11371512af9d9bdd27d99b782216b6945" + "url": "https://github.com/giggsey/libphonenumber-for-php-lite.git", + "reference": "6ffb41a259c950d6f4df5596e32917f631052910" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/3ba905c11371512af9d9bdd27d99b782216b6945", - "reference": "3ba905c11371512af9d9bdd27d99b782216b6945", + "url": "https://api.github.com/repos/giggsey/libphonenumber-for-php-lite/zipball/6ffb41a259c950d6f4df5596e32917f631052910", + "reference": "6ffb41a259c950d6f4df5596e32917f631052910", + "shasum": "" + }, + "require": { + "php": "^8.1", + "symfony/polyfill-mbstring": "^1.17" + }, + "conflict": { + "giggsey/libphonenumber-for-php": "*" + }, + "require-dev": { + "ext-dom": "*", + "friendsofphp/php-cs-fixer": "^3.71", + "infection/infection": "^0.29|^0.31.0", + "nette/php-generator": "^4.1", + "php-coveralls/php-coveralls": "^2.7", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.1.7", + "phpstan/phpstan-deprecation-rules": "^2.0.1", + "phpstan/phpstan-phpunit": "^2.0.4", + "phpstan/phpstan-strict-rules": "^2.0.3", + "phpunit/phpunit": "^10.5.45", + "symfony/console": "^6.4", + "symfony/filesystem": "^6.4", + "symfony/process": "^6.4" + }, + "suggest": { + "giggsey/libphonenumber-for-php": "Use libphonenumber-for-php for geocoding, carriers, timezones and matching" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.x-dev" + } + }, + "autoload": { + "psr-4": { + "libphonenumber\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Joshua Gigg", + "email": "giggsey@gmail.com", + "homepage": "https://giggsey.com/" + } + ], + "description": "A lite version of giggsey/libphonenumber-for-php, which is a PHP Port of Google's libphonenumber", + "homepage": "https://github.com/giggsey/libphonenumber-for-php-lite", + "keywords": [ + "geocoding", + "geolocation", + "libphonenumber", + "mobile", + "phonenumber", + "validation" + ], + "support": { + "issues": "https://github.com/giggsey/libphonenumber-for-php-lite/issues", + "source": "https://github.com/giggsey/libphonenumber-for-php-lite" + }, + "time": "2026-10-08T08:51:54+00:00" + }, + { + "name": "graham-campbell/result-type", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "adccca3324eece92ca35463648c12b9e6293c05b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/adccca3324eece92ca35463648c12b9e6293c05b", + "reference": "adccca3324eece92ca35463648c12b9e6293c05b", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9.3" + "phpoption/phpoption": "^1.10" }, "require-dev": { - "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" + "phpunit/phpunit": "^8.5.52 || ^9.6.34 || ^10.5.63 || ^11.5.55 || ^12.5.14" }, "type": "library", "autoload": { @@ -1184,7 +1207,7 @@ ], "support": { "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.3" + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.2.0" }, "funding": [ { @@ -1196,29 +1219,30 @@ "type": "tidelift" } ], - "time": "2024-07-20T21:45:45+00:00" + "time": "2026-08-24T09:06:52+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "7.8.2", + "version": "7.15.5", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "f4152d9eb85c445fe1f992001d1748e8bec070d2" + "reference": "ee80339fd9177ba44c49cdb653ff02a4d1106b9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4152d9eb85c445fe1f992001d1748e8bec070d2", - "reference": "f4152d9eb85c445fe1f992001d1748e8bec070d2", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee80339fd9177ba44c49cdb653ff02a4d1106b9a", + "reference": "ee80339fd9177ba44c49cdb653ff02a4d1106b9a", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0.3", - "guzzlehttp/psr7": "^1.9.1 || ^2.6.3", + "guzzlehttp/promises": "^2.5.3", + "guzzlehttp/psr7": "^2.13.1", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", - "symfony/deprecation-contracts": "^2.2 || ^3.0" + "symfony/deprecation-contracts": "^2.5 || ^3.0", + "symfony/polyfill-php80": "^1.25" }, "provide": { "psr/http-client-implementation": "1.0" @@ -1226,9 +1250,10 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", - "guzzle/client-integration-tests": "3.0.2", + "guzzle/client-integration-tests": "3.0.3", + "guzzlehttp/test-server": "^0.7", "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "phpunit/phpunit": "^8.5.52 || ^9.6.34", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -1306,7 +1331,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.8.2" + "source": "https://github.com/guzzle/guzzle/tree/7.15.5" }, "funding": [ { @@ -1322,28 +1347,29 @@ "type": "tidelift" } ], - "time": "2024-07-18T11:12:18+00:00" + "time": "2026-08-24T09:21:06+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.4", + "version": "2.5.3", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" + "reference": "cde49999552d185d64715fe9c1f77a2aadd2f9f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", - "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "url": "https://api.github.com/repos/guzzle/promises/zipball/cde49999552d185d64715fe9c1f77a2aadd2f9f1", + "reference": "cde49999552d185d64715fe9c1f77a2aadd2f9f1", "shasum": "" }, "require": { - "php": "^7.2.5 || ^8.0" + "php": "^7.2.5 || ^8.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.39 || ^9.6.20" + "phpunit/phpunit": "^8.5.52 || ^9.6.34" }, "type": "library", "extra": { @@ -1389,7 +1415,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.4" + "source": "https://github.com/guzzle/promises/tree/2.5.3" }, "funding": [ { @@ -1405,42 +1431,51 @@ "type": "tidelift" } ], - "time": "2024-10-17T10:06:22+00:00" + "time": "2026-08-24T09:11:28+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.9.1", + "version": "2.13.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b" + "reference": "95e7828100de18b4e269fb1703be530082d5166d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", - "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/95e7828100de18b4e269fb1703be530082d5166d", + "reference": "95e7828100de18b4e269fb1703be530082d5166d", "shasum": "" }, "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0", + "symfony/polyfill-php80": "^1.25" }, "provide": { + "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "1.1.0", + "jshttp/mime-db": "1.54.0.1", + "phpunit/phpunit": "^8.5.52 || ^9.6.34" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\Psr7\\": "src/" } @@ -1479,6 +1514,11 @@ "name": "Tobias Schultze", "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" } ], "description": "PSR-7 message implementation that also provides common utility methods", @@ -1494,7 +1534,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.9.1" + "source": "https://github.com/guzzle/psr7/tree/2.13.1" }, "funding": [ { @@ -1510,111 +1550,41 @@ "type": "tidelift" } ], - "time": "2023-04-17T16:00:37+00:00" + "time": "2026-08-24T09:13:11+00:00" }, { - "name": "http-interop/http-factory-guzzle", - "version": "1.2.0", + "name": "guzzlehttp/uri-template", + "version": "v2.0.1", "source": { "type": "git", - "url": "https://github.com/http-interop/http-factory-guzzle.git", - "reference": "8f06e92b95405216b237521cc64c804dd44c4a81" + "url": "https://github.com/guzzle/uri-template.git", + "reference": "7a466ad606491eb6528c717482f7cca77f1851f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/http-interop/http-factory-guzzle/zipball/8f06e92b95405216b237521cc64c804dd44c4a81", - "reference": "8f06e92b95405216b237521cc64c804dd44c4a81", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/7a466ad606491eb6528c717482f7cca77f1851f3", + "reference": "7a466ad606491eb6528c717482f7cca77f1851f3", "shasum": "" }, "require": { - "guzzlehttp/psr7": "^1.7||^2.0", - "php": ">=7.3", - "psr/http-factory": "^1.0" - }, - "provide": { - "psr/http-factory-implementation": "^1.0" + "php": "^7.4 || ^8.0", + "symfony/polyfill-php80": "^1.25" }, "require-dev": { - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^9.5" - }, - "suggest": { - "guzzlehttp/psr7": "Includes an HTTP factory starting in version 2.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Http\\Factory\\Guzzle\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "An HTTP Factory using Guzzle PSR7", - "keywords": [ - "factory", - "http", - "psr-17", - "psr-7" - ], - "support": { - "issues": "https://github.com/http-interop/http-factory-guzzle/issues", - "source": "https://github.com/http-interop/http-factory-guzzle/tree/1.2.0" - }, - "time": "2021-07-21T13:50:14+00:00" - }, - { - "name": "intervention/image", - "version": "2.7.2", - "source": { - "type": "git", - "url": "https://github.com/Intervention/image.git", - "reference": "04be355f8d6734c826045d02a1079ad658322dad" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Intervention/image/zipball/04be355f8d6734c826045d02a1079ad658322dad", - "reference": "04be355f8d6734c826045d02a1079ad658322dad", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "guzzlehttp/psr7": "~1.1 || ^2.0", - "php": ">=5.4.0" - }, - "require-dev": { - "mockery/mockery": "~0.9.2", - "phpunit/phpunit": "^4.8 || ^5.7 || ^7.5.15" - }, - "suggest": { - "ext-gd": "to use GD library based image processing.", - "ext-imagick": "to use Imagick based image processing.", - "intervention/imagecache": "Caching extension for the Intervention Image library" + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^9.6.34", + "uri-template/tests": "1.0.2" }, "type": "library", "extra": { - "laravel": { - "aliases": { - "Image": "Intervention\\Image\\Facades\\Image" - }, - "providers": [ - "Intervention\\Image\\ImageServiceProvider" - ] - }, - "branch-alias": { - "dev-master": "2.4-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { "psr-4": { - "Intervention\\Image\\": "src/Intervention/Image" + "GuzzleHttp\\UriTemplate\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1623,61 +1593,76 @@ ], "authors": [ { - "name": "Oliver Vogel", - "email": "oliver@intervention.io", - "homepage": "https://intervention.io/" + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" } ], - "description": "Image handling and manipulation library with support for Laravel integration", - "homepage": "http://image.intervention.io/", + "description": "A polyfill class for uri_template of PHP", "keywords": [ - "gd", - "image", - "imagick", - "laravel", - "thumbnail", - "watermark" + "guzzlehttp", + "uri-template" ], "support": { - "issues": "https://github.com/Intervention/image/issues", - "source": "https://github.com/Intervention/image/tree/2.7.2" + "issues": "https://github.com/guzzle/uri-template/issues", + "source": "https://github.com/guzzle/uri-template/tree/v2.0.1" }, "funding": [ { - "url": "https://paypal.me/interventionio", - "type": "custom" + "url": "https://github.com/GrahamCampbell", + "type": "github" }, { - "url": "https://github.com/Intervention", + "url": "https://github.com/Nyholm", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/uri-template", + "type": "tidelift" } ], - "time": "2022-05-21T17:30:32+00:00" + "time": "2026-08-24T17:13:02+00:00" }, { "name": "jean85/pretty-package-versions", - "version": "2.0.6", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4" + "reference": "4d7aa5dab42e2a76d99559706022885de0e18e1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/f9fdd29ad8e6d024f52678b570e5593759b550b4", - "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/4d7aa5dab42e2a76d99559706022885de0e18e1a", + "reference": "4d7aa5dab42e2a76d99559706022885de0e18e1a", "shasum": "" }, "require": { - "composer-runtime-api": "^2.0.0", - "php": "^7.1|^8.0" + "composer-runtime-api": "^2.1.0", + "php": "^7.4|^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "jean85/composer-provided-replaced-stub-package": "^1.0", - "phpstan/phpstan": "^1.4", - "phpunit/phpunit": "^7.5|^8.5|^9.4", - "vimeo/psalm": "^4.3" + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^7.5|^8.5|^9.6", + "rector/rector": "^2.0", + "vimeo/psalm": "^4.3 || ^5.0" }, "type": "library", "extra": { @@ -1709,45 +1694,37 @@ ], "support": { "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.6" + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.1.1" }, - "time": "2024-03-08T09:58:59+00:00" + "time": "2025-03-19T14:43:43+00:00" }, { - "name": "kwaadpepper/enum", - "version": "2.1.3", + "name": "kwaadpepper/serial-int-caster", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/Kwaadpepper/enum.git", - "reference": "cc695e6a07ee57a1220942581c303842e186b22f" + "url": "https://github.com/Kwaadpepper/serial-int-caster.git", + "reference": "d912cd98df22109bbfde2a7b9d03e50f5cf7e697" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Kwaadpepper/enum/zipball/cc695e6a07ee57a1220942581c303842e186b22f", - "reference": "cc695e6a07ee57a1220942581c303842e186b22f", + "url": "https://api.github.com/repos/Kwaadpepper/serial-int-caster/zipball/d912cd98df22109bbfde2a7b9d03e50f5cf7e697", + "reference": "d912cd98df22109bbfde2a7b9d03e50f5cf7e697", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=7.3.0", + "ruafozy/mersenne-twister": "^2.0" }, "require-dev": { - "orchestra/testbench": "^6", - "phpunit/php-code-coverage": "^9", - "phpunit/phpunit": "~9", - "slevomat/coding-standard": "^7", - "squizlabs/php_codesniffer": "^3" + "phpunit/phpunit": "^9.5", + "slevomat/coding-standard": "^8.6", + "squizlabs/php_codesniffer": "^3.6" }, "type": "library", - "extra": { - "laravel": { - "providers": [ - "Kwaadpepper\\Enum\\EnumServiceProvider" - ] - } - }, "autoload": { "psr-4": { - "Kwaadpepper\\Enum\\": "src/" + "Kwaadpepper\\Serial\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1757,74 +1734,88 @@ "authors": [ { "name": "Jérémy Munsch", - "email": "github@jeremydev.ovh", - "homepage": "https://jeremydev.ovh" + "email": "github@jeremydev.ovh" } ], - "description": "Enums to use for any project", - "homepage": "https://github.com/kwaadpepper/enum", - "keywords": [ - "enum", - "laravel" - ], + "description": "Convert int To as serial number and reverse", "support": { - "issues": "https://github.com/Kwaadpepper/enum/issues", - "source": "https://github.com/Kwaadpepper/enum/tree/2.1.3" + "issues": "https://github.com/Kwaadpepper/serial-int-caster/issues", + "source": "https://github.com/Kwaadpepper/serial-int-caster/tree/2.0.0" }, - "time": "2022-07-28T15:18:54+00:00" + "time": "2025-08-02T16:04:53+00:00" }, { "name": "laravel/framework", - "version": "v8.83.29", + "version": "v13.35.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "d841a226a50c715431952a10260ba4fac9e91cc4" + "reference": "a413a9da94884e5e9d58f4e6612884f712827804" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/d841a226a50c715431952a10260ba4fac9e91cc4", - "reference": "d841a226a50c715431952a10260ba4fac9e91cc4", + "url": "https://api.github.com/repos/laravel/framework/zipball/a413a9da94884e5e9d58f4e6612884f712827804", + "reference": "a413a9da94884e5e9d58f4e6612884f712827804", "shasum": "" }, "require": { - "doctrine/inflector": "^1.4|^2.0", - "dragonmantank/cron-expression": "^3.0.2", - "egulias/email-validator": "^2.1.10", - "ext-json": "*", + "brick/math": "^0.14.2 || ^0.15 || ^0.16 || ^0.17 || ^0.18 || ^0.19 || ^0.20 || ^1.0", + "composer-runtime-api": "^2.2", + "doctrine/inflector": "^2.0.5", + "dragonmantank/cron-expression": "^3.4", + "egulias/email-validator": "^4.0", + "ext-ctype": "*", + "ext-filter": "*", + "ext-hash": "*", "ext-mbstring": "*", "ext-openssl": "*", - "laravel/serializable-closure": "^1.0", - "league/commonmark": "^1.3|^2.0.2", - "league/flysystem": "^1.1", - "monolog/monolog": "^2.0", - "nesbot/carbon": "^2.53.1", - "opis/closure": "^3.6", - "php": "^7.3|^8.0", - "psr/container": "^1.0", - "psr/log": "^1.0|^2.0", - "psr/simple-cache": "^1.0", - "ramsey/uuid": "^4.2.2", - "swiftmailer/swiftmailer": "^6.3", - "symfony/console": "^5.4", - "symfony/error-handler": "^5.4", - "symfony/finder": "^5.4", - "symfony/http-foundation": "^5.4", - "symfony/http-kernel": "^5.4", - "symfony/mime": "^5.4", - "symfony/process": "^5.4", - "symfony/routing": "^5.4", - "symfony/var-dumper": "^5.4", - "tijsverkoyen/css-to-inline-styles": "^2.2.2", - "vlucas/phpdotenv": "^5.4.1", - "voku/portable-ascii": "^1.6.1" + "ext-session": "*", + "ext-tokenizer": "*", + "fruitcake/php-cors": "^1.3", + "guzzlehttp/guzzle": "^7.8.2 || ^8.0", + "guzzlehttp/promises": "^2.0.3 || ^3.0", + "guzzlehttp/psr7": "^2.9 || ^3.0", + "guzzlehttp/uri-template": "^1.0 || ^2.0", + "laravel/prompts": "^0.3.11", + "laravel/serializable-closure": "^2.0.10", + "league/commonmark": "^2.8.1", + "league/flysystem": "^3.25.1", + "league/flysystem-local": "^3.25.1", + "league/uri": "^7.5.1", + "monolog/monolog": "^3.10", + "nesbot/carbon": "^3.8.4", + "nunomaduro/termwind": "^2.0", + "php": "^8.3", + "psr/container": "^1.1.1 || ^2.0.1", + "psr/http-message": "^1.0 || ^2.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0", + "ramsey/uuid": "^4.7", + "symfony/console": "^7.4.0 || ^8.0.0", + "symfony/error-handler": "^7.4.0 || ^8.0.0", + "symfony/finder": "^7.4.0 || ^8.0.0", + "symfony/http-foundation": "^7.4.0 || ^8.0.0", + "symfony/http-kernel": "^7.4.0 || ^8.0.0", + "symfony/mailer": "^7.4.0 || ^8.0.0", + "symfony/mime": "^7.4.0 || ^8.0.0", + "symfony/polyfill-php84": "^1.36", + "symfony/polyfill-php85": "^1.36", + "symfony/polyfill-php86": "^1.36", + "symfony/process": "^7.4.5 || ^8.0.5", + "symfony/routing": "^7.4.0 || ^8.0.0", + "symfony/uid": "^7.4.0 || ^8.0.0", + "symfony/var-dumper": "^7.4.0 || ^8.0.0", + "tijsverkoyen/css-to-inline-styles": "^2.2.5", + "vlucas/phpdotenv": "^5.6.1", + "voku/portable-ascii": "^2.0.2" }, "conflict": { "tightenco/collect": "<5.5.33" }, "provide": { - "psr/container-implementation": "1.0", - "psr/simple-cache-implementation": "1.0" + "psr/container-implementation": "1.1 || 2.0", + "psr/log-implementation": "1.0 || 2.0 || 3.0", + "psr/simple-cache-implementation": "1.0 || 2.0 || 3.0" }, "replace": { "illuminate/auth": "self.version", @@ -1832,6 +1823,8 @@ "illuminate/bus": "self.version", "illuminate/cache": "self.version", "illuminate/collections": "self.version", + "illuminate/concurrency": "self.version", + "illuminate/conditionable": "self.version", "illuminate/config": "self.version", "illuminate/console": "self.version", "illuminate/container": "self.version", @@ -1843,84 +1836,120 @@ "illuminate/filesystem": "self.version", "illuminate/hashing": "self.version", "illuminate/http": "self.version", + "illuminate/image": "self.version", + "illuminate/json-schema": "self.version", "illuminate/log": "self.version", "illuminate/macroable": "self.version", "illuminate/mail": "self.version", "illuminate/notifications": "self.version", "illuminate/pagination": "self.version", "illuminate/pipeline": "self.version", + "illuminate/process": "self.version", "illuminate/queue": "self.version", "illuminate/redis": "self.version", + "illuminate/reflection": "self.version", "illuminate/routing": "self.version", "illuminate/session": "self.version", "illuminate/support": "self.version", "illuminate/testing": "self.version", "illuminate/translation": "self.version", "illuminate/validation": "self.version", - "illuminate/view": "self.version" + "illuminate/view": "self.version", + "spatie/once": "*" }, "require-dev": { - "aws/aws-sdk-php": "^3.198.1", - "doctrine/dbal": "^2.13.3|^3.1.4", - "filp/whoops": "^2.14.3", - "guzzlehttp/guzzle": "^6.5.5|^7.0.1", - "league/flysystem-cached-adapter": "^1.0", - "mockery/mockery": "^1.4.4", - "orchestra/testbench-core": "^6.27", - "pda/pheanstalk": "^4.0", - "phpunit/phpunit": "^8.5.19|^9.5.8", - "predis/predis": "^1.1.9", - "symfony/cache": "^5.4" + "ably/ably-php": "^1.0", + "aws/aws-sdk-php": "^3.322.9", + "ext-gmp": "*", + "fakerphp/faker": "^1.24", + "intervention/image": "^4.0", + "laravel/pint": "^1.18", + "league/flysystem-aws-s3-v3": "^3.25.1", + "league/flysystem-ftp": "^3.25.1", + "league/flysystem-path-prefixing": "^3.25.1", + "league/flysystem-read-only": "^3.25.1", + "league/flysystem-sftp-v3": "^3.25.1", + "mockery/mockery": "^1.6.10", + "opis/json-schema": "^2.4.1", + "orchestra/testbench-core": "^11.5.0", + "pda/pheanstalk": "^7.0.0 || ^8.0.0", + "php-http/discovery": "^1.15", + "phpstan/phpstan": "2.2.15", + "phpunit/phpunit": "^11.5.50 || ^12.5.8 || ^13.0.3", + "predis/predis": "^2.3 || ^3.0", + "rector/rector": "2.6.3", + "resend/resend-php": "^1.0", + "symfony/cache": "^7.4.0 || ^8.0.0", + "symfony/http-client": "^7.4.0 || ^8.0.0", + "symfony/mercure": "^0.8.0", + "symfony/psr-http-message-bridge": "^7.4.0 || ^8.0.0", + "symfony/translation": "^7.4.0 || ^8.0.0", + "web-token/jwt-library": "^4.1" }, "suggest": { "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", - "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.198.1).", - "brianium/paratest": "Required to run tests in parallel (^6.0).", - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).", - "ext-bcmath": "Required to use the multiple_of validation rule.", + "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.322.9).", + "brianium/paratest": "Required to run tests in parallel (^7.0 || ^8.0).", + "ext-apcu": "Required to use the APC cache driver.", + "ext-fileinfo": "Required to use the Filesystem class.", "ext-ftp": "Required to use the Flysystem FTP driver.", "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", "ext-memcached": "Required to use the memcache cache driver.", - "ext-pcntl": "Required to use all features of the queue worker.", + "ext-pcntl": "Required to use all features of the queue worker and console signal trapping.", + "ext-pdo": "Required to use all database features.", "ext-posix": "Required to use all features of the queue worker.", - "ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0).", - "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", + "ext-redis": "Required to use the Redis cache and queue drivers (^4.0 || ^5.0 || ^6.0).", + "fakerphp/faker": "Required to generate fake data using the fake() helper (^1.23).", "filp/whoops": "Required for friendly error pages in development (^2.14.3).", - "guzzlehttp/guzzle": "Required to use the HTTP Client, Mailgun mail driver and the ping methods on schedules (^6.5.5|^7.0.1).", + "intervention/image": "Required to use the image processing features (^4.0).", "laravel/tinker": "Required to use the tinker console command (^2.0).", - "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", - "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", - "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", - "mockery/mockery": "Required to use mocking (^1.4.4).", - "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", - "pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).", - "phpunit/phpunit": "Required to use assertions and run tests (^8.5.19|^9.5.8).", - "predis/predis": "Required to use the predis connector (^1.1.9).", - "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0|^5.0|^6.0|^7.0).", - "symfony/cache": "Required to PSR-6 cache bridge (^5.4).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^5.4).", - "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0).", - "wildbit/swiftmailer-postmark": "Required to use Postmark mail driver (^3.0)." + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.25.1).", + "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.25.1).", + "league/flysystem-path-prefixing": "Required to use the scoped driver (^3.25.1).", + "league/flysystem-read-only": "Required to use read-only disks (^3.25.1)", + "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.25.1).", + "mockery/mockery": "Required to use mocking (^1.6).", + "pda/pheanstalk": "Required to use the beanstalk queue driver (^7.0 || ^8.0).", + "php-http/discovery": "Required to use PSR-7 bridging features (^1.15).", + "phpunit/phpunit": "Required to use assertions and run tests (^11.5.50 || ^12.5.8 || ^13.0.3).", + "predis/predis": "Required to use the predis connector (^2.3 || ^3.0).", + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0 || ^7.0).", + "resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0 || ^1.0).", + "spatie/fork": "Required to use the 'fork' concurrency driver (^1.2).", + "symfony/cache": "Required to PSR-6 cache bridge (^7.4 || ^8.0).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^7.4 || ^8.0).", + "symfony/http-client": "Required to enable support for the Symfony API mail transports (^7.4 || ^8.0).", + "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^7.4 || ^8.0).", + "symfony/mercure": "Required to use the Mercure broadcast driver (^0.8).", + "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^7.4 || ^8.0).", + "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^7.4 || ^8.0).", + "web-token/jwt-library": "Required to sign Mercure JWTs and use end-to-end encrypted channels (^4.1)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "13.0.x-dev" } }, "autoload": { "files": [ + "src/Illuminate/Collections/functions.php", "src/Illuminate/Collections/helpers.php", "src/Illuminate/Events/functions.php", + "src/Illuminate/Filesystem/functions.php", "src/Illuminate/Foundation/helpers.php", + "src/Illuminate/Log/functions.php", + "src/Illuminate/Reflection/helpers.php", + "src/Illuminate/Support/functions.php", "src/Illuminate/Support/helpers.php" ], "psr-4": { "Illuminate\\": "src/Illuminate/", "Illuminate\\Support\\": [ "src/Illuminate/Macroable/", - "src/Illuminate/Collections/" + "src/Illuminate/Collections/", + "src/Illuminate/Conditionable/", + "src/Illuminate/Reflection/" ] } }, @@ -1944,36 +1973,94 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-11-20T15:55:41+00:00" + "time": "2026-10-06T13:52:37+00:00" }, { - "name": "laravel/serializable-closure", - "version": "v1.3.7", + "name": "laravel/prompts", + "version": "v0.3.25", "source": { "type": "git", - "url": "https://github.com/laravel/serializable-closure.git", - "reference": "4f48ade902b94323ca3be7646db16209ec76be3d" + "url": "https://github.com/laravel/prompts.git", + "reference": "21b7b49d60fcb700016dd27b582ae739c75de816" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/4f48ade902b94323ca3be7646db16209ec76be3d", - "reference": "4f48ade902b94323ca3be7646db16209ec76be3d", + "url": "https://api.github.com/repos/laravel/prompts/zipball/21b7b49d60fcb700016dd27b582ae739c75de816", + "reference": "21b7b49d60fcb700016dd27b582ae739c75de816", "shasum": "" }, "require": { - "php": "^7.3|^8.0" + "composer-runtime-api": "^2.2", + "ext-mbstring": "*", + "php": "^8.1", + "symfony/console": "^6.2|^7.0|^8.0" + }, + "conflict": { + "illuminate/console": ">=10.17.0 <10.25.0", + "laravel/framework": ">=10.17.0 <10.25.0" }, "require-dev": { - "illuminate/support": "^8.0|^9.0|^10.0|^11.0", - "nesbot/carbon": "^2.61|^3.0", - "pestphp/pest": "^1.21.3", - "phpstan/phpstan": "^1.8.2", - "symfony/var-dumper": "^5.4.11|^6.2.0|^7.0.0" + "illuminate/collections": "^10.0|^11.0|^12.0|^13.0", + "mockery/mockery": "^1.5", + "pestphp/pest": "^2.3|^3.4|^4.0", + "phpstan/phpstan": "^1.12.28", + "phpstan/phpstan-mockery": "^1.1.3" + }, + "suggest": { + "ext-pcntl": "Required for the spinner to be animated." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "0.3.x-dev" + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Laravel\\Prompts\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Add beautiful and user-friendly forms to your command-line applications.", + "support": { + "source": "https://github.com/laravel/prompts/tree/v0.3.25" + }, + "time": "2026-10-06T02:25:49+00:00" + }, + { + "name": "laravel/serializable-closure", + "version": "v2.1.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/serializable-closure.git", + "reference": "2d5869a838bbcf37e0d8b0568fc41914e81374b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/2d5869a838bbcf37e0d8b0568fc41914e81374b5", + "reference": "2d5869a838bbcf37e0d8b0568fc41914e81374b5", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "illuminate/support": "^10.0|^11.0|^12.0|^13.0", + "nesbot/carbon": "^2.67|^3.0", + "pestphp/pest": "^2.36|^3.0|^4.0", + "phpstan/phpstan": "^2.0", + "symfony/var-dumper": "^6.2.0|^7.0.0|^8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" } }, "autoload": { @@ -2005,37 +2092,37 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2024-11-14T18:34:49+00:00" + "time": "2026-09-22T14:32:34+00:00" }, { "name": "laravel/tinker", - "version": "v2.10.1", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/laravel/tinker.git", - "reference": "22177cc71807d38f2810c6204d8f7183d88a57d3" + "reference": "4faba77764bd33411735936acdf30446d058c78b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/tinker/zipball/22177cc71807d38f2810c6204d8f7183d88a57d3", - "reference": "22177cc71807d38f2810c6204d8f7183d88a57d3", + "url": "https://api.github.com/repos/laravel/tinker/zipball/4faba77764bd33411735936acdf30446d058c78b", + "reference": "4faba77764bd33411735936acdf30446d058c78b", "shasum": "" }, "require": { - "illuminate/console": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0", - "illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0", - "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0", - "php": "^7.2.5|^8.0", - "psy/psysh": "^0.11.1|^0.12.0", - "symfony/var-dumper": "^4.3.4|^5.0|^6.0|^7.0" + "illuminate/console": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0", + "illuminate/contracts": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0", + "illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0", + "php": "^8.1", + "psy/psysh": "^0.12.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0|^8.0" }, "require-dev": { "mockery/mockery": "~1.3.3|^1.4.2", "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^8.5.8|^9.3.3|^10.0" + "phpunit/phpunit": "^10.5|^11.5" }, "suggest": { - "illuminate/database": "The Illuminate Database package (^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0)." + "illuminate/database": "The Illuminate Database package (^8.0|^9.0|^10.0|^11.0|^12.0|^13.0)." }, "type": "library", "extra": { @@ -2043,6 +2130,9 @@ "providers": [ "Laravel\\Tinker\\TinkerServiceProvider" ] + }, + "branch-alias": { + "dev-master": "3.x-dev" } }, "autoload": { @@ -2069,35 +2159,98 @@ ], "support": { "issues": "https://github.com/laravel/tinker/issues", - "source": "https://github.com/laravel/tinker/tree/v2.10.1" + "source": "https://github.com/laravel/tinker/tree/v3.0.2" }, - "time": "2025-01-27T14:24:01+00:00" + "time": "2026-03-17T14:54:13+00:00" }, { - "name": "ldc/ldccrmv2client", - "version": "3.0.6", + "name": "laravel/ui", + "version": "v4.6.3", "source": { "type": "git", - "url": "git@lab.s-web.fr:ldc-web/projets/crm-client.git", - "reference": "b08177cbd4f1142e6878dc0b1a4bb445e332849f" + "url": "https://github.com/laravel/ui.git", + "reference": "ff27db15416c1ed8ad9848f5692e47595dd5de27" }, "dist": { "type": "zip", - "url": "https://lab.s-web.fr/api/v4/projects/26/packages/composer/archives/ldc/ldccrmv2client.zip?sha=b08177cbd4f1142e6878dc0b1a4bb445e332849f", - "reference": "b08177cbd4f1142e6878dc0b1a4bb445e332849f", + "url": "https://api.github.com/repos/laravel/ui/zipball/ff27db15416c1ed8ad9848f5692e47595dd5de27", + "reference": "ff27db15416c1ed8ad9848f5692e47595dd5de27", "shasum": "" }, "require": { - "ext-curl": "^7.3", + "illuminate/console": "^9.21|^10.0|^11.0|^12.0|^13.0", + "illuminate/filesystem": "^9.21|^10.0|^11.0|^12.0|^13.0", + "illuminate/support": "^9.21|^10.0|^11.0|^12.0|^13.0", + "illuminate/validation": "^9.21|^10.0|^11.0|^12.0|^13.0", + "php": "^8.0", + "symfony/console": "^6.0|^7.0|^8.0" + }, + "require-dev": { + "orchestra/testbench": "^7.35|^8.15|^9.0|^10.0|^11.0", + "phpunit/phpunit": "^9.3|^10.4|^11.5|^12.5|^13.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Ui\\UiServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\Ui\\": "src/", + "Illuminate\\Foundation\\Auth\\": "auth-backend/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Laravel UI utilities and presets.", + "keywords": [ + "laravel", + "ui" + ], + "support": { + "source": "https://github.com/laravel/ui/tree/v4.6.3" + }, + "time": "2026-03-17T13:41:52+00:00" + }, + { + "name": "ldc/ldccrmv4client", + "version": "4.1.8", + "source": { + "type": "git", + "url": "git@lab.s-web.fr:ldc-web/projets/crm-client.git", + "reference": "96183314eab486370bdef1a687672f47aeb413ae" + }, + "dist": { + "type": "zip", + "url": "https://lab.s-web.fr/api/v4/projects/26/packages/composer/archives/ldc/ldccrmv4client.zip?sha=96183314eab486370bdef1a687672f47aeb413ae", + "reference": "96183314eab486370bdef1a687672f47aeb413ae", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^2.0", + "ext-curl": "*", "guzzlehttp/guzzle": "^7.4", - "kwaadpepper/enum": "^2.1", - "php": "^7.3", + "php": "^8.2", "respect/validation": "^2.2" }, "require-dev": { - "orchestra/testbench": "^6.13", - "phpunit/phpunit": "~9.0", - "slevomat/coding-standard": "^7.0", + "orchestra/testbench": "^8.10", + "phpunit/phpunit": "9.6", + "slevomat/coding-standard": "^8.10", "squizlabs/php_codesniffer": "^3.5" }, "type": "library", @@ -2114,60 +2267,68 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Jérémy Munsch", - "email": "jeremy.munsch@ldc.fr", - "homepage": "https://jeremydev.ovh" - } - ], - "description": "LDC CRM Client V2", - "homepage": "https://github.com/kwaadpepper", + "description": "LDC CRM Client V4", "keywords": [ "CRM", "Client", "LDC", "Laravel" - ] + ], + "support": { + "email": "digital@ldc.fr" + } }, { "name": "league/commonmark", - "version": "1.6.7", + "version": "2.10.3", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "2b8185c13bc9578367a5bf901881d1c1b5bbd09b" + "reference": "6efbd9c472b91db0a3350fcd601c8332c2382e1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/2b8185c13bc9578367a5bf901881d1c1b5bbd09b", - "reference": "2b8185c13bc9578367a5bf901881d1c1b5bbd09b", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/6efbd9c472b91db0a3350fcd601c8332c2382e1f", + "reference": "6efbd9c472b91db0a3350fcd601c8332c2382e1f", "shasum": "" }, "require": { "ext-mbstring": "*", - "php": "^7.1 || ^8.0" - }, - "conflict": { - "scrutinizer/ocular": "1.7.*" + "league/config": "^1.1.1", + "php": "^7.4 || ^8.0", + "psr/event-dispatcher": "^1.0", + "symfony/deprecation-contracts": "^2.1 || ^3.0", + "symfony/polyfill-php80": "^1.16" }, "require-dev": { - "cebe/markdown": "~1.0", - "commonmark/commonmark.js": "0.29.2", - "erusev/parsedown": "~1.0", + "cebe/markdown": "^1.0", + "commonmark/cmark": "0.31.1", + "commonmark/commonmark.js": "0.31.1", + "composer/package-versions-deprecated": "^1.8", + "embed/embed": "^4.4", + "erusev/parsedown": "^1.0", "ext-json": "*", "github/gfm": "0.29.0", - "michelf/php-markdown": "~1.4", - "mikehaertl/php-shellcommand": "^1.4", - "phpstan/phpstan": "^0.12.90", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.2", - "scrutinizer/ocular": "^1.5", - "symfony/finder": "^4.2" + "michelf/php-markdown": "^1.4 || ^2.0", + "nyholm/psr7": "^1.5", + "phpstan/phpstan": "^2.0.0", + "phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0 || ^12.0.0 || ^13.0.0", + "scrutinizer/ocular": "^1.8.1", + "symfony/finder": "^5.3 | ^6.0 | ^7.0 || ^8.0", + "symfony/process": "^5.4 | ^6.0 | ^7.0 || ^8.0", + "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 | ^7.0 || ^8.0", + "unleashedtech/php-coding-standard": "^3.1.1", + "vimeo/psalm": "^4.24.0 || ^5.0.0 || ^6.0.0" + }, + "suggest": { + "symfony/yaml": "v2.3+ required if using the Front Matter extension" }, - "bin": [ - "bin/commonmark" - ], "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.11-dev" + } + }, "autoload": { "psr-4": { "League\\CommonMark\\": "src" @@ -2185,7 +2346,7 @@ "role": "Lead Developer" } ], - "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and Github-Flavored Markdown (GFM)", + "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)", "homepage": "https://commonmark.thephpleague.com", "keywords": [ "commonmark", @@ -2199,6 +2360,7 @@ ], "support": { "docs": "https://commonmark.thephpleague.com/", + "forum": "https://github.com/thephpleague/commonmark/discussions", "issues": "https://github.com/thephpleague/commonmark/issues", "rss": "https://github.com/thephpleague/commonmark/releases.atom", "source": "https://github.com/thephpleague/commonmark" @@ -2221,58 +2383,141 @@ "type": "tidelift" } ], - "time": "2022-01-13T17:18:13+00:00" + "time": "2026-09-21T13:07:34+00:00" }, { - "name": "league/flysystem", - "version": "1.1.10", + "name": "league/config", + "version": "v1.2.0", "source": { "type": "git", - "url": "https://github.com/thephpleague/flysystem.git", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" + "url": "https://github.com/thephpleague/config.git", + "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", + "url": "https://api.github.com/repos/thephpleague/config/zipball/754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", + "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", "shasum": "" }, "require": { - "ext-fileinfo": "*", - "league/mime-type-detection": "^1.3", - "php": "^7.2.5 || ^8.0" - }, - "conflict": { - "league/flysystem-sftp": "<1.0.6" + "dflydev/dot-access-data": "^3.0.1", + "nette/schema": "^1.2", + "php": "^7.4 || ^8.0" }, "require-dev": { - "phpspec/prophecy": "^1.11.1", - "phpunit/phpunit": "^8.5.8" - }, - "suggest": { - "ext-ftp": "Allows you to use FTP server storage", - "ext-openssl": "Allows you to use FTPS server storage", - "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", - "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", - "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", - "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", - "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", - "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", - "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", - "league/flysystem-webdav": "Allows you to use WebDAV storage", - "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", - "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", - "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.5", + "scrutinizer/ocular": "^1.8.1", + "unleashedtech/php-coding-standard": "^3.1", + "vimeo/psalm": "^4.7.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-main": "1.2-dev" } }, "autoload": { "psr-4": { - "League\\Flysystem\\": "src/" + "League\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Define configuration arrays with strict schemas and access values with dot notation", + "homepage": "https://config.thephpleague.com", + "keywords": [ + "array", + "config", + "configuration", + "dot", + "dot-access", + "nested", + "schema" + ], + "support": { + "docs": "https://config.thephpleague.com/", + "issues": "https://github.com/thephpleague/config/issues", + "rss": "https://github.com/thephpleague/config/releases.atom", + "source": "https://github.com/thephpleague/config" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + } + ], + "time": "2022-12-11T20:36:23+00:00" + }, + { + "name": "league/flysystem", + "version": "3.36.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "f7fb152932f30072d573510cbd4dd657d6475b25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f7fb152932f30072d573510cbd4dd657d6475b25", + "reference": "f7fb152932f30072d573510cbd4dd657d6475b25", + "shasum": "" + }, + "require": { + "league/flysystem-local": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" + }, + "conflict": { + "async-aws/core": "<1.19.0", + "async-aws/s3": "<1.14.0", + "aws/aws-sdk-php": "3.209.31 || 3.210.0", + "guzzlehttp/guzzle": "<7.0", + "guzzlehttp/ringphp": "<1.1.1", + "phpseclib/phpseclib": "3.0.15", + "symfony/http-client": "<5.2" + }, + "require-dev": { + "async-aws/s3": "^1.5 || ^2.0", + "async-aws/simple-s3": "^1.1 || ^2.0", + "aws/aws-sdk-php": "^3.295.10", + "composer/semver": "^3.0", + "ext-fileinfo": "*", + "ext-ftp": "*", + "ext-mongodb": "^1.3|^2", + "ext-zip": "*", + "friendsofphp/php-cs-fixer": "^3.5", + "google/cloud-storage": "^1.23", + "guzzlehttp/psr7": "^2.6", + "microsoft/azure-storage-blob": "^1.1", + "mongodb/mongodb": "^1.2|^2", + "phpseclib/phpseclib": "^3.0.36", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5.11|^10.0", + "sabre/dav": "^4.6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2282,75 +2527,53 @@ "authors": [ { "name": "Frank de Jonge", - "email": "info@frenky.net" + "email": "info@frankdejonge.nl" } ], - "description": "Filesystem abstraction: Many filesystems, one API.", + "description": "File storage abstraction for PHP", "keywords": [ - "Cloud Files", "WebDAV", - "abstraction", "aws", "cloud", - "copy.com", - "dropbox", - "file systems", + "file", "files", "filesystem", "filesystems", "ftp", - "rackspace", - "remote", "s3", "sftp", "storage" ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/1.1.10" + "source": "https://github.com/thephpleague/flysystem/tree/3.36.0" }, - "funding": [ - { - "url": "https://offset.earth/frankdejonge", - "type": "other" - } - ], - "time": "2022-10-04T09:16:37+00:00" + "time": "2026-09-02T08:00:27+00:00" }, { - "name": "league/glide", - "version": "1.7.2", + "name": "league/flysystem-local", + "version": "3.35.3", "source": { "type": "git", - "url": "https://github.com/thephpleague/glide.git", - "reference": "8dba756ada0b8e525bf6f1f7d1bd83c1e99e124e" + "url": "https://github.com/thephpleague/flysystem-local.git", + "reference": "a099b24dce160f3b2239043d13d47c4a1a214ea4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/glide/zipball/8dba756ada0b8e525bf6f1f7d1bd83c1e99e124e", - "reference": "8dba756ada0b8e525bf6f1f7d1bd83c1e99e124e", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/a099b24dce160f3b2239043d13d47c4a1a214ea4", + "reference": "a099b24dce160f3b2239043d13d47c4a1a214ea4", "shasum": "" }, "require": { - "intervention/image": "^2.4", - "league/flysystem": "^1.0", - "php": "^7.2|^8.0", - "psr/http-message": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^1.3.3", - "phpunit/php-token-stream": "^3.1|^4.0", - "phpunit/phpunit": "^8.5|^9.0" + "ext-fileinfo": "*", + "league/flysystem": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, "autoload": { "psr-4": { - "League\\Glide\\": "src/" + "League\\Flysystem\\Local\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -2359,56 +2582,45 @@ ], "authors": [ { - "name": "Jonathan Reinink", - "email": "jonathan@reinink.ca", - "homepage": "http://reinink.ca" - }, - { - "name": "Titouan Galopin", - "email": "galopintitouan@gmail.com", - "homepage": "https://titouangalopin.com" + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" } ], - "description": "Wonderfully easy on-demand image manipulation library with an HTTP based API.", - "homepage": "http://glide.thephpleague.com", + "description": "Local filesystem adapter for Flysystem.", "keywords": [ - "ImageMagick", - "editing", - "gd", - "image", - "imagick", - "league", - "manipulation", - "processing" + "Flysystem", + "file", + "files", + "filesystem", + "local" ], "support": { - "issues": "https://github.com/thephpleague/glide/issues", - "source": "https://github.com/thephpleague/glide/tree/1.7.2" + "source": "https://github.com/thephpleague/flysystem-local/tree/3.35.3" }, - "time": "2023-02-14T06:26:04+00:00" + "time": "2026-08-12T13:29:21+00:00" }, { "name": "league/mime-type-detection", - "version": "1.12.0", + "version": "1.17.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "c7f2872fb273bf493811473dafc88d60ae829f48" + "reference": "f5f47eff7c48ed1003069a2ca67f316fb4021c76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/c7f2872fb273bf493811473dafc88d60ae829f48", - "reference": "c7f2872fb273bf493811473dafc88d60ae829f48", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/f5f47eff7c48ed1003069a2ca67f316fb4021c76", + "reference": "f5f47eff7c48ed1003069a2ca67f316fb4021c76", "shasum": "" }, "require": { "ext-fileinfo": "*", - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3" + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0 || ^11.0 || ^12.0" }, "type": "library", "autoload": { @@ -2429,7 +2641,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.12.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.17.0" }, "funding": [ { @@ -2441,35 +2653,226 @@ "type": "tidelift" } ], - "time": "2023-08-03T07:14:11+00:00" + "time": "2026-07-09T11:49:27+00:00" }, { - "name": "maatwebsite/excel", - "version": "3.1.56", + "name": "league/uri", + "version": "7.8.1", "source": { "type": "git", - "url": "https://github.com/SpartnerNL/Laravel-Excel.git", - "reference": "0381d0225b42c3f328d90f0dd05ca071fca3953f" + "url": "https://github.com/thephpleague/uri.git", + "reference": "08cf38e3924d4f56238125547b5720496fac8fd4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/SpartnerNL/Laravel-Excel/zipball/0381d0225b42c3f328d90f0dd05ca071fca3953f", - "reference": "0381d0225b42c3f328d90f0dd05ca071fca3953f", + "url": "https://api.github.com/repos/thephpleague/uri/zipball/08cf38e3924d4f56238125547b5720496fac8fd4", + "reference": "08cf38e3924d4f56238125547b5720496fac8fd4", "shasum": "" }, "require": { - "composer/semver": "^3.3", - "ext-json": "*", - "illuminate/support": "5.8.*||^6.0||^7.0||^8.0||^9.0||^10.0||^11.0", - "php": "^7.0||^8.0", - "phpoffice/phpspreadsheet": "^1.18", - "psr/simple-cache": "^1.0||^2.0||^3.0" + "league/uri-interfaces": "^7.8.1", + "php": "^8.1", + "psr/http-factory": "^1" + }, + "conflict": { + "league/uri-schemes": "^1.0" + }, + "suggest": { + "ext-bcmath": "to improve IPV4 host parsing", + "ext-dom": "to convert the URI into an HTML anchor tag", + "ext-fileinfo": "to create Data URI from file contennts", + "ext-gmp": "to improve IPV4 host parsing", + "ext-intl": "to handle IDN host with the best performance", + "ext-uri": "to use the PHP native URI class", + "jeremykendall/php-domain-parser": "to further parse the URI host and resolve its Public Suffix and Top Level Domain", + "league/uri-components": "to provide additional tools to manipulate URI objects components", + "league/uri-polyfill": "to backport the PHP URI extension for older versions of PHP", + "php-64bit": "to improve IPV4 host parsing", + "rowbot/url": "to handle URLs using the WHATWG URL Living Standard specification", + "symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "URI manipulation library", + "homepage": "https://uri.thephpleague.com", + "keywords": [ + "URN", + "data-uri", + "file-uri", + "ftp", + "hostname", + "http", + "https", + "middleware", + "parse_str", + "parse_url", + "psr-7", + "query-string", + "querystring", + "rfc2141", + "rfc3986", + "rfc3987", + "rfc6570", + "rfc8141", + "uri", + "uri-template", + "url", + "ws" + ], + "support": { + "docs": "https://uri.thephpleague.com", + "forum": "https://thephpleague.slack.com", + "issues": "https://github.com/thephpleague/uri-src/issues", + "source": "https://github.com/thephpleague/uri/tree/7.8.1" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2026-03-15T20:22:25+00:00" + }, + { + "name": "league/uri-interfaces", + "version": "7.8.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri-interfaces.git", + "reference": "85d5c77c5d6d3af6c54db4a78246364908f3c928" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/85d5c77c5d6d3af6c54db4a78246364908f3c928", + "reference": "85d5c77c5d6d3af6c54db4a78246364908f3c928", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^8.1", + "psr/http-message": "^1.1 || ^2.0" + }, + "suggest": { + "ext-bcmath": "to improve IPV4 host parsing", + "ext-gmp": "to improve IPV4 host parsing", + "ext-intl": "to handle IDN host with the best performance", + "php-64bit": "to improve IPV4 host parsing", + "rowbot/url": "to handle URLs using the WHATWG URL Living Standard specification", + "symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "Common tools for parsing and resolving RFC3987/RFC3986 URI", + "homepage": "https://uri.thephpleague.com", + "keywords": [ + "data-uri", + "file-uri", + "ftp", + "hostname", + "http", + "https", + "parse_str", + "parse_url", + "psr-7", + "query-string", + "querystring", + "rfc3986", + "rfc3987", + "rfc6570", + "uri", + "url", + "ws" + ], + "support": { + "docs": "https://uri.thephpleague.com", + "forum": "https://thephpleague.slack.com", + "issues": "https://github.com/thephpleague/uri-src/issues", + "source": "https://github.com/thephpleague/uri-interfaces/tree/7.8.1" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2026-03-08T20:05:35+00:00" + }, + { + "name": "maatwebsite/excel", + "version": "4.x-dev", + "source": { + "type": "git", + "url": "https://github.com/SpartnerNL/Laravel-Excel.git", + "reference": "050985813424582bf084b93eb8c3fee0fb12c6c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/SpartnerNL/Laravel-Excel/zipball/050985813424582bf084b93eb8c3fee0fb12c6c4", + "reference": "050985813424582bf084b93eb8c3fee0fb12c6c4", + "shasum": "" + }, + "require": { + "composer/semver": "^3.4", + "illuminate/support": "^12.0 || ^13.0", + "php": "^8.3", + "phpoffice/phpspreadsheet": "^5.9", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0" }, "require-dev": { - "laravel/scout": "^7.0||^8.0||^9.0||^10.0", - "orchestra/testbench": "^6.0||^7.0||^8.0||^9.0", - "predis/predis": "^1.1" + "brianium/paratest": "^7.20", + "driftingly/rector-laravel": "^2.5", + "ext-sqlite3": "*", + "larastan/larastan": "^3.10", + "laravel/pint": "^1.29", + "laravel/scout": "^10.25 || ^11.2", + "orchestra/testbench": "^10.11 || ^11.1", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan-mockery": "^2.0", + "phpunit/phpunit": "^12.5 || ~13.1.14", + "predis/predis": "^2.3 || ^3.0", + "rector/rector": "^2.4.2" }, + "default-branch": true, "type": "library", "extra": { "laravel": { @@ -2510,7 +2913,7 @@ ], "support": { "issues": "https://github.com/SpartnerNL/Laravel-Excel/issues", - "source": "https://github.com/SpartnerNL/Laravel-Excel/tree/3.1.56" + "source": "https://github.com/SpartnerNL/Laravel-Excel/tree/4.x" }, "funding": [ { @@ -2522,33 +2925,40 @@ "type": "github" } ], - "time": "2024-08-19T09:40:43+00:00" + "time": "2026-09-14T12:30:46+00:00" }, { "name": "maennchen/zipstream-php", - "version": "2.1.0", + "version": "3.2.2", "source": { "type": "git", "url": "https://github.com/maennchen/ZipStream-PHP.git", - "reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58" + "reference": "77bebeb4c6c340bb3c11c843b2cffd8bbfde4d5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/c4c5803cc1f93df3d2448478ef79394a5981cc58", - "reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58", + "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/77bebeb4c6c340bb3c11c843b2cffd8bbfde4d5e", + "reference": "77bebeb4c6c340bb3c11c843b2cffd8bbfde4d5e", "shasum": "" }, "require": { - "myclabs/php-enum": "^1.5", - "php": ">= 7.1", - "psr/http-message": "^1.0", - "symfony/polyfill-mbstring": "^1.0" + "ext-mbstring": "*", + "ext-zlib": "*", + "php-64bit": "^8.3" }, "require-dev": { + "brianium/paratest": "^7.7", "ext-zip": "*", - "guzzlehttp/guzzle": ">= 6.3", + "friendsofphp/php-cs-fixer": "^3.86", + "guzzlehttp/guzzle": "^7.5", "mikey179/vfsstream": "^1.6", - "phpunit/phpunit": ">= 7.5" + "php-coveralls/php-coveralls": "^2.5", + "phpunit/phpunit": "^12.0", + "vimeo/psalm": "^6.0" + }, + "suggest": { + "guzzlehttp/psr7": "^2.4", + "psr/http-message": "^2.0" }, "type": "library", "autoload": { @@ -2585,19 +2995,15 @@ ], "support": { "issues": "https://github.com/maennchen/ZipStream-PHP/issues", - "source": "https://github.com/maennchen/ZipStream-PHP/tree/2.1.0" + "source": "https://github.com/maennchen/ZipStream-PHP/tree/3.2.2" }, "funding": [ { "url": "https://github.com/maennchen", "type": "github" - }, - { - "url": "https://opencollective.com/zipstream", - "type": "open_collective" } ], - "time": "2020-05-30T13:11:16+00:00" + "time": "2026-04-11T18:38:28+00:00" }, { "name": "markbaker/complex", @@ -2707,24 +3113,100 @@ "time": "2022-12-02T22:17:43+00:00" }, { - "name": "mews/purifier", - "version": "3.4.2", + "name": "mcamara/laravel-localization", + "version": "v2.4.2", "source": { "type": "git", - "url": "https://github.com/mewebstudio/Purifier.git", - "reference": "d4d3830267eeda7b385d61dd680ace14dcf142df" + "url": "https://github.com/mcamara/laravel-localization.git", + "reference": "dbfa563ea0ceb6d072adc280a8830999ade9ed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mewebstudio/Purifier/zipball/d4d3830267eeda7b385d61dd680ace14dcf142df", - "reference": "d4d3830267eeda7b385d61dd680ace14dcf142df", + "url": "https://api.github.com/repos/mcamara/laravel-localization/zipball/dbfa563ea0ceb6d072adc280a8830999ade9ed74", + "reference": "dbfa563ea0ceb6d072adc280a8830999ade9ed74", + "shasum": "" + }, + "require": { + "laravel/framework": "^11.0|^12.0|^13.0", + "php": "^8.2" + }, + "require-dev": { + "orchestra/testbench": "^9.0|^10.0|^11.0", + "phpunit/phpunit": "^10.1|^11.0|^12.5.12" + }, + "suggest": { + "ext-intl": "*" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "LaravelLocalization": "Mcamara\\LaravelLocalization\\Facades\\LaravelLocalization" + }, + "providers": [ + "Mcamara\\LaravelLocalization\\LaravelLocalizationServiceProvider" + ] + } + }, + "autoload": { + "psr-0": { + "Mcamara\\LaravelLocalization": "src/" + }, + "classmap": [] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marc Cámara", + "email": "mcamara88@gmail.com", + "role": "Developer" + } + ], + "description": "Easy localization for Laravel", + "homepage": "https://github.com/mcamara/laravel-localization", + "keywords": [ + "laravel", + "localization", + "php" + ], + "support": { + "issues": "https://github.com/mcamara/laravel-localization/issues", + "source": "https://github.com/mcamara/laravel-localization/tree/v2.4.2" + }, + "funding": [ + { + "url": "https://github.com/iwasherefirst2", + "type": "github" + }, + { + "url": "https://github.com/mcamara", + "type": "github" + } + ], + "time": "2026-08-24T08:07:04+00:00" + }, + { + "name": "mews/purifier", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/mewebstudio/Purifier.git", + "reference": "b2705cc6c832ce7229373418e191d71b6c037841" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mewebstudio/Purifier/zipball/b2705cc6c832ce7229373418e191d71b6c037841", + "reference": "b2705cc6c832ce7229373418e191d71b6c037841", "shasum": "" }, "require": { "ezyang/htmlpurifier": "^4.16.0", - "illuminate/config": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", - "illuminate/filesystem": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", - "illuminate/support": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/config": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0", + "illuminate/filesystem": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0", + "illuminate/support": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0", "php": "^7.2|^8.0" }, "require-dev": { @@ -2780,48 +3262,474 @@ ], "support": { "issues": "https://github.com/mewebstudio/Purifier/issues", - "source": "https://github.com/mewebstudio/Purifier/tree/3.4.2" + "source": "https://github.com/mewebstudio/Purifier/tree/3.4.4" }, - "time": "2024-03-20T16:18:22+00:00" + "time": "2026-04-15T16:41:08+00:00" }, { - "name": "monolog/monolog", - "version": "2.10.0", + "name": "microsoft/kiota-abstractions", + "version": "2.2.0", "source": { "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "5cf826f2991858b54d5c3809bee745560a1042a7" + "url": "https://github.com/microsoft/kiota-abstractions-php.git", + "reference": "03f85e9b6b5b4864bdf188279651190b8062c30a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5cf826f2991858b54d5c3809bee745560a1042a7", - "reference": "5cf826f2991858b54d5c3809bee745560a1042a7", + "url": "https://api.github.com/repos/microsoft/kiota-abstractions-php/zipball/03f85e9b6b5b4864bdf188279651190b8062c30a", + "reference": "03f85e9b6b5b4864bdf188279651190b8062c30a", "shasum": "" }, "require": { - "php": ">=7.2", - "psr/log": "^1.0.1 || ^2.0 || ^3.0" - }, - "provide": { - "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" + "open-telemetry/sdk": "^1.0.0", + "php": "^8.2", + "php-http/promise": "~1.2.0", + "psr/http-message": "^1.1 || ^2.0", + "ramsey/uuid": "^4.2.3", + "stduritemplate/stduritemplate": "^0.0.53 || ^0.0.54 || ^0.0.55 || ^0.0.56 || ^0.0.57 || ^0.0.59 || ^1.0.0 || ^2.0.0" }, "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "phpstan/phpstan": "^1.12.16", + "phpunit/phpunit": "^9.6.22" + }, + "type": "library", + "autoload": { + "psr-4": { + "Microsoft\\Kiota\\Abstractions\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Microsoft Graph Client Tooling", + "email": "graphtooling@service.microsoft.com", + "role": "Developer" + } + ], + "description": "Abstractions for Kiota", + "support": { + "source": "https://github.com/microsoft/kiota-abstractions-php/tree/2.2.0" + }, + "time": "2026-10-06T14:59:11+00:00" + }, + { + "name": "microsoft/kiota-bundle", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/microsoft/kiota-bundle-php.git", + "reference": "3702ed91b750c77e2c168c2343c48fb97e065725" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/microsoft/kiota-bundle-php/zipball/3702ed91b750c77e2c168c2343c48fb97e065725", + "reference": "3702ed91b750c77e2c168c2343c48fb97e065725", + "shasum": "" + }, + "require": { + "microsoft/kiota-abstractions": "^2.2.0", + "microsoft/kiota-http-guzzle": "^2.2.0", + "microsoft/kiota-serialization-form": "^2.2.0", + "microsoft/kiota-serialization-json": "^2.2.0", + "microsoft/kiota-serialization-multipart": "^2.2.0", + "microsoft/kiota-serialization-text": "^2.2.0", + "php": "^8.2" + }, + "require-dev": { + "phpstan/phpstan": "^1.12.16", + "phpunit/phpunit": "^9.6.22" + }, + "type": "library", + "autoload": { + "psr-4": { + "Microsoft\\Kiota\\Bundle\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Microsoft Graph Client Tooling", + "email": "graphtooling@service.microsoft.com" + } + ], + "description": "Default implementations for Kiota client setup", + "support": { + "source": "https://github.com/microsoft/kiota-bundle-php/tree/2.2.0" + }, + "time": "2026-10-06T19:09:36+00:00" + }, + { + "name": "microsoft/kiota-http-guzzle", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/microsoft/kiota-http-guzzle-php.git", + "reference": "9ef45982a4b16b58f7a8cce650db2ca0ced86b23" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/microsoft/kiota-http-guzzle-php/zipball/9ef45982a4b16b58f7a8cce650db2ca0ced86b23", + "reference": "9ef45982a4b16b58f7a8cce650db2ca0ced86b23", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-zlib": "*", + "guzzlehttp/guzzle": "^7.4.5 || ^8.0", + "microsoft/kiota-abstractions": "^2.2.0", + "php": "^8.2" + }, + "require-dev": { + "phpstan/phpstan": "^1.12.16", + "phpunit/phpunit": "^9.6.22" + }, + "type": "library", + "autoload": { + "psr-4": { + "Microsoft\\Kiota\\Http\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Microsoft Graph Client Tooling", + "email": "graphtooling@service.microsoft.com" + } + ], + "description": "Kiota HTTP Request Adapter implementation", + "support": { + "source": "https://github.com/microsoft/kiota-http-guzzle-php/tree/2.2.0" + }, + "time": "2026-10-06T18:26:46+00:00" + }, + { + "name": "microsoft/kiota-serialization-form", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/microsoft/kiota-serialization-form-php.git", + "reference": "52adfd781cc1cd56578d7f0d0ab385c2753a5629" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/microsoft/kiota-serialization-form-php/zipball/52adfd781cc1cd56578d7f0d0ab385c2753a5629", + "reference": "52adfd781cc1cd56578d7f0d0ab385c2753a5629", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/psr7": "^1.6 || ^2 || ^3", + "microsoft/kiota-abstractions": "^2.2.0", + "php": "^8.2" + }, + "require-dev": { + "phpstan/phpstan": "^1.12.16", + "phpunit/phpunit": "^9.6.22", + "roave/security-advisories": "dev-latest" + }, + "type": "library", + "autoload": { + "psr-4": { + "Microsoft\\Kiota\\Serialization\\Form\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Microsoft Graph Client Tooling", + "email": "graphtooling@service.microsoft.com", + "role": "Developer" + } + ], + "description": "Form implementation of Kiota abstractions serialization.", + "support": { + "source": "https://github.com/microsoft/kiota-serialization-form-php/tree/2.2.0" + }, + "time": "2026-10-06T18:52:14+00:00" + }, + { + "name": "microsoft/kiota-serialization-json", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/microsoft/kiota-serialization-json-php.git", + "reference": "c8c210af48db25e4fbb6c5234182840446a4a3e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/microsoft/kiota-serialization-json-php/zipball/c8c210af48db25e4fbb6c5234182840446a4a3e2", + "reference": "c8c210af48db25e4fbb6c5234182840446a4a3e2", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/psr7": "^1.6 || ^2 || ^3", + "microsoft/kiota-abstractions": "^2.2.0", + "php": "^8.2" + }, + "require-dev": { + "phpstan/phpstan": "^1.12.16", + "phpunit/phpunit": "^9.6.22", + "roave/security-advisories": "dev-latest" + }, + "type": "library", + "autoload": { + "psr-4": { + "Microsoft\\Kiota\\Serialization\\Json\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Microsoft Graph Client Tooling", + "email": "graphtooling@service.microsoft.com", + "role": "Developer" + } + ], + "description": "Implementation of Kiota serialization abstractions using Json.", + "support": { + "source": "https://github.com/microsoft/kiota-serialization-json-php/tree/2.2.0" + }, + "time": "2026-10-06T17:55:13+00:00" + }, + { + "name": "microsoft/kiota-serialization-multipart", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/microsoft/kiota-serialization-multipart-php.git", + "reference": "4ae474342ee0c16bb338af7dd24522bac58a8787" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/microsoft/kiota-serialization-multipart-php/zipball/4ae474342ee0c16bb338af7dd24522bac58a8787", + "reference": "4ae474342ee0c16bb338af7dd24522bac58a8787", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/psr7": "^1.6 || ^2 || ^3", + "microsoft/kiota-abstractions": "^2.2.0", + "php": "^8.2" + }, + "require-dev": { + "phpstan/phpstan": "^1.12.16", + "phpunit/phpunit": "^9.6.22", + "roave/security-advisories": "dev-latest" + }, + "type": "library", + "autoload": { + "psr-4": { + "Microsoft\\Kiota\\Serialization\\Multipart\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Microsoft Graph Client Tooling", + "email": "graphtooling@service.microsoft.com", + "role": "Developer" + } + ], + "description": "Multipart implementation of Kiota abstractions serialization.", + "support": { + "source": "https://github.com/microsoft/kiota-serialization-multipart-php/tree/2.2.0" + }, + "time": "2026-10-06T19:07:42+00:00" + }, + { + "name": "microsoft/kiota-serialization-text", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/microsoft/kiota-serialization-text-php.git", + "reference": "0bea98321822aed25251441f2f0f9347e4ca396c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/microsoft/kiota-serialization-text-php/zipball/0bea98321822aed25251441f2f0f9347e4ca396c", + "reference": "0bea98321822aed25251441f2f0f9347e4ca396c", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^1.6 || ^2 || ^3", + "microsoft/kiota-abstractions": "^2.2.0", + "php": "^8.2" + }, + "require-dev": { + "phpstan/phpstan": "^1.12.16", + "phpunit/phpunit": "^9.6.22" + }, + "type": "library", + "autoload": { + "psr-4": { + "Microsoft\\Kiota\\Serialization\\Text\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Microsoft Graph Client Tooling", + "email": "graphtooling@service.microsoft.com" + } + ], + "description": "Implementation of Serialization Abstractions for text/plain content", + "support": { + "source": "https://github.com/microsoft/kiota-serialization-text-php/tree/2.2.0" + }, + "time": "2026-10-06T17:53:51+00:00" + }, + { + "name": "moneyphp/money", + "version": "v4.9.0", + "source": { + "type": "git", + "url": "https://github.com/moneyphp/money.git", + "reference": "d49ee625c6ba79b9d7a228ce153b02fc1032152b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/moneyphp/money/zipball/d49ee625c6ba79b9d7a228ce153b02fc1032152b", + "reference": "d49ee625c6ba79b9d7a228ce153b02fc1032152b", + "shasum": "" + }, + "require": { + "ext-bcmath": "*", + "ext-filter": "*", + "ext-json": "*", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0" + }, + "require-dev": { + "cache/taggable-cache": "^1.1.0", + "doctrine/coding-standard": "^12.0", + "doctrine/instantiator": "^1.5.0 || ^2.0", + "ext-gmp": "*", + "ext-intl": "*", + "florianv/exchanger": "^2.8.1", + "florianv/swap": "^4.3.0", + "moneyphp/crypto-currencies": "^1.1.0", + "moneyphp/iso-currencies": "^3.4", + "php-http/message": "^1.16.0", + "php-http/mock-client": "^1.6.0", + "phpbench/phpbench": "^1.2.5", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1.9", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^10.5.9", + "psr/cache": "^1.0.1 || ^2.0 || ^3.0", + "ticketswap/phpstan-error-formatter": "^1.1" + }, + "suggest": { + "ext-gmp": "Calculate without integer limits", + "ext-intl": "Format Money objects with intl", + "florianv/exchanger": "Exchange rates library for PHP", + "florianv/swap": "Exchange rates library for PHP", + "psr/cache-implementation": "Used for Currency caching" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Money\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mathias Verraes", + "email": "mathias@verraes.net", + "homepage": "http://verraes.net" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "Frederik Bosch", + "email": "f.bosch@genkgo.nl" + } + ], + "description": "PHP implementation of Fowler's Money pattern", + "homepage": "http://moneyphp.org", + "keywords": [ + "Value Object", + "money", + "vo" + ], + "support": { + "issues": "https://github.com/moneyphp/money/issues", + "source": "https://github.com/moneyphp/money/tree/v4.9.0" + }, + "time": "2026-05-04T20:23:15+00:00" + }, + { + "name": "monolog/monolog", + "version": "3.12.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "d7059e4c691d05ea1222b5124bed0f961be46e15" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/d7059e4c691d05ea1222b5124bed0f961be46e15", + "reference": "d7059e4c691d05ea1222b5124bed0f961be46e15", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/log": "^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^3.0", "doctrine/couchdb": "~1.0@dev", "elasticsearch/elasticsearch": "^7 || ^8", "ext-json": "*", - "graylog2/gelf-php": "^1.4.2 || ^2@dev", - "guzzlehttp/guzzle": "^7.4", + "graylog2/gelf-php": "^1.4.2 || ^2.0", + "guzzlehttp/guzzle": "^7.4.5", "guzzlehttp/psr7": "^2.2", - "mongodb/mongodb": "^1.8", + "mongodb/mongodb": "^1.8 || ^2.0", "php-amqplib/php-amqplib": "~2.4 || ^3", - "phpspec/prophecy": "^1.15", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^8.5.38 || ^9.6.19", - "predis/predis": "^1.1 || ^2.0", - "rollbar/rollbar": "^1.3 || ^2 || ^3", - "ruflin/elastica": "^7", - "swiftmailer/swiftmailer": "^5.3|^6.0", + "php-console/php-console": "^3.1.8", + "phpstan/phpstan": "^2", + "phpstan/phpstan-deprecation-rules": "^2", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "^10.5.17 || ^11.0.7", + "predis/predis": "^1.1 || ^2", + "psr/clock": "^1.0", + "rollbar/rollbar": "^4.0", + "ruflin/elastica": "^7 || ^8", "symfony/mailer": "^5.4 || ^6", "symfony/mime": "^5.4 || ^6" }, @@ -2838,13 +3746,14 @@ "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "psr/clock": "Required to pass a clock to the Logger and control the timestamp of log records", "rollbar/rollbar": "Allow sending log messages to Rollbar", "ruflin/elastica": "Allow sending log messages to an Elastic Search server" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { @@ -2872,7 +3781,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/2.10.0" + "source": "https://github.com/Seldaek/monolog/tree/3.12.1" }, "funding": [ { @@ -2884,109 +3793,44 @@ "type": "tidelift" } ], - "time": "2024-11-12T12:43:37+00:00" - }, - { - "name": "myclabs/php-enum", - "version": "1.8.5", - "source": { - "type": "git", - "url": "https://github.com/myclabs/php-enum.git", - "reference": "e7be26966b7398204a234f8673fdad5ac6277802" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/php-enum/zipball/e7be26966b7398204a234f8673fdad5ac6277802", - "reference": "e7be26966b7398204a234f8673fdad5ac6277802", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": "^7.3 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "1.*", - "vimeo/psalm": "^4.6.2 || ^5.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "MyCLabs\\Enum\\": "src/" - }, - "classmap": [ - "stubs/Stringable.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP Enum contributors", - "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" - } - ], - "description": "PHP Enum implementation", - "homepage": "https://github.com/myclabs/php-enum", - "keywords": [ - "enum" - ], - "support": { - "issues": "https://github.com/myclabs/php-enum/issues", - "source": "https://github.com/myclabs/php-enum/tree/1.8.5" - }, - "funding": [ - { - "url": "https://github.com/mnapoli", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum", - "type": "tidelift" - } - ], - "time": "2025-01-14T11:49:03+00:00" + "time": "2026-09-29T19:21:12+00:00" }, { "name": "nesbot/carbon", - "version": "2.73.0", + "version": "3.14.2", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon.git", - "reference": "9228ce90e1035ff2f0db84b40ec2e023ed802075" + "reference": "94cfc34887f07ab5c0efa07914c8f527544e3224" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/9228ce90e1035ff2f0db84b40ec2e023ed802075", - "reference": "9228ce90e1035ff2f0db84b40ec2e023ed802075", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/94cfc34887f07ab5c0efa07914c8f527544e3224", + "reference": "94cfc34887f07ab5c0efa07914c8f527544e3224", "shasum": "" }, "require": { - "carbonphp/carbon-doctrine-types": "*", + "carbonphp/carbon-doctrine-types": "<100.0", "ext-json": "*", - "php": "^7.1.8 || ^8.0", + "php": "^8.1", "psr/clock": "^1.0", + "symfony/clock": "^6.3.12 || ^7.0 || ^8.0", "symfony/polyfill-mbstring": "^1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" + "symfony/translation": "^4.4.18 || ^5.2.1 || ^6.0 || ^7.0 || ^8.0" }, "provide": { "psr/clock-implementation": "1.0" }, "require-dev": { - "doctrine/dbal": "^2.0 || ^3.1.4 || ^4.0", - "doctrine/orm": "^2.7 || ^3.0", - "friendsofphp/php-cs-fixer": "^3.0", - "kylekatarnls/multi-tester": "^2.0", - "ondrejmirtes/better-reflection": "<6", - "phpmd/phpmd": "^2.9", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.99 || ^1.7.14", - "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6", - "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", - "squizlabs/php_codesniffer": "^3.4" + "doctrine/dbal": "^3.6.3 || ^4.0", + "doctrine/orm": "^2.15.2 || ^3.0", + "friendsofphp/php-cs-fixer": "^v3.87.1", + "kylekatarnls/multi-tester": "^2.5.3", + "phpmd/phpmd": "^3.0@dev", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.1.22", + "phpunit/phpunit": "^10.5.53", + "squizlabs/php_codesniffer": "^3.13.4 || ^4.0.0" }, "bin": [ "bin/carbon" @@ -3029,16 +3873,16 @@ } ], "description": "An API extension for DateTime that supports 281 different languages.", - "homepage": "https://carbon.nesbot.com", + "homepage": "https://carbonphp.github.io/carbon/", "keywords": [ "date", "datetime", "time" ], "support": { - "docs": "https://carbon.nesbot.com/docs", - "issues": "https://github.com/briannesbitt/Carbon/issues", - "source": "https://github.com/briannesbitt/Carbon" + "docs": "https://carbonphp.github.io/carbon/guide/getting-started/introduction.html", + "issues": "https://github.com/CarbonPHP/carbon/issues", + "source": "https://github.com/CarbonPHP/carbon" }, "funding": [ { @@ -3054,75 +3898,188 @@ "type": "tidelift" } ], - "time": "2025-01-08T20:10:23+00:00" + "time": "2026-10-02T07:26:52+00:00" }, { - "name": "nicmart/tree", - "version": "0.3.1", + "name": "nette/schema", + "version": "v1.3.6", "source": { "type": "git", - "url": "https://github.com/nicmart/Tree.git", - "reference": "c55ba47c64a3cb7454c22e6d630729fc2aab23ff" + "url": "https://github.com/nette/schema.git", + "reference": "c54350438cd6914616f790a49cb424605f421562" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nicmart/Tree/zipball/c55ba47c64a3cb7454c22e6d630729fc2aab23ff", - "reference": "c55ba47c64a3cb7454c22e6d630729fc2aab23ff", + "url": "https://api.github.com/repos/nette/schema/zipball/c54350438cd6914616f790a49cb424605f421562", + "reference": "c54350438cd6914616f790a49cb424605f421562", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "nette/utils": "^4.0", + "php": "8.1 - 8.5" }, "require-dev": { - "ergebnis/composer-normalize": "^2.8.0", - "ergebnis/license": "^1.0.0", - "ergebnis/php-cs-fixer-config": "^2.2.1", - "phpunit/phpunit": "^7.5.20" + "nette/phpstan-rules": "^1.0", + "nette/tester": "^2.6", + "phpstan/extension-installer": "^1.4@stable", + "phpstan/phpstan": "^2.1.39@stable", + "tracy/tracy": "^2.8" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, "autoload": { "psr-4": { - "Tree\\": "src/" - } + "Nette\\": "src" + }, + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" ], "authors": [ { - "name": "Nicolò Martini", - "email": "nicmartnic@gmail.com" + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" } ], - "description": "A basic but flexible php tree data structure and a fluent tree builder implementation.", + "description": "📐 Nette Schema: validating data structures against a given Schema.", + "homepage": "https://nette.org", + "keywords": [ + "config", + "nette" + ], "support": { - "issues": "https://github.com/nicmart/Tree/issues", - "source": "https://github.com/nicmart/Tree/tree/0.3.1" + "issues": "https://github.com/nette/schema/issues", + "source": "https://github.com/nette/schema/tree/v1.3.6" }, - "time": "2020-11-27T09:02:17+00:00" + "time": "2026-08-16T21:58:41+00:00" }, { - "name": "nikic/php-parser", - "version": "v4.19.4", + "name": "nette/utils", + "version": "v4.1.5", "source": { "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" + "url": "https://github.com/nette/utils.git", + "reference": "b043439dbdf954e6c28b5ea7e34b0100f83165e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", - "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "url": "https://api.github.com/repos/nette/utils/zipball/b043439dbdf954e6c28b5ea7e34b0100f83165e0", + "reference": "b043439dbdf954e6c28b5ea7e34b0100f83165e0", "shasum": "" }, "require": { + "php": "8.2 - 8.5" + }, + "conflict": { + "nette/finder": "<3", + "nette/schema": "<1.2.2" + }, + "require-dev": { + "jetbrains/phpstorm-attributes": "^1.2", + "nette/phpstan-rules": "^1.0", + "nette/tester": "^2.5", + "phpstan/extension-installer": "^1.4@stable", + "phpstan/phpstan": "^2.1@stable", + "tracy/tracy": "^2.9" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::chr(), ord() and reverse()", + "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", + "ext-json": "to use Nette\\Utils\\Json", + "ext-mbstring": "to use Strings::lower() etc...", + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Nette\\": "src" + }, + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", + "homepage": "https://nette.org", + "keywords": [ + "array", + "core", + "datetime", + "images", + "json", + "nette", + "paginator", + "password", + "slugify", + "string", + "unicode", + "utf-8", + "utility", + "validation" + ], + "support": { + "issues": "https://github.com/nette/utils/issues", + "source": "https://github.com/nette/utils/tree/v4.1.5" + }, + "time": "2026-07-17T23:02:45+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.9.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "9e33da9553fe7786f0962b35f4e4ecf01be89def" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9e33da9553fe7786f0962b35f4e4ecf01be89def", + "reference": "9e33da9553fe7786f0962b35f4e4ecf01be89def", + "shasum": "" + }, + "require": { + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.1" + "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^9.0" }, "bin": [ "bin/php-parse" @@ -3130,7 +4087,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.x-dev" } }, "autoload": { @@ -3154,9 +4111,96 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.9.0" }, - "time": "2024-09-29T15:01:53+00:00" + "time": "2026-09-13T18:51:52+00:00" + }, + { + "name": "nunomaduro/termwind", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/termwind.git", + "reference": "712a31b768f5daea284c2169a7d227031001b9a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/712a31b768f5daea284c2169a7d227031001b9a8", + "reference": "712a31b768f5daea284c2169a7d227031001b9a8", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^8.2", + "symfony/console": "^7.4.4 || ^8.0.4" + }, + "require-dev": { + "illuminate/console": "^11.47.0", + "laravel/pint": "^1.27.1", + "mockery/mockery": "^1.6.12", + "pestphp/pest": "^2.36.0 || ^3.8.4 || ^4.3.2", + "phpstan/phpstan": "^1.12.32", + "phpstan/phpstan-strict-rules": "^1.6.2", + "symfony/var-dumper": "^7.3.5 || ^8.0.4", + "thecodingmachine/phpstan-strict-rules": "^1.0.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Termwind\\Laravel\\TermwindServiceProvider" + ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Termwind\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "It's like Tailwind CSS, but for the console.", + "keywords": [ + "cli", + "console", + "css", + "package", + "php", + "style" + ], + "support": { + "issues": "https://github.com/nunomaduro/termwind/issues", + "source": "https://github.com/nunomaduro/termwind/tree/v2.4.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://github.com/xiCO2k", + "type": "github" + } + ], + "time": "2026-02-16T23:10:27+00:00" }, { "name": "nyholm/psr7", @@ -3237,113 +4281,33 @@ "time": "2024-09-09T07:06:30+00:00" }, { - "name": "opis/closure", - "version": "3.6.3", + "name": "nyholm/psr7-server", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/opis/closure.git", - "reference": "3d81e4309d2a927abbe66df935f4bb60082805ad" + "url": "https://github.com/Nyholm/psr7-server.git", + "reference": "4335801d851f554ca43fa6e7d2602141538854dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opis/closure/zipball/3d81e4309d2a927abbe66df935f4bb60082805ad", - "reference": "3d81e4309d2a927abbe66df935f4bb60082805ad", - "shasum": "" - }, - "require": { - "php": "^5.4 || ^7.0 || ^8.0" - }, - "require-dev": { - "jeremeamia/superclosure": "^2.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.6.x-dev" - } - }, - "autoload": { - "files": [ - "functions.php" - ], - "psr-4": { - "Opis\\Closure\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marius Sarca", - "email": "marius.sarca@gmail.com" - }, - { - "name": "Sorin Sarca", - "email": "sarca_sorin@hotmail.com" - } - ], - "description": "A library that can be used to serialize closures (anonymous functions) and arbitrary objects.", - "homepage": "https://opis.io/closure", - "keywords": [ - "anonymous functions", - "closure", - "function", - "serializable", - "serialization", - "serialize" - ], - "support": { - "issues": "https://github.com/opis/closure/issues", - "source": "https://github.com/opis/closure/tree/3.6.3" - }, - "time": "2022-01-27T09:35:39+00:00" - }, - { - "name": "php-http/client-common", - "version": "2.7.2", - "source": { - "type": "git", - "url": "https://github.com/php-http/client-common.git", - "reference": "0cfe9858ab9d3b213041b947c881d5b19ceeca46" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/0cfe9858ab9d3b213041b947c881d5b19ceeca46", - "reference": "0cfe9858ab9d3b213041b947c881d5b19ceeca46", + "url": "https://api.github.com/repos/Nyholm/psr7-server/zipball/4335801d851f554ca43fa6e7d2602141538854dc", + "reference": "4335801d851f554ca43fa6e7d2602141538854dc", "shasum": "" }, "require": { "php": "^7.1 || ^8.0", - "php-http/httplug": "^2.0", - "php-http/message": "^1.6", - "psr/http-client": "^1.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0 || ^2.0", - "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0 || ^7.0", - "symfony/polyfill-php80": "^1.17" + "psr/http-message": "^1.0 || ^2.0" }, "require-dev": { - "doctrine/instantiator": "^1.1", - "guzzlehttp/psr7": "^1.4", - "nyholm/psr7": "^1.2", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "phpspec/prophecy": "^1.10.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.33 || ^9.6.7" - }, - "suggest": { - "ext-json": "To detect JSON responses with the ContentTypePlugin", - "ext-libxml": "To detect XML responses with the ContentTypePlugin", - "php-http/cache-plugin": "PSR-6 Cache plugin", - "php-http/logger-plugin": "PSR-3 Logger plugin", - "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + "nyholm/nsa": "^1.1", + "nyholm/psr7": "^1.3", + "phpunit/phpunit": "^7.0 || ^8.5 || ^9.3" }, "type": "library", "autoload": { "psr-4": { - "Http\\Client\\Common\\": "src/" + "Nyholm\\Psr7Server\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3352,23 +4316,440 @@ ], "authors": [ { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + }, + { + "name": "Martijn van der Ven", + "email": "martijn@vanderven.se" } ], - "description": "Common HTTP Client implementations and tools for HTTPlug", - "homepage": "http://httplug.io", + "description": "Helper classes to handle PSR-7 server requests", + "homepage": "http://tnyholm.se", "keywords": [ - "client", - "common", - "http", - "httplug" + "psr-17", + "psr-7" ], "support": { - "issues": "https://github.com/php-http/client-common/issues", - "source": "https://github.com/php-http/client-common/tree/2.7.2" + "issues": "https://github.com/Nyholm/psr7-server/issues", + "source": "https://github.com/Nyholm/psr7-server/tree/1.1.0" }, - "time": "2024-09-24T06:21:48+00:00" + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" + } + ], + "time": "2023-11-08T09:30:43+00:00" + }, + { + "name": "open-telemetry/api", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/api.git", + "reference": "7c029c4a6fd457094a20569bf98f93d95e9a7559" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/7c029c4a6fd457094a20569bf98f93d95e9a7559", + "reference": "7c029c4a6fd457094a20569bf98f93d95e9a7559", + "shasum": "" + }, + "require": { + "open-telemetry/context": "^1.4", + "php": "^8.1", + "psr/log": "^1.1|^2.0|^3.0", + "symfony/polyfill-php82": "^1.26" + }, + "conflict": { + "open-telemetry/sdk": "<=1.11" + }, + "type": "library", + "extra": { + "spi": { + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" + ] + }, + "branch-alias": { + "dev-main": "1.8.x-dev" + } + }, + "autoload": { + "files": [ + "Trace/functions.php" + ], + "psr-4": { + "OpenTelemetry\\API\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "API for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "api", + "apm", + "logging", + "opentelemetry", + "otel", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/languages/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2026-07-06T12:28:04+00:00" + }, + { + "name": "open-telemetry/context", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/context.git", + "reference": "3c414b246e0dabb7d6145404e6a5e4536ca18d07" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/context/zipball/3c414b246e0dabb7d6145404e6a5e4536ca18d07", + "reference": "3c414b246e0dabb7d6145404e6a5e4536ca18d07", + "shasum": "" + }, + "require": { + "php": "^8.1", + "symfony/polyfill-php82": "^1.26" + }, + "suggest": { + "ext-ffi": "To allow context switching in Fibers" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + } + }, + "autoload": { + "files": [ + "fiber/initialize_fiber_handler.php" + ], + "psr-4": { + "OpenTelemetry\\Context\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "Context implementation for OpenTelemetry PHP.", + "keywords": [ + "Context", + "opentelemetry", + "otel" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/languages/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2025-10-19T06:44:33+00:00" + }, + { + "name": "open-telemetry/sdk", + "version": "1.15.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/sdk.git", + "reference": "77e1aa73850154abb86937d52a70883edc3b4547" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/77e1aa73850154abb86937d52a70883edc3b4547", + "reference": "77e1aa73850154abb86937d52a70883edc3b4547", + "shasum": "" + }, + "require": { + "ext-json": "*", + "nyholm/psr7-server": "^1.1", + "open-telemetry/api": "^1.8", + "open-telemetry/context": "^1.4", + "open-telemetry/sem-conv": "^1.38.0", + "php": "^8.1", + "php-http/discovery": "^1.14", + "psr/http-client": "^1.0", + "psr/http-client-implementation": "^1.0", + "psr/http-factory-implementation": "^1.0", + "psr/http-message": "^1.0.1|^2.0", + "psr/log": "^1.1|^2.0|^3.0", + "ramsey/uuid": "^3.0 || ^4.0", + "symfony/polyfill-mbstring": "^1.23", + "symfony/polyfill-php82": "^1.26", + "tbachert/spi": "^1.0.5" + }, + "suggest": { + "ext-gmp": "To support unlimited number of synchronous metric readers", + "ext-mbstring": "To increase performance of string operations", + "open-telemetry/sdk-configuration": "File-based OpenTelemetry SDK configuration" + }, + "type": "library", + "extra": { + "spi": { + "OpenTelemetry\\API\\Configuration\\ConfigEnv\\EnvComponentLoader": [ + "OpenTelemetry\\API\\Instrumentation\\Configuration\\General\\ConfigEnv\\EnvComponentLoaderHttpConfig", + "OpenTelemetry\\API\\Instrumentation\\Configuration\\General\\ConfigEnv\\EnvComponentLoaderPeerConfig", + "OpenTelemetry\\SDK\\ConfigEnv\\Trace\\SpanSuppressionStrategySemConv", + "OpenTelemetry\\SDK\\ConfigEnv\\Trace\\SpanSuppressionStrategySpanKind", + "OpenTelemetry\\SDK\\ConfigEnv\\Distribution\\DistributionConfigurationSdk" + ], + "OpenTelemetry\\SDK\\Common\\Configuration\\Resolver\\ResolverInterface": [ + "OpenTelemetry\\SDK\\Common\\Configuration\\Resolver\\SdkConfigurationResolver" + ], + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" + ] + }, + "branch-alias": { + "dev-main": "1.14.x-dev" + } + }, + "autoload": { + "files": [ + "Common/Util/functions.php", + "Logs/Exporter/_register.php", + "Metrics/MetricExporter/_register.php", + "Propagation/_register.php", + "Trace/SpanExporter/_register.php", + "Common/Dev/Compatibility/_load.php", + "_autoload.php" + ], + "psr-4": { + "OpenTelemetry\\SDK\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "SDK for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "apm", + "logging", + "opentelemetry", + "otel", + "sdk", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/languages/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2026-07-14T13:09:54+00:00" + }, + { + "name": "open-telemetry/sem-conv", + "version": "1.44.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/sem-conv.git", + "reference": "c94bc7ebacef039cda4f4c9270807dcc58b4e3af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/c94bc7ebacef039cda4f4c9270807dcc58b4e3af", + "reference": "c94bc7ebacef039cda4f4c9270807dcc58b4e3af", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "OpenTelemetry\\SemConv\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "Semantic conventions for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "apm", + "logging", + "opentelemetry", + "otel", + "semantic conventions", + "semconv", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/languages/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2026-09-09T22:06:17+00:00" + }, + { + "name": "paragonie/constant_time_encoding", + "version": "v3.1.3", + "source": { + "type": "git", + "url": "https://github.com/paragonie/constant_time_encoding.git", + "reference": "d5b01a39b3415c2cd581d3bd3a3575c1ebbd8e77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/d5b01a39b3415c2cd581d3bd3a3575c1ebbd8e77", + "reference": "d5b01a39b3415c2cd581d3bd3a3575c1ebbd8e77", + "shasum": "" + }, + "require": { + "php": "^8" + }, + "require-dev": { + "infection/infection": "^0", + "nikic/php-fuzzer": "^0", + "phpunit/phpunit": "^9|^10|^11", + "vimeo/psalm": "^4|^5|^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "ParagonIE\\ConstantTime\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com", + "role": "Maintainer" + }, + { + "name": "Steve 'Sc00bz' Thomas", + "email": "steve@tobtu.com", + "homepage": "https://www.tobtu.com", + "role": "Original Developer" + } + ], + "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", + "keywords": [ + "base16", + "base32", + "base32_decode", + "base32_encode", + "base64", + "base64_decode", + "base64_encode", + "bin2hex", + "encoding", + "hex", + "hex2bin", + "rfc4648" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/constant_time_encoding/issues", + "source": "https://github.com/paragonie/constant_time_encoding" + }, + "time": "2025-09-24T15:06:41+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.100", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", + "shasum": "" + }, + "require": { + "php": ">= 7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, + "time": "2020-10-15T08:29:30+00:00" }, { "name": "php-http/discovery", @@ -3449,199 +4830,18 @@ }, "time": "2024-10-02T11:20:13+00:00" }, - { - "name": "php-http/httplug", - "version": "2.4.1", - "source": { - "type": "git", - "url": "https://github.com/php-http/httplug.git", - "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/5cad731844891a4c282f3f3e1b582c46839d22f4", - "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "php-http/promise": "^1.1", - "psr/http-client": "^1.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "require-dev": { - "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0", - "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eric GELOEN", - "email": "geloen.eric@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" - } - ], - "description": "HTTPlug, the HTTP client abstraction for PHP", - "homepage": "http://httplug.io", - "keywords": [ - "client", - "http" - ], - "support": { - "issues": "https://github.com/php-http/httplug/issues", - "source": "https://github.com/php-http/httplug/tree/2.4.1" - }, - "time": "2024-09-23T11:39:58+00:00" - }, - { - "name": "php-http/message", - "version": "1.16.2", - "source": { - "type": "git", - "url": "https://github.com/php-http/message.git", - "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/06dd5e8562f84e641bf929bfe699ee0f5ce8080a", - "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a", - "shasum": "" - }, - "require": { - "clue/stream-filter": "^1.5", - "php": "^7.2 || ^8.0", - "psr/http-message": "^1.1 || ^2.0" - }, - "provide": { - "php-http/message-factory-implementation": "1.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.6", - "ext-zlib": "*", - "guzzlehttp/psr7": "^1.0 || ^2.0", - "laminas/laminas-diactoros": "^2.0 || ^3.0", - "php-http/message-factory": "^1.0.2", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "slim/slim": "^3.0" - }, - "suggest": { - "ext-zlib": "Used with compressor/decompressor streams", - "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", - "laminas/laminas-diactoros": "Used with Diactoros Factories", - "slim/slim": "Used with Slim Framework PSR-7 implementation" - }, - "type": "library", - "autoload": { - "files": [ - "src/filters.php" - ], - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "HTTP Message related tools", - "homepage": "http://php-http.org", - "keywords": [ - "http", - "message", - "psr-7" - ], - "support": { - "issues": "https://github.com/php-http/message/issues", - "source": "https://github.com/php-http/message/tree/1.16.2" - }, - "time": "2024-10-02T11:34:13+00:00" - }, - { - "name": "php-http/message-factory", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/message-factory.git", - "reference": "4d8778e1c7d405cbb471574821c1ff5b68cc8f57" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message-factory/zipball/4d8778e1c7d405cbb471574821c1ff5b68cc8f57", - "reference": "4d8778e1c7d405cbb471574821c1ff5b68cc8f57", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "psr/http-message": "^1.0 || ^2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Factory interfaces for PSR-7 HTTP Message", - "homepage": "http://php-http.org", - "keywords": [ - "factory", - "http", - "message", - "stream", - "uri" - ], - "support": { - "issues": "https://github.com/php-http/message-factory/issues", - "source": "https://github.com/php-http/message-factory/tree/1.1.0" - }, - "abandoned": "psr/http-factory", - "time": "2023-04-14T14:16:17+00:00" - }, { "name": "php-http/promise", - "version": "1.3.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/php-http/promise.git", - "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83" + "reference": "b81bdf5a8e82a065fd73eb82919f28e0ac4d2a1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/fc85b1fba37c169a69a07ef0d5a8075770cc1f83", - "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83", + "url": "https://api.github.com/repos/php-http/promise/zipball/b81bdf5a8e82a065fd73eb82919f28e0ac4d2a1b", + "reference": "b81bdf5a8e82a065fd73eb82919f28e0ac4d2a1b", "shasum": "" }, "require": { @@ -3678,28 +4878,30 @@ ], "support": { "issues": "https://github.com/php-http/promise/issues", - "source": "https://github.com/php-http/promise/tree/1.3.1" + "source": "https://github.com/php-http/promise/tree/1.2.2" }, - "time": "2024-03-15T13:55:21+00:00" + "time": "2025-11-08T15:23:07+00:00" }, { "name": "phpoffice/phpspreadsheet", - "version": "1.25.2", + "version": "5.10.0", "source": { "type": "git", "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", - "reference": "a317a09e7def49852400a4b3eca4a4b0790ceeb5" + "reference": "eb18727acf6b1f4cc67145a52ab04f9fd4c28d53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/a317a09e7def49852400a4b3eca4a4b0790ceeb5", - "reference": "a317a09e7def49852400a4b3eca4a4b0790ceeb5", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/eb18727acf6b1f4cc67145a52ab04f9fd4c28d53", + "reference": "eb18727acf6b1f4cc67145a52ab04f9fd4c28d53", "shasum": "" }, "require": { + "composer/pcre": "^1||^2||^3", "ext-ctype": "*", "ext-dom": "*", "ext-fileinfo": "*", + "ext-filter": "*", "ext-gd": "*", "ext-iconv": "*", "ext-libxml": "*", @@ -3710,31 +4912,32 @@ "ext-xmlwriter": "*", "ext-zip": "*", "ext-zlib": "*", - "ezyang/htmlpurifier": "^4.15", - "maennchen/zipstream-php": "^2.1", + "maennchen/zipstream-php": "^2.1 || ^3.0", "markbaker/complex": "^3.0", "markbaker/matrix": "^3.0", - "php": "^7.3 || ^8.0", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0", + "php": "^8.2", "psr/simple-cache": "^1.0 || ^2.0 || ^3.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "dev-master", - "dompdf/dompdf": "^1.0 || ^2.0", + "dealerdirect/phpcodesniffer-composer-installer": "dev-main", + "dompdf/dompdf": "^2.0 || ^3.0", + "ext-intl": "*", + "ext-openssl": "*", "friendsofphp/php-cs-fixer": "^3.2", - "mitoteam/jpgraph": "10.2.4", - "mpdf/mpdf": "8.1.1", + "mitoteam/jpgraph": "^10.5", + "mpdf/mpdf": "^8.1.1", "phpcompatibility/php-compatibility": "^9.3", - "phpstan/phpstan": "^1.1", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^8.5 || ^9.0", + "phpstan/phpstan": "^1.1 || ^2.0", + "phpstan/phpstan-deprecation-rules": "^1.0 || ^2.0", + "phpstan/phpstan-phpunit": "^1.0 || ^2.0", + "phpunit/phpunit": "^10.5 || ^11.0", "squizlabs/php_codesniffer": "^3.7", - "tecnickcom/tcpdf": "6.5" + "tecnickcom/tcpdf": ">=6.8.0 <7.0.0" }, "suggest": { "dompdf/dompdf": "Option for rendering PDF with PDF Writer", - "ext-intl": "PHP Internationalization Functions", + "ext-intl": "PHP Internationalization Functions, required for NumberFormat Wizard and StringHelper::setLocale()", + "ext-openssl": "Handline Agile-encrypted Xlsx spreadsheets", "mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers", "mpdf/mpdf": "Option for rendering PDF with PDF Writer", "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer" @@ -3767,6 +4970,9 @@ }, { "name": "Adrien Crivelli" + }, + { + "name": "Owen Leibman" } ], "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", @@ -3783,22 +4989,22 @@ ], "support": { "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", - "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.25.2" + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/5.10.0" }, - "time": "2022-09-25T17:21:01+00:00" + "time": "2026-09-17T03:54:50+00:00" }, { "name": "phpoption/phpoption", - "version": "1.9.3", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54" + "reference": "67b192b6a42ec03944b972d6e633ddec78ad2c6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/e3fac8b24f56113f7cb96af14958c0dd16330f54", - "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/67b192b6a42ec03944b972d6e633ddec78ad2c6d", + "reference": "67b192b6a42ec03944b972d6e633ddec78ad2c6d", "shasum": "" }, "require": { @@ -3806,7 +5012,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" + "phpunit/phpunit": "^8.5.54 || ^9.6.36 || ^10.5.64 || ^11.5.56 || ^12.5.33" }, "type": "library", "extra": { @@ -3848,7 +5054,7 @@ ], "support": { "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.3" + "source": "https://github.com/schmittjoh/php-option/tree/1.10.0" }, "funding": [ { @@ -3860,36 +5066,36 @@ "type": "tidelift" } ], - "time": "2024-07-20T21:41:07+00:00" + "time": "2026-08-24T00:54:40+00:00" }, { "name": "phpseclib/phpseclib", - "version": "2.0.51", + "version": "3.0.57", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "ed661e7cdaeb8c419e609e2f3203551a13c2ed48" + "reference": "d17e0ddaeaf6f22f7e007cbb437d78792fe2a0e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/ed661e7cdaeb8c419e609e2f3203551a13c2ed48", - "reference": "ed661e7cdaeb8c419e609e2f3203551a13c2ed48", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/d17e0ddaeaf6f22f7e007cbb437d78792fe2a0e4", + "reference": "d17e0ddaeaf6f22f7e007cbb437d78792fe2a0e4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "paragonie/constant_time_encoding": "^1|^2|^3", + "paragonie/random_compat": "^1.4|^2.0|^9.99.99", + "php": ">=5.6.1" }, "require-dev": { - "phing/phing": "~2.7", - "phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4", - "squizlabs/php_codesniffer": "~2.0" + "phpunit/phpunit": "*" }, "suggest": { + "ext-dom": "Install the DOM extension to load XML formatted public keys.", "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", - "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations.", - "ext-xml": "Install the XML extension to load XML formatted public keys." + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." }, "type": "library", "autoload": { @@ -3897,7 +5103,7 @@ "phpseclib/bootstrap.php" ], "psr-4": { - "phpseclib\\": "phpseclib/" + "phpseclib3\\": "phpseclib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3954,7 +5160,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/2.0.51" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.57" }, "funding": [ { @@ -3970,7 +5176,79 @@ "type": "tidelift" } ], - "time": "2026-01-27T09:11:52+00:00" + "time": "2026-08-26T12:13:21+00:00" + }, + { + "name": "propaganistas/laravel-phone", + "version": "6.1.0", + "source": { + "type": "git", + "url": "https://github.com/Propaganistas/Laravel-Phone.git", + "reference": "7433d79ea4b1f7cd07e752ba9c0fce3ac2898362" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Propaganistas/Laravel-Phone/zipball/7433d79ea4b1f7cd07e752ba9c0fce3ac2898362", + "reference": "7433d79ea4b1f7cd07e752ba9c0fce3ac2898362", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "giggsey/libphonenumber-for-php-lite": "^9.0", + "illuminate/contracts": "^11.0|^12.0|^13.0", + "illuminate/support": "^11.0|^12.0|^13.0", + "illuminate/validation": "^11.0|^12.0|^13.0", + "php": "^8.2" + }, + "require-dev": { + "laravel/pint": "^1.21", + "orchestra/testbench": "*", + "phpunit/phpunit": "^11.5.3" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Propaganistas\\LaravelPhone\\PhoneServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Propaganistas\\LaravelPhone\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Propaganistas", + "email": "Propaganistas@users.noreply.github.com" + } + ], + "description": "Adds phone number functionality to Laravel based on Google's libphonenumber API.", + "keywords": [ + "laravel", + "libphonenumber", + "phone", + "validation" + ], + "support": { + "issues": "https://github.com/Propaganistas/Laravel-Phone/issues", + "source": "https://github.com/Propaganistas/Laravel-Phone/tree/6.1.0" + }, + "funding": [ + { + "url": "https://github.com/Propaganistas", + "type": "github" + } + ], + "time": "2026-10-02T06:58:06+00:00" }, { "name": "psr/clock", @@ -4022,22 +5300,27 @@ }, { "name": "psr/container", - "version": "1.1.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -4064,9 +5347,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2021-03-05T17:36:06+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { "name": "psr/event-dispatcher", @@ -4227,16 +5510,16 @@ }, { "name": "psr/http-message", - "version": "1.1", + "version": "2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { @@ -4245,7 +5528,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -4260,7 +5543,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -4274,36 +5557,36 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/1.1" + "source": "https://github.com/php-fig/http-message/tree/2.0" }, - "time": "2023-04-04T09:50:52+00:00" + "time": "2023-04-04T09:54:51+00:00" }, { "name": "psr/log", - "version": "1.1.4", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -4324,31 +5607,31 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, - "time": "2021-05-03T11:20:27+00:00" + "time": "2024-09-11T13:17:53+00:00" }, { "name": "psr/simple-cache", - "version": "1.0.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -4363,7 +5646,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for simple caching", @@ -4375,43 +5658,43 @@ "simple-cache" ], "support": { - "source": "https://github.com/php-fig/simple-cache/tree/master" + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" }, - "time": "2017-10-23T01:57:42+00:00" + "time": "2021-10-29T13:26:27+00:00" }, { "name": "psy/psysh", - "version": "v0.11.22", + "version": "v0.12.24", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "128fa1b608be651999ed9789c95e6e2a31b5802b" + "reference": "ca0fdcf8a7617afa3adfdf1b5fef573dffb69ca1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/128fa1b608be651999ed9789c95e6e2a31b5802b", - "reference": "128fa1b608be651999ed9789c95e6e2a31b5802b", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/ca0fdcf8a7617afa3adfdf1b5fef573dffb69ca1", + "reference": "ca0fdcf8a7617afa3adfdf1b5fef573dffb69ca1", "shasum": "" }, "require": { "ext-json": "*", "ext-tokenizer": "*", - "nikic/php-parser": "^4.0 || ^3.1", - "php": "^8.0 || ^7.0.8", - "symfony/console": "^6.0 || ^5.0 || ^4.0 || ^3.4", - "symfony/var-dumper": "^6.0 || ^5.0 || ^4.0 || ^3.4" + "nikic/php-parser": "^5.0 || ^4.0", + "php": "^8.0 || ^7.4", + "symfony/console": "^8.0 || ^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4", + "symfony/var-dumper": "^8.0 || ^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4" }, "conflict": { "symfony/console": "4.4.37 || 5.3.14 || 5.3.15 || 5.4.3 || 5.4.4 || 6.0.3 || 6.0.4" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.2" + "bamarni/composer-bin-plugin": "^1.2", + "composer/class-map-generator": "^1.6" }, "suggest": { + "composer/class-map-generator": "Improved tab completion performance with better class discovery.", "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", - "ext-pdo-sqlite": "The doc command requires SQLite to work.", - "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", - "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history." + "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well." }, "bin": [ "bin/psysh" @@ -4423,7 +5706,7 @@ "forward-command": false }, "branch-alias": { - "dev-0.11": "0.11.x-dev" + "dev-main": "0.12.x-dev" } }, "autoload": { @@ -4441,12 +5724,11 @@ "authors": [ { "name": "Justin Hileman", - "email": "justin@justinhileman.info", - "homepage": "http://justinhileman.com" + "email": "justin@justinhileman.info" } ], "description": "An interactive shell for modern PHP.", - "homepage": "http://psysh.org", + "homepage": "https://psysh.org", "keywords": [ "REPL", "console", @@ -4455,9 +5737,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.22" + "source": "https://github.com/bobthecow/psysh/tree/v0.12.24" }, - "time": "2023-10-14T21:56:36+00:00" + "time": "2026-06-29T15:41:09+00:00" }, { "name": "ralouphie/getallheaders", @@ -4505,42 +5787,49 @@ }, { "name": "ramsey/collection", - "version": "1.2.2", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/ramsey/collection.git", - "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a" + "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/cccc74ee5e328031b15640b51056ee8d3bb66c0a", - "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a", + "url": "https://api.github.com/repos/ramsey/collection/zipball/344572933ad0181accbf4ba763e85a0306a8c5e2", + "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2", "shasum": "" }, "require": { - "php": "^7.3 || ^8", - "symfony/polyfill-php81": "^1.23" + "php": "^8.1" }, "require-dev": { - "captainhook/captainhook": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "ergebnis/composer-normalize": "^2.6", - "fakerphp/faker": "^1.5", - "hamcrest/hamcrest-php": "^2", - "jangregor/phpstan-prophecy": "^0.8", - "mockery/mockery": "^1.3", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1", - "phpstan/phpstan": "^0.12.32", - "phpstan/phpstan-mockery": "^0.12.5", - "phpstan/phpstan-phpunit": "^0.12.11", - "phpunit/phpunit": "^8.5 || ^9", - "psy/psysh": "^0.10.4", - "slevomat/coding-standard": "^6.3", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.4" + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.45", + "fakerphp/faker": "^1.24", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^2.1", + "mockery/mockery": "^1.6", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpspec/prophecy-phpunit": "^2.3", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^10.5", + "ramsey/coding-standard": "^2.3", + "ramsey/conventional-commits": "^1.6", + "roave/security-advisories": "dev-latest" }, "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, "autoload": { "psr-4": { "Ramsey\\Collection\\": "src/" @@ -4568,70 +5857,53 @@ ], "support": { "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/1.2.2" + "source": "https://github.com/ramsey/collection/tree/2.1.1" }, - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", - "type": "tidelift" - } - ], - "time": "2021-10-10T03:01:02+00:00" + "time": "2025-03-22T05:38:12+00:00" }, { "name": "ramsey/uuid", - "version": "4.2.3", + "version": "4.9.4", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df" + "reference": "75d73f48d02797c2c285a7e9f348fadc0102ffe2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", - "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/75d73f48d02797c2c285a7e9f348fadc0102ffe2", + "reference": "75d73f48d02797c2c285a7e9f348fadc0102ffe2", "shasum": "" }, "require": { - "brick/math": "^0.8 || ^0.9", - "ext-json": "*", - "php": "^7.2 || ^8.0", - "ramsey/collection": "^1.0", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-php80": "^1.14" + "brick/math": "^0.8.16 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14 || ^0.15 || ^0.16 || ^0.17 || ^0.18 || ^0.19 || ^0.20 || ^1.0", + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" }, "replace": { "rhumsaa/uuid": "self.version" }, "require-dev": { - "captainhook/captainhook": "^5.10", + "captainhook/captainhook": "^5.25", "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.8", - "ergebnis/composer-normalize": "^2.15", - "mockery/mockery": "^1.3", - "moontoast/math": "^1.1", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "ergebnis/composer-normalize": "^2.47", + "mockery/mockery": "^1.6", "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.2", - "php-mock/php-mock-mockery": "^1.3", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-mockery": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^8.5 || ^9", - "slevomat/coding-standard": "^7.0", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.9" + "php-mock/php-mock": "^2.6", + "php-mock/php-mock-mockery": "^1.5", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpbench/phpbench": "^1.2.14", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6", + "slevomat/coding-standard": "^8.18", + "squizlabs/php_codesniffer": "^3.13" }, "suggest": { "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", - "ext-ctype": "Enables faster processing of character classification using ctype functions.", "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", @@ -4641,9 +5913,6 @@ "extra": { "captainhook": { "force-install": true - }, - "branch-alias": { - "dev-main": "4.x-dev" } }, "autoload": { @@ -4666,41 +5935,36 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.2.3" + "source": "https://github.com/ramsey/uuid/tree/4.9.4" }, - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", - "type": "tidelift" - } - ], - "time": "2021-09-25T23:10:38+00:00" + "time": "2026-09-16T11:39:30+00:00" }, { "name": "respect/stringifier", - "version": "0.2.0", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/Respect/Stringifier.git", - "reference": "e55af3c8aeaeaa2abb5fa47a58a8e9688cc23b59" + "reference": "e88515f675b373596d5dcdd9dc6103b8504c7ca5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Respect/Stringifier/zipball/e55af3c8aeaeaa2abb5fa47a58a8e9688cc23b59", - "reference": "e55af3c8aeaeaa2abb5fa47a58a8e9688cc23b59", + "url": "https://api.github.com/repos/Respect/Stringifier/zipball/e88515f675b373596d5dcdd9dc6103b8504c7ca5", + "reference": "e88515f675b373596d5dcdd9dc6103b8504c7ca5", "shasum": "" }, "require": { - "php": ">=7.1" + "php": "^8.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.8", "malukenho/docheader": "^0.1.7", - "phpunit/phpunit": "^6.4" + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-deprecation-rules": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpstan/phpstan-strict-rules": "^1.5", + "phpunit/phpunit": "^10.0", + "respect/coding-standard": "^4.0", + "squizlabs/php_codesniffer": "^3.7" }, "type": "library", "autoload": { @@ -4708,7 +5972,9 @@ "src/stringify.php" ], "psr-4": { - "Respect\\Stringifier\\": "src/" + "Respect\\Stringifier\\": "src/", + "Respect\\Stringifier\\Test\\": "tests/src/", + "Respect\\Stringifier\\Test\\Unit\\": "tests/unit" } }, "notification-url": "https://packagist.org/downloads/", @@ -4722,7 +5988,6 @@ } ], "description": "Converts any value to a string", - "homepage": "http://respect.github.io/Stringifier/", "keywords": [ "respect", "stringifier", @@ -4730,50 +5995,48 @@ ], "support": { "issues": "https://github.com/Respect/Stringifier/issues", - "source": "https://github.com/Respect/Stringifier/tree/0.2.0" + "source": "https://github.com/Respect/Stringifier/tree/1.0.0" }, - "time": "2017-12-29T19:39:25+00:00" + "time": "2023-04-12T20:15:44+00:00" }, { "name": "respect/validation", - "version": "2.2.3", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/Respect/Validation.git", - "reference": "4c21a7ffc9a4915673cb2c2843963919e664e627" + "reference": "48254ed1079fc0879eb03fb2b600f92bb4ecb787" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Respect/Validation/zipball/4c21a7ffc9a4915673cb2c2843963919e664e627", - "reference": "4c21a7ffc9a4915673cb2c2843963919e664e627", + "url": "https://api.github.com/repos/Respect/Validation/zipball/48254ed1079fc0879eb03fb2b600f92bb4ecb787", + "reference": "48254ed1079fc0879eb03fb2b600f92bb4ecb787", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0", - "respect/stringifier": "^0.2.0", + "php": ">=8.1", + "respect/stringifier": "^0.2.0 || ^1.0", "symfony/polyfill-mbstring": "^1.2" }, "require-dev": { - "egulias/email-validator": "^3.0", - "malukenho/docheader": "^0.1", + "egulias/email-validator": "^3.0 || ^4.0", + "giggsey/libphonenumber-for-php-lite": "^8.13 || ^9.0", + "malukenho/docheader": "^1.0", "mikey179/vfsstream": "^1.6", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-deprecation-rules": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^9.3", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-deprecation-rules": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.6", "psr/http-message": "^1.0", - "respect/coding-standard": "^3.0", - "squizlabs/php_codesniffer": "^3.5", - "symfony/validator": "^3.0||^4.0", - "zendframework/zend-validator": "^2.1" + "respect/coding-standard": "^4.0", + "squizlabs/php_codesniffer": "^3.7" }, "suggest": { - "egulias/email-validator": "Strict (RFC compliant) email validation", + "egulias/email-validator": "Improves the Email rule if available", "ext-bcmath": "Arbitrary Precision Mathematics", "ext-fileinfo": "File Information", "ext-mbstring": "Multibyte String Functions", - "symfony/validator": "Use Symfony validator through Respect\\Validation", - "zendframework/zend-validator": "Use Zend Framework validator through Respect\\Validation" + "giggsey/libphonenumber-for-php-lite": "Enables the phone rule if available" }, "type": "library", "autoload": { @@ -4800,119 +6063,100 @@ ], "support": { "issues": "https://github.com/Respect/Validation/issues", - "source": "https://github.com/Respect/Validation/tree/2.2.3" + "source": "https://github.com/Respect/Validation/tree/2.5.0" }, - "time": "2021-03-19T14:12:45+00:00" + "time": "2026-07-22T15:21:03+00:00" }, { - "name": "sentry/sdk", - "version": "3.6.0", + "name": "ruafozy/mersenne-twister", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/getsentry/sentry-php-sdk.git", - "reference": "24c235ff2027401cbea099bf88689e1a1f197c7a" + "url": "https://github.com/ruafozy/php-mersenne-twister.git", + "reference": "61dcb3f7a53a7db332c338a822530cb3be87c37d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php-sdk/zipball/24c235ff2027401cbea099bf88689e1a1f197c7a", - "reference": "24c235ff2027401cbea099bf88689e1a1f197c7a", + "url": "https://api.github.com/repos/ruafozy/php-mersenne-twister/zipball/61dcb3f7a53a7db332c338a822530cb3be87c37d", + "reference": "61dcb3f7a53a7db332c338a822530cb3be87c37d", "shasum": "" }, "require": { - "http-interop/http-factory-guzzle": "^1.0", - "sentry/sentry": "^3.22", - "symfony/http-client": "^4.3|^5.0|^6.0|^7.0" + "php": ">=7.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~9" + }, + "type": "library", + "autoload": { + "files": [ + "src/mersenne_twister.php" + ] }, - "type": "metapackage", "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Sentry", - "email": "accounts@sentry.io" - } - ], - "description": "This is a metapackage shipping sentry/sentry with a recommended HTTP client.", - "homepage": "http://sentry.io", + "description": "Pure-PHP Mersenne Twister", + "homepage": "https://github.com/ruafozy/php-mersenne-twister", "keywords": [ - "crash-reporting", - "crash-reports", - "error-handler", - "error-monitoring", - "log", - "logging", - "sentry" + "PRNG", + "mersenne", + "random" ], "support": { - "issues": "https://github.com/getsentry/sentry-php-sdk/issues", - "source": "https://github.com/getsentry/sentry-php-sdk/tree/3.6.0" + "issues": "https://github.com/ruafozy/php-mersenne-twister/issues", + "source": "https://github.com/ruafozy/php-mersenne-twister/tree/2.0.0" }, - "funding": [ - { - "url": "https://sentry.io/", - "type": "custom" - }, - { - "url": "https://sentry.io/pricing/", - "type": "custom" - } - ], - "time": "2023-12-04T10:49:33+00:00" + "time": "2023-03-25T19:18:10+00:00" }, { "name": "sentry/sentry", - "version": "3.22.1", + "version": "4.33.2", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "8859631ba5ab15bc1af420b0eeed19ecc6c9d81d" + "reference": "8a0556ccb6cdcdce81f9af4ca8714c22cff2e003" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/8859631ba5ab15bc1af420b0eeed19ecc6c9d81d", - "reference": "8859631ba5ab15bc1af420b0eeed19ecc6c9d81d", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/8a0556ccb6cdcdce81f9af4ca8714c22cff2e003", + "reference": "8a0556ccb6cdcdce81f9af4ca8714c22cff2e003", "shasum": "" }, "require": { + "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "guzzlehttp/promises": "^1.5.3|^2.0", + "guzzlehttp/psr7": "^1.8.4|^2.1.1|^3.0.0", "jean85/pretty-package-versions": "^1.5|^2.0.4", "php": "^7.2|^8.0", - "php-http/async-client-implementation": "^1.0", - "php-http/client-common": "^1.5|^2.0", - "php-http/discovery": "^1.15", - "php-http/httplug": "^1.1|^2.0", - "php-http/message": "^1.5", - "php-http/message-factory": "^1.1", - "psr/http-factory": "^1.0", - "psr/http-factory-implementation": "^1.0", "psr/log": "^1.0|^2.0|^3.0", - "symfony/options-resolver": "^3.4.43|^4.4.30|^5.0.11|^6.0|^7.0", - "symfony/polyfill-php80": "^1.17" + "symfony/options-resolver": "^4.4.30|^5.0.11|^6.0|^7.0|^8.0" }, "conflict": { - "php-http/client-common": "1.8.0", "raven/raven": "*" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.19|3.4.*", - "guzzlehttp/psr7": "^1.8.4|^2.1.1", - "http-interop/http-factory-guzzle": "^1.0", + "carthage-software/mago": "1.30.0", + "friendsofphp/php-cs-fixer": "^3.4", + "guzzlehttp/guzzle": "^7.0|^8.0", + "guzzlehttp/promises": "^2.0.3|^3.0.0", "monolog/monolog": "^1.6|^2.0|^3.0", - "nikic/php-parser": "^4.10.3", - "php-http/mock-client": "^1.3", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.0", + "nyholm/psr7": "^1.8", + "open-telemetry/api": "^1.1", + "open-telemetry/context": "^1.1", + "open-telemetry/exporter-otlp": "^1.1", + "open-telemetry/gen-otlp-protobuf": "^1.2.1", + "open-telemetry/sdk": "^1.1", + "open-telemetry/sem-conv": "^1.27", "phpstan/phpstan": "^1.3", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^8.5.14|^9.4", - "symfony/phpunit-bridge": "^5.2|^6.0", - "vimeo/psalm": "^4.17" + "phpunit/phpunit": "^8.5.52|^9.6.34", + "spiral/roadrunner-http": "^3.6", + "spiral/roadrunner-worker": "^3.6" }, "suggest": { + "ext-excimer": "Enable Sentry profiling with the Excimer PHP extension.", "monolog/monolog": "Allow sending log messages to Sentry by using the included Monolog handler." }, "type": "library", @@ -4934,7 +6178,7 @@ "email": "accounts@sentry.io" } ], - "description": "A PHP SDK for Sentry (http://sentry.io)", + "description": "PHP SDK for Sentry (http://sentry.io)", "homepage": "http://sentry.io", "keywords": [ "crash-reporting", @@ -4943,11 +6187,13 @@ "error-monitoring", "log", "logging", - "sentry" + "profiling", + "sentry", + "tracing" ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/3.22.1" + "source": "https://github.com/getsentry/sentry-php/tree/4.33.2" }, "funding": [ { @@ -4959,38 +6205,42 @@ "type": "custom" } ], - "time": "2023-11-13T11:47:28+00:00" + "time": "2026-10-07T12:48:05+00:00" }, { "name": "sentry/sentry-laravel", - "version": "3.8.2", + "version": "4.28.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-laravel.git", - "reference": "1293e5732f8405e12f000cdf5dee78c927a18de0" + "reference": "34bf18fbf99b884a9bfbb46957d0178d2d0b988e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/1293e5732f8405e12f000cdf5dee78c927a18de0", - "reference": "1293e5732f8405e12f000cdf5dee78c927a18de0", + "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/34bf18fbf99b884a9bfbb46957d0178d2d0b988e", + "reference": "34bf18fbf99b884a9bfbb46957d0178d2d0b988e", "shasum": "" }, "require": { - "illuminate/support": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", + "illuminate/support": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0 | ^12.0 | ^13.0", "nyholm/psr7": "^1.0", "php": "^7.2 | ^8.0", - "sentry/sdk": "^3.4", - "sentry/sentry": "^3.20.1", - "symfony/psr-http-message-bridge": "^1.0 | ^2.0" + "sentry/sentry": "^4.31.0", + "symfony/psr-http-message-bridge": "^1.0 | ^2.0 | ^6.0 | ^7.0 | ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.11", - "laravel/folio": "^1.0", - "laravel/framework": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", + "guzzlehttp/guzzle": "^7.2", + "laravel/ai": "^0.1.5", + "laravel/folio": "^1.1", + "laravel/framework": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0 | ^12.0 | ^13.0", + "laravel/octane": "^2.15", + "laravel/pennant": "^1.0", + "livewire/livewire": "^2.0 | ^3.0 | ^4.0", "mockery/mockery": "^1.3", - "orchestra/testbench": "^4.7 | ^5.1 | ^6.0 | ^7.0 | ^8.0", + "orchestra/testbench": "^4.7 | ^5.1 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0", "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^8.4 | ^9.3" + "phpunit/phpunit": "^8.5 | ^9.6 | ^10.4 | ^11.5" }, "type": "library", "extra": { @@ -5002,12 +6252,6 @@ "Sentry\\Laravel\\ServiceProvider", "Sentry\\Laravel\\Tracing\\ServiceProvider" ] - }, - "branch-alias": { - "dev-0.x": "0.x-dev", - "dev-1.x": "1.x-dev", - "dev-2.x": "2.x-dev", - "dev-master": "3.x-dev" } }, "autoload": { @@ -5035,11 +6279,13 @@ "laravel", "log", "logging", - "sentry" + "profiling", + "sentry", + "tracing" ], "support": { "issues": "https://github.com/getsentry/sentry-laravel/issues", - "source": "https://github.com/getsentry/sentry-laravel/tree/3.8.2" + "source": "https://github.com/getsentry/sentry-laravel/tree/4.28.0" }, "funding": [ { @@ -5051,103 +6297,49 @@ "type": "custom" } ], - "time": "2023-10-12T14:38:46+00:00" - }, - { - "name": "spatie/browsershot", - "version": "3.40.2", - "source": { - "type": "git", - "url": "https://github.com/spatie/browsershot.git", - "reference": "3e55eaf5ab8cee65d1661a567e89b3374afb9116" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/browsershot/zipball/3e55eaf5ab8cee65d1661a567e89b3374afb9116", - "reference": "3e55eaf5ab8cee65d1661a567e89b3374afb9116", - "shasum": "" - }, - "require": { - "php": "^7.1", - "spatie/image": "^1.5.3", - "spatie/temporary-directory": "^1.1", - "symfony/process": "^4.2|^5.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.1|^7.5", - "spatie/phpunit-snapshot-assertions": "^1.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\Browsershot\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://github.com/freekmurze", - "role": "Developer" - } - ], - "description": "Convert a webpage to an image or pdf using headless Chrome", - "homepage": "https://github.com/spatie/browsershot", - "keywords": [ - "chrome", - "convert", - "headless", - "image", - "pdf", - "puppeteer", - "screenshot", - "webpage" - ], - "support": { - "issues": "https://github.com/spatie/browsershot/issues", - "source": "https://github.com/spatie/browsershot/tree/3.40.2" - }, - "funding": [ - { - "url": "https://github.com/spatie", - "type": "github" - } - ], - "time": "2020-11-11T22:18:15+00:00" + "time": "2026-09-23T14:29:19+00:00" }, { "name": "spatie/crawler", - "version": "4.7.6", + "version": "9.4.2", "source": { "type": "git", "url": "https://github.com/spatie/crawler.git", - "reference": "fe6e428b8ceaec561b9819bb948242ad0cfd40bb" + "reference": "937bcf5786e66bca20da50db004f6d1443e81418" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/crawler/zipball/fe6e428b8ceaec561b9819bb948242ad0cfd40bb", - "reference": "fe6e428b8ceaec561b9819bb948242ad0cfd40bb", + "url": "https://api.github.com/repos/spatie/crawler/zipball/937bcf5786e66bca20da50db004f6d1443e81418", + "reference": "937bcf5786e66bca20da50db004f6d1443e81418", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "^6.3 || ^7.0", - "guzzlehttp/psr7": "^1.4", - "nicmart/tree": "^0.3.0", - "php": "^7.3|^8.0", - "spatie/browsershot": "^3.14", - "spatie/robots-txt": "^1.0.1", - "symfony/dom-crawler": "^4.0 || ^5.0", - "tightenco/collect": "^5.6 || ^6.0 || ^7.0" + "guzzlehttp/guzzle": "^7.8.2 || ^8.0", + "guzzlehttp/psr7": "^2.6.3 || ^3.0", + "php": "^8.4", + "psr/http-client": "^1.0", + "spatie/robots-txt": "^2.0", + "symfony/css-selector": "^7.0|^8.0", + "symfony/dom-crawler": "^7.0|^8.0" }, "require-dev": { - "larapack/dd": "^1.1", - "phpunit/phpunit": "^9.0" + "pestphp/pest": "^4.0", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "spatie/invade": "^2.1", + "spatie/ray": "^1.37" + }, + "suggest": { + "spatie/browsershot": "Required for JavaScript rendering with BrowsershotRenderer (^5.0.5)" }, "type": "library", + "extra": { + "branch-alias": { + "dev-v9": "9.x-dev" + } + }, "autoload": { "psr-4": { "Spatie\\Crawler\\": "src" @@ -5173,72 +6365,7 @@ ], "support": { "issues": "https://github.com/spatie/crawler/issues", - "source": "https://github.com/spatie/crawler/tree/4.7.6" - }, - "funding": [ - { - "url": "https://github.com/spatie", - "type": "github" - } - ], - "time": "2020-12-01T20:55:10+00:00" - }, - { - "name": "spatie/image", - "version": "1.10.6", - "source": { - "type": "git", - "url": "https://github.com/spatie/image.git", - "reference": "897e819848096ea8eee8ed4a3531c6166f9a99e0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/image/zipball/897e819848096ea8eee8ed4a3531c6166f9a99e0", - "reference": "897e819848096ea8eee8ed4a3531c6166f9a99e0", - "shasum": "" - }, - "require": { - "ext-exif": "*", - "ext-json": "*", - "ext-mbstring": "*", - "league/glide": "^1.6", - "php": "^7.2|^8.0", - "spatie/image-optimizer": "^1.1", - "spatie/temporary-directory": "^1.0|^2.0", - "symfony/process": "^3.0|^4.0|^5.0|^6.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.21|^9.5.4", - "symfony/var-dumper": "^4.0|^5.0|^6.0", - "vimeo/psalm": "^4.6" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\Image\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "Manipulate images with an expressive API", - "homepage": "https://github.com/spatie/image", - "keywords": [ - "image", - "spatie" - ], - "support": { - "issues": "https://github.com/spatie/image/issues", - "source": "https://github.com/spatie/image/tree/1.10.6" + "source": "https://github.com/spatie/crawler/tree/9.4.2" }, "funding": [ { @@ -5250,37 +6377,38 @@ "type": "github" } ], - "time": "2021-12-21T10:01:09+00:00" + "time": "2026-08-07T07:19:51+00:00" }, { - "name": "spatie/image-optimizer", - "version": "1.8.0", + "name": "spatie/laravel-package-tools", + "version": "1.93.3", "source": { "type": "git", - "url": "https://github.com/spatie/image-optimizer.git", - "reference": "4fd22035e81d98fffced65a8c20d9ec4daa9671c" + "url": "https://github.com/spatie/laravel-package-tools.git", + "reference": "7aeef26bd8d4909bec744dbf47aee7d1395588c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/image-optimizer/zipball/4fd22035e81d98fffced65a8c20d9ec4daa9671c", - "reference": "4fd22035e81d98fffced65a8c20d9ec4daa9671c", + "url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/7aeef26bd8d4909bec744dbf47aee7d1395588c1", + "reference": "7aeef26bd8d4909bec744dbf47aee7d1395588c1", "shasum": "" }, "require": { - "ext-fileinfo": "*", - "php": "^7.3|^8.0", - "psr/log": "^1.0 | ^2.0 | ^3.0", - "symfony/process": "^4.2|^5.0|^6.0|^7.0" + "illuminate/contracts": "^10.0|^11.0|^12.0|^13.0", + "php": "^8.1" }, "require-dev": { - "pestphp/pest": "^1.21", - "phpunit/phpunit": "^8.5.21|^9.4.4", - "symfony/var-dumper": "^4.2|^5.0|^6.0|^7.0" + "mockery/mockery": "^1.5", + "orchestra/testbench": "^8.0|^9.2|^10.0|^11.0", + "pestphp/pest": "^2.1|^3.1|^4.0", + "phpunit/php-code-coverage": "^10.0|^11.0|^12.0", + "phpunit/phpunit": "^10.5|^11.5|^12.5", + "spatie/pest-plugin-test-time": "^2.2|^3.0" }, "type": "library", "autoload": { "psr-4": { - "Spatie\\ImageOptimizer\\": "src" + "Spatie\\LaravelPackageTools\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -5291,48 +6419,58 @@ { "name": "Freek Van der Herten", "email": "freek@spatie.be", - "homepage": "https://spatie.be", "role": "Developer" } ], - "description": "Easily optimize images using PHP", - "homepage": "https://github.com/spatie/image-optimizer", + "description": "Tools for creating Laravel packages", + "homepage": "https://github.com/spatie/laravel-package-tools", "keywords": [ - "image-optimizer", + "laravel-package-tools", "spatie" ], "support": { - "issues": "https://github.com/spatie/image-optimizer/issues", - "source": "https://github.com/spatie/image-optimizer/tree/1.8.0" + "issues": "https://github.com/spatie/laravel-package-tools/issues", + "source": "https://github.com/spatie/laravel-package-tools/tree/1.93.3" }, - "time": "2024-11-04T08:24:54+00:00" + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2026-09-28T07:16:50+00:00" }, { "name": "spatie/laravel-sitemap", - "version": "5.8.0", + "version": "8.2.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-sitemap.git", - "reference": "90c4dd061ba251c2bff9edf83d5e1d38d17f1529" + "reference": "51f52030ab22abf5e95ed037fea5f8073114e784" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-sitemap/zipball/90c4dd061ba251c2bff9edf83d5e1d38d17f1529", - "reference": "90c4dd061ba251c2bff9edf83d5e1d38d17f1529", + "url": "https://api.github.com/repos/spatie/laravel-sitemap/zipball/51f52030ab22abf5e95ed037fea5f8073114e784", + "reference": "51f52030ab22abf5e95ed037fea5f8073114e784", "shasum": "" }, "require": { - "illuminate/support": "~5.8.0|^6.0|^7.0|^8.0", - "nesbot/carbon": "^1.21|^2.0", - "php": "^7.2", - "spatie/crawler": "^4.1.0" + "illuminate/support": "^12.0|^13.0", + "nesbot/carbon": "^2.71|^3.0", + "php": "^8.4", + "spatie/crawler": "^9.0", + "spatie/laravel-package-tools": "^1.16.1" }, "require-dev": { - "mockery/mockery": "^1.3.1", - "orchestra/testbench": "~3.8.8|^4.0|^5.0|^6.0", - "phpunit/phpunit": "^8.3|^9.0|^9.3", - "spatie/phpunit-snapshot-assertions": "^3.0.0", - "spatie/temporary-directory": "^1.1" + "larastan/larastan": "^3.0", + "laravel/pint": "^1.13", + "orchestra/testbench": "^10.0|^11.0", + "pestphp/pest": "^4.0", + "phpstan/extension-installer": "^1.3", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "spatie/pest-plugin-snapshots": "^2.1", + "spatie/temporary-directory": "^2.2" }, "type": "library", "extra": { @@ -5366,8 +6504,7 @@ "spatie" ], "support": { - "issues": "https://github.com/spatie/laravel-sitemap/issues", - "source": "https://github.com/spatie/laravel-sitemap/tree/5.8.0" + "source": "https://github.com/spatie/laravel-sitemap/tree/8.2.0" }, "funding": [ { @@ -5375,28 +6512,27 @@ "type": "custom" } ], - "time": "2020-09-09T09:29:31+00:00" + "time": "2026-06-24T07:59:14+00:00" }, { "name": "spatie/robots-txt", - "version": "1.0.10", + "version": "2.5.4", "source": { "type": "git", "url": "https://github.com/spatie/robots-txt.git", - "reference": "8802a2bee670b3c13cfd21ede0322f72b3efb711" + "reference": "a8dd35d0a94e863f52509a366a634978e9c1db03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/robots-txt/zipball/8802a2bee670b3c13cfd21ede0322f72b3efb711", - "reference": "8802a2bee670b3c13cfd21ede0322f72b3efb711", + "url": "https://api.github.com/repos/spatie/robots-txt/zipball/a8dd35d0a94e863f52509a366a634978e9c1db03", + "reference": "a8dd35d0a94e863f52509a366a634978e9c1db03", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": "^8.1" }, "require-dev": { - "larapack/dd": "^1.0", - "phpunit/phpunit": "^8.0 || ^9.0" + "phpunit/phpunit": "^11.5.2" }, "type": "library", "autoload": { @@ -5424,98 +6560,90 @@ ], "support": { "issues": "https://github.com/spatie/robots-txt/issues", - "source": "https://github.com/spatie/robots-txt/tree/1.0.10" + "source": "https://github.com/spatie/robots-txt/tree/2.5.4" }, - "time": "2020-12-07T11:10:49+00:00" + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2026-02-25T07:59:20+00:00" }, { - "name": "spatie/temporary-directory", - "version": "1.3.0", + "name": "stduritemplate/stduritemplate", + "version": "2.0.12", "source": { "type": "git", - "url": "https://github.com/spatie/temporary-directory.git", - "reference": "f517729b3793bca58f847c5fd383ec16f03ffec6" + "url": "https://github.com/std-uritemplate/std-uritemplate-php.git", + "reference": "fd18ebed22ded14a5833ab69d91443b19bd28647" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/temporary-directory/zipball/f517729b3793bca58f847c5fd383ec16f03ffec6", - "reference": "f517729b3793bca58f847c5fd383ec16f03ffec6", + "url": "https://api.github.com/repos/std-uritemplate/std-uritemplate-php/zipball/fd18ebed22ded14a5833ab69d91443b19bd28647", + "reference": "fd18ebed22ded14a5833ab69d91443b19bd28647", "shasum": "" }, "require": { - "php": "^7.2|^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.0|^9.0" + "php": "^7.4 || ^8.0" }, "type": "library", "autoload": { "psr-4": { - "Spatie\\TemporaryDirectory\\": "src" + "StdUriTemplate\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "Apache-2.0" ], "authors": [ { - "name": "Alex Vanderbist", - "email": "alex@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" + "name": "Andrea Peruffo", + "email": "andrea.peruffo1982@gmail.com" } ], - "description": "Easily create, use and destroy temporary directories", - "homepage": "https://github.com/spatie/temporary-directory", - "keywords": [ - "php", - "spatie", - "temporary-directory" - ], + "description": "Std UriTemplate, RFC 6570 implementation", "support": { - "issues": "https://github.com/spatie/temporary-directory/issues", - "source": "https://github.com/spatie/temporary-directory/tree/1.3.0" + "source": "https://github.com/std-uritemplate/std-uritemplate-php/tree/2.0.12" }, - "time": "2020-11-09T15:54:21+00:00" + "time": "2026-07-16T11:03:57+00:00" }, { - "name": "swiftmailer/swiftmailer", - "version": "v6.3.0", + "name": "symfony/clock", + "version": "v8.1.0", "source": { "type": "git", - "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "8a5d5072dca8f48460fce2f4131fcc495eec654c" + "url": "https://github.com/symfony/clock.git", + "reference": "701ef4de9705d6c32292ebee5e8044094a09fbf6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/8a5d5072dca8f48460fce2f4131fcc495eec654c", - "reference": "8a5d5072dca8f48460fce2f4131fcc495eec654c", + "url": "https://api.github.com/repos/symfony/clock/zipball/701ef4de9705d6c32292ebee5e8044094a09fbf6", + "reference": "701ef4de9705d6c32292ebee5e8044094a09fbf6", "shasum": "" }, "require": { - "egulias/email-validator": "^2.0|^3.1", - "php": ">=7.0.0", - "symfony/polyfill-iconv": "^1.0", - "symfony/polyfill-intl-idn": "^1.10", - "symfony/polyfill-mbstring": "^1.0" + "php": ">=8.4.1", + "psr/clock": "^1.0" }, - "require-dev": { - "mockery/mockery": "^1.0", - "symfony/phpunit-bridge": "^4.4|^5.4" - }, - "suggest": { - "ext-intl": "Needed to support internationalized email addresses" + "provide": { + "psr/clock-implementation": "1.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.2-dev" - } - }, "autoload": { "files": [ - "lib/swift_required.php" + "Resources/now.php" + ], + "psr-4": { + "Symfony\\Component\\Clock\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -5524,85 +6652,89 @@ ], "authors": [ { - "name": "Chris Corbyn" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Swiftmailer, free feature-rich PHP mailer", - "homepage": "https://swiftmailer.symfony.com", + "description": "Decouples applications from the system clock", + "homepage": "https://symfony.com", "keywords": [ - "email", - "mail", - "mailer" + "clock", + "psr20", + "time" ], "support": { - "issues": "https://github.com/swiftmailer/swiftmailer/issues", - "source": "https://github.com/swiftmailer/swiftmailer/tree/v6.3.0" + "source": "https://github.com/symfony/clock/tree/v8.1.0" }, "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, { "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/swiftmailer/swiftmailer", + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "abandoned": "symfony/mailer", - "time": "2021-10-18T15:26:12+00:00" + "time": "2026-05-29T05:06:50+00:00" }, { "name": "symfony/console", - "version": "v5.4.47", + "version": "v8.1.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed" + "reference": "4b81146e3ee248ea969186f85499b54fbc78db08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", - "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", + "url": "https://api.github.com/repos/symfony/console/zipball/4b81146e3ee248ea969186f85499b54fbc78db08", + "reference": "4b81146e3ee248ea969186f85499b54fbc78db08", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" + "php": ">=8.4.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php85": "^1.32", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^7.4.6|^8.0.6" }, "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" + "symfony/dependency-injection": "<8.1", + "symfony/event-dispatcher": "<8.1" }, "provide": { - "psr/log-implementation": "1.0|2.0" + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "psr/log": "^1|^2|^3", + "symfony/config": "^7.4|^8.0", + "symfony/dependency-injection": "^8.1", + "symfony/event-dispatcher": "^8.1", + "symfony/filesystem": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/lock": "^7.4|^8.0", + "symfony/messenger": "^7.4|^8.0", + "symfony/mime": "^7.4|^8.0", + "symfony/process": "^7.4|^8.0", + "symfony/stopwatch": "^7.4|^8.0", + "symfony/uid": "^7.4|^8.0", + "symfony/validator": "^7.4|^8.0", + "symfony/var-dumper": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -5636,7 +6768,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.47" + "source": "https://github.com/symfony/console/tree/v8.1.8" }, "funding": [ { @@ -5647,30 +6779,33 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-11-06T11:30:55+00:00" + "time": "2026-09-18T16:00:27+00:00" }, { "name": "symfony/css-selector", - "version": "v5.4.45", + "version": "v8.1.6", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "4f7f3c35fba88146b56d0025d20ace3f3901f097" + "reference": "08e2905152a39cf3fd1745d83f8c483e258887d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/4f7f3c35fba88146b56d0025d20ace3f3901f097", - "reference": "4f7f3c35fba88146b56d0025d20ace3f3901f097", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/08e2905152a39cf3fd1745d83f8c483e258887d9", + "reference": "08e2905152a39cf3fd1745d83f8c483e258887d9", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.4.1" }, "type": "library", "autoload": { @@ -5702,7 +6837,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.45" + "source": "https://github.com/symfony/css-selector/tree/v8.1.6" }, "funding": [ { @@ -5713,29 +6848,33 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2026-08-23T10:06:25+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.4", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918" + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918", - "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/f3202fa1b5097b0af062dc978b32ecf63404e31d", + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.1" }, "type": "library", "extra": { @@ -5744,7 +6883,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.7-dev" } }, "autoload": { @@ -5769,7 +6908,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.1" }, "funding": [ { @@ -5780,43 +6919,38 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2026-06-05T06:23:12+00:00" }, { "name": "symfony/dom-crawler", - "version": "v5.4.48", + "version": "v8.1.5", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "b57df76f4757a9a8dfbb57ba48d7780cc20776c6" + "reference": "94f70e1b2e5b7b8f8618871fd9eaad3e39e9f03d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/b57df76f4757a9a8dfbb57ba48d7780cc20776c6", - "reference": "b57df76f4757a9a8dfbb57ba48d7780cc20776c6", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/94f70e1b2e5b7b8f8618871fd9eaad3e39e9f03d", + "reference": "94f70e1b2e5b7b8f8618871fd9eaad3e39e9f03d", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "masterminds/html5": "<2.6" + "php": ">=8.4.1", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "^1.0" }, "require-dev": { - "masterminds/html5": "^2.6", - "symfony/css-selector": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/css-selector": "" + "symfony/css-selector": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -5844,7 +6978,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v5.4.48" + "source": "https://github.com/symfony/dom-crawler/tree/v8.1.5" }, "funding": [ { @@ -5855,36 +6989,46 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-11-13T14:36:38+00:00" + "time": "2026-08-21T17:47:34+00:00" }, { "name": "symfony/error-handler", - "version": "v5.4.46", + "version": "v8.1.8", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "d19ede7a2cafb386be9486c580649d0f9e3d0363" + "reference": "c146daceccd5d4f864c051b233c276641cec527b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/d19ede7a2cafb386be9486c580649d0f9e3d0363", - "reference": "d19ede7a2cafb386be9486c580649d0f9e3d0363", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/c146daceccd5d4f864c051b233c276641cec527b", + "reference": "c146daceccd5d4f864c051b233c276641cec527b", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.4.1", "psr/log": "^1|^2|^3", - "symfony/var-dumper": "^4.4|^5.0|^6.0" + "symfony/polyfill-php85": "^1.32", + "symfony/var-dumper": "^7.4|^8.0" + }, + "conflict": { + "symfony/deprecation-contracts": "<2.5" }, "require-dev": { - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/http-kernel": "^4.4|^5.0|^6.0", - "symfony/serializer": "^4.4|^5.0|^6.0" + "symfony/console": "^7.4|^8.0", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0", + "symfony/webpack-encore-bundle": "^1.0|^2.0" }, "bin": [ "Resources/bin/patch-type-declarations" @@ -5915,7 +7059,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v5.4.46" + "source": "https://github.com/symfony/error-handler/tree/v8.1.8" }, "funding": [ { @@ -5926,53 +7070,54 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-11-05T14:17:06+00:00" + "time": "2026-09-22T18:58:53+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.4.45", + "version": "v8.1.5", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9" + "reference": "7458da64220376b2e0dc2d8451bf43382c1ad297" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/72982eb416f61003e9bb6e91f8b3213600dcf9e9", - "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7458da64220376b2e0dc2d8451bf43382c1ad297", + "reference": "7458da64220376b2e0dc2d8451bf43382c1ad297", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher-contracts": "^2|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.4.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<4.4" + "symfony/security-http": "<7.4", + "symfony/service-contracts": "<2.5" }, "provide": { "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0" + "symfony/event-dispatcher-implementation": "2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "symfony/config": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/error-handler": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/framework-bundle": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -6000,7 +7145,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.45" + "source": "https://github.com/symfony/event-dispatcher/tree/v8.1.5" }, "funding": [ { @@ -6011,34 +7156,35 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2026-08-21T17:47:34+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.4", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "e0fe3d79b516eb75126ac6fa4cbf19b79b08c99f" + "reference": "c7de7a00ffb67842132da02ea92988a39ccd9f4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/e0fe3d79b516eb75126ac6fa4cbf19b79b08c99f", - "reference": "e0fe3d79b516eb75126ac6fa4cbf19b79b08c99f", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/c7de7a00ffb67842132da02ea92988a39ccd9f4e", + "reference": "c7de7a00ffb67842132da02ea92988a39ccd9f4e", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, "type": "library", "extra": { "thanks": { @@ -6046,7 +7192,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.7-dev" } }, "autoload": { @@ -6079,7 +7225,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.4" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.7.1" }, "funding": [ { @@ -6090,31 +7236,36 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2026-06-05T06:23:12+00:00" }, { "name": "symfony/finder", - "version": "v5.4.45", + "version": "v8.1.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "63741784cd7b9967975eec610b256eed3ede022b" + "reference": "bd4fed193a3132c91c5c93595cbfc78988915822" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/63741784cd7b9967975eec610b256eed3ede022b", - "reference": "63741784cd7b9967975eec610b256eed3ede022b", + "url": "https://api.github.com/repos/symfony/finder/zipball/bd4fed193a3132c91c5c93595cbfc78988915822", + "reference": "bd4fed193a3132c91c5c93595cbfc78988915822", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.4.1" + }, + "require-dev": { + "symfony/filesystem": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -6142,7 +7293,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.45" + "source": "https://github.com/symfony/finder/tree/v8.1.8" }, "funding": [ { @@ -6154,94 +7305,7 @@ "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-28T13:32:08+00:00" - }, - { - "name": "symfony/http-client", - "version": "v5.4.49", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-client.git", - "reference": "d77d8e212cde7b5c4a64142bf431522f19487c28" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/d77d8e212cde7b5c4a64142bf431522f19487c28", - "reference": "d77d8e212cde7b5c4a64142bf431522f19487c28", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/log": "^1|^2|^3", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/http-client-contracts": "^2.5.4", - "symfony/polyfill-php73": "^1.11", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.0|^2|^3" - }, - "provide": { - "php-http/async-client-implementation": "*", - "php-http/client-implementation": "*", - "psr/http-client-implementation": "1.0", - "symfony/http-client-implementation": "2.4" - }, - "require-dev": { - "amphp/amp": "^2.5", - "amphp/http-client": "^4.2.1", - "amphp/http-tunnel": "^1.0", - "amphp/socket": "^1.1", - "guzzlehttp/promises": "^1.4|^2.0", - "nyholm/psr7": "^1.0", - "php-http/httplug": "^1.0|^2.0", - "php-http/message-factory": "^1.0", - "psr/http-client": "^1.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^4.4.13|^5.1.5|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/stopwatch": "^4.4|^5.0|^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpClient\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously", - "homepage": "https://symfony.com", - "keywords": [ - "http" - ], - "support": { - "source": "https://github.com/symfony/http-client/tree/v5.4.49" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/nicolas-grekas", "type": "github" }, { @@ -6249,117 +7313,40 @@ "type": "tidelift" } ], - "time": "2024-11-28T08:37:04+00:00" - }, - { - "name": "symfony/http-client-contracts", - "version": "v2.5.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "48ef1d0a082885877b664332b9427662065a360c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/48ef1d0a082885877b664332b9427662065a360c", - "reference": "48ef1d0a082885877b664332b9427662065a360c", - "shasum": "" - }, - "require": { - "php": ">=7.2.5" - }, - "suggest": { - "symfony/http-client-implementation": "" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, - "branch-alias": { - "dev-main": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\HttpClient\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to HTTP clients", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v2.5.5" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-11-28T08:37:04+00:00" + "time": "2026-09-26T06:33:49+00:00" }, { "name": "symfony/http-foundation", - "version": "v5.4.48", + "version": "v8.1.8", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "3f38b8af283b830e1363acd79e5bc3412d055341" + "reference": "662f5257658d4f60deff1bc790e9f2c68cb391bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3f38b8af283b830e1363acd79e5bc3412d055341", - "reference": "3f38b8af283b830e1363acd79e5bc3412d055341", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/662f5257658d4f60deff1bc790e9f2c68cb391bf", + "reference": "662f5257658d4f60deff1bc790e9f2c68cb391bf", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.1", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.4.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "^1.1" + }, + "conflict": { + "doctrine/dbal": "<4.3" }, "require-dev": { - "predis/predis": "^1.0|^2.0", - "symfony/cache": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", - "symfony/mime": "^4.4|^5.0|^6.0", - "symfony/rate-limiter": "^5.2|^6.0" - }, - "suggest": { - "symfony/mime": "To use the file extension guesser" + "doctrine/dbal": "^4.3", + "predis/predis": "^1.1|^2.0", + "symfony/cache": "^7.4|^8.0", + "symfony/clock": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/mime": "^7.4|^8.0", + "symfony/rate-limiter": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -6387,7 +7374,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.4.48" + "source": "https://github.com/symfony/http-foundation/tree/v8.1.8" }, "funding": [ { @@ -6398,81 +7385,78 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-11-13T18:58:02+00:00" + "time": "2026-09-24T07:13:53+00:00" }, { "name": "symfony/http-kernel", - "version": "v5.4.48", + "version": "v8.1.8", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "c2dbfc92b851404567160d1ecf3fb7d9b7bde9b0" + "reference": "51c014e881d8b4ce61e56c0d4105f65b50df786a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/c2dbfc92b851404567160d1ecf3fb7d9b7bde9b0", - "reference": "c2dbfc92b851404567160d1ecf3fb7d9b7bde9b0", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/51c014e881d8b4ce61e56c0d4105f65b50df786a", + "reference": "51c014e881d8b4ce61e56c0d4105f65b50df786a", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/log": "^1|^2", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^5.0|^6.0", - "symfony/http-foundation": "^5.4.21|^6.2.7", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.4.1", + "psr/log": "^1|^2|^3", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/error-handler": "^7.4|^8.0", + "symfony/event-dispatcher": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/polyfill-ctype": "^1.8" }, "conflict": { - "symfony/browser-kit": "<5.4", - "symfony/cache": "<5.0", - "symfony/config": "<5.0", - "symfony/console": "<4.4", - "symfony/dependency-injection": "<5.3", - "symfony/doctrine-bridge": "<5.0", - "symfony/form": "<5.0", - "symfony/http-client": "<5.0", - "symfony/mailer": "<5.0", - "symfony/messenger": "<5.0", - "symfony/translation": "<5.0", - "symfony/twig-bridge": "<5.0", - "symfony/validator": "<5.0", - "twig/twig": "<2.13" + "symfony/dependency-injection": "<8.1", + "symfony/flex": "<2.10", + "symfony/http-client-contracts": "<2.5", + "symfony/serializer": "<7.4.15|>=8.0,<8.0.15|>=8.1,<8.1.2", + "symfony/translation-contracts": "<2.5", + "symfony/var-dumper": "<8.1", + "symfony/web-profiler-bundle": "<8.1", + "twig/twig": "<3.21" }, "provide": { - "psr/log-implementation": "1.0|2.0" + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/cache": "^1.0|^2.0|^3.0", - "symfony/browser-kit": "^5.4|^6.0", - "symfony/config": "^5.0|^6.0", - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/css-selector": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^5.3|^6.0", - "symfony/dom-crawler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/http-client-contracts": "^1.1|^2|^3", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/routing": "^4.4|^5.0|^6.0", - "symfony/stopwatch": "^4.4|^5.0|^6.0", - "symfony/translation": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2|^3", - "symfony/var-dumper": "^4.4.31|^5.4", - "twig/twig": "^2.13|^3.0.4" - }, - "suggest": { - "symfony/browser-kit": "", - "symfony/config": "", - "symfony/console": "", - "symfony/dependency-injection": "" + "symfony/browser-kit": "^7.4|^8.0", + "symfony/clock": "^7.4|^8.0", + "symfony/config": "^7.4|^8.0", + "symfony/console": "^7.4|^8.0", + "symfony/css-selector": "^7.4|^8.0", + "symfony/dependency-injection": "^8.1", + "symfony/dom-crawler": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/finder": "^7.4|^8.0", + "symfony/http-client-contracts": "^2.5|^3", + "symfony/process": "^7.4|^8.0", + "symfony/property-access": "^7.4|^8.0", + "symfony/rate-limiter": "^7.4|^8.0", + "symfony/routing": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0", + "symfony/stopwatch": "^7.4|^8.0", + "symfony/translation": "^7.4|^8.0", + "symfony/translation-contracts": "^2.5|^3", + "symfony/uid": "^7.4|^8.0", + "symfony/validator": "^7.4|^8.0", + "symfony/var-dumper": "^8.1", + "symfony/var-exporter": "^7.4|^8.0", + "twig/twig": "^3.21|^4.0" }, "type": "library", "autoload": { @@ -6500,7 +7484,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.4.48" + "source": "https://github.com/symfony/http-kernel/tree/v8.1.8" }, "funding": [ { @@ -6511,49 +7495,130 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-11-27T12:43:17+00:00" + "time": "2026-09-29T14:08:01+00:00" }, { - "name": "symfony/mime", - "version": "v5.4.45", + "name": "symfony/mailer", + "version": "v8.1.7", "source": { "type": "git", - "url": "https://github.com/symfony/mime.git", - "reference": "8c1b9b3e5b52981551fc6044539af1d974e39064" + "url": "https://github.com/symfony/mailer.git", + "reference": "8783380ecdafa23d36fc90c5873fd44b635c6e10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/8c1b9b3e5b52981551fc6044539af1d974e39064", - "reference": "8c1b9b3e5b52981551fc6044539af1d974e39064", + "url": "https://api.github.com/repos/symfony/mailer/zipball/8783380ecdafa23d36fc90c5873fd44b635c6e10", + "reference": "8783380ecdafa23d36fc90c5873fd44b635c6e10", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "egulias/email-validator": "^2.1.10|^3|^4", + "php": ">=8.4.1", + "psr/event-dispatcher": "^1", + "psr/log": "^1|^2|^3", + "symfony/event-dispatcher": "^7.4|^8.0", + "symfony/mime": "^7.4|^8.0", + "symfony/service-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/http-client-contracts": "<2.5" + }, + "require-dev": { + "symfony/console": "^7.4|^8.0", + "symfony/http-client": "^7.4|^8.0", + "symfony/messenger": "^7.4|^8.0", + "symfony/twig-bridge": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mailer\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Helps sending emails", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/mailer/tree/v8.1.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-09-15T06:01:24+00:00" + }, + { + "name": "symfony/mime", + "version": "v8.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/mime.git", + "reference": "773ac57f20e2795bdadb65b5b1b5f4850d498283" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mime/zipball/773ac57f20e2795bdadb65b5b1b5f4850d498283", + "reference": "773ac57f20e2795bdadb65b5b1b5f4850d498283", + "shasum": "" + }, + "require": { + "php": ">=8.4.1", "symfony/polyfill-intl-idn": "^1.10", - "symfony/polyfill-mbstring": "^1.0", - "symfony/polyfill-php80": "^1.16" + "symfony/polyfill-mbstring": "^1.0" }, "conflict": { "egulias/email-validator": "~3.0.0", - "phpdocumentor/reflection-docblock": "<3.2.2", - "phpdocumentor/type-resolver": "<1.4.0", - "symfony/mailer": "<4.4", - "symfony/serializer": "<5.4.35|>=6,<6.3.12|>=6.4,<6.4.3" + "phpdocumentor/reflection-docblock": "<5.2|>=7", + "phpdocumentor/type-resolver": "<1.5.1" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3.1|^4", - "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/process": "^5.4|^6.4", - "symfony/property-access": "^4.4|^5.1|^6.0", - "symfony/property-info": "^4.4|^5.1|^6.0", - "symfony/serializer": "^5.4.35|~6.3.12|^6.4.3" + "league/html-to-markdown": "^5.0", + "phpdocumentor/reflection-docblock": "^5.2|^6.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/process": "^7.4|^8.0", + "symfony/property-access": "^7.4|^8.0", + "symfony/property-info": "^7.4|^8.0", + "symfony/serializer": "^7.4.17|^8.1.5" }, "type": "library", "autoload": { @@ -6585,7 +7650,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v5.4.45" + "source": "https://github.com/symfony/mime/tree/v8.1.7" }, "funding": [ { @@ -6596,32 +7661,34 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-10-23T20:18:32+00:00" + "time": "2026-09-04T11:02:17+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.4.45", + "version": "v8.1.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6" + "reference": "88f9c561f678a02d54b897014049fa839e33ff82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6", - "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/88f9c561f678a02d54b897014049fa839e33ff82", + "reference": "88f9c561f678a02d54b897014049fa839e33ff82", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.4.1", + "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", "autoload": { @@ -6654,7 +7721,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.45" + "source": "https://github.com/symfony/options-resolver/tree/v8.1.0" }, "funding": [ { @@ -6665,25 +7732,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2026-05-29T05:06:50+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.31.0", + "version": "v1.37.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" + "reference": "141046a8f9477948ff284fa65be2095baafb94f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2", "shasum": "" }, "require": { @@ -6733,7 +7804,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0" }, "funding": [ { @@ -6745,83 +7816,7 @@ "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-09T11:45:10+00:00" - }, - { - "name": "symfony/polyfill-iconv", - "version": "v1.31.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "48becf00c920479ca2e910c22a5a39e5d47ca956" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/48becf00c920479ca2e910c22a5a39e5d47ca956", - "reference": "48becf00c920479ca2e910c22a5a39e5d47ca956", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "provide": { - "ext-iconv": "*" - }, - "suggest": { - "ext-iconv": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Iconv\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Iconv extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "iconv", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-iconv/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/nicolas-grekas", "type": "github" }, { @@ -6829,20 +7824,20 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2026-04-10T16:19:22+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.31.0", + "version": "v1.43.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" + "reference": "5cac8f4db97208823aa353f59a01faad2da52c75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", - "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/5cac8f4db97208823aa353f59a01faad2da52c75", + "reference": "5cac8f4db97208823aa353f59a01faad2da52c75", "shasum": "" }, "require": { @@ -6891,7 +7886,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.43.0" }, "funding": [ { @@ -6902,25 +7897,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2026-09-25T15:46:47+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.31.0", + "version": "v1.43.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773" + "reference": "533d68cf99c8f8ee2e8893c59ed59192e92cfd74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c36586dcf89a12315939e00ec9b4474adcb1d773", - "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/533d68cf99c8f8ee2e8893c59ed59192e92cfd74", + "reference": "533d68cf99c8f8ee2e8893c59ed59192e92cfd74", "shasum": "" }, "require": { @@ -6974,7 +7973,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.43.0" }, "funding": [ { @@ -6985,25 +7984,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2026-09-23T14:40:04+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.31.0", + "version": "v1.43.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "3833d7255cc303546435cb650316bff708a1c75c" + "reference": "ebd57ccc7edb93d632e184efbe7693d2517bab3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", - "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/ebd57ccc7edb93d632e184efbe7693d2517bab3b", + "reference": "ebd57ccc7edb93d632e184efbe7693d2517bab3b", "shasum": "" }, "require": { @@ -7055,7 +8058,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.43.0" }, "funding": [ { @@ -7066,28 +8069,33 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2026-09-23T22:02:09+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.31.0", + "version": "v1.43.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + "reference": "4d5d331bf731e0aedbc6b2f5e61135b7b7996a72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/4d5d331bf731e0aedbc6b2f5e61135b7b7996a72", + "reference": "4d5d331bf731e0aedbc6b2f5e61135b7b7996a72", "shasum": "" }, "require": { + "ext-iconv": "*", "php": ">=7.2" }, "provide": { @@ -7135,7 +8143,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.43.0" }, "funding": [ { @@ -7147,79 +8155,7 @@ "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-09T11:45:10+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.31.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb", - "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/nicolas-grekas", "type": "github" }, { @@ -7227,20 +8163,20 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2026-09-24T15:19:04+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.31.0", + "version": "v1.43.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" + "reference": "9c6a5d6b01ca51d486c813e9a9c0ed55f208bb74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/9c6a5d6b01ca51d486c813e9a9c0ed55f208bb74", + "reference": "9c6a5d6b01ca51d486c813e9a9c0ed55f208bb74", "shasum": "" }, "require": { @@ -7291,7 +8227,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.43.0" }, "funding": [ { @@ -7302,25 +8238,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2026-09-25T15:50:05+00:00" }, { - "name": "symfony/polyfill-php81", - "version": "v1.31.0", + "name": "symfony/polyfill-php82", + "version": "v1.43.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" + "url": "https://github.com/symfony/polyfill-php82.git", + "reference": "843bbe8b2a7934307b749751eede0f111f5d1cfc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", - "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "url": "https://api.github.com/repos/symfony/polyfill-php82/zipball/843bbe8b2a7934307b749751eede0f111f5d1cfc", + "reference": "843bbe8b2a7934307b749751eede0f111f5d1cfc", "shasum": "" }, "require": { @@ -7338,7 +8278,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" + "Symfony\\Polyfill\\Php82\\": "" }, "classmap": [ "Resources/stubs" @@ -7358,7 +8298,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.2+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -7367,7 +8307,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php82/tree/v1.43.0" }, "funding": [ { @@ -7378,30 +8318,356 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2026-09-25T15:50:05+00:00" }, { - "name": "symfony/process", - "version": "v5.4.47", + "name": "symfony/polyfill-php84", + "version": "v1.43.0", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d" + "url": "https://github.com/symfony/polyfill-php84.git", + "reference": "22c6548499cbe5c5bb072fc0c42312dff062a015" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/5d1662fb32ebc94f17ddb8d635454a776066733d", - "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/22c6548499cbe5c5bb072fc0c42312dff062a015", + "reference": "22c6548499cbe5c5bb072fc0c42312dff062a015", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php84\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php84/tree/v1.43.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-09-23T22:01:09+00:00" + }, + { + "name": "symfony/polyfill-php85", + "version": "v1.43.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php85.git", + "reference": "86a42cbcc07adc331481a5ab310a4024bfc227f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/86a42cbcc07adc331481a5ab310a4024bfc227f6", + "reference": "86a42cbcc07adc331481a5ab310a4024bfc227f6", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php85\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.5+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php85/tree/v1.43.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-09-25T15:46:47+00:00" + }, + { + "name": "symfony/polyfill-php86", + "version": "v1.43.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php86.git", + "reference": "8840df45b24f33a49dc419fa18dc0057231ae1d8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php86/zipball/8840df45b24f33a49dc419fa18dc0057231ae1d8", + "reference": "8840df45b24f33a49dc419fa18dc0057231ae1d8", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php86\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.6+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php86/tree/v1.43.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-09-25T15:46:47+00:00" + }, + { + "name": "symfony/polyfill-uuid", + "version": "v1.43.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-uuid.git", + "reference": "b23ff8245cc5c4479ea2be3d0132d2e6dd433993" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/b23ff8245cc5c4479ea2be3d0132d2e6dd433993", + "reference": "b23ff8245cc5c4479ea2be3d0132d2e6dd433993", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-uuid": "*" + }, + "suggest": { + "ext-uuid": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Uuid\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for uuid functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "uuid" + ], + "support": { + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.43.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-09-24T05:20:52+00:00" + }, + { + "name": "symfony/process", + "version": "v8.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "10823b09358e690df4ff943e24e8492bb1019fc3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/10823b09358e690df4ff943e24e8492bb1019fc3", + "reference": "10823b09358e690df4ff943e24e8492bb1019fc3", + "shasum": "" + }, + "require": { + "php": ">=8.4.1" }, "type": "library", "autoload": { @@ -7429,7 +8695,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.47" + "source": "https://github.com/symfony/process/tree/v8.1.7" }, "funding": [ { @@ -7440,52 +8706,51 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-11-06T11:36:42+00:00" + "time": "2026-09-02T12:40:29+00:00" }, { "name": "symfony/psr-http-message-bridge", - "version": "v2.3.1", + "version": "v8.1.0", "source": { "type": "git", "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "581ca6067eb62640de5ff08ee1ba6850a0ee472e" + "reference": "67fd34de15ded1763aa1e330fe345f080a94022c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/581ca6067eb62640de5ff08ee1ba6850a0ee472e", - "reference": "581ca6067eb62640de5ff08ee1ba6850a0ee472e", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/67fd34de15ded1763aa1e330fe345f080a94022c", + "reference": "67fd34de15ded1763aa1e330fe345f080a94022c", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/http-message": "^1.0 || ^2.0", - "symfony/deprecation-contracts": "^2.5 || ^3.0", - "symfony/http-foundation": "^5.4 || ^6.0" + "php": ">=8.4.1", + "psr/http-message": "^1.0|^2.0", + "symfony/http-foundation": "^7.4|^8.0" + }, + "conflict": { + "php-http/discovery": "<1.15" }, "require-dev": { "nyholm/psr7": "^1.1", - "psr/log": "^1.1 || ^2 || ^3", - "symfony/browser-kit": "^5.4 || ^6.0", - "symfony/config": "^5.4 || ^6.0", - "symfony/event-dispatcher": "^5.4 || ^6.0", - "symfony/framework-bundle": "^5.4 || ^6.0", - "symfony/http-kernel": "^5.4 || ^6.0", - "symfony/phpunit-bridge": "^6.2" - }, - "suggest": { - "nyholm/psr7": "For a super lightweight PSR-7/17 implementation" + "php-http/discovery": "^1.15", + "psr/log": "^1.1.4|^2|^3", + "symfony/browser-kit": "^7.4|^8.0", + "symfony/config": "^7.4|^8.0", + "symfony/event-dispatcher": "^7.4|^8.0", + "symfony/framework-bundle": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/runtime": "^7.4|^8.0" }, "type": "symfony-bridge", - "extra": { - "branch-alias": { - "dev-main": "2.3-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Bridge\\PsrHttpMessage\\": "" @@ -7505,11 +8770,11 @@ }, { "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "homepage": "https://symfony.com/contributors" } ], "description": "PSR HTTP message bridge", - "homepage": "http://symfony.com", + "homepage": "https://symfony.com", "keywords": [ "http", "http-message", @@ -7517,8 +8782,7 @@ "psr-7" ], "support": { - "issues": "https://github.com/symfony/psr-http-message-bridge/issues", - "source": "https://github.com/symfony/psr-http-message-bridge/tree/v2.3.1" + "source": "https://github.com/symfony/psr-http-message-bridge/tree/v8.1.0" }, "funding": [ { @@ -7529,52 +8793,42 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-07-26T11:53:26+00:00" + "time": "2026-05-29T05:06:50+00:00" }, { "name": "symfony/routing", - "version": "v5.4.48", + "version": "v8.1.8", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "dd08c19879a9b37ff14fd30dcbdf99a4cf045db1" + "reference": "e46d741c56485441f37104a3e7eace4e17ed91f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/dd08c19879a9b37ff14fd30dcbdf99a4cf045db1", - "reference": "dd08c19879a9b37ff14fd30dcbdf99a4cf045db1", + "url": "https://api.github.com/repos/symfony/routing/zipball/e46d741c56485441f37104a3e7eace4e17ed91f9", + "reference": "e46d741c56485441f37104a3e7eace4e17ed91f9", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "doctrine/annotations": "<1.12", - "symfony/config": "<5.3", - "symfony/dependency-injection": "<4.4", - "symfony/yaml": "<4.4" + "php": ">=8.4.1", + "symfony/deprecation-contracts": "^2.5|^3" }, "require-dev": { - "doctrine/annotations": "^1.12|^2", "psr/log": "^1|^2|^3", - "symfony/config": "^5.3|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/config": "For using the all-in-one router or any loader", - "symfony/expression-language": "For using expression matching", - "symfony/http-foundation": "For using a Symfony Request object", - "symfony/yaml": "For using the YAML loader" + "symfony/config": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/yaml": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -7608,7 +8862,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v5.4.48" + "source": "https://github.com/symfony/routing/tree/v8.1.8" }, "funding": [ { @@ -7619,38 +8873,39 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-11-12T18:20:21+00:00" + "time": "2026-09-28T19:13:15+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.5.4", + "version": "v3.7.3", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "f37b419f7aea2e9abf10abd261832cace12e3300" + "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f37b419f7aea2e9abf10abd261832cace12e3300", - "reference": "f37b419f7aea2e9abf10abd261832cace12e3300", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", + "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "type": "library", "extra": { "thanks": { @@ -7658,13 +8913,16 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.7-dev" } }, "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -7691,7 +8949,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.4" + "source": "https://github.com/symfony/service-contracts/tree/v3.7.3" }, "funding": [ { @@ -7702,43 +8960,47 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2026-07-27T15:39:01+00:00" }, { "name": "symfony/string", - "version": "v5.4.47", + "version": "v8.1.7", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "136ca7d72f72b599f2631aca474a4f8e26719799" + "reference": "d950140b5f56f31901e5b7a0c04ffc3a3deb943c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/136ca7d72f72b599f2631aca474a4f8e26719799", - "reference": "136ca7d72f72b599f2631aca474a4f8e26719799", + "url": "https://api.github.com/repos/symfony/string/zipball/d950140b5f56f31901e5b7a0c04ffc3a3deb943c", + "reference": "d950140b5f56f31901e5b7a0c04ffc3a3deb943c", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" + "php": ">=8.4.1", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-intl-grapheme": "^1.33", + "symfony/polyfill-intl-normalizer": "^1.0", + "symfony/polyfill-mbstring": "^1.0" }, "conflict": { - "symfony/translation-contracts": ">=3.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0|^6.0" + "symfony/emoji": "^7.4|^8.0", + "symfony/http-client": "^7.4|^8.0", + "symfony/intl": "^7.4|^8.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -7777,7 +9039,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.47" + "source": "https://github.com/symfony/string/tree/v8.1.7" }, "funding": [ { @@ -7788,62 +9050,58 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-11-10T20:33:58+00:00" + "time": "2026-09-11T14:51:16+00:00" }, { "name": "symfony/translation", - "version": "v5.4.45", + "version": "v8.1.5", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "98f26acc99341ca4bab345fb14d7b1d7cb825bed" + "reference": "d9e1caba0d6b6f9a26710af8a2f88d37f001215a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/98f26acc99341ca4bab345fb14d7b1d7cb825bed", - "reference": "98f26acc99341ca4bab345fb14d7b1d7cb825bed", + "url": "https://api.github.com/repos/symfony/translation/zipball/d9e1caba0d6b6f9a26710af8a2f88d37f001215a", + "reference": "d9e1caba0d6b6f9a26710af8a2f88d37f001215a", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^2.3" + "php": ">=8.4.1", + "symfony/polyfill-mbstring": "^1.0", + "symfony/translation-contracts": "^3.6.1" }, "conflict": { - "symfony/config": "<4.4", - "symfony/console": "<5.3", - "symfony/dependency-injection": "<5.0", - "symfony/http-kernel": "<5.0", - "symfony/twig-bundle": "<5.0", - "symfony/yaml": "<4.4" + "nikic/php-parser": "<5.0", + "symfony/http-client-contracts": "<2.5", + "symfony/service-contracts": "<2.5" }, "provide": { - "symfony/translation-implementation": "2.3" + "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { + "nikic/php-parser": "^5.0", "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/http-client-contracts": "^1.1|^2.0|^3.0", - "symfony/http-kernel": "^5.0|^6.0", - "symfony/intl": "^4.4|^5.0|^6.0", + "symfony/config": "^7.4|^8.0", + "symfony/console": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/finder": "^7.4|^8.0", + "symfony/http-client-contracts": "^2.5|^3.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/intl": "^7.4|^8.0", "symfony/polyfill-intl-icu": "^1.21", - "symfony/service-contracts": "^1.1.2|^2|^3", - "symfony/yaml": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log-implementation": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" + "symfony/routing": "^7.4|^8.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -7874,7 +9132,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.4.45" + "source": "https://github.com/symfony/translation/tree/v8.1.5" }, "funding": [ { @@ -7885,32 +9143,33 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2026-08-21T17:47:34+00:00" }, { "name": "symfony/translation-contracts", - "version": "v2.5.4", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "450d4172653f38818657022252f9d81be89ee9a8" + "reference": "ccb206b98faccc511ebae8e5fad50f2dc0b30621" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/450d4172653f38818657022252f9d81be89ee9a8", - "reference": "450d4172653f38818657022252f9d81be89ee9a8", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/ccb206b98faccc511ebae8e5fad50f2dc0b30621", + "reference": "ccb206b98faccc511ebae8e5fad50f2dc0b30621", "shasum": "" }, "require": { - "php": ">=7.2.5" - }, - "suggest": { - "symfony/translation-implementation": "" + "php": ">=8.1" }, "type": "library", "extra": { @@ -7919,13 +9178,16 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.7-dev" } }, "autoload": { "psr-4": { "Symfony\\Contracts\\Translation\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -7952,7 +9214,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.5.4" + "source": "https://github.com/symfony/translation-contracts/tree/v3.7.1" }, "funding": [ { @@ -7963,47 +9225,123 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2026-06-05T06:23:12+00:00" }, { - "name": "symfony/var-dumper", - "version": "v5.4.48", + "name": "symfony/uid", + "version": "v8.1.8", "source": { "type": "git", - "url": "https://github.com/symfony/var-dumper.git", - "reference": "42f18f170aa86d612c3559cfb3bd11a375df32c8" + "url": "https://github.com/symfony/uid.git", + "reference": "f412a0b5edd75eb3104a93bd0d11fd2ea3da34e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/42f18f170aa86d612c3559cfb3bd11a375df32c8", - "reference": "42f18f170aa86d612c3559cfb3bd11a375df32c8", + "url": "https://api.github.com/repos/symfony/uid/zipball/f412a0b5edd75eb3104a93bd0d11fd2ea3da34e4", + "reference": "f412a0b5edd75eb3104a93bd0d11fd2ea3da34e4", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "symfony/console": "<4.4" + "php": ">=8.4.1", + "symfony/polyfill-uuid": "^1.15" }, "require-dev": { - "ext-iconv": "*", - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/uid": "^5.1|^6.0", - "twig/twig": "^2.13|^3.0.4" + "symfony/console": "^7.4|^8.0" }, - "suggest": { - "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-intl": "To show region name in time zone dump", - "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Uid\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to generate and represent UIDs", + "homepage": "https://symfony.com", + "keywords": [ + "UID", + "ulid", + "uuid" + ], + "support": { + "source": "https://github.com/symfony/uid/tree/v8.1.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-09-23T17:45:45+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v8.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "741a8c4c948b0bb9bd3653daacd3644c73c40ea5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/741a8c4c948b0bb9bd3653daacd3644c73c40ea5", + "reference": "741a8c4c948b0bb9bd3653daacd3644c73c40ea5", + "shasum": "" + }, + "require": { + "php": ">=8.4.1", + "symfony/polyfill-mbstring": "^1.0" + }, + "conflict": { + "symfony/console": "<7.4", + "symfony/error-handler": "<7.4" + }, + "require-dev": { + "symfony/console": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/process": "^7.4|^8.0", + "symfony/uid": "^7.4|^8.0", + "twig/twig": "^3.12|^4.0" }, "bin": [ "Resources/bin/var-dump-server" @@ -8041,7 +9379,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.48" + "source": "https://github.com/symfony/var-dumper/tree/v8.1.7" }, "funding": [ { @@ -8052,95 +9390,98 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-11-08T15:21:10+00:00" + "time": "2026-09-03T16:02:27+00:00" }, { - "name": "tightenco/collect", - "version": "v7.26.1", + "name": "tbachert/spi", + "version": "v1.0.5", "source": { "type": "git", - "url": "https://github.com/tighten/collect.git", - "reference": "5e460929279ad806e59fc731e649e9b25fc8774a" + "url": "https://github.com/Nevay/spi.git", + "reference": "e7078767866d0a9e0f91d3f9d42a832df5e39002" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tighten/collect/zipball/5e460929279ad806e59fc731e649e9b25fc8774a", - "reference": "5e460929279ad806e59fc731e649e9b25fc8774a", + "url": "https://api.github.com/repos/Nevay/spi/zipball/e7078767866d0a9e0f91d3f9d42a832df5e39002", + "reference": "e7078767866d0a9e0f91d3f9d42a832df5e39002", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/var-dumper": "^3.4 || ^4.0 || ^5.0" + "composer-plugin-api": "^2.0", + "composer/semver": "^1.0 || ^2.0 || ^3.0", + "php": "^8.1" }, "require-dev": { - "mockery/mockery": "^1.0", - "nesbot/carbon": "^2.23.0", - "phpunit/phpunit": "^7.0" + "composer/composer": "^2.0", + "infection/infection": "^0.27.9", + "phpunit/phpunit": "^10.5", + "psalm/phar": "^5.18" + }, + "type": "composer-plugin", + "extra": { + "class": "Nevay\\SPI\\Composer\\Plugin", + "branch-alias": { + "dev-main": "1.0.x-dev" + }, + "plugin-optional": true }, - "type": "library", "autoload": { - "files": [ - "src/Collect/Support/helpers.php", - "src/Collect/Support/alias.php" - ], "psr-4": { - "Tightenco\\Collect\\": "src/Collect" + "Nevay\\SPI\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "Apache-2.0" ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" - } - ], - "description": "Collect - Illuminate Collections as a separate package.", + "description": "Service provider loading facility", "keywords": [ - "collection", - "laravel" + "service provider" ], "support": { - "issues": "https://github.com/tighten/collect/issues", - "source": "https://github.com/tighten/collect/tree/v7.26.1" + "issues": "https://github.com/Nevay/spi/issues", + "source": "https://github.com/Nevay/spi/tree/v1.0.5" }, - "abandoned": "illuminate/collections", - "time": "2020-09-05T00:05:48+00:00" + "time": "2025-06-29T15:42:06+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", - "version": "v2.2.7", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", - "reference": "83ee6f38df0a63106a9e4536e3060458b74ccedb" + "reference": "f0292ccf0ec75843d65027214426b6b163b48b41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/83ee6f38df0a63106a9e4536e3060458b74ccedb", - "reference": "83ee6f38df0a63106a9e4536e3060458b74ccedb", + "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/f0292ccf0ec75843d65027214426b6b163b48b41", + "reference": "f0292ccf0ec75843d65027214426b6b163b48b41", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", - "php": "^5.5 || ^7.0 || ^8.0", - "symfony/css-selector": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" + "php": "^7.4 || ^8.0", + "symfony/css-selector": "^5.4 || ^6.0 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^7.5 || ^8.5.21 || ^9.5.10" + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^8.5.21 || ^9.5.10" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { @@ -8163,27 +9504,139 @@ "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", "support": { "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues", - "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/v2.2.7" + "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/v2.4.0" }, - "time": "2023-12-08T13:03:43+00:00" + "time": "2025-12-02T11:56:42+00:00" }, { - "name": "uwil/k8s-laravel", - "version": "1.4.0", + "name": "uwil/arcadia-api-php-client", + "version": "1.0.0", "source": { "type": "git", - "url": "git@lab.s-web.fr:ldc-web/projets/k8s-laravel.git", - "reference": "14da608cb5ebc1c48615d213545655db2009364f" + "url": "git@lab.s-web.fr:ldc-web/projets/arcadia/arcadia-php-client.git", + "reference": "70d38cccd1f9095418859e88f206c94937cae378" }, "dist": { "type": "zip", - "url": "https://lab.s-web.fr/api/v4/projects/90/packages/composer/archives/uwil/k8s-laravel.zip?sha=14da608cb5ebc1c48615d213545655db2009364f", - "reference": "14da608cb5ebc1c48615d213545655db2009364f", + "url": "https://lab.s-web.fr/api/v4/projects/251/packages/composer/archives/uwil/arcadia-api-php-client.zip?sha=70d38cccd1f9095418859e88f206c94937cae378", + "reference": "70d38cccd1f9095418859e88f206c94937cae378", "shasum": "" }, "require": { - "illuminate/support": "~8|~9|~10|~11", - "laravel/framework": "~8|~9|~10|~11", + "ext-curl": "*", + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^7.10", + "php": ">=8.3", + "symfony/polyfill-php86": "^1.41", + "uwil/arcadia-kiota-open-api-client": "^0.1.0" + }, + "require-dev": { + "ace-of-aces/intellipest": "^0.3.0", + "dg/bypass-finals": "^1.9", + "friendsofphp/php-cs-fixer": "^3.94", + "laravel/pint": "^1.29", + "mockery/mockery": "^1.6", + "pestphp/pest": "^4.4", + "phpstan/phpstan": "^2.1", + "slevomat/coding-standard": "^8.28" + }, + "type": "library", + "autoload": { + "psr-4": { + "Uwil\\ArcadiaApiPhpClient\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests/" + } + }, + "scripts": { + "test": [ + "vendor/bin/pest --log-junit=junit.xml" + ], + "format": [ + "vendor/bin/pint" + ], + "lint:php": [ + "find . -path './vendor' -prune -o -type f -name '*.php' -print0 | xargs -0 -n1 -P4 -I{} php -l \"{}\"" + ], + "lint:pint": [ + "vendor/bin/pint --no-interaction --quiet" + ], + "lint:phpcs": [ + "vendor/bin/phpcs" + ], + "lint:phpstan": [ + "vendor/bin/phpstan analyse" + ], + "test:coverage": [ + "vendor/bin/pest --log-junit=junit.xml --coverage --coverage-html=coverage --coverage-clover=coverage.xml" + ] + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "LDC Digital", + "email": "digital@ldc.fr" + } + ], + "description": "PHP Client implementation for Arcadia API" + }, + { + "name": "uwil/arcadia-kiota-open-api-client", + "version": "0.1.5", + "source": { + "type": "git", + "url": "git@lab.s-web.fr:ldc-web/projets/arcadia/arcadia-kiota-openapi-client.git", + "reference": "a7dce9544b2215e964ce1922033a8f3fc5f416bf" + }, + "dist": { + "type": "zip", + "url": "https://lab.s-web.fr/api/v4/projects/278/packages/composer/archives/uwil/arcadia-kiota-open-api-client.zip?sha=a7dce9544b2215e964ce1922033a8f3fc5f416bf", + "reference": "a7dce9544b2215e964ce1922033a8f3fc5f416bf", + "shasum": "" + }, + "require": { + "microsoft/kiota-bundle": "^2.1", + "php": "^8.2 || ^8.3 || ^8.4 || ^8.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Uwil\\ArcadiaKiotaOpenApiClient\\": "client/" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "LDC Digital", + "email": "digital@ldc.fr" + } + ], + "description": "Client generated with Kiota with Arcadia Api OpenApi specification" + }, + { + "name": "uwil/k8s-laravel", + "version": "3.0.0", + "source": { + "type": "git", + "url": "git@lab.s-web.fr:ldc-web/projets/k8s-laravel.git", + "reference": "96f85bef45b1ee8d6c2f85e5af2aa6003fa357fd" + }, + "dist": { + "type": "zip", + "url": "https://lab.s-web.fr/api/v4/projects/90/packages/composer/archives/uwil/k8s-laravel.zip?sha=96f85bef45b1ee8d6c2f85e5af2aa6003fa357fd", + "reference": "96f85bef45b1ee8d6c2f85e5af2aa6003fa357fd", + "shasum": "" + }, + "require": { + "illuminate/support": "~8|~9|~10|~11|~12|~13", + "laravel/framework": "~8|~9|~10|~11|~12|~13", "php": "~7.3|~7.4|~8" }, "require-dev": { @@ -8222,37 +9675,205 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Vincent BRIDIER", - "email": "vincent.bridier@ldc.fr", - "homepage": "https://www.ldc.fr" - } - ], - "description": "Laravel requirements for k8s" + "description": "Laravel requirements for k8s", + "support": { + "email": "equipe.web@ldc.fr", + "issues": "https://lab.s-web.fr/ldc-web/projets/k8s-laravel/-/issues" + } }, { - "name": "vlucas/phpdotenv", - "version": "v5.6.1", + "name": "uwil/laravel-admin-secure", + "version": "6.0.1", "source": { "type": "git", - "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2" + "url": "git@lab.s-web.fr:ldc-web/projets/ldc-web-admin-secure-laravel.git", + "reference": "d0c4dbc6f0e196e30da85881aebc71b40464712a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/a59a13791077fe3d44f90e7133eb68e7d22eaff2", - "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2", + "url": "https://lab.s-web.fr/api/v4/projects/20/packages/composer/archives/uwil/laravel-admin-secure.zip?sha=d0c4dbc6f0e196e30da85881aebc71b40464712a", + "reference": "d0c4dbc6f0e196e30da85881aebc71b40464712a", + "shasum": "" + }, + "require": { + "dxw/cidr": "^4.0.0", + "illuminate/support": "~11|~12|~13", + "laravel/framework": "~11|~12|~13", + "php": "^8.3", + "symfony/options-resolver": "^7.0|^8.0" + }, + "require-dev": { + "driftingly/rector-laravel": "^2.3", + "larastan/larastan": "^3.9", + "laravel/pint": "^1.29", + "orchestra/testbench": "^11.1", + "slevomat/coding-standard": "^8.3", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Uwil\\LaravelAdminSecure\\AdminSecureServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Uwil\\LaravelAdminSecure\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Uwil\\LaravelAdminSecure\\Tests\\": "tests" + } + }, + "scripts": { + "phpcs": [ + "./vendor/bin/phpcs" + ], + "rector": [ + "./vendor/bin/rector" + ], + "phpstan": [ + "./vendor/bin/phpstan" + ], + "post-autoload-dump": [ + "@php ./vendor/bin/testbench package:discover --ansi" + ] + }, + "license": [ + "MIT" + ], + "description": "Restrict access to LDC Network", + "keywords": [ + "laravel", + "security", + "uwil" + ], + "support": { + "email": "digital@ldc.fr", + "issues": "https://lab.s-web.fr/ldc-web/projets/laravel-admin-secure/-/issues" + } + }, + { + "name": "uwil/laravel-redirections", + "version": "3.0.0", + "source": { + "type": "git", + "url": "git@lab.s-web.fr:ldc-web/projets/laravel-redirections.git", + "reference": "3bb877be593e69c1ab259513cca1fffbbf50f40c" + }, + "dist": { + "type": "zip", + "url": "https://lab.s-web.fr/api/v4/projects/224/packages/composer/archives/uwil/laravel-redirections.zip?sha=3bb877be593e69c1ab259513cca1fffbbf50f40c", + "reference": "3bb877be593e69c1ab259513cca1fffbbf50f40c", + "shasum": "" + }, + "require": { + "illuminate/support": "^12.0|^13", + "laravel/framework": "^12.0|^13", + "php": "^8.5" + }, + "require-dev": { + "phpstan/phpstan": "^2.1", + "slevomat/coding-standard": "^8.3" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Uwil\\Laravel\\Redirections\\RedirectServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Uwil\\Laravel\\Redirections\\": "src/" + } + }, + "scripts": { + "phpcs": [ + "./vendor/bin/phpcs" + ], + "phpstan": [ + "./vendor/bin/phpstan" + ] + }, + "license": [ + "MIT" + ], + "description": "Redirect broken or old URLs in Laravel project.", + "keywords": [ + "laravel", + "redirect", + "uwil" + ], + "support": { + "email": "equipe.web@ldc.fr", + "issues": "https://lab.s-web.fr/ldc-web/projets/laravel-redirects/-/issues" + } + }, + { + "name": "uwil/sitemap-generator", + "version": "7.1.1", + "source": { + "type": "git", + "url": "git@lab.s-web.fr:ldc-web/projets/sitemap-generator.git", + "reference": "1f789eca239e9c064f9eab8acc1dc5fca3428b00" + }, + "dist": { + "type": "zip", + "url": "https://lab.s-web.fr/api/v4/projects/108/packages/composer/archives/uwil/sitemap-generator.zip?sha=1f789eca239e9c064f9eab8acc1dc5fca3428b00", + "reference": "1f789eca239e9c064f9eab8acc1dc5fca3428b00", + "shasum": "" + }, + "require": { + "illuminate/support": "~11|~12|~13", + "laravel/framework": "~11|~12|~13", + "mcamara/laravel-localization": "^2.4", + "spatie/laravel-sitemap": "^8.1" + }, + "require-dev": { + "slevomat/coding-standard": "^8.15" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Uwil\\SitemapGenerator\\SitemapGeneratorServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Uwil\\SitemapGenerator\\": "src/" + } + }, + "description": "Create sitemap.xml" + }, + { + "name": "vlucas/phpdotenv", + "version": "v5.7.0", + "source": { + "type": "git", + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "301c07936b16d88628b126b01d082ba153cf4c40" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/301c07936b16d88628b126b01d082ba153cf4c40", + "reference": "301c07936b16d88628b126b01d082ba153cf4c40", "shasum": "" }, "require": { "ext-pcre": "*", - "graham-campbell/result-type": "^1.1.3", + "graham-campbell/result-type": "^1.2", "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9.3", - "symfony/polyfill-ctype": "^1.24", - "symfony/polyfill-mbstring": "^1.24", - "symfony/polyfill-php80": "^1.24" + "phpoption/phpoption": "^1.10", + "symfony/polyfill-ctype": "^1.26", + "symfony/polyfill-mbstring": "^1.26", + "symfony/polyfill-php80": "^1.26" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", @@ -8293,7 +9914,7 @@ "homepage": "https://github.com/vlucas" } ], - "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "description": "Loads environment variables from `.env` to `$_ENV` and `$_SERVER` automagically, and optionally to `getenv()`.", "keywords": [ "dotenv", "env", @@ -8301,7 +9922,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.1" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.7.0" }, "funding": [ { @@ -8313,27 +9934,27 @@ "type": "tidelift" } ], - "time": "2024-07-20T21:52:34+00:00" + "time": "2026-08-24T18:07:49+00:00" }, { "name": "voku/portable-ascii", - "version": "1.6.1", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/voku/portable-ascii.git", - "reference": "87337c91b9dfacee02452244ee14ab3c43bc485a" + "reference": "8e1051fe39379367aecf014f41744ce7539a856f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/87337c91b9dfacee02452244ee14ab3c43bc485a", - "reference": "87337c91b9dfacee02452244ee14ab3c43bc485a", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/8e1051fe39379367aecf014f41744ce7539a856f", + "reference": "8e1051fe39379367aecf014f41744ce7539a856f", "shasum": "" }, "require": { - "php": ">=7.0.0" + "php": ">=7.1.0" }, "require-dev": { - "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" + "phpunit/phpunit": "~8.5 || ~9.6 || ~10.5 || ~11.5" }, "suggest": { "ext-intl": "Use Intl for transliterator_transliterate() support" @@ -8351,7 +9972,7 @@ "authors": [ { "name": "Lars Moelleken", - "homepage": "http://www.moelleken.org/" + "homepage": "https://www.moelleken.org/" } ], "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", @@ -8363,7 +9984,7 @@ ], "support": { "issues": "https://github.com/voku/portable-ascii/issues", - "source": "https://github.com/voku/portable-ascii/tree/1.6.1" + "source": "https://github.com/voku/portable-ascii/tree/2.1.1" }, "funding": [ { @@ -8387,37 +10008,41 @@ "type": "tidelift" } ], - "time": "2022-01-24T18:55:24+00:00" + "time": "2026-04-26T05:33:54+00:00" }, { "name": "webmozart/assert", - "version": "1.11.0", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + "reference": "8a163706bbcac613733dba03f51e13b5eb1bb819" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/8a163706bbcac613733dba03f51e13b5eb1bb819", + "reference": "8a163706bbcac613733dba03f51e13b5eb1bb819", "shasum": "" }, "require": { "ext-ctype": "*", - "php": "^7.2 || ^8.0" + "ext-date": "*", + "ext-filter": "*", + "php": "^8.2" }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" + "suggest": { + "ext-intl": "", + "ext-simplexml": "", + "ext-spl": "" }, "type": "library", "extra": { + "psalm": { + "pluginClass": "Webmozart\\Assert\\PsalmPlugin" + }, "branch-alias": { - "dev-master": "1.10-dev" + "dev-master": "2.0-dev", + "dev-feature/2-0": "2.0-dev" } }, "autoload": { @@ -8433,6 +10058,10 @@ { "name": "Bernhard Schussek", "email": "bschussek@gmail.com" + }, + { + "name": "Woody Gilk", + "email": "woody.gilk@gmail.com" } ], "description": "Assertions to validate method input/output with nice error messages.", @@ -8443,43 +10072,595 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" + "source": "https://github.com/webmozarts/assert/tree/2.5.0" }, - "time": "2022-06-03T18:03:27+00:00" + "time": "2026-10-05T23:14:19+00:00" } ], "packages-dev": [ { - "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.2", + "name": "ace-of-aces/intellipest", + "version": "v0.4.0", "source": { "type": "git", - "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" + "url": "https://github.com/ace-of-aces/intellipest.git", + "reference": "5e59185fac35c0c5e32eb18a155d479e369f77f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "url": "https://api.github.com/repos/ace-of-aces/intellipest/zipball/5e59185fac35c0c5e32eb18a155d479e369f77f3", + "reference": "5e59185fac35c0c5e32eb18a155d479e369f77f3", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + "nikic/php-parser": "^5.7", + "php": "^8.3", + "react/event-loop": "^1.6", + "symfony/console": "^7.4.0 || ^8.0.0" }, "require-dev": { - "composer/composer": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0" + "laravel/pint": "^1.29", + "pestphp/pest": "^4.3", + "phpstan/phpstan": "^2.1" }, - "type": "composer-plugin", + "bin": [ + "bin/intellipest" + ], + "type": "library", + "autoload": { + "psr-4": { + "AceOfAces\\IntelliPest\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Julian Schramm", + "email": "hi@julian.center" + } + ], + "description": "Generate IDE helpers to assist development with PestPHP", + "support": { + "issues": "https://github.com/ace-of-aces/intellipest/issues", + "source": "https://github.com/ace-of-aces/intellipest/tree/v0.4.0" + }, + "time": "2026-04-08T15:15:37+00:00" + }, + { + "name": "archtechx/enums", + "version": "v1.1.2", + "source": { + "type": "git", + "url": "https://github.com/archtechx/enums.git", + "reference": "81375b71c176f680880a95e7448d84258cfb5c72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/archtechx/enums/zipball/81375b71c176f680880a95e7448d84258cfb5c72", + "reference": "81375b71c176f680880a95e7448d84258cfb5c72", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "larastan/larastan": "^2.4", + "orchestra/testbench": "^8.0 || ^9.0", + "pestphp/pest": "^2.0", + "pestphp/pest-plugin-laravel": "^2.0" + }, + "type": "library", "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + "phpstan": { + "includes": [ + "extension.neon" + ] + } }, "autoload": { "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + "ArchTech\\Enums\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Samuel Štancl", + "email": "samuel@archte.ch" + } + ], + "description": "Helpers for making PHP enums more lovable.", + "support": { + "issues": "https://github.com/archtechx/enums/issues", + "source": "https://github.com/archtechx/enums/tree/v1.1.2" + }, + "time": "2025-06-06T23:15:09+00:00" + }, + { + "name": "barryvdh/laravel-ide-helper", + "version": "v3.7.0", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/laravel-ide-helper.git", + "reference": "ad7e37676f1ff985d55ef1b6b96a0c0a40f2609a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/ad7e37676f1ff985d55ef1b6b96a0c0a40f2609a", + "reference": "ad7e37676f1ff985d55ef1b6b96a0c0a40f2609a", + "shasum": "" + }, + "require": { + "barryvdh/reflection-docblock": "^2.4", + "composer/class-map-generator": "^1.0", + "ext-json": "*", + "illuminate/console": "^11.15 || ^12 || ^13.0", + "illuminate/database": "^11.15 || ^12 || ^13.0", + "illuminate/filesystem": "^11.15 || ^12 || ^13.0", + "illuminate/support": "^11.15 || ^12 || ^13.0", + "php": "^8.2" + }, + "require-dev": { + "ext-pdo_sqlite": "*", + "friendsofphp/php-cs-fixer": "^3", + "illuminate/config": "^11.15 || ^12 || ^13.0", + "illuminate/view": "^11.15 || ^12 || ^13.0", + "larastan/larastan": "^3.1", + "mockery/mockery": "^1.4", + "orchestra/testbench": "^9.2 || ^10 || ^11.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^10.5 || ^11.5.3 || ^12.5.12", + "spatie/phpunit-snapshot-assertions": "^4 || ^5", + "vlucas/phpdotenv": "^5" + }, + "suggest": { + "illuminate/events": "Required for automatic helper generation (^6|^7|^8|^9|^10|^11)." + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "3.6-dev" + } + }, + "autoload": { + "psr-4": { + "Barryvdh\\LaravelIdeHelper\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.", + "keywords": [ + "autocomplete", + "codeintel", + "dev", + "helper", + "ide", + "laravel", + "netbeans", + "phpdoc", + "phpstorm", + "sublime" + ], + "support": { + "issues": "https://github.com/barryvdh/laravel-ide-helper/issues", + "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v3.7.0" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2026-03-17T14:12:51+00:00" + }, + { + "name": "barryvdh/reflection-docblock", + "version": "v2.4.1", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/ReflectionDocBlock.git", + "reference": "4f5ba70c30c81f2ce03a16a9965832cfcc31ed3b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/ReflectionDocBlock/zipball/4f5ba70c30c81f2ce03a16a9965832cfcc31ed3b", + "reference": "4f5ba70c30c81f2ce03a16a9965832cfcc31ed3b", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.14|^9" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "psr-0": { + "Barryvdh": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "support": { + "source": "https://github.com/barryvdh/ReflectionDocBlock/tree/v2.4.1" + }, + "time": "2026-03-05T20:09:01+00:00" + }, + { + "name": "brianium/paratest", + "version": "v7.20.0", + "source": { + "type": "git", + "url": "https://github.com/paratestphp/paratest.git", + "reference": "81c80677c9ec0ed4ef16b246167f11dec81a6e3d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/81c80677c9ec0ed4ef16b246167f11dec81a6e3d", + "reference": "81c80677c9ec0ed4ef16b246167f11dec81a6e3d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-simplexml": "*", + "fidry/cpu-core-counter": "^1.3.0", + "jean85/pretty-package-versions": "^2.1.1", + "php": "~8.3.0 || ~8.4.0 || ~8.5.0", + "phpunit/php-code-coverage": "^12.5.3 || ^13.0.1", + "phpunit/php-file-iterator": "^6.0.1 || ^7", + "phpunit/php-timer": "^8 || ^9", + "phpunit/phpunit": "^12.5.14 || ^13.0.5", + "sebastian/environment": "^8.0.3 || ^9", + "symfony/console": "^7.4.7 || ^8.0.7", + "symfony/process": "^7.4.5 || ^8.0.5" + }, + "require-dev": { + "doctrine/coding-standard": "^14.0.0", + "ext-pcntl": "*", + "ext-pcov": "*", + "ext-posix": "*", + "phpstan/phpstan": "^2.1.44", + "phpstan/phpstan-deprecation-rules": "^2.0.4", + "phpstan/phpstan-phpunit": "^2.0.16", + "phpstan/phpstan-strict-rules": "^2.0.10", + "symfony/filesystem": "^7.4.6 || ^8.0.6" + }, + "bin": [ + "bin/paratest", + "bin/paratest_for_phpstorm" + ], + "type": "library", + "autoload": { + "psr-4": { + "ParaTest\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Scaturro", + "email": "scaturrob@gmail.com", + "role": "Developer" + }, + { + "name": "Filippo Tessarotto", + "email": "zoeslam@gmail.com", + "role": "Developer" + } + ], + "description": "Parallel testing for PHP", + "homepage": "https://github.com/paratestphp/paratest", + "keywords": [ + "concurrent", + "parallel", + "phpunit", + "testing" + ], + "support": { + "issues": "https://github.com/paratestphp/paratest/issues", + "source": "https://github.com/paratestphp/paratest/tree/v7.20.0" + }, + "funding": [ + { + "url": "https://github.com/sponsors/Slamdunk", + "type": "github" + }, + { + "url": "https://paypal.me/filippotessarotto", + "type": "paypal" + } + ], + "time": "2026-03-29T15:46:14+00:00" + }, + { + "name": "codezero/browser-locale", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/codezero-be/browser-locale.git", + "reference": "dd6c50e5557b06b57960df6db7f52e85ef683e5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/codezero-be/browser-locale/zipball/dd6c50e5557b06b57960df6db7f52e85ef683e5e", + "reference": "dd6c50e5557b06b57960df6db7f52e85ef683e5e", + "shasum": "" + }, + "require": { + "php": "^7.0|^8.0" + }, + "require-dev": { + "mockery/mockery": "^1.3.3", + "phpunit/phpunit": "^6.0|^7.0|^8.0|^9.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "CodeZero\\BrowserLocale\\Laravel\\BrowserLocaleServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "CodeZero\\BrowserLocale\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ivan Vermeyen", + "email": "ivan@codezero.be" + } + ], + "description": "Get the most preferred locales from your visitor's browser.", + "keywords": [ + "browser", + "country", + "detect", + "language", + "locale", + "php", + "website" + ], + "support": { + "issues": "https://github.com/codezero-be/browser-locale/issues", + "source": "https://github.com/codezero-be/browser-locale/tree/3.4.0" + }, + "funding": [ + { + "url": "https://paypal.me/ivanvermeyen", + "type": "custom" + }, + { + "url": "https://ko-fi.com/ivanvermeyen", + "type": "ko_fi" + } + ], + "time": "2024-03-02T12:51:17+00:00" + }, + { + "name": "composer/class-map-generator", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/composer/class-map-generator.git", + "reference": "c0efbeb2f3fd7e23c7f180a59765c0b48a31fbc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/c0efbeb2f3fd7e23c7f180a59765c0b48a31fbc4", + "reference": "c0efbeb2f3fd7e23c7f180a59765c0b48a31fbc4", + "shasum": "" + }, + "require": { + "composer/pcre": "^2.1 || ^3.1", + "php": "^7.2 || ^8.0", + "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7 || ^8" + }, + "require-dev": { + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-deprecation-rules": "^1 || ^2", + "phpstan/phpstan-phpunit": "^1 || ^2", + "phpstan/phpstan-strict-rules": "^1.1 || ^2", + "phpunit/phpunit": "^8", + "symfony/filesystem": "^5.4 || ^6 || ^7 || ^8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\ClassMapGenerator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Utilities to scan PHP code and generate class maps.", + "keywords": [ + "classmap" + ], + "support": { + "issues": "https://github.com/composer/class-map-generator/issues", + "source": "https://github.com/composer/class-map-generator/tree/1.8.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + } + ], + "time": "2026-09-25T15:24:19+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-06T16:37:16+00:00" + }, + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/composer-installer.git", + "reference": "963f0c67bffde0eac41b56be71ac0e8ba132f0bd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/963f0c67bffde0eac41b56be71ac0e8ba132f0bd", + "reference": "963f0c67bffde0eac41b56be71ac0e8ba132f0bd", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.2", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.1.0 || ^4.0" + }, + "require-dev": { + "composer/composer": "^2.2", + "ext-json": "*", + "ext-zip": "*", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcompatibility/php-compatibility": "^9.0 || ^10.0.0@dev", + "yoast/phpunit-polyfills": "^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -8489,17 +10670,16 @@ "authors": [ { "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" + "email": "opensource@frenck.dev", + "homepage": "https://frenck.dev", + "role": "Open source developer" }, { "name": "Contributors", - "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" + "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", "keywords": [ "PHPCodeSniffer", "PHP_CodeSniffer", @@ -8519,237 +10699,110 @@ "tests" ], "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" - }, - "time": "2022-02-04T12:51:07+00:00" - }, - { - "name": "doctrine/cache", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/cache.git", - "reference": "1ca8f21980e770095a31456042471a57bc4c68fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb", - "reference": "1ca8f21980e770095a31456042471a57bc4c68fb", - "shasum": "" - }, - "require": { - "php": "~7.1 || ^8.0" - }, - "conflict": { - "doctrine/common": ">2.2,<2.4" - }, - "require-dev": { - "cache/integration-tests": "dev-master", - "doctrine/coding-standard": "^9", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psr/cache": "^1.0 || ^2.0 || ^3.0", - "symfony/cache": "^4.4 || ^5.4 || ^6", - "symfony/var-exporter": "^4.4 || ^5.4 || ^6" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", - "homepage": "https://www.doctrine-project.org/projects/cache.html", - "keywords": [ - "abstraction", - "apcu", - "cache", - "caching", - "couchdb", - "memcached", - "php", - "redis", - "xcache" - ], - "support": { - "issues": "https://github.com/doctrine/cache/issues", - "source": "https://github.com/doctrine/cache/tree/2.2.0" + "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "security": "https://github.com/PHPCSStandards/composer-installer/security/policy", + "source": "https://github.com/PHPCSStandards/composer-installer" }, "funding": [ { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" + "url": "https://github.com/PHPCSStandards", + "type": "github" }, { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" + "url": "https://github.com/jrfnl", + "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", - "type": "tidelift" + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2022-05-20T20:07:39+00:00" + "time": "2026-05-06T08:26:05+00:00" }, { - "name": "doctrine/dbal", - "version": "3.3.8", + "name": "dg/bypass-finals", + "version": "v1.11.0", "source": { "type": "git", - "url": "https://github.com/doctrine/dbal.git", - "reference": "f873a820227bc352d023791775a01f078a30dfe1" + "url": "https://github.com/dg/bypass-finals.git", + "reference": "b21595bdd1937e9ac912d68380dc85a65d77285f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/f873a820227bc352d023791775a01f078a30dfe1", - "reference": "f873a820227bc352d023791775a01f078a30dfe1", + "url": "https://api.github.com/repos/dg/bypass-finals/zipball/b21595bdd1937e9ac912d68380dc85a65d77285f", + "reference": "b21595bdd1937e9ac912d68380dc85a65d77285f", "shasum": "" }, "require": { - "composer-runtime-api": "^2", - "doctrine/cache": "^1.11|^2.0", - "doctrine/deprecations": "^0.5.3|^1", - "doctrine/event-manager": "^1.0", - "php": "^7.3 || ^8.0", - "psr/cache": "^1|^2|^3", - "psr/log": "^1|^2|^3" + "php": ">=8.2" }, "require-dev": { - "doctrine/coding-standard": "9.0.0", - "jetbrains/phpstorm-stubs": "2022.1", - "phpstan/phpstan": "1.8.2", - "phpstan/phpstan-strict-rules": "^1.3", - "phpunit/phpunit": "9.5.21", - "psalm/plugin-phpunit": "0.17.0", - "squizlabs/php_codesniffer": "3.7.1", - "symfony/cache": "^5.2|^6.0", - "symfony/console": "^2.7|^3.0|^4.0|^5.0|^6.0", - "vimeo/psalm": "4.24.0" + "nette/phpstan-rules": "^1.0", + "nette/tester": "^2.6", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.2" }, - "suggest": { - "symfony/console": "For helpful console commands such as SQL execution and import of files." - }, - "bin": [ - "bin/doctrine-dbal" - ], "type": "library", "autoload": { - "psr-4": { - "Doctrine\\DBAL\\": "src" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" + "name": "David Grudl", + "homepage": "https://davidgrudl.com" } ], - "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", - "homepage": "https://www.doctrine-project.org/projects/dbal.html", + "description": "Removes final keyword from source code on-the-fly and allows mocking of final methods and classes", "keywords": [ - "abstraction", - "database", - "db2", - "dbal", - "mariadb", - "mssql", - "mysql", - "oci8", - "oracle", - "pdo", - "pgsql", - "postgresql", - "queryobject", - "sasql", - "sql", - "sqlite", - "sqlserver", - "sqlsrv" + "finals", + "mocking", + "phpunit", + "testing", + "unit" ], "support": { - "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.3.8" + "issues": "https://github.com/dg/bypass-finals/issues", + "source": "https://github.com/dg/bypass-finals/tree/v1.11.0" }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal", - "type": "tidelift" - } - ], - "time": "2022-08-05T15:35:35+00:00" + "time": "2026-07-24T12:24:07+00:00" }, { "name": "doctrine/deprecations", - "version": "1.1.4", + "version": "1.1.6", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" + "reference": "d4fe3e6fd9bb9e72557a19674f44d8ac7db4c6ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", - "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/d4fe3e6fd9bb9e72557a19674f44d8ac7db4c6ca", + "reference": "d4fe3e6fd9bb9e72557a19674f44d8ac7db4c6ca", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, + "conflict": { + "phpunit/phpunit": "<=7.5 || >=14" + }, "require-dev": { - "doctrine/coding-standard": "^9 || ^12", - "phpstan/phpstan": "1.4.10 || 2.0.3", + "doctrine/coding-standard": "^9 || ^12 || ^14", + "phpstan/phpstan": "1.4.10 || 2.1.30", "phpstan/phpstan-phpunit": "^1.0 || ^2", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12.4 || ^13.0", "psr/log": "^1 || ^2 || ^3" }, "suggest": { @@ -8769,41 +10822,41 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.4" + "source": "https://github.com/doctrine/deprecations/tree/1.1.6" }, - "time": "2024-12-07T21:18:45+00:00" + "time": "2026-02-07T07:09:04+00:00" }, { - "name": "doctrine/event-manager", - "version": "1.2.0", + "name": "dragon-code/contracts", + "version": "2.25.0", "source": { "type": "git", - "url": "https://github.com/doctrine/event-manager.git", - "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520" + "url": "https://github.com/TheDragonCode/contracts.git", + "reference": "13d1254801026be5ba33cf1309a414953869175f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/event-manager/zipball/95aa4cb529f1e96576f3fda9f5705ada4056a520", - "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520", + "url": "https://api.github.com/repos/TheDragonCode/contracts/zipball/13d1254801026be5ba33cf1309a414953869175f", + "reference": "13d1254801026be5ba33cf1309a414953869175f", "shasum": "" }, "require": { - "doctrine/deprecations": "^0.5.3 || ^1", - "php": "^7.1 || ^8.0" + "php": "^7.2.5 || ^8.0", + "psr/http-message": "^1.0.1 || ^2.0", + "symfony/http-kernel": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0", + "symfony/polyfill-php80": "^1.23" }, "conflict": { - "doctrine/common": "<2.9" + "andrey-helldar/contracts": "*" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^10", - "phpstan/phpstan": "~1.4.10 || ^1.8.8", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.24" + "illuminate/database": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "phpdocumentor/reflection-docblock": "^5.0 || ^6.0" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\": "src" + "DragonCode\\Contracts\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -8812,288 +10865,319 @@ ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - }, - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro", + "homepage": "https://dragon-code.pro" } ], - "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", - "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "description": "A set of contracts for any project", "keywords": [ - "event", - "event dispatcher", - "event manager", - "event system", - "events" + "contracts", + "interfaces" ], "support": { - "issues": "https://github.com/doctrine/event-manager/issues", - "source": "https://github.com/doctrine/event-manager/tree/1.2.0" + "source": "https://github.com/TheDragonCode/contracts" }, "funding": [ { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" + "url": "https://boosty.to/dragon-code", + "type": "boosty" }, { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", - "type": "tidelift" + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" } ], - "time": "2022-10-12T20:51:15+00:00" + "time": "2026-03-17T21:50:20+00:00" }, { - "name": "doctrine/instantiator", - "version": "1.5.0", + "name": "dragon-code/pretty-array", + "version": "4.2.0", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + "url": "https://github.com/TheDragonCode/pretty-array.git", + "reference": "b94034d92172a5d14a578822d68b2a8f8b5388e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "url": "https://api.github.com/repos/TheDragonCode/pretty-array/zipball/b94034d92172a5d14a578822d68b2a8f8b5388e0", + "reference": "b94034d92172a5d14a578822d68b2a8f8b5388e0", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9 || ^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.30 || ^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.5.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:15:36+00:00" - }, - { - "name": "facade/flare-client-php", - "version": "1.10.0", - "source": { - "type": "git", - "url": "https://github.com/facade/flare-client-php.git", - "reference": "213fa2c69e120bca4c51ba3e82ed1834ef3f41b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/facade/flare-client-php/zipball/213fa2c69e120bca4c51ba3e82ed1834ef3f41b8", - "reference": "213fa2c69e120bca4c51ba3e82ed1834ef3f41b8", - "shasum": "" - }, - "require": { - "facade/ignition-contracts": "~1.0", - "illuminate/pipeline": "^5.5|^6.0|^7.0|^8.0", - "php": "^7.1|^8.0", - "symfony/http-foundation": "^3.3|^4.1|^5.0", - "symfony/mime": "^3.4|^4.0|^5.1", - "symfony/var-dumper": "^3.4|^4.0|^5.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.14", - "phpunit/phpunit": "^7.5", - "spatie/phpunit-snapshot-assertions": "^2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "files": [ - "src/helpers.php" - ], - "psr-4": { - "Facade\\FlareClient\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Send PHP errors to Flare", - "homepage": "https://github.com/facade/flare-client-php", - "keywords": [ - "exception", - "facade", - "flare", - "reporting" - ], - "support": { - "issues": "https://github.com/facade/flare-client-php/issues", - "source": "https://github.com/facade/flare-client-php/tree/1.10.0" - }, - "funding": [ - { - "url": "https://github.com/spatie", - "type": "github" - } - ], - "time": "2022-08-09T11:23:57+00:00" - }, - { - "name": "facade/ignition", - "version": "2.17.7", - "source": { - "type": "git", - "url": "https://github.com/facade/ignition.git", - "reference": "b4f5955825bb4b74cba0f94001761c46335c33e9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/facade/ignition/zipball/b4f5955825bb4b74cba0f94001761c46335c33e9", - "reference": "b4f5955825bb4b74cba0f94001761c46335c33e9", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", + "dragon-code/contracts": "^2.20", + "dragon-code/support": "^6.11.2", + "ext-dom": "*", "ext-mbstring": "*", - "facade/flare-client-php": "^1.9.1", - "facade/ignition-contracts": "^1.0.2", - "illuminate/support": "^7.0|^8.0", - "monolog/monolog": "^2.0", - "php": "^7.2.5|^8.0", - "symfony/console": "^5.0", - "symfony/var-dumper": "^5.0" + "php": "^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.14", - "livewire/livewire": "^2.4", - "mockery/mockery": "^1.3", - "orchestra/testbench": "^5.0|^6.0", - "psalm/plugin-laravel": "^1.2" + "phpunit/phpunit": "^9.6 || ^10.0 || ^11.0 || ^12.0" }, "suggest": { - "laravel/telescope": "^3.1" + "symfony/thanks": "Give thanks (in the form of a GitHub) to your fellow PHP package maintainers" }, "type": "library", - "extra": { - "laravel": { - "aliases": { - "Flare": "Facade\\Ignition\\Facades\\Flare" - }, - "providers": [ - "Facade\\Ignition\\IgnitionServiceProvider" - ] - }, - "branch-alias": { - "dev-master": "2.x-dev" - } - }, "autoload": { - "files": [ - "src/helpers.php" - ], "psr-4": { - "Facade\\Ignition\\": "src" + "DragonCode\\PrettyArray\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "A beautiful error page for Laravel applications.", - "homepage": "https://github.com/facade/ignition", + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro", + "homepage": "https://dragon-code.pro" + } + ], + "description": "Simple conversion of an array to a pretty view", "keywords": [ - "error", - "flare", - "laravel", - "page" + "andrey helldar", + "array", + "dragon", + "dragon code", + "pretty", + "pretty array" ], "support": { - "docs": "https://flareapp.io/docs/ignition-for-laravel/introduction", - "forum": "https://twitter.com/flareappio", - "issues": "https://github.com/facade/ignition/issues", - "source": "https://github.com/facade/ignition" + "issues": "https://github.com/TheDragonCode/pretty-array/issues", + "source": "https://github.com/TheDragonCode/pretty-array" }, - "time": "2023-01-26T12:34:59+00:00" + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2025-02-24T15:35:24+00:00" + }, + { + "name": "dragon-code/support", + "version": "6.17.1", + "source": { + "type": "git", + "url": "https://github.com/TheDragonCode/support.git", + "reference": "82a465953267989883d64b921e9725600a5073b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/TheDragonCode/support/zipball/82a465953267989883d64b921e9725600a5073b5", + "reference": "82a465953267989883d64b921e9725600a5073b5", + "shasum": "" + }, + "require": { + "dragon-code/contracts": "^2.22.0", + "ext-bcmath": "*", + "ext-ctype": "*", + "ext-dom": "*", + "ext-json": "*", + "ext-mbstring": "*", + "php": "^8.1", + "psr/http-message": "^1.0.1 || ^2.0", + "voku/portable-ascii": "^1.4.8 || ^2.0.1" + }, + "conflict": { + "andrey-helldar/support": "*" + }, + "require-dev": { + "illuminate/contracts": "^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0", + "phpunit/phpunit": "^9.6 || ^11.0 || ^12.0", + "symfony/var-dumper": "^6.0 || ^7.0" + }, + "suggest": { + "dragon-code/laravel-support": "Various helper files for the Laravel and Lumen frameworks", + "symfony/thanks": "Give thanks (in the form of a GitHub) to your fellow PHP package maintainers" + }, + "type": "library", + "extra": { + "dragon-code": { + "docs-generator": { + "preview": { + "brand": "php", + "vendor": "The Dragon Code" + } + } + } + }, + "autoload": { + "psr-4": { + "DragonCode\\Support\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro", + "homepage": "https://dragon-code.pro" + } + ], + "description": "Support package is a collection of helpers and tools for any project.", + "keywords": [ + "dragon", + "dragon-code", + "framework", + "helper", + "helpers", + "laravel", + "php", + "support", + "symfony", + "yii", + "yii2" + ], + "support": { + "issues": "https://github.com/TheDragonCode/support/issues", + "source": "https://github.com/TheDragonCode/support" + }, + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2026-04-03T15:06:29+00:00" + }, + { + "name": "driftingly/rector-laravel", + "version": "2.6.2", + "source": { + "type": "git", + "url": "https://github.com/driftingly/rector-laravel.git", + "reference": "c0f9a2ff7365cec45d4dc64223608e7cec74604a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/driftingly/rector-laravel/zipball/c0f9a2ff7365cec45d4dc64223608e7cec74604a", + "reference": "c0f9a2ff7365cec45d4dc64223608e7cec74604a", + "shasum": "" + }, + "require": { + "php": ">=8.3", + "rector/rector": "^2.6.4", + "symplify/rule-doc-generator-contracts": "^11.2", + "webmozart/assert": "^1.11 || ^2.0" + }, + "require-dev": { + "boundwize/structarmed": "^0.16", + "nette/utils": "^4.0", + "nikic/php-parser": "^5.6", + "phpstan/extension-installer": "^1.3", + "phpstan/phpstan": "^2.2", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpstan/phpstan-webmozart-assert": "^2.0", + "phpunit/phpunit": "^10.5", + "symplify/rule-doc-generator": "^12.2", + "tightenco/duster": "^3.1", + "tracy/tracy": "^2.10" + }, + "type": "rector-extension", + "extra": { + "rector": { + "includes": [ + "config/config.php" + ] + } + }, + "autoload": { + "psr-4": { + "RectorLaravel\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Rector upgrades rules for Laravel Framework", + "support": { + "issues": "https://github.com/driftingly/rector-laravel/issues", + "source": "https://github.com/driftingly/rector-laravel/tree/2.6.2" + }, + "time": "2026-08-29T21:42:57+00:00" + }, + { + "name": "entropy/entropy", + "version": "0.4.29", + "source": { + "type": "git", + "url": "https://github.com/TomasVotruba/entropy.git", + "reference": "e2dfbd791ab7acea5aed40deefa00b12ad902ca2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/TomasVotruba/entropy/zipball/e2dfbd791ab7acea5aed40deefa00b12ad902ca2", + "reference": "e2dfbd791ab7acea5aed40deefa00b12ad902ca2", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.4", + "symfony/polyfill-php80": "^1.31" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpunit/phpunit": "^9.6", + "rector/jack": "^1.0", + "rector/rector": "^2.4", + "rector/swiss-knife": "^2.4", + "shipmonk/composer-dependency-analyser": "^1.8", + "shipmonk/dead-code-detector": "^1.4", + "symplify/easy-coding-standard": "^13.1", + "symplify/phpstan-rules": "^14.10", + "tomasvotruba/type-coverage": "^2.2", + "tracy/tracy": "^2.12" + }, + "type": "library", + "autoload": { + "psr-4": { + "Entropy\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "proprietary" + ], + "description": "Entropy framework", + "support": { + "issues": "https://github.com/TomasVotruba/entropy/issues", + "source": "https://github.com/TomasVotruba/entropy/tree/0.4.29" + }, + "time": "2026-10-08T07:55:55+00:00" }, { "name": "fakerphp/faker", - "version": "v1.20.0", + "version": "v1.24.1", "source": { "type": "git", "url": "https://github.com/FakerPHP/Faker.git", - "reference": "37f751c67a5372d4e26353bd9384bc03744ec77b" + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/37f751c67a5372d4e26353bd9384bc03744ec77b", - "reference": "37f751c67a5372d4e26353bd9384bc03744ec77b", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0", + "php": "^7.4 || ^8.0", "psr/container": "^1.0 || ^2.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" }, @@ -9104,7 +11188,8 @@ "bamarni/composer-bin-plugin": "^1.4.1", "doctrine/persistence": "^1.3 || ^2.0", "ext-intl": "*", - "symfony/phpunit-bridge": "^4.4 || ^5.2" + "phpunit/phpunit": "^9.5.26", + "symfony/phpunit-bridge": "^5.4.16" }, "suggest": { "doctrine/orm": "Required to use Faker\\ORM\\Doctrine", @@ -9114,11 +11199,6 @@ "ext-mbstring": "Required for multibyte Unicode string functionality." }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "v1.20-dev" - } - }, "autoload": { "psr-4": { "Faker\\": "src/Faker/" @@ -9141,22 +11221,84 @@ ], "support": { "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/v1.20.0" + "source": "https://github.com/FakerPHP/Faker/tree/v1.24.1" }, - "time": "2022-07-20T13:12:54+00:00" + "time": "2024-11-21T13:46:39+00:00" }, { - "name": "filp/whoops", - "version": "2.17.0", + "name": "fidry/cpu-core-counter", + "version": "1.4.1", "source": { "type": "git", - "url": "https://github.com/filp/whoops.git", - "reference": "075bc0c26631110584175de6523ab3f1652eb28e" + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "d384a7d0d6e67aa497327260ca95023e92dc2032" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/075bc0c26631110584175de6523ab3f1652eb28e", - "reference": "075bc0c26631110584175de6523ab3f1652eb28e", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/d384a7d0d6e67aa497327260ca95023e92dc2032", + "reference": "d384a7d0d6e67aa497327260ca95023e92dc2032", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0 || ^1.1.2", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-deprecation-rules": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "symfony/polyfill-mbstring": "^1.33", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", + "keywords": [ + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.4.1" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2026-09-29T22:11:39+00:00" + }, + { + "name": "filp/whoops", + "version": "2.18.6", + "source": { + "type": "git", + "url": "https://github.com/filp/whoops.git", + "reference": "7d0a2cde892089bb09372f4366e9b960eb3001a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/filp/whoops/zipball/7d0a2cde892089bb09372f4366e9b960eb3001a9", + "reference": "7d0a2cde892089bb09372f4366e9b960eb3001a9", "shasum": "" }, "require": { @@ -9165,8 +11307,8 @@ }, "require-dev": { "mockery/mockery": "^1.0", - "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", - "symfony/var-dumper": "^4.0 || ^5.0" + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3 || ^10.5.58", + "symfony/var-dumper": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0" }, "suggest": { "symfony/var-dumper": "Pretty print complex values better with var-dumper available", @@ -9206,7 +11348,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.17.0" + "source": "https://github.com/filp/whoops/tree/2.18.6" }, "funding": [ { @@ -9214,24 +11356,26 @@ "type": "github" } ], - "time": "2025-01-25T12:00:00+00:00" + "time": "2026-10-03T17:03:57+00:00" }, { "name": "hamcrest/hamcrest-php", - "version": "v2.0.1", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" + "reference": "b61cd040da1a4925bc90a51c074f5297e7c0fa52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", - "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b61cd040da1a4925bc90a51c074f5297e7c0fa52", + "reference": "b61cd040da1a4925bc90a51c074f5297e7c0fa52", "shasum": "" }, "require": { - "php": "^5.3|^7.0|^8.0" + "ext-ctype": "*", + "ext-dom": "*", + "php": "^7.4|^8.0" }, "replace": { "cordoval/hamcrest-php": "*", @@ -9239,13 +11383,15 @@ "kodova/hamcrest-php": "*" }, "require-dev": { - "phpunit/php-file-iterator": "^1.4 || ^2.0", - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -9263,35 +11409,1596 @@ ], "support": { "issues": "https://github.com/hamcrest/hamcrest-php/issues", - "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" + "source": "https://github.com/hamcrest/hamcrest-php/tree/v3.0.0" }, - "time": "2020-07-09T08:09:16+00:00" + "time": "2026-03-17T11:56:53+00:00" }, { - "name": "mockery/mockery", - "version": "1.6.12", + "name": "iamcal/sql-parser", + "version": "v0.7", "source": { "type": "git", - "url": "https://github.com/mockery/mockery.git", - "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699" + "url": "https://github.com/iamcal/SQLParser.git", + "reference": "610392f38de49a44dab08dc1659960a29874c4b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/1f4efdd7d3beafe9807b08156dfcb176d18f1699", - "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699", + "url": "https://api.github.com/repos/iamcal/SQLParser/zipball/610392f38de49a44dab08dc1659960a29874c4b8", + "reference": "610392f38de49a44dab08dc1659960a29874c4b8", + "shasum": "" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^5|^6|^7|^8|^9" + }, + "type": "library", + "autoload": { + "psr-4": { + "iamcal\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Cal Henderson", + "email": "cal@iamcal.com" + } + ], + "description": "MySQL schema parser", + "support": { + "issues": "https://github.com/iamcal/SQLParser/issues", + "source": "https://github.com/iamcal/SQLParser/tree/v0.7" + }, + "time": "2026-01-28T22:20:33+00:00" + }, + { + "name": "larastan/larastan", + "version": "v3.13.0", + "source": { + "type": "git", + "url": "https://github.com/larastan/larastan.git", + "reference": "24ee69a7705ffc7c2cd8a3c96a5f498a4c2de5e3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/larastan/larastan/zipball/24ee69a7705ffc7c2cd8a3c96a5f498a4c2de5e3", + "reference": "24ee69a7705ffc7c2cd8a3c96a5f498a4c2de5e3", "shasum": "" }, "require": { - "hamcrest/hamcrest-php": "^2.0.1", - "lib-pcre": ">=7.0", + "iamcal/sql-parser": "^0.7.0", + "illuminate/console": "^11.44.2 || ^12.4.1 || ^13", + "illuminate/container": "^11.44.2 || ^12.4.1 || ^13", + "illuminate/contracts": "^11.44.2 || ^12.4.1 || ^13", + "illuminate/database": "^11.44.2 || ^12.4.1 || ^13", + "illuminate/http": "^11.44.2 || ^12.4.1 || ^13", + "illuminate/pipeline": "^11.44.2 || ^12.4.1 || ^13", + "illuminate/support": "^11.44.2 || ^12.4.1 || ^13", + "php": "^8.2", + "phpstan/phpstan": "^2.3.0" + }, + "require-dev": { + "doctrine/coding-standard": "^14", + "laravel/framework": "^11.44.2 || ^12.7.2 || ^13", + "mockery/mockery": "^1.6.12", + "nikic/php-parser": "^5.4", + "orchestra/canvas": "^v9.2.2 || ^10.0.1 || ^11", + "orchestra/testbench-core": "^9.12.0 || ^10.1 || ^11", + "phpstan/phpstan-deprecation-rules": "^2.0.1", + "phpunit/phpunit": "^10.5.35 || ^11.5.15 || ^12.5.8 || ^13.3.0" + }, + "suggest": { + "orchestra/testbench": "Using Larastan for analysing a package needs Testbench", + "phpmyadmin/sql-parser": "Install to enable Larastan's optional phpMyAdmin-based SQL parser automatically" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Larastan\\Larastan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Can Vural", + "email": "can9119@gmail.com" + } + ], + "description": "Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel", + "keywords": [ + "PHPStan", + "code analyse", + "code analysis", + "larastan", + "laravel", + "package", + "php", + "static analysis" + ], + "support": { + "issues": "https://github.com/larastan/larastan/issues", + "source": "https://github.com/larastan/larastan/tree/v3.13.0" + }, + "funding": [ + { + "url": "https://github.com/canvural", + "type": "github" + } + ], + "time": "2026-10-07T14:14:28+00:00" + }, + { + "name": "laravel-lang/actions", + "version": "1.13.2", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/actions.git", + "reference": "5e9bbd3b8af3fed4b733e424c56810b0d3e81377" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/actions/zipball/5e9bbd3b8af3fed4b733e424c56810b0d3e81377", + "reference": "5e9bbd3b8af3fed4b733e424c56810b0d3e81377", + "shasum": "" + }, + "require": { + "ext-json": "*", + "laravel-lang/publisher": "^14.0 || ^15.0 || ^16.0", + "php": "^8.1" + }, + "require-dev": { + "laravel-lang/status-generator": "^2.3.1", + "phpunit/phpunit": "^10.0 || ^11.0 || ^12.0", + "symfony/var-dumper": "^6.3 || ^7.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "LaravelLang\\Actions\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "LaravelLang\\Actions\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro", + "homepage": "https://dragon-code.pro" + }, + { + "name": "Laravel Lang Team", + "homepage": "https://laravel-lang.com" + } + ], + "description": "Translation of buttons and other action elements", + "keywords": [ + "actions", + "buttons", + "lang", + "languages", + "laravel", + "translations" + ], + "support": { + "issues": "https://github.com/Laravel-Lang/actions/issues", + "source": "https://github.com/Laravel-Lang/actions/tree/1.13.2" + }, + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2026-05-30T12:11:11+00:00" + }, + { + "name": "laravel-lang/attributes", + "version": "2.16.4", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/attributes.git", + "reference": "4a0de72632bb1862532977fd76ed6be9c1cc65af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/attributes/zipball/4a0de72632bb1862532977fd76ed6be9c1cc65af", + "reference": "4a0de72632bb1862532977fd76ed6be9c1cc65af", + "shasum": "" + }, + "require": { + "ext-json": "*", + "laravel-lang/publisher": "^14.0 || ^15.0 || ^16.0", + "php": "^8.1" + }, + "require-dev": { + "laravel-lang/status-generator": "^1.19 || ^2.0", + "phpunit/phpunit": "^10.0 || ^11.0 || ^12.0", + "symfony/var-dumper": "^6.0 || ^7.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "LaravelLang\\Attributes\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "LaravelLang\\Attributes\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro" + }, + { + "name": "Laravel-Lang Team", + "homepage": "https://github.com/Laravel-Lang" + } + ], + "description": "Translation of form element names", + "keywords": [ + "attributes", + "fields", + "form", + "lang", + "languages", + "laravel", + "messages", + "translations", + "validation" + ], + "support": { + "issues": "https://github.com/Laravel-Lang/attributes/issues", + "source": "https://github.com/Laravel-Lang/attributes/tree/2.16.4" + }, + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2026-05-30T12:11:05+00:00" + }, + { + "name": "laravel-lang/common", + "version": "6.8.0", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/common.git", + "reference": "f1e3383f94c4f157f0f41324792382bf2dd84d52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/common/zipball/f1e3383f94c4f157f0f41324792382bf2dd84d52", + "reference": "f1e3383f94c4f157f0f41324792382bf2dd84d52", + "shasum": "" + }, + "require": { + "laravel-lang/actions": "^1.9", + "laravel-lang/attributes": "^2.12", + "laravel-lang/http-statuses": "^3.8", + "laravel-lang/json-fallback": "^2.2", + "laravel-lang/lang": "^13.12 || ^14.0 || ^15.5.1", + "laravel-lang/locales": "^2.10", + "laravel-lang/models": "^1.3", + "laravel-lang/moonshine": "^1.2", + "laravel-lang/publisher": "^16.5", + "laravel-lang/routes": "^1.7", + "laravel-lang/starter-kits": "^1.0", + "php": "^8.1" + }, + "require-dev": { + "dragon-code/support": "^6.13", + "orchestra/testbench": "^8.17 || ^9.1.2 || ^10.0 || ^11.0", + "phpunit/phpunit": "^10.5.20 || ^11.0 || ^12.0", + "symfony/var-dumper": "^6.4 || ^7.1.1 || ^8.0" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laravel-Lang Team", + "homepage": "https://github.com/Laravel-Lang" + }, + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro", + "homepage": "https://dragon-code.pro" + } + ], + "description": "Easily connect the necessary language packs to the application", + "keywords": [ + "Laravel-lang", + "actions", + "attribute", + "attributes", + "breeze", + "buttons", + "cashier", + "fortify", + "framework", + "http", + "http-status", + "http-status-code", + "i18n", + "jetstream", + "lang", + "language", + "languages", + "laravel", + "locale", + "locales", + "localization", + "localizations", + "moonshine", + "nova", + "publisher", + "spark", + "translation", + "translations", + "ui" + ], + "support": { + "issues": "https://github.com/Laravel-Lang/common/issues", + "source": "https://github.com/Laravel-Lang/common" + }, + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2026-03-17T23:15:14+00:00" + }, + { + "name": "laravel-lang/config", + "version": "1.17.1", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/config.git", + "reference": "7970b89045998b73aab4ffd99a04c6f7f5b3f4f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/config/zipball/7970b89045998b73aab4ffd99a04c6f7f5b3f4f8", + "reference": "7970b89045998b73aab4ffd99a04c6f7f5b3f4f8", + "shasum": "" + }, + "require": { + "archtechx/enums": "^1.0", + "illuminate/config": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "illuminate/support": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "laravel-lang/locale-list": "^1.6", + "php": "^8.1" + }, + "require-dev": { + "orchestra/testbench": "^8.23 || ^9.1 || ^10.0 || ^11.0", + "pestphp/pest": "^2.34 || ^3.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "LaravelLang\\Config\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "LaravelLang\\Config\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro", + "homepage": "https://dragon-code.pro" + }, + { + "name": "Laravel-Lang Team", + "homepage": "https://laravel-lang.com" + } + ], + "description": "The Laravel-Lang config package", + "keywords": [ + "Laravel-lang", + "Settings", + "config", + "lang", + "languages", + "laravel", + "locale", + "locales", + "localization", + "localizations", + "translation", + "translations" + ], + "support": { + "issues": "https://github.com/Laravel-Lang/config/issues", + "source": "https://github.com/Laravel-Lang/config/tree/1.17.1" + }, + "time": "2026-09-20T09:41:38+00:00" + }, + { + "name": "laravel-lang/http-statuses", + "version": "3.13.2", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/http-statuses.git", + "reference": "2d33c7b4f5b268224c559c27c1220764b5391ae2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/http-statuses/zipball/2d33c7b4f5b268224c559c27c1220764b5391ae2", + "reference": "2d33c7b4f5b268224c559c27c1220764b5391ae2", + "shasum": "" + }, + "require": { + "ext-json": "*", + "laravel-lang/publisher": "^14.1 || ^15.0 || ^16.0", + "php": "^8.1" + }, + "require-dev": { + "laravel-lang/status-generator": "^1.19 || ^2.0", + "phpunit/phpunit": "^10.0 || ^11.0 || ^12.0", + "symfony/var-dumper": "^6.0 || ^7.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "LaravelLang\\HttpStatuses\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "LaravelLang\\HttpStatuses\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro" + }, + { + "name": "Laravel-Lang Team", + "homepage": "https://github.com/Laravel-Lang" + } + ], + "description": "Translation of HTTP statuses", + "keywords": [ + "http", + "lang", + "languages", + "laravel", + "messages", + "status", + "translations" + ], + "support": { + "issues": "https://github.com/Laravel-Lang/http-statuses/issues", + "source": "https://github.com/Laravel-Lang/http-statuses/tree/3.13.2" + }, + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2026-05-30T12:11:06+00:00" + }, + { + "name": "laravel-lang/json-fallback", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/json-fallback.git", + "reference": "1b02c798da837c63e2d01f45b45bb49367d5b6a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/json-fallback/zipball/1b02c798da837c63e2d01f45b45bb49367d5b6a1", + "reference": "1b02c798da837c63e2d01f45b45bb49367d5b6a1", + "shasum": "" + }, + "require": { + "illuminate/support": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "illuminate/translation": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "php": "^8.1" + }, + "require-dev": { + "orchestra/testbench": "^8.0 || ^9.0 || ^10.0 || ^11.0", + "phpunit/phpunit": "^10.0 || ^11.0 || ^12.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "LaravelLang\\JsonFallback\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro", + "homepage": "https://github.com/andrey-helldar" + }, + { + "name": "Felipe Dsdev", + "homepage": "https://github.com/felipe-dsdev" + } + ], + "description": "Adds support for fallback JSON string translation", + "support": { + "issues": "https://github.com/Laravel-Lang/json-fallback/issues", + "source": "https://github.com/Laravel-Lang/json-fallback/tree/2.3.0" + }, + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2026-03-17T21:18:08+00:00" + }, + { + "name": "laravel-lang/lang", + "version": "15.37.3", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/lang.git", + "reference": "a3504212776c77984273beb9b7ef9ecbacc2e4e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/lang/zipball/a3504212776c77984273beb9b7ef9ecbacc2e4e4", + "reference": "a3504212776c77984273beb9b7ef9ecbacc2e4e4", + "shasum": "" + }, + "require": { + "ext-json": "*", + "laravel-lang/publisher": "^16.0", + "php": "^8.2" + }, + "conflict": { + "laravel/framework": "<11.0.7" + }, + "require-dev": { + "dragon-code/codestyler": "^6.0", + "laravel-lang/status-generator": "^2.11", + "phpunit/phpunit": "^11.0 || ^12.0", + "symfony/var-dumper": "^7.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "LaravelLang\\Lang\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "LaravelLang\\Lang\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laravel-Lang Team", + "homepage": "https://github.com/Laravel-Lang" + } + ], + "description": "List of 126 languages for Laravel Framework, Laravel Jetstream, Laravel Fortify, Laravel Breeze, Laravel Cashier, Laravel Nova, Laravel Spark and Laravel UI", + "keywords": [ + "lang", + "languages", + "laravel", + "lpm" + ], + "support": { + "issues": "https://github.com/Laravel-Lang/lang/issues", + "source": "https://github.com/Laravel-Lang/lang" + }, + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2026-10-01T08:03:34+00:00" + }, + { + "name": "laravel-lang/locale-list", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/locale-list.git", + "reference": "48e61c7f0a957420d4aaf5d35653889c25c4e2d4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/locale-list/zipball/48e61c7f0a957420d4aaf5d35653889c25c4e2d4", + "reference": "48e61c7f0a957420d4aaf5d35653889c25c4e2d4", + "shasum": "" + }, + "require": { + "archtechx/enums": "^0.3.2 || ^1.0", + "php": "^8.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "LaravelLang\\LocaleList\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro", + "homepage": "https://dragon-code.pro" + }, + { + "name": "Laravel-Lang Team", + "homepage": "https://laravel-lang.com" + } + ], + "description": "List of localizations available in Laravel Lang projects", + "keywords": [ + "Laravel-lang", + "lang", + "languages", + "laravel", + "locale", + "locales", + "localization", + "translation", + "translations" + ], + "support": { + "issues": "https://github.com/Laravel-Lang/locale-list/issues", + "source": "https://github.com/Laravel-Lang/locale-list" + }, + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2026-01-20T08:17:15+00:00" + }, + { + "name": "laravel-lang/locales", + "version": "2.11.0", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/locales.git", + "reference": "761aa3cfbc5bbe29eb958c9839e7dd3806193bac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/locales/zipball/761aa3cfbc5bbe29eb958c9839e7dd3806193bac", + "reference": "761aa3cfbc5bbe29eb958c9839e7dd3806193bac", + "shasum": "" + }, + "require": { + "archtechx/enums": "^0.3.2 || ^1.0", + "dragon-code/support": "^6.11.3", + "ext-json": "*", + "illuminate/collections": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "laravel-lang/config": "^1.12", + "laravel-lang/locale-list": "^1.5", + "laravel-lang/native-country-names": "^1.5", + "laravel-lang/native-currency-names": "^1.6", + "laravel-lang/native-locale-names": "^2.5", + "php": "^8.1" + }, + "require-dev": { + "orchestra/testbench": "^8.0 || ^9.0 || ^10.0 || ^11.0", + "pestphp/pest": "^2.24.1 || ^3.0 || ^4.0", + "symfony/var-dumper": "^6.0 || ^7.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "LaravelLang\\Locales\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "LaravelLang\\Locales\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro" + }, + { + "name": "Laravel-Lang Team", + "homepage": "https://laravel-lang.com" + } + ], + "description": "Basic functionality for working with localizations", + "keywords": [ + "laravel", + "locale", + "locales", + "localization", + "translation", + "translations" + ], + "support": { + "issues": "https://github.com/Laravel-Lang/locales/issues", + "source": "https://github.com/Laravel-Lang/locales" + }, + "time": "2026-03-17T22:40:41+00:00" + }, + { + "name": "laravel-lang/models", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/models.git", + "reference": "a9aa0205ca019f4459ace26b0432b3b6d1886f66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/models/zipball/a9aa0205ca019f4459ace26b0432b3b6d1886f66", + "reference": "a9aa0205ca019f4459ace26b0432b3b6d1886f66", + "shasum": "" + }, + "require": { + "composer/class-map-generator": "^1.3", + "dragon-code/support": "^6.13", + "illuminate/database": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "illuminate/support": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "laravel-lang/config": "^1.12", + "laravel-lang/locales": "^2.10.0", + "laravel/prompts": ">=0.1", + "php": "^8.1" + }, + "require-dev": { + "laravel/pint": "^1.20", + "orchestra/testbench": "^8.0 || ^9.0 || ^10.0 || ^11.0", + "pestphp/pest": "^2.34 || ^3.0 || ^4.0", + "pestphp/pest-plugin-laravel": "^2.4 || ^3.0 || ^4.0", + "symfony/var-dumper": "^6.0 || ^7.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "LaravelLang\\Models\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "LaravelLang\\Models\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro", + "homepage": "https://dragon-code.pro", + "role": "Maintainer" + }, + { + "name": "Andrey Sokolov", + "email": "walfireru@gmail.com", + "homepage": "https://github.com/Quiss", + "role": "Usability consultant" + }, + { + "name": "Laravel-Lang Team", + "homepage": "https://github.com/Laravel-Lang" + } + ], + "description": "Easy and fast way to localize models", + "keywords": [ + "database", + "l18n", + "languages", + "laravel", + "locales", + "localization", + "models", + "translate", + "translations" + ], + "support": { + "issues": "https://github.com/Laravel-Lang/models/issues", + "source": "https://github.com/Laravel-Lang/models" + }, + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2026-03-17T23:00:20+00:00" + }, + { + "name": "laravel-lang/moonshine", + "version": "1.9.2", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/moonshine.git", + "reference": "3927bcf658d392c9f2eb03c773f52ff650b37f63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/moonshine/zipball/3927bcf658d392c9f2eb03c773f52ff650b37f63", + "reference": "3927bcf658d392c9f2eb03c773f52ff650b37f63", + "shasum": "" + }, + "require": { + "ext-json": "*", + "laravel-lang/publisher": "^15.0 || ^16.4.1", + "php": "^8.1" + }, + "require-dev": { + "dragon-code/support": "^6.15.2", + "illuminate/support": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "laravel-lang/lang": "^14.8 || ^15.14", + "laravel-lang/status-generator": "^2.12", + "phpunit/phpunit": "^10.0 || ^11.0 || ^12.0", + "symfony/var-dumper": "^6.3 || ^7.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "LaravelLang\\MoonShine\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "LaravelLang\\MoonShine\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro" + }, + { + "name": "Laravel Lang Team", + "homepage": "https://laravel-lang.com" + } + ], + "description": "Translation for MoonShine admin panel", + "keywords": [ + "lang", + "languages", + "laravel", + "moonshine", + "translations" + ], + "support": { + "issues": "https://github.com/Laravel-Lang/moonshine/issues", + "source": "https://github.com/Laravel-Lang/moonshine/tree/1.9.2" + }, + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2026-05-30T12:11:41+00:00" + }, + { + "name": "laravel-lang/native-country-names", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/native-country-names.git", + "reference": "1d293138e34eb9e914bc4568cdebac2cb0a2eb0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/native-country-names/zipball/1d293138e34eb9e914bc4568cdebac2cb0a2eb0e", + "reference": "1d293138e34eb9e914bc4568cdebac2cb0a2eb0e", + "shasum": "" + }, + "require": { + "dragon-code/support": "^6.11", + "ext-json": "*", + "illuminate/collections": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "php": "^8.1" + }, + "require-dev": { + "illuminate/support": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "laravel-lang/locale-list": "^1.5", + "pestphp/pest": "^2.0 || ^3.0 || ^4.0", + "punic/punic": "^3.8", + "symfony/console": "^6.0 || ^7.0 || ^8.0", + "symfony/process": "^6.0 || ^7.0 || ^8.0", + "symfony/var-dumper": "^6.0 || ^7.0 || ^8.0", + "vlucas/phpdotenv": "^5.6" + }, + "type": "library", + "autoload": { + "psr-4": { + "LaravelLang\\NativeCountryNames\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro" + }, + { + "name": "Laravel-Lang Team", + "homepage": "https://laravel-lang.com" + } + ], + "description": "The project contains native translations of country names", + "keywords": [ + "Laravel-lang", + "countries", + "country", + "lang", + "languages", + "laravel", + "locale", + "locales", + "localization", + "territories", + "territory", + "translation", + "translations" + ], + "support": { + "issues": "https://github.com/Laravel-Lang/native-country-names/issues", + "source": "https://github.com/Laravel-Lang/native-country-names" + }, + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2026-03-17T22:01:15+00:00" + }, + { + "name": "laravel-lang/native-currency-names", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/native-currency-names.git", + "reference": "7ebe95a9942bebf6afd61986fa18c82dade3d583" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/native-currency-names/zipball/7ebe95a9942bebf6afd61986fa18c82dade3d583", + "reference": "7ebe95a9942bebf6afd61986fa18c82dade3d583", + "shasum": "" + }, + "require": { + "dragon-code/support": "^6.11", + "ext-json": "*", + "illuminate/collections": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "php": "^8.1" + }, + "require-dev": { + "illuminate/support": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "laravel-lang/locale-list": "^1.2", + "pestphp/pest": "^2.0 || ^3.0 || ^4.0", + "punic/punic": "^3.8", + "symfony/console": "^6.0 || ^7.0", + "symfony/process": "^6.0 || ^7.0", + "symfony/var-dumper": "^6.0 || ^7.0", + "vlucas/phpdotenv": "^5.6" + }, + "type": "library", + "autoload": { + "psr-4": { + "LaravelLang\\NativeCurrencyNames\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro" + }, + { + "name": "Laravel-Lang Team", + "homepage": "https://laravel-lang.com" + } + ], + "description": "The project contains native translations of currency names", + "keywords": [ + "Laravel-lang", + "currency", + "lang", + "languages", + "laravel", + "locale", + "locales", + "localization", + "translation", + "translations" + ], + "support": { + "issues": "https://github.com/Laravel-Lang/native-currency-names/issues", + "source": "https://github.com/Laravel-Lang/native-currency-names" + }, + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2026-06-20T16:50:37+00:00" + }, + { + "name": "laravel-lang/native-locale-names", + "version": "2.9.0", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/native-locale-names.git", + "reference": "e5925182bad34654203a5d93544357ca00a6d9c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/native-locale-names/zipball/e5925182bad34654203a5d93544357ca00a6d9c0", + "reference": "e5925182bad34654203a5d93544357ca00a6d9c0", + "shasum": "" + }, + "require": { + "dragon-code/support": "^6.11", + "ext-json": "*", + "php": "^8.1" + }, + "require-dev": { + "illuminate/support": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "laravel-lang/locale-list": "^1.2", + "pestphp/pest": "^2.24.3 || ^3.0 || ^4.0", + "punic/punic": "^3.8", + "symfony/console": "^6.0 || ^7.0", + "symfony/process": "^6.0 || ^7.0", + "symfony/var-dumper": "^6.0 || ^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "LaravelLang\\NativeLocaleNames\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro" + }, + { + "name": "Laravel-Lang Team", + "homepage": "https://laravel-lang.com" + } + ], + "description": "The project contains native translations of locale names", + "keywords": [ + "Laravel-lang", + "lang", + "languages", + "laravel", + "locale", + "locales", + "localization", + "translation", + "translations" + ], + "support": { + "issues": "https://github.com/Laravel-Lang/native-locale-names/issues", + "source": "https://github.com/Laravel-Lang/native-locale-names" + }, + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2026-06-20T16:52:11+00:00" + }, + { + "name": "laravel-lang/publisher", + "version": "16.8.0", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/publisher.git", + "reference": "e5d3383f5385c2102f8a0d3dbe488ed86cd0250f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/publisher/zipball/e5d3383f5385c2102f8a0d3dbe488ed86cd0250f", + "reference": "e5d3383f5385c2102f8a0d3dbe488ed86cd0250f", + "shasum": "" + }, + "require": { + "composer/semver": "^3.4", + "dragon-code/pretty-array": "^4.1", + "dragon-code/support": "^6.11.3", + "ext-json": "*", + "illuminate/collections": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "illuminate/console": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "illuminate/support": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "laravel-lang/config": "^1.12", + "laravel-lang/locales": "^2.10", + "league/commonmark": "^2.4.1", + "league/config": "^1.2", + "php": "^8.1" + }, + "conflict": { + "laravel-lang/attributes": "<2.0", + "laravel-lang/http-statuses": "<3.0", + "laravel-lang/lang": "<11.0" + }, + "require-dev": { + "laravel-lang/json-fallback": "^2.2", + "orchestra/testbench": "^8.14 || ^9.0 || ^10.0 || ^11.0", + "phpunit/phpunit": "^10.4.2 || ^11.0 || ^12.0", + "symfony/var-dumper": "^6.3.6 || ^7.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "LaravelLang\\Publisher\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "LaravelLang\\Publisher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro" + }, + { + "name": "Laravel-Lang Team", + "homepage": "https://laravel-lang.com" + } + ], + "description": "Localization publisher for your Laravel application", + "keywords": [ + "Laravel-lang", + "breeze", + "cashier", + "fortify", + "framework", + "i18n", + "jetstream", + "lang", + "languages", + "laravel", + "locale", + "locales", + "localization", + "localizations", + "lpm", + "lumen", + "nova", + "publisher", + "spark", + "trans", + "translation", + "translations", + "validations" + ], + "support": { + "issues": "https://github.com/Laravel-Lang/publisher/issues", + "source": "https://github.com/Laravel-Lang/publisher" + }, + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2026-03-17T22:56:20+00:00" + }, + { + "name": "laravel-lang/routes", + "version": "1.11.0", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/routes.git", + "reference": "29d7f83f2679f51187aa4e761d73bb4e0d133bf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/routes/zipball/29d7f83f2679f51187aa4e761d73bb4e0d133bf4", + "reference": "29d7f83f2679f51187aa4e761d73bb4e0d133bf4", + "shasum": "" + }, + "require": { + "codezero/browser-locale": "^3.4", + "dragon-code/support": "^6.13", + "illuminate/config": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "illuminate/http": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "illuminate/routing": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "illuminate/support": "^10.0 || ^11.0 || ^12.0 || ^13.0", + "laravel-lang/config": "^1.13", + "laravel-lang/locales": "^2.10", + "php": "^8.1" + }, + "require-dev": { + "orchestra/testbench": "^8.23 || ^9.1 || ^10.0 || ^11.0", + "pestphp/pest": "^2.34 || ^3.0 || ^4.0", + "pestphp/pest-plugin-laravel": "^2.4 || ^3.0 || ^4.0", + "symfony/var-dumper": "^6.0 || ^7.0 || ^8.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "LaravelLang\\Routes\\ServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "helpers/functions.php" + ], + "psr-4": { + "LaravelLang\\Routes\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro", + "homepage": "https://dragon-code.pro" + }, + { + "name": "Laravel-Lang Team", + "homepage": "https://github.com/Laravel-Lang" + } + ], + "description": "Easy and fast way to localize routes", + "keywords": [ + "l18n", + "languages", + "laravel", + "localization", + "routes", + "translate", + "translations" + ], + "support": { + "issues": "https://github.com/Laravel-Lang/routes/issues", + "source": "https://github.com/Laravel-Lang/routes" + }, + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2026-03-17T23:06:16+00:00" + }, + { + "name": "laravel-lang/starter-kits", + "version": "1.16.1", + "source": { + "type": "git", + "url": "https://github.com/Laravel-Lang/starter-kits.git", + "reference": "87c00c77bbb73385d0526b35dbe07ea2bbfc32db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Laravel-Lang/starter-kits/zipball/87c00c77bbb73385d0526b35dbe07ea2bbfc32db", + "reference": "87c00c77bbb73385d0526b35dbe07ea2bbfc32db", + "shasum": "" + }, + "require": { + "ext-json": "*", + "laravel-lang/publisher": "^16.6", + "php": "^8.1" + }, + "require-dev": { + "laravel-lang/status-generator": "^2.13", + "phpunit/phpunit": "^11.0 || ^12.0", + "symfony/var-dumper": "^7.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "LaravelLang\\StarterKits\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "LaravelLang\\StarterKits\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Helldar", + "email": "helldar@dragon-code.pro" + }, + { + "name": "Laravel Lang Team", + "homepage": "https://laravel-lang.com" + } + ], + "description": "Translations for Laravel Starter Kits", + "keywords": [ + "i18n", + "lang", + "languages", + "laravel", + "starter-kit", + "starter-kits", + "translations" + ], + "support": { + "issues": "https://github.com/Laravel-Lang/starter-kits/issues", + "source": "https://github.com/Laravel-Lang/starter-kits/tree/1.16.1" + }, + "funding": [ + { + "url": "https://boosty.to/dragon-code", + "type": "boosty" + }, + { + "url": "https://yoomoney.ru/to/410012608840929", + "type": "yoomoney" + } + ], + "time": "2026-07-16T18:13:26+00:00" + }, + { + "name": "laravel/pint", + "version": "v1.32.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/pint.git", + "reference": "006bd7825eb01daf92959d060b89cd9514fe4253" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pint/zipball/006bd7825eb01daf92959d060b89cd9514fe4253", + "reference": "006bd7825eb01daf92959d060b89cd9514fe4253", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "php": "^8.3.0" + }, + "require-dev": { + "composer/semver": "^3.4.4", + "friendsofphp/php-cs-fixer": "^3.95.25", + "illuminate/view": "^13.31.0", + "larastan/larastan": "^3.11.0", + "laravel-zero/framework": "^13.0.0", + "laravel/agent-detector": "^2.0.2", + "laravel/prompts": "^0.3.24", + "mockery/mockery": "^1.6.15", + "nunomaduro/termwind": "^2.4.0", + "pestphp/pest": "^4.7.8" + }, + "bin": [ + "builds/pint" + ], + "type": "project", + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Seeders\\": "database/seeders/", + "Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "An opinionated code formatter for PHP.", + "homepage": "https://laravel.com", + "keywords": [ + "dev", + "format", + "formatter", + "lint", + "linter", + "php" + ], + "support": { + "issues": "https://github.com/laravel/pint/issues", + "source": "https://github.com/laravel/pint" + }, + "time": "2026-09-10T10:47:55+00:00" + }, + { + "name": "mockery/mockery", + "version": "1.6.15", + "source": { + "type": "git", + "url": "https://github.com/mockery/mockery.git", + "reference": "967a801bd188989a5669bd280f252d51c0fdc9ee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mockery/mockery/zipball/967a801bd188989a5669bd280f252d51c0fdc9ee", + "reference": "967a801bd188989a5669bd280f252d51c0fdc9ee", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "^2.0 || ^3.0", "php": ">=7.3" }, "conflict": { "phpunit/phpunit": "<8.0" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.6.17", - "symplify/easy-coding-standard": "^12.1.14" + "phpunit/phpunit": "^9.6.36", + "symplify/easy-coding-standard": "^13.2.17" }, "type": "library", "autoload": { @@ -9348,24 +13055,24 @@ "security": "https://github.com/mockery/mockery/security/advisories", "source": "https://github.com/mockery/mockery" }, - "time": "2024-05-16T03:13:13+00:00" + "time": "2026-08-19T19:37:52+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.13.0", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414" + "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae", + "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.0" }, "conflict": { "doctrine/collections": "<1.6.8", @@ -9400,46 +13107,48 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.14.0" }, "funding": [ { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" + "url": "https://github.com/mnapoli", + "type": "github" } ], - "time": "2025-02-12T12:17:51+00:00" + "time": "2026-08-11T10:17:44+00:00" }, { "name": "nunomaduro/collision", - "version": "v5.11.0", + "version": "v8.9.5", "source": { "type": "git", "url": "https://github.com/nunomaduro/collision.git", - "reference": "8b610eef8582ccdc05d8f2ab23305e2d37049461" + "reference": "fb53eacd509a1d303858e2d20cfebf2d630254ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/8b610eef8582ccdc05d8f2ab23305e2d37049461", - "reference": "8b610eef8582ccdc05d8f2ab23305e2d37049461", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/fb53eacd509a1d303858e2d20cfebf2d630254ec", + "reference": "fb53eacd509a1d303858e2d20cfebf2d630254ec", "shasum": "" }, "require": { - "facade/ignition-contracts": "^1.0", - "filp/whoops": "^2.14.3", - "php": "^7.3 || ^8.0", - "symfony/console": "^5.0" + "filp/whoops": "^2.18.4", + "nunomaduro/termwind": "^2.4.0", + "php": "^8.2.0", + "symfony/console": "^7.4.14 || ^8.1.1" + }, + "conflict": { + "laravel/framework": "<11.48.0 || >=14.0.0", + "phpunit/phpunit": "<11.5.50 || >=14.0.0" }, "require-dev": { - "brianium/paratest": "^6.1", - "fideloper/proxy": "^4.4.1", - "fruitcake/laravel-cors": "^2.0.3", - "laravel/framework": "8.x-dev", - "nunomaduro/larastan": "^0.6.2", - "nunomaduro/mock-final-classes": "^1.0", - "orchestra/testbench": "^6.0", - "phpstan/phpstan": "^0.12.64", - "phpunit/phpunit": "^9.5.0" + "brianium/paratest": "^7.8.5", + "larastan/larastan": "^3.10.0", + "laravel/framework": "^11.48.0 || ^12.56.0 || ^13.20.0", + "laravel/pint": "^1.29.3", + "orchestra/testbench-core": "^9.12.0 || ^10.12.1 || ^11.3.5", + "pestphp/pest": "^3.8.5 || ^4.7.5 || ^5.0.0", + "sebastian/environment": "^7.2.1 || ^8.1.2 || ^9.3.2" }, "type": "library", "extra": { @@ -9447,9 +13156,15 @@ "providers": [ "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" ] + }, + "branch-alias": { + "dev-8.x": "8.x-dev" } }, "autoload": { + "files": [ + "./src/Adapters/Phpunit/Autoload.php" + ], "psr-4": { "NunoMaduro\\Collision\\": "src/" } @@ -9470,6 +13185,7 @@ "cli", "command-line", "console", + "dev", "error", "handling", "laravel", @@ -9495,7 +13211,757 @@ "type": "patreon" } ], - "time": "2022-01-10T16:22:52+00:00" + "time": "2026-07-15T19:09:14+00:00" + }, + { + "name": "nunomaduro/mock-final-classes", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/mock-final-classes.git", + "reference": "b13fc71acd9d6f1e2de8209217103cbd2035871f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/mock-final-classes/zipball/b13fc71acd9d6f1e2de8209217103cbd2035871f", + "reference": "b13fc71acd9d6f1e2de8209217103cbd2035871f", + "shasum": "" + }, + "require": { + "dg/bypass-finals": "^1.1", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "localheinz/phpstan-rules": "^0.10.0", + "phpstan/phpstan": "^0.11.8", + "phpstan/phpstan-strict-rules": "^0.11.1", + "phpunit/phpunit": "^7.0|^8.0|^9.3", + "thecodingmachine/phpstan-strict-rules": "^0.11.1" + }, + "type": "library", + "autoload": { + "files": [ + "autoload.php" + ], + "psr-4": { + "NunoMaduro\\MockFinalClasses\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Allows mocking of final methods and classes in PHP.", + "keywords": [ + "class", + "classes", + "final", + "mock", + "php", + "phpunit" + ], + "support": { + "issues": "https://github.com/nunomaduro/mock-final-classes/issues", + "source": "https://github.com/nunomaduro/mock-final-classes/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2023-05-14T23:33:16+00:00" + }, + { + "name": "nunomaduro/pokio", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/pokio.git", + "reference": "fc7884ebc5b0fabd6e267c0b4e6f750ba69cee5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/pokio/zipball/fc7884ebc5b0fabd6e267c0b4e6f750ba69cee5b", + "reference": "fc7884ebc5b0fabd6e267c0b4e6f750ba69cee5b", + "shasum": "" + }, + "require": { + "php": "^8.3.0" + }, + "conflict": { + "symplify/easy-parallel": "<11.2.2" + }, + "require-dev": { + "laravel/pint": "^1.29.0", + "peckphp/peck": "^0.1.3", + "pestphp/pest": "^4.5.0", + "pestphp/pest-plugin-type-coverage": "^4.0.3", + "phpstan/phpstan": "^2.1.46", + "symfony/var-dumper": "^7.4.8 || ^8.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.1.x-dev" + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Pokio\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Pokio is a dead simple asynchronous API for PHP that just works", + "keywords": [ + "asynchronous", + "library", + "php", + "pokio" + ], + "support": { + "issues": "https://github.com/nunomaduro/pokio/issues", + "source": "https://github.com/nunomaduro/pokio/tree/v1.0.1" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2026-04-12T12:06:31+00:00" + }, + { + "name": "pestphp/pest", + "version": "v4.7.8", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest.git", + "reference": "5b2293f67adcf1b2320b33f521b94a692d18f360" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest/zipball/5b2293f67adcf1b2320b33f521b94a692d18f360", + "reference": "5b2293f67adcf1b2320b33f521b94a692d18f360", + "shasum": "" + }, + "require": { + "brianium/paratest": "^7.20.0", + "composer/xdebug-handler": "^3.0.5", + "nunomaduro/collision": "^8.9.5", + "nunomaduro/termwind": "^2.4.0", + "pestphp/pest-plugin": "^4.0.0", + "pestphp/pest-plugin-arch": "^4.0.2", + "pestphp/pest-plugin-mutate": "^4.0.1", + "pestphp/pest-plugin-profanity": "^4.2.1", + "php": "^8.3.0", + "phpunit/phpunit": "^12.5.33", + "symfony/process": "^7.4.13|^8.1.0" + }, + "conflict": { + "filp/whoops": "<2.18.3", + "phpunit/phpunit": ">12.5.33", + "sebastian/exporter": "<7.0.0", + "webmozart/assert": "<1.11.0" + }, + "require-dev": { + "mrpunyapal/peststan": "^0.2.12", + "pestphp/pest-dev-tools": "^4.1.0", + "pestphp/pest-plugin-browser": "^4.3.1", + "pestphp/pest-plugin-type-coverage": "^4.0.4", + "psy/psysh": "^0.12.24" + }, + "bin": [ + "bin/pest" + ], + "type": "library", + "extra": { + "pest": { + "plugins": [ + "Pest\\Mutate\\Plugins\\Mutate", + "Pest\\Plugins\\Configuration", + "Pest\\Plugins\\Bail", + "Pest\\Plugins\\Cache", + "Pest\\Plugins\\Coverage", + "Pest\\Plugins\\Init", + "Pest\\Plugins\\Environment", + "Pest\\Plugins\\Help", + "Pest\\Plugins\\Memory", + "Pest\\Plugins\\Only", + "Pest\\Plugins\\Printer", + "Pest\\Plugins\\ProcessIsolation", + "Pest\\Plugins\\Profile", + "Pest\\Plugins\\Retry", + "Pest\\Plugins\\Snapshot", + "Pest\\Plugins\\Verbose", + "Pest\\Plugins\\Version", + "Pest\\Plugins\\Shard", + "Pest\\Plugins\\Parallel" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "files": [ + "src/Functions.php", + "src/Pest.php" + ], + "psr-4": { + "Pest\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "The elegant PHP Testing Framework.", + "keywords": [ + "framework", + "pest", + "php", + "test", + "testing", + "unit" + ], + "support": { + "issues": "https://github.com/pestphp/pest/issues", + "source": "https://github.com/pestphp/pest/tree/v4.7.8" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2026-08-03T20:49:44+00:00" + }, + { + "name": "pestphp/pest-plugin", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin.git", + "reference": "9d4b93d7f73d3f9c3189bb22c220fef271cdf568" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin/zipball/9d4b93d7f73d3f9c3189bb22c220fef271cdf568", + "reference": "9d4b93d7f73d3f9c3189bb22c220fef271cdf568", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0.0", + "composer-runtime-api": "^2.2.2", + "php": "^8.3" + }, + "conflict": { + "pestphp/pest": "<4.0.0" + }, + "require-dev": { + "composer/composer": "^2.8.10", + "pestphp/pest": "^4.0.0", + "pestphp/pest-dev-tools": "^4.0.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Pest\\Plugin\\Manager" + }, + "autoload": { + "psr-4": { + "Pest\\Plugin\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Pest plugin manager", + "keywords": [ + "framework", + "manager", + "pest", + "php", + "plugin", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin/tree/v4.0.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2025-08-20T12:35:58+00:00" + }, + { + "name": "pestphp/pest-plugin-arch", + "version": "v4.0.2", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-arch.git", + "reference": "3fb0d02a91b9da504b139dc7ab2a31efb7c3215c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-arch/zipball/3fb0d02a91b9da504b139dc7ab2a31efb7c3215c", + "reference": "3fb0d02a91b9da504b139dc7ab2a31efb7c3215c", + "shasum": "" + }, + "require": { + "pestphp/pest-plugin": "^4.0.0", + "php": "^8.3", + "ta-tikoma/phpunit-architecture-test": "^0.8.7" + }, + "require-dev": { + "pestphp/pest": "^4.4.6", + "pestphp/pest-dev-tools": "^4.1.0" + }, + "type": "library", + "extra": { + "pest": { + "plugins": [ + "Pest\\Arch\\Plugin" + ] + } + }, + "autoload": { + "files": [ + "src/Autoload.php" + ], + "psr-4": { + "Pest\\Arch\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Arch plugin for Pest PHP.", + "keywords": [ + "arch", + "architecture", + "framework", + "pest", + "php", + "plugin", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin-arch/tree/v4.0.2" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2026-04-10T17:20:19+00:00" + }, + { + "name": "pestphp/pest-plugin-faker", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-faker.git", + "reference": "afb07eeca115cc19a2f5e20a4ec113ee6e26d4ec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-faker/zipball/afb07eeca115cc19a2f5e20a4ec113ee6e26d4ec", + "reference": "afb07eeca115cc19a2f5e20a4ec113ee6e26d4ec", + "shasum": "" + }, + "require": { + "fakerphp/faker": "^1.24.1", + "pestphp/pest": "^4.0.0", + "php": "^8.3.0" + }, + "require-dev": { + "pestphp/pest-dev-tools": "^4.0.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/Faker.php" + ], + "psr-4": { + "Pest\\Faker\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Pest Faker Plugin", + "keywords": [ + "faker", + "framework", + "pest", + "php", + "plugin", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin-faker/tree/v4.0.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2025-08-20T10:22:28+00:00" + }, + { + "name": "pestphp/pest-plugin-laravel", + "version": "v4.1.0", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-laravel.git", + "reference": "3057a36669ff11416cc0dc2b521b3aec58c488d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-laravel/zipball/3057a36669ff11416cc0dc2b521b3aec58c488d0", + "reference": "3057a36669ff11416cc0dc2b521b3aec58c488d0", + "shasum": "" + }, + "require": { + "laravel/framework": "^11.45.2|^12.52.0|^13.0", + "pestphp/pest": "^4.4.1", + "php": "^8.3.0" + }, + "require-dev": { + "laravel/dusk": "^8.3.6", + "orchestra/testbench": "^9.13.0|^10.9.0|^11.0", + "pestphp/pest-dev-tools": "^4.1.0" + }, + "type": "library", + "extra": { + "pest": { + "plugins": [ + "Pest\\Laravel\\Plugin" + ] + }, + "laravel": { + "providers": [ + "Pest\\Laravel\\PestServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "src/Autoload.php" + ], + "psr-4": { + "Pest\\Laravel\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Pest Laravel Plugin", + "keywords": [ + "framework", + "laravel", + "pest", + "php", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin-laravel/tree/v4.1.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2026-02-21T00:29:45+00:00" + }, + { + "name": "pestphp/pest-plugin-mutate", + "version": "v4.0.1", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-mutate.git", + "reference": "d9b32b60b2385e1688a68cc227594738ec26d96c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-mutate/zipball/d9b32b60b2385e1688a68cc227594738ec26d96c", + "reference": "d9b32b60b2385e1688a68cc227594738ec26d96c", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.6.1", + "pestphp/pest-plugin": "^4.0.0", + "php": "^8.3", + "psr/simple-cache": "^3.0.0" + }, + "require-dev": { + "pestphp/pest": "^4.0.0", + "pestphp/pest-dev-tools": "^4.0.0", + "pestphp/pest-plugin-type-coverage": "^4.0.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Pest\\Mutate\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + }, + { + "name": "Sandro Gehri", + "email": "sandrogehri@gmail.com" + } + ], + "description": "Mutates your code to find untested cases", + "keywords": [ + "framework", + "mutate", + "mutation", + "pest", + "php", + "plugin", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin-mutate/tree/v4.0.1" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/gehrisandro", + "type": "github" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2025-08-21T20:19:25+00:00" + }, + { + "name": "pestphp/pest-plugin-profanity", + "version": "v4.2.1", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-profanity.git", + "reference": "343cfa6f3564b7e35df0ebb77b7fa97039f72b27" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-profanity/zipball/343cfa6f3564b7e35df0ebb77b7fa97039f72b27", + "reference": "343cfa6f3564b7e35df0ebb77b7fa97039f72b27", + "shasum": "" + }, + "require": { + "pestphp/pest-plugin": "^4.0.0", + "php": "^8.3" + }, + "require-dev": { + "faissaloux/pest-plugin-inside": "^1.9", + "pestphp/pest": "^4.0.0", + "pestphp/pest-dev-tools": "^4.0.0" + }, + "type": "library", + "extra": { + "pest": { + "plugins": [ + "Pest\\Profanity\\Plugin" + ] + } + }, + "autoload": { + "psr-4": { + "Pest\\Profanity\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Pest Profanity Plugin", + "keywords": [ + "framework", + "pest", + "php", + "plugin", + "profanity", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin-profanity/tree/v4.2.1" + }, + "time": "2025-12-08T00:13:17+00:00" + }, + { + "name": "pestphp/pest-plugin-type-coverage", + "version": "v4.0.4", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-type-coverage.git", + "reference": "f485d40ec4e2081f9d3456c00f2c008f145d7896" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-type-coverage/zipball/f485d40ec4e2081f9d3456c00f2c008f145d7896", + "reference": "f485d40ec4e2081f9d3456c00f2c008f145d7896", + "shasum": "" + }, + "require": { + "nunomaduro/pokio": "^1.0.0", + "pestphp/pest-plugin": "^4.0.0", + "php": "^8.3", + "phpstan/phpstan": "^1.12.24|^2.1.46", + "tomasvotruba/type-coverage": "^1.0.0|^2.1.0" + }, + "require-dev": { + "pestphp/pest": "^4.4.5", + "pestphp/pest-dev-tools": "^4.1.0" + }, + "type": "library", + "extra": { + "pest": { + "plugins": [ + "Pest\\TypeCoverage\\Plugin" + ] + } + }, + "autoload": { + "psr-4": { + "Pest\\TypeCoverage\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Type Coverage plugin for Pest PHP.", + "keywords": [ + "coverage", + "framework", + "pest", + "php", + "plugin", + "test", + "testing", + "type-coverage", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin-type-coverage/tree/v4.0.4" + }, + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2026-04-06T14:00:30+00:00" }, { "name": "phar-io/manifest", @@ -9616,31 +14082,273 @@ "time": "2022-02-21T01:04:05+00:00" }, { - "name": "phpstan/phpdoc-parser", - "version": "1.33.0", + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.4.0", "source": { "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6db563514f27e19595a19f45a4bf757b6401194e", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "ext-json": "*", + "php": ">=5.3.0" + }, + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" + }, + "require-dev": { + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", + "squizlabs/php_codesniffer": "^3.6" + }, + "suggest": { + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" + } + ], + "description": "This tool checks the syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "keywords": [ + "lint", + "static analysis" + ], + "support": { + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.4.0" + }, + "time": "2024-03-27T12:14:49+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "ee15a5a2022c8383906b225055e9496a6a5e6e3b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/ee15a5a2022c8383906b225055e9496a6a5e6e3b", + "reference": "ee15a5a2022c8383906b225055e9496a6a5e6e3b", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.8", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^4.25" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "https://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.2.1" + }, + "time": "2025-11-10T21:21:55+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "6.0.3", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "7bae67520aa9f5ecc506d646810bd40d9da54582" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/7bae67520aa9f5ecc506d646810bd40d9da54582", + "reference": "7bae67520aa9f5ecc506d646810bd40d9da54582", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^1.1", + "ext-filter": "*", + "php": "^7.4 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^2.0", + "phpstan/phpdoc-parser": "^2.0", + "webmozart/assert": "^1.9.1 || ^2" + }, + "require-dev": { + "mockery/mockery": "~1.3.5 || ~1.6.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-webmozart-assert": "^1.2", + "phpunit/phpunit": "^9.5", + "psalm/phar": "^5.26", + "shipmonk/dead-code-detector": "^0.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/6.0.3" + }, + "time": "2026-03-18T20:49:53+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "dbe2133bb23e2e33a6834f4ed417f24a1b167769" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/dbe2133bb23e2e33a6834f4ed417f24a1b167769", + "reference": "dbe2133bb23e2e33a6834f4ed417f24a1b167769", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^1.0", + "php": "^7.4 || ^8.0", + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "psalm/phar": "^4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev", + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/2.1.0" + }, + "time": "2026-09-27T19:32:54+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "2.3.6", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "1427af4647235b4a73b13940b1f1258d3584f36e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1427af4647235b4a73b13940b1f1258d3584f36e", + "reference": "1427af4647235b4a73b13940b1f1258d3584f36e", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" }, "require-dev": { "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^5.3.0", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", "symfony/process": "^5.2" }, "type": "library", @@ -9658,41 +14366,103 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.6" }, - "time": "2024-10-13T11:25:22+00:00" + "time": "2026-09-27T20:07:45+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "2.3.0", + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b1f9890d9af53a25c58129e78f0aadd31f90d7f4", + "reference": "b1f9890d9af53a25c58129e78f0aadd31f90d7f4", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ondřej Mirtes" + }, + { + "name": "Markus Staab" + }, + { + "name": "Vincent Langlet" + } + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2026-10-06T06:15:36+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.32", + "version": "12.5.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" + "reference": "7440368d94738d54f2c1de24dbd3871793bbb0dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", + "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": "^4.19.1 || ^5.1.0", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-text-template": "^2.0.4", - "sebastian/code-unit-reverse-lookup": "^2.0.3", - "sebastian/complexity": "^2.0.3", - "sebastian/environment": "^5.1.5", - "sebastian/lines-of-code": "^1.0.4", - "sebastian/version": "^3.0.2", - "theseer/tokenizer": "^1.2.3" + "nikic/php-parser": "^5.9.0", + "php": ">=8.3", + "phpunit/php-text-template": "^5.0.1", + "sebastian/complexity": "^5.0", + "sebastian/environment": "^8.1.2", + "sebastian/lines-of-code": "^4.0.1", + "sebastian/version": "^6.0", + "theseer/tokenizer": "^2.0.1" }, "require-dev": { - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^12.5.37" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -9701,7 +14471,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "9.2.x-dev" + "dev-main": "12.5.x-dev" } }, "autoload": { @@ -9730,40 +14500,52 @@ "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/9.2.32" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.5.8" }, "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-code-coverage", + "type": "tidelift" } ], - "time": "2024-08-22T04:23:01+00:00" + "time": "2026-10-03T14:03:50+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "a248d1640ab059b075f53a2ef0f9856e864e06b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a248d1640ab059b075f53a2ef0f9856e864e06b5", + "reference": "a248d1640ab059b075f53a2ef0f9856e864e06b5", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.5.33" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -9790,36 +14572,49 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/6.0.2" }, "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-file-iterator", + "type": "tidelift" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2026-08-25T14:40:53+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.1.1", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/12b54e689b07a25a9b41e57736dfab6ec9ae5406", + "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "suggest": { "ext-pcntl": "*" @@ -9827,7 +14622,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -9853,7 +14648,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/6.0.0" }, "funding": [ { @@ -9861,32 +14657,32 @@ "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2025-02-07T04:58:58+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.4", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "babab73b7ef9fae406f2eb3ee11323a61caa63d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/babab73b7ef9fae406f2eb3ee11323a61caa63d5", + "reference": "babab73b7ef9fae406f2eb3ee11323a61caa63d5", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.5.37" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -9912,40 +14708,53 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "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": "2020-10-26T05:33:50+00:00" + "time": "2026-10-03T04:51:29+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.3", + "version": "8.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc", + "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "8.0-dev" } }, "autoload": { @@ -9971,7 +14780,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "security": "https://github.com/sebastianbergmann/php-timer/security/policy", + "source": "https://github.com/sebastianbergmann/php-timer/tree/8.0.0" }, "funding": [ { @@ -9979,54 +14789,49 @@ "type": "github" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2025-02-07T04:59:38+00:00" }, { "name": "phpunit/phpunit", - "version": "9.6.22", + "version": "12.5.33", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" + "reference": "b98e028a26c5c5ba7e4a54be96ccf35f2914d184" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b98e028a26c5c5ba7e4a54be96ccf35f2914d184", + "reference": "b98e028a26c5c5ba7e4a54be96ccf35f2914d184", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", + "ext-filter": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", - "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.1", + "myclabs/deep-copy": "^1.13.4", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.32", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.4", - "phpunit/php-timer": "^5.0.3", - "sebastian/cli-parser": "^1.0.2", - "sebastian/code-unit": "^1.0.8", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.6", - "sebastian/environment": "^5.1.5", - "sebastian/exporter": "^4.0.6", - "sebastian/global-state": "^5.0.7", - "sebastian/object-enumerator": "^4.0.4", - "sebastian/resource-operations": "^3.0.4", - "sebastian/type": "^3.2.1", - "sebastian/version": "^3.0.2" - }, - "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "php": ">=8.3", + "phpunit/php-code-coverage": "^12.5.7", + "phpunit/php-file-iterator": "^6.0.1", + "phpunit/php-invoker": "^6.0.0", + "phpunit/php-text-template": "^5.0.0", + "phpunit/php-timer": "^8.0.0", + "sebastian/cli-parser": "^4.2.1", + "sebastian/comparator": "^7.1.8", + "sebastian/diff": "^7.0.0", + "sebastian/environment": "^8.1.2", + "sebastian/exporter": "^7.0.3", + "sebastian/global-state": "^8.0.3", + "sebastian/object-enumerator": "^7.0.0", + "sebastian/recursion-context": "^7.0.1", + "sebastian/type": "^6.0.4", + "sebastian/version": "^6.0.0", + "staabm/side-effects-detector": "^1.0.5" }, "bin": [ "phpunit" @@ -10034,7 +14839,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "12.5-dev" } }, "autoload": { @@ -10066,50 +14871,43 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.33" }, "funding": [ { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", - "type": "tidelift" + "url": "https://phpunit.de/sponsoring.html", + "type": "other" } ], - "time": "2024-12-05T13:48:26+00:00" + "time": "2026-07-28T13:58:09+00:00" }, { - "name": "psr/cache", - "version": "1.0.1", + "name": "react/event-loop", + "version": "v1.6.0", "source": { "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + "url": "https://github.com/reactphp/event-loop.git", + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/ba276bda6083df7e0050fd9b33f66ad7a4ac747a", + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a", "shasum": "" }, "require": { "php": ">=5.3.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "type": "library", "autoload": { "psr-4": { - "Psr\\Cache\\": "src/" + "React\\EventLoop\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -10118,45 +14916,124 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Common interface for caching libraries", + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", "keywords": [ - "cache", - "psr", - "psr-6" + "asynchronous", + "event-loop" ], "support": { - "source": "https://github.com/php-fig/cache/tree/master" + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.6.0" }, - "time": "2016-08-06T20:24:11+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-17T20:46:25+00:00" }, { - "name": "sebastian/cli-parser", - "version": "1.0.2", + "name": "rector/rector", + "version": "2.7.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + "url": "https://github.com/rectorphp/rector.git", + "reference": "4d6a39b7fff302cac0ce90cd959a53c2f6a32776" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/4d6a39b7fff302cac0ce90cd959a53c2f6a32776", + "reference": "4d6a39b7fff302cac0ce90cd959a53c2f6a32776", "shasum": "" }, "require": { - "php": ">=7.3" + "php": "^7.4|^8.0", + "phpstan/phpstan": "^2.3.0" + }, + "conflict": { + "rector/rector-doctrine": "*", + "rector/rector-downgrade-php": "*", + "rector/rector-phpunit": "*", + "rector/rector-symfony": "*" + }, + "bin": [ + "bin/rector" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "homepage": "https://getrector.com/", + "keywords": [ + "automation", + "dev", + "migration", + "refactoring" + ], + "support": { + "issues": "https://github.com/rectorphp/rector/issues", + "source": "https://github.com/rectorphp/rector/tree/2.7.0" + }, + "funding": [ + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2026-10-06T08:46:45+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "4.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "7d05781b13f7dec9043a629a21d086ed74582a15" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/7d05781b13f7dec9043a629a21d086ed74582a15", + "reference": "7d05781b13f7dec9043a629a21d086ed74582a15", + "shasum": "" + }, + "require": { + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.5.25" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "4.2-dev" } }, "autoload": { @@ -10179,153 +15056,60 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.2.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" - } - ], - "time": "2024-03-02T06:27:43+00:00" - }, - { - "name": "sebastian/code-unit", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ + }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" - }, - "funding": [ + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:08:54+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "url": "https://tidelift.com/funding/github/packagist/sebastian/cli-parser", + "type": "tidelift" } ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2026-05-17T05:29:34+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "7.1.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "7c65c1e79836812819705b473a90c12399542485" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/7c65c1e79836812819705b473a90c12399542485", + "reference": "7c65c1e79836812819705b473a90c12399542485", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.3", + "sebastian/diff": "^7.0", + "sebastian/exporter": "^7.0.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.5.25" + }, + "suggest": { + "ext-bcmath": "For comparing BcMath\\Number objects" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "7.1-dev" } }, "autoload": { @@ -10364,41 +15148,54 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/7.1.8" }, "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/comparator", + "type": "tidelift" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2026-05-21T04:45:25+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.3", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/bad4316aba5303d0221f43f8cee37eb58d384bbb", + "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" + "nikic/php-parser": "^5.0", + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -10421,7 +15218,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/5.0.0" }, "funding": [ { @@ -10429,33 +15227,33 @@ "type": "github" } ], - "time": "2023-12-22T06:19:30+00:00" + "time": "2025-02-07T04:55:25+00:00" }, { "name": "sebastian/diff", - "version": "4.0.6", + "version": "7.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + "reference": "cd4cabe39f8a4e8ee6818ba99f10a05561ea4ad6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/cd4cabe39f8a4e8ee6818ba99f10a05561ea4ad6", + "reference": "cd4cabe39f8a4e8ee6818ba99f10a05561ea4ad6", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" + "phpunit/phpunit": "^12.5.33", + "symfony/process": "^7.4.17" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -10487,35 +15285,48 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/7.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/diff", + "type": "tidelift" } ], - "time": "2024-03-02T06:30:58+00:00" + "time": "2026-08-25T15:35:54+00:00" }, { "name": "sebastian/environment", - "version": "5.1.5", + "version": "8.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "reference": "9d32c685773823b1983e256ae4ecd48a10d6e439" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/9d32c685773823b1983e256ae4ecd48a10d6e439", + "reference": "9d32c685773823b1983e256ae4ecd48a10d6e439", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.5.26" }, "suggest": { "ext-posix": "*" @@ -10523,7 +15334,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "8.1-dev" } }, "autoload": { @@ -10542,7 +15353,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -10550,42 +15361,55 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/8.1.2" }, "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/environment", + "type": "tidelift" } ], - "time": "2023-02-03T06:03:51+00:00" + "time": "2026-05-25T13:40:20+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.6", + "version": "7.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + "reference": "c5e21b5de653ce0a769fb36f5cdfcb5e7a32cf23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c5e21b5de653ce0a769fb36f5cdfcb5e7a32cf23", + "reference": "c5e21b5de653ce0a769fb36f5cdfcb5e7a32cf23", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.3", + "sebastian/recursion-context": "^7.0.1" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.5.25" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -10627,46 +15451,56 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/7.0.3" }, "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/exporter", + "type": "tidelift" } ], - "time": "2024-03-02T06:33:00+00:00" + "time": "2026-05-20T04:37:17+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.7", + "version": "8.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + "reference": "b164d3274d6537ab462591c5755f76a8f5b1aae9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b164d3274d6537ab462591c5755f76a8f5b1aae9", + "reference": "b164d3274d6537ab462591c5755f76a8f5b1aae9", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.3", + "sebastian/object-reflector": "^5.0", + "sebastian/recursion-context": "^7.0.1" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^12.5.28" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "8.0-dev" } }, "autoload": { @@ -10685,47 +15519,60 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/8.0.3" }, "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/global-state", + "type": "tidelift" } ], - "time": "2024-03-02T06:35:11+00:00" + "time": "2026-06-01T15:10:33+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.4", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + "reference": "d543b8ef219dcd8da262cbb958639a96bedba10e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d543b8ef219dcd8da262cbb958639a96bedba10e", + "reference": "d543b8ef219dcd8da262cbb958639a96bedba10e", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" + "nikic/php-parser": "^5.7.0", + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.5.25" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -10748,42 +15595,55 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/4.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/lines-of-code", + "type": "tidelift" } ], - "time": "2023-12-22T06:20:34+00:00" + "time": "2026-05-19T16:22:07+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.4", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1effe8e9b8e068e9ae228e542d5d11b5d16db894", + "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.3", + "sebastian/object-reflector": "^5.0", + "sebastian/recursion-context": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -10805,7 +15665,8 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/7.0.0" }, "funding": [ { @@ -10813,32 +15674,32 @@ "type": "github" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2025-02-07T04:57:48+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "reference": "4bfa827c969c98be1e527abd576533293c634f6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/4bfa827c969c98be1e527abd576533293c634f6a", + "reference": "4bfa827c969c98be1e527abd576533293c634f6a", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -10860,7 +15721,8 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/5.0.0" }, "funding": [ { @@ -10868,32 +15730,32 @@ "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2025-02-07T04:58:17+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "7.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "0b01998a7d5b1f122911a66bebcb8d46f0c82d8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/0b01998a7d5b1f122911a66bebcb8d46f0c82d8c", + "reference": "0b01998a7d5b1f122911a66bebcb8d46f0c82d8c", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -10923,94 +15785,53 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/7.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" - } - ], - "time": "2023-02-03T06:07:39+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ + }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" - }, - "funding": [ + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, { - "url": "https://github.com/sebastianbergmann", - "type": "github" + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" } ], - "time": "2024-03-14T16:00:52+00:00" + "time": "2025-08-13T04:44:59+00:00" }, { "name": "sebastian/type", - "version": "3.2.1", + "version": "6.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "reference": "82ff822c2edc46724be9f7411d3163021f602773" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/82ff822c2edc46724be9f7411d3163021f602773", + "reference": "82ff822c2edc46724be9f7411d3163021f602773", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^12.5.25" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -11033,37 +15854,50 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/6.0.4" }, "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/type", + "type": "tidelift" } ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2026-05-20T06:45:45+00:00" }, { "name": "sebastian/version", - "version": "3.0.2", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "reference": "9e935a16187e14f39b0e79910dabd614972cdb26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/9e935a16187e14f39b0e79910dabd614972cdb26", + "reference": "9e935a16187e14f39b0e79910dabd614972cdb26", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -11086,54 +15920,67 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "security": "https://github.com/sebastianbergmann/version/security/policy", + "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": "2020-09-28T06:39:44+00:00" + "time": "2026-10-04T05:50:08+00:00" }, { "name": "slevomat/coding-standard", - "version": "7.2.1", + "version": "8.31.1", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "aff06ae7a84e4534bf6f821dc982a93a5d477c90" + "reference": "0a40807a48873948bfa7ffce2a4e69ba40cf5e76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/aff06ae7a84e4534bf6f821dc982a93a5d477c90", - "reference": "aff06ae7a84e4534bf6f821dc982a93a5d477c90", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/0a40807a48873948bfa7ffce2a4e69ba40cf5e76", + "reference": "0a40807a48873948bfa7ffce2a4e69ba40cf5e76", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7", - "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": "^1.5.1", - "squizlabs/php_codesniffer": "^3.6.2" + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.2.1", + "php": "^7.4 || ^8.0", + "phpstan/phpdoc-parser": "^2.3.3", + "squizlabs/php_codesniffer": "^4.0.1" }, "require-dev": { - "phing/phing": "2.17.3", - "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.4.10|1.7.1", - "phpstan/phpstan-deprecation-rules": "1.0.0", - "phpstan/phpstan-phpunit": "1.0.0|1.1.1", - "phpstan/phpstan-strict-rules": "1.2.3", - "phpunit/phpunit": "7.5.20|8.5.21|9.5.20" + "phing/phing": "3.0.1|3.1.2", + "php-parallel-lint/php-parallel-lint": "1.4.0", + "phpstan/phpstan": "2.2.7", + "phpstan/phpstan-deprecation-rules": "2.0.5", + "phpstan/phpstan-phpunit": "2.0.18", + "phpstan/phpstan-strict-rules": "2.0.12", + "phpunit/phpunit": "9.6.34|10.5.63|11.4.4|11.5.56|12.5.33" }, "type": "phpcodesniffer-standard", "extra": { "branch-alias": { - "dev-master": "7.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { "psr-4": { - "SlevomatCodingStandard\\": "SlevomatCodingStandard" + "SlevomatCodingStandard\\": "SlevomatCodingStandard/" } }, "notification-url": "https://packagist.org/downloads/", @@ -11141,9 +15988,13 @@ "MIT" ], "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "keywords": [ + "dev", + "phpcs" + ], "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/7.2.1" + "source": "https://github.com/slevomat/coding-standard/tree/8.31.1" }, "funding": [ { @@ -11155,41 +16006,426 @@ "type": "tidelift" } ], - "time": "2022-05-25T10:58:12+00:00" + "time": "2026-07-31T10:42:43+00:00" }, { - "name": "squizlabs/php_codesniffer", - "version": "3.11.3", + "name": "spatie/backtrace", + "version": "1.8.2", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10" + "url": "https://github.com/spatie/backtrace.git", + "reference": "8ffe78be5ed355b5009e3dd989d183433e9a5adc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10", - "reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10", + "url": "https://api.github.com/repos/spatie/backtrace/zipball/8ffe78be5ed355b5009e3dd989d183433e9a5adc", + "reference": "8ffe78be5ed355b5009e3dd989d183433e9a5adc", "shasum": "" }, "require": { + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "ext-json": "*", + "laravel/serializable-closure": "^1.3 || ^2.0", + "phpunit/phpunit": "^9.3 || ^11.4.3", + "spatie/phpunit-snapshot-assertions": "^4.2 || ^5.1.6", + "symfony/var-dumper": "^5.1|^6.0|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Backtrace\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van de Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "A better backtrace", + "homepage": "https://github.com/spatie/backtrace", + "keywords": [ + "Backtrace", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/backtrace/issues", + "source": "https://github.com/spatie/backtrace/tree/1.8.2" + }, + "funding": [ + { + "url": "https://github.com/sponsors/spatie", + "type": "github" + }, + { + "url": "https://spatie.be/open-source/support-us", + "type": "other" + } + ], + "time": "2026-03-11T13:48:28+00:00" + }, + { + "name": "spatie/error-solutions", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/spatie/error-solutions.git", + "reference": "e495d7178ca524f2dd0fe6a1d99a1e608e1c9936" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/error-solutions/zipball/e495d7178ca524f2dd0fe6a1d99a1e608e1c9936", + "reference": "e495d7178ca524f2dd0fe6a1d99a1e608e1c9936", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "illuminate/broadcasting": "^10.0|^11.0|^12.0", + "illuminate/cache": "^10.0|^11.0|^12.0", + "illuminate/support": "^10.0|^11.0|^12.0", + "livewire/livewire": "^2.11|^3.5.20", + "openai-php/client": "^0.10.1", + "orchestra/testbench": "8.22.3|^9.0|^10.0", + "pestphp/pest": "^2.20|^3.0", + "phpstan/phpstan": "^2.1", + "psr/simple-cache": "^3.0", + "psr/simple-cache-implementation": "^3.0", + "spatie/ray": "^1.28", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "vlucas/phpdotenv": "^5.5" + }, + "suggest": { + "openai-php/client": "Require get solutions from OpenAI", + "simple-cache-implementation": "To cache solutions from OpenAI" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Ignition\\": "legacy/ignition", + "Spatie\\ErrorSolutions\\": "src", + "Spatie\\LaravelIgnition\\": "legacy/laravel-ignition" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ruben Van Assche", + "email": "ruben@spatie.be", + "role": "Developer" + } + ], + "description": "This is my package error-solutions", + "homepage": "https://github.com/spatie/error-solutions", + "keywords": [ + "error-solutions", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/error-solutions/issues", + "source": "https://github.com/spatie/error-solutions/tree/1.1.3" + }, + "funding": [ + { + "url": "https://github.com/Spatie", + "type": "github" + } + ], + "time": "2025-02-14T12:29:50+00:00" + }, + { + "name": "spatie/flare-client-php", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/flare-client-php.git", + "reference": "53f41b08a27cc039e1a8ed2be9a202e924f31bad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/flare-client-php/zipball/53f41b08a27cc039e1a8ed2be9a202e924f31bad", + "reference": "53f41b08a27cc039e1a8ed2be9a202e924f31bad", + "shasum": "" + }, + "require": { + "illuminate/pipeline": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0", + "php": "^8.0", + "spatie/backtrace": "^1.6.1", + "symfony/http-foundation": "^5.2|^6.0|^7.0|^8.0", + "symfony/mime": "^5.2|^6.0|^7.0|^8.0", + "symfony/process": "^5.2|^6.0|^7.0|^8.0", + "symfony/var-dumper": "^5.2|^6.0|^7.0|^8.0" + }, + "require-dev": { + "dms/phpunit-arraysubset-asserts": "^0.5.0", + "pestphp/pest": "^1.20|^2.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "spatie/pest-plugin-snapshots": "^1.0|^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.3.x-dev" + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Spatie\\FlareClient\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Send PHP errors to Flare", + "homepage": "https://github.com/spatie/flare-client-php", + "keywords": [ + "exception", + "flare", + "reporting", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/flare-client-php/issues", + "source": "https://github.com/spatie/flare-client-php/tree/1.11.1" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2026-05-15T09:31:32+00:00" + }, + { + "name": "spatie/ignition", + "version": "1.16.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/ignition.git", + "reference": "b59385bb7aa24dae81bcc15850ebecfda7b40838" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/ignition/zipball/b59385bb7aa24dae81bcc15850ebecfda7b40838", + "reference": "b59385bb7aa24dae81bcc15850ebecfda7b40838", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "php": "^8.0", + "spatie/backtrace": "^1.7.1", + "spatie/error-solutions": "^1.1.2", + "spatie/flare-client-php": "^1.9", + "symfony/console": "^5.4.42|^6.0|^7.0|^8.0", + "symfony/http-foundation": "^5.4.42|^6.0|^7.0|^8.0", + "symfony/mime": "^5.4.42|^6.0|^7.0|^8.0", + "symfony/var-dumper": "^5.4.42|^6.0|^7.0|^8.0" + }, + "require-dev": { + "illuminate/cache": "^9.52|^10.0|^11.0|^12.0|^13.0", + "mockery/mockery": "^1.4", + "pestphp/pest": "^1.20|^2.0|^3.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "psr/simple-cache-implementation": "*", + "symfony/cache": "^5.4.38|^6.0|^7.0|^8.0", + "symfony/process": "^5.4.35|^6.0|^7.0|^8.0", + "vlucas/phpdotenv": "^5.5" + }, + "suggest": { + "openai-php/client": "Require get solutions from OpenAI", + "simple-cache-implementation": "To cache solutions from OpenAI" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.5.x-dev" + } + }, + "autoload": { + "psr-4": { + "Spatie\\Ignition\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Spatie", + "email": "info@spatie.be", + "role": "Developer" + } + ], + "description": "A beautiful error page for PHP applications.", + "homepage": "https://flareapp.io/ignition", + "keywords": [ + "error", + "flare", + "laravel", + "page" + ], + "support": { + "docs": "https://flareapp.io/docs/ignition-for-laravel/introduction", + "forum": "https://twitter.com/flareappio", + "issues": "https://github.com/spatie/ignition/issues", + "source": "https://github.com/spatie/ignition" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2026-03-17T10:51:08+00:00" + }, + { + "name": "spatie/laravel-ignition", + "version": "2.12.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-ignition.git", + "reference": "45b3b6e1e73fc161cba2149972698644b99594ee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/45b3b6e1e73fc161cba2149972698644b99594ee", + "reference": "45b3b6e1e73fc161cba2149972698644b99594ee", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "illuminate/support": "^11.0|^12.0|^13.0", + "nesbot/carbon": "^2.72|^3.0", + "php": "^8.2", + "spatie/ignition": "^1.16", + "symfony/console": "^7.4|^8.0", + "symfony/var-dumper": "^7.4|^8.0" + }, + "require-dev": { + "livewire/livewire": "^3.7.0|^4.0|dev-josh/v3-laravel-13-support", + "mockery/mockery": "^1.6.12", + "openai-php/client": "^0.10.3|^0.19", + "orchestra/testbench": "^v9.16.0|^10.6|^11.0", + "pestphp/pest": "^3.7|^4.0", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan-deprecation-rules": "^2.0.3", + "phpstan/phpstan-phpunit": "^2.0.8", + "vlucas/phpdotenv": "^5.6.2" + }, + "suggest": { + "openai-php/client": "Require get solutions from OpenAI", + "psr/simple-cache-implementation": "Needed to cache solutions from OpenAI" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "Flare": "Spatie\\LaravelIgnition\\Facades\\Flare" + }, + "providers": [ + "Spatie\\LaravelIgnition\\IgnitionServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Spatie\\LaravelIgnition\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Spatie", + "email": "info@spatie.be", + "role": "Developer" + } + ], + "description": "A beautiful error page for Laravel applications.", + "homepage": "https://flareapp.io/ignition", + "keywords": [ + "error", + "flare", + "laravel", + "page" + ], + "support": { + "docs": "https://flareapp.io/docs/ignition-for-laravel/introduction", + "forum": "https://twitter.com/flareappio", + "issues": "https://github.com/spatie/laravel-ignition/issues", + "source": "https://github.com/spatie/laravel-ignition" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2026-03-17T12:20:04+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "bbdc3d0532623e21838b7041a4364383a8126f96" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/bbdc3d0532623e21838b7041a4364383a8126f96", + "reference": "bbdc3d0532623e21838b7041a4364383a8126f96", + "shasum": "" + }, + "require": { + "ext-libxml": "*", "ext-simplexml": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", - "php": ">=5.4.0" + "php": ">=7.2.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + "phpunit/phpunit": "^8.4.0 || ^9.3.4 || ^10.5.32 || 11.3.3 - 11.5.28 || ^11.5.31" + }, + "suggest": { + "ext-iconv": "For accurate character length calculation when the checked files contain multi-byte characters.", + "ext-pcntl": "For parallel processing support via the --parallel CLI option." }, "bin": [ "bin/phpcbf", "bin/phpcs" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -11208,7 +16444,7 @@ "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "description": "PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.", "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", @@ -11235,31 +16471,202 @@ "type": "open_collective" }, { - "url": "https://thanks.dev/phpcsstandards", + "url": "https://thanks.dev/u/gh/phpcsstandards", "type": "thanks_dev" } ], - "time": "2025-01-23T17:04:15+00:00" + "time": "2026-08-06T02:45:27+00:00" }, { - "name": "theseer/tokenizer", - "version": "1.2.3", + "name": "staabm/side-effects-detector", + "version": "1.0.5", "source": { "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + "url": "https://github.com/staabm/side-effects-detector.git", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.6", + "phpunit/phpunit": "^9.6.21", + "symfony/var-dumper": "^5.4.43", + "tomasvotruba/type-coverage": "1.0.0", + "tomasvotruba/unused-public": "1.0.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A static analysis tool to detect side effects in PHP code", + "keywords": [ + "static analysis" + ], + "support": { + "issues": "https://github.com/staabm/side-effects-detector/issues", + "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" + }, + "funding": [ + { + "url": "https://github.com/staabm", + "type": "github" + } + ], + "time": "2024-10-20T05:08:20+00:00" + }, + { + "name": "symplify/rule-doc-generator-contracts", + "version": "11.2.0", + "source": { + "type": "git", + "url": "https://github.com/symplify/rule-doc-generator-contracts.git", + "reference": "479cfcfd46047f80624aba931d9789e50475b5c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symplify/rule-doc-generator-contracts/zipball/479cfcfd46047f80624aba931d9789e50475b5c6", + "reference": "479cfcfd46047f80624aba931d9789e50475b5c6", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpstan/extension-installer": "^1.2", + "rector/rector": "^0.15.10", + "symplify/easy-ci": "^11.1", + "symplify/easy-coding-standard": "^11.1", + "symplify/easy-testing": "^11.1", + "symplify/phpstan-extensions": "^11.1", + "symplify/phpstan-rules": "11.2.3.72", + "tomasvotruba/unused-public": "^0.0.34" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "11.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symplify\\RuleDocGenerator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Contracts for production code of RuleDocGenerator", + "support": { + "source": "https://github.com/symplify/rule-doc-generator-contracts/tree/11.2.0" + }, + "funding": [ + { + "url": "https://www.paypal.me/rectorphp", + "type": "custom" + }, + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "abandoned": true, + "time": "2024-03-18T22:02:54+00:00" + }, + { + "name": "ta-tikoma/phpunit-architecture-test", + "version": "0.8.7", + "source": { + "type": "git", + "url": "https://github.com/ta-tikoma/phpunit-architecture-test.git", + "reference": "1248f3f506ca9641d4f68cebcd538fa489754db8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ta-tikoma/phpunit-architecture-test/zipball/1248f3f506ca9641d4f68cebcd538fa489754db8", + "reference": "1248f3f506ca9641d4f68cebcd538fa489754db8", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18.0 || ^5.0.0", + "php": "^8.1.0", + "phpdocumentor/reflection-docblock": "^5.3.0 || ^6.0.0", + "phpunit/phpunit": "^10.5.5 || ^11.0.0 || ^12.0.0 || ^13.0.0", + "symfony/finder": "^6.4.0 || ^7.0.0 || ^8.0.0" + }, + "require-dev": { + "laravel/pint": "^1.13.7", + "phpstan/phpstan": "^1.10.52" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPUnit\\Architecture\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ni Shi", + "email": "futik0ma011@gmail.com" + }, + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Methods for testing application architecture", + "keywords": [ + "architecture", + "phpunit", + "stucture", + "test", + "testing" + ], + "support": { + "issues": "https://github.com/ta-tikoma/phpunit-architecture-test/issues", + "source": "https://github.com/ta-tikoma/phpunit-architecture-test/tree/0.8.7" + }, + "time": "2026-02-17T17:25:14+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "7989e43bf381af0eac72e4f0ca5bcbfa81658be4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/7989e43bf381af0eac72e4f0ca5bcbfa81658be4", + "reference": "7989e43bf381af0eac72e4f0ca5bcbfa81658be4", "shasum": "" }, "require": { "ext-dom": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" + "php": "^8.1" }, "type": "library", "autoload": { @@ -11281,7 +16688,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + "source": "https://github.com/theseer/tokenizer/tree/2.0.1" }, "funding": [ { @@ -11289,17 +16696,90 @@ "type": "github" } ], - "time": "2024-03-03T12:36:25+00:00" + "time": "2025-12-08T11:19:18+00:00" + }, + { + "name": "tomasvotruba/type-coverage", + "version": "2.5.0", + "source": { + "type": "git", + "url": "https://github.com/TomasVotruba/type-coverage.git", + "reference": "afcfc6f890cb680d10974cbdff210892210c822a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/TomasVotruba/type-coverage/zipball/afcfc6f890cb680d10974cbdff210892210c822a", + "reference": "afcfc6f890cb680d10974cbdff210892210c822a", + "shasum": "" + }, + "require": { + "entropy/entropy": "^0.4.23", + "php": ">=7.4", + "phpstan/phpstan": "^2.2" + }, + "require-dev": { + "doctrine/collections": "^2.3", + "phpstan/extension-installer": "^1.4", + "phpunit/phpunit": "^13.2", + "rector/jack": "^1.1", + "rector/rector": "^2.5", + "shipmonk/composer-dependency-analyser": "^1.8", + "symfony/dom-crawler": "^8.1", + "symfony/form": "^8.1", + "symplify/easy-coding-standard": "^13.2", + "tomasvotruba/unused-public": "^2.2", + "tracy/tracy": "^2.12" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "config/extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "Rector\\TypePerfect\\": "packages/type-perfect/src", + "TomasVotruba\\TypeCoverage\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Measure type coverage of your project", + "keywords": [ + "phpstan-extension", + "static analysis" + ], + "support": { + "issues": "https://github.com/TomasVotruba/type-coverage/issues", + "source": "https://github.com/TomasVotruba/type-coverage/tree/2.5.0" + }, + "funding": [ + { + "url": "https://www.paypal.me/rectorphp", + "type": "custom" + }, + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2026-10-05T20:07:08+00:00" } ], "aliases": [], - "minimum-stability": "dev", - "stability-flags": {}, + "minimum-stability": "stable", + "stability-flags": { + "maatwebsite/excel": 20 + }, "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^7.3" + "php": "^8.5" }, "platform-dev": {}, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.9.0" } diff --git a/config/admin-secure.php b/config/admin-secure.php deleted file mode 100644 index e94639af..00000000 --- a/config/admin-secure.php +++ /dev/null @@ -1,6 +0,0 @@ - env('UWIL_ADMIN_SECURE_CIDR_LIST'), - 'cidrProjectAllowedList' => env('UWIL_ADMIN_SECURE_CIDR_PROJECT_ALLOWED_LIST') -]; diff --git a/config/app.php b/config/app.php index caa32c32..d625924d 100644 --- a/config/app.php +++ b/config/app.php @@ -1,194 +1,139 @@ env('APP_NAME', 'Laravel'), /* - |-------------------------------------------------------------------------- - | Application Front Views Folder - |-------------------------------------------------------------------------- - | - | This value is the folder where blades will be found - | - */ - - 'theme' => 'sable', - - /* - |-------------------------------------------------------------------------- - | Application Environment - |-------------------------------------------------------------------------- - | - | This value determines the "environment" your application is currently - | running in. This may determine how you prefer to configure various - | services the application utilizes. Set this in your ".env" file. - | - */ + |-------------------------------------------------------------------------- + | Application Environment + |-------------------------------------------------------------------------- + | + | This value determines the "environment" your application is currently + | running in. This may determine how you prefer to configure various + | services the application utilizes. Set this in your ".env" file. + | + */ 'env' => env('APP_ENV', 'production'), /* - |-------------------------------------------------------------------------- - | Application Debug Mode - |-------------------------------------------------------------------------- - | - | When your application is in debug mode, detailed error messages with - | stack traces will be shown on every error that occurs within your - | application. If disabled, a simple generic error page is shown. - | - */ + |-------------------------------------------------------------------------- + | Application Debug Mode + |-------------------------------------------------------------------------- + | + | When your application is in debug mode, detailed error messages with + | stack traces will be shown on every error that occurs within your + | application. If disabled, a simple generic error page is shown. + | + */ - 'debug' => (bool)env('APP_DEBUG', false), + 'debug' => (bool) env('APP_DEBUG', false), /* - |-------------------------------------------------------------------------- - | Application URL - |-------------------------------------------------------------------------- - | - | This URL is used by the console to properly generate URLs when using - | the Artisan command line tool. You should set this to the root of - | your application so that it is used when running Artisan tasks. - | - */ + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | the application so that it's available within Artisan commands. + | + */ 'url' => env('APP_URL', 'http://localhost'), - 'asset_url' => env('ASSET_URL', null), + /* + |-------------------------------------------------------------------------- + | Application Timezone + |-------------------------------------------------------------------------- + | + | Here you may specify the default timezone for your application, which + | will be used by the PHP date and date-time functions. The timezone + | is set to "UTC" by default as it is suitable for most use cases. + | + */ + + 'timezone' => 'UTC', /* - |-------------------------------------------------------------------------- - | Application Timezone - |-------------------------------------------------------------------------- - | - | Here you may specify the default timezone for your application, which - | will be used by the PHP date and date-time functions. We have gone - | ahead and set this to a sensible default for you out of the box. - | - */ + |-------------------------------------------------------------------------- + | Application Locale Configuration + |-------------------------------------------------------------------------- + | + | The application locale determines the default locale that will be used + | by Laravel's translation / localization methods. This option can be + | set to any locale for which you plan to have translation strings. + | + */ - 'timezone' => 'Europe/Paris', + 'locale' => env('APP_LOCALE', 'fr'), + + 'locales' => ['fr'], + + 'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'), + + 'faker_locale' => env('APP_FAKER_LOCALE', 'fr_FR'), + + 'currency' => env('APP_CURRENCY', 'EUR'), /* - |-------------------------------------------------------------------------- - | Application Locale Configuration - |-------------------------------------------------------------------------- - | - | The application locale determines the default locale that will be used - | by the translation service provider. You are free to set this value - | to any of the locales which will be supported by the application. - | - */ - - 'locale' => 'fr', - - /* - |-------------------------------------------------------------------------- - | Application Fallback Locale - |-------------------------------------------------------------------------- - | - | The fallback locale determines the locale to use when the current one - | is not available. You may change the value to correspond to any of - | the language folders that are provided through your application. - | - */ - - 'fallback_locale' => 'en', - - /* - |-------------------------------------------------------------------------- - | Faker Locale - |-------------------------------------------------------------------------- - | - | This locale will be used by the Faker PHP library when generating fake - | data for your database seeds. For example, this will be used to get - | localized telephone numbers, street address information and more. - | - */ - - 'faker_locale' => 'en_US', - - /* - |-------------------------------------------------------------------------- - | Encryption Key - |-------------------------------------------------------------------------- - | - | This key is used by the Illuminate encrypter service and should be set - | to a random, 32 character string, otherwise these encrypted strings - | will not be safe. Please do this before deploying an application! - | - */ - - 'key' => env('APP_KEY'), + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is utilized by Laravel's encryption services and should be set + | to a random, 32 character string to ensure that all encrypted values + | are secure. You should do this prior to deploying the application. + | + */ 'cipher' => 'AES-256-CBC', + 'key' => env('APP_KEY'), + + 'previous_keys' => [ + ...array_filter( + explode(',', (string) env('APP_PREVIOUS_KEYS', '')) + ), + ], + /* - |-------------------------------------------------------------------------- - | Autoloaded Service Providers - |-------------------------------------------------------------------------- - | - | The service providers listed here will be automatically loaded on the - | request to your application. Feel free to add your own services to - | this array to grant expanded functionality to your applications. - | - */ - - 'providers' => [ - - /* - * Laravel Framework Service Providers... - */ - - Illuminate\Auth\AuthServiceProvider::class, - Illuminate\Broadcasting\BroadcastServiceProvider::class, - Illuminate\Bus\BusServiceProvider::class, - Illuminate\Cache\CacheServiceProvider::class, - Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, - Illuminate\Cookie\CookieServiceProvider::class, - Illuminate\Database\DatabaseServiceProvider::class, - Illuminate\Encryption\EncryptionServiceProvider::class, - Illuminate\Filesystem\FilesystemServiceProvider::class, - Illuminate\Foundation\Providers\FoundationServiceProvider::class, - Illuminate\Hashing\HashServiceProvider::class, - Illuminate\Mail\MailServiceProvider::class, - Illuminate\Notifications\NotificationServiceProvider::class, - Illuminate\Pagination\PaginationServiceProvider::class, - Illuminate\Pipeline\PipelineServiceProvider::class, - Illuminate\Queue\QueueServiceProvider::class, - Illuminate\Redis\RedisServiceProvider::class, - Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, - Illuminate\Session\SessionServiceProvider::class, - Illuminate\Translation\TranslationServiceProvider::class, - Illuminate\Validation\ValidationServiceProvider::class, - Illuminate\View\ViewServiceProvider::class, - - /* - * Package Service Providers... - */ - - /* - * Application Service Providers... - */ - - App\Providers\AppServiceProvider::class, - App\Providers\AuthServiceProvider::class, - App\Providers\EventServiceProvider::class, - App\Providers\RouteServiceProvider::class, - Gloudemans\Shoppingcart\ShoppingcartServiceProvider::class, - App\Providers\CrmApiServiceProvider::class, + |-------------------------------------------------------------------------- + | Maintenance Mode Driver + |-------------------------------------------------------------------------- + | + | These configuration options determine the driver used to determine and + | manage Laravel's "maintenance mode" status. The "cache" driver will + | allow maintenance mode to be controlled across multiple machines. + | + | Supported drivers: "file", "cache" + | + */ + 'maintenance' => [ + 'driver' => env('APP_MAINTENANCE_DRIVER', 'file'), + 'store' => env('APP_MAINTENANCE_STORE', 'database'), ], /* @@ -200,55 +145,16 @@ return [ | is started. However, feel free to register as many as you wish as | the aliases are "lazy" loaded so they don't hinder performance. | - */ + */ - 'aliases' => [ - - 'App' => Illuminate\Support\Facades\App::class, - 'Arr' => Illuminate\Support\Arr::class, - 'Artisan' => Illuminate\Support\Facades\Artisan::class, - 'Auth' => Illuminate\Support\Facades\Auth::class, - 'Blade' => Illuminate\Support\Facades\Blade::class, - 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, - 'Bus' => Illuminate\Support\Facades\Bus::class, - 'Cache' => Illuminate\Support\Facades\Cache::class, - 'Config' => Illuminate\Support\Facades\Config::class, - 'Cookie' => Illuminate\Support\Facades\Cookie::class, - 'Crypt' => Illuminate\Support\Facades\Crypt::class, - 'DB' => Illuminate\Support\Facades\DB::class, - 'Eloquent' => Illuminate\Database\Eloquent\Model::class, - 'Event' => Illuminate\Support\Facades\Event::class, - 'File' => Illuminate\Support\Facades\File::class, - 'Gate' => Illuminate\Support\Facades\Gate::class, - 'Hash' => Illuminate\Support\Facades\Hash::class, - 'Http' => Illuminate\Support\Facades\Http::class, - 'Lang' => Illuminate\Support\Facades\Lang::class, - 'Log' => Illuminate\Support\Facades\Log::class, - 'Mail' => Illuminate\Support\Facades\Mail::class, - 'Notification' => Illuminate\Support\Facades\Notification::class, - 'Password' => Illuminate\Support\Facades\Password::class, - 'Queue' => Illuminate\Support\Facades\Queue::class, - 'Redirect' => Illuminate\Support\Facades\Redirect::class, - 'Redis' => Illuminate\Support\Facades\Redis::class, - 'Request' => Illuminate\Support\Facades\Request::class, - 'Response' => Illuminate\Support\Facades\Response::class, - 'Route' => Illuminate\Support\Facades\Route::class, - 'Schema' => Illuminate\Support\Facades\Schema::class, - 'Session' => Illuminate\Support\Facades\Session::class, - 'Storage' => Illuminate\Support\Facades\Storage::class, - 'Str' => Illuminate\Support\Str::class, - 'URL' => Illuminate\Support\Facades\URL::class, - 'Validator' => Illuminate\Support\Facades\Validator::class, - 'View' => Illuminate\Support\Facades\View::class, + 'aliases' => Facade::defaultAliases()->merge([ // Enums. - 'LogType' => \App\Enums\LogType::class, - 'SettingRegisterMode' => \App\Enums\SettingRegisterMode::class, - 'SellUnit' => \App\Enums\SellUnit::class, - 'OrderUnit' => \App\Enums\OrderUnit::class, - 'ProductBrand' => \App\Enums\ProductBrand::class, - 'InvoicingUnit' => \App\Enums\InvoicingUnit::class, - 'WeightUnit' => \App\Enums\WeightUnit::class, - 'PriceShowingMode' => \App\Enums\PriceShowingMode::class, - ], + 'SellUnit' => SellUnit::class, + 'OrderUnit' => OrderUnit::class, + 'ProductBrand' => ProductBrand::class, + 'InvoicingUnit' => InvoicingUnit::class, + + 'PriceShowingMode' => PriceShowingMode::class, + ])->toArray(), ]; diff --git a/config/auth.php b/config/auth.php index 2e773166..7aa762b4 100644 --- a/config/auth.php +++ b/config/auth.php @@ -1,122 +1,141 @@ [ - 'guard' => 'web', - 'passwords' => 'users', + 'guard' => 'frontend', + 'passwords' => 'customers', ], /* - |-------------------------------------------------------------------------- - | Authentication Guards - |-------------------------------------------------------------------------- - | - | Next, you may define every authentication guard for your application. - | Of course, a great default configuration has been defined for you - | here which uses session storage and the Eloquent user provider. - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | Supported: "session", "token" - | - */ + |-------------------------------------------------------------------------- + | Authentication Guards + |-------------------------------------------------------------------------- + | + | Next, you may define every authentication guard for your application. + | Of course, a great default configuration has been defined for you + | which utilizes session storage plus the Eloquent user provider. + | + | All authentication guards have a user provider, which defines how the + | users are actually retrieved out of your database or other storage + | system used by the application. Typically, Eloquent is utilized. + | + | Supported: "session" + | + */ 'guards' => [ - 'web' => [ - 'driver' => 'session', + 'backend' => [ + 'driver' => 'session', 'provider' => 'users', ], 'api' => [ - 'driver' => 'token', + 'driver' => 'token', 'provider' => 'users', - 'hash' => false, + 'hash' => false, ], - 'customer' => [ - 'driver' => 'session', + 'frontend' => [ + 'driver' => 'session', 'provider' => 'customers', + 'hash' => false, ], ], /* - |-------------------------------------------------------------------------- - | User Providers - |-------------------------------------------------------------------------- - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | If you have multiple user tables or models you may configure multiple - | sources which represent each model / table. These sources may then - | be assigned to any extra authentication guards you have defined. - | - | Supported: "database", "eloquent" - | - */ + |-------------------------------------------------------------------------- + | User Providers + |-------------------------------------------------------------------------- + | + | All authentication guards have a user provider, which defines how the + | users are actually retrieved out of your database or other storage + | system used by the application. Typically, Eloquent is utilized. + | + | If you have multiple user tables or models you may configure multiple + | providers to represent the model / table. These providers may then + | be assigned to any extra authentication guards you have defined. + | + | Supported: "database", "eloquent" + | + */ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => App\Models\User::class, + 'model' => User::class, ], 'customers' => [ - 'driver' => 'eloquent', - 'model' => App\Models\Customers::class, - ] + 'driver' => CrmUserProvider::class, + 'model' => Customer::class, + ], ], /* - |-------------------------------------------------------------------------- - | Resetting Passwords - |-------------------------------------------------------------------------- - | - | You may specify multiple password reset configurations if you have more - | than one user table or model in the application and you want to have - | separate password reset settings based on the specific user types. - | - | The expire time is the number of minutes that the reset token should be - | considered valid. This security feature keeps tokens short-lived so - | they have less time to be guessed. You may change this as needed. - | - */ + |-------------------------------------------------------------------------- + | Resetting Passwords + |-------------------------------------------------------------------------- + | + | These configuration options specify the behavior of Laravel's password + | reset functionality, including the table utilized for token storage + | and the user provider that is invoked to actually retrieve users. + | + | The expiry time is the number of minutes that each reset token will be + | considered valid. This security feature keeps tokens short-lived so + | they have less time to be guessed. You may change this as needed. + | + | The throttle setting is the number of seconds a user must wait before + | generating more password reset tokens. This prevents the user from + | quickly generating a very large amount of password reset tokens. + | + */ 'passwords' => [ - 'users' => [ - 'provider' => 'users', - 'table' => 'password_resets', - 'expire' => 60, + 'customers' => [ + 'provider' => 'customers', + 'table' => 'customer_password_resets', + 'expire' => 60, 'throttle' => 60, ], ], /* - |-------------------------------------------------------------------------- - | Password Confirmation Timeout - |-------------------------------------------------------------------------- - | - | Here you may define the amount of seconds before a password confirmation - | times out and the user is prompted to re-enter their password via the - | confirmation screen. By default, the timeout lasts for three hours. - | - */ - + |-------------------------------------------------------------------------- + | Password Confirmation Timeout + |-------------------------------------------------------------------------- + | + | Here you may define the number of seconds before a password confirmation + | window expires and users are asked to re-enter their password via the + | confirmation screen. By default, the timeout lasts for three hours. + | + */ 'password_timeout' => 10800, + 'verification' => [ + // 60 minutes. + 'expire' => 60, + ], + 'reset' => [ + // 60 minutes. + 'expire' => 60, + ], + ]; diff --git a/config/breadcrumbs.php b/config/breadcrumbs.php index e29e0c73..b485a3ef 100644 --- a/config/breadcrumbs.php +++ b/config/breadcrumbs.php @@ -1,77 +1,81 @@ 'fo/modules/breadcrumb/breadcrumb-layout', - 'view' => 'breadcrumb.layout', + /** + * |-------------------------------------------------------------------------- + * | Breadcrumbs File(s) + * |-------------------------------------------------------------------------- + * | + * | The file(s) where breadcrumbs are defined. e.g. + * | + * | - base_path('routes/breadcrumbs.php') + * | - glob(base_path('breadcrumbs/*.php')) + * | + */ + 'files' => [ + base_path('routes/breadcrumbs-bo.php'), + base_path('routes/breadcrumbs-fo.php'), + ], - /* - |-------------------------------------------------------------------------- - | Breadcrumbs File(s) - |-------------------------------------------------------------------------- - | - | The file(s) where breadcrumbs are defined. e.g. - | - | - base_path('routes/breadcrumbs.php') - | - glob(base_path('breadcrumbs/*.php')) - | - */ + /** + * |-------------------------------------------------------------------------- + * | Exceptions + * |-------------------------------------------------------------------------- + * | + * | Determine when to throw an exception. + * | + */ - 'files' => base_path('routes/breadcrumbs.php'), - - /* - |-------------------------------------------------------------------------- - | Exceptions - |-------------------------------------------------------------------------- - | - | Determine when to throw an exception. - | - */ - - // When route-bound breadcrumbs are used but the current route doesn't have a name (UnnamedRouteException). + // * When route-bound breadcrumbs are used but the current route doesn't have a name (UnnamedRouteException) 'unnamed-route-exception' => true, - // When route-bound breadcrumbs are used and the matching breadcrumb doesn't exist (InvalidBreadcrumbException). + // * When route-bound breadcrumbs are used and the matching breadcrumb doesn't exist (InvalidBreadcrumbException) 'missing-route-bound-breadcrumb-exception' => true, - // When a named breadcrumb is used but doesn't exist (InvalidBreadcrumbException). + // * When a named breadcrumb is used but doesn't exist (InvalidBreadcrumbException) 'invalid-named-breadcrumb-exception' => true, - /* - |-------------------------------------------------------------------------- - | Classes - |-------------------------------------------------------------------------- - | - | Subclass the default classes for more advanced customisations. - | - */ + /** + * |-------------------------------------------------------------------------- + * | Classes + * |-------------------------------------------------------------------------- + * | + * | Subclass the default classes for more advanced customisations. + * | + */ - // Manager. - 'manager-class' => Diglactic\Breadcrumbs\Manager::class, + // * Manager + 'manager-class' => Manager::class, - // Generator. - 'generator-class' => Diglactic\Breadcrumbs\Generator::class, + // * Generator + 'generator-class' => Generator::class, ]; diff --git a/config/broadcasting.php b/config/broadcasting.php deleted file mode 100644 index 758e3917..00000000 --- a/config/broadcasting.php +++ /dev/null @@ -1,59 +0,0 @@ - env('BROADCAST_DRIVER', 'null'), - - /* - |-------------------------------------------------------------------------- - | Broadcast Connections - |-------------------------------------------------------------------------- - | - | Here you may define all of the broadcast connections that will be used - | to broadcast events to other systems or over websockets. Samples of - | each available type of connection are provided inside this array. - | - */ - - 'connections' => [ - - 'pusher' => [ - 'driver' => 'pusher', - 'key' => env('PUSHER_APP_KEY'), - 'secret' => env('PUSHER_APP_SECRET'), - 'app_id' => env('PUSHER_APP_ID'), - 'options' => [ - 'cluster' => env('PUSHER_APP_CLUSTER'), - 'useTLS' => true, - ], - ], - - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - ], - - 'log' => [ - 'driver' => 'log', - ], - - 'null' => [ - 'driver' => 'null', - ], - - ], - -]; diff --git a/config/cache.php b/config/cache.php deleted file mode 100644 index 0463e6c8..00000000 --- a/config/cache.php +++ /dev/null @@ -1,101 +0,0 @@ - env('CACHE_DRIVER', 'file'), - - /* - |-------------------------------------------------------------------------- - | Cache Stores - |-------------------------------------------------------------------------- - | - | Here you may define all of the cache "stores" for your application as - | well as their drivers. You may even define multiple stores for the - | same cache driver to group types of items stored in your caches. - | - */ - - 'stores' => [ - - 'apc' => [ - 'driver' => 'apc', - ], - - 'array' => [ - 'driver' => 'array', - 'serialize' => false, - ], - - 'database' => [ - 'driver' => 'database', - 'table' => 'cache', - 'connection' => null, - ], - - 'file' => [ - 'driver' => 'file', - 'path' => storage_path('framework/cache/data'), - ], - - 'memcached' => [ - 'driver' => 'memcached', - 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), - 'sasl' => [ - env('MEMCACHED_USERNAME'), - env('MEMCACHED_PASSWORD'), - ], - 'servers' => [ - [ - 'host' => env('MEMCACHED_HOST', '127.0.0.1'), - 'port' => env('MEMCACHED_PORT', 11211), - 'weight' => 100, - ], - ], - ], - - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'cache', - ], - - 'dynamodb' => [ - 'driver' => 'dynamodb', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), - 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), - 'endpoint' => env('DYNAMODB_ENDPOINT'), - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Cache Key Prefix - |-------------------------------------------------------------------------- - | - | When utilizing a RAM based store such as APC or Memcached, there might - | be other applications utilizing the same cache. So, we'll specify a - | value to get prefixed to all our keys so we can avoid collisions. - | - */ - - 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'), - -]; diff --git a/config/cart.php b/config/cart.php deleted file mode 100644 index cd3d78ce..00000000 --- a/config/cart.php +++ /dev/null @@ -1,79 +0,0 @@ - \App\Lib\LDC\CartCalculator::class, - - /* - |-------------------------------------------------------------------------- - | Default tax rate - |-------------------------------------------------------------------------- - | - | This default tax rate will be used when you make a class implement the - | Taxable interface and use the HasTax trait. - | - */ - - 'tax' => 20, - - /* - |-------------------------------------------------------------------------- - | Shoppingcart database settings - |-------------------------------------------------------------------------- - | - | Here you can set the connection that the shoppingcart should use when - | storing and restoring a cart. - | - */ - - 'database' => [ - - 'connection' => null, - - 'table' => 'shoppingcart', - - ], - - /* - |-------------------------------------------------------------------------- - | Destroy the cart on user logout - |-------------------------------------------------------------------------- - | - | When this option is set to 'true' the cart will automatically - | destroy all cart instances when the user logs out. - | - */ - - 'destroy_on_logout' => false, - - /* - |-------------------------------------------------------------------------- - | Default number format - |-------------------------------------------------------------------------- - | - | This defaults will be used for the formatted numbers if you don't - | set them in the method call. - | - */ - - 'format' => [ - - 'decimals' => 2, - - 'decimal_point' => '.', - - 'thousand_separator' => '', - - ], - -]; diff --git a/config/cors.php b/config/cors.php deleted file mode 100644 index caccf68b..00000000 --- a/config/cors.php +++ /dev/null @@ -1,34 +0,0 @@ - ['api/*'], - - 'allowed_methods' => ['*'], - - 'allowed_origins' => ['*'], - - 'allowed_origins_patterns' => [], - - 'allowed_headers' => ['*'], - - 'exposed_headers' => [], - - 'max_age' => 0, - - 'supports_credentials' => false, - -]; diff --git a/config/crm.php b/config/crm.php index ff4932f3..b1cbff17 100644 --- a/config/crm.php +++ b/config/crm.php @@ -1,7 +1,9 @@ env('CRM_ENDPOINT'), - 'token' => env('CRM_TOKEN'), - 'password' => env('CRM_PASSWORD') + 'token' => env('CRM_TOKEN'), + 'password' => env('CRM_PASSWORD'), ]; diff --git a/config/database.php b/config/database.php deleted file mode 100644 index 2dfee26f..00000000 --- a/config/database.php +++ /dev/null @@ -1,147 +0,0 @@ - env('DB_CONNECTION', 'mysql'), - - /* - |-------------------------------------------------------------------------- - | Database Connections - |-------------------------------------------------------------------------- - | - | Here are each of the database connections setup for your application. - | Of course, examples of configuring each database platform that is - | supported by Laravel is shown below to make development simple. - | - | - | All database work in Laravel is done through the PHP PDO facilities - | so make sure you have the driver for your particular database of - | choice installed on your machine before you begin development. - | - */ - - 'connections' => [ - - 'sqlite' => [ - 'driver' => 'sqlite', - 'url' => env('DATABASE_URL'), - 'database' => env('DB_DATABASE', database_path('database.sqlite')), - 'prefix' => '', - 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), - ], - - 'mysql' => [ - 'driver' => 'mysql', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'unix_socket' => env('DB_SOCKET', ''), - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', - 'prefix' => '', - 'prefix_indexes' => true, - 'strict' => true, - 'engine' => null, - 'options' => extension_loaded('pdo_mysql') ? array_filter([ - PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), - ]) : [], - ], - - 'pgsql' => [ - 'driver' => 'pgsql', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '5432'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'prefix_indexes' => true, - 'schema' => 'public', - 'sslmode' => 'prefer', - ], - - 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '1433'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'prefix_indexes' => true, - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Migration Repository Table - |-------------------------------------------------------------------------- - | - | This table keeps track of all the migrations that have already run for - | your application. Using this information, we can determine which of - | the migrations on disk haven't actually been run in the database. - | - */ - - 'migrations' => 'migrations', - - /* - |-------------------------------------------------------------------------- - | Redis Databases - |-------------------------------------------------------------------------- - | - | Redis is an open source, fast, and advanced key-value store that also - | provides a richer body of commands than a typical key-value system - | such as APC or Memcached. Laravel makes it easy to dig right in. - | - */ - - 'redis' => [ - - 'client' => env('REDIS_CLIENT', 'phpredis'), - - 'options' => [ - 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), - ], - - 'default' => [ - 'url' => env('REDIS_URL'), - 'host' => env('REDIS_HOST', '127.0.0.1'), - 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', '6379'), - 'database' => env('REDIS_DB', '0'), - ], - - 'cache' => [ - 'url' => env('REDIS_URL'), - 'host' => env('REDIS_HOST', '127.0.0.1'), - 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', '6379'), - 'database' => env('REDIS_CACHE_DB', '1'), - ], - - ], -]; diff --git a/config/filesystems.php b/config/filesystems.php index 11469cd6..a4956fe7 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -1,96 +1,98 @@ env('FILESYSTEM_DRIVER', 'local'), + 'default' => env('FILESYSTEM_DISK') ?: 'local', /* - |-------------------------------------------------------------------------- - | Default Cloud Filesystem Disk - |-------------------------------------------------------------------------- - | - | Many applications store files both locally and in the cloud. For this - | reason, you may specify a default "cloud" driver here. This driver - | will be bound as the Cloud disk implementation in the container. - | - */ - - 'cloud' => env('FILESYSTEM_CLOUD', 's3'), - - /* - |-------------------------------------------------------------------------- - | Filesystem Disks - |-------------------------------------------------------------------------- - | - | Here you may configure as many filesystem "disks" as you wish, and you - | may even configure multiple disks of the same driver. Defaults have - | been setup for each driver as an example of the required options. - | - | Supported Drivers: "local", "ftp", "sftp", "s3" - | - */ + |-------------------------------------------------------------------------- + | Filesystem Disks + |-------------------------------------------------------------------------- + | + | Below you may configure as many filesystem disks as necessary, and you + | may even configure multiple disks for the same driver. Examples for + | most supported storage drivers are configured here for reference. + | + | Supported drivers: "local", "ftp", "sftp", "s3" + | + */ 'disks' => [ - 'local' => [ - 'driver' => 'local', - 'root' => storage_path('app'), + 'public' => [ + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => rtrim((string) env('APP_URL', 'http://localhost'), '/') . '/storage', + 'visibility' => 'public', + 'throw' => false, + 'report' => false, ], - 'public' => [ - 'driver' => 'local', - 'root' => storage_path('app/public'), - 'url' => env('APP_URL') . '/storage', - 'visibility' => 'public', + 'private' => [ + 'driver' => 'local', + 'root' => storage_path('app/private'), + 'visibility' => 'private', + 'throw' => false, ], 's3' => [ - 'driver' => 's3', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION'), - 'bucket' => env('AWS_BUCKET'), - 'url' => env('AWS_URL'), - 'endpoint' => env('AWS_ENDPOINT'), + 'driver' => 's3', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_BUCKET'), + 'url' => env('AWS_URL'), + 'endpoint' => env('AWS_ENDPOINT'), + 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), + 'throw' => false, + 'report' => false, ], 'inco' => [ - 'driver' => 'local', - 'root' => storage_path('inco'), + 'driver' => 'local', + 'root' => storage_path('inco'), + 'visibility' => 'private', + 'throw' => true, ], - 'salaries' => [ - 'driver' => 'local', - 'root' => storage_path('salaries'), + 'employees' => [ + 'driver' => 'local', + 'root' => storage_path('salaries'), + 'visibility' => 'private', + 'throw' => true, ], 'regate' => [ - 'driver' => 'local', - 'root' => storage_path('orders/in'), + 'driver' => 'local', + 'root' => storage_path('orders/in'), + 'visibility' => 'private', + 'throw' => true, ], ], /* - |-------------------------------------------------------------------------- - | Symbolic Links - |-------------------------------------------------------------------------- - | - | Here you may configure the symbolic links that will be created when the - | `storage:link` Artisan command is executed. The array keys should be - | the locations of the links and the values should be their targets. - | - */ + |-------------------------------------------------------------------------- + | Symbolic Links + |-------------------------------------------------------------------------- + | + | Here you may configure the symbolic links that will be created when the + | `storage:link` Artisan command is executed. The array keys should be + | the locations of the links and the values should be their targets. + | + */ 'links' => [ public_path('storage') => storage_path('app/public'), diff --git a/config/hashing.php b/config/hashing.php deleted file mode 100644 index 6641c8cc..00000000 --- a/config/hashing.php +++ /dev/null @@ -1,52 +0,0 @@ - 'bcrypt', - - /* - |-------------------------------------------------------------------------- - | Bcrypt Options - |-------------------------------------------------------------------------- - | - | Here you may specify the configuration options that should be used when - | passwords are hashed using the Bcrypt algorithm. This will allow you - | to control the amount of time it takes to hash the given password. - | - */ - - 'bcrypt' => [ - 'rounds' => env('BCRYPT_ROUNDS', 10), - ], - - /* - |-------------------------------------------------------------------------- - | Argon Options - |-------------------------------------------------------------------------- - | - | Here you may specify the configuration options that should be used when - | passwords are hashed using the Argon algorithm. These will allow you - | to control the amount of time it takes to hash the given password. - | - */ - - 'argon' => [ - 'memory' => 1024, - 'threads' => 2, - 'time' => 2, - ], - -]; diff --git a/config/ide-helper.php b/config/ide-helper.php new file mode 100644 index 00000000..bb4d4eee --- /dev/null +++ b/config/ide-helper.php @@ -0,0 +1,382 @@ + '_ide_helper.php', + + /* + |-------------------------------------------------------------------------- + | Models filename + |-------------------------------------------------------------------------- + | + | The default filename for the models helper file. + | + */ + + 'models_filename' => '_ide_helper_models.php', + + /* + |-------------------------------------------------------------------------- + | PhpStorm meta filename + |-------------------------------------------------------------------------- + | + | PhpStorm also supports the directory `.phpstorm.meta.php/` with arbitrary + | files in it, should you need additional files for your project; e.g. + | `.phpstorm.meta.php/laravel_ide_Helper.php'. + | + */ + 'meta_filename' => '.phpstorm.meta.php', + + /* + |-------------------------------------------------------------------------- + | Fluent helpers + |-------------------------------------------------------------------------- + | + | Set to true to generate commonly used Fluent methods. + | + */ + + 'include_fluent' => false, + + /* + |-------------------------------------------------------------------------- + | Write model query methods + |-------------------------------------------------------------------------- + | + | Set to false to disable generated docs for the 'query()', 'newQuery()' and 'newModelQuery()' methods. + | + */ + + 'write_query_methods' => false, + + /* + |-------------------------------------------------------------------------- + | Write model magic methods + |-------------------------------------------------------------------------- + | + | Set to false to disable write magic methods of model. + | + */ + + 'write_model_magic_where' => false, + + /* + |-------------------------------------------------------------------------- + | Write model external Eloquent builder methods + |-------------------------------------------------------------------------- + | + | Set to false to disable write external Eloquent builder methods. + | + */ + + 'write_model_external_builder_methods' => false, + + /* + |-------------------------------------------------------------------------- + | Write model relation count and exists properties + |-------------------------------------------------------------------------- + | + | Set to false to disable writing of relation count and exists properties + | to model DocBlocks. + | + */ + + 'write_model_relation_count_properties' => false, + 'write_model_relation_exists_properties' => false, + + /* + |-------------------------------------------------------------------------- + | Write Eloquent model mixins + |-------------------------------------------------------------------------- + | + | This will add the necessary DocBlock mixins to the model class + | contained in the Laravel framework. This helps the IDE with + | auto-completion. + | + | Please be aware that this setting changes a file within the /vendor directory. + | + */ + + 'write_eloquent_model_mixins' => false, + + /* + |-------------------------------------------------------------------------- + | Helper files to include + |-------------------------------------------------------------------------- + | + | Include helper files. By default not included, but can be toggled with the + | -- helpers (-H) option. Extra helper files can be included. + | + */ + + 'include_helpers' => false, + + 'helper_files' => [ + base_path() . '/vendor/laravel/framework/src/Illuminate/Support/helpers.php', + base_path() . '/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php', + ], + + /* + |-------------------------------------------------------------------------- + | Model locations to include + |-------------------------------------------------------------------------- + | + | Define in which directories the ide-helper:models command should look + | for models. + | + | glob patterns are supported to easier reach models in sub-directories, + | e.g. `app/Services/* /Models` (without the space). + | + */ + + 'model_locations' => [ + 'app', + ], + + /* + |-------------------------------------------------------------------------- + | Models to ignore + |-------------------------------------------------------------------------- + | + | Define which models should be ignored. + | + */ + + 'ignored_models' => [ + ShopPickupExceptionPivot::class, + ], + + /* + |-------------------------------------------------------------------------- + | Models hooks + |-------------------------------------------------------------------------- + | + | Define which hook classes you want to run for models to add custom information. + | + | Hooks should implement Barryvdh\LaravelIdeHelper\Contracts\ModelHookInterface. + | + */ + + 'model_hooks' => [ + // App\Support\IdeHelper\MyModelHook::class + ], + + /* + |-------------------------------------------------------------------------- + | Extra classes + |-------------------------------------------------------------------------- + | + | These implementations are not really extended, but called with magic functions. + | + */ + + 'extra' => [ + 'Eloquent' => [Builder::class, \Illuminate\Database\Query\Builder::class], + 'Session' => [Store::class], + ], + + 'magic' => [], + + /* + |-------------------------------------------------------------------------- + | Interface implementations + |-------------------------------------------------------------------------- + | + | These interfaces will be replaced with the implementing class. Some interfaces + | are detected by the helpers, others can be listed below. + | + */ + + 'interfaces' => [ + // App\MyInterface::class => App\MyImplementation::class, + ], + + /* + |-------------------------------------------------------------------------- + | Support for camel cased models + |-------------------------------------------------------------------------- + | + | There are some Laravel packages (such as Eloquence) that allow for accessing + | Eloquent model properties via camel case, instead of snake case. + | + | Enabling this option will support these packages by saving all model + | properties as camel case, instead of snake case. + | + | For example, normally you would see this: + | + | * @property \Illuminate\Support\Carbon $created_at + | * @property \Illuminate\Support\Carbon $updated_at + | + | With this enabled, the properties will be this: + | + | * @property \Illuminate\Support\Carbon $createdAt + | * @property \Illuminate\Support\Carbon $updatedAt + | + | Note, it is currently an all-or-nothing option. + | + */ + 'model_camel_case_properties' => false, + + /* + |-------------------------------------------------------------------------- + | Property casts + |-------------------------------------------------------------------------- + | + | Cast the given "real type" to the given "type". + | + */ + 'type_overrides' => [ + 'integer' => 'int', + 'boolean' => 'bool', + ], + + /* + |-------------------------------------------------------------------------- + | Include DocBlocks from classes + |-------------------------------------------------------------------------- + | + | Include DocBlocks from classes to allow additional code inspection for + | magic methods and properties. + | + */ + 'include_class_docblocks' => false, + + /* + |-------------------------------------------------------------------------- + | Force FQN usage + |-------------------------------------------------------------------------- + | + | Use the fully qualified (class) name in DocBlocks, + | even if the class exists in the same namespace + | or there is an import (use className) of the class. + | + */ + 'force_fqn' => false, + + /* + |-------------------------------------------------------------------------- + | Use generics syntax + |-------------------------------------------------------------------------- + | + | Use generics syntax within DocBlocks, + | e.g. `Collection` instead of `Collection|User[]`. + | + */ + 'use_generics_annotations' => true, + + /* + |-------------------------------------------------------------------------- + | Default return types for macros + |-------------------------------------------------------------------------- + | + | Define default return types for macros without explicit return types. + | e.g. `\Illuminate\Database\Query\Builder::class => 'static'`, + | `\Illuminate\Support\Str::class => 'string'` + | + */ + 'macro_default_return_types' => [ + Factory::class => PendingRequest::class, + ], + + /* + |-------------------------------------------------------------------------- + | Additional relation types + |-------------------------------------------------------------------------- + | + | Sometimes it's needed to create custom relation types. The key of the array + | is the relationship method name. The value of the array is the fully-qualified + | class name of the relationship, e.g. `'relationName' => RelationShipClass::class`. + | + */ + 'additional_relation_types' => [], + + /* + |-------------------------------------------------------------------------- + | Additional relation return types + |-------------------------------------------------------------------------- + | + | When using custom relation types its possible for the class name to not contain + | the proper return type of the relation. The key of the array is the relationship + | method name. The value of the array is the return type of the relation ('many' + | or 'morphTo'). + | e.g. `'relationName' => 'many'`. + | + */ + 'additional_relation_return_types' => [], + + /* + |-------------------------------------------------------------------------- + | Enforce nullable Eloquent relationships on not null columns + |-------------------------------------------------------------------------- + | + | When set to true (default), this option enforces nullable Eloquent relationships. + | However, in cases where the application logic ensures the presence of related + | records it may be desirable to set this option to false to avoid unwanted null warnings. + | + | Default: true + | A not null column with no foreign key constraint will have a "nullable" relationship. + | * @property int $not_null_column_with_no_foreign_key_constraint + | * @property-read BelongsToVariation|null $notNullColumnWithNoForeignKeyConstraint + | + | Option: false + | A not null column with no foreign key constraint will have a "not nullable" relationship. + | * @property int $not_null_column_with_no_foreign_key_constraint + | * @property-read BelongsToVariation $notNullColumnWithNoForeignKeyConstraint + | + */ + + 'enforce_nullable_relationships' => true, + + /* + |-------------------------------------------------------------------------- + | Make soft deletable relations nullable + |-------------------------------------------------------------------------- + | + | When set to true (default), relationships to models using SoftDeletes trait + | will be marked as nullable. This is because soft-deleted records are excluded + | from queries by default, meaning even non-nullable foreign keys can return + | null when the related model is soft-deleted. + | + | Default: true + | A relationship to a soft-deletable model will include |null in the type: + | * @property-read Team|null $team + | + | Option: false + | A relationship to a soft-deletable model will NOT include |null (unless + | nullable for other reasons such as nullable foreign key column): + | * @property-read Team $team + | + */ + + 'soft_deletes_force_nullable' => true, + + /* + |-------------------------------------------------------------------------- + | Run artisan commands after migrations to generate model helpers + |-------------------------------------------------------------------------- + | + | The specified commands should run after migrations are finished running. + | + */ + 'post_migrate' => [ + // 'ide-helper:models --nowrite', + ], + +]; diff --git a/config/ldc.php b/config/ldc.php new file mode 100644 index 00000000..f61e682c --- /dev/null +++ b/config/ldc.php @@ -0,0 +1,7 @@ + env('LDC_HEADQUARTERS_PHONE_RECEPTION') ?: '02 43 62 70 00', +]; diff --git a/config/logging.php b/config/logging.php index b8c17735..1d47522d 100644 --- a/config/logging.php +++ b/config/logging.php @@ -1,111 +1,135 @@ env('LOG_CHANNEL', 'stack'), /* - |-------------------------------------------------------------------------- - | Log Channels - |-------------------------------------------------------------------------- - | - | Here you may configure the log channels for your application. Out of - | the box, Laravel uses the Monolog PHP logging library. This gives - | you a variety of powerful log handlers / formatters to utilize. - | - | Available Drivers: "single", "daily", "slack", "syslog", - | "errorlog", "monolog", - | "custom", "stack" - | - */ + |-------------------------------------------------------------------------- + | Deprecations Log Channel + |-------------------------------------------------------------------------- + | + | This option controls the log channel that should be used to log warnings + | regarding deprecated PHP and library features. This allows you to get + | your application ready for upcoming major versions of dependencies. + | + */ + + 'deprecations' => [ + 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), + 'trace' => env('LOG_DEPRECATIONS_TRACE', false), + ], + + /* + |-------------------------------------------------------------------------- + | Log Channels + |-------------------------------------------------------------------------- + | + | Here you may configure the log channels for your application. Laravel + | utilizes the Monolog PHP logging library, which includes a variety + | of powerful log handlers and formatters that you're free to use. + | + | Available drivers: "single", "daily", "monthly", "slack", "syslog", + | "errorlog", "monolog", "custom", "stack" + | + */ 'channels' => [ - 'stack' => [ - 'driver' => 'stack', - 'channels' => ['single'], - 'ignore_exceptions' => false, - ], - 'stackProd' => [ - 'driver' => 'stack', - 'channels' => ['dailyProd'], + 'stack' => [ + 'driver' => 'stack', + 'channels' => explode(',', (string) env('LOG_STACK', 'single')), 'ignore_exceptions' => false, ], 'single' => [ - 'driver' => 'single', - 'path' => storage_path('logs/laravel.log'), - 'level' => env('LOG_LEVEL', 'debug'), - ], - - 'dailyProd' => [ - 'driver' => 'daily', - 'path' => storage_path('logs/laravel.log'), - 'level' => 'notice', - 'days' => 60, + 'driver' => 'single', + 'path' => storage_path('logs/laravel.log'), + 'level' => env('LOG_LEVEL', 'debug'), + 'replace_placeholders' => true, ], 'daily' => [ - 'driver' => 'daily', - 'path' => storage_path('logs/laravel.log'), - 'level' => env('LOG_LEVEL', 'debug'), - 'days' => 14, + 'driver' => 'daily', + 'path' => storage_path('logs/laravel.log'), + 'level' => env('LOG_LEVEL', 'debug'), + 'max_files' => env('LOG_DAILY_DAYS', 14), + 'replace_placeholders' => true, + ], + + 'monthly' => [ + 'driver' => 'monthly', + 'path' => storage_path('logs/laravel.log'), + 'level' => env('LOG_LEVEL', 'debug'), + 'max_files' => 3, + 'replace_placeholders' => true, ], 'slack' => [ - 'driver' => 'slack', - 'url' => env('LOG_SLACK_WEBHOOK_URL'), - 'username' => 'Laravel Log', - 'emoji' => ':boom:', - 'level' => env('LOG_LEVEL', 'critical'), + 'driver' => 'slack', + 'url' => env('LOG_SLACK_WEBHOOK_URL'), + 'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'), + 'emoji' => env('LOG_SLACK_EMOJI', ':boom:'), + 'level' => env('LOG_LEVEL', 'critical'), + 'replace_placeholders' => true, ], 'papertrail' => [ - 'driver' => 'monolog', - 'level' => env('LOG_LEVEL', 'debug'), - 'handler' => SyslogUdpHandler::class, + 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), + 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), 'handler_with' => [ - 'host' => env('PAPERTRAIL_URL'), - 'port' => env('PAPERTRAIL_PORT'), + 'host' => env('PAPERTRAIL_URL'), + 'port' => env('PAPERTRAIL_PORT'), + 'connectionString' => 'tls://' . env('PAPERTRAIL_URL') . ':' . env('PAPERTRAIL_PORT'), ], + 'processors' => [PsrLogMessageProcessor::class], ], 'stderr' => [ - 'driver' => 'monolog', - 'handler' => StreamHandler::class, - 'formatter' => env('LOG_STDERR_FORMATTER'), - 'with' => [ + 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), + 'handler' => StreamHandler::class, + 'handler_with' => [ 'stream' => 'php://stderr', ], + 'formatter' => env('LOG_STDERR_FORMATTER'), + 'processors' => [PsrLogMessageProcessor::class], ], 'syslog' => [ - 'driver' => 'syslog', - 'level' => env('LOG_LEVEL', 'debug'), + 'driver' => 'syslog', + 'level' => env('LOG_LEVEL', 'debug'), + 'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER), + 'replace_placeholders' => true, ], 'errorlog' => [ - 'driver' => 'errorlog', - 'level' => env('LOG_LEVEL', 'debug'), + 'driver' => 'errorlog', + 'level' => env('LOG_LEVEL', 'debug'), + 'replace_placeholders' => true, ], 'null' => [ - 'driver' => 'monolog', + 'driver' => 'monolog', 'handler' => NullHandler::class, ], @@ -114,18 +138,18 @@ return [ ], 'stdout' => [ - 'driver' => 'monolog', - 'level' => env('LOG_LEVEL', 'debug'), - 'handler' => StreamHandler::class, + 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), + 'handler' => StreamHandler::class, 'formatter' => env('LOG_STDOUT_FORMATTER'), - 'with' => [ + 'with' => [ 'stream' => 'php://stdout', ], ], 'k8s' => [ - 'driver' => 'stack', - 'channels' => ['daily', 'stdout'], + 'driver' => 'stack', + 'channels' => ['daily', 'stdout'], 'ignore_exceptions' => false, ], diff --git a/config/mail.php b/config/mail.php index 1032a96b..93171f62 100644 --- a/config/mail.php +++ b/config/mail.php @@ -1,122 +1,122 @@ env('MAIL_MAILER', 'smtp'), + 'default' => env('MAIL_MAILER') ?: 'log', /* - |-------------------------------------------------------------------------- - | Mailer Configurations - |-------------------------------------------------------------------------- - | - | Here you may configure all of the mailers used by your application plus - | their respective settings. Several examples have been configured for - | you and you are free to add your own as your application requires. - | - | Laravel supports a variety of mail "transport" drivers to be used while - | sending an e-mail. You will specify which one you are using for your - | mailers below. You are free to add additional mailers as required. - | - | Supported: "smtp", "sendmail", "mailgun", "ses", - | "postmark", "log", "array" - | - */ + |-------------------------------------------------------------------------- + | Mailer Configurations + |-------------------------------------------------------------------------- + | + | Here you may configure all of the mailers used by your application plus + | their respective settings. Several examples have been configured for + | you and you are free to add your own as your application requires. + | + | Laravel supports a variety of mail "transport" drivers that can be used + | when delivering an email. You may specify which one you're using for + | your mailers below. You may also add additional mailers if needed. + | + | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2", + | "postmark", "resend", "log", "array", + | "failover", "roundrobin" + | + */ 'mailers' => [ 'smtp' => [ - 'transport' => 'smtp', - 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), - 'port' => env('MAIL_PORT', 587), - 'encryption' => env('MAIL_ENCRYPTION', 'tls'), - 'username' => env('MAIL_USERNAME'), - 'password' => env('MAIL_PASSWORD'), - 'timeout' => null, - 'auth_mode' => null, + 'transport' => 'smtp', + 'scheme' => env('MAIL_SCHEME'), + 'url' => env('MAIL_URL'), + 'host' => env('MAIL_HOST', '127.0.0.1'), + 'port' => env('MAIL_PORT', 2525), + 'username' => env('MAIL_USERNAME'), + 'password' => env('MAIL_PASSWORD'), + 'timeout' => null, + 'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url((string) env('APP_URL', 'http://localhost'), PHP_URL_HOST)), ], 'ses' => [ 'transport' => 'ses', ], - 'mailgun' => [ - 'transport' => 'mailgun', - ], - 'postmark' => [ 'transport' => 'postmark', + // 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'), + // 'client' => [ + // 'timeout' => 5, + // ], + ], + + 'resend' => [ + 'transport' => 'resend', ], 'sendmail' => [ 'transport' => 'sendmail', - 'path' => '/usr/sbin/sendmail -bs', + 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), ], 'log' => [ 'transport' => 'log', - 'channel' => env('MAIL_LOG_CHANNEL'), + 'channel' => env('MAIL_LOG_CHANNEL'), ], 'array' => [ 'transport' => 'array', ], - ], + 'failover' => [ + 'transport' => 'failover', + 'mailers' => [ + 'smtp', + 'log', + ], + 'retry_after' => 60, + ], - /* - |-------------------------------------------------------------------------- - | Global "From" Address - |-------------------------------------------------------------------------- - | - | You may wish for all e-mails sent by your application to be sent from - | the same address. Here, you may specify a name and address that is - | used globally for all e-mails that are sent by your application. - | - */ - - 'from' => [ - 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), - 'name' => env('MAIL_FROM_NAME', 'Example'), - ], - - 'to' => [ - 'regate' => env('MAIL_TO_REGATE', 'btqcnc.ldceai@ldc.fr'), - ], - - 'contactsList' => [ - 'serviceweb' => explode(",", env('MAIL_LIST_SERVICEWEB', 'digital@ldc.fr')), - 'invalidInco' => explode( - ",", - env('MAIL_LIST_INVALIDINCO', 'digital@ldc.fr,lise.de-wever@ldc.fr,christelle.manceau@ldc.fr') - ), - ], - - /* - |-------------------------------------------------------------------------- - | Markdown Mail Settings - |-------------------------------------------------------------------------- - | - | If you are using Markdown based email rendering, you may configure your - | theme and component paths here, allowing you to customize the design - | of the emails. Or, you may simply stick with the Laravel defaults! - | - */ - - 'markdown' => [ - 'theme' => 'default', - - 'paths' => [ - resource_path('views/vendor/mail'), + 'roundrobin' => [ + 'transport' => 'roundrobin', + 'mailers' => [ + 'ses', + 'postmark', + ], + 'retry_after' => 60, ], ], + /* + |-------------------------------------------------------------------------- + | Global "From" Address + |-------------------------------------------------------------------------- + | + | You may wish for all emails sent by your application to be sent from + | the same address. Here you may specify a name and address that is + | used globally for all emails that are sent by your application. + | + */ + + 'from' => [ + 'address' => env('MAIL_FROM_ADDRESS'), + 'name' => env('MAIL_FROM_NAME', env('APP_NAME', 'Laravel')), + ], + + 'to' => [ + 'contact' => env('MAIL_TO_CONTACT'), + 'regate' => env('MAIL_TO_REGATE'), + ], + ]; diff --git a/config/purifier.php b/config/purifier.php index efbd2367..19c70944 100644 --- a/config/purifier.php +++ b/config/purifier.php @@ -17,6 +17,8 @@ * @link http://htmlpurifier.org/live/configdoc/plain.html */ +declare(strict_types=1); + // phpcs:disable Generic.Files.LineLength.TooLong return [ 'encoding' => 'UTF-8', @@ -25,32 +27,36 @@ return [ 'cacheFileMode' => 0755, 'settings' => [ 'default' => [ - 'HTML.SafeIframe' => true, + 'HTML.SafeIframe' => true, // * For iframes - 'URI.SafeIframeRegexp' => "%^(http://|https://|//)(vimeo.com)%", - 'HTML.Doctype' => 'HTML 4.01 Transitional', - 'HTML.Allowed' => 'h1[style],h2[style],h3[style],h4[style],h5[style],h6[style],figure[class|style],oembed[url],div[style],b,strong,i,em,u,a[href|title|target|rel],ul[style],ol[style],dl[style],li,p[style],br,span[style|class],img[width|height|alt|src|style|class|title],iframe[src|width|height|class|frameborder|style],table[style|align|border|cellspacing|cellpadding|width],thead,tbody,th[colspan|align|valign|style],tr[align|valign|style],td[style|colspan|rowspan|scope|align|valign],hr,dl,dt,blockquote', - 'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align,list-style-type,float,width,height,vertical-align,border-color', - 'AutoFormat.AutoParagraph' => false, - 'AutoFormat.RemoveEmpty' => false, + 'URI.SafeIframeRegexp' => '%^(http://|https://|//)(www.youtube.com/embed/|player.vimeo.com/video/|vimeo.com/)%', + 'HTML.Doctype' => 'HTML 4.01 Transitional', + // * Legacy filter en full avec safe legacy. + // phpcs:ignore Generic.Files.LineLength.MaxExceeded + 'HTML.Allowed' => 'h1[style],h2[style],h3[style],h4[style],h5[style],h6[style],figure[class|style],oembed[url],div[style],b,strong,i,em,u,a[href|title|target|rel],ul[style],ol[style],dl[style],li,p[style],br,span[style|class],img[width|height|alt|src|style|class|title],iframe[src|width|height|class|frameborder|style],table[style|align|border|cellspacing|cellpadding|width],thead,tbody,th[colspan|align|valign|style],tr[align|valign|style],td[style|colspan|rowspan|scope|align|valign],hr,dl,dt', + // * Restricted basics. + // 'HTML.Allowed' => 'br,p[style],b[style],u[style],i[style],a[href|title|target|rel],strong[style],span[class],ul[style],ol[style],li[style],h2[style],h3[style],h4[style],hr,blockquote[style]', + // * Legacy filter en full avec safe legacy. + // phpcs:ignore Generic.Files.LineLength.MaxExceeded + 'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align,list-style-type,float,width,height,vertical-align,border-color', + // * Restricted basics. + // 'CSS.AllowedProperties' => 'text-align,margin-left', + 'AutoFormat.AutoParagraph' => false, + 'AutoFormat.RemoveEmpty' => false, 'AutoFormat.RemoveEmpty.RemoveNbsp' => false, ], - "youtube" => [ - "HTML.SafeIframe" => 'true', - "URI.SafeIframeRegexp" => "%^(http://|https://|//)(www.youtube.com/embed/|player.vimeo.com/video/|vimeo.com/)%", - ], 'custom_definition' => [ - 'id' => 'html5-definitions', - 'rev' => 1, - 'debug' => true, + 'id' => 'html5-definitions', + 'rev' => 1, + 'debug' => true, 'elements' => [ // * http://developers.whatwg.org/sections.html ['section', 'Block', 'Flow', 'Common'], - ['nav', 'Block', 'Flow', 'Common'], + ['nav', 'Block', 'Flow', 'Common'], ['article', 'Block', 'Flow', 'Common'], - ['aside', 'Block', 'Flow', 'Common'], - ['header', 'Block', 'Flow', 'Common'], - ['footer', 'Block', 'Flow', 'Common'], + ['aside', 'Block', 'Flow', 'Common'], + ['header', 'Block', 'Flow', 'Common'], + ['footer', 'Block', 'Flow', 'Common'], // * Content model actually excludes several tags, not modelled here ['address', 'Block', 'Flow', 'Common'], @@ -63,26 +69,26 @@ return [ // * http://developers.whatwg.org/the-video-element.html#the-video-element ['video', 'Block', 'Optional: (source, Flow) | (Flow, source) | Flow', 'Common', [ - 'src' => 'URI', - 'type' => 'Text', - 'width' => 'Length', - 'height' => 'Length', - 'poster' => 'URI', - 'preload' => 'Enum#auto,metadata,none', + 'src' => 'URI', + 'type' => 'Text', + 'width' => 'Length', + 'height' => 'Length', + 'poster' => 'URI', + 'preload' => 'Enum#auto,metadata,none', 'controls' => 'Bool', ]], ['source', 'Block', 'Flow', 'Common', [ - 'src' => 'URI', + 'src' => 'URI', 'type' => 'Text', ]], // * http://developers.whatwg.org/text-level-semantics.html - ['s', 'Inline', 'Inline', 'Common'], - ['var', 'Inline', 'Inline', 'Common'], - ['sub', 'Inline', 'Inline', 'Common'], - ['sup', 'Inline', 'Inline', 'Common'], + ['s', 'Inline', 'Inline', 'Common'], + ['var', 'Inline', 'Inline', 'Common'], + ['sub', 'Inline', 'Inline', 'Common'], + ['sup', 'Inline', 'Inline', 'Common'], ['mark', 'Inline', 'Inline', 'Common'], - ['wbr', 'Inline', 'Empty', 'Core'], + ['wbr', 'Inline', 'Empty', 'Core'], // * http://developers.whatwg.org/edits.html ['ins', 'Block', 'Flow', 'Common', ['cite' => 'URI', 'datetime' => 'CDATA']], diff --git a/config/queue.php b/config/queue.php deleted file mode 100644 index 08e1704e..00000000 --- a/config/queue.php +++ /dev/null @@ -1,89 +0,0 @@ - env('QUEUE_CONNECTION', 'sync'), - - /* - |-------------------------------------------------------------------------- - | Queue Connections - |-------------------------------------------------------------------------- - | - | Here you may configure the connection information for each server that - | is used by your application. A default configuration has been added - | for each back-end shipped with Laravel. You are free to add more. - | - | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" - | - */ - - 'connections' => [ - - 'sync' => [ - 'driver' => 'sync', - ], - - 'database' => [ - 'driver' => 'database', - 'table' => 'jobs', - 'queue' => 'default', - 'retry_after' => 90, - ], - - 'beanstalkd' => [ - 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', - 'retry_after' => 90, - 'block_for' => 0, - ], - - 'sqs' => [ - 'driver' => 'sqs', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), - 'queue' => env('SQS_QUEUE', 'your-queue-name'), - 'suffix' => env('SQS_SUFFIX'), - 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), - ], - - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - 'queue' => env('REDIS_QUEUE', 'default'), - 'retry_after' => 90, - 'block_for' => null, - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Failed Queue Jobs - |-------------------------------------------------------------------------- - | - | These options configure the behavior of failed queue job logging so you - | can control which database and table are used to store the jobs that - | have failed. You may change them to any database / table you wish. - | - */ - - 'failed' => [ - 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), - 'database' => env('DB_CONNECTION', 'mysql'), - 'table' => 'failed_jobs', - ], - -]; diff --git a/config/refresh-sitemap.php b/config/refresh-sitemap.php index 9cbbb310..4e97a901 100644 --- a/config/refresh-sitemap.php +++ b/config/refresh-sitemap.php @@ -1,6 +1,7 @@ [ - 'product' => [ - 'productSlug' => [Product::class, 'slug'] - ], - ], + 'routesBinder' => [], /** * You can put route conditions here @@ -69,7 +66,6 @@ return [ * 'ocbStatus' => EleveurOcbStatus::yes()->value, * 'star_moment' => true * ] - * */ 'queryConditions' => [], @@ -118,5 +114,5 @@ return [ * * Default is every day at 15:45 */ - 'cron' => '45 15 * * *' + 'cron' => '45 15 * * *', ]; diff --git a/config/sentry.php b/config/sentry.php index 29627fe9..4f95db20 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -1,5 +1,9 @@ env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')), @@ -55,7 +59,7 @@ return [ 'send_default_pii' => env('SENTRY_SEND_DEFAULT_PII', false), // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#traces-sample-rate. - 'traces_sample_rate' => env('SENTRY_TRACES_SAMPLE_RATE') === null ? null : (float)env('SENTRY_TRACES_SAMPLE_RATE'), + 'traces_sample_rate' => env('SENTRY_TRACES_SAMPLE_RATE') === null ? null : (float) env('SENTRY_TRACES_SAMPLE_RATE'), - 'before_send' => [\App\Lib\Helpers\ExceptionsHelper::class, 'sentryEventHandler'], + 'before_send' => [ExceptionsHelper::class, 'sentryEventHandler'], ]; diff --git a/config/serial-caster.php b/config/serial-caster.php new file mode 100644 index 00000000..e8d84204 --- /dev/null +++ b/config/serial-caster.php @@ -0,0 +1,9 @@ + (int) Env::get('SERIAL_CASTER_SEED'), +]; diff --git a/config/services.php b/config/services.php index f1d2c51a..cb8391fc 100644 --- a/config/services.php +++ b/config/services.php @@ -1,5 +1,7 @@ [ - 'domain' => env('MAILGUN_DOMAIN'), - 'secret' => env('MAILGUN_SECRET'), - 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), - ], + */ 'postmark' => [ 'token' => env('POSTMARK_TOKEN'), ], 'ses' => [ - 'key' => env('AWS_ACCESS_KEY_ID'), + 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], 'matomo' => [ - 'site_id' => env('MATOMO_SITE_ID') + 'site_id' => env('MATOMO_SITE_ID'), + ], + 'arcadia_api' => [ + 'endpoint' => env('ARCADIA_API_ENDPOINT'), + 'api_key' => env('ARCADIA_API_APIKEY'), + 'api_secret' => env('ARCADIA_API_SECRET'), + 'ignore_self_signed_cert' => (bool) env('ARCADIA_API_IGNORE_SELF_SIGNED_CERT', false), ], ]; diff --git a/config/session.php b/config/session.php index 13ef89b6..dcd58731 100644 --- a/config/session.php +++ b/config/session.php @@ -1,201 +1,191 @@ env('SESSION_DRIVER', 'file'), - - /* - |-------------------------------------------------------------------------- - | Session Lifetime - |-------------------------------------------------------------------------- - | - | Here you may specify the number of minutes that you wish the session - | to be allowed to remain idle before it expires. If you want them - | to immediately expire on the browser closing, set that option. - | - */ + /** + * |-------------------------------------------------------------------------- + * | Default Session Driver + * |-------------------------------------------------------------------------- + * | + * | This option controls the default session "driver" that will be used on + * | requests. By default, we will use the lightweight native driver but + * | you may specify any of the other wonderful drivers provided here. + * | + * | Supported: "file", "cookie", "database", "apc", + * | "memcached", "redis", "dynamodb", "array" + * | + */ + 'driver' => env('SESSION_DRIVER') ?: 'file', + /** + * |-------------------------------------------------------------------------- + * | Session Lifetime + * |-------------------------------------------------------------------------- + * | + * | Here you may specify the number of minutes that you wish the session + * | to be allowed to remain idle before it expires. If you want them + * | to immediately expire on the browser closing, set that option. + * | + */ 'lifetime' => env('SESSION_LIFETIME', 120), 'expire_on_close' => false, - /* - |-------------------------------------------------------------------------- - | Session Encryption - |-------------------------------------------------------------------------- - | - | This option allows you to easily specify that all of your session data - | should be encrypted before it is stored. All encryption will be run - | automatically by Laravel and you can use the Session like normal. - | - */ - + /** + * |-------------------------------------------------------------------------- + * | Session Encryption + * |-------------------------------------------------------------------------- + * | + * | This option allows you to easily specify that all of your session data + * | should be encrypted before it is stored. All encryption will be run + * | automatically by Laravel and you can use the Session like normal. + * | + */ 'encrypt' => false, - /* - |-------------------------------------------------------------------------- - | Session File Location - |-------------------------------------------------------------------------- - | - | When using the native session driver, we need a location where session - | files may be stored. A default has been set for you but a different - | location may be specified. This is only needed for file sessions. - | - */ - + /** + * |-------------------------------------------------------------------------- + * | Session File Location + * |-------------------------------------------------------------------------- + * | + * | When using the native session driver, we need a location where session + * | files may be stored. A default has been set for you but a different + * | location may be specified. This is only needed for file sessions. + * | + */ 'files' => storage_path('framework/sessions'), - /* - |-------------------------------------------------------------------------- - | Session Database Connection - |-------------------------------------------------------------------------- - | - | When using the "database" or "redis" session drivers, you may specify a - | connection that should be used to manage these sessions. This should - | correspond to a connection in your database configuration options. - | - */ + /** + * |-------------------------------------------------------------------------- + * | Session Database Connection + * |-------------------------------------------------------------------------- + * | + * | When using the "database" or "redis" session drivers, you may specify a + * | connection that should be used to manage these sessions. This should + * | correspond to a connection in your database configuration options. + * | + */ + 'connection' => env('SESSION_CONNECTION'), - 'connection' => env('SESSION_CONNECTION', null), - - /* - |-------------------------------------------------------------------------- - | Session Database Table - |-------------------------------------------------------------------------- - | - | When using the "database" session driver, you may specify the table we - | should use to manage the sessions. Of course, a sensible default is - | provided for you; however, you are free to change this as needed. - | - */ + 'prefix' => env('SESSION_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_session'), + /** + * |-------------------------------------------------------------------------- + * | Session Database Table + * |-------------------------------------------------------------------------- + * | + * | When using the "database" session driver, you may specify the table we + * | should use to manage the sessions. Of course, a sensible default is + * | provided for you; however, you are free to change this as needed. + * | + */ 'table' => 'sessions', - /* - |-------------------------------------------------------------------------- - | Session Cache Store - |-------------------------------------------------------------------------- - | - | While using one of the framework's cache driven session backends you may - | list a cache store that should be used for these sessions. This value - | must match with one of the application's configured cache "stores". - | - | Affects: "apc", "dynamodb", "memcached", "redis" - | - */ - - 'store' => env('SESSION_STORE', null), - - /* - |-------------------------------------------------------------------------- - | Session Sweeping Lottery - |-------------------------------------------------------------------------- - | - | Some session drivers must manually sweep their storage location to get - | rid of old sessions from storage. Here are the chances that it will - | happen on a given request. By default, the odds are 2 out of 100. - | - */ + /** + * |-------------------------------------------------------------------------- + * | Session Cache Store + * |-------------------------------------------------------------------------- + * | + * | While using one of the framework's cache driven session backends you may + * | list a cache store that should be used for these sessions. This value + * | must match with one of the application's configured cache "stores". + * | + * | Affects: "apc", "dynamodb", "memcached", "redis" + * | + */ + 'store' => env('SESSION_STORE'), + /** + * |-------------------------------------------------------------------------- + * | Session Sweeping Lottery + * |-------------------------------------------------------------------------- + * | + * | Some session drivers must manually sweep their storage location to get + * | rid of old sessions from storage. Here are the chances that it will + * | happen on a given request. By default, the odds are 2 out of 100. + * | + */ 'lottery' => [2, 100], - /* - |-------------------------------------------------------------------------- - | Session Cookie Name - |-------------------------------------------------------------------------- - | - | Here you may change the name of the cookie used to identify a session - | instance by ID. The name specified here will get used every time a - | new session cookie is created by the framework for every driver. - | - */ - + /** + * |-------------------------------------------------------------------------- + * | Session Cookie Name + * |-------------------------------------------------------------------------- + * | + * | Here you may change the name of the cookie used to identify a session + * | instance by ID. The name specified here will get used every time a + * | new session cookie is created by the framework for every driver. + * | + */ 'cookie' => env( 'SESSION_COOKIE', Str::slug(env('APP_NAME', 'laravel'), '_') . '_session' ), - /* - |-------------------------------------------------------------------------- - | Session Cookie Path - |-------------------------------------------------------------------------- - | - | The session cookie path determines the path for which the cookie will - | be regarded as available. Typically, this will be the root path of - | your application but you are free to change this when necessary. - | - */ - + /** + * |-------------------------------------------------------------------------- + * | Session Cookie Path + * |-------------------------------------------------------------------------- + * | + * | The session cookie path determines the path for which the cookie will + * | be regarded as available. Typically, this will be the root path of + * | your application but you are free to change this when necessary. + * | + */ 'path' => '/', - /* - |-------------------------------------------------------------------------- - | Session Cookie Domain - |-------------------------------------------------------------------------- - | - | Here you may change the domain of the cookie used to identify a session - | in your application. This will determine which domains the cookie is - | available to in your application. A sensible default has been set. - | - */ - - 'domain' => env('SESSION_DOMAIN', null), - - /* - |-------------------------------------------------------------------------- - | HTTPS Only Cookies - |-------------------------------------------------------------------------- - | - | By setting this option to true, session cookies will only be sent back - | to the server if the browser has a HTTPS connection. This will keep - | the cookie from being sent to you if it can not be done securely. - | - */ + /** + * |-------------------------------------------------------------------------- + * | Session Cookie Domain + * |-------------------------------------------------------------------------- + * | + * | Here you may change the domain of the cookie used to identify a session + * | in your application. This will determine which domains the cookie is + * | available to in your application. A sensible default has been set. + * | + */ + 'domain' => env('SESSION_DOMAIN'), + /** + * |-------------------------------------------------------------------------- + * | HTTPS Only Cookies + * |-------------------------------------------------------------------------- + * | + * | By setting this option to true, session cookies will only be sent back + * | to the server if the browser has a HTTPS connection. This will keep + * | the cookie from being sent to you when it can't be done securely. + * | + */ 'secure' => env('SESSION_SECURE_COOKIE'), - /* - |-------------------------------------------------------------------------- - | HTTP Access Only - |-------------------------------------------------------------------------- - | - | Setting this value to true will prevent JavaScript from accessing the - | value of the cookie and the cookie will only be accessible through - | the HTTP protocol. You are free to modify this option if needed. - | - */ - + /** + * |-------------------------------------------------------------------------- + * | HTTP Access Only + * |-------------------------------------------------------------------------- + * | + * | Setting this value to true will prevent JavaScript from accessing the + * | value of the cookie and the cookie will only be accessible through + * | the HTTP protocol. You are free to modify this option if needed. + * | + */ 'http_only' => true, - /* - |-------------------------------------------------------------------------- - | Same-Site Cookies - |-------------------------------------------------------------------------- - | - | This option determines how your cookies behave when cross-site requests - | take place, and can be used to mitigate CSRF attacks. By default, we - | will set this value to "lax" since this is a secure default value. - | - | Supported: "lax", "strict", "none", null - | - */ - + /** + * |-------------------------------------------------------------------------- + * | Same-Site Cookies + * |-------------------------------------------------------------------------- + * | + * | This option determines how your cookies behave when cross-site requests + * | take place, and can be used to mitigate CSRF attacks. By default, we + * | will set this value to "lax" since this is a secure default value. + * | + * | Supported: "lax", "strict", "none", null + * | + */ 'same_site' => 'lax', ]; diff --git a/config/theme.php b/config/theme.php deleted file mode 100644 index f0a467be..00000000 --- a/config/theme.php +++ /dev/null @@ -1,3 +0,0 @@ - [ - resource_path('views/front/' . config('app.theme')), resource_path('views'), + // ! for vendor publish (mail notifications par ex) + resource_path('views/vendor'), ], /* @@ -27,7 +30,7 @@ return [ | stored for your application. Typically, this is within the storage | directory. However, as usual, you are free to change this value. | - */ + */ 'compiled' => env( 'VIEW_COMPILED_PATH', diff --git a/database/factories/PickupExceptionFactory.php b/database/factories/PickupExceptionFactory.php new file mode 100644 index 00000000..e28f9969 --- /dev/null +++ b/database/factories/PickupExceptionFactory.php @@ -0,0 +1,40 @@ + + */ +class PickupExceptionFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = PickupException::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'id' => (string) Uuid::uuid7(), + 'date' => fake()->date(), + 'label' => fake()->streetAddress(), + 'repeatable' => fake()->boolean(), + 'auto_updated' => false, + 'repeat_frequency' => fake()->randomElement(RepeatFrequency::cases()), + ]; + } +} diff --git a/database/factories/ShopFactory.php b/database/factories/ShopFactory.php new file mode 100644 index 00000000..48e6c0b6 --- /dev/null +++ b/database/factories/ShopFactory.php @@ -0,0 +1,44 @@ + + */ +class ShopFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Shop::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'id' => (string) Uuid::uuid7(), + 'name' => fake()->company(), + 'address' => fake()->streetAddress(), + 'postcode' => fake()->postcode(), + 'city' => fake()->city(), + 'phone' => fake()->phoneNumber(), + + 'latitude' => (string) fake()->latitude(), + 'longitude' => (string) fake()->longitude(), + + 'default' => false, + ]; + } +} diff --git a/database/factories/SlideFactory.php b/database/factories/SlideFactory.php new file mode 100644 index 00000000..a42b0cd6 --- /dev/null +++ b/database/factories/SlideFactory.php @@ -0,0 +1,48 @@ + + */ +class SlideFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Slide::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + $date_start = fake()->dateTimeBetween('-1 month', 'now'); + $date_end = $date_start->add(DateInterval::createFromDateString('2days')); + + return [ + 'title' => fake()->sentence(4), + 'text' => fake()->paragraph(), + 'link' => fake()->url(), + 'link_label' => fake()->words(2, true), + 'link_new_tab' => fake()->boolean(), + 'connected' => fake()->boolean(20), + 'picture' => fake()->imageUrl(1920, 1080, 'nature'), + 'picture_alt' => fake()->sentence(3), + 'picture_title' => fake()->sentence(3), + 'status' => true, + 'date_start' => $date_start, + 'date_end' => $date_end, + ]; + } +} diff --git a/database/factories/TagFactory.php b/database/factories/TagFactory.php new file mode 100644 index 00000000..b7762d16 --- /dev/null +++ b/database/factories/TagFactory.php @@ -0,0 +1,34 @@ + + */ +class TagFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Tag::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'label' => fake()->unique()->word . ' ' . fake()->unique()->word, + 'status' => true, + ]; + } +} diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 72b85123..4a85ef67 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -1,11 +1,17 @@ + */ class UserFactory extends Factory { /** @@ -23,12 +29,13 @@ class UserFactory extends Factory public function definition() { return [ - 'name' => $this->faker->name, - 'email' => $this->faker->unique()->safeEmail, - 'email_verified_at' => now(), - 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', - // Password is password . - 'remember_token' => Str::random(10), + 'firstname' => fake()->firstName(), + 'lastname' => fake()->lastName(), + 'email' => fake()->unique()->safeEmail, + 'email_verified_at' => now(), + 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', + 'role' => fake()->randomElement(UserRole::cases()), + 'remember_token' => Str::random(10), ]; } } diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index dfd1a40d..5ae30430 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -1,5 +1,7 @@ string('identifier'); $table->string('instance'); $table->longText('content'); @@ -30,6 +32,6 @@ class CreateShoppingcartTable extends Migration */ public function down() { - Schema::drop(config('cart.database.table')); + Schema::drop('shoppingcart'); } } diff --git a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php index 6aa6d743..cb397212 100644 --- a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php +++ b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php @@ -1,5 +1,7 @@ string('picture_large')->nullable()->after('picture'); $table->string('sell_unit')->nullable()->after('stock'); // Lier à une liste de valeurs. - $table->unsignedFloat('weight')->nullable()->after('sell_unit'); + $table->float('weight')->unsigned()->nullable()->after('sell_unit'); $table->string('weight_unit')->nullable()->after('weight'); // Lier à une liste de valeurs. - $table->string('product_type')->default('foodProduct')->after('id'); + $table->string('product_type')->default('inco')->after('id'); // Lier à une liste de valeurs. // Mise en avant. $table->boolean('star')->default(0)->after('slug'); diff --git a/database/migrations/2021_03_16_135155_create_food_products.php b/database/migrations/2021_03_16_135155_create_food_products.php index 6ba7e9c0..002ddcde 100644 --- a/database/migrations/2021_03_16_135155_create_food_products.php +++ b/database/migrations/2021_03_16_135155_create_food_products.php @@ -1,5 +1,7 @@ text('allergens')->nullable(); $table->text('selling_argument')->nullable(); - // Valeurs nutritionnelles ref. - $table->unsignedFloat('nv_ref_weight_g')->nullable(); + $table->float('nv_ref_weight_g')->unsigned()->nullable(); // Taille de la référence en grammes. - $table->unsignedFloat('nv_kj')->nullable(); + $table->float('nv_kj')->unsigned()->nullable(); // Energie Kj. - $table->unsignedFloat('nv_kcal')->nullable(); + $table->float('nv_kcal')->unsigned()->nullable(); // Energie Kcal. - $table->unsignedFloat('nv_fat_g')->nullable(); + $table->float('nv_fat_g')->unsigned()->nullable(); // Graisses. - $table->unsignedFloat('nv_sat_fat_g')->nullable(); + $table->float('nv_sat_fat_g')->unsigned()->nullable(); // Dont acides gras saturés. - $table->unsignedFloat('nv_carb_g')->nullable(); + $table->float('nv_carb_g')->unsigned()->nullable(); // Glucides. - $table->unsignedFloat('nv_sugar_g')->nullable(); + $table->float('nv_sugar_g')->unsigned()->nullable(); // Dont sucres. - $table->unsignedFloat('nv_fiber_g')->nullable(); + $table->float('nv_fiber_g')->unsigned()->nullable(); // Fibres alimentaires. - $table->unsignedFloat('nv_protein_g')->nullable(); + $table->float('nv_protein_g')->unsigned()->nullable(); // Protéines. - $table->unsignedFloat('nv_salt_g')->nullable(); + $table->float('nv_salt_g')->unsigned()->nullable(); // Sel. // Valeurs nutritionnelles par portion. - $table->unsignedFloat('nv_serving_size_g')->nullable(); + $table->float('nv_serving_size_g')->unsigned()->nullable(); // Taille portion en grammes. - $table->unsignedFloat('nv_serving_kj')->nullable(); + $table->float('nv_serving_kj')->unsigned()->nullable(); // Energie Kj. - $table->unsignedFloat('nv_serving_kcal')->nullable(); + $table->float('nv_serving_kcal')->unsigned()->nullable(); // Energie Kcal. - $table->unsignedFloat('nv_serving_fat_g')->nullable(); + $table->float('nv_serving_fat_g')->unsigned()->nullable(); // Graisses. - $table->unsignedFloat('nv_serving_sat_fat_g')->nullable(); + $table->float('nv_serving_sat_fat_g')->unsigned()->nullable(); // Dont acides gras saturés. - $table->unsignedFloat('nv_serving_carb_g')->nullable(); + $table->float('nv_serving_carb_g')->unsigned()->nullable(); // Glucides. - $table->unsignedFloat('nv_serving_sugar_g')->nullable(); + $table->float('nv_serving_sugar_g')->unsigned()->nullable(); // Dont sucres. - $table->unsignedFloat('nv_serving_fiber_g')->nullable(); + $table->float('nv_serving_fiber_g')->unsigned()->nullable(); // Fibres alimentaires. - $table->unsignedFloat('nv_serving_protein_g')->nullable(); + $table->float('nv_serving_protein_g')->unsigned()->nullable(); // Protéines. - $table->unsignedFloat('nv_serving_salt_g')->nullable(); + $table->float('nv_serving_salt_g')->unsigned()->nullable(); // Sel. // Apports journaliers. - $table->unsignedFloat('nv_daily_energy')->nullable(); + $table->float('nv_daily_energy')->unsigned()->nullable(); // Energie % recommandé. - $table->unsignedFloat('nv_daily_fat')->nullable(); + $table->float('nv_daily_fat')->unsigned()->nullable(); // Graisses. - $table->unsignedFloat('nv_daily_sat_fat')->nullable(); + $table->float('nv_daily_sat_fat')->unsigned()->nullable(); // Dont acides gras saturés. - $table->unsignedFloat('nv_daily_carb')->nullable(); + $table->float('nv_daily_carb')->unsigned()->nullable(); // Glucides. - $table->unsignedFloat('nv_daily_sugar')->nullable(); + $table->float('nv_daily_sugar')->unsigned()->nullable(); // Dont sucres. - $table->unsignedFloat('nv_daily_fiber')->nullable(); + $table->float('nv_daily_fiber')->unsigned()->nullable(); // Fibres alimentaires. - $table->unsignedFloat('nv_daily_protein')->nullable(); + $table->float('nv_daily_protein')->unsigned()->nullable(); // Protéines. - $table->unsignedFloat('nv_daily_salt')->nullable(); + $table->float('nv_daily_salt')->unsigned()->nullable(); // Sel. // Nutriscore. $table->string('nutriscore')->nullable(); diff --git a/database/migrations/2021_03_16_140753_create_products_products.php b/database/migrations/2021_03_16_140753_create_products_products.php index 0866d7cb..8d9c5a65 100644 --- a/database/migrations/2021_03_16_140753_create_products_products.php +++ b/database/migrations/2021_03_16_140753_create_products_products.php @@ -1,5 +1,7 @@ id(); $table->string('label'); }); - - $seeder = new DiscountTypesSeeder(); - $seeder->run(); } /** diff --git a/database/migrations/2021_04_06_154003_create_promotions_table.php b/database/migrations/2021_04_06_154003_create_promotions_table.php index 08209225..424a211b 100644 --- a/database/migrations/2021_04_06_154003_create_promotions_table.php +++ b/database/migrations/2021_04_06_154003_create_promotions_table.php @@ -1,5 +1,7 @@ string('label'); $table->float('rate'); }); - - $seeder = new TaxRatesSeeder(); - $seeder->run(); } /** diff --git a/database/migrations/2021_04_07_154718_add_fields_to_products_table.php b/database/migrations/2021_04_07_154718_add_fields_to_products_table.php index e7d4d081..aeb4cc01 100644 --- a/database/migrations/2021_04_07_154718_add_fields_to_products_table.php +++ b/database/migrations/2021_04_07_154718_add_fields_to_products_table.php @@ -1,5 +1,7 @@ string('slug'); $table->collation = 'utf8mb4_unicode_ci'; }); - - $seeder = new TagsSeeder(); - $seeder->run(); } /** diff --git a/database/migrations/2021_04_09_081345_create_product_tag_table.php b/database/migrations/2021_04_09_081345_create_product_tag_table.php index 878484eb..befb6d2d 100644 --- a/database/migrations/2021_04_09_081345_create_product_tag_table.php +++ b/database/migrations/2021_04_09_081345_create_product_tag_table.php @@ -1,5 +1,7 @@ string('commentaire')->nullable(); $table->timestamps(); }); - - $seeder = new SlidersSeeder(); - $seeder->run(); } /** diff --git a/database/migrations/2021_04_14_115954_create_slides_table.php b/database/migrations/2021_04_14_115954_create_slides_table.php index f3a71115..e3b30743 100644 --- a/database/migrations/2021_04_14_115954_create_slides_table.php +++ b/database/migrations/2021_04_14_115954_create_slides_table.php @@ -1,5 +1,7 @@ id(); - $table->enum('day_index', [0,1,2,3,4,5,6])->nullable()->unique(); + $table->enum('day_index', [0, 1, 2, 3, 4, 5, 6])->nullable()->unique(); $table->string('morning_start')->nullable(); $table->string('morning_end')->nullable(); $table->string('afternoon_start')->nullable(); @@ -28,9 +29,6 @@ class CreateTimeslotSettingsTable extends Migration $table->timestamps(); }); - - $seeder = new TimeslotSettingsSeeder(); - $seeder->run(); } /** diff --git a/database/migrations/2021_04_21_092030_create_jobs_table.php b/database/migrations/2021_04_21_092030_create_jobs_table.php index 1be9e8a8..b5f2b233 100644 --- a/database/migrations/2021_04_21_092030_create_jobs_table.php +++ b/database/migrations/2021_04_21_092030_create_jobs_table.php @@ -1,5 +1,7 @@ text('gmaps_embed_href')->nullable(); $table->timestamps(); }); - - $seeder = new MagasinsSeeder(); - $seeder->run(); } /** diff --git a/database/migrations/2021_04_22_153147_make_child_of_magasins_time_settings_table.php b/database/migrations/2021_04_22_153147_make_child_of_magasins_time_settings_table.php index 5dcfe915..f5d4831e 100644 --- a/database/migrations/2021_04_22_153147_make_child_of_magasins_time_settings_table.php +++ b/database/migrations/2021_04_22_153147_make_child_of_magasins_time_settings_table.php @@ -1,5 +1,7 @@ dropUnique('timeslot_settings_day_index_unique'); $table->foreignId('magasin_id')->after('id')->default(1)->constrained('magasins'); - $table->unique(array('magasin_id', 'day_index')); + $table->unique(['magasin_id', 'day_index']); }); Schema::table('timeslot_settings', function (Blueprint $table) { diff --git a/database/migrations/2021_04_23_112008_add_magasin_to_timeslots_table.php b/database/migrations/2021_04_23_112008_add_magasin_to_timeslots_table.php index 5fca4fdd..fd9dcc8a 100644 --- a/database/migrations/2021_04_23_112008_add_magasin_to_timeslots_table.php +++ b/database/migrations/2021_04_23_112008_add_magasin_to_timeslots_table.php @@ -1,5 +1,7 @@ unique('no_art'); - }); + Schema::table('food_products', function (Blueprint $table) { + $table->unique('no_art'); + }); } /** @@ -25,7 +27,7 @@ class MakeUniqueNoArtInfFoodProductsTable extends Migration */ public function down() { - Schema::table('food_products', function (Blueprint $table) { - }); + Schema::table('food_products', function (Blueprint $table) { + }); } } diff --git a/database/migrations/2021_05_03_173156_alter_products_table.php b/database/migrations/2021_05_03_173156_alter_products_table.php index 8a2de7eb..822b5ce3 100644 --- a/database/migrations/2021_05_03_173156_alter_products_table.php +++ b/database/migrations/2021_05_03_173156_alter_products_table.php @@ -1,5 +1,7 @@ string('product_type')->default('foodProduct')->change(); + $table->string('product_type')->default('inco')->change(); $table->string('product_type')->nullable(false)->change(); }); } diff --git a/database/migrations/2021_05_06_121330_create_tool_products_table.php b/database/migrations/2021_05_06_121330_create_tool_products_table.php index f5f8a9bf..ef45ac44 100644 --- a/database/migrations/2021_05_06_121330_create_tool_products_table.php +++ b/database/migrations/2021_05_06_121330_create_tool_products_table.php @@ -1,5 +1,7 @@ date('date')->default('1999-01-01')->after('magasin_id'); }); - foreach (Timeslot::all() as $timeslot) { + foreach (DB::table('timeslots')->get() as $timeslot) { // L'ancienne date est castée au format m/d/Y, une date FR comme le 30/06/2023 sera donc buguée. // On récupère l'ancienne date non castée et on en crée une date valide. - $timeslot->date = Carbon::createFromFormat('d/m/Y', $timeslot->getRawOriginal('day')); - $timeslot->save(); + $date = Carbon::createFromFormat('d/m/Y', $timeslot->day); + DB::table('timeslots')->where('id', $timeslot->id)->update(['date' => $date]); } Schema::table('timeslots', function (Blueprint $table) { $table->dropColumn('day'); @@ -44,9 +46,9 @@ class FormatDayInTimeslotsTable extends Migration Schema::table('timeslots', function (Blueprint $table) { $table->string('date')->after('magasin_id'); }); - foreach (Timeslot::all() as $timeslot) { - $timeslot->date = Carbon::create($timeslot->day)->format('d/m/Y'); - $timeslot->save(); + foreach (DB::table('timeslots')->get() as $timeslot) { + $dateStr = Carbon::create($timeslot->day)->format('d/m/Y'); + DB::table('timeslots')->where('id', $timeslot->id)->update(['date' => $dateStr]); } Schema::table('timeslots', function (Blueprint $table) { $table->dropColumn('day'); diff --git a/database/migrations/2023_07_26_091913_add_order_products_table.php b/database/migrations/2023_07_26_091913_add_order_products_table.php index 0c5524ab..54fba6c5 100644 --- a/database/migrations/2023_07_26_091913_add_order_products_table.php +++ b/database/migrations/2023_07_26_091913_add_order_products_table.php @@ -1,5 +1,7 @@ string('nom')->nullable(false)->change(); $table->string('prenom')->nullable(false)->change(); $table->string('code', 10)->nullable(false)->change(); - // FIXME : Pourquoi ca passe pas avec eloquent ???? DB::statement( 'ALTER TABLE `salaries` CHANGE COLUMN `magasin_id` `magasin_id` BIGINT(20) UNSIGNED NOT NULL AFTER `service`;' ); @@ -40,7 +41,6 @@ class AlterCleanSalariesTable extends Migration $table->string('nom')->nullable()->change(); $table->string('prenom')->nullable()->change(); $table->string('code', 50)->nullable()->change(); - // FIXME : Pourquoi ca passe pas avec eloquent ???? DB::statement( 'ALTER TABLE `salaries` CHANGE COLUMN `magasin_id` `magasin_id` BIGINT(20) UNSIGNED NULL AFTER `service`;' ); diff --git a/database/migrations/2025_02_10_112337_add_type_to_exceptions_table.php b/database/migrations/2025_02_10_112337_add_type_to_exceptions_table.php index e78743a2..6d40b5da 100644 --- a/database/migrations/2025_02_10_112337_add_type_to_exceptions_table.php +++ b/database/migrations/2025_02_10_112337_add_type_to_exceptions_table.php @@ -1,10 +1,11 @@ label; - $other = ExceptionDayType::other()->label; - Schema::table('collecte_exceptions', function (Blueprint $table) { $table->string('type') - ->default(ExceptionDayType::ferie()->label) + ->default('Jour férié') ->after('comment') ->comment('Type of exception day.'); }); - - DB::table('collecte_exceptions') ->where('comment', 'Jour férié') - ->update(['type' => $ferie]); + ->update(['type' => 'Jour férié']); DB::table('collecte_exceptions') ->where('comment', '<>', 'Jour férié') - ->update(['type' => $other]); + ->update(['type' => 'Autre']); } /** diff --git a/database/migrations/2026_02_04_102119_add_connected_field_in_slides_table.php b/database/migrations/2026_02_04_102119_add_connected_field_in_slides_table.php index 0a04e41d..ec0303ec 100644 --- a/database/migrations/2026_02_04_102119_add_connected_field_in_slides_table.php +++ b/database/migrations/2026_02_04_102119_add_connected_field_in_slides_table.php @@ -1,5 +1,7 @@ orderBy('order')->get(); - $order = 1; + $order = 1; foreach ($products as $product) { $product->order = $order; $product->saveOrFail(); diff --git a/database/migrations/2026_02_25_111055_add_boolean_display_old_value_for_promotions_table.php b/database/migrations/2026_02_25_111055_add_boolean_display_old_value_for_promotions_table.php index 80205bde..bae1b066 100644 --- a/database/migrations/2026_02_25_111055_add_boolean_display_old_value_for_promotions_table.php +++ b/database/migrations/2026_02_25_111055_add_boolean_display_old_value_for_promotions_table.php @@ -1,5 +1,7 @@ label = "Promotion"; + $promotion = new Tag(); + $promotion->label = 'Promotion'; $promotion->slug = Str::slug($promotion->label); $promotion->save(); } diff --git a/database/migrations/2026_04_27_152343_add_unique_to_password_resets.php b/database/migrations/2026_04_27_152343_add_unique_to_password_resets.php new file mode 100644 index 00000000..fd23af21 --- /dev/null +++ b/database/migrations/2026_04_27_152343_add_unique_to_password_resets.php @@ -0,0 +1,30 @@ +unique(['email']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('password_resets', function (Blueprint $table) { + $table->dropUnique(['email']); + }); + } +}; diff --git a/database/migrations/2026_04_29_110121_rename_table_password_resets_to_customer_password_resets.php b/database/migrations/2026_04_29_110121_rename_table_password_resets_to_customer_password_resets.php new file mode 100644 index 00000000..762e846b --- /dev/null +++ b/database/migrations/2026_04_29_110121_rename_table_password_resets_to_customer_password_resets.php @@ -0,0 +1,30 @@ +rename('customer_password_resets'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('customer_password_resets', function (Blueprint $table) { + $table->rename('password_resets'); + }); + } +}; diff --git a/database/migrations/2026_04_29_120913_remove_id_from_customer_password_resets.php b/database/migrations/2026_04_29_120913_remove_id_from_customer_password_resets.php new file mode 100644 index 00000000..34f87acf --- /dev/null +++ b/database/migrations/2026_04_29_120913_remove_id_from_customer_password_resets.php @@ -0,0 +1,30 @@ +dropColumn('id'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('customer_password_resets', function (Blueprint $table) { + $table->id(); + }); + } +}; diff --git a/database/migrations/2026_05_06_164734_fix_slides_table.php b/database/migrations/2026_05_06_164734_fix_slides_table.php new file mode 100644 index 00000000..ba00f4c8 --- /dev/null +++ b/database/migrations/2026_05_06_164734_fix_slides_table.php @@ -0,0 +1,34 @@ +unsignedInteger('order') + ->nullable(false) + ->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('slides', function (Blueprint $table) { + $table->integer('order') + ->nullable(false) + ->change(); + }); + } +}; diff --git a/database/migrations/2026_05_07_090552_delete_sliders_table.php b/database/migrations/2026_05_07_090552_delete_sliders_table.php new file mode 100644 index 00000000..1a6ac197 --- /dev/null +++ b/database/migrations/2026_05_07_090552_delete_sliders_table.php @@ -0,0 +1,30 @@ +dropForeign(['slider_id']); + $table->dropColumn('slider_id'); + }); + Schema::drop('sliders'); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_07_104436_migrate_slides_pictures.php b/database/migrations/2026_05_07_104436_migrate_slides_pictures.php new file mode 100644 index 00000000..acdb4d73 --- /dev/null +++ b/database/migrations/2026_05_07_104436_migrate_slides_pictures.php @@ -0,0 +1,59 @@ +get()->map(function (object $slide) use ($disk) { + if ($slide->picture === null) { + return; + } + + $diskFilePath = "images/slides/{$slide->picture}"; + + if (! $disk->exists($diskFilePath)) { + throw new \RuntimeException("Missing file {$diskFilePath}"); + } + + $fileInfo = new \SplFileInfo($disk->path($diskFilePath)); + + $newFilePath = FileStorageHelper::storeFile( + new Slide(), + $fileInfo + ); + + DB::table('slides') + ->where('id', $slide->id) + ->update([ + 'picture' => $newFilePath, + ]); + }); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_07_115830_add_image_attributes_on_sliders.php b/database/migrations/2026_05_07_115830_add_image_attributes_on_sliders.php new file mode 100644 index 00000000..f6541201 --- /dev/null +++ b/database/migrations/2026_05_07_115830_add_image_attributes_on_sliders.php @@ -0,0 +1,32 @@ +string('picture_title')->nullable()->after('picture'); + $table->string('picture_alt')->nullable()->after('picture'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('slides', function (Blueprint $table) { + $table->dropColumn('picture_title'); + $table->dropColumn('picture_alt'); + }); + } +}; diff --git a/database/migrations/2026_05_07_123948_add_status_to_slides.php b/database/migrations/2026_05_07_123948_add_status_to_slides.php new file mode 100644 index 00000000..5fb1c17a --- /dev/null +++ b/database/migrations/2026_05_07_123948_add_status_to_slides.php @@ -0,0 +1,30 @@ +boolean('status')->after('order'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('slides', function (Blueprint $table) { + $table->dropColumn('status'); + }); + } +}; diff --git a/database/migrations/2026_05_12_162815_update_order_on_tags.php b/database/migrations/2026_05_12_162815_update_order_on_tags.php new file mode 100644 index 00000000..79c956dc --- /dev/null +++ b/database/migrations/2026_05_12_162815_update_order_on_tags.php @@ -0,0 +1,30 @@ +integer('order')->unsigned()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('tags', function (Blueprint $table) { + $table->integer('order')->change(); + }); + } +}; diff --git a/database/migrations/2026_05_12_172419_drop_anifoods_product_table.php b/database/migrations/2026_05_12_172419_drop_anifoods_product_table.php new file mode 100644 index 00000000..2c609640 --- /dev/null +++ b/database/migrations/2026_05_12_172419_drop_anifoods_product_table.php @@ -0,0 +1,25 @@ +dropColumn('product_type'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_13_165615_resole_salarie_shop_dynamically.php b/database/migrations/2026_05_13_165615_resole_salarie_shop_dynamically.php new file mode 100644 index 00000000..866a8620 --- /dev/null +++ b/database/migrations/2026_05_13_165615_resole_salarie_shop_dynamically.php @@ -0,0 +1,131 @@ +get(['id', 'magasin_id', 'site', 'service']); + + $magasin_salaries_exceptions = []; + $magasin_salaries = []; + + foreach ($salaries as $salarie) { + $resolved = $this->resolveNormalShop((string) $salarie->site, (string) $salarie->service); + + if ($resolved->magasin_id !== $salarie->magasin_id) { + $magasin_salaries_exceptions[] = [ + 'magasin_id' => $salarie->magasin_id, + 'salarie_id' => $salarie->id, + ]; + } else { + $key = $salarie->site . '_' . $resolved->service_id; + if (! isset($magasin_salaries[$key])) { + $magasin_salaries[$key] = [ + 'site_code' => $salarie->site, + 'service_code' => $resolved->service_id, + 'magasin_id' => $resolved->magasin_id, + ]; + } + } + } + + Schema::table('magasins', function (Blueprint $table) { + $table->boolean('default') + ->default(false) + ->after('gmaps_embed_href'); + }); + + Schema::table('salaries', function (Blueprint $table) { + $table->dropForeign(['magasin_id']); + $table->dropColumn('magasin_id'); + }); + + Schema::create('magasin_salarie', function (Blueprint $table) { + $table->id(); + $table->string('site_code'); + $table->string('service_code')->nullable(); + $table->foreignId('magasin_id')->constrained('magasins', 'id'); + $table->unique(['site_code', 'service_code']); + $table->comment('Permet de résoudre le magasin pour un salarie en fonction du site et éventuellement du service'); + }); + + Schema::create('magasin_salaries_exceptions', function (Blueprint $table) { + $table->foreignId('salarie_id')->constrained('salaries', 'id'); + $table->foreignId('magasin_id')->constrained('magasins', 'id'); + $table->primary(['salarie_id', 'magasin_id']); + $table->comment('Exceptions pour certains salariés afin de pallier au manque de cohérence coté régate'); + }); + + DB::transaction(function () use ($magasin_salaries, $magasin_salaries_exceptions) { + DB::table('magasins')->where('id', 1)->update(['default' => true]); + + if (! empty($magasin_salaries)) { + DB::table('magasin_salarie')->insert(array_values($magasin_salaries)); + } + + foreach (array_chunk($magasin_salaries_exceptions, 500) as $chunk) { + DB::table('magasin_salaries_exceptions')->insert($chunk); + } + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } + + /** + * Règles d'exceptions legacy en usage au 13/05/26 au moins. + * + * @return object{service_id:string|null,magasin_id:int} + */ + private function resolveNormalShop(string $site, string $service): object + { + $magasinId = match ($site) { + 'LDCCAV' => 3, // Cavol. + 'DDE' => 8, // Dinde. + 'DPE' => 9, // DPE. + 'CEPACPE' => match (true) { + in_array($service, ['CEPACP060', 'CEPACP070', 'CEPACP072']) => 6, // CPE. + in_array($service, ['CEPACP065', 'CEPACP066']) => 11, // PLB. + default => 10, // CEPA. + }, + 'LDCPLB' => 11, // PLB. + 'TPWISS' => 7, // Wissous. + + // Saint Laurent. + 'SL' => 1, + 'GDFROI' => 1, + 'SLELA' => 1, + default => 1, + }; + + // La règle ne dépend du service que pour le site "cepacpe". + // Pour les autres, la règle s'applique à tout le site (service = null). + $resolvedService = ($site === 'CEPACPE') ? $service : null; + + return (object) [ + 'service_id' => $resolvedService, + 'magasin_id' => $magasinId, + ]; + } +}; diff --git a/database/migrations/2026_05_15_085114_rename_tables.php b/database/migrations/2026_05_15_085114_rename_tables.php new file mode 100644 index 00000000..9150e872 --- /dev/null +++ b/database/migrations/2026_05_15_085114_rename_tables.php @@ -0,0 +1,71 @@ +dropForeign('salaries_customer_id_foreign'); + $table->foreign(['customer_id'])->references('id')->on('customers')->cascadeOnUpdate()->nullOnDelete(); + }); + + Schema::table('shop_employee_exception', function (Blueprint $table) { + $table->dropForeign('magasin_salaries_exceptions_salarie_id_foreign'); + $table->dropForeign('magasin_salaries_exceptions_magasin_id_foreign'); + $table->renameColumn('salarie_id', 'employee_id'); + $table->renameColumn('magasin_id', 'shop_id'); + $table->foreign(['employee_id'])->references('id')->on('employees')->cascadeOnUpdate()->cascadeOnDelete(); + $table->foreign(['shop_id'])->references('id')->on('shops')->cascadeOnUpdate()->cascadeOnDelete(); + }); + + Schema::table('shop_employees', function (Blueprint $table) { + $table->dropForeign('magasin_salarie_magasin_id_foreign'); + $table->renameColumn('magasin_id', 'shop_id'); + $table->foreign(['shop_id'])->references('id')->on('shops')->cascadeOnUpdate()->cascadeOnDelete(); + }); + + Schema::table('timeslot_exceptions', function (Blueprint $table) { + $table->dropForeign('collecte_exceptions_magasin_id_foreign'); + $table->renameColumn('magasin_id', 'shop_id'); + $table->foreign(['shop_id'])->references('id')->on('shops')->cascadeOnUpdate()->cascadeOnDelete(); + }); + + Schema::table('timeslot_settings', function (Blueprint $table) { + $table->dropForeign('timeslot_settings_magasin_id_foreign'); + $table->dropUnique('timeslot_settings_magasin_id_day_index_unique'); + $table->renameColumn('magasin_id', 'shop_id'); + $table->renameColumn('day_index', 'week_day'); + $table->foreign(['shop_id'])->references('id')->on('shops')->cascadeOnUpdate()->cascadeOnDelete(); + $table->unique(['shop_id', 'week_day']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_15_094440_drop_discount_type_table.php b/database/migrations/2026_05_15_094440_drop_discount_type_table.php new file mode 100644 index 00000000..2bfd0b1c --- /dev/null +++ b/database/migrations/2026_05_15_094440_drop_discount_type_table.php @@ -0,0 +1,30 @@ +dropForeign('promotions_discount_type_id_foreign'); + $table->renameColumn('discount_type_id', 'discount_type'); + }); + Schema::drop('discount_types'); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_15_095409_drop_ordre_status_table.php b/database/migrations/2026_05_15_095409_drop_ordre_status_table.php new file mode 100644 index 00000000..d6ced9f5 --- /dev/null +++ b/database/migrations/2026_05_15_095409_drop_ordre_status_table.php @@ -0,0 +1,30 @@ +dropForeign('orders_status_id_foreign'); + $table->renameColumn('status_id', 'status'); + }); + Schema::drop('order_status'); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_15_095736_drop_order_products.php b/database/migrations/2026_05_15_095736_drop_order_products.php new file mode 100644 index 00000000..3c4b89ed --- /dev/null +++ b/database/migrations/2026_05_15_095736_drop_order_products.php @@ -0,0 +1,30 @@ +dropForeign('orders_products_order_id_foreign'); + $table->dropForeign('orders_products_product_id_foreign'); + }); + Schema::drop('order_products'); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_15_100312_drop_tax_rates.php b/database/migrations/2026_05_15_100312_drop_tax_rates.php new file mode 100644 index 00000000..3c2cccfa --- /dev/null +++ b/database/migrations/2026_05_15_100312_drop_tax_rates.php @@ -0,0 +1,30 @@ +dropForeign('products_tax_rate_id_foreign'); + $table->renameColumn('tax_rate_id', 'tax_rate'); + }); + Schema::drop('tax_rates'); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_15_102945_drop_settings.php b/database/migrations/2026_05_15_102945_drop_settings.php new file mode 100644 index 00000000..c8636592 --- /dev/null +++ b/database/migrations/2026_05_15_102945_drop_settings.php @@ -0,0 +1,25 @@ +selectRaw('matricule, COUNT(matricule) as counts') + ->groupBy('matricule') + ->having('counts', '>', 1) + ->get(); + + // * Garder uniquement le plus récent + foreach ($duplicates as $duplicate) { + $idsToDelete = DB::table('employees') + ->where('matricule', $duplicate->matricule) + ->orderBy('id', 'desc') + ->skip(1) + ->take(PHP_INT_MAX) + ->pluck('id'); + + DB::table('employees')->whereIn('id', $idsToDelete)->delete(); + } + + Schema::table('employees', function (Blueprint $table) { + $table->unique('matricule'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_15_130940_add_unique_to_pages.php b/database/migrations/2026_05_15_130940_add_unique_to_pages.php new file mode 100644 index 00000000..f624e72c --- /dev/null +++ b/database/migrations/2026_05_15_130940_add_unique_to_pages.php @@ -0,0 +1,31 @@ +renameColumn('key', 'slug'); + $table->renameColumn('value', 'content'); + $table->renameColumn('chapeau', 'heading'); + $table->unique('slug'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_15_131427_remove_heading_from_pages_table.php b/database/migrations/2026_05_15_131427_remove_heading_from_pages_table.php new file mode 100644 index 00000000..ba74cd09 --- /dev/null +++ b/database/migrations/2026_05_15_131427_remove_heading_from_pages_table.php @@ -0,0 +1,29 @@ +dropColumn('banner'); + $table->dropColumn('heading'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_15_133554_rename_promotions.php b/database/migrations/2026_05_15_133554_rename_promotions.php new file mode 100644 index 00000000..2b2a8c23 --- /dev/null +++ b/database/migrations/2026_05_15_133554_rename_promotions.php @@ -0,0 +1,34 @@ +dropForeign('product_promotion_product_id_foreign'); + $table->dropForeign('product_promotion_promotion_id_foreign'); + $table->renameColumn('promotion_id', 'offer_id'); + $table->foreign(['product_id'])->references('id')->on('products')->cascadeOnDelete()->cascadeOnUpdate(); + $table->foreign(['offer_id'])->references('id')->on('offers')->cascadeOnDelete()->cascadeOnUpdate(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_15_165156_add_order_to_faqs_table.php b/database/migrations/2026_05_15_165156_add_order_to_faqs_table.php new file mode 100644 index 00000000..8719c0c3 --- /dev/null +++ b/database/migrations/2026_05_15_165156_add_order_to_faqs_table.php @@ -0,0 +1,43 @@ +integer('order')->unsigned()->after('answer')->default(0); + }); + + $i = 0; + DB::table('faqs')->get()->each(function ($faq) use (&$i) { + DB::table('faqs')->where('id', $faq->id) + ->update(['order' => $i++]); + }); + + Schema::table('faqs', function (Blueprint $table) { + $table->integer('order')->unsigned()->after('answer')->change(); + $table->unique('order'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('faqs', function (Blueprint $table) { + $table->dropUnique(['order']); + $table->dropColumn('order'); + }); + } +}; diff --git a/database/migrations/2026_05_15_172544_add_seo_fields_on_pages_table.php b/database/migrations/2026_05_15_172544_add_seo_fields_on_pages_table.php new file mode 100644 index 00000000..68365671 --- /dev/null +++ b/database/migrations/2026_05_15_172544_add_seo_fields_on_pages_table.php @@ -0,0 +1,68 @@ +string('seo_title')->after('slug'); + $table->string('seo_description')->after('seo_title'); + }); + + DB::table('pages')->where('slug', 'accueil') + ->update([ + 'seo_title' => 'Accueil', + 'seo_description' => 'Page d\'accueil de la boutique.', + ]); + + DB::table('pages')->where('slug', 'contact') + ->update([ + 'seo_title' => 'Contactez-nous', + 'seo_description' => 'Procédure afin de contacter les gérants de la boutique.', + ]); + + DB::table('pages')->where('slug', 'legals') + ->update([ + 'seo_title' => 'Mentions légales & CGU', + 'seo_description' => 'Mentions légales et conditions générales d\'utilisations de la boutique.', + ]); + + DB::table('pages')->where('slug', 'cgv') + ->update([ + 'seo_title' => 'CGV', + 'seo_description' => 'Conditions générales de ventes de la boutique.', + ]); + + DB::table('pages')->where('slug', 'confidentialite') + ->update([ + 'seo_title' => 'Politique de confidentialité', + 'seo_description' => 'Politique de confidentialité de la boutique.', + ]); + + DB::table('pages')->where('slug', 'faq') + ->update([ + 'title' => 'Foire aux questions', + 'seo_title' => 'FAQ', + 'seo_description' => 'Foire aux questions fréquemment posées.', + ]); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_18_113005_migrate_old_slugs_to_redirect_package.php b/database/migrations/2026_05_18_113005_migrate_old_slugs_to_redirect_package.php new file mode 100644 index 00000000..8bc0e760 --- /dev/null +++ b/database/migrations/2026_05_18_113005_migrate_old_slugs_to_redirect_package.php @@ -0,0 +1,67 @@ +get()->map(function ($oldSlug) { + $isProduct = $oldSlug->product_id !== null; + $modelTable = $isProduct ? 'products' : 'ranges'; + $modelId = $oldSlug->product_id ?? $oldSlug->range_id; + + $oldSlugValue = $oldSlug->slug; + $newSlugValue = DB::table($modelTable)->where('id', $modelId)->first('slug')->slug; + + $model = $isProduct ? new Product() : new Range(); + // * Legacy Url for ranges + $oldQuery = $isProduct ? "/produit/{$oldSlugValue}" : "/gamme-de-produits/{$oldSlugValue}"; + $newQuery = self::formatRedirectionQuery($model->getFrontUrl($newSlugValue)); + + if ($oldQuery === $newQuery) { + return; + } + + DB::table('uwil_redirections')->insert([ + 'hash' => $oldQuery, + 'old_model_slug' => $oldSlugValue, + 'old_query' => $oldQuery, + 'new_query' => $newQuery, + 'model_redirectable_id' => $modelId, + 'model_redirectable_type' => $model->getMorphClass(), + 'redirect_type' => RedirectionType::model, + 'redirect_code' => 301, + ]); + }); + + Schema::drop('old_slugs'); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } + + private static function formatRedirectionQuery(string $url): string + { + return Str::of($url) + ->chopStart(\config('app.url')) + ->start('/') + ->value(); + } +}; diff --git a/database/migrations/2026_05_18_125014_migrate_ranges_pictures.php b/database/migrations/2026_05_18_125014_migrate_ranges_pictures.php new file mode 100644 index 00000000..527fb9ab --- /dev/null +++ b/database/migrations/2026_05_18_125014_migrate_ranges_pictures.php @@ -0,0 +1,59 @@ +get()->map(function (object $range) use ($disk) { + if ($range->picture === null) { + return; + } + + $diskFilePath = "images/gammes/{$range->picture}"; + + if (! $disk->exists($diskFilePath)) { + throw new \RuntimeException("Missing file {$diskFilePath}"); + } + + $fileInfo = new \SplFileInfo($disk->path($diskFilePath)); + + $newFilePath = FileStorageHelper::storeFile( + new Range(), + $fileInfo + ); + + DB::table('ranges') + ->where('id', $range->id) + ->update([ + 'picture' => $newFilePath, + ]); + }); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_18_142859_add_order_to_ranges.php b/database/migrations/2026_05_18_142859_add_order_to_ranges.php new file mode 100644 index 00000000..0ba98dd3 --- /dev/null +++ b/database/migrations/2026_05_18_142859_add_order_to_ranges.php @@ -0,0 +1,43 @@ +integer('order')->unsigned()->after('status')->default(0); + }); + + $i = 0; + DB::table('ranges')->get()->each(function ($faq) use (&$i) { + DB::table('ranges')->where('id', $faq->id) + ->update(['order' => $i++]); + }); + + Schema::table('ranges', function (Blueprint $table) { + $table->integer('order')->unsigned()->after('status')->change(); + $table->unique('order'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('ranges', function (Blueprint $table) { + $table->dropUnique(['order']); + $table->dropColumn('order'); + }); + } +}; diff --git a/database/migrations/2026_05_18_152042_add_picture_title_to_ranges_table.php b/database/migrations/2026_05_18_152042_add_picture_title_to_ranges_table.php new file mode 100644 index 00000000..a4af8d60 --- /dev/null +++ b/database/migrations/2026_05_18_152042_add_picture_title_to_ranges_table.php @@ -0,0 +1,45 @@ +string('picture_title')->nullable()->after('picture'); + $table->string('picture_alt')->nullable()->after('picture'); + }); + + DB::table('ranges')->get()->map(function ($range) { + DB::table('ranges')->where('id', $range->id)->update([ + 'picture_title' => $range->name, + 'picture_alt' => $range->name, + ]); + }); + + Schema::table('ranges', function (Blueprint $table) { + $table->string('picture_title')->change(); + $table->string('picture_alt')->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('ranges', function (Blueprint $table) { + $table->dropColumn('picture_title'); + $table->dropColumn('picture_alt'); + }); + } +}; diff --git a/database/migrations/2026_05_18_152043_add_picture_title_to_products_table.php b/database/migrations/2026_05_18_152043_add_picture_title_to_products_table.php new file mode 100644 index 00000000..427da53a --- /dev/null +++ b/database/migrations/2026_05_18_152043_add_picture_title_to_products_table.php @@ -0,0 +1,53 @@ +string('picture_title')->nullable()->after('picture'); + $table->string('picture_alt')->nullable()->after('picture'); + $table->string('picture_large_title')->nullable()->after('picture_large'); + $table->string('picture_large_alt')->nullable()->after('picture_large'); + }); + + DB::table('products')->get()->map(function ($product) { + DB::table('products')->where('id', $product->id)->update([ + 'picture_title' => $product->name, + 'picture_alt' => $product->name, + 'picture_large_title' => $product->name, + 'picture_large_alt' => $product->name, + ]); + }); + + Schema::table('products', function (Blueprint $table) { + $table->string('picture_title')->change(); + $table->string('picture_alt')->change(); + $table->string('picture_large_title')->change(); + $table->string('picture_large_alt')->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('products', function (Blueprint $table) { + $table->dropColumn('picture_title'); + $table->dropColumn('picture_alt'); + $table->dropColumn('picture_large_title'); + $table->dropColumn('picture_large_alt'); + }); + } +}; diff --git a/database/migrations/2026_05_19_094421_change_some_columns_on_products_table.php b/database/migrations/2026_05_19_094421_change_some_columns_on_products_table.php new file mode 100644 index 00000000..95a9a64e --- /dev/null +++ b/database/migrations/2026_05_19_094421_change_some_columns_on_products_table.php @@ -0,0 +1,32 @@ +where(['stock' => null])->update(['stock' => 0]); + Schema::table('products', function (Blueprint $table) { + $table->integer('stock')->default(0)->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('products', function (Blueprint $table) { + $table->integer('stock')->nullable()->change(); + }); + } +}; diff --git a/database/migrations/2026_05_19_101521_change_order_status.php b/database/migrations/2026_05_19_101521_change_order_status.php new file mode 100644 index 00000000..699b2c3a --- /dev/null +++ b/database/migrations/2026_05_19_101521_change_order_status.php @@ -0,0 +1,26 @@ +whereNotIn('status', [1, 3, 7])->update(['status' => 1]); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + // Do nothing. + } +}; diff --git a/database/migrations/2026_05_19_101521_migrate_products_pictures.php b/database/migrations/2026_05_19_101521_migrate_products_pictures.php new file mode 100644 index 00000000..6546921e --- /dev/null +++ b/database/migrations/2026_05_19_101521_migrate_products_pictures.php @@ -0,0 +1,84 @@ +get()->map(function (object $product) use ($disk) { + if ($product->picture === null) { + return; + } + + $newFilePath = null; + $diskFilePath = "images/produits/{$product->picture}"; + + if ($disk->exists($diskFilePath)) { + $fileInfo = new \SplFileInfo($disk->path($diskFilePath)); + + $newFilePath = FileStorageHelper::storeFile( + new Range(), + $fileInfo + ); + } + + DB::table('products') + ->where('id', $product->id) + ->update([ + 'picture' => $newFilePath, + ]); + }); + }); + + DB::transaction(function () use ($disk) { + DB::table('products')->get()->map(function (object $product) use ($disk) { + if ($product->picture_large === null) { + return; + } + + $newFilePath = null; + $diskFilePath = "images/produits/{$product->picture_large}"; + + if ($disk->exists($diskFilePath)) { + $fileInfo = new \SplFileInfo($disk->path($diskFilePath)); + + $newFilePath = FileStorageHelper::storeFile( + new Range(), + $fileInfo + ); + } + + DB::table('products') + ->where('id', $product->id) + ->update([ + 'picture_large' => $newFilePath, + ]); + }); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_19_101522_change_some_columns_2_on_products_table.php b/database/migrations/2026_05_19_101522_change_some_columns_2_on_products_table.php new file mode 100644 index 00000000..83ba9045 --- /dev/null +++ b/database/migrations/2026_05_19_101522_change_some_columns_2_on_products_table.php @@ -0,0 +1,34 @@ +string('brand')->change(); + $table->unique('order'); + $table->dropColumn('price_buy'); // * Non utilisé, juste presente en bo + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('products', function (Blueprint $table) { + $table->string('brand')->nullable()->change(); + $table->dropUnique(['order']); + $table->float('price_buy')->nullable()->after('invoicing_unit'); + }); + } +}; diff --git a/database/migrations/2026_05_20_113304_add_sort_order_to_product_product_table.php b/database/migrations/2026_05_20_113304_add_sort_order_to_product_product_table.php new file mode 100644 index 00000000..d48a7c7e --- /dev/null +++ b/database/migrations/2026_05_20_113304_add_sort_order_to_product_product_table.php @@ -0,0 +1,30 @@ +integer('sort_order')->default(0); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('product_product', function (Blueprint $table) { + $table->dropColumn('sort_order'); + }); + } +}; diff --git a/database/migrations/2026_05_20_123658_remove_margin_from_products_table.php b/database/migrations/2026_05_20_123658_remove_margin_from_products_table.php new file mode 100644 index 00000000..76595abd --- /dev/null +++ b/database/migrations/2026_05_20_123658_remove_margin_from_products_table.php @@ -0,0 +1,30 @@ +dropColumn('margin'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('products', function (Blueprint $table) { + $table->float('margin')->unsigned()->default(0)->after('range_id'); + }); + } +}; diff --git a/database/migrations/2026_05_20_160028_change_product_inco_relation_with_product.php b/database/migrations/2026_05_20_160028_change_product_inco_relation_with_product.php new file mode 100644 index 00000000..c7c239c0 --- /dev/null +++ b/database/migrations/2026_05_20_160028_change_product_inco_relation_with_product.php @@ -0,0 +1,42 @@ +unique('product_id'); + $table->dropUnique('food_products_no_art_unique'); + }); + DB::table('product_incos') + ->whereNull('no_art') + ->delete(); + Schema::table('product_incos', function (Blueprint $table) { + $table->integer('no_art')->unsigned()->change(); + $table->unique(['no_art']); + }); + Schema::table('product_incos', function (Blueprint $table) { + $table->dropForeign('food_products_product_id_foreign'); + $table->foreign(['product_id'])->references('id')->on('products') + ->cascadeOnDelete()->cascadeOnUpdate(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_21_103837_change_product_order_column.php b/database/migrations/2026_05_21_103837_change_product_order_column.php new file mode 100644 index 00000000..9e767189 --- /dev/null +++ b/database/migrations/2026_05_21_103837_change_product_order_column.php @@ -0,0 +1,35 @@ +orderBy('order', 'desc')->get(); + $i = $products->count() + 1; + $products->each(function ($product) use (&$i) { + DB::table('products')->where('id', $product->id) + ->update(['order' => $i--]); + }); + Schema::table('products', function (Blueprint $table) { + $table->bigInteger('order')->unsigned()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_21_120644_remove_home_statis_page.php b/database/migrations/2026_05_21_120644_remove_home_statis_page.php new file mode 100644 index 00000000..8c910fc5 --- /dev/null +++ b/database/migrations/2026_05_21_120644_remove_home_statis_page.php @@ -0,0 +1,25 @@ +where('slug', 'accueil')->delete(); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_21_122658_rename_offers_to_discounts.php b/database/migrations/2026_05_21_122658_rename_offers_to_discounts.php new file mode 100644 index 00000000..dbe00747 --- /dev/null +++ b/database/migrations/2026_05_21_122658_rename_offers_to_discounts.php @@ -0,0 +1,38 @@ +dropForeign('product_offer_offer_id_foreign'); + $table->dropForeign('product_offer_product_id_foreign'); + $table->renameColumn('offer_id', 'discount_id'); + }); + Schema::rename('product_offer', 'product_discount'); + Schema::rename('offers', 'discounts'); + Schema::table('product_discount', function (Blueprint $table) { + $table->foreign(['product_id'])->references('id')->on('products') + ->cascadeOnDelete()->cascadeOnUpdate(); + $table->foreign(['discount_id'])->references('id')->on('discounts') + ->cascadeOnDelete()->cascadeOnUpdate(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_21_131414_rename_offers_discounts.php b/database/migrations/2026_05_21_131414_rename_offers_discounts.php new file mode 100644 index 00000000..fb4a859a --- /dev/null +++ b/database/migrations/2026_05_21_131414_rename_offers_discounts.php @@ -0,0 +1,25 @@ +foreignId('discount_id')->nullable()->after('range_id') + ->constrained('discounts', 'id') + ->nullOnDelete()->cascadeOnUpdate(); + }); + + DB::table('discount_product')->get()->each(function ($table) { + DB::table('products')->where('id', $table->product_id) + ->update([ + 'discount_id' => $table->discount_id, + ]); + }); + + Schema::drop('discount_product'); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_21_163851_simplify_shops_map.php b/database/migrations/2026_05_21_163851_simplify_shops_map.php new file mode 100644 index 00000000..1d75f613 --- /dev/null +++ b/database/migrations/2026_05_21_163851_simplify_shops_map.php @@ -0,0 +1,30 @@ +dropColumn('gmaps_placeid'); + $table->dropColumn('gmaps_link_href'); + $table->dropColumn('gmaps_embed_href'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_22_101939_remove_time_slot_settings.php b/database/migrations/2026_05_22_101939_remove_time_slot_settings.php new file mode 100644 index 00000000..1c89f1ab --- /dev/null +++ b/database/migrations/2026_05_22_101939_remove_time_slot_settings.php @@ -0,0 +1,25 @@ +dropColumn('time'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_22_102934_rename_shop_column_on_timeslots_table.php b/database/migrations/2026_05_22_102934_rename_shop_column_on_timeslots_table.php new file mode 100644 index 00000000..e8db88cc --- /dev/null +++ b/database/migrations/2026_05_22_102934_rename_shop_column_on_timeslots_table.php @@ -0,0 +1,30 @@ +dropForeign('timeslots_magasin_id_foreign'); + $table->renameColumn('magasin_id', 'shop_id'); + $table->foreign('shop_id')->references('id')->on('shops'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_22_104824_rename_time_slot_exceptions_table.php b/database/migrations/2026_05_22_104824_rename_time_slot_exceptions_table.php new file mode 100644 index 00000000..50496f20 --- /dev/null +++ b/database/migrations/2026_05_22_104824_rename_time_slot_exceptions_table.php @@ -0,0 +1,25 @@ +foreignId('shop_id') + ->constrained('shops', 'id') + ->cascadeOnUpdate()->cascadeOnDelete(); + $table->foreignId('pickup_exception_id') + ->constrained('pickup_exceptions', 'id') + ->cascadeOnUpdate()->cascadeOnDelete(); + + $table->unique(['shop_id', 'pickup_exception_id']); + }); + + Schema::table('pickup_exceptions', function (Blueprint $table) { + $table->renameColumn('comment', 'label'); + $table->dropForeign('timeslot_exceptions_shop_id_foreign'); + $table->boolean('repeatable')->after('label'); + $table->string('repeat_frequency')->after('repeatable')->default('Weekly') + ->comment('Enum Domain\Enums\RepeatFrequency'); + $table->string('label')->change(); + $table->dropColumn('type'); + }); + + DB::table('pickup_exceptions')->get()->each(function ($v) { + DB::table('shop_pickup_exception')->insertOrIgnore([ + 'shop_id' => $v->shop_id, + 'pickup_exception_id' => $v->id, + ]); + }); + + Schema::table('pickup_exceptions', function (Blueprint $table) { + $table->dropColumn('shop_id'); + }); + + $duplicates = DB::table('pickup_exceptions') + ->selectRaw('MIN(id) as keep_id, date, label') + ->groupBy('date', 'label') + ->havingRaw('COUNT(*) > 1') + ->get(); + + foreach ($duplicates as $duplicate) { + $dupIds = DB::table('pickup_exceptions') + ->where('date', $duplicate->date) + ->where('label', $duplicate->label) + ->where('id', '!=', $duplicate->keep_id) + ->pluck('id'); + + $shopIdsToLink = DB::table('shop_pickup_exception') + ->whereIn('pickup_exception_id', $dupIds) + ->pluck('shop_id'); + + $newLinks = $shopIdsToLink->map(fn ($shopId) => [ + 'shop_id' => $shopId, + 'pickup_exception_id' => $duplicate->keep_id, + ])->toArray(); + + DB::table('shop_pickup_exception')->insertOrIgnore($newLinks); + DB::table('shop_pickup_exception')->whereIn('pickup_exception_id', $dupIds)->delete(); + DB::table('pickup_exceptions')->whereIn('id', $dupIds)->delete(); + } + + Schema::table('pickup_exceptions', function (Blueprint $table) { + $table->unique(['date', 'label']); + }); + + $repeatables = [ + '2026-01-01' => '1er janvier', + '2026-04-06' => 'Lundi de Pâques', + '2026-05-01' => '1er mai', + '2026-05-08' => '8 mai', + '2026-05-14' => 'Ascension', + '2026-05-25' => 'Lundi de Pentecôte', + '2026-07-14' => '14 juillet', + '2026-08-15' => 'Assomption', + '2026-11-01' => 'Toussaint', + '2026-11-11' => '11 novembre', + '2026-12-25' => 'Jour de Noël', + ]; + + DB::table('pickup_exceptions') + ->whereIn('label', $repeatables) + ->delete(); + + // ! Dont run on migrate fresh + if (DB::table('pickup_exceptions')->count()) { + DB::table('pickup_exceptions')->insert( + collect($repeatables)->map(fn ($label, $date) => [ + 'date' => $date, + 'label' => $label, + 'repeatable' => true, + 'repeat_frequency' => 'Yearly', + 'created_at' => Date::now(), + 'updated_at' => Date::now(), + ])->all() + ); + } + + $repeatableExceptionIds = DB::table('pickup_exceptions')->whereIn('label', $repeatables)->pluck('id'); + $shopIds = DB::table('shops')->pluck('id'); + + $shopIds->each(function ($shopId) use ($repeatableExceptionIds) { + $records = $repeatableExceptionIds->map(fn ($exceptionId) => [ + 'shop_id' => $shopId, + 'pickup_exception_id' => $exceptionId, + ])->toArray(); + + DB::table('shop_pickup_exception')->upsert( + $records, + ['shop_id', 'pickup_exception_id'], + [] + ); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_26_095455_add_auto_updated_on_pickup_exceptions_table.php b/database/migrations/2026_05_26_095455_add_auto_updated_on_pickup_exceptions_table.php new file mode 100644 index 00000000..3ac36509 --- /dev/null +++ b/database/migrations/2026_05_26_095455_add_auto_updated_on_pickup_exceptions_table.php @@ -0,0 +1,36 @@ +boolean('auto_updated')->after('repeat_frequency'); + }); + + // * Previous migration made repeatable as autoupdated. + + DB::table('pickup_exceptions')->where('repeatable', true) + ->update(['auto_updated' => true]); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('pickup_exceptions', function (Blueprint $table) { + $table->dropColumn('auto_updated'); + }); + } +}; diff --git a/database/migrations/2026_05_26_143214_add_replacements_day_to_shop_pickup_exception_table.php b/database/migrations/2026_05_26_143214_add_replacements_day_to_shop_pickup_exception_table.php new file mode 100644 index 00000000..2180a3ea --- /dev/null +++ b/database/migrations/2026_05_26_143214_add_replacements_day_to_shop_pickup_exception_table.php @@ -0,0 +1,32 @@ +date('replacement_date')->nullable()->after('pickup_exception_id'); + $blueprint->dateTime('order_deadline_at')->nullable()->after('replacement_date'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('shop_pickup_exception', function (Blueprint $blueprint) { + $blueprint->dropColumn('replacement_date'); + $blueprint->dropColumn('order_deadline_at'); + }); + } +}; diff --git a/database/migrations/2026_05_26_154849_convert_all_dates_to_utc.php b/database/migrations/2026_05_26_154849_convert_all_dates_to_utc.php new file mode 100644 index 00000000..67128545 --- /dev/null +++ b/database/migrations/2026_05_26_154849_convert_all_dates_to_utc.php @@ -0,0 +1,119 @@ + ['created_at'], + 'customers' => ['created_at', 'updated_at'], + 'discounts' => ['date_start', 'date_end', 'created_at', 'updated_at'], + 'failed_jobs' => ['failed_at'], + 'faqs' => ['created_at', 'updated_at'], + 'order_lines' => ['created_at', 'updated_at'], + 'orders' => ['created_at', 'updated_at'], + 'pages' => ['created_at', 'updated_at'], + 'pickup_exceptions' => ['created_at', 'updated_at'], + 'product_incos' => ['created_at', 'updated_at'], + 'products' => ['orderable_start', 'orderable_end', 'created_at', 'updated_at', 'deleted_at'], + 'ranges' => ['created_at', 'updated_at'], + 'shop_pickup_exception' => ['order_deadline_at'], + 'shoppingcart' => ['created_at', 'updated_at'], + 'shops' => ['created_at', 'updated_at'], + 'slides' => ['date_start', 'date_end', 'created_at', 'updated_at'], + 'stats' => ['created_at', 'updated_at'], + 'timeslots' => ['created_at', 'updated_at'], + 'users' => ['email_verified_at', 'created_at', 'updated_at'], + 'uwil_redirections' => ['created_at', 'updated_at'], + 'xml_incos' => ['created_at', 'updated_at'], + ]; + + public function up(): void + { + foreach ($this->schemaMapping as $table => $columns) { + $this->migrateTableTimezones($table, $columns, 'Europe/Paris', 'UTC'); + } + } + + public function down(): void + { + foreach ($this->schemaMapping as $table => $columns) { + $this->migrateTableTimezones($table, $columns, 'UTC', 'Europe/Paris'); + } + } + + /** + * @param array $columns + * + * @phpcs:disable + */ + private function migrateTableTimezones(string $table, array $columns, string $fromTz, string $toTz): void + { + if (! Schema::hasTable($table)) { + return; + } + + $hasId = Schema::hasColumn($table, 'id'); + + $query = DB::table($table)->where(function ($q) use ($columns) { + foreach ($columns as $column) { + $q->orWhereNotNull($column); + } + }); + + if ($hasId) { + $query->orderBy('id')->chunkById(500, function ($rows) use ($table, $columns, $fromTz, $toTz) { + foreach ($rows as $row) { + $updateData = []; + foreach ($columns as $column) { + if (! empty($row->{$column})) { + $updateData[$column] = $this->convertTz($row->{$column}, $fromTz, $toTz); + } + } + + if (! empty($updateData)) { + DB::table($table)->where('id', $row->id)->update($updateData); + } + } + }, 'id'); + } else { + $firstColumn = reset($columns); + + $query->orderBy($firstColumn) + ->chunk(500, function ($rows) use ($table, $columns, $fromTz, $toTz) { + foreach ($rows as $row) { + $updateData = []; + foreach ($columns as $column) { + if (! empty($row->{$column})) { + $updateData[$column] = $this->convertTz($row->{$column}, $fromTz, $toTz); + } + } + + if (! empty($updateData)) { + DB::table($table)->where((array) $row)->update($updateData); + } + } + }); + } + } + + private function convertTz(string $value, string $fromTz, string $toTz): string + { + try { + return Carbon::createFromFormat('Y-m-d H:i:s', $value, $fromTz) + ->setTimezone($toTz) + ->format('Y-m-d H:i:s'); + } catch (\Exception) { + return Carbon::parse($value, $fromTz) + ->setTimezone($toTz) + ->format('Y-m-d H:i:s'); + } + } +}; diff --git a/database/migrations/2026_05_28_095941_remove_order_comment.php b/database/migrations/2026_05_28_095941_remove_order_comment.php new file mode 100644 index 00000000..d0c8bada --- /dev/null +++ b/database/migrations/2026_05_28_095941_remove_order_comment.php @@ -0,0 +1,30 @@ +dropColumn('commentaire'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('orders', function (Blueprint $table) { + $table->string('commentaire')->nullable()->after('date'); + }); + } +}; diff --git a/database/migrations/2026_05_28_101213_consolidate_order.php b/database/migrations/2026_05_28_101213_consolidate_order.php new file mode 100644 index 00000000..b7bd1d1f --- /dev/null +++ b/database/migrations/2026_05_28_101213_consolidate_order.php @@ -0,0 +1,58 @@ +dropForeign('orders_customer_id_foreign'); + $table->json('employee')->nullable()->after('id')->comment('Domain\Models\ValueObjects\OrderEmployee'); + }); + DB::table('orders') + ->join('customers', 'orders.customer_id', '=', 'customers.id') + ->join('employees', 'customers.id', '=', 'employees.customer_id') + ->get([ + 'orders.id', + 'employees.matricule', + 'employees.nom', + 'employees.prenom', + 'employees.etablissement', + 'employees.site', + 'employees.service', + ])->each(function ($order) { + DB::table('orders')->where('id', $order->id) + ->update([ + 'employee' => json_encode([ + 'matricule' => $order->matricule, + 'firstname' => $order->nom, + 'lastname' => $order->prenom, + 'facility' => $order->etablissement, + 'site' => $order->site, + 'service' => $order->service, + ], \JSON_THROW_ON_ERROR), + ]); + }); + + Schema::table('orders', function (Blueprint $table) { + $table->dropColumn('customer_id'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_28_101213_convert_discount_value_as_int.php b/database/migrations/2026_05_28_101213_convert_discount_value_as_int.php new file mode 100644 index 00000000..e723849f --- /dev/null +++ b/database/migrations/2026_05_28_101213_convert_discount_value_as_int.php @@ -0,0 +1,35 @@ +get()->each(function ($discounts) { + DB::table('discounts')->where('id', $discounts->id)->update([ + 'discount_value' => $discounts->discount_type === 1 ? // ? Is Amount in euro + $discounts->discount_value * 100 : $discounts->discount_value, + ]); + }); + Schema::table('discounts', function (Blueprint $table) { + $table->integer('discount_value')->unsigned()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_28_101213_convert_order_total_as_int.php b/database/migrations/2026_05_28_101213_convert_order_total_as_int.php new file mode 100644 index 00000000..8265d6a5 --- /dev/null +++ b/database/migrations/2026_05_28_101213_convert_order_total_as_int.php @@ -0,0 +1,36 @@ +get()->each(function ($orders) { + DB::table('orders')->where('id', $orders->id)->update([ + 'total' => $orders->total * 100, + ]); + }); + // * Delete lone negative order amount. + DB::table('orders')->where('id', 2096)->delete(); + Schema::table('orders', function (Blueprint $table) { + $table->integer('total')->unsigned()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_28_101213_convert_product_prices_as_int.php b/database/migrations/2026_05_28_101213_convert_product_prices_as_int.php new file mode 100644 index 00000000..ce7ddf12 --- /dev/null +++ b/database/migrations/2026_05_28_101213_convert_product_prices_as_int.php @@ -0,0 +1,29 @@ +get()->each(function ($product) { + DB::table('products')->where('id', $product->id)->update([ + 'price' => $product->price * 100, + ]); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_28_101213_rename_columns_on_discount_table.php b/database/migrations/2026_05_28_101213_rename_columns_on_discount_table.php new file mode 100644 index 00000000..d965b467 --- /dev/null +++ b/database/migrations/2026_05_28_101213_rename_columns_on_discount_table.php @@ -0,0 +1,29 @@ +renameColumn('discount_value', 'value'); + $table->renameColumn('discount_type', 'type'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_05_28_102411_consolidate_order_lines.php b/database/migrations/2026_05_28_102411_consolidate_order_lines.php new file mode 100644 index 00000000..d26ff89e --- /dev/null +++ b/database/migrations/2026_05_28_102411_consolidate_order_lines.php @@ -0,0 +1,163 @@ +get()->each(function ($line) { + DB::table('order_lines')->where('id', $line->id)->update([ + 'unit_price' => $line->unit_price * 100, + 'unit_tax' => $line->unit_tax * 100, + 'unit_discount' => $line->unit_discount * 100, + 'tax_rate' => match ($line->tax_rate) { + // * Enum TaxRate + 20.0 => 1, + 5.5 => 2, + default => throw new \UnexpectedValueException( + "unhandled value '{$line->tax_rate}' for tax_rate" + ) + }, + 'total_ttc' => $line->total_ttc * 100, + 'total_ht' => $line->total_ht * 100, + 'total_tax' => $line->total_tax * 100, + 'total_discount' => $line->total_discount * 100, + ]); + }); + + Schema::table('order_lines', function (Blueprint $table) { + $table->integer('unit_price')->unsigned()->change(); + $table->integer('unit_tax')->unsigned()->change(); + $table->integer('unit_discount')->unsigned()->change(); + $table->smallInteger('tax_rate')->unsigned()->change(); + $table->integer('total_ttc')->unsigned()->change(); + $table->integer('total_ht')->unsigned()->change(); + $table->integer('total_tax')->unsigned()->change(); + $table->integer('total_discount')->unsigned()->change(); + }); + + Schema::table('order_lines', function (Blueprint $table) { + $table->dropColumn('commentaire'); + $table->dropForeign('order_lines_order_id_foreign'); + $table->dropForeign('order_lines_product_id_foreign'); + $table->foreign(['order_id'])->references('id')->on('orders') + ->cascadeOnUpdate()->cascadeOnDelete(); + $table->json('product')->after('order_id')->comment('Domain\Models\ValueObjects\OrderLineProduct'); + }); + + DB::table('order_lines') + ->join('products', 'order_lines.product_id', '=', 'products.id') + ->join('product_incos', 'products.id', '=', 'product_incos.product_id') + ->get([ + 'order_lines.id', + 'order_lines.tax_rate', + 'products.id as prod_id', + 'products.picture', + 'product_incos.no_art', + 'products.discount_id', + 'products.reference', + 'products.name', + 'products.brand', + 'products.weight', + 'products.weight_unit', + 'products.weight_variable', + 'products.order_unit', + 'products.price', + 'products.invoicing_unit', + 'products.status', + ])->each(function ($line) { + $discount = DB::table('discounts')->where('id', $line->discount_id)->first(); + + $discountedPrice = match ($discount?->type ?? null) { + null => null, + 1 => $this->calculateAmountDiscount((int) $line->price, $discount->value), + 2 => $this->calculatePercentDiscount((int) $line->price, $discount->value), + }; + + $priceKgTtc = $this->calculatePriceKgTtc( + basePriceHt: $discountedPrice ?? (int) $line->price, + taxRateEnum: $line->tax_rate, + status: (bool) $line->status, + invoicingUnit: $line->invoicing_unit, + weight: (int) $line->weight, + weightUnit: $line->weight_unit + ); + + $actualTaxRate = match ($line->tax_rate) { + 1 => 20.0, + 2 => 5.5, + default => 0.0, + }; + + DB::table('order_lines')->where('id', $line->id)->update([ + 'product' => json_encode([ + 'inco_id' => $line->no_art, + 'reference' => $line->reference, + 'name' => $line->name, + 'brand' => $line->brand, + 'weight' => $line->weight, + 'weight_unit' => $line->weight_unit, + 'weight_variable' => $line->weight_variable, + 'order_unit' => $line->order_unit, + 'price' => (int) $line->price, + 'discounted_price' => $discountedPrice, + 'price_kg_ttc' => $priceKgTtc, + 'tax_rate' => $actualTaxRate, + 'original_id' => $line->prod_id, + 'picture' => $line->picture, + ], \JSON_THROW_ON_ERROR | \JSON_UNESCAPED_SLASHES), + ]); + }); + + Schema::table('order_lines', function (Blueprint $table) { + $table->dropColumn('product_id'); + }); + } + + // * A ce moment Cart Calculator est arrondi à deux decimales + + private function calculatePercentDiscount(int $price, int $percentBy100): int + { + $percent = $percentBy100 / 100; + + // * Arrondir a deux décimales et tronquer comme dans le calculator. + return intval(round($price * ($percent / 100), 2)); + } + + private function calculateAmountDiscount(int $priceInCents, int $amountInCents): int + { + return $priceInCents - $amountInCents; + } + + private function calculatePriceKgTtc(int $basePriceHt, int $taxRateEnum, bool $status, string | int | null $invoicingUnit, int $weight, string | int | null $weightUnit): int + { + $taxMultiplier = match ($taxRateEnum) { + 1 => 1.20, // 20% + 2 => 1.055, // 5.5% + default => 1.0, + }; + + $priceTtc = $basePriceHt * $taxMultiplier; + + if ($status && $invoicingUnit === 'PCE' && $weight > 0) { + $weightInGrams = $weightUnit === 'KG' ? $weight * 1000 : $weight; + $ratio = 1000 / $weightInGrams; + + return intval(round($priceTtc * $ratio)); + } + + return intval(round($priceTtc)); + } +}; diff --git a/database/migrations/2026_06_01_130113_update_sliders_links.php b/database/migrations/2026_06_01_130113_update_sliders_links.php new file mode 100644 index 00000000..58c9ab3f --- /dev/null +++ b/database/migrations/2026_06_01_130113_update_sliders_links.php @@ -0,0 +1,36 @@ +where('link', 'https://www.laboutiquedecocotte.fr/produits?search=Lou%C3%A9') + ->update([ + 'link' => '/produits?brand[]=loue', + 'link_label' => 'Volailles de Loué', + ]); + DB::table('slides') + ->where('link', 'https://www.laboutiquedecocotte.fr/produits?search=le+gaulois') + ->update([ + 'link' => '/produits?brand[]=legaulois', + 'link_label' => 'Produits Le Gaulois', + ]); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_06_01_150709_update_page_title.php b/database/migrations/2026_06_01_150709_update_page_title.php new file mode 100644 index 00000000..ddae3044 --- /dev/null +++ b/database/migrations/2026_06_01_150709_update_page_title.php @@ -0,0 +1,27 @@ +where(['title' => 'CONDITIONS GENERALES DE VENTE']) + ->update(['title' => 'Conditions Generales de Vente']); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_06_03_143713_add_short_description_to_products_table.php b/database/migrations/2026_06_03_143713_add_short_description_to_products_table.php new file mode 100644 index 00000000..16d3810d --- /dev/null +++ b/database/migrations/2026_06_03_143713_add_short_description_to_products_table.php @@ -0,0 +1,58 @@ +text('short_description')->nullable()->after('description'); + }); + + DB::table('products')->orderBy('id')->chunk(100, function ($products) { + foreach ($products as $product) { + if (empty($product->description)) { + continue; + } + + $shortDescription = null; + + if (preg_match('/]*>(.*?)<\/p>/is', $product->description, $matches)) { + $shortDescription = trim(strip_tags($matches[1])); + + $shortDescription = html_entity_decode($shortDescription); + } + + if (empty($shortDescription) && ! empty($product->description)) { + $shortDescription = Str::of($product->description)->stripTags()->limit(150, ''); + } + + DB::table('products') + ->where('id', $product->id) + ->update([ + 'short_description' => $shortDescription ?: null, + ]); + } + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('products', function (Blueprint $blueprint) { + $blueprint->dropColumn('short_description'); + }); + } +}; diff --git a/database/migrations/2026_06_04_154533_change_columns_to_int_on_products_table.php b/database/migrations/2026_06_04_154533_change_columns_to_int_on_products_table.php new file mode 100644 index 00000000..fd3a731a --- /dev/null +++ b/database/migrations/2026_06_04_154533_change_columns_to_int_on_products_table.php @@ -0,0 +1,32 @@ +integer('price')->change(); + $table->unsignedTinyInteger('tax_rate')->default(1)->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('products', function (Blueprint $table) { + $table->decimal('price', 8, 3)->change(); + $table->unsignedBigInteger('tax_rate')->default(1)->change(); + }); + } +}; diff --git a/database/migrations/2026_06_05_082126_strip_product_short_description.php b/database/migrations/2026_06_05_082126_strip_product_short_description.php new file mode 100644 index 00000000..03eaf640 --- /dev/null +++ b/database/migrations/2026_06_05_082126_strip_product_short_description.php @@ -0,0 +1,30 @@ +get()->each(function ($product) { + \DB::table('products')->where('id', $product->id) + ->update([ + 'short_description' => str(strval($product->short_description)) + ->limit(90, '...', true), + ]); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_06_05_112425_add_delivery_address_to_orders.php b/database/migrations/2026_06_05_112425_add_delivery_address_to_orders.php new file mode 100644 index 00000000..490d71d9 --- /dev/null +++ b/database/migrations/2026_06_05_112425_add_delivery_address_to_orders.php @@ -0,0 +1,73 @@ +json('delivery_address')->nullable()->after('employee'); + }); + + DB::table('timeslots') + ->join('shops', 'timeslots.shop_id', '=', 'shops.id') + ->select('timeslots.id as timeslot_id', 'timeslots.order_id', 'shops.*') + ->orderBy('timeslots.id') + ->chunkById(500, function ($records) { + foreach ($records as $record) { + $payload = json_encode([ + 'name' => ! empty($record->name) ? $record->name : self::DEFAULT_NAME, + 'address' => ! empty($record->address) ? $record->address : self::DEFAULT_ADDRESS, + 'postcode' => ! empty($record->postcode) ? $record->postcode : self::DEFAULT_POSTCODE, + 'city' => ! empty($record->city) ? $record->city : self::DEFAULT_CITY, + 'phone' => $record->phone ?? null, + 'latitude' => $record->latitude ?? null, + 'longitude' => $record->longitude ?? null, + ], JSON_UNESCAPED_UNICODE); + + DB::table('orders') + ->where('id', $record->order_id) + ->update(['delivery_address' => $payload]); + } + }, 'timeslots.id', 'timeslot_id'); + + $defaultPayload = json_encode([ + 'name' => self::DEFAULT_NAME, + 'address' => self::DEFAULT_ADDRESS, + 'postcode' => self::DEFAULT_POSTCODE, + 'city' => self::DEFAULT_CITY, + 'phone' => null, + 'latitude' => null, + 'longitude' => null, + ], JSON_UNESCAPED_UNICODE); + + DB::table('orders') + ->whereNull('delivery_address') + ->update(['delivery_address' => $defaultPayload]); + + Schema::table('orders', function (Blueprint $table) { + $table->json('delivery_address')->nullable(false)->change(); + }); + } + + public function down(): void + { + Schema::table('orders', function (Blueprint $table) { + $table->dropColumn('delivery_address'); + }); + } +}; diff --git a/database/migrations/2026_06_06_181952_migrate_products_to_uuidv7.php b/database/migrations/2026_06_06_181952_migrate_products_to_uuidv7.php new file mode 100644 index 00000000..a1faf9d1 --- /dev/null +++ b/database/migrations/2026_06_06_181952_migrate_products_to_uuidv7.php @@ -0,0 +1,190 @@ +addTemporaryUuidColumn('products'); + $productMap = $this->generateProductUuids(); + + $this->makeUuidColumnRequired('products'); + + $this->updateOrderLinesJson($productMap); + + $productFkTables = ['product_incos', 'product_tag', 'stats']; + $this->updateForeignKeysForTables($productFkTables, 'products', 'product_id'); + + $this->updateProductProductTable(); + + $this->swapIdColumn('products'); + + $this->recreateForeignKeys($productFkTables, 'product_id', 'id', 'products'); + + Schema::table('product_product', function (Blueprint $table) { + $table->foreign('product_id')->references('id')->on('products')->cascadeOnDelete(); + $table->foreign('associated_id')->references('id')->on('products')->cascadeOnDelete(); + }); + + Schema::enableForeignKeyConstraints(); + } + + /** + * @throws \RuntimeException + */ + public function down(): void + { + throw new \RuntimeException( + 'This migration is irreversible: the transformation of products from integer IDs to UUIDv7 cannot be rolled back.' + ); + } + + private function dropForeignKeysForColumn(string $tableName, string $columnName): void + { + $fks = Schema::getForeignKeys($tableName); + foreach ($fks as $fk) { + if (in_array($columnName, $fk['columns'])) { + Schema::table($tableName, function (Blueprint $table) use ($fk) { + $table->dropForeign($fk['name']); + }); + } + } + } + + private function recreateForeignKeys(array $tables, string $columnName, string $references, string $onTable): void + { + foreach ($tables as $tableName) { + Schema::table($tableName, function (Blueprint $table) use ($columnName, $references, $onTable) { + $table->foreign($columnName)->references($references)->on($onTable)->cascadeOnDelete(); + }); + } + } + + private function addTemporaryUuidColumn(string $tableName): void + { + Schema::table($tableName, function (Blueprint $table) { + $table->uuid('uuid')->nullable()->after('id'); + }); + } + + private function makeUuidColumnRequired(string $tableName): void + { + Schema::table($tableName, function (Blueprint $table) { + $table->uuid('uuid')->nullable(false)->change(); + }); + } + + private function generateProductUuids(): array + { + $products = DB::table('products')->get(['id', 'reference', 'created_at']); + $productMap = []; + + foreach ($products as $product) { + $createdAt = $product->created_at ? Carbon::parse($product->created_at) : now(); + $uuid = UuidV7::generate($createdAt->toDateTimeImmutable()); + $productMap[$product->id] = ['uuid' => $uuid, 'reference' => $product->reference]; + + DB::table('products')->where('id', $product->id)->update(['uuid' => $uuid]); + } + + return $productMap; + } + + private function updateOrderLinesJson(array $productMap): void + { + $orderLines = DB::table('order_lines')->get(['id', 'product']); + foreach ($orderLines as $line) { + $productData = json_decode($line->product, true); + if (isset($productData['reference'])) { + $oldRef = $productData['reference']; + unset($productData['reference']); + + $foundUuid = null; + foreach ($productMap as $p) { + if ((string) $p['reference'] === (string) $oldRef) { + $foundUuid = $p['uuid']; + break; + } + } + + if ($foundUuid) { + $productData['original_id'] = UuidV7::fromString($foundUuid)->toBase58(); + } else { + $productData['original_id'] = $oldRef; + } + + DB::table('order_lines')->where('id', $line->id)->update([ + 'product' => json_encode($productData, JSON_UNESCAPED_SLASHES), + ]); + } + } + } + + private function updateForeignKeysForTables(array $tables, string $parentTable, string $columnName): void + { + $newColumn = 'new_' . $columnName; + foreach ($tables as $tableName) { + Schema::table($tableName, function (Blueprint $table) use ($newColumn, $columnName) { + $table->uuid($newColumn)->nullable()->after($columnName); + }); + + DB::table($tableName) + ->join($parentTable, "{$tableName}.{$columnName}", '=', "{$parentTable}.id") + ->update(["{$tableName}.{$newColumn}" => DB::raw("{$parentTable}.uuid")]); + + $this->dropForeignKeysForColumn($tableName, $columnName); + + Schema::table($tableName, function (Blueprint $table) use ($newColumn, $columnName) { + $table->dropColumn($columnName); + $table->renameColumn($newColumn, $columnName); + $table->uuid($columnName)->nullable(false)->change(); + }); + } + } + + private function updateProductProductTable(): void + { + Schema::table('product_product', function (Blueprint $table) { + $table->uuid('new_product_id')->nullable()->after('product_id'); + $table->uuid('new_associated_id')->nullable()->after('associated_id'); + }); + + DB::table('product_product') + ->join('products as p1', 'product_product.product_id', '=', 'p1.id') + ->join('products as p2', 'product_product.associated_id', '=', 'p2.id') + ->update([ + 'product_product.new_product_id' => DB::raw('p1.uuid'), + 'product_product.new_associated_id' => DB::raw('p2.uuid'), + ]); + + $this->dropForeignKeysForColumn('product_product', 'product_id'); + $this->dropForeignKeysForColumn('product_product', 'associated_id'); + + Schema::table('product_product', function (Blueprint $table) { + $table->dropColumn(['product_id', 'associated_id']); + $table->renameColumn('new_product_id', 'product_id'); + $table->renameColumn('new_associated_id', 'associated_id'); + $table->uuid('product_id')->nullable(false)->change(); + $table->uuid('associated_id')->nullable(false)->change(); + }); + } + + private function swapIdColumn(string $tableName): void + { + Schema::table($tableName, function (Blueprint $table) { + $table->dropColumn(['id', 'reference', 'created_at']); + $table->renameColumn('uuid', 'id'); + $table->primary('id'); + }); + } +}; diff --git a/database/migrations/2026_06_06_181953_migrate_orders_to_uuidv7.php b/database/migrations/2026_06_06_181953_migrate_orders_to_uuidv7.php new file mode 100644 index 00000000..5d3b4594 --- /dev/null +++ b/database/migrations/2026_06_06_181953_migrate_orders_to_uuidv7.php @@ -0,0 +1,119 @@ +addTemporaryUuidColumn('orders'); + $this->generateOrderUuids(); + + $this->makeUuidColumnRequired('orders'); + + $orderFkTables = ['order_lines', 'timeslots']; + $this->updateForeignKeysForTables($orderFkTables, 'orders', 'order_id'); + + $this->swapIdColumn('orders'); + + $this->recreateForeignKeys($orderFkTables, 'order_id', 'id', 'orders'); + + Schema::enableForeignKeyConstraints(); + } + + /** + * @throws \RuntimeException + */ + public function down(): void + { + throw new \RuntimeException( + 'This migration is irreversible: the transformation of orders from integer IDs to UUIDv7 cannot be rolled back.' + ); + } + + private function dropForeignKeysForColumn(string $tableName, string $columnName): void + { + $fks = Schema::getForeignKeys($tableName); + foreach ($fks as $fk) { + if (in_array($columnName, $fk['columns'])) { + Schema::table($tableName, function (Blueprint $table) use ($fk) { + $table->dropForeign($fk['name']); + }); + } + } + } + + private function recreateForeignKeys(array $tables, string $columnName, string $references, string $onTable): void + { + foreach ($tables as $tableName) { + Schema::table($tableName, function (Blueprint $table) use ($columnName, $references, $onTable) { + $table->foreign($columnName)->references($references)->on($onTable)->cascadeOnDelete(); + }); + } + } + + private function addTemporaryUuidColumn(string $tableName): void + { + Schema::table($tableName, function (Blueprint $table) { + $table->uuid('uuid')->nullable()->after('id'); + }); + } + + private function makeUuidColumnRequired(string $tableName): void + { + Schema::table($tableName, function (Blueprint $table) { + $table->uuid('uuid')->nullable(false)->change(); + }); + } + + private function generateOrderUuids(): void + { + $orders = DB::table('orders')->get(['id', 'created_at']); + + foreach ($orders as $order) { + $createdAt = $order->created_at ? Carbon::parse($order->created_at) : now(); + $uuid = UuidV7::generate($createdAt->toDateTimeImmutable()); + DB::table('orders')->where('id', $order->id)->update(['uuid' => $uuid]); + } + } + + private function updateForeignKeysForTables(array $tables, string $parentTable, string $columnName): void + { + $newColumn = 'new_' . $columnName; + foreach ($tables as $tableName) { + Schema::table($tableName, function (Blueprint $table) use ($newColumn, $columnName) { + $table->uuid($newColumn)->nullable()->after($columnName); + }); + + DB::table($tableName) + ->join($parentTable, "{$tableName}.{$columnName}", '=', "{$parentTable}.id") + ->update(["{$tableName}.{$newColumn}" => DB::raw("{$parentTable}.uuid")]); + + $this->dropForeignKeysForColumn($tableName, $columnName); + + Schema::table($tableName, function (Blueprint $table) use ($newColumn, $columnName) { + $table->dropColumn($columnName); + $table->renameColumn($newColumn, $columnName); + $table->uuid($columnName)->nullable(false)->change(); + }); + } + } + + private function swapIdColumn(string $tableName): void + { + Schema::table($tableName, function (Blueprint $table) { + $table->dropColumn(['id', 'reference', 'created_at']); + $table->renameColumn('uuid', 'id'); + $table->primary('id'); + }); + } +}; diff --git a/database/migrations/2026_06_07_072414_migrate_customers_to_uuidv7.php b/database/migrations/2026_06_07_072414_migrate_customers_to_uuidv7.php new file mode 100644 index 00000000..afd3ce7c --- /dev/null +++ b/database/migrations/2026_06_07_072414_migrate_customers_to_uuidv7.php @@ -0,0 +1,130 @@ +addTemporaryUuidColumn('customers'); + $this->generateCustomerUuids(); + + $this->makeUuidColumnRequired('customers'); + + $customerFkTables = ['employees']; + $this->updateForeignKeysForTables($customerFkTables, 'customers', 'customer_id'); + + $this->changeHashcodeColumnToUuid('customers'); + $this->swapIdColumn('customers'); + + $this->recreateForeignKeys($customerFkTables, 'customer_id', 'id', 'customers'); + + Schema::enableForeignKeyConstraints(); + } + + /** + * @throws \RuntimeException + */ + public function down(): void + { + throw new \RuntimeException( + 'This migration is irreversible: the transformation of customers from integer IDs to UUIDv7 cannot be rolled back.' + ); + } + + private function dropForeignKeysForColumn(string $tableName, string $columnName): void + { + $fks = Schema::getForeignKeys($tableName); + foreach ($fks as $fk) { + if (in_array($columnName, $fk['columns'])) { + Schema::table($tableName, function (Blueprint $table) use ($fk) { + $table->dropForeign($fk['name']); + }); + } + } + } + + private function recreateForeignKeys(array $tables, string $columnName, string $references, string $onTable): void + { + foreach ($tables as $tableName) { + Schema::table($tableName, function (Blueprint $table) use ($columnName, $references, $onTable) { + // Assuming cascadeOnUpdate()->nullOnDelete() based on earlier migrations, + // or just cascadeOnDelete() if that's what we want. + // Looking at old table for employees it was cascadeOnUpdate()->nullOnDelete(). + $table->foreign($columnName)->references($references)->on($onTable)->cascadeOnUpdate()->nullOnDelete(); + }); + } + } + + private function addTemporaryUuidColumn(string $tableName): void + { + Schema::table($tableName, function (Blueprint $table) { + $table->uuid('uuid')->nullable()->after('id'); + }); + } + + private function makeUuidColumnRequired(string $tableName): void + { + Schema::table($tableName, function (Blueprint $table) { + $table->uuid('uuid')->nullable(false)->change(); + }); + } + + private function generateCustomerUuids(): void + { + $customers = DB::table('customers')->get(['id', 'created_at']); + + foreach ($customers as $customer) { + $createdAt = $customer->created_at ? Carbon::parse($customer->created_at) : now(); + $uuid = UuidV7::generate($createdAt->toDateTimeImmutable()); + DB::table('customers')->where('id', $customer->id)->update(['uuid' => $uuid]); + } + } + + private function updateForeignKeysForTables(array $tables, string $parentTable, string $columnName): void + { + $newColumn = 'new_' . $columnName; + foreach ($tables as $tableName) { + Schema::table($tableName, function (Blueprint $table) use ($newColumn, $columnName) { + $table->uuid($newColumn)->nullable()->after($columnName); + }); + + DB::table($tableName) + ->join($parentTable, "{$tableName}.{$columnName}", '=', "{$parentTable}.id") + ->update(["{$tableName}.{$newColumn}" => DB::raw("{$parentTable}.uuid")]); + + $this->dropForeignKeysForColumn($tableName, $columnName); + + Schema::table($tableName, function (Blueprint $table) use ($newColumn, $columnName) { + $table->dropColumn($columnName); + $table->renameColumn($newColumn, $columnName); + $table->uuid($columnName)->nullable()->change(); // customer_id in employees is nullable + }); + } + } + + private function changeHashcodeColumnToUuid(string $tableName): void + { + Schema::table($tableName, function (Blueprint $table) { + $table->uuid('hashcode')->nullable(false)->change(); + }); + } + + private function swapIdColumn(string $tableName): void + { + Schema::table($tableName, function (Blueprint $table) { + $table->dropColumn('id'); + $table->renameColumn('uuid', 'id'); + $table->primary('id'); + }); + } +}; diff --git a/database/migrations/2026_06_07_172027_drop_date_column_from_orders_table.php b/database/migrations/2026_06_07_172027_drop_date_column_from_orders_table.php new file mode 100644 index 00000000..c22a5c45 --- /dev/null +++ b/database/migrations/2026_06_07_172027_drop_date_column_from_orders_table.php @@ -0,0 +1,30 @@ +dropColumn('date'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('orders', function (Blueprint $table) { + $table->date('date')->nullable(); + }); + } +}; diff --git a/database/migrations/2026_06_07_175730_add_reference_to_orders_table.php b/database/migrations/2026_06_07_175730_add_reference_to_orders_table.php new file mode 100644 index 00000000..8ab76e1e --- /dev/null +++ b/database/migrations/2026_06_07_175730_add_reference_to_orders_table.php @@ -0,0 +1,46 @@ +string('reference')->nullable()->after('id'); + }); + + DB::table('orders')->orderBy('id') + ->chunk(100, function ($orders) { + foreach ($orders as $order) { + $reference = UidUuid::fromString($order->id)->toBase58(); + DB::table('orders') + ->where('id', $order->id) + ->update(['reference' => $reference]); + } + }); + + Schema::table('orders', function (Blueprint $table) { + $table->string('reference')->nullable(false)->unique()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('orders', function (Blueprint $table) { + $table->dropColumn('reference'); + }); + } +}; diff --git a/database/migrations/2026_06_07_180625_simplify_timeslot_into_orders.php b/database/migrations/2026_06_07_180625_simplify_timeslot_into_orders.php new file mode 100644 index 00000000..eebfd609 --- /dev/null +++ b/database/migrations/2026_06_07_180625_simplify_timeslot_into_orders.php @@ -0,0 +1,39 @@ +foreignId('shop_id')->after('id')->nullable()->constrained('shops')->nullOnDelete(); + $table->date('pickup_day')->after('delivery_address')->nullable(); + }); + + DB::table('orders') + ->join('timeslots', 'orders.id', '=', 'timeslots.order_id') + ->update([ + 'orders.shop_id' => DB::raw('timeslots.shop_id'), + 'orders.pickup_day' => DB::raw('timeslots.day'), + ]); + + Schema::dropIfExists('timeslots'); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_06_07_193825_update_shop_employee_exception_table.php b/database/migrations/2026_06_07_193825_update_shop_employee_exception_table.php new file mode 100644 index 00000000..34666584 --- /dev/null +++ b/database/migrations/2026_06_07_193825_update_shop_employee_exception_table.php @@ -0,0 +1,46 @@ +string('matricule')->nullable(); + }); + + DB::statement(' + UPDATE shop_employee_exception + JOIN employees ON employees.id = shop_employee_exception.employee_id + SET shop_employee_exception.matricule = employees.matricule + '); + + Schema::table('shop_employee_exception', function (Blueprint $table) { + $table->dropForeign(['employee_id']); + $table->dropPrimary(); + $table->dropColumn('employee_id'); + + $table->string('matricule')->nullable(false)->change(); + $table->primary(['matricule', 'shop_id']); + $table->foreign('matricule')->references('matricule') + ->on('employees')->cascadeOnUpdate()->cascadeOnDelete(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_06_08_164207_add_employee_matricule_virtual_index_to_orders_table.php b/database/migrations/2026_06_08_164207_add_employee_matricule_virtual_index_to_orders_table.php new file mode 100644 index 00000000..404e2f83 --- /dev/null +++ b/database/migrations/2026_06_08_164207_add_employee_matricule_virtual_index_to_orders_table.php @@ -0,0 +1,30 @@ +string('employee_matricule')->virtualAs("JSON_UNQUOTE(JSON_EXTRACT(employee, '$.matricule'))")->index(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('orders', function (Blueprint $table) { + $table->dropColumn('employee_matricule'); + }); + } +}; diff --git a/database/migrations/2026_06_10_221046_make_invoicing_and_sell_unit_not_nullable_on_products_table.php b/database/migrations/2026_06_10_221046_make_invoicing_and_sell_unit_not_nullable_on_products_table.php new file mode 100644 index 00000000..e73043c5 --- /dev/null +++ b/database/migrations/2026_06_10_221046_make_invoicing_and_sell_unit_not_nullable_on_products_table.php @@ -0,0 +1,32 @@ +string('invoicing_unit')->nullable(false)->change(); + $table->string('sell_unit')->nullable(false)->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('products', function (Blueprint $table) { + $table->string('invoicing_unit')->nullable()->change(); + $table->string('sell_unit')->nullable()->change(); + }); + } +}; diff --git a/database/migrations/2026_06_11_091414_move_invalid_orders_and_make_employee_non_nullable.php b/database/migrations/2026_06_11_091414_move_invalid_orders_and_make_employee_non_nullable.php new file mode 100644 index 00000000..85e347a7 --- /dev/null +++ b/database/migrations/2026_06_11_091414_move_invalid_orders_and_make_employee_non_nullable.php @@ -0,0 +1,56 @@ +uuid('id')->primary(); + $table->unsignedBigInteger('shop_id')->nullable(); + $table->string('reference')->unique(); + $table->json('employee')->nullable()->comment('Domain\ValueObjects\OrderEmployee'); + $table->json('delivery_address'); + $table->date('pickup_day')->nullable(); + $table->unsignedInteger('total'); + $table->unsignedBigInteger('status'); + $table->timestamp('updated_at')->nullable(); + $table->string('employee_matricule')->virtualAs("JSON_UNQUOTE(JSON_EXTRACT(employee, '$.matricule'))")->index(); + }); + + $invalidOrders = DB::table('orders')->whereNull('employee')->get(); + $insertData = collect($invalidOrders)->map(function ($order) { + $data = (array) $order; + unset($data['employee_matricule']); + + return $data; + })->toArray(); + + if (! empty($insertData)) { + DB::table('invalid_orders')->insert($insertData); + } + + DB::table('orders')->whereNull('employee')->delete(); + + Schema::table('orders', function (Blueprint $table) { + $table->json('employee')->nullable(false)->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_06_11_104029_add_last_login_at_to_customers_table.php b/database/migrations/2026_06_11_104029_add_last_login_at_to_customers_table.php new file mode 100644 index 00000000..2134910e --- /dev/null +++ b/database/migrations/2026_06_11_104029_add_last_login_at_to_customers_table.php @@ -0,0 +1,30 @@ +timestamp('last_login_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('customers', function (Blueprint $table) { + $table->dropColumn('last_login_at'); + }); + } +}; diff --git a/database/migrations/2026_06_11_160000_migrate_weights_to_grams.php b/database/migrations/2026_06_11_160000_migrate_weights_to_grams.php new file mode 100644 index 00000000..6339d447 --- /dev/null +++ b/database/migrations/2026_06_11_160000_migrate_weights_to_grams.php @@ -0,0 +1,80 @@ + + */ + private const UNIT_TO_GRAMS = [ + 'G' => 1, + 'KG' => 1000, + 'T' => 1_000_000, + ]; + + public function up(): void + { + $this->migrateOrderLineWeights(); + $this->migrateProductWeights(); + + Schema::table('products', function (Blueprint $table) { + $table->unsignedInteger('weight')->nullable()->default(null)->change(); + $table->dropColumn('weight_unit'); + }); + } + + private function migrateProductWeights(): void + { + DB::table('products') + ->where('weight_unit', 'KG') + ->update(['weight' => DB::raw('weight * 1000')]); + + DB::table('products') + ->where('weight_unit', 'T') + ->update(['weight' => DB::raw('weight * 1000000')]); + } + + private function migrateOrderLineWeights(): void + { + DB::table('order_lines') + ->whereNotNull('product') + ->orderBy('id') + ->chunk(500, function ($lines): void { + foreach ($lines as $line) { + $data = json_decode($line->product, true); + + if (! is_array($data) || ! isset($data['weight'])) { + continue; + } + + $unit = strtoupper((string) ($data['weight_unit'] ?? 'G')); + $factor = self::UNIT_TO_GRAMS[$unit] ?? 1; + + // * Convert to grams + $data['weight'] = (int) round((float) $data['weight'] * $factor); + + // * Remove weight_unit + unset($data['weight_unit']); + + DB::table('order_lines') + ->where('id', $line->id) + ->update([ + 'product' => json_encode($data, JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES), + ]); + } + }); + } + + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_06_12_120149_convert_weight_variable_to_boolean_in_order_lines_product.php b/database/migrations/2026_06_12_120149_convert_weight_variable_to_boolean_in_order_lines_product.php new file mode 100644 index 00000000..dd0ff80b --- /dev/null +++ b/database/migrations/2026_06_12_120149_convert_weight_variable_to_boolean_in_order_lines_product.php @@ -0,0 +1,41 @@ +orderBy('id')->chunk(500, function ($lines) { + foreach ($lines as $line) { + if (! is_string($line->product)) { + continue; + } + + $product = json_decode($line->product, true); + + if (isset($product['weight_variable']) && is_int($product['weight_variable'])) { + $product['weight_variable'] = (bool) $product['weight_variable']; + + DB::table('order_lines') + ->where('id', $line->id) + ->update(['product' => json_encode($product, \JSON_UNESCAPED_SLASHES)]); + } + } + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_06_12_122322_populate_null_discounted_price_in_order_lines_product.php b/database/migrations/2026_06_12_122322_populate_null_discounted_price_in_order_lines_product.php new file mode 100644 index 00000000..51190c04 --- /dev/null +++ b/database/migrations/2026_06_12_122322_populate_null_discounted_price_in_order_lines_product.php @@ -0,0 +1,48 @@ +orderBy('id')->chunk(500, function ($lines) { + foreach ($lines as $line) { + if (! is_string($line->product)) { + continue; + } + + $product = json_decode($line->product, true); + $updated = false; + + // If discounted_price is null or missing, set it to price + if (! isset($product['discounted_price']) || $product['discounted_price'] === null || $product['discounted_price'] === '') { + if (isset($product['price'])) { + $product['discounted_price'] = $product['price']; + $updated = true; + } + } + + if ($updated) { + DB::table('order_lines') + ->where('id', $line->id) + ->update(['product' => json_encode($product, \JSON_UNESCAPED_SLASHES)]); + } + } + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_06_13_151618_migrate_shops_and_pickup_exceptions_to_uuidv7.php b/database/migrations/2026_06_13_151618_migrate_shops_and_pickup_exceptions_to_uuidv7.php new file mode 100644 index 00000000..87e77644 --- /dev/null +++ b/database/migrations/2026_06_13_151618_migrate_shops_and_pickup_exceptions_to_uuidv7.php @@ -0,0 +1,183 @@ +addTemporaryUuidColumn('shops'); + $this->generateUuidsForTable('shops'); + $this->makeUuidColumnRequired('shops'); + + $shopFkTables = [ + 'orders' => ['onDelete' => 'set null', 'nullable' => true], + 'shop_employee_exception' => ['onDelete' => 'cascade', 'nullable' => false], + 'shop_employees' => ['onDelete' => 'cascade', 'nullable' => false], + 'shop_pickup_exception' => ['onDelete' => 'cascade', 'nullable' => false], + ]; + $this->updateForeignKeysForTables($shopFkTables, 'shops', 'shop_id'); + $this->recreatePrimaryAndUniqueKeys($shopFkTables, 'shop_id'); + $this->swapIdColumn('shops'); + $this->recreateForeignKeys($shopFkTables, 'shop_id', 'id', 'shops'); + + // * Process Pickup Exceptions + $this->addTemporaryUuidColumn('pickup_exceptions'); + $this->generateUuidsForTable('pickup_exceptions'); + $this->makeUuidColumnRequired('pickup_exceptions'); + + $pickupExceptionFkTables = [ + 'shop_pickup_exception' => ['onDelete' => 'cascade', 'nullable' => false], + ]; + $this->updateForeignKeysForTables($pickupExceptionFkTables, 'pickup_exceptions', 'pickup_exception_id'); + $this->recreatePrimaryAndUniqueKeys($pickupExceptionFkTables, 'pickup_exception_id'); + $this->swapIdColumn('pickup_exceptions'); + $this->recreateForeignKeys($pickupExceptionFkTables, 'pickup_exception_id', 'id', 'pickup_exceptions'); + + Schema::enableForeignKeyConstraints(); + } + + /** + * @throws \RuntimeException + */ + public function down(): void + { + throw new \RuntimeException( + 'This migration is irreversible: the transformation of shops and pickup exceptions from integer IDs to UUIDv7 cannot be rolled back.' + ); + } + + private function dropForeignKeysForColumn(string $tableName, string $columnName): void + { + $database = DB::getDatabaseName(); + + $foreignKeys = DB::table('information_schema.KEY_COLUMN_USAGE') + ->select('CONSTRAINT_NAME') + ->where('TABLE_SCHEMA', $database) + ->where('TABLE_NAME', $tableName) + ->where('COLUMN_NAME', $columnName) + ->whereNotNull('REFERENCED_TABLE_NAME') + ->distinct() + ->pluck('CONSTRAINT_NAME'); + + foreach ($foreignKeys as $foreignKeyName) { + DB::statement(sprintf( + 'ALTER TABLE `%s` DROP FOREIGN KEY `%s`', + $tableName, + $foreignKeyName + )); + } + } + + private function recreateForeignKeys(array $tables, string $columnName, string $references, string $onTable): void + { + foreach ($tables as $tableName => $options) { + Schema::table($tableName, function (Blueprint $table) use ($columnName, $references, $onTable, $options) { + $fk = $table->foreign($columnName)->references($references)->on($onTable)->onUpdate('cascade'); + if ($options['onDelete'] === 'cascade') { + $fk->cascadeOnDelete(); + } elseif ($options['onDelete'] === 'set null') { + $fk->nullOnDelete(); + } + }); + } + } + + private function addTemporaryUuidColumn(string $tableName): void + { + Schema::table($tableName, function (Blueprint $table) { + $table->uuid('uuid')->nullable()->after('id'); + }); + } + + private function makeUuidColumnRequired(string $tableName): void + { + Schema::table($tableName, function (Blueprint $table) { + $table->uuid('uuid')->nullable(false)->change(); + }); + } + + private function generateUuidsForTable(string $tableName): void + { + $records = DB::table($tableName)->get(['id', 'created_at']); + + foreach ($records as $record) { + $createdAt = $record->created_at ? Carbon::parse($record->created_at) : now(); + $uuid = UuidV7::generate($createdAt->toDateTimeImmutable()); + DB::table($tableName)->where('id', $record->id)->update(['uuid' => $uuid]); + } + } + + private function updateForeignKeysForTables(array $tables, string $parentTable, string $columnName): void + { + $newColumn = 'new_' . $columnName; + foreach ($tables as $tableName => $options) { + Schema::table($tableName, function (Blueprint $table) use ($newColumn, $columnName) { + $table->uuid($newColumn)->nullable()->after($columnName); + }); + + DB::table($tableName) + ->join($parentTable, "{$tableName}.{$columnName}", '=', "{$parentTable}.id") + ->update(["{$tableName}.{$newColumn}" => DB::raw("{$parentTable}.uuid")]); + + $this->dropForeignKeysForColumn($tableName, $columnName); + if ($tableName === 'shop_employee_exception') { + $this->dropForeignKeysForColumn($tableName, 'matricule'); + } + + Schema::table($tableName, function (Blueprint $table) use ($newColumn, $columnName, $tableName) { + if ($tableName === 'shop_employee_exception') { + $table->dropPrimary(['matricule', 'shop_id']); + } + if ($tableName === 'shop_pickup_exception' && $columnName === 'shop_id') { + $table->dropUnique(['shop_id', 'pickup_exception_id']); + } + + $table->dropColumn($columnName); + $table->renameColumn($newColumn, $columnName); + }); + + Schema::table($tableName, function (Blueprint $table) use ($columnName, $options) { + if ($options['nullable']) { + $table->uuid($columnName)->nullable()->change(); + } else { + $table->uuid($columnName)->nullable(false)->change(); + } + }); + } + } + + private function recreatePrimaryAndUniqueKeys(array $tables, string $columnName): void + { + foreach ($tables as $tableName => $options) { + Schema::table($tableName, function (Blueprint $table) use ($tableName, $columnName) { + if ($tableName === 'shop_employee_exception') { + $table->primary(['matricule', 'shop_id']); + $table->foreign('matricule')->references('matricule')->on('employees')->cascadeOnDelete()->cascadeOnUpdate(); + } + if ($tableName === 'shop_pickup_exception' && $columnName === 'pickup_exception_id') { + $table->unique(['shop_id', 'pickup_exception_id']); + } + }); + } + } + + private function swapIdColumn(string $tableName): void + { + Schema::table($tableName, function (Blueprint $table) { + $table->dropColumn('id'); + $table->renameColumn('uuid', 'id'); + $table->primary('id'); + }); + } +}; diff --git a/database/migrations/2026_10_01_123336_add_last_sync_to_employees.php b/database/migrations/2026_10_01_123336_add_last_sync_to_employees.php new file mode 100644 index 00000000..42c48d8e --- /dev/null +++ b/database/migrations/2026_10_01_123336_add_last_sync_to_employees.php @@ -0,0 +1,30 @@ +timestamp('last_sync')->after('code')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('employees', function (Blueprint $table) { + $table->dropColumn('last_sync'); + }); + } +}; diff --git a/database/migrations/2026_10_01_150950_fix_employee_service_code.php b/database/migrations/2026_10_01_150950_fix_employee_service_code.php new file mode 100644 index 00000000..d7e3f3ef --- /dev/null +++ b/database/migrations/2026_10_01_150950_fix_employee_service_code.php @@ -0,0 +1,38 @@ +orderBy('id') + ->chunk(100, function ($employees) { + foreach ($employees as $employee) { + DB::table('employees') + ->where('id', $employee->id) + ->update([ + 'service' => Str::of($employee->service) + ->replaceFirst($employee->site, '') + ->replaceMatches('/[^\d]/', ''), + ]); + } + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_10_01_163000_create_settings_table.php b/database/migrations/2026_10_01_163000_create_settings_table.php new file mode 100644 index 00000000..d492bfe4 --- /dev/null +++ b/database/migrations/2026_10_01_163000_create_settings_table.php @@ -0,0 +1,38 @@ +id(); + $table->json('employee_sites')->nullable(); + $table->timestamps(); + }); + + DB::table('settings')->insert([ + 'id' => 1, + 'employee_sites' => json_encode([]), + 'created_at' => now(), + 'updated_at' => now(), + ]); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('settings'); + } +}; diff --git a/database/migrations/2026_10_02_130500_fix_ambiguous_employee_codes.php b/database/migrations/2026_10_02_130500_fix_ambiguous_employee_codes.php new file mode 100644 index 00000000..165b5719 --- /dev/null +++ b/database/migrations/2026_10_02_130500_fix_ambiguous_employee_codes.php @@ -0,0 +1,41 @@ +where('matricule', '0117621') + ->where('code', 'gd363CYO') + ->update(['code' => 'gd363CYQ']); + + DB::table('employees') + ->where('matricule', '0117628') + ->where('code', 'diHNo574') + ->update(['code' => 'djHNa574']); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + DB::table('employees') + ->where('matricule', '0117621') + ->where('code', 'gd363CYQ') + ->update(['code' => 'gd363CYO']); + + DB::table('employees') + ->where('matricule', '0117628') + ->where('code', 'djHNa574') + ->update(['code' => 'diHNo574']); + } +}; diff --git a/database/migrations/2026_10_02_143800_fix_orders_employee_column.php b/database/migrations/2026_10_02_143800_fix_orders_employee_column.php new file mode 100644 index 00000000..71ea7c97 --- /dev/null +++ b/database/migrations/2026_10_02_143800_fix_orders_employee_column.php @@ -0,0 +1,68 @@ +whereNotNull('employee') + ->orderBy('id') + ->chunk(500, function ($orders): void { + foreach ($orders as $order) { + $data = json_decode((string) $order->employee, true); + if (! is_array($data)) { + continue; + } + + $site = $data['site'] ?? ''; + $site = match ($site) { + 'LDC SERVICES' => 'LDCSER', + 'LDC VOLAILLES' => 'LDCVOL', + 'LDC TER' => 'LDCTER', + default => $site, + }; + $data['site'] = $site; + + $service = $data['service'] ?? ''; + $data['service'] = (string) Str::of((string) $service) + ->replaceFirst((string) $site, '') + ->replaceMatches('/[^\d]/', ''); + + DB::table('orders') + ->where('id', $order->id) + ->update([ + 'employee' => json_encode($data, JSON_THROW_ON_ERROR), + ]); + } + }); + + DB::table('employees') + ->where('site', 'LDC SERVICES') + ->update(['site' => 'LDCSER']); + + DB::table('employees') + ->where('site', 'LDC VOLAILLES') + ->update(['site' => 'LDCVOL']); + + DB::table('employees') + ->where('site', 'LDC TER') + ->update(['site' => 'LDCTER']); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + throw new \Error('WONT ROLLBACK'); + } +}; diff --git a/database/migrations/2026_10_02_222500_drop_xml_incos_table.php b/database/migrations/2026_10_02_222500_drop_xml_incos_table.php new file mode 100644 index 00000000..d4374b8e --- /dev/null +++ b/database/migrations/2026_10_02_222500_drop_xml_incos_table.php @@ -0,0 +1,25 @@ +key = 'accueil'; - $accueil->value = "Page d'accueil"; - $accueil->save(); - $contact = new Content(); - $contact->key = "contact"; - $contact->value = "Nous contacter"; + $contact = new Page(); + $contact->slug = 'contact'; + $contact->title = 'Nous contacter'; + $contact->seo_title = 'Nous contacter'; + $contact->seo_description = 'Nous contacter'; + $contact->content = 'Nous contacter'; $contact->save(); - $legals = new Content(); - $legals->key = "legals"; - $legals->value = "Mentions légales"; + $legals = new Page(); + $legals->slug = 'legals'; + $legals->title = 'Mentions légales'; + $legals->seo_title = 'Mentions légales'; + $legals->seo_description = 'Mentions légales'; + $legals->content = 'Mentions légales'; $legals->save(); - $cgv = new Content(); - $cgv->key = "cgv"; - $cgv->value = "Conditions générales de ventes"; + $cgv = new Page(); + $cgv->slug = 'cgv'; + $cgv->title = 'Conditions générales de ventes'; + $cgv->seo_title = 'Conditions générales de ventes'; + $cgv->seo_description = 'Conditions générales de ventes'; + $cgv->content = 'Conditions générales de ventes'; $cgv->save(); - $confidentialite = new Content(); - $confidentialite->key = "confidentialite"; - $confidentialite->value = "Politique de confidentialité"; + $confidentialite = new Page(); + $confidentialite->slug = 'confidentialite'; + $confidentialite->title = 'Politique de confidentialité'; + $confidentialite->seo_title = 'Politique de confidentialité'; + $confidentialite->seo_description = 'Politique de confidentialité'; + $confidentialite->content = 'Politique de confidentialité'; $confidentialite->save(); - $faq = new Content(); - $faq->key = "faq"; - $faq->value = "FAQ"; + $faq = new Page(); + $faq->slug = 'faq'; + $faq->title = 'FAQ'; + $faq->seo_title = 'FAQ'; + $faq->seo_description = 'FAQ'; + $faq->content = 'FAQ'; $faq->save(); } } diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 8836ab60..45c40182 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -1,5 +1,7 @@ call(ContentSeeder::class); - $this->call(SettingsSeeder::class); - $this->call(OrdersStatusSeeder::class); } } diff --git a/database/seeders/DiscountTypesSeeder.php b/database/seeders/DiscountTypesSeeder.php deleted file mode 100644 index 8ed72bc6..00000000 --- a/database/seeders/DiscountTypesSeeder.php +++ /dev/null @@ -1,26 +0,0 @@ -label = "Montant"; - - $pourcentage = new DiscountType(); - $pourcentage->label = "Pourcentage"; - - $montant->save(); - $pourcentage->save(); - } -} diff --git a/database/seeders/MagasinsSeeder.php b/database/seeders/MagasinsSeeder.php deleted file mode 100644 index 54ffe4f0..00000000 --- a/database/seeders/MagasinsSeeder.php +++ /dev/null @@ -1,26 +0,0 @@ -name = 'Point de retrait'; - $shop->address = 'l\'adresse'; - $shop->postcode = '72000'; - $shop->city = 'Le Mans'; - $shop->gmaps_embed_href = "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d5338.425979915083!2d0.1977634707405403!3d48.00959481914027!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x47e288cfcdc1a263%3A0x7acf6d8dc923c25a!2zQ2l0w6kgUGxhbnRhZ2Vuw6p0!5e0!3m2!1sfr!2sfr!4v1619612657653!5m2!1sfr!2sfr"; - $shop->gmaps_link_href = 'https://goo.gl/maps/sxuj7FevRSHsDb8MA'; - $shop->save(); - } -} diff --git a/database/seeders/OrdersStatusSeeder.php b/database/seeders/OrdersStatusSeeder.php deleted file mode 100644 index bd2be617..00000000 --- a/database/seeders/OrdersStatusSeeder.php +++ /dev/null @@ -1,47 +0,0 @@ -label = "En attente"; - - $payee = new OrdersStatus(); - $payee->label ="Payée"; - - $validee = new OrdersStatus(); - $validee->label = "Validée"; - - $preparation = new OrdersStatus(); - $preparation->label = "En cours de préparation"; - - $prete = new OrdersStatus(); - $prete->label = "Prête"; - - $retiree = new OrdersStatus(); - $retiree->label = "Retirée"; - - $annulee = new OrdersStatus(); - $annulee->label = "Annulée"; - - // Ordre - $attente->save(); - $payee->save(); - $validee->save(); - $preparation->save(); - $prete->save(); - $retiree->save(); - $annulee->save(); - } -} diff --git a/database/seeders/SettingsSeeder.php b/database/seeders/SettingsSeeder.php deleted file mode 100644 index 1a435b95..00000000 --- a/database/seeders/SettingsSeeder.php +++ /dev/null @@ -1,52 +0,0 @@ -key = "has_costs"; - $hasCosts->value = "0"; - $hasCosts->save(); - - $costs = new Setting(); - $costs->key = "costs"; - $costs->value = "0.00"; - $costs->save(); - - $hasPayment = new Setting(); - $hasPayment->key = "has_payment"; - $hasPayment->value = "0"; - $hasPayment->save(); - - $qrCode = new Setting(); - $qrCode->key = "qr_code"; - $qrCode->value = "0"; - $qrCode->save(); - - $orderWithdrawalPeriod = new Setting(); - $orderWithdrawalPeriod->key = "order_withdrawal_period"; - $orderWithdrawalPeriod->value = "0"; - $orderWithdrawalPeriod->save(); - - $sendContactMailTo = new Setting(); - $sendContactMailTo->key = "send_contact_mail_to"; - $sendContactMailTo->value = config('mail.from.address'); - $sendContactMailTo->save(); - - $sendOrderMailTo = new Setting(); - $sendOrderMailTo->key = "send_order_confirm_mail_to"; - $sendOrderMailTo->value = config('mail.from.address'); - $sendOrderMailTo->save(); - } -} diff --git a/database/seeders/SlidersSeeder.php b/database/seeders/SlidersSeeder.php deleted file mode 100644 index db0e4390..00000000 --- a/database/seeders/SlidersSeeder.php +++ /dev/null @@ -1,24 +0,0 @@ -label = "Home"; - $homeslider->slug = Str::slug($homeslider->label); - $homeslider->commentaire = 'Slider de la home'; - $homeslider->save(); - } -} diff --git a/database/seeders/TagsSeeder.php b/database/seeders/TagsSeeder.php deleted file mode 100644 index c8932b08..00000000 --- a/database/seeders/TagsSeeder.php +++ /dev/null @@ -1,58 +0,0 @@ -label = "Canard"; - $canard->slug = Str::slug($canard->label); - $canard->save(); - - $poulet = new Tag(); - $poulet->label = "Poulet"; - $poulet->slug = Str::slug($poulet->label); - $poulet->save(); - - $dinde = new Tag(); - $dinde->label = "Dinde"; - $dinde->slug = Str::slug($dinde->label); - $dinde->save(); - - $charcuterie = new Tag(); - $charcuterie->label = "Charcuteries"; - $charcuterie->slug = Str::slug($charcuterie->label); - $charcuterie->save(); - - $panes = new Tag(); - $panes->label = "Panés"; - $panes->slug = Str::slug($panes->label); - $panes->save(); - - $dinde = new Tag(); - $dinde->label = "Dinde"; - $dinde->slug = Str::slug($dinde->label); - $dinde->save(); - - $produits_surgeles = new Tag(); - $produits_surgeles->label = "Produits surgelés"; - $produits_surgeles->slug = Str::slug($produits_surgeles->label); - $produits_surgeles->save(); - - $paniers = new Tag(); - $paniers->label = "Paniers garnis"; - $paniers->slug = Str::slug($paniers->label); - $paniers->save();*/ - } -} diff --git a/database/seeders/TaxRatesSeeder.php b/database/seeders/TaxRatesSeeder.php deleted file mode 100644 index 2608482c..00000000 --- a/database/seeders/TaxRatesSeeder.php +++ /dev/null @@ -1,28 +0,0 @@ -label = "TVA 20%"; - $highTva->rate = 20; - - $lowTva = new TaxRate(); - $lowTva->label = "TVA 5.5%"; - $lowTva->rate = 5.5; - - $highTva->save(); - $lowTva->save(); - } -} diff --git a/database/seeders/TimeslotSettingsSeeder.php b/database/seeders/TimeslotSettingsSeeder.php deleted file mode 100644 index cab7a3b2..00000000 --- a/database/seeders/TimeslotSettingsSeeder.php +++ /dev/null @@ -1,86 +0,0 @@ -day_index = '0'; - $mondays->morning_start = "09:01"; - $mondays->morning_end = "12:00"; - $mondays->afternoon_start = "13:00"; - $mondays->afternoon_end = "17:00"; - $mondays->interval = "00:15"; - $mondays->max_orders_per_interval = 4; - $mondays->min_order_preparation = "01:00"; - $mondays->save(); - - $tuesdays = new TimeslotSetting(); - $tuesdays->day_index = '1'; - $tuesdays->morning_start = "09:02"; - $tuesdays->morning_end = "12:00"; - $tuesdays->afternoon_start = "13:00"; - $tuesdays->afternoon_end = "17:00"; - $tuesdays->interval = "00:15"; - $tuesdays->max_orders_per_interval = 4; - $tuesdays->min_order_preparation = "01:00"; - $tuesdays->save(); - - $wednesdays = new TimeslotSetting(); - $wednesdays->day_index = '2'; - $wednesdays->morning_start = "09:03"; - $wednesdays->morning_end = "12:00"; - $wednesdays->afternoon_start = "13:00"; - $wednesdays->afternoon_end = "17:00"; - $wednesdays->interval = "00:15"; - $wednesdays->max_orders_per_interval = 4; - $wednesdays->min_order_preparation = "01:00"; - $wednesdays->save(); - - $thursdays = new TimeslotSetting(); - $thursdays->day_index = '3'; - $thursdays->morning_start = "09:04"; - $thursdays->morning_end = "12:00"; - $thursdays->afternoon_start = "13:00"; - $thursdays->afternoon_end = "17:00"; - $thursdays->interval = "00:15"; - $thursdays->max_orders_per_interval = 4; - $thursdays->min_order_preparation = "01:00"; - $thursdays->save(); - - $fridays = new TimeslotSetting(); - $fridays->day_index = '4'; - $fridays->morning_start = "09:05"; - $fridays->morning_end = "12:00"; - $fridays->afternoon_start = "13:00"; - $fridays->afternoon_end = "17:00"; - $fridays->interval = "00:15"; - $fridays->max_orders_per_interval = 4; - $fridays->min_order_preparation = "01:00"; - $fridays->save(); - - $saturdays = new TimeslotSetting(); - $saturdays->day_index = '5'; - $saturdays->morning_start = "09:06"; - $saturdays->morning_end = "12:00"; - $saturdays->interval = "00:15"; - $saturdays->max_orders_per_interval = 4; - $saturdays->min_order_preparation = "01:00"; - $saturdays->save(); - - $sundays = new TimeslotSetting(); - $sundays->day_index = '6'; - $sundays->save(); - - } -} diff --git a/domain/Builders/OrderBuilder.php b/domain/Builders/OrderBuilder.php new file mode 100644 index 00000000..236fd41d --- /dev/null +++ b/domain/Builders/OrderBuilder.php @@ -0,0 +1,85 @@ +type, [OrderBuilderType::FROM_BASKET, OrderBuilderType::WITH_PICKUP, OrderBuilderType::COMPLETED], true); + } + + #[\Override] + public function isCompleted(): bool + { + return in_array($this->type, [OrderBuilderType::WITH_PICKUP, OrderBuilderType::COMPLETED], true); + } + + #[\Override] + public function getBuilderType(): OrderBuilderType + { + return $this->type; + } + + #[\Override] + public function withPickupTimeSlot(ShopId $shopId, PickupTimeSlot $timeSlot): OrderBuilderCompleted + { + $this->type = OrderBuilderType::WITH_PICKUP; + $this->shopId = $shopId; + $this->pickupTimeSlot = $timeSlot; + + return $this; + } + + #[\Override] + public function getBasket(): Basket + { + return $this->basket; + } + + #[\Override] + public function getShopperId(): ShopperId + { + return $this->shopperId; + } + + #[\Override] + public function getShopId(): ShopId + { + return $this->shopId; + } + + #[\Override] + public function getPickupTimeSlot(): PickupTimeSlot + { + return $this->pickupTimeSlot; + } + + public static function fromBasket(Basket $basket, ShopperId $shopperId): OrderBuilderWithBasket + { + return new self( + OrderBuilderType::FROM_BASKET, + $basket, + $shopperId + ); + } +} diff --git a/domain/Builders/OrderBuilderCompleted.php b/domain/Builders/OrderBuilderCompleted.php new file mode 100644 index 00000000..6278c8c3 --- /dev/null +++ b/domain/Builders/OrderBuilderCompleted.php @@ -0,0 +1,21 @@ + */ + use BaseEnum; + + case afghanistan = 1; + case alandIslands = 2; + case albania = 3; + case algeria = 4; + case americanSamoa = 5; + case andorra = 6; + case angola = 7; + case anguilla = 8; + case antarctica = 9; + case antiguaAndBarbuda = 10; + case argentina = 11; + case armenia = 12; + case aruba = 13; + case australia = 14; + case austria = 15; + case azerbaijan = 16; + case bahrain = 17; + case bahamas = 18; + case bangladesh = 19; + case barbados = 20; + case belarus = 21; + case belgium = 22; + case belize = 23; + case benin = 24; + case bermuda = 25; + case bhutan = 26; + case boliviaPlurinationalStateOf = 27; + case bonaireSintEustatiusAndSaba = 28; + case bosniaAndHerzegovina = 29; + case botswana = 30; + case bouvetIsland = 31; + case brazil = 32; + case britishIndianOceanTerritory = 33; + case bruneiDarussalam = 34; + case bulgaria = 35; + case burkinaFaso = 36; + case burundi = 37; + case cambodia = 38; + case cameroon = 39; + case canada = 40; + case capeVerde = 41; + case caymanIslands = 42; + case centralAfricanRepublic = 43; + case chad = 44; + case chile = 45; + case china = 46; + case christmasIsland = 47; + case cocosKeelingIslands = 48; + case colombia = 49; + case comoros = 50; + case congo = 51; + case congoTheDemocraticRepublicOfThe = 52; + case cookIslands = 53; + case costaRica = 54; + case coteDivoire = 55; + case croatia = 56; + case cuba = 57; + case curacao = 58; + case cyprus = 59; + case czechRepublic = 60; + case denmark = 61; + case djibouti = 62; + case dominica = 63; + case dominicanRepublic = 64; + case ecuador = 65; + case egypt = 66; + case elSalvador = 67; + case equatorialGuinea = 68; + case eritrea = 69; + case estonia = 70; + case ethiopia = 71; + case falklandIslandsMalvinas = 72; + case faroeIslands = 73; + case fiji = 74; + case finland = 75; + case france = 76; + case frenchGuiana = 77; + case frenchPolynesia = 78; + case frenchSouthernTerritories = 79; + case gabon = 80; + case gambia = 81; + case georgia = 82; + case germany = 83; + case ghana = 84; + case gibraltar = 85; + case greece = 86; + case greenland = 87; + case grenada = 88; + case guadeloupe = 89; + case guam = 90; + case guatemala = 91; + case guernsey = 92; + case guinea = 93; + case guineaBissau = 94; + case guyana = 95; + case haiti = 96; + case heardIslandAndMcdonaldIslands = 97; + case holySeeVaticanCityState = 98; + case honduras = 99; + case hongKong = 100; + case hungary = 101; + case iceland = 102; + case india = 103; + case indonesia = 104; + case iranIslamicRepublicOf = 105; + case iraq = 106; + case ireland = 107; + case isleOfMan = 108; + case israel = 109; + case italy = 110; + case jamaica = 111; + case japan = 112; + case jersey = 113; + case jordan = 114; + case kazakhstan = 115; + case kenya = 116; + case kiribati = 117; + case koreaDemocraticPeoplesRepublicOf = 118; + case koreaRepublicOf = 119; + case kuwait = 120; + case kyrgyzstan = 121; + case laoPeoplesDemocraticRepublic = 122; + case latvia = 123; + case lebanon = 124; + case lesotho = 125; + case liberia = 126; + case libya = 127; + case liechtenstein = 128; + case lithuania = 129; + case luxembourg = 130; + case macao = 131; + case macedoniaTheFormerYugoslavRepublicOf = 132; + case madagascar = 133; + case malawi = 134; + case malaysia = 135; + case maldives = 136; + case mali = 137; + case malta = 138; + case marshallIslands = 139; + case martinique = 140; + case mauritania = 141; + case mauritius = 142; + case mayotte = 143; + case mexico = 144; + case micronesiaFederatedStatesOf = 145; + case moldovaRepublicOf = 146; + case monaco = 147; + case mongolia = 148; + case montenegro = 149; + case montserrat = 150; + case morocco = 151; + case mozambique = 152; + case myanmar = 153; + case namibia = 154; + case nauru = 155; + case nepal = 156; + case netherlands = 157; + case newCaledonia = 158; + case newZealand = 159; + case nicaragua = 160; + case niger = 161; + case nigeria = 162; + case niue = 163; + case norfolkIsland = 164; + case northernMarianaIslands = 165; + case norway = 166; + case oman = 167; + case pakistan = 168; + case palau = 169; + case palestineStateOf = 170; + case panama = 171; + case papuaNewGuinea = 172; + case paraguay = 173; + case peru = 174; + case philippines = 175; + case pitcairn = 176; + case poland = 177; + case portugal = 178; + case puertoRico = 179; + case qatar = 180; + case reunion = 181; + case romania = 182; + case russianFederation = 183; + case rwanda = 184; + case saintBarthelemy = 185; + case saintHelenaAscensionAndTristanDaCunha = 186; + case saintKittsAndNevis = 187; + case saintLucia = 188; + case saintMartinFrenchPart = 189; + case saintPierreAndMiquelon = 190; + case saintVincentAndTheGrenadines = 191; + case samoa = 192; + case sanMarino = 193; + case saoTomeAndPrincipe = 194; + case saudiArabia = 195; + case senegal = 196; + case serbia = 197; + case seychelles = 198; + case sierraLeone = 199; + case singapore = 200; + case sintMaartenDutchPart = 201; + case slovakia = 202; + case slovenia = 203; + case solomonIslands = 204; + case somalia = 205; + case southAfrica = 206; + case southGeorgiaAndTheSouthSandwichIslands = 207; + case southSudan = 208; + case spain = 209; + case sriLanka = 210; + case sudan = 211; + case suriname = 212; + case svalbardAndJanMayen = 213; + case swaziland = 214; + case sweden = 215; + case switzerland = 216; + case syrianArabRepublic = 217; + case taiwanProvinceOfChina = 218; + case tajikistan = 219; + case tanzaniaUnitedRepublicOf = 220; + case thailand = 221; + case timorLeste = 222; + case togo = 223; + case tokelau = 224; + case tonga = 225; + case trinidadAndTobago = 226; + case tunisia = 227; + case turkey = 228; + case turkmenistan = 229; + case turksAndCaicosIslands = 230; + case tuvalu = 231; + case uganda = 232; + case ukraine = 233; + case unitedArabEmirates = 234; + case unitedKingdom = 235; + case unitedStates = 236; + case unitedStatesMinorOutlyingIslands = 237; + case uruguay = 238; + case uzbekistan = 239; + case vanuatu = 240; + case venezuelaBolivarianRepublicOf = 241; + case vietNam = 242; + case virginIslandsBritish = 243; + case virginIslandsUs = 244; + case wallisAndFutuna = 245; + case westernSahara = 246; + case yemen = 247; + case zambia = 248; + case zimbabwe = 249; + + /** + * Optionnal labels definition + * + * @phpstan-ignore-next-line + */ + private const LABELS = [ + self::afghanistan->name => 'Afghanistan', + self::alandIslands->name => 'Åland Islands', + self::albania->name => 'Albania', + self::algeria->name => 'Algeria', + self::americanSamoa->name => 'American Samoa', + self::andorra->name => 'Andorra', + self::angola->name => 'Angola', + self::anguilla->name => 'Anguilla', + self::antarctica->name => 'Antarctica', + self::antiguaAndBarbuda->name => 'Antigua and Barbuda', + self::argentina->name => 'Argentina', + self::armenia->name => 'Armenia', + self::aruba->name => 'Aruba', + self::australia->name => 'Australia', + self::austria->name => 'Austria', + self::azerbaijan->name => 'Azerbaijan', + self::bahrain->name => 'Bahrain', + self::bahamas->name => 'Bahamas', + self::bangladesh->name => 'Bangladesh', + self::barbados->name => 'Barbados', + self::belarus->name => 'Belarus', + self::belgium->name => 'Belgium', + self::belize->name => 'Belize', + self::benin->name => 'Benin', + self::bermuda->name => 'Bermuda', + self::bhutan->name => 'Bhutan', + self::boliviaPlurinationalStateOf->name => 'Bolivia, Plurinational State of', + self::bonaireSintEustatiusAndSaba->name => 'Bonaire, Sint Eustatius and Saba', + self::bosniaAndHerzegovina->name => 'Bosnia and Herzegovina', + self::botswana->name => 'Botswana', + self::bouvetIsland->name => 'Bouvet Island', + self::brazil->name => 'Brazil', + self::britishIndianOceanTerritory->name => 'British Indian Ocean Territory', + self::bruneiDarussalam->name => 'Brunei Darussalam', + self::bulgaria->name => 'Bulgaria', + self::burkinaFaso->name => 'Burkina Faso', + self::burundi->name => 'Burundi', + self::cambodia->name => 'Cambodia', + self::cameroon->name => 'Cameroon', + self::canada->name => 'Canada', + self::capeVerde->name => 'Cape Verde', + self::caymanIslands->name => 'Cayman Islands', + self::centralAfricanRepublic->name => 'Central African Republic', + self::chad->name => 'Chad', + self::chile->name => 'Chile', + self::china->name => 'China', + self::christmasIsland->name => 'Christmas Island', + self::cocosKeelingIslands->name => 'Cocos (Keeling) Islands', + self::colombia->name => 'Colombia', + self::comoros->name => 'Comoros', + self::congo->name => 'Congo', + self::congoTheDemocraticRepublicOfThe->name => 'Congo, the Democratic Republic of the', + self::cookIslands->name => 'Cook Islands', + self::costaRica->name => 'Costa Rica', + self::coteDivoire->name => 'Côte d\'Ivoire', + self::croatia->name => 'Croatia', + self::cuba->name => 'Cuba', + self::curacao->name => 'Curaçao', + self::cyprus->name => 'Cyprus', + self::czechRepublic->name => 'Czech Republic', + self::denmark->name => 'Denmark', + self::djibouti->name => 'Djibouti', + self::dominica->name => 'Dominica', + self::dominicanRepublic->name => 'Dominican Republic', + self::ecuador->name => 'Ecuador', + self::egypt->name => 'Egypt', + self::elSalvador->name => 'El Salvador', + self::equatorialGuinea->name => 'Equatorial Guinea', + self::eritrea->name => 'Eritrea', + self::estonia->name => 'Estonia', + self::ethiopia->name => 'Ethiopia', + self::falklandIslandsMalvinas->name => 'Falkland Islands (Malvinas)', + self::faroeIslands->name => 'Faroe Islands', + self::fiji->name => 'Fiji', + self::finland->name => 'Finland', + self::france->name => 'France', + self::frenchGuiana->name => 'French Guiana', + self::frenchPolynesia->name => 'French Polynesia', + self::frenchSouthernTerritories->name => 'French Southern Territories', + self::gabon->name => 'Gabon', + self::gambia->name => 'Gambia', + self::georgia->name => 'Georgia', + self::germany->name => 'Germany', + self::ghana->name => 'Ghana', + self::gibraltar->name => 'Gibraltar', + self::greece->name => 'Greece', + self::greenland->name => 'Greenland', + self::grenada->name => 'Grenada', + self::guadeloupe->name => 'Guadeloupe', + self::guam->name => 'Guam', + self::guatemala->name => 'Guatemala', + self::guernsey->name => 'Guernsey', + self::guinea->name => 'Guinea', + self::guineaBissau->name => 'GuineaBissau', + self::guyana->name => 'Guyana', + self::haiti->name => 'Haiti', + self::heardIslandAndMcdonaldIslands->name => 'Heard Island and McDonald Islands', + self::holySeeVaticanCityState->name => 'Holy See (Vatican City State)', + self::honduras->name => 'Honduras', + self::hongKong->name => 'Hong Kong', + self::hungary->name => 'Hungary', + self::iceland->name => 'Iceland', + self::india->name => 'India', + self::indonesia->name => 'Indonesia', + self::iranIslamicRepublicOf->name => 'Iran, Islamic Republic of', + self::iraq->name => 'Iraq', + self::ireland->name => 'Ireland', + self::isleOfMan->name => 'Isle of Man', + self::israel->name => 'Israel', + self::italy->name => 'Italy', + self::jamaica->name => 'Jamaica', + self::japan->name => 'Japan', + self::jersey->name => 'Jersey', + self::jordan->name => 'Jordan', + self::kazakhstan->name => 'Kazakhstan', + self::kenya->name => 'Kenya', + self::kiribati->name => 'Kiribati', + self::koreaDemocraticPeoplesRepublicOf->name => 'Korea, Democratic People\'s Republic of', + self::koreaRepublicOf->name => 'Korea, Republic of', + self::kuwait->name => 'Kuwait', + self::kyrgyzstan->name => 'Kyrgyzstan', + self::laoPeoplesDemocraticRepublic->name => 'Lao People\'s Democratic Republic', + self::latvia->name => 'Latvia', + self::lebanon->name => 'Lebanon', + self::lesotho->name => 'Lesotho', + self::liberia->name => 'Liberia', + self::libya->name => 'Libya', + self::liechtenstein->name => 'Liechtenstein', + self::lithuania->name => 'Lithuania', + self::luxembourg->name => 'Luxembourg', + self::macao->name => 'Macao', + self::macedoniaTheFormerYugoslavRepublicOf->name => 'Macedonia, the Former Yugoslav Republic of', + self::madagascar->name => 'Madagascar', + self::malawi->name => 'Malawi', + self::malaysia->name => 'Malaysia', + self::maldives->name => 'Maldives', + self::mali->name => 'Mali', + self::malta->name => 'Malta', + self::marshallIslands->name => 'Marshall Islands', + self::martinique->name => 'Martinique', + self::mauritania->name => 'Mauritania', + self::mauritius->name => 'Mauritius', + self::mayotte->name => 'Mayotte', + self::mexico->name => 'Mexico', + self::micronesiaFederatedStatesOf->name => 'Micronesia, Federated States of', + self::moldovaRepublicOf->name => 'Moldova, Republic of', + self::monaco->name => 'Monaco', + self::mongolia->name => 'Mongolia', + self::montenegro->name => 'Montenegro', + self::montserrat->name => 'Montserrat', + self::morocco->name => 'Morocco', + self::mozambique->name => 'Mozambique', + self::myanmar->name => 'Myanmar', + self::namibia->name => 'Namibia', + self::nauru->name => 'Nauru', + self::nepal->name => 'Nepal', + self::netherlands->name => 'Netherlands', + self::newCaledonia->name => 'New Caledonia', + self::newZealand->name => 'New Zealand', + self::nicaragua->name => 'Nicaragua', + self::niger->name => 'Niger', + self::nigeria->name => 'Nigeria', + self::niue->name => 'Niue', + self::norfolkIsland->name => 'Norfolk Island', + self::northernMarianaIslands->name => 'Northern Mariana Islands', + self::norway->name => 'Norway', + self::oman->name => 'Oman', + self::pakistan->name => 'Pakistan', + self::palau->name => 'Palau', + self::palestineStateOf->name => 'Palestine, State of', + self::panama->name => 'Panama', + self::papuaNewGuinea->name => 'Papua New Guinea', + self::paraguay->name => 'Paraguay', + self::peru->name => 'Peru', + self::philippines->name => 'Philippines', + self::pitcairn->name => 'Pitcairn', + self::poland->name => 'Poland', + self::portugal->name => 'Portugal', + self::puertoRico->name => 'Puerto Rico', + self::qatar->name => 'Qatar', + self::reunion->name => 'Réunion', + self::romania->name => 'Romania', + self::russianFederation->name => 'Russian Federation', + self::rwanda->name => 'Rwanda', + self::saintBarthelemy->name => 'Saint Barthélemy', + self::saintHelenaAscensionAndTristanDaCunha->name => 'Saint Helena, Ascension and Tristan da Cunha', + self::saintKittsAndNevis->name => 'Saint Kitts and Nevis', + self::saintLucia->name => 'Saint Lucia', + self::saintMartinFrenchPart->name => 'Saint Martin (French part)', + self::saintPierreAndMiquelon->name => 'Saint Pierre and Miquelon', + self::saintVincentAndTheGrenadines->name => 'Saint Vincent and the Grenadines', + self::samoa->name => 'Samoa', + self::sanMarino->name => 'San Marino', + self::saoTomeAndPrincipe->name => 'Sao Tome and Principe', + self::saudiArabia->name => 'Saudi Arabia', + self::senegal->name => 'Senegal', + self::serbia->name => 'Serbia', + self::seychelles->name => 'Seychelles', + self::sierraLeone->name => 'Sierra Leone', + self::singapore->name => 'Singapore', + self::sintMaartenDutchPart->name => 'Sint Maarten (Dutch part)', + self::slovakia->name => 'Slovakia', + self::slovenia->name => 'Slovenia', + self::solomonIslands->name => 'Solomon Islands', + self::somalia->name => 'Somalia', + self::southAfrica->name => 'South Africa', + self::southGeorgiaAndTheSouthSandwichIslands->name => 'South Georgia and the South Sandwich Islands', + self::southSudan->name => 'South Sudan', + self::spain->name => 'Spain', + self::sriLanka->name => 'Sri Lanka', + self::sudan->name => 'Sudan', + self::suriname->name => 'Suriname', + self::svalbardAndJanMayen->name => 'Svalbard and Jan Mayen', + self::swaziland->name => 'Swaziland', + self::sweden->name => 'Sweden', + self::switzerland->name => 'Switzerland', + self::syrianArabRepublic->name => 'Syrian Arab Republic', + self::taiwanProvinceOfChina->name => 'Taiwan, Province of China', + self::tajikistan->name => 'Tajikistan', + self::tanzaniaUnitedRepublicOf->name => 'Tanzania, United Republic of', + self::thailand->name => 'Thailand', + self::timorLeste->name => 'TimorLeste', + self::togo->name => 'Togo', + self::tokelau->name => 'Tokelau', + self::tonga->name => 'Tonga', + self::trinidadAndTobago->name => 'Trinidad and Tobago', + self::tunisia->name => 'Tunisia', + self::turkey->name => 'Turkey', + self::turkmenistan->name => 'Turkmenistan', + self::turksAndCaicosIslands->name => 'Turks and Caicos Islands', + self::tuvalu->name => 'Tuvalu', + self::uganda->name => 'Uganda', + self::ukraine->name => 'Ukraine', + self::unitedArabEmirates->name => 'United Arab Emirates', + self::unitedKingdom->name => 'United Kingdom', + self::unitedStates->name => 'United States', + self::unitedStatesMinorOutlyingIslands->name => 'United States Minor Outlying Islands', + self::uruguay->name => 'Uruguay', + self::uzbekistan->name => 'Uzbekistan', + self::vanuatu->name => 'Vanuatu', + self::venezuelaBolivarianRepublicOf->name => 'Venezuela, Bolivarian Republic of', + self::vietNam->name => 'Viet Nam', + self::virginIslandsBritish->name => 'Virgin Islands, British', + self::virginIslandsUs->name => 'Virgin Islands, U.S.', + self::wallisAndFutuna->name => 'Wallis and Futuna', + self::westernSahara->name => 'Western Sahara', + self::yemen->name => 'Yemen', + self::zambia->name => 'Zambia', + self::zimbabwe->name => 'Zimbabwe', + ]; + + /** + * Custom added ISOCODES definition + */ + private const ISOCODES = [ + self::france->name => 'FR', + self::guadeloupe->name => 'GP', + self::martinique->name => 'MQ', + self::frenchGuiana->name => 'GF', + self::reunion->name => 'RE', + self::saintPierreAndMiquelon->name => 'PM', + self::mayotte->name => 'YT', + self::saintBarthelemy->name => 'BL', + self::saintMartinFrenchPart->name => 'MF', + self::wallisAndFutuna->name => 'WF', + self::frenchPolynesia->name => 'PF', + self::newCaledonia->name => 'NC', + ]; + + /** + * Custom added Numerical ISOCODES definition + */ + private const ISOCODES_NUM = [ + self::france->name => 250, + self::guadeloupe->name => 312, + self::martinique->name => 474, + self::frenchGuiana->name => 254, + self::reunion->name => 638, + self::saintPierreAndMiquelon->name => 666, + self::mayotte->name => 175, + self::saintBarthelemy->name => 652, + self::saintMartinFrenchPart->name => 663, + self::wallisAndFutuna->name => 876, + self::frenchPolynesia->name => 258, + self::newCaledonia->name => 540, + ]; + + /** + * Get ISOCODE + */ + public function iso(): string + { + return self::ISOCODES[$this->name] ?? throw UnknownCountryIsoCodeException::fromCountry($this); + } + + /** + * Get ISOCODE NUM + */ + public function isoNum(): int + { + return self::ISOCODES_NUM[$this->name] ?? throw UnknownCountryIsoCodeException::fromCountry($this); + } + + /** + * Get ISOCODE + */ + public function isoCode(): ?string + { + return self::ISOCODES[$this->name] ?? null; + } + + /** + * Get Country from isocode + * + * @throws \RuntimeException If the iso code cannot be resolved. + */ + public static function fromIsoCode(string $isoCode): self + { + $isoToCountries = array_flip(self::ISOCODES); + $countryName = array_key_exists( + $isoCode, + $isoToCountries + ) ? $isoToCountries[$isoCode] : ''; + $country = self::make($countryName, 'label'); + + if ($country === null) { + throw UnknownCountryIsoCodeException::fromIsoCode($isoCode); + } + + return $country; + } + + /** + * Get enum ISOCODES + * + * @return array + */ + public static function toIsoCodes(): array + { + return self::ISOCODES; + } +} diff --git a/domain/Enums/DiscountType.php b/domain/Enums/DiscountType.php new file mode 100644 index 00000000..17cd7aee --- /dev/null +++ b/domain/Enums/DiscountType.php @@ -0,0 +1,26 @@ + */ + use BaseEnum; + + case AMOUNT = 1; + case PERCENT = 2; + + /** + * Optionnal labels definition + * + * @phpstan-ignore-next-line classConstant.unused (Base enum usage) + */ + private const LABELS = [ + self::AMOUNT->name => 'Montant', + self::PERCENT->name => 'Pourcentage', + ]; +} diff --git a/domain/Enums/EmployeeSite.php b/domain/Enums/EmployeeSite.php new file mode 100644 index 00000000..ea39bade --- /dev/null +++ b/domain/Enums/EmployeeSite.php @@ -0,0 +1,52 @@ + */ + use BaseEnum; + + case slhp = 'SLHP'; + case ldcser = 'LDCSER'; + case ldcvol = 'LDCVOL'; + case ldcter = 'LDCTER'; + case ldctra = 'LDCTRA'; + case ldccav = 'LDCCAV'; + case ldchol = 'LDCHOL'; + case cepacpe = 'CEPACPE'; + case dde = 'DDE'; + case dpe = 'DPE'; + case sl = 'SL'; + case gdfroi = 'GDFROI'; + case ldcplb = 'LDCPLB'; + case slela = 'SLELA'; + case tpwiss = 'TPWISS'; + + /** + * Optionnal labels definition + * + * @phpstan-ignore-next-line classConstant.unused (Base enum usage) + */ + private const LABELS = [ + self::slhp->name => 'SLHP', + self::ldcser->name => 'LDCSER', + self::ldcvol->name => 'LDCVOL', + self::ldcter->name => 'LDCTER', + self::ldctra->name => 'LDCTRA', + self::ldccav->name => 'LDCCAV', + self::ldchol->name => 'LDCHOL', + self::cepacpe->name => 'CEPACP', + self::dde->name => 'DDE', + self::dpe->name => 'DPE', + self::sl->name => 'SL', + self::gdfroi->name => 'GDFROI', + self::ldcplb->name => 'LDCPLB', + self::slela->name => 'SLELA', + self::tpwiss->name => 'TPWISS', + ]; +} diff --git a/domain/Enums/Nutriscore.php b/domain/Enums/Nutriscore.php new file mode 100644 index 00000000..9c6f3372 --- /dev/null +++ b/domain/Enums/Nutriscore.php @@ -0,0 +1,19 @@ + */ + use BaseEnum; + + case A = 'A'; + case B = 'B'; + case C = 'C'; + case D = 'D'; + case E = 'E'; +} diff --git a/domain/Enums/OrderStatus.php b/domain/Enums/OrderStatus.php new file mode 100644 index 00000000..5bd641a1 --- /dev/null +++ b/domain/Enums/OrderStatus.php @@ -0,0 +1,28 @@ + */ + use BaseEnum; + + case WAITING = 1; + case VALIDATED = 3; + case CANCELED = 7; + + /** + * Optional labels definition + * + * @phpstan-ignore-next-line classConstant.unused (Base enum usage) + */ + private const LABELS = [ + self::WAITING->name => 'En attente', + self::VALIDATED->name => 'Validée', + self::CANCELED->name => 'Annulée', + ]; +} diff --git a/domain/Enums/OrderTunnelStep.php b/domain/Enums/OrderTunnelStep.php new file mode 100644 index 00000000..23f25856 --- /dev/null +++ b/domain/Enums/OrderTunnelStep.php @@ -0,0 +1,12 @@ + */ + use BaseEnum; + + case five = 5; + case twelve = 12; + case twentyfive = 25; + case fifty = 50; + case onehundred = 100; +} diff --git a/domain/Enums/PriceShowingMode.php b/domain/Enums/PriceShowingMode.php new file mode 100644 index 00000000..5f8bfbc1 --- /dev/null +++ b/domain/Enums/PriceShowingMode.php @@ -0,0 +1,26 @@ + */ + use BaseEnum; + + case authenticated = 'authenticated'; + case guest = 'guest'; + + /** + * Optionnal labels definition + * + * @phpstan-ignore-next-line classConstant.unused (Base enum usage) + */ + private const LABELS = [ + self::authenticated->name => 'Client Connecté', + self::guest->name => 'Public', + ]; +} diff --git a/domain/Enums/ProductBrand.php b/domain/Enums/ProductBrand.php new file mode 100644 index 00000000..92b6b0fc --- /dev/null +++ b/domain/Enums/ProductBrand.php @@ -0,0 +1,46 @@ + */ + use BaseEnum; + + case none = 'none'; + case loue = 'loue'; + case legaulois = 'legaulois'; + case legauloispro = 'legauloispro'; + case marie = 'marie'; + case tregalette = 'tregalette'; + case esprirestauration = 'esprirestauration'; + case lepetitmarchedeloue = 'lepetitmarchedeloue'; + case lesaccessibles = 'lesaccessibles'; + case legauloisvegetal = 'legauloisvegetal'; + case natureandrespect = 'natureandrespect'; + case reghalal = 'reghalal'; + + /** + * Optionnal labels definition + * + * @phpstan-ignore-next-line classConstant.unused (Base enum usage) + */ + private const LABELS = [ + self::none->name => 'Sans marque', + self::loue->name => 'Loué', + self::legaulois->name => 'Le Gaulois', + self::legauloispro->name => 'Le Gaulois Professionnel', + self::marie->name => 'Marie', + self::tregalette->name => 'Trégalette', + self::esprirestauration->name => 'Espri Restauration', + self::lepetitmarchedeloue->name => 'Le petit marché de Loué', + self::lesaccessibles->name => 'Les Accessibles', + self::legauloisvegetal->name => 'Le Gaulois végétal', + self::natureandrespect->name => 'Nature & Respect', + self::reghalal->name => 'Réghalal', + ]; +} diff --git a/domain/Enums/RepeatFrequency.php b/domain/Enums/RepeatFrequency.php new file mode 100644 index 00000000..af1729ee --- /dev/null +++ b/domain/Enums/RepeatFrequency.php @@ -0,0 +1,28 @@ + */ + use BaseEnum; + + case WEEKLY = 'Weekly'; + case MONTHLY = 'Monthly'; + case YEARLY = 'Yearly'; + + /** + * Optionnal labels definition + * + * @phpstan-ignore-next-line classConstant.unused (Base enum usage) + */ + private const LABELS = [ + self::WEEKLY->name => 'Toutes les semaines', + self::MONTHLY->name => 'Tous les mois', + self::YEARLY->name => 'Tous les ans', + ]; +} diff --git a/domain/Enums/SellUnit.php b/domain/Enums/SellUnit.php new file mode 100644 index 00000000..c5d95b3c --- /dev/null +++ b/domain/Enums/SellUnit.php @@ -0,0 +1,28 @@ + */ + use BaseEnum; + + case PCE = 'PCE'; + case KGM = 'KGM'; + case COLIS = 'COLIS'; + + /** + * Optionnal labels definition + * + * @phpstan-ignore-next-line classConstant.unused (Base enum usage) + */ + private const LABELS = [ + self::PCE->name => 'Pièce', + self::KGM->name => 'Kg', + self::COLIS->name => 'Colis', + ]; +} diff --git a/domain/Enums/StaticPageSlug.php b/domain/Enums/StaticPageSlug.php new file mode 100644 index 00000000..87cfb14d --- /dev/null +++ b/domain/Enums/StaticPageSlug.php @@ -0,0 +1,32 @@ + */ + use BaseEnum; + + case CONTACT = 'contact'; + case LEGALS = 'legals'; + case TERMS = 'cgv'; + case PRIVACY = 'confidentialite'; + case FAQ = 'faq'; + + /** + * Optionnal labels definition + * + * @phpstan-ignore-next-line classConstant.unused (Base enum usage) + */ + private const LABELS = [ + self::CONTACT->name => 'contact', + self::LEGALS->name => 'mentions légales', + self::TERMS->name => 'cgv', + self::PRIVACY->name => 'confidentialité', + self::FAQ->name => 'faq', + ]; +} diff --git a/domain/Enums/StatsCustomerType.php b/domain/Enums/StatsCustomerType.php new file mode 100644 index 00000000..2aa2ec93 --- /dev/null +++ b/domain/Enums/StatsCustomerType.php @@ -0,0 +1,28 @@ + */ + use BaseEnum; + + case nbSalarie = 1; + case nbSalarieWithAccount = 2; + case membershipRate = 3; + + /** + * Optionnal labels definition + * + * @phpstan-ignore-next-line classConstant.unused (Base enum usage) + */ + private const LABELS = [ + self::nbSalarie->name => 'Nombre de salariés', + self::nbSalarieWithAccount->name => 'Nombre de salariés ayant créé un compte', + self::membershipRate->name => 'Taux d\'adhésion', + ]; +} diff --git a/domain/Enums/StatsShopType.php b/domain/Enums/StatsShopType.php new file mode 100644 index 00000000..bbe65ce1 --- /dev/null +++ b/domain/Enums/StatsShopType.php @@ -0,0 +1,48 @@ + */ + use BaseEnum; + + case nbActiveClients = 1; + case nbValidateCmd = 2; + case nbWaitingCmd = 3; + case nbCanceledCmd = 4; + case nbCmdWith7DayDelay = 5; + case nbCmdWith14DayDelay = 6; + case canceledRate = 7; + case orderFrequency = 8; + case purchaseFrequency = 9; + case averageBasketHt = 10; + case averageProductCountPerOrder = 11; + case caHt = 12; + case caTtc = 13; + + /** + * Optionnal labels definition + * + * @phpstan-ignore-next-line classConstant.unused (Base enum usage) + */ + private const LABELS = [ + self::nbActiveClients->name => 'Nombre de clients actifs', + self::nbValidateCmd->name => 'Commandes validées', + self::nbWaitingCmd->name => 'Commandes en attente', + self::nbCanceledCmd->name => 'Commandes annulées', + self::nbCmdWith7DayDelay->name => 'Nombre de commandes à J+7', + self::nbCmdWith14DayDelay->name => 'Nombre de commandes à J+14', + self::canceledRate->name => 'Taux d\'abandon', + self::orderFrequency->name => 'Fréquence de commande', + self::purchaseFrequency->name => 'Fréquence d\'achat', + self::averageBasketHt->name => 'Prix du panier moyen', + self::averageProductCountPerOrder->name => 'Nombre d\'article moyen par commande', + self::caHt->name => 'Montant total HT', + self::caTtc->name => 'Montant total TTC', + ]; +} diff --git a/domain/Enums/TaxRate.php b/domain/Enums/TaxRate.php new file mode 100644 index 00000000..6aef67a3 --- /dev/null +++ b/domain/Enums/TaxRate.php @@ -0,0 +1,70 @@ + */ + use BaseEnum; + + case TVA_20 = 1; + case TVA_5_5 = 2; + + /** + * Optional labels definition + * + * @phpstan-ignore-next-line classConstant.unused (Base enum usage) + */ + private const LABELS = [ + self::TVA_20->name => 'TVA 20%', + self::TVA_5_5->name => 'TVA 5.5%', + ]; + + public function percent(): float + { + return match ($this) { + self::TVA_20 => 20.0, + self::TVA_5_5 => 5.5, + }; + } + + public static function fromPercent(float $percent): self + { + return match ($percent) { + self::TVA_20->percent() => self::TVA_20, + self::TVA_5_5->percent() => self::TVA_5_5, + default => self::tryFrom((int) $percent) ?? throw new \UnexpectedValueException( + sprintf('Unhandled tax rate: %s', $percent) + ), + }; + } + + public function rate(): float + { + return $this->percent() / 100; + } + + /** + * Exact decimal multiplier (1 + rate), as a string to avoid any float rounding. + * + * @return numeric-string + */ + public function multiplier(): string + { + return match ($this) { + self::TVA_20 => '1.2', + self::TVA_5_5 => '1.055', + }; + } + + public function applyTo(Money $price): Money + { + return $price->multiply($this->multiplier(), Product::ROUNDING); + } +} diff --git a/domain/Enums/Units/InvoicingUnit.php b/domain/Enums/Units/InvoicingUnit.php new file mode 100644 index 00000000..5086e247 --- /dev/null +++ b/domain/Enums/Units/InvoicingUnit.php @@ -0,0 +1,28 @@ + */ + use BaseEnum; + + case PCE = 'PCE'; + case KGM = 'KGM'; + case COLIS = 'COLIS'; + + /** + * Optionnal labels definition + * + * @phpstan-ignore-next-line classConstant.unused (Base enum usage) + */ + private const LABELS = [ + self::PCE->name => 'Pièce', + self::KGM->name => 'Kg', + self::COLIS->name => 'Colis', + ]; +} diff --git a/domain/Enums/Units/OrderUnit.php b/domain/Enums/Units/OrderUnit.php new file mode 100644 index 00000000..6851cb0e --- /dev/null +++ b/domain/Enums/Units/OrderUnit.php @@ -0,0 +1,37 @@ + */ + use BaseEnum; + + case PCE = 'PCE'; + case KGM = 'KGM'; + case COLIS = 'COLIS'; + + public function toRegateCode(): string + { + return match ($this) { + self::COLIS => 'UEA', + self::KGM => 'KGM', + self::PCE => 'UB', + }; + } + + /** + * Optionnal labels definition + * + * @phpstan-ignore-next-line classConstant.unused (Base enum usage) + */ + private const LABELS = [ + self::PCE->name => 'Pièce', + self::KGM->name => 'Kg', + self::COLIS->name => 'Colis', + ]; +} diff --git a/domain/Enums/UserRole.php b/domain/Enums/UserRole.php new file mode 100644 index 00000000..98f22189 --- /dev/null +++ b/domain/Enums/UserRole.php @@ -0,0 +1,21 @@ + */ + use BaseEnum; + + case SuperAdmin = 1; + case Admin = 2; + + public function isAtLeastEqualsTo(self $role): bool + { + return $this->value() <= $role->value(); + } +} diff --git a/domain/Events/AnOrderHasBeenPlaced.php b/domain/Events/AnOrderHasBeenPlaced.php new file mode 100644 index 00000000..fabe7e11 --- /dev/null +++ b/domain/Events/AnOrderHasBeenPlaced.php @@ -0,0 +1,34 @@ +product->name, + productIncoId: clone $line->product->incoId, + productWeightIsVariable: $line->product->weight->isVariable, + productPriceKgTtc: clone $line->product->priceKgTtc, + productOrderUnit: $line->product->orderUnit, + quantity: $line->quantity, + totalTtc: clone $line->totalTtc + ); + } +} diff --git a/domain/Events/Dto/OrderPlacedShop.php b/domain/Events/Dto/OrderPlacedShop.php new file mode 100644 index 00000000..6f6f93b7 --- /dev/null +++ b/domain/Events/Dto/OrderPlacedShop.php @@ -0,0 +1,40 @@ +name, + address: $address->address, + postcode: $address->postcode, + city: $address->city, + ); + } +} diff --git a/domain/Events/Dto/RegateOrderCsvGenerated.php b/domain/Events/Dto/RegateOrderCsvGenerated.php new file mode 100644 index 00000000..f487233b --- /dev/null +++ b/domain/Events/Dto/RegateOrderCsvGenerated.php @@ -0,0 +1,16 @@ + $matricules */ + public function __construct( + public array $matricules, + ) { + foreach ($matricules as $matricule) { + if (! $matricule instanceof Matricule) { + throw new \UnexpectedValueException('Can only accept list of ' . Matricule::class); + } + } + } +} diff --git a/domain/Exceptions/OrderTunnel/MissingOrderBuilderException.php b/domain/Exceptions/OrderTunnel/MissingOrderBuilderException.php new file mode 100644 index 00000000..72d60fc4 --- /dev/null +++ b/domain/Exceptions/OrderTunnel/MissingOrderBuilderException.php @@ -0,0 +1,16 @@ +name}'"); + } +} diff --git a/domain/Models/Entities/Basket.php b/domain/Models/Entities/Basket.php new file mode 100644 index 00000000..9dead7f3 --- /dev/null +++ b/domain/Models/Entities/Basket.php @@ -0,0 +1,175 @@ + */ +final class Basket implements Entity +{ + /** + * @var array + */ + private array $items = []; + + /** + * @param array $items + */ + public function __construct( + public readonly BasketId $id, + array $items = [] + ) { + foreach ($items as $item) { + if (! $item instanceof BasketProduct) { + throw new \DomainException('All items shall be of type BasketProduct'); + } + $this->items[(string) $item->id->value] = $item; + } + } + + #[\Override] + public function id(): BasketId + { + return $this->id; + } + + public function has(ProductId $itemId): bool + { + return array_key_exists((string) $itemId->value, $this->items); + } + + public function addOrUpdate(BasketProduct $item): void + { + if ($this->has($item->id)) { + $existingItem = $this->items[(string) $item->id->value]; + $updatedItem = $this->cloneWithQuantity( + $existingItem, + $existingItem->qty + $item->qty + ); + + $this->items[(string) $item->id->value] = $updatedItem; + + return; + } + + $this->items[(string) $item->id->value] = $item; + } + + public function remove(ProductId $itemId, int $qty): void + { + if ($qty < 1) { + throw new \DomainException('Cannot remove quantity less than 1'); + } + + if (! $this->has($itemId)) { + throw new \DomainException('Basket item does not exists'); + } + + $existingItem = $this->items[(string) $itemId->value]; + + if ($existingItem->qty <= $qty) { + $this->removeLine($itemId); + + return; + } + + $updatedItem = $this->cloneWithQuantity( + $existingItem, + $existingItem->qty - $qty + ); + + $this->items[(string) $itemId->value] = $updatedItem; + } + + public function removeLine(ProductId $itemId): void + { + if (! $this->has($itemId)) { + throw new \DomainException('Basket item does not exists'); + } + + unset($this->items[(string) $itemId->value]); + } + + /** + * @return array + */ + public function items(): array + { + return $this->items; + } + + public function totalTaxIncluded(): Money + { + return array_reduce( + $this->items, + fn (Money $total, BasketProduct $item) => $total->add($item->totalTtc()), + Money::EUR(0) + ); + } + + public function totalVat(): Money + { + return array_reduce( + $this->items, + fn (Money $total, BasketProduct $item) => $total->add($item->taxTotal()), + Money::EUR(0) + ); + } + + public function totalRaw(): Money + { + return array_reduce( + $this->items, + fn (Money $total, BasketProduct $item) => $total->add($item->subtotalHt()), + Money::EUR(0) + ); + } + + public function totalDiscount(): Money + { + return array_reduce( + $this->items, + fn (Money $total, BasketProduct $item) => $total->add($item->discountTotal()), + Money::EUR(0) + ); + } + + public function totalWeight(): int + { + return (int) array_sum(array_map(fn (BasketProduct $item) => $item->weightTotal(), $this->items)); + } + + public function countItems(): int + { + return (int) array_sum(array_map(fn (BasketProduct $item) => $item->qty, $this->items)); + } + + private function cloneWithQuantity(BasketProduct $item, int $qty): BasketProduct + { + return new BasketProduct( + $item->id, + $item->name, + $qty, + $item->unitPriceHt, + $item->unitDiscount, + $item->taxRate, + $item->weightGrams, + $item->brand, + $item->incoId, + $item->orderUnit, + $item->slug, + $item->picture, + $item->description, + $item->weightVariable, + $item->discountRate, + $item->priceKgTtc, + [...$item->options] + ); + } +} diff --git a/domain/Models/Entities/Order.php b/domain/Models/Entities/Order.php new file mode 100644 index 00000000..6156e564 --- /dev/null +++ b/domain/Models/Entities/Order.php @@ -0,0 +1,116 @@ + */ +final class Order implements Entity +{ + public function __construct( + public readonly OrderId $id, + public readonly ShopId $shopId, + public readonly OrderReference $reference, + public readonly OrderEmployee $employee, + public readonly DeliveryAddress $deliveryAddress, + public readonly PickupTimeSlot $pickupTimeSlot, + public OrderStatus $status, + private readonly Money $total, + /** @var OrderLine[] */ + private array $lines, + ) { + if ($total->getAmount() <= 0) { + throw new \DomainException('Total amount must be greater than zero'); + } + foreach ($lines as $line) { + if (! ($line instanceof OrderLine)) { + throw new \DomainException('All lines must be instances of OrderLine'); + } + } + } + + #[\Override] + public function id(): OrderId + { + return $this->id; + } + + public function getTotal(): Money + { + return $this->total; + } + + /** @return OrderLine[] */ + public function getLines(): array + { + return $this->lines; + } + + public function cancel(): void + { + if ($this->status === OrderStatus::CANCELED) { + return; + } + + $this->status = OrderStatus::CANCELED; + } + + public static function fromBasket( + OrderId $id, + OrderReference $reference, + Basket $basket, + PickupTimeSlot $pickupTimeSlot, + Shopper $shopper, + Shop $shop + ): self { + $lines = array_map( + fn (BasketProduct $item) => OrderLine::fromBasketProduct($item), + array_values($basket->items()) + ); + + return new self( + id: $id, + shopId: clone $shop->id(), + reference: $reference, + employee: OrderEmployee::fromShopper($shopper), + deliveryAddress: DeliveryAddress::fromShop($shop), + pickupTimeSlot: clone $pickupTimeSlot, + status: OrderStatus::VALIDATED, + total: clone $basket->totalTaxIncluded(), + lines: $lines + ); + } + + public function toPlacedEvent(): AnOrderHasBeenPlaced + { + return new AnOrderHasBeenPlaced( + orderId: $this->id(), + reference: $this->reference, + totalTtc: $this->getTotal(), + byMatricule: $this->employee->matricule, + employee: clone $this->employee, + shop: OrderPlacedShop::fromDeliveryAddress($this->deliveryAddress), + pickupDay: CarbonImmutable::instance($this->pickupTimeSlot->getAt()), + lines: array_map( + fn (OrderLine $line) => OrderPlacedLine::fromOrderLine($line), + $this->lines + ) + ); + } +} diff --git a/domain/Models/Entities/PickupExceptionOnDate.php b/domain/Models/Entities/PickupExceptionOnDate.php new file mode 100644 index 00000000..225eae08 --- /dev/null +++ b/domain/Models/Entities/PickupExceptionOnDate.php @@ -0,0 +1,36 @@ + */ +final readonly class PickupExceptionOnDate implements Entity +{ + public function __construct( + public PickupExceptionId $id, + public CarbonInterface $date, + public string $label, + public bool $repeatable, + public RepeatFrequency $repeatFrequency, + public bool $autoUpdated + ) { + } + + #[\Override] + public function id(): PickupExceptionId + { + return $this->id; + } + + public function isPickupDay(WeekDay $pickupDay = WeekDay::Friday): bool + { + return $this->date->isDayOfWeek($pickupDay->value); + } +} diff --git a/domain/Models/Entities/Product.php b/domain/Models/Entities/Product.php new file mode 100644 index 00000000..f73a2994 --- /dev/null +++ b/domain/Models/Entities/Product.php @@ -0,0 +1,188 @@ + */ +final readonly class Product implements Entity +{ + public const int ROUNDING = Money::ROUND_UP; + + private const int GRAMS_PER_KG = 1000; + + public function __construct( + private ProductId $id, + public Money $price, + public TaxRate $tax_rate, + public ?ProductWeight $product_weight, + public InvoicingUnit $invoicing_unit, + public SellUnit $sell_unit, + public ?DiscountValue $validDiscount, + public bool $status, + public ?CarbonImmutable $orderable_start, + public ?CarbonImmutable $orderable_end, + public bool $hasInco + ) { + } + + #[\Override] + public function id(): ProductId + { + return $this->id; + } + + public function canBeOrderOn(?CarbonInterface $date = null): bool + { + $target = $date ?? CarbonImmutable::now(); + + if ($this->orderable_start && $target < $this->orderable_start) { + return false; + } + if ($this->orderable_end && $target > $this->orderable_end) { + return false; + } + + return $this->status && $this->hasInco; + } + + public function isOrderable(?CarbonInterface $date = null): bool + { + return $this->canBeOrderOn($date); + } + + public function isPublished(): bool + { + return $this->status; + } + + public function hasInco(): bool + { + return $this->hasInco; + } + + public function hasDiscount(): bool + { + return $this->validDiscount !== null; + } + + public function basePriceHt(): Money + { + if ($this->invoicing_unit === InvoicingUnit::KGM && $this->sell_unit === SellUnit::PCE && $this->product_weight) { + // * Price per kg => price of the piece: price x grams / 1000 (single rounding, no float) + return $this->price + ->multiply($this->product_weight->toGrams()) + ->divide(self::GRAMS_PER_KG, self::ROUNDING); + } + + return $this->price; + } + + public function basePriceTtc(): Money + { + return $this->tax_rate->applyTo($this->basePriceHt()); + } + + public function discountAmountHt(): Money + { + $basePriceHt = $this->basePriceHt(); + $discountAmount = $this->validDiscount?->calculateDiscountAmount($basePriceHt) + ?? new Money(0, $basePriceHt->getCurrency()); + + if ($discountAmount->greaterThan($basePriceHt)) { + return $basePriceHt; + } + + return $discountAmount; + } + + public function discountedPriceHt(): Money + { + return $this->basePriceHt()->subtract($this->discountAmountHt()); + } + + public function discountedPriceTtc(): Money + { + return $this->tax_rate->applyTo($this->discountedPriceHt()); + } + + public function priceKgTtc(): Money + { + if ($this->invoicing_unit === InvoicingUnit::KGM) { + // * The product price is already a price per kg: it is the reference for the kg price + $discountAmountKgHt = $this->validDiscount?->calculateDiscountAmount($this->price) + ?? new Money(0, $this->price->getCurrency()); + + $grams = $this->product_weight?->toGrams() ?? 0; + + if ( + $this->validDiscount !== null + && ! $this->validDiscount->isPercentage() + && $this->sell_unit === SellUnit::PCE + && $grams > 0 + ) { + // * A fixed amount applies to the piece: bring it back to a per-kg amount + $discountAmountKgHt = $discountAmountKgHt + ->multiply(self::GRAMS_PER_KG) + ->divide($grams, self::ROUNDING); + } + + $discountedKgPriceHt = $this->price->subtract($discountAmountKgHt); + + if ($discountedKgPriceHt->isNegative()) { + $discountedKgPriceHt = new Money(0, $this->price->getCurrency()); + } + + return $this->tax_rate->applyTo($discountedKgPriceHt); + } + + $priceTtc = $this->discountedPriceTtc(); + $grams = $this->product_weight?->toGrams() ?? 0; + + // NOTE: If the product is not published or not sold by piece, we don't need to convert the price to per kg + if ($grams > 0 && $this->status && $this->invoicing_unit === InvoicingUnit::PCE) { + // * Price of the piece => price per kg: price x 1000 / grams (single rounding, no float) + return $priceTtc + ->multiply(self::GRAMS_PER_KG) + ->divide($grams, self::ROUNDING); + } + + return $priceTtc; + } + + public function discountRate(): DiscountRate + { + if ($this->validDiscount?->isPercentage()) { + return DiscountRate::fromPercentage($this->validDiscount->getPercentage()); + } + + return DiscountRate::fromAmounts($this->discountAmountHt(), $this->basePriceHt()); + } + + public function pricing(): ProductPricing + { + return new ProductPricing( + basePriceHt: $this->basePriceHt(), + basePriceTtc: $this->basePriceTtc(), + discountAmountHt: $this->discountAmountHt(), + discountedPriceHt: $this->discountedPriceHt(), + discountedPriceTtc: $this->discountedPriceTtc(), + priceKgTtc: $this->priceKgTtc(), + discountRate: $this->discountRate(), + hasDiscount: $this->hasDiscount() + ); + } +} diff --git a/domain/Models/Entities/Shop.php b/domain/Models/Entities/Shop.php new file mode 100644 index 00000000..20a0ad9f --- /dev/null +++ b/domain/Models/Entities/Shop.php @@ -0,0 +1,43 @@ + */ +final readonly class Shop implements Entity +{ + public function __construct( + public ShopId $id, + public string $name, + public string $address, + public string $postcode, + public string $city, + public ?string $phone = null, + public ?string $latitude = null, + public ?string $longitude = null, + public bool $isDefault = false + ) { + if (trim($name) === '') { + throw new \DomainException('name cannot be empty'); + } + if (trim($address) === '') { + throw new \DomainException('address cannot be empty'); + } + if (trim($postcode) === '') { + throw new \DomainException('postcode cannot be empty'); + } + if (trim($city) === '') { + throw new \DomainException('city cannot be empty'); + } + } + + #[\Override] + public function id(): ShopId + { + return $this->id; + } +} diff --git a/domain/Models/Entities/Shopper.php b/domain/Models/Entities/Shopper.php new file mode 100644 index 00000000..0fb42b0a --- /dev/null +++ b/domain/Models/Entities/Shopper.php @@ -0,0 +1,50 @@ + */ +final readonly class Shopper implements Entity +{ + public function __construct( + private readonly ShopperId $id, + public readonly Email $email, + public readonly Matricule $matricule, + public readonly string $nom, + public readonly string $prenom, + public readonly CarbonInterface $startDate, + public readonly ?CarbonInterface $endDate, + public readonly ShopperEstablishmentCode $etablissement, + public readonly ShopperSiteCode $site, + public readonly ShopperServiceCode $service + ) { + if (trim($nom) === '') { + throw new \DomainException('nom cannot be empty'); + } + if (trim($prenom) === '') { + throw new \DomainException('prenom cannot be empty'); + } + } + + #[\Override] + public function id(): ShopperId + { + return $this->id; + } + + public function isActive(): bool + { + return $this->endDate === null || $this->endDate->greaterThan(CarbonImmutable::now()); + } +} diff --git a/domain/Models/ValueObjects/AttachedFile.php b/domain/Models/ValueObjects/AttachedFile.php new file mode 100644 index 00000000..a19b5f22 --- /dev/null +++ b/domain/Models/ValueObjects/AttachedFile.php @@ -0,0 +1,24 @@ + */ + public array $options = [] + ) { + if (trim($name) === '') { + throw new \DomainException('name cannot be empty'); + } + if (trim($slug) === '') { + throw new \DomainException('slug cannot be empty'); + } + if ($qty <= 0) { + throw new \DomainException('qty has to be positive'); + } + if (! $unitPriceHt->isPositive()) { + throw new \DomainException('unitPriceHt has to be positive'); + } + if (! $unitDiscount->isPositive() && ! $unitDiscount->isZero()) { + throw new \DomainException('unitDiscount cannot be negative'); + } + if (! $priceKgTtc->isPositive()) { + throw new \DomainException('priceKgTtc has to be positive'); + } + } + + public function unitPriceHt(): Money + { + return $this->unitPriceHt; + } + + public function unitPriceDiscounted(): Money + { + return $this->unitPriceHt->subtract($this->unitDiscount); + } + + public function unitTax(): Money + { + return $this->unitTtc()->subtract($this->unitPriceDiscounted()); + } + + public function unitTtc(): Money + { + return $this->taxRate->applyTo($this->unitPriceDiscounted()); + } + + public function discountTotal(): Money + { + return $this->unitDiscount->multiply($this->qty, Product::ROUNDING); + } + + public function priceTotalHt(): Money + { + return $this->unitPriceHt->multiply($this->qty, Product::ROUNDING); + } + + public function subtotalHt(): Money + { + return $this->priceTotalHt()->subtract($this->discountTotal()); + } + + public function taxTotal(): Money + { + return $this->totalTtc()->subtract($this->subtotalHt()); + } + + public function totalTtc(): Money + { + return $this->taxRate->applyTo($this->subtotalHt()); + } + + public function weightTotal(): int + { + return $this->weightGrams * $this->qty; + } +} diff --git a/domain/Models/ValueObjects/Code.php b/domain/Models/ValueObjects/Code.php new file mode 100644 index 00000000..967cd7c2 --- /dev/null +++ b/domain/Models/ValueObjects/Code.php @@ -0,0 +1,39 @@ + 10) { + throw new \DomainException('Code has to be between 6 and 10 chars length'); + } + if (! preg_match('/^[' . self::ALLOWED_CHARACTERS . ']+$/', $value)) { + throw new \DomainException('Code contains invalid characters'); + } + } + + public function __toString(): string + { + return $this->value; + } + + public function equals(mixed $other): bool + { + return $other instanceof self && $this->value === $other->value; + } +} diff --git a/domain/Models/ValueObjects/ContactFormData.php b/domain/Models/ValueObjects/ContactFormData.php new file mode 100644 index 00000000..f006984a --- /dev/null +++ b/domain/Models/ValueObjects/ContactFormData.php @@ -0,0 +1,37 @@ +latitude, -90.0, 'Latitude must be between -90 and 90 degrees.'); + Assert::lessThanEq($this->latitude, 90.0, 'Latitude must be between -90 and 90 degrees.'); + Assert::greaterThanEq($this->longitude, -180.0, 'Longitude must be between -180 and 180 degrees.'); + Assert::lessThanEq($this->longitude, 180.0, 'Longitude must be between -180 and 180 degrees.'); + } +} diff --git a/domain/Models/ValueObjects/CrmCustomer.php b/domain/Models/ValueObjects/CrmCustomer.php new file mode 100644 index 00000000..3f733846 --- /dev/null +++ b/domain/Models/ValueObjects/CrmCustomer.php @@ -0,0 +1,56 @@ + $this->hashcode, + 'email' => $this->email, + 'password' => $this->password, + 'firstname' => $this->firstname, + 'lastname' => $this->lastname, + 'birthDate' => $this->birthDate, + 'phone' => $this->phone, + 'address' => $this->address, + 'address2' => $this->address2, + 'city' => $this->city, + 'postcode' => $this->postcode, + 'country' => $this->country, + 'optIn' => $this->optIn, + 'status' => $this->status, + 'lastConnection' => $this->lastConnection, + ]; + } +} diff --git a/domain/Models/ValueObjects/DatePeriod.php b/domain/Models/ValueObjects/DatePeriod.php new file mode 100644 index 00000000..24b1bddb --- /dev/null +++ b/domain/Models/ValueObjects/DatePeriod.php @@ -0,0 +1,41 @@ +start = $start !== null ? \DateTimeImmutable::createFromInterface($start) : null; + $this->end = $end !== null ? \DateTimeImmutable::createFromInterface($end) : null; + + if ($this->start !== null && $this->end !== null) { + Assert::true($this->start <= $this->end, 'The start date must be before or equal to the end date.'); + } + } + + public function isActiveAt(?\DateTimeInterface $date = null): bool + { + $target = $date !== null ? \DateTimeImmutable::createFromInterface($date) : new \DateTimeImmutable(); + + if ($this->start !== null && $target < $this->start) { + return false; + } + + if ($this->end !== null && $target > $this->end) { + return false; + } + + return true; + } +} diff --git a/domain/Models/ValueObjects/DeliveryAddress.php b/domain/Models/ValueObjects/DeliveryAddress.php new file mode 100644 index 00000000..885fc7fa --- /dev/null +++ b/domain/Models/ValueObjects/DeliveryAddress.php @@ -0,0 +1,71 @@ +validate(); + } + + public static function fromShop(Shop $shop): self + { + return new self( + name: $shop->name, + address: $shop->address, + postcode: $shop->postcode, + city: $shop->city, + phone: $shop->phone, + latitude: $shop->latitude, + longitude: $shop->longitude + ); + } + + private function validate(): void + { + if (trim($this->name) === '') { + throw new \DomainException('Store name cannot be empty.'); + } + if (trim($this->address) === '') { + throw new \DomainException('Address cannot be empty.'); + } + if (trim($this->postcode) === '') { + throw new \DomainException('Postcode cannot be empty.'); + } + if (trim($this->city) === '') { + throw new \DomainException('City cannot be empty.'); + } + + if ($this->latitude !== null && $this->longitude === null) { + throw new \DomainException('Longitude must be provided if latitude is.'); + } + } + + /** + * @return array + */ + public function toArray(): array + { + return [ + 'name' => $this->name, + 'address' => $this->address, + 'postcode' => $this->postcode, + 'city' => $this->city, + 'phone' => $this->phone, + 'latitude' => $this->latitude, + 'longitude' => $this->longitude, + ]; + } +} diff --git a/domain/Models/ValueObjects/DiscountRate.php b/domain/Models/ValueObjects/DiscountRate.php new file mode 100644 index 00000000..b34b7e82 --- /dev/null +++ b/domain/Models/ValueObjects/DiscountRate.php @@ -0,0 +1,105 @@ +isPositive() || ! $discountAmount->isPositive()) { + return self::zero(); + } + + $basisPoints = intdiv( + ((int) $discountAmount->getAmount() * self::MAX_BASIS_POINTS * 2) + (int) $basePrice->getAmount(), + (int) $basePrice->getAmount() * 2 + ); + + return new self(min($basisPoints, self::MAX_BASIS_POINTS)); + } + + public function basisPoints(): int + { + return $this->basisPoints; + } + + /** Ratio between 0.0 and 1.0 */ + public function ratio(): float + { + return $this->basisPoints / self::MAX_BASIS_POINTS; + } + + /** Percentage between 0.0 and 100.0 */ + public function percentage(): float + { + return $this->basisPoints / 100; + } + + public function isZero(): bool + { + return $this->basisPoints === 0; + } + + public function equals(self $other): bool + { + return $this->basisPoints === $other->basisPoints; + } + + /** + * Returns the discount amount produced by this rate on the given amount. + * + * @param Money::ROUND_* $roundingMode + */ + public function applyTo(Money $amount, int $roundingMode = Money::ROUND_UP): Money + { + return $amount->multiply((string) $this->basisPoints)->divide(self::MAX_BASIS_POINTS, $roundingMode); + } + + #[\Override] + public function __toString(): string + { + return rtrim(rtrim(number_format($this->percentage(), 2, '.', ''), '0'), '.') . ' %'; + } +} diff --git a/domain/Models/ValueObjects/DiscountValue.php b/domain/Models/ValueObjects/DiscountValue.php new file mode 100644 index 00000000..55cf2a10 --- /dev/null +++ b/domain/Models/ValueObjects/DiscountValue.php @@ -0,0 +1,123 @@ + 100)) { + throw new \DomainException( + 'Percentage rate must be between 0 and 100.' + ); + } + if ($type === DiscountType::AMOUNT && $amount === null) { + throw new \DomainException( + 'Amount must be provided for amount discounts.' + ); + } + if ($amount !== null && $amount->isNegative()) { + throw new \DomainException( + 'Discount amount cannot be negative.' + ); + } + } + + public static function fromAmount(Money $amount): self + { + return new self(type: DiscountType::AMOUNT, amount: $amount); + } + + public static function fromPercentage(int $percentageRate): self + { + return new self(type: DiscountType::PERCENT, percentage: $percentageRate); + } + + public function value(): Money | int + { + if ($this->type === DiscountType::AMOUNT) { + return $this->getAmount(); + } + + return $this->getPercentage(); + } + + public function isPercentage(): bool + { + return $this->type === DiscountType::PERCENT; + } + + public function getPercentageRate(): float + { + return $this->getPercentage() / 100; + } + + public function getPercentage(): int + { + if ($this->type !== DiscountType::PERCENT) { + throw new \DomainException( + 'Cannot get percentage from a non-percentage discount.' + ); + } + + if ($this->percentage === null) { + throw new \DomainException( + 'Percentage rate must be set for percentage discounts.' + ); + } + + return $this->percentage; + } + + public function getAmount(): Money + { + if ($this->type !== DiscountType::AMOUNT) { + throw new \DomainException( + 'Cannot get amount from a non-amount discount.' + ); + } + + if ($this->amount === null) { + throw new \DomainException( + 'Amount must be set for amount discounts.' + ); + } + + return $this->amount; + } + + public function calculateDiscountAmount(Money $basePrice): Money + { + if ($this->type === DiscountType::AMOUNT) { + $amount = $this->getAmount(); + if (! $amount->getCurrency()->equals($basePrice->getCurrency())) { + throw new \DomainException('Currency mismatch.'); + } + + return $amount; + } + + $rate = $this->getPercentageRate(); + + return $basePrice->multiply((string) $rate, Product::ROUNDING); + } +} diff --git a/domain/Models/ValueObjects/EditablePickupExceptionForShop.php b/domain/Models/ValueObjects/EditablePickupExceptionForShop.php new file mode 100644 index 00000000..dd69e2f4 --- /dev/null +++ b/domain/Models/ValueObjects/EditablePickupExceptionForShop.php @@ -0,0 +1,21 @@ +pickupException = clone $pickupException; + } +} diff --git a/domain/Models/ValueObjects/Email.php b/domain/Models/ValueObjects/Email.php new file mode 100644 index 00000000..5f0606c2 --- /dev/null +++ b/domain/Models/ValueObjects/Email.php @@ -0,0 +1,21 @@ +validate($value); + } + + private function validate(string $email): void + { + if (! filter_var($email, FILTER_VALIDATE_EMAIL)) { + throw new \DomainException('Invalid email address'); + } + } +} diff --git a/domain/Models/ValueObjects/EmployeeUpsertData.php b/domain/Models/ValueObjects/EmployeeUpsertData.php new file mode 100644 index 00000000..91201635 --- /dev/null +++ b/domain/Models/ValueObjects/EmployeeUpsertData.php @@ -0,0 +1,21 @@ +value = $matricule; + } + + public function __toString(): string + { + return $this->value; + } + + public function equals(mixed $other): bool + { + return $other instanceof self && $this->value === $other->value; + } +} diff --git a/domain/Models/ValueObjects/NutritionalValues.php b/domain/Models/ValueObjects/NutritionalValues.php new file mode 100644 index 00000000..b84357cf --- /dev/null +++ b/domain/Models/ValueObjects/NutritionalValues.php @@ -0,0 +1,119 @@ + + */ + public function toArray(): array + { + return [ + 'nv_ref_weight_g' => $this->refWeightG, + 'nv_kj' => $this->kj, + 'nv_kcal' => $this->kcal, + 'nv_fat_g' => $this->fatG, + 'nv_sat_fat_g' => $this->satFatG, + 'nv_carb_g' => $this->carbG, + 'nv_sugar_g' => $this->sugarG, + 'nv_fiber_g' => $this->fiberG, + 'nv_protein_g' => $this->proteinG, + 'nv_salt_g' => $this->saltG, + + 'nv_serving_size_g' => $this->servingSizeG, + 'nv_serving_kj' => $this->servingKj, + 'nv_serving_kcal' => $this->servingKcal, + 'nv_serving_fat_g' => $this->servingFatG, + 'nv_serving_sat_fat_g' => $this->servingSatFatG, + 'nv_serving_carb_g' => $this->servingCarbG, + 'nv_serving_sugar_g' => $this->servingSugarG, + 'nv_serving_fiber_g' => $this->servingFiberG, + 'nv_serving_protein_g' => $this->servingProteinG, + 'nv_serving_salt_g' => $this->servingSaltG, + + 'nv_daily_energy' => $this->dailyEnergy, + 'nv_daily_fat' => $this->dailyFat, + 'nv_daily_sat_fat' => $this->dailySatFat, + 'nv_daily_carb' => $this->dailyCarb, + 'nv_daily_sugar' => $this->dailySugar, + 'nv_daily_fiber' => $this->dailyFiber, + 'nv_daily_protein' => $this->dailyProtein, + 'nv_daily_salt' => $this->dailySalt, + ]; + } +} diff --git a/domain/Models/ValueObjects/OrderEmployee.php b/domain/Models/ValueObjects/OrderEmployee.php new file mode 100644 index 00000000..53bff56a --- /dev/null +++ b/domain/Models/ValueObjects/OrderEmployee.php @@ -0,0 +1,41 @@ +assertNotEmpty('firstname', $firstname); + $this->assertNotEmpty('lastname', $lastname); + } + + public static function fromShopper(Shopper $shopper): self + { + return new self( + matricule: clone $shopper->matricule, + firstname: $shopper->prenom, + lastname: $shopper->nom, + facility: $shopper->etablissement, + site: $shopper->site, + service: $shopper->service + ); + } + + private function assertNotEmpty(string $attribute, string $value): void + { + if (empty(trim($value))) { + throw new \DomainException("{$attribute} cannot be empty"); + } + } +} diff --git a/domain/Models/ValueObjects/OrderLine.php b/domain/Models/ValueObjects/OrderLine.php new file mode 100644 index 00000000..d2d27b49 --- /dev/null +++ b/domain/Models/ValueObjects/OrderLine.php @@ -0,0 +1,69 @@ +unitTtc = $unitPriceHt->subtract($unitDiscount)->add($unitTax); + + if ($quantity <= 0) { + throw new \DomainException('Quantity must be greater than 0'); + } + if ($unitPriceHt->isNegative()) { + throw new \DomainException('Unit price must be non-negative'); + } + if ($unitDiscount->isNegative()) { + throw new \DomainException('Unit discount must be non-negative'); + } + if ($unitTax->isNegative()) { + throw new \DomainException('Unit tax must be non-negative'); + } + if ($this->unitTtc->isNegative()) { + throw new \DomainException('Unit TTC must be non-negative'); + } + if ($totalHt->isNegative()) { + throw new \DomainException('Total HT must be non-negative'); + } + if ($totalDiscount->isNegative()) { + throw new \DomainException('Total discount must be non-negative'); + } + if ($totalTax->isNegative()) { + throw new \DomainException('Total tax must be non-negative'); + } + if ($totalTtc->isNegative()) { + throw new \DomainException('Total TTC must be non-negative'); + } + } + + public static function fromBasketProduct(BasketProduct $item): self + { + return new self( + product: OrderLineProduct::fromBasketProduct($item), + quantity: $item->qty, + unitPriceHt: clone $item->unitPriceHt, + unitDiscount: clone $item->unitDiscount, + unitTax: clone $item->unitTax(), + totalHt: clone $item->subtotalHt(), + totalDiscount: clone $item->discountTotal(), + totalTax: clone $item->taxTotal(), + totalTtc: clone $item->totalTtc() + ); + } +} diff --git a/domain/Models/ValueObjects/OrderLineProduct.php b/domain/Models/ValueObjects/OrderLineProduct.php new file mode 100644 index 00000000..a8ab97fc --- /dev/null +++ b/domain/Models/ValueObjects/OrderLineProduct.php @@ -0,0 +1,64 @@ +isNegative()) { + throw new \DomainException('Product price cannot be negative'); + } + if ($discountedPrice->isNegative()) { + throw new \DomainException('Product discounted price cannot be negative'); + } + if ($priceKgTtc->isNegative()) { + throw new \DomainException('Price per kg TTC cannot be negative'); + } + if ($discountedPrice->greaterThan($price)) { + throw new \DomainException('Product discounted price cannot be greater than original price'); + } + if (! $priceKgTtc->isPositive()) { + throw new \DomainException('Price per kg TTC has to be positive'); + } + } + + public static function fromBasketProduct(BasketProduct $item): self + { + return new self( + incoId: $item->incoId ?? throw new \DomainException('incoId cannot be null for an order'), + originalId: $item->id, + name: $item->name, + weight: new ProductWeight($item->weightGrams, $item->weightVariable), + brand: $item->brand ?? ProductBrand::none, + orderUnit: $item->orderUnit, + price: clone $item->unitPriceHt, + discountedPrice: $item->unitPriceDiscounted(), + priceKgTtc: clone $item->priceKgTtc, + taxRate: $item->taxRate, + picture: $item->picture + ); + } +} diff --git a/domain/Models/ValueObjects/OrderReference.php b/domain/Models/ValueObjects/OrderReference.php new file mode 100644 index 00000000..59b6edc1 --- /dev/null +++ b/domain/Models/ValueObjects/OrderReference.php @@ -0,0 +1,47 @@ +value); + } +} diff --git a/domain/Models/ValueObjects/PhoneNumber.php b/domain/Models/ValueObjects/PhoneNumber.php new file mode 100644 index 00000000..25938e79 --- /dev/null +++ b/domain/Models/ValueObjects/PhoneNumber.php @@ -0,0 +1,26 @@ +value; + } +} diff --git a/domain/Models/ValueObjects/PickupTimeSlot.php b/domain/Models/ValueObjects/PickupTimeSlot.php new file mode 100644 index 00000000..ed38ad58 --- /dev/null +++ b/domain/Models/ValueObjects/PickupTimeSlot.php @@ -0,0 +1,50 @@ +at = clone $at; + $this->for = clone $for; + } + + public function getAt(): \DateTimeImmutable + { + return $this->at instanceof \DateTimeImmutable + ? $this->at + : \DateTimeImmutable::createFromInterface($this->at); + } + + public function getFor(): \DateInterval + { + return $this->for; + } + + public function getEndsAt(): \DateTimeImmutable + { + return $this->getAt()->add($this->for); + } + + public function __toString(): string + { + return sprintf( + '%s (%s)', + $this->getAt()->format(\DateTimeInterface::RFC3339), + CarbonInterval::instance($this->for)->spec() + ); + } +} diff --git a/domain/Models/ValueObjects/PictureMetadata.php b/domain/Models/ValueObjects/PictureMetadata.php new file mode 100644 index 00000000..d9c2f25f --- /dev/null +++ b/domain/Models/ValueObjects/PictureMetadata.php @@ -0,0 +1,29 @@ +alt !== null) { + $trimmedAlt = trim($this->alt); + Assert::stringNotEmpty($trimmedAlt, 'Picture alt cannot be empty when provided.'); + Assert::minLength($trimmedAlt, 4, 'Picture alt must be at least 4 characters.'); + Assert::maxLength($trimmedAlt, 75, 'Picture alt cannot exceed 75 characters.'); + } + + if ($this->title !== null) { + $trimmedTitle = trim($this->title); + Assert::stringNotEmpty($trimmedTitle, 'Picture title cannot be empty when provided.'); + Assert::minLength($trimmedTitle, 4, 'Picture title must be at least 4 characters.'); + Assert::maxLength($trimmedTitle, 75, 'Picture title cannot exceed 75 characters.'); + } + } +} diff --git a/domain/Models/ValueObjects/ProductPricing.php b/domain/Models/ValueObjects/ProductPricing.php new file mode 100644 index 00000000..ff2ed2ed --- /dev/null +++ b/domain/Models/ValueObjects/ProductPricing.php @@ -0,0 +1,70 @@ +isNegative()) { + throw new \DomainException('basePriceHt cannot be negative'); + } + if ($basePriceTtc->isNegative()) { + throw new \DomainException('basePriceTtc cannot be negative'); + } + if ($discountAmountHt->isNegative()) { + throw new \DomainException('discountAmountHt cannot be negative'); + } + if ($discountedPriceHt->isNegative()) { + throw new \DomainException('discountedPriceHt cannot be negative'); + } + if ($discountedPriceTtc->isNegative()) { + throw new \DomainException('discountedPriceTtc cannot be negative'); + } + if ($priceKgTtc->isNegative()) { + throw new \DomainException('priceKgTtc cannot be negative'); + } + } + + public function basePriceHt(): Money + { + return $this->basePriceHt; + } + + public function basePriceTtc(): Money + { + return $this->basePriceTtc; + } + + public function discountAmountHt(): Money + { + return $this->discountAmountHt; + } + + public function discountedPriceHt(): Money + { + return $this->discountedPriceHt; + } + + public function discountedPriceTtc(): Money + { + return $this->discountedPriceTtc; + } + + public function priceKgTtc(): Money + { + return $this->priceKgTtc; + } +} diff --git a/domain/Models/ValueObjects/ProductWeight.php b/domain/Models/ValueObjects/ProductWeight.php new file mode 100644 index 00000000..0866530a --- /dev/null +++ b/domain/Models/ValueObjects/ProductWeight.php @@ -0,0 +1,38 @@ +value; + } + + public function forDisplay(): string + { + if ($this->value >= 1000) { + $kg = $this->value / 1000; + + $formatted = fmod($kg, 1.0) === 0.0 + ? number_format($kg, 0, ',', ' ') + : rtrim(rtrim(number_format($kg, 3, ',', ' '), '0'), ','); + + return "{$formatted} kg"; + } + + return "{$this->value} g"; + } +} diff --git a/domain/Models/ValueObjects/SeoMetadata.php b/domain/Models/ValueObjects/SeoMetadata.php new file mode 100644 index 00000000..2e7cf6c7 --- /dev/null +++ b/domain/Models/ValueObjects/SeoMetadata.php @@ -0,0 +1,20 @@ +title)); + Assert::maxLength($this->title, 255); + Assert::stringNotEmpty(trim($this->description)); + Assert::maxLength($this->description, 500); + } +} diff --git a/domain/Models/ValueObjects/SessionId.php b/domain/Models/ValueObjects/SessionId.php new file mode 100644 index 00000000..4c740eb7 --- /dev/null +++ b/domain/Models/ValueObjects/SessionId.php @@ -0,0 +1,19 @@ +greaterThanOrEqualTo($replacementDate)) { + throw new \DomainException( + 'Order deadline must be strictly before the replacement date' + ); + } + } + + public function hasReplacement(): bool + { + return $this->replacementDate !== null; + } + + public function effectiveDeadline(CarbonInterface $defaultDeadline): CarbonImmutable + { + return $this->orderDeadlineAt !== null + ? CarbonImmutable::createFromInterface($this->orderDeadlineAt) + : CarbonImmutable::createFromInterface($defaultDeadline); + } + + public function isDeadlinePassed(CarbonInterface $now, CarbonInterface $defaultDeadline): bool + { + return $now->greaterThan($this->effectiveDeadline($defaultDeadline)); + } +} diff --git a/domain/Models/ValueObjects/ShopperEstablishmentCode.php b/domain/Models/ValueObjects/ShopperEstablishmentCode.php new file mode 100644 index 00000000..8de11d69 --- /dev/null +++ b/domain/Models/ValueObjects/ShopperEstablishmentCode.php @@ -0,0 +1,32 @@ +value; + } + + public function equals(mixed $other): bool + { + return $other instanceof self && $this->value === $other->value; + } +} diff --git a/domain/Models/ValueObjects/ShopperServiceCode.php b/domain/Models/ValueObjects/ShopperServiceCode.php new file mode 100644 index 00000000..73d2f6b9 --- /dev/null +++ b/domain/Models/ValueObjects/ShopperServiceCode.php @@ -0,0 +1,32 @@ +value; + } + + public function equals(mixed $other): bool + { + return $other instanceof self && $this->value === $other->value; + } +} diff --git a/domain/Models/ValueObjects/ShopperSiteCode.php b/domain/Models/ValueObjects/ShopperSiteCode.php new file mode 100644 index 00000000..b9883797 --- /dev/null +++ b/domain/Models/ValueObjects/ShopperSiteCode.php @@ -0,0 +1,32 @@ +value; + } + + public function equals(mixed $other): bool + { + return $other instanceof self && $this->value === $other->value; + } +} diff --git a/domain/Models/ValueObjects/Slug.php b/domain/Models/ValueObjects/Slug.php new file mode 100644 index 00000000..ea353937 --- /dev/null +++ b/domain/Models/ValueObjects/Slug.php @@ -0,0 +1,38 @@ +value; + } +} diff --git a/domain/Policies/CustomerOrderLimitPolicy.php b/domain/Policies/CustomerOrderLimitPolicy.php new file mode 100644 index 00000000..1b1a6722 --- /dev/null +++ b/domain/Policies/CustomerOrderLimitPolicy.php @@ -0,0 +1,44 @@ +greaterThan($this->getMaxOrderAmount())) { + throw new OrderLimitExceededException(); + } + } + + public function assertCanPlaceWeeklyOrder(Money $basketTotal, Money $weeklyTotal): void + { + if ($weeklyTotal->add($basketTotal)->greaterThan($this->getMaxWeeklyAmount())) { + throw new WeeklyLimitExceededException(); + } + } + + private function getMaxOrderAmount(): Money + { + return new Money($this->maxOrderAmountCents, $this->currency ?? new Currency('EUR')); + } + + private function getMaxWeeklyAmount(): Money + { + return new Money($this->maxWeeklyAmountCents, $this->currency ?? new Currency('EUR')); + } +} diff --git a/domain/Ports/Directories/CodeDirectory.php b/domain/Ports/Directories/CodeDirectory.php new file mode 100644 index 00000000..ca22230e --- /dev/null +++ b/domain/Ports/Directories/CodeDirectory.php @@ -0,0 +1,18 @@ + + */ +interface CodeDirectory extends Directory +{ + public function find(Code $code): ?string; + + public function exists(Code $code): bool; +} diff --git a/domain/Ports/Directories/ShopDirectory.php b/domain/Ports/Directories/ShopDirectory.php new file mode 100644 index 00000000..d6815d3d --- /dev/null +++ b/domain/Ports/Directories/ShopDirectory.php @@ -0,0 +1,20 @@ + + */ +interface ShopDirectory extends Directory +{ + public function find(ShopId $id): ?Shop; + + /** @return array */ + public function getAll(): array; +} diff --git a/domain/Ports/Repositories/BasketRepository.php b/domain/Ports/Repositories/BasketRepository.php new file mode 100644 index 00000000..8dcbafad --- /dev/null +++ b/domain/Ports/Repositories/BasketRepository.php @@ -0,0 +1,21 @@ + + */ +interface BasketRepository extends Repository +{ + public function find(BasketId $id): ?Basket; + + public function persist(Basket $basket): void; + + public function delete(Basket $basket): void; +} diff --git a/domain/Ports/Repositories/OrderRepository.php b/domain/Ports/Repositories/OrderRepository.php new file mode 100644 index 00000000..160b1a70 --- /dev/null +++ b/domain/Ports/Repositories/OrderRepository.php @@ -0,0 +1,21 @@ + + */ +interface OrderRepository extends Repository +{ + public function find(OrderId $id): ?Order; + + public function persist(Order $order): void; + + public function delete(Order $order): void; +} diff --git a/domain/Ports/Repositories/PickupExceptionRepository.php b/domain/Ports/Repositories/PickupExceptionRepository.php new file mode 100644 index 00000000..f505b9f9 --- /dev/null +++ b/domain/Ports/Repositories/PickupExceptionRepository.php @@ -0,0 +1,32 @@ + + */ +interface PickupExceptionRepository extends Repository +{ + public function find(PickupExceptionId $id): ?PickupExceptionOnDate; + + public function persist(PickupExceptionOnDate $pickupException): void; + + public function delete(PickupExceptionOnDate $pickupException): void; + + /** @return array */ + public function getExceptionsForShop(ShopId $shopId, CarbonPeriod $period): array; + + /** @return array */ + public function getAllExceptions(): array; + + /** @return array */ + public function getExceptionsAssociatedWithShop(ShopId $shopId): array; +} diff --git a/domain/Ports/Repositories/ProductRepository.php b/domain/Ports/Repositories/ProductRepository.php new file mode 100644 index 00000000..9449d305 --- /dev/null +++ b/domain/Ports/Repositories/ProductRepository.php @@ -0,0 +1,24 @@ + + */ +interface ProductRepository extends Repository +{ + public function find(ProductId $id): ?Product; + + public function persist(Product $product): void; + + public function delete(Product $product): void; + + public function getBasketProduct(ProductId $id, int $qty): BasketProduct; +} diff --git a/domain/Ports/Repositories/ShopRepository.php b/domain/Ports/Repositories/ShopRepository.php new file mode 100644 index 00000000..eb56b07c --- /dev/null +++ b/domain/Ports/Repositories/ShopRepository.php @@ -0,0 +1,30 @@ + + */ +interface ShopRepository extends Repository +{ + public function find(ShopId $id): ?Shop; + + public function persist(Shop $shop): void; + + public function delete(Shop $shop): void; + + public function findExceptionShopFor(Matricule $matricule): ?Shop; + + public function findShopForSiteAndService(ShopperSiteCode $siteCode, ?ShopperServiceCode $serviceCode): ?Shop; + + public function getDefaultShop(): Shop; +} diff --git a/domain/Ports/Repositories/ShopperRepository.php b/domain/Ports/Repositories/ShopperRepository.php new file mode 100644 index 00000000..e6c9a524 --- /dev/null +++ b/domain/Ports/Repositories/ShopperRepository.php @@ -0,0 +1,24 @@ + + */ +interface ShopperRepository extends Repository +{ + public function find(ShopperId $id): ?Shopper; + + public function persist(Shopper $shopper): void; + + public function delete(Shopper $shopper): void; + + /** @throws \DomainException If the shopper is not found */ + public function getByIdOrFail(ShopperId $id): Shopper; +} diff --git a/domain/Ports/Services/AdminAuthenticationService.php b/domain/Ports/Services/AdminAuthenticationService.php new file mode 100644 index 00000000..4c0e7e75 --- /dev/null +++ b/domain/Ports/Services/AdminAuthenticationService.php @@ -0,0 +1,25 @@ + $rows + */ + public function generate(array $header, array $rows): string; +} diff --git a/domain/Ports/Services/CustomerAuthenticationService.php b/domain/Ports/Services/CustomerAuthenticationService.php new file mode 100644 index 00000000..6f89d8a3 --- /dev/null +++ b/domain/Ports/Services/CustomerAuthenticationService.php @@ -0,0 +1,37 @@ + $upsertData + */ + public function upsertEmployees(array $upsertData): void; + + /** + * @param \Domain\Models\ValueObjects\Matricule[] $matriculesToInsert + * @return object{insertedCount: int, updatedCount: int, matriculesInserted: \Domain\Models\ValueObjects\Matricule[]} + */ + public function getImportedAfter(array $matriculesToInsert, CarbonImmutable $importStartTime): object; +} diff --git a/domain/Ports/Services/EmployeeStatisticsService.php b/domain/Ports/Services/EmployeeStatisticsService.php new file mode 100644 index 00000000..023c496b --- /dev/null +++ b/domain/Ports/Services/EmployeeStatisticsService.php @@ -0,0 +1,18 @@ +getBasketId(); + + return $this->repository->find($basketId) ?? new Basket($basketId, []); + } + + public function add(ProductId $productId, int $qty = 1): void + { + $basketProduct = $this->productRepository->getBasketProduct($productId, $qty); + $basket = $this->getBasket(); + + $basket->addOrUpdate($basketProduct); + + $this->repository->persist($basket); + } + + public function remove(ProductId $productId, int $qty = 1): void + { + $basket = $this->getBasket(); + $basket->remove($productId, $qty); + + $this->repository->persist($basket); + } + + public function removeLine(ProductId $productId): void + { + $basket = $this->getBasket(); + $basket->removeLine($productId); + + $this->repository->persist($basket); + } + + public function revalidateBasket(Basket $basket): Basket + { + $refreshedItems = []; + + foreach ($basket->items() as $item) { + $refreshedItems[] = $this->productRepository->getBasketProduct($item->id, $item->qty); + } + + $refreshedBasket = new Basket($basket->id, $refreshedItems); + $this->repository->persist($refreshedBasket); + + return $refreshedBasket; + } + + public function empty(): void + { + $this->repository->delete($this->getBasket()); + } + + private function getBasketId(): BasketId + { + $sessionId = $this->sessionService->get(); + + return new BasketId($sessionId->value); + } +} diff --git a/domain/Services/OrderService.php b/domain/Services/OrderService.php new file mode 100644 index 00000000..a0736665 --- /dev/null +++ b/domain/Services/OrderService.php @@ -0,0 +1,62 @@ +newOrderId(), + reference: $this->newReference(), + basket: $basket, + pickupTimeSlot: $pickupTimeSlot, + shopper: $shopper, + shop: $shop + ); + } + + private function newOrderId(): OrderId + { + return new OrderId(Uuid::uuid7()); + } + + private function newReference(): OrderReference + { + return new OrderReference(Uuid::uuid7()); + } + + public function cancelOrder(OrderId $id): void + { + $order = $this->orderRepository->find($id); + + if (! $order) { + throw new \DomainException('Order not found'); + } + + $order->cancel(); + + $this->orderRepository->persist($order); + } +} diff --git a/domain/Services/OrderTunnelService.php b/domain/Services/OrderTunnelService.php new file mode 100644 index 00000000..0a149fae --- /dev/null +++ b/domain/Services/OrderTunnelService.php @@ -0,0 +1,231 @@ +basketService->getBasket()->countItems() > 0; + } + + public function canAccessStep(OrderTunnelStep $step): bool + { + $builder = $this->orderBuilderSessionManager->get(); + + $hasValidBasket = $this->hasValidBasket(); + + return match ($step) { + OrderTunnelStep::REVIEW => $hasValidBasket, + OrderTunnelStep::BOOKING => $this->hasValidBasket() && $builder !== null && $builder->isFromBasket(), + OrderTunnelStep::CONFIRMATION => $this->hasValidBasket() && $builder !== null && $builder->isCompleted(), + }; + } + + /** + * Resolve the shop assigned to a customer. + * + * @throws \UnexpectedValueException If no shop can be resolved. + */ + public function getShopForCustomer(ShopperId $customerId): Shop + { + return $this->shopperService->getShopFor($customerId) + ?? throw new \UnexpectedValueException( + "No shop found for customer '{$customerId->value}'" + ); + } + + /** @return array */ + public function getAvailableTimeSlots(Shop $shop): array + { + return $this->pickupService->getTimeSlotsFor( + $shop, + $this->getTimeslotsUntil() + ); + } + + public function initializeFromBasket(Basket $basket, ShopperId $customerId): void + { + /** @var OrderBuilder $builder */ + $builder = OrderBuilder::fromBasket($basket, $customerId); + + $this->orderBuilderSessionManager->save($builder); + } + + /** + * @throws \Domain\Exceptions\OrderTunnel\MissingOrderBuilderException + */ + public function getBuilderFromBasketOrFail(): OrderBuilderWithBasket + { + $builder = $this->orderBuilderSessionManager->get(); + + if ($builder === null || ! $builder->isFromBasket()) { + throw new MissingOrderBuilderException(); + } + + /** @var OrderBuilderWithBasket $builder */ + return $builder; + } + + /** + * @throws \Domain\Exceptions\OrderTunnel\MissingOrderBuilderException + */ + public function getBuilderCompletedOrFail(): OrderBuilderCompleted + { + $builder = $this->orderBuilderSessionManager->get(); + + if ($builder === null || ! $builder->isCompleted()) { + throw new MissingOrderBuilderException(); + } + + /** @var OrderBuilderCompleted $builder */ + return $builder; + } + + /** + * Validate that the selected date matches an available slot and apply it to the builder. + * + * @param array $availableSlots + */ + public function applyTimeSlot( + OrderBuilderWithBasket $builder, + Shop $shop, + CarbonInterface $selectedDate, + array $availableSlots + ): ?PickupTimeSlot { + $matchedSlot = null; + foreach ($availableSlots as $ts) { + if ($selectedDate->isSameDay($ts->getAt())) { + $matchedSlot = $ts; + break; + } + } + + if ($matchedSlot === null) { + return null; + } + + /** @var OrderBuilder $completed */ + $completed = $builder->withPickupTimeSlot($shop->id(), $matchedSlot); + + $this->orderBuilderSessionManager->save($completed); + + return $matchedSlot; + } + + /** @throws \Domain\Exceptions\OrderTunnel\OrderLimitExceededException */ + public function assertBasketAmountWithinLimit(Basket $basket): void + { + $this->orderLimitPolicy->assertCanPlaceOrder($basket->totalTaxIncluded()); + } + + /** @throws \Domain\Exceptions\OrderTunnel\WeeklyLimitExceededException */ + public function assertBasketWeeklyAmountWithinLimitFor( + Shopper $shopper, + Basket $withBasket, + \DateTimeInterface $atDate + ): void { + $startOfWeek = CarbonImmutable::instance($atDate)->startOfWeek(CarbonInterface::MONDAY); + $endOfWeek = CarbonImmutable::instance($atDate)->endOfWeek(CarbonInterface::SUNDAY); + + $weekTotal = $this->employeeStatisticsService->getWeeklyTotalForEmployee( + $shopper->matricule, + $startOfWeek, + $endOfWeek + ); + + $this->orderLimitPolicy->assertCanPlaceWeeklyOrder($withBasket->totalTaxIncluded(), $weekTotal); + } + + /** + * @throws WeeklyLimitExceededException + * @throws OrderLimitExceededException + */ + public function finalizeOrder(OrderBuilderCompleted $builder): Order + { + $shopperId = $builder->getShopperId(); + $basket = $this->basketService->revalidateBasket($builder->getBasket()); + $pickupTimeSlot = $builder->getPickupTimeSlot(); + $shopId = $builder->getShopId(); + $shopper = $this->shopperRepository->getByIdOrFail($shopperId); + + $this->assertBasketAmountWithinLimit($basket); + $this->assertBasketWeeklyAmountWithinLimitFor( + $shopper, + $basket, + $pickupTimeSlot->getAt() + ); + + return $this->transactionManager->execute(function () use ($basket, $shopId, $shopper, $pickupTimeSlot) { + $shop = $this->shopRepository->find($shopId); + if (! $shop) { + throw new \DomainException("Shop with id '{$shopId->value}' not found."); + } + + $order = $this->orderService->createOrderFromBasket( + $basket, + $pickupTimeSlot, + $shopper, + $shop + ); + + $this->orderRepository->persist($order); + + $this->eventDispatcher->dispatch($order->toPlacedEvent()); + + $this->basketService->empty(); + $this->orderBuilderSessionManager->clear(); + + return $order; + }); + } + + private function getTimeslotsUntil(): CarbonInterface + { + return CarbonImmutable::now()->addDays(self::TIMESLOTS_DAY_TARGET); + } +} diff --git a/domain/Services/PickupSchedulingService.php b/domain/Services/PickupSchedulingService.php new file mode 100644 index 00000000..7367c59d --- /dev/null +++ b/domain/Services/PickupSchedulingService.php @@ -0,0 +1,203 @@ +nextPickup(); + + return $this->getDefaultDeadline($nextPickup); + } + + public function nextPickup(): CarbonInterface + { + $now = $this->getNow(); + $startOfThisDay = $now->copy()->startOfDay(); + + if ($startOfThisDay->isDayOfWeek(self::PICKUP_DAY->value) && $now->hour < self::CUTOFF_HOUR) { + return $startOfThisDay->addHours(self::CUTOFF_HOUR); + } + + return $startOfThisDay + ->next(self::PICKUP_DAY->value) + ->addHours(self::CUTOFF_HOUR); + } + + public function getPeriodFromPickUpDay(): CarbonPeriod + { + $nextPickup = $this->nextPickup(); + + return $this->getPeriodForPickupDate($nextPickup); + } + + public function getPeriodForPickupDate(CarbonInterface $pickupDate): CarbonPeriod + { + $pickupDate = CarbonImmutable::createFromInterface($pickupDate); + $defaultDeadLine = $this->getDefaultDeadline($pickupDate); + + return CarbonPeriod::create($defaultDeadLine, $pickupDate->endOfDay()); + } + + /** @return \Domain\Models\ValueObjects\EditablePickupExceptionForShop[] */ + public function getEditablePickupExceptionsFor(Shop $shop): array + { + $allExceptions = $this->pickupExceptionRepository->getAllExceptions(); + $shopExceptions = $this->pickupExceptionRepository->getExceptionsAssociatedWithShop($shop->id()); + + return array_map(function (PickupExceptionOnDate $pickupException) use ($shopExceptions) { + $associated = null; + foreach ($shopExceptions as $shopEx) { + if ($shopEx->exception->id->equals($pickupException->id)) { + $associated = $shopEx; + break; + } + } + + $isChecked = $associated !== null; + $isPickupDay = $pickupException->isPickupDay(self::PICKUP_DAY); + $defaultDeadline = $this->getDefaultDeadline($pickupException->date); + $isBlocked = $associated !== null && ! $associated->hasReplacement(); + $isPastDeadline = $associated !== null && $associated->isDeadlinePassed($this->getNow(), $defaultDeadline); + + return new EditablePickupExceptionForShop( + $pickupException, + $isPickupDay, + $isChecked && $isPickupDay && $isBlocked, + $isChecked && $isPickupDay && $isPastDeadline + ); + }, $allExceptions); + } + + /** @return \Domain\Models\ValueObjects\PickupTimeSlot[] */ + public function getTimeSlotsFor(Shop $shop, \DateTimeInterface $until): array + { + $todayDate = $this->getNow()->startOfDay(); + $untilDayDate = CarbonImmutable::createFromInterface($until)->startOfDay(); + $coveredPeriod = CarbonPeriod::create($todayDate, $untilDayDate); + + if ($untilDayDate->lessThanOrEqualTo($todayDate)) { + throw new \InvalidArgumentException('Cannot get time slots for past days'); + } + + $pickupExceptionList = $this->pickupExceptionRepository->getExceptionsForShop($shop->id(), $coveredPeriod); + + $filteredDates = array_filter( + $coveredPeriod->toArray(), + fn (CarbonInterface $date) => $date->isDayOfWeek(self::PICKUP_DAY->value) + ); + + $mappedSlots = array_map(function (CarbonInterface $date) use ($pickupExceptionList) { + $pickupDayDate = CarbonImmutable::createFromInterface($date); + + $shopPickupExceptionForTheDate = null; + foreach ($pickupExceptionList as $ex) { + if ($pickupDayDate->isSameDay($ex->exception->date)) { + $shopPickupExceptionForTheDate = $ex; + break; + } + } + + return $shopPickupExceptionForTheDate !== null + ? $this->getTimeSlotForException($shopPickupExceptionForTheDate) + : $this->getTimeSlotForPickupDay($pickupDayDate); + }, $filteredDates); + + $validSlots = array_filter($mappedSlots); + usort($validSlots, fn (PickupTimeSlot $a, PickupTimeSlot $b) => $a->getAt() <=> $b->getAt()); + + return $validSlots; + } + + protected function getTimeSlotForPickupDay(CarbonInterface $pickupDayDate): ?PickupTimeSlot + { + $defaultDeadline = $this->getDefaultDeadline($pickupDayDate); + + // ? Have we reached the default standard deadline ? + return $this->isBefore($defaultDeadline) + // * Nominal pipeline: timeslot matches standard pickup day + ? $this->createTimeSlot($pickupDayDate) + : null; + } + + protected function getTimeSlotForException(ShopPickupOverride $shopPickupException): ?PickupTimeSlot + { + if (! $shopPickupException->hasReplacement() || $shopPickupException->replacementDate === null) { + return null; + } + + $defaultDeadline = $this->getDefaultDeadline(CarbonImmutable::createFromInterface($shopPickupException->exception->date)); + $deadline = $shopPickupException->effectiveDeadline($defaultDeadline); + + return $this->isBefore($deadline) + ? $this->createTimeSlot($shopPickupException->replacementDate->toImmutable()) + : null; + } + + protected function createTimeSlot(CarbonInterface $forDate): PickupTimeSlot + { + return new PickupTimeSlot( + $forDate->startOfDay(), + \DateInterval::createFromDateString('23 hours 59 minutes 59 seconds') + ); + } + + protected function getDefaultDeadline(CarbonInterface $pickupDate): CarbonImmutable + { + $deadline = CarbonImmutable::createFromInterface($pickupDate) + ->startOfWeek(CarbonInterface::MONDAY) + ->addDays(self::CUTOFF_DAY->value - 1) + ->addHours(self::CUTOFF_HOUR); + + return $this->getCutoffWeekOffset() !== 0 + ? $deadline->addWeeks($this->getCutoffWeekOffset()) + : $deadline; + } + + private function getCutoffWeekOffset(): int + { + return self::CUTOFF_WEEK_OFFSET; + } + + protected function isBefore(CarbonInterface $date): bool + { + return $this->getNow()->lessThanOrEqualTo($date); + } + + protected function getNow(): CarbonImmutable + { + return CarbonImmutable::createFromInterface(new \DateTimeImmutable()); + } +} diff --git a/domain/Services/RegateService.php b/domain/Services/RegateService.php new file mode 100644 index 00000000..96758aad --- /dev/null +++ b/domain/Services/RegateService.php @@ -0,0 +1,79 @@ +productIncoId->value, + $employeeMatricule->value, + (string) $line->productIncoId->value, + 'commande ferme', + (string) $line->productOrderUnit->value, + $line->productOrderUnit->toRegateCode(), + '', + $pickupDay->format('d/m/Y'), + (string) $line->quantity, + (string) $reference, + ] + ); + } + + $csvContent = $this->csvGenerator->generate($this->header, $rows); + + $now = CarbonImmutable::now(); + $fileName = sprintf( + 'BTQ-%s-%s%s.csv', + $reference, + $now->format('Ymd_His'), + \microtime(true) + ); + + $this->dispatcher->dispatch( + new RegateOrderCsvGenerated($csvContent, $fileName) + ); + } +} diff --git a/domain/Services/ShopperService.php b/domain/Services/ShopperService.php new file mode 100644 index 00000000..ec12f9f6 --- /dev/null +++ b/domain/Services/ShopperService.php @@ -0,0 +1,73 @@ +shopperRepository->find($shopperId); + } + + /** + * Resolve the shop assigned to a customer through their employee record. + * + * Resolution order: + * 1. Direct exception override (shop_employee_exception table) + * 2. Site + service mapping (shop_employees table, with service_code) + * 3. Site-only mapping (shop_employees table, service_code IS NULL) + * 4. Default shop (shops.default = true) + */ + public function getShopFor(ShopperId $shopperId): ?Shop + { + $shopper = $this->getShopperFor($shopperId); + + return $shopper !== null ? $this->resolveShopForEmployee($shopper) : null; + } + + public function resolveShopForEmployee(Shopper $shopper): Shop + { + // 1. Check for a direct exception override + $exceptionShop = $this->shopRepository + ->findExceptionShopFor($shopper->matricule); + if ($exceptionShop !== null) { + return $exceptionShop; + } + + // 2. Try matching on site_code + service_code + $serviceShop = $this->shopRepository + ->findShopForSiteAndService($shopper->site, $shopper->service); + if ($serviceShop !== null) { + return $serviceShop; + } + + // 3. Fall back to site_code only (service_code IS NULL) + $siteShop = $this->shopRepository + ->findShopForSiteAndService($shopper->site, null); + if ($siteShop !== null) { + return $siteShop; + } + + // 4. Ultimate fallback: the default shop + return $this->shopRepository->getDefaultShop(); + } + + public function canCustomerPassOrdersApp(ShopperId $shopperId): bool + { + return $this->getShopperFor($shopperId)?->isActive() ?? false; + } +} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..689b6daf --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,115 @@ +import vueTsEslintConfig from "@vue/eslint-config-typescript"; +import pluginImportX from "eslint-plugin-import-x"; +import pluginVue from "eslint-plugin-vue"; + +export default [ + // Global ignores + { + ignores: [ + "webpack.mix.js", + "**/*.php", + "**/*.svg", + "**/vendor/**", + "node_modules/**", + "public/**", + ] + }, + // Vue (strongly-recommended) + ...pluginVue.configs[ + "flat/strongly-recommended" + ], + // TypeScript via @vue/eslint-config-typescript + ...vueTsEslintConfig(), + // Import plugin + pluginImportX.flatConfigs.recommended, + pluginImportX.flatConfigs.typescript, + // Global settings + { + languageOptions: { + ecmaVersion: "latest", + sourceType: "module", + }, + settings: {"import-x/resolver": {typescript: { project: "./tsconfig.json",},},}, + rules: { + // Base formatting + "indent": [ + "error", + 2, + {"SwitchCase": 1} + ], + "linebreak-style": [ + "error", + "unix" + ], + "quotes": [ + "error", + "double" + ], + "semi": [ + "error", + "always" + ], + // Vue & TypeScript + "vue/one-component-per-file": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + { + argsIgnorePattern: "^_", + varsIgnorePattern: "^_", + caughtErrorsIgnorePattern: "^_", + }, + ], + "max-len": [ + "error", + { comments: 160, code: 160, ignoreUrls: true, ignoreStrings: true, ignoreTemplateLiterals: true}, + ], + "object-curly-newline": [ + "error", + { + ObjectExpression: { multiline: true, minProperties: 6}, + ObjectPattern: { multiline: true, minProperties: 6}, + ImportDeclaration: { multiline: true, minProperties: 6}, + ExportDeclaration: { multiline: true, minProperties: 6}, + }, + ], + // Import ordering + "import-x/order": [ + "error", + { + groups: [ + "builtin", + "external", + "internal", + "parent", + "sibling", + "index", + ], + "newlines-between": "always", + alphabetize: { order: "asc", caseInsensitive: true}, + pathGroups: [ + { + pattern: "@angular/**", + group: "external", + position: "before", + }, + { + pattern: "primeng?(/**)", + group: "external", + position: "before", + }, + { + pattern: "@quezap/**", + group: "internal", + position: "after", + }, + ], + pathGroupsExcludedImportTypes: [ + "builtin" + ], + }, + ], + // Disable replaced rules + "import/order": "off", + }, + }, +]; diff --git a/infra/Adapters/Directories/EloquentCodeDirectory.php b/infra/Adapters/Directories/EloquentCodeDirectory.php new file mode 100644 index 00000000..b9cfda5b --- /dev/null +++ b/infra/Adapters/Directories/EloquentCodeDirectory.php @@ -0,0 +1,28 @@ +where('code', $code->value) + ->exists(); + } + + #[\Override] + public function find(Code $id): ?string + { + $exists = $this->exists($id); + + return $exists ? $id->value : null; + } +} diff --git a/infra/Adapters/Directories/EloquentShopDirectory.php b/infra/Adapters/Directories/EloquentShopDirectory.php new file mode 100644 index 00000000..26a758bb --- /dev/null +++ b/infra/Adapters/Directories/EloquentShopDirectory.php @@ -0,0 +1,51 @@ +where('id', $id->value) + ->first(); + + if (! $shop) { + return null; + } + + return $this->toEntity($shop); + } + + #[\Override] + public function getAll(): array + { + return Shop::query() + ->get() + ->map(fn (Shop $shop) => $this->toEntity($shop)) + ->all(); + } + + private function toEntity(Shop $model): DomainShop + { + return new DomainShop( + id: $model->getId(), + name: $model->name, + address: $model->address, + postcode: $model->postcode, + city: $model->city, + phone: $model->phone, + latitude: $model->latitude, + longitude: $model->longitude, + isDefault: (bool) $model->default + ); + } +} diff --git a/infra/Adapters/Events/LaravelDomainEventDispatcher.php b/infra/Adapters/Events/LaravelDomainEventDispatcher.php new file mode 100644 index 00000000..dbc03a42 --- /dev/null +++ b/infra/Adapters/Events/LaravelDomainEventDispatcher.php @@ -0,0 +1,17 @@ +with('lines') + ->where('id', $id->value) + ->first(); + + if (! $eloquentOrder) { + return null; + } + + return $this->toEntity($eloquentOrder); + } + + #[\Override] + public function persist(DomainOrder $order): void + { + $eloquentOrder = Order::query() + ->where('id', $order->id->value->toString()) + ->firstOrNew(); + + $eloquentOrder->id = $order->id->value->toString(); + $eloquentOrder->shop_id = $order->shopId->value->toString(); + $eloquentOrder->reference = $order->reference; + $eloquentOrder->employee = clone $order->employee; + $eloquentOrder->delivery_address = clone $order->deliveryAddress; + $eloquentOrder->pickup_day = Carbon::instance($order->pickupTimeSlot->getAt()); + $eloquentOrder->status = $order->status; + $eloquentOrder->total = clone $order->getTotal(); + + $eloquentOrder->save(); + + OrderLine::query() + ->where('order_id', $order->id->value->toString()) + ->delete(); + + $linesToInsert = []; + $now = now(); + + foreach ($order->getLines() as $line) { + $eloquentOrderLine = new OrderLine(); + $eloquentOrderLine->order_id = $order->id->value->toString(); + $eloquentOrderLine->product = clone $line->product; + $eloquentOrderLine->quantity = $line->quantity; + $eloquentOrderLine->total_ttc = clone $line->totalTtc; + + // Use values directly from the domain OrderLine + $eloquentOrderLine->tax_rate = $line->product->taxRate; + $eloquentOrderLine->unit_price = clone $line->unitPriceHt; + $eloquentOrderLine->unit_tax = clone $line->unitTax; + $eloquentOrderLine->unit_discount = clone $line->unitDiscount; + $eloquentOrderLine->total_discount = clone $line->totalDiscount; + $eloquentOrderLine->total_ht = clone $line->totalHt; + $eloquentOrderLine->total_tax = clone $line->totalTax; + + $attributes = $eloquentOrderLine->getAttributes(); + $attributes['created_at'] = $now; + $attributes['updated_at'] = $now; + + $linesToInsert[] = $attributes; + } + + if (! empty($linesToInsert)) { + OrderLine::query()->insert($linesToInsert); + } + } + + #[\Override] + public function delete(DomainOrder $order): void + { + Order::query() + ->where('id', $order->id->value) + ->delete(); + } + + /** @return array */ + public function getAll(): array + { + return Order::query() + ->with('lines') + ->get() + ->map(fn (Order $eloquentOrder) => $this->toEntity($eloquentOrder)) + ->all(); + } + + private function toEntity(Order $model): DomainOrder + { + $lines = $model->lines->map(function (OrderLine $line) { + return new DomainOrderLine( + product: $line->product, + quantity: $line->quantity, + unitPriceHt: $line->unit_price, + unitDiscount: $line->unit_discount, + unitTax: $line->unit_tax, + totalHt: $line->total_ht, + totalDiscount: $line->total_discount, + totalTax: $line->total_tax, + totalTtc: $line->total_ttc + ); + })->all(); + + if ($model->shop === null) { + throw new \UnexpectedValueException('Order missing shop'); + } + + if ($model->employee === null) { + throw new \UnexpectedValueException('Order missing employee'); + } + + return new DomainOrder( + id: $model->getId(), + shopId: new ShopId(Uuid::fromString((string) $model->shop_id)), + reference: $model->reference, + employee: clone $model->employee, + deliveryAddress: clone $model->delivery_address, + pickupTimeSlot: new PickupTimeSlot( + $model->pickup_day ? CarbonImmutable::instance($model->pickup_day) : CarbonImmutable::now(), + CarbonInterval::minutes(PickupTimeSlot::LENGTH) + ), + status: $model->status, + total: clone $model->total, + lines: $lines + ); + } +} diff --git a/infra/Adapters/Repositories/EloquentPickupExceptionRepository.php b/infra/Adapters/Repositories/EloquentPickupExceptionRepository.php new file mode 100644 index 00000000..ae9d8cfb --- /dev/null +++ b/infra/Adapters/Repositories/EloquentPickupExceptionRepository.php @@ -0,0 +1,109 @@ +where('id', $id->value) + ->first(); + + return $ex ? $this->toDomain($ex) : null; + } + + #[\Override] + public function persist(PickupExceptionOnDate $entity): void + { + $model = PickupException::query() + ->where('id', $entity->id->value) + ->firstOrNew(); + + $model->id = $entity->id->value->toString(); + $model->date = Carbon::instance($entity->date); + $model->label = $entity->label; + $model->repeatable = $entity->repeatable; + $model->repeat_frequency = $entity->repeatFrequency; + $model->auto_updated = $entity->autoUpdated; + + $model->save(); + } + + #[\Override] + public function delete(PickupExceptionOnDate $entity): void + { + PickupException::query() + ->where('id', $entity->id->value) + ->delete(); + } + + public function getExceptionsForShop(ShopId $shopId, CarbonPeriod $period): array + { + $shop = Shop::query() + ->where('id', $shopId->value) + ->firstOrFail(); + + return $shop->pickupExceptions() + ->where('date', '>', $period->getStartDate()->toImmutable()) + ->where('date', '<=', $period->getEndDate()?->toImmutable()) + ->get() + ->map(fn (PickupException $ex) => $this->toShopDomain($ex, $ex->pivot)) + ->all(); + } + + public function getAllExceptions(): array + { + return PickupException::query() + ->get() + ->map(fn (PickupException $ex) => $this->toDomain($ex)) + ->all(); + } + + public function getExceptionsAssociatedWithShop(ShopId $shopId): array + { + $shop = Shop::query() + ->where('id', $shopId->value) + ->firstOrFail(); + $shop->relationLoaded('pickupExceptions') ?: $shop->load('pickupExceptions'); + + return $shop->pickupExceptions + ->map(fn (PickupException $ex) => $this->toShopDomain($ex, $ex->pivot)) + ->all(); + } + + private function toDomain(PickupException $model): PickupExceptionOnDate + { + return new PickupExceptionOnDate( + id: $model->getId(), + date: $model->date->toImmutable(), + label: $model->label, + repeatable: (bool) $model->repeatable, + repeatFrequency: $model->repeat_frequency, + autoUpdated: (bool) $model->auto_updated + ); + } + + private function toShopDomain(PickupException $model, ?ShopPickupExceptionPivot $pivot = null): ShopPickupOverride + { + return new ShopPickupOverride( + exception: $this->toDomain($model), + replacementDate: $pivot?->replacement_date?->toImmutable(), + orderDeadlineAt: $pivot?->order_deadline_at?->toImmutable() + ); + } +} diff --git a/infra/Adapters/Repositories/EloquentProductRepository.php b/infra/Adapters/Repositories/EloquentProductRepository.php new file mode 100644 index 00000000..10e3884b --- /dev/null +++ b/infra/Adapters/Repositories/EloquentProductRepository.php @@ -0,0 +1,113 @@ +with(['inco', 'validDiscount']) + ->where('id', $id->value) + ->first(); + + return $product ? $this->toEntity($product) : null; + } + + #[\Override] + public function persist(DomainProduct $entity): void + { + $model = Product::query() + ->where('id', $entity->id()->value->toString()) + ->firstOrNew(); + + $model->id = $entity->id()->value->toString(); + $model->price = $entity->price; + $model->tax_rate = $entity->tax_rate; + $model->product_weight = $entity->product_weight; + $model->invoicing_unit = $entity->invoicing_unit; + $model->sell_unit = $entity->sell_unit; + $model->status = $entity->status; + $model->orderable_start = optional( + $entity->orderable_start, + fn (?CarbonImmutable $date) => $date ? + Carbon::instance($date) : null + ); + $model->orderable_end = optional( + $entity->orderable_end, + fn (?CarbonImmutable $date) => $date ? + Carbon::instance($date) : null + ); + + $model->save(); + } + + #[\Override] + public function delete(DomainProduct $product): void + { + Product::query() + ->where('id', $product->id()->value->toString()) + ->delete(); + } + + public function getBasketProduct(ProductId $id, int $qty): BasketProduct + { + $product = Product::query() + ->with(['inco', 'validDiscount']) + ->where('id', $id->value) + ->firstOrFail(); + + $domainProduct = $this->toEntity($product); + $pricing = $domainProduct->pricing(); + + return new BasketProduct( + id: $id, + name: $product->name, + qty: $qty, + unitPriceHt: $pricing->basePriceHt(), + unitDiscount: $pricing->discountAmountHt(), + taxRate: $product->tax_rate, + weightGrams: (int) $product->weight, + brand: $product->brand, + incoId: $product->inco ? $product->inco->getId() : null, + orderUnit: $product->order_unit ?? OrderUnit::PCE, + slug: $product->slug, + picture: $product->picture, + description: $product->description, + weightVariable: $product->weight_variable, + discountRate: $pricing->discountRate, + priceKgTtc: $pricing->priceKgTtc(), + options: [] + ); + } + + public function toEntity(Product $model): DomainProduct + { + return new DomainProduct( + id: new ProductId(Uuid::fromString($model->id)), + price: $model->price, + tax_rate: $model->tax_rate, + product_weight: $model->product_weight ? clone $model->product_weight : null, + invoicing_unit: $model->invoicing_unit, + sell_unit: $model->sell_unit, + validDiscount: $model->validDiscount ? clone $model->validDiscount->value : null, + status: (bool) $model->status, + orderable_start: $model->orderable_start ? CarbonImmutable::instance($model->orderable_start) : null, + orderable_end: $model->orderable_end ? CarbonImmutable::instance($model->orderable_end) : null, + hasInco: $model->inco !== null + ); + } +} diff --git a/infra/Adapters/Repositories/EloquentShopRepository.php b/infra/Adapters/Repositories/EloquentShopRepository.php new file mode 100644 index 00000000..bf6dad0a --- /dev/null +++ b/infra/Adapters/Repositories/EloquentShopRepository.php @@ -0,0 +1,120 @@ +where('matricule', $matricule->value) + ->value('shop_id'); + + if ($shopId !== null) { + $model = ModelsShop::query() + ->where('id', $shopId) + ->first(); + + return $model ? $this->toDomain($model) : null; + } + + return null; + } + + public function findShopForSiteAndService(ShopperSiteCode $siteCode, ?ShopperServiceCode $serviceCode): ?Shop + { + $query = DB::table('shop_employees') + ->where('site_code', $siteCode->value); + + if ($serviceCode !== null) { + $query->where('service_code', $serviceCode->value); + } else { + $query->whereNull('service_code'); + } + + $shopId = $query->value('shop_id'); + + if ($shopId !== null) { + $model = ModelsShop::query() + ->where('id', $shopId) + ->first(); + + return $model ? $this->toDomain($model) : null; + } + + return null; + } + + #[\Override] + public function find(ShopId $id): ?Shop + { + $model = ModelsShop::query() + ->where('id', $id->value) + ->first(); + + return $model ? $this->toDomain($model) : null; + } + + #[\Override] + public function persist(Shop $entity): void + { + $model = ModelsShop::query() + ->where('id', $entity->id()->value->toString()) + ->firstOrNew(); + + $model->id = $entity->id()->value->toString(); + $model->name = $entity->name; + $model->address = $entity->address; + $model->postcode = $entity->postcode; + $model->city = $entity->city; + $model->phone = $entity->phone; + $model->latitude = $entity->latitude; + $model->longitude = $entity->longitude; + $model->default = $entity->isDefault; + + $model->save(); + } + + #[\Override] + public function delete(Shop $entity): void + { + ModelsShop::query() + ->where('id', $entity->id()->value) + ->delete(); + } + + public function getDefaultShop(): Shop + { + $model = ModelsShop::query() + ->where('default', true) + ->firstOrFail(); + + return $this->toDomain($model); + } + + private function toDomain(ModelsShop $model): Shop + { + return new Shop( + id: $model->getId(), + name: $model->name, + address: $model->address, + postcode: $model->postcode, + city: $model->city, + phone: $model->phone, + latitude: $model->latitude, + longitude: $model->longitude, + isDefault: (bool) $model->default + ); + } +} diff --git a/infra/Adapters/Repositories/EloquentShopperRepository.php b/infra/Adapters/Repositories/EloquentShopperRepository.php new file mode 100644 index 00000000..671de995 --- /dev/null +++ b/infra/Adapters/Repositories/EloquentShopperRepository.php @@ -0,0 +1,105 @@ +with('employee') + ->where('id', $id->value) + ->first(); + + if ($customer === null || $customer->employee === null) { + return null; + } + + return $this->mapToShopper($customer); + } + + #[\Override] + public function persist(Shopper $entity): void + { + $customer = Customer::query() + ->where('id', $entity->id()->value) + ->firstOrNew(); + + $customer->id = $entity->id()->value->toString(); + $customer->email = $entity->email; + + if ($customer->employee === null) { + throw new \DomainException( + 'Customer must have an associated employee to persist a Shopper.' + ); + } + + $customer->employee->matricule = $entity->matricule; + $customer->employee->nom = $entity->nom; + $customer->employee->prenom = $entity->prenom; + $customer->employee->start_date = Carbon::instance($entity->startDate); + $customer->employee->end_date = optional( + $entity->endDate, + fn (?CarbonInterface $date) => $date ? Carbon::instance($date) : null + ); + $customer->employee->etablissement = $entity->etablissement; + $customer->employee->site = $entity->site; + $customer->employee->service = $entity->service; + + $customer->save(); + } + + #[\Override] + public function delete(Shopper $entity): void + { + Customer::query() + ->where('id', $entity->id()->value) + ->delete(); + } + + public function getByIdOrFail(ShopperId $id): Shopper + { + $shopper = $this->find($id); + + if ($shopper === null) { + throw new \DomainException("Shopper with id '{$id->value}' not found or is not linked to any employee."); + } + + return $shopper; + } + + private function mapToShopper(Customer $customer): Shopper + { + if (! $customer->employee) { + throw new \DomainException( + 'Customer must have an associated employee to be mapped to a Shopper.' + ); + } + + return new Shopper( + id: $customer->getId(), + email: $customer->email, + matricule: clone $customer->employee->matricule, + nom: $customer->employee->nom, + prenom: $customer->employee->prenom, + startDate: $customer->employee->start_date ? + CarbonImmutable::instance($customer->employee->start_date) : CarbonImmutable::now(), + endDate: $customer->employee->end_date ? + CarbonImmutable::instance($customer->employee->end_date) : null, + etablissement: $customer->employee->etablissement, + site: $customer->employee->site, + service: $customer->employee->service + ); + } +} diff --git a/infra/Adapters/Repositories/SessionBasketRepository.php b/infra/Adapters/Repositories/SessionBasketRepository.php new file mode 100644 index 00000000..4754abec --- /dev/null +++ b/infra/Adapters/Repositories/SessionBasketRepository.php @@ -0,0 +1,71 @@ +sessionKeyPrefix . $id->value; + } + + #[\Override] + public function find(BasketId $id): ?Basket + { + $sessionKey = $this->getSessionKey($id); + + if ($this->session->has($sessionKey)) { + $sessionData = $this->session->get($sessionKey); + + if (is_string($sessionData)) { + try { + /** @var array $decoded */ + $decoded = json_decode( + $sessionData, + true, + 512, + JSON_THROW_ON_ERROR + ); + + if (is_array($decoded)) { + return $this->serializer->fromArray($decoded); + } + } catch (\Throwable $e) { + // Ignore and fall back to null + } + } + } + + return null; + } + + #[\Override] + public function persist(Basket $basket): void + { + $this->session->put( + $this->getSessionKey($basket->id), + json_encode($this->serializer->toArray($basket), JSON_THROW_ON_ERROR) + ); + } + + #[\Override] + public function delete(Basket $basket): void + { + $this->session->forget($this->getSessionKey($basket->id)); + } +} diff --git a/infra/Adapters/Serializers/BasketSerializer.php b/infra/Adapters/Serializers/BasketSerializer.php new file mode 100644 index 00000000..5d8f3fa4 --- /dev/null +++ b/infra/Adapters/Serializers/BasketSerializer.php @@ -0,0 +1,149 @@ + */ + public function toArray(Basket $basket): array + { + return [ + 'id' => (string) $basket->id->value, + 'items' => array_map( + fn (BasketProduct $item) => [ + 'id' => (string) $item->id->value, + 'name' => $item->name, + 'qty' => $item->qty, + 'unitPriceHt' => $item->unitPriceHt, + 'unitDiscount' => $item->unitDiscount, + 'taxRate' => $item->taxRate->value, + 'weightGrams' => $item->weightGrams, + 'brand' => $item->brand?->value, + 'incoId' => $item->incoId?->value, + 'orderUnit' => $item->orderUnit->value, + 'slug' => $item->slug, + 'picture' => $item->picture, + 'description' => $item->description, + 'weightVariable' => $item->weightVariable, + 'discountRateBp' => $item->discountRate->basisPoints(), + 'priceKgTtc' => $item->priceKgTtc, + 'options' => $item->options, + ], + array_values($basket->items()) + ), + ]; + } + + /** @param array $data */ + public function fromArray(array $data): Basket + { + $basketId = Arr::string($data, 'id'); + $rawItems = Arr::array($data, 'items', []); + + $hydratedItems = []; + + foreach ($rawItems as $itemData) { + $itemData = Arr::wrap($itemData); + $id = Arr::string($itemData, 'id'); + $name = Arr::string($itemData, 'name'); + $qty = Arr::integer($itemData, 'qty'); + $unitPriceHt = Arr::array($itemData, 'unitPriceHt'); + $unitPriceHtCurrency = Arr::string($unitPriceHt, 'currency'); + $unitDiscount = Arr::array($itemData, 'unitDiscount'); + $unitDiscountCurrency = Arr::string($unitDiscount, 'currency'); + $taxRate = Arr::integer($itemData, 'taxRate'); + $weightGrams = Arr::integer($itemData, 'weightGrams'); + $brand = Arr::get($itemData, 'brand'); // using get because it can be null + $incoId = Arr::get($itemData, 'incoId'); + $orderUnit = Arr::string($itemData, 'orderUnit'); + $slug = Arr::string($itemData, 'slug'); + $picture = Arr::get($itemData, 'picture'); + $description = Arr::get($itemData, 'description'); + $weightVariable = Arr::boolean($itemData, 'weightVariable'); + $discountRate = $this->hydrateDiscountRate($itemData); + $priceKgTtc = Arr::array($itemData, 'priceKgTtc'); + $priceKgTtcCurrency = Arr::string($priceKgTtc, 'currency'); + $options = Arr::array($itemData, 'options', []); + + if (empty($unitPriceHtCurrency)) { + throw new \DomainException("Currency is required for unitPriceHt of item with id $id"); + } + if (empty($unitDiscountCurrency)) { + throw new \DomainException("Currency is required for unitDiscount of item with id $id"); + } + if (empty($priceKgTtcCurrency)) { + throw new \DomainException("Currency is required for priceKgTtc of item with id $id"); + } + + $hydratedItems[$id] = new BasketProduct( + id: new ProductId(Uuid::fromString($id)), + name: $name, + qty: $qty, + unitPriceHt: new Money( + is_scalar($a = Arr::get($unitPriceHt, 'amount', 0)) ? (int) $a : 0, + new Currency($unitPriceHtCurrency) + ), + unitDiscount: new Money( + is_scalar($a = Arr::get($unitDiscount, 'amount', 0)) ? (int) $a : 0, + new Currency($unitDiscountCurrency) + ), + taxRate: TaxRate::from($taxRate), + weightGrams: $weightGrams, + brand: is_string($brand) && $brand !== '' ? ProductBrand::from($brand) : null, + incoId: is_scalar($incoId) && $incoId !== 0 ? new IncoId((int) $incoId) : null, + orderUnit: OrderUnit::from($orderUnit), + slug: $slug, + picture: is_string($picture) && $picture !== '' ? $picture : null, + description: is_string($description) && $description !== '' ? $description : null, + weightVariable: $weightVariable, + discountRate: $discountRate, + priceKgTtc: new Money( + is_scalar($a = Arr::get($priceKgTtc, 'amount', 0)) ? (int) $a : 0, + new Currency($priceKgTtcCurrency) + ), + options: $options + ); + } + + return new Basket( + id: new BasketId(Uuid::fromString($basketId)), + items: $hydratedItems + ); + } + + /** + * Reads the discount rate in basis points; falls back to the legacy float ratio + * (key "discountRate") stored in sessions created before the DiscountRate value object. + * + * @param array $itemData + */ + private function hydrateDiscountRate(array $itemData): DiscountRate + { + $basisPoints = Arr::get($itemData, 'discountRateBp'); + if (is_int($basisPoints)) { + return DiscountRate::fromBasisPoints($basisPoints); + } + + $legacyRatio = Arr::get($itemData, 'discountRate', 0.0); + + return is_numeric($legacyRatio) + ? DiscountRate::fromRatio(min(max((float) $legacyRatio, 0.0), 1.0)) + : DiscountRate::zero(); + } +} diff --git a/infra/Adapters/Services/AppAdminAuthService.php b/infra/Adapters/Services/AppAdminAuthService.php new file mode 100644 index 00000000..e19ed67a --- /dev/null +++ b/infra/Adapters/Services/AppAdminAuthService.php @@ -0,0 +1,62 @@ + */ +class AppAdminAuthService implements AdminAuthenticationService +{ + public function __construct( + private readonly StatefulGuard $guard + ) { + } + + public function canWithUser(\UnitEnum | string $abilities, mixed $arguments = []): bool + { + return $this->getUser()?->can($abilities, $arguments) ?? false; + } + + public function check(): bool + { + return $this->guard->check(); + } + + public function guest(): bool + { + return ! $this->check(); + } + + public function getUser(): ?AdminDetails + { + $user = $this->guard->user(); + + if ($user && ! ($user instanceof User)) { + throw new \InvalidArgumentException('Auth service needs a backend guard'); + } + + return $user ? clone $user : null; + } + + public function getUserAsMandatory(): AdminDetails + { + $user = $this->getUser(); + + if ($user === null) { + throw new AuthServiceException('Authenticated user is required from here'); + } + + return clone $user; + } + + public function getMandatoryUserId(): string + { + return (string) $this->getUserAsMandatory()->id; + } +} diff --git a/infra/Adapters/Services/AppCustomerAuthService.php b/infra/Adapters/Services/AppCustomerAuthService.php new file mode 100644 index 00000000..4e4ad4fe --- /dev/null +++ b/infra/Adapters/Services/AppCustomerAuthService.php @@ -0,0 +1,119 @@ + */ +class AppCustomerAuthService implements CustomerAuthenticationService +{ + public function __construct( + private readonly StatefulGuard $guard, + private readonly CrmService $crmService + ) { + } + + public function canWithCustomer(\UnitEnum | string $abilities, mixed $arguments = []): bool + { + return $this->getCustomer()?->can($abilities, $arguments) ?? false; + } + + public function logIn(CustomerDetails $customer): void + { + if (! $customer instanceof Authenticatable || ! $customer instanceof Customer) { + throw new \InvalidArgumentException( + 'Expected an instance of Authenticatable and Customer for logging in' + ); + } + $this->guard->login($customer); + } + + public function logout(): void + { + $this->guard->logout(); + } + + public function check(): bool + { + return $this->guard->check(); + } + + public function guest(): bool + { + return ! $this->check(); + } + + public function getCustomer(): ?CustomerDetails + { + $customer = $this->guard->user(); + + if ($customer && ! ($customer instanceof Customer)) { + throw new \InvalidArgumentException('Auth service needs a frontend guard'); + } + + return $customer ? clone $customer : null; + } + + public function getCustomerAsMandatory(): CustomerDetails + { + $customer = $this->getCustomer(); + + if ($customer === null) { + throw new AuthServiceException('Authenticated user is required from here'); + } + + return clone $customer; + } + + public function resetPasswordFor(CustomerDetails $customer, string $password): bool | \Exception + { + return $this->crmService->resetPasswordFor($customer->email, $password); + } + + public function hasVerifiedEmail(CustomerDetails $customer): bool + { + $crmCustomer = $this->getCrmCustomerFrom($customer); + + if ($crmCustomer === null) { + return false; + } + + return $crmCustomer->status; + } + + public function verifyEmail(CustomerDetails $customer): bool + { + $crmCustomer = $this->getCrmCustomerFrom($customer); + + if ($crmCustomer === null) { + return false; + } + + $activation = $this->crmService->activate($crmCustomer); + + return $activation->result; + } + + private function getCrmCustomerFrom(Customer $customer): ?CrmCustomer + { + $crmCustomer = $this->crmService->getCustomerFromHashCode($customer->hashcode); + + if ($crmCustomer instanceof CrmServiceException) { + report($crmCustomer); + + throw $crmCustomer; + } + + return $crmCustomer; + } +} diff --git a/infra/Adapters/Services/AppSessionService.php b/infra/Adapters/Services/AppSessionService.php new file mode 100644 index 00000000..1d7cac70 --- /dev/null +++ b/infra/Adapters/Services/AppSessionService.php @@ -0,0 +1,30 @@ +sessionKey)) { + Session::put($this->sessionKey, Uuid::uuid7()->toString()); + } + + /** @var string $uuidString */ + $uuidString = Session::get($this->sessionKey); + + return new SessionId(Uuid::fromString($uuidString)); + } +} diff --git a/infra/Adapters/Services/CsvGeneratorImpl.php b/infra/Adapters/Services/CsvGeneratorImpl.php new file mode 100644 index 00000000..aabefc38 --- /dev/null +++ b/infra/Adapters/Services/CsvGeneratorImpl.php @@ -0,0 +1,42 @@ + $rows + */ + public function generate(array $header, array $rows): string + { + $file = new SplTempFileObject(); + + $file->fputcsv( + $header, + ';', + '"', + '\\' + ); + + foreach ($rows as $item) { + $file->fputcsv($item, ';', '"', '\\'); + } + + $file->rewind(); + + $content = ''; + + while (! $file->eof()) { + $content .= $file->getCurrentLine(); + $file->next(); + } + + return $content; + } +} diff --git a/infra/Adapters/Services/EloquentEmployeeImportStorageService.php b/infra/Adapters/Services/EloquentEmployeeImportStorageService.php new file mode 100644 index 00000000..7e00ff99 --- /dev/null +++ b/infra/Adapters/Services/EloquentEmployeeImportStorageService.php @@ -0,0 +1,78 @@ + $upsertData + */ + public function upsertEmployees(array $upsertData): void + { + $now = CarbonImmutable::now()->format('Y-m-d H:i:s'); + $mappedData = array_map(static function (EmployeeUpsertData $data) use ($now): array { + return [ + 'matricule' => $data->matricule->value, + 'nom' => $data->lastname, + 'prenom' => $data->firstname, + 'etablissement' => $data->etablissement->value, + 'service' => $data->service->value, + 'site' => $data->site->value, + 'start_date' => $data->startDate->format('Y-m-d H:i:s'), + 'end_date' => $data->endDate?->format('Y-m-d H:i:s'), + 'code' => $data->code->value, + 'last_sync' => $now, + ]; + }, $upsertData); + + // NOTE: chunking is essential here because the query builder has a binding limit of 65535 + // each row has 10 bindings, so we can insert at most 65535 / 10 = 6553 rows at once + // we use 1000 to be safe + foreach (array_chunk($mappedData, 1000) as $chunk) { + Employee::query()->upsert( + values: $chunk, + uniqueBy: ['matricule'], + update: ['nom', 'prenom', 'etablissement', 'service', 'site', 'start_date', 'end_date', 'last_sync'] + ); + } + } + + /** + * @param \Domain\Models\ValueObjects\Matricule[] $matriculesToInsert + * @return object{insertedCount: int, updatedCount: int, matriculesInserted: \Domain\Models\ValueObjects\Matricule[]} + */ + public function getImportedAfter(array $matriculesToInsert, CarbonImmutable $importStartTime): object + { + $employees = Employee::query() + ->whereIn('matricule', $matriculesToInsert) + ->get(['matricule', 'created_at', 'updated_at']); + + /** @var list<\Domain\Models\ValueObjects\Matricule> $matriculesInserted */ + $matriculesInserted = $employees + ->pluck('matricule') + ->values() + ->toArray(); + + $insertedCount = $employees + ->where('created_at', '>=', $importStartTime) + ->count(); + + $updatedCount = $employees + ->where('created_at', '<', $importStartTime) + ->where('updated_at', '>=', $importStartTime) + ->count(); + + return (object) [ + 'insertedCount' => $insertedCount, + 'updatedCount' => $updatedCount, + 'matriculesInserted' => $matriculesInserted, + ]; + } +} diff --git a/infra/Adapters/Services/EloquentEmployeeStatisticsService.php b/infra/Adapters/Services/EloquentEmployeeStatisticsService.php new file mode 100644 index 00000000..f0b28152 --- /dev/null +++ b/infra/Adapters/Services/EloquentEmployeeStatisticsService.php @@ -0,0 +1,39 @@ +string('app.currency'); + if ($currencyCode === '') { + $currencyCode = 'EUR'; + } + /** @var non-empty-string $currencyCode */ + $this->appDefaultCurrency = new Currency($currencyCode); + } + + public function getWeeklyTotalForEmployee(Matricule $matricule, CarbonInterface $start, CarbonInterface $end): Money + { + $weekTotal = Order::query() + ->where('employee_matricule', $matricule->value) + ->where('status', OrderStatus::VALIDATED) + ->whereBetween('pickup_day', [$start, $end]) + ->sum('total'); + + return new Money((int) $weekTotal, $this->appDefaultCurrency); + } +} diff --git a/infra/Adapters/Services/LaravelTransactionManager.php b/infra/Adapters/Services/LaravelTransactionManager.php new file mode 100644 index 00000000..0f41c47c --- /dev/null +++ b/infra/Adapters/Services/LaravelTransactionManager.php @@ -0,0 +1,23 @@ + $callback()); + } +} diff --git a/infra/Adapters/Services/SessionOrderBuilderManager.php b/infra/Adapters/Services/SessionOrderBuilderManager.php new file mode 100644 index 00000000..0639972f --- /dev/null +++ b/infra/Adapters/Services/SessionOrderBuilderManager.php @@ -0,0 +1,45 @@ +session->get($this->sessionKey); + + if ($orderBuilder !== null && ! ($orderBuilder instanceof OrderBuilder)) { + throw new \UnexpectedValueException('Invalid session data for order builder'); + } + + return $orderBuilder; + } + + public function save(OrderBuilder $builder): void + { + $this->session->put($this->sessionKey, $builder); + } + + public function clear(): void + { + $this->session->forget($this->sessionKey); + } +} diff --git a/lang/en.json b/lang/en.json new file mode 100644 index 00000000..32a019bd --- /dev/null +++ b/lang/en.json @@ -0,0 +1,881 @@ +{ + "(and :count more error)": "(and :count more error)", + "(and :count more errors)": "(and :count more error)|(and :count more errors)|(and :count more errors)", + "- at least one lowercase letter": "- at least one lowercase letter", + "- at least one number": "- at least one number", + "- at least one special character.": "- at least one special character.", + "- at least one uppercase letter": "- at least one uppercase letter", + "- minimum 8 characters": "- minimum 8 characters", + ":appname - An order was placed": ":appname - An order was placed", + ":field :inter:model": ":field :inter:model", + ":name logo": ":name logo", + ":name site logo": ":name site logo", + ":time before order taking closes - :appname": ":time before order taking closes - :appname", + ":title A wide selection :/title :desc Quality products, a variety of options, portion sizes to suit your needs... :/desc": ":title A wide selection :/title :desc Quality products, a variety of options, portion sizes to suit your needs... :/desc", + ":title Convenient and fast :/title :desc What could be better than ordering online to save time? :/desc": ":title Convenient and fast :/title :desc What could be better than ordering online to save time? :/desc", + ":title Freshness & Quality :/title :desc Your order is carefully prepared, with strict adherence to the cold chain :/desc": ":title Freshness & Quality :/title :desc Your order is carefully prepared, with strict adherence to the cold chain :/desc", + ":title Pick up your order :/title :desc :/desc": ":title Pick up your order :/title :desc :/desc", + ":title Save money :/title :desc Get even more out of our gourmet products by buying directly :/desc": ":title Save money :/title :desc Get even more out of our gourmet products by buying directly :/desc", + ":title Select :/title :desc your products online :/desc": ":title Select :/title :desc your products online :/desc", + ":title Select :/title :desc your time slot :/desc": ":title Select :/title :desc your time slot :/desc", + "A confirmation has just been sent to the email address": "A confirmation has just been sent to the email address", + "A confirmation has just been sent to your email address": "A confirmation has just been sent to your email address", + "A decryption key is required.": "A decryption key is required.", + "A fresh verification link has been sent to your email address.": "A fresh verification link has been sent to your email address.", + "A Timeout Occurred": "A Timeout Occurred", + "About": "About", + "Accept": "Accept", + "Accepted": "Accepted", + "Access the shop": "Access the shop", + "Account blocked. Please contact your HR department or the St Laurent switchboard at :phone": "Account blocked. Please contact your HR department or the St Laurent switchboard at :phone", + "Action": "Action", + "Action failed": "Action failed", + "Actions": "Actions", + "Activation": "Activation", + "Activation of your previously created account.": "Activation of your previously created account.", + "Add": "Add", + "Add :name": "Add :name", + "Add a reminder to my calendar to place my order on :reminderDay at :reminderTime (Attached ICS file)": "Add a reminder to my calendar to place my order on :reminderDay at :reminderTime (Attached ICS file)", + "Add a site": "Add a site", + "Add one": "Add one", + "Add to Basket": "Add to Basket", + "add_joinedfile": "add_joinedfile", + "Added :amount to basket": "Added :amount to basket", + "Address": "Address", + "Admin": "Admin", + "Agree": "Agree", + "Aisles": "Aisles", + "All aisles": "All aisles", + "All discounts": "All discounts", + "All products have been selected.": "All products have been selected.", + "All rights reserved.": "All rights reserved.", + "Allergens": "Allergens", + "Already registered?": "Already registered?", + "Already Reported": "Already Reported", + "An account is already associated with this email address": "An account is already associated with this email address", + "An employee sync is already in progress.": "An employee sync is already in progress.", + "An error has occurred.": "An error has occurred.", + "An error has occurred. Please try again later": "An error occurred, please try again later.", + "An error occurred while fetching the preview.": "An error occurred while fetching the preview.", + "An error occurred, please try again later.": "An error occurred, please try again later.", + "An error occurred, please try again with a new activation link.": "An error occurred, please try again with a new activation link.", + "An order was placed": "An order was placed", + "and the": "and the", + "Approximately": "Approximately", + "Arcadia API error: :error": "Arcadia API error: :error", + "Arcadia INCO Sheet": "Arcadia INCO Sheet", + "Arcadia INCO Sheet Preview": "Arcadia INCO Sheet Preview", + "Archive": "Archive", + "Are you sure you want to empty your basket?": "Are you sure you want to empty your basket?", + "Are you sure?": "Are you sure?", + "Artist cat": "Artist cat", + "Assign": "Assign", + "Associate": "Associate", + "Associate an INCO sheet from the Arcadia API by entering the article number.": "Associate an INCO sheet from the Arcadia API by entering the article number.", + "Associate INCO sheet": "Associate INCO sheet", + "Associated INCO Sheet": "Associated INCO Sheet", + "Associated products": "Associated products", + "Associating this INCO sheet will replace the currently linked INCO sheet for this product.": "Associating this INCO sheet will replace the currently linked INCO sheet for this product.", + "at the following address": "at the following address", + "Attach": "Attach", + "Attachement filename": "Attachement filename", + "Attachment": "Attachment", + "Automated message": "Automated message", + "Available days": "Available days", + "Available products": "Available products", + "Average nutritional values": "Average nutritional values", + "Average product weight": "Average product weight", + "Back": "Back", + "Back to :page": "Back to :page", + "Back to basket": "Back to basket", + "Back to shop": "Back to shop", + "Bad Gateway": "Bad Gateway", + "Bad Request": "Bad Request", + "Bandwidth Limit Exceeded": "Bandwidth Limit Exceeded", + "Base unit used to calculate the sales unit of this product.": "Base unit used to calculate the sales unit of this product.", + "Base unit used to determine the price": "Base unit used to determine the price", + "Basket has been cleared": "Basket has been cleared", + "Basket Summary": "Basket Summary", + "Before proceeding, please check your email for a verification link.": "Before proceeding, please check your email for a verification link.", + "Blocked week": "Blocked week", + "Booking": "Booking", + "Brand": "Brand", + "Breadcrumb": "Breadcrumb", + "Browse": "Browse", + "buy_place": "buy_place", + "Call the :phone": "Call the :phone", + "Cancel": "Cancel", + "Cancel the order": "Cancel the order", + "Carbohydrates": "Carbohydrates", + "Catalog": "Catalog", + "Change my password": "Change my password", + "Change your password.": "Change your password.", + "Changes saved!": "Changes saved!", + "Check all collection exceptions that concern this store. Use the options button to configure postponements if necessary.": "Check all collection exceptions that concern this store. Use the options button to configure postponements if necessary.", + "Check all your information before confirming.": "Check all your information before confirming.", + "Check and confirm the content of your order before continuing.": "Check and confirm the content of your order before continuing.", + "Check if this event repeats over time.": "Check if this event repeats over time.", + "Check to highlight the product": "Check to highlight the product", + "Check to publish the exception": "Check to publish the exception", + "Check to publish the product": "Check to publish the product", + "Check to publish the range": "Check to publish the range", + "Check to publish the tag": "Check to publish the tag", + "Check to restrict access": "Check to restrict access", + "Check to restrict display to logged-in members.": "Check to restrict display to logged-in members.", + "Choose": "Choose", + "Choose :name": "Choose :name", + "Choose File": "Choose File", + "Choose Image": "Choose Image", + "Choose slide": "Choose slide", + "Choose your new password.": "Choose your new password.", + "City": "City", + "civilty": "civilty", + "Clear": "Clear", + "Clear sorting": "Clear sorting", + "click here to request another": "click here to request another", + "Click on the map to place or move the pickup point.": "Click on the map to place or move the pickup point.", + "Click to copy": "Click to copy", + "Client Closed Request": "Client Closed Request", + "Close": "Close", + "Collapse": "Collapse", + "Collapse All": "Collapse All", + "Collection date": "Collection date", + "Collection date:": "Collection date:", + "Collection details": "Collection details", + "Collection information": "Collection information", + "Collection point": "Collection point", + "Coming soon": "Coming soon", + "Comment": "Comment", + "Company information": "Company information", + "complain": "complain", + "Complete content of the page.": "Complete content of the page.", + "Complete content of the range.": "Complete content of the range.", + "Complete list of shop products.": "Complete list of shop products.", + "Complete your order": "Complete your order", + "Completely empty the basket": "Completely empty the basket", + "Composition & Preparation": "Composition & Preparation", + "Confirm": "Confirm", + "Confirm association": "Confirm association", + "Confirm order": "Confirm order", + "Confirm Password": "Confirm Password", + "Confirm pickup": "Confirm pickup", + "Confirmation": "Confirmation", + "Conflict": "Conflict", + "Connect": "Connect", + "Connected": "Connected", + "Connected members only": "Connected members only", + "Connection Closed Without Response": "Connection Closed Without Response", + "Connection Timed Out": "Connection Timed Out", + "Consumer sales unit": "Consumer sales unit", + "consumption_date": "consumption_date", + "Contact": "Contact", + "Contact form": "Contact form", + "Contact Information": "Contact Information", + "Contact Message": "Contact Message", + "Contact us": "Contact us", + "contact us": "contact us", + "Content": "Content", + "Continue": "Continue", + "Cookie Management": "Cookie Management", + "coord_please_complete": "coord_please_complete", + "Create": "Create", + "Create :name": "Create :name", + "Created": "Created", + "creation": "creation", + "CRM data": "CRM data", + "Current period": "Current period", + "Current price": "Current price", + "Daily Intake (% RI)": "Daily Intake (% RI)", + "Dashboard": "Dashboard", + "data_size_mo": "data_size_mo", + "Date": "Date", + "Date of birth": "Date of birth", + "Day": "Day", + "days": "days", + "Default pickup point": "Default pickup point", + "Define one code per employee site (at least 2 uppercase letters, e.g. PA, NA, LY). These codes are used to query the Arcadia HR IS and synchronize employees in the employee store.": "Define one code per employee site (at least 2 uppercase letters, e.g. PA, NA, LY). These codes are used to query the Arcadia HR IS and synchronize employees in the employee store.", + "Delete": "Delete", + "Delete :name": "Delete :name", + "Delete :name from the basket": "Delete :name from the basket", + "Delete this site": "Delete this site", + "Deleting this item will also delete all associated items. You will not be able to undo this action. Do you really want to continue?": "Deleting this item will also delete all associated items. You will not be able to undo this action. Do you really want to continue?", + "Description (HTML)": "Description (HTML)", + "Designation": "Designation", + "Detach": "Detach", + "Details": "Details", + "Dietary fiber": "Dietary fiber", + "Difference": "Difference", + "Disable": "Disable", + "Discard": "Discard", + "Discounted unit price (excluding tax)": "Discounted unit price (excluding tax)", + "Discover our products": "Discover our products", + "Do you really want to cancel this item?": "Do you really want to cancel this item?", + "Do you really want to delete this item?": "Do you really want to delete this item?", + "Do you really want to mark this item as processed?": "Do you really want to mark this item as processed?", + "Do you want to save this item as is?": "Do you want to save this item as is?", + "Done": "Done", + "Down": "Down", + "Download example file": "Download example file", + "Drag and drop products to associate them.": "Drag and drop products to associate them.", + "Drag products here to select them.": "Drag products here to select them.", + "Duplicate": "Duplicate", + "Duplicate :name": "Duplicate :name", + "Edit": "Edit", + "Edit :name": "Edit :name", + "email": "email", + "Email Address": "Email Address", + "Email:": "Email:", + "Employee site codes (Arcadia)": "Employee site codes (Arcadia)", + "Employee sites": "Employee sites", + "Employees Sync": "Employees Sync", + "Empty Basket": "Empty Basket", + "Enable": "Enable", + "Encrypted environment file already exists.": "Encrypted environment file already exists.", + "Encrypted environment file not found.": "Encrypted environment file not found.", + "End date": "End date", + "End date of the previous period": "End date of the previous period", + "Energy": "Energy", + "Energy (kJ / kcal)": "Energy (kJ / kcal)", + "Enter the Arcadia INCO article number": "Enter the Arcadia INCO article number", + "Environment file already exists.": "Environment file already exists.", + "Environment file not found.": "Environment file not found.", + "Error confirmation": "Error confirmation", + "Error list": "Error list", + "errors": "errors", + "Estimated order total": "Estimated order total", + "Estimated total": "Estimated total", + "Estimated total incl. tax": "Estimated total incl. tax", + "Ex: 2 people": "Ex: 2 people", + "Ex: Holiday, Exceptional closure...": "Ex: Holiday, Exceptional closure...", + "Exception information": "Exception information", + "Expand": "Expand", + "Expand All": "Expand All", + "Expectation Failed": "Expectation Failed", + "Explanation": "Explanation", + "Export": "Export", + "Export :name": "Export :name", + "Facility": "Facility", + "Failed Dependency": "Failed Dependency", + "Failed to add item to basket": "Failed to add item to basket", + "Failed to clear the basket": "Failed to clear the basket", + "Failed to fetch products": "Failed to fetch products", + "Failed to fetch the basket": "Failed to fetch the basket", + "Failed to remove item from basket": "Failed to remove item from basket", + "FAQ": "FAQ", + "Fat": "Fat", + "Featured Products Slider": "Featured Products Slider", + "Fetching data from Arcadia API...": "Fetching data from Arcadia API...", + "File": "File", + "Files": "Files", + "Filter by :value": "Filter by :value", + "Filters": "Filters", + "Final order validation": "Final order validation", + "Final Validation": "Final Validation", + "First csv line shall be :importColumns": "First csv line shall be :importColumns", + "First name": "First name", + "firstname": "firstname", + "For any questions related to your order, please contact reception by phone or via our section": "For any questions related to your order, please contact reception by phone or via our section", + "For any questions,": "For any questions,", + "Forbidden": "Forbidden", + "Forgot password": "Forgot password", + "Forgot password procedure": "Forgot password procedure", + "Forgot Your Password?": "Forgot Your Password?", + "format_joinedfile": "format_joinedfile", + "Found": "Found", + "French public holidays are automatically provisioned and associated with stores": "French public holidays are automatically provisioned and associated with stores", + "Frequency": "Frequency", + "Frequently asked questions.": "Frequently asked questions.", + "from": "from", + "from :date": "from :date", + "From date": "From date", + "Gateway Timeout": "Gateway Timeout", + "general conditions": "general conditions", + "General Information": "General Information", + "General Information & Nutriscore": "General Information & Nutriscore", + "general terms": "general terms", + "General terms and conditions of sale": "General terms and conditions of sale", + "general terms and conditions of sale": "general terms and conditions of sale", + "General terms and conditions of sale of the shop.": "General terms and conditions of sale of the shop.", + "Give the product a short description": "Give the product a short description", + "Give this exception an explicit name.": "Give this exception an explicit name.", + "Give your faq a title.": "Give your faq a title.", + "Give your keyword a label.": "Give your keyword a label.", + "Give your product a name.": "Give your product a name.", + "Give your range a title.": "Give your range a title.", + "Give your slide a title.": "Give your slide a title.", + "Go Home": "Go Home", + "Go to page :page": "Go to page :page", + "Go to website": "Go to website", + "Gone": "Gone", + "GPS & Maps Coordinates": "GPS & Maps Coordinates", + "Hello": "Hello", + "Hello :fullname": "Hello :fullname", + "Hello!": "Hello!", + "Here is a message sent from :app_name.": "Here is a message sent from :app_name.", + "Here, the arrows are used to sort and not to filter": "Here, the arrows are used to sort and not to filter", + "Hide": "Hide", + "Hide :name": "Hide :name", + "Highlight": "Highlight", + "Home": "Home", + "HTTP Version Not Supported": "HTTP Version Not Supported", + "https://...": "https://...", + "I consent to receive news and deals from :name": "I consent to receive news and deals from :name", + "I have read and accept the": "I have read and accept the", + "I have read and accept the :terms": "I have read and accept the :terms", + "I have read and accept the :terms and the :privacy": "I have read and accept the :terms and the :privacy", + "I wish to subscribe to the newsletter": "I wish to subscribe to the newsletter", + "I'm a teapot": "I'm a teapot", + "If you did not create an account, no further action is required.": "If you did not create an account, no further action is required.", + "If you did not receive the email": "If you did not receive the email", + "If you did not request a password reset, no further action is required.": "If you did not request a password reset, no further action is required.", + "If you need to you can always contact us, otherwise we’ll be back online shortly!": "If you need to you can always contact us, otherwise we’ll be back online shortly!", + "If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:", + "IM Used": "IM Used", + "Image": "Image", + "Image of a cat playing a grand piano": "Image of a cat playing a grand piano", + "Impersonate": "Impersonate", + "Impersonation": "Impersonation", + "Import": "Import", + "Import :name": "Import :name", + "In order to give us time to prepare your products, order taking at the shop ends today at :closureTime for a delivery on :date at your usual collection point.": "In order to give us time to prepare your products, order taking at the shop ends today at :closureTime for a delivery on :date at your usual collection point.", + "INCO article number": "INCO article number", + "INCO sheet was not found on Arcadia API.": "INCO sheet was not found on Arcadia API.", + "Ingredients": "Ingredients", + "Insufficient Storage": "Insufficient Storage", + "Internal Server Error": "Internal Server Error", + "Introduction": "Introduction", + "Invalid filename.": "Invalid filename.", + "Invalid JSON was returned from the route.": "Invalid JSON was returned from the route.", + "Invalid or unavailable time slot": "Invalid or unavailable time slot", + "Invalid SSL Certificate": "Invalid SSL Certificate", + "is": "is", + "is confirmed and ready.": "is confirmed and ready.", + "is confirmed.": "is confirmed.", + "It seems you haven't added anything to your basket yet.": "It seems you haven't added anything to your basket yet.", + "Item": "Item", + "Item removed from basket": "Item removed from basket", + "jj": "jj", + "joinedfile": "joinedfile", + "JPEG/PNG, 2MB max.": "JPEG/PNG, 2MB max.", + "JPEG/PNG, 2MB max. Recommended dimensions: :width px by :height px": "JPEG/PNG, 2MB max. Recommended dimensions: :width px by :height px", + "JPEG/PNG, 2Mo max.": "JPEG/PNG, 2Mo max.", + "Kcal": "Kcal", + "Keyword information": "Keyword information", + "Keywords associated with the product": "Keywords associated with the product", + "Kj": "Kj", + "L'ancien mot de passe ne correspond pas.": "Your old password does not match.", + "Label": "Label", + "Last name": "Last name", + "Last sync: :date": "Last sync: :date", + "lastname": "lastname", + "Le lien de désinscription est invalide": "The unsubscription link is invalid.", + "Learn more...": "Learn more...", + "Leave empty for immediate display": "Leave empty for immediate display", + "Leave empty for permanent display": "Leave empty for permanent display", + "Legal Notice & TOU": "Legal Notice & TOU", + "Legal notice and terms of use of the shop.": "Legal notice and terms of use of the shop.", + "length": "length", + "Length Required": "Length Required", + "Like": "Like", + "limit_date": "limit_date", + "Link options": "Link options", + "List of products in your basket": "List of products in your basket", + "Load": "Load", + "Loading": "Loading", + "Loading more": "Loading more", + "Loading...": "Loading...", + "Localize": "Localize", + "Location": "Location", + "Location on the map": "Location on the map", + "Location:": "Location:", + "Locked": "Locked", + "Log In": "Log In", + "Log in": "Log in", + "Log Out": "Log Out", + "Login": "Login", + "Login to your personal account.": "Login to your personal account.", + "Logout": "Logout", + "Loop Detected": "Loop Detected", + "lot_number": "lot_number", + "lot_number_tip": "lot_number_tip", + "Main content (HTML)": "Main content (HTML)", + "Main Slider": "Main Slider", + "Maintenance Mode": "Maintenance Mode", + "Mandatory fields": "Mandatory fields", + "mandatory_fields": "mandatory_fields", + "max_joinedfile_size": "max_joinedfile_size", + "Maximum number of elements reached.": "Maximum number of elements reached.", + "Media (Images)": "Media (Images)", + "Membership rate": "Membership rate", + "Merchandising": "Merchandising", + "Message": "Message", + "Message subject": "Message subject", + "Message:": "Message:", + "message_contact_failed": "message_contact_failed", + "message_contact_send": "message_contact_send", + "Method Not Allowed": "Method Not Allowed", + "Minimum number of elements reached.": "Minimum number of elements reached.", + "Misdirected Request": "Misdirected Request", + "mm": "mm", + "Month": "Month", + "Moved Permanently": "Moved Permanently", + "Multi-Status": "Multi-Status", + "Multiple Choices": "Multiple Choices", + "Must accurately describe the page content ( description tag).": "Must accurately describe the page content ( description tag).", + "Must accurately describe the page, recommendation for optimal search engine positioning ( tag).": "Must accurately describe the page, recommendation for optimal search engine positioning (<title> tag).", + "Must accurately describe the page, recommended for optimal search engine positioning (<title> tag).": "Must accurately describe the page, recommended for optimal search engine positioning (<title> tag).", + "My Account": "My Account", + "My collection point": "My collection point", + "My details": "My details", + "My Orders": "My Orders", + "My pickup point :name, :address, :postcode :city": "My pickup point :name, :address, :postcode :city", + "my_coord": "my_coord", + "Name": "Name", + "NB": "NB", + "Network Authentication Required": "Network Authentication Required", + "Network Connect Timeout Error": "Network Connect Timeout Error", + "Network Read Timeout Error": "Network Read Timeout Error", + "Never": "Never", + "New": "New", + "New :name": "New :name", + "New order from :firstname :lastname - :appname": "New order from :firstname :lastname - :appname", + "New order registered!": "New order registered!", + "New password": "New password", + "Newsletter unsubscription": "Newsletter unsubscription", + "No": "No", + "No account was found for this email address": "No account was found for this email address", + "No account yet?": "No account yet?", + "No Content": "No Content", + "No INCO sheet currently associated with this product.": "No INCO sheet currently associated with this product.", + "No INCO sheet found on Arcadia for this article number.": "No INCO sheet found on Arcadia for this article number.", + "No INCO sheet is currently associated with this product.": "No INCO sheet is currently associated with this product.", + "No pickup days available at the moment": "No pickup days available at the moment", + "No pickup exception has been created for now.": "No pickup exception has been created for now.", + "No picture available": "No picture available", + "No product matches your search.": "No product matches your search.", + "No replacement date configured": "No replacement date configured", + "No results found.": "No results found.", + "No site configured. Click the button below to add a site.": "No site configured. Click the button below to add a site.", + "No substitute days have been set up. No time slots will be generated for this week.": "No substitute days have been set up. No time slots will be generated for this week.", + "Non-Authoritative Information": "Non-Authoritative Information", + "None": "None", + "Not Acceptable": "Not Acceptable", + "Not Extended": "Not Extended", + "Not Found": "Not Found", + "Not Implemented": "Not Implemented", + "Not Modified": "Not Modified", + "Not visible": "Not visible", + "Number of employees": "Number of employees", + "Number of registered employees": "Number of registered employees", + "Nutrient": "Nutrient", + "Nutriscore": "Nutriscore", + "Nutriscore arguments": "Nutriscore arguments", + "Nutritional Values": "Nutritional Values", + "Nutritional values": "Nutritional values", + "of": "of", + "of employees": "of employees", + "Of which saturated fatty acids": "Of which saturated fatty acids", + "of which saturated fatty acids": "of which saturated fatty acids", + "of which sugars": "of which sugars", + "Offers": "Offers", + "Offers Slider": "Offers Slider", + "Oh no": "Oh no", + "OK": "OK", + "Old password": "Old password", + "On": "On", + "Oops! An error occurred...": "Oops! An error occurred...", + "Open": "Open", + "Open in a current window": "Open in a current window", + "Open in a new window": "Open in a new window", + "Open in a parent frame": "Open in a parent frame", + "Open in the topmost frame": "Open in the topmost frame", + "Open on the website": "Open on the website", + "Order": "Order", + "Order cancelled": "Order cancelled", + "Order data": "Order data", + "Order detail of :date": "Order detail of :date", + "Order details": "Order details", + "Order details:": "Order details:", + "Order number": "Order number", + "Order period": "Order period", + "Order Reference": "Order Reference", + "Order Reference:": "Order Reference:", + "Order reservation": "Order reservation", + "Order status": "Order status", + "Order summary": "Order summary", + "Order validation": "Order validation", + "Origin Is Unreachable": "Origin Is Unreachable", + "Original price": "Original price", + "Our team will do their best to reply as soon as possible.": "Our team will do their best to reply as soon as possible.", + "Page Expired": "Page Expired", + "Page title (can be empty for some keys).": "Page title (can be empty for some keys).", + "Pagination Navigation": "Pagination Navigation", + "Partial Content": "Partial Content", + "Password": "Password", + "Password updated": "Password updated", + "Payload Too Large": "Payload Too Large", + "Payment Required": "Payment Required", + "Per": "Per", + "Per 100g / Ref": "Per 100g / Ref", + "Per Serving": "Per Serving", + "Permanent Redirect": "Permanent Redirect", + "Personal account": "Personal account", + "personal data management policy": "personal data management policy", + "personal data policy": "personal data policy", + "Phone": "Phone", + "Pickup day": "Pickup day", + "Pickup Locations": "Pickup Locations", + "Pickup on :day at :time, at the following address:": "Pickup on :day at :time, at the following address:", + "Pickup on :day, at the following address:": "Pickup on :day, at the following address:", + "Pickup point name": "Pickup point name", + "Place my order :appname": "Place my order :appname", + "Placeholder": "Placeholder", + "Please check your email, if we know you you should receive a reset link": "Please check your email, if we know you you should receive a reset link", + "Please click the button below to verify your email address.": "Please click the button below to verify your email address.", + "Please confirm your password before continuing.": "Please confirm your password before continuing.", + "Please contact your HR department for your access code": "Please contact your HR department for your access code", + "Please contact your HR department to get your single-use registration code.": "Please contact your HR department to get your single-use registration code.", + "Please enter a period to view statistics": "Please enter a period to view statistics", + "Please enter an article number.": "Please enter an article number.", + "Please enter your employee number (available on your payslip), 7 characters long (e.g. v00115590->0115590).": "Please enter your employee number (available on your payslip), 7 characters long (e.g. v00115590->0115590).", + "Please log in to continue.": "Please log in to continue.", + "Please note: The scheduled postponement is a one-time event and will not repeat automatically.": "Please note: The scheduled postponement is a one-time event and will not repeat automatically.", + "Portion Size": "Portion Size", + "postal": "postal", + "Postal address": "Postal address", + "Precondition Failed": "Precondition Failed", + "Precondition Required": "Precondition Required", + "Preparation": "Preparation", + "Preparation advice": "Preparation advice", + "Preview": "Preview", + "Preview and Associate": "Preview and Associate", + "Preview Arcadia INCO": "Preview Arcadia INCO", + "Previous period": "Previous period", + "Price": "Price", + "Price per kg (incl. tax)": "Price per kg (incl. tax)", + "Price per kilo": "Price per kilo", + "Price per kilo TTC": "Price per kilo TTC", + "Price per pound": "Price per pound", + "Pricing, Stock & Units": "Pricing, Stock & Units", + "Privacy Policy": "Privacy Policy", + "Privacy policy of the shop.": "Privacy policy of the shop.", + "Procedure to contact the store managers.": "Procedure to contact the store managers.", + "Procedure to recover the password linked to your account.": "Procedure to recover the password linked to your account.", + "Proceed to the next step": "Proceed to the next step", + "Processing": "Processing", + "Processing your order": "Processing your order", + "Product": "Product", + "Product brand": "Product brand", + "Product details": "Product details", + "Product picture": "Product picture", + "Product sold by the kilo": "Product sold by the kilo", + "Product sold by the kilo. The price will be recalculated based on the weight of the product delivered when your order is handed over. The price is therefore subject to variation on your invoice.": "Product sold by the kilo. The price will be recalculated based on the weight of the product delivered when your order is handed over. The price is therefore subject to variation on your invoice.", + "product_code": "product_code", + "product_name": "product_name", + "Products": "Products", + "Promotion configuration": "Promotion configuration", + "propose_recipe": "propose_recipe", + "Proteins": "Proteins", + "Proxy Authentication Required": "Proxy Authentication Required", + "Publication period": "Publication period", + "Published": "Published", + "Quantity": "Quantity", + "Quantity controls": "Quantity controls", + "Quantity in Basket": "Quantity in Basket", + "question_concern": "question_concern", + "Railgun Error": "Railgun Error", + "Range": "Range", + "Range information": "Range information", + "Range Not Satisfiable": "Range Not Satisfiable", + "Record": "Record", + "Recurrence options": "Recurrence options", + "ref: :reference": "ref: :reference", + "Reference": "Reference", + "Reference Daily Intakes for an adult (8400kj/2000kcal).": "Reference Daily Intakes for an adult (8400kj/2000kcal).", + "Reference Weight": "Reference Weight", + "Regards,": "Regards,", + "Register": "Register", + "Registration procedure for the shop.": "Registration procedure for the shop.", + "Remember Me": "Remember Me", + "Remember to validate your order before :closureTime on :url": "Remember to validate your order before :closureTime on :url", + "Remember to validate your order on :url": "Remember to validate your order on :url", + "Reminder of your order ref: :ref": "Reminder of your order ref: :ref", + "Reminder of your order ref: :ref:": "Reminder of your order ref: :ref:", + "Remove from Basket": "Remove from Basket", + "Removed :amount from basket": "Removed :amount from basket", + "Repeatable": "Repeatable", + "Repeatable exception": "Repeatable exception", + "Replacement date :date": "Replacement date :date", + "report_abuse": "report_abuse", + "report_abuse_message": "report_abuse_message", + "Request Header Fields Too Large": "Request Header Fields Too Large", + "Request Timeout": "Request Timeout", + "Reservation": "Reservation", + "Reservation of your order": "Reservation of your order", + "Reset": "Reset", + "Reset Content": "Reset Content", + "Reset filters": "Reset filters", + "Reset Password": "Reset Password", + "Reset Password Notification": "Reset Password Notification", + "Reset your password": "Reset your password", + "Restore": "Restore", + "Restore :name": "Restore :name", + "results": "results", + "Retry With": "Retry With", + "Return to home": "Return to home", + "Salary export - :appname": "Salary export - :appname", + "Salt": "Salt", + "Sat. %": "Sat. %", + "Saturated": "Saturated", + "Save": "Save", + "Save & Close": "Save & Close", + "Save & Return": "Save & Return", + "Save :name": "Save :name", + "Search": "Search", + "Search :name": "Search :name", + "Search using a date range": "Search using a date range", + "Search...": "Search...", + "See all aisles": "See all aisles", + "See all offers": "See all offers", + "See nutritional values": "See nutritional values", + "See Other": "See Other", + "See the :range aisle": "See the :range aisle", + "See the aisle": "See the aisle", + "See the list of ingredients": "See the list of ingredients", + "Select": "Select", + "Select All": "Select All", + "Select the date of this exception.": "Select the date of this exception.", + "Select the frequency if the event is repeatable (Default: Weekly).": "Select the frequency if the event is repeatable (Default: Weekly).", + "Select the frequency if the subscription concerns specific days.": "Select the frequency if the subscription concerns specific days.", + "Select the row": "Select the row", + "Select this pickup day": "Select this pickup day", + "Select your pickup day": "Select your pickup day", + "select_ask": "select_ask", + "Selected products": "Selected products", + "Selling argument": "Selling argument", + "Send": "Send", + "Send Password Reset Link": "Send Password Reset Link", + "Sender": "Sender", + "Sender:": "Sender:", + "Server Error": "Server Error", + "Service": "Service", + "Service Unavailable": "Service Unavailable", + "Services": "Services", + "Servings": "Servings", + "Session Has Expired": "Session Has Expired", + "Settings": "Settings", + "Shop homepage.": "Shop homepage.", + "Shopping basket emptied!": "Shopping basket emptied!", + "Shopping Basket Preview": "Shopping Basket Preview", + "Show": "Show", + "Show :name": "Show :name", + "Show All": "Show All", + "Show basket": "Show basket", + "Showing": "Showing", + "Sign In": "Sign In", + "Site": "Site", + "Site dashboard": "Site dashboard", + "Site logo :name": "Site logo :name", + "Slide :number": "Slide :number", + "Slide information": "Slide information", + "So that we can send you a password reset link, please provide the email address you used when you registered.": "So that we can send you a password reset link, please provide the email address you used when you registered.", + "Sold by the pound": "Sold by the pound", + "Sold by weight": "Sold by weight", + "Solve": "Solve", + "Sorry for the inconvenience but we’re performing some maintenance at the moment.": "Sorry for the inconvenience but we’re performing some maintenance at the moment.", + "Sort :name in ascending order": "Sort :name in ascending order", + "Sort :name in descending order": "Sort :name in descending order", + "Special": "Special", + "Specific product": "Specific product", + "Specific store product.": "Specific store product.", + "SSL Handshake Failed": "SSL Handshake Failed", + "Standardized weight unit": "Standardized weight unit", + "Start": "Start", + "Start date": "Start date", + "Start date of the previous period": "Start date of the previous period", + "Start typing an address..": "Start typing an address..", + "Status": "Status", + "Step :number": "Step :number", + "Stock": "Stock", + "Stop": "Stop", + "Submit": "Submit", + "Subscribe": "Subscribe", + "Success confirmation": "Success confirmation", + "Sugars": "Sugars", + "Sugars %": "Sugars %", + "Summary": "Summary", + "Switch": "Switch", + "Switch To Role": "Switch To Role", + "Switching Protocols": "Switching Protocols", + "Synchronize from Arcadia": "Synchronize from Arcadia", + "Tag": "Tag", + "Tags": "Tags", + "Take one out": "Take one out", + "Temporary Redirect": "Temporary Redirect", + "terms and conditions": "terms and conditions", + "Thank you for this order!": "Thank you for this order!", + "The :app_name team": "The :app_name team", + "The :attribute must be a valid role.": "The :attribute must be a valid role.", + "The :attribute must be at least :length characters and contain at least one number.": "The :attribute must be at least :length characters and contain at least one number.", + "The :attribute must be at least :length characters and contain at least one special character and one number.": "The :attribute must be at least :length characters and contain at least one special character and one number.", + "The :attribute must be at least :length characters and contain at least one special character.": "The :attribute must be at least :length characters and contain at least one special character.", + "The :attribute must be at least :length characters and contain at least one uppercase character and one number.": "The :attribute must be at least :length characters and contain at least one uppercase character and one number.", + "The :attribute must be at least :length characters and contain at least one uppercase character and one special character.": "The :attribute must be at least :length characters and contain at least one uppercase character and one special character.", + "The :attribute must be at least :length characters and contain at least one uppercase character, one number, and one special character.": "The :attribute must be at least :length characters and contain at least one uppercase character, one number, and one special character.", + "The :attribute must be at least :length characters and contain at least one uppercase character.": "The :attribute must be at least :length characters and contain at least one uppercase character.", + "The :attribute must be at least :length characters.": "The :attribute must be at least :length characters.", + "The :attribute must contain at least one letter.": "The :attribute must contain at least one letter.", + "The :attribute must contain at least one number.": "The :attribute must contain at least one number.", + "The :attribute must contain at least one symbol.": "The :attribute must contain at least one symbol.", + "The :attribute must contain at least one uppercase and one lowercase letter.": "The :attribute must contain at least one uppercase and one lowercase letter.", + "The :sitename Team": "The :sitename Team", + "The answer": "The answer", + "The brand associated with the product": "The brand associated with the product", + "The customer account was not found.": "The customer account was not found.", + "The discount applies to the piece (sold unit).": "The discount applies to the piece (sold unit).", + "The employee sync job has been dispatched": "The employee sync job has been dispatched", + "The existing encrypted environment file is not in readable format. Use --force to overwrite it.": "The existing encrypted environment file is not in readable format. Use --force to overwrite it.", + "The existing encryption key is required to update the encrypted environment file.": "The existing encryption key is required to update the encrypted environment file.", + "The given data was invalid.": "The given data was invalid.", + "The INCO sheet has been successfully associated with the product.": "The INCO sheet has been successfully associated with the product.", + "The INCO sheet has been successfully associated.": "The INCO sheet has been successfully associated.", + "The INCO sheet has been successfully synchronized from Arcadia.": "The INCO sheet has been successfully synchronized from Arcadia.", + "The list is empty.": "The list is empty.", + "The new password must be at least 8 characters and contain uppercase, lowercase, number and special character.": "The new password must be at least 8 characters and contain uppercase, lowercase, number and special character.", + "The operation was not performed": "The operation was not performed", + "The order": "The order", + "The order deadline has passed. This item will no longer be available for purchase.": "The order deadline has passed. This item will no longer be available for purchase.", + "The password must contain": "The password must contain", + "The publication status is updated according to the scheduled dates. To change the publication status, please edit or remove the corresponding dates.": "The publication status is updated according to the scheduled dates. To change the publication status, please edit or remove the corresponding dates.", + "The range associated with the product": "The range associated with the product", + "The response is not a streamed response.": "The response is not a streamed response.", + "The response is not a view.": "The response is not a view.", + "The team": "The team", + "The text that will accompany the image": "The text that will accompany the image", + "The text that will accompany your slide image.": "The text that will accompany your slide image.", + "The total amount for this delivery date has been exceeded (€200 maximum). Please modify it to validate.": "The total amount for this delivery date has been exceeded (€200 maximum). Please modify it to validate.", + "The total amount of this order has been exceeded (€200 maximum). Please modify it to validate.": "The total amount of this order has been exceeded (€200 maximum). Please modify it to validate.", + "The unsubscription link is invalid.": "The unsubscription link is invalid.", + "The usual limit to pass an order is :date": "The usual limit to pass an order is :date", + "The usual pickup day is :date": "The usual pickup day is :date", + "The verification link is invalid or the customer account was not found.": "The verification link is invalid or the customer account was not found.", + "This action is unauthorized.": "This action is unauthorized.", + "This activation link is not valid": "This activation link is not valid", + "This is not the page you are looking for...": "This is not the page you are looking for...", + "This password reset link will expire in :count minutes.": "This password reset link will expire in :count minutes.", + "to": "to", + "To be collected on": "To be collected on", + "To date": "To date", + "To update your personal information, fill in the new data below": "To update your personal information, fill in the new data below", + "To update your personal information, fill in the new data below:": "To update your personal information, fill in the new data below:", + "Today's Orders": "Today's Orders", + "Toggle navigation": "Toggle navigation", + "Too Early": "Too Early", + "Too Many Requests": "Too Many Requests", + "Total": "Total", + "Total %": "Total %", + "Total (including tax)": "Total (including tax)", + "Total for this product: :total": "Total for this product: :total", + "Total in €": "Total in €", + "Total Price (excluding tax)": "Total Price (excluding tax)", + "Total to pay": "Total to pay", + "Total TTC": "Total TTC", + "Total TTC:": "Total TTC:", + "town": "town", + "Translate": "Translate", + "Translate It": "Translate It", + "TTC": "TTC", + "Unable to write the encrypted environment file.": "Unable to write the encrypted environment file.", + "Unauthorized": "Unauthorized", + "Unavailable For Legal Reasons": "Unavailable For Legal Reasons", + "Unit price": "Unit price", + "Unit price (excluding tax)": "Unit price (excluding tax)", + "Unit price (incl. tax)": "Unit price (incl. tax)", + "Unit price: :price": "Unit price: :price", + "Unit used when transmitting the order to Regate": "Unit used when transmitting the order to Regate", + "Unknown Error": "Unknown Error", + "Unpack": "Unpack", + "Unprocessable Entity": "Unprocessable Entity", + "Unsubscribe": "Unsubscribe", + "Unsupported Media Type": "Unsupported Media Type", + "until :date": "until :date", + "Up": "Up", + "Update": "Update", + "Update :name": "Update :name", + "Update my personal details": "Update my personal details", + "Updated automatically": "Updated automatically", + "Upgrade Required": "Upgrade Required", + "URI Too Long": "URI Too Long", + "Use Proxy": "Use Proxy", + "Use the Arcadia section above to search and associate an INCO sheet.": "Use the Arcadia section above to search and associate an INCO sheet.", + "User": "User", + "Validate my basket": "Validate my basket", + "Validate my basket and proceed to reservation": "Validate my basket and proceed to reservation", + "Validation of your order.": "Validation of your order.", + "Validity period": "Validity period", + "Variable weight product": "Variable weight product", + "Variant Also Negotiates": "Variant Also Negotiates", + "VAT": "VAT", + "Verify Email Address": "Verify Email Address", + "Verify Your Email Address": "Verify Your Email Address", + "Verify your email address": "Verify your email address", + "View": "View", + "View :name": "View :name", + "View details of :name": "View details of :name", + "View on map": "View on map", + "View on OpenStreetMap": "View on OpenStreetMap", + "View product": "View product", + "Visible": "Visible", + "Vos informations ont bien été enregistrées.": "Your information has been saved.", + "Votre désinscription à la newsletter a été prise en compte": "Your newsletter unsubscription has been taken into account.", + "Warning": "Warning", + "We do our utmost to deliver your entire order, unfortunately some products may be out of stock. You will not be charged for undelivered products.": "We do our utmost to deliver your entire order, unfortunately some products may be out of stock. You will not be charged for undelivered products.", + "We'll be back soon!": "We'll be back soon!", + "Web Server is Down": "Web Server is Down", + "Welcome to your account. What would you like to do ?": "Welcome to your account. What would you like to do ?", + "Whoops!": "Whoops!", + "Year": "Year", + "Yes": "Yes", + "Yes, empty my basket": "Yes, empty my basket", + "You are logged in!": "You are logged in!", + "You are logged out!": "You are logged out!", + "You are not authorized to access this element.": "You are not authorized to access this element.", + "You are receiving this email because we received a password reset request for your account.": "You are receiving this email because we received a password reset request for your account.", + "You have an order to collect today - :appname": "You have an order to collect today - :appname", + "You have just generated a .csv file following the import of employees, available as an attachment to this email.": "You have just generated a .csv file following the import of employees, available as an attachment to this email.", + "You have no orders": "You have no orders", + "You have reached the maximum order limit for this basket.": "You have reached the maximum order limit for this basket.", + "You will reach the maximum weekly order limit with this basket.": "You will reach the maximum weekly order limit with this basket.", + "Your account has been successfully activated, you can now log in.": "Your account has been successfully activated, you can now log in.", + "Your account is already activated, you can log in with it now.": "Your account is already activated, you can log in with it now.", + "Your account is not activated yet. Please check your email for the activation link.": "Your account is not activated yet. Please check your email for the activation link.", + "Your account is now verified, you can start using the site.": "Your account is now verified, you can start using the site.", + "Your assigned pickup point is :shop": "Your assigned pickup point is :shop", + "Your basket": "Your basket", + "Your basket is empty": "Your basket is empty", + "Your collection": "Your collection", + "Your email address": "Your email address", + "Your email address cannot be changed.": "Your email address cannot be changed.", + "Your information has been saved.": "Your information has been saved.", + "Your message could not be sent.<br>We are sorry and ask you to please try again later.": "Your message could not be sent.<br>We are sorry and ask you to please try again later.", + "Your message has been sent!": "Your message has been sent!", + "Your new password must be different from the old one": "Your new password must be different from the old one", + "Your newsletter unsubscription has been taken into account.": "Your newsletter unsubscription has been taken into account.", + "Your old password does not match.": "Your old password does not match.", + "Your order": "Your order", + "Your order - :appname": "Your order - :appname", + "Your order is ready for collection today at your collection point!": "Your order is ready for collection today at your collection point!", + "Your order is registered!": "Your order is registered!", + "Your order session has expired or is invalid. Please review your basket.": "Your order session has expired or is invalid. Please review your basket.", + "Your password has been changed - :appname": "Your password has been changed - :appname", + "Your password has been changed on :appname": "Your password has been changed on :appname", + "Your password has been changed. If you are not at the origin of this change, please contact us as soon as possible using the contact form or by contacting your manager.": "Your password has been changed. If you are not at the origin of this change, please contact us as soon as possible using the contact form or by contacting your manager.", + "your_message": "your_message", + "Zip code": "Zip code", + "Your search": "Your search", + "Choose position": "Choose position", + "Move": "Move", + "Move down": "Move down", + "Move up": "Move up", + "New position": "New position" +} diff --git a/lang/en/actions.php b/lang/en/actions.php new file mode 100644 index 00000000..7ff2b68b --- /dev/null +++ b/lang/en/actions.php @@ -0,0 +1,119 @@ +<?php + +declare(strict_types=1); + +return [ + 'accept' => 'Accept', + 'action' => 'Action', + 'actions' => 'Actions', + 'add' => 'Add', + 'admin' => 'Admin', + 'agree' => 'Agree', + 'archive' => 'Archive', + 'assign' => 'Assign', + 'associate' => 'Associate', + 'attach' => 'Attach', + 'browse' => 'Browse', + 'cancel' => 'Cancel', + 'choose' => 'Choose', + 'choose_file' => 'Choose File', + 'choose_image' => 'Choose Image', + 'click_to_copy' => 'Click to copy', + 'close' => 'Close', + 'collapse' => 'Collapse', + 'collapse_all' => 'Collapse All', + 'comment' => 'Comment', + 'confirm' => 'Confirm', + 'connect' => 'Connect', + 'create' => 'Create', + 'delete' => 'Delete', + 'detach' => 'Detach', + 'details' => 'Details', + 'disable' => 'Disable', + 'discard' => 'Discard', + 'done' => 'Done', + 'down' => 'Down', + 'duplicate' => 'Duplicate', + 'edit' => 'Edit', + 'enable' => 'Enable', + 'expand' => 'Expand', + 'expand_all' => 'Expand All', + 'explanation' => 'Explanation', + 'export' => 'Export', + 'file' => 'File', + 'files' => 'Files', + 'go_home' => 'Go Home', + 'hide' => 'Hide', + 'home' => 'Home', + 'image' => 'Image', + 'impersonate' => 'Impersonate', + 'impersonation' => 'Impersonation', + 'import' => 'Import', + 'introduction' => 'Introduction', + 'like' => 'Like', + 'load' => 'Load', + 'localize' => 'Localize', + 'log_in' => 'Log In', + 'log_out' => 'Log Out', + 'named' => [ + 'add' => 'Add :name', + 'choose' => 'Choose :name', + 'create' => 'Create :name', + 'delete' => 'Delete :name', + 'duplicate' => 'Duplicate :name', + 'edit' => 'Edit :name', + 'export' => 'Export :name', + 'hide' => 'Hide :name', + 'import' => 'Import :name', + 'new' => 'New :name', + 'restore' => 'Restore :name', + 'save' => 'Save :name', + 'search' => 'Search :name', + 'show' => 'Show :name', + 'update' => 'Update :name', + 'view' => 'View :name', + ], + 'new' => 'New', + 'no' => 'No', + 'open' => 'Open', + 'open_website' => 'Open on the website', + 'preview' => 'Preview', + 'price' => 'Price', + 'record' => 'Record', + 'restore' => 'Restore', + 'save' => 'Save', + 'save_and_close' => 'Save & Close', + 'save_and_return' => 'Save & Return', + 'search' => 'Search', + 'select' => 'Select', + 'select_all' => 'Select All', + 'send' => 'Send', + 'settings' => 'Settings', + 'show' => 'Show', + 'show_all' => 'Show All', + 'sign_in' => 'Sign In', + 'solve' => 'Solve', + 'start' => 'Start', + 'stop' => 'Stop', + 'submit' => 'Submit', + 'subscribe' => 'Subscribe', + 'switch' => 'Switch', + 'switch_to_role' => 'Switch To Role', + 'tag' => 'Tag', + 'tags' => 'Tags', + 'target_link' => [ + 'blank' => 'Open in a new window', + 'parent' => 'Open in a parent frame', + 'self' => 'Open in a current window', + 'top' => 'Open in the topmost frame', + ], + 'translate' => 'Translate', + 'translate_it' => 'Translate It', + 'unpack' => 'Unpack', + 'unsubscribe' => 'Unsubscribe', + 'up' => 'Up', + 'update' => 'Update', + 'user' => 'User', + 'view' => 'View', + 'yes' => 'Yes', +]; diff --git a/lang/en/auth.php b/lang/en/auth.php new file mode 100644 index 00000000..ad725d8b --- /dev/null +++ b/lang/en/auth.php @@ -0,0 +1,9 @@ +<?php + +declare(strict_types=1); + +return [ + 'failed' => 'These credentials do not match our records.', + 'password' => 'The provided password is incorrect.', + 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', +]; diff --git a/resources/lang/en/cookie-notice.php b/lang/en/cookie-notice.php similarity index 95% rename from resources/lang/en/cookie-notice.php rename to lang/en/cookie-notice.php index 9c24ce34..869c505d 100644 --- a/resources/lang/en/cookie-notice.php +++ b/lang/en/cookie-notice.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + // * Version 6.0.3 // phpcs:disable return [ @@ -21,11 +23,11 @@ return [ 'panel_content' => 'Cookie management panel content', 'picture_cookie_title' => 'Image of a nice big cookie', 'navigation_title' => 'Cookies panel navigation', - 'custom' => [ + 'custom' => [ 'matomo' => [ 'title' => 'Matomo', 'description' => 'Audience measurement services are used to generate traffic statistics, which are useful for improving the site.', 'labelLink' => 'Learn more', - ] - ] + ], + ], ]; diff --git a/lang/en/country.php b/lang/en/country.php new file mode 100644 index 00000000..7699eff0 --- /dev/null +++ b/lang/en/country.php @@ -0,0 +1,255 @@ +<?php + +declare(strict_types=1); + +return [ + 'afghanistan' => 'Afghanistan', + 'alandIslands' => 'Åland Islands', + 'albania' => 'Albania', + 'algeria' => 'Algeria', + 'americanSamoa' => 'American Samoa', + 'andorra' => 'Andorra', + 'angola' => 'Angola', + 'anguilla' => 'Anguilla', + 'antarctica' => 'Antarctica', + 'antiguaAndBarbuda' => 'Antigua and Barbuda', + 'argentina' => 'Argentina', + 'armenia' => 'Armenia', + 'aruba' => 'Aruba', + 'australia' => 'Australia', + 'austria' => 'Austria', + 'azerbaijan' => 'Azerbaijan', + 'bahrain' => 'Bahrain', + 'bahamas' => 'Bahamas', + 'bangladesh' => 'Bangladesh', + 'barbados' => 'Barbados', + 'belarus' => 'Belarus', + 'belgium' => 'Belgium', + 'belize' => 'Belize', + 'benin' => 'Benin', + 'bermuda' => 'Bermuda', + 'bhutan' => 'Bhutan', + 'boliviaPlurinationalStateOf' => 'Bolivia, Plurinational State of', + 'bonaireSintEustatiusAndSaba' => 'Bonaire, Sint Eustatius and Saba', + 'bosniaAndHerzegovina' => 'Bosnia and Herzegovina', + 'botswana' => 'Botswana', + 'bouvetIsland' => 'Bouvet Island', + 'brazil' => 'Brazil', + 'britishIndianOceanTerritory' => 'British Indian Ocean Territory', + 'bruneiDarussalam' => 'Brunei Darussalam', + 'bulgaria' => 'Bulgaria', + 'burkinaFaso' => 'Burkina Faso', + 'burundi' => 'Burundi', + 'cambodia' => 'Cambodia', + 'cameroon' => 'Cameroon', + 'canada' => 'Canada', + 'capeVerde' => 'Cape Verde', + 'caymanIslands' => 'Cayman Islands', + 'centralAfricanRepublic' => 'Central African Republic', + 'chad' => 'Chad', + 'chile' => 'Chile', + 'china' => 'China', + 'christmasIsland' => 'Christmas Island', + 'cocosKeelingIslands' => 'Cocos (Keeling) Islands', + 'colombia' => 'Colombia', + 'comoros' => 'Comoros', + 'congo' => 'Congo', + 'congoTheDemocraticRepublicOfThe' => 'Congo, the Democratic Republic of the', + 'cookIslands' => 'Cook Islands', + 'costaRica' => 'Costa Rica', + 'coteDivoire' => 'Côte d\'Ivoire', + 'croatia' => 'Croatia', + 'cuba' => 'Cuba', + 'curacao' => 'Curaçao', + 'cyprus' => 'Cyprus', + 'czechRepublic' => 'Czech Republic', + 'denmark' => 'Denmark', + 'djibouti' => 'Djibouti', + 'dominica' => 'Dominica', + 'dominicanRepublic' => 'Dominican Republic', + 'ecuador' => 'Ecuador', + 'egypt' => 'Egypt', + 'elSalvador' => 'El Salvador', + 'equatorialGuinea' => 'Equatorial Guinea', + 'eritrea' => 'Eritrea', + 'estonia' => 'Estonia', + 'ethiopia' => 'Ethiopia', + 'falklandIslandsMalvinas' => 'Falkland Islands (Malvinas)', + 'faroeIslands' => 'Faroe Islands', + 'fiji' => 'Fiji', + 'finland' => 'Finland', + 'france' => 'France', + 'frenchGuiana' => 'French Guiana', + 'frenchPolynesia' => 'French Polynesia', + 'frenchSouthernTerritories' => 'French Southern Territories', + 'gabon' => 'Gabon', + 'gambia' => 'Gambia', + 'georgia' => 'Georgia', + 'germany' => 'Germany', + 'ghana' => 'Ghana', + 'gibraltar' => 'Gibraltar', + 'greece' => 'Greece', + 'greenland' => 'Greenland', + 'grenada' => 'Grenada', + 'guadeloupe' => 'Guadeloupe', + 'guam' => 'Guam', + 'guatemala' => 'Guatemala', + 'guernsey' => 'Guernsey', + 'guinea' => 'Guinea', + 'guineaBissau' => 'GuineaBissau', + 'guyana' => 'Guyana', + 'haiti' => 'Haiti', + 'heardIslandAndMcdonaldIslands' => 'Heard Island and McDonald Islands', + 'holySeeVaticanCityState' => 'Holy See (Vatican City State)', + 'honduras' => 'Honduras', + 'hongKong' => 'Hong Kong', + 'hungary' => 'Hungary', + 'iceland' => 'Iceland', + 'india' => 'India', + 'indonesia' => 'Indonesia', + 'iranIslamicRepublicOf' => 'Iran, Islamic Republic of', + 'iraq' => 'Iraq', + 'ireland' => 'Ireland', + 'isleOfMan' => 'Isle of Man', + 'israel' => 'Israel', + 'italy' => 'Italy', + 'jamaica' => 'Jamaica', + 'japan' => 'Japan', + 'jersey' => 'Jersey', + 'jordan' => 'Jordan', + 'kazakhstan' => 'Kazakhstan', + 'kenya' => 'Kenya', + 'kiribati' => 'Kiribati', + 'koreaDemocraticPeoplesRepublicOf' => 'Korea, Democratic People\'s Republic of', + 'koreaRepublicOf' => 'Korea, Republic of', + 'kuwait' => 'Kuwait', + 'kyrgyzstan' => 'Kyrgyzstan', + 'laoPeoplesDemocraticRepublic' => 'Lao People\'s Democratic Republic', + 'latvia' => 'Latvia', + 'lebanon' => 'Lebanon', + 'lesotho' => 'Lesotho', + 'liberia' => 'Liberia', + 'libya' => 'Libya', + 'liechtenstein' => 'Liechtenstein', + 'lithuania' => 'Lithuania', + 'luxembourg' => 'Luxembourg', + 'macao' => 'Macao', + 'macedoniaTheFormerYugoslavRepublicOf' => 'Macedonia, the Former Yugoslav Republic of', + 'madagascar' => 'Madagascar', + 'malawi' => 'Malawi', + 'malaysia' => 'Malaysia', + 'maldives' => 'Maldives', + 'mali' => 'Mali', + 'malta' => 'Malta', + 'marshallIslands' => 'Marshall Islands', + 'martinique' => 'Martinique', + 'mauritania' => 'Mauritania', + 'mauritius' => 'Mauritius', + 'mayotte' => 'Mayotte', + 'mexico' => 'Mexico', + 'micronesiaFederatedStatesOf' => 'Micronesia, Federated States of', + 'moldovaRepublicOf' => 'Moldova, Republic of', + 'monaco' => 'Monaco', + 'mongolia' => 'Mongolia', + 'montenegro' => 'Montenegro', + 'montserrat' => 'Montserrat', + 'morocco' => 'Morocco', + 'mozambique' => 'Mozambique', + 'myanmar' => 'Myanmar', + 'namibia' => 'Namibia', + 'nauru' => 'Nauru', + 'nepal' => 'Nepal', + 'netherlands' => 'Netherlands', + 'newCaledonia' => 'New Caledonia', + 'newZealand' => 'New Zealand', + 'nicaragua' => 'Nicaragua', + 'niger' => 'Niger', + 'nigeria' => 'Nigeria', + 'niue' => 'Niue', + 'norfolkIsland' => 'Norfolk Island', + 'northernMarianaIslands' => 'Northern Mariana Islands', + 'norway' => 'Norway', + 'oman' => 'Oman', + 'pakistan' => 'Pakistan', + 'palau' => 'Palau', + 'palestineStateOf' => 'Palestine, State of', + 'panama' => 'Panama', + 'papuaNewGuinea' => 'Papua New Guinea', + 'paraguay' => 'Paraguay', + 'peru' => 'Peru', + 'philippines' => 'Philippines', + 'pitcairn' => 'Pitcairn', + 'poland' => 'Poland', + 'portugal' => 'Portugal', + 'puertoRico' => 'Puerto Rico', + 'qatar' => 'Qatar', + 'reunion' => 'Réunion', + 'romania' => 'Romania', + 'russianFederation' => 'Russian Federation', + 'rwanda' => 'Rwanda', + 'saintBarthelemy' => 'Saint Barthélemy', + 'saintHelenaAscensionAndTristanDaCunha' => 'Saint Helena, Ascension and Tristan da Cunha', + 'saintKittsAndNevis' => 'Saint Kitts and Nevis', + 'saintLucia' => 'Saint Lucia', + 'saintMartinFrenchPart' => 'Saint Martin (French part)', + 'saintPierreAndMiquelon' => 'Saint Pierre and Miquelon', + 'saintVincentAndTheGrenadines' => 'Saint Vincent and the Grenadines', + 'samoa' => 'Samoa', + 'sanMarino' => 'San Marino', + 'saoTomeAndPrincipe' => 'Sao Tome and Principe', + 'saudiArabia' => 'Saudi Arabia', + 'senegal' => 'Senegal', + 'serbia' => 'Serbia', + 'seychelles' => 'Seychelles', + 'sierraLeone' => 'Sierra Leone', + 'singapore' => 'Singapore', + 'sintMaartenDutchPart' => 'Sint Maarten (Dutch part)', + 'slovakia' => 'Slovakia', + 'slovenia' => 'Slovenia', + 'solomonIslands' => 'Solomon Islands', + 'somalia' => 'Somalia', + 'southAfrica' => 'South Africa', + 'southGeorgiaAndTheSouthSandwichIslands' => 'South Georgia and the South Sandwich Islands', + 'southSudan' => 'South Sudan', + 'spain' => 'Spain', + 'sriLanka' => 'Sri Lanka', + 'sudan' => 'Sudan', + 'suriname' => 'Suriname', + 'svalbardAndJanMayen' => 'Svalbard and Jan Mayen', + 'swaziland' => 'Swaziland', + 'sweden' => 'Sweden', + 'switzerland' => 'Switzerland', + 'syrianArabRepublic' => 'Syrian Arab Republic', + 'taiwanProvinceOfChina' => 'Taiwan, Province of China', + 'tajikistan' => 'Tajikistan', + 'tanzaniaUnitedRepublicOf' => 'Tanzania, United Republic of', + 'thailand' => 'Thailand', + 'timorLeste' => 'TimorLeste', + 'togo' => 'Togo', + 'tokelau' => 'Tokelau', + 'tonga' => 'Tonga', + 'trinidadAndTobago' => 'Trinidad and Tobago', + 'tunisia' => 'Tunisia', + 'turkey' => 'Turkey', + 'turkmenistan' => 'Turkmenistan', + 'turksAndCaicosIslands' => 'Turks and Caicos Islands', + 'tuvalu' => 'Tuvalu', + 'uganda' => 'Uganda', + 'ukraine' => 'Ukraine', + 'unitedArabEmirates' => 'United Arab Emirates', + 'unitedKingdom' => 'United Kingdom', + 'unitedStates' => 'United States', + 'unitedStatesMinorOutlyingIslands' => 'United States Minor Outlying Islands', + 'uruguay' => 'Uruguay', + 'uzbekistan' => 'Uzbekistan', + 'vanuatu' => 'Vanuatu', + 'venezuelaBolivarianRepublicOf' => 'Venezuela, Bolivarian Republic of', + 'vietNam' => 'Viet Nam', + 'virginIslandsBritish' => 'Virgin Islands, British', + 'virginIslandsUs' => 'Virgin Islands, U.S.', + 'wallisAndFutuna' => 'Wallis and Futuna', + 'westernSahara' => 'Western Sahara', + 'yemen' => 'Yemen', + 'zambia' => 'Zambia', + 'zimbabwe' => 'Zimbabwe', +]; diff --git a/lang/en/crud.php b/lang/en/crud.php new file mode 100644 index 00000000..45c028ba --- /dev/null +++ b/lang/en/crud.php @@ -0,0 +1,128 @@ +<?php + +declare(strict_types=1); + +return [ + 'actions' => [ + 'list' => 'list', + 'view' => 'view', + 'create' => 'create', + 'duplicate' => 'duplicate', + 'update' => 'edit', + 'delete' => 'delete', + 'save' => 'save', + 'edit' => 'update', + ], + + 'helpers' => [ + 'list' => 'List', + 'view_associated' => 'View related :model', + 'list_all' => 'List all :model', + 'create_model' => 'Create :model', + 'view_model' => 'View :model', + 'associate_model' => 'Associate :model', + 'update_model' => 'Edit :model', + 'duplicate_model' => 'Duplicate :model', + 'delete_model' => 'Delete :model', + 'save_model' => 'Save :model', + 'edit_model' => 'Update :model', + 'no_results' => 'No results', + 'no_results_for_model' => 'No results for :model', + 'publish' => 'Publish', + 'unpublish' => 'Unpublish', + 'starred' => 'Highlighted', + 'discounted' => 'On sale', + 'star' => 'Highlight', + 'unstar' => 'Do not highlight', + 'seo_title' => 'Must accurately describe the page, recommendation for optimal search engine positioning (<title> tag).', + 'seo_description' => 'Must accurately describe the content of the page (<meta> description tag).', + 'required_fields' => 'Required fields', + 'required_fields_with_aster' => 'Fields followed by an asterisk are required', + 'visibility_with_dates' => 'This field only takes effect if no dates are set.', + 'publish_at' => ':model will be published starting from this date.', + 'unpublish_at' => ':model will be unpublished starting from this date.', + 'nutritionnal_values' => 'Values must be entered in grams, except for energy in kJ and kcal.', + 'new_tab_boolean' => 'Check to open in a new tab.', + 'game_text' => 'Must contain at least 15 characters and at most 32 words.', + 'url' => 'Must be a valid URL.', + 'year' => 'Year of the :model', + ], + + 'labels' => [ + 'new_tab_boolean' => 'Open in a new tab?', + ], + + 'libs' => [ + 'toolbox' => [ + 'assertFieldIsUnique' => 'The :valeur of the field :attribut is already used', + 'assertNoInternalBoUrls' => ':attribute: It is forbidden to paste back-office uri in this field', + 'assertNoInternalUrls' => ':attribute: It is forbidden to paste a :appname url in this field.', + ], + ], + + 'messages' => [ + 'action_done' => 'The action was performed', + 'has_been_created' => ':model has been created', + 'cannot_be_created' => ':model cannot be created', + 'has_been_updated' => ':model has been updated', + 'cannot_be_updated' => ':model cannot be updated', + 'has_been_deleted' => ':model has been deleted', + 'cannot_be_deleted' => ':model cannot be deleted', + 'order_changed' => 'The order has been changed!', + 'order_not_changed' => 'The order was not changed!', + 'publish_status_saved' => 'Publication status changed successfully!', + 'star_saved' => 'Highlight status changed successfully!', + 'right' => 'You do not have permission to access this section!', + 'theme_updated' => 'The theme has been updated!', + ], + + 'minicrud' => [ + 'visibility_label' => 'Visibility', + 'visibility_helper' => 'Check to make visible.', + 'select' => 'Select :entity from the list.', + 'associated_enum' => 'Associated :entity', + 'dimensions_must_be' => 'Must be :widthpx (width) by :heightpx (height).', + 'picture_title_helper' => 'Useful for users, appears when hovering over the image', + 'picture_title_label' => 'Image title attribute', + 'picture_alt_helper' => 'Must describe your image for search engines and visually impaired users (5 to 6 words)', + 'picture_alt_label' => 'Image alt attribute', + 'text_warning' => 'Review your content before publishing.', + ], + + 'pagination' => [ + 'previous' => 'Previous page', + 'next' => 'Next page', + 'specific_page' => 'Go to page #:id', + 'paginate_list' => 'Number of items per page', + ], + + 'other' => [ + 'up' => 'Move display order up', + 'down' => 'Move display order down', + 'no_model_found' => 'No :model found', + 'publish' => 'Published', + 'unpublish' => 'Unpublished', + 'search_start' => 'Start search', + 'search_delete' => 'Clear search', + 'search_placeholder' => 'Your keywords here...', + 'sort_ascending' => 'Sort :name in ascending order', + 'sort_descending' => 'Sort :name in descending order', + 'sort_delete' => 'Clear sort', + 'sort_arrow' => 'Here, arrows are used for sorting, not filtering', + 'right' => 'You do not have permissions', + ], + 'meta' => [ + 'title' => [ + 'create' => 'Create a :model', + 'edit' => 'Edit a :model', + 'show' => 'View a :model', + ], + 'description' => [ + 'index' => 'List of all :model', + 'create' => 'Create a brand new :model', + 'edit' => 'Edit an existing :model', + 'show' => 'View an existing :model', + ], + ], + +]; diff --git a/lang/en/http-statuses.php b/lang/en/http-statuses.php new file mode 100644 index 00000000..3346f78c --- /dev/null +++ b/lang/en/http-statuses.php @@ -0,0 +1,84 @@ +<?php + +declare(strict_types=1); + +return [ + '0' => 'Unknown Error', + '100' => 'Continue', + '101' => 'Switching Protocols', + '102' => 'Processing', + '200' => 'OK', + '201' => 'Created', + '202' => 'Accepted', + '203' => 'Non-Authoritative Information', + '204' => 'No Content', + '205' => 'Reset Content', + '206' => 'Partial Content', + '207' => 'Multi-Status', + '208' => 'Already Reported', + '226' => 'IM Used', + '300' => 'Multiple Choices', + '301' => 'Moved Permanently', + '302' => 'Found', + '303' => 'See Other', + '304' => 'Not Modified', + '305' => 'Use Proxy', + '307' => 'Temporary Redirect', + '308' => 'Permanent Redirect', + '400' => 'Bad Request', + '401' => 'Unauthorized', + '402' => 'Payment Required', + '403' => 'Forbidden', + '404' => 'Not Found', + '405' => 'Method Not Allowed', + '406' => 'Not Acceptable', + '407' => 'Proxy Authentication Required', + '408' => 'Request Timeout', + '409' => 'Conflict', + '410' => 'Gone', + '411' => 'Length Required', + '412' => 'Precondition Failed', + '413' => 'Payload Too Large', + '414' => 'URI Too Long', + '415' => 'Unsupported Media Type', + '416' => 'Range Not Satisfiable', + '417' => 'Expectation Failed', + '418' => 'I\'m a teapot', + '419' => 'Session Has Expired', + '421' => 'Misdirected Request', + '422' => 'Unprocessable Entity', + '423' => 'Locked', + '424' => 'Failed Dependency', + '425' => 'Too Early', + '426' => 'Upgrade Required', + '428' => 'Precondition Required', + '429' => 'Too Many Requests', + '431' => 'Request Header Fields Too Large', + '444' => 'Connection Closed Without Response', + '449' => 'Retry With', + '451' => 'Unavailable For Legal Reasons', + '499' => 'Client Closed Request', + '500' => 'Internal Server Error', + '501' => 'Not Implemented', + '502' => 'Bad Gateway', + '503' => 'Maintenance Mode', + '504' => 'Gateway Timeout', + '505' => 'HTTP Version Not Supported', + '506' => 'Variant Also Negotiates', + '507' => 'Insufficient Storage', + '508' => 'Loop Detected', + '509' => 'Bandwidth Limit Exceeded', + '510' => 'Not Extended', + '511' => 'Network Authentication Required', + '520' => 'Unknown Error', + '521' => 'Web Server is Down', + '522' => 'Connection Timed Out', + '523' => 'Origin Is Unreachable', + '524' => 'A Timeout Occurred', + '525' => 'SSL Handshake Failed', + '526' => 'Invalid SSL Certificate', + '527' => 'Railgun Error', + '598' => 'Network Read Timeout Error', + '599' => 'Network Connect Timeout Error', + 'unknownError' => 'Unknown Error', +]; diff --git a/lang/en/models.php b/lang/en/models.php new file mode 100644 index 00000000..4ee57572 --- /dev/null +++ b/lang/en/models.php @@ -0,0 +1,22 @@ +<?php + +declare(strict_types=1); + +return [ + 'classes' => [ + 'slides' => 'slide|slides', + 'tags' => 'tag|tags', + 'pages' => 'page|pages', + 'faqs' => 'faq|faqs', + 'products' => 'product|products', + 'ranges' => 'range|ranges', + 'product_incos' => 'inco sheet|inco sheets', + 'discounts' => 'discount|discounts', + 'shops' => 'shop|shops', + 'pickup-exceptions' => 'pickup exception|pickup exceptions', + 'orders' => 'order|orders', + 'customers' => 'customer|customers', + 'brands' => 'brand|brands', + 'settings' => 'employee site|employee sites', + ], +]; diff --git a/lang/en/pagination.php b/lang/en/pagination.php new file mode 100644 index 00000000..f4ceddec --- /dev/null +++ b/lang/en/pagination.php @@ -0,0 +1,8 @@ +<?php + +declare(strict_types=1); + +return [ + 'next' => 'Next »', + 'previous' => '« Previous', +]; diff --git a/lang/en/passwords.php b/lang/en/passwords.php new file mode 100644 index 00000000..f3b65bab --- /dev/null +++ b/lang/en/passwords.php @@ -0,0 +1,11 @@ +<?php + +declare(strict_types=1); + +return [ + 'reset' => 'Your password has been reset.', + 'sent' => 'We have emailed your password reset link.', + 'throttled' => 'Please wait before retrying.', + 'token' => 'This password reset token is invalid.', + 'user' => 'We can\'t find a user with that email address.', +]; diff --git a/lang/en/search.php b/lang/en/search.php new file mode 100644 index 00000000..b8d4598d --- /dev/null +++ b/lang/en/search.php @@ -0,0 +1,10 @@ +<?php + +declare(strict_types=1); + +return [ + 'label' => 'Search', + 'keywords_here' => 'Your keywords here... :fields', + 'launch' => 'Start search', + 'clear' => 'Clear search', +]; diff --git a/lang/en/validation.php b/lang/en/validation.php new file mode 100644 index 00000000..c5f8ae1b --- /dev/null +++ b/lang/en/validation.php @@ -0,0 +1,291 @@ +<?php + +declare(strict_types=1); + +return [ + 'accepted' => 'The :attribute field must be accepted.', + 'accepted_if' => 'The :attribute field must be accepted when :other is :value.', + 'active_url' => 'The :attribute field must be a valid URL.', + 'after' => 'The :attribute field must be a date after :date.', + 'after_or_equal' => 'The :attribute field must be a date after or equal to :date.', + 'alpha' => 'The :attribute field must only contain letters.', + 'alpha_dash' => 'The :attribute field must only contain letters, numbers, dashes, and underscores.', + 'alpha_num' => 'The :attribute field must only contain letters and numbers.', + 'any_of' => 'The :attribute field is invalid.', + 'array' => 'The :attribute field must be an array.', + 'array_keys' => 'The :attribute field must only contain the following keys: :values.', + 'ascii' => 'The :attribute field must only contain single-byte alphanumeric characters and symbols.', + 'base64' => 'The :attribute field must be a valid Base64 string.', + 'before' => 'The :attribute field must be a date before :date.', + 'before_or_equal' => 'The :attribute field must be a date before or equal to :date.', + 'between' => [ + 'array' => 'The :attribute field must have between :min and :max items.', + 'file' => 'The :attribute field must be between :min and :max kilobytes.', + 'numeric' => 'The :attribute field must be between :min and :max.', + 'string' => 'The :attribute field must be between :min and :max characters.', + ], + 'boolean' => 'The :attribute field must be true or false.', + 'can' => 'The :attribute field contains an unauthorized value.', + 'confirmed' => 'The :attribute field confirmation does not match.', + 'contains' => 'The :attribute field is missing a required value.', + 'current_password' => 'The password is incorrect.', + 'date' => 'The :attribute field must be a valid date.', + 'date_equals' => 'The :attribute field must be a date equal to :date.', + 'date_format' => 'The :attribute field must match the format :format.', + 'decimal' => 'The :attribute field must have :decimal decimal places.', + 'declined' => 'The :attribute field must be declined.', + 'declined_if' => 'The :attribute field must be declined when :other is :value.', + 'different' => 'The :attribute field and :other must be different.', + 'digits' => 'The :attribute field must be :digits digits.', + 'digits_between' => 'The :attribute field must be between :min and :max digits.', + 'dimensions' => 'The :attribute field has invalid image dimensions.', + 'distinct' => 'The :attribute field has a duplicate value.', + 'doesnt_contain' => 'The :attribute field must not contain any of the following: :values.', + 'doesnt_end_with' => 'The :attribute field must not end with one of the following: :values.', + 'doesnt_start_with' => 'The :attribute field must not start with one of the following: :values.', + 'email' => 'The :attribute field must be a valid email address.', + 'encoding' => 'The :attribute field must be encoded in :encoding.', + 'ends_with' => 'The :attribute field must end with one of the following: :values.', + 'enum' => 'The selected :attribute is invalid.', + 'exists' => 'The selected :attribute is invalid.', + 'extensions' => 'The :attribute field must have one of the following extensions: :values.', + 'file' => 'The :attribute field must be a file.', + 'filled' => 'The :attribute field must have a value.', + 'gt' => [ + 'array' => 'The :attribute field must have more than :value items.', + 'file' => 'The :attribute field must be greater than :value kilobytes.', + 'numeric' => 'The :attribute field must be greater than :value.', + 'string' => 'The :attribute field must be greater than :value characters.', + ], + 'gte' => [ + 'array' => 'The :attribute field must have :value items or more.', + 'file' => 'The :attribute field must be greater than or equal to :value kilobytes.', + 'numeric' => 'The :attribute field must be greater than or equal to :value.', + 'string' => 'The :attribute field must be greater than or equal to :value characters.', + ], + 'hex_color' => 'The :attribute field must be a valid hexadecimal color.', + 'image' => 'The :attribute field must be an image.', + 'in' => 'The selected :attribute is invalid.', + 'in_array' => 'The :attribute field must exist in :other.', + 'in_array_keys' => 'The :attribute field must contain at least one of the following keys: :values.', + 'integer' => 'The :attribute field must be an integer.', + 'ip' => 'The :attribute field must be a valid IP address.', + 'ipv4' => 'The :attribute field must be a valid IPv4 address.', + 'ipv6' => 'The :attribute field must be a valid IPv6 address.', + 'json' => 'The :attribute field must be a valid JSON string.', + 'list' => 'The :attribute field must be a list.', + 'lowercase' => 'The :attribute field must be lowercase.', + 'lt' => [ + 'array' => 'The :attribute field must have less than :value items.', + 'file' => 'The :attribute field must be less than :value kilobytes.', + 'numeric' => 'The :attribute field must be less than :value.', + 'string' => 'The :attribute field must be less than :value characters.', + ], + 'lte' => [ + 'array' => 'The :attribute field must not have more than :value items.', + 'file' => 'The :attribute field must be less than or equal to :value kilobytes.', + 'numeric' => 'The :attribute field must be less than or equal to :value.', + 'string' => 'The :attribute field must be less than or equal to :value characters.', + ], + 'mac_address' => 'The :attribute field must be a valid MAC address.', + 'max' => [ + 'array' => 'The :attribute field must not have more than :max items.', + 'file' => 'The :attribute field must not be greater than :max kilobytes.', + 'numeric' => 'The :attribute field must not be greater than :max.', + 'string' => 'The :attribute field must not be greater than :max characters.', + ], + 'max_digits' => 'The :attribute field must not have more than :max digits.', + 'mimes' => 'The :attribute field must be a file of type: :values.', + 'mimetypes' => 'The :attribute field must be a file of type: :values.', + 'min' => [ + 'array' => 'The :attribute field must have at least :min items.', + 'file' => 'The :attribute field must be at least :min kilobytes.', + 'numeric' => 'The :attribute field must be at least :min.', + 'string' => 'The :attribute field must be at least :min characters.', + ], + 'min_digits' => 'The :attribute field must have at least :min digits.', + 'missing' => 'The :attribute field must be missing.', + 'missing_if' => 'The :attribute field must be missing when :other is :value.', + 'missing_unless' => 'The :attribute field must be missing unless :other is :value.', + 'missing_with' => 'The :attribute field must be missing when :values is present.', + 'missing_with_all' => 'The :attribute field must be missing when :values are present.', + 'multiple_of' => 'The :attribute field must be a multiple of :value.', + 'not_in' => 'The selected :attribute is invalid.', + 'not_regex' => 'The :attribute field format is invalid.', + 'numeric' => 'The :attribute field must be a number.', + 'password' => [ + 'letters' => 'The :attribute field must contain at least one letter.', + 'mixed' => 'The :attribute field must contain at least one uppercase and one lowercase letter.', + 'numbers' => 'The :attribute field must contain at least one number.', + 'symbols' => 'The :attribute field must contain at least one symbol.', + 'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.', + ], + 'present' => 'The :attribute field must be present.', + 'present_if' => 'The :attribute field must be present when :other is :value.', + 'present_unless' => 'The :attribute field must be present unless :other is :value.', + 'present_with' => 'The :attribute field must be present when :values is present.', + 'present_with_all' => 'The :attribute field must be present when :values are present.', + 'prohibited' => 'The :attribute field is prohibited.', + 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.', + 'prohibited_if_accepted' => 'The :attribute field is prohibited when :other is accepted.', + 'prohibited_if_declined' => 'The :attribute field is prohibited when :other is declined.', + 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.', + 'prohibits' => 'The :attribute field prohibits :other from being present.', + 'regex' => 'The :attribute field format is invalid.', + 'required' => 'The :attribute field is required.', + 'required_array_keys' => 'The :attribute field must contain entries for: :values.', + 'required_if' => 'The :attribute field is required when :other is :value.', + 'required_if_accepted' => 'The :attribute field is required when :other is accepted.', + 'required_if_declined' => 'The :attribute field is required when :other is declined.', + 'required_unless' => 'The :attribute field is required unless :other is in :values.', + 'required_with' => 'The :attribute field is required when :values is present.', + 'required_with_all' => 'The :attribute field is required when :values are present.', + 'required_without' => 'The :attribute field is required when :values is not present.', + 'required_without_all' => 'The :attribute field is required when none of :values are present.', + 'same' => 'The :attribute field must match :other.', + 'size' => [ + 'array' => 'The :attribute field must contain :size items.', + 'file' => 'The :attribute field must be :size kilobytes.', + 'numeric' => 'The :attribute field must be :size.', + 'string' => 'The :attribute field must be :size characters.', + ], + 'starts_with' => 'The :attribute field must start with one of the following: :values.', + 'string' => 'The :attribute field must be a string.', + 'timezone' => 'The :attribute field must be a valid timezone.', + 'ulid' => 'The :attribute field must be a valid ULID.', + 'unique' => 'The :attribute has already been taken.', + 'uploaded' => 'The :attribute failed to upload.', + 'uppercase' => 'The :attribute field must be uppercase.', + 'url' => 'The :attribute field must be a valid URL.', + 'uuid' => 'The :attribute field must be a valid UUID.', + 'attributes' => [ + 'address' => 'address', + 'affiliate_url' => 'affiliate URL', + 'age' => 'age', + 'amount' => 'amount', + 'announcement' => 'announcement', + 'area' => 'area', + 'audience_prize' => 'audience prize', + 'audience_winner' => 'audience winner', + 'available' => 'available', + 'birthday' => 'birthday', + 'body' => 'body', + 'city' => 'city', + 'color' => 'color', + 'company' => 'company', + 'compilation' => 'compilation', + 'concept' => 'concept', + 'conditions' => 'conditions', + 'content' => 'content', + 'contest' => 'contest', + 'country' => 'country', + 'cover' => 'cover', + 'created_at' => 'created at', + 'creator' => 'creator', + 'currency' => 'currency', + 'current_password' => 'current password', + 'customer' => 'customer', + 'date' => 'date', + 'date_of_birth' => 'date of birth', + 'dates' => 'dates', + 'day' => 'day', + 'deleted_at' => 'deleted at', + 'description' => 'description', + 'display_type' => 'display type', + 'district' => 'district', + 'duration' => 'duration', + 'email' => 'email', + 'excerpt' => 'excerpt', + 'filter' => 'filter', + 'finished_at' => 'finished at', + 'first_name' => 'first name', + 'gender' => 'gender', + 'grand_prize' => 'grand prize', + 'group' => 'group', + 'hour' => 'hour', + 'image' => 'image', + 'image_desktop' => 'desktop image', + 'image_main' => 'main image', + 'image_mobile' => 'mobile image', + 'images' => 'images', + 'is_audience_winner' => 'is audience winner', + 'is_hidden' => 'is hidden', + 'is_subscribed' => 'is subscribed', + 'is_visible' => 'is visible', + 'is_winner' => 'is winner', + 'items' => 'items', + 'key' => 'key', + 'last_name' => 'last name', + 'lesson' => 'lesson', + 'line_address_1' => 'line address 1', + 'line_address_2' => 'line address 2', + 'login' => 'login', + 'message' => 'message', + 'middle_name' => 'middle name', + 'minute' => 'minute', + 'mobile' => 'mobile', + 'month' => 'month', + 'name' => 'name', + 'national_code' => 'national code', + 'number' => 'number', + 'password' => 'password', + 'password_confirmation' => 'password confirmation', + 'phone' => 'phone', + 'photo' => 'photo', + 'portfolio' => 'portfolio', + 'postal_code' => 'postal code', + 'preview' => 'preview', + 'price' => 'price', + 'product_id' => 'product ID', + 'product_uid' => 'product UID', + 'product_uuid' => 'product UUID', + 'promo_code' => 'promo code', + 'province' => 'province', + 'quantity' => 'quantity', + 'reason' => 'reason', + 'recaptcha_response_field' => 'recaptcha response field', + 'referee' => 'referee', + 'referees' => 'referees', + 'region' => 'region', + 'reject_reason' => 'reject reason', + 'remember' => 'remember', + 'restored_at' => 'restored at', + 'result_text_under_image' => 'result text under image', + 'role' => 'role', + 'rule' => 'rule', + 'rules' => 'rules', + 'second' => 'second', + 'sex' => 'sex', + 'shipment' => 'shipment', + 'short_text' => 'short text', + 'size' => 'size', + 'skills' => 'skills', + 'slug' => 'slug', + 'specialization' => 'specialization', + 'started_at' => 'started at', + 'state' => 'state', + 'status' => 'status', + 'street' => 'street', + 'student' => 'student', + 'subject' => 'subject', + 'tag' => 'tag', + 'tags' => 'tags', + 'teacher' => 'teacher', + 'terms' => 'terms', + 'test_description' => 'test description', + 'test_locale' => 'test locale', + 'test_name' => 'test name', + 'text' => 'text', + 'time' => 'time', + 'timezone' => 'timezone', + 'title' => 'title', + 'type' => 'type', + 'updated_at' => 'updated at', + 'user' => 'user', + 'username' => 'username', + 'value' => 'value', + 'winner' => 'winner', + 'work' => 'work', + 'year' => 'year', + ], +]; diff --git a/lang/en/vue.php b/lang/en/vue.php new file mode 100644 index 00000000..a7716fe3 --- /dev/null +++ b/lang/en/vue.php @@ -0,0 +1,44 @@ +<?php + +declare(strict_types=1); + +return [ + 'ImageInputComponent' => [ + 'choose_a_file' => 'Choose a file', + 'change_source_picture' => 'Change source image', + 'view_source_picture' => 'View image', + 'resize_source_picture' => 'Resize image', + 'resized_source_picture' => 'Resized image', + 'preview_picture' => 'Image preview', + 'change_picture_before_import' => 'Edit image before import', + 'close_window' => 'Close window', + 'close_and_validate' => 'Confirm and close window', + 'close_window_without_validation' => 'Close window without saving', + 'zoom_in' => 'Zoom in', + 'zoom_out' => 'Zoom out', + 'move_left' => 'Move left', + 'move_right' => 'Move right', + 'move_up' => 'Move up', + 'move_down' => 'Move down', + 'mirror_horizontal' => 'Flip horizontal', + 'mirror_vertical' => 'Flip vertical', + 'rotation' => 'Rotation', + 'rotate_rewind' => 'Rotate counter-clockwise', + 'rotate' => 'Rotate clockwise', + 'degres' => ':deg degrees', + 'validate' => 'Validate', + 'preview' => 'Preview', + 'reset_image' => 'Reset image', + 'width' => 'width :valuepx', + 'height' => 'height :valuepx', + 'remove_picture' => 'Remove image', + ], + 'WordCounterComponent' => [ + 'words' => 'Words', + 'characters' => 'Characters', + ], + 'PasswordVisibility' => [ + 'hide' => 'Hide password', + 'show' => 'Show password', + ], +]; diff --git a/lang/fr.json b/lang/fr.json new file mode 100644 index 00000000..cf44c934 --- /dev/null +++ b/lang/fr.json @@ -0,0 +1,868 @@ +{ + "(and :count more error)": "(et :count erreur en plus)", + "(and :count more errors)": "(et :count erreur en plus)|(et :count erreurs en plus)|(et :count erreurs en plus)", + "- at least one lowercase letter": "- au moins une minuscule", + "- at least one number": "- au moins un chiffre", + "- at least one special character.": "- au moins un caractère spécial.", + "- at least one uppercase letter": "- au moins une majuscule", + "- minimum 8 characters": "- minimum 8 caractères", + ":appname - An order was placed": ":appname - Une commande a été passée", + ":field :inter:model": ":field :inter:model", + ":name logo": "Logo :name", + ":name site logo": "Logo du site :name", + ":time before order taking closes - :appname": ":time avant la clôture des prises de commande - :appname", + ":title A wide selection :/title :desc Quality products, a variety of options, portion sizes to suit your needs... :/desc": ":title Un large choix :/title :desc Des produits de qualité, des préparations variées, des quantités adaptées... :/desc", + ":title Convenient and fast :/title :desc What could be better than ordering online to save time? :/desc": ":title Pratique et rapide :/title :desc Quoi de mieux que la commande en ligne pour gagner du temps ? :/desc", + ":title Freshness & Quality :/title :desc Your order is carefully prepared, with strict adherence to the cold chain :/desc": ":title Fraicheur & Qualité :/title :desc Votre commande est préparée avec soin, dans le plus grand respect de la chaîne du froid :/desc", + ":title Pick up your order :/title :desc :/desc": ":title Retirez :/title :desc votre commande :/desc", + ":title Save money :/title :desc Get even more out of our gourmet products by buying directly :/desc": ":title Des économies :/title :desc Profitez encore plus de nos produits gourmands en achetant en direct :/desc", + ":title Select :/title :desc your products online :/desc": ":title Sélectionnez :/title :desc vos produits en ligne :/desc", + ":title Select :/title :desc your pickup day :/desc": ":title Choisissez :/title :desc votre jour de retrait :/desc", + "A confirmation has just been sent to your email address": "Une confirmation vient de vous être envoyée sur votre adresse e-mail", + "A decryption key is required.": "Une clé de déchiffrement est requise.", + "A fresh verification link has been sent to your email address.": "Un nouveau lien de vérification a été envoyé à votre adresse e-mail.", + "A Timeout Occurred": "Temps d'attente dépassé", + "About": "Environ", + "Accept": "Accepter", + "Accepted": "Accepté", + "Access the shop": "Accéder à la boutique", + "Account blocked. Please contact your HR department or the St Laurent switchboard at :phone": "Compte bloqué. Veuillez contacter votre RH ou le standard St Laurent au :phone", + "Action": "Action", + "Action failed": "L'action à échoué", + "Actions": "Actions", + "Activation": "Activation", + "Activation of your previously created account.": "Activation de votre compte précédemment créé.", + "Add": "Ajouter", + "Add :name": "Ajouter :name", + "Add a reminder to my calendar to place my order on :reminderDay at :reminderTime (Attached ICS file)": "Ajouter un rappel à mon agenda pour passer ma commande le :reminderDay à :reminderTime (Fichier en pièce jointe)", + "Add a site": "Ajouter un site", + "Add one": "En ajouter un", + "Add to Basket": "Ajouter au panier", + "add_joinedfile": "Ajouter un fichier", + "Added :amount to basket": ":amount ajouté(s) au panier", + "Address": "Adresse", + "Admin": "Administrateur", + "Agree": "Accepter", + "Aisles": "Rayons", + "All aisles": "Tous les rayons", + "All discounts": "Toutes les promotions", + "All products have been selected.": "Tous les produits ont été sélectionnés.", + "All rights reserved.": "Tous droits réservés.", + "Allergens": "Allergènes", + "Already registered?": "Déjà inscrit ?", + "Already Reported": "Déjà rapporté", + "An account is already associated with this email address": "Un compte est déjà associé à cette adresse e-mail", + "An employee sync is already in progress.": "Une synchronisation des salariés est déjà en cours.", + "An error has occurred.": "Une erreur est survenue.", + "An error has occurred. Please try again later": "Une erreur est survenue, merci de réessayer ultérieurement", + "An error occurred while fetching the preview.": "Une erreur est survenue lors de la récupération de la prévisualisation.", + "An error occurred, please try again later.": "Une erreur est survenue, merci de réessayer ultérieurement", + "An error occurred, please try again with a new activation link.": "Une erreur est survenue, veuillez réessayer avec un nouveau lien d'activation.", + "An order was placed": "Une commande a été passée", + "and the": "et la", + "Approximately": "Environ", + "Arcadia API error: :error": "Erreur de l'API Arcadia : :error", + "Arcadia INCO Sheet": "Fiche INCO Arcadia", + "Arcadia INCO Sheet Preview": "Prévisualisation de la fiche INCO Arcadia", + "Archive": "Archive", + "Are you sure you want to empty your basket?": "Voulez-vous réellement vider votre panier ?", + "Are you sure?": "Êtes-vous sûr ?", + "Artist cat": "Chat artiste", + "Assign": "Attribuer", + "Associate": "Associé", + "Associate an INCO sheet from the Arcadia API by entering the article number.": "Associez une fiche INCO depuis l'API Arcadia en saisissant le numéro d'article.", + "Associate INCO sheet": "Associer une fiche INCO", + "Associated INCO Sheet": "Fiche INCO associée", + "Associated products": "Produits associés", + "Associating this INCO sheet will replace the currently linked INCO sheet for this product.": "L'association de cette fiche remplacera la fiche INCO actuellement liée à ce produit.", + "at the following address": "à l'adresse suivante", + "Attach": "Attacher", + "Attachement filename": "Nom du fichier joint", + "Attachment": "Pièce jointe", + "Automated message": "Message automatisé", + "Available days": "Jours disponibles", + "Available products": "Produits disponibles", + "Average nutritional values": "Valeurs nutritionnelles moyennes", + "Average product weight": "Poids moyen du produit", + "Back": "Retour", + "Back to :page": "Retour sur :page", + "Back to basket": "Retour au panier", + "Back to shop": "Retour à la boutique", + "Bad Gateway": "Passerelle invalide", + "Bad Request": "Requête erronée", + "Bandwidth Limit Exceeded": "Limite de bande passante dépassée", + "Base unit used to calculate the sales unit of this product.": "Unité de base permettant de calculer l'unité de vente de ce produit.", + "Base unit used to determine the price": "Unité de base permettant d'établir le prix", + "Basket has been cleared": "Le panier a été vidé", + "Basket Summary": "Récapitulatif de votre panier", + "Before proceeding, please check your email for a verification link.": "Avant de continuer, merci de vérifier votre e-mail contenant un lien de vérification.", + "Blocked week": "Semaine bloquée", + "Booking": "Réservation", + "Brand": "Marque", + "Breadcrumb": "Fil d'Ariane", + "Browse": "Parcourir", + "buy_place": "Lieu d'achat", + "Call the :phone": "Appeler le :phone", + "Cancel": "Annuler", + "Cancel the order": "Annuler la commande", + "Carbohydrates": "Glucides", + "Catalog": "Catalogue", + "Change my password": "Changer mon mot de passe", + "Change your password.": "Changement de votre mot de passe.", + "Changes saved!": "Modifications enregistrées !", + "Check all collection exceptions that concern this store. Use the options button to configure postponements if necessary.": "Cochez toutes les exceptions de collecte qui concernent ce magasin. Utilisez le bouton d'options pour configurer les reports si nécessaire.", + "Check all your information before confirming.": "Vérifiez toutes vos informations avant de confirmer.", + "Check and confirm the content of your order before continuing.": "Vérifiez et validez le contenu de votre commande avant de poursuivre.", + "Check if this event repeats over time.": "Cochez si cet événement se répète dans le temps.", + "Check to highlight the product": "Cochez pour mettre en avant le produit", + "Check to publish the exception": "Cochez pour publier l'exception", + "Check to publish the product": "Cochez pour publier le produit", + "Check to publish the range": "Cochez pour publier la gamme", + "Check to publish the tag": "Cochez pour publier l'étiquette", + "Check to restrict access": "Cochez pour restreindre l'accès", + "Check to restrict display to logged-in members.": "Cochez pour restreindre l'affichage aux membres connectés.", + "Choose": "Choisir", + "Choose :name": "Choisir :name", + "Choose File": "Choisir le fichier", + "Choose Image": "Choisir une image", + "Choose slide": "Choisir la diapositive", + "Choose your new password.": "Choisissez votre nouveau mot de passe.", + "City": "Ville", + "civilty": "Civilité", + "Clear": "Vider", + "Clear sorting": "Effacer le tri", + "click here to request another": "cliquez ici pour en demander un autre", + "Click on the map to place or move the pickup point.": "Cliquez sur la carte pour placer ou déplacer le point de retrait.", + "Click to copy": "Cliquer pour copier", + "Client Closed Request": "Demande fermée par le client", + "Close": "Fermer", + "Collapse": "Réduire", + "Collapse All": "Réduire tout", + "Collection date": "Date de collecte", + "Collection details": "Détails du retrait", + "Collection information": "Informations de retrait", + "Collection point": "Point de retrait", + "Coming soon": "Bientôt disponible", + "Comment": "Commentaire", + "Company information": "Informations de l'entreprise", + "complain": "Réclamation Produit", + "Complete content of the page.": "Contenu complet de la page.", + "Complete content of the range.": "Contenu complet de la gamme.", + "Complete list of shop products.": "Liste complète des produits de la boutique.", + "Complete your order": "Finaliser votre commande", + "Completely empty the basket": "Vider intégralement le panier", + "Composition & Preparation": "Composition & Préparation", + "Confirm": "Confirmer", + "Confirm association": "Confirmer l'association", + "Confirm order": "Confirmer la commande", + "Confirm Password": "Confirmer le mot de passe", + "Confirm pickup": "Valider le retrait", + "Confirmation": "Confirmation", + "Conflict": "Conflit", + "Connect": "Connecter", + "Connected": "Connecté", + "Connected members only": "Membres connectés uniquement", + "Connection Closed Without Response": "Connexion fermée sans réponse", + "Connection Timed Out": "La connexion a expiré", + "Consumer sales unit": "Unité de vente consommateur", + "consumption_date": "Date de consommation", + "Contact": "Contact", + "Contact form": "Formulaire de contact", + "Contact Information": "Coordonnées & Contact", + "Contact Message": "Message de contact", + "Contact us": "Contactez-nous", + "contact us": "contactez-nous", + "Content": "Contenus", + "Continue": "Continuer", + "Cookie Management": "Gestion des cookies", + "coord_please_complete": "Merci de compléter correctement les champs du formulaire.", + "Create": "Créer", + "Create :name": "Créer :name", + "Created": "Créé", + "creation": "création", + "CRM data": "Données CRM", + "Current period": "Période actuelle", + "Current price": "Prix actuel", + "Daily Intake (% RI)": "Apport Jour. (% AR)", + "Dashboard": "Tableau de bord", + "data_size_mo": ":datasize Mo", + "Date": "Date", + "Date of birth": "Date de naissance", + "Day": "Jour", + "days": "jours", + "Default pickup point": "Point de retrait par défaut", + "Define one code per employee site (at least 2 uppercase letters, e.g. PA, NA, LY). These codes are used to query the Arcadia HR IS and synchronize employees in the employee store.": "Définissez un code par site salarié (au moins 2 lettres majuscules, ex: PA, NA, LY). Ces codes sont utilisés pour interroger le SI RH Arcadia et synchroniser les employés dans la boutique salariés.", + "Delete": "Supprimer", + "Delete :name": "Supprimer :name", + "Delete :name from the basket": "Supprimer :name du panier", + "Delete this site": "Supprimer ce site", + "Deleting this item will also delete all associated items. You will not be able to undo this action. Do you really want to continue?": "Supprimer cet élément va aussi supprimer tous les éléments associés. Vous ne pourrez pas annuler cette action. Voulez-vous vraiment continuer ?", + "Description (HTML)": "Description (HTML)", + "Designation": "Désignation", + "Detach": "Détacher", + "Details": "Détails", + "Dietary fiber": "Fibres alimentaires", + "Difference": "Différence", + "Disable": "Désactiver", + "Discard": "Jeter", + "Discounted unit price (excluding tax)": "Prix unitaire remisé HT", + "Discover our products": "Découvrir nos produits", + "Do you really want to cancel this item?": "Voulez-vous vraiment annuler cet élément ?", + "Do you really want to delete this item?": "Voulez-vous vraiment supprimer cet élément ?", + "Do you really want to mark this item as processed?": "Voulez-vous vraiment marquer cet élément comme traité ?", + "Do you want to save this item as is?": "Voulez-vous enregistrer cet élément tel-quel ?", + "Done": "Fait", + "Down": "Descendre", + "Download example file": "Télecharger le fichier d'exemple", + "Drag and drop products to associate them.": "Glissez et déposez les produits pour les associer.", + "Drag products here to select them.": "Glissez des produits ici pour les sélectionner.", + "Duplicate": "Dupliquer", + "Duplicate :name": "Dupliquer :name", + "Edit": "Éditer", + "Edit :name": "Modifier :name", + "email": "E-mail", + "Email Address": "Adresse e-mail", + "Employee site codes (Arcadia)": "Codes des sites des salariés (Arcadia)", + "Employee sites": "Sites des salariés", + "Employees Sync": "Syncronisation des salariés", + "Empty Basket": "Vider le panier", + "Enable": "Activer", + "Encrypted environment file already exists.": "Le fichier d'environnement chiffré existe déjà.", + "Encrypted environment file not found.": "Fichier d'environnement chiffré introuvable.", + "End date": "Date de fin", + "End date of the previous period": "Date de fin de la période précédente", + "Energy": "Énergie", + "Energy (kJ / kcal)": "Énergie (kJ / kcal)", + "Enter the Arcadia INCO article number": "Saisissez le numéro d'article INCO Arcadia", + "Environment file already exists.": "Le fichier d'environnement existe déjà.", + "Environment file not found.": "Fichier d'environnement introuvable.", + "Error confirmation": "Confirmation d'erreur", + "Error list": "Liste des erreurs", + "errors": "les erreurs", + "Estimated order total": "Total estimé de la commande", + "Estimated total": "Total estimé", + "Estimated total incl. tax": "Total estimé TTC", + "Ex: 2 people": "Ex: 2 personnes", + "Ex: Holiday, Exceptional closure...": "Ex: Férié, Fermeture exceptionnelle...", + "Exception information": "Informations de l'exception", + "Expand": "Développer", + "Expand All": "Développer tout", + "Expectation Failed": "Comportement attendu insatisfaisant", + "Explanation": "Explication", + "Export": "Exporter", + "Export :name": "Exporter :name", + "Facility": "Établissement", + "Failed Dependency": "Dépendance échouée", + "Failed to add item to basket": "Impossible d'ajouter l'article au panier", + "Failed to clear the basket": "Impossible de vider le panier", + "Failed to fetch products": "Échec de la récupération des produits", + "Failed to fetch the basket": "Impossible de récupérer le panier", + "Failed to remove item from basket": "Impossible de retirer l'article du panier", + "FAQ": "FAQ", + "Fat": "Matières grasses", + "Featured Products Slider": "Carrousel des produits phares", + "Fetching data from Arcadia API...": "Récupération des données depuis l'API Arcadia...", + "File": "Déposer", + "Files": "Des dossiers", + "Filter by :value": "Filtrer par :value", + "Filters": "Filtres", + "Final order validation": "Validation finale de la commande", + "Final Validation": "Validation Finale", + "First csv line shall be :importColumns": "La première ligne du fichier CSV doit être : :importColumns", + "First name": "Prénom", + "firstname": "Prénom", + "For any questions related to your order, please contact reception by phone or via our section": "Pour toutes questions liées à votre commande, merci de contacter l'accueil par téléphone ou par notre rubrique", + "For any questions,": "Pour toutes questions,", + "Forbidden": "Interdit", + "Forgot password": "Mot de passe oublié", + "Forgot password procedure": "Procédure d'oubli de mot de passe", + "Forgot Your Password?": "Mot de passe oublié ?", + "format_joinedfile": "Formats acceptés", + "Found": "Trouvé", + "French public holidays are automatically provisioned and associated with stores": "Les jours fériés Français sont automatiquement provisionnés et associés aux boutiques", + "Frequency": "Fréquence", + "Frequently asked questions.": "Foire aux questions fréquemment posées.", + "from": "de", + "from :date": "du :date", + "From date": "Du", + "Gateway Timeout": "Temps d'attente de la passerelle dépassé", + "general conditions": "conditions générales", + "General Information": "Informations générales", + "General Information & Nutriscore": "Informations générales & Nutriscore", + "general terms": "conditions générales", + "General terms and conditions of sale": "Conditions Générales de Vente", + "general terms and conditions of sale": "conditions générales de vente", + "General terms and conditions of sale of the shop.": "Conditions générales de vente de la boutique.", + "Give the product a short description": "Donnez une courte description au produit", + "Give this exception an explicit name.": "Donnez un nom explicite à cette exception.", + "Give your faq a title.": "Donnez un titre à votre faq.", + "Give your keyword a label.": "Donnez un libellé à votre mot clé.", + "Give your product a name.": "Donnez un nom à votre produit.", + "Give your range a title.": "Donnez un titre à votre gamme.", + "Give your slide a title.": "Donnez un titre à votre slide.", + "Go Home": "Aller à l'accueil", + "Go to page :page": "Aller à la page :page", + "Go to website": "Voir le site", + "Gone": "Disparu", + "GPS & Maps Coordinates": "Coordonnées GPS & Maps", + "Hello": "Bonjour", + "Hello!": "Bonjour !", + "Here is a message sent from :app_name.": "Voici un message envoyé depuis :app_name.", + "Here, the arrows are used to sort and not to filter": "Ici, les flèches servent à trier et non pas à filtrer", + "Hide": "Cacher", + "Hide :name": "Cacher :name", + "Highlight": "Mettre en avant", + "Home": "Accueil", + "HTTP Version Not Supported": "Version HTTP non prise en charge", + "https://...": "https://...", + "I consent to receive news and deals from :name": "J'accepte de recevoir les actualités et bons plans :name", + "I have read and accept the": "J'ai lu et j'accepte les", + "I have read and accept the :terms": "J'ai lu et j'accepte les :terms", + "I have read and accept the :terms and the :privacy": "J'ai lu et accepte les :terms et la :privacy", + "I wish to subscribe to the newsletter": "Je souhaite m'inscrire à la newsletter", + "I'm a teapot": "Je suis une théière", + "If you did not create an account, no further action is required.": "Si vous n'avez pas créé de compte, vous pouvez ignorer ce message.", + "If you did not receive the email": "Si vous n'avez pas reçu cet e-mail", + "If you did not request a password reset, no further action is required.": "Si vous n'avez pas demandé de réinitialisation de mot de passe, vous pouvez ignorer ce message.", + "If you need to you can always <a href=\"mailto::email\">contact us</a>, otherwise we’ll be back online shortly!": "Si besoin vous pouvez toujours nous <a href=\"mailto::email\">contacter</a>, sinon nous serons de retour bientôt", + "If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "Si vous avez des difficultés à cliquer sur le bouton \":actionText\", copiez et collez l'URL ci-dessous\ndans votre navigateur Web :", + "IM Used": "IM utilisé", + "Image": "Image", + "Image of a cat playing a grand piano": "Image d'un chat qui joue du piano à queue", + "Impersonate": "Utiliser un autre compte", + "Impersonation": "Imitation", + "Import": "Importer", + "Import :name": "Importer :name", + "In order to give us time to prepare your products, order taking at the shop ends today at :closureTime for a delivery on :date at your usual collection point.": "Afin de nous laisser du temps pour préparer vos produits, la prise de commande de la boutique de cocotte se termine aujourd'hui à :closureTime pour une livraison le :date dans votre point de retrait habituel.", + "INCO article number": "Numéro d'article INCO", + "INCO sheet was not found on Arcadia API.": "La fiche INCO est introuvable sur l'API Arcadia.", + "Ingredients": "Liste d'ingrédients", + "Insufficient Storage": "Espace insuffisant", + "Internal Server Error": "Erreur interne du serveur", + "Introduction": "Introduction", + "Invalid filename.": "Nom de fichier incorrect.", + "Invalid JSON was returned from the route.": "Un JSON non valide a été renvoyé par la route.", + "Invalid or unavailable time slot": "Créneau invalide ou indisponible", + "Invalid SSL Certificate": "Certificat SSL invalide", + "is": "est", + "is confirmed and ready.": "est confirmée et prête.", + "is confirmed.": "est confirmée.", + "It seems you haven't added anything to your basket yet.": "Il semble que vous n'ayez encore rien ajouté à votre panier.", + "Item": "Élément", + "Item removed from basket": "Article retiré du panier", + "jj": "jj", + "joinedfile": "Pièce jointe", + "JPEG/PNG, 2MB max.": "JPEG/PNG, 2Mo max.", + "JPEG/PNG, 2MB max. Recommended dimensions: :width px by :height px": "JPEG/PNG, 2Mo max. Dimensions conseillées : :width px par :height px", + "JPEG/PNG, 2Mo max.": "JPEG/PNG, 2Mo max.", + "Kcal": "Kcal", + "Keyword information": "Informations du mot clé", + "Keywords associated with the product": "Les mots clés associés au produit", + "Kj": "Kj", + "L'ancien mot de passe ne correspond pas.": "L'ancien mot de passe ne correspond pas.", + "Label": "Libellé", + "Last name": "Nom", + "Last sync: :date": "Dernière synchronisation : :date", + "lastname": "Nom", + "Le lien de désinscription est invalide": "Le lien de désinscription est invalide", + "Learn more...": "En savoir plus...", + "Leave empty for immediate display": "Laisser vide pour un affichage immédiat", + "Leave empty for permanent display": "Laisser vide pour un affichage permanent", + "Legal Notice & TOU": "Mentions légales & CGU", + "Legal notice and terms of use of the shop.": "Mentions légales et conditions générales d'utilisation de la boutique.", + "length": "longueur", + "Length Required": "Longueur requise", + "Like": "Aimer", + "limit_date": "Date limite de consommation", + "Link options": "Options de lien", + "List of products in your basket": "Liste des produits dans votre panier", + "Load": "Charger", + "Loading": "Chargement", + "Loading more": "Chargement supplémentaire", + "Loading...": "Chargement...", + "Localize": "Localiser", + "Location": "Emplacement", + "Location on the map": "Emplacement sur la carte", + "Locked": "Verrouillé", + "Log In": "Se connecter", + "Log in": "Connectez-vous", + "Log Out": "Se déconnecter", + "Login": "Connexion", + "Login to your personal account.": "Connexion à votre compte personnel.", + "Logout": "Déconnexion", + "Loop Detected": "Boucle détectée", + "lot_number": "N° de lot figurant à coté de la date", + "lot_number_tip": "Vous pouvez également trouver le n° de lot sous la dénomination \"n° de tracabilité\" ou \"n° trac\".", + "Main content (HTML)": "Contenu principal (HTML)", + "Main Slider": "Carrousel principal", + "Maintenance Mode": "Mode de maintenance", + "Mandatory fields": "Champs obligatoires", + "mandatory_fields": "Champs obligatoires", + "max_joinedfile_size": "Taille max", + "Maximum number of elements reached.": "Nombre d'éléments maximal atteint.", + "Media (Images)": "Médias (Images)", + "Membership rate": "Taux d'adhésion", + "Merchandising": "Merchandising", + "Message": "Message", + "Message subject": "Objet du message", + "message_contact_failed": "Une erreur est survenue durant l'envoi de votre message. Veuillez réessayer ultèrieurement.", + "message_contact_send": "Votre message a été envoyé avec succès.", + "Method Not Allowed": "Méthode non autorisée", + "Minimum number of elements reached.": "Nombre d'éléments minimal atteint.", + "Misdirected Request": "Demande mal dirigée", + "mm": "mm", + "Month": "Mois", + "Moved Permanently": "Déplacé de façon permanente", + "Multi-Status": "Statut multiple", + "Multiple Choices": "Choix multiples", + "Must accurately describe the page content (<meta> description tag).": "Doit décrire précisément le contenu de la page (balise <meta> description).", + "Must accurately describe the page, recommendation for optimal search engine positioning (<title> tag).": "Doit décrire précisément la page, recommandation pour un positionnement optimal dans les moteurs de recherche (balise <title>).", + "Must accurately describe the page, recommended for optimal search engine positioning (<title> tag).": "Doit décrire précisément la page, recommandation pour un positionnement\n optimal dans les moteurs de recherche (balise <title>).", + "My Account": "Mon compte", + "My collection point": "Mon point de retrait", + "My details": "Mes coordonnées", + "My Orders": "Mes Commandes", + "My pickup point :name, :address, :postcode :city": "Mon point de retrait :name, :address, :postcode :city", + "my_coord": "Mes coordonnées", + "Name": "Nom", + "NB": "NB", + "Network Authentication Required": "Authentification réseau requise", + "Network Connect Timeout Error": "Temps d'attente de la connexion réseau dépassé", + "Network Read Timeout Error": "Temps d'attente de la lecture réseau dépassé", + "Never": "Jamais", + "New": "Nouveau", + "New :name": "Nouveau :name", + "New order from :firstname :lastname - :appname": "Nouvelle commande de :firstname :lastname - :appname", + "New order registered!": "Nouvelle commande enregistrée !", + "New password": "Nouveau mot de passe", + "Newsletter unsubscription": "Désinscription à la newsletter", + "No": "Non", + "No account was found for this email address": "Aucun compte n'a été trouvé pour cette adresse e-mail", + "No account yet?": "Pas encore de compte ?", + "No Content": "Pas de contenu", + "No INCO sheet currently associated with this product.": "Aucune fiche INCO actuellement associée à ce produit.", + "No INCO sheet found on Arcadia for this article number.": "Aucune fiche INCO trouvée sur Arcadia pour ce numéro d'article.", + "No INCO sheet is currently associated with this product.": "Aucune fiche INCO n'est actuellement associée à ce produit.", + "No pickup days available at the moment": "Aucun jour de retrait disponible pour le moment", + "No pickup exception has been created for now.": "Aucune exception de retrait n'a été créée pour le moment.", + "No picture available": "Aucune image disponible", + "No product matches your search.": "Aucun produit ne correspond à votre recherche.", + "No replacement date configured": "Pas de jour de remplacement configuré", + "No results found.": "Aucun résultat trouvé.", + "No site configured. Click the button below to add a site.": "Aucun site configuré. Cliquez sur le bouton ci-dessous pour ajouter un site.", + "No substitute days have been set up. No time slots will be generated for this week.": "Aucun jour de remplacement configuré. Aucun créneau ne sera généré pour cette semaine.", + "Non-Authoritative Information": "Informations non certifiées", + "None": "Aucun", + "Not Acceptable": "Pas acceptable", + "Not Extended": "Non prolongé", + "Not Found": "Non trouvé", + "Not Implemented": "Non implémenté", + "Not Modified": "Non modifié", + "Not visible": "Non visible", + "Number of employees": "Nombre de salariés", + "Number of registered employees": "Nombre de salariés inscrits", + "Nutrient": "Nutriment", + "Nutriscore": "Nutriscore", + "Nutriscore arguments": "Arguments Nutriscore", + "Nutritional Values": "Valeurs nutritionnelles", + "Nutritional values": "Valeurs nutritionnelles", + "of": "de", + "of employees": "des salariés", + "Of which saturated fatty acids": "dont acides gras saturés", + "of which saturated fatty acids": "dont acides gras saturés", + "of which sugars": "dont sucres", + "Offers": "Offres", + "Offers Slider": "Carrousel des offres", + "Oh no": "Oh non", + "OK": "OK", + "Old password": "Ancien mot de passe", + "On": "Le", + "Oops! An error occurred...": "Oups ! Une erreur s'est produite...", + "Open": "Ouvrir", + "Open in a current window": "Ouvrir dans une fenêtre actuelle", + "Open in a new window": "Ouvrir dans une nouvelle fenêtre", + "Open in a parent frame": "Ouvrir dans un cadre parent", + "Open in the topmost frame": "Ouvrir dans le cadre le plus haut", + "Open on the website": "Ouvrir sur le site", + "Order": "Commander", + "Order cancelled": "Commande annulée", + "Order data": "Données de la commande", + "Order detail of :date": "Détail de votre commande du :date", + "Order details": "Détails de la commande", + "Order number": "Numéro de commande", + "Order period": "Période de commande", + "Order Reference": "Référence de commande", + "Order reservation": "Réservation de commande", + "Order status": "Etat de votre commande", + "Order summary": "Récapitulatif de commande", + "Order validation": "Validation de commande", + "Origin Is Unreachable": "L'origine est inaccessible", + "Original price": "Prix d'origine", + "Our team will do their best to reply as soon as possible.": "Nos services mettent tout en oeuvre pour y répondre au plus vite.", + "Page Expired": "Page expirée", + "Page title (can be empty for some keys).": "Titre de la page (peut être vide pour certaines clés).", + "Pagination Navigation": "Pagination", + "Partial Content": "Contenu partiel", + "Password": "Mot de passe", + "Password updated": "Mot de passe mis à jour", + "Payload Too Large": "Charge utile trop grande", + "Payment Required": "Paiement requis", + "Per": "Pour", + "Per 100g / Ref": "Pour 100g / Réf", + "Per Serving": "Par portion", + "Permanent Redirect": "Redirection permanente", + "Personal account": "Votre compte", + "personal data management policy": "politique de gestion des données personnelles", + "personal data policy": "politique de gestion des données personnelles", + "Phone": "Téléphone", + "Pickup day": "Jour de retrait", + "Pickup Locations": "Point de retrait|Points de retraits", + "Pickup on :day, at the following address:": "A retirer le :day, à l'adresse suivante :", + "Pickup point name": "Nom du point de retrait", + "Place my order :appname": "Passer ma commande :appname", + "Placeholder": "Placeholder", + "Please check your email, if we know you you should receive a reset link": "Veuillez vérifier votre boite e-mail, dans le cas où nous vous connaisson vous devriez recevoir un lien de réinitialisation", + "Please click the button below to verify your email address.": "Veuillez cliquer sur le bouton ci-dessous pour vérifier votre adresse e-mail :", + "Please confirm your password before continuing.": "Veuillez confirmer votre mot de passe avant de continuer.", + "Please contact your HR department for your access code": "Merci de vous rapprocher de votre service RH pour connaître votre code d'accès", + "Please contact your HR department to get your single-use registration code.": "Merci de vous rapprocher de votre service RH pour connaître votre code d'inscription à usage unique.", + "Please enter a period to view statistics": "Veuillez renseigner une période afin de visualiser les statistiques", + "Please enter an article number.": "Veuillez saisir un numéro d'article.", + "Please enter your employee number (available on your payslip), 7 characters long (e.g. v00115590->0115590).": "Merci de renseigner votre matricule (disponible sur votre bulletin de salaire), sur 7 caractères (ex : v00115590->0115590).", + "Please log in to continue.": "Veuillez vous connecter pour continuer.", + "Please note: The scheduled postponement is a one-time event and will not repeat automatically.": "Attention : le report configuré est ponctuel et ne se répétera pas automatiquement.", + "Portion Size": "Taille de la portion", + "postal": "Code postal", + "Postal address": "Adresse postale", + "Precondition Failed": "La précondition a échoué", + "Precondition Required": "Condition préalable requise", + "Preparation": "Préparation", + "Preparation advice": "Conseil de préparation", + "Preview": "Aperçu", + "Preview and Associate": "Prévisualiser et associer", + "Preview Arcadia INCO": "Prévisualiser la fiche Arcadia", + "Previous period": "Période précédente", + "Price": "Prix", + "Price per kg (incl. tax)": "Prix au KG TTC", + "Price per kilo": "Prix kilo", + "Price per kilo TTC": "Prix kilo TTC", + "Price per pound": "Prix au kilo", + "Pricing, Stock & Units": "Tarification, Stock & Unités", + "Privacy Policy": "Politique de confidentialité", + "Privacy policy of the shop.": "Politique de confidentialité de la boutique.", + "Procedure to contact the store managers.": "Procédure pour contacter les responsables de la boutique.", + "Procedure to recover the password linked to your account.": "Procédure afin de retrouver son mot de passe lié à son compte.", + "Proceed to the next step": "Faire passer la commande à l'étape suivant", + "Processing": "En traitement", + "Processing your order": "Traitement de votre commande", + "Product": "Produit", + "Product brand": "Marque du produit", + "Product details": "Détails du produit", + "Product picture": "Image du produit", + "Product sold by the kilo": "Produit vendu au kilo", + "Product sold by the kilo. The price will be recalculated based on the weight of the product delivered when your order is handed over. The price is therefore subject to variation on your invoice.": "Produit vendu au kilo. Le prix sera recalculé en fonction du poids du produit livré lors de la remise de votre commande. Le prix est donc susceptible de varier sur votre facture.", + "product_code": "Code barre du produit concerné", + "product_name": "Nom du produit", + "Products": "Produits", + "Promotion configuration": "Configuration de la promotion", + "propose_recipe": "Proposez votre recette", + "Proteins": "Protéines", + "Proxy Authentication Required": "Authentification proxy requise", + "Publication period": "Période de parution", + "Published": "Publié", + "Quantity": "Quantité", + "Quantity controls": "Contrôle de la quantité", + "Quantity in Basket": "Quantité dans le panier", + "question_concern": "Votre question concerne", + "Railgun Error": "Erreur de Railgun", + "Range": "Plage", + "Range information": "Informations de la gamme", + "Range Not Satisfiable": "Plage non satisfaisante", + "Record": "Enregistrer", + "Recurrence options": "Options de récurrence", + "ref: :reference": "réf: :reference", + "Reference": "Référence", + "Reference Daily Intakes for an adult (8400kj/2000kcal).": "Apports Quotidiens de référence pour un adulte (8400kj/2000kcal).", + "Reference Weight": "Poids de référence", + "Regards,": "Cordialement,", + "Register": "Inscription", + "Registration procedure for the shop.": "Procédure d'inscription à la boutique.", + "Remember Me": "Se souvenir de moi", + "Remember to validate your order before :closureTime on :url": "Pensez à valider votre commande avant :closureTime sur :url", + "Remember to validate your order on :url": "Pensez à bien valider votre commande sur :url", + "Reminder of your order ref: :ref": "Rappel de votre commande ref: :ref", + "Remove from Basket": "Retirer du panier", + "Removed :amount from basket": ":amount retiré(s) du panier", + "Repeatable": "Répétable", + "Repeatable exception": "Exception répétable", + "Replacement date :date": "Date de remplacement :date", + "report_abuse": "Signaler un abus", + "report_abuse_message": "Je souhaite signaler le message de :username car cet utilisateur ne respecte pas les conditions d'utilisation du Club des Gaulois.\n\nCordialement", + "Request Header Fields Too Large": "Champs d'en-tête de requête trop grands", + "Request Timeout": "Temps d'attente de la requête dépassé", + "Reservation": "Réservation", + "Reservation of your order": "Réservation de votre commande", + "Reset": "Réinitialiser", + "Reset Content": "Réinitialiser le contenu", + "Reset filters": "Réinitialiser les filtres", + "Reset Password": "Réinitialisation du mot de passe", + "Reset Password Notification": "Notification de réinitialisation du mot de passe", + "Reset your password": "Réinitialiser votre mot de passe", + "Restore": "Restaurer", + "Restore :name": "Restaurer :name", + "results": "résultats", + "Retry With": "Réessayer avec", + "Return to home": "Revenir à l'accueil", + "Salary export - :appname": "Export salariés - :appname", + "Salt": "Sel", + "Sat. %": "Sat. %", + "Saturated": "Saturées", + "Save": "Sauvegarder", + "Save & Close": "Sauvegarder et fermer", + "Save & Return": "Sauvegarder et retourner", + "Save :name": "Sauvegarder :name", + "Search": "Rechercher", + "Search :name": "Chercher :name", + "Search using a date range": "Rechercher en utilisant une plage de dates", + "Search...": "Rechercher...", + "See all aisles": "Voir tous les rayons", + "See all offers": "Voir toutes les offres", + "See nutritional values": "Voir les valeurs nutritionnelles", + "See Other": "Voir autre", + "See the :range aisle": "Voir le rayon :range", + "See the aisle": "Voir le rayon", + "See the list of ingredients": "Voir la liste des ingrédients", + "Select": "Sélectionner", + "Select All": "Tout sélectionner", + "Select the date of this exception.": "Sélectionnez la date de cette exception.", + "Select the frequency if the event is repeatable (Default: Weekly).": "Sélectionnez la fréquence si l'événement est répétable (Par défaut: Hebdomadaire).", + "Select the frequency if the subscription concerns specific days.": "Sélectionnez la fréquence si l'abonnement concerne des jours précis.", + "Select the row": "Selectionner la ligne", + "Select this pickup day": "Sélectionner ce jour de retrait", + "Select your pickup day": "Sélectionnez votre jour de retrait", + "select_ask": "Sélectionnez une demande", + "Selected products": "Produits sélectionnés", + "Selling argument": "Argumentaire de vente", + "Send": "Envoyer", + "Send Password Reset Link": "Envoyer le lien de réinitialisation du mot de passe", + "Sender": "Expéditeur", + "Server Error": "Erreur serveur", + "Service": "Service", + "Service Unavailable": "Service indisponible", + "Services": "Services", + "Servings": "Portions", + "Session Has Expired": "La session a expiré", + "Settings": "Paramètres", + "Shop homepage.": "Page d'accueil de la boutique.", + "Shopping basket emptied!": "Panier vidé !", + "Shopping Basket Preview": "Aperçu du panier", + "Show": "Afficher", + "Show :name": "Afficher :name", + "Show All": "Afficher tout", + "Show basket": "Afficher le panier", + "Showing": "Montrant", + "Sign In": "Se connecter", + "Site": "Site", + "Site dashboard": "Dashboard du site", + "Site logo :name": "Logo du site :name", + "Slide :number": "Diapositive :number", + "Slide information": "Informations du slide", + "So that we can send you a password reset link, please provide the email address you used when you registered.": "Pour que nous puissions vous envoyer un lien de réinitialisation de votre mot de passe, merci de nous indiquer l'adresse e-mail saisie lors de votre inscription.", + "Sold by the pound": "Produit vendu au kilo", + "Sold by weight": "Vendu au poids", + "Solve": "Résoudre", + "Sorry for the inconvenience but we’re performing some maintenance at the moment.": "Veuillez nous excuser pour la gêne occasionnée, nous sommes en train de réaliser une opération de maintenance.", + "Sort :name in ascending order": "Trier :name en ordre ascendant", + "Sort :name in descending order": "Trier :name en ordre descendant", + "Special": "Spécial", + "Specific product": "Produit spécifique", + "Specific store product.": "Produit spécifique de la boutique.", + "SSL Handshake Failed": "Échec de la prise de contact SSL", + "Standardized weight unit": "Unité de poids normalisée", + "Start": "Commencer", + "Start date": "Date de début", + "Start date of the previous period": "Date de début de la période précédente", + "Start typing an address..": "Commencez à taper une adresse..", + "Status": "Statut", + "Step :number": "Étape :number", + "Stock": "Stock", + "Stop": "Arrêter", + "Submit": "Soumettre", + "Subscribe": "S'abonner", + "Success confirmation": "Confirmation de succès", + "Sugars": "Sucres", + "Sugars %": "Sucres %", + "Summary": "Récapitulatif", + "Switch": "Changer", + "Switch To Role": "Passer au rôle", + "Switching Protocols": "Protocoles de commutation", + "Synchronize from Arcadia": "Synchroniser depuis Arcadia", + "Tag": "Mot clé", + "Tags": "Mots clés", + "Take one out": "En retirer un", + "Temporary Redirect": "Redirection temporaire", + "terms and conditions": "conditions générales de vente", + "Thank you for this order!": "Merci pour cette commande !", + "The :app_name team": "L'équipe :app_name", + "The :attribute must be a valid role.": "Le :attribute doit être un rôle valide.", + "The :attribute must be at least :length characters and contain at least one number.": "Le champ :attribute doit avoir au moins :length caractères et contenir au moins un chiffre.", + "The :attribute must be at least :length characters and contain at least one special character and one number.": "Le champ :attribute doit avoir au moins :length caractères et contenir au moins un caractère spécial et un nombre.", + "The :attribute must be at least :length characters and contain at least one special character.": "Le champ :attribute doit avoir au moins :length caractères et contenir au moins un caractère spécial.", + "The :attribute must be at least :length characters and contain at least one uppercase character and one number.": "Le champ :attribute doit avoir au moins :length caractères et contenir au moins une majuscule et un chiffre.", + "The :attribute must be at least :length characters and contain at least one uppercase character and one special character.": "Le champ :attribute doit avoir au moins :length caractères et contenir au moins une majuscule et un caractère spécial.", + "The :attribute must be at least :length characters and contain at least one uppercase character, one number, and one special character.": "Le champ :attribute doit avoir au moins :length caractères, et contenir au moins une majuscule, un chiffre et un caractère spécial.", + "The :attribute must be at least :length characters and contain at least one uppercase character.": "Le champ :attribute doit avoir au moins :length caractères et au moins une majuscule.", + "The :attribute must be at least :length characters.": "Le champ :attribute doit avoir au moins :length caractères.", + "The :attribute must contain at least one letter.": "Le champ :attribute doit avoir au moins une lettre.", + "The :attribute must contain at least one number.": "Le champ :attribute doit avoir au moins un numéro.", + "The :attribute must contain at least one symbol.": "Le champ :attribute doit avoir au moins un symbole.", + "The :attribute must contain at least one uppercase and one lowercase letter.": "Le champ :attribute doit avoir au moins une lettre majuscule et une lettre minuscule.", + "The :sitename Team": "L'équipe :sitename", + "The answer": "La réponse", + "The brand associated with the product": "La marque associée au produit", + "The customer account was not found.": "Le compte client n'est pas trouvé.", + "The discount applies to the piece (sold unit).": "La remise s'applique à la pièce (unité de vente).", + "The employee sync job has been dispatched": "Le job de synchronisation des salariés a été lancé", + "The existing encrypted environment file is not in readable format. Use --force to overwrite it.": "The existing encrypted environment file is not in readable format. Use --force to overwrite it.", + "The existing encryption key is required to update the encrypted environment file.": "The existing encryption key is required to update the encrypted environment file.", + "The given data was invalid.": "La donnée renseignée est incorrecte.", + "The INCO sheet has been successfully associated with the product.": "La fiche INCO a été associée avec succès au produit.", + "The INCO sheet has been successfully associated.": "La fiche INCO a été associée avec succès.", + "The INCO sheet has been successfully synchronized from Arcadia.": "La fiche INCO a été synchronisée avec succès depuis Arcadia.", + "The list is empty.": "La liste est vide.", + "The new password must be at least 8 characters and contain uppercase, lowercase, number and special character.": "Le nouveau mot de passe doit avoir une longueur minimale de 8 caractères et doit contenir majuscule, minuscule, chiffre et caractère spécial.", + "The operation was not performed": "L'opération n'a pas été effectuée", + "The order": "La commande", + "The order deadline has passed. This item will no longer be available for purchase.": "La date limite de commande est dépassée. Le remplacement ne sera plus proposé aux clients.", + "The password must contain": "Le mot de passe doit contenir", + "The publication status is updated according to the scheduled dates. To change the publication status, please edit or remove the corresponding dates.": "La publication est modifiée en concordance avec les dates enregistrées. Pour modifier l'état de publication, veuillez modifier ou enlever les dates correspondantes.", + "The range associated with the product": "La gamme associée au produit", + "The response is not a streamed response.": "La réponse n'est pas une réponse diffusée.", + "The response is not a view.": "La réponse n'est pas une vue.", + "The team": "L'équipe", + "The text that will accompany the image": "Le texte qui accompagnera l'image", + "The text that will accompany your slide image.": "Le texte qui accompagnera l'image de votre slide.", + "The total amount for this delivery date has been exceeded (€200 maximum). Please modify it to validate.": "Le montant total pour cette date de livraison est dépassé (200€ maximum). Veuillez modifier cette dernière pour la valider.", + "The total amount of this order has been exceeded (€200 maximum). Please modify it to validate.": "Le montant total de cette commande est dépassé (200€ maximum). Veuillez modifier cette dernière pour la valider.", + "The unsubscription link is invalid.": "Le lien de désinscription est invalide.", + "The usual limit to pass an order is :date": "La date limite habituelle pour passer une commande est le :date", + "The usual pickup day is :date": "Le jour de retrait habituel est le :date", + "The verification link is invalid or the customer account was not found.": "Le lien de vérification est invalide ou le compte client n'a pas été trouvé.", + "This action is unauthorized.": "Cette action n'est pas autorisée.", + "This activation link is not valid": "Ce lien d'activation n'est pas valide", + "This is not the page you are looking for...": "Ce n'est pas la page que vous recherchez...", + "This password reset link will expire in :count minutes.": "Ce lien de réinitialisation du mot de passe expirera dans :count minutes.", + "to": "à", + "To be collected on": "À retirer le", + "To date": "Jusqu'au", + "To update your personal information, fill in the new data below": "Pour modifier vos informations personnelles, renseignez vos nouvelles données ci-dessous", + "Today's Orders": "Commandes du jour", + "Toggle navigation": "Afficher / masquer le menu de navigation", + "Too Early": "Trop tôt", + "Too Many Requests": "Trop de requêtes", + "Total": "Total", + "Total %": "Total %", + "Total (including tax)": "Total TTC", + "Total for this product: :total": "Total pour ce produit : :total", + "Total in €": "Total en €", + "Total Price (excluding tax)": "Prix Total HT", + "Total to pay": "Total à payer", + "Total TTC": "Total TTC", + "town": "Ville", + "Translate": "Traduire", + "Translate It": "Traduis le", + "TTC": "TTC", + "Unable to write the encrypted environment file.": "Unable to write the encrypted environment file.", + "Unauthorized": "Non autorisé", + "Unavailable For Legal Reasons": "Indisponible pour des raisons légales", + "Unit price": "Prix unitaire", + "Unit price (excluding tax)": "Prix unitaire HT", + "Unit price (incl. tax)": "Prix à la pièce TTC", + "Unit price: :price": "Prix unitaire : :price", + "Unit used when transmitting the order to Regate": "Unité utilisée lors de la transmission de commande à Regate", + "Unknown Error": "Erreur inconnue", + "Unpack": "Déballer", + "Unprocessable Entity": "Entité non traitable", + "Unsubscribe": "Se désabonner", + "Unsupported Media Type": "Type de média non supporté", + "until :date": "au :date", + "Up": "Monter", + "Update": "Mettre à jour", + "Update :name": "Mettre à jour :name", + "Update my personal details": "Mettre à jour mes informations personnelles", + "Updated automatically": "Mis à jour automatiquement.", + "Upgrade Required": "Mise à niveau requise", + "URI Too Long": "URI trop long", + "Use Proxy": "Utiliser un proxy", + "Use the Arcadia section above to search and associate an INCO sheet.": "Utilisez la section Arcadia ci-dessus pour rechercher et associer une fiche INCO.", + "User": "Utilisateur", + "Validate my basket": "Valider mon panier", + "Validate my basket and proceed to reservation": "Valider mon panier et passer à la réservation", + "Validation of your order.": "Validation de votre commande.", + "Validity period": "Période de validité", + "Variable weight product": "Produit à poids variable", + "Variant Also Negotiates": "La variante négocie également", + "VAT": "TVA", + "Verify Email Address": "Vérifier l'adresse e-mail", + "Verify Your Email Address": "Vérifiez votre adresse e-mail", + "Verify your email address": "Vérifier votre adresse e-mail", + "View": "Vue", + "View :name": "Voir :name", + "View details of :name": "Voir les détails de :name", + "View on map": "Voir sur la carte", + "View on OpenStreetMap": "Voir sur Open Street map", + "View product": "Voir le produit", + "Visible": "Visible", + "Vos informations ont bien été enregistrées.": "Vos informations ont bien été enregistrées.", + "Votre désinscription à la newsletter a été prise en compte": "Votre désinscription à la newsletter a été prise en compte", + "Warning": "Attention", + "We do our utmost to deliver your entire order, unfortunately some products may be out of stock. You will not be charged for undelivered products.": "Nous faisons le maximum pour vous livrer l'intégralité de votre commande, malheureusement certains produits peuvent être en rupture. Vous ne serez pas facturé des produits non livrés.", + "We'll be back soon!": "Nous serons de retour bientôt", + "Web Server is Down": "Le serveur Web est en panne", + "Welcome to your account. What would you like to do ?": "Bienvenue dans votre compte. Que souhaitez-vous faire ?", + "Whoops!": "Oups !", + "Year": "Année", + "Yes": "Oui", + "Yes, empty my basket": "Oui, vider mon panier", + "You are logged in!": "Vous êtes connecté !", + "You are logged out!": "Vous êtes déconnecté !", + "You are not authorized to access this element.": "Vous n'êtes pas autorisé à accéder à cet élément.", + "You are receiving this email because we received a password reset request for your account.": "Vous recevez cet e-mail car nous avons reçu une demande de réinitialisation de mot de passe pour votre compte.", + "You have an order to collect today - :appname": "Vous avez une commande à retirer aujourd'hui - :appname", + "You have just generated a .csv file following the import of employees, available as an attachment to this email.": "Vous venez de générer un fichier .csv suite à l'import de salariés, disponible en pièce jointe de cet email.", + "You have no orders": "Vous n'avez aucunes commandes", + "You have reached the maximum order limit for this basket.": "Vous avez atteint la limite de commandes autorisées pour ce panier.", + "You will reach the maximum weekly order limit with this basket.": "Vous atteindrez la limite de commandes hebdomadaires autorisées avec ce panier.", + "Your account has been successfully activated, you can now log in.": "Votre compte a bien été activé, vous pouvez désormais vous connecter.", + "Your account is already activated, you can log in with it now.": "Votre compte est déjà activé, vous pouvez dès à présent vous connecter avec celui-ci.", + "Your account is not activated yet. Please check your email for the activation link.": "Votre compte n'est pas activé, vérifiez dans vos emails pour y trouver le mail de confirmation. Un lien d'activation vous a été renvoyé.", + "Your account is now verified, you can start using the site.": "Votre compte est à présent vérifié, vous pouvez commencer à utiliser le site.", + "Your assigned pickup point is :shop": "Votre point de retrait assignée est : :shop", + "Your basket": "Votre panier", + "Your basket is empty": "Votre panier est vide", + "Your collection": "Votre retrait", + "Your email address": "Votre adresse email", + "Your email address cannot be changed.": "Votre adresse e-mail ne peut pas être modifiée.", + "Your information has been saved.": "Vos informations ont bien été enregistrées.", + "Your message could not be sent.<br>We are sorry and ask you to please try again later.": "Votre message n'a pas pu être envoyé.<br>Nous en sommes désolés et vous prions<br>de bien vouloir réessayer plus tard.", + "Your message has been sent!": "Votre message a bien été envoyé !", + "Your new password must be different from the old one": "Votre nouveau mot de passe doit être différent de l'ancien", + "Your newsletter unsubscription has been taken into account.": "Votre désinscription à la newsletter a été prise en compte.", + "Your old password does not match.": "L'ancien mot de passe ne correspond pas.", + "Your order": "Votre commande", + "Your order - :appname": "Votre commande - :appname", + "Your order is ready for collection today at your collection point!": "Votre commande est à récupérer aujourd\\u0027hui dans votre point de retrait !", + "Your order is registered!": "Votre commande est enregistrée !", + "Your order session has expired or is invalid. Please review your basket.": "Votre session de commande a expiré ou est invalide. Veuillez vérifier votre panier.", + "Your password has been changed - :appname": "Votre mot de passe a été changé - :appname", + "Your password has been changed on :appname": "Votre mot de passe a été changé sur :appname", + "Your password has been changed. If you are not at the origin of this change, please contact us as soon as possible using the contact form or by contacting your manager.": "Votre mot de passe a été changé. Si vous n'êtes pas à l'origine de ceci, veuillez nous contacter au plus vite en utilisant le formulaire de contact ou en vous rapprochant de votre responsable.", + "your_message": "Votre message", + "Zip code": "Code postal", + "Your search": "Votre recherche", + "Choose position": "Choisir une position", + "Move": "Déplacer", + "Move down": "Descendre d'un cran", + "Move up": "Monter d'un cran", + "New position": "Nouvelle position" +} diff --git a/lang/fr/actions.php b/lang/fr/actions.php new file mode 100644 index 00000000..b853eed5 --- /dev/null +++ b/lang/fr/actions.php @@ -0,0 +1,119 @@ +<?php + +declare(strict_types=1); + +return [ + 'accept' => 'Accepter', + 'action' => 'Action', + 'actions' => 'Actions', + 'add' => 'Ajouter', + 'admin' => 'Administrateur', + 'agree' => 'Approuver', + 'archive' => 'Archiver', + 'assign' => 'Attribuer', + 'associate' => 'Associer', + 'attach' => 'Attacher', + 'browse' => 'Parcourir', + 'cancel' => 'Annuler', + 'choose' => 'Choisir', + 'choose_file' => 'Choisir le fichier', + 'choose_image' => 'Choisir une image', + 'click_to_copy' => 'Cliquer pour copier', + 'close' => 'Fermer', + 'collapse' => 'Réduire', + 'collapse_all' => 'Réduire tout', + 'comment' => 'Commentaire', + 'confirm' => 'Confirmer', + 'connect' => 'Connecter', + 'create' => 'Créer', + 'delete' => 'Supprimer', + 'detach' => 'Détacher', + 'details' => 'Détails', + 'disable' => 'Désactiver', + 'discard' => 'Jeter', + 'done' => 'Fait', + 'down' => 'Descendre', + 'duplicate' => 'Dupliquer', + 'edit' => 'Editer', + 'enable' => 'Activer', + 'expand' => 'Développer', + 'expand_all' => 'Développer tout', + 'explanation' => 'Explication', + 'export' => 'Exporter', + 'file' => 'Déposer', + 'files' => 'Fichiers', + 'go_home' => 'Aller à l\'accueil', + 'hide' => 'Cacher', + 'home' => 'Accueil', + 'image' => 'Image', + 'impersonate' => 'Imiter', + 'impersonation' => 'Imitation', + 'import' => 'Importer', + 'introduction' => 'Introduction', + 'like' => 'Aimer', + 'load' => 'Charger', + 'localize' => 'Localiser', + 'log_in' => 'Se connecter', + 'log_out' => 'Se déconnecter', + 'named' => [ + 'add' => 'Ajouter :name', + 'choose' => 'Choisir :name', + 'create' => 'Créer :name', + 'delete' => 'Supprimer :name', + 'duplicate' => 'Dupliquer :name', + 'edit' => 'Editer :name', + 'export' => 'Exporter :name', + 'hide' => 'Cacher :name', + 'import' => 'Importer :name', + 'new' => 'Nouveau :name', + 'restore' => 'Restaurer :name', + 'save' => 'Sauvegarder :name', + 'search' => 'Chercher :name', + 'show' => 'Afficher :name', + 'update' => 'Mettre à jour :name', + 'view' => 'Voir :name', + ], + 'new' => 'Nouveau', + 'no' => 'Non', + 'open' => 'Ouvrir', + 'open_website' => 'Ouvrir sur le site', + 'preview' => 'Aperçu', + 'price' => 'Prix', + 'record' => 'Enregistrer', + 'restore' => 'Restaurer', + 'save' => 'Sauvegarder', + 'save_and_close' => 'Sauvegarder et fermer', + 'save_and_return' => 'Sauvegarder et retourner', + 'search' => 'Chercher', + 'select' => 'Sélectionner', + 'select_all' => 'Tout sélectionner', + 'send' => 'Envoyer', + 'settings' => 'Paramètres', + 'show' => 'Montrer', + 'show_all' => 'Afficher tout', + 'sign_in' => 'Se connecter', + 'solve' => 'Résoudre', + 'start' => 'Commencer', + 'stop' => 'Arrêter', + 'submit' => 'Soumettre', + 'subscribe' => 'S\'abonner', + 'switch' => 'Changer', + 'switch_to_role' => 'Passer au rôle', + 'tag' => 'Mot clé', + 'tags' => 'Mots clés', + 'target_link' => [ + 'blank' => 'Ouvrir dans une nouvelle fenêtre', + 'parent' => 'Ouvrir dans la fenêtre parente', + 'self' => 'Ouvrir dans la fenêtre actuelle', + 'top' => 'Ouvrir dans le cadre le plus haut', + ], + 'translate' => 'Traduire', + 'translate_it' => 'Traduis le', + 'unpack' => 'Déballer', + 'unsubscribe' => 'Se désabonner', + 'up' => 'Monter', + 'update' => 'Mettre à jour', + 'user' => 'Utilisateur', + 'view' => 'Voir', + 'yes' => 'Oui', +]; diff --git a/lang/fr/auth.php b/lang/fr/auth.php new file mode 100644 index 00000000..a22cd3f7 --- /dev/null +++ b/lang/fr/auth.php @@ -0,0 +1,9 @@ +<?php + +declare(strict_types=1); + +return [ + 'failed' => 'Ces identifiants ne correspondent pas à nos enregistrements.', + 'password' => 'Le mot de passe est incorrect', + 'throttle' => 'Tentatives de connexion trop nombreuses. Veuillez essayer de nouveau dans :seconds secondes.', +]; diff --git a/resources/lang/fr/cookie-notice.php b/lang/fr/cookie-notice.php similarity index 88% rename from resources/lang/fr/cookie-notice.php rename to lang/fr/cookie-notice.php index b5692e59..21165b57 100644 --- a/resources/lang/fr/cookie-notice.php +++ b/lang/fr/cookie-notice.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + // * Version 6.0.3 // phpcs:disable return [ @@ -14,19 +16,18 @@ return [ 'button_validate_and_close' => 'Valider et fermer', 'button_title_open_new_tab' => 'Ouvrir le lien dans un nouvel onglet', 'banner_title' => 'La boutique de cocotte utilise des cookies !', - 'banner_text' => - 'Nous utilisons des cookies pour nous assurer du bon fonctionnement de notre site et à des fins analytiques. + 'banner_text' => 'Nous utilisons des cookies pour nous assurer du bon fonctionnement de notre site et à des fins analytiques. Vous pouvez changer d’avis à tout moment en cliquant sur l’icône présente sur chaque page de notre site. En autorisant ces services tiers, vous acceptez le dépôt et la lecture de cookies et l’utilisation de technologies de suivi nécessaires à leur bon fonctionnement.', 'modal_title' => 'Fenêtre de gestion de cookies', 'panel_content' => 'Contenu du panneau des cookies', 'picture_cookie_title' => 'Image d’un bon gros cookie', 'navigation_title' => 'Navigation du panneau des cookies', - 'custom' => [ + 'custom' => [ 'matomo' => [ 'title' => 'Matomo', 'description' => 'Les services de mesure d’audience permettent de générer des statistiques de fréquentation utiles à l’amélioration du site.', 'labelLink' => 'En apprendre plus', ], - ] + ], ]; diff --git a/lang/fr/country.php b/lang/fr/country.php new file mode 100644 index 00000000..dc63730f --- /dev/null +++ b/lang/fr/country.php @@ -0,0 +1,255 @@ +<?php + +declare(strict_types=1); + +return [ + 'afghanistan' => 'Afghanistan', + 'alandIslands' => 'Îles Åland', + 'albania' => 'Albanie', + 'algeria' => 'Algérie', + 'americanSamoa' => 'Samoa américaines', + 'andorra' => 'Andorre', + 'angola' => 'Angola', + 'anguilla' => 'Anguilla', + 'antarctica' => 'Antarctique', + 'antiguaAndBarbuda' => 'Antigua-et-Barbuda', + 'argentina' => 'Argentine', + 'armenia' => 'Arménie', + 'aruba' => 'Aruba', + 'australia' => 'Australie', + 'austria' => 'Autriche', + 'azerbaijan' => 'Azerbaïdjan', + 'bahrain' => 'Bahreïn', + 'bahamas' => 'Bahamas', + 'bangladesh' => 'Bangladesh', + 'barbados' => 'Barbade', + 'belarus' => 'Bélarus', + 'belgium' => 'Belgique', + 'belize' => 'Belize', + 'benin' => 'Bénin', + 'bermuda' => 'Bermudes', + 'bhutan' => 'Bhoutan', + 'boliviaPlurinationalStateOf' => 'Bolivie, État plurinational de', + 'bonaireSintEustatiusAndSaba' => 'Bonaire, Saint-Eustache et Saba', + 'bosniaAndHerzegovina' => 'Bosnie-Herzégovine', + 'botswana' => 'Botswana', + 'bouvetIsland' => 'Île Bouvet', + 'brazil' => 'Brésil', + 'britishIndianOceanTerritory' => 'Territoire britannique de l\'océan Indien', + 'bruneiDarussalam' => 'Brunéi Darussalam', + 'bulgaria' => 'Bulgarie', + 'burkinaFaso' => 'Burkina Faso', + 'burundi' => 'Burundi', + 'cambodia' => 'Cambodge', + 'cameroon' => 'Cameroun', + 'canada' => 'Canada', + 'capeVerde' => 'Cap-Vert', + 'caymanIslands' => 'Îles Caïmans', + 'centralAfricanRepublic' => 'République centrafricaine', + 'chad' => 'Tchad', + 'chile' => 'Chili', + 'china' => 'Chine', + 'christmasIsland' => 'Île Christmas', + 'cocosKeelingIslands' => 'Îles Cocos (Keeling)', + 'colombia' => 'Colombie', + 'comoros' => 'Comores', + 'congo' => 'Congo', + 'congoTheDemocraticRepublicOfThe' => 'Congo, République démocratique du', + 'cookIslands' => 'Îles Cook', + 'costaRica' => 'Costa Rica', + 'coteDivoire' => 'Côte d\'Ivoire', + 'croatia' => 'Croatie', + 'cuba' => 'Cuba', + 'curacao' => 'Curaçao', + 'cyprus' => 'Chypre', + 'czechRepublic' => 'République tchèque', + 'denmark' => 'Danemark', + 'djibouti' => 'Djibouti', + 'dominica' => 'Dominique', + 'dominicanRepublic' => 'République dominicaine', + 'ecuador' => 'Équateur', + 'egypt' => 'Égypte', + 'elSalvador' => 'El Salvador', + 'equatorialGuinea' => 'Guinée équatoriale', + 'eritrea' => 'Érythrée', + 'estonia' => 'Estonie', + 'ethiopia' => 'Éthiopie', + 'falklandIslandsMalvinas' => 'Îles Falkland (Malouines)', + 'faroeIslands' => 'Îles Féroé', + 'fiji' => 'Fidji', + 'finland' => 'Finlande', + 'france' => 'France', + 'frenchGuiana' => 'Guyane française', + 'frenchPolynesia' => 'Polynésie française', + 'frenchSouthernTerritories' => 'Terres australes françaises', + 'gabon' => 'Gabon', + 'gambia' => 'Gambie', + 'georgia' => 'Géorgie', + 'germany' => 'Allemagne', + 'ghana' => 'Ghana', + 'gibraltar' => 'Gibraltar', + 'greece' => 'Grèce', + 'greenland' => 'Groenland', + 'grenada' => 'Grenade', + 'guadeloupe' => 'Guadeloupe', + 'guam' => 'Guam', + 'guatemala' => 'Guatemala', + 'guernsey' => 'Guernesey', + 'guinea' => 'Guinée', + 'guineaBissau' => 'Guinée-Bissau', + 'guyana' => 'Guyana', + 'haiti' => 'Haïti', + 'heardIslandAndMcdonaldIslands' => 'Île Heard et îles McDonald', + 'holySeeVaticanCityState' => 'Saint-Siège (État de la Cité du Vatican)', + 'honduras' => 'Honduras', + 'hongKong' => 'Hong Kong', + 'hungary' => 'Hongrie', + 'iceland' => 'Islande', + 'india' => 'Inde', + 'indonesia' => 'Indonésie', + 'iranIslamicRepublicOf' => 'Iran, République islamique d\'', + 'iraq' => 'Irak', + 'ireland' => 'Irlande', + 'isleOfMan' => 'Île de Man', + 'israel' => 'Israël', + 'italy' => 'Italie', + 'jamaica' => 'Jamaïque', + 'japan' => 'Japon', + 'jersey' => 'Jersey', + 'jordan' => 'Jordanie', + 'kazakhstan' => 'Kazakhstan', + 'kenya' => 'Kenya', + 'kiribati' => 'Kiribati', + 'koreaDemocraticPeoplesRepublicOf' => 'Corée, République populaire démocratique de', + 'koreaRepublicOf' => 'Corée, République de', + 'kuwait' => 'Koweït', + 'kyrgyzstan' => 'Kirghizistan', + 'laoPeoplesDemocraticRepublic' => 'République démocratique populaire lao', + 'latvia' => 'Lettonie', + 'lebanon' => 'Liban', + 'lesotho' => 'Lesotho', + 'liberia' => 'Libéria', + 'libya' => 'Libye', + 'liechtenstein' => 'Liechtenstein', + 'lithuania' => 'Lituanie', + 'luxembourg' => 'Luxembourg', + 'macao' => 'Macao', + 'macedoniaTheFormerYugoslavRepublicOf' => 'Macédoine, l\'ex-République yougoslave de', + 'madagascar' => 'Madagascar', + 'malawi' => 'Malawi', + 'malaysia' => 'Malaisie', + 'maldives' => 'Maldives', + 'mali' => 'Mali', + 'malta' => 'Malte', + 'marshallIslands' => 'Îles Marshall', + 'martinique' => 'Martinique', + 'mauritania' => 'Mauritanie', + 'mauritius' => 'Maurice', + 'mayotte' => 'Mayotte', + 'mexico' => 'Mexique', + 'micronesiaFederatedStatesOf' => 'Micronésie, États fédérés de', + 'moldovaRepublicOf' => 'Moldova, République de', + 'monaco' => 'Monaco', + 'mongolia' => 'Mongolie', + 'montenegro' => 'Monténégro', + 'montserrat' => 'Montserrat', + 'morocco' => 'Maroc', + 'mozambique' => 'Mozambique', + 'myanmar' => 'Myanmar', + 'namibia' => 'Namibie', + 'nauru' => 'Nauru', + 'nepal' => 'Népal', + 'netherlands' => 'Pays-Bas', + 'newCaledonia' => 'Nouvelle-Calédonie', + 'newZealand' => 'Nouvelle-Zélande', + 'nicaragua' => 'Nicaragua', + 'niger' => 'Niger', + 'nigeria' => 'Nigéria', + 'niue' => 'Niue', + 'norfolkIsland' => 'Île Norfolk', + 'northernMarianaIslands' => 'Îles Mariannes du Nord', + 'norway' => 'Norvège', + 'oman' => 'Oman', + 'pakistan' => 'Pakistan', + 'palau' => 'Palaos', + 'palestineStateOf' => 'Palestine, État de', + 'panama' => 'Panama', + 'papuaNewGuinea' => 'Papouasie-Nouvelle-Guinée', + 'paraguay' => 'Paraguay', + 'peru' => 'Pérou', + 'philippines' => 'Philippines', + 'pitcairn' => 'Pitcairn', + 'poland' => 'Pologne', + 'portugal' => 'Portugal', + 'puertoRico' => 'Porto Rico', + 'qatar' => 'Qatar', + 'reunion' => 'Réunion', + 'romania' => 'Roumanie', + 'russianFederation' => 'Fédération de Russie', + 'rwanda' => 'Rwanda', + 'saintBarthelemy' => 'Saint-Barthélemy', + 'saintHelenaAscensionAndTristanDaCunha' => 'Sainte-Hélène, Ascension et Tristan da Cunha', + 'saintKittsAndNevis' => 'Saint-Kitts-et-Nevis', + 'saintLucia' => 'Sainte-Lucie', + 'saintMartinFrenchPart' => 'Saint-Martin (partie française)', + 'saintPierreAndMiquelon' => 'Saint-Pierre-et-Miquelon', + 'saintVincentAndTheGrenadines' => 'Saint-Vincent-et-les-Grenadines', + 'samoa' => 'Samoa', + 'sanMarino' => 'Saint-Marin', + 'saoTomeAndPrincipe' => 'Sao Tomé-et-Principe', + 'saudiArabia' => 'Arabie saoudite', + 'senegal' => 'Sénégal', + 'serbia' => 'Serbie', + 'seychelles' => 'Seychelles', + 'sierraLeone' => 'Sierra Leone', + 'singapore' => 'Singapour', + 'sintMaartenDutchPart' => 'Saint-Martin (partie néerlandaise)', + 'slovakia' => 'Slovaquie', + 'slovenia' => 'Slovénie', + 'solomonIslands' => 'Îles Salomon', + 'somalia' => 'Somalie', + 'southAfrica' => 'Afrique du Sud', + 'southGeorgiaAndTheSouthSandwichIslands' => 'Géorgie du Sud et îles Sandwich du Sud', + 'southSudan' => 'Soudan du Sud', + 'spain' => 'Espagne', + 'sriLanka' => 'Sri Lanka', + 'sudan' => 'Soudan', + 'suriname' => 'Suriname', + 'svalbardAndJanMayen' => 'Svalbard et Jan Mayen', + 'swaziland' => 'Eswatini', + 'sweden' => 'Suède', + 'switzerland' => 'Suisse', + 'syrianArabRepublic' => 'République arabe syrienne', + 'taiwanProvinceOfChina' => 'Taïwan, Province de Chine', + 'tajikistan' => 'Tadjikistan', + 'tanzaniaUnitedRepublicOf' => 'Tanzanie, République unie de', + 'thailand' => 'Thaïlande', + 'timorLeste' => 'Timor-Leste', + 'togo' => 'Togo', + 'tokelau' => 'Tokelau', + 'tonga' => 'Tonga', + 'trinidadAndTobago' => 'Trinité-et-Tobago', + 'tunisia' => 'Tunisie', + 'turkey' => 'Turquie', + 'turkmenistan' => 'Turkménistan', + 'turksAndCaicosIslands' => 'Îles Turques-et-Caïques', + 'tuvalu' => 'Tuvalu', + 'uganda' => 'Ouganda', + 'ukraine' => 'Ukraine', + 'unitedArabEmirates' => 'Émirats arabes unis', + 'unitedKingdom' => 'Royaume-Uni', + 'unitedStates' => 'États-Unis', + 'unitedStatesMinorOutlyingIslands' => 'Îles mineures éloignées des États-Unis', + 'uruguay' => 'Uruguay', + 'uzbekistan' => 'Ouzbékistan', + 'vanuatu' => 'Vanuatu', + 'venezuelaBolivarianRepublicOf' => 'Venezuela, République bolivarienne du', + 'vietNam' => 'Viet Nam', + 'virginIslandsBritish' => 'Îles Vierges britanniques', + 'virginIslandsUs' => 'Îles Vierges américaines', + 'wallisAndFutuna' => 'Wallis-et-Futuna', + 'westernSahara' => 'Sahara occidental', + 'yemen' => 'Yémen', + 'zambia' => 'Zambie', + 'zimbabwe' => 'Zimbabwe', +]; diff --git a/lang/fr/crud.php b/lang/fr/crud.php new file mode 100644 index 00000000..ef835118 --- /dev/null +++ b/lang/fr/crud.php @@ -0,0 +1,132 @@ +<?php + +declare(strict_types=1); + +return [ + 'actions' => [ + 'list' => 'liste', + 'view' => 'voir', + 'create' => 'créer', + 'duplicate' => 'dupliquer', + 'update' => 'éditer', + 'delete' => 'supprimer', + 'save' => 'enregistrer', + 'edit' => 'mettre à jour', + ], + + 'helpers' => [ + 'list' => 'Liste', + 'view_associated' => 'Voir les :model liés', + 'list_all' => 'Lister tous les :model', + 'create_model' => 'Créer :model', + 'view_model' => 'Voir :model', + 'associate_model' => 'Associer :model', + 'update_model' => 'Éditer :model', + 'duplicate_model' => 'Dupliquer :model', + 'delete_model' => 'Supprimer :model', + 'save_model' => 'Sauvegarder :model', + 'edit_model' => 'Mettre à jour :model', + 'no_results' => 'Aucun résultat', + 'no_results_for_model' => 'Aucun résultat pour :model', + 'publish' => 'Publier', + 'unpublish' => 'Dépublier', + 'starred' => 'Mis en avant', + 'discounted' => 'En promotion', + 'star' => 'Mettre en avant', + 'unstar' => 'Ne pas mettre en avant', + 'seo_title' => 'Doit décrire précisément la page, recommandation pour un positionnement + optimal dans les moteurs de recherche (balise <title>).', + 'seo_description' => 'Doit décrire précisément le contenu de la page (balise <meta> description).', + 'required_fields' => 'Champs obligatoires', + 'required_fields_with_aster' => 'Les champs suivis d\'un astérisque sont obligatoires', + 'visibility_with_dates' => 'Ce champ n\'aura d\'effet que si aucune date n\'est renseignée.', + 'publish_at' => ':model sera publié à partir de cette date.', + 'unpublish_at' => ':model sera dépublié à partir de cette date.', + 'nutritionnal_values' => 'Les valeurs doivent être renseignées en grammes, + exceptés pour l\'énergie en kJ et en kcal.', + 'new_tab_boolean' => 'Cocher pour ouvrir dans un nouvel onglet.', + 'game_text' => 'Doit contenir au minimum 15 caractères et au maximum 32 mots.', + 'url' => 'Doit être une URL valide.', + 'year' => 'Année du :model', + ], + + 'labels' => [ + 'new_tab_boolean' => 'Ouvrir dans un nouvel onglet ?', + ], + + 'libs' => [ + 'toolbox' => [ + 'assertFieldIsUnique' => 'La :valeur du champ :attribut est déjà utilisée', + 'assertNoInternalBoUrls' => ':attribute : Il est interdit de coller l\'uri de back-office dans ce champ', + 'assertNoInternalUrls' => ':attribute : Il est interdit de coller une url de :appname dans ce champ.', + ], + ], + + 'messages' => [ + 'action_done' => 'l\'action à été effectuée', + 'has_been_created' => ':model a été créé', + 'cannot_be_created' => ':model ne peut être créé', + 'has_been_updated' => ':model a été mis à jour', + 'cannot_be_updated' => ':model ne peut être mis à jour', + 'has_been_deleted' => ':model a été supprimé', + 'cannot_be_deleted' => ':model ne peut être supprimé', + 'order_changed' => 'L\'ordre a été changé !', + 'order_not_changed' => 'L\'ordre n\'a pas été changé !', + 'publish_status_saved' => 'Changement de l\'état de publication réussit !', + 'star_saved' => 'Changement de mise en avant réussit !', + 'right' => 'Vous n\'avez pas les droits pour accéder à cette partie !', + 'theme_updated' => 'Le thème a été mis à jour !', + ], + + 'minicrud' => [ + 'visibility_label' => 'Visibilité', + 'visibility_helper' => 'Cocher pour rendre visible.', + 'select' => 'Sélectionnez :entity dans la liste.', + 'associated_enum' => 'Associé :entity', + 'dimensions_must_be' => 'Doit être :widthpx (largeur) par :heightpx (hauteur).', + 'picture_title_helper' => 'Utile pour les utilisateurs, s\'affiche en passant la souris sur l\'image', + 'picture_title_label' => 'Attribut du titre de l\'image', + 'picture_alt_helper' => 'Doit décrire votre image pour les moteurs de recherche et les aveugles (5 à 6 mots)', + 'picture_alt_label' => 'Attribut Alt de l\'image', + 'text_warning' => 'Relisez votre contenu avant de le publier.', + ], + + 'pagination' => [ + 'previous' => 'Page précédente', + 'next' => 'Page suivante', + 'specific_page' => 'Accéder à la page n°:id', + 'paginate_list' => 'Nombre d\'éléments par page', + ], + + 'other' => [ + 'up' => 'Modifier l\'ordre d\'apparition vers le haut', + 'down' => 'Modifier l\'ordre d\'apparition vers le bas', + 'no_model_found' => 'Aucun :model trouvé', + 'publish' => 'Publié', + 'unpublish' => 'Dépublié', + 'search_start' => 'Lancer la recherche', + 'search_delete' => 'Supprimer la recherche', + 'search_placeholder' => 'Vos mots clés ici...', + 'sort_ascending' => 'Trier :name dans l\'ordre croissant', + 'sort_descending' => 'Trier :name dans l\'ordre décroissant', + 'sort_delete' => 'Supprimer le tri', + 'sort_arrow' => 'Ici, les flèches sont utilisées pour trier et non pour filtrer', + 'right' => 'Vous n\'avez pas les droits', + ], + 'meta' => [ + 'title' => [ + 'create' => '{0} Création d\'un :model|{1} Création d\'une :model', + 'edit' => '{0} Edition d\'un :model|{1} Edition d\'une :model', + 'show' => '{0} Visualisation d\'un :model|{1} Visualisation d\'une :model', + ], + // phpcs:disable Generic.Files.LineLength.TooLong + 'description' => [ + 'index' => '{0} Liste de tous les :model|{1} Liste de toutes les :model', + 'create' => '{0} Création d\'un tout nouveau :model|{1} Création d\'une toute nouvelle :model|{2} Création d\'un tout nouvel :model', + 'edit' => '{0} Edition d\'un :model déjà existant|{1} Edition d\'une :model déjà existante', + 'show' => '{0} Visualisation d\'un :model déjà existant|{1} Visualisation d\'une :model déjà existante', + ], + // phpcs:enable + ], + +]; diff --git a/lang/fr/http-statuses.php b/lang/fr/http-statuses.php new file mode 100644 index 00000000..f7114082 --- /dev/null +++ b/lang/fr/http-statuses.php @@ -0,0 +1,84 @@ +<?php + +declare(strict_types=1); + +return [ + '0' => 'Erreur inconnue', + '100' => 'Continuer', + '101' => 'Protocoles de commutation', + '102' => 'En traitement', + '200' => 'OK', + '201' => 'Créé', + '202' => 'Accepté', + '203' => 'Informations non certifiées', + '204' => 'Pas de contenu', + '205' => 'Réinitialiser le contenu', + '206' => 'Contenu partiel', + '207' => 'Statut multiple', + '208' => 'Déjà rapporté', + '226' => 'IM utilisé', + '300' => 'Choix multiples', + '301' => 'Déplacé de façon permanente', + '302' => 'A trouvé', + '303' => 'Voir autre', + '304' => 'Non modifié', + '305' => 'Utiliser un proxy', + '307' => 'Redirection temporaire', + '308' => 'Redirection permanente', + '400' => 'Requête invalide', + '401' => 'Non authentifié', + '402' => 'Paiement requis', + '403' => 'Interdit', + '404' => 'Page non trouvée', + '405' => 'Méthode non autorisée', + '406' => 'Non acceptable', + '407' => 'Authentification proxy requise', + '408' => 'Requête expirée', + '409' => 'Conflit', + '410' => 'Disparu', + '411' => 'Longueur requise', + '412' => 'La précondition a échoué', + '413' => 'Charge utile trop grande', + '414' => 'URI trop long', + '415' => 'Type de média non supporté', + '416' => 'Plage non satisfaisante', + '417' => 'Comportement attendu insatisfaisant', + '418' => 'Je suis une théière', + '419' => 'La session a expiré', + '421' => 'Demande mal dirigée', + '422' => 'Contenu non traitable', + '423' => 'Verrouillé', + '424' => 'Dépendance échouée', + '425' => 'Trop tôt', + '426' => 'Mise à niveau requise', + '428' => 'Condition préalable requise', + '429' => 'Trop de demandes', + '431' => 'Champs d\'en-tête de requête trop grands', + '444' => 'Connexion fermée sans réponse', + '449' => 'Réessayer avec', + '451' => 'Indisponible pour des raisons légales', + '499' => 'Demande fermée par le client', + '500' => 'Erreur interne du serveur', + '501' => 'Non implémenté', + '502' => 'Mauvaise passerelle', + '503' => 'Service non disponible', + '504' => 'Temps d\'attente de la passerelle dépassé', + '505' => 'Version HTTP non prise en charge', + '506' => 'La variante négocie également', + '507' => 'Espace insuffisant', + '508' => 'Boucle détectée', + '509' => 'Limite de bande passante dépassée', + '510' => 'Non prolongé', + '511' => 'Authentification réseau requise', + '520' => 'Erreur inconnue', + '521' => 'Le serveur Web est en panne', + '522' => 'La connexion a expiré', + '523' => 'L\'origine est inaccessible', + '524' => 'Un dépassement de délai s\'est produit', + '525' => 'Échec de la prise de contact SSL', + '526' => 'Certificat SSL invalide', + '527' => 'Erreur de Railgun', + '598' => 'Temps d\'attente de la lecture réseau dépassé', + '599' => 'Temps d\'attente de la connexion réseau dépassé', + 'unknownError' => 'Erreur inconnue', +]; diff --git a/lang/fr/models.php b/lang/fr/models.php new file mode 100644 index 00000000..8519ca9a --- /dev/null +++ b/lang/fr/models.php @@ -0,0 +1,22 @@ +<?php + +declare(strict_types=1); + +return [ + 'classes' => [ + 'slides' => 'slide|slides', + 'tags' => 'mot clé|mots clés', + 'pages' => 'page|pages', + 'faqs' => 'foire au questions|foires au questions', + 'products' => 'produit|produits', + 'ranges' => 'gamme|gammes', + 'product_incos' => 'fiche inco|fiches inco', + 'discounts' => 'promotion|promotions', + 'shops' => 'magasin|magasins', + 'pickup-exceptions' => 'fermeture exceptionnelle|fermetures exceptionnelles', + 'orders' => 'commande|commandes', + 'customers' => 'client|clients', + 'brands' => 'marque|marques', + 'settings' => 'site des salariés|sites des salariés', + ], +]; diff --git a/lang/fr/pagination.php b/lang/fr/pagination.php new file mode 100644 index 00000000..df01397e --- /dev/null +++ b/lang/fr/pagination.php @@ -0,0 +1,12 @@ +<?php + +declare(strict_types=1); + +return [ + 'next' => 'Suivant »', + 'next_page' => 'Page suivante', + 'paginate_list' => 'Nombre d\'élements par page', + 'previous' => '« Précédent', + 'previous_page' => 'Page précédente', + 'specific_page' => 'Aller à la page n°:id', +]; diff --git a/lang/fr/passwords.php b/lang/fr/passwords.php new file mode 100644 index 00000000..75ae1485 --- /dev/null +++ b/lang/fr/passwords.php @@ -0,0 +1,11 @@ +<?php + +declare(strict_types=1); + +return [ + 'reset' => 'Votre mot de passe a été réinitialisé !', + 'sent' => 'Nous vous avons envoyé par email le lien de réinitialisation du mot de passe !', + 'throttled' => 'Veuillez patienter avant de réessayer.', + 'token' => 'Ce jeton de réinitialisation du mot de passe n\'est pas valide.', + 'user' => 'Aucun utilisateur n\'a été trouvé avec cette adresse email.', +]; diff --git a/lang/fr/search.php b/lang/fr/search.php new file mode 100644 index 00000000..25cec166 --- /dev/null +++ b/lang/fr/search.php @@ -0,0 +1,10 @@ +<?php + +declare(strict_types=1); + +return [ + 'label' => 'Rechercher', + 'keywords_here' => 'Vos mots clés ici... :fields', + 'launch' => 'Lancer la recherche', + 'clear' => 'Effacer la recherche', +]; diff --git a/lang/fr/validation.php b/lang/fr/validation.php new file mode 100644 index 00000000..a2614ec8 --- /dev/null +++ b/lang/fr/validation.php @@ -0,0 +1,433 @@ +<?php + +declare(strict_types=1); + +return [ + 'accepted' => 'Le champ :attribute doit être accepté.', + 'accepted_if' => 'Le champ :attribute doit être accepté quand :other a la valeur :value.', + 'active_url' => 'Le champ :attribute n\'est pas une URL valide.', + 'after' => 'Le champ :attribute doit être une date postérieure au :date.', + 'after_or_equal' => 'Le champ :attribute doit être une date postérieure ou égale au :date.', + 'alpha' => 'Le champ :attribute doit contenir uniquement des lettres.', + 'alpha_dash' => 'Le champ :attribute doit contenir uniquement des lettres, des chiffres et des tirets.', + 'alpha_num' => 'Le champ :attribute doit contenir uniquement des chiffres et des lettres.', + 'any_of' => 'Le champ :attribute est invalide.', + 'array' => 'Le champ :attribute doit être un tableau.', + 'array_keys' => 'Le champ :attribute ne doit contenir que les clés suivantes : :values.', + 'ascii' => 'Le champ :attribute ne doit contenir que des caractères alphanumériques et des symboles codés sur un octet.', + 'base64' => 'Le champ :attribute doit être une chaîne Base64 valide.', + 'before' => 'Le champ :attribute doit être une date antérieure au :date.', + 'before_or_equal' => 'Le champ :attribute doit être une date antérieure ou égale au :date.', + 'between' => [ + 'array' => 'Le tableau :attribute doit contenir entre :min et :max éléments.', + 'file' => 'La taille du fichier de :attribute doit être comprise entre :min et :max kilo-octets.', + 'numeric' => 'La valeur de :attribute doit être comprise entre :min et :max.', + 'string' => 'Le texte :attribute doit contenir entre :min et :max caractères.', + ], + 'boolean' => 'Le champ :attribute doit être vrai ou faux.', + 'can' => 'Le champ :attribute contient une valeur non autorisée.', + 'confirmed' => 'Le champ de confirmation :attribute ne correspond pas.', + 'contains' => 'Le champ :attribute manque une valeur requise.', + 'current_password' => 'Le mot de passe est incorrect.', + 'date' => 'Le champ :attribute n\'est pas une date valide.', + 'date_equals' => 'Le champ :attribute doit être une date égale à :date.', + 'date_format' => 'Le champ :attribute ne correspond pas au format :format.', + 'decimal' => 'Le champ :attribute doit comporter :decimal décimales.', + 'declined' => 'Le champ :attribute doit être décliné.', + 'declined_if' => 'Le champ :attribute doit être décliné quand :other a la valeur :value.', + 'different' => 'Les champs :attribute et :other doivent être différents.', + 'digits' => 'Le champ :attribute doit contenir :digits chiffres.', + 'digits_between' => 'Le champ :attribute doit contenir entre :min et :max chiffres.', + 'dimensions' => 'La taille de l\'image :attribute n\'est pas conforme.', + 'distinct' => 'Le champ :attribute a une valeur en double.', + 'doesnt_contain' => 'Le champ :attribute ne doit contenir aucun des éléments suivants : :values.', + 'doesnt_end_with' => 'Le champ :attribute ne doit pas finir avec une des valeurs suivantes : :values.', + 'doesnt_start_with' => 'Le champ :attribute ne doit pas commencer avec une des valeurs suivantes : :values.', + 'email' => 'Le champ :attribute doit être une adresse e-mail valide.', + 'encoding' => 'Le champ :attribute doit être encodé en :encoding.', + 'ends_with' => 'Le champ :attribute doit se terminer par une des valeurs suivantes : :values', + 'enum' => 'Le champ :attribute sélectionné est invalide.', + 'exists' => 'Le champ :attribute sélectionné est invalide.', + 'extensions' => 'Le champ :attribute doit avoir l\'une des extensions suivantes : :values.', + 'file' => 'Le champ :attribute doit être un fichier.', + 'filled' => 'Le champ :attribute doit avoir une valeur.', + 'gt' => [ + 'array' => 'Le tableau :attribute doit contenir plus de :value éléments.', + 'file' => 'La taille du fichier de :attribute doit être supérieure à :value kilo-octets.', + 'numeric' => 'La valeur de :attribute doit être supérieure à :value.', + 'string' => 'Le texte :attribute doit contenir plus de :value caractères.', + ], + 'gte' => [ + 'array' => 'Le tableau :attribute doit contenir au moins :value éléments.', + 'file' => 'La taille du fichier de :attribute doit être supérieure ou égale à :value kilo-octets.', + 'numeric' => 'La valeur de :attribute doit être supérieure ou égale à :value.', + 'string' => 'Le texte :attribute doit contenir au moins :value caractères.', + ], + 'hex_color' => 'Le champ :attribute doit être une couleur hexadécimale valide.', + 'image' => 'Le champ :attribute doit être une image.', + 'in' => 'Le champ :attribute est invalide.', + 'in_array' => 'Le champ :attribute n\'existe pas dans :other.', + 'in_array_keys' => 'Le champ :attribute doit contenir au moins l\'une des clés suivantes : :values.', + 'inco_id' => 'Le champ :attribute doit être un identifiant inco valide', + 'integer' => 'Le champ :attribute doit être un entier.', + 'ip' => 'Le champ :attribute doit être une adresse IP valide.', + 'ipv4' => 'Le champ :attribute doit être une adresse IPv4 valide.', + 'ipv6' => 'Le champ :attribute doit être une adresse IPv6 valide.', + 'json' => 'Le champ :attribute doit être un document JSON valide.', + 'list' => 'Le champ :attribute doit être une liste.', + 'lowercase' => 'Le champ :attribute doit être en minuscules.', + 'lt' => [ + 'array' => 'Le tableau :attribute doit contenir moins de :value éléments.', + 'file' => 'La taille du fichier de :attribute doit être inférieure à :value kilo-octets.', + 'numeric' => 'La valeur de :attribute doit être inférieure à :value.', + 'string' => 'Le texte :attribute doit contenir moins de :value caractères.', + ], + 'lte' => [ + 'array' => 'Le tableau :attribute doit contenir au plus :value éléments.', + 'file' => 'La taille du fichier de :attribute doit être inférieure ou égale à :value kilo-octets.', + 'numeric' => 'La valeur de :attribute doit être inférieure ou égale à :value.', + 'string' => 'Le texte :attribute doit contenir au plus :value caractères.', + ], + 'mac_address' => 'Le champ :attribute doit être une adresse MAC valide.', + 'matricule' => 'Le champ :attribute doit être un matricule valide', + 'max' => [ + 'array' => 'Le tableau :attribute ne peut pas contenir plus que :max éléments.', + 'file' => 'La taille du fichier de :attribute ne peut pas dépasser :max kilo-octets.', + 'numeric' => 'La valeur de :attribute ne peut pas être supérieure à :max.', + 'string' => 'Le texte de :attribute ne peut pas contenir plus de :max caractères.', + ], + 'max_digits' => 'Le champ :attribute ne doit pas avoir plus de :max chiffres.', + 'mimes' => 'Le champ :attribute doit être un fichier de type : :values.', + 'mimetypes' => 'Le champ :attribute doit être un fichier de type : :values.', + 'min' => [ + 'array' => 'Le tableau :attribute doit contenir au moins :min éléments.', + 'file' => 'La taille du fichier de :attribute doit être supérieure ou égale à :min kilo-octets.', + 'numeric' => 'La valeur de :attribute doit être supérieure ou égale à :min.', + 'string' => 'Le texte de :attribute doit contenir au moins :min caractères.', + ], + 'min_digits' => 'Le champ :attribute doit avoir au moins :min chiffres.', + 'missing' => 'Le champ :attribute doit être manquant.', + 'missing_if' => 'Le champ :attribute doit être manquant quand :other a la valeur :value.', + 'missing_unless' => 'Le champ :attribute doit être manquant sauf si :other a la valeur :value.', + 'missing_with' => 'Le champ :attribute doit être manquant quand :values est présent.', + 'missing_with_all' => 'Le champ :attribute doit être manquant quand :values sont présents.', + 'multiple_of' => 'La valeur de :attribute doit être un multiple de :value', + 'not_in' => 'Le champ :attribute sélectionné n\'est pas valide.', + 'not_regex' => 'Le format du champ :attribute n\'est pas valide.', + 'numeric' => 'Le champ :attribute doit contenir un nombre.', + 'password' => [ + 'letters' => 'Le champ :attribute doit contenir au moins une lettre.', + 'mixed' => 'Le champ :attribute doit contenir au moins une majuscule et une minuscule.', + 'numbers' => 'Le champ :attribute doit contenir au moins un chiffre.', + 'symbols' => 'Le champ :attribute doit contenir au moins un symbole.', + 'uncompromised' => 'La valeur du champ :attribute est apparue dans une fuite de données. Veuillez choisir une valeur différente.', + ], + 'phone' => 'Le champ :attribute doit être un numero de téléphone valide', + 'postal_code' => 'Le champ :attribute doit être un code postal valide.', + 'present' => 'Le champ :attribute doit être présent.', + 'present_if' => 'Le champ :attribute doit être présent lorsque :other est :value.', + 'present_unless' => 'Le champ :attribute doit être présent sauf si :other vaut :value.', + 'present_with' => 'Le champ :attribute doit être présent lorsque :values est présent.', + 'present_with_all' => 'Le champ :attribute doit être présent lorsque :values sont présents.', + 'prohibited' => 'Le champ :attribute est interdit.', + 'prohibited_if' => 'Le champ :attribute est interdit quand :other a la valeur :value.', + 'prohibited_if_accepted' => 'Le champ :attribute est interdit quand :other a été accepté.', + 'prohibited_if_declined' => 'Le champ :attribute est interdit quand :other a été refusé.', + 'prohibited_unless' => 'Le champ :attribute est interdit à moins que :other est l\'une des valeurs :values.', + 'prohibits' => 'Le champ :attribute interdit :other d\'être présent.', + 'regex' => 'Le format du champ :attribute est invalide.', + 'required' => 'Le champ :attribute est obligatoire.', + 'required_array_keys' => 'Le champ :attribute doit contenir des entrées pour : :values.', + 'required_if' => 'Le champ :attribute est obligatoire quand la valeur de :other est :value.', + 'required_if_accepted' => 'Le champ :attribute est obligatoire quand le champ :other a été accepté.', + 'required_if_declined' => 'Le champ :attribute est obligatoire quand le champ :other a été refusé.', + 'required_unless' => 'Le champ :attribute est obligatoire sauf si :other est :values.', + 'required_with' => 'Le champ :attribute est obligatoire quand :values est présent.', + 'required_with_all' => 'Le champ :attribute est obligatoire quand :values sont présents.', + 'required_without' => 'Le champ :attribute est obligatoire quand :values n\'est pas présent.', + 'required_without_all' => 'Le champ :attribute est requis quand aucun de :values n\'est présent.', + 'same' => 'Les champs :attribute et :other doivent être identiques.', + 'size' => [ + 'array' => 'Le tableau :attribute doit contenir :size éléments.', + 'file' => 'La taille du fichier de :attribute doit être de :size kilo-octets.', + 'numeric' => 'La valeur de :attribute doit être :size.', + 'string' => 'Le texte de :attribute doit contenir :size caractères.', + ], + 'starts_with' => 'Le champ :attribute doit commencer avec une des valeurs suivantes : :values', + 'string' => 'Le champ :attribute doit être une chaîne de caractères.', + 'timezone' => 'Le champ :attribute doit être un fuseau horaire valide.', + 'ulid' => 'Le champ :attribute doit être un ULID valide.', + 'unique' => 'La valeur du champ :attribute est déjà utilisée.', + 'uploaded' => 'Le fichier du champ :attribute n\'a pu être téléversé.', + 'uppercase' => 'Le champ :attribute doit être en majuscules.', + 'url' => 'Le format de l\'URL de :attribute n\'est pas valide.', + 'uuid' => 'Le champ :attribute doit être un UUID valide.', + 'attributes' => [ + 'address' => 'adresse', + 'affiliate_url' => 'URL d\'affiliation', + 'age' => 'âge', + 'amount' => 'montant', + 'announcement' => 'annonce', + 'area' => 'zone', + 'audience_prize' => 'prix du public', + 'audience_winner' => 'gagnant du public', + 'available' => 'disponible', + 'birthday' => 'anniversaire', + 'body' => 'corps', + 'city' => 'ville', + 'code' => 'code d\'inscription', + 'color' => 'color', + 'company' => 'entreprise', + 'compilation' => 'compilation', + 'concept' => 'concept', + 'conditions' => 'conditions', + 'content' => 'contenu', + 'contest' => 'contest', + 'country' => 'pays', + 'cover' => 'couverture', + 'created_at' => 'date de création', + 'creator' => 'créateur', + 'currency' => 'devise', + 'current_password' => 'mot de passe actuel', + 'customer' => 'client', + 'date' => 'date', + 'date_of_birth' => 'date de naissance', + 'dates' => 'rendez-vous', + 'day' => 'jour', + 'deleted_at' => 'date de suppression', + 'description' => 'description', + 'display_type' => 'type d\'affichage', + 'district' => 'quartier', + 'duration' => 'durée', + 'email' => 'adresse e-mail', + 'excerpt' => 'extrait', + 'filter' => 'filtre', + 'finished_at' => 'date de fin', + 'first_name' => 'prénom', + 'gender' => 'genre', + 'grand_prize' => 'grand prix', + 'group' => 'groupe', + 'hour' => 'heure', + 'image' => 'image', + 'image_desktop' => 'image de bureau', + 'image_main' => 'image principale', + 'image_mobile' => 'image mobile', + 'images' => 'images', + 'is_audience_winner' => 'est le gagnant du public', + 'is_hidden' => 'est caché', + 'is_subscribed' => 'est abonné', + 'is_visible' => 'est visible', + 'is_winner' => 'est gagnant', + 'items' => 'articles', + 'key' => 'clé', + 'last_name' => 'nom de famille', + 'lesson' => 'leçon', + 'line_address_1' => 'ligne d\'adresse 1', + 'line_address_2' => 'ligne d\'adresse 2', + 'login' => 'identifiant', + 'matricule' => 'matricule', + 'message' => 'message', + 'middle_name' => 'deuxième prénom', + 'minute' => 'minute', + 'mobile' => 'portable', + 'month' => 'mois', + 'name' => 'nom', + 'national_code' => 'code national', + 'number' => 'numéro', + 'password' => 'mot de passe', + 'password_confirmation' => 'confirmation du mot de passe', + 'phone' => 'téléphone', + 'photo' => 'photo', + 'portfolio' => 'portefeuille', + 'postal_code' => 'code postal', + 'preview' => 'aperçu', + 'price' => 'prix', + 'product_id' => 'identifiant du produit', + 'product_uid' => 'UID du produit', + 'product_uuid' => 'UUID du produit', + 'promo_code' => 'code promo', + 'province' => 'région', + 'quantity' => 'quantité', + 'reason' => 'raison', + 'recaptcha_response_field' => 'champ de réponse reCAPTCHA', + 'referee' => 'arbitre', + 'referees' => 'arbitres', + 'region' => 'region', + 'reject_reason' => 'motif de rejet', + 'remember' => 'se souvenir', + 'restored_at' => 'date de restauration', + 'result_text_under_image' => 'texte de résultat sous l\'image', + 'role' => 'rôle', + 'rule' => 'règle', + 'rules' => 'règles', + 'second' => 'seconde', + 'sex' => 'sexe', + 'shipment' => 'expédition', + 'short_text' => 'texte court', + 'size' => 'taille', + 'skills' => 'compétences', + 'slug' => 'slug', + 'specialization' => 'spécialisation', + 'started_at' => 'date de début', + 'state' => 'état', + 'status' => 'statut', + 'street' => 'rue', + 'student' => 'étudiant', + 'subject' => 'sujet', + 'tag' => 'mot clé', + 'tags' => 'mots clés', + 'teacher' => 'professeur', + 'terms' => 'conditions', + 'test_description' => 'description du test', + 'test_locale' => 'localisation du test', + 'test_name' => 'nom du test', + 'text' => 'texte', + 'time' => 'heure', + 'timezone' => 'fuseau horaire', + 'title' => 'titre', + 'type' => 'type', + 'updated_at' => 'date de mise à jour', + 'user' => 'utilisateur', + 'username' => 'nom d\'utilisateur', + 'value' => 'valeur', + 'winner' => 'gagnant', + 'work' => 'travail', + 'year' => 'année', + ], + 'custom' => [ + 'attributes' => [ + 'allergens' => 'Allergènes', + 'answer' => 'réponse', + 'associated_products' => 'produits associés', + 'brand' => 'marque', + 'connected' => 'limiter aux utilisateurs connectés', + 'date_end_orderable' => 'date d\'indisponibilité à la commande', + 'date_end_show' => 'date de fin d\'affichage', + 'date_start_orderable' => 'date disponibilité à la commande', + 'date_start_show' => 'date de début d\'affichage', + 'default' => 'par défaut', + 'discount_type' => 'type de remise', + 'discount_value' => 'valeur de la remise', + 'image_large' => 'image large', + 'inco_id' => 'code inco', + 'ingredients' => 'Ingrédients', + 'invoicing_unit' => 'unite de facturation', + 'is_old_price_displayed' => 'affichage de l\'ancien prix', + 'label' => 'libellé', + 'latitude' => 'latitude', + 'link' => 'lien url', + 'link_label' => 'texte du lien url', + 'link_new_tab' => 'ouvrir le lien dans un nouvel onglet', + 'longitude' => 'longitude', + 'no_art' => 'identifiant inco', + 'nutriscore' => 'Nutriscore', + 'nutriscore_args' => 'Arguments Nutriscore', + 'nv_carb_g' => 'Glucides (g)', + 'nv_daily_carb' => 'Apport journalier en glucides (%)', + 'nv_daily_energy' => 'Apport journalier en énergie (%)', + 'nv_daily_fat' => 'Apport journalier en matières grasses (%)', + 'nv_daily_fiber' => 'Apport journalier en fibres (%)', + 'nv_daily_protein' => 'Apport journalier en protéines (%)', + 'nv_daily_salt' => 'Apport journalier en sel (%)', + 'nv_daily_sat_fat' => 'Apport journalier en acides gras saturés (%)', + 'nv_daily_sugar' => 'Apport journalier en sucres (%)', + 'nv_fat_g' => 'Matières grasses (g)', + 'nv_fiber_g' => 'Fibres (g)', + 'nv_kcal' => 'Énergie (kcal)', + 'nv_kj' => 'Énergie (kJ)', + 'nv_protein_g' => 'Protéines (g)', + 'nv_ref_weight_g' => 'Poids de référence (g)', + 'nv_salt_g' => 'Sel (g)', + 'nv_sat_fat_g' => 'Acides gras saturés (g)', + 'nv_serving_carb_g' => 'Glucides par portion (g)', + 'nv_serving_fat_g' => 'Matières grasses par portion (g)', + 'nv_serving_fiber_g' => 'Fibres par portion (g)', + 'nv_serving_kcal' => 'Énergie par portion (kcal)', + 'nv_serving_kj' => 'Énergie par portion (kJ)', + 'nv_serving_protein_g' => 'Protéines par portion (g)', + 'nv_serving_salt_g' => 'Sel par portion (g)', + 'nv_serving_sat_fat_g' => 'Acides gras saturés par portion (g)', + 'nv_serving_size_g' => 'Taille d\'une portion (g)', + 'nv_serving_sugar_g' => 'Sucres par portion (g)', + 'nv_sugar_g' => 'Sucres (g)', + 'object' => 'objet', + 'ok_cgv' => 'conditions générales de vente', + 'optin' => 'inscription à la newsletter', + 'order' => 'ordre', + 'order_date' => 'date de commande', + 'order_date_end' => 'date de commande fin', + 'order_date_start' => 'date de commande début', + 'order_deadline_at' => 'date limite de commande', + 'order_pickup_end' => 'date de retrait fin', + 'order_pickup_start' => 'date de retrait début', + 'order_status' => 'état de la commande', + 'order_unit' => 'unité de commande', + 'page' => 'page', + 'per_page' => 'par page', + 'pickup_date' => 'date de retrait', + 'picture_alt' => 'texte alternatif à l\'image', + 'picture_large' => 'image large', + 'picture_large_alt' => 'texte alternatif à l\'image large', + 'picture_large_title' => 'titre de l\'image large', + 'picture_title' => 'titre de l\'image', + 'preparation' => 'Préparation', + 'postal_address' => 'adresse postale', + 'question' => 'question', + 'reference' => 'référence', + 'repeat_frequency' => 'fréquence de répétition', + 'repeatable' => 'répétable', + 'replacement_date' => 'jour de remplacement', + 'sell_unit' => 'unité de vente', + 'selling_argument' => 'Argumentaire de vente', + 'seo_description' => 'balise description', + 'seo_title' => 'balise titre', + 'servings' => 'Portions', + 'short_description' => 'description courte', + 'star' => 'mis en avant', + 'status' => 'publication', + 'stock' => 'stock', + 'tax_rate' => 'taux de taxation', + 'timeslot' => 'créneau', + 'total' => 'montant', + 'weight' => 'poids', + 'weight_unit' => 'unite de poids', + 'weight_variable' => 'poids variable', + ], + 'birth_date' => [ + 'before_or_equal' => 'Vous devez être majeur pour vous inscrire.', + 'date' => 'Veuillez entrer une date de naissance valide.', + 'date_format' => 'Veuillez entrer une date de naissance valide.', + ], + 'file' => [ + 'max' => 'La taille du fichier ne peut pas dépasser :max kilo-octets.', + 'mimes' => 'Le fichier doit être de type : :values.', + ], + 'has_picture' => [ + 'file_does_not_exist' => ':attribute n\'existe pas dans le système de fichier', + 'file_not_readable' => ':attribute n\'est pas lisible ou a expiré', + 'height_between' => ':attribute la hauteur doit être comprise entre :min et :max', + 'height_equal' => ':attribute la hauteur doit être de :value', + 'weight_max' => ':attribute le poids doit être de max :value Kb', + 'width_between' => ':attribute la largeur doit être comprise entre :min et :max', + 'width_equal' => ':attribute la largeur doit être de :value', + ], + 'of_the' => [ + 'female' => 'de la ', + 'male' => 'du ', + 'plural' => 'des ', + 'vowel' => 'de l\'', + ], + 'ok_cgu_privacy' => [ + 'accepted' => 'Vous devez accepter les conditions générales et la politique de gestion des données personnelles.', + ], + 'ok_cgv' => [ + 'accepted' => 'Vous devez accepter les conditions générales de vente.', + ], + 'selectedcreneau' => [ + 'required' => 'Vous devez choisir un horaire de retrait pour votre commande.', + ], + 'selectedmagasin' => [ + 'required' => 'Vous devez choisir un point de retrait pour votre commande.', + ], + ], +]; diff --git a/lang/fr/vue.php b/lang/fr/vue.php new file mode 100644 index 00000000..87f7b821 --- /dev/null +++ b/lang/fr/vue.php @@ -0,0 +1,44 @@ +<?php + +declare(strict_types=1); + +return [ + 'ImageInputComponent' => [ + 'choose_a_file' => 'Choisir un fichier', + 'change_source_picture' => 'Modifier l\'image source', + 'view_source_picture' => 'Voir l\'image', + 'resize_source_picture' => 'Redimensionner l\'image', + 'resized_source_picture' => 'Image redimensionnée', + 'preview_picture' => 'Aperçu de l\'image', + 'change_picture_before_import' => 'Modification de l\'image avant l\'importation', + 'close_window' => 'Fermer la fenêtre', + 'close_and_validate' => 'Valider le contenu et fermer la fenêtre', + 'close_window_without_validation' => 'Fermer la fenêtre sans valider le contenu', + 'zoom_in' => 'Zoom avant', + 'zoom_out' => 'Zoom arrière', + 'move_left' => 'Déplacer vers la gauche', + 'move_right' => 'Déplacer vers la droite', + 'move_up' => 'Déplacer en vers le haut', + 'move_down' => 'Déplacer en vers le bas', + 'mirror_horizontal' => 'Miroir horizontal', + 'mirror_vertical' => 'Miroir vertical', + 'rotation' => 'Rotation', + 'rotate_rewind' => 'Rotation dans le sens inverse des aiguilles d\'une montre', + 'rotate' => 'Rotation dans le sens des aiguilles d\'une montre', + 'degres' => ':deg degrés', + 'validate' => 'Valider', + 'preview' => 'Prévisualisation', + 'reset_image' => 'Réinitialiser l\'image', + 'width' => 'largeur :valuepx', + 'height' => 'hauteur :valuepx', + 'remove_picture' => 'Supprimer l\'image', + ], + 'WordCounterComponent' => [ + 'words' => 'Mots', + 'characters' => 'Caractères', + ], + 'PasswordVisibility' => [ + 'hide' => 'Cacher le mot de passe', + 'show' => 'Dévoiler le mot de passe', + ], +]; diff --git a/manifest.yaml b/manifest.yaml index caec9126..65ea3535 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -1,4 +1,3 @@ ---- apiVersion: v1 kind: ConfigMap metadata: @@ -9,25 +8,40 @@ data: APP_KEY: "${APP_APP_KEY}" APP_DEBUG: "${APP_APP_DEBUG}" APP_URL: "https://${REDIRECT}${APP_DOMAIN}" + APP_CURRENCY: "${APP_APP_CURRENCY}" LOG_CHANNEL: "k8s" - DB_HOST: "${APP_DB_HOST}" + CACHE_STORE: "${APP_CACHE_STORE}" + QUEUE_CONNECTION: "${APP_QUEUE_CONNECTION}" + SESSION_DRIVER: "${APP_SESSION_DRIVER}" + FILESYSTEM_DISK: "${APP_FILESYSTEM_DISK}" + DB_HOST: "${APP_GLOBAL_OVH_MYSQL_HOST}" + DB_PORT: "${APP_GLOBAL_OVH_MYSQL_PORT}" DB_DATABASE: "${APP_DB_DATABASE}" + DB_CONNECTION: "mysql" DB_USERNAME: "${APP_DB_USERNAME}" DB_PASSWORD: "${APP_DB_PASSWORD}" - QUEUE_CONNECTION: "database" + MAIL_MAILER: "${APP_MAIL_MAILER}" MAIL_HOST: "${APP_MAIL_HOST}" MAIL_PORT: "${APP_MAIL_PORT}" MAIL_USERNAME: "${APP_MAIL_USERNAME}" MAIL_PASSWORD: "${APP_MAIL_PASSWORD}" MAIL_ENCRYPTION: "${APP_MAIL_ENCRYPTION}" + MAIL_SCHEME: "${APP_MAIL_SCHEME}" MAIL_FROM_ADDRESS: "${APP_MAIL_FROM_ADDRESS}" MAIL_FROM_NAME: "${APP_APP_NAME}" + MAIL_TO_CONTACT: "${APP_MAIL_TO_CONTACT}" + MAIL_TO_REGATE: "${APP_MAIL_TO_REGATE}" + SENTRY_LARAVEL_DSN: "${APP_SENTRY_LARAVEL_DSN}" CRM_ENDPOINT: "${APP_CRM_ENDPOINT}" CRM_TOKEN: "${APP_CRM_TOKEN}" CRM_PASSWORD: "${APP_CRM_PASSWORD}" - SENTRY_LARAVEL_DSN: "${APP_SENTRY_LARAVEL_DSN}" MATOMO_SITE_ID: "${APP_MATOMO_SITE_ID}" UWIL_ADMIN_SECURE_CIDR_LIST: "${APP_GLOBAL_UWIL_ADMIN_SECURE_CIDR_LIST}" + ARCADIA_API_ENDPOINT: "${APP_ARCADIA_API_ENDPOINT}" + ARCADIA_API_APIKEY: "${APP_ARCADIA_API_APIKEY}" + ARCADIA_API_SECRET: "${APP_ARCADIA_API_SECRET}" + SERIAL_CASTER_SEED: "${APP_SERIAL_CASTER_SEED}" + LDC_HEADQUARTERS_PHONE_RECEPTION: "${APP_LDC_HEADQUARTERS_PHONE_RECEPTION}" --- apiVersion: v1 kind: PersistentVolumeClaim @@ -58,6 +72,9 @@ spec: containers: - name: ${CI_PROJECT_PATH_SLUG}-container image: $IMAGE_TAG + env: + - name: XDG_CONFIG_HOME # For tinker + value: /tmp envFrom: - configMapRef: name: ${CI_PROJECT_PATH_SLUG}-config-map @@ -76,12 +93,7 @@ spec: lifecycle: preStop: exec: - command: - [ - "/bin/sh", - "-c", - "kill -s TERM 1; while test $(ps ax | grep -v grep | grep bash | wc -l) -gt 0; do sleep 2s; done", - ] + command: [ "/bin/sh", "-c", "kill -s TERM 1; while test $(ps ax | grep -v grep | grep bash | wc -l) -gt 0; do sleep 2s; done" ] resources: limits: cpu: "${APP_CI_CPU_LIMIT}" @@ -90,21 +102,21 @@ spec: cpu: "${APP_CI_CPU_REQUEST}" memory: "${APP_CI_MEMORY_REQUEST}" command: - - "bash" + - "bash" args: - - "k8s-queues.sh" + - "k8s-queues.sh" envFrom: - - configMapRef: - name: ${CI_PROJECT_PATH_SLUG}-config-map + - configMapRef: + name: ${CI_PROJECT_PATH_SLUG}-config-map volumeMounts: - - name: storage - mountPath: /app/srcs/storage + - name: storage + mountPath: /app/srcs/storage imagePullSecrets: - name: docker-registry-credentials securityContext: - runAsUser: 33 - runAsGroup: 33 - fsGroup: 33 + runAsUser: 82 + runAsGroup: 82 + fsGroup: 82 fsGroupChangePolicy: "OnRootMismatch" volumes: - name: storage @@ -120,7 +132,7 @@ spec: app: ${CI_PROJECT_PATH_SLUG}-app ports: - port: 80 - targetPort: 443 + targetPort: 80 --- apiVersion: traefik.io/v1alpha1 kind: IngressRoute @@ -137,7 +149,8 @@ spec: - name: ${CI_PROJECT_PATH_SLUG}-service port: 80 middlewares: - - name: redirect-no-www-to-www + - name: redirect-no-www-to-www + tls: secretName: ${CRT_TLS_NAME} --- @@ -157,38 +170,38 @@ spec: affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - ${CI_PROJECT_PATH_SLUG}-app - topologyKey: "kubernetes.io/hostname" - namespaces: [$KUBE_NAMESPACE] + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - ${CI_PROJECT_PATH_SLUG}-app + topologyKey: "kubernetes.io/hostname" + namespaces: [ $KUBE_NAMESPACE ] containers: - - name: ${CI_PROJECT_PATH_SLUG}-scheduled - image: $IMAGE_TAG - imagePullPolicy: IfNotPresent - command: - - "php" - args: - - "artisan" - - "schedule:run" - envFrom: - - configMapRef: - name: ${CI_PROJECT_PATH_SLUG}-config-map - volumeMounts: - - name: storage - mountPath: /app/srcs/storage - imagePullSecrets: - - name: docker-registry-credentials - volumes: + - name: ${CI_PROJECT_PATH_SLUG}-scheduled + image: $IMAGE_TAG + imagePullPolicy: IfNotPresent + command: + - "php" + args: + - "artisan" + - "schedule:run" + envFrom: + - configMapRef: + name: ${CI_PROJECT_PATH_SLUG}-config-map + volumeMounts: - name: storage - persistentVolumeClaim: - claimName: ${CI_PROJECT_PATH_SLUG}-pvc-storage + mountPath: /app/srcs/storage + imagePullSecrets: + - name: docker-registry-credentials + volumes: + - name: storage + persistentVolumeClaim: + claimName: ${CI_PROJECT_PATH_SLUG}-pvc-storage securityContext: - runAsUser: 33 - runAsGroup: 33 - fsGroup: 33 + runAsUser: 82 + runAsGroup: 82 + fsGroup: 82 fsGroupChangePolicy: "OnRootMismatch" restartPolicy: OnFailure diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index e90f6356..00000000 --- a/package-lock.json +++ /dev/null @@ -1,17412 +0,0 @@ -{ - "name": "srcs", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "devDependencies": { - "@fancyapps/fancybox": "^3.5.7", - "@fortawesome/fontawesome-free": "^6.2.0", - "@ldc-web/cookie-notice": "^6.1.0", - "@types/bootstrap": "^5.2.1", - "@voerro/vue-tagsinput": "^2.7.1", - "axios": "^0.21.1", - "bootstrap": "^5.2.0", - "cross-env": "^7.0", - "jquery": "^3.6", - "laravel-mix": "^6.0.49", - "lodash": "^4.17.19", - "popper.js": "^1.12", - "resolve-url-loader": "^3.1.0", - "sass": "^1.28.0", - "sass-loader": "^8.0.2", - "simplebar": "^5.3.8", - "swiper": "^6.3.4", - "tippy.js": "^6.3.1", - "vue": "^2.7.10", - "vue-content-placeholders": "^0.2.1", - "vue-loader": "^15.10.0", - "vue-smooth-dnd": "^0.8.1", - "vue-template-compiler": "^2.6.12", - "vuex": "^3.6.2" - } - }, - "node_modules/@ampproject/remapping": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", - "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", - "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.1.0", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", - "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.25.9", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/compat-data": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.19.0.tgz", - "integrity": "sha512-y5rqgTTPTmaF5e2nVhOxw+Ur9HDJLsWb6U/KpgUzRZEdPfE6VOubXBKLdbcUTijzRptednSBDQbYZBOSqJxpJw==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.19.0.tgz", - "integrity": "sha512-reM4+U7B9ss148rh2n1Qs9ASS+w94irYXga7c2jaQv9RVzpS7Mv1a9rnYYwuDa45G+DkORt9g6An2k/V4d9LbQ==", - "dev": true, - "dependencies": { - "@ampproject/remapping": "^2.1.0", - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.19.0", - "@babel/helper-compilation-targets": "^7.19.0", - "@babel/helper-module-transforms": "^7.19.0", - "@babel/helpers": "^7.19.0", - "@babel/parser": "^7.19.0", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.1", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/generator": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.2.tgz", - "integrity": "sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.26.2", - "@babel/types": "^7.26.0", - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25", - "jsesc": "^3.0.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz", - "integrity": "sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz", - "integrity": "sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw==", - "dev": true, - "dependencies": { - "@babel/helper-explode-assignable-expression": "^7.18.6", - "@babel/types": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.0.tgz", - "integrity": "sha512-Ai5bNWXIvwDvWM7njqsG3feMlL9hCVQsPYXodsZyLwshYkZVJt59Gftau4VrE8S9IT9asd2uSP1hG6wCNw+sXA==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.19.0", - "@babel/helper-validator-option": "^7.18.6", - "browserslist": "^4.20.2", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.19.0.tgz", - "integrity": "sha512-NRz8DwF4jT3UfrmUoZjd0Uph9HQnP30t7Ash+weACcyNkiYTywpIjDBgReJMKgr+n86sn2nPVVmJ28Dm053Kqw==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", - "@babel/helper-member-expression-to-functions": "^7.18.9", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/helper-replace-supers": "^7.18.9", - "@babel/helper-split-export-declaration": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.19.0.tgz", - "integrity": "sha512-htnV+mHX32DF81amCDrwIDr8nrp1PTm+3wfBN9/v8QJOLEioOCOG7qNyq0nHeFiWbT3Eb7gsPwEmV64UCQ1jzw==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "regexpu-core": "^5.1.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.2.tgz", - "integrity": "sha512-r9QJJ+uDWrd+94BSPcP6/de67ygLtvVy6cK4luE6MOuDsZIdoaPBnfSpbO/+LTifjPckbKXRuI9BB/Z2/y3iTg==", - "dev": true, - "dependencies": { - "@babel/helper-compilation-targets": "^7.17.7", - "@babel/helper-plugin-utils": "^7.16.7", - "debug": "^4.1.1", - "lodash.debounce": "^4.0.8", - "resolve": "^1.14.2", - "semver": "^6.1.2" - }, - "peerDependencies": { - "@babel/core": "^7.4.0-0" - } - }, - "node_modules/@babel/helper-define-polyfill-provider/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/helper-environment-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", - "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-explode-assignable-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz", - "integrity": "sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-function-name": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz", - "integrity": "sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==", - "dev": true, - "dependencies": { - "@babel/template": "^7.18.10", - "@babel/types": "^7.19.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", - "dev": true, - "dependencies": { - "@babel/types": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.18.9.tgz", - "integrity": "sha512-RxifAh2ZoVU67PyKIO4AMi1wTenGfMR/O/ae0CCRqwgBAt5v7xjdtRw7UoSbsreKrQn5t7r89eruK/9JjYHuDg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-imports": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", - "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz", - "integrity": "sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ==", - "dev": true, - "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-simple-access": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/helper-validator-identifier": "^7.18.6", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz", - "integrity": "sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-plugin-utils": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz", - "integrity": "sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz", - "integrity": "sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-wrap-function": "^7.18.9", - "@babel/types": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-replace-supers": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.18.9.tgz", - "integrity": "sha512-dNsWibVI4lNT6HiuOIBr1oyxo40HvIVmbwPUm3XZ7wMh4k2WxrxTqZwSqw/eEmXDS9np0ey5M2bz9tBmO9c+YQ==", - "dev": true, - "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-member-expression-to-functions": "^7.18.9", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/traverse": "^7.18.9", - "@babel/types": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-simple-access": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz", - "integrity": "sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==", - "dev": true, - "dependencies": { - "@babel/types": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.18.9.tgz", - "integrity": "sha512-imytd2gHi3cJPsybLRbmFrF7u5BIEuI2cNheyKi3/iOBC63kNn3q8Crn2xVuESli0aM4KYsyEqKyS7lFL8YVtw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", - "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-option": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", - "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-wrap-function": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.19.0.tgz", - "integrity": "sha512-txX8aN8CZyYGTwcLhlk87KRqncAzhh5TpQamZUa0/u3an36NtDpUP6bQgBCBcLeBs09R/OwQu3OjK0k/HwfNDg==", - "dev": true, - "dependencies": { - "@babel/helper-function-name": "^7.19.0", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.19.0.tgz", - "integrity": "sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg==", - "dev": true, - "dependencies": { - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/parser": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", - "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.26.0" - }, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz", - "integrity": "sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.18.9.tgz", - "integrity": "sha512-AHrP9jadvH7qlOj6PINbgSuphjQUAK7AOT7DPjBo9EHoLhQTnnK5u45e1Hd4DbSQEO9nqPWtQ89r+XEOWFScKg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/helper-skip-transparent-expression-wrappers": "^7.18.9", - "@babel/plugin-proposal-optional-chaining": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.13.0" - } - }, - "node_modules/@babel/plugin-proposal-async-generator-functions": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.19.0.tgz", - "integrity": "sha512-nhEByMUTx3uZueJ/QkJuSlCfN4FGg+xy+vRsfGQGzSauq5ks2Deid2+05Q3KhfaUjvec1IGhw/Zm3cFm8JigTQ==", - "dev": true, - "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-plugin-utils": "^7.19.0", - "@babel/helper-remap-async-to-generator": "^7.18.9", - "@babel/plugin-syntax-async-generators": "^7.8.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-class-properties": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz", - "integrity": "sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-class-static-block": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.18.6.tgz", - "integrity": "sha512-+I3oIiNxrCpup3Gi8n5IGMwj0gOCAjcJUSQEcotNnCCPMEnixawOQ+KeJPlgfjzx+FKQ1QSyZOWe7wmoJp7vhw==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-class-static-block": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.12.0" - } - }, - "node_modules/@babel/plugin-proposal-dynamic-import": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz", - "integrity": "sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-dynamic-import": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-export-namespace-from": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz", - "integrity": "sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-json-strings": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz", - "integrity": "sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-json-strings": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.18.9.tgz", - "integrity": "sha512-128YbMpjCrP35IOExw2Fq+x55LMP42DzhOhX2aNNIdI9avSWl2PI0yuBWarr3RYpZBSPtabfadkH2yeRiMD61Q==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz", - "integrity": "sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-numeric-separator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz", - "integrity": "sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-numeric-separator": "^7.10.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-object-rest-spread": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.18.9.tgz", - "integrity": "sha512-kDDHQ5rflIeY5xl69CEqGEZ0KY369ehsCIEbTGb4siHG5BE9sga/T0r0OUwyZNLMmZE79E1kbsqAjwFCW4ds6Q==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.18.8", - "@babel/helper-compilation-targets": "^7.18.9", - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.18.8" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-optional-catch-binding": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz", - "integrity": "sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-optional-chaining": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.18.9.tgz", - "integrity": "sha512-v5nwt4IqBXihxGsW2QmCWMDS3B3bzGIk/EQVZz2ei7f3NJl8NzAJVvUmpDW5q1CRNY+Beb/k58UAH1Km1N411w==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/helper-skip-transparent-expression-wrappers": "^7.18.9", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-private-methods": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz", - "integrity": "sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-private-property-in-object": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.18.6.tgz", - "integrity": "sha512-9Rysx7FOctvT5ouj5JODjAFAkgGoudQuLPamZb0v1TGLpapdNaftzifU8NTWQm0IRjqoYypdrSmyWgkocDQ8Dw==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-unicode-property-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz", - "integrity": "sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==", - "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-class-properties": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", - "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-class-static-block": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", - "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", - "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-export-namespace-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", - "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-import-assertions": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.18.6.tgz", - "integrity": "sha512-/DU3RXad9+bZwrgWJQKbr39gYbJpLJHezqEzRzi/BHRlJ9zsQb4CK2CA/5apllXNomwA1qHwzvHl+AdEmC5krQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-private-property-in-object": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", - "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-top-level-await": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", - "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.18.6.tgz", - "integrity": "sha512-9S9X9RUefzrsHZmKMbDXxweEH+YlE8JJEuat9FdvW9Qh1cw7W64jELCtWNkPBPX5En45uy28KGvA/AySqUh8CQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.18.6.tgz", - "integrity": "sha512-ARE5wZLKnTgPW7/1ftQmSi1CmkqqHo2DNmtztFhvgtOWSDfq0Cq9/9L+KnZNYSNrydBekhW3rwShduf59RoXag==", - "dev": true, - "dependencies": { - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/helper-remap-async-to-generator": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz", - "integrity": "sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.18.9.tgz", - "integrity": "sha512-5sDIJRV1KtQVEbt/EIBwGy4T01uYIo4KRB3VUqzkhrAIOGx7AoctL9+Ux88btY0zXdDyPJ9mW+bg+v+XEkGmtw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-classes": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.19.0.tgz", - "integrity": "sha512-YfeEE9kCjqTS9IitkgfJuxjcEtLUHMqa8yUJ6zdz8vR7hKuo6mOy2C05P0F1tdMmDCeuyidKnlrw/iTppHcr2A==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-compilation-targets": "^7.19.0", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/helper-plugin-utils": "^7.19.0", - "@babel/helper-replace-supers": "^7.18.9", - "@babel/helper-split-export-declaration": "^7.18.6", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.18.9.tgz", - "integrity": "sha512-+i0ZU1bCDymKakLxn5srGHrsAPRELC2WIbzwjLhHW9SIE1cPYkLCL0NlnXMZaM1vhfgA2+M7hySk42VBvrkBRw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.18.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.18.13.tgz", - "integrity": "sha512-TodpQ29XekIsex2A+YJPj5ax2plkGa8YYY6mFjCohk/IG9IY42Rtuj1FuDeemfg2ipxIFLzPeA83SIBnlhSIow==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz", - "integrity": "sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg==", - "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz", - "integrity": "sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz", - "integrity": "sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw==", - "dev": true, - "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-for-of": { - "version": "7.18.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.8.tgz", - "integrity": "sha512-yEfTRnjuskWYo0k1mHUqrVWaZwrdq8AYbfrpqULOJOaucGSp4mNMVps+YtA8byoevxS/urwU75vyhQIxcCgiBQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-function-name": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz", - "integrity": "sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ==", - "dev": true, - "dependencies": { - "@babel/helper-compilation-targets": "^7.18.9", - "@babel/helper-function-name": "^7.18.9", - "@babel/helper-plugin-utils": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-literals": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz", - "integrity": "sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-member-expression-literals": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz", - "integrity": "sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.18.6.tgz", - "integrity": "sha512-Pra5aXsmTsOnjM3IajS8rTaLCy++nGM4v3YR4esk5PCsyg9z8NA5oQLwxzMUtDBd8F+UmVza3VxoAaWCbzH1rg==", - "dev": true, - "dependencies": { - "@babel/helper-module-transforms": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", - "babel-plugin-dynamic-import-node": "^2.3.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.18.6.tgz", - "integrity": "sha512-Qfv2ZOWikpvmedXQJDSbxNqy7Xr/j2Y8/KfijM0iJyKkBTmWuvCA1yeH1yDM7NJhBW/2aXxeucLj6i80/LAJ/Q==", - "dev": true, - "dependencies": { - "@babel/helper-module-transforms": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/helper-simple-access": "^7.18.6", - "babel-plugin-dynamic-import-node": "^2.3.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.19.0.tgz", - "integrity": "sha512-x9aiR0WXAWmOWsqcsnrzGR+ieaTMVyGyffPVA7F8cXAGt/UxefYv6uSHZLkAFChN5M5Iy1+wjE+xJuPt22H39A==", - "dev": true, - "dependencies": { - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-module-transforms": "^7.19.0", - "@babel/helper-plugin-utils": "^7.19.0", - "@babel/helper-validator-identifier": "^7.18.6", - "babel-plugin-dynamic-import-node": "^2.3.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz", - "integrity": "sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ==", - "dev": true, - "dependencies": { - "@babel/helper-module-transforms": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.19.0.tgz", - "integrity": "sha512-HDSuqOQzkU//kfGdiHBt71/hkDTApw4U/cMVgKgX7PqfB3LOaK+2GtCEsBu1dL9CkswDm0Gwehht1dCr421ULQ==", - "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.19.0", - "@babel/helper-plugin-utils": "^7.19.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/plugin-transform-new-target": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz", - "integrity": "sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-object-super": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz", - "integrity": "sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/helper-replace-supers": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-parameters": { - "version": "7.18.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.18.8.tgz", - "integrity": "sha512-ivfbE3X2Ss+Fj8nnXvKJS6sjRG4gzwPMsP+taZC+ZzEGjAYlvENixmt1sZ5Ca6tWls+BlKSGKPJ6OOXvXCbkFg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-property-literals": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz", - "integrity": "sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.18.6.tgz", - "integrity": "sha512-poqRI2+qiSdeldcz4wTSTXBRryoq3Gc70ye7m7UD5Ww0nE29IXqMl6r7Nd15WBgRd74vloEMlShtH6CKxVzfmQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "regenerator-transform": "^0.15.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-reserved-words": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz", - "integrity": "sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-runtime": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.18.10.tgz", - "integrity": "sha512-q5mMeYAdfEbpBAgzl7tBre/la3LeCxmDO1+wMXRdPWbcoMjR3GiXlCLk7JBZVVye0bqTGNMbt0yYVXX1B1jEWQ==", - "dev": true, - "dependencies": { - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.9", - "babel-plugin-polyfill-corejs2": "^0.3.2", - "babel-plugin-polyfill-corejs3": "^0.5.3", - "babel-plugin-polyfill-regenerator": "^0.4.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-runtime/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz", - "integrity": "sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-spread": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.19.0.tgz", - "integrity": "sha512-RsuMk7j6n+r752EtzyScnWkQyuJdli6LdO5Klv8Yx0OfPVTcQkIUfS8clx5e9yHXzlnhOZF3CbQ8C2uP5j074w==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.19.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz", - "integrity": "sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz", - "integrity": "sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz", - "integrity": "sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-unicode-escapes": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz", - "integrity": "sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz", - "integrity": "sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA==", - "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/preset-env": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.19.0.tgz", - "integrity": "sha512-1YUju1TAFuzjIQqNM9WsF4U6VbD/8t3wEAlw3LFYuuEr+ywqLRcSXxFKz4DCEj+sN94l/XTDiUXYRrsvMpz9WQ==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.19.0", - "@babel/helper-compilation-targets": "^7.19.0", - "@babel/helper-plugin-utils": "^7.19.0", - "@babel/helper-validator-option": "^7.18.6", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.18.6", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.18.9", - "@babel/plugin-proposal-async-generator-functions": "^7.19.0", - "@babel/plugin-proposal-class-properties": "^7.18.6", - "@babel/plugin-proposal-class-static-block": "^7.18.6", - "@babel/plugin-proposal-dynamic-import": "^7.18.6", - "@babel/plugin-proposal-export-namespace-from": "^7.18.9", - "@babel/plugin-proposal-json-strings": "^7.18.6", - "@babel/plugin-proposal-logical-assignment-operators": "^7.18.9", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", - "@babel/plugin-proposal-numeric-separator": "^7.18.6", - "@babel/plugin-proposal-object-rest-spread": "^7.18.9", - "@babel/plugin-proposal-optional-catch-binding": "^7.18.6", - "@babel/plugin-proposal-optional-chaining": "^7.18.9", - "@babel/plugin-proposal-private-methods": "^7.18.6", - "@babel/plugin-proposal-private-property-in-object": "^7.18.6", - "@babel/plugin-proposal-unicode-property-regex": "^7.18.6", - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-class-properties": "^7.12.13", - "@babel/plugin-syntax-class-static-block": "^7.14.5", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-import-assertions": "^7.18.6", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5", - "@babel/plugin-syntax-top-level-await": "^7.14.5", - "@babel/plugin-transform-arrow-functions": "^7.18.6", - "@babel/plugin-transform-async-to-generator": "^7.18.6", - "@babel/plugin-transform-block-scoped-functions": "^7.18.6", - "@babel/plugin-transform-block-scoping": "^7.18.9", - "@babel/plugin-transform-classes": "^7.19.0", - "@babel/plugin-transform-computed-properties": "^7.18.9", - "@babel/plugin-transform-destructuring": "^7.18.13", - "@babel/plugin-transform-dotall-regex": "^7.18.6", - "@babel/plugin-transform-duplicate-keys": "^7.18.9", - "@babel/plugin-transform-exponentiation-operator": "^7.18.6", - "@babel/plugin-transform-for-of": "^7.18.8", - "@babel/plugin-transform-function-name": "^7.18.9", - "@babel/plugin-transform-literals": "^7.18.9", - "@babel/plugin-transform-member-expression-literals": "^7.18.6", - "@babel/plugin-transform-modules-amd": "^7.18.6", - "@babel/plugin-transform-modules-commonjs": "^7.18.6", - "@babel/plugin-transform-modules-systemjs": "^7.19.0", - "@babel/plugin-transform-modules-umd": "^7.18.6", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.19.0", - "@babel/plugin-transform-new-target": "^7.18.6", - "@babel/plugin-transform-object-super": "^7.18.6", - "@babel/plugin-transform-parameters": "^7.18.8", - "@babel/plugin-transform-property-literals": "^7.18.6", - "@babel/plugin-transform-regenerator": "^7.18.6", - "@babel/plugin-transform-reserved-words": "^7.18.6", - "@babel/plugin-transform-shorthand-properties": "^7.18.6", - "@babel/plugin-transform-spread": "^7.19.0", - "@babel/plugin-transform-sticky-regex": "^7.18.6", - "@babel/plugin-transform-template-literals": "^7.18.9", - "@babel/plugin-transform-typeof-symbol": "^7.18.9", - "@babel/plugin-transform-unicode-escapes": "^7.18.10", - "@babel/plugin-transform-unicode-regex": "^7.18.6", - "@babel/preset-modules": "^0.1.5", - "@babel/types": "^7.19.0", - "babel-plugin-polyfill-corejs2": "^0.3.2", - "babel-plugin-polyfill-corejs3": "^0.5.3", - "babel-plugin-polyfill-regenerator": "^0.4.0", - "core-js-compat": "^3.22.1", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/preset-env/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/preset-modules": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", - "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", - "@babel/plugin-transform-dotall-regex": "^7.4.4", - "@babel/types": "^7.4.4", - "esutils": "^2.0.2" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/runtime": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.19.0.tgz", - "integrity": "sha512-eR8Lo9hnDS7tqkO7NsV+mKvCmv5boaXFSZ70DnfhcgiEne8hv9oCEd36Klw74EtizEqLsy4YnW8UWwpBVolHZA==", - "dev": true, - "dependencies": { - "regenerator-runtime": "^0.13.4" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/template": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", - "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.25.9", - "@babel/parser": "^7.25.9", - "@babel/types": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", - "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.25.9", - "@babel/generator": "^7.25.9", - "@babel/parser": "^7.25.9", - "@babel/template": "^7.25.9", - "@babel/types": "^7.25.9", - "debug": "^4.3.1", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/types": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", - "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", - "dev": true, - "dependencies": { - "@babel/helper-string-parser": "^7.25.9", - "@babel/helper-validator-identifier": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/@discoveryjs/json-ext": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", - "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", - "dev": true, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/@fancyapps/fancybox": { - "version": "3.5.7", - "resolved": "https://registry.npmjs.org/@fancyapps/fancybox/-/fancybox-3.5.7.tgz", - "integrity": "sha512-rcEtu8t+WnmqIDV/Wfm1yvy/nDdwc7YV25j9HLxGC2/WOsUhk9rcWg2nB8g1BrjRt9zaoADdjHTU6ILYTJzBBg==", - "dev": true - }, - "node_modules/@fortawesome/fontawesome-free": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.2.0.tgz", - "integrity": "sha512-CNR7qRIfCwWHNN7FnKUniva94edPdyQzil/zCwk3v6k4R6rR2Fr8i4s3PM7n/lyfPA6Zfko9z5WDzFxG9SW1uQ==", - "dev": true, - "hasInstallScript": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", - "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.0.0", - "@jridgewell/sourcemap-codec": "^1.4.10" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", - "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", - "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25" - } - }, - "node_modules/@jridgewell/source-map/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", - "dev": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@juggle/resize-observer": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@juggle/resize-observer/-/resize-observer-3.4.0.tgz", - "integrity": "sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==", - "dev": true - }, - "node_modules/@ldc-web/cookie-notice": { - "version": "6.1.0", - "resolved": "https://lab.s-web.fr/api/v4/projects/50/packages/npm/@ldc-web/cookie-notice/-/@ldc-web/cookie-notice-6.1.0.tgz", - "integrity": "sha1-bzewvM6mGuWr3Ju8/HWkxXm60+A=", - "dev": true - }, - "node_modules/@leichtgewicht/ip-codec": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", - "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==", - "dev": true - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@popperjs/core": { - "version": "2.11.6", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz", - "integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" - } - }, - "node_modules/@trysound/sax": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", - "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==", - "dev": true, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/@types/babel__core": { - "version": "7.1.19", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.19.tgz", - "integrity": "sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } - }, - "node_modules/@types/babel__generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", - "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__traverse": { - "version": "7.18.1", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.1.tgz", - "integrity": "sha512-FSdLaZh2UxaMuLp9lixWaHq/golWTRWOnRsAXzDTDSDOQLuZb1nsdCt6pJSPWSEQt2eFZ2YVk3oYhn+1kLMeMA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.3.0" - } - }, - "node_modules/@types/body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", - "dev": true, - "dependencies": { - "@types/connect": "*", - "@types/node": "*" - } - }, - "node_modules/@types/bonjour": { - "version": "3.5.10", - "resolved": "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.10.tgz", - "integrity": "sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/bootstrap": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/@types/bootstrap/-/bootstrap-5.2.4.tgz", - "integrity": "sha512-jGNB81zuDHu1DPvBV7Ox3Z3eyzdWPNguYwrt0j7X90VExA8H7c6qxJh0cz5j3xp0XvSy1TYaP2pkyXCHeo8CaA==", - "dev": true, - "dependencies": { - "@popperjs/core": "^2.9.2" - } - }, - "node_modules/@types/clean-css": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@types/clean-css/-/clean-css-4.2.5.tgz", - "integrity": "sha512-NEzjkGGpbs9S9fgC4abuBvTpVwE3i+Acu9BBod3PUyjDVZcNsGx61b8r2PphR61QGPnn0JHVs5ey6/I4eTrkxw==", - "dev": true, - "dependencies": { - "@types/node": "*", - "source-map": "^0.6.0" - } - }, - "node_modules/@types/connect": { - "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/connect-history-api-fallback": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.3.5.tgz", - "integrity": "sha512-h8QJa8xSb1WD4fpKBDcATDNGXghFj6/3GRWG6dhmRcu0RX1Ubasur2Uvx5aeEwlf0MwblEC2bMzzMQntxnw/Cw==", - "dev": true, - "dependencies": { - "@types/express-serve-static-core": "*", - "@types/node": "*" - } - }, - "node_modules/@types/eslint": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", - "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", - "dev": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", - "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", - "dev": true, - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, - "node_modules/@types/estree": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true - }, - "node_modules/@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", - "dev": true, - "dependencies": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", - "@types/qs": "*", - "@types/serve-static": "*" - } - }, - "node_modules/@types/express-serve-static-core": { - "version": "4.17.30", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.30.tgz", - "integrity": "sha512-gstzbTWro2/nFed1WXtf+TtrpwxH7Ggs4RLYTLbeVgIkUQOI3WG/JKjgeOU1zXDvezllupjrf8OPIdvTbIaVOQ==", - "dev": true, - "dependencies": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*" - } - }, - "node_modules/@types/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", - "dev": true, - "dependencies": { - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "node_modules/@types/http-proxy": { - "version": "1.17.9", - "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.9.tgz", - "integrity": "sha512-QsbSjA/fSk7xB+UXlCT3wHBy5ai9wOcNDWwZAtud+jXhwOM3l+EYZh8Lng4+/6n8uar0J7xILzqftJdJ/Wdfkw==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/imagemin": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@types/imagemin/-/imagemin-8.0.0.tgz", - "integrity": "sha512-B9X2CUeDv/uUeY9CqkzSTfmsLkeJP6PkmXlh4lODBbf9SwpmNuLS30WzUOi863dgsjY3zt3gY5q2F+UdifRi1A==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/imagemin-gifsicle": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@types/imagemin-gifsicle/-/imagemin-gifsicle-7.0.1.tgz", - "integrity": "sha512-kUz6sUh0P95JOS0RGEaaemWUrASuw+dLsWIveK2UZJx74id/B9epgblMkCk/r5MjUWbZ83wFvacG5Rb/f97gyA==", - "dev": true, - "dependencies": { - "@types/imagemin": "*" - } - }, - "node_modules/@types/imagemin-mozjpeg": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@types/imagemin-mozjpeg/-/imagemin-mozjpeg-8.0.1.tgz", - "integrity": "sha512-kMQWEoKxxhlnH4POI3qfW9DjXlQfi80ux3l2b3j5R3eudSCoUIzKQLkfMjNJ6eMYnMWBcB+rfQOWqIzdIwFGKw==", - "dev": true, - "dependencies": { - "@types/imagemin": "*" - } - }, - "node_modules/@types/imagemin-optipng": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@types/imagemin-optipng/-/imagemin-optipng-5.2.1.tgz", - "integrity": "sha512-XCM/3q+HUL7v4zOqMI+dJ5dTxT+MUukY9KU49DSnYb/4yWtSMHJyADP+WHSMVzTR63J2ZvfUOzSilzBNEQW78g==", - "dev": true, - "dependencies": { - "@types/imagemin": "*" - } - }, - "node_modules/@types/imagemin-svgo": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@types/imagemin-svgo/-/imagemin-svgo-8.0.1.tgz", - "integrity": "sha512-YafkdrVAcr38U0Ln1C+L1n4SIZqC47VBHTyxCq7gTUSd1R9MdIvMcrljWlgU1M9O68WZDeQWUrKipKYfEOCOvQ==", - "dev": true, - "dependencies": { - "@types/imagemin": "*", - "@types/svgo": "^1" - } - }, - "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true - }, - "node_modules/@types/mime": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", - "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==", - "dev": true - }, - "node_modules/@types/minimatch": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", - "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", - "dev": true - }, - "node_modules/@types/node": { - "version": "18.7.16", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.16.tgz", - "integrity": "sha512-EQHhixfu+mkqHMZl1R2Ovuvn47PUw18azMJOTwSZr9/fhzHNGXAJ0ma0dayRVchprpCj0Kc1K1xKoWaATWF1qg==", - "dev": true - }, - "node_modules/@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true - }, - "node_modules/@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", - "dev": true - }, - "node_modules/@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", - "dev": true - }, - "node_modules/@types/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==", - "dev": true - }, - "node_modules/@types/serve-index": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz", - "integrity": "sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg==", - "dev": true, - "dependencies": { - "@types/express": "*" - } - }, - "node_modules/@types/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==", - "dev": true, - "dependencies": { - "@types/mime": "*", - "@types/node": "*" - } - }, - "node_modules/@types/sockjs": { - "version": "0.3.33", - "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.33.tgz", - "integrity": "sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/svgo": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/@types/svgo/-/svgo-1.3.6.tgz", - "integrity": "sha512-AZU7vQcy/4WFEuwnwsNsJnFwupIpbllH1++LXScN6uxT1Z4zPzdrWG97w4/I7eFKFTvfy/bHFStWjdBAg2Vjug==", - "dev": true - }, - "node_modules/@types/ws": { - "version": "8.5.3", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", - "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@voerro/vue-tagsinput": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/@voerro/vue-tagsinput/-/vue-tagsinput-2.7.1.tgz", - "integrity": "sha512-G7ClILHgtc/D1vEw9qp6dlsAstlhwLDkPvEp6w1iY/dmSzu4hhxaMk8jyahjxQRDgiLlrAikESOsfkVhy18YwQ==", - "dev": true - }, - "node_modules/@vue/compiler-sfc": { - "version": "2.7.16", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-2.7.16.tgz", - "integrity": "sha512-KWhJ9k5nXuNtygPU7+t1rX6baZeqOYLEforUPjgNDBnLicfHCoi48H87Q8XyLZOrNNsmhuwKqtpDQWjEFe6Ekg==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.23.5", - "postcss": "^8.4.14", - "source-map": "^0.6.1" - }, - "optionalDependencies": { - "prettier": "^1.18.2 || ^2.0.0" - } - }, - "node_modules/@vue/component-compiler-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@vue/component-compiler-utils/-/component-compiler-utils-3.3.0.tgz", - "integrity": "sha512-97sfH2mYNU+2PzGrmK2haqffDpVASuib9/w2/noxiFi31Z54hW+q3izKQXXQZSNhtiUpAI36uSuYepeBe4wpHQ==", - "dev": true, - "dependencies": { - "consolidate": "^0.15.1", - "hash-sum": "^1.0.2", - "lru-cache": "^4.1.2", - "merge-source-map": "^1.1.0", - "postcss": "^7.0.36", - "postcss-selector-parser": "^6.0.2", - "source-map": "~0.6.1", - "vue-template-es2015-compiler": "^1.9.0" - }, - "optionalDependencies": { - "prettier": "^1.18.2 || ^2.0.0" - } - }, - "node_modules/@vue/component-compiler-utils/node_modules/lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "node_modules/@vue/component-compiler-utils/node_modules/picocolors": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", - "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", - "dev": true - }, - "node_modules/@vue/component-compiler-utils/node_modules/postcss": { - "version": "7.0.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", - "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", - "dev": true, - "dependencies": { - "picocolors": "^0.2.1", - "source-map": "^0.6.1" - }, - "engines": { - "node": ">=6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - } - }, - "node_modules/@vue/component-compiler-utils/node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", - "dev": true - }, - "node_modules/@webassemblyjs/ast": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", - "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", - "dev": true, - "dependencies": { - "@webassemblyjs/helper-numbers": "1.13.2", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2" - } - }, - "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", - "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", - "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", - "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", - "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", - "dev": true, - "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.13.2", - "@webassemblyjs/helper-api-error": "1.13.2", - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", - "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", - "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-buffer": "1.14.1", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2", - "@webassemblyjs/wasm-gen": "1.14.1" - } - }, - "node_modules/@webassemblyjs/ieee754": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", - "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", - "dev": true, - "dependencies": { - "@xtuc/ieee754": "^1.2.0" - } - }, - "node_modules/@webassemblyjs/leb128": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", - "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", - "dev": true, - "dependencies": { - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@webassemblyjs/utf8": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", - "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", - "dev": true - }, - "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", - "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-buffer": "1.14.1", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2", - "@webassemblyjs/helper-wasm-section": "1.14.1", - "@webassemblyjs/wasm-gen": "1.14.1", - "@webassemblyjs/wasm-opt": "1.14.1", - "@webassemblyjs/wasm-parser": "1.14.1", - "@webassemblyjs/wast-printer": "1.14.1" - } - }, - "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", - "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2", - "@webassemblyjs/ieee754": "1.13.2", - "@webassemblyjs/leb128": "1.13.2", - "@webassemblyjs/utf8": "1.13.2" - } - }, - "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", - "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-buffer": "1.14.1", - "@webassemblyjs/wasm-gen": "1.14.1", - "@webassemblyjs/wasm-parser": "1.14.1" - } - }, - "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", - "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-api-error": "1.13.2", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2", - "@webassemblyjs/ieee754": "1.13.2", - "@webassemblyjs/leb128": "1.13.2", - "@webassemblyjs/utf8": "1.13.2" - } - }, - "node_modules/@webassemblyjs/wast-printer": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", - "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.14.1", - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@webpack-cli/configtest": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz", - "integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==", - "dev": true, - "peerDependencies": { - "webpack": "4.x.x || 5.x.x", - "webpack-cli": "4.x.x" - } - }, - "node_modules/@webpack-cli/info": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz", - "integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==", - "dev": true, - "dependencies": { - "envinfo": "^7.7.3" - }, - "peerDependencies": { - "webpack-cli": "4.x.x" - } - }, - "node_modules/@webpack-cli/serve": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz", - "integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==", - "dev": true, - "peerDependencies": { - "webpack-cli": "4.x.x" - }, - "peerDependenciesMeta": { - "webpack-dev-server": { - "optional": true - } - } - }, - "node_modules/@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "node_modules/@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "dev": true, - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/acorn": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", - "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/adjust-sourcemap-loader": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/adjust-sourcemap-loader/-/adjust-sourcemap-loader-3.0.0.tgz", - "integrity": "sha512-YBrGyT2/uVQ/c6Rr+t6ZJXniY03YtHGMJQYal368burRGYKqhx9qGTWqcBU5s1CwYY9E/ri63RYyG1IacMZtqw==", - "dev": true, - "dependencies": { - "loader-utils": "^2.0.0", - "regex-parser": "^2.2.11" - }, - "engines": { - "node": ">=8.9" - } - }, - "node_modules/adjust-sourcemap-loader/node_modules/loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - }, - "engines": { - "node": ">=8.9.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "node_modules/ajv-formats": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", - "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", - "dev": true, - "dependencies": { - "ajv": "^8.0.0" - }, - "peerDependencies": { - "ajv": "^8.0.0" - }, - "peerDependenciesMeta": { - "ajv": { - "optional": true - } - } - }, - "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv-formats/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true - }, - "node_modules/ansi-html-community": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz", - "integrity": "sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==", - "dev": true, - "engines": [ - "node >= 0.8.0" - ], - "bin": { - "ansi-html": "bin/ansi-html" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/arity-n": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/arity-n/-/arity-n-1.0.4.tgz", - "integrity": "sha1-2edrEXM+CFacCEeuezmyhgswt0U=", - "dev": true - }, - "node_modules/array-flatten": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", - "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==", - "dev": true - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dev": true, - "dependencies": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "node_modules/asn1.js/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", - "dev": true - }, - "node_modules/assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", - "dev": true, - "dependencies": { - "object-assign": "^4.1.1", - "util": "0.10.3" - } - }, - "node_modules/assert/node_modules/inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==", - "dev": true - }, - "node_modules/assert/node_modules/util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha512-5KiHfsmkqacuKjkRkdV7SsfDJ2EGiPsK92s2MhNSY0craxjTdKTtqKsJaCWp4LW33ZZ0OPUv1WO/TFvNQRiQxQ==", - "dev": true, - "dependencies": { - "inherits": "2.0.1" - } - }, - "node_modules/atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true, - "bin": { - "atob": "bin/atob.js" - }, - "engines": { - "node": ">= 4.5.0" - } - }, - "node_modules/autoprefixer": { - "version": "10.4.8", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.8.tgz", - "integrity": "sha512-75Jr6Q/XpTqEf6D2ltS5uMewJIx5irCU1oBYJrWjFenq/m12WRRrz6g15L1EIoYvPLXTbEry7rDOwrcYNj77xw==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/autoprefixer" - } - ], - "dependencies": { - "browserslist": "^4.21.3", - "caniuse-lite": "^1.0.30001373", - "fraction.js": "^4.2.0", - "normalize-range": "^0.1.2", - "picocolors": "^1.0.0", - "postcss-value-parser": "^4.2.0" - }, - "bin": { - "autoprefixer": "bin/autoprefixer" - }, - "engines": { - "node": "^10 || ^12 || >=14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, - "node_modules/babel-loader": { - "version": "8.2.5", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.5.tgz", - "integrity": "sha512-OSiFfH89LrEMiWd4pLNqGz4CwJDtbs2ZVc+iGu2HrkRfPxId9F2anQj38IxWpmRfsUY0aBZYi1EFcd3mhtRMLQ==", - "dev": true, - "dependencies": { - "find-cache-dir": "^3.3.1", - "loader-utils": "^2.0.0", - "make-dir": "^3.1.0", - "schema-utils": "^2.6.5" - }, - "engines": { - "node": ">= 8.9" - }, - "peerDependencies": { - "@babel/core": "^7.0.0", - "webpack": ">=2" - } - }, - "node_modules/babel-loader/node_modules/loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - }, - "engines": { - "node": ">=8.9.0" - } - }, - "node_modules/babel-plugin-dynamic-import-node": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", - "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", - "dev": true, - "dependencies": { - "object.assign": "^4.1.0" - } - }, - "node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.2.tgz", - "integrity": "sha512-LPnodUl3lS0/4wN3Rb+m+UK8s7lj2jcLRrjho4gLw+OJs+I4bvGXshINesY5xx/apM+biTnQ9reDI8yj+0M5+Q==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.17.7", - "@babel/helper-define-polyfill-provider": "^0.3.2", - "semver": "^6.1.1" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/babel-plugin-polyfill-corejs2/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.3.tgz", - "integrity": "sha512-zKsXDh0XjnrUEW0mxIHLfjBfnXSMr5Q/goMe/fxpQnLm07mcOZiIZHBNWCMx60HmdvjxfXcalac0tfFg0wqxyw==", - "dev": true, - "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.3.2", - "core-js-compat": "^3.21.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/babel-plugin-polyfill-regenerator": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.0.tgz", - "integrity": "sha512-RW1cnryiADFeHmfLS+WW/G431p1PsW5qdRdz0SDRi7TKcUgc7Oh/uXkT7MZ/+tGsT1BkczEAmD5XjUyJ5SWDTw==", - "dev": true, - "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.3.2" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/batch": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", - "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", - "dev": true - }, - "node_modules/big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "node_modules/bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", - "dev": true - }, - "node_modules/body-parser": { - "version": "1.20.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", - "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", - "dev": true, - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.13.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/body-parser/node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/body-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/body-parser/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/bonjour-service": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.0.14.tgz", - "integrity": "sha512-HIMbgLnk1Vqvs6B4Wq5ep7mxvj9sGz5d1JJyDNSGNIdA/w2MCz6GTjWTdjqOJV1bEPj+6IkxDvWNFKEBxNt4kQ==", - "dev": true, - "dependencies": { - "array-flatten": "^2.1.2", - "dns-equal": "^1.0.0", - "fast-deep-equal": "^3.1.3", - "multicast-dns": "^7.2.5" - } - }, - "node_modules/boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", - "dev": true - }, - "node_modules/bootstrap": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.1.tgz", - "integrity": "sha512-UQi3v2NpVPEi1n35dmRRzBJFlgvWHYwyem6yHhuT6afYF+sziEt46McRbT//kVXZ7b1YUYEVGdXEH74Nx3xzGA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/twbs" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/bootstrap" - } - ], - "peerDependencies": { - "@popperjs/core": "^2.11.6" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", - "dev": true - }, - "node_modules/browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "dependencies": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "dependencies": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "node_modules/browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "dependencies": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/browserify-rsa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", - "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", - "dev": true, - "dependencies": { - "bn.js": "^5.0.0", - "randombytes": "^2.0.1" - } - }, - "node_modules/browserify-sign": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz", - "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", - "dev": true, - "dependencies": { - "bn.js": "^5.2.1", - "browserify-rsa": "^4.1.0", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.5", - "hash-base": "~3.0", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.7", - "readable-stream": "^2.3.8", - "safe-buffer": "^5.2.1" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/browserify-sign/node_modules/hash-base": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.5.tgz", - "integrity": "sha512-vXm0l45VbcHEVlTCzs8M+s0VeYsB2lnlAaThoLKGXr3bE/VWDOelNUnycUPEhKEaXARL2TEFjBOyUiM6+55KBg==", - "dev": true, - "dependencies": { - "inherits": "^2.0.4", - "safe-buffer": "^5.2.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/browserify-sign/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "dependencies": { - "pako": "~1.0.5" - } - }, - "node_modules/browserslist": { - "version": "4.24.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", - "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "caniuse-lite": "^1.0.30001669", - "electron-to-chromium": "^1.5.41", - "node-releases": "^2.0.18", - "update-browserslist-db": "^1.1.1" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/buffer": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", - "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", - "dev": true, - "dependencies": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "node_modules/buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", - "dev": true - }, - "node_modules/builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", - "dev": true - }, - "node_modules/bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/camel-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", - "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", - "dev": true, - "dependencies": { - "pascal-case": "^3.1.2", - "tslib": "^2.0.3" - } - }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/can-use-dom": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/can-use-dom/-/can-use-dom-0.1.0.tgz", - "integrity": "sha512-ceOhN1DL7Y4O6M0j9ICgmTYziV89WMd96SvSl0REd8PMgrY0B/WBOPoed5S1KUmJqXgUXh8gzSe6E3ae27upsQ==", - "dev": true - }, - "node_modules/caniuse-api": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", - "integrity": "sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==", - "dev": true, - "dependencies": { - "browserslist": "^4.0.0", - "caniuse-lite": "^1.0.0", - "lodash.memoize": "^4.1.2", - "lodash.uniq": "^4.5.0" - } - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001767", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001767.tgz", - "integrity": "sha512-34+zUAMhSH+r+9eKmYG+k2Rpt8XttfE4yXAjoZvkAPs15xcYQhyBYdalJ65BzivAvGRMViEjy6oKr/S91loekQ==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "CC-BY-4.0" - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/charenc": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", - "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", - "dev": true, - "engines": { - "node": ">=6.0" - } - }, - "node_modules/cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/clean-css": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.1.tgz", - "integrity": "sha512-lCr8OHhiWCTw4v8POJovCoh4T7I9U11yVsPjMWWnnMmp9ZowCxyad1Pathle/9HjaDp+fdQKjO9fQydE6RHTZg==", - "dev": true, - "dependencies": { - "source-map": "~0.6.0" - }, - "engines": { - "node": ">= 10.0" - } - }, - "node_modules/cli-table3": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.2.tgz", - "integrity": "sha512-QyavHCaIC80cMivimWu4aWHilIpiDpfm3hGmqAmXVL1UsnbLuBSMd21hTX6VY4ZSDSM73ESLeF8TOYId3rBTbw==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0" - }, - "engines": { - "node": "10.* || >= 12.*" - }, - "optionalDependencies": { - "@colors/colors": "1.5.0" - } - }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/clone-deep": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", - "dev": true, - "dependencies": { - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.2", - "shallow-clone": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/collect.js": { - "version": "4.28.6", - "resolved": "https://registry.npmjs.org/collect.js/-/collect.js-4.28.6.tgz", - "integrity": "sha512-NAyuk1DnCotRaDZIS5kJ4sptgkwOeYqElird10yziN5JBuwYOGkOTguhNcPn5g344IfylZecxNYZAVXgv19p5Q==", - "dev": true - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/colord": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", - "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==", - "dev": true - }, - "node_modules/colorette": { - "version": "2.0.19", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", - "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==", - "dev": true - }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "dev": true - }, - "node_modules/compose-function": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/compose-function/-/compose-function-3.0.3.tgz", - "integrity": "sha1-ntZ18TzFRQHTCVCkhv9qe6OrGF8=", - "dev": true, - "dependencies": { - "arity-n": "^1.0.4" - } - }, - "node_modules/compressible": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", - "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", - "dev": true, - "dependencies": { - "mime-db": ">= 1.43.0 < 2" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/compression": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", - "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", - "dev": true, - "dependencies": { - "accepts": "~1.3.5", - "bytes": "3.0.0", - "compressible": "~2.0.16", - "debug": "2.6.9", - "on-headers": "~1.0.2", - "safe-buffer": "5.1.2", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/compression/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/compression/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/concat": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/concat/-/concat-1.0.3.tgz", - "integrity": "sha1-QPM1MInWVGdpXLGIa0Xt1jfYzKg=", - "dev": true, - "dependencies": { - "commander": "^2.9.0" - }, - "bin": { - "concat": "bin/concat" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/connect-history-api-fallback": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz", - "integrity": "sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/consola": { - "version": "2.15.3", - "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", - "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==", - "dev": true - }, - "node_modules/console-browserify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", - "dev": true - }, - "node_modules/consolidate": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/consolidate/-/consolidate-0.15.1.tgz", - "integrity": "sha512-DW46nrsMJgy9kqAbPt5rKaCr7uFtpo4mSUvLHIUbJEjm0vo+aY5QLwBUq3FK4tRnJr/X0Psc0C4jf/h+HtXSMw==", - "dev": true, - "dependencies": { - "bluebird": "^3.1.1" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==", - "dev": true - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dev": true, - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-disposition/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.1" - } - }, - "node_modules/cookie": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", - "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", - "dev": true - }, - "node_modules/core-js": { - "version": "3.25.3", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.25.3.tgz", - "integrity": "sha512-y1hvKXmPHvm5B7w4ln1S4uc9eV/O5+iFExSRUimnvIph11uaizFR8LFMdONN8hG3P2pipUfX4Y/fR8rAEtcHcQ==", - "dev": true, - "hasInstallScript": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, - "node_modules/core-js-compat": { - "version": "3.25.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.25.1.tgz", - "integrity": "sha512-pOHS7O0i8Qt4zlPW/eIFjwp+NrTPx+wTL0ctgI2fHn31sZOq89rDsmtc/A2vAX7r6shl+bmVI+678He46jgBlw==", - "dev": true, - "dependencies": { - "browserslist": "^4.21.3" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true - }, - "node_modules/cosmiconfig": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", - "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", - "dev": true, - "dependencies": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/create-ecdh": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", - "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" - } - }, - "node_modules/create-ecdh/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "dependencies": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "node_modules/create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "dependencies": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "node_modules/cross-env": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", - "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.1" - }, - "bin": { - "cross-env": "src/bin/cross-env.js", - "cross-env-shell": "src/bin/cross-env-shell.js" - }, - "engines": { - "node": ">=10.14", - "npm": ">=6", - "yarn": ">=1" - } - }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/crypt": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", - "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "dependencies": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - }, - "engines": { - "node": "*" - } - }, - "node_modules/css": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz", - "integrity": "sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "source-map": "^0.6.1", - "source-map-resolve": "^0.5.2", - "urix": "^0.1.0" - } - }, - "node_modules/css-declaration-sorter": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.3.1.tgz", - "integrity": "sha512-fBffmak0bPAnyqc/HO8C3n2sHrp9wcqQz6ES9koRF2/mLOVAx9zIQ3Y7R29sYCteTPqMCwns4WYQoCX91Xl3+w==", - "dev": true, - "engines": { - "node": "^10 || ^12 || >=14" - }, - "peerDependencies": { - "postcss": "^8.0.9" - } - }, - "node_modules/css-loader": { - "version": "5.2.7", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-5.2.7.tgz", - "integrity": "sha512-Q7mOvpBNBG7YrVGMxRxcBJZFL75o+cH2abNASdibkj/fffYD8qWbInZrD0S9ccI6vZclF3DsHE7njGlLtaHbhg==", - "dev": true, - "dependencies": { - "icss-utils": "^5.1.0", - "loader-utils": "^2.0.0", - "postcss": "^8.2.15", - "postcss-modules-extract-imports": "^3.0.0", - "postcss-modules-local-by-default": "^4.0.0", - "postcss-modules-scope": "^3.0.0", - "postcss-modules-values": "^4.0.0", - "postcss-value-parser": "^4.1.0", - "schema-utils": "^3.0.0", - "semver": "^7.3.5" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^4.27.0 || ^5.0.0" - } - }, - "node_modules/css-loader/node_modules/loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - }, - "engines": { - "node": ">=8.9.0" - } - }, - "node_modules/css-loader/node_modules/schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/css-select": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", - "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", - "dev": true, - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.0.1", - "domhandler": "^4.3.1", - "domutils": "^2.8.0", - "nth-check": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/css-select/node_modules/domhandler": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", - "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", - "dev": true, - "dependencies": { - "domelementtype": "^2.2.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/css-tree": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", - "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", - "dev": true, - "dependencies": { - "mdn-data": "2.0.14", - "source-map": "^0.6.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/css-what": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", - "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", - "dev": true, - "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/cssesc": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", - "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", - "dev": true, - "bin": { - "cssesc": "bin/cssesc" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/cssnano": { - "version": "5.1.13", - "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-5.1.13.tgz", - "integrity": "sha512-S2SL2ekdEz6w6a2epXn4CmMKU4K3KpcyXLKfAYc9UQQqJRkD/2eLUG0vJ3Db/9OvO5GuAdgXw3pFbR6abqghDQ==", - "dev": true, - "dependencies": { - "cssnano-preset-default": "^5.2.12", - "lilconfig": "^2.0.3", - "yaml": "^1.10.2" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/cssnano" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/cssnano-preset-default": { - "version": "5.2.12", - "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-5.2.12.tgz", - "integrity": "sha512-OyCBTZi+PXgylz9HAA5kHyoYhfGcYdwFmyaJzWnzxuGRtnMw/kR6ilW9XzlzlRAtB6PLT/r+prYgkef7hngFew==", - "dev": true, - "dependencies": { - "css-declaration-sorter": "^6.3.0", - "cssnano-utils": "^3.1.0", - "postcss-calc": "^8.2.3", - "postcss-colormin": "^5.3.0", - "postcss-convert-values": "^5.1.2", - "postcss-discard-comments": "^5.1.2", - "postcss-discard-duplicates": "^5.1.0", - "postcss-discard-empty": "^5.1.1", - "postcss-discard-overridden": "^5.1.0", - "postcss-merge-longhand": "^5.1.6", - "postcss-merge-rules": "^5.1.2", - "postcss-minify-font-values": "^5.1.0", - "postcss-minify-gradients": "^5.1.1", - "postcss-minify-params": "^5.1.3", - "postcss-minify-selectors": "^5.2.1", - "postcss-normalize-charset": "^5.1.0", - "postcss-normalize-display-values": "^5.1.0", - "postcss-normalize-positions": "^5.1.1", - "postcss-normalize-repeat-style": "^5.1.1", - "postcss-normalize-string": "^5.1.0", - "postcss-normalize-timing-functions": "^5.1.0", - "postcss-normalize-unicode": "^5.1.0", - "postcss-normalize-url": "^5.1.0", - "postcss-normalize-whitespace": "^5.1.1", - "postcss-ordered-values": "^5.1.3", - "postcss-reduce-initial": "^5.1.0", - "postcss-reduce-transforms": "^5.1.0", - "postcss-svgo": "^5.1.0", - "postcss-unique-selectors": "^5.1.1" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/cssnano-utils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-3.1.0.tgz", - "integrity": "sha512-JQNR19/YZhz4psLX/rQ9M83e3z2Wf/HdJbryzte4a3NSuafyp9w/I4U+hx5C2S9g41qlstH7DEWnZaaj83OuEA==", - "dev": true, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/csso": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", - "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", - "dev": true, - "dependencies": { - "css-tree": "^1.1.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/csstype": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.0.tgz", - "integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==", - "dev": true - }, - "node_modules/d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "dev": true, - "dependencies": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "node_modules/de-indent": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", - "integrity": "sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0=", - "dev": true - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/decode-uri-component": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", - "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/default-gateway": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz", - "integrity": "sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==", - "dev": true, - "dependencies": { - "execa": "^5.0.0" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/define-lazy-prop": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", - "dev": true, - "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "dev": true, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/detect-node": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", - "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", - "dev": true - }, - "node_modules/diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, - "node_modules/diffie-hellman/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/dns-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", - "integrity": "sha512-z+paD6YUQsk+AbGCEM4PrOXSss5gd66QfcVBFTKR/HpFL9jCqikS94HYwKww6fQyO7IxrIIyUu+g0Ka9tUS2Cg==", - "dev": true - }, - "node_modules/dns-packet": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.4.0.tgz", - "integrity": "sha512-EgqGeaBB8hLiHLZtp/IbaDQTL8pZ0+IvwzSHA6d7VyMDM+B9hgddEMa9xjK5oYnw0ci0JQ6g2XCD7/f6cafU6g==", - "dev": true, - "dependencies": { - "@leichtgewicht/ip-codec": "^2.0.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/dom-serializer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", - "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", - "dev": true, - "dependencies": { - "domelementtype": "^2.0.1", - "domhandler": "^4.2.0", - "entities": "^2.0.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/dom-serializer/node_modules/domhandler": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", - "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", - "dev": true, - "dependencies": { - "domelementtype": "^2.2.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/dom7": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/dom7/-/dom7-3.0.0.tgz", - "integrity": "sha512-oNlcUdHsC4zb7Msx7JN3K0Nro1dzJ48knvBOnDPKJ2GV9wl1i5vydJZUSyOfrkKFDZEud/jBsTk92S/VGSAe/g==", - "dev": true, - "dependencies": { - "ssr-window": "^3.0.0-alpha.1" - } - }, - "node_modules/domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true, - "engines": { - "node": ">=0.4", - "npm": ">=1.2" - } - }, - "node_modules/domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ] - }, - "node_modules/domhandler": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-3.3.0.tgz", - "integrity": "sha512-J1C5rIANUbuYK+FuFL98650rihynUOEzRLxW+90bKZRWB6A1X1Tf82GxR1qAWLyfNPRvjqfip3Q5tdYlmAa9lA==", - "dev": true, - "dependencies": { - "domelementtype": "^2.0.1" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/domutils": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", - "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", - "dev": true, - "dependencies": { - "dom-serializer": "^1.0.1", - "domelementtype": "^2.2.0", - "domhandler": "^4.2.0" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, - "node_modules/domutils/node_modules/domhandler": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", - "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", - "dev": true, - "dependencies": { - "domelementtype": "^2.2.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/dot-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", - "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", - "dev": true, - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/dotenv": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", - "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/dotenv-expand": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz", - "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==", - "dev": true - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "dev": true - }, - "node_modules/electron-to-chromium": { - "version": "1.5.66", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.66.tgz", - "integrity": "sha512-pI2QF6+i+zjPbqRzJwkMvtvkdI7MjVbSh2g8dlMguDJIXEPw+kwasS1Jl+YGPEBfGVxsVgGUratAKymPdPo2vQ==", - "dev": true - }, - "node_modules/elliptic": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", - "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", - "dev": true, - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/enhanced-resolve": { - "version": "5.17.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", - "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/entities": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", - "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", - "dev": true, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", - "dev": true, - "bin": { - "envinfo": "dist/cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, - "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-module-lexer": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", - "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", - "dev": true - }, - "node_modules/es5-ext": { - "version": "0.10.64", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", - "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "esniff": "^2.0.1", - "next-tick": "^1.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "dev": true, - "dependencies": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "node_modules/es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "dev": true, - "dependencies": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "dev": true - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/esniff": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", - "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", - "dev": true, - "dependencies": { - "d": "^1.0.1", - "es5-ext": "^0.10.62", - "event-emitter": "^0.3.5", - "type": "^2.7.2" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esniff/node_modules/type": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", - "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==", - "dev": true - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", - "dev": true, - "dependencies": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "dev": true - }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, - "engines": { - "node": ">=0.8.x" - } - }, - "node_modules/evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "dependencies": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", - "dev": true, - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.3", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.7.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.3.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.3", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", - "proxy-addr": "~2.0.7", - "qs": "6.13.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.19.0", - "serve-static": "1.16.2", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/express/node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", - "dev": true - }, - "node_modules/express/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/express/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/express/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/ext": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", - "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", - "dev": true, - "dependencies": { - "type": "^2.0.0" - } - }, - "node_modules/ext/node_modules/type": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.3.0.tgz", - "integrity": "sha512-rgPIqOdfK/4J9FhiVrZ3cveAjRRo5rsQBAIhnylX874y1DX/kEKSVdLsnuHB6l1KTjHyU01VjiMBHgU2adejyg==", - "dev": true - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fastest-levenshtein": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", - "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", - "dev": true, - "engines": { - "node": ">= 4.9.1" - } - }, - "node_modules/fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/faye-websocket": { - "version": "0.11.4", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", - "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", - "dev": true, - "dependencies": { - "websocket-driver": ">=0.5.1" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/file-loader": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz", - "integrity": "sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==", - "dev": true, - "dependencies": { - "loader-utils": "^2.0.0", - "schema-utils": "^3.0.0" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^4.0.0 || ^5.0.0" - } - }, - "node_modules/file-loader/node_modules/loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - }, - "engines": { - "node": ">=8.9.0" - } - }, - "node_modules/file-loader/node_modules/schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/file-type": { - "version": "12.4.2", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-12.4.2.tgz", - "integrity": "sha512-UssQP5ZgIOKelfsaB5CuGAL+Y+q7EmONuiwF3N5HAH0t27rvrttgi6Ra9k/+DVaY9UF6+ybxu5pOXLUdA8N7Vg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/finalhandler": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", - "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", - "dev": true, - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/finalhandler/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/finalhandler/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/find-cache-dir": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", - "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", - "dev": true, - "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/avajs/find-cache-dir?sponsor=1" - } - }, - "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/follow-redirects": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fraction.js": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz", - "integrity": "sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==", - "dev": true, - "engines": { - "node": "*" - }, - "funding": { - "type": "patreon", - "url": "https://www.patreon.com/infusion" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/fs-monkey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.3.tgz", - "integrity": "sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q==", - "dev": true - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true - }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/globby": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", - "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", - "dev": true, - "dependencies": { - "@types/glob": "^7.1.1", - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.0.3", - "glob": "^7.1.3", - "ignore": "^5.1.1", - "merge2": "^1.2.3", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, - "node_modules/growly": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", - "integrity": "sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw==", - "dev": true - }, - "node_modules/handle-thing": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", - "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==", - "dev": true - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/hash-base/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/hash-base/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/hash-sum": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz", - "integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==", - "dev": true - }, - "node_modules/hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true, - "bin": { - "he": "bin/he" - } - }, - "node_modules/hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", - "dev": true, - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/hpack.js": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", - "integrity": "sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "obuf": "^1.0.0", - "readable-stream": "^2.0.1", - "wbuf": "^1.1.0" - } - }, - "node_modules/html-entities": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.3.tgz", - "integrity": "sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==", - "dev": true - }, - "node_modules/html-loader": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/html-loader/-/html-loader-1.3.2.tgz", - "integrity": "sha512-DEkUwSd0sijK5PF3kRWspYi56XP7bTNkyg5YWSzBdjaSDmvCufep5c4Vpb3PBf6lUL0YPtLwBfy9fL0t5hBAGA==", - "dev": true, - "dependencies": { - "html-minifier-terser": "^5.1.1", - "htmlparser2": "^4.1.0", - "loader-utils": "^2.0.0", - "schema-utils": "^3.0.0" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^4.0.0 || ^5.0.0" - } - }, - "node_modules/html-loader/node_modules/loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - }, - "engines": { - "node": ">=8.9.0" - } - }, - "node_modules/html-loader/node_modules/schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/html-minifier-terser": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz", - "integrity": "sha512-ZPr5MNObqnV/T9akshPKbVgyOqLmy+Bxo7juKCfTfnjNniTAMdy4hz21YQqoofMBJD2kdREaqPPdThoR78Tgxg==", - "dev": true, - "dependencies": { - "camel-case": "^4.1.1", - "clean-css": "^4.2.3", - "commander": "^4.1.1", - "he": "^1.2.0", - "param-case": "^3.0.3", - "relateurl": "^0.2.7", - "terser": "^4.6.3" - }, - "bin": { - "html-minifier-terser": "cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/html-minifier-terser/node_modules/clean-css": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.4.tgz", - "integrity": "sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==", - "dev": true, - "dependencies": { - "source-map": "~0.6.0" - }, - "engines": { - "node": ">= 4.0" - } - }, - "node_modules/html-minifier-terser/node_modules/commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, - "node_modules/html-minifier-terser/node_modules/terser": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz", - "integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==", - "dev": true, - "dependencies": { - "commander": "^2.20.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.12" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/html-minifier-terser/node_modules/terser/node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "node_modules/htmlparser2": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-4.1.0.tgz", - "integrity": "sha512-4zDq1a1zhE4gQso/c5LP1OtrhYTncXNSpvJYtWJBtXAETPlMfi3IFNjGuQbYLuVY4ZR0QMqRVvo4Pdy9KLyP8Q==", - "dev": true, - "dependencies": { - "domelementtype": "^2.0.1", - "domhandler": "^3.0.0", - "domutils": "^2.0.0", - "entities": "^2.0.0" - } - }, - "node_modules/http-deceiver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", - "integrity": "sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw==", - "dev": true - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dev": true, - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/http-parser-js": { - "version": "0.5.8", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz", - "integrity": "sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==", - "dev": true - }, - "node_modules/http-proxy": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", - "dev": true, - "dependencies": { - "eventemitter3": "^4.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/http-proxy-middleware": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz", - "integrity": "sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==", - "dev": true, - "dependencies": { - "@types/http-proxy": "^1.17.8", - "http-proxy": "^1.18.1", - "is-glob": "^4.0.1", - "is-plain-obj": "^3.0.0", - "micromatch": "^4.0.2" - }, - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "@types/express": "^4.17.13" - }, - "peerDependenciesMeta": { - "@types/express": { - "optional": true - } - } - }, - "node_modules/https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==", - "dev": true - }, - "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true, - "engines": { - "node": ">=10.17.0" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/icss-utils": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", - "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", - "dev": true, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/imagemin": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/imagemin/-/imagemin-7.0.1.tgz", - "integrity": "sha512-33AmZ+xjZhg2JMCe+vDf6a9mzWukE7l+wAtesjE7KyteqqKjzxv7aVQeWnul1Ve26mWvEQqyPwl0OctNBfSR9w==", - "dev": true, - "dependencies": { - "file-type": "^12.0.0", - "globby": "^10.0.0", - "graceful-fs": "^4.2.2", - "junk": "^3.1.0", - "make-dir": "^3.0.0", - "p-pipe": "^3.0.0", - "replace-ext": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/img-loader": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/img-loader/-/img-loader-4.0.0.tgz", - "integrity": "sha512-UwRcPQdwdOyEHyCxe1V9s9YFwInwEWCpoO+kJGfIqDrBDqA8jZUsEZTxQ0JteNPGw/Gupmwesk2OhLTcnw6tnQ==", - "dev": true, - "dependencies": { - "loader-utils": "^1.1.0" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "imagemin": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/import-local": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", - "dev": true, - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/interpret": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", - "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/ipaddr.js": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz", - "integrity": "sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "node_modules/is-core-module": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", - "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "dev": true, - "bin": { - "is-docker": "cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-plain-obj": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", - "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dev": true, - "dependencies": { - "is-docker": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/jest-worker": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", - "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", - "dev": true, - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/jest-worker/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/jquery": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", - "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==", - "dev": true - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/jsesc": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", - "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/junk": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/junk/-/junk-3.1.0.tgz", - "integrity": "sha512-pBxcB3LFc8QVgdggvZWyeys+hnrNWg4OcZIU/1X59k5jQdLBlCsYGRQaz234SqoRLTCgMH00fY0xRJH+F9METQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/klona": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.5.tgz", - "integrity": "sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/laravel-mix": { - "version": "6.0.49", - "resolved": "https://registry.npmjs.org/laravel-mix/-/laravel-mix-6.0.49.tgz", - "integrity": "sha512-bBMFpFjp26XfijPvY5y9zGKud7VqlyOE0OWUcPo3vTBY5asw8LTjafAbee1dhfLz6PWNqDziz69CP78ELSpfKw==", - "dev": true, - "dependencies": { - "@babel/core": "^7.15.8", - "@babel/plugin-proposal-object-rest-spread": "^7.15.6", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/plugin-transform-runtime": "^7.15.8", - "@babel/preset-env": "^7.15.8", - "@babel/runtime": "^7.15.4", - "@types/babel__core": "^7.1.16", - "@types/clean-css": "^4.2.5", - "@types/imagemin-gifsicle": "^7.0.1", - "@types/imagemin-mozjpeg": "^8.0.1", - "@types/imagemin-optipng": "^5.2.1", - "@types/imagemin-svgo": "^8.0.0", - "autoprefixer": "^10.4.0", - "babel-loader": "^8.2.3", - "chalk": "^4.1.2", - "chokidar": "^3.5.2", - "clean-css": "^5.2.4", - "cli-table3": "^0.6.0", - "collect.js": "^4.28.5", - "commander": "^7.2.0", - "concat": "^1.0.3", - "css-loader": "^5.2.6", - "cssnano": "^5.0.8", - "dotenv": "^10.0.0", - "dotenv-expand": "^5.1.0", - "file-loader": "^6.2.0", - "fs-extra": "^10.0.0", - "glob": "^7.2.0", - "html-loader": "^1.3.2", - "imagemin": "^7.0.1", - "img-loader": "^4.0.0", - "lodash": "^4.17.21", - "md5": "^2.3.0", - "mini-css-extract-plugin": "^1.6.2", - "node-libs-browser": "^2.2.1", - "postcss-load-config": "^3.1.0", - "postcss-loader": "^6.2.0", - "semver": "^7.3.5", - "strip-ansi": "^6.0.0", - "style-loader": "^2.0.0", - "terser": "^5.9.0", - "terser-webpack-plugin": "^5.2.4", - "vue-style-loader": "^4.1.3", - "webpack": "^5.60.0", - "webpack-cli": "^4.9.1", - "webpack-dev-server": "^4.7.3", - "webpack-merge": "^5.8.0", - "webpack-notifier": "^1.14.1", - "webpackbar": "^5.0.0-3", - "yargs": "^17.2.1" - }, - "bin": { - "laravel-mix": "bin/cli.js", - "mix": "bin/cli.js" - }, - "engines": { - "node": ">=12.14.0" - }, - "peerDependencies": { - "@babel/core": "^7.15.8", - "@babel/plugin-proposal-object-rest-spread": "^7.15.6", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/plugin-transform-runtime": "^7.15.8", - "@babel/preset-env": "^7.15.8", - "postcss": "^8.3.11", - "webpack": "^5.60.0", - "webpack-cli": "^4.9.1" - } - }, - "node_modules/laravel-mix/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/lilconfig": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.6.tgz", - "integrity": "sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true - }, - "node_modules/loader-runner": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", - "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", - "dev": true, - "engines": { - "node": ">=6.11.5" - } - }, - "node_modules/loader-utils": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", - "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", - "dev": true, - "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/loader-utils/node_modules/json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "dev": true, - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "json5": "lib/cli.js" - } - }, - "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", - "dev": true - }, - "node_modules/lodash.memoize": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", - "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", - "dev": true - }, - "node_modules/lodash.throttle": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", - "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==", - "dev": true - }, - "node_modules/lodash.uniq": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", - "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", - "dev": true - }, - "node_modules/lower-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", - "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", - "dev": true, - "dependencies": { - "tslib": "^2.0.3" - } - }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/md5": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", - "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", - "dev": true, - "dependencies": { - "charenc": "0.0.2", - "crypt": "0.0.2", - "is-buffer": "~1.1.6" - } - }, - "node_modules/md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/mdn-data": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", - "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", - "dev": true - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/memfs": { - "version": "3.4.7", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.7.tgz", - "integrity": "sha512-ygaiUSNalBX85388uskeCyhSAoOSgzBbtVCr9jA2RROssFL9Q19/ZXFqS+2Th2sr1ewNIWgFdLzLC3Yl1Zv+lw==", - "dev": true, - "dependencies": { - "fs-monkey": "^1.0.3" - }, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/merge-source-map": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", - "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", - "dev": true, - "dependencies": { - "source-map": "^0.6.1" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/micromatch": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, - "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "dependencies": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - }, - "bin": { - "miller-rabin": "bin/miller-rabin" - } - }, - "node_modules/miller-rabin/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "dev": true, - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/mini-css-extract-plugin": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.6.2.tgz", - "integrity": "sha512-WhDvO3SjGm40oV5y26GjMJYjd2UMqrLAGKy5YS2/3QKJy2F7jgynuHTir/tgUUOiNQu5saXHdc8reo7YuhhT4Q==", - "dev": true, - "dependencies": { - "loader-utils": "^2.0.0", - "schema-utils": "^3.0.0", - "webpack-sources": "^1.1.0" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^4.4.0 || ^5.0.0" - } - }, - "node_modules/mini-css-extract-plugin/node_modules/loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - }, - "engines": { - "node": ">=8.9.0" - } - }, - "node_modules/mini-css-extract-plugin/node_modules/schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "node_modules/minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", - "dev": true - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/multicast-dns": { - "version": "7.2.5", - "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz", - "integrity": "sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==", - "dev": true, - "dependencies": { - "dns-packet": "^5.2.2", - "thunky": "^1.0.2" - }, - "bin": { - "multicast-dns": "cli.js" - } - }, - "node_modules/nanoid": { - "version": "3.3.8", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", - "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "node_modules/next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", - "dev": true - }, - "node_modules/no-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", - "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", - "dev": true, - "dependencies": { - "lower-case": "^2.0.2", - "tslib": "^2.0.3" - } - }, - "node_modules/node-forge": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", - "dev": true, - "engines": { - "node": ">= 6.13.0" - } - }, - "node_modules/node-libs-browser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", - "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", - "dev": true, - "dependencies": { - "assert": "^1.1.1", - "browserify-zlib": "^0.2.0", - "buffer": "^4.3.0", - "console-browserify": "^1.1.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.11.0", - "domain-browser": "^1.1.1", - "events": "^3.0.0", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", - "path-browserify": "0.0.1", - "process": "^0.11.10", - "punycode": "^1.2.4", - "querystring-es3": "^0.2.0", - "readable-stream": "^2.3.3", - "stream-browserify": "^2.0.1", - "stream-http": "^2.7.2", - "string_decoder": "^1.0.0", - "timers-browserify": "^2.0.4", - "tty-browserify": "0.0.0", - "url": "^0.11.0", - "util": "^0.11.0", - "vm-browserify": "^1.0.1" - } - }, - "node_modules/node-libs-browser/node_modules/punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", - "dev": true - }, - "node_modules/node-notifier": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-9.0.1.tgz", - "integrity": "sha512-fPNFIp2hF/Dq7qLDzSg4vZ0J4e9v60gJR+Qx7RbjbWqzPDdEqeVpEx5CFeDAELIl+A/woaaNn1fQ5nEVerMxJg==", - "dev": true, - "dependencies": { - "growly": "^1.3.0", - "is-wsl": "^2.2.0", - "semver": "^7.3.2", - "shellwords": "^0.1.1", - "uuid": "^8.3.0", - "which": "^2.0.2" - } - }, - "node_modules/node-releases": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", - "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", - "dev": true - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/normalize-range": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", - "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "dependencies": { - "path-key": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/nth-check": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", - "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", - "dev": true, - "dependencies": { - "boolbase": "^1.0.0" - }, - "funding": { - "url": "https://github.com/fb55/nth-check?sponsor=1" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", - "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/obuf": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", - "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", - "dev": true - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dev": true, - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/open": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", - "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", - "dev": true, - "dependencies": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==", - "dev": true - }, - "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-pipe": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-pipe/-/p-pipe-3.1.0.tgz", - "integrity": "sha512-08pj8ATpzMR0Y80x50yJHn37NF6vjrqHutASaX5LiH5npS9XPvrUmscd9MF5R4fuYRHOxQR1FfMIlF7AzwoPqw==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-retry": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", - "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", - "dev": true, - "dependencies": { - "@types/retry": "0.12.0", - "retry": "^0.13.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, - "node_modules/param-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", - "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", - "dev": true, - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/parse-asn1": { - "version": "5.1.7", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz", - "integrity": "sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg==", - "dev": true, - "dependencies": { - "asn1.js": "^4.10.1", - "browserify-aes": "^1.2.0", - "evp_bytestokey": "^1.0.3", - "hash-base": "~3.0", - "pbkdf2": "^3.1.2", - "safe-buffer": "^5.2.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/parse-asn1/node_modules/hash-base": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.5.tgz", - "integrity": "sha512-vXm0l45VbcHEVlTCzs8M+s0VeYsB2lnlAaThoLKGXr3bE/VWDOelNUnycUPEhKEaXARL2TEFjBOyUiM6+55KBg==", - "dev": true, - "dependencies": { - "inherits": "^2.0.4", - "safe-buffer": "^5.2.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/parse-asn1/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/pascal-case": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", - "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", - "dev": true, - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/path-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "dev": true - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "node_modules/path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", - "dev": true - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "dev": true, - "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/popper.js": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz", - "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==", - "dev": true - }, - "node_modules/postcss": { - "version": "8.4.49", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", - "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/postcss-calc": { - "version": "8.2.4", - "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-8.2.4.tgz", - "integrity": "sha512-SmWMSJmB8MRnnULldx0lQIyhSNvuDl9HfrZkaqqE/WHAhToYsAvDq+yAsA/kIyINDszOp3Rh0GFoNuH5Ypsm3Q==", - "dev": true, - "dependencies": { - "postcss-selector-parser": "^6.0.9", - "postcss-value-parser": "^4.2.0" - }, - "peerDependencies": { - "postcss": "^8.2.2" - } - }, - "node_modules/postcss-colormin": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-5.3.0.tgz", - "integrity": "sha512-WdDO4gOFG2Z8n4P8TWBpshnL3JpmNmJwdnfP2gbk2qBA8PWwOYcmjmI/t3CmMeL72a7Hkd+x/Mg9O2/0rD54Pg==", - "dev": true, - "dependencies": { - "browserslist": "^4.16.6", - "caniuse-api": "^3.0.0", - "colord": "^2.9.1", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-convert-values": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-5.1.2.tgz", - "integrity": "sha512-c6Hzc4GAv95B7suy4udszX9Zy4ETyMCgFPUDtWjdFTKH1SE9eFY/jEpHSwTH1QPuwxHpWslhckUQWbNRM4ho5g==", - "dev": true, - "dependencies": { - "browserslist": "^4.20.3", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-discard-comments": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-5.1.2.tgz", - "integrity": "sha512-+L8208OVbHVF2UQf1iDmRcbdjJkuBF6IS29yBDSiWUIzpYaAhtNl6JYnYm12FnkeCwQqF5LeklOu6rAqgfBZqQ==", - "dev": true, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-discard-duplicates": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-5.1.0.tgz", - "integrity": "sha512-zmX3IoSI2aoenxHV6C7plngHWWhUOV3sP1T8y2ifzxzbtnuhk1EdPwm0S1bIUNaJ2eNbWeGLEwzw8huPD67aQw==", - "dev": true, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-discard-empty": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-5.1.1.tgz", - "integrity": "sha512-zPz4WljiSuLWsI0ir4Mcnr4qQQ5e1Ukc3i7UfE2XcrwKK2LIPIqE5jxMRxO6GbI3cv//ztXDsXwEWT3BHOGh3A==", - "dev": true, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-discard-overridden": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-5.1.0.tgz", - "integrity": "sha512-21nOL7RqWR1kasIVdKs8HNqQJhFxLsyRfAnUDm4Fe4t4mCWL9OJiHvlHPjcd8zc5Myu89b/7wZDnOSjFgeWRtw==", - "dev": true, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-load-config": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-3.1.4.tgz", - "integrity": "sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==", - "dev": true, - "dependencies": { - "lilconfig": "^2.0.5", - "yaml": "^1.10.2" - }, - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - "peerDependencies": { - "postcss": ">=8.0.9", - "ts-node": ">=9.0.0" - }, - "peerDependenciesMeta": { - "postcss": { - "optional": true - }, - "ts-node": { - "optional": true - } - } - }, - "node_modules/postcss-loader": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-6.2.1.tgz", - "integrity": "sha512-WbbYpmAaKcux/P66bZ40bpWsBucjx/TTgVVzRZ9yUO8yQfVBlameJ0ZGVaPfH64hNSBh63a+ICP5nqOpBA0w+Q==", - "dev": true, - "dependencies": { - "cosmiconfig": "^7.0.0", - "klona": "^2.0.5", - "semver": "^7.3.5" - }, - "engines": { - "node": ">= 12.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "postcss": "^7.0.0 || ^8.0.1", - "webpack": "^5.0.0" - } - }, - "node_modules/postcss-merge-longhand": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-5.1.6.tgz", - "integrity": "sha512-6C/UGF/3T5OE2CEbOuX7iNO63dnvqhGZeUnKkDeifebY0XqkkvrctYSZurpNE902LDf2yKwwPFgotnfSoPhQiw==", - "dev": true, - "dependencies": { - "postcss-value-parser": "^4.2.0", - "stylehacks": "^5.1.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-merge-rules": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-5.1.2.tgz", - "integrity": "sha512-zKMUlnw+zYCWoPN6yhPjtcEdlJaMUZ0WyVcxTAmw3lkkN/NDMRkOkiuctQEoWAOvH7twaxUUdvBWl0d4+hifRQ==", - "dev": true, - "dependencies": { - "browserslist": "^4.16.6", - "caniuse-api": "^3.0.0", - "cssnano-utils": "^3.1.0", - "postcss-selector-parser": "^6.0.5" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-minify-font-values": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-5.1.0.tgz", - "integrity": "sha512-el3mYTgx13ZAPPirSVsHqFzl+BBBDrXvbySvPGFnQcTI4iNslrPaFq4muTkLZmKlGk4gyFAYUBMH30+HurREyA==", - "dev": true, - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-minify-gradients": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-5.1.1.tgz", - "integrity": "sha512-VGvXMTpCEo4qHTNSa9A0a3D+dxGFZCYwR6Jokk+/3oB6flu2/PnPXAh2x7x52EkY5xlIHLm+Le8tJxe/7TNhzw==", - "dev": true, - "dependencies": { - "colord": "^2.9.1", - "cssnano-utils": "^3.1.0", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-minify-params": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-5.1.3.tgz", - "integrity": "sha512-bkzpWcjykkqIujNL+EVEPOlLYi/eZ050oImVtHU7b4lFS82jPnsCb44gvC6pxaNt38Els3jWYDHTjHKf0koTgg==", - "dev": true, - "dependencies": { - "browserslist": "^4.16.6", - "cssnano-utils": "^3.1.0", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-minify-selectors": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-5.2.1.tgz", - "integrity": "sha512-nPJu7OjZJTsVUmPdm2TcaiohIwxP+v8ha9NehQ2ye9szv4orirRU3SDdtUmKH+10nzn0bAyOXZ0UEr7OpvLehg==", - "dev": true, - "dependencies": { - "postcss-selector-parser": "^6.0.5" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-modules-extract-imports": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz", - "integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==", - "dev": true, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-local-by-default": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz", - "integrity": "sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ==", - "dev": true, - "dependencies": { - "icss-utils": "^5.0.0", - "postcss-selector-parser": "^6.0.2", - "postcss-value-parser": "^4.1.0" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-scope": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz", - "integrity": "sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==", - "dev": true, - "dependencies": { - "postcss-selector-parser": "^6.0.4" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-values": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", - "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", - "dev": true, - "dependencies": { - "icss-utils": "^5.0.0" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-normalize-charset": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-5.1.0.tgz", - "integrity": "sha512-mSgUJ+pd/ldRGVx26p2wz9dNZ7ji6Pn8VWBajMXFf8jk7vUoSrZ2lt/wZR7DtlZYKesmZI680qjr2CeFF2fbUg==", - "dev": true, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-normalize-display-values": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-5.1.0.tgz", - "integrity": "sha512-WP4KIM4o2dazQXWmFaqMmcvsKmhdINFblgSeRgn8BJ6vxaMyaJkwAzpPpuvSIoG/rmX3M+IrRZEz2H0glrQNEA==", - "dev": true, - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-normalize-positions": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-5.1.1.tgz", - "integrity": "sha512-6UpCb0G4eofTCQLFVuI3EVNZzBNPiIKcA1AKVka+31fTVySphr3VUgAIULBhxZkKgwLImhzMR2Bw1ORK+37INg==", - "dev": true, - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-normalize-repeat-style": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-5.1.1.tgz", - "integrity": "sha512-mFpLspGWkQtBcWIRFLmewo8aC3ImN2i/J3v8YCFUwDnPu3Xz4rLohDO26lGjwNsQxB3YF0KKRwspGzE2JEuS0g==", - "dev": true, - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-normalize-string": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-5.1.0.tgz", - "integrity": "sha512-oYiIJOf4T9T1N4i+abeIc7Vgm/xPCGih4bZz5Nm0/ARVJ7K6xrDlLwvwqOydvyL3RHNf8qZk6vo3aatiw/go3w==", - "dev": true, - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-normalize-timing-functions": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-5.1.0.tgz", - "integrity": "sha512-DOEkzJ4SAXv5xkHl0Wa9cZLF3WCBhF3o1SKVxKQAa+0pYKlueTpCgvkFAHfk+Y64ezX9+nITGrDZeVGgITJXjg==", - "dev": true, - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-normalize-unicode": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-5.1.0.tgz", - "integrity": "sha512-J6M3MizAAZ2dOdSjy2caayJLQT8E8K9XjLce8AUQMwOrCvjCHv24aLC/Lps1R1ylOfol5VIDMaM/Lo9NGlk1SQ==", - "dev": true, - "dependencies": { - "browserslist": "^4.16.6", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-normalize-url": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-5.1.0.tgz", - "integrity": "sha512-5upGeDO+PVthOxSmds43ZeMeZfKH+/DKgGRD7TElkkyS46JXAUhMzIKiCa7BabPeIy3AQcTkXwVVN7DbqsiCew==", - "dev": true, - "dependencies": { - "normalize-url": "^6.0.1", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-normalize-whitespace": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-5.1.1.tgz", - "integrity": "sha512-83ZJ4t3NUDETIHTa3uEg6asWjSBYL5EdkVB0sDncx9ERzOKBVJIUeDO9RyA9Zwtig8El1d79HBp0JEi8wvGQnA==", - "dev": true, - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-ordered-values": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-5.1.3.tgz", - "integrity": "sha512-9UO79VUhPwEkzbb3RNpqqghc6lcYej1aveQteWY+4POIwlqkYE21HKWaLDF6lWNuqCobEAyTovVhtI32Rbv2RQ==", - "dev": true, - "dependencies": { - "cssnano-utils": "^3.1.0", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-reduce-initial": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-5.1.0.tgz", - "integrity": "sha512-5OgTUviz0aeH6MtBjHfbr57tml13PuedK/Ecg8szzd4XRMbYxH4572JFG067z+FqBIf6Zp/d+0581glkvvWMFw==", - "dev": true, - "dependencies": { - "browserslist": "^4.16.6", - "caniuse-api": "^3.0.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-reduce-transforms": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-5.1.0.tgz", - "integrity": "sha512-2fbdbmgir5AvpW9RLtdONx1QoYG2/EtqpNQbFASDlixBbAYuTcJ0dECwlqNqH7VbaUnEnh8SrxOe2sRIn24XyQ==", - "dev": true, - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-selector-parser": { - "version": "6.0.10", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", - "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", - "dev": true, - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-svgo": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-5.1.0.tgz", - "integrity": "sha512-D75KsH1zm5ZrHyxPakAxJWtkyXew5qwS70v56exwvw542d9CRtTo78K0WeFxZB4G7JXKKMbEZtZayTGdIky/eA==", - "dev": true, - "dependencies": { - "postcss-value-parser": "^4.2.0", - "svgo": "^2.7.0" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-unique-selectors": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-5.1.1.tgz", - "integrity": "sha512-5JiODlELrz8L2HwxfPnhOWZYWDxVHWL83ufOv84NrcgipI7TaeRsatAhK4Tr2/ZiYldpK/wBvw5BD3qfaK96GA==", - "dev": true, - "dependencies": { - "postcss-selector-parser": "^6.0.5" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/postcss-value-parser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", - "dev": true - }, - "node_modules/prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", - "dev": true, - "optional": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/pretty-time": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pretty-time/-/pretty-time-1.1.0.tgz", - "integrity": "sha512-28iF6xPQrP8Oa6uxE6a1biz+lWeTOAPKggvjB8HAs6nVMKZwf5bG++632Dx614hIWgUPkgivRfG+a8uAXGTIbA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "dev": true, - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "dev": true, - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/proxy-addr/node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", - "dev": true - }, - "node_modules/public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/public-encrypt/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "dev": true, - "dependencies": { - "side-channel": "^1.0.6" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==", - "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", - "dev": true, - "engines": { - "node": ">=0.4.x" - } - }, - "node_modules/querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==", - "dev": true, - "engines": { - "node": ">=0.4.x" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "dependencies": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "dev": true, - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/raw-body/node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/readable-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/rechoir": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", - "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", - "dev": true, - "dependencies": { - "resolve": "^1.9.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/regenerate": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", - "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", - "dev": true - }, - "node_modules/regenerate-unicode-properties": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.0.1.tgz", - "integrity": "sha512-vn5DU6yg6h8hP/2OkQo3K7uVILvY4iu0oI4t3HFa81UPkhGJwkRwM10JEc3upjdhHjs/k8GJY1sRBhk5sr69Bw==", - "dev": true, - "dependencies": { - "regenerate": "^1.4.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", - "dev": true - }, - "node_modules/regenerator-transform": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.0.tgz", - "integrity": "sha512-LsrGtPmbYg19bcPHwdtmXwbW+TqNvtY4riE3P83foeHRroMbH6/2ddFBfab3t7kbzc7v7p4wbkIecHImqt0QNg==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.8.4" - } - }, - "node_modules/regex-parser": { - "version": "2.2.11", - "resolved": "https://registry.npmjs.org/regex-parser/-/regex-parser-2.2.11.tgz", - "integrity": "sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q==", - "dev": true - }, - "node_modules/regexpu-core": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.1.0.tgz", - "integrity": "sha512-bb6hk+xWd2PEOkj5It46A16zFMs2mv86Iwpdu94la4S3sJ7C973h2dHpYKwIBGaWSO7cIRJ+UX0IeMaWcO4qwA==", - "dev": true, - "dependencies": { - "regenerate": "^1.4.2", - "regenerate-unicode-properties": "^10.0.1", - "regjsgen": "^0.6.0", - "regjsparser": "^0.8.2", - "unicode-match-property-ecmascript": "^2.0.0", - "unicode-match-property-value-ecmascript": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/regjsgen": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.6.0.tgz", - "integrity": "sha512-ozE883Uigtqj3bx7OhL1KNbCzGyW2NQZPl6Hs09WTvCuZD5sTI4JY58bkbQWa/Y9hxIsvJ3M8Nbf7j54IqeZbA==", - "dev": true - }, - "node_modules/regjsparser": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.8.4.tgz", - "integrity": "sha512-J3LABycON/VNEu3abOviqGHuB/LOtOQj8SKmfP9anY5GfAVw/SPjwzSjxGjbZXIxbGfqTHtJw58C2Li/WkStmA==", - "dev": true, - "dependencies": { - "jsesc": "~0.5.0" - }, - "bin": { - "regjsparser": "bin/parser" - } - }, - "node_modules/regjsparser/node_modules/jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - } - }, - "node_modules/relateurl": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", - "integrity": "sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/replace-ext": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", - "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true - }, - "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", - "dev": true, - "dependencies": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "dependencies": { - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve-cwd/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "node_modules/resolve-url-loader": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/resolve-url-loader/-/resolve-url-loader-3.1.5.tgz", - "integrity": "sha512-mgFMCmrV/tA4738EsFmPFE5/MaqSgUMe8LK971kVEKA/RrNVb7+VqFsg/qmKyythf34eyq476qIobP/gfFBGSQ==", - "dev": true, - "dependencies": { - "adjust-sourcemap-loader": "3.0.0", - "camelcase": "5.3.1", - "compose-function": "3.0.3", - "convert-source-map": "1.7.0", - "es6-iterator": "2.0.3", - "loader-utils": "^1.2.3", - "postcss": "7.0.36", - "rework": "1.0.1", - "rework-visit": "1.0.0", - "source-map": "0.6.1" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/resolve-url-loader/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/resolve-url-loader/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/resolve-url-loader/node_modules/chalk/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/resolve-url-loader/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/resolve-url-loader/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/resolve-url-loader/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/resolve-url-loader/node_modules/postcss": { - "version": "7.0.36", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", - "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", - "dev": true, - "dependencies": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - }, - "engines": { - "node": ">=6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - } - }, - "node_modules/resolve-url-loader/node_modules/supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/retry": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", - "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rework": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/rework/-/rework-1.0.1.tgz", - "integrity": "sha1-MIBqhBNCtUUQqkEQhQzUhTQUSqc=", - "dev": true, - "dependencies": { - "convert-source-map": "^0.3.3", - "css": "^2.0.0" - } - }, - "node_modules/rework-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/rework-visit/-/rework-visit-1.0.0.tgz", - "integrity": "sha1-mUWygD8hni96ygCtuLyfZA+ELJo=", - "dev": true - }, - "node_modules/rework/node_modules/convert-source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-0.3.5.tgz", - "integrity": "sha1-8dgClQr33SYxof6+BZZVDIarMZA=", - "dev": true - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "node_modules/sass": { - "version": "1.32.8", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.32.8.tgz", - "integrity": "sha512-Sl6mIeGpzjIUZqvKnKETfMf0iDAswD9TNlv13A7aAF3XZlRPMq4VvJWBC2N2DXbp94MQVdNSFG6LfF/iOXrPHQ==", - "dev": true, - "dependencies": { - "chokidar": ">=2.0.0 <4.0.0" - }, - "bin": { - "sass": "sass.js" - }, - "engines": { - "node": ">=8.9.0" - } - }, - "node_modules/sass-loader": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-8.0.2.tgz", - "integrity": "sha512-7o4dbSK8/Ol2KflEmSco4jTjQoV988bM82P9CZdmo9hR3RLnvNc0ufMNdMrB0caq38JQ/FgF4/7RcbcfKzxoFQ==", - "dev": true, - "dependencies": { - "clone-deep": "^4.0.1", - "loader-utils": "^1.2.3", - "neo-async": "^2.6.1", - "schema-utils": "^2.6.1", - "semver": "^6.3.0" - }, - "engines": { - "node": ">= 8.9.0" - } - }, - "node_modules/sass-loader/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/schema-utils": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", - "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.5", - "ajv": "^6.12.4", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 8.9.0" - } - }, - "node_modules/select-hose": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", - "integrity": "sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg==", - "dev": true - }, - "node_modules/selfsigned": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.1.1.tgz", - "integrity": "sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ==", - "dev": true, - "dependencies": { - "node-forge": "^1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/send": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", - "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", - "dev": true, - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/send/node_modules/debug/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/send/node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "node_modules/serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/serve-index": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", - "integrity": "sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==", - "dev": true, - "dependencies": { - "accepts": "~1.3.4", - "batch": "0.6.1", - "debug": "2.6.9", - "escape-html": "~1.0.3", - "http-errors": "~1.6.2", - "mime-types": "~2.1.17", - "parseurl": "~1.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/serve-index/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/serve-index/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/serve-index/node_modules/http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==", - "dev": true, - "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/serve-index/node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", - "dev": true - }, - "node_modules/serve-index/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/serve-index/node_modules/setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "dev": true - }, - "node_modules/serve-index/node_modules/statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/serve-static": { - "version": "1.16.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", - "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", - "dev": true, - "dependencies": { - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.19.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", - "dev": true - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "dev": true - }, - "node_modules/sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, - "bin": { - "sha.js": "bin.js" - } - }, - "node_modules/shallow-clone": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/shellwords": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", - "dev": true - }, - "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, - "node_modules/simplebar": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/simplebar/-/simplebar-5.3.8.tgz", - "integrity": "sha512-LOHjyOcihx++zFN+vuktoZBGpCarFCtHIVDWXOf2VELbGDknq3Hw/sddafRp1aCg123VNkHWOFHUDHYEXAtufQ==", - "dev": true, - "dependencies": { - "@juggle/resize-observer": "^3.3.1", - "can-use-dom": "^0.1.0", - "core-js": "^3.0.1", - "lodash.debounce": "^4.0.8", - "lodash.memoize": "^4.1.2", - "lodash.throttle": "^4.1.1" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/smooth-dnd": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/smooth-dnd/-/smooth-dnd-0.12.1.tgz", - "integrity": "sha512-Dndj/MOG7VP83mvzfGCLGzV2HuK1lWachMtWl/Iuk6zV7noDycIBnflwaPuDzoaapEl3Pc4+ybJArkkx9sxPZg==", - "dev": true - }, - "node_modules/sockjs": { - "version": "0.3.24", - "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz", - "integrity": "sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==", - "dev": true, - "dependencies": { - "faye-websocket": "^0.11.3", - "uuid": "^8.3.2", - "websocket-driver": "^0.7.4" - } - }, - "node_modules/source-list-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "dev": true, - "dependencies": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/source-map-url": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", - "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", - "dev": true - }, - "node_modules/spdy": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz", - "integrity": "sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==", - "dev": true, - "dependencies": { - "debug": "^4.1.0", - "handle-thing": "^2.0.0", - "http-deceiver": "^1.2.7", - "select-hose": "^2.0.0", - "spdy-transport": "^3.0.0" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/spdy-transport": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz", - "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", - "dev": true, - "dependencies": { - "debug": "^4.1.0", - "detect-node": "^2.0.4", - "hpack.js": "^2.1.6", - "obuf": "^1.1.2", - "readable-stream": "^3.0.6", - "wbuf": "^1.7.3" - } - }, - "node_modules/spdy-transport/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/ssr-window": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-3.0.0.tgz", - "integrity": "sha512-q+8UfWDg9Itrg0yWK7oe5p/XRCJpJF9OBtXfOPgSJl+u3Xd5KI328RUEvUqSMVM9CiQUEf1QdBzJMkYGErj9QA==", - "dev": true - }, - "node_modules/stable": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", - "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", - "deprecated": "Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility", - "dev": true - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/std-env": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.2.1.tgz", - "integrity": "sha512-D/uYFWkI/31OrnKmXZqGAGK5GbQRPp/BWA1nuITcc6ICblhhuQUPHS5E2GSCVS7Hwhf4ciq8qsATwBUxv+lI6w==", - "dev": true - }, - "node_modules/stream-browserify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", - "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", - "dev": true, - "dependencies": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" - } - }, - "node_modules/stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", - "dev": true, - "dependencies": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/string_decoder/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/style-loader": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-2.0.0.tgz", - "integrity": "sha512-Z0gYUJmzZ6ZdRUqpg1r8GsaFKypE+3xAzuFeMuoHgjc9KZv3wMyCRjQIWEbhoFSq7+7yoHXySDJyyWQaPajeiQ==", - "dev": true, - "dependencies": { - "loader-utils": "^2.0.0", - "schema-utils": "^3.0.0" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^4.0.0 || ^5.0.0" - } - }, - "node_modules/style-loader/node_modules/loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - }, - "engines": { - "node": ">=8.9.0" - } - }, - "node_modules/style-loader/node_modules/schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/stylehacks": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-5.1.0.tgz", - "integrity": "sha512-SzLmvHQTrIWfSgljkQCw2++C9+Ne91d/6Sp92I8c5uHTcy/PgeHamwITIbBW9wnFTY/3ZfSXR9HIL6Ikqmcu6Q==", - "dev": true, - "dependencies": { - "browserslist": "^4.16.6", - "postcss-selector-parser": "^6.0.4" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/svgo": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz", - "integrity": "sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==", - "dev": true, - "dependencies": { - "@trysound/sax": "0.2.0", - "commander": "^7.2.0", - "css-select": "^4.1.3", - "css-tree": "^1.1.3", - "csso": "^4.2.0", - "picocolors": "^1.0.0", - "stable": "^0.1.8" - }, - "bin": { - "svgo": "bin/svgo" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/svgo/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/swiper": { - "version": "6.8.4", - "resolved": "https://registry.npmjs.org/swiper/-/swiper-6.8.4.tgz", - "integrity": "sha512-O+buF9Q+sMA0H7luMS8R59hCaJKlpo8PXhQ6ZYu6Rn2v9OsFd4d1jmrv14QvxtQpKAvL/ZiovEeANI/uDGet7g==", - "dev": true, - "funding": [ - { - "type": "patreon", - "url": "https://www.patreon.com/vladimirkharlampidi" - }, - { - "type": "open_collective", - "url": "http://opencollective.com/swiper" - } - ], - "hasInstallScript": true, - "dependencies": { - "dom7": "^3.0.0", - "ssr-window": "^3.0.0" - }, - "engines": { - "node": ">= 4.7.0" - } - }, - "node_modules/tapable": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/terser": { - "version": "5.36.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz", - "integrity": "sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==", - "dev": true, - "dependencies": { - "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/terser-webpack-plugin": { - "version": "5.3.10", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", - "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", - "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.20", - "jest-worker": "^27.4.5", - "schema-utils": "^3.1.1", - "serialize-javascript": "^6.0.1", - "terser": "^5.26.0" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^5.1.0" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "esbuild": { - "optional": true - }, - "uglify-js": { - "optional": true - } - } - }, - "node_modules/terser-webpack-plugin/node_modules/schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/thunky": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", - "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", - "dev": true - }, - "node_modules/timers-browserify": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", - "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", - "dev": true, - "dependencies": { - "setimmediate": "^1.0.4" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/tippy.js": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.1.tgz", - "integrity": "sha512-JnFncCq+rF1dTURupoJ4yPie5Cof978inW6/4S6kmWV7LL9YOSEVMifED3KdrVPEG+Z/TFH2CDNJcQEfaeuQww==", - "dev": true, - "dependencies": { - "@popperjs/core": "^2.8.3" - } - }, - "node_modules/to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha512-okFlQcoGTi4LQBG/PgSYblw9VOyptsz2KJZqc6qtgGdes8VktzUQkj4BI2blit072iS8VODNcMA+tvnS9dnuMA==", - "dev": true - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "dev": true, - "engines": { - "node": ">=0.6" - } - }, - "node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "dev": true - }, - "node_modules/tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha512-JVa5ijo+j/sOoHGjw0sxw734b1LhBkQ3bvUGNdxnVXDCX81Yx7TFgnZygxrIIWn23hbfTaMYLwRmAxFyDuFmIw==", - "dev": true - }, - "node_modules/type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", - "dev": true - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dev": true, - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/unicode-canonical-property-names-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", - "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-match-property-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", - "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", - "dev": true, - "dependencies": { - "unicode-canonical-property-names-ecmascript": "^2.0.0", - "unicode-property-aliases-ecmascript": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-match-property-value-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz", - "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-property-aliases-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz", - "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/update-browserslist-db": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", - "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.0" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "node_modules/url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ==", - "dev": true, - "dependencies": { - "punycode": "1.3.2", - "querystring": "0.2.0" - } - }, - "node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", - "dev": true - }, - "node_modules/util": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", - "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", - "dev": true, - "dependencies": { - "inherits": "2.0.3" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, - "node_modules/util/node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", - "dev": true - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "dev": true, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "dev": true - }, - "node_modules/vue": { - "version": "2.7.16", - "resolved": "https://registry.npmjs.org/vue/-/vue-2.7.16.tgz", - "integrity": "sha512-4gCtFXaAA3zYZdTp5s4Hl2sozuySsgz4jy1EnpBHNfpMa9dK1ZCG7viqBPCwXtmgc8nHqUsAu3G4gtmXkkY3Sw==", - "deprecated": "Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.", - "dev": true, - "dependencies": { - "@vue/compiler-sfc": "2.7.16", - "csstype": "^3.1.0" - } - }, - "node_modules/vue-content-placeholders": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/vue-content-placeholders/-/vue-content-placeholders-0.2.1.tgz", - "integrity": "sha512-Q+HPjuY98R0fLQ45eOOCYeMY7vpjU1H/Qqs0ptdBI6xe3nDDsPE4r/kN5YA9rVxQFP/PKhG5qQR4rqy02xPabw==", - "dev": true - }, - "node_modules/vue-hot-reload-api": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz", - "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==", - "dev": true - }, - "node_modules/vue-loader": { - "version": "15.11.1", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.11.1.tgz", - "integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==", - "dev": true, - "dependencies": { - "@vue/component-compiler-utils": "^3.1.0", - "hash-sum": "^1.0.2", - "loader-utils": "^1.1.0", - "vue-hot-reload-api": "^2.3.0", - "vue-style-loader": "^4.1.0" - }, - "peerDependencies": { - "css-loader": "*", - "webpack": "^3.0.0 || ^4.1.0 || ^5.0.0-0" - }, - "peerDependenciesMeta": { - "cache-loader": { - "optional": true - }, - "prettier": { - "optional": true - }, - "vue-template-compiler": { - "optional": true - } - } - }, - "node_modules/vue-smooth-dnd": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/vue-smooth-dnd/-/vue-smooth-dnd-0.8.1.tgz", - "integrity": "sha512-eZVVPTwz4A1cs0+CjXx/ihV+gAl3QBoWQnU6+23Gp59t0WBU99z7ducBQ4FvjBamqOlg8SDOE5eFHQedxwB4Wg==", - "dev": true, - "dependencies": { - "smooth-dnd": "0.12.1" - } - }, - "node_modules/vue-style-loader": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.3.tgz", - "integrity": "sha512-sFuh0xfbtpRlKfm39ss/ikqs9AbKCoXZBpHeVZ8Tx650o0k0q/YCM7FRvigtxpACezfq6af+a7JeqVTWvncqDg==", - "dev": true, - "dependencies": { - "hash-sum": "^1.0.2", - "loader-utils": "^1.0.2" - } - }, - "node_modules/vue-template-compiler": { - "version": "2.7.16", - "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.16.tgz", - "integrity": "sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==", - "dev": true, - "dependencies": { - "de-indent": "^1.0.2", - "he": "^1.2.0" - } - }, - "node_modules/vue-template-es2015-compiler": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz", - "integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==", - "dev": true - }, - "node_modules/vuex": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz", - "integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==", - "dev": true, - "peerDependencies": { - "vue": "^2.0.0" - } - }, - "node_modules/watchpack": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", - "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", - "dev": true, - "dependencies": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/wbuf": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", - "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", - "dev": true, - "dependencies": { - "minimalistic-assert": "^1.0.0" - } - }, - "node_modules/webpack": { - "version": "5.96.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.96.1.tgz", - "integrity": "sha512-l2LlBSvVZGhL4ZrPwyr8+37AunkcYj5qh8o6u2/2rzoPc8gxFJkLj1WxNgooi9pnoc06jh0BjuXnamM4qlujZA==", - "dev": true, - "dependencies": { - "@types/eslint-scope": "^3.7.7", - "@types/estree": "^1.0.6", - "@webassemblyjs/ast": "^1.12.1", - "@webassemblyjs/wasm-edit": "^1.12.1", - "@webassemblyjs/wasm-parser": "^1.12.1", - "acorn": "^8.14.0", - "browserslist": "^4.24.0", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.17.1", - "es-module-lexer": "^1.2.1", - "eslint-scope": "5.1.1", - "events": "^3.2.0", - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.11", - "json-parse-even-better-errors": "^2.3.1", - "loader-runner": "^4.2.0", - "mime-types": "^2.1.27", - "neo-async": "^2.6.2", - "schema-utils": "^3.2.0", - "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.10", - "watchpack": "^2.4.1", - "webpack-sources": "^3.2.3" - }, - "bin": { - "webpack": "bin/webpack.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependenciesMeta": { - "webpack-cli": { - "optional": true - } - } - }, - "node_modules/webpack-cli": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz", - "integrity": "sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==", - "dev": true, - "dependencies": { - "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^1.2.0", - "@webpack-cli/info": "^1.5.0", - "@webpack-cli/serve": "^1.7.0", - "colorette": "^2.0.14", - "commander": "^7.0.0", - "cross-spawn": "^7.0.3", - "fastest-levenshtein": "^1.0.12", - "import-local": "^3.0.2", - "interpret": "^2.2.0", - "rechoir": "^0.7.0", - "webpack-merge": "^5.7.3" - }, - "bin": { - "webpack-cli": "bin/cli.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "4.x.x || 5.x.x" - }, - "peerDependenciesMeta": { - "@webpack-cli/generators": { - "optional": true - }, - "@webpack-cli/migrate": { - "optional": true - }, - "webpack-bundle-analyzer": { - "optional": true - }, - "webpack-dev-server": { - "optional": true - } - } - }, - "node_modules/webpack-cli/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/webpack-dev-middleware": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-5.3.4.tgz", - "integrity": "sha512-BVdTqhhs+0IfoeAf7EoH5WE+exCmqGerHfDM0IL096Px60Tq2Mn9MAbnaGUe6HiMa41KMCYF19gyzZmBcq/o4Q==", - "dev": true, - "dependencies": { - "colorette": "^2.0.10", - "memfs": "^3.4.3", - "mime-types": "^2.1.31", - "range-parser": "^1.2.1", - "schema-utils": "^4.0.0" - }, - "engines": { - "node": ">= 12.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^4.0.0 || ^5.0.0" - } - }, - "node_modules/webpack-dev-middleware/node_modules/ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/webpack-dev-middleware/node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, - "node_modules/webpack-dev-middleware/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/webpack-dev-middleware/node_modules/schema-utils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", - "integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.8.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.0.0" - }, - "engines": { - "node": ">= 12.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/webpack-dev-server": { - "version": "4.11.0", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.11.0.tgz", - "integrity": "sha512-L5S4Q2zT57SK7tazgzjMiSMBdsw+rGYIX27MgPgx7LDhWO0lViPrHKoLS7jo5In06PWYAhlYu3PbyoC6yAThbw==", - "dev": true, - "dependencies": { - "@types/bonjour": "^3.5.9", - "@types/connect-history-api-fallback": "^1.3.5", - "@types/express": "^4.17.13", - "@types/serve-index": "^1.9.1", - "@types/serve-static": "^1.13.10", - "@types/sockjs": "^0.3.33", - "@types/ws": "^8.5.1", - "ansi-html-community": "^0.0.8", - "bonjour-service": "^1.0.11", - "chokidar": "^3.5.3", - "colorette": "^2.0.10", - "compression": "^1.7.4", - "connect-history-api-fallback": "^2.0.0", - "default-gateway": "^6.0.3", - "express": "^4.17.3", - "graceful-fs": "^4.2.6", - "html-entities": "^2.3.2", - "http-proxy-middleware": "^2.0.3", - "ipaddr.js": "^2.0.1", - "open": "^8.0.9", - "p-retry": "^4.5.0", - "rimraf": "^3.0.2", - "schema-utils": "^4.0.0", - "selfsigned": "^2.0.1", - "serve-index": "^1.9.1", - "sockjs": "^0.3.24", - "spdy": "^4.0.2", - "webpack-dev-middleware": "^5.3.1", - "ws": "^8.4.2" - }, - "bin": { - "webpack-dev-server": "bin/webpack-dev-server.js" - }, - "engines": { - "node": ">= 12.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^4.37.0 || ^5.0.0" - }, - "peerDependenciesMeta": { - "webpack-cli": { - "optional": true - } - } - }, - "node_modules/webpack-dev-server/node_modules/ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/webpack-dev-server/node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, - "node_modules/webpack-dev-server/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/webpack-dev-server/node_modules/schema-utils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", - "integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.8.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.0.0" - }, - "engines": { - "node": ">= 12.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/webpack-merge": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", - "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", - "dev": true, - "dependencies": { - "clone-deep": "^4.0.1", - "wildcard": "^2.0.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/webpack-notifier": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/webpack-notifier/-/webpack-notifier-1.15.0.tgz", - "integrity": "sha512-N2V8UMgRB5komdXQRavBsRpw0hPhJq2/SWNOGuhrXpIgRhcMexzkGQysUyGStHLV5hkUlgpRiF7IUXoBqyMmzQ==", - "dev": true, - "dependencies": { - "node-notifier": "^9.0.0", - "strip-ansi": "^6.0.0" - }, - "peerDependencies": { - "@types/webpack": ">4.41.31" - }, - "peerDependenciesMeta": { - "@types/webpack": { - "optional": true - } - } - }, - "node_modules/webpack-sources": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", - "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", - "dev": true, - "dependencies": { - "source-list-map": "^2.0.0", - "source-map": "~0.6.1" - } - }, - "node_modules/webpack/node_modules/schema-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/webpack/node_modules/webpack-sources": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", - "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", - "dev": true, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/webpackbar": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/webpackbar/-/webpackbar-5.0.2.tgz", - "integrity": "sha512-BmFJo7veBDgQzfWXl/wwYXr/VFus0614qZ8i9znqcl9fnEdiVkdbi0TedLQ6xAK92HZHDJ0QmyQ0fmuZPAgCYQ==", - "dev": true, - "dependencies": { - "chalk": "^4.1.0", - "consola": "^2.15.3", - "pretty-time": "^1.1.0", - "std-env": "^3.0.1" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "webpack": "3 || 4 || 5" - } - }, - "node_modules/websocket-driver": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", - "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", - "dev": true, - "dependencies": { - "http-parser-js": ">=0.5.1", - "safe-buffer": ">=5.1.0", - "websocket-extensions": ">=0.1.1" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/websocket-extensions": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", - "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wildcard": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", - "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", - "dev": true - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/ws": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", - "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true, - "engines": { - "node": ">=0.4" - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, - "node_modules/yargs": { - "version": "17.5.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", - "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", - "dev": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "engines": { - "node": ">=12" - } - } - }, - "dependencies": { - "@ampproject/remapping": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", - "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", - "dev": true, - "requires": { - "@jridgewell/gen-mapping": "^0.1.0", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, - "@babel/code-frame": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", - "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.25.9", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" - } - }, - "@babel/compat-data": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.19.0.tgz", - "integrity": "sha512-y5rqgTTPTmaF5e2nVhOxw+Ur9HDJLsWb6U/KpgUzRZEdPfE6VOubXBKLdbcUTijzRptednSBDQbYZBOSqJxpJw==", - "dev": true - }, - "@babel/core": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.19.0.tgz", - "integrity": "sha512-reM4+U7B9ss148rh2n1Qs9ASS+w94irYXga7c2jaQv9RVzpS7Mv1a9rnYYwuDa45G+DkORt9g6An2k/V4d9LbQ==", - "dev": true, - "requires": { - "@ampproject/remapping": "^2.1.0", - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.19.0", - "@babel/helper-compilation-targets": "^7.19.0", - "@babel/helper-module-transforms": "^7.19.0", - "@babel/helpers": "^7.19.0", - "@babel/parser": "^7.19.0", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.1", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "@babel/generator": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.2.tgz", - "integrity": "sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==", - "dev": true, - "requires": { - "@babel/parser": "^7.26.2", - "@babel/types": "^7.26.0", - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25", - "jsesc": "^3.0.2" - }, - "dependencies": { - "@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", - "dev": true, - "requires": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" - } - } - } - }, - "@babel/helper-annotate-as-pure": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz", - "integrity": "sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==", - "dev": true, - "requires": { - "@babel/types": "^7.18.6" - } - }, - "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz", - "integrity": "sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw==", - "dev": true, - "requires": { - "@babel/helper-explode-assignable-expression": "^7.18.6", - "@babel/types": "^7.18.9" - } - }, - "@babel/helper-compilation-targets": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.0.tgz", - "integrity": "sha512-Ai5bNWXIvwDvWM7njqsG3feMlL9hCVQsPYXodsZyLwshYkZVJt59Gftau4VrE8S9IT9asd2uSP1hG6wCNw+sXA==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.19.0", - "@babel/helper-validator-option": "^7.18.6", - "browserslist": "^4.20.2", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "@babel/helper-create-class-features-plugin": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.19.0.tgz", - "integrity": "sha512-NRz8DwF4jT3UfrmUoZjd0Uph9HQnP30t7Ash+weACcyNkiYTywpIjDBgReJMKgr+n86sn2nPVVmJ28Dm053Kqw==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", - "@babel/helper-member-expression-to-functions": "^7.18.9", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/helper-replace-supers": "^7.18.9", - "@babel/helper-split-export-declaration": "^7.18.6" - } - }, - "@babel/helper-create-regexp-features-plugin": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.19.0.tgz", - "integrity": "sha512-htnV+mHX32DF81amCDrwIDr8nrp1PTm+3wfBN9/v8QJOLEioOCOG7qNyq0nHeFiWbT3Eb7gsPwEmV64UCQ1jzw==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "regexpu-core": "^5.1.0" - } - }, - "@babel/helper-define-polyfill-provider": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.2.tgz", - "integrity": "sha512-r9QJJ+uDWrd+94BSPcP6/de67ygLtvVy6cK4luE6MOuDsZIdoaPBnfSpbO/+LTifjPckbKXRuI9BB/Z2/y3iTg==", - "dev": true, - "requires": { - "@babel/helper-compilation-targets": "^7.17.7", - "@babel/helper-plugin-utils": "^7.16.7", - "debug": "^4.1.1", - "lodash.debounce": "^4.0.8", - "resolve": "^1.14.2", - "semver": "^6.1.2" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "@babel/helper-environment-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", - "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", - "dev": true - }, - "@babel/helper-explode-assignable-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz", - "integrity": "sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg==", - "dev": true, - "requires": { - "@babel/types": "^7.18.6" - } - }, - "@babel/helper-function-name": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz", - "integrity": "sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==", - "dev": true, - "requires": { - "@babel/template": "^7.18.10", - "@babel/types": "^7.19.0" - } - }, - "@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", - "dev": true, - "requires": { - "@babel/types": "^7.18.6" - } - }, - "@babel/helper-member-expression-to-functions": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.18.9.tgz", - "integrity": "sha512-RxifAh2ZoVU67PyKIO4AMi1wTenGfMR/O/ae0CCRqwgBAt5v7xjdtRw7UoSbsreKrQn5t7r89eruK/9JjYHuDg==", - "dev": true, - "requires": { - "@babel/types": "^7.18.9" - } - }, - "@babel/helper-module-imports": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", - "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", - "dev": true, - "requires": { - "@babel/types": "^7.18.6" - } - }, - "@babel/helper-module-transforms": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz", - "integrity": "sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ==", - "dev": true, - "requires": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-simple-access": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/helper-validator-identifier": "^7.18.6", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0" - } - }, - "@babel/helper-optimise-call-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz", - "integrity": "sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==", - "dev": true, - "requires": { - "@babel/types": "^7.18.6" - } - }, - "@babel/helper-plugin-utils": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz", - "integrity": "sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw==", - "dev": true - }, - "@babel/helper-remap-async-to-generator": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz", - "integrity": "sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-wrap-function": "^7.18.9", - "@babel/types": "^7.18.9" - } - }, - "@babel/helper-replace-supers": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.18.9.tgz", - "integrity": "sha512-dNsWibVI4lNT6HiuOIBr1oyxo40HvIVmbwPUm3XZ7wMh4k2WxrxTqZwSqw/eEmXDS9np0ey5M2bz9tBmO9c+YQ==", - "dev": true, - "requires": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-member-expression-to-functions": "^7.18.9", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/traverse": "^7.18.9", - "@babel/types": "^7.18.9" - } - }, - "@babel/helper-simple-access": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz", - "integrity": "sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==", - "dev": true, - "requires": { - "@babel/types": "^7.18.6" - } - }, - "@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.18.9.tgz", - "integrity": "sha512-imytd2gHi3cJPsybLRbmFrF7u5BIEuI2cNheyKi3/iOBC63kNn3q8Crn2xVuESli0aM4KYsyEqKyS7lFL8YVtw==", - "dev": true, - "requires": { - "@babel/types": "^7.18.9" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", - "dev": true, - "requires": { - "@babel/types": "^7.18.6" - } - }, - "@babel/helper-string-parser": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", - "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", - "dev": true - }, - "@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", - "dev": true - }, - "@babel/helper-validator-option": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", - "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", - "dev": true - }, - "@babel/helper-wrap-function": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.19.0.tgz", - "integrity": "sha512-txX8aN8CZyYGTwcLhlk87KRqncAzhh5TpQamZUa0/u3an36NtDpUP6bQgBCBcLeBs09R/OwQu3OjK0k/HwfNDg==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.19.0", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0" - } - }, - "@babel/helpers": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.19.0.tgz", - "integrity": "sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg==", - "dev": true, - "requires": { - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0" - } - }, - "@babel/parser": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", - "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", - "dev": true, - "requires": { - "@babel/types": "^7.26.0" - } - }, - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz", - "integrity": "sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.18.9.tgz", - "integrity": "sha512-AHrP9jadvH7qlOj6PINbgSuphjQUAK7AOT7DPjBo9EHoLhQTnnK5u45e1Hd4DbSQEO9nqPWtQ89r+XEOWFScKg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/helper-skip-transparent-expression-wrappers": "^7.18.9", - "@babel/plugin-proposal-optional-chaining": "^7.18.9" - } - }, - "@babel/plugin-proposal-async-generator-functions": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.19.0.tgz", - "integrity": "sha512-nhEByMUTx3uZueJ/QkJuSlCfN4FGg+xy+vRsfGQGzSauq5ks2Deid2+05Q3KhfaUjvec1IGhw/Zm3cFm8JigTQ==", - "dev": true, - "requires": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-plugin-utils": "^7.19.0", - "@babel/helper-remap-async-to-generator": "^7.18.9", - "@babel/plugin-syntax-async-generators": "^7.8.4" - } - }, - "@babel/plugin-proposal-class-properties": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz", - "integrity": "sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-proposal-class-static-block": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.18.6.tgz", - "integrity": "sha512-+I3oIiNxrCpup3Gi8n5IGMwj0gOCAjcJUSQEcotNnCCPMEnixawOQ+KeJPlgfjzx+FKQ1QSyZOWe7wmoJp7vhw==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-class-static-block": "^7.14.5" - } - }, - "@babel/plugin-proposal-dynamic-import": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz", - "integrity": "sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-dynamic-import": "^7.8.3" - } - }, - "@babel/plugin-proposal-export-namespace-from": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz", - "integrity": "sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" - } - }, - "@babel/plugin-proposal-json-strings": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz", - "integrity": "sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-json-strings": "^7.8.3" - } - }, - "@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.18.9.tgz", - "integrity": "sha512-128YbMpjCrP35IOExw2Fq+x55LMP42DzhOhX2aNNIdI9avSWl2PI0yuBWarr3RYpZBSPtabfadkH2yeRiMD61Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" - } - }, - "@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz", - "integrity": "sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" - } - }, - "@babel/plugin-proposal-numeric-separator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz", - "integrity": "sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-numeric-separator": "^7.10.4" - } - }, - "@babel/plugin-proposal-object-rest-spread": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.18.9.tgz", - "integrity": "sha512-kDDHQ5rflIeY5xl69CEqGEZ0KY369ehsCIEbTGb4siHG5BE9sga/T0r0OUwyZNLMmZE79E1kbsqAjwFCW4ds6Q==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.18.8", - "@babel/helper-compilation-targets": "^7.18.9", - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.18.8" - } - }, - "@babel/plugin-proposal-optional-catch-binding": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz", - "integrity": "sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" - } - }, - "@babel/plugin-proposal-optional-chaining": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.18.9.tgz", - "integrity": "sha512-v5nwt4IqBXihxGsW2QmCWMDS3B3bzGIk/EQVZz2ei7f3NJl8NzAJVvUmpDW5q1CRNY+Beb/k58UAH1Km1N411w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/helper-skip-transparent-expression-wrappers": "^7.18.9", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" - } - }, - "@babel/plugin-proposal-private-methods": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz", - "integrity": "sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-proposal-private-property-in-object": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.18.6.tgz", - "integrity": "sha512-9Rysx7FOctvT5ouj5JODjAFAkgGoudQuLPamZb0v1TGLpapdNaftzifU8NTWQm0IRjqoYypdrSmyWgkocDQ8Dw==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5" - } - }, - "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz", - "integrity": "sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-class-properties": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", - "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13" - } - }, - "@babel/plugin-syntax-class-static-block": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", - "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", - "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-export-namespace-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", - "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-import-assertions": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.18.6.tgz", - "integrity": "sha512-/DU3RXad9+bZwrgWJQKbr39gYbJpLJHezqEzRzi/BHRlJ9zsQb4CK2CA/5apllXNomwA1qHwzvHl+AdEmC5krQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-private-property-in-object": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", - "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-syntax-top-level-await": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", - "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-arrow-functions": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.18.6.tgz", - "integrity": "sha512-9S9X9RUefzrsHZmKMbDXxweEH+YlE8JJEuat9FdvW9Qh1cw7W64jELCtWNkPBPX5En45uy28KGvA/AySqUh8CQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-transform-async-to-generator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.18.6.tgz", - "integrity": "sha512-ARE5wZLKnTgPW7/1ftQmSi1CmkqqHo2DNmtztFhvgtOWSDfq0Cq9/9L+KnZNYSNrydBekhW3rwShduf59RoXag==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/helper-remap-async-to-generator": "^7.18.6" - } - }, - "@babel/plugin-transform-block-scoped-functions": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz", - "integrity": "sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-transform-block-scoping": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.18.9.tgz", - "integrity": "sha512-5sDIJRV1KtQVEbt/EIBwGy4T01uYIo4KRB3VUqzkhrAIOGx7AoctL9+Ux88btY0zXdDyPJ9mW+bg+v+XEkGmtw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.9" - } - }, - "@babel/plugin-transform-classes": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.19.0.tgz", - "integrity": "sha512-YfeEE9kCjqTS9IitkgfJuxjcEtLUHMqa8yUJ6zdz8vR7hKuo6mOy2C05P0F1tdMmDCeuyidKnlrw/iTppHcr2A==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-compilation-targets": "^7.19.0", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/helper-plugin-utils": "^7.19.0", - "@babel/helper-replace-supers": "^7.18.9", - "@babel/helper-split-export-declaration": "^7.18.6", - "globals": "^11.1.0" - } - }, - "@babel/plugin-transform-computed-properties": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.18.9.tgz", - "integrity": "sha512-+i0ZU1bCDymKakLxn5srGHrsAPRELC2WIbzwjLhHW9SIE1cPYkLCL0NlnXMZaM1vhfgA2+M7hySk42VBvrkBRw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.9" - } - }, - "@babel/plugin-transform-destructuring": { - "version": "7.18.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.18.13.tgz", - "integrity": "sha512-TodpQ29XekIsex2A+YJPj5ax2plkGa8YYY6mFjCohk/IG9IY42Rtuj1FuDeemfg2ipxIFLzPeA83SIBnlhSIow==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.9" - } - }, - "@babel/plugin-transform-dotall-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz", - "integrity": "sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-transform-duplicate-keys": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz", - "integrity": "sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.9" - } - }, - "@babel/plugin-transform-exponentiation-operator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz", - "integrity": "sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw==", - "dev": true, - "requires": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-transform-for-of": { - "version": "7.18.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.8.tgz", - "integrity": "sha512-yEfTRnjuskWYo0k1mHUqrVWaZwrdq8AYbfrpqULOJOaucGSp4mNMVps+YtA8byoevxS/urwU75vyhQIxcCgiBQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-transform-function-name": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz", - "integrity": "sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ==", - "dev": true, - "requires": { - "@babel/helper-compilation-targets": "^7.18.9", - "@babel/helper-function-name": "^7.18.9", - "@babel/helper-plugin-utils": "^7.18.9" - } - }, - "@babel/plugin-transform-literals": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz", - "integrity": "sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.9" - } - }, - "@babel/plugin-transform-member-expression-literals": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz", - "integrity": "sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-transform-modules-amd": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.18.6.tgz", - "integrity": "sha512-Pra5aXsmTsOnjM3IajS8rTaLCy++nGM4v3YR4esk5PCsyg9z8NA5oQLwxzMUtDBd8F+UmVza3VxoAaWCbzH1rg==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "@babel/plugin-transform-modules-commonjs": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.18.6.tgz", - "integrity": "sha512-Qfv2ZOWikpvmedXQJDSbxNqy7Xr/j2Y8/KfijM0iJyKkBTmWuvCA1yeH1yDM7NJhBW/2aXxeucLj6i80/LAJ/Q==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/helper-simple-access": "^7.18.6", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "@babel/plugin-transform-modules-systemjs": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.19.0.tgz", - "integrity": "sha512-x9aiR0WXAWmOWsqcsnrzGR+ieaTMVyGyffPVA7F8cXAGt/UxefYv6uSHZLkAFChN5M5Iy1+wjE+xJuPt22H39A==", - "dev": true, - "requires": { - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-module-transforms": "^7.19.0", - "@babel/helper-plugin-utils": "^7.19.0", - "@babel/helper-validator-identifier": "^7.18.6", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "@babel/plugin-transform-modules-umd": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz", - "integrity": "sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.19.0.tgz", - "integrity": "sha512-HDSuqOQzkU//kfGdiHBt71/hkDTApw4U/cMVgKgX7PqfB3LOaK+2GtCEsBu1dL9CkswDm0Gwehht1dCr421ULQ==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.19.0", - "@babel/helper-plugin-utils": "^7.19.0" - } - }, - "@babel/plugin-transform-new-target": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz", - "integrity": "sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-transform-object-super": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz", - "integrity": "sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/helper-replace-supers": "^7.18.6" - } - }, - "@babel/plugin-transform-parameters": { - "version": "7.18.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.18.8.tgz", - "integrity": "sha512-ivfbE3X2Ss+Fj8nnXvKJS6sjRG4gzwPMsP+taZC+ZzEGjAYlvENixmt1sZ5Ca6tWls+BlKSGKPJ6OOXvXCbkFg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-transform-property-literals": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz", - "integrity": "sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-transform-regenerator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.18.6.tgz", - "integrity": "sha512-poqRI2+qiSdeldcz4wTSTXBRryoq3Gc70ye7m7UD5Ww0nE29IXqMl6r7Nd15WBgRd74vloEMlShtH6CKxVzfmQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6", - "regenerator-transform": "^0.15.0" - } - }, - "@babel/plugin-transform-reserved-words": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz", - "integrity": "sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-transform-runtime": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.18.10.tgz", - "integrity": "sha512-q5mMeYAdfEbpBAgzl7tBre/la3LeCxmDO1+wMXRdPWbcoMjR3GiXlCLk7JBZVVye0bqTGNMbt0yYVXX1B1jEWQ==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.9", - "babel-plugin-polyfill-corejs2": "^0.3.2", - "babel-plugin-polyfill-corejs3": "^0.5.3", - "babel-plugin-polyfill-regenerator": "^0.4.0", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "@babel/plugin-transform-shorthand-properties": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz", - "integrity": "sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-transform-spread": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.19.0.tgz", - "integrity": "sha512-RsuMk7j6n+r752EtzyScnWkQyuJdli6LdO5Klv8Yx0OfPVTcQkIUfS8clx5e9yHXzlnhOZF3CbQ8C2uP5j074w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.19.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.18.9" - } - }, - "@babel/plugin-transform-sticky-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz", - "integrity": "sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-transform-template-literals": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz", - "integrity": "sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.9" - } - }, - "@babel/plugin-transform-typeof-symbol": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz", - "integrity": "sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.9" - } - }, - "@babel/plugin-transform-unicode-escapes": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz", - "integrity": "sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.9" - } - }, - "@babel/plugin-transform-unicode-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz", - "integrity": "sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/preset-env": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.19.0.tgz", - "integrity": "sha512-1YUju1TAFuzjIQqNM9WsF4U6VbD/8t3wEAlw3LFYuuEr+ywqLRcSXxFKz4DCEj+sN94l/XTDiUXYRrsvMpz9WQ==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.19.0", - "@babel/helper-compilation-targets": "^7.19.0", - "@babel/helper-plugin-utils": "^7.19.0", - "@babel/helper-validator-option": "^7.18.6", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.18.6", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.18.9", - "@babel/plugin-proposal-async-generator-functions": "^7.19.0", - "@babel/plugin-proposal-class-properties": "^7.18.6", - "@babel/plugin-proposal-class-static-block": "^7.18.6", - "@babel/plugin-proposal-dynamic-import": "^7.18.6", - "@babel/plugin-proposal-export-namespace-from": "^7.18.9", - "@babel/plugin-proposal-json-strings": "^7.18.6", - "@babel/plugin-proposal-logical-assignment-operators": "^7.18.9", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", - "@babel/plugin-proposal-numeric-separator": "^7.18.6", - "@babel/plugin-proposal-object-rest-spread": "^7.18.9", - "@babel/plugin-proposal-optional-catch-binding": "^7.18.6", - "@babel/plugin-proposal-optional-chaining": "^7.18.9", - "@babel/plugin-proposal-private-methods": "^7.18.6", - "@babel/plugin-proposal-private-property-in-object": "^7.18.6", - "@babel/plugin-proposal-unicode-property-regex": "^7.18.6", - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-class-properties": "^7.12.13", - "@babel/plugin-syntax-class-static-block": "^7.14.5", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-import-assertions": "^7.18.6", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5", - "@babel/plugin-syntax-top-level-await": "^7.14.5", - "@babel/plugin-transform-arrow-functions": "^7.18.6", - "@babel/plugin-transform-async-to-generator": "^7.18.6", - "@babel/plugin-transform-block-scoped-functions": "^7.18.6", - "@babel/plugin-transform-block-scoping": "^7.18.9", - "@babel/plugin-transform-classes": "^7.19.0", - "@babel/plugin-transform-computed-properties": "^7.18.9", - "@babel/plugin-transform-destructuring": "^7.18.13", - "@babel/plugin-transform-dotall-regex": "^7.18.6", - "@babel/plugin-transform-duplicate-keys": "^7.18.9", - "@babel/plugin-transform-exponentiation-operator": "^7.18.6", - "@babel/plugin-transform-for-of": "^7.18.8", - "@babel/plugin-transform-function-name": "^7.18.9", - "@babel/plugin-transform-literals": "^7.18.9", - "@babel/plugin-transform-member-expression-literals": "^7.18.6", - "@babel/plugin-transform-modules-amd": "^7.18.6", - "@babel/plugin-transform-modules-commonjs": "^7.18.6", - "@babel/plugin-transform-modules-systemjs": "^7.19.0", - "@babel/plugin-transform-modules-umd": "^7.18.6", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.19.0", - "@babel/plugin-transform-new-target": "^7.18.6", - "@babel/plugin-transform-object-super": "^7.18.6", - "@babel/plugin-transform-parameters": "^7.18.8", - "@babel/plugin-transform-property-literals": "^7.18.6", - "@babel/plugin-transform-regenerator": "^7.18.6", - "@babel/plugin-transform-reserved-words": "^7.18.6", - "@babel/plugin-transform-shorthand-properties": "^7.18.6", - "@babel/plugin-transform-spread": "^7.19.0", - "@babel/plugin-transform-sticky-regex": "^7.18.6", - "@babel/plugin-transform-template-literals": "^7.18.9", - "@babel/plugin-transform-typeof-symbol": "^7.18.9", - "@babel/plugin-transform-unicode-escapes": "^7.18.10", - "@babel/plugin-transform-unicode-regex": "^7.18.6", - "@babel/preset-modules": "^0.1.5", - "@babel/types": "^7.19.0", - "babel-plugin-polyfill-corejs2": "^0.3.2", - "babel-plugin-polyfill-corejs3": "^0.5.3", - "babel-plugin-polyfill-regenerator": "^0.4.0", - "core-js-compat": "^3.22.1", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "@babel/preset-modules": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", - "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", - "@babel/plugin-transform-dotall-regex": "^7.4.4", - "@babel/types": "^7.4.4", - "esutils": "^2.0.2" - } - }, - "@babel/runtime": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.19.0.tgz", - "integrity": "sha512-eR8Lo9hnDS7tqkO7NsV+mKvCmv5boaXFSZ70DnfhcgiEne8hv9oCEd36Klw74EtizEqLsy4YnW8UWwpBVolHZA==", - "dev": true, - "requires": { - "regenerator-runtime": "^0.13.4" - } - }, - "@babel/template": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", - "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.25.9", - "@babel/parser": "^7.25.9", - "@babel/types": "^7.25.9" - } - }, - "@babel/traverse": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", - "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.25.9", - "@babel/generator": "^7.25.9", - "@babel/parser": "^7.25.9", - "@babel/template": "^7.25.9", - "@babel/types": "^7.25.9", - "debug": "^4.3.1", - "globals": "^11.1.0" - } - }, - "@babel/types": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", - "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", - "dev": true, - "requires": { - "@babel/helper-string-parser": "^7.25.9", - "@babel/helper-validator-identifier": "^7.25.9" - } - }, - "@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", - "dev": true, - "optional": true - }, - "@discoveryjs/json-ext": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", - "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", - "dev": true - }, - "@fancyapps/fancybox": { - "version": "3.5.7", - "resolved": "https://registry.npmjs.org/@fancyapps/fancybox/-/fancybox-3.5.7.tgz", - "integrity": "sha512-rcEtu8t+WnmqIDV/Wfm1yvy/nDdwc7YV25j9HLxGC2/WOsUhk9rcWg2nB8g1BrjRt9zaoADdjHTU6ILYTJzBBg==", - "dev": true - }, - "@fortawesome/fontawesome-free": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.2.0.tgz", - "integrity": "sha512-CNR7qRIfCwWHNN7FnKUniva94edPdyQzil/zCwk3v6k4R6rR2Fr8i4s3PM7n/lyfPA6Zfko9z5WDzFxG9SW1uQ==", - "dev": true - }, - "@jridgewell/gen-mapping": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", - "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", - "dev": true, - "requires": { - "@jridgewell/set-array": "^1.0.0", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, - "@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", - "dev": true - }, - "@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "dev": true - }, - "@jridgewell/source-map": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", - "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", - "dev": true, - "requires": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25" - }, - "dependencies": { - "@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", - "dev": true, - "requires": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" - } - } - } - }, - "@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, - "@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", - "dev": true, - "requires": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "@juggle/resize-observer": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@juggle/resize-observer/-/resize-observer-3.4.0.tgz", - "integrity": "sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==", - "dev": true - }, - "@ldc-web/cookie-notice": { - "version": "6.1.0", - "resolved": "https://lab.s-web.fr/api/v4/projects/50/packages/npm/@ldc-web/cookie-notice/-/@ldc-web/cookie-notice-6.1.0.tgz", - "integrity": "sha1-bzewvM6mGuWr3Ju8/HWkxXm60+A=", - "dev": true - }, - "@leichtgewicht/ip-codec": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", - "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==", - "dev": true - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "@popperjs/core": { - "version": "2.11.6", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz", - "integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==", - "dev": true - }, - "@trysound/sax": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", - "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==", - "dev": true - }, - "@types/babel__core": { - "version": "7.1.19", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.19.tgz", - "integrity": "sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw==", - "dev": true, - "requires": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } - }, - "@types/babel__generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", - "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0" - } - }, - "@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", - "dev": true, - "requires": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "@types/babel__traverse": { - "version": "7.18.1", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.1.tgz", - "integrity": "sha512-FSdLaZh2UxaMuLp9lixWaHq/golWTRWOnRsAXzDTDSDOQLuZb1nsdCt6pJSPWSEQt2eFZ2YVk3oYhn+1kLMeMA==", - "dev": true, - "requires": { - "@babel/types": "^7.3.0" - } - }, - "@types/body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", - "dev": true, - "requires": { - "@types/connect": "*", - "@types/node": "*" - } - }, - "@types/bonjour": { - "version": "3.5.10", - "resolved": "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.10.tgz", - "integrity": "sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/bootstrap": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/@types/bootstrap/-/bootstrap-5.2.4.tgz", - "integrity": "sha512-jGNB81zuDHu1DPvBV7Ox3Z3eyzdWPNguYwrt0j7X90VExA8H7c6qxJh0cz5j3xp0XvSy1TYaP2pkyXCHeo8CaA==", - "dev": true, - "requires": { - "@popperjs/core": "^2.9.2" - } - }, - "@types/clean-css": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@types/clean-css/-/clean-css-4.2.5.tgz", - "integrity": "sha512-NEzjkGGpbs9S9fgC4abuBvTpVwE3i+Acu9BBod3PUyjDVZcNsGx61b8r2PphR61QGPnn0JHVs5ey6/I4eTrkxw==", - "dev": true, - "requires": { - "@types/node": "*", - "source-map": "^0.6.0" - } - }, - "@types/connect": { - "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/connect-history-api-fallback": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.3.5.tgz", - "integrity": "sha512-h8QJa8xSb1WD4fpKBDcATDNGXghFj6/3GRWG6dhmRcu0RX1Ubasur2Uvx5aeEwlf0MwblEC2bMzzMQntxnw/Cw==", - "dev": true, - "requires": { - "@types/express-serve-static-core": "*", - "@types/node": "*" - } - }, - "@types/eslint": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", - "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", - "dev": true, - "requires": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "@types/eslint-scope": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", - "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", - "dev": true, - "requires": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, - "@types/estree": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true - }, - "@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", - "dev": true, - "requires": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", - "@types/qs": "*", - "@types/serve-static": "*" - } - }, - "@types/express-serve-static-core": { - "version": "4.17.30", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.30.tgz", - "integrity": "sha512-gstzbTWro2/nFed1WXtf+TtrpwxH7Ggs4RLYTLbeVgIkUQOI3WG/JKjgeOU1zXDvezllupjrf8OPIdvTbIaVOQ==", - "dev": true, - "requires": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*" - } - }, - "@types/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", - "dev": true, - "requires": { - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "@types/http-proxy": { - "version": "1.17.9", - "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.9.tgz", - "integrity": "sha512-QsbSjA/fSk7xB+UXlCT3wHBy5ai9wOcNDWwZAtud+jXhwOM3l+EYZh8Lng4+/6n8uar0J7xILzqftJdJ/Wdfkw==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/imagemin": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@types/imagemin/-/imagemin-8.0.0.tgz", - "integrity": "sha512-B9X2CUeDv/uUeY9CqkzSTfmsLkeJP6PkmXlh4lODBbf9SwpmNuLS30WzUOi863dgsjY3zt3gY5q2F+UdifRi1A==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/imagemin-gifsicle": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@types/imagemin-gifsicle/-/imagemin-gifsicle-7.0.1.tgz", - "integrity": "sha512-kUz6sUh0P95JOS0RGEaaemWUrASuw+dLsWIveK2UZJx74id/B9epgblMkCk/r5MjUWbZ83wFvacG5Rb/f97gyA==", - "dev": true, - "requires": { - "@types/imagemin": "*" - } - }, - "@types/imagemin-mozjpeg": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@types/imagemin-mozjpeg/-/imagemin-mozjpeg-8.0.1.tgz", - "integrity": "sha512-kMQWEoKxxhlnH4POI3qfW9DjXlQfi80ux3l2b3j5R3eudSCoUIzKQLkfMjNJ6eMYnMWBcB+rfQOWqIzdIwFGKw==", - "dev": true, - "requires": { - "@types/imagemin": "*" - } - }, - "@types/imagemin-optipng": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@types/imagemin-optipng/-/imagemin-optipng-5.2.1.tgz", - "integrity": "sha512-XCM/3q+HUL7v4zOqMI+dJ5dTxT+MUukY9KU49DSnYb/4yWtSMHJyADP+WHSMVzTR63J2ZvfUOzSilzBNEQW78g==", - "dev": true, - "requires": { - "@types/imagemin": "*" - } - }, - "@types/imagemin-svgo": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@types/imagemin-svgo/-/imagemin-svgo-8.0.1.tgz", - "integrity": "sha512-YafkdrVAcr38U0Ln1C+L1n4SIZqC47VBHTyxCq7gTUSd1R9MdIvMcrljWlgU1M9O68WZDeQWUrKipKYfEOCOvQ==", - "dev": true, - "requires": { - "@types/imagemin": "*", - "@types/svgo": "^1" - } - }, - "@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true - }, - "@types/mime": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", - "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==", - "dev": true - }, - "@types/minimatch": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", - "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", - "dev": true - }, - "@types/node": { - "version": "18.7.16", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.16.tgz", - "integrity": "sha512-EQHhixfu+mkqHMZl1R2Ovuvn47PUw18azMJOTwSZr9/fhzHNGXAJ0ma0dayRVchprpCj0Kc1K1xKoWaATWF1qg==", - "dev": true - }, - "@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true - }, - "@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", - "dev": true - }, - "@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", - "dev": true - }, - "@types/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==", - "dev": true - }, - "@types/serve-index": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz", - "integrity": "sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg==", - "dev": true, - "requires": { - "@types/express": "*" - } - }, - "@types/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==", - "dev": true, - "requires": { - "@types/mime": "*", - "@types/node": "*" - } - }, - "@types/sockjs": { - "version": "0.3.33", - "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.33.tgz", - "integrity": "sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/svgo": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/@types/svgo/-/svgo-1.3.6.tgz", - "integrity": "sha512-AZU7vQcy/4WFEuwnwsNsJnFwupIpbllH1++LXScN6uxT1Z4zPzdrWG97w4/I7eFKFTvfy/bHFStWjdBAg2Vjug==", - "dev": true - }, - "@types/ws": { - "version": "8.5.3", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", - "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@voerro/vue-tagsinput": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/@voerro/vue-tagsinput/-/vue-tagsinput-2.7.1.tgz", - "integrity": "sha512-G7ClILHgtc/D1vEw9qp6dlsAstlhwLDkPvEp6w1iY/dmSzu4hhxaMk8jyahjxQRDgiLlrAikESOsfkVhy18YwQ==", - "dev": true - }, - "@vue/compiler-sfc": { - "version": "2.7.16", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-2.7.16.tgz", - "integrity": "sha512-KWhJ9k5nXuNtygPU7+t1rX6baZeqOYLEforUPjgNDBnLicfHCoi48H87Q8XyLZOrNNsmhuwKqtpDQWjEFe6Ekg==", - "dev": true, - "requires": { - "@babel/parser": "^7.23.5", - "postcss": "^8.4.14", - "prettier": "^1.18.2 || ^2.0.0", - "source-map": "^0.6.1" - } - }, - "@vue/component-compiler-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@vue/component-compiler-utils/-/component-compiler-utils-3.3.0.tgz", - "integrity": "sha512-97sfH2mYNU+2PzGrmK2haqffDpVASuib9/w2/noxiFi31Z54hW+q3izKQXXQZSNhtiUpAI36uSuYepeBe4wpHQ==", - "dev": true, - "requires": { - "consolidate": "^0.15.1", - "hash-sum": "^1.0.2", - "lru-cache": "^4.1.2", - "merge-source-map": "^1.1.0", - "postcss": "^7.0.36", - "postcss-selector-parser": "^6.0.2", - "prettier": "^1.18.2 || ^2.0.0", - "source-map": "~0.6.1", - "vue-template-es2015-compiler": "^1.9.0" - }, - "dependencies": { - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "picocolors": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", - "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", - "dev": true - }, - "postcss": { - "version": "7.0.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", - "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", - "dev": true, - "requires": { - "picocolors": "^0.2.1", - "source-map": "^0.6.1" - } - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", - "dev": true - } - } - }, - "@webassemblyjs/ast": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", - "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", - "dev": true, - "requires": { - "@webassemblyjs/helper-numbers": "1.13.2", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2" - } - }, - "@webassemblyjs/floating-point-hex-parser": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", - "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", - "dev": true - }, - "@webassemblyjs/helper-api-error": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", - "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", - "dev": true - }, - "@webassemblyjs/helper-buffer": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", - "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", - "dev": true - }, - "@webassemblyjs/helper-numbers": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", - "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", - "dev": true, - "requires": { - "@webassemblyjs/floating-point-hex-parser": "1.13.2", - "@webassemblyjs/helper-api-error": "1.13.2", - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", - "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", - "dev": true - }, - "@webassemblyjs/helper-wasm-section": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", - "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-buffer": "1.14.1", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2", - "@webassemblyjs/wasm-gen": "1.14.1" - } - }, - "@webassemblyjs/ieee754": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", - "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", - "dev": true, - "requires": { - "@xtuc/ieee754": "^1.2.0" - } - }, - "@webassemblyjs/leb128": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", - "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", - "dev": true, - "requires": { - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/utf8": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", - "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", - "dev": true - }, - "@webassemblyjs/wasm-edit": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", - "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-buffer": "1.14.1", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2", - "@webassemblyjs/helper-wasm-section": "1.14.1", - "@webassemblyjs/wasm-gen": "1.14.1", - "@webassemblyjs/wasm-opt": "1.14.1", - "@webassemblyjs/wasm-parser": "1.14.1", - "@webassemblyjs/wast-printer": "1.14.1" - } - }, - "@webassemblyjs/wasm-gen": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", - "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2", - "@webassemblyjs/ieee754": "1.13.2", - "@webassemblyjs/leb128": "1.13.2", - "@webassemblyjs/utf8": "1.13.2" - } - }, - "@webassemblyjs/wasm-opt": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", - "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-buffer": "1.14.1", - "@webassemblyjs/wasm-gen": "1.14.1", - "@webassemblyjs/wasm-parser": "1.14.1" - } - }, - "@webassemblyjs/wasm-parser": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", - "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-api-error": "1.13.2", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2", - "@webassemblyjs/ieee754": "1.13.2", - "@webassemblyjs/leb128": "1.13.2", - "@webassemblyjs/utf8": "1.13.2" - } - }, - "@webassemblyjs/wast-printer": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", - "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.14.1", - "@xtuc/long": "4.2.2" - } - }, - "@webpack-cli/configtest": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz", - "integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==", - "dev": true, - "requires": {} - }, - "@webpack-cli/info": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz", - "integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==", - "dev": true, - "requires": { - "envinfo": "^7.7.3" - } - }, - "@webpack-cli/serve": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz", - "integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==", - "dev": true, - "requires": {} - }, - "@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true - }, - "accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "dev": true, - "requires": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - } - }, - "acorn": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", - "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", - "dev": true - }, - "adjust-sourcemap-loader": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/adjust-sourcemap-loader/-/adjust-sourcemap-loader-3.0.0.tgz", - "integrity": "sha512-YBrGyT2/uVQ/c6Rr+t6ZJXniY03YtHGMJQYal368burRGYKqhx9qGTWqcBU5s1CwYY9E/ri63RYyG1IacMZtqw==", - "dev": true, - "requires": { - "loader-utils": "^2.0.0", - "regex-parser": "^2.2.11" - }, - "dependencies": { - "loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - } - } - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ajv-formats": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", - "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", - "dev": true, - "requires": { - "ajv": "^8.0.0" - }, - "dependencies": { - "ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - } - } - }, - "ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true - }, - "ansi-html-community": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz", - "integrity": "sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==", - "dev": true - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "arity-n": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/arity-n/-/arity-n-1.0.4.tgz", - "integrity": "sha1-2edrEXM+CFacCEeuezmyhgswt0U=", - "dev": true - }, - "array-flatten": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", - "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==", - "dev": true - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", - "dev": true - } - } - }, - "assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", - "dev": true, - "requires": { - "object-assign": "^4.1.1", - "util": "0.10.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==", - "dev": true - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha512-5KiHfsmkqacuKjkRkdV7SsfDJ2EGiPsK92s2MhNSY0craxjTdKTtqKsJaCWp4LW33ZZ0OPUv1WO/TFvNQRiQxQ==", - "dev": true, - "requires": { - "inherits": "2.0.1" - } - } - } - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "autoprefixer": { - "version": "10.4.8", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.8.tgz", - "integrity": "sha512-75Jr6Q/XpTqEf6D2ltS5uMewJIx5irCU1oBYJrWjFenq/m12WRRrz6g15L1EIoYvPLXTbEry7rDOwrcYNj77xw==", - "dev": true, - "requires": { - "browserslist": "^4.21.3", - "caniuse-lite": "^1.0.30001373", - "fraction.js": "^4.2.0", - "normalize-range": "^0.1.2", - "picocolors": "^1.0.0", - "postcss-value-parser": "^4.2.0" - } - }, - "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dev": true, - "requires": { - "follow-redirects": "^1.14.0" - } - }, - "babel-loader": { - "version": "8.2.5", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.5.tgz", - "integrity": "sha512-OSiFfH89LrEMiWd4pLNqGz4CwJDtbs2ZVc+iGu2HrkRfPxId9F2anQj38IxWpmRfsUY0aBZYi1EFcd3mhtRMLQ==", - "dev": true, - "requires": { - "find-cache-dir": "^3.3.1", - "loader-utils": "^2.0.0", - "make-dir": "^3.1.0", - "schema-utils": "^2.6.5" - }, - "dependencies": { - "loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - } - } - }, - "babel-plugin-dynamic-import-node": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", - "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", - "dev": true, - "requires": { - "object.assign": "^4.1.0" - } - }, - "babel-plugin-polyfill-corejs2": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.2.tgz", - "integrity": "sha512-LPnodUl3lS0/4wN3Rb+m+UK8s7lj2jcLRrjho4gLw+OJs+I4bvGXshINesY5xx/apM+biTnQ9reDI8yj+0M5+Q==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.17.7", - "@babel/helper-define-polyfill-provider": "^0.3.2", - "semver": "^6.1.1" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "babel-plugin-polyfill-corejs3": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.3.tgz", - "integrity": "sha512-zKsXDh0XjnrUEW0mxIHLfjBfnXSMr5Q/goMe/fxpQnLm07mcOZiIZHBNWCMx60HmdvjxfXcalac0tfFg0wqxyw==", - "dev": true, - "requires": { - "@babel/helper-define-polyfill-provider": "^0.3.2", - "core-js-compat": "^3.21.0" - } - }, - "babel-plugin-polyfill-regenerator": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.0.tgz", - "integrity": "sha512-RW1cnryiADFeHmfLS+WW/G431p1PsW5qdRdz0SDRi7TKcUgc7Oh/uXkT7MZ/+tGsT1BkczEAmD5XjUyJ5SWDTw==", - "dev": true, - "requires": { - "@babel/helper-define-polyfill-provider": "^0.3.2" - } - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true - }, - "batch": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", - "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", - "dev": true - }, - "big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true - }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true - }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", - "dev": true - }, - "body-parser": { - "version": "1.20.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", - "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", - "dev": true, - "requires": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.13.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "dependencies": { - "bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - } - } - }, - "bonjour-service": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.0.14.tgz", - "integrity": "sha512-HIMbgLnk1Vqvs6B4Wq5ep7mxvj9sGz5d1JJyDNSGNIdA/w2MCz6GTjWTdjqOJV1bEPj+6IkxDvWNFKEBxNt4kQ==", - "dev": true, - "requires": { - "array-flatten": "^2.1.2", - "dns-equal": "^1.0.0", - "fast-deep-equal": "^3.1.3", - "multicast-dns": "^7.2.5" - } - }, - "boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", - "dev": true - }, - "bootstrap": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.1.tgz", - "integrity": "sha512-UQi3v2NpVPEi1n35dmRRzBJFlgvWHYwyem6yHhuT6afYF+sziEt46McRbT//kVXZ7b1YUYEVGdXEH74Nx3xzGA==", - "dev": true, - "requires": {} - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "requires": { - "fill-range": "^7.1.1" - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", - "dev": true - }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "browserify-rsa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", - "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", - "dev": true, - "requires": { - "bn.js": "^5.0.0", - "randombytes": "^2.0.1" - } - }, - "browserify-sign": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz", - "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", - "dev": true, - "requires": { - "bn.js": "^5.2.1", - "browserify-rsa": "^4.1.0", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.5", - "hash-base": "~3.0", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.7", - "readable-stream": "^2.3.8", - "safe-buffer": "^5.2.1" - }, - "dependencies": { - "hash-base": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.5.tgz", - "integrity": "sha512-vXm0l45VbcHEVlTCzs8M+s0VeYsB2lnlAaThoLKGXr3bE/VWDOelNUnycUPEhKEaXARL2TEFjBOyUiM6+55KBg==", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "safe-buffer": "^5.2.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "requires": { - "pako": "~1.0.5" - } - }, - "browserslist": { - "version": "4.24.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", - "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30001669", - "electron-to-chromium": "^1.5.41", - "node-releases": "^2.0.18", - "update-browserslist-db": "^1.1.1" - } - }, - "buffer": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", - "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", - "dev": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, - "buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", - "dev": true - }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", - "dev": true - }, - "bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", - "dev": true - }, - "call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "dev": true, - "requires": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, - "camel-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", - "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", - "dev": true, - "requires": { - "pascal-case": "^3.1.2", - "tslib": "^2.0.3" - } - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "can-use-dom": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/can-use-dom/-/can-use-dom-0.1.0.tgz", - "integrity": "sha512-ceOhN1DL7Y4O6M0j9ICgmTYziV89WMd96SvSl0REd8PMgrY0B/WBOPoed5S1KUmJqXgUXh8gzSe6E3ae27upsQ==", - "dev": true - }, - "caniuse-api": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", - "integrity": "sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==", - "dev": true, - "requires": { - "browserslist": "^4.0.0", - "caniuse-lite": "^1.0.0", - "lodash.memoize": "^4.1.2", - "lodash.uniq": "^4.5.0" - } - }, - "caniuse-lite": { - "version": "1.0.30001767", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001767.tgz", - "integrity": "sha512-34+zUAMhSH+r+9eKmYG+k2Rpt8XttfE4yXAjoZvkAPs15xcYQhyBYdalJ65BzivAvGRMViEjy6oKr/S91loekQ==", - "dev": true - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "charenc": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", - "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", - "dev": true - }, - "chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - } - }, - "chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", - "dev": true - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "clean-css": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.1.tgz", - "integrity": "sha512-lCr8OHhiWCTw4v8POJovCoh4T7I9U11yVsPjMWWnnMmp9ZowCxyad1Pathle/9HjaDp+fdQKjO9fQydE6RHTZg==", - "dev": true, - "requires": { - "source-map": "~0.6.0" - } - }, - "cli-table3": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.2.tgz", - "integrity": "sha512-QyavHCaIC80cMivimWu4aWHilIpiDpfm3hGmqAmXVL1UsnbLuBSMd21hTX6VY4ZSDSM73ESLeF8TOYId3rBTbw==", - "dev": true, - "requires": { - "@colors/colors": "1.5.0", - "string-width": "^4.2.0" - } - }, - "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "clone-deep": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.2", - "shallow-clone": "^3.0.0" - } - }, - "collect.js": { - "version": "4.28.6", - "resolved": "https://registry.npmjs.org/collect.js/-/collect.js-4.28.6.tgz", - "integrity": "sha512-NAyuk1DnCotRaDZIS5kJ4sptgkwOeYqElird10yziN5JBuwYOGkOTguhNcPn5g344IfylZecxNYZAVXgv19p5Q==", - "dev": true - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "colord": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", - "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==", - "dev": true - }, - "colorette": { - "version": "2.0.19", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", - "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==", - "dev": true - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "dev": true - }, - "compose-function": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/compose-function/-/compose-function-3.0.3.tgz", - "integrity": "sha1-ntZ18TzFRQHTCVCkhv9qe6OrGF8=", - "dev": true, - "requires": { - "arity-n": "^1.0.4" - } - }, - "compressible": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", - "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", - "dev": true, - "requires": { - "mime-db": ">= 1.43.0 < 2" - } - }, - "compression": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", - "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", - "dev": true, - "requires": { - "accepts": "~1.3.5", - "bytes": "3.0.0", - "compressible": "~2.0.16", - "debug": "2.6.9", - "on-headers": "~1.0.2", - "safe-buffer": "5.1.2", - "vary": "~1.1.2" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - } - } - }, - "concat": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/concat/-/concat-1.0.3.tgz", - "integrity": "sha1-QPM1MInWVGdpXLGIa0Xt1jfYzKg=", - "dev": true, - "requires": { - "commander": "^2.9.0" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "connect-history-api-fallback": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz", - "integrity": "sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==", - "dev": true - }, - "consola": { - "version": "2.15.3", - "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", - "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==", - "dev": true - }, - "console-browserify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", - "dev": true - }, - "consolidate": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/consolidate/-/consolidate-0.15.1.tgz", - "integrity": "sha512-DW46nrsMJgy9kqAbPt5rKaCr7uFtpo4mSUvLHIUbJEjm0vo+aY5QLwBUq3FK4tRnJr/X0Psc0C4jf/h+HtXSMw==", - "dev": true, - "requires": { - "bluebird": "^3.1.1" - } - }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==", - "dev": true - }, - "content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dev": true, - "requires": { - "safe-buffer": "5.2.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "dev": true - }, - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "cookie": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", - "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", - "dev": true - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", - "dev": true - }, - "core-js": { - "version": "3.25.3", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.25.3.tgz", - "integrity": "sha512-y1hvKXmPHvm5B7w4ln1S4uc9eV/O5+iFExSRUimnvIph11uaizFR8LFMdONN8hG3P2pipUfX4Y/fR8rAEtcHcQ==", - "dev": true - }, - "core-js-compat": { - "version": "3.25.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.25.1.tgz", - "integrity": "sha512-pOHS7O0i8Qt4zlPW/eIFjwp+NrTPx+wTL0ctgI2fHn31sZOq89rDsmtc/A2vAX7r6shl+bmVI+678He46jgBlw==", - "dev": true, - "requires": { - "browserslist": "^4.21.3" - } - }, - "core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true - }, - "cosmiconfig": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", - "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", - "dev": true, - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" - } - }, - "create-ecdh": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", - "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "cross-env": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", - "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.1" - } - }, - "cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "crypt": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", - "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", - "dev": true - }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, - "css": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz", - "integrity": "sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "source-map": "^0.6.1", - "source-map-resolve": "^0.5.2", - "urix": "^0.1.0" - } - }, - "css-declaration-sorter": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.3.1.tgz", - "integrity": "sha512-fBffmak0bPAnyqc/HO8C3n2sHrp9wcqQz6ES9koRF2/mLOVAx9zIQ3Y7R29sYCteTPqMCwns4WYQoCX91Xl3+w==", - "dev": true, - "requires": {} - }, - "css-loader": { - "version": "5.2.7", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-5.2.7.tgz", - "integrity": "sha512-Q7mOvpBNBG7YrVGMxRxcBJZFL75o+cH2abNASdibkj/fffYD8qWbInZrD0S9ccI6vZclF3DsHE7njGlLtaHbhg==", - "dev": true, - "requires": { - "icss-utils": "^5.1.0", - "loader-utils": "^2.0.0", - "postcss": "^8.2.15", - "postcss-modules-extract-imports": "^3.0.0", - "postcss-modules-local-by-default": "^4.0.0", - "postcss-modules-scope": "^3.0.0", - "postcss-modules-values": "^4.0.0", - "postcss-value-parser": "^4.1.0", - "schema-utils": "^3.0.0", - "semver": "^7.3.5" - }, - "dependencies": { - "loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - }, - "schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - } - } - } - }, - "css-select": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", - "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", - "dev": true, - "requires": { - "boolbase": "^1.0.0", - "css-what": "^6.0.1", - "domhandler": "^4.3.1", - "domutils": "^2.8.0", - "nth-check": "^2.0.1" - }, - "dependencies": { - "domhandler": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", - "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", - "dev": true, - "requires": { - "domelementtype": "^2.2.0" - } - } - } - }, - "css-tree": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", - "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", - "dev": true, - "requires": { - "mdn-data": "2.0.14", - "source-map": "^0.6.1" - } - }, - "css-what": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", - "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", - "dev": true - }, - "cssesc": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", - "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", - "dev": true - }, - "cssnano": { - "version": "5.1.13", - "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-5.1.13.tgz", - "integrity": "sha512-S2SL2ekdEz6w6a2epXn4CmMKU4K3KpcyXLKfAYc9UQQqJRkD/2eLUG0vJ3Db/9OvO5GuAdgXw3pFbR6abqghDQ==", - "dev": true, - "requires": { - "cssnano-preset-default": "^5.2.12", - "lilconfig": "^2.0.3", - "yaml": "^1.10.2" - } - }, - "cssnano-preset-default": { - "version": "5.2.12", - "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-5.2.12.tgz", - "integrity": "sha512-OyCBTZi+PXgylz9HAA5kHyoYhfGcYdwFmyaJzWnzxuGRtnMw/kR6ilW9XzlzlRAtB6PLT/r+prYgkef7hngFew==", - "dev": true, - "requires": { - "css-declaration-sorter": "^6.3.0", - "cssnano-utils": "^3.1.0", - "postcss-calc": "^8.2.3", - "postcss-colormin": "^5.3.0", - "postcss-convert-values": "^5.1.2", - "postcss-discard-comments": "^5.1.2", - "postcss-discard-duplicates": "^5.1.0", - "postcss-discard-empty": "^5.1.1", - "postcss-discard-overridden": "^5.1.0", - "postcss-merge-longhand": "^5.1.6", - "postcss-merge-rules": "^5.1.2", - "postcss-minify-font-values": "^5.1.0", - "postcss-minify-gradients": "^5.1.1", - "postcss-minify-params": "^5.1.3", - "postcss-minify-selectors": "^5.2.1", - "postcss-normalize-charset": "^5.1.0", - "postcss-normalize-display-values": "^5.1.0", - "postcss-normalize-positions": "^5.1.1", - "postcss-normalize-repeat-style": "^5.1.1", - "postcss-normalize-string": "^5.1.0", - "postcss-normalize-timing-functions": "^5.1.0", - "postcss-normalize-unicode": "^5.1.0", - "postcss-normalize-url": "^5.1.0", - "postcss-normalize-whitespace": "^5.1.1", - "postcss-ordered-values": "^5.1.3", - "postcss-reduce-initial": "^5.1.0", - "postcss-reduce-transforms": "^5.1.0", - "postcss-svgo": "^5.1.0", - "postcss-unique-selectors": "^5.1.1" - } - }, - "cssnano-utils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-3.1.0.tgz", - "integrity": "sha512-JQNR19/YZhz4psLX/rQ9M83e3z2Wf/HdJbryzte4a3NSuafyp9w/I4U+hx5C2S9g41qlstH7DEWnZaaj83OuEA==", - "dev": true, - "requires": {} - }, - "csso": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", - "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", - "dev": true, - "requires": { - "css-tree": "^1.1.2" - } - }, - "csstype": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.0.tgz", - "integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==", - "dev": true - }, - "d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "dev": true, - "requires": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "de-indent": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", - "integrity": "sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0=", - "dev": true - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "decode-uri-component": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", - "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", - "dev": true - }, - "default-gateway": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz", - "integrity": "sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==", - "dev": true, - "requires": { - "execa": "^5.0.0" - } - }, - "define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "requires": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - } - }, - "define-lazy-prop": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", - "dev": true - }, - "define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", - "dev": true, - "requires": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - } - }, - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true - }, - "des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "dev": true - }, - "detect-node": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", - "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", - "dev": true - }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "dns-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", - "integrity": "sha512-z+paD6YUQsk+AbGCEM4PrOXSss5gd66QfcVBFTKR/HpFL9jCqikS94HYwKww6fQyO7IxrIIyUu+g0Ka9tUS2Cg==", - "dev": true - }, - "dns-packet": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.4.0.tgz", - "integrity": "sha512-EgqGeaBB8hLiHLZtp/IbaDQTL8pZ0+IvwzSHA6d7VyMDM+B9hgddEMa9xjK5oYnw0ci0JQ6g2XCD7/f6cafU6g==", - "dev": true, - "requires": { - "@leichtgewicht/ip-codec": "^2.0.1" - } - }, - "dom-serializer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", - "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", - "dev": true, - "requires": { - "domelementtype": "^2.0.1", - "domhandler": "^4.2.0", - "entities": "^2.0.0" - }, - "dependencies": { - "domhandler": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", - "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", - "dev": true, - "requires": { - "domelementtype": "^2.2.0" - } - } - } - }, - "dom7": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/dom7/-/dom7-3.0.0.tgz", - "integrity": "sha512-oNlcUdHsC4zb7Msx7JN3K0Nro1dzJ48knvBOnDPKJ2GV9wl1i5vydJZUSyOfrkKFDZEud/jBsTk92S/VGSAe/g==", - "dev": true, - "requires": { - "ssr-window": "^3.0.0-alpha.1" - } - }, - "domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true - }, - "domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "dev": true - }, - "domhandler": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-3.3.0.tgz", - "integrity": "sha512-J1C5rIANUbuYK+FuFL98650rihynUOEzRLxW+90bKZRWB6A1X1Tf82GxR1qAWLyfNPRvjqfip3Q5tdYlmAa9lA==", - "dev": true, - "requires": { - "domelementtype": "^2.0.1" - } - }, - "domutils": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", - "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", - "dev": true, - "requires": { - "dom-serializer": "^1.0.1", - "domelementtype": "^2.2.0", - "domhandler": "^4.2.0" - }, - "dependencies": { - "domhandler": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", - "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", - "dev": true, - "requires": { - "domelementtype": "^2.2.0" - } - } - } - }, - "dot-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", - "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", - "dev": true, - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "dotenv": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", - "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", - "dev": true - }, - "dotenv-expand": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz", - "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==", - "dev": true - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "dev": true - }, - "electron-to-chromium": { - "version": "1.5.66", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.66.tgz", - "integrity": "sha512-pI2QF6+i+zjPbqRzJwkMvtvkdI7MjVbSh2g8dlMguDJIXEPw+kwasS1Jl+YGPEBfGVxsVgGUratAKymPdPo2vQ==", - "dev": true - }, - "elliptic": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", - "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", - "dev": true, - "requires": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true - }, - "encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "dev": true - }, - "enhanced-resolve": { - "version": "5.17.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", - "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - } - }, - "entities": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", - "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", - "dev": true - }, - "envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", - "dev": true - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dev": true, - "requires": { - "get-intrinsic": "^1.2.4" - } - }, - "es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true - }, - "es-module-lexer": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", - "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", - "dev": true - }, - "es5-ext": { - "version": "0.10.64", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", - "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", - "dev": true, - "requires": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "esniff": "^2.0.1", - "next-tick": "^1.1.0" - } - }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "dev": true, - "requires": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, - "escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "dev": true - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "esniff": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", - "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", - "dev": true, - "requires": { - "d": "^1.0.1", - "es5-ext": "^0.10.62", - "event-emitter": "^0.3.5", - "type": "^2.7.2" - }, - "dependencies": { - "type": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", - "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==", - "dev": true - } - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "dev": true - }, - "event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "dev": true - }, - "events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - } - }, - "express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", - "dev": true, - "requires": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.3", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.7.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.3.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.3", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", - "proxy-addr": "~2.0.7", - "qs": "6.13.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.19.0", - "serve-static": "1.16.2", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "dependencies": { - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", - "dev": true - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "ext": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", - "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", - "dev": true, - "requires": { - "type": "^2.0.0" - }, - "dependencies": { - "type": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.3.0.tgz", - "integrity": "sha512-rgPIqOdfK/4J9FhiVrZ3cveAjRRo5rsQBAIhnylX874y1DX/kEKSVdLsnuHB6l1KTjHyU01VjiMBHgU2adejyg==", - "dev": true - } - } - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fastest-levenshtein": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", - "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", - "dev": true - }, - "fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "faye-websocket": { - "version": "0.11.4", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", - "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", - "dev": true, - "requires": { - "websocket-driver": ">=0.5.1" - } - }, - "file-loader": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz", - "integrity": "sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==", - "dev": true, - "requires": { - "loader-utils": "^2.0.0", - "schema-utils": "^3.0.0" - }, - "dependencies": { - "loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - }, - "schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - } - } - } - }, - "file-type": { - "version": "12.4.2", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-12.4.2.tgz", - "integrity": "sha512-UssQP5ZgIOKelfsaB5CuGAL+Y+q7EmONuiwF3N5HAH0t27rvrttgi6Ra9k/+DVaY9UF6+ybxu5pOXLUdA8N7Vg==", - "dev": true - }, - "fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "finalhandler": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", - "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", - "dev": true, - "requires": { - "debug": "2.6.9", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - } - } - }, - "find-cache-dir": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", - "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "follow-redirects": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", - "dev": true - }, - "forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "dev": true - }, - "fraction.js": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz", - "integrity": "sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==", - "dev": true - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "dev": true - }, - "fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - }, - "fs-monkey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.3.tgz", - "integrity": "sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q==", - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - }, - "function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true - }, - "gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "dev": true, - "requires": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - } - }, - "get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true - }, - "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true - }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - }, - "globby": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", - "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", - "dev": true, - "requires": { - "@types/glob": "^7.1.1", - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.0.3", - "glob": "^7.1.3", - "ignore": "^5.1.1", - "merge2": "^1.2.3", - "slash": "^3.0.0" - } - }, - "gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "requires": { - "get-intrinsic": "^1.1.3" - } - }, - "graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, - "growly": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", - "integrity": "sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw==", - "dev": true - }, - "handle-thing": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", - "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==", - "dev": true - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "requires": { - "es-define-property": "^1.0.0" - } - }, - "has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "dev": true - }, - "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true - }, - "hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "hash-sum": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz", - "integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==", - "dev": true - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, - "requires": { - "function-bind": "^1.1.2" - } - }, - "he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "hpack.js": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", - "integrity": "sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "obuf": "^1.0.0", - "readable-stream": "^2.0.1", - "wbuf": "^1.1.0" - } - }, - "html-entities": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.3.tgz", - "integrity": "sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==", - "dev": true - }, - "html-loader": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/html-loader/-/html-loader-1.3.2.tgz", - "integrity": "sha512-DEkUwSd0sijK5PF3kRWspYi56XP7bTNkyg5YWSzBdjaSDmvCufep5c4Vpb3PBf6lUL0YPtLwBfy9fL0t5hBAGA==", - "dev": true, - "requires": { - "html-minifier-terser": "^5.1.1", - "htmlparser2": "^4.1.0", - "loader-utils": "^2.0.0", - "schema-utils": "^3.0.0" - }, - "dependencies": { - "loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - }, - "schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - } - } - } - }, - "html-minifier-terser": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz", - "integrity": "sha512-ZPr5MNObqnV/T9akshPKbVgyOqLmy+Bxo7juKCfTfnjNniTAMdy4hz21YQqoofMBJD2kdREaqPPdThoR78Tgxg==", - "dev": true, - "requires": { - "camel-case": "^4.1.1", - "clean-css": "^4.2.3", - "commander": "^4.1.1", - "he": "^1.2.0", - "param-case": "^3.0.3", - "relateurl": "^0.2.7", - "terser": "^4.6.3" - }, - "dependencies": { - "clean-css": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.4.tgz", - "integrity": "sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==", - "dev": true, - "requires": { - "source-map": "~0.6.0" - } - }, - "commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", - "dev": true - }, - "terser": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz", - "integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==", - "dev": true, - "requires": { - "commander": "^2.20.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.12" - }, - "dependencies": { - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - } - } - } - } - }, - "htmlparser2": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-4.1.0.tgz", - "integrity": "sha512-4zDq1a1zhE4gQso/c5LP1OtrhYTncXNSpvJYtWJBtXAETPlMfi3IFNjGuQbYLuVY4ZR0QMqRVvo4Pdy9KLyP8Q==", - "dev": true, - "requires": { - "domelementtype": "^2.0.1", - "domhandler": "^3.0.0", - "domutils": "^2.0.0", - "entities": "^2.0.0" - } - }, - "http-deceiver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", - "integrity": "sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw==", - "dev": true - }, - "http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dev": true, - "requires": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - } - }, - "http-parser-js": { - "version": "0.5.8", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz", - "integrity": "sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==", - "dev": true - }, - "http-proxy": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", - "dev": true, - "requires": { - "eventemitter3": "^4.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" - } - }, - "http-proxy-middleware": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz", - "integrity": "sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==", - "dev": true, - "requires": { - "@types/http-proxy": "^1.17.8", - "http-proxy": "^1.18.1", - "is-glob": "^4.0.1", - "is-plain-obj": "^3.0.0", - "micromatch": "^4.0.2" - } - }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==", - "dev": true - }, - "human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "icss-utils": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", - "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", - "dev": true, - "requires": {} - }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true - }, - "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true - }, - "imagemin": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/imagemin/-/imagemin-7.0.1.tgz", - "integrity": "sha512-33AmZ+xjZhg2JMCe+vDf6a9mzWukE7l+wAtesjE7KyteqqKjzxv7aVQeWnul1Ve26mWvEQqyPwl0OctNBfSR9w==", - "dev": true, - "requires": { - "file-type": "^12.0.0", - "globby": "^10.0.0", - "graceful-fs": "^4.2.2", - "junk": "^3.1.0", - "make-dir": "^3.0.0", - "p-pipe": "^3.0.0", - "replace-ext": "^1.0.0" - } - }, - "img-loader": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/img-loader/-/img-loader-4.0.0.tgz", - "integrity": "sha512-UwRcPQdwdOyEHyCxe1V9s9YFwInwEWCpoO+kJGfIqDrBDqA8jZUsEZTxQ0JteNPGw/Gupmwesk2OhLTcnw6tnQ==", - "dev": true, - "requires": { - "loader-utils": "^1.1.0" - } - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "import-local": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", - "dev": true, - "requires": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "interpret": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", - "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", - "dev": true - }, - "ipaddr.js": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz", - "integrity": "sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==", - "dev": true - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-core-module": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", - "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, - "is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-plain-obj": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", - "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", - "dev": true - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true - }, - "is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dev": true, - "requires": { - "is-docker": "^2.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "jest-worker": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", - "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", - "dev": true, - "requires": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "dependencies": { - "supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jquery": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", - "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==", - "dev": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "jsesc": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", - "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", - "dev": true - }, - "json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true - }, - "jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^2.0.0" - } - }, - "junk": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/junk/-/junk-3.1.0.tgz", - "integrity": "sha512-pBxcB3LFc8QVgdggvZWyeys+hnrNWg4OcZIU/1X59k5jQdLBlCsYGRQaz234SqoRLTCgMH00fY0xRJH+F9METQ==", - "dev": true - }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true - }, - "klona": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.5.tgz", - "integrity": "sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ==", - "dev": true - }, - "laravel-mix": { - "version": "6.0.49", - "resolved": "https://registry.npmjs.org/laravel-mix/-/laravel-mix-6.0.49.tgz", - "integrity": "sha512-bBMFpFjp26XfijPvY5y9zGKud7VqlyOE0OWUcPo3vTBY5asw8LTjafAbee1dhfLz6PWNqDziz69CP78ELSpfKw==", - "dev": true, - "requires": { - "@babel/core": "^7.15.8", - "@babel/plugin-proposal-object-rest-spread": "^7.15.6", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/plugin-transform-runtime": "^7.15.8", - "@babel/preset-env": "^7.15.8", - "@babel/runtime": "^7.15.4", - "@types/babel__core": "^7.1.16", - "@types/clean-css": "^4.2.5", - "@types/imagemin-gifsicle": "^7.0.1", - "@types/imagemin-mozjpeg": "^8.0.1", - "@types/imagemin-optipng": "^5.2.1", - "@types/imagemin-svgo": "^8.0.0", - "autoprefixer": "^10.4.0", - "babel-loader": "^8.2.3", - "chalk": "^4.1.2", - "chokidar": "^3.5.2", - "clean-css": "^5.2.4", - "cli-table3": "^0.6.0", - "collect.js": "^4.28.5", - "commander": "^7.2.0", - "concat": "^1.0.3", - "css-loader": "^5.2.6", - "cssnano": "^5.0.8", - "dotenv": "^10.0.0", - "dotenv-expand": "^5.1.0", - "file-loader": "^6.2.0", - "fs-extra": "^10.0.0", - "glob": "^7.2.0", - "html-loader": "^1.3.2", - "imagemin": "^7.0.1", - "img-loader": "^4.0.0", - "lodash": "^4.17.21", - "md5": "^2.3.0", - "mini-css-extract-plugin": "^1.6.2", - "node-libs-browser": "^2.2.1", - "postcss-load-config": "^3.1.0", - "postcss-loader": "^6.2.0", - "semver": "^7.3.5", - "strip-ansi": "^6.0.0", - "style-loader": "^2.0.0", - "terser": "^5.9.0", - "terser-webpack-plugin": "^5.2.4", - "vue-style-loader": "^4.1.3", - "webpack": "^5.60.0", - "webpack-cli": "^4.9.1", - "webpack-dev-server": "^4.7.3", - "webpack-merge": "^5.8.0", - "webpack-notifier": "^1.14.1", - "webpackbar": "^5.0.0-3", - "yargs": "^17.2.1" - }, - "dependencies": { - "commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true - } - } - }, - "lilconfig": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.6.tgz", - "integrity": "sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg==", - "dev": true - }, - "lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true - }, - "loader-runner": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", - "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", - "dev": true - }, - "loader-utils": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", - "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" - }, - "dependencies": { - "json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - } - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", - "dev": true - }, - "lodash.memoize": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", - "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", - "dev": true - }, - "lodash.throttle": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", - "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==", - "dev": true - }, - "lodash.uniq": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", - "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", - "dev": true - }, - "lower-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", - "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", - "dev": true, - "requires": { - "tslib": "^2.0.3" - } - }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "md5": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", - "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", - "dev": true, - "requires": { - "charenc": "0.0.2", - "crypt": "0.0.2", - "is-buffer": "~1.1.6" - } - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "mdn-data": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", - "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", - "dev": true - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "dev": true - }, - "memfs": { - "version": "3.4.7", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.7.tgz", - "integrity": "sha512-ygaiUSNalBX85388uskeCyhSAoOSgzBbtVCr9jA2RROssFL9Q19/ZXFqS+2Th2sr1ewNIWgFdLzLC3Yl1Zv+lw==", - "dev": true, - "requires": { - "fs-monkey": "^1.0.3" - } - }, - "merge-descriptors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", - "dev": true - }, - "merge-source-map": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", - "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", - "dev": true, - "requires": { - "source-map": "^0.6.1" - } - }, - "merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "dev": true - }, - "micromatch": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, - "requires": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" - } - }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "dev": true - }, - "mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true - }, - "mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "requires": { - "mime-db": "1.52.0" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "mini-css-extract-plugin": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.6.2.tgz", - "integrity": "sha512-WhDvO3SjGm40oV5y26GjMJYjd2UMqrLAGKy5YS2/3QKJy2F7jgynuHTir/tgUUOiNQu5saXHdc8reo7YuhhT4Q==", - "dev": true, - "requires": { - "loader-utils": "^2.0.0", - "schema-utils": "^3.0.0", - "webpack-sources": "^1.1.0" - }, - "dependencies": { - "loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - }, - "schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - } - } - } - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", - "dev": true - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "multicast-dns": { - "version": "7.2.5", - "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz", - "integrity": "sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==", - "dev": true, - "requires": { - "dns-packet": "^5.2.2", - "thunky": "^1.0.2" - } - }, - "nanoid": { - "version": "3.3.8", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", - "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", - "dev": true - }, - "negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "dev": true - }, - "neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", - "dev": true - }, - "no-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", - "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", - "dev": true, - "requires": { - "lower-case": "^2.0.2", - "tslib": "^2.0.3" - } - }, - "node-forge": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", - "dev": true - }, - "node-libs-browser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", - "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", - "dev": true, - "requires": { - "assert": "^1.1.1", - "browserify-zlib": "^0.2.0", - "buffer": "^4.3.0", - "console-browserify": "^1.1.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.11.0", - "domain-browser": "^1.1.1", - "events": "^3.0.0", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", - "path-browserify": "0.0.1", - "process": "^0.11.10", - "punycode": "^1.2.4", - "querystring-es3": "^0.2.0", - "readable-stream": "^2.3.3", - "stream-browserify": "^2.0.1", - "stream-http": "^2.7.2", - "string_decoder": "^1.0.0", - "timers-browserify": "^2.0.4", - "tty-browserify": "0.0.0", - "url": "^0.11.0", - "util": "^0.11.0", - "vm-browserify": "^1.0.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", - "dev": true - } - } - }, - "node-notifier": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-9.0.1.tgz", - "integrity": "sha512-fPNFIp2hF/Dq7qLDzSg4vZ0J4e9v60gJR+Qx7RbjbWqzPDdEqeVpEx5CFeDAELIl+A/woaaNn1fQ5nEVerMxJg==", - "dev": true, - "requires": { - "growly": "^1.3.0", - "is-wsl": "^2.2.0", - "semver": "^7.3.2", - "shellwords": "^0.1.1", - "uuid": "^8.3.0", - "which": "^2.0.2" - } - }, - "node-releases": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", - "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", - "dev": true - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "normalize-range": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", - "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", - "dev": true - }, - "normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", - "dev": true - }, - "npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "requires": { - "path-key": "^3.0.0" - } - }, - "nth-check": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", - "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", - "dev": true, - "requires": { - "boolbase": "^1.0.0" - } - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true - }, - "object-inspect": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", - "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", - "dev": true - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - }, - "object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - } - }, - "obuf": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", - "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", - "dev": true - }, - "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dev": true, - "requires": { - "ee-first": "1.1.1" - } - }, - "on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "requires": { - "mimic-fn": "^2.1.0" - } - }, - "open": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", - "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", - "dev": true, - "requires": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" - } - }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==", - "dev": true - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-pipe": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-pipe/-/p-pipe-3.1.0.tgz", - "integrity": "sha512-08pj8ATpzMR0Y80x50yJHn37NF6vjrqHutASaX5LiH5npS9XPvrUmscd9MF5R4fuYRHOxQR1FfMIlF7AzwoPqw==", - "dev": true - }, - "p-retry": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", - "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", - "dev": true, - "requires": { - "@types/retry": "0.12.0", - "retry": "^0.13.1" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, - "param-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", - "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", - "dev": true, - "requires": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "parse-asn1": { - "version": "5.1.7", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz", - "integrity": "sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg==", - "dev": true, - "requires": { - "asn1.js": "^4.10.1", - "browserify-aes": "^1.2.0", - "evp_bytestokey": "^1.0.3", - "hash-base": "~3.0", - "pbkdf2": "^3.1.2", - "safe-buffer": "^5.2.1" - }, - "dependencies": { - "hash-base": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.5.tgz", - "integrity": "sha512-vXm0l45VbcHEVlTCzs8M+s0VeYsB2lnlAaThoLKGXr3bE/VWDOelNUnycUPEhKEaXARL2TEFjBOyUiM6+55KBg==", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "safe-buffer": "^5.2.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - }, - "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "dev": true - }, - "pascal-case": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", - "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", - "dev": true, - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "path-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", - "dev": true - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - } - }, - "popper.js": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz", - "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==", - "dev": true - }, - "postcss": { - "version": "8.4.49", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", - "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", - "dev": true, - "requires": { - "nanoid": "^3.3.7", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - } - }, - "postcss-calc": { - "version": "8.2.4", - "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-8.2.4.tgz", - "integrity": "sha512-SmWMSJmB8MRnnULldx0lQIyhSNvuDl9HfrZkaqqE/WHAhToYsAvDq+yAsA/kIyINDszOp3Rh0GFoNuH5Ypsm3Q==", - "dev": true, - "requires": { - "postcss-selector-parser": "^6.0.9", - "postcss-value-parser": "^4.2.0" - } - }, - "postcss-colormin": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-5.3.0.tgz", - "integrity": "sha512-WdDO4gOFG2Z8n4P8TWBpshnL3JpmNmJwdnfP2gbk2qBA8PWwOYcmjmI/t3CmMeL72a7Hkd+x/Mg9O2/0rD54Pg==", - "dev": true, - "requires": { - "browserslist": "^4.16.6", - "caniuse-api": "^3.0.0", - "colord": "^2.9.1", - "postcss-value-parser": "^4.2.0" - } - }, - "postcss-convert-values": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-5.1.2.tgz", - "integrity": "sha512-c6Hzc4GAv95B7suy4udszX9Zy4ETyMCgFPUDtWjdFTKH1SE9eFY/jEpHSwTH1QPuwxHpWslhckUQWbNRM4ho5g==", - "dev": true, - "requires": { - "browserslist": "^4.20.3", - "postcss-value-parser": "^4.2.0" - } - }, - "postcss-discard-comments": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-5.1.2.tgz", - "integrity": "sha512-+L8208OVbHVF2UQf1iDmRcbdjJkuBF6IS29yBDSiWUIzpYaAhtNl6JYnYm12FnkeCwQqF5LeklOu6rAqgfBZqQ==", - "dev": true, - "requires": {} - }, - "postcss-discard-duplicates": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-5.1.0.tgz", - "integrity": "sha512-zmX3IoSI2aoenxHV6C7plngHWWhUOV3sP1T8y2ifzxzbtnuhk1EdPwm0S1bIUNaJ2eNbWeGLEwzw8huPD67aQw==", - "dev": true, - "requires": {} - }, - "postcss-discard-empty": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-5.1.1.tgz", - "integrity": "sha512-zPz4WljiSuLWsI0ir4Mcnr4qQQ5e1Ukc3i7UfE2XcrwKK2LIPIqE5jxMRxO6GbI3cv//ztXDsXwEWT3BHOGh3A==", - "dev": true, - "requires": {} - }, - "postcss-discard-overridden": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-5.1.0.tgz", - "integrity": "sha512-21nOL7RqWR1kasIVdKs8HNqQJhFxLsyRfAnUDm4Fe4t4mCWL9OJiHvlHPjcd8zc5Myu89b/7wZDnOSjFgeWRtw==", - "dev": true, - "requires": {} - }, - "postcss-load-config": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-3.1.4.tgz", - "integrity": "sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==", - "dev": true, - "requires": { - "lilconfig": "^2.0.5", - "yaml": "^1.10.2" - } - }, - "postcss-loader": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-6.2.1.tgz", - "integrity": "sha512-WbbYpmAaKcux/P66bZ40bpWsBucjx/TTgVVzRZ9yUO8yQfVBlameJ0ZGVaPfH64hNSBh63a+ICP5nqOpBA0w+Q==", - "dev": true, - "requires": { - "cosmiconfig": "^7.0.0", - "klona": "^2.0.5", - "semver": "^7.3.5" - } - }, - "postcss-merge-longhand": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-5.1.6.tgz", - "integrity": "sha512-6C/UGF/3T5OE2CEbOuX7iNO63dnvqhGZeUnKkDeifebY0XqkkvrctYSZurpNE902LDf2yKwwPFgotnfSoPhQiw==", - "dev": true, - "requires": { - "postcss-value-parser": "^4.2.0", - "stylehacks": "^5.1.0" - } - }, - "postcss-merge-rules": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-5.1.2.tgz", - "integrity": "sha512-zKMUlnw+zYCWoPN6yhPjtcEdlJaMUZ0WyVcxTAmw3lkkN/NDMRkOkiuctQEoWAOvH7twaxUUdvBWl0d4+hifRQ==", - "dev": true, - "requires": { - "browserslist": "^4.16.6", - "caniuse-api": "^3.0.0", - "cssnano-utils": "^3.1.0", - "postcss-selector-parser": "^6.0.5" - } - }, - "postcss-minify-font-values": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-5.1.0.tgz", - "integrity": "sha512-el3mYTgx13ZAPPirSVsHqFzl+BBBDrXvbySvPGFnQcTI4iNslrPaFq4muTkLZmKlGk4gyFAYUBMH30+HurREyA==", - "dev": true, - "requires": { - "postcss-value-parser": "^4.2.0" - } - }, - "postcss-minify-gradients": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-5.1.1.tgz", - "integrity": "sha512-VGvXMTpCEo4qHTNSa9A0a3D+dxGFZCYwR6Jokk+/3oB6flu2/PnPXAh2x7x52EkY5xlIHLm+Le8tJxe/7TNhzw==", - "dev": true, - "requires": { - "colord": "^2.9.1", - "cssnano-utils": "^3.1.0", - "postcss-value-parser": "^4.2.0" - } - }, - "postcss-minify-params": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-5.1.3.tgz", - "integrity": "sha512-bkzpWcjykkqIujNL+EVEPOlLYi/eZ050oImVtHU7b4lFS82jPnsCb44gvC6pxaNt38Els3jWYDHTjHKf0koTgg==", - "dev": true, - "requires": { - "browserslist": "^4.16.6", - "cssnano-utils": "^3.1.0", - "postcss-value-parser": "^4.2.0" - } - }, - "postcss-minify-selectors": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-5.2.1.tgz", - "integrity": "sha512-nPJu7OjZJTsVUmPdm2TcaiohIwxP+v8ha9NehQ2ye9szv4orirRU3SDdtUmKH+10nzn0bAyOXZ0UEr7OpvLehg==", - "dev": true, - "requires": { - "postcss-selector-parser": "^6.0.5" - } - }, - "postcss-modules-extract-imports": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz", - "integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==", - "dev": true, - "requires": {} - }, - "postcss-modules-local-by-default": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz", - "integrity": "sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ==", - "dev": true, - "requires": { - "icss-utils": "^5.0.0", - "postcss-selector-parser": "^6.0.2", - "postcss-value-parser": "^4.1.0" - } - }, - "postcss-modules-scope": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz", - "integrity": "sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==", - "dev": true, - "requires": { - "postcss-selector-parser": "^6.0.4" - } - }, - "postcss-modules-values": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", - "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", - "dev": true, - "requires": { - "icss-utils": "^5.0.0" - } - }, - "postcss-normalize-charset": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-5.1.0.tgz", - "integrity": "sha512-mSgUJ+pd/ldRGVx26p2wz9dNZ7ji6Pn8VWBajMXFf8jk7vUoSrZ2lt/wZR7DtlZYKesmZI680qjr2CeFF2fbUg==", - "dev": true, - "requires": {} - }, - "postcss-normalize-display-values": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-5.1.0.tgz", - "integrity": "sha512-WP4KIM4o2dazQXWmFaqMmcvsKmhdINFblgSeRgn8BJ6vxaMyaJkwAzpPpuvSIoG/rmX3M+IrRZEz2H0glrQNEA==", - "dev": true, - "requires": { - "postcss-value-parser": "^4.2.0" - } - }, - "postcss-normalize-positions": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-5.1.1.tgz", - "integrity": "sha512-6UpCb0G4eofTCQLFVuI3EVNZzBNPiIKcA1AKVka+31fTVySphr3VUgAIULBhxZkKgwLImhzMR2Bw1ORK+37INg==", - "dev": true, - "requires": { - "postcss-value-parser": "^4.2.0" - } - }, - "postcss-normalize-repeat-style": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-5.1.1.tgz", - "integrity": "sha512-mFpLspGWkQtBcWIRFLmewo8aC3ImN2i/J3v8YCFUwDnPu3Xz4rLohDO26lGjwNsQxB3YF0KKRwspGzE2JEuS0g==", - "dev": true, - "requires": { - "postcss-value-parser": "^4.2.0" - } - }, - "postcss-normalize-string": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-5.1.0.tgz", - "integrity": "sha512-oYiIJOf4T9T1N4i+abeIc7Vgm/xPCGih4bZz5Nm0/ARVJ7K6xrDlLwvwqOydvyL3RHNf8qZk6vo3aatiw/go3w==", - "dev": true, - "requires": { - "postcss-value-parser": "^4.2.0" - } - }, - "postcss-normalize-timing-functions": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-5.1.0.tgz", - "integrity": "sha512-DOEkzJ4SAXv5xkHl0Wa9cZLF3WCBhF3o1SKVxKQAa+0pYKlueTpCgvkFAHfk+Y64ezX9+nITGrDZeVGgITJXjg==", - "dev": true, - "requires": { - "postcss-value-parser": "^4.2.0" - } - }, - "postcss-normalize-unicode": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-5.1.0.tgz", - "integrity": "sha512-J6M3MizAAZ2dOdSjy2caayJLQT8E8K9XjLce8AUQMwOrCvjCHv24aLC/Lps1R1ylOfol5VIDMaM/Lo9NGlk1SQ==", - "dev": true, - "requires": { - "browserslist": "^4.16.6", - "postcss-value-parser": "^4.2.0" - } - }, - "postcss-normalize-url": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-5.1.0.tgz", - "integrity": "sha512-5upGeDO+PVthOxSmds43ZeMeZfKH+/DKgGRD7TElkkyS46JXAUhMzIKiCa7BabPeIy3AQcTkXwVVN7DbqsiCew==", - "dev": true, - "requires": { - "normalize-url": "^6.0.1", - "postcss-value-parser": "^4.2.0" - } - }, - "postcss-normalize-whitespace": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-5.1.1.tgz", - "integrity": "sha512-83ZJ4t3NUDETIHTa3uEg6asWjSBYL5EdkVB0sDncx9ERzOKBVJIUeDO9RyA9Zwtig8El1d79HBp0JEi8wvGQnA==", - "dev": true, - "requires": { - "postcss-value-parser": "^4.2.0" - } - }, - "postcss-ordered-values": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-5.1.3.tgz", - "integrity": "sha512-9UO79VUhPwEkzbb3RNpqqghc6lcYej1aveQteWY+4POIwlqkYE21HKWaLDF6lWNuqCobEAyTovVhtI32Rbv2RQ==", - "dev": true, - "requires": { - "cssnano-utils": "^3.1.0", - "postcss-value-parser": "^4.2.0" - } - }, - "postcss-reduce-initial": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-5.1.0.tgz", - "integrity": "sha512-5OgTUviz0aeH6MtBjHfbr57tml13PuedK/Ecg8szzd4XRMbYxH4572JFG067z+FqBIf6Zp/d+0581glkvvWMFw==", - "dev": true, - "requires": { - "browserslist": "^4.16.6", - "caniuse-api": "^3.0.0" - } - }, - "postcss-reduce-transforms": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-5.1.0.tgz", - "integrity": "sha512-2fbdbmgir5AvpW9RLtdONx1QoYG2/EtqpNQbFASDlixBbAYuTcJ0dECwlqNqH7VbaUnEnh8SrxOe2sRIn24XyQ==", - "dev": true, - "requires": { - "postcss-value-parser": "^4.2.0" - } - }, - "postcss-selector-parser": { - "version": "6.0.10", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", - "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", - "dev": true, - "requires": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - } - }, - "postcss-svgo": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-5.1.0.tgz", - "integrity": "sha512-D75KsH1zm5ZrHyxPakAxJWtkyXew5qwS70v56exwvw542d9CRtTo78K0WeFxZB4G7JXKKMbEZtZayTGdIky/eA==", - "dev": true, - "requires": { - "postcss-value-parser": "^4.2.0", - "svgo": "^2.7.0" - } - }, - "postcss-unique-selectors": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-5.1.1.tgz", - "integrity": "sha512-5JiODlELrz8L2HwxfPnhOWZYWDxVHWL83ufOv84NrcgipI7TaeRsatAhK4Tr2/ZiYldpK/wBvw5BD3qfaK96GA==", - "dev": true, - "requires": { - "postcss-selector-parser": "^6.0.5" - } - }, - "postcss-value-parser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", - "dev": true - }, - "prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", - "dev": true, - "optional": true - }, - "pretty-time": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pretty-time/-/pretty-time-1.1.0.tgz", - "integrity": "sha512-28iF6xPQrP8Oa6uxE6a1biz+lWeTOAPKggvjB8HAs6nVMKZwf5bG++632Dx614hIWgUPkgivRfG+a8uAXGTIbA==", - "dev": true - }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "dev": true, - "requires": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "dependencies": { - "ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "dev": true - } - } - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", - "dev": true - }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "dev": true, - "requires": { - "side-channel": "^1.0.6" - } - }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==", - "dev": true - }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==", - "dev": true - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "dev": true - }, - "raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "dev": true, - "requires": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "dependencies": { - "bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true - } - } - }, - "readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "rechoir": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", - "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", - "dev": true, - "requires": { - "resolve": "^1.9.0" - } - }, - "regenerate": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", - "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", - "dev": true - }, - "regenerate-unicode-properties": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.0.1.tgz", - "integrity": "sha512-vn5DU6yg6h8hP/2OkQo3K7uVILvY4iu0oI4t3HFa81UPkhGJwkRwM10JEc3upjdhHjs/k8GJY1sRBhk5sr69Bw==", - "dev": true, - "requires": { - "regenerate": "^1.4.2" - } - }, - "regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", - "dev": true - }, - "regenerator-transform": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.0.tgz", - "integrity": "sha512-LsrGtPmbYg19bcPHwdtmXwbW+TqNvtY4riE3P83foeHRroMbH6/2ddFBfab3t7kbzc7v7p4wbkIecHImqt0QNg==", - "dev": true, - "requires": { - "@babel/runtime": "^7.8.4" - } - }, - "regex-parser": { - "version": "2.2.11", - "resolved": "https://registry.npmjs.org/regex-parser/-/regex-parser-2.2.11.tgz", - "integrity": "sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q==", - "dev": true - }, - "regexpu-core": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.1.0.tgz", - "integrity": "sha512-bb6hk+xWd2PEOkj5It46A16zFMs2mv86Iwpdu94la4S3sJ7C973h2dHpYKwIBGaWSO7cIRJ+UX0IeMaWcO4qwA==", - "dev": true, - "requires": { - "regenerate": "^1.4.2", - "regenerate-unicode-properties": "^10.0.1", - "regjsgen": "^0.6.0", - "regjsparser": "^0.8.2", - "unicode-match-property-ecmascript": "^2.0.0", - "unicode-match-property-value-ecmascript": "^2.0.0" - } - }, - "regjsgen": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.6.0.tgz", - "integrity": "sha512-ozE883Uigtqj3bx7OhL1KNbCzGyW2NQZPl6Hs09WTvCuZD5sTI4JY58bkbQWa/Y9hxIsvJ3M8Nbf7j54IqeZbA==", - "dev": true - }, - "regjsparser": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.8.4.tgz", - "integrity": "sha512-J3LABycON/VNEu3abOviqGHuB/LOtOQj8SKmfP9anY5GfAVw/SPjwzSjxGjbZXIxbGfqTHtJw58C2Li/WkStmA==", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", - "dev": true - } - } - }, - "relateurl": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", - "integrity": "sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==", - "dev": true - }, - "replace-ext": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", - "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", - "dev": true - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true - }, - "requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true - }, - "resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", - "dev": true, - "requires": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - } - }, - "resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "requires": { - "resolve-from": "^5.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - } - } - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "resolve-url-loader": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/resolve-url-loader/-/resolve-url-loader-3.1.5.tgz", - "integrity": "sha512-mgFMCmrV/tA4738EsFmPFE5/MaqSgUMe8LK971kVEKA/RrNVb7+VqFsg/qmKyythf34eyq476qIobP/gfFBGSQ==", - "dev": true, - "requires": { - "adjust-sourcemap-loader": "3.0.0", - "camelcase": "5.3.1", - "compose-function": "3.0.3", - "convert-source-map": "1.7.0", - "es6-iterator": "2.0.3", - "loader-utils": "^1.2.3", - "postcss": "7.0.36", - "rework": "1.0.1", - "rework-visit": "1.0.0", - "source-map": "0.6.1" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "dependencies": { - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "postcss": { - "version": "7.0.36", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", - "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "retry": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", - "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", - "dev": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rework": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/rework/-/rework-1.0.1.tgz", - "integrity": "sha1-MIBqhBNCtUUQqkEQhQzUhTQUSqc=", - "dev": true, - "requires": { - "convert-source-map": "^0.3.3", - "css": "^2.0.0" - }, - "dependencies": { - "convert-source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-0.3.5.tgz", - "integrity": "sha1-8dgClQr33SYxof6+BZZVDIarMZA=", - "dev": true - } - } - }, - "rework-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/rework-visit/-/rework-visit-1.0.0.tgz", - "integrity": "sha1-mUWygD8hni96ygCtuLyfZA+ELJo=", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "sass": { - "version": "1.32.8", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.32.8.tgz", - "integrity": "sha512-Sl6mIeGpzjIUZqvKnKETfMf0iDAswD9TNlv13A7aAF3XZlRPMq4VvJWBC2N2DXbp94MQVdNSFG6LfF/iOXrPHQ==", - "dev": true, - "requires": { - "chokidar": ">=2.0.0 <4.0.0" - } - }, - "sass-loader": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-8.0.2.tgz", - "integrity": "sha512-7o4dbSK8/Ol2KflEmSco4jTjQoV988bM82P9CZdmo9hR3RLnvNc0ufMNdMrB0caq38JQ/FgF4/7RcbcfKzxoFQ==", - "dev": true, - "requires": { - "clone-deep": "^4.0.1", - "loader-utils": "^1.2.3", - "neo-async": "^2.6.1", - "schema-utils": "^2.6.1", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "schema-utils": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", - "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.5", - "ajv": "^6.12.4", - "ajv-keywords": "^3.5.2" - } - }, - "select-hose": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", - "integrity": "sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg==", - "dev": true - }, - "selfsigned": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.1.1.tgz", - "integrity": "sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ==", - "dev": true, - "requires": { - "node-forge": "^1" - } - }, - "semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true - }, - "send": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", - "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", - "dev": true, - "requires": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - }, - "dependencies": { - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - } - } - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "dev": true - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - } - } - }, - "serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, - "serve-index": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", - "integrity": "sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==", - "dev": true, - "requires": { - "accepts": "~1.3.4", - "batch": "0.6.1", - "debug": "2.6.9", - "escape-html": "~1.0.3", - "http-errors": "~1.6.2", - "mime-types": "~2.1.17", - "parseurl": "~1.3.2" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", - "dev": true - }, - "http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==", - "dev": true, - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", - "dev": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "dev": true - }, - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", - "dev": true - } - } - }, - "serve-static": { - "version": "1.16.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", - "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", - "dev": true, - "requires": { - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.19.0" - } - }, - "set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, - "requires": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - } - }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", - "dev": true - }, - "setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "dev": true - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "shallow-clone": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", - "dev": true, - "requires": { - "kind-of": "^6.0.2" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "shellwords": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", - "dev": true - }, - "side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "dev": true, - "requires": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" - } - }, - "signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, - "simplebar": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/simplebar/-/simplebar-5.3.8.tgz", - "integrity": "sha512-LOHjyOcihx++zFN+vuktoZBGpCarFCtHIVDWXOf2VELbGDknq3Hw/sddafRp1aCg123VNkHWOFHUDHYEXAtufQ==", - "dev": true, - "requires": { - "@juggle/resize-observer": "^3.3.1", - "can-use-dom": "^0.1.0", - "core-js": "^3.0.1", - "lodash.debounce": "^4.0.8", - "lodash.memoize": "^4.1.2", - "lodash.throttle": "^4.1.1" - } - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "smooth-dnd": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/smooth-dnd/-/smooth-dnd-0.12.1.tgz", - "integrity": "sha512-Dndj/MOG7VP83mvzfGCLGzV2HuK1lWachMtWl/Iuk6zV7noDycIBnflwaPuDzoaapEl3Pc4+ybJArkkx9sxPZg==", - "dev": true - }, - "sockjs": { - "version": "0.3.24", - "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz", - "integrity": "sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==", - "dev": true, - "requires": { - "faye-websocket": "^0.11.3", - "uuid": "^8.3.2", - "websocket-driver": "^0.7.4" - } - }, - "source-list-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true - }, - "source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "dev": true, - "requires": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "source-map-url": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", - "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", - "dev": true - }, - "spdy": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz", - "integrity": "sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==", - "dev": true, - "requires": { - "debug": "^4.1.0", - "handle-thing": "^2.0.0", - "http-deceiver": "^1.2.7", - "select-hose": "^2.0.0", - "spdy-transport": "^3.0.0" - } - }, - "spdy-transport": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz", - "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", - "dev": true, - "requires": { - "debug": "^4.1.0", - "detect-node": "^2.0.4", - "hpack.js": "^2.1.6", - "obuf": "^1.1.2", - "readable-stream": "^3.0.6", - "wbuf": "^1.7.3" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, - "ssr-window": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-3.0.0.tgz", - "integrity": "sha512-q+8UfWDg9Itrg0yWK7oe5p/XRCJpJF9OBtXfOPgSJl+u3Xd5KI328RUEvUqSMVM9CiQUEf1QdBzJMkYGErj9QA==", - "dev": true - }, - "stable": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", - "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", - "dev": true - }, - "statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "dev": true - }, - "std-env": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.2.1.tgz", - "integrity": "sha512-D/uYFWkI/31OrnKmXZqGAGK5GbQRPp/BWA1nuITcc6ICblhhuQUPHS5E2GSCVS7Hwhf4ciq8qsATwBUxv+lI6w==", - "dev": true - }, - "stream-browserify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", - "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", - "dev": true, - "requires": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" - } - }, - "stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", - "dev": true, - "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true - }, - "style-loader": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-2.0.0.tgz", - "integrity": "sha512-Z0gYUJmzZ6ZdRUqpg1r8GsaFKypE+3xAzuFeMuoHgjc9KZv3wMyCRjQIWEbhoFSq7+7yoHXySDJyyWQaPajeiQ==", - "dev": true, - "requires": { - "loader-utils": "^2.0.0", - "schema-utils": "^3.0.0" - }, - "dependencies": { - "loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - }, - "schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - } - } - } - }, - "stylehacks": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-5.1.0.tgz", - "integrity": "sha512-SzLmvHQTrIWfSgljkQCw2++C9+Ne91d/6Sp92I8c5uHTcy/PgeHamwITIbBW9wnFTY/3ZfSXR9HIL6Ikqmcu6Q==", - "dev": true, - "requires": { - "browserslist": "^4.16.6", - "postcss-selector-parser": "^6.0.4" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true - }, - "svgo": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz", - "integrity": "sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==", - "dev": true, - "requires": { - "@trysound/sax": "0.2.0", - "commander": "^7.2.0", - "css-select": "^4.1.3", - "css-tree": "^1.1.3", - "csso": "^4.2.0", - "picocolors": "^1.0.0", - "stable": "^0.1.8" - }, - "dependencies": { - "commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true - } - } - }, - "swiper": { - "version": "6.8.4", - "resolved": "https://registry.npmjs.org/swiper/-/swiper-6.8.4.tgz", - "integrity": "sha512-O+buF9Q+sMA0H7luMS8R59hCaJKlpo8PXhQ6ZYu6Rn2v9OsFd4d1jmrv14QvxtQpKAvL/ZiovEeANI/uDGet7g==", - "dev": true, - "requires": { - "dom7": "^3.0.0", - "ssr-window": "^3.0.0" - } - }, - "tapable": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", - "dev": true - }, - "terser": { - "version": "5.36.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz", - "integrity": "sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==", - "dev": true, - "requires": { - "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - } - }, - "terser-webpack-plugin": { - "version": "5.3.10", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", - "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", - "dev": true, - "requires": { - "@jridgewell/trace-mapping": "^0.3.20", - "jest-worker": "^27.4.5", - "schema-utils": "^3.1.1", - "serialize-javascript": "^6.0.1", - "terser": "^5.26.0" - }, - "dependencies": { - "schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - } - } - } - }, - "thunky": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", - "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", - "dev": true - }, - "timers-browserify": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", - "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", - "dev": true, - "requires": { - "setimmediate": "^1.0.4" - } - }, - "tippy.js": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.1.tgz", - "integrity": "sha512-JnFncCq+rF1dTURupoJ4yPie5Cof978inW6/4S6kmWV7LL9YOSEVMifED3KdrVPEG+Z/TFH2CDNJcQEfaeuQww==", - "dev": true, - "requires": { - "@popperjs/core": "^2.8.3" - } - }, - "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha512-okFlQcoGTi4LQBG/PgSYblw9VOyptsz2KJZqc6qtgGdes8VktzUQkj4BI2blit072iS8VODNcMA+tvnS9dnuMA==", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "dev": true - }, - "tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "dev": true - }, - "tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha512-JVa5ijo+j/sOoHGjw0sxw734b1LhBkQ3bvUGNdxnVXDCX81Yx7TFgnZygxrIIWn23hbfTaMYLwRmAxFyDuFmIw==", - "dev": true - }, - "type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", - "dev": true - }, - "type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dev": true, - "requires": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - } - }, - "unicode-canonical-property-names-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", - "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", - "dev": true - }, - "unicode-match-property-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", - "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", - "dev": true, - "requires": { - "unicode-canonical-property-names-ecmascript": "^2.0.0", - "unicode-property-aliases-ecmascript": "^2.0.0" - } - }, - "unicode-match-property-value-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz", - "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==", - "dev": true - }, - "unicode-property-aliases-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz", - "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==", - "dev": true - }, - "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "dev": true - }, - "update-browserslist-db": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", - "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", - "dev": true, - "requires": { - "escalade": "^3.2.0", - "picocolors": "^1.1.0" - } - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ==", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", - "dev": true - } - } - }, - "util": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", - "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", - "dev": true, - "requires": { - "inherits": "2.0.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", - "dev": true - } - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "dev": true - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "dev": true - }, - "vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "dev": true - }, - "vue": { - "version": "2.7.16", - "resolved": "https://registry.npmjs.org/vue/-/vue-2.7.16.tgz", - "integrity": "sha512-4gCtFXaAA3zYZdTp5s4Hl2sozuySsgz4jy1EnpBHNfpMa9dK1ZCG7viqBPCwXtmgc8nHqUsAu3G4gtmXkkY3Sw==", - "dev": true, - "requires": { - "@vue/compiler-sfc": "2.7.16", - "csstype": "^3.1.0" - } - }, - "vue-content-placeholders": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/vue-content-placeholders/-/vue-content-placeholders-0.2.1.tgz", - "integrity": "sha512-Q+HPjuY98R0fLQ45eOOCYeMY7vpjU1H/Qqs0ptdBI6xe3nDDsPE4r/kN5YA9rVxQFP/PKhG5qQR4rqy02xPabw==", - "dev": true - }, - "vue-hot-reload-api": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz", - "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==", - "dev": true - }, - "vue-loader": { - "version": "15.11.1", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.11.1.tgz", - "integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==", - "dev": true, - "requires": { - "@vue/component-compiler-utils": "^3.1.0", - "hash-sum": "^1.0.2", - "loader-utils": "^1.1.0", - "vue-hot-reload-api": "^2.3.0", - "vue-style-loader": "^4.1.0" - } - }, - "vue-smooth-dnd": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/vue-smooth-dnd/-/vue-smooth-dnd-0.8.1.tgz", - "integrity": "sha512-eZVVPTwz4A1cs0+CjXx/ihV+gAl3QBoWQnU6+23Gp59t0WBU99z7ducBQ4FvjBamqOlg8SDOE5eFHQedxwB4Wg==", - "dev": true, - "requires": { - "smooth-dnd": "0.12.1" - } - }, - "vue-style-loader": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.3.tgz", - "integrity": "sha512-sFuh0xfbtpRlKfm39ss/ikqs9AbKCoXZBpHeVZ8Tx650o0k0q/YCM7FRvigtxpACezfq6af+a7JeqVTWvncqDg==", - "dev": true, - "requires": { - "hash-sum": "^1.0.2", - "loader-utils": "^1.0.2" - } - }, - "vue-template-compiler": { - "version": "2.7.16", - "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.16.tgz", - "integrity": "sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==", - "dev": true, - "requires": { - "de-indent": "^1.0.2", - "he": "^1.2.0" - } - }, - "vue-template-es2015-compiler": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz", - "integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==", - "dev": true - }, - "vuex": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz", - "integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==", - "dev": true, - "requires": {} - }, - "watchpack": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", - "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", - "dev": true, - "requires": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" - } - }, - "wbuf": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", - "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", - "dev": true, - "requires": { - "minimalistic-assert": "^1.0.0" - } - }, - "webpack": { - "version": "5.96.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.96.1.tgz", - "integrity": "sha512-l2LlBSvVZGhL4ZrPwyr8+37AunkcYj5qh8o6u2/2rzoPc8gxFJkLj1WxNgooi9pnoc06jh0BjuXnamM4qlujZA==", - "dev": true, - "requires": { - "@types/eslint-scope": "^3.7.7", - "@types/estree": "^1.0.6", - "@webassemblyjs/ast": "^1.12.1", - "@webassemblyjs/wasm-edit": "^1.12.1", - "@webassemblyjs/wasm-parser": "^1.12.1", - "acorn": "^8.14.0", - "browserslist": "^4.24.0", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.17.1", - "es-module-lexer": "^1.2.1", - "eslint-scope": "5.1.1", - "events": "^3.2.0", - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.11", - "json-parse-even-better-errors": "^2.3.1", - "loader-runner": "^4.2.0", - "mime-types": "^2.1.27", - "neo-async": "^2.6.2", - "schema-utils": "^3.2.0", - "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.10", - "watchpack": "^2.4.1", - "webpack-sources": "^3.2.3" - }, - "dependencies": { - "schema-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - } - }, - "webpack-sources": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", - "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", - "dev": true - } - } - }, - "webpack-cli": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz", - "integrity": "sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==", - "dev": true, - "requires": { - "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^1.2.0", - "@webpack-cli/info": "^1.5.0", - "@webpack-cli/serve": "^1.7.0", - "colorette": "^2.0.14", - "commander": "^7.0.0", - "cross-spawn": "^7.0.3", - "fastest-levenshtein": "^1.0.12", - "import-local": "^3.0.2", - "interpret": "^2.2.0", - "rechoir": "^0.7.0", - "webpack-merge": "^5.7.3" - }, - "dependencies": { - "commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true - } - } - }, - "webpack-dev-middleware": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-5.3.4.tgz", - "integrity": "sha512-BVdTqhhs+0IfoeAf7EoH5WE+exCmqGerHfDM0IL096Px60Tq2Mn9MAbnaGUe6HiMa41KMCYF19gyzZmBcq/o4Q==", - "dev": true, - "requires": { - "colorette": "^2.0.10", - "memfs": "^3.4.3", - "mime-types": "^2.1.31", - "range-parser": "^1.2.1", - "schema-utils": "^4.0.0" - }, - "dependencies": { - "ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.3" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "schema-utils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", - "integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.8.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.0.0" - } - } - } - }, - "webpack-dev-server": { - "version": "4.11.0", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.11.0.tgz", - "integrity": "sha512-L5S4Q2zT57SK7tazgzjMiSMBdsw+rGYIX27MgPgx7LDhWO0lViPrHKoLS7jo5In06PWYAhlYu3PbyoC6yAThbw==", - "dev": true, - "requires": { - "@types/bonjour": "^3.5.9", - "@types/connect-history-api-fallback": "^1.3.5", - "@types/express": "^4.17.13", - "@types/serve-index": "^1.9.1", - "@types/serve-static": "^1.13.10", - "@types/sockjs": "^0.3.33", - "@types/ws": "^8.5.1", - "ansi-html-community": "^0.0.8", - "bonjour-service": "^1.0.11", - "chokidar": "^3.5.3", - "colorette": "^2.0.10", - "compression": "^1.7.4", - "connect-history-api-fallback": "^2.0.0", - "default-gateway": "^6.0.3", - "express": "^4.17.3", - "graceful-fs": "^4.2.6", - "html-entities": "^2.3.2", - "http-proxy-middleware": "^2.0.3", - "ipaddr.js": "^2.0.1", - "open": "^8.0.9", - "p-retry": "^4.5.0", - "rimraf": "^3.0.2", - "schema-utils": "^4.0.0", - "selfsigned": "^2.0.1", - "serve-index": "^1.9.1", - "sockjs": "^0.3.24", - "spdy": "^4.0.2", - "webpack-dev-middleware": "^5.3.1", - "ws": "^8.4.2" - }, - "dependencies": { - "ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.3" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "schema-utils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", - "integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.8.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.0.0" - } - } - } - }, - "webpack-merge": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", - "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", - "dev": true, - "requires": { - "clone-deep": "^4.0.1", - "wildcard": "^2.0.0" - } - }, - "webpack-notifier": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/webpack-notifier/-/webpack-notifier-1.15.0.tgz", - "integrity": "sha512-N2V8UMgRB5komdXQRavBsRpw0hPhJq2/SWNOGuhrXpIgRhcMexzkGQysUyGStHLV5hkUlgpRiF7IUXoBqyMmzQ==", - "dev": true, - "requires": { - "node-notifier": "^9.0.0", - "strip-ansi": "^6.0.0" - } - }, - "webpack-sources": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", - "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", - "dev": true, - "requires": { - "source-list-map": "^2.0.0", - "source-map": "~0.6.1" - } - }, - "webpackbar": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/webpackbar/-/webpackbar-5.0.2.tgz", - "integrity": "sha512-BmFJo7veBDgQzfWXl/wwYXr/VFus0614qZ8i9znqcl9fnEdiVkdbi0TedLQ6xAK92HZHDJ0QmyQ0fmuZPAgCYQ==", - "dev": true, - "requires": { - "chalk": "^4.1.0", - "consola": "^2.15.3", - "pretty-time": "^1.1.0", - "std-env": "^3.0.1" - } - }, - "websocket-driver": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", - "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", - "dev": true, - "requires": { - "http-parser-js": ">=0.5.1", - "safe-buffer": ">=5.1.0", - "websocket-extensions": ">=0.1.1" - } - }, - "websocket-extensions": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", - "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", - "dev": true - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "wildcard": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", - "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", - "dev": true - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "ws": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", - "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", - "dev": true, - "requires": {} - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true - }, - "yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "dev": true - }, - "yargs": { - "version": "17.5.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", - "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", - "dev": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" - } - }, - "yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true - } - } -} diff --git a/package.json b/package.json index 8d8ac631..6c6622d4 100644 --- a/package.json +++ b/package.json @@ -1,38 +1,85 @@ { - "private": true, - "scripts": { - "dev": "npm run development", - "development": "mix", - "watch": "mix watch", - "watch-poll": "mix watch -- --watch-options-poll=1000", - "hot": "mix watch --hot", - "prod": "npm run production", - "production": "mix --production" - }, - "devDependencies": { - "@fancyapps/fancybox": "^3.5.7", - "@fortawesome/fontawesome-free": "^6.2.0", - "@ldc-web/cookie-notice": "^6.1.0", - "@types/bootstrap": "^5.2.1", - "@voerro/vue-tagsinput": "^2.7.1", - "axios": "^0.21.1", - "bootstrap": "^5.2.0", - "cross-env": "^7.0", - "jquery": "^3.6", - "laravel-mix": "^6.0.49", - "lodash": "^4.17.19", - "popper.js": "^1.12", - "resolve-url-loader": "^3.1.0", - "sass": "^1.28.0", - "sass-loader": "^8.0.2", - "simplebar": "^5.3.8", - "swiper": "^6.3.4", - "tippy.js": "^6.3.1", - "vue": "^2.7.10", - "vue-content-placeholders": "^0.2.1", - "vue-loader": "^15.10.0", - "vue-smooth-dnd": "^0.8.1", - "vue-template-compiler": "^2.6.12", - "vuex": "^3.6.2" - } + "private": true, + "name": "srcs", + "type": "module", + "scripts": { + "vite": "vite --clearScreen false", + "prod": "vite build --mode production", + "dev": "NODE_ENV=development vite build -d --mode development", + "watch": "NODE_ENV=development vite build --mode development --watch", + "eslint": "eslint --max-warnings 0 ./resources", + "eslint-fix": "eslint --fix --max-warnings 0 ./resources", + "eslint-ci": "eslint --max-warnings 0 ./resources --format=junit", + "test:unit": "vitest run", + "test:unit:coverage": "vitest run --coverage", + "stylelint": "stylelint --config './.stylelintrc.json' --max-warnings 0 '**/resources/**/*.scss'", + "stylelint-fix": "stylelint --config './.stylelintrc.json' --fix --max-warnings 0 '**/resources/**/*.scss'", + "stylelint-ci": "stylelint --config './.stylelintrc.json' --max-warnings 0 '**/resources/**/*.scss' --custom-formatter stylelint-junit-formatter" + }, + "devDependencies": { + "@erbelion/vite-plugin-laravel-purgecss": "^0.4.8", + "@fortawesome/fontawesome-svg-core": "^7.3.1", + "@fortawesome/free-brands-svg-icons": "^7.3.1", + "@fortawesome/free-regular-svg-icons": "^7.3.1", + "@fortawesome/free-solid-svg-icons": "^7.3.1", + "@fortawesome/vue-fontawesome": "^3.3.3", + "@types/bootstrap": "^5.2.11", + "@types/leaflet": "^1.9.22", + "@types/node": "^25.9.9", + "@vitejs/plugin-basic-ssl": "^2.3.0", + "@vitejs/plugin-vue": "^6.0.10", + "@vitest/coverage-v8": "^4.1.12", + "@vue/eslint-config-typescript": "^14.9.0", + "@vue/tsconfig": "^0.9.1", + "autoprefixer": "^10.6.2", + "eslint": "^10.13.0", + "eslint-import-resolver-typescript": "^4.4.5", + "eslint-plugin-import-x": "^4.17.1", + "eslint-plugin-vue": "^10.12.0", + "jsdom": "^29.1.1", + "laravel-vite-plugin": "^3.2.0", + "postcss": "^8.5.32", + "postcss-discard-comments": "^7.0.8", + "sass-embedded": "^1.106.1", + "stylelint": "^17.16.0", + "stylelint-config-idiomatic-order": "github:ream88/stylelint-config-idiomatic-order", + "stylelint-config-sass-guidelines": "^13.0.0", + "stylelint-config-standard-scss": "^17.0.0", + "stylelint-junit-formatter": "^0.2.2", + "stylelint-scss": "^7.4.0", + "typescript": "^6.0.3", + "typescript-eslint": "^8.72.1", + "vite": "^8.3.5", + "vite-plugin-checker": "^0.13.0", + "vite-plugin-eslint2": "^5.3.0", + "vite-plugin-static-copy": "^4.1.1", + "vitest": "^4.1.12", + "vue-tsc": "^3.3.13" + }, + "dependencies": { + "@fortawesome/fontawesome-free": "^7.3.1", + "@ldc-web/cookie-notice": "^6.1.1", + "@voerro/vue-tagsinput": "^2.7.1", + "@vueform/multiselect": "^2.6.11", + "axios": "^1.21.0", + "bootstrap": "^5.3.8", + "ckeditor5": "^48.5.3", + "cropperjs": "^2.3.1", + "eslint-formatter-junit": "^9.0.1", + "leaflet": "^1.9.4", + "lodash": "^4.18.1", + "pinia": "^3.0.4", + "slugify": "^1.6.9", + "sweetalert2": "^11.26.25", + "vue": "^3.5.44", + "vue-content-placeholders": "^0.2.1", + "vue-smooth-dnd": "^0.8.1", + "vuedraggable": "^4.1.0", + "zod": "^4.6.7" + }, + "overrides": { + "js-yaml": ">=4.1.1", + "glob": ">=10.5.0", + "minimatch": ">=10.2.3" + } } diff --git a/phpcs.xml b/phpcs.xml index 9127c939..28974ae0 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,126 +1,70 @@ <?xml version="1.0" encoding="UTF-8"?> -<ruleset name="LDC Laravel" +<ruleset name="Php Coding Standard" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"> - <description>Created with the PHP Coding Standard Generator. http://edorian.github.com/php-coding-standard-generator/</description> + + <description>Standard optimisé : Analyse statique complémentaire à Pint.</description> + <arg name="colors" /> + <config name="installed_paths" value="vendor/slevomat/coding-standard"/> <arg name="extensions" value="php" /> + <arg name="parallel" value="75" /> <file>app/</file> <file>config/</file> - <file>database/factories</file> + <file>database/</file> <file>routes/</file> - <rule ref="PSR1" /> - <rule ref="PSR12" /> + <file>tests/</file> + + <exclude-pattern>*/vendor/*</exclude-pattern> + <exclude-pattern>*/storage/*</exclude-pattern> + <exclude-pattern>_ide_helper.php</exclude-pattern> + <exclude-pattern>*/tests/*</exclude-pattern> + + <rule ref="PSR12"/> - <rule ref="Generic.Classes.DuplicateClassName"/> <rule ref="Generic.CodeAnalysis.EmptyStatement"/> - <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/> - <rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/> - <rule ref="Generic.CodeAnalysis.JumbledIncrementer"/> <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/> - <rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/> - <rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/> <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/> - <rule ref="Generic.Commenting.Todo"/> - <rule ref="Generic.Commenting.Fixme"/> - <rule ref="Generic.ControlStructures.InlineControlStructure"/> - <rule ref="Generic.Files.ByteOrderMark"/> - <rule ref="Generic.Files.LineEndings"/> - <rule ref="Generic.Files.LineLength"/> - <rule ref="Generic.Formatting.DisallowMultipleStatements"/> - <rule ref="Generic.Formatting.MultipleStatementAlignment"/> - <rule ref="Generic.Formatting.NoSpaceAfterCast"/> - <rule ref="Generic.Functions.CallTimePassByReference"/> - <rule ref="Generic.Functions.FunctionCallArgumentSpacing"/> - <rule ref="Generic.Metrics.CyclomaticComplexity"/> + <rule ref="Generic.Metrics.CyclomaticComplexity"> + <properties> + <property name="complexity" value="10"/> + <property name="absoluteComplexity" value="20"/> + </properties> + </rule> <rule ref="Generic.Metrics.NestingLevel"/> - <rule ref="Generic.NamingConventions.ConstructorName"/> - <rule ref="Generic.NamingConventions.UpperCaseConstantName"/> - <rule ref="Generic.NamingConventions.CamelCapsFunctionName"/> + <rule ref="Generic.PHP.DeprecatedFunctions"/> - <rule ref="Generic.PHP.DisallowShortOpenTag"/> <rule ref="Generic.PHP.ForbiddenFunctions"/> <rule ref="Generic.PHP.NoSilencedErrors"/> - <rule ref="Generic.Strings.UnnecessaryStringConcat"/> - <rule ref="Generic.WhiteSpace.DisallowTabIndent"/> - <rule ref="Generic.WhiteSpace.ScopeIndent"/> - <rule ref="MySource.PHP.EvalObjectFactory"/> - <rule ref="MySource.PHP.GetRequestData"/> - <rule ref="MySource.PHP.AjaxNullComparison"/> - <rule ref="PEAR.Classes.ClassDeclaration"/> - <rule ref="PEAR.Commenting.InlineComment"/> - <rule ref="PSR1.Classes.ClassDeclaration"/> - <rule ref="PSR1.Files.SideEffects"/> - <rule ref="PSR2.Classes.ClassDeclaration"/> - <rule ref="PSR2.Classes.PropertyDeclaration"/> - <rule ref="PSR2.ControlStructures.ElseIfDeclaration"/> - <rule ref="PSR2.ControlStructures.SwitchDeclaration"/> - <rule ref="PSR2.Files.EndFileNewline"/> - <rule ref="PSR2.Methods.MethodDeclaration"/> - <rule ref="PSR2.Namespaces.NamespaceDeclaration"/> - <rule ref="PSR2.Namespaces.UseDeclaration"/> - <rule ref="Squiz.PHP.CommentedOutCode"/> - <rule ref="Squiz.PHP.DisallowMultipleAssignments"> - <exclude name="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure" /> - </rule> - <rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/> - - <rule ref="Squiz.PHP.DiscouragedFunctions"> - <properties> - <property name="error" value="true"/> - </properties> - </rule> <rule ref="Squiz.PHP.Eval"/> <rule ref="Squiz.PHP.GlobalKeyword"/> - <rule ref="Squiz.PHP.Heredoc"/> - <rule ref="Squiz.PHP.InnerFunctions"/> - <rule ref="Squiz.PHP.LowercasePHPFunctions"/> <rule ref="Squiz.PHP.NonExecutableCode"/> - <rule ref="Squiz.Scope.MemberVarScope"/> - <rule ref="Squiz.Scope.MethodScope"/> <rule ref="Squiz.Scope.StaticThisUsage"/> - <rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/> - <rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/> - <rule ref="Squiz.WhiteSpace.MemberVarSpacing"> - <properties> - <property name="spacingBeforeFirst " value="false"/> - </properties> - </rule> - <rule ref="Squiz.WhiteSpace.OperatorSpacing"> - <properties> - <property name="ignoreNewlines" value="true"/> - </properties> - </rule> - <rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing"> - <properties> - <property name="ignoreNewlines" value="true"/> - </properties> - </rule> - <rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing"/> - <rule ref="Squiz.WhiteSpace.SemicolonSpacing"/> - <rule ref="Squiz.Commenting.BlockComment"> - <exclude name="Squiz.Commenting.BlockComment.WrongStart" /> - </rule> - <rule ref="Squiz.Commenting.ClassComment"> - <exclude name="Squiz.Commenting.ClassComment.Missing" /> - <exclude name="Squiz.Commenting.ClassComment.TagNotAllowed" /> - </rule> - <rule ref="Squiz.Commenting.DocCommentAlignment"/> - <rule ref="Squiz.Commenting.EmptyCatchComment"/> - <rule ref="Squiz.Commenting.FunctionComment"> - <exclude name="Squiz.Commenting.FunctionComment.MissingParamComment" /> - </rule> - <rule ref="Squiz.Commenting.FunctionCommentThrowTag"/> - <rule ref="Squiz.Commenting.InlineComment"> - <exclude name="Squiz.Commenting.InlineComment.DocBlock" /> - </rule> - <rule ref="Squiz.Commenting.LongConditionClosingComment"> - <exclude name="Squiz.Commenting.LongConditionClosingComment.SpacingBefore" /> - </rule> - <rule ref="Squiz.Commenting.PostStatementComment"/> - <rule ref="Squiz.Commenting.VariableComment"/> - <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses.UnusedUse" /> - <!-- For Laravel migrations --> + <rule ref="Generic.NamingConventions.ConstructorName"/> + <rule ref="Generic.NamingConventions.CamelCapsFunctionName"/> + + <rule ref="Generic.Files.LineLength"> + <properties> + <property name="lineLimit" value="150"/> + <property name="absoluteLineLimit" value="250"/> + </properties> + </rule> + + <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"> + <properties> + <property name="searchAnnotations" value="true" /> + </properties> + </rule> + + <rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"> + <properties> + <property name="spacesCountAroundEqualsSign" value="0" /> + <property name="declareOnFirstLine" value="false" /> + <property name="linesCountBeforeDeclare" value="1" /> + <property name="linesCountAfterDeclare" value="1" /> + </properties> + </rule> + <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace"> <exclude-pattern>*/database/migrations/*</exclude-pattern> </rule> diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 00000000..49120889 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,15 @@ +includes: + - vendor/larastan/larastan/extension.neon + - vendor/nesbot/carbon/extension.neon + +parameters: + paths: + - app/ + - domain/ + - infra/ + + # Level 9 is the highest level + level: 9 + + # Enforce strict types analysis + treatPhpDocTypesAsCertain: false diff --git a/phpunit.xml b/phpunit.xml index 4ae4d979..c3216a6a 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,31 +1,62 @@ <?xml version="1.0" encoding="UTF-8"?> -<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" - bootstrap="vendor/autoload.php" - colors="true" -> - <testsuites> - <testsuite name="Unit"> - <directory suffix="Test.php">./tests/Unit</directory> - </testsuite> - <testsuite name="Feature"> - <directory suffix="Test.php">./tests/Feature</directory> - </testsuite> - </testsuites> - <coverage processUncoveredFiles="true"> - <include> - <directory suffix=".php">./app</directory> - </include> - </coverage> - <php> - <server name="APP_ENV" value="testing"/> - <server name="BCRYPT_ROUNDS" value="4"/> - <server name="CACHE_DRIVER" value="array"/> - <!-- <server name="DB_CONNECTION" value="sqlite"/> --> - <!-- <server name="DB_DATABASE" value=":memory:"/> --> - <server name="MAIL_MAILER" value="array"/> - <server name="QUEUE_CONNECTION" value="sync"/> - <server name="SESSION_DRIVER" value="array"/> - <server name="TELESCOPE_ENABLED" value="false"/> - </php> +<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.5/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true"> + <testsuites> + <testsuite name="Architecture"> + <directory suffix="Test.php">./tests/Architecture</directory> + </testsuite> + <testsuite name="Feature"> + <directory suffix="Test.php">./tests/Feature</directory> + </testsuite> + <testsuite name="IntegrationStandalones"> + <directory suffix="Test.php">./tests/Integration/Standalones</directory> + </testsuite> + <testsuite name="IntegrationWithApp"> + <directory suffix="Test.php">./tests/Integration/WithApp</directory> + </testsuite> + <testsuite name="Unit"> + <directory suffix="Test.php">./tests/Unit</directory> + </testsuite> + </testsuites> + <php> + <ini name="memory_limit" value="-1"/> + <env name="APP_ENV" value="testing"/> + <env name="BCRYPT_ROUNDS" value="4"/> + <env name="CACHE_DRIVER" value="array"/> + <env name="CACHE_STORE" value="array"/> + <env name="DB_CONNECTION" value="mysql"/> + <!-- <env name="DB_DATABASE" value="testing_db"/> --> + <env name="MAIL_MAILER" value="array"/> + <env name="QUEUE_CONNECTION" value="sync"/> + <env name="SESSION_DRIVER" value="array"/> + <env name="TELESCOPE_ENABLED" value="false"/> + + <env name="CRM_ENDPOINT" value="http://fake-url.com"/> + <env name="CRM_TOKEN" value="fake-token"/> + <env name="CRM_PASSWORD" value="fake-password"/> + + <env name="ARCADIA_API_ENDPOINT" value="https://fake-arcadia-api.local"/> + <env name="ARCADIA_API_APIKEY" value="fake-key"/> + <env name="ARCADIA_API_SECRET" value="fake-secret"/> + </php> + <source> + <include> + <directory suffix=".php">./app</directory> + <directory suffix=".php">./domain</directory> + <directory suffix=".php">./infra</directory> + <directory suffix=".php">./shared</directory> + </include> + <exclude> + <directory suffix=".php">./config</directory> + <directory suffix=".php">./database/migrations</directory> + <directory suffix=".php">./routes</directory> + <directory suffix=".php">./database/factories</directory> + <directory suffix=".php">./database/seeders</directory> + </exclude> + </source> + <coverage> + <report> + <clover outputFile="coverage/clover.xml"/> + <html outputDirectory="coverage/html"/> + </report> + </coverage> </phpunit> diff --git a/pint.json b/pint.json new file mode 100644 index 00000000..d270a744 --- /dev/null +++ b/pint.json @@ -0,0 +1,77 @@ +{ + "preset": "laravel", + "rules": { + "indentation_type": true, + "single_line_empty_body": false, + "types_spaces": { + "space": "single", + "space_multiple_catch": "single" + }, + "control_structure_braces": true, + "new_with_parentheses": { + "anonymous_class": true, + "named_class": true + }, + "class_definition": { + "single_item_single_line": false, + "single_line": false, + "space_before_parenthesis": true + }, + "curly_braces_position": { + "allow_single_line_empty_anonymous_classes": false, + "classes_opening_brace": "next_line_unless_newline_at_signature_end", + "anonymous_classes_opening_brace": "next_line_unless_newline_at_signature_end", + "control_structures_opening_brace": "same_line", + "functions_opening_brace": "next_line_unless_newline_at_signature_end", + "anonymous_functions_opening_brace": "same_line" + }, + "binary_operator_spaces": { + "default": "align_single_space_minimal", + "operators": { + "=": "align_single_space", + "|": "single_space", + "=>": "align_single_space", + ".=": "align_single_space" + } + }, + "concat_space": { + "spacing": "one" + }, + "align_multiline_comment": { + "comment_type": "all_multiline" + }, + "array_indentation": true, + "method_chaining_indentation": true, + "statement_indentation": { + "stick_comment_to_next_continuous_control_statement": true + }, + "no_unused_imports": true, + "fully_qualified_strict_types": { + "import_symbols": true, + "leading_backslash_in_global_namespace": true, + "phpdoc_tags": [] + }, + "visibility_required": { + "elements": [ + "const", + "method", + "property" + ] + }, + "no_useless_else": true, + "function_declaration": { + "closure_function_spacing": "one", + "closure_fn_spacing": "one", + "trailing_comma_single_line": false + }, + "single_line_after_imports": true, + "combine_consecutive_issets": true, + "array_syntax": { + "syntax": "short" + }, + "single_quote": true, + "blank_line_after_namespace": true, + "blank_line_after_opening_tag": true, + "declare_strict_types": true + } +} diff --git a/public/favicon.ico b/public/favicon.ico index e69de29b..ab38ae9d 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/index.php b/public/index.php index a8137b13..1788c6f9 100644 --- a/public/index.php +++ b/public/index.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + use Illuminate\Contracts\Http\Kernel; use Illuminate\Http\Request; @@ -14,10 +16,10 @@ define('LARAVEL_START', microtime(true)); | will require this file so that any prerendered template can be shown | instead of starting the framework, which could cause an exception. | -*/ + */ -if (file_exists(__DIR__.'/../storage/framework/maintenance.php')) { - require __DIR__.'/../storage/framework/maintenance.php'; +if (file_exists(__DIR__ . '/../storage/framework/maintenance.php')) { + require __DIR__ . '/../storage/framework/maintenance.php'; } /* @@ -29,9 +31,9 @@ if (file_exists(__DIR__.'/../storage/framework/maintenance.php')) { | this application. We just need to utilize it! We'll simply require it | into the script here so we don't need to manually load our classes. | -*/ + */ -require __DIR__.'/../vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; /* |-------------------------------------------------------------------------- @@ -42,9 +44,9 @@ require __DIR__.'/../vendor/autoload.php'; | the application's HTTP kernel. Then, we will send the response back | to this client's browser, allowing them to enjoy our application. | -*/ + */ -$app = require_once __DIR__.'/../bootstrap/app.php'; +$app = require_once __DIR__ . '/../bootstrap/app.php'; $kernel = $app->make(Kernel::class); diff --git a/rector.php b/rector.php new file mode 100644 index 00000000..42edab17 --- /dev/null +++ b/rector.php @@ -0,0 +1,34 @@ +<?php + +declare(strict_types=1); + +use Rector\Config\RectorConfig; +use RectorLaravel\Set\LaravelLevelSetList; +use RectorLaravel\Set\LaravelSetList; +use RectorLaravel\Set\LaravelSetProvider; + +return RectorConfig::configure() + ->withSetProviders(LaravelSetProvider::class) + ->withPaths([ + __DIR__ . '/app', + __DIR__ . '/bootstrap', + __DIR__ . '/config', + __DIR__ . '/public', + __DIR__ . '/resources', + __DIR__ . '/routes', + __DIR__ . '/tests', + ]) + ->withPhpSets() + ->withComposerBased(laravel: true) + ->withSets([ + LaravelLevelSetList::UP_TO_LARAVEL_130, + LaravelSetList::LARAVEL_CODE_QUALITY, + LaravelSetList::LARAVEL_COLLECTION, + LaravelSetList::LARAVEL_IF_HELPERS, + LaravelSetList::LARAVEL_LEGACY_FACTORIES_TO_CLASSES, + LaravelSetList::LARAVEL_TYPE_DECLARATIONS, + LaravelSetList::LARAVEL_ELOQUENT_MAGIC_METHOD_TO_QUERY_BUILDER, + ]) + ->withTypeCoverageLevel(0) + ->withDeadCodeLevel(0) + ->withCodeQualityLevel(0); diff --git a/resources/assets/fonts/Barlow-Black.woff b/resources/assets/fonts/Barlow-Black.woff new file mode 100644 index 00000000..abe07f60 Binary files /dev/null and b/resources/assets/fonts/Barlow-Black.woff differ diff --git a/resources/assets/fonts/Barlow-Black.woff2 b/resources/assets/fonts/Barlow-Black.woff2 new file mode 100644 index 00000000..ce56e2fc Binary files /dev/null and b/resources/assets/fonts/Barlow-Black.woff2 differ diff --git a/resources/assets/fonts/Barlow-BlackItalic.woff b/resources/assets/fonts/Barlow-BlackItalic.woff new file mode 100644 index 00000000..22280c39 Binary files /dev/null and b/resources/assets/fonts/Barlow-BlackItalic.woff differ diff --git a/resources/assets/fonts/Barlow-BlackItalic.woff2 b/resources/assets/fonts/Barlow-BlackItalic.woff2 new file mode 100644 index 00000000..2df9c3a9 Binary files /dev/null and b/resources/assets/fonts/Barlow-BlackItalic.woff2 differ diff --git a/resources/assets/fonts/Barlow-Bold.woff b/resources/assets/fonts/Barlow-Bold.woff new file mode 100644 index 00000000..5c94beec Binary files /dev/null and b/resources/assets/fonts/Barlow-Bold.woff differ diff --git a/resources/assets/fonts/Barlow-Bold.woff2 b/resources/assets/fonts/Barlow-Bold.woff2 new file mode 100644 index 00000000..514a7cf8 Binary files /dev/null and b/resources/assets/fonts/Barlow-Bold.woff2 differ diff --git a/resources/assets/fonts/Barlow-BoldItalic.woff b/resources/assets/fonts/Barlow-BoldItalic.woff new file mode 100644 index 00000000..3bd49993 Binary files /dev/null and b/resources/assets/fonts/Barlow-BoldItalic.woff differ diff --git a/resources/assets/fonts/Barlow-BoldItalic.woff2 b/resources/assets/fonts/Barlow-BoldItalic.woff2 new file mode 100644 index 00000000..d8b00211 Binary files /dev/null and b/resources/assets/fonts/Barlow-BoldItalic.woff2 differ diff --git a/resources/assets/fonts/Barlow-ExtraBold.woff b/resources/assets/fonts/Barlow-ExtraBold.woff new file mode 100644 index 00000000..370fdfa0 Binary files /dev/null and b/resources/assets/fonts/Barlow-ExtraBold.woff differ diff --git a/resources/assets/fonts/Barlow-ExtraBold.woff2 b/resources/assets/fonts/Barlow-ExtraBold.woff2 new file mode 100644 index 00000000..a6b73653 Binary files /dev/null and b/resources/assets/fonts/Barlow-ExtraBold.woff2 differ diff --git a/resources/assets/fonts/Barlow-ExtraBoldItalic.woff b/resources/assets/fonts/Barlow-ExtraBoldItalic.woff new file mode 100644 index 00000000..90a155aa Binary files /dev/null and b/resources/assets/fonts/Barlow-ExtraBoldItalic.woff differ diff --git a/resources/assets/fonts/Barlow-ExtraBoldItalic.woff2 b/resources/assets/fonts/Barlow-ExtraBoldItalic.woff2 new file mode 100644 index 00000000..75370d93 Binary files /dev/null and b/resources/assets/fonts/Barlow-ExtraBoldItalic.woff2 differ diff --git a/resources/assets/fonts/Barlow-ExtraLight.woff b/resources/assets/fonts/Barlow-ExtraLight.woff new file mode 100644 index 00000000..3821bf53 Binary files /dev/null and b/resources/assets/fonts/Barlow-ExtraLight.woff differ diff --git a/resources/assets/fonts/Barlow-ExtraLight.woff2 b/resources/assets/fonts/Barlow-ExtraLight.woff2 new file mode 100644 index 00000000..bf2cb8f3 Binary files /dev/null and b/resources/assets/fonts/Barlow-ExtraLight.woff2 differ diff --git a/resources/assets/fonts/Barlow-ExtraLightItalic.woff b/resources/assets/fonts/Barlow-ExtraLightItalic.woff new file mode 100644 index 00000000..0572518f Binary files /dev/null and b/resources/assets/fonts/Barlow-ExtraLightItalic.woff differ diff --git a/resources/assets/fonts/Barlow-ExtraLightItalic.woff2 b/resources/assets/fonts/Barlow-ExtraLightItalic.woff2 new file mode 100644 index 00000000..5510fb34 Binary files /dev/null and b/resources/assets/fonts/Barlow-ExtraLightItalic.woff2 differ diff --git a/resources/assets/fonts/Barlow-Italic.woff b/resources/assets/fonts/Barlow-Italic.woff new file mode 100644 index 00000000..5e960794 Binary files /dev/null and b/resources/assets/fonts/Barlow-Italic.woff differ diff --git a/resources/assets/fonts/Barlow-Italic.woff2 b/resources/assets/fonts/Barlow-Italic.woff2 new file mode 100644 index 00000000..c28507bd Binary files /dev/null and b/resources/assets/fonts/Barlow-Italic.woff2 differ diff --git a/resources/assets/fonts/Barlow-Light.woff b/resources/assets/fonts/Barlow-Light.woff new file mode 100644 index 00000000..afb04e1a Binary files /dev/null and b/resources/assets/fonts/Barlow-Light.woff differ diff --git a/resources/assets/fonts/Barlow-Light.woff2 b/resources/assets/fonts/Barlow-Light.woff2 new file mode 100644 index 00000000..f2b1bf17 Binary files /dev/null and b/resources/assets/fonts/Barlow-Light.woff2 differ diff --git a/resources/assets/fonts/Barlow-LightItalic.woff b/resources/assets/fonts/Barlow-LightItalic.woff new file mode 100644 index 00000000..106e1668 Binary files /dev/null and b/resources/assets/fonts/Barlow-LightItalic.woff differ diff --git a/resources/assets/fonts/Barlow-LightItalic.woff2 b/resources/assets/fonts/Barlow-LightItalic.woff2 new file mode 100644 index 00000000..2c7df9c0 Binary files /dev/null and b/resources/assets/fonts/Barlow-LightItalic.woff2 differ diff --git a/resources/assets/fonts/Barlow-Medium.woff b/resources/assets/fonts/Barlow-Medium.woff new file mode 100644 index 00000000..38f5fc2f Binary files /dev/null and b/resources/assets/fonts/Barlow-Medium.woff differ diff --git a/resources/assets/fonts/Barlow-Medium.woff2 b/resources/assets/fonts/Barlow-Medium.woff2 new file mode 100644 index 00000000..cd925338 Binary files /dev/null and b/resources/assets/fonts/Barlow-Medium.woff2 differ diff --git a/resources/assets/fonts/Barlow-MediumItalic.woff b/resources/assets/fonts/Barlow-MediumItalic.woff new file mode 100644 index 00000000..ee0be6cc Binary files /dev/null and b/resources/assets/fonts/Barlow-MediumItalic.woff differ diff --git a/resources/assets/fonts/Barlow-MediumItalic.woff2 b/resources/assets/fonts/Barlow-MediumItalic.woff2 new file mode 100644 index 00000000..d792bfc4 Binary files /dev/null and b/resources/assets/fonts/Barlow-MediumItalic.woff2 differ diff --git a/resources/assets/fonts/Barlow-Regular.woff b/resources/assets/fonts/Barlow-Regular.woff new file mode 100644 index 00000000..e7564755 Binary files /dev/null and b/resources/assets/fonts/Barlow-Regular.woff differ diff --git a/resources/assets/fonts/Barlow-Regular.woff2 b/resources/assets/fonts/Barlow-Regular.woff2 new file mode 100644 index 00000000..2e301122 Binary files /dev/null and b/resources/assets/fonts/Barlow-Regular.woff2 differ diff --git a/resources/assets/fonts/Barlow-SemiBold.woff b/resources/assets/fonts/Barlow-SemiBold.woff new file mode 100644 index 00000000..66a9637e Binary files /dev/null and b/resources/assets/fonts/Barlow-SemiBold.woff differ diff --git a/resources/assets/fonts/Barlow-SemiBold.woff2 b/resources/assets/fonts/Barlow-SemiBold.woff2 new file mode 100644 index 00000000..9860e39c Binary files /dev/null and b/resources/assets/fonts/Barlow-SemiBold.woff2 differ diff --git a/resources/assets/fonts/Barlow-SemiBoldItalic.woff b/resources/assets/fonts/Barlow-SemiBoldItalic.woff new file mode 100644 index 00000000..7b924787 Binary files /dev/null and b/resources/assets/fonts/Barlow-SemiBoldItalic.woff differ diff --git a/resources/assets/fonts/Barlow-SemiBoldItalic.woff2 b/resources/assets/fonts/Barlow-SemiBoldItalic.woff2 new file mode 100644 index 00000000..884113c3 Binary files /dev/null and b/resources/assets/fonts/Barlow-SemiBoldItalic.woff2 differ diff --git a/resources/assets/fonts/Barlow-Thin.woff b/resources/assets/fonts/Barlow-Thin.woff new file mode 100644 index 00000000..af45abb4 Binary files /dev/null and b/resources/assets/fonts/Barlow-Thin.woff differ diff --git a/resources/assets/fonts/Barlow-Thin.woff2 b/resources/assets/fonts/Barlow-Thin.woff2 new file mode 100644 index 00000000..2ac96ac3 Binary files /dev/null and b/resources/assets/fonts/Barlow-Thin.woff2 differ diff --git a/resources/assets/fonts/Barlow-ThinItalic.woff b/resources/assets/fonts/Barlow-ThinItalic.woff new file mode 100644 index 00000000..c62be9e9 Binary files /dev/null and b/resources/assets/fonts/Barlow-ThinItalic.woff differ diff --git a/resources/assets/fonts/Barlow-ThinItalic.woff2 b/resources/assets/fonts/Barlow-ThinItalic.woff2 new file mode 100644 index 00000000..d7afa08f Binary files /dev/null and b/resources/assets/fonts/Barlow-ThinItalic.woff2 differ diff --git a/resources/assets/fonts/BarlowCondensed-Medium.woff b/resources/assets/fonts/BarlowCondensed-Medium.woff new file mode 100644 index 00000000..c273c661 Binary files /dev/null and b/resources/assets/fonts/BarlowCondensed-Medium.woff differ diff --git a/resources/assets/fonts/BarlowCondensed-Medium.woff2 b/resources/assets/fonts/BarlowCondensed-Medium.woff2 new file mode 100644 index 00000000..ce70445d Binary files /dev/null and b/resources/assets/fonts/BarlowCondensed-Medium.woff2 differ diff --git a/resources/assets/fonts/BarlowCondensed-SemiBold.woff b/resources/assets/fonts/BarlowCondensed-SemiBold.woff new file mode 100644 index 00000000..8beab4ef Binary files /dev/null and b/resources/assets/fonts/BarlowCondensed-SemiBold.woff differ diff --git a/resources/assets/fonts/BarlowCondensed-SemiBold.woff2 b/resources/assets/fonts/BarlowCondensed-SemiBold.woff2 new file mode 100644 index 00000000..118d4b0e Binary files /dev/null and b/resources/assets/fonts/BarlowCondensed-SemiBold.woff2 differ diff --git a/resources/views/front/sable/img/chevron_next.svg b/resources/assets/images/chevron_next.svg similarity index 100% rename from resources/views/front/sable/img/chevron_next.svg rename to resources/assets/images/chevron_next.svg diff --git a/resources/views/front/sable/img/chevron_prev.svg b/resources/assets/images/chevron_prev.svg similarity index 100% rename from resources/views/front/sable/img/chevron_prev.svg rename to resources/assets/images/chevron_prev.svg diff --git a/resources/views/front/sable/img/crosshair.svg b/resources/assets/images/crosshair.svg similarity index 100% rename from resources/views/front/sable/img/crosshair.svg rename to resources/assets/images/crosshair.svg diff --git a/resources/views/front/sable/img/eng_1.png b/resources/assets/images/eng_1.png similarity index 100% rename from resources/views/front/sable/img/eng_1.png rename to resources/assets/images/eng_1.png diff --git a/resources/views/front/sable/img/eng_2.png b/resources/assets/images/eng_2.png similarity index 100% rename from resources/views/front/sable/img/eng_2.png rename to resources/assets/images/eng_2.png diff --git a/resources/views/front/sable/img/eng_3.png b/resources/assets/images/eng_3.png similarity index 100% rename from resources/views/front/sable/img/eng_3.png rename to resources/assets/images/eng_3.png diff --git a/resources/views/front/sable/img/eng_4.png b/resources/assets/images/eng_4.png similarity index 100% rename from resources/views/front/sable/img/eng_4.png rename to resources/assets/images/eng_4.png diff --git a/resources/views/front/sable/img/form_confirm.png b/resources/assets/images/form_confirm.png similarity index 100% rename from resources/views/front/sable/img/form_confirm.png rename to resources/assets/images/form_confirm.png diff --git a/resources/views/front/sable/img/form_fail.png b/resources/assets/images/form_fail.png similarity index 100% rename from resources/views/front/sable/img/form_fail.png rename to resources/assets/images/form_fail.png diff --git a/resources/views/front/sable/img/icons/filter.png b/resources/assets/images/icons/filter.png similarity index 100% rename from resources/views/front/sable/img/icons/filter.png rename to resources/assets/images/icons/filter.png diff --git a/resources/views/front/sable/img/icons/form_fail.png b/resources/assets/images/icons/form_fail.png similarity index 100% rename from resources/views/front/sable/img/icons/form_fail.png rename to resources/assets/images/icons/form_fail.png diff --git a/resources/views/front/sable/img/icons/icon_arrow.png b/resources/assets/images/icons/icon_arrow.png similarity index 100% rename from resources/views/front/sable/img/icons/icon_arrow.png rename to resources/assets/images/icons/icon_arrow.png diff --git a/resources/views/front/sable/img/icons/icon_cart-white.png b/resources/assets/images/icons/icon_cart-white.png similarity index 100% rename from resources/views/front/sable/img/icons/icon_cart-white.png rename to resources/assets/images/icons/icon_cart-white.png diff --git a/resources/views/front/sable/img/icons/icon_cart_white.png b/resources/assets/images/icons/icon_cart_white.png similarity index 100% rename from resources/views/front/sable/img/icons/icon_cart_white.png rename to resources/assets/images/icons/icon_cart_white.png diff --git a/resources/views/front/sable/img/icons/icon_check.png b/resources/assets/images/icons/icon_check.png similarity index 100% rename from resources/views/front/sable/img/icons/icon_check.png rename to resources/assets/images/icons/icon_check.png diff --git a/resources/views/front/sable/img/icons/icon_profile.png b/resources/assets/images/icons/icon_profile.png similarity index 100% rename from resources/views/front/sable/img/icons/icon_profile.png rename to resources/assets/images/icons/icon_profile.png diff --git a/resources/views/front/sable/img/icons/icon_profile_white.png b/resources/assets/images/icons/icon_profile_white.png similarity index 100% rename from resources/views/front/sable/img/icons/icon_profile_white.png rename to resources/assets/images/icons/icon_profile_white.png diff --git a/resources/views/front/sable/img/icons/icon_search.png b/resources/assets/images/icons/icon_search.png similarity index 100% rename from resources/views/front/sable/img/icons/icon_search.png rename to resources/assets/images/icons/icon_search.png diff --git a/resources/views/front/sable/img/icons/icon_search_dark.png b/resources/assets/images/icons/icon_search_dark.png similarity index 100% rename from resources/views/front/sable/img/icons/icon_search_dark.png rename to resources/assets/images/icons/icon_search_dark.png diff --git a/resources/views/front/sable/img/icons/icon_search_orange.png b/resources/assets/images/icons/icon_search_orange.png similarity index 100% rename from resources/views/front/sable/img/icons/icon_search_orange.png rename to resources/assets/images/icons/icon_search_orange.png diff --git a/resources/views/front/sable/img/icons/icon_search_white.png b/resources/assets/images/icons/icon_search_white.png similarity index 100% rename from resources/views/front/sable/img/icons/icon_search_white.png rename to resources/assets/images/icons/icon_search_white.png diff --git a/resources/views/front/sable/img/icons/icon_tocque.png b/resources/assets/images/icons/icon_tocque.png similarity index 100% rename from resources/views/front/sable/img/icons/icon_tocque.png rename to resources/assets/images/icons/icon_tocque.png diff --git a/resources/views/front/sable/img/icons/step_1.png b/resources/assets/images/icons/step_1.png similarity index 100% rename from resources/views/front/sable/img/icons/step_1.png rename to resources/assets/images/icons/step_1.png diff --git a/resources/assets/images/icons/step_2.png b/resources/assets/images/icons/step_2.png new file mode 100644 index 00000000..8c73f40f Binary files /dev/null and b/resources/assets/images/icons/step_2.png differ diff --git a/resources/views/front/sable/img/icons/step_3.png b/resources/assets/images/icons/step_3.png similarity index 100% rename from resources/views/front/sable/img/icons/step_3.png rename to resources/assets/images/icons/step_3.png diff --git a/resources/assets/images/icons/steps-arrow.png b/resources/assets/images/icons/steps-arrow.png new file mode 100644 index 00000000..f24617d3 Binary files /dev/null and b/resources/assets/images/icons/steps-arrow.png differ diff --git a/resources/views/front/sable/img/logo.png b/resources/assets/images/logo.png similarity index 100% rename from resources/views/front/sable/img/logo.png rename to resources/assets/images/logo.png diff --git a/resources/views/front/sable/img/loyalty.svg b/resources/assets/images/loyalty.svg similarity index 100% rename from resources/views/front/sable/img/loyalty.svg rename to resources/assets/images/loyalty.svg diff --git a/resources/views/front/sable/img/nutriscore/nutriscore-A.png b/resources/assets/images/nutriscore/nutriscore-A.png similarity index 100% rename from resources/views/front/sable/img/nutriscore/nutriscore-A.png rename to resources/assets/images/nutriscore/nutriscore-A.png diff --git a/resources/views/front/sable/img/nutriscore/nutriscore-B.png b/resources/assets/images/nutriscore/nutriscore-B.png similarity index 100% rename from resources/views/front/sable/img/nutriscore/nutriscore-B.png rename to resources/assets/images/nutriscore/nutriscore-B.png diff --git a/resources/views/front/sable/img/nutriscore/nutriscore-C.png b/resources/assets/images/nutriscore/nutriscore-C.png similarity index 100% rename from resources/views/front/sable/img/nutriscore/nutriscore-C.png rename to resources/assets/images/nutriscore/nutriscore-C.png diff --git a/resources/views/front/sable/img/nutriscore/nutriscore-D.png b/resources/assets/images/nutriscore/nutriscore-D.png similarity index 100% rename from resources/views/front/sable/img/nutriscore/nutriscore-D.png rename to resources/assets/images/nutriscore/nutriscore-D.png diff --git a/resources/views/front/sable/img/nutriscore/nutriscore-E.png b/resources/assets/images/nutriscore/nutriscore-E.png similarity index 100% rename from resources/views/front/sable/img/nutriscore/nutriscore-E.png rename to resources/assets/images/nutriscore/nutriscore-E.png diff --git a/resources/views/front/sable/img/order-step-active.svg b/resources/assets/images/order-step-active.svg similarity index 100% rename from resources/views/front/sable/img/order-step-active.svg rename to resources/assets/images/order-step-active.svg diff --git a/resources/views/front/sable/img/order-step-done.svg b/resources/assets/images/order-step-done.svg similarity index 100% rename from resources/views/front/sable/img/order-step-done.svg rename to resources/assets/images/order-step-done.svg diff --git a/resources/views/front/sable/img/order-step-inactive.svg b/resources/assets/images/order-step-inactive.svg similarity index 100% rename from resources/views/front/sable/img/order-step-inactive.svg rename to resources/assets/images/order-step-inactive.svg diff --git a/resources/views/front/sable/img/pl_nophoto.png b/resources/assets/images/pl_nophoto.png similarity index 100% rename from resources/views/front/sable/img/pl_nophoto.png rename to resources/assets/images/pl_nophoto.png diff --git a/resources/views/front/sable/img/pointer.svg b/resources/assets/images/pointer.svg similarity index 100% rename from resources/views/front/sable/img/pointer.svg rename to resources/assets/images/pointer.svg diff --git a/resources/views/front/sable/img/product_lists_filler.jpg b/resources/assets/images/product_lists_filler.jpg similarity index 100% rename from resources/views/front/sable/img/product_lists_filler.jpg rename to resources/assets/images/product_lists_filler.jpg diff --git a/resources/views/front/sable/img/step_1.png b/resources/assets/images/step_1.png similarity index 100% rename from resources/views/front/sable/img/step_1.png rename to resources/assets/images/step_1.png diff --git a/resources/views/front/sable/img/step_2.png b/resources/assets/images/step_2.png similarity index 100% rename from resources/views/front/sable/img/step_2.png rename to resources/assets/images/step_2.png diff --git a/resources/views/front/sable/img/step_3.png b/resources/assets/images/step_3.png similarity index 100% rename from resources/views/front/sable/img/step_3.png rename to resources/assets/images/step_3.png diff --git a/resources/views/front/sable/img/step_4.png b/resources/assets/images/step_4.png similarity index 100% rename from resources/views/front/sable/img/step_4.png rename to resources/assets/images/step_4.png diff --git a/resources/views/front/sable/img/svg/chevron_down.svg b/resources/assets/images/svg/chevron_down.svg similarity index 100% rename from resources/views/front/sable/img/svg/chevron_down.svg rename to resources/assets/images/svg/chevron_down.svg diff --git a/resources/views/front/sable/img/svg/chevron_next.svg b/resources/assets/images/svg/chevron_next.svg similarity index 100% rename from resources/views/front/sable/img/svg/chevron_next.svg rename to resources/assets/images/svg/chevron_next.svg diff --git a/resources/views/front/sable/img/svg/chevron_prev.svg b/resources/assets/images/svg/chevron_prev.svg similarity index 100% rename from resources/views/front/sable/img/svg/chevron_prev.svg rename to resources/assets/images/svg/chevron_prev.svg diff --git a/resources/views/front/sable/img/svg/chevron_up.svg b/resources/assets/images/svg/chevron_up.svg similarity index 100% rename from resources/views/front/sable/img/svg/chevron_up.svg rename to resources/assets/images/svg/chevron_up.svg diff --git a/resources/assets/images/svg/close.svg b/resources/assets/images/svg/close.svg new file mode 100644 index 00000000..5a3b4fdf --- /dev/null +++ b/resources/assets/images/svg/close.svg @@ -0,0 +1,7 @@ +<?xml version="1.0" ?> +<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'> +<svg id="Layer_1" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" xml:space="preserve" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink"> + <path d="M443.6,387.1L312.4,255.4l131.5-130c5.4-5.4,5.4-14.2,0-19.6l-37.4-37.6c-2.6-2.6-6.1-4-9.8-4c-3.7,0-7.2,1.5-9.8,4 L256,197.8L124.9,68.3c-2.6-2.6-6.1-4-9.8-4c-3.7,0-7.2,1.5-9.8,4L68,105.9c-5.4,5.4-5.4,14.2,0,19.6l131.5,130L68.4,387.1 c-2.6,2.6-4.1,6.1-4.1,9.8c0,3.7,1.4,7.2,4.1,9.8l37.4,37.6c2.7,2.7,6.2,4.1,9.8,4.1c3.5,0,7.1-1.3,9.8-4.1L256,313.1l130.7,131.1 c2.7,2.7,6.2,4.1,9.8,4.1c3.5,0,7.1-1.3,9.8-4.1l37.4-37.6c2.6-2.6,4.1-6.1,4.1-9.8C447.7,393.2,446.2,389.7,443.6,387.1z" /> +</svg> diff --git a/resources/views/front/sable/img/svg/crosshair.svg b/resources/assets/images/svg/crosshair.svg similarity index 100% rename from resources/views/front/sable/img/svg/crosshair.svg rename to resources/assets/images/svg/crosshair.svg diff --git a/resources/views/front/sable/img/svg/loyalty.svg b/resources/assets/images/svg/loyalty.svg similarity index 100% rename from resources/views/front/sable/img/svg/loyalty.svg rename to resources/assets/images/svg/loyalty.svg diff --git a/resources/views/front/sable/img/svg/order-step-active.svg b/resources/assets/images/svg/order-step-active.svg similarity index 100% rename from resources/views/front/sable/img/svg/order-step-active.svg rename to resources/assets/images/svg/order-step-active.svg diff --git a/resources/views/front/sable/img/svg/order-step-done.svg b/resources/assets/images/svg/order-step-done.svg similarity index 100% rename from resources/views/front/sable/img/svg/order-step-done.svg rename to resources/assets/images/svg/order-step-done.svg diff --git a/resources/views/front/sable/img/svg/order-step-inactive.svg b/resources/assets/images/svg/order-step-inactive.svg similarity index 100% rename from resources/views/front/sable/img/svg/order-step-inactive.svg rename to resources/assets/images/svg/order-step-inactive.svg diff --git a/resources/assets/images/svg/orders.svg b/resources/assets/images/svg/orders.svg new file mode 100644 index 00000000..53511276 --- /dev/null +++ b/resources/assets/images/svg/orders.svg @@ -0,0 +1,15 @@ +<?xml version="1.0" ?> +<svg id="Layer_1" data-name="Layer 1" viewBox="0 0 64 64" + xmlns="http://www.w3.org/2000/svg"> + <title /> + <path style="fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:2px" d="M46.922,15H41v1.141a.86.86,0,0,1-.859.859H24.859A.86.86,0,0,1,24,16.141V15H18.078A2.052,2.052,0,0,0,16,17.026V51.974A2.052,2.052,0,0,0,18.078,54H46.922A2.052,2.052,0,0,0,49,51.974V17.026A2.052,2.052,0,0,0,46.922,15Z" /> + <path style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:2px" d="M39.984,13H35v-.372a2.529,2.529,0,0,0-1.88-2.488A2.491,2.491,0,0,0,30,12.511V13H25.016A1.016,1.016,0,0,0,24,14.016v1.968A1.016,1.016,0,0,0,25.016,17H39.984A1.016,1.016,0,0,0,41,15.984V14.016A1.016,1.016,0,0,0,39.984,13Z" /> + <path style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:2px" d="M25,24H43" /> + <polyline style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:2px" points="19 23 20 24 23 20" /> + <path style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:2px" d="M25,32H43" /> + <polyline style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:2px" points="19 31 20 32 23 28" /> + <path style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:2px" d="M25,40H43" /> + <polyline style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:2px" points="19 39 20 40 23 36" /> + <path style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:2px" d="M25,48H43" /> + <polyline style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:2px" points="19 47 20 48 23 44" /> +</svg> diff --git a/resources/favicon/apple-touch-icon.png b/resources/favicon/apple-touch-icon.png new file mode 100644 index 00000000..81aebea9 Binary files /dev/null and b/resources/favicon/apple-touch-icon.png differ diff --git a/resources/favicon/favicon-96x96.png b/resources/favicon/favicon-96x96.png new file mode 100644 index 00000000..ade8760e Binary files /dev/null and b/resources/favicon/favicon-96x96.png differ diff --git a/resources/favicon/favicon.ico b/resources/favicon/favicon.ico new file mode 100644 index 00000000..ab38ae9d Binary files /dev/null and b/resources/favicon/favicon.ico differ diff --git a/resources/favicon/favicon.svg b/resources/favicon/favicon.svg new file mode 100644 index 00000000..ec4433c5 --- /dev/null +++ b/resources/favicon/favicon.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="1000" height="1000"><g clip-path="url(#SvgjsClipPath1081)"><rect width="1000" height="1000" fill="#ffffff"></rect><g transform="matrix(5.625,0,0,5.625,50,50)"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="160" height="160" viewBox="0 0 160 160"><image width="160" height="160" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAACgCAYAAACLz2ctAAAAxHpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjabVBbDsMgDPvnFDsCiVMex6FrJ+0GO/4MpFU7zQiTOMiEhP3zfoVHh4oFW3JJNaVIWLWqjUGJE22wRBt8kUZ+08NZUErgiZmW5PcPXU6DeTRGy8WoPL2w3gvV3L/8GPlD6B0pg82NqhtBZ0HcoHmrqZZ8/cK6xzvK3KET8vA+TX5zy5zetlCE6g5BJANpNoC+U0BjYGRB5kXhasxBVhwz4UD+zelA+AJm+VlyFQkGKgAAAYZpQ0NQSUNDIHByb2ZpbGUAAHicfZG/S8NAHMVf04o/qIjYQcQhQxUEu6iIY6liESyUtkKrDiaX/oImDUmKi6PgWnDwx2LVwcVZVwdXQRD8AeIfIE6KLlLi95JCixgPjvvw7t7j7h0gNCpMNQNRQNUsIxWPidncqtj9igAG0YsJ+CRm6on0Ygae4+sePr7eRXiW97k/R7+SNxngE4mjTDcs4g3i2U1L57xPHGIlSSE+J5406ILEj1yXXX7jXHRY4JkhI5OaJw4Ri8UOljuYlQyVeIY4rKga5QtZlxXOW5zVSo217slfGMxrK2mu0xxFHEtIIAkRMmooowILEVo1UkykaD/m4R9x/ElyyeQqg5FjAVWokBw/+B/87tYsTE+5ScEY0PVi2x9jQPcu0Kzb9vexbTdPAP8zcKW1/dUGMPdJer2thY+AgW3g4rqtyXvA5Q4w/KRLhuRIfppCoQC8n9E35YChW6Bvze2ttY/TByBDXS3fAAeHwHiRstc93t3T2du/Z1r9/QB27nKoWDspYQAADsppVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDQuNC4wLUV4aXYyIj4KIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIgogICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgIHhtbG5zOkdJTVA9Imh0dHA6Ly93d3cuZ2ltcC5vcmcveG1wLyIKICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIgogICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjhmZjk1ZjM1LTA1MDctOWY0Zi04N2Q5LTQzYzc0MjQyNzczYSIKICAgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozMDExYzNhNS03NTdmLTQ4ZmQtYTQ2OS02NjY4ZjlmNjNmZDIiCiAgIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo4ZmY5NWYzNS0wNTA3LTlmNGYtODdkOS00M2M3NDI0Mjc3M2EiCiAgIEdJTVA6QVBJPSIyLjAiCiAgIEdJTVA6UGxhdGZvcm09IldpbmRvd3MiCiAgIEdJTVA6VGltZVN0YW1wPSIxNzc2NDE5MDAwOTA2MjI1IgogICBHSU1QOlZlcnNpb249IjIuMTAuMzYiCiAgIGRjOkZvcm1hdD0iaW1hZ2UvcG5nIgogICBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIgogICB0aWZmOk9yaWVudGF0aW9uPSIxIgogICB4bXA6Q3JlYXRlRGF0ZT0iMjAyMi0xMC0xOVQxNDoyNzoyMiswMjowMCIKICAgeG1wOkNyZWF0b3JUb29sPSJHSU1QIDIuMTAiCiAgIHhtcDpNZXRhZGF0YURhdGU9IjIwMjY6MDQ6MTdUMTE6NDM6MjArMDI6MDAiCiAgIHhtcDpNb2RpZnlEYXRlPSIyMDI2OjA0OjE3VDExOjQzOjIwKzAyOjAwIj4KICAgPHhtcE1NOkhpc3Rvcnk+CiAgICA8cmRmOlNlcT4KICAgICA8cmRmOmxpCiAgICAgIHN0RXZ0OmFjdGlvbj0iY3JlYXRlZCIKICAgICAgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDo4ZmY5NWYzNS0wNTA3LTlmNGYtODdkOS00M2M3NDI0Mjc3M2EiCiAgICAgIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCAyMy41IChXaW5kb3dzKSIKICAgICAgc3RFdnQ6d2hlbj0iMjAyMi0xMC0xOVQxNDoyNzoyMiswMjowMCIvPgogICAgIDxyZGY6bGkKICAgICAgc3RFdnQ6YWN0aW9uPSJzYXZlZCIKICAgICAgc3RFdnQ6Y2hhbmdlZD0iLyIKICAgICAgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDpmZTgwOTY3Yi02ZmMzLTQzOWYtYjNjMy0wYzA1NzEzMjFhMDkiCiAgICAgIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkdpbXAgMi4xMCAoV2luZG93cykiCiAgICAgIHN0RXZ0OndoZW49IjIwMjYtMDQtMTdUMTE6NDM6MjAiLz4KICAgIDwvcmRmOlNlcT4KICAgPC94bXBNTTpIaXN0b3J5PgogIDwvcmRmOkRlc2NyaXB0aW9uPgogPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIAo8P3hwYWNrZXQgZW5kPSJ3Ij8+UI77iQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB+oEEQkrFAVVFuUAACAASURBVHja7V13eBTV2v9tsumV0ENRI0XgBvSiIt7LFREpgggalBaKGiUgIgiIIOVqkCIllBAgREDF3vgUFC7XckUg9BpqSCAhZZPdzZZs332/P2aS7OzMJptkd7PBeZ9nnmTOnjltfvPWUyRERPBRkslkuHDhAn759VcsS0lxa9n9+vXDhAkT8MADD6Bbt24IDw/HnU5WqxVXrlzBmTNnkZeXi4ULF7q9jtTVq/Fwnz7o0q0bmjdvXmt+/6VLly711QHz9/eHzWZDeFgYevXqBZVKhcLCwgaV2a5dOyQnJ2Po0KHo0qULOnXqhGbNmuGvQH5+fvD394dCoUBoaCh69uyJ0tIyyGSyBpUb06IFkpKS8Morr+C+Hj3QJjYWrVq0gL9UWuuzEl/mgO4k+25KJBKIxB2X+o4JETVoPP8yABTJR7myOAQiiQAUSQSgSCKJABRJBKBIIokAFEkEoEgiiQAUSQSgSCKJABRJBKBIIokAFEkEoEgiiQAUSQSgSCK5g6TiEDQ9stlsKJHJoNfrERwSgqDQUISFhSHY31/kgCJ5lnRaHb764mvEtm2Le+Pi0K5tW7SIikKIVIqJCxfCKgJQJE9SYFAgZLJSwd8+fv99JH+wCgUAzE2kP+KU/CZIRSUliG3TpuZMCQnIWr8eD8fGigBsTDKbzbDZbAgKCrqj+uXSQqDevXFx3z50b9VKFMHepnKVGp988jHCAzuhWat4ZH64C0a98Y7p37gXp3Du+/Z6GN3ienAznTyJHq1bY9O2bb7bEbqDyGAwkEqlovPnz9NTTw0lAJwrKenVO6avx8+eJ7RpWdU32rCJKDWN1+fKa8O2bT7ZjzsCgCaTiZ5++mmng29/mUymOwKARQoFJS7+d1W/FvTvTwlDBtfY9xWpqSIA3U1KpZImTBjvEvgAkEqlalL9MxrNpNFoyGw2V6eZzbTv4C+EHj1d7nflVWFXjgjABnK9sc+PdTrQ0aF3U6f2cbx0rVbbJPpXVlZGY8cl1hlgtV0nL1wQAdhg8VNUTI/3e9zpII8Y8TQVF8vo1KkzfA5QUeHTfbPZbHT4cBbF94x3O/gA0IuTJpGhQicCsL60bVuG4MCOHPkslckV/A465NPpdT7bN7lcWSuAJk2ZTC8lJfHS56ek0O85Nwhja1dHfv/mSxGA9aGdO3cKDmifR/qQ0ShsXDjm1ev1Ptm30tJSeuCBh2sETiprRBj0Bgps04rzWyXdNppoyc8HKGrECOdc8LGHRQDWnfNtq/GlOO1gEwDgzp27BPuWlJREZWVywWcef2xQdd4ucYJ5Mnd95BSEIgDrQFu3bhUcxE2bNtXeQUcRrPMtEbx8+XLBvq1fv6HG5yJbxnDyW602wXxpW7YIA9BmEwHoCqWlpTl5Qetd66DDcxqN7wDQZLLw2jdlymSyWKx17tfzY8eQ2WIRzPvRxx/z8pcUFIgArI20Wq0g+LZs2eLS81arlfesWqP2mf4tWLCA1z5XGZPQuFy+ct1p/v5PDuTkTRw/ngw+IA18GoBzZ8/hh5Q2bHD5ebNZAIBq3wCgUsm3eLdv3+7Ssxqthvfs2HETyGZxjt4Ro0bynnlswOMiAJ3RtWs5vAH7xz8eraOIM/kkAG02G/Xq1YvTrkWLF7n8/Pnz53n9kpXKnOb/+JNPnBojrujRfzkA2mxEQLgD+B6rcxjNaDIKALDxQ3EaDZ+DFRYWuvz8vn37HFSSrbw8N0tKaOq/UyjEBYf2oUOHRQDaU4mshDdIp06dqXM5QjpgWZmy0ft3+/ZtXrssFtdjtJ9//nnVc888PZIPcIOecO99LkdHnhg4oNG8Az45H7CoqIiX1qVLp7pPdvTzQ+8He3PSjMaKRu9faamCcz9mzHj4+7u+Psx+MuqDvR36Z7YiIjgEyLks+OzMmW9i1sw3uXMJH+kLqbRx1qf53Ko4i8WC1NRUXnpYWFi9yhv5zDM4eeJk1b2yvByxse0arX9WK2HNmjV2KTFYt25tncqIjo6q+j84OJjzW8/HBzh/sF0cVq5eiSCpP14YNwbr1n6A++7riddeexUBAQHihFQiov/8/B+eiJg5c2a9y/vqsy85ZR04cKBR+/fjnh857Tl48GCdyzh79mx1JGjt+lrdM5XXyzs/5unatkZ2SPscAB9/vD9XP3liEKlU9bdc8/O5+tbzz48mg8HQWOYVdY/rxmlPQT0cwgU386ueHzxwMClZ46y4vNw5AIeNIF+ciOZTALRY+JGBP9xgoU1Nns4p88ihI43SP51OJ2AUldW5HLm8jFPGxFem0o8njtOSj3Y5BeBtgZlCIgAd3SY6vtukpKikweWeOn2WU+YLCS80Sv8qKip4/VMqlfUohx8hGr70XcKzowTBN2DMC+Sr5FMANBgMHplAWlgo5PaweL1/QqHF+iwRMJv5Dnbc14WAED4wp0wmudl318H4lBtGaK2rO9wDoaFhgta2tykvL88t1r1UGoDly5dzEy9fBaDn5c3YuAkx0gD4KvkUAIVcAX5+fh4ptzEAOGcO1/82Y8YM+NdzQ6H58+dj+rQZTn9vM2AAfjx6FG3q6b76y7phGhIhqCn22r3H/dzIyulTXu3XqlUfcOp/+umnSaNtmHpx61YBb7wSX36ZDp0+TTdKS8lGvk+NAsArV67Q2rUb6OLFC7UC0Owm/WXv3r2ccuPj40leKveO88Vi4/Xr3LlzDS5Xr9cLGDVNa9mp1wF44cIFh4XilhoB6C6fnV6vp4SE5zhljx8zvtGMK42b5iUOHz6MU+66detEADoXhVbq1KmHQ2Rif40AVCjc90WfPXeWV77VavV4v4XcLxqNxk3gNtHo0WM4ZaelpYkAFCKTXsB9gChSqapfxujRCZzfT58+57b6hSZyLntvmcf7vXTpUoGZz+7T0HJy8njlG/UGEYCOJBTpAEBTp06tynP16hWH0NlYqnDTQmqbzSZY/82b+R7r8+Xsy7z63nlnsXs/bIGJt4vdXMcdAcDi4mKXlgkuX/4+57f/HjjotjZs3LiRV/f93Xs5XVfcUGrfvpPDoqOXPDIBICUlhdevDB/dEavRALh3316nAHRUnu1/e+qpEW5tx4YNGwW40jte4fi3b9/2yNharVaaN2+ez67/bXQAFhUVUa9eNe/mlHsj16kx4m56c9abgqLRnSG6N954w+uAkAa14dS3du1aEYBERJs3c3c2mDghkWbMmMlJ69TxXrKarYKr2TxBK1as5NXTv/9jbnH9bNiwgVNul65dvOJ3NJvN9Oxzz3Pq3rx5swjA6Oj23CA86zBNT0/n6kiTXqI3Xp/ltW3VXp/5ugA3llJOTk69y1y7di2vzHwPGjqOpFZr6r2W+o4EoJAuZE/ONh3izBzef9Bj7Vu5cpVgnX0f/VeddrDQaLQUH/83XjkJoxK8/mJHPj3SZ9dEex2AQiEjR1qzZk2NAPx77z4eU+CdcS1mB4FEKi6WkU6nI6PJSGazueoysfcqlYqysy9T//4Dec8PGvQUKeXeX4lnMBjo3liuBR4W1Mbndoj1CgCFZgILkaM4drzGeDh0JmQdN+Tq3btfo26GlJ+fLziGFRX6vxYA1WqVy0bFs88+W+NL9XToLDMz0y3ge+GFFxp9wQ8R0ZYt/J3FXnwxySshSJ8BYHGxzGUAmkwmGjt2gvNNxhWeFyFWq5UUCjm9LmAM1XRFRkdRUVFRveq0WYgUZWrKy71Nl7Nz6Nz5y3Qp+wbl5hWSQdcw11Bq6npeW99e8PZfB4B5eXl1dqvMFtiYCACdOXnGqwP0wQcfuAS+558fSwoX1nfYiKhCbyJNhYFKShV07mI2/fTTQUpP30FvvrmUho94idBxGAH/JGAkDRo6k959L4N++jmLLlzMp8ISDcnLTaTV142Dpa7ng9AXJi14BYCXL1+ql18vJWUZ77mNGzdwjizwBpnMJtJoNKTRaEiv15PJZKqzeD134RJ1+tvDbtUxBw57kQx1iCCuEviY3DUrx6cBePHixXoBUGgDx8zMXaRvIjM9LDaigkIZTZ852yM73gOg5xPnkroOLtI1a7jW/pAhQxrVUPJpABIRFRUV0rp1ayk+vjstWbK4XssYvU3vL19VRyC9SsApwiO3CaPkhIlywsRSwqQSwvhCQuRlAvYR8KST5/vR5Zxyl9u3fPkKn1gl2CQASERkNBopO/sKlZaW+jTwiopldH+fAS6Crj/h2e9p6kdy2nqE6Nscov/KiA6riI5riE5piE5riU6qiX4rIvrkTDFN+/w3wqPDnJSXQFdvuv5xOj6fnJx85wLQcRp+XbaibQq07P3ltYCtL2367hqdLSEqtRJVEJGBNUgc7G8iyieiM0R0nIiOEtERIjpERAeJ6Dsi+pCIphEVgBY841hPdzLQTZfarDeYaOhTzzT6ZpVeOS84JycHnTpxt1ez2WyunXnrw3QrvwCDho3ClfMnnOSIR8KSpZiaMAwD/haEmnurBnAYwDkA1wCoABgBBAMIBRAOIBpABIDfAewDNIAkkltKydVhaNV5HoC+AGpeD5xfUIyOHdpy0nQ6HUJCQu6s7dmio6OFloM2aQC+veAdrFi+jJeeMHEW1qxbg2bREoT6AcKrfi0A/gdYTwMqLVCRD5gyASu4D0gBSFj+5M/+HwCg8vzpCAB3A7Bf775nLzBhL9AagKTELjOfYmNb89J0ev2dB8DAoECBffKsbll07vX9/WyE6a/NwNb0NN5v3fon4tNda2vhO0UAbQPylwIFLKPTgAGfxQF4lVsH+LEAJABBAPoDqFxv3ooLwAXXgO23WObZujUQ7FzA+ftJsGPHTkyZMrkqbdWqlVi5YqX3dsPwhgjWarWIiIjgpBkMBgQFBTUp8KVtTsdr06fxf7hnOK7+sRud20U6ebIYMP0AlHwPyPcBSgAVLOACWLBJWBA6sgSJHQAlLADjWe4HwFGIlG0Fmj/OArsZgHttdmgWpkWLlyDlvXer7rdnbMdLL7905wDQYDDw2PqVK1fQpUuXJgE8s8WKd95+B6tWr+D9Nui5qfj+q3SEOH3H54GiZ4BbuUAxCwwLC6RK1U7qwPUcN0+pBGEQm78jgEDAqAaCo7jZlb8D0d0AXGXLf8Ba6w4s2ooKRISHc9KMJiMCAwLvjL1hhDjd0qXvwWg0NwGRa8PEiZN44Bv83IuQa23Y/7Uz8F0AbnYH/uwJHMsFbgIwsQBqDSCG5WKB7OXn5JLYATAYQEuWaxJw85TAPjixrK0iZcUwrLX20d+Pr6lqNdo7Z3MiiUSCxMRETtpnn32CX3/9zbfBZ7Vi4oTJ+Pyz3dwfOg/Bd19kIibMCduzZgMX4oHTl4CLjNoHEwuKKBZ4EQBCWDA5gs0edH6s7gdW74tifjNeARa9y602sR8QFsJyWAkLbBdesZ8/P4/NZrtzAAgAq1evxoMOO9YvWbLUpwG4eNG/8elnH3PSVqzeALr6E0IEzVsDcHsZ8FsP4CwYXS8KQFsALdj/A1l9zq8G4AkBkQDYqZhT1gJf/lp9HxEBrJsLZoe2IpbxBQHO7HCOkRjQeNu3eUUHrKTr16+jc+fOnDSTyYgAL+gadaUtW7YiOXkq9yNKTcObM6c5eaICkGcAJ2YB1wHYWMC1dhCzxICKJHZGhjMzwd4AiQBwL5NmAhDk8EDWt8DDDwEoZ4EPAO0B3OPa600YPRrffP2113V0r/pBHJ3RAJCdfcXnwPf555/zwLd5a2YN4CsFbkwFjs5iXCvBLPBasFwooDL+yACP7LmbU9bAgtjGit721fllF/nZ73qEzaNj3TImAAFPuNznqa9y+3vt+rU7SwQDgF7P38Fzzpx5UCpVPgXAsWPHcu5Xrd2E5FdedJL7NuPTO/8J8+KlrKiMZv6SlAWco7i1B5p9mpD4jWBBDcBUCLzxGrcFo0YCrZuzN2oAZtbIabnM5T7//e8PoGevh6ruz549C5PJdOcA0Gw2Y/z4ibz0gwd/xpgx43wGfB+sXsO5f+m1tzB31nQnjG8lcLw9cGQzIGeBEslYuhTC2g5Ceh6EOKAfIAlgWSZ7BQQyhkqYlEGgBXg4EfjGznZ7fTjw7QqW4xWyAGwJoP0eIKiPy/2OiYnB9GnVXPCjbR+h+HbxnQPAwYOfwnfffS3424ED+5C+Jd0HwLca8+bO4aRlbFzhhJ0fAPLmA/lgLgBoBlAUQJF23EtSLXYJdiK42gkCCYJZFhfIyGuJFJD4AwF+QMsAIIIAWHD6InD2F4c2fwCgK6v7XWfrbQ2g5YA69799h/bVOmDeFSgUCo+PuVdCcWq1Br/+erDGPNOSp0GtUuOtt95qFPBt2pSGeXPnctLS0jOF1TTzn8DJwUA2e9+WEbkUYjeifkDVFvAOBkf10EvtTGK7H4l1gcQAaGUDYEXRNWAat3kYNAII7MrelADIBdABQNuprMOxbhQU6O9gIN4hIriiQudSvvnz52Pz5s1eB19+QQFmzOAqVrPmpWDaVAG9z3oSuPhPJtKgY99zBEDBLJ5Y4JGfgMhl/5FUidkASCofqgShhH3ID0BYZfAX+Pp/wNH/2FsdQOY6VE9WqJSW7Z4AOqTWaxx0Ou57Cgy5QyIhkZGRLuedPn063nvvPXjLO0QETE582SG1O959d6FA7jIg+0HGuWytNjYojAs+QUMDlT65EBZUldxPYvcaJMytFECwEQhl0GUB8PpsbksOfwO0jwOgBXCS/dsRQNyXVaCtK926VVj1f++evdGiRYs7A4ChocF1yr948WKUlpZ6BYAvJ72CX37bz0mTqc4gnPcOdYBsPaNnyVh1rQ0rdgMYLNUMPsaQkFQFfSWQOLJICQAbMTNY2voBgSYAehy+xBoXlRQLPNKD/f8GGFUgDEDHl4GAmHqNQ3l5OXbsyKi6n/TyJLRt2/bOAKDQvL/Fi5egrEyBo0ePofNdfP+gVuv5WKTZYsWHmRmctIXvrkbLSIHIgOIj4GIKUMraCwJi1zn4AtmHqsWtxNE0rhSlREAzKxDDOAJzcoHHHuE25WImY6fAzFq+NtYHGDu63mNx/PhxnDxZfaxtr1696n2GiU9awe3b38u5f2bkCDRv3gx9+jyEQ8cOo2p+EUutWrXyeJveeecdh5QueG/RmwI5tcD1ZCCHBUkrgMJZSVcj+PxYkRvIgs6JB1pCDPCkBETZgOhKLzTwdDKX+82fBXTvy+qf11nrtzmA2J1AyOP1B+AR7qzudu28c6ay1wA4e/ZMruh76UWUlpaxYGsJIjU0ag3ycvKgVWsRHh7u0fZs356JVSu5LpbsG38KWL2FwI1HGQuzgtH7qsAHJ1GNKvBVBn79OdauxPGByohHsA2INgAhJgASqG4Bl7jaAZIXgQnxFQG4wFZxF4BWo1HbFPyaKH071/jz1qxorwHwuedGIjKqWqc4ffosFi3icqDwiHDcFXcXwiI8e7yUxWpFUhLX8EietRjd7hFQuouXAjnnGS5UOR8vlOV8QuG0qvsgjptFwv4g4XE/lgMG2IBIK9AGjIVTasJcB49Uv8FAx8rVDTIwM6nbA+h8jG1UPcfDYkFBfgHXAg70Tnzeq5MR9u79GcOHD3WwQr1WfRWVlsjRqg0XbCVKE1pFB/BF74kI4BKq5vJRM0adI3v3Hc/VEsDqfH4OotcBr5Wi188GBBqAzlIwkwu1GPwCcOBLexUGuPIpENoDgAHAKRbb/7oChDVs0oDQhGG5XI6YmBiPvwupN1/8/ff3EvA96REa6r1FMCDgrQXzOUkb0jIEwAdAu5dx8KoAxDBRDgTZeU8EwcdGMwSCvxLHhthYoyOCgFg/VvRasGgNF3wAkPURENoVTNRFw6rM7WY0GHyMn7aCl+a4hKLJi2AAgn6lufPmeZX7DR02HDs+3F7td5y9CDOmvSwA1LNA7hhmalPlbOQgB9HLUxj9q30yHFeLkOxhOaAfAc0ljF4HKw4cJqRwo4GYMQmI/Tvjc4SG9fm1fwmIW+gmicB1eaWmpgqeMNrkRTAA9OwZj/PnL3DdChcvoXv3+zxet0arRaTDl602EiKE1J1bTwMXfmSUfT+AWjPKf9UEAx73k9i5WvgA5IleCQH+BIRYgTgCAiXQWTUIewjA6eqsCeOAXcuB0LYsJz7NFv+PHCAorsFjYjQaMXHCRHz5NcNyx44di08//dRrePD6usjdu3fz0hJGj/FK3QqFkpcmGG2ifKDgR8bHFghQNPvXVpvolXLQyTU8HKxeIiDMBnQ0AIFmAHrkn+CCDwA2pgOhHcGE2s6x1dwzxS3gA4DJkydXgQ+A12PxXgdgfHxPTJo0hZN2KfssKir0Hq9748ZNnPt3l68RUILVQMkm5oVXsBI1DNUzmgUlqj/gENOV8BBKXO7nR0CEjTVejVBcsCDJYSXk2ElAm8ooZhHr82s7GLjrXbeMh8lkweeff85J63hXR6/iwesiGABkMhlat+auyj9yKAuP/ONhj9WZm3cTcffcXXU/auyr+PbTLQIyaTdwfgLjYzMB1BLMNCuHOQN80RvgAEBHpwvZ6X02QGoE4qRAuB8AFe55Asizm2r1+mRgfQrr87sJZqZ1KIBHVYB/pFvGRK1WIyoqimcRe3O9dqNsTSAU5Xjj9RlQlMk9Vue06dzj7Z0uiCrezVi+NpbrsVPqnU+hD3Awi4WykZ3laxfrDTcDMODIFS74AOCD9wC0Y/19BWwRrZ9xG/gAYOFCrhGTnp7u9c0CGm1vjDFjuHpf1qljGDPOM7qg0WTGz/t+4KS1adtaIGc5IPsJUDASldhVbETOdD8JT++zzyBxtHptrN8v2ga0ZIK/twvMeHQ8txWJ44HAykjYbfaKBNB8gNvGJC0tDZs2Vasks2fPxtSpU72Og0YRwQBgNlvQp89DOH36DNdS1WjcHoaTlcrRuhXXBWQm4ut/6s+AP8cxIq/S7xci4HTmGB726yy5up/EUffzJ8DfymwoFGUDoMXgBODAN9VN6DsE+DoViO3CqKP4jXW7PDINuHcxmOnODaOCggJ06NCBZw17K/rhExwwIECK77//npd+7vw5t9elVXFn1iS+OkfA+LgCFI9j/H5WVucLdPD58VhabdzPwfCQ2oBIIxBkAWBFRSEXfACwOR2I7coaHafARD06ALh7mVvABwDTXuWu7nv22dGNAr5GBSAAdOx4F39wkpMhl7tXF1y9pnqhUXy/EUhdLbD7k+pLRt8ysmpdkJ1d4VT3E450cMHHXpVul9YSINgEVOjxvkMz7n8CuP8uO9Gbw3BixK0C/KPdMhYrV67ED3bqSMeOXbBtm3vW4xARrFYrrFZr1c4KtQnYRhPBlTTvrbfxwSrurJQnBw3Fgf373FL+unWpmD17VtX9iYu30Lt7B37GnMHA+QOMqyMQoBjG/UL+dbV8ncR7YQPutgCtrAAM+P2/QP+B1dkG9gK+2Q5ExoPZ3eAPlvs9uBC4Zw6YMEjDaMeOHXjxxRcdxHE+2rVrX+eylEolzpw5g5KSEigUClRUVECj0UCn00MiYSYzSKVSREREIDw8HDExMejcuTPi4+MhlUp9B4BmswXTpk3F9u2ZPIusoUqx1WqDVMqdVKk0EKKDBIyPY82YSQf+YCYdRDBckPyFjI9KFsnX/QQjHn4ESK3A3QREmmC1miDtD+BQddarh4DOvQGUgXGAF4NZXvlwEeDfpsHjXF6uQrNmXBBv3rwZycnJtYyhFWq1GhaLBRaLBUajETdu3EDKsmX49Zdf6tyOxMREJCUloX37tggPj2p8AAKASqVBdHSk4Bc7efLkeperLFchxmHQNRZCOAeTFUDpOuDIIsbd0Yr1+9lPs3dc3VbF/fzhOL+Pz/1sQLgNiNIxKpzUguKLQNu/VWe7qy9w/QAgDQezviMH7DSr9UDL1xs8vgpFOSZMSMRPP/1YlbZhwwbMmDGjxueuXr2OUaOeQXZ2duPrgGazGTqdDgaDAVar1a2NiIqKwCaHKAUATJkyBSpV/XdNkMsd17XejVDeLPNfgeJF1bOOg8CJevBXE/g5VQyFp1oREGoDYiWA1AKUAPO5k3HwxbuANITVP8tYXHd4D2g5ucFju3PnLjRv3owDvrS0TTWCr6ioCK+88gq6du3sUfDVCkCj0YT9+/dj6NChCAwMRFhYGEJCQjBw4JP48svPUFZW5raGTH9tOtLS+NvezpgxE0Zj/danXs/J4dxnfrGT32H1OSbIb2VcLvBjndB2YpdrAPtzuB0n0iF0kQ2IkDCABDB6LrCrGgtYMBfo04d1OF8As7VaBwDtZ4GzHVa9JIuKs/0uoxOvw7Rpwjs9bN++HRKJBLGxscjIyBDMExcXh6+++gqXLl2CXC6DQqFAeXk5lEol1Go15yovL0d5eTkUSiXkMhnycm7gj0OHMHL4cI7lwt2+X6+n/PwCOn78OE2aNLnG4wdGjBhBSqV7j6EXqmf69Bl1Lkej0dLQp0bYldOHrtyq4GcseI7oBxDtBtGnIPoJRP8D0Z8gOgyyHWWvrMorkGxZYWTLiiRbVjTZspqRLasZUVZM9XWsGdHxaKJTkUQXQ4m0wUQkIaVB4PDF22BOyzgPom/ZugtXNngcNRoNPfroo5y61q9f7zR/bUflhkdEUEZGBhUXFze4bTqtlnbv2kUTJ06sPidEq9XSwIH963xU1PLly0mhULgNgPPmzResJzf3Zp3K+e8vv3GeHzBsPJXzTviyEF0C0Zfs9T2IDoLoDxaAR0B01BGElQCMIFtWFNmyoomymnGvY9FEWVFEF8OJiiREZgkRgW4c5/fLpGQBeIQFYM4YImrYwdw2m41Xz+rVq2s4ky+Fl/+1114jlUpFarWa1Gq1R87nM5lM5Gc2m7Fy5XKEh4fj4MHf6h5lkMncunxvWcp7SH6Fb5n1eqAvbhcWuVzOvffew7n/Ze9uXLnmuNb4EqN36VE96yWI73Tmi1pb1V8J55640+zD2DUeUoK1EHjn+6bQ6wAAC5tJREFUbW7tc5KAAAtjB8EMdnXbdACx9R4/i9WKiZMmOagxM/Dmm/zVfhaLBWPHjeOtDly0aBE2btyIyMhIREREICIiguM6cV8wIsC58rJ582aXji69du2a278MrVZHDzzwkGC7dny4w+VyNm1Kc3h+IHGZ4Hais6z4/RFEv4PoECN6K7kf78qSEGUFEGUFE2WFEWWFE2VFEGVFMtexSOb+WCiRPJQ9jAo0cgy3H/NngKgIRDkgOsVy3atxgucnuUpbtmzhjVd6errT/EMHDeLlr0lMe+SoLscGDBs2zOmhy2vXck9aXLNmjccaptXqqHWbuxsMwrVrUznPPjtnDTHH+p0goolEWhYE50GUxQLvT2fgs7/8iLICWSCGMmA8FkZ0PIzoVAjRxUAirZSIQBVmfh+0+azoPQOivWz9xmP1GiuFQkHz586vk9j995IlvPxbtmzx/llxcOHwYrlcTklJSdxzxdI2erxxJSUyp7rntq3bXC5n67bt/BPD3+lBZEMVhyIziK6D6Lid/nfMEXQOVxVH9Ge44rEgohNBROcCiG6zZRLo9hmH9ncDkZqtN4vVO5Vf1GuMli8XPqdu5UrnhkxJUREvf2OcE1cFwIyMDOdfl1JJkydzreEPP/zQaw1cv36DUxBuTkt3uZzU9Wm851+eDirWsUAwgkgBonIQyVgwnmYBedQFQB5j854CUR6IrGy5JaCkEdx6//clW48ORCfBqAHk+pm9FouFlOXlNHPmG4Ljsm7dOucnj+r19HxCQoNOL/X4aZkmk4mSp00T7FxmZqb3j0EtKqHmLTsItmfSpBdJo6lwTRynpgmWMegxkPmoHWgIRCYQ3WABVakPHmevY3ZgPGYHvmMsoOTV5SRO4ta1dCYL8JsgugqiKyDSrHN5LDIyttfolaiNk73qIMkAUJ8+fXwHgLm5uTRi+HBeI/v961+Um5vbaA3VanXUr19/p/7IkpIS1wyTtAynLy9tEUhnYMFjA5EeRBoQKUGUD8Zlc4YFWSUAj4PoBJt2mtXlNEwZZgG/H1XqftfZ59TJRFS7L1WnN9Cbc+Y6bfvf4uNrPcxbyD0DgHbs2NH4AFy3bh2vYS1atar1kGhZcTF9v2cPZWZmUlpaGu366CO6efOmRxprtdooOzubevfsLTiQrirRco2Ndv/feQISBMt56VmW+5HDVQiibBZoJ1jwVQLvDPtbPohYEOvPORh4A0FkYcsqBVEuiKhm0JSrdBT/wCNOgTdn7lwqLy8nmwsHMBuNRsEy/vzzz8YF4PbtfLY+8PHHqaZTpRUKBf3www/ULCZGsFPz5s0jnU7nkUYr5UryZzZO5l0bNrpuHF3L1xGiXxIsZ9ZwkCobZLbY6YhyVk9UgkjF6nEKEJWxgNLbgbUctMxO/LZ/DKSUOYJ6KQm4xqlcR6RQm2nhopQaxe32jO11GjeLxUL+AQG8cg79/nvjAZD39U+ZQkaDQTDzihUr6hQl+ec//0lGo9FjjV+zZo3Tuj/4YLXL5eQUEeGpX4hZIc4v64WHQOW7WZ2NXLsu/IdbRqFGKN/X1SqGhejj/7tMwGM1jmly8jRSKpVktljqNWapqakCevQk3wDgihUrBDOVlZXR33v3rnOYDgDJ5XKPdmDBggVO6x41KqFWFaLK8CKiWZsuETDBaXnLhoOKDoM0JSC9AWQ2seJWzVq0duAaO5r7rN7MB6CNFpOOLHT+FtHAhMW1juWmGlxlrpLBYKC4uDjfsYIrG7Bz506eMXJft27OFXa7SMlqJ5xoyJAhLukmDaWNGzfW+OKat2hZp1hyvpwI088RMMSlj6xLV9B380HGbBZcGgFdLRF08WvQuEfq9gHPe2s+yWSlpNPp3TZeR48e5dXjjffkFIDjx0/gJGZmZtY4KJsdvsQNAgBISEjwmA4oREJGlJBeWlHhWpsURqL5HxcSkEFAD5cBs3MmaH0S6iUtePrsBs84+4Ws4Tlz5jQOAPfs2UNnz54lIiKNWk1DhvC/+r6PPkqFhYUuxR9nvf56o31NRqOZrl27QaNGJdT6cmfNmkMmk9WlcjVWov9dJZqYLiPgMwI6ugVg1Vd/2vefE5RfqKTiEiUplBoymSweHSuFQkG9evVyu4ivMwD37dtH3379NX20Ywc1b9mSNzgpKSlOH965c6fLeb1N8+a9VeuLfy5hDMnlrk8l09qI0n6yEsaeImAnAXMJGEnAAwRE1xF0PQhIpyWr9tKt24pGGaMigZBco09GcCU2TES0detWTv6t27aRr5FaraajR49Tnz7/cBkY/f45kH74v59Jra05umIhIgP7t5JKy/Pp7i7c8tasZ/XCMpDtKshwG6RVjCStvpRMtsYfo82bNzfqpAQ+AP38SVmL5bp7924Hl8cql3xQBoOBTCYTkdW7gyyXy+nBB/vWiUO1b9OV9v70XzJb6oaSxYuTHKzL54jobSKSstbvDCK66VMf6qZNm3j9X7BgAen0erJYLN4BYGJioksuk4sXszkNXbRoEef306dP07hx4yksMtLpy/3Xo49R+saNdPjIEarwoqGiUCjp4MFfaejQIS4D8W/3/53ybt6qw4Dauavujqe6TDJoTNpQgyehppk1bgOgSqWql99t9uzZpNPp6Nr165SYmFhnBXzkyJG0f/9+unr1KslkMiotLaUSmYxkMhmVsPelxcVUXFxMcrmc4aANJJVKTXv27KF+/fq51MZvvv3ONeuSuGtaps3ZRU2JCgoKaMCAAYJjsHDhQjIYdNSQCbNOATh16lSXH8ioZfGKJ69/PPQQ/fTDD25dg2KxWEin15NGq6UbuTfom2+/JfjZhyQHUcEt19Zo6AxcAH6z5xA1RbJYLHTj2jWnDKVr1660e/dukrno5K8RgEeOHq3TghOVSkVDhw5tNBB++ukuj0dXCgoKaEXKSnp30bt04/oNl5/LzbtdPZGj4yNUVKykpkzHT5yo8V307duX9u/fS7m5uaTRaMhkMpHZbCadTkcGg4H0en3VZTAYyGAwkE6no7KyMrp06RJlZWVRvXZGMJvNKCoqQmlpKVQqFfz9/dGiZUs0j4lBcHAwAgICEBAQAD9/f4AINputatMas9nMbPlgs6GiogKFt2/jw4wMbN+xo9Z6R44ciRUrlqFr1+4e363BYrHAaiUEBbm+W/z3e/Zi1EhmzWv61o8w9ZVENCUyGAz4448/cPPWLURFRsFktuLypQtISUnxXKW+8KXZbDY6f+YM7dq1iwY++STvS3ty0CD6cMcOOnHypEeWB7qDNFotDRv+TFWbj2adaFLcrqKigr766iuvSzSf2BvGnmw2G/R6fdUWX35+fpBKpQgKCvLK6Y31pQsXLiI+vnrDl7y8W7jrrg5NhvudPnECM5OS8MeZM16tV+prA+Hn54ewsDA0NSosLOTch4c3rT60btMGgxMSvA5An+OATZW++OILzr7XpaWlXjlx3J1kNBqhUChgtVoREBCAwMBABAQEwN/fH8HBwbxzn1nPetVmVVar1emGlJUbVjpKMakIHfeQ43lrTfG7DgoKqtMp6RKJBBKJBH5+fpydDuok8UTouEuWSBwGVhxaEYDeJDOJIysCsPFIVKVFADYqBYYFCirdIokA9Ao1a9aMp6CLJALQaxTblrunn06nEwdFBKD3qFOnThg4sPrgD0fHtEgiAD1KkZGRSEpKqrrfsnULyCoaJiIAvUjdu1fP0tm1cxdOnD4pDooIQO+R4znIqevWiYNSC4mxYDeS0Enw3j6BXOSAf2ESioU6xohFEgHoMQoPD8c9cXGcNL1eLw6MCEDvccAjhw9z0pYtWyYOjAhA71Hr1q0xc+bMqvv09HTs3LnT7Qc8igAUySnNmzePc3/ixAmo1WpxYEQAeofatGlTdTJ5v3/1w9CnnkJERIQ4MAIkumE8RHK5HHl5eZBKpejSpQtCQkLEQREBKJIogkUSSQSgSCIARRIJwP8DqbNS2nnxvGkAAAAASUVORK5CYII="></image></svg></g></g><defs><clipPath id="SvgjsClipPath1081"><rect width="1000" height="1000" x="0" y="0" rx="400" ry="400"></rect></clipPath></defs></svg> \ No newline at end of file diff --git a/resources/favicon/site.webmanifest b/resources/favicon/site.webmanifest new file mode 100644 index 00000000..5f0f74a9 --- /dev/null +++ b/resources/favicon/site.webmanifest @@ -0,0 +1,21 @@ +{ + "name": "Boutique de Cocotte", + "short_name": "Cocotte", + "icons": [ + { + "src": "/web-app-manifest-192x192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "/web-app-manifest-512x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} \ No newline at end of file diff --git a/resources/favicon/web-app-manifest-192x192.png b/resources/favicon/web-app-manifest-192x192.png new file mode 100644 index 00000000..59987bdc Binary files /dev/null and b/resources/favicon/web-app-manifest-192x192.png differ diff --git a/resources/favicon/web-app-manifest-512x512.png b/resources/favicon/web-app-manifest-512x512.png new file mode 100644 index 00000000..fe1f2705 Binary files /dev/null and b/resources/favicon/web-app-manifest-512x512.png differ diff --git a/resources/js/app.js b/resources/js/app.js deleted file mode 100644 index 8ee0337d..00000000 --- a/resources/js/app.js +++ /dev/null @@ -1,31 +0,0 @@ -require('./bootstrap'); -require('@fancyapps/fancybox'); -import Vue from 'vue'; - -import "./orderFilters"; - -// Vuex -// import Vuex from 'vuex'; -import VoerroTagsInput from '@voerro/vue-tagsinput'; - -Vue.component('faq', require('./components/Faq.vue').default); -Vue.component('product-card', require('./components/ProductCard.vue').default); -Vue.component('products-cards-dnd', require('./components/ProductsCardsDnd.vue').default); -Vue.component('tags-input', VoerroTagsInput); -Vue.component('auto-complete-tags', require('./components/AutoCompleteTags.vue').default); -Vue.component('creneaux-exceptions', require('./components/CreneauxExceptions.vue').default); - -const app = new Vue({ - el: '#app', -}); - -$(document).ready(function(){ - const tippyInstances = tippy('[data-tippy-content]'); - //just add a data-tippy-content attribute to any tag to show a tooltip - const generictippy = createSingleton(tippyInstances, { - allowHTML: true, - delay: 500, - animation: 'scale', - moveTransition: 'transform 0.2s ease-out', - }); -}); diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js deleted file mode 100644 index ea9fc1cc..00000000 --- a/resources/js/bootstrap.js +++ /dev/null @@ -1,54 +0,0 @@ -window._ = require('lodash'); - -/** - * We'll load the axios HTTP library which allows us to easily issue requests - * to our Laravel back-end. This library automatically handles sending the - * CSRF token as a header based on the value of the "XSRF" token cookie. - */ - -window.axios = require('axios'); -import Popper from 'popper.js'; -import tippy, { createSingleton } from 'tippy.js'; -//window.Popper = require('popper.js').default; -window.$ = window.jQuery = require('jquery'); -//require('@fortawesome/fontawesome-free/js/all'); -const bootstrap = require('bootstrap'); -window.Popper = Popper; -window.tippy = tippy; -window.createSingleton = createSingleton; - -//window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; -window.axios.defaults.headers.common = { - 'Accept': 'application/json, text/plain, */*', - 'X-Requested-With': 'XMLHttpRequest', - 'X-CSRF-TOKEN' : document.querySelector('meta[name="csrf-token"]').getAttribute('content') -}; - -/** - * Echo exposes an expressive API for subscribing to channels and listening - * for events that are broadcast by Laravel. Echo and event broadcasting - * allows your team to easily build robust real-time web applications. - */ - -// import Echo from 'laravel-echo'; - -// window.Pusher = require('pusher-js'); - -// window.Echo = new Echo({ -// broadcaster: 'pusher', -// key: process.env.MIX_PUSHER_APP_KEY, -// cluster: process.env.MIX_PUSHER_APP_CLUSTER, -// forceTLS: true -// }); - -setTimeout(() => { - const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]'); - const tooltipList = [...document.querySelectorAll('[data-bs-toggle="tooltip"]')].map(tooltipTriggerEl => { - // * VUE 2 removes title attributes - const label = tooltipTriggerEl.getAttribute('arial-label'); - if (label) { - tooltipTriggerEl.setAttribute('title', label); - } - return new bootstrap.Tooltip(tooltipTriggerEl); - }); -}, 2000); diff --git a/resources/js/components/AutoCompleteTags.vue b/resources/js/components/AutoCompleteTags.vue deleted file mode 100644 index 3401a409..00000000 --- a/resources/js/components/AutoCompleteTags.vue +++ /dev/null @@ -1,60 +0,0 @@ -<template> - <tags-input - :element-id="elementId" - v-model="selectedTags" - :existing-tags="existingtags" - :id-field="idField" - :text-field="textField" - placeholder="Ajouter un tag" - :typeahead="true" - :display-field="displayField" - typeahead-style="dropdown"> - </tags-input> -</template> - -<script> -export default ({ - components: { VoerroTagsInput }, - props: { - dbexistingtags: { - type: String, - }, - dbselectedtags: { - type: String, - }, - elementId: { - type: String, - }, - idField: { - default: 'key', - type: String, - }, - textField: { - default: 'value', - type: String, - }, - displayField: { - default: null, - type: String, - } - }, - data() { - return { - selectedTags: [], - existingtags: [], - } - }, - mounted() { - console.log('Autocomplete Tags Component mounted.'); - this.existingtags = JSON.parse(this.dbexistingtags); - this.selectedTags = JSON.parse(this.dbselectedtags); - }, - methods: { - } -}) -</script> - -<style scoped> - @import url("https://cdn.jsdelivr.net/npm/@voerro/vue-tagsinput@2.7.1/dist/style.css"); -</style> - diff --git a/resources/js/components/CreneauxExceptions.vue b/resources/js/components/CreneauxExceptions.vue deleted file mode 100644 index 63693f97..00000000 --- a/resources/js/components/CreneauxExceptions.vue +++ /dev/null @@ -1,128 +0,0 @@ -<template> - <div> - <div - class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2">Jours Exception - <small class="text-muted">Fermetures exceptionnelles</small></h1> - <transition name="fade"> - <span class="float-right text-success" v-show="processing">{{ response }}</span> - </transition> - <button class="btn btn-primary btn-sm text-white float-right" @click="saveData()" :disabled="processing"> - Sauvegarder les exceptions - <div class="spinner-border spinner-border-sm text-light" role="status" v-show="processing"> - <span class="sr-only">Loading...</span> - </div> - </button> - </div> - <table class="table table-bordered text-center"> - <thead> - <tr> - <th scope="col">Jour</th> - <th scope="col">Commentaire</th> - <th scope="col">Type</th> - <th scope="col"></th> - </tr> - </thead> - <tbody> - <tr v-for="(item, index) in datas" v-bind:key="item.id"> - <td><input class="form-control form-control-sm" v-model="item.date" type="date" required></td> - <td><input class="form-control form-control-sm" v-model="item.comment" type="text"></td> - <td> - <select class="form-control form-control-sm" v-model="item.type"> - <option v-for="(option, index) in exceptionType" :key="index" :value="option.value"> - {{ option.label }} - </option> - </select> - </td> - <td><button @click="removeItem(index)" class="btn btn-danger btn-sm">Supprimer</button></td> - </tr> - </tbody> - </table> - <div class="form-group text-right"> - <button class="btn btn-primary btn-sm text-white" @click="newItem">Ajouter une date</button> - </div> - </div> -</template> - -<script> -export default { - mounted() { - console.log('CreneauxExceptions Component mounted.'); - this.datas = JSON.parse(this.dbdatas); - this.exceptionType = JSON.parse(this.exceptionTypeData); - }, - props: [ - 'name', - 'dbdatas', - 'magasinId', - 'exceptionTypeData' - ], - data() { - return { - datas: [], - exceptionType: [], - response: null, - processing: false - } - }, - watch: { - - }, - methods: { - newItem() { - this.datas.push({ date: '', comment: '', type: this.exceptionType.length > 0 ? this.exceptionType[0].value : '', magasin_id: this.magasinId }); - }, - removeItem(index) { - if (this.datas[index]['id'] !== undefined) { - this.processing = true; - axios.post('/bo/ajax/delete-creneaux-exception', { - id: this.datas[index]['id'], - }).then( - (response) => { - this.response = response.data; - this.processing = false; - } - ) - .catch(function (error) { - console.log(error); - alert('Erreur lors de la suppression.'); - this.processing = false; - }); - this.datas.splice(index, 1); - } else { - this.datas.splice(index, 1); - } - }, - saveData() { - this.processing = true; - this.response = "En cours de sauvegarde..." - axios.post('/bo/ajax/save-creneaux-exception', { - collecte_exception: this.datas, - }).then( - (response) => { - this.datas = response.data; - this.response = "Sauvegarde terminée !"; - this.processing = false; - } - ) - .catch(function (error) { - console.log(error); - this.response = "Erreur lors de la sauvegarde."; - this.processing = false; - }); - - } - } -} -</script> - -<style scoped> -.fade-enter-active, -.fade-leave-active { - transition: opacity .5s; -} - -.fade-enter, -.fade-leave-to { - opacity: 0; -} -</style> diff --git a/resources/js/components/Faq.vue b/resources/js/components/Faq.vue deleted file mode 100644 index 37232ed0..00000000 --- a/resources/js/components/Faq.vue +++ /dev/null @@ -1,112 +0,0 @@ -<template> - <div> - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2">FAQ</h1> - <transition name="fade"> - <span class="float-right text-success" v-show="processing">{{ response }}</span> - </transition> - <button class="btn btn-primary btn-sm text-white float-right" @click="saveData()" :disabled="processing"> - Sauvegarder - <div class="spinner-border spinner-border-sm text-light" role="status" v-show="processing"> - <span class="sr-only">Loading...</span> - </div> - </button> - </div> - <table class="table table-bordered text-center"> - <thead> - <tr> - <th scope="col">Question</th> - <th scope="col">Réponse</th> - <th scope="col"></th> - </tr> - </thead> - <tbody> - <tr v-for="(item, index) in datas" v-bind:key="item.id"> - <td><input class="form-control form-control-sm" v-model="item.question" type="text" required></td> - <td><input class="form-control form-control-sm" v-model="item.answer" type="text" required></td> - <td><button @click="removeItem(index)" class="btn btn-danger btn-sm">Supprimer</button></td> - </tr> - </tbody> - </table> - <div class="form-group text-right"> - <button class="btn btn-primary btn-sm text-white" @click="newItem">Ajouter une ligne</button> - </div> - </div> -</template> - -<script> - export default { - mounted() { - console.log('Faq Component mounted.'); - this.datas = JSON.parse(this.dbdatas); - }, - props: [ - 'name', - 'dbdatas', - ], - data() { - return { - datas: [], - response: null, - processing: false - } - }, - watch: { - - }, - methods: { - newItem() { - this.datas.push({question: '', answer: ''}); - }, - removeItem(index) { - if (this.datas[index]['id'] !== undefined) { - this.processing = true; - axios.post('/bo/ajax/delete-faq', { - id: this.datas[index]['id'], - }).then( - (response) => { - this.response = response.data; - this.processing = false; - } - ) - .catch(function (error) { - console.log(error); - alert('Erreur lors de la suppression.'); - this.processing = false; - }); - this.datas.splice(index, 1); - } else { - this.datas.splice(index, 1); - } - }, - saveData() { - this.processing = true; - this.response = "En cours de sauvegarde..." - axios.post('/bo/ajax/save-faq', { - faq: this.datas, - }).then( - (response) => { - this.datas = response.data; - this.response = "Sauvegarde terminée !"; - this.processing = false; - } - ) - .catch(function (error) { - console.log(error); - this.response = "Erreur lors de la sauvegarde."; - this.processing = false; - }); - - } - } - } -</script> - -<style scoped> - .fade-enter-active, .fade-leave-active { - transition: opacity .5s; - } - .fade-enter, .fade-leave-to { - opacity: 0; - } -</style> diff --git a/resources/js/components/ProductCard.vue b/resources/js/components/ProductCard.vue deleted file mode 100644 index 71dff779..00000000 --- a/resources/js/components/ProductCard.vue +++ /dev/null @@ -1,21 +0,0 @@ -<template> - <div class="card draggable-item"> - <img class="card-img-top" :src="'/storage/images/produits/'+product.picture" :alt="product.name"> - <div class="card-body"> - <h5 class="card-title">{{product.name}}</h5> - <small class="text-muted">{{product.price}}</small> - <p class="card-text" v-html="product.description"></p> - </div> - </div> -</template> - -<script> - export default { - props: { - product: { - type: Object, - default: () => ({}) - } - }, - } -</script> diff --git a/resources/js/components/ProductsCardsDnd.vue b/resources/js/components/ProductsCardsDnd.vue deleted file mode 100644 index b47b47f9..00000000 --- a/resources/js/components/ProductsCardsDnd.vue +++ /dev/null @@ -1,124 +0,0 @@ -<template> - <div class="groups"> - <div class="group"> - Produits disponibles - <Container group-name="1" - :tag="{value: 'div', props: {class: 'pool'}}" - :get-child-payload="getChildPayload1" - @drop="onDrop('existingProds', $event)" - drag-class="ghost" - orientation="horizontal"> - <Draggable v-for="item in existingProds" :key="item.id"> - <product-card :product="item" :key="item.id"></product-card> - </Draggable> - </Container> - </div> - <div class="group"> - Produits sélectionnés - <Container group-name="1" - :tag="{value: 'div', props: {class: 'selection'}}" - :get-child-payload="getChildPayload2" - drag-class="ghost" - :drop-placeholder="dropOptions" - @drop="onDrop('selectedProds', $event)" - orientation="horizontal"> - <Draggable v-for="item in selectedProds" :key="item.id"> - <product-card :key="item.id" :product="item"></product-card> - </Draggable> - </Container> - </div> - <input type="hidden" :id="elementId" :name="elementId" class="form-control" placeholder="Produit * " :value="product_id"> - </div> -</template> - -<script> -import { Container, Draggable, smoothDnD } from 'vue-smooth-dnd' - -export default { - name: 'Groups', - - components: {Container, Draggable}, - props: { - dbexistingprods: { - type: String, - }, - dbselectedprods: { - type: String, - }, - elementId: { - type: String, - }, - }, - - data () { - return { - selectedProds: [], - existingProds: [], - product_id: '', - dropOptions: { - className: "ghost", - animationDuration: 300, - showOnTop: true, - }, - } - }, - mounted() { - console.log('DnD Products Component mounted.'); - this.selectedProds = JSON.parse(this.dbselectedprods); - this.existingProds = JSON.parse(this.dbexistingprods); - this.product_id = this.selectedProds.map(({ id }) => id ); - }, - methods: { - onDrop (collection, dropResult) { - this[collection] = this.applyDrag(this[collection], dropResult); - this.product_id = this.selectedProds.map(({ id }) => id ); - }, - - getChildPayload1 (index) { - return this.existingProds[index] - }, - - getChildPayload2 (index) { - return this.selectedProds[index] - }, - - applyDrag(arr, dragResult) { - const { removedIndex, addedIndex, payload } = dragResult - if (removedIndex === null && addedIndex === null) return arr - - const result = [...arr] - let itemToAdd = payload - - if (removedIndex !== null) { - itemToAdd = result.splice(removedIndex, 1)[0] - } - - if (addedIndex !== null) { - result.splice(addedIndex, 0, itemToAdd) - } - - return result; - } - } -} -</script> - -<style lang="css" scoped> - .groups { - /*display: flex; - justify-content: stretch; - margin-top: 50px; - margin-right: 50px;*/ - } - - .ghost { - opacity: 0.8; - /*background: #c8ebfb;*/ - background: #f00; - } - - .group { - /*margin-left: 50px; - flex: 1;*/ - } -</style> diff --git a/resources/js/orderFilters.js b/resources/js/orderFilters.js deleted file mode 100644 index ccd18124..00000000 --- a/resources/js/orderFilters.js +++ /dev/null @@ -1,30 +0,0 @@ -document.addEventListener("DOMContentLoaded", function () { - const tagListToSwitchDisplay = ["date-order", "date-retrait"]; - - tagListToSwitchDisplay.forEach(function (tag) { - /** @type {NodeListOf<HMTLElement>} */ - const elementListToSwitchDisplay = document.querySelectorAll( - `[data-toggle="${tag}-end"]` - ); - /** @type {HTMLElement|null} */ - const toggleSwitchElement = document.getElementById(`${tag}-switch`); - if (!toggleSwitchElement) { - return; - } - // * Force switch on if end is filled with a date - elementListToSwitchDisplay.forEach((el) => { - toggleSwitchElement.checked = el.value?.length ? true : false; - }); - const displaySwitch = () => { - elementListToSwitchDisplay.forEach((el) => { - if (toggleSwitchElement.checked) { - el.classList.remove("d-none"); - } else { - el.classList.add("d-none"); - } - }); - }; - displaySwitch(); - toggleSwitchElement.addEventListener("change", displaySwitch); - }); -}); diff --git a/resources/lang/en/auth.php b/resources/lang/en/auth.php deleted file mode 100644 index e5506df2..00000000 --- a/resources/lang/en/auth.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | Authentication Language Lines - |-------------------------------------------------------------------------- - | - | The following language lines are used during authentication for various - | messages that we need to display to the user. You are free to modify - | these language lines according to your application's requirements. - | - */ - - 'failed' => 'These credentials do not match our records.', - 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', - -]; diff --git a/resources/lang/en/pagination.php b/resources/lang/en/pagination.php deleted file mode 100644 index d4814118..00000000 --- a/resources/lang/en/pagination.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | Pagination Language Lines - |-------------------------------------------------------------------------- - | - | The following language lines are used by the paginator library to build - | the simple pagination links. You are free to change them to anything - | you want to customize your views to better match your application. - | - */ - - 'previous' => '« Previous', - 'next' => 'Next »', - -]; diff --git a/resources/lang/en/passwords.php b/resources/lang/en/passwords.php deleted file mode 100644 index 2345a56b..00000000 --- a/resources/lang/en/passwords.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | Password Reset Language Lines - |-------------------------------------------------------------------------- - | - | The following language lines are the default lines which match reasons - | that are given by the password broker for a password update attempt - | has failed, such as for an invalid token or invalid new password. - | - */ - - 'reset' => 'Your password has been reset!', - 'sent' => 'We have emailed your password reset link!', - 'throttled' => 'Please wait before retrying.', - 'token' => 'This password reset token is invalid.', - 'user' => "We can't find a user with that email address.", - -]; diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php deleted file mode 100644 index 2e2820b0..00000000 --- a/resources/lang/en/validation.php +++ /dev/null @@ -1,152 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | Validation Language Lines - |-------------------------------------------------------------------------- - | - | The following language lines contain the default error messages used by - | the validator class. Some of these rules have multiple versions such - | as the size rules. Feel free to tweak each of these messages here. - | - */ - - 'accepted' => 'The :attribute must be accepted.', - 'active_url' => 'The :attribute is not a valid URL.', - 'after' => 'The :attribute must be a date after :date.', - 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', - 'alpha' => 'The :attribute may only contain letters.', - 'alpha_dash' => 'The :attribute may only contain letters, numbers, dashes and underscores.', - 'alpha_num' => 'The :attribute may only contain letters and numbers.', - 'array' => 'The :attribute must be an array.', - 'before' => 'The :attribute must be a date before :date.', - 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', - 'between' => [ - 'numeric' => 'The :attribute must be between :min and :max.', - 'file' => 'The :attribute must be between :min and :max kilobytes.', - 'string' => 'The :attribute must be between :min and :max characters.', - 'array' => 'The :attribute must have between :min and :max items.', - ], - 'boolean' => 'The :attribute field must be true or false.', - 'confirmed' => 'The :attribute confirmation does not match.', - 'date' => 'The :attribute is not a valid date.', - 'date_equals' => 'The :attribute must be a date equal to :date.', - 'date_format' => 'The :attribute does not match the format :format.', - 'different' => 'The :attribute and :other must be different.', - 'digits' => 'The :attribute must be :digits digits.', - 'digits_between' => 'The :attribute must be between :min and :max digits.', - 'dimensions' => 'The :attribute has invalid image dimensions.', - 'distinct' => 'The :attribute field has a duplicate value.', - 'email' => 'The :attribute must be a valid email address.', - 'ends_with' => 'The :attribute must end with one of the following: :values.', - 'exists' => 'The selected :attribute is invalid.', - 'file' => 'The :attribute must be a file.', - 'filled' => 'The :attribute field must have a value.', - 'gt' => [ - 'numeric' => 'The :attribute must be greater than :value.', - 'file' => 'The :attribute must be greater than :value kilobytes.', - 'string' => 'The :attribute must be greater than :value characters.', - 'array' => 'The :attribute must have more than :value items.', - ], - 'gte' => [ - 'numeric' => 'The :attribute must be greater than or equal :value.', - 'file' => 'The :attribute must be greater than or equal :value kilobytes.', - 'string' => 'The :attribute must be greater than or equal :value characters.', - 'array' => 'The :attribute must have :value items or more.', - ], - 'image' => 'The :attribute must be an image.', - 'in' => 'The selected :attribute is invalid.', - 'in_array' => 'The :attribute field does not exist in :other.', - 'integer' => 'The :attribute must be an integer.', - 'ip' => 'The :attribute must be a valid IP address.', - 'ipv4' => 'The :attribute must be a valid IPv4 address.', - 'ipv6' => 'The :attribute must be a valid IPv6 address.', - 'json' => 'The :attribute must be a valid JSON string.', - 'lt' => [ - 'numeric' => 'The :attribute must be less than :value.', - 'file' => 'The :attribute must be less than :value kilobytes.', - 'string' => 'The :attribute must be less than :value characters.', - 'array' => 'The :attribute must have less than :value items.', - ], - 'lte' => [ - 'numeric' => 'The :attribute must be less than or equal :value.', - 'file' => 'The :attribute must be less than or equal :value kilobytes.', - 'string' => 'The :attribute must be less than or equal :value characters.', - 'array' => 'The :attribute must not have more than :value items.', - ], - 'max' => [ - 'numeric' => 'The :attribute may not be greater than :max.', - 'file' => 'The :attribute may not be greater than :max kilobytes.', - 'string' => 'The :attribute may not be greater than :max characters.', - 'array' => 'The :attribute may not have more than :max items.', - ], - 'mimes' => 'The :attribute must be a file of type: :values.', - 'mimetypes' => 'The :attribute must be a file of type: :values.', - 'min' => [ - 'numeric' => 'The :attribute must be at least :min.', - 'file' => 'The :attribute must be at least :min kilobytes.', - 'string' => 'The :attribute must be at least :min characters.', - 'array' => 'The :attribute must have at least :min items.', - ], - 'multiple_of' => 'The :attribute must be a multiple of :value', - 'not_in' => 'The selected :attribute is invalid.', - 'not_regex' => 'The :attribute format is invalid.', - 'numeric' => 'The :attribute must be a number.', - 'password' => 'The password is incorrect.', - 'present' => 'The :attribute field must be present.', - 'regex' => 'The :attribute format is invalid.', - 'required' => 'The :attribute field is required.', - 'required_if' => 'The :attribute field is required when :other is :value.', - 'required_unless' => 'The :attribute field is required unless :other is in :values.', - 'required_with' => 'The :attribute field is required when :values is present.', - 'required_with_all' => 'The :attribute field is required when :values are present.', - 'required_without' => 'The :attribute field is required when :values is not present.', - 'required_without_all' => 'The :attribute field is required when none of :values are present.', - 'same' => 'The :attribute and :other must match.', - 'size' => [ - 'numeric' => 'The :attribute must be :size.', - 'file' => 'The :attribute must be :size kilobytes.', - 'string' => 'The :attribute must be :size characters.', - 'array' => 'The :attribute must contain :size items.', - ], - 'starts_with' => 'The :attribute must start with one of the following: :values.', - 'string' => 'The :attribute must be a string.', - 'timezone' => 'The :attribute must be a valid zone.', - 'unique' => 'The :attribute has already been taken.', - 'uploaded' => 'The :attribute failed to upload.', - 'url' => 'The :attribute format is invalid.', - 'uuid' => 'The :attribute must be a valid UUID.', - - /* - |-------------------------------------------------------------------------- - | Custom Validation Language Lines - |-------------------------------------------------------------------------- - | - | Here you may specify custom validation messages for attributes using the - | convention "attribute.rule" to name the lines. This makes it quick to - | specify a specific custom language line for a given attribute rule. - | - */ - - 'custom' => [ - 'attribute-name' => [ - 'rule-name' => 'custom-message', - ], - ], - - /* - |-------------------------------------------------------------------------- - | Custom Validation Attributes - |-------------------------------------------------------------------------- - | - | The following language lines are used to swap our attribute placeholder - | with something more reader friendly such as "E-Mail Address" instead - | of "email". This simply helps us make our message more expressive. - | - */ - - 'attributes' => [], - -]; diff --git a/resources/lang/fr.json b/resources/lang/fr.json deleted file mode 100644 index cc4ab50e..00000000 --- a/resources/lang/fr.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "coord_please_complete": "Merci de compléter correctement les champs du formulaire.", - "my_coord": "Mes coordonnées", - "lastname": "Nom", - "firstname": "Prénom", - "address": "Adresse", - "email": "E-mail", - "postal": "Code postal", - "town": "Ville", - "phone": "Téléphone", - "propose_recipe": "Proposez votre recette", - "complain": "Réclamation Produit", - "question_concern": "Votre question concerne", - "ask_concern": "Votre demande concerne*", - "select_ask": "Sélectionnez une demande", - "product_name": "Nom du produit", - "product_code": "Code barre du produit concerné", - "buy_place": "Lieu d'achat", - "lot_number": "N° de lot figurant à coté de la date", - "lot_number_tip": "Vous pouvez également trouver le n° de lot sous la dénomination \"n° de tracabilité\" ou \"n° trac\".", - "limit_date": "Date limite de consommation", - "jj": "jj", - "mm": "mm", - "aaaa": "aaaa", - "consumption_date": "Date de consommation", - "joinedfile": "Pièce jointe", - "add_joinedfile": "Ajouter un fichier", - "format_joinedfile": "Formats acceptés", - "max_joinedfile_size": "Taille max", - "data_size_mo": ":datasize Mo", - "your_message": "Votre message", - "mandatory_fields": "Champs obligatoires", - "send": "Envoyer", - "civilty": "Civilité", - "message_contact_send": "Votre message a été envoyé avec succès.", - "message_contact_failed": "Une erreur est survenue durant l'envoi de votre message. Veuillez réessayer ultèrieurement.", - "report_abuse": "Signaler un abus", - "report_abuse_message" : "Je souhaite signaler le message de :username car cet utilisateur ne respecte pas les conditions d'utilisation du Club des Gaulois.\n\nCordialement", - "We'll be back soon!": "Nous serons de retour bientôt", - "Sorry for the inconvenience but we’re performing some maintenance at the moment." : "Veuillez nous excuser pour la gêne occasionnée, nous sommes en train de réaliser une opération de maintenance.", - "If you need to you can always <a href=\"mailto::email\">contact us</a>, otherwise we’ll be back online shortly!" : "Si besoin vous pouvez toujours nous <a href=\"mailto::email\">contacter</a>, sinon nous serons de retour bientôt", - "The :sitename Team" : "L'équipe :sitename", - "You must accept the terms and conditions and the privacy policy" : "Vous devez accepter les conditions générales et la politique de gestion des données personnelles.", - "The :attribute must be a valid role.": "Le :attribute doit être un rôle valide.", - "The :attribute must be at least :length characters and contain at least one number.": "Le champ :attribute doit avoir au moins :length caractères et contenir au moins un chiffre.", - "The :attribute must be at least :length characters and contain at least one special character and one number.": "Le champ :attribute doit avoir au moins :length caractères et contenir au moins un caractère spécial et un nombre.", - "The :attribute must be at least :length characters and contain at least one special character.": "Le champ :attribute doit avoir au moins :length caractères et contenir au moins un caractère spécial.", - "The :attribute must be at least :length characters and contain at least one uppercase character and one number.": "Le champ :attribute doit avoir au moins :length caractères et contenir au moins une majuscule et un chiffre.", - "The :attribute must be at least :length characters and contain at least one uppercase character and one special character.": "Le champ :attribute doit avoir au moins :length caractères et contenir au moins une majuscule et un caractère spécial.", - "The :attribute must be at least :length characters and contain at least one uppercase character, one number, and one special character.": "Le champ :attribute doit avoir au moins :length caractères, et contenir au moins une majuscule, un chiffre et un caractère spécial.", - "The :attribute must be at least :length characters and contain at least one uppercase character.": "Le champ :attribute doit avoir au moins :length caractères et au moins une majuscule.", - "The :attribute must be at least :length characters.": "Le champ :attribute doit avoir au moins :length caractères.", - "The :attribute must contain at least one letter.": "Le champ :attribute doit avoir au moins une lettre.", - "The :attribute must contain at least one number.": "Le champ :attribute doit avoir au moins un numéro.", - "The :attribute must contain at least one symbol.": "Le champ :attribute doit avoir au moins un symbole.", - "The :attribute must contain at least one uppercase and one lowercase letter.": "Le champ :attribute doit avoir au moins une lettre majuscule et une lettre minuscule." -} diff --git a/resources/lang/fr/crud.php b/resources/lang/fr/crud.php deleted file mode 100644 index 60fde920..00000000 --- a/resources/lang/fr/crud.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -return [ - 'messages' => [ - 'order_changed' => 'L\'ordre a été changé !', - 'order_not_changed' => 'L\'ordre n\'a pas été changé !', - ], - - 'other' => [ - 'up' => 'Modifier l\'ordre d\'apparition vers le haut', - 'down' => 'Modifier l\'ordre d\'apparition vers le bas', - 'right' => 'Vous n\'avez pas les droits', - ] -]; diff --git a/resources/lang/fr/validation.php b/resources/lang/fr/validation.php deleted file mode 100644 index f2463bfc..00000000 --- a/resources/lang/fr/validation.php +++ /dev/null @@ -1,193 +0,0 @@ -<?php - -return [ - /* - |-------------------------------------------------------------------------- - | Validation Language Lines - |-------------------------------------------------------------------------- - | - | The following language lines contain the default error messages used by - | the validator class. Some of these rules have multiple versions such - | as the size rules. Feel free to tweak each of these messages. - | - */ - - 'accepted' => 'Le champ :attribute doit être accepté.', - 'active_url' => "Le champ :attribute n'est pas une URL valide.", - 'after' => 'Le champ :attribute doit être une date postérieure au :date.', - 'after_or_equal' => 'Le champ :attribute doit être une date postérieure ou égale au :date.', - 'alpha' => 'Le champ :attribute doit contenir uniquement des lettres.', - 'alpha_dash' => 'Le champ :attribute doit contenir uniquement des lettres, des chiffres et des tirets.', - 'alpha_num' => 'Le champ :attribute doit contenir uniquement des chiffres et des lettres.', - 'array' => 'Le champ :attribute doit être un tableau.', - 'before' => 'Le champ :attribute doit être une date antérieure au :date.', - 'before_or_equal' => 'Le champ :attribute doit être une date antérieure ou égale au :date.', - 'between' => [ - 'numeric' => 'La valeur de :attribute doit être comprise entre :min et :max.', - 'file' => 'La taille du fichier de :attribute doit être comprise entre :min et :max kilo-octets.', - 'string' => 'Le texte :attribute doit contenir entre :min et :max caractères.', - 'array' => 'Le tableau :attribute doit contenir entre :min et :max éléments.', - ], - 'boolean' => 'Le champ :attribute doit être vrai ou faux.', - 'confirmed' => 'Le champ de confirmation :attribute ne correspond pas.', - 'date' => "Le champ :attribute n'est pas une date valide.", - 'date_equals' => 'Le champ :attribute doit être une date égale à :date.', - 'date_format' => 'Le champ :attribute ne correspond pas au format :format.', - 'different' => 'Les champs :attribute et :other doivent être différents.', - 'digits' => 'Le champ :attribute doit contenir :digits chiffres.', - 'digits_between' => 'Le champ :attribute doit contenir entre :min et :max chiffres.', - 'dimensions' => "La taille de l'image :attribute n'est pas conforme.", - 'distinct' => 'Le champ :attribute a une valeur en double.', - 'email' => 'Le champ :attribute doit être une adresse email valide.', - 'ends_with' => 'Le champ :attribute doit se terminer par une des valeurs suivantes : :values', - 'exists' => 'Le champ :attribute sélectionné est invalide.', - 'file' => 'Le champ :attribute doit être un fichier.', - 'filled' => 'Le champ :attribute doit avoir une valeur.', - 'gt' => [ - 'numeric' => 'La valeur de :attribute doit être supérieure à :value.', - 'file' => 'La taille du fichier de :attribute doit être supérieure à :value kilo-octets.', - 'string' => 'Le texte :attribute doit contenir plus de :value caractères.', - 'array' => 'Le tableau :attribute doit contenir plus de :value éléments.', - ], - 'gte' => [ - 'numeric' => 'La valeur de :attribute doit être supérieure ou égale à :value.', - 'file' => 'La taille du fichier de :attribute doit être supérieure ou égale à :value kilo-octets.', - 'string' => 'Le texte :attribute doit contenir au moins :value caractères.', - 'array' => 'Le tableau :attribute doit contenir au moins :value éléments.', - ], - 'image' => 'Le champ :attribute doit être une image.', - 'in' => 'Le champ :attribute est invalide.', - 'in_array' => "Le champ :attribute n'existe pas dans :other.", - 'integer' => 'Le champ :attribute doit être un entier.', - 'ip' => 'Le champ :attribute doit être une adresse IP valide.', - 'ipv4' => 'Le champ :attribute doit être une adresse IPv4 valide.', - 'ipv6' => 'Le champ :attribute doit être une adresse IPv6 valide.', - 'json' => 'Le champ :attribute doit être un document JSON valide.', - 'lt' => [ - 'numeric' => 'La valeur de :attribute doit être inférieure à :value.', - 'file' => 'La taille du fichier de :attribute doit être inférieure à :value kilo-octets.', - 'string' => 'Le texte :attribute doit contenir moins de :value caractères.', - 'array' => 'Le tableau :attribute doit contenir moins de :value éléments.', - ], - 'lte' => [ - 'numeric' => 'La valeur de :attribute doit être inférieure ou égale à :value.', - 'file' => 'La taille du fichier de :attribute doit être inférieure ou égale à :value kilo-octets.', - 'string' => 'Le texte :attribute doit contenir au plus :value caractères.', - 'array' => 'Le tableau :attribute doit contenir au plus :value éléments.', - ], - 'max' => [ - 'numeric' => 'La valeur de :attribute ne peut être supérieure à :max.', - 'file' => 'La taille du fichier de :attribute ne peut pas dépasser :max kilo-octets.', - 'string' => 'Le texte de :attribute ne peut contenir plus de :max caractères.', - 'array' => 'Le tableau :attribute ne peut contenir plus de :max éléments.', - ], - 'mimes' => 'Le champ :attribute doit être un fichier de type : :values.', - 'mimetypes' => 'Le champ :attribute doit être un fichier de type : :values.', - 'min' => [ - 'numeric' => 'La valeur de :attribute doit être supérieure ou égale à :min.', - 'file' => 'La taille du fichier de :attribute doit être supérieure à :min kilo-octets.', - 'string' => 'Le texte :attribute doit contenir au moins :min caractères.', - 'array' => 'Le tableau :attribute doit contenir au moins :min éléments.', - ], - 'multiple_of' => 'La valeur de :attribute doit être un multiple de :value', - 'not_in' => "Le champ :attribute sélectionné n'est pas valide.", - 'not_regex' => "Le format du champ :attribute n'est pas valide.", - 'numeric' => 'Le champ :attribute doit contenir un nombre.', - 'password' => 'Le mot de passe est incorrect', - 'present' => 'Le champ :attribute doit être présent.', - 'regex' => 'Le format du champ :attribute est invalide.', - 'required' => 'Le champ :attribute est obligatoire.', - 'required_if' => 'Le champ :attribute est obligatoire quand la valeur de :other est :value.', - 'required_unless' => 'Le champ :attribute est obligatoire sauf si :other est :values.', - 'required_with' => 'Le champ :attribute est obligatoire quand :values est présent.', - 'required_with_all' => 'Le champ :attribute est obligatoire quand :values sont présents.', - 'required_without' => "Le champ :attribute est obligatoire quand :values n'est pas présent.", - 'required_without_all' => "Le champ :attribute est requis quand aucun de :values n'est présent.", - 'same' => 'Les champs :attribute et :other doivent être identiques.', - 'size' => [ - 'numeric' => 'La valeur de :attribute doit être :size.', - 'file' => 'La taille du fichier de :attribute doit être de :size kilo-octets.', - 'string' => 'Le texte de :attribute doit contenir :size caractères.', - 'array' => 'Le tableau :attribute doit contenir :size éléments.', - ], - 'starts_with' => 'Le champ :attribute doit commencer avec une des valeurs suivantes : :values', - 'string' => 'Le champ :attribute doit être une chaîne de caractères.', - 'timezone' => 'Le champ :attribute doit être un fuseau horaire valide.', - 'unique' => 'La valeur du champ :attribute est déjà utilisée.', - 'uploaded' => "Le fichier du champ :attribute n'a pu être téléversé.", - 'url' => "Le format de l'URL de :attribute n'est pas valide.", - 'uuid' => 'Le champ :attribute doit être un UUID valide', - - /* - |-------------------------------------------------------------------------- - | Custom Validation Language Lines - |-------------------------------------------------------------------------- - | - | Here you may specify custom validation messages for attributes using the - | convention "attribute.rule" to name the lines. This makes it quick to - | specify a specific custom language line for a given attribute rule. - | - */ - - 'custom' => [ - 'attribute-name' => [ - 'rule-name' => 'custom-message', - ], - 'ok_cgv' => [ - 'accepted' => 'Vous devez accepter les conditions générales de vente.', - ], - 'ok_cgu_privacy' => [ - 'accepted' => 'Vous devez accepter les conditions générales et la politique de gestion des données personnelles.', - ], - 'selectedcreneau' => [ - 'required' => 'Vous devez choisir un horaire de retrait pour votre commande.', - ], - 'selectedmagasin' => [ - 'required' => 'Vous devez choisir un point de retrait pour votre commande.', - ] - ], - - /* - |-------------------------------------------------------------------------- - | Custom Validation Attributes - |-------------------------------------------------------------------------- - | - | The following language lines are used to swap attribute place-holders - | with something more reader friendly such as E-Mail Address instead - | of "email". This simply helps us make messages a little cleaner. - | - */ - - 'attributes' => [ - 'name' => 'nom', - 'username' => "nom d'utilisateur", - 'email' => 'adresse email', - 'first_name' => 'prénom', - 'last_name' => 'nom', - 'password' => 'mot de passe', - 'password_confirmation' => 'confirmation du mot de passe', - 'city' => 'ville', - 'country' => 'pays', - 'address' => 'adresse', - 'phone' => 'téléphone', - 'mobile' => 'portable', - 'age' => 'âge', - 'sex' => 'sexe', - 'gender' => 'genre', - 'day' => 'jour', - 'month' => 'mois', - 'year' => 'année', - 'hour' => 'heure', - 'minute' => 'minute', - 'second' => 'seconde', - 'title' => 'titre', - 'content' => 'contenu', - 'description' => 'description', - 'excerpt' => 'extrait', - 'date' => 'date', - 'time' => 'heure', - 'available' => 'disponible', - 'size' => 'taille', - 'subject' => 'objet', - ], -]; diff --git a/resources/sass/_classes.scss b/resources/sass/_classes.scss deleted file mode 100644 index e175ff62..00000000 --- a/resources/sass/_classes.scss +++ /dev/null @@ -1,25 +0,0 @@ -.display { - display: block !important; -} -.display-none { - display: none !important; -} -.display-none-weak { - display: none; -} -.display-flex { - display: flex !important; -} - -.w-md-auto { - width: 100% !important; - - /** Equivalent to @include media-breakpoint-up(md) */ - @media (min-width: 768px) { - width: auto !important; - } -} - -.flex-50 { - flex-basis: 50% !important; -} diff --git a/resources/sass/_dashboard.scss b/resources/sass/_dashboard.scss deleted file mode 100644 index 304102a3..00000000 --- a/resources/sass/_dashboard.scss +++ /dev/null @@ -1,102 +0,0 @@ -body { - font-size: .875rem; - } - - .lni { - width: 16px; - height: 16px; - vertical-align: text-bottom; - font-size: 20px !important; - font-weight: bold !important; - } - - /* - * Sidebar - */ - - .sidebar { - position: fixed; - top: 0; - /* rtl:raw: - right: 0; - */ - bottom: 0; - /* rtl:remove */ - left: 0; - z-index: 100; /* Behind the navbar */ - padding: 48px 0 0; /* Height of navbar */ - box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1); - } - - @media (max-width: 767.98px) { - .sidebar { - top: 5rem; - } - } - - .sidebar-sticky { - position: relative; - top: 0; - height: calc(100vh - 48px); - padding-top: .5rem; - overflow-x: hidden; - overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ - } - - .sidebar .nav-link { - font-weight: 500; - color: #333; - } - - .sidebar .nav-link .lni { - margin-right: 8px; - color: #727272; - } - - .sidebar .nav-link.active { - color: #2470dc; - } - - .sidebar .nav-link:hover .lni, - .sidebar .nav-link.active .lni { - color: inherit; - } - - .sidebar-heading { - font-size: .75rem; - text-transform: uppercase; - } - - /* - * Navbar - */ - - .navbar-brand { - padding-top: .75rem; - padding-bottom: .75rem; - font-size: 1rem; - background-color: rgba(0, 0, 0, .25); - box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25); - } - - .navbar .navbar-toggler { - top: .25rem; - right: 1rem; - } - - .navbar .form-control { - padding: .75rem 1rem; - border-width: 0; - border-radius: 0; - } - - .form-control-dark { - color: #fff; - background-color: rgba(255, 255, 255, .1); - border-color: rgba(255, 255, 255, .1); - } - - .form-control-dark:focus { - border-color: transparent; - box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); - } diff --git a/resources/sass/_forms.scss b/resources/sass/_forms.scss deleted file mode 100644 index 3ea95b1b..00000000 --- a/resources/sass/_forms.scss +++ /dev/null @@ -1,65 +0,0 @@ -/* The switch - the box around the slider */ -.switch { - position: relative; - display: inline-block; - width: 60px; - height: 34px; - /* Hide default HTML checkbox */ - input { - opacity: 0; - width: 0; - height: 0; - } - } - - /* The slider */ - .slider { - position: absolute; - cursor: pointer; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: #ccc; - -webkit-transition: .4s; - transition: .4s; - - &::before { - position: absolute; - content: ""; - height: 26px; - width: 26px; - left: 4px; - bottom: 4px; - background-color: white; - -webkit-transition: .4s; - transition: .4s; - } - } - - input:checked + .slider { - background-color: #2196F3; - } - - input:focus + .slider { - box-shadow: 0 0 1px #2196F3; - } - - input:checked + .slider:before { - -webkit-transform: translateX(26px); - -ms-transform: translateX(26px); - transform: translateX(26px); - } - - /* Rounded sliders */ - .slider.round { - border-radius: 34px; - } - - .slider.round:before { - border-radius: 50%; - } - - .inco_data{ - height: initial; - } diff --git a/resources/sass/_icons.scss b/resources/sass/_icons.scss deleted file mode 100644 index 5dd84993..00000000 --- a/resources/sass/_icons.scss +++ /dev/null @@ -1,13 +0,0 @@ -.icon-size { - font-size: 20px; -} - -.cross-red { - @extend .icon-size; - color: crimson; -} - -.check-green { - @extend .icon-size; - color: seagreen; -} diff --git a/resources/sass/_popup.scss b/resources/sass/_popup.scss deleted file mode 100644 index f07e629f..00000000 --- a/resources/sass/_popup.scss +++ /dev/null @@ -1,83 +0,0 @@ -/* Custom modal content styling */ - -.modal-container { - max-width: 500px; - padding: 0; - margin: 20px 0; - border-radius: .3em; - box-shadow: 0 0.1em 0.4em rgba(0,0,0,.3); - } - - .modal-title { - font-weight: 700; - padding: 1.5em; - font-family: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif; - } - - .modal-body { - max-height: calc(100vh - 230px); - min-height: 50px; - padding: 0 1.5em 1.5em 1.5em; - overflow-y: auto; - } - - .modal-footer { - padding: 1.5em; - text-align: right; - } - - p:first-child { - margin-top: 0; - } - - - //tooltips - .tooltip:not(.bs-tooltip-auto) { - background: #333; - color: white; - font-weight: bold; - padding: 4px 8px; - font-size: 13px; - border-radius: 4px; - //display: none; - width: 120px; - } - - .tooltip[data-show] { - display: block; - opacity: 1; - } - -.arrow, -.arrow::before { - position: absolute; - width: 8px; - height: 8px; - background: inherit; -} - -.arrow { - visibility: hidden; -} - -.arrow::before { - visibility: visible; - content: ''; - transform: rotate(45deg); -} - -.tooltip[x-placement^='top'] > .arrow { - bottom: -4px; -} - -.tooltip[x-placement^='bottom'] > .arrow { - top: -4px; -} - -.tooltip[x-placement^='left'] > .arrow { - right: -4px; -} - -.tooltip[x-placement^='right'] > .arrow { - left: -4px; -} diff --git a/resources/sass/_variables.scss b/resources/sass/_variables.scss deleted file mode 100644 index 6da204e0..00000000 --- a/resources/sass/_variables.scss +++ /dev/null @@ -1,37 +0,0 @@ -// Body -$body-bg: #f8fafc; - -// Typography -$font-family-sans-serif: 'Nunito', sans-serif; -$font-size-base: 0.9rem; -$line-height-base: 1.6; - -// Colors -$blue: #3490dc; -$indigo: #6574cd; -$purple: #9561e2; -$pink: #f66d9b; -$red: #e3342f; -$orange: #f6993f; -$yellow: #ffed4a; -$green: #38c172; -$teal: #4dc0b5; -$cyan: #6cb2eb; - -$color1: #f3ebe4; -$color2: #07386a; -$color3: #0f437e; -$color4: #1e5ba1; -$color5: #4e3238; -$color6: #f79e15; -$color7: #e02125; -$color8: #ffb504; -$color9: #c6bcb3; -$color10: #999595; -$color11: #ab9d8e; - -// Theme -$theme-colors: ( - "primary": #3176C4, - //"secondary": #E7374B -); diff --git a/resources/sass/app.scss b/resources/sass/app.scss deleted file mode 100644 index 7f61edd9..00000000 --- a/resources/sass/app.scss +++ /dev/null @@ -1,33 +0,0 @@ -// Fonts -@import url('https://fonts.googleapis.com/css?family=Nunito'); - -//libs -//@import "@fortawesome/fontawesome-free"; -$fa-font-path: "../../webfonts"; -// Font-Awesome -@import "@fortawesome/fontawesome-free/scss/fontawesome"; -@import "@fortawesome/fontawesome-free/scss/regular"; -@import "@fortawesome/fontawesome-free/scss/solid"; -@import "@fortawesome/fontawesome-free/scss/brands"; -@import "@fancyapps/fancybox/dist/jquery.fancybox"; -@import '~tippy.js/dist/tippy.css'; -@import '~tippy.js/animations/scale.css'; -@import '~tippy.js/themes/light.css'; -@import '~tippy.js/themes/light-border.css'; -@import '~tippy.js/themes/translucent.css'; - -// Variables -//@import 'variables'; - - -@import 'classes'; -@import 'popup'; -@import 'icons'; - -// Bootstrap -@import '~bootstrap/scss/bootstrap'; - -@import 'dashboard'; - -@import './smoothdnd.scss'; -@import 'forms.scss'; diff --git a/resources/sass/bo/_dashboard.scss b/resources/sass/bo/_dashboard.scss new file mode 100644 index 00000000..5e8a2867 --- /dev/null +++ b/resources/sass/bo/_dashboard.scss @@ -0,0 +1,107 @@ +body { + font-size: 0.875rem; +} + +.lni { + width: 16px; + height: 16px; + font-size: 20px !important; + font-weight: bold !important; + vertical-align: text-bottom; +} + +/* + * Sidebar + */ + +.sidebar { + position: fixed; + z-index: 100; /* Behind the navbar */ + top: 0; + + /* rtl:raw: + right: 0; + */ + bottom: 0; + + /* rtl:remove */ + left: 0; + padding: 48px 0 0; /* Height of navbar */ + box-shadow: inset -1px 0 0 rgb(0 0 0 / 10%); +} + +@media (width <= 767.98px) { + .sidebar { + top: 5rem; + } + + .sidebar-sticky { + height: calc(100vh - 5rem); + } +} + +.sidebar-sticky { + position: relative; + top: 0; + overflow: hidden auto; /* Scrollable contents if viewport is shorter than content. */ + height: calc(100vh - 48px); + padding-top: 0.5rem; +} + +.sidebar .nav-link { + color: #333; + font-weight: 500; +} + +.sidebar .nav-link .lni { + margin-right: 8px; + color: #727272; +} + +.sidebar .nav-link.active { + color: #2470dc; +} + +.sidebar .nav-link:hover .lni, +.sidebar .nav-link.active .lni { + color: inherit; +} + +.sidebar-heading { + font-size: 0.75rem; + text-transform: uppercase; +} + +/* + * Navbar + */ + +.navbar-brand { + padding-top: 0.75rem; + padding-bottom: 0.75rem; + background-color: rgb(0 0 0 / 25%); + box-shadow: inset -1px 0 0 rgb(0 0 0 / 25%); + font-size: 1rem; +} + +.navbar .navbar-toggler { + top: 0.25rem; + right: 1rem; +} + +.navbar .form-control { + padding: 0.75rem 1rem; + border-width: 0; + border-radius: 0; +} + +.form-control-dark { + border-color: rgb(255 255 255 / 10%); + background-color: rgb(255 255 255 / 10%); + color: #fff; +} + +.form-control-dark:focus { + border-color: transparent; + box-shadow: 0 0 0 3px rgb(255 255 255 / 25%); +} diff --git a/resources/sass/bo/_forms.scss b/resources/sass/bo/_forms.scss new file mode 100644 index 00000000..0dc00b54 --- /dev/null +++ b/resources/sass/bo/_forms.scss @@ -0,0 +1,59 @@ +/* The switch - the box around the slider */ +.switch { + position: relative; + display: inline-block; + width: 60px; + height: 34px; + + /* Hide default HTML checkbox */ + input { + width: 0; + height: 0; + opacity: 0; + } +} + +/* The slider */ +.slider { + position: absolute; + background-color: #ccc; + cursor: pointer; + inset: 0; + transition: 0.4s; + + &::before { + position: absolute; + bottom: 4px; + left: 4px; + width: 26px; + height: 26px; + background-color: #fff; + content: ''; + transition: 0.4s; + } +} + +input:checked + .slider { + background-color: #2196f3; +} + +input:focus + .slider { + box-shadow: 0 0 1px #2196f3; +} + +input:checked + .slider::before { + transform: translateX(26px); +} + +/* Rounded sliders */ +.slider.round { + border-radius: 34px; +} + +.slider.round::before { + border-radius: 50%; +} + +.inco-data { + height: initial; +} diff --git a/resources/sass/bo/_icons.scss b/resources/sass/bo/_icons.scss new file mode 100644 index 00000000..00e9f8c9 --- /dev/null +++ b/resources/sass/bo/_icons.scss @@ -0,0 +1,13 @@ +.icon-size { + font-size: 20px; +} + +.cross-red { + color: #dc143c; + font-size: 20px; +} + +.check-green { + color: #2e8b57; + font-size: 20px; +} diff --git a/resources/sass/bo/base/_common.scss b/resources/sass/bo/base/_common.scss new file mode 100644 index 00000000..1ef8db24 --- /dev/null +++ b/resources/sass/bo/base/_common.scss @@ -0,0 +1,68 @@ +.mw-5 { + max-width: 5rem !important; +} + +.mw-6 { + max-width: 6rem !important; +} + +.mw-10 { + max-width: 10rem !important; +} + +.large-actionsbar-buttons { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; + + @include media-breakpoint-up(md) { + min-width: 5rem; + } +} + +.table { + &.fix-action { + th:last-child, + td:last-child { + position: sticky; + right: 0; + width: 0.1%; + background-color: $gray-200; + color: $gray-900; + white-space: nowrap; + } + } +} + +.bg-grey-50 { + background-color: #f6f8fb; +} + +.min-w-700px { + min-width: 700px !important; +} + +.autocomplete-dropdown { + z-index: 1050; + top: 100%; + display: none; + max-height: 250px; + overflow-y: auto; +} + +.cursor-pointer { + cursor: pointer; +} + +.w-fit { + width: fit-content; +} + +.select-none { + user-select: none; +} + +.form-group:has([required]) > label::after { + color: var(--bs-danger); + content: ' *'; +} diff --git a/resources/sass/bo/bo.scss b/resources/sass/bo/bo.scss new file mode 100644 index 00000000..152e0e7e --- /dev/null +++ b/resources/sass/bo/bo.scss @@ -0,0 +1,19 @@ +@charset "UTF-8"; + +// * UTILITIES +@import './utilities/variables'; + +// * VENDOR +@import './vendor/bootstrap'; +@import './utilities/checker'; + +// BASE +@import './base/common'; + +// Variables +@import 'icons'; + +// Bootstrap +@import 'dashboard'; +@import './smoothdnd'; +@import 'forms'; diff --git a/resources/sass/bo/smoothdnd.scss b/resources/sass/bo/smoothdnd.scss new file mode 100644 index 00000000..78c1f161 --- /dev/null +++ b/resources/sass/bo/smoothdnd.scss @@ -0,0 +1,30 @@ +.smooth-dnd-container { + margin: 1rem; + + &.pool { + display: block !important; + overflow: auto; + border: 1px solid #ccc; + + .card { + max-width: 15rem; + max-height: 15rem; + cursor: grab; + overflow-y: auto; + } + } + + &.selection { + min-width: 10rem; + min-height: 10rem; + border: 1px solid #ccc; + + .card { + overflow: scroll; + max-width: 15rem; + max-height: 15rem; + cursor: grab; + overflow-y: auto; + } + } +} diff --git a/resources/sass/bo/utilities/_bootstrap-variables.scss b/resources/sass/bo/utilities/_bootstrap-variables.scss new file mode 100644 index 00000000..aea99343 --- /dev/null +++ b/resources/sass/bo/utilities/_bootstrap-variables.scss @@ -0,0 +1,24 @@ +// Override bootstrap colors +$primary: $color-primary; +$secondary: $color-secondary; +$success: $color-success; +$info: $color-info; +$warning: $color-warning; +$danger: $color-danger; +$light: $color-light; +$dark: $color-dark; +$theme-colors: ( + primary: $primary, + secondary: $secondary, + success: $success, + info: $info, + warning: $warning, + danger: $danger, + light: $light, + dark: $dark, +); + +// Override bootstrap vars +$font-family-base: $font-default-family-base; +$font-size-base: $font-default-size-base; +$line-height-base: $line-default-height-base; diff --git a/resources/sass/bo/utilities/_checker.scss b/resources/sass/bo/utilities/_checker.scss new file mode 100644 index 00000000..8f2d843a --- /dev/null +++ b/resources/sass/bo/utilities/_checker.scss @@ -0,0 +1,27 @@ +@use 'sass:color'; + +/* stylelint-disable selector-no-qualifying-type */ +$color: color.scale($color-light, $lightness: -30%); + +tr.checker-line:has(input.checker:checked) { + background-color: $color; +} + +tr.checker-line:has(input.checker:checked) td { + background-color: $color !important; + transition: background-color 0.2s ease-in-out; +} + +tr.checker-line { + cursor: pointer; + user-select: none; +} + +tr.checker-line a, +tr.checker-line button { + cursor: pointer; +} + +tr.checker-line input { + cursor: default; +} diff --git a/resources/sass/bo/utilities/_variables.scss b/resources/sass/bo/utilities/_variables.scss new file mode 100644 index 00000000..e7c4b629 --- /dev/null +++ b/resources/sass/bo/utilities/_variables.scss @@ -0,0 +1,17 @@ +// * COLORS (WCAG AA accessible - minimum 4.5:1 contrast ratio vs white) +$color-white: #fff; +$color-light: #f8f9fa; +$color-dark: #212529; +$color-success: #157347; +$color-danger: #bb2d3b; +$color-info: #087990; +$color-warning: #946206; +$color-primary: #0b5ed7; +$color-secondary: #6c757d; + +// * FONTS +$font-default-family-base: system-ui, -apple-system, 'Segoe UI', 'Roboto', + 'Helvetica Neue', 'Arial', 'Noto Sans', 'Liberation Sans', sans-serif, + 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; // - The default site font family. +$font-default-size-base: 1rem; // Assumes the browser default, typically `16px` +$line-default-height-base: 1.5; diff --git a/resources/sass/bo/vendor/_bootstrap.scss b/resources/sass/bo/vendor/_bootstrap.scss new file mode 100644 index 00000000..75e3d270 --- /dev/null +++ b/resources/sass/bo/vendor/_bootstrap.scss @@ -0,0 +1,52 @@ +// 1. Include new custom variables +@import "./../utilities/bootstrap-variables"; + +// 2. Include functions first (so you can manipulate colors, SVGs, calc, etc) +@import "bootstrap/scss/functions"; + +// 3. Include remainder of required Bootstrap stylesheets +@import "bootstrap/scss/variables"; +@import "bootstrap/scss/variables-dark"; + +// 4. Include remainder of required parts +@import "bootstrap/scss/maps"; +@import "bootstrap/scss/mixins"; +@import "bootstrap/scss/utilities"; + +// 5. Optionally include any other parts as needed +@import "bootstrap/scss/root"; +@import "bootstrap/scss/reboot"; +@import "bootstrap/scss/type"; +@import "bootstrap/scss/images"; +@import "bootstrap/scss/containers"; +@import "bootstrap/scss/grid"; +@import "bootstrap/scss/tables"; +@import "bootstrap/scss/forms"; +@import "bootstrap/scss/buttons"; +@import "bootstrap/scss/transitions"; +@import "bootstrap/scss/dropdown"; +@import "bootstrap/scss/button-group"; +@import "bootstrap/scss/nav"; +@import "bootstrap/scss/navbar"; +@import "bootstrap/scss/card"; +@import "bootstrap/scss/accordion"; +@import "bootstrap/scss/breadcrumb"; +@import "bootstrap/scss/pagination"; +@import "bootstrap/scss/badge"; +@import "bootstrap/scss/alert"; +@import "bootstrap/scss/progress"; +@import "bootstrap/scss/list-group"; +@import "bootstrap/scss/close"; +@import "bootstrap/scss/toasts"; +@import "bootstrap/scss/modal"; +@import "bootstrap/scss/tooltip"; +@import "bootstrap/scss/popover"; +@import "bootstrap/scss/carousel"; +@import "bootstrap/scss/spinners"; +@import "bootstrap/scss/offcanvas"; +@import "bootstrap/scss/placeholders"; + +@import "bootstrap/scss/helpers"; + +// 6. Optionally include utilities API last to generate classes based on the Sass map in `_utilities.scss` +@import "bootstrap/scss/utilities/api"; diff --git a/resources/sass/fo/base/_common.scss b/resources/sass/fo/base/_common.scss new file mode 100644 index 00000000..d145ec05 --- /dev/null +++ b/resources/sass/fo/base/_common.scss @@ -0,0 +1,171 @@ +.font-barlow { + @include font-family-barlow; +} + +.full-page > main { + padding: 0 !important; +} + +.z-md-0 { + @media (width >= 768px) { + z-index: 0 !important; + } +} + +.mw-5 { + max-width: 5rem !important; +} + +.mw-6 { + max-width: 6rem !important; +} + +.mw-10 { + max-width: 10rem !important; +} + +.mw-13 { + max-width: 13rem !important; +} + +.mh-10 { + max-height: 10rem !important; +} + +.mh-100vh { + min-height: 100vh !important; +} + +.mh-90vh { + min-height: 90vh !important; +} + +.cursor-pointer { + cursor: pointer !important; +} + +.pointer-events-none { + pointer-events: none !important; +} + +.w-4 { + width: 4rem; +} + +.h-logo { + width: auto; + max-width: 100%; + height: 3rem; + + @media (width >= 768px) { + height: 3.2rem; + } +} + +.mh-50px { + max-height: 50px !important; +} + +.wh-20px { + width: 20px !important; + height: 20px !important; +} + +.wh-32px { + width: 32px !important; + height: 32px !important; +} + +.mh-250px-scroll { + max-height: 250px !important; + overflow-y: auto !important; +} + +.mh-350px-scroll { + max-height: 350px !important; + overflow-y: auto !important; +} + +.fs-4rem { + font-size: 4rem !important; +} + +.min-h-300px { + min-height: 300px !important; +} + +.wh-10rem { + width: 10rem !important; + height: 10rem !important; +} + +.mh-150px { + max-height: 150px !important; +} + +.mw-80px { + max-width: 80px !important; +} + +.leaflet-popup-title { + display: block; + margin-bottom: 4px; + font-size: 1.1em; +} + +#fo-toast-container { + z-index: 1080 !important; + + @media (width > 767.98px) { + width: 90vw; + inset: 4rem auto auto 50% !important; + transform: translateX(-50%) !important; + } + + inset: 4rem auto auto 50% !important; + transform: translateX(-50%) !important; +} + +@media (width >= 992px) { + .sticky-lg-top-navbar { + position: sticky !important; + top: 5rem !important; + } +} + +.spinner-border-xl { + width: 4rem; + height: 4rem; + border-width: 0.25rem; +} + +#search:focus { + border-color: var(--bs-dark) !important; + box-shadow: 0 0 0 0.25rem rgb(var(--bs-dark-rgb), 0.5) !important; +} + + +#hero-carousel { + height: 75vh; + min-height: 400px; + max-height: 800px; + + img { + max-height: 45vh; + } +} + +.scroll-m-top-96 { + scroll-margin-top: 6rem !important; +} + +.bottom-n15px { + bottom: -15px !important; +} + +.form-floating > .form-control[required] ~ label::after, +.form-floating > .form-select[required] ~ label::after, +.form-check:has([required]) > label::after { + color: var(--bs-danger); + content: ' *'; +} diff --git a/resources/sass/fo/base/_fonts.scss b/resources/sass/fo/base/_fonts.scss new file mode 100644 index 00000000..134493b6 --- /dev/null +++ b/resources/sass/fo/base/_fonts.scss @@ -0,0 +1,179 @@ +@font-face { + font-display: swap; + font-family: Barlow; + font-style: italic; + font-weight: 200; + src: url('./../../../assets/fonts/Barlow-ExtraLightItalic.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-ExtraLightItalic.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: italic; + font-weight: normal; + src: url('./../../../assets/fonts/Barlow-Italic.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-Italic.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: normal; + font-weight: 300; + src: url('./../../../assets/fonts/Barlow-Light.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-Light.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: italic; + font-weight: 300; + src: url('./../../../assets/fonts/Barlow-LightItalic.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-LightItalic.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: normal; + font-weight: 500; + src: url('./../../../assets/fonts/Barlow-Medium.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-Medium.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: italic; + font-weight: 500; + src: url('./../../../assets/fonts/Barlow-MediumItalic.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-MediumItalic.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: normal; + font-weight: normal; + src: url('./../../../assets/fonts/Barlow-Regular.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-Regular.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: normal; + font-weight: 600; + src: url('./../../../assets/fonts/Barlow-SemiBold.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-SemiBold.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: italic; + font-weight: 600; + src: url('./../../../assets/fonts/Barlow-SemiBoldItalic.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-SemiBoldItalic.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: normal; + font-weight: 100; + src: url('./../../../assets/fonts/Barlow-Thin.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-Thin.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: italic; + font-weight: 100; + src: url('./../../../assets/fonts/Barlow-ThinItalic.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-ThinItalic.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: normal; + font-weight: 900; + src: url('./../../../assets/fonts/Barlow-Black.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-Black.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: italic; + font-weight: 900; + src: url('./../../../assets/fonts/Barlow-BlackItalic.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-BlackItalic.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: normal; + font-weight: bold; + src: url('./../../../assets/fonts/Barlow-Bold.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-Bold.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: italic; + font-weight: bold; + src: url('./../../../assets/fonts/Barlow-BoldItalic.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-BoldItalic.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: normal; + font-weight: bold; + src: url('./../../../assets/fonts/Barlow-ExtraBold.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-ExtraBold.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: italic; + font-weight: bold; + src: url('./../../../assets/fonts/Barlow-ExtraBoldItalic.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-ExtraBoldItalic.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: Barlow; + font-style: normal; + font-weight: 200; + src: url('./../../../assets/fonts/Barlow-ExtraLight.woff2') format('woff2'), + url('./../../../assets/fonts/Barlow-ExtraLight.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: 'Barlow Condensed'; + font-style: normal; + font-weight: 500; + src: url('./../../../assets/fonts/BarlowCondensed-Medium.woff2') format('woff2'), + url('./../../../assets/fonts/BarlowCondensed-Medium.woff') format('woff'); +} + +@font-face { + font-display: swap; + font-family: 'Barlow Condensed'; + font-style: normal; + font-weight: 600; + src: url('./../../../assets/fonts/BarlowCondensed-SemiBold.woff2') format('woff2'), + url('./../../../assets/fonts/BarlowCondensed-SemiBold.woff') format('woff'); +} diff --git a/resources/sass/fo/base/_typography.scss b/resources/sass/fo/base/_typography.scss new file mode 100644 index 00000000..d880cf55 --- /dev/null +++ b/resources/sass/fo/base/_typography.scss @@ -0,0 +1,29 @@ +h1, +.h1 { + color: #111827; + font-size: clamp(3rem, 7vw, 5rem); + font-weight: 800; + letter-spacing: -0.04em; + line-height: 1.1; + text-wrap: balance; +} + +h2, +.h2 { + color: #111827; + font-size: clamp(2.5rem, 6vw, 4rem); + font-weight: 800; + letter-spacing: -0.03em; + line-height: 1.2; + text-wrap: balance; +} + +h3, +.h3 { + color: #374151; + font-size: clamp(2rem, 4vw, 3rem); + font-weight: 700; + letter-spacing: -0.02em; + line-height: 1.25; + text-wrap: balance; +} diff --git a/resources/sass/fo/fo.scss b/resources/sass/fo/fo.scss new file mode 100644 index 00000000..042da33a --- /dev/null +++ b/resources/sass/fo/fo.scss @@ -0,0 +1,13 @@ +// UTILITIES +@import './utilities/variables'; +@import './utilities/mixins'; + +// LIBS +@import './vendor/bootstrap'; +@import './vendor/sliders'; +@import './vendor/cookies'; + +// BASE +@import './base/fonts'; +@import './base/common'; +@import './base/typography'; diff --git a/resources/sass/fo/utilities/_bootstrap-custom.scss b/resources/sass/fo/utilities/_bootstrap-custom.scss new file mode 100644 index 00000000..80e8c024 --- /dev/null +++ b/resources/sass/fo/utilities/_bootstrap-custom.scss @@ -0,0 +1,36 @@ +@use 'sass:map'; + +// ADD SOME CLASSES IN BOOTSTRAP BREAKPOINTS +@each $type, $classes, $keys in $targets { + @each $key, $data in $keys { + @each $breakpoint in map.keys($grid-breakpoints) { + @include media-breakpoint-up($breakpoint) { + .#{$type}-#{$breakpoint}-#{$key} { + @each $class in $classes { + #{$class}: #{$data} !important; + } + } + } + } + } +} + +// ADDITIONAL BOOTSTRAP IMPORTS +.row {margin: 0;} + +.stretched-link::after { + cursor: pointer; +} + +.btn-tertiary { + border-color: var(--bs-dark) !important; +} + +.focus-ring-dark { + --bs-focus-ring-color: rgb(var(--bs-dark-rgb), 0.25) !important; +} + + +.btn-tertiary:hover { + background-color: rgb(var(--bs-light-rgb), 0.85) !important; +} diff --git a/resources/sass/fo/utilities/_bootstrap-variables.scss b/resources/sass/fo/utilities/_bootstrap-variables.scss new file mode 100644 index 00000000..a9d7cdac --- /dev/null +++ b/resources/sass/fo/utilities/_bootstrap-variables.scss @@ -0,0 +1,72 @@ +@use 'sass:map'; + +$primary: $color-primary; +$secondary: $color-secondary; +$tertiary: $color-tertiary; +$success: $color-success; +$info: $color-info; +$warning: $color-warning; +$danger: $color-danger; +$light: $color-light; +$dark: $color-dark; +$custom-theme-colors: ( + primary: $primary, + secondary: $secondary, + tertiary: $tertiary, + success: $success, + info: $info, + warning: $warning, + danger: $danger, + light: $light, + dark: $dark +); +$enable-shadows: true; +$min-contrast-ratio: 4.5; +$color-contrast-dark: $dark; +$color-contrast-light: $color-white; +$link-color: $dark; +$link-decoration: underline; +$link-hover-color: tint-color($color-dark, 20%); +$position-values: ( + 0: 0, + 15: 15%, + 25: 25%, + 33: 33%, + 50: 50%, + 66: 66%, + 75: 75%, + 85: 85%, + 100: 100% +); +$targets: ( + 'w' ('width') (0:0%, 8:8rem, 25:25%, 50:50%, 75:75%, 100:100%, auto:auto, fit:fit-content), + 'h' ('height') (0:0%, 25:25%, 50:50%, 75:75%, 100:100%, auto:auto, fit:fit-content), + 'opacity' ('opacity') (0:0, 25:0.25, 50:0.5, 75:0.75, 100:1), + 'position' ('position') (relative:relative, absolute:absolute, fixed:fixed, sticky:sticky), + 'text' ('text') (center:center, start:left, end:right), + 'd' ('display') (block:block, flex:flex, table-header-group:table-header-group, table-cell:table-cell, none:none) +); + +// * CARDS +$card-bg: $color-white; +$card-border-color: rgba($dark, 0.05); +$card-box-shadow: 0 0.25rem 0.75rem rgba($dark, 0.08); + +// * BORDER RADIUS +$btn-border-radius: 1rem !default; +$btn-border-radius-sm: 0.5rem !default; +$btn-border-radius-lg: 1.5rem !default; +$input-border-radius: $btn-border-radius; +$input-border-radius-sm: $btn-border-radius-sm; +$input-border-radius-lg: $btn-border-radius-lg; + +// * FORMS +$form-file-button-bg: var(--bs-secondary-bg, #e9ecef); +$form-file-button-color: var(--bs-body-color, #212529); +$form-file-button-hover-bg: var(--bs-secondary-bg, #e9ecef); +$form-file-button-hover-color: var(--bs-body-color, #212529); + +// * ACCORDION +$accordion-color: var(--bs-body-color); +$accordion-button-active-bg: var(--bs-primary); +$accordion-button-active-color: var(--bs-light-text); diff --git a/resources/sass/fo/utilities/_mixins.scss b/resources/sass/fo/utilities/_mixins.scss new file mode 100644 index 00000000..a6f640d1 --- /dev/null +++ b/resources/sass/fo/utilities/_mixins.scss @@ -0,0 +1,41 @@ +@mixin font-family-barlow { + font-family: $font-barlow; +} + +@mixin d-flex($direction, $justify, $align) { + display: flex; + flex-direction: $direction !important; + justify-content: $justify !important; + + $align-items: $align !important; +} + +@mixin btn($color, $border, $backgroundColor) { + border: $border; + background-color: $backgroundColor; + color: $color; + + &:hover, + &:focus { + @include btn-hover(var(--bs-dark), none, 0, var(--cocote-color), var(--bs-box-shadow)); + } +} + +@mixin btn-hover($color, $border, $radius, $backgroundColor, $shadow) { + border: $border; + background-color: $backgroundColor !important; + box-shadow: $shadow; + color: $color !important; +} + +@mixin visibility($opacity, $visibility) { + opacity: $opacity; + + $visibility: $visibility; +} + +@mixin background-img { + background-position: center; + background-repeat: no-repeat; + background-size: 50%; +} diff --git a/resources/sass/fo/utilities/_variables.scss b/resources/sass/fo/utilities/_variables.scss new file mode 100644 index 00000000..cb8cb021 --- /dev/null +++ b/resources/sass/fo/utilities/_variables.scss @@ -0,0 +1,29 @@ +$color-cocotte: #f6c500; +$color-white: #fff; +$color-light: #f8f9fa; +$color-dark: #212529; + +// * COLORS +$color-success: #3a8a00; +$color-danger: #d60051; +$color-secondary: #5c636a; +$color-info: #045487; +$color-warning: #ffc454; +$color-primary: $color-cocotte; +$color-tertiary: #f8f6ed; + +// * BODY +$body-bg: #f8f9fa; +$body-color: $color-dark; + +// * FONTS +$font-barlow: 'Barlow', 'Franklin Gothic Medium', 'Arial Narrow', sans-serif; +$font-family-base: $font-barlow; +$font-size-base: 1rem; +$line-height-base: 1.5; +$font-weight-base: 500; + +:root { + --cocote-color: #{$color-cocotte}; + --cocotte-dark: color-mix(in srgb, var(--cocote-color), rgb(0 0 0 / 50%) 25%); +} diff --git a/resources/sass/fo/vendor/_bootstrap.scss b/resources/sass/fo/vendor/_bootstrap.scss new file mode 100644 index 00000000..dcc06686 --- /dev/null +++ b/resources/sass/fo/vendor/_bootstrap.scss @@ -0,0 +1,61 @@ +@use "sass:map"; + +// 1. Required Bootstrap functions +@import "bootstrap/scss/functions"; + +// 2. Custom variables +@import "./../utilities/bootstrap-variables"; + +// 3. Bootstrap's default variables +@import "bootstrap/scss/variables"; +@import "bootstrap/scss/variables-dark"; + +// 4. Merging Maps +$theme-colors: map.merge($theme-colors, $custom-theme-colors); + +// 5. Remaining required Bootstrap files +@import "bootstrap/scss/maps"; +@import "bootstrap/scss/mixins"; +@import "bootstrap/scss/utilities"; +@import "bootstrap/scss/root"; +@import "bootstrap/scss/reboot"; + +// 6. Your optional Bootstrap components +@import "bootstrap/scss/root"; +@import "bootstrap/scss/reboot"; +@import "bootstrap/scss/type"; +@import "bootstrap/scss/images"; +@import "bootstrap/scss/containers"; +@import "bootstrap/scss/grid"; +@import "bootstrap/scss/tables"; +@import "bootstrap/scss/forms"; +@import "bootstrap/scss/buttons"; +@import "bootstrap/scss/transitions"; +@import "bootstrap/scss/dropdown"; +@import "bootstrap/scss/button-group"; +@import "bootstrap/scss/nav"; +@import "bootstrap/scss/navbar"; +@import "bootstrap/scss/card"; +@import "bootstrap/scss/accordion"; +@import "bootstrap/scss/breadcrumb"; +@import "bootstrap/scss/pagination"; +@import "bootstrap/scss/badge"; +@import "bootstrap/scss/alert"; +@import "bootstrap/scss/progress"; +@import "bootstrap/scss/list-group"; +@import "bootstrap/scss/close"; +@import "bootstrap/scss/toasts"; +@import "bootstrap/scss/modal"; +@import "bootstrap/scss/tooltip"; +@import "bootstrap/scss/popover"; +@import "bootstrap/scss/carousel"; +@import "bootstrap/scss/spinners"; +@import "bootstrap/scss/offcanvas"; +@import "bootstrap/scss/placeholders"; +@import "bootstrap/scss/helpers"; + +// 7. Generating the Bootstrap utilities API +@import "bootstrap/scss/utilities/api"; + +// 8. Customized +@import "./../utilities/bootstrap-custom"; diff --git a/resources/views/front/sable/sass/vendor/_cookies.scss b/resources/sass/fo/vendor/_cookies.scss similarity index 60% rename from resources/views/front/sable/sass/vendor/_cookies.scss rename to resources/sass/fo/vendor/_cookies.scss index 74839fe9..c47f348d 100644 --- a/resources/views/front/sable/sass/vendor/_cookies.scss +++ b/resources/sass/fo/vendor/_cookies.scss @@ -1,30 +1,34 @@ -@import "~@ldc-web/cookie-notice/dist/browser/cookie-cn.css"; +@import "@ldc-web/cookie-notice/src/scss/themes/standard"; @import './../utilities/variables'; +:root { + --cs-primary-color: initial; +} + #cn-wrapper { p:not(.cn-modal-title), .cn-cookie-description { - color: $dark !important; + color: var(--bs-dark) !important; } .cn-nav #cn-deny-banner, .cn-nav #cn-accept-banner, .cn-nav #cn-settings-banner { font-weight: bolder; - background-color: $dark !important; - color: $white !important; + background-color: var(--bs-dark) !important; + color: var(--bs-white) !important; &:hover, &:focus { - background-color: $orange !important; - color: $dark !important; + background-color: var(--cocote-color) !important; + color: var(--bs-dark) !important; } } .cn-content { .cn-switch input { &:checked + span { - background: $orange !important; + background: var(--cocote-color) !important; &::before { left: 2rem !important; @@ -37,7 +41,7 @@ .cn-modal-container .cn-cookie-name, .cn-banner-content .cn-banner-text .cn-banner-title { - color: $orange !important; + color: var(--cocote-color) !important; } } diff --git a/resources/sass/fo/vendor/_sliders.scss b/resources/sass/fo/vendor/_sliders.scss new file mode 100644 index 00000000..96a242d4 --- /dev/null +++ b/resources/sass/fo/vendor/_sliders.scss @@ -0,0 +1,100 @@ +#products-carousel { + position: relative; + + &.has-controls, + &:has(.carousel-control-prev) { + @include media-breakpoint-up(lg) { + padding-left: 3.5rem; + padding-right: 3.5rem; + } + } + + .carousel-inner { + display: flex !important; + flex-wrap: nowrap !important; + overflow-x: auto !important; + scroll-behavior: smooth; + scrollbar-width: none; + + &::-webkit-scrollbar { + display: none; + } + } + + .carousel-item { + margin-right: 0 !important; + transition: none !important; + } + + .carousel-control-prev, + .carousel-control-next { + position: absolute; + top: 50%; + bottom: auto; + z-index: 5; + display: flex; + align-items: center; + justify-content: center; + width: 44px; + height: 44px; + padding: 0; + color: var(--bs-dark); + cursor: pointer; + background-color: var(--bs-primary); + border: 1px solid rgba(0, 0, 0, 0.08); + border-radius: 50%; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); + opacity: 1; + filter: none; + transform: translateY(-50%); + transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; + + &:hover, + &:focus-visible { + color: var(--bs-dark); + background-color: color-mix(in srgb, var(--bs-primary) 85%, black); + box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2); + opacity: 1; + transform: translateY(-50%) scale(1.08); + } + + &:active { + transform: translateY(-50%) scale(0.96); + } + } + + .carousel-control-prev { + left: 0.5rem; + } + + .carousel-control-next { + right: 0.5rem; + } +} + +.carousel-indicators { + gap: .5rem; + + + [data-bs-target] { + border: 2px solid var(--bs-dark) !important; + background-color: rgba(var(--bs-dark-rgb), .15) !important; + opacity: 1; + border-radius: .2rem; + width: 1.125rem; + height: 1.125rem; + margin: 0; + padding: 0; + text-indent: -999px; /* keep bootstrap native text hiding */ + transition: background-color .2s, transform .2s, border-radius .2s; + } + + .active { + background-color: var(--bs-dark) !important; + transform: scale(1.05); + border-radius: 50%; /* from previous instruction 'celui selectionné soit rond' */ + } +} + +#hero-carousel { +} diff --git a/resources/sass/smoothdnd.scss b/resources/sass/smoothdnd.scss deleted file mode 100644 index 7c29699e..00000000 --- a/resources/sass/smoothdnd.scss +++ /dev/null @@ -1,28 +0,0 @@ -.smooth-dnd-container { - margin: 1rem; - &.pool { - border: 1px solid #ccc; - display: block !important; - overflow: auto; - .card { - cursor: grab; - max-height: 15rem; - max-width: 15rem; - overflow-y: auto; - } - } - - &.selection { - border: 1px solid #ccc; - min-height: 10rem; - min-width: 10rem; - - .card { - cursor: grab; - max-height: 15rem; - max-width: 15rem; - overflow: scroll; - overflow-y: auto; - } - } -} diff --git a/resources/ts/bo/base/common.ts b/resources/ts/bo/base/common.ts new file mode 100644 index 00000000..e69de29b diff --git a/resources/ts/bo/bo.ts b/resources/ts/bo/bo.ts new file mode 100644 index 00000000..ebd0d04c --- /dev/null +++ b/resources/ts/bo/bo.ts @@ -0,0 +1,17 @@ +// ASSETS +import.meta.glob("../../assets/images/**/*", { eager: true }); + +// UTILITIES +import "./utilities/bootstrap"; +import "./utilities/checker"; +import "./utilities/fontawesome"; +import "./utilities/money-input"; +import "./utilities/vue-bo"; + +// MODULES +import "./../modules/sweetalert"; +import { confirm } from "./../modules/sweetalert-confirm"; +globalThis.SweetAlertConfirm = confirm; + +// CUSTOM +import "./base/common"; diff --git a/resources/ts/bo/components/BelongsToManyDropdownComponent.vue b/resources/ts/bo/components/BelongsToManyDropdownComponent.vue new file mode 100644 index 00000000..45dd29b2 --- /dev/null +++ b/resources/ts/bo/components/BelongsToManyDropdownComponent.vue @@ -0,0 +1,191 @@ +<template> + <div class="belongs-to-many-dropdown"> + <Transition name="fade"> + <p + v-if="message" + class="message" + > + {{ message }} + </p> + </Transition> + + <div class="d-inline-block tagInput w-100"> + <Multiselect + v-model="selectedItems" + mode="tags" + :options="allItems" + :searchable="true" + :object="true" + value-prop="id" + label="text" + track-by="text" + :max="max ?? undefined" + :placeholder="placeholder" + :create-option="allowNew" + :no-results-text="trans('No results found.')" + :no-options-text="trans('The list is empty.')" + @select="checkMaxLimit" + @deselect="checkMinLimit" + /> + </div> + + <input + v-if="!selectedItems.length" + :name="name" + type="hidden" + value="" + > + <template + v-for="(sItem, index) in selectedItems" + :key="index" + > + <p class="text-danger m-0"> + {{ parseValidationInput(`${name}[${String(index)}][name]`, allErrors) }} + </p> + + <template v-if="!isNewItem(sItem)"> + <input + :name="`${name}[${String(index)}][id]`" + type="hidden" + :value="sItem.id" + > + <input + :name="`${name}[${String(index)}][value]`" + type="hidden" + :value="sItem.id" + > + </template> + + <input + :name="`${name}[${String(index)}][name]`" + type="hidden" + :value="sItem.text" + > + <input + :name="`${name}[${String(index)}][label]`" + type="hidden" + :value="sItem.text" + > + <input + :name="`${name}[${String(index)}][title]`" + type="hidden" + :value="sItem.text" + > + </template> + </div> +</template> + +<script setup lang="ts"> +import Multiselect from "@vueform/multiselect"; +import slugify from "slugify"; +import { nextTick, onBeforeMount, onMounted, ref, useAttrs } from "vue"; + +import { parseValidationInput } from "@modules/parseLaravelErrorMessages"; +import { trans } from "@modules/trans"; + +defineOptions({ name: "BelongsToManyDropdownComponent" }); + +interface CustomTag { + id?: string | number; + name?: string; + label?: string; + title?: string; + text?: string; + slug?: string; +} + +const attrs = useAttrs(); + +const name = ref<string>(""); +const selectedItems = ref<Array<CustomTag>>([]); +const allItems = ref<Array<CustomTag>>([]); +const placeholder = ref<string>(""); +const min = ref<number>(0); +const max = ref<number | null>(null); +const allErrors = ref<Record<string, Array<string>>>({}); +const message = ref<string | null>(null); + +const allowNew = ref<boolean>(false); + +onBeforeMount(() => { + if (!attrs.json) { + throw new Error("this component requires json"); + } +}); + +onMounted(() => { + const json = String(attrs.json ?? "{}"); + const data = JSON.parse(json); + + name.value = data.name; + selectedItems.value = parseTags(data.value || []); + allItems.value = parseTags(data.itemsList || []); + placeholder.value = data.placeholder; + + const rawAllowNew = data.allowNew ?? attrs.allowNew ?? false; + allowNew.value = rawAllowNew === true || rawAllowNew === "true"; + + const parsedMin = Number.parseInt((data?.itemLimit ?? [])[0] ?? 0); + min.value = Math.max(0, parsedMin); + + const parsedMax = Number.parseInt((data?.itemLimit ?? [])[1] ?? 0); + max.value = parsedMax <= min.value ? null : parsedMax; + + allErrors.value = data.errors || {}; +}); + +const parseTags = (items: Array<CustomTag>): Array<CustomTag> => { + return items.map((i: CustomTag) => { + i.text = String(i.label ?? i.name ?? i.title); + i.slug = String(i.slug ?? slugify(i.text)); + return i; + }); +}; + +const isNewItem = (item: CustomTag): boolean => { + return !allItems.value.some((i) => String(i.id) === String(item.id)); +}; + +const checkMaxLimit = () => { + if (max.value && selectedItems.value.length >= max.value) { + message.value = trans("Maximum number of elements reached."); + setTimeout(() => (message.value = null), 1500); + } +}; + +const checkMinLimit = async (removedOption: CustomTag) => { + if (selectedItems.value.length < min.value) { + message.value = trans("Minimum number of elements reached."); + setTimeout(() => (message.value = null), 1500); + + await nextTick(); + selectedItems.value.push(removedOption); + } +}; +</script> + +<style lang="scss"> +@import '@vueform/multiselect/themes/default.css'; + +.belongs-to-many-dropdown { + .message { + color: var(--bs-danger); + } + + .fade-enter-active, + .fade-leave-active { + transition: opacity 0.5s ease; + } + + .fade-enter-from, + .fade-leave-to { + opacity: 0; + } + + :root { + --ms-tag-bg: var(--bs-blue); + --ms-tag-color: #ffffff; + --ms-radius: 0.375rem; + } +} +</style> diff --git a/resources/ts/bo/components/CkEditorComponent.vue b/resources/ts/bo/components/CkEditorComponent.vue new file mode 100644 index 00000000..0481dce6 --- /dev/null +++ b/resources/ts/bo/components/CkEditorComponent.vue @@ -0,0 +1,370 @@ +<template> + <div class="ck-editor-component"> + <div ref="wordCounter" /> + <div ref="ckeditor" /> + <input + ref="hiddenInput" + :id="id" + class="form-control" + type="hidden" + :name="name" + :value="text" + :required="required" + > + </div> +</template> + +<script lang="ts" setup> +import { ClassicEditor, Editor, type EditorConfig } from "ckeditor5"; +import { + computed, + onBeforeUnmount, + onMounted, + reactive, + ref, + shallowRef, + useAttrs, +} from "vue"; + +import { builtinPlugins, frTranslations, normalizeEditorText } from "@modules/ckeditor"; +import { uniqueId } from "@modules/uniqueid"; + +import "ckeditor5/ckeditor5.css"; + +defineOptions({ name: "CkEditorComponent", }); + +// * EMITS +const emits = defineEmits<{ + input: [string: string], +}>(); + +// * ATTRIBUTES +const attrs = useAttrs(); + +// * REFS +const ckeditor = ref<HTMLDivElement | null>(null); +const wordCounter = ref<HTMLDivElement | null>(null); +const hiddenInput = ref<HTMLInputElement | null>(null); +const editorInstance = shallowRef<Editor | null>(null); + +// * PROPS +const props = defineProps({ + id: { + type: String, + default: () => uniqueId(), + }, + name: { + type: String, + default: "" + }, + dbtext: { + type: String, + default: "" + }, + required: { + type: Boolean, + default: false + }, +}); + +// * DATA +const id = ref<string>(props.id); +const name = ref<string>(props.name); +const text = ref<string>(normalizeEditorText(props.dbtext)); +const required = ref<boolean>(props.required); + +/** Counter parameters. */ +const counterParameters = reactive<{ + words: number, + chars: number, +}>({ + words: 0, + chars: 0, +}); + +// * COMPUTED +const isUsedWithProps = computed<boolean>(() => attrs.json === undefined); + +function getNavbarHeight(): number { + const navbar = document.querySelector(".sticky-top .navbar") ?? document.querySelector(".sticky-top"); + return navbar ? Math.round(navbar.getBoundingClientRect().height) : 48; +} + +const handleResize = (): void => { + if (editorInstance.value) { + editorInstance.value.ui.viewportOffset = {top: getNavbarHeight(),}; + } +}; + +// * LIFECYCLE +onMounted(() => { + const json = String(attrs.json ?? "{}"), + data = JSON.parse(json); + if (!isUsedWithProps.value) { + if (data.id) id.value = String(data.id); + if (data.name) name.value = String(data.name); + text.value = normalizeEditorText(data.text); + if (data.required) required.value = Boolean(data.required); + void makeSuperBuild(); + } + + hiddenInput.value?.addEventListener("ss:ck:set-data", onExternalSetData as EventListener); + window.addEventListener("resize", handleResize); +}); + +onBeforeUnmount(() => { + hiddenInput.value?.removeEventListener("ss:ck:set-data", onExternalSetData as EventListener); + window.removeEventListener("resize", handleResize); +}); + +// * METHODS +async function makeSuperBuild(): Promise<void> { + + const editorConfig: EditorConfig = { + ui: {viewportOffset: {top: getNavbarHeight()}}, + attachTo: ckeditor.value as HTMLElement, + plugins: builtinPlugins, + translations: [frTranslations], + wordCount: { + container: wordCounter.value as HTMLElement, + onUpdate: (stats: { characters: number; words: number }) => { + counterParameters.chars = stats.characters; + counterParameters.words = stats.words; + }, + }, + link: { + // Automatically add target="_blank" and rel="noopener noreferrer" to all external links. + addTargetToExternalLinks: true, + + // Let the users control the "download" attribute of each link. + decorators: { + openInNewTab: { + mode: "manual", + label: "Ouvrir dans un nouvel onglet", + attributes: { target: "_blank", } + } + } + }, + typing: { + transformations: { + include: [], + extra: [ + { from: ":)", to: "😊" }, + { from: ":-P", to: "😛" }, + { from: "8-)", to: "😎" }, + { from: ";-)", to: "😉" }, + { from: ":-D", to: "😄" }, + { from: ":twisted:", to: "😈" }, + { from: ":mrgreen:", to: "😁" }, + { from: ":lol:", to: "😆" }, + { from: ":roll:", to: "🙄" }, + { from: ":-?", to: "😕" }, + { from: ":cry:", to: "😢" }, + { from: ":-o", to: "😮" }, + { from: ":evil:", to: "😡" }, + { from: ":-|", to: "😐" }, + { from: ":oops:", to: "😳" }, + { from: ":-x", to: "😠" }, + { from: "8-O", to: "😲" }, + { from: ":-(", to: "😧" }, + { from: ":arrow:", to: "➡" }, + { from: ":idea:", to: "💡" }, + ], + }, + }, + mediaEmbed: { + previewsInData: false, + removeProviders: [ + "dailymotion", + "spotify", + "youtube", + "vimeo", + "instagram", + "twitter", + "googleMaps", + "flickr", + "facebook", + ], + // // see https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-media-embed/src/mediaembedediting.js + // providers: [ + // { + // // display local videos in oembed tags + // name: "localVideo", + // url: /^(\/(?:content|storage|uploads)\/.*)/, + // html: (match: string[]) => { + // const path = match[1]; + + // return ( + // "<video controls allowfullscreen style=\"max-width: 90%; margin: 0 auto; display: block;\">" + + // `<source src="${path}" type="video/mp4">` + + // `<p>Votre navigateur ne prend pas en charge les vidéos HTML5. Voici <a href="${path}">un lien pour télécharger la vidéo</a>.</p>` + + // "</video>" + // ); + // }, + // }, + // ], + }, + toolbar: { + items: [ + "heading", + "|", + "findAndReplace", + "|", + "bold", + "italic", + "underline", + "strikethrough", + "link", + "bulletedList", + "numberedList", + "code", + "codeBlock", + "|", + "outdent", + "indent", + "alignment", + "|", + "undo", + "redo", + "selectAll", + "|", + "blockQuote", + "|", + "insertTable", + "tableColumn", + "tableRow", + "mergeTableCells", + "|", + "highlight", + "removeHighlight", + "fontColor", + "fontBackgroundColor", + "fontFamily", + "fontSize", + "horizontalLine", + "specialCharacters", + "|", + "removeFormat", + "|", + "sourceEditing", + ], + }, + table: { + contentToolbar: [ + "tableColumn", + "tableRow", + "mergeTableCells", + "tableProperties", + "tableCellProperties", + "toggleTableCaption", + ], + + // Configuration of the TableProperties plugin. + tableProperties: {}, + + // Configuration of the TableCellProperties plugin. + tableCellProperties: {}, + }, + language: "fr", + image: { + toolbar: [ + "toggleImageCaption", + "imageTextAlternative", + "imageStyle:inline", + "imageStyle:alignLeft", + "imageStyle:alignRight", + "imageStyle:alignCenter", + "imageStyle:side", + "imageResize", + "linkImage", + ], + }, + }; + + ClassicEditor.create({ ...editorConfig, licenseKey: "GPL" }) + .then((editor: Editor) => { + let timer: ReturnType<typeof setTimeout> | null = null; + const updateContent = () => { + const data = editor.getData(); + text.value = data; + emits("input", data); + timer = null; + }; + // Display all toolbar elements + // console.log(Array.from(editor.ui.componentFactory.names())); + editorInstance.value = editor; + ckeditor.value = Object.freeze(editor) as never; + editor.setData(text.value); + editor.model.document.on("change:data", () => { + if (timer) { + clearTimeout(timer); + } + // * Keep track of internal editor + timer = setTimeout(updateContent, 1000); + }); + }) + .catch((error: unknown) => { + console.error("Oops, something went wrong!"); + console.error( + "Please, report the following error on https://github.com/ckeditor/ckeditor5/issues with the build id and the error stack trace:" + ); + console.warn("Build id: x0tjc6omqq4d-iydt761tuj51"); + console.error(error); + }); +} + +function onExternalSetData(event: Event): void { + const customEvent = event as CustomEvent<{ data?: string }>; + const payload = customEvent.detail?.data; + if (typeof payload !== "string") { + return; + } + + const cleanText = normalizeEditorText(payload); + text.value = cleanText; + if (hiddenInput.value) { + hiddenInput.value.value = cleanText; + } + + if (editorInstance.value) { + editorInstance.value.setData(cleanText); + } +} +</script> + +<style lang="scss"> +@import "bootstrap/scss/functions"; +@import "bootstrap/scss/variables"; + +.ck-editor-component { + .ck-rounded-corners { + border-radius: 0 0 0.375rem 0.375rem !important; + } + + .ck-word-count { + background-color: rgb(var(--bs-secondary-bg-rgb)); + border: var(--bs-border-width) solid var(--bs-border-color); + border-bottom: 0px; + border-top-left-radius: 0.375rem; + border-top-right-radius: 0.375rem; + color: var(--bs-body-color); + display: flex; + flex-direction: row; + justify-content: space-around !important; + } + + .ck-content { + transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; + } + + .ck-focused { + border-color: $input-focus-border-color !important; + box-shadow: $input-focus-box-shadow !important; + outline: 0 !important; + } + + .ck-editor__main { + color: $body-color; + } +} +</style> diff --git a/resources/ts/bo/components/EmployeeSitesInputComponent.vue b/resources/ts/bo/components/EmployeeSitesInputComponent.vue new file mode 100644 index 00000000..90ac2030 --- /dev/null +++ b/resources/ts/bo/components/EmployeeSitesInputComponent.vue @@ -0,0 +1,101 @@ +<template> + <div class="employee-sites-input container-fluid"> + <div class="row"> + <div + class="col-md-6 col-lg-4" + v-for="(site, index) in sites" + :key="index" + > + <div class="input-group mb-2"> + <span + class="input-group-text" + :id="'site-location-' + index" + aria-label="Site location" + > + <i class="fa-solid fa-location-dot" /> + </span> + <input + :aria-labelledby="'site-location-' + index" + v-model="sites[index]" + type="text" + name="employee_sites[]" + class="form-control text-uppercase font-monospace" + placeholder="ex: PA" + maxlength="20" + required + > + <button + type="button" + class="btn btn-outline-danger" + :title="__('Delete this site')" + @click="removeSite(index)" + > + <i class="fa-solid fa-trash" /> + </button> + </div> + </div> + </div> + + + <div + class="row" + v-if="sites.length === 0" + > + <div class="col"> + <div + class="alert alert-secondary py-2 mb-2" + > + <i class="fa-solid fa-circle-info me-1" /> + <span>{{ __('No site configured. Click the button below to add a site.') }}</span> + </div> + </div> + </div> + + <div class="row"> + <div class="col"> + <button + type="button" + class="btn btn-sm btn-outline-primary" + @click="addSite" + > + <i class="fa-solid fa-plus me-1" /> + {{ __('Add a site') }} + </button> + </div> + </div> + </div> +</template> + +<script setup lang="ts"> +import { onMounted, ref, useAttrs } from "vue"; + +import { __ } from "@modules/trans"; + +defineOptions({ name: "EmployeeSitesInputComponent" }); + +const attrs = useAttrs(); +const sites = ref<string[]>([]); + +onMounted(() => { + try { + const rawJson = attrs.json ? String(attrs.json) : "[]"; + const data = typeof attrs.json === "object" ? attrs.json : JSON.parse(rawJson); + if (Array.isArray(data)) { + sites.value = [...data]; + } else if (data && Array.isArray(data.sites)) { + sites.value = [...data.sites]; + } + } catch (e) { + console.error("Failed to parse employee sites json", e); + sites.value = []; + } +}); + +const addSite = (): void => { + sites.value.push(""); +}; + +const removeSite = (index: number): void => { + sites.value.splice(index, 1); +}; +</script> diff --git a/resources/ts/bo/components/ImageInputComponent.vue b/resources/ts/bo/components/ImageInputComponent.vue new file mode 100644 index 00000000..74cc7b3e --- /dev/null +++ b/resources/ts/bo/components/ImageInputComponent.vue @@ -0,0 +1,1128 @@ +<template> + <div + ref="imageInput" + class="image-input-vue p-0" + > + <!-- INPUT GROUP --> + <div class="row"> + <!-- INPUT GROUP --> + <div :class="`col-12 ${parameters.preview ? 'col-md-6' : ''} form-group`"> + <label + v-if="parameters.preview && parameters.showLabels" + :for="parameters.id" + class="col-form-label" + > + <b>{{ __("vue.ImageInputComponent.choose_a_file") }}</b> + </label> + <div class="input-group"> + <button + @click.prevent="chooseAFile" + class="btn btn-outline-secondary z-1" + type="button" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.change_source_picture')" + > + <FontAwesomeIcon icon="fa-solid fa-folder-open" /> + </button> + <!-- OUTPUT HTML INPUT --> + <input + :id="parameters.id" + ref="inputFileImage" + @change="pictureInputHasChanged" + type="file" + class="d-none" + :name="`${fileParamIsFile ? parameters.name : ''}`" + accept=".jpg,.jpeg,.gif,.png" + :aria-describedby="`Help${parameters.id}`" + > + <input + v-if="typeof fileOutput === 'string'" + class="d-none" + :name="parameters.name" + type="text" + :value="fileOutput" + > + <!-- END OUTPUT HTML INPUT --> + <!-- FILENAME DISPLAY --> + <input + @click.prevent="chooseAFile" + type="text" + :value="fileParameters.fileName" + class="form-control right-aligned" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.change_source_picture')" + :aria-describedby="`Help${parameters.id}`" + readonly + > + <button + v-if="!parameters.required && hasPicture" + @click.prevent="resetComponent" + class="btn btn-outline-danger" + type="button" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.remove_picture')" + > + <FontAwesomeIcon icon="fa-solid fa-eraser" /> + </button> + <button + v-if="!parameters.preview && fileDataUrl" + class="btn btn-warning" + type="button" + data-bs-toggle="modal" + :data-bs-target="`#ModalPreview${parameters.id}`" + > + <span + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.view_source_picture')" + > + <FontAwesomeIcon icon="fa-solid fa-eye" /> + </span> + </button> + <button + @click.prevent="prepareImageEditor()" + :disabled="!hasPicture" + :class="`btn ${!hasCroppedPicture ? 'btn-primary' : 'btn-success'}`" + type="button" + data-bs-toggle="modal" + :data-bs-target="`#Modal${parameters.id}`" + > + <span + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.resize_source_picture')" + > + <FontAwesomeIcon icon="fa-solid fa-crop" /> + </span> + </button> + <span + v-if="hasCroppedPicture" + class="input-group-text text-success" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.resized_source_picture')" + > + <FontAwesomeIcon icon="fa-solid fa-wand-magic" /> + </span> + </div> + <small + :id="`Help${parameters.id}`" + class="form-text text-body-secondary" + > + {{ parameters.helper }} + </small> + </div> + <!-- END INPUT GROUP --> + <!-- INLINE PREVIEW PART --> + <div + v-if="parameters.preview" + :class="`col-12 ${parameters.preview ? 'col-md-6' : ''} form-group d-flex flex-column`" + > + <p + v-if="fileDataUrl && parameters.showLabels" + :id="`PreviewHelp${parameters.id}`" + class="col-form-label fw-bold m-0" + > + {{ __("vue.ImageInputComponent.preview_picture") }} + </p> + <div> + <img + v-if="fileDataUrl" + class="img-fluid" + :src="fileDataUrl" + :alt="__('Placeholder')" + :aria-describedby="`PreviewHelp${parameters.id}`" + > + </div> + <small + v-if="fileParamIsFile" + class="form-text text-body-secondary" + > + <span>{{ humanFileSize((fileParameters.file as File).size) }}</span> + {{ __("vue.ImageInputComponent.width", { valuepx: String(fileParameters.dimensions.width) }) }} + {{ __("vue.ImageInputComponent.height", { valuepx: String(fileParameters.dimensions.height) }) }} + </small> + </div> + <!-- END INLINE PREVIEW PART --> + </div> + <!-- END INPUT GROUP --> + + <!-- CROP MODAL --> + <div + :id="`Modal${parameters.id}`" + class="modal" + tabindex="-1" + data-bs-backdrop="static" + data-bs-keyboard="false" + @dragstart.prevent="() => false" + @ondrop.prevent="() => false" + @dragover.prevent="() => false" + > + <div class="modal-dialog modal-xl"> + <div class="modal-content"> + <div class="modal-header"> + <h5 class="modal-title"> + {{ __("vue.ImageInputComponent.change_picture_before_import") }} + </h5> + <button + type="button" + class="btn-close" + data-bs-dismiss="modal" + :aria-label="__('vue.ImageInputComponent.close_window')" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.close_window_without_validation')" + /> + </div> + <div class="modal-body"> + <div class="container"> + <div class="row"> + <div class="col text-center"> + <div class="btn-group me-4 mt-2"> + <button + class="btn btn-warning" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.reset_image')" + @click.prevent="cropperReset" + > + <FontAwesomeIcon icon="fa-solid fa-sync-alt" /> + </button> + </div> + <div class="btn-group me-4 mt-2"> + <button + class="btn btn-primary" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.zoom_in')" + @click.prevent="cropperZoom(0.1)" + > + <FontAwesomeIcon icon="fa-solid fa-search-plus" /> + </button> + <button + type="button" + class="btn btn-primary" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.zoom_out')" + @click.prevent="cropperZoom(-0.1)" + > + <FontAwesomeIcon icon="fa-solid fa-search-minus" /> + </button> + </div> + <div class="btn-group me-4 mt-2"> + <button + type="button" + class="btn btn-primary" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.move_left')" + @click.prevent="cropperMove(-10, 0)" + > + <FontAwesomeIcon icon="fa-solid fa-arrow-left" /> + </button> + <button + type="button" + class="btn btn-primary" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.move_right')" + @click.prevent="cropperMove(10, 0)" + > + <FontAwesomeIcon icon="fa-solid fa-arrow-right" /> + </button> + <button + type="button" + class="btn btn-primary" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.move_up')" + @click.prevent="cropperMove(0, -10)" + > + <FontAwesomeIcon icon="fa-solid fa-arrow-up" /> + </button> + <button + type="button" + class="btn btn-primary" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.move_down')" + @click.prevent="cropperMove(0, 10)" + > + <FontAwesomeIcon icon="fa-solid fa-arrow-down" /> + </button> + </div> + <div class="btn-group me-4 mt-2"> + <button + type="button" + class="btn btn-primary" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.mirror_horizontal')" + @click.prevent="cropperScale('H')" + > + <FontAwesomeIcon icon="fa-solid fa-arrows-alt-h" /> + </button> + <button + type="button" + class="btn btn-primary" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.mirror_vertical')" + @click.prevent="cropperScale('V')" + > + <FontAwesomeIcon icon="fa-solid fa-arrows-alt-v" /> + </button> + </div> + </div> + </div> + <div class="row"> + <div class="col"> + <div class="form-group d-flex flex-row"> + <div class="rotate-button"> + <span class="text-dark">{{ __("vue.ImageInputComponent.rotation") }} :</span> + <div class="btn-group mt-1"> + <button + type="button" + class="btn btn-primary" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.rotate_rewind')" + @click.prevent="cropperRotate(-45)" + > + <FontAwesomeIcon icon="fa-solid fa-undo-alt" /> + </button> + <button + type="button" + class="btn btn-primary" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.rotate')" + @click.prevent="cropperRotate(45)" + > + <FontAwesomeIcon icon="fa-solid fa-redo-alt" /> + </button> + </div> + </div> + <div class="mt-1 ms-4 rotate-drag"> + <label + :for="`range-${parameters.id}`" + class="form-label me-4" + > + {{ + __("vue.ImageInputComponent.degres", { + deg: String(cropperParameters.rotation), + }) + }} + </label> + <input + ref="rotationSlider" + @input.stop="cropperParameters.rotation = Number.parseInt(($event.target as HTMLInputElement).value)" + @change.stop="cropperParameters.rotation = Number.parseInt(($event.target as HTMLInputElement).value)" + type="range" + class="form-range" + :id="`range-${parameters.id}`" + min="0" + max="360" + :value="cropperParameters.rotation" + > + </div> + </div> + </div> + </div> + <div class="row mt-3"> + <div class="col-12 col-md-6 p-0 mb-3 cropper-container-wrapper"> + <img + class="image-modification" + ref="imgEditor" + src="" + :alt="__('Placeholder')" + > + </div> + <div + ref="previewBox" + class="col-12 col-md-6 p-0 preview-img" + > + <div + :id="`Preview${parameters.id}`" + :style="previewStyle" + /> + </div> + </div> + </div> + </div> + <div class="modal-footer"> + <button + type="button" + class="btn btn-secondary" + data-bs-dismiss="modal" + :aria-label="__('vue.ImageInputComponent.close_window_without_validation')" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.close_window_without_validation')" + > + {{ __("vue.ImageInputComponent.close_window") }} + </button> + <button + @click.prevent="exportCropperFile" + type="button" + class="btn btn-primary" + data-bs-toggle="tooltip" + data-bs-dismiss="modal" + :title="__('vue.ImageInputComponent.close_and_validate')" + > + {{ __("vue.ImageInputComponent.validate") }} + </button> + </div> + </div> + </div> + </div> + <!-- END CROP MODAL --> + + <!-- PREVIEW MODAL --> + <div + v-if="!parameters.preview && fileDataUrl" + :id="`ModalPreview${parameters.id}`" + class="modal" + tabindex="-1" + data-bs-backdrop="static" + data-bs-keyboard="false" + > + <div class="modal-dialog modal-xl"> + <div class="modal-content"> + <div class="modal-header"> + <h5 class="modal-title"> + {{ __("vue.ImageInputComponent.preview") }} + </h5> + <button + type="button" + class="btn-close" + data-bs-dismiss="modal" + :aria-label="__('vue.ImageInputComponent.close_window')" + data-bs-toggle="tooltip" + :title="__('vue.ImageInputComponent.close_window_without_validation')" + /> + </div> + <div class="modal-body"> + <div class="container"> + <div class="row"> + <div class="col-12 text-center d-flex flex-column"> + <small + :id="`PreviewHelp${parameters.id}`" + class="form-text text-body-secondary d-block" + >{{ + __("vue.ImageInputComponent.preview_picture") }}</small> + <small + v-if="fileParamIsFile" + class="form-text text-body-secondary" + > + <span>{{ humanFileSize((fileParameters.file as File).size) }}</span> + {{ __("vue.ImageInputComponent.width", { valuepx: String(fileParameters.dimensions.width) }) }} + {{ __("vue.ImageInputComponent.height", { valuepx: String(fileParameters.dimensions.height) }) }} + </small> + <div> + <img + v-if="fileDataUrl" + class="img-fluid" + :src="fileDataUrl" + :alt="__('Placeholder')" + :aria-describedby="`PreviewHelp${parameters.id}`" + > + </div> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + <!-- END PREVIEW MODAL --> + </div> +</template> + +<script lang="ts" setup> +import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; +import { Cropper } from "cropperjs"; +import { + computed, + defineEmits, defineOptions, defineProps, + nextTick, onMounted, reactive, ref, useAttrs, watch +} from "vue"; + +import { Tooltips } from "@modules/bs-tooltips"; +import { __ } from "@modules/trans"; +import { uniqueId } from "@modules/uniqueid"; + +/** If string the it is an absolute file path. */ +type FileOutputValue = File | string | null; +type MirrorScale = 1 | -1; + +type CropperParameters = { + /** Rotate the image to an absolute degree. */ + rotation: number, + /** The scaling factor applies to the abscissa of the image. */ + scaleX: MirrorScale, + /** The scaling factor applies to the ordinate of the image. */ + scaleY: MirrorScale +}; + +// * CONSTANTS +const UNITS = [ + "byte", + "kilobyte", + "megabyte", + "gigabyte", + "terabyte", + "petabyte", +]; +const BYTES_PER_KB = 1024; + +defineOptions({ name: "ImageInputComponent" }); + +// * EMITS +const emits = defineEmits<{ + browseFile: [intId: string], + imageFile: [file: File | null], +}>(); + +// * ATTRIBUTES +const attrs = useAttrs(); + +// * REFS +const imageInput = ref<HTMLDivElement | null>(null); +const previewBox = ref<HTMLDivElement | null>(null); +/** The inputfile to select a picture and send in form. */ +const inputFileImage = ref<HTMLInputElement | null>(null); +const imgEditor = ref<HTMLImageElement | null>(null); + +// * PROPS +const props = defineProps({ + id: { + type: String, + default: () => uniqueId(), + }, + name: { + type: String, + default: "" + }, + value: { + type: String, + default: "" + }, + helper: { + type: String, + default: "" + }, + required: { + type: Boolean, + default: false + }, + /** Show above input file and picture bold text. */ + showLabels: { + type: Boolean, + default: true + }, + /** Directly display the image preview or within a BS modal. */ + preview: { + type: Boolean, + default: true + }, + /** Asks the component to just emit a browse event and not open the input file picker. */ + browseEvent: { + type: Boolean, + default: false + }, + /** Picture dimmensions */ + width: { + type: Number, + default: 0 + }, + height: { + type: Number, + default: 0 + }, +}); + +// * DATA +const tooltips = ref<Tooltips | null>(null); +/** If there is an actual picture file. */ +const hasPicture = ref<boolean>(false); +const hasCroppedPicture = ref<boolean>(false); +const previewStyle = ref<string>(""); + +const parameters = reactive<{ + id: string, + name: string, + helper: string, + required: boolean, + showLabels: boolean, + preview: boolean, + browseEvent: boolean, + /** Wanted picture dimensions. */ + dimensions: { + height: number; + width: number; + }, +}>({ + id: props.id, + name: props.name, + helper: props.helper, + required: props.required, + showLabels: props.showLabels, + preview: props.preview, + browseEvent: props.browseEvent, + /** Wanted picture dimensions. */ + dimensions: { + width: props.width, + height: props.height, + }, +}); + +/** Internal file we are working on. */ +const fileParameters = reactive<{ + file: File | null, + filePath: string, + fileName: string, + /** Actual picture dimensions. */ + dimensions: { + height: number; + width: number; + }, +}>({ + file: null, + filePath: "", + fileName: "", + dimensions: { + height: 0, + width: 0, + }, +}); + +/** The picture as data Url in order to display and crop. */ +const fileDataUrl = ref<string | null>(null); + +/** + * The file we shall output : + * - String when having an already stored picture + * - File when we have a File fron the input or cropped component + * - null when noting + */ +const fileOutput = ref<FileOutputValue>(null); + +/** Cropper parameters and instance. */ +const cropperParameters = reactive<CropperParameters>({ + rotation: 0, + scaleX: 1, + scaleY: 1, +}); +const cropperInstance = ref<Cropper | null>(null); +let lastAppliedRotation = 0; + +/** Keep previous prop value in order to detect changes. */ +const previousPropValue = ref<string>(props.value); + +// * COMPUTED +const cropperTemplate = computed<string>(() => { + const ratio = parameters.dimensions.width / parameters.dimensions.height; + return "<cropper-canvas background>" + + "<cropper-image rotatable scalable translatable></cropper-image>" + + "<cropper-shade hidden></cropper-shade>" + + "<cropper-handle action=\"move\" plain></cropper-handle>" + + `<cropper-selection id="CropSelection${parameters.id}" initial-coverage="1" aspect-ratio="${ratio}" movable outlined>` + + "<cropper-grid role=\"grid\" bordered covered></cropper-grid>" + + "<cropper-crosshair centered></cropper-crosshair>" + + "<cropper-handle action=\"move\" theme-color=\"rgba(255, 255, 255, 0.35)\"></cropper-handle>" + + "</cropper-selection>" + + "</cropper-canvas>"; +}); +const isUsedWithProps = computed<boolean>(() => attrs.json === undefined); +const fileParamIsFile = computed<boolean>(() => fileParameters.file instanceof File); + +// * LIFECYCLE +onMounted(() => { + const json = String(attrs.json ?? "{}"), + data = JSON.parse(json); + if (isUsedWithProps.value) { + assignFromProps(); + } else { + parameters.id = data.id ?? uniqueId(); + parameters.name = data.name; + parameters.helper = data.helper ?? ""; + parameters.dimensions.width = Number.parseInt(String(data.width)); + parameters.dimensions.height = Number.parseInt(String(data.height)); + parameters.preview = Boolean(data.preview); + parameters.required = Boolean(data.required); + parameters.showLabels = Boolean(data.showLabels); + parameters.browseEvent = Boolean(data.browseEvent); + const value = data.value; + if (typeof value === "string" && value.length) { + fileParameters.filePath = value.replace(/^\/|^/, ""); + fileParameters.fileName = value.replace(/^\/|^/, ""); + fileOutput.value = fileParameters.filePath; + } + } + fetchPictureFromPath(fileParameters.filePath); + initTooltips(); +}); + +// * WATCHERS + +/** Watch props value changes. */ +watch(props, (newValue: typeof props) => { + // * Ignore non prop usage. + if (!isUsedWithProps.value) { + return; + } + assignFromProps(); + previousPropValue.value = newValue.value; +}, { deep: true }); +watch(previousPropValue, () => { + // * Ignore non prop usage. + if (!isUsedWithProps.value) { + return; + } + cropperReset(); + hasCroppedPicture.value = false; + fetchPictureFromPath(fileParameters.filePath)!.then((file) => useThis(file)); +}); +/** Crop parameters changes. */ +watch(cropperParameters, (newValue: CropperParameters) => { + const cropperImage = cropperInstance.value?.getCropperImage(); + if (!cropperImage) { + return; + } + const deltaRotation = newValue.rotation - lastAppliedRotation; + if (deltaRotation !== 0) { + cropperImage.$rotate(deltaRotation * Math.PI / 180); + lastAppliedRotation = newValue.rotation; + } +}, { deep: true }); +/** The output has changed, so need to change inputFileImage values. */ +watch(fileOutput, (newValue: FileOutputValue) => { + // Dont use input type file if we have a string as output (already stored picture). + if (typeof newValue === "string") { + // * Reset input file. + inputFileImage.value!.value = ""; + return; + } + + // * Just add a file to output. + if (!(newValue instanceof File)) { + return; + } + + const container = new DataTransfer(); + container.items.add(newValue); + inputFileImage.value!.files = container.files; + emits("imageFile", newValue); +}); +watch(fileDataUrl, (newValue) => { + if (newValue === null) { + return; + } + fileParameters.dimensions = { ...parameters.dimensions }; +}); + +// * METHODS +function assignFromProps(): void { + fileParameters.filePath = props.value.replace(/^\/|^/, ""); + fileParameters.fileName = props.value.replace(/^\/|^/, ""); + fileOutput.value = fileParameters.filePath; + + const mapParam = <T extends typeof parameters>(dest: T, prop: keyof T, value: ValueOf<T>) => { + dest[prop] = value; + }; + for (const key of ["id", "name", "helper", "required", "showLabels", "preview", "browseEvent"]) { + const paramKey = key as keyof typeof parameters; + mapParam<typeof parameters>(parameters, paramKey, props[paramKey as never]); + } + mapParam<typeof parameters>(parameters, "dimensions", { height: props.height, width: props.width }); +} + +/** Vertical or Horizontal scale. */ +function cropperScale(direction: "H" | "V"): void { + const cropperImage = cropperInstance.value?.getCropperImage(); + if (!cropperImage) { + return; + } + const dir: "X" | "Y" = direction === "H" ? "X" : "Y"; + cropperParameters[`scale${dir}`] = (-1 / cropperParameters[`scale${dir}`]) as MirrorScale; + if (direction === "H") { + cropperImage.$scale(-1, 1); + } else { + cropperImage.$scale(1, -1); + } +} + +function cropperRotate(deg: number): void { + deg += cropperParameters.rotation; + cropperParameters.rotation = Math.min(Math.max(deg, 0), 360); +} + +function cropperReset(): void { + cropperInstance.value?.getCropperImage()?.$resetTransform(); + cropperInstance.value?.getCropperImage()?.$center("contain"); + cropperInstance.value?.getCropperSelection()?.$reset(); + cropperParameters.rotation = 0; + cropperParameters.scaleX = 1; + cropperParameters.scaleY = 1; + lastAppliedRotation = 0; +} + +/** Export cropped file from cropper. */ +async function exportCropperFile(): Promise<void> { + const selection = cropperInstance.value?.getCropperSelection(); + if (!selection) { + return; + } + const outputWidth = Math.max(1, Math.trunc(parameters.dimensions.width)); + const outputHeight = Math.max(1, Math.trunc(parameters.dimensions.height)); + hasCroppedPicture.value = true; + const canvas = await selection.$toCanvas({ + width: outputWidth, + height: outputHeight, + beforeDraw: (context: CanvasRenderingContext2D) => { + context.fillStyle = "rgba(0, 0, 0, 0)"; + context.imageSmoothingEnabled = true; + context.imageSmoothingQuality = "high"; + }, + }); + + const normalizedCanvas = document.createElement("canvas"); + normalizedCanvas.width = outputWidth; + normalizedCanvas.height = outputHeight; + const normalizedCtx = normalizedCanvas.getContext("2d"); + if (!normalizedCtx) { + return; + } + normalizedCtx.imageSmoothingEnabled = true; + normalizedCtx.imageSmoothingQuality = "high"; + normalizedCtx.clearRect(0, 0, outputWidth, outputHeight); + normalizedCtx.drawImage(canvas, 0, 0, outputWidth, outputHeight); + + fileDataUrl.value = normalizedCanvas.toDataURL("image/png"); + const file = new File( + [dataUrltoBlob(fileDataUrl.value)], + fileParameters.fileName, + { + type: "image/png", + lastModified: Date.now(), + } + ); + useThis(file); + fileOutput.value = file; +} + +/** Click in input file picker. */ +function chooseAFile(): void { + emits("browseFile", parameters.id); + if (parameters.browseEvent) { + return; + } + inputFileImage.value!.click(); +} + +/** Input file has changed. */ +function pictureInputHasChanged(): void { + if (inputFileImage?.value?.files && inputFileImage!.value!.files[0]) { + cropperReset(); + hasCroppedPicture.value = false; + useThis(inputFileImage!.value!.files[0]); + fileOutput.value = inputFileImage!.value!.files[0]; + } +} + +/** Fetch the picture from file Path and save it as a File in the file input. */ +function fetchPictureFromPath(filePath: string): Promise<File> | void { + if (!filePath.length) { + return; + } + return new Promise<File>((accept, deny) => nextTick(() => { + const prefixedFilePath: string = filePath.replace(/^\/|^/, "/"), + stringFileName: string = prefixedFilePath.substring(prefixedFilePath.lastIndexOf("/")).replace(/^\/|^/, ""); + + fetch(prefixedFilePath) + .then((response) => response.blob()) + .then((blob: Blob) => { + const file = new File([blob], stringFileName, { + type: "image/png", + lastModified: Date.now(), + }); + setFileAsDataUrl(file); + accept(file); + }).catch(() => deny("Failed to fetch picture")); + })); +} + +/** Persist a File added from input or while component init. */ +function useThis(file: File): void { + setFileAsDataUrl(file); + fileParameters.fileName = file.name; + fileParameters.file = file; + hasPicture.value = true; +} + +/** Set a file as DataUrl in order to use it within the component. */ +function setFileAsDataUrl(file: File): void { + const reader = new FileReader(); + reader.addEventListener( + "load", + () => { + /** On convertit l'image en une chaîne de caractères base64. */ + fileDataUrl.value = String(reader.result); + fileParameters.fileName = file.name; + fileParameters.file = file; + hasPicture.value = true; + }, + false + ); + + reader.readAsDataURL(file); + reader.onloadend = () => { + fetchImageDimensions(String(reader.result)); + }; +} + +function cropperZoom(scale: number): void { + cropperInstance.value?.getCropperImage()?.$zoom(scale); +} + +function cropperMove(x: number, y: number): void { + cropperInstance.value?.getCropperImage()?.$move(x, y); +} + +/** Init Cropper. */ +function prepareImageEditor(): void { + const recomputePreviewWhenModalShown = () => { + const modalElement = document.getElementById(`Modal${parameters.id}`); + if (!modalElement) { + return; + } + const onModalShown = () => { + requestAnimationFrame(() => { + previewStyleCompute(); + setupCropperViewerWithRetry(); + previewStyleCompute(); + }); + modalElement.removeEventListener("shown.bs.modal", onModalShown); + }; + modalElement.addEventListener("shown.bs.modal", onModalShown); + }; + + const createCropper = () => { + const imgEditorEl = imgEditor.value; + if (!imgEditorEl) { + throw new Error("imgEditor required"); + } + if (cropperInstance.value) { + cropperInstance.value.destroy(); + } + cropperInstance.value = new Cropper(imgEditorEl, {template: cropperTemplate.value,}); + lastAppliedRotation = 0; + }; + + if (fileParameters.file === null) { + throw new Error("File nust not be null"); + } + + const editorImg = imgEditor.value!; + const blobUrl = URL.createObjectURL(fileParameters.file); + + const initCropperAfterLoad = () => { + editorImg.removeEventListener("load", initCropperAfterLoad); + nextTick(() => { + recomputePreviewWhenModalShown(); + createCropper(); + previewStyleCompute(); + setupCropperViewerWithRetry(); + previewStyleCompute(); + }); + }; + + editorImg.addEventListener("load", initCropperAfterLoad); + editorImg.src = blobUrl; +} + +/** Reset the entire component state. */ +function resetComponent(): void { + cropperReset(); + fileDataUrl.value = null; + fileOutput.value = null; + inputFileImage.value!.value = ""; + fileParameters.fileName = __("vue.ImageInputComponent.choose_a_file"); + fileParameters.filePath = ""; + fileParameters.file = null; + fileParameters.dimensions.height = 0; + fileParameters.dimensions.width = 0; + hasPicture.value = false; + hasCroppedPicture.value = false; + emits("imageFile", null); +} + +/** Download prefixed path picture and fetch its dimensions. */ +function fetchImageDimensions(pictureSrc: string): void { + const img = new Image(); + try { + img.onload = () => { + fileParameters.dimensions.width = img.width; + fileParameters.dimensions.height = img.height; + }; + img.src = pictureSrc; + } catch { + fileParameters.dimensions.width = img.width; + fileParameters.dimensions.height = img.height; + } +} + +/** Computed the priew picture style for adaptative dimensions. */ +function previewStyleCompute(): void { + if (previewBox.value === null) { + return; + } + const targetContainerWidth = previewBox.value.clientWidth; + if (targetContainerWidth <= 0) { + return; + } + const targetWidth = targetContainerWidth / 1.2, + targetHeight = + (parameters.dimensions.height * targetContainerWidth) / + parameters.dimensions.width / + 1.2; + previewStyle.value = `width: ${targetWidth.toFixed(3)}px;height:${targetHeight.toFixed(3)}px;`; +} + +/** Set up the cropper-viewer custom element for live preview. */ +function setupCropperViewer(): boolean { + const previewEl = document.getElementById(`Preview${parameters.id}`); + const cropSelection = document.getElementById(`CropSelection${parameters.id}`); + if (!previewEl || !cropSelection) { + return false; + } + previewEl.innerHTML = ""; + const viewer = document.createElement("cropper-viewer"); + viewer.setAttribute("selection", `#CropSelection${parameters.id}`); + viewer.style.width = "100%"; + viewer.style.height = "100%"; + previewEl.appendChild(viewer); + + return true; +} + +/** + * Cropper peut injecter sa sélection de manière asynchrone. + * On retente quelques frames pour éviter un preview blanc intermittent. + */ +function setupCropperViewerWithRetry(maxAttempts = 10): void { + let attempts = 0; + const trySetup = () => { + if (setupCropperViewer()) { + return; + } + attempts += 1; + if (attempts >= maxAttempts) { + return; + } + requestAnimationFrame(trySetup); + }; + trySetup(); +} + +/** Transform data url to blob. */ +function dataUrltoBlob(dataUrl: string): Blob { + const arr = dataUrl.split(","); + if (!arr[0] || !arr[1]) { + throw new Error("invalid data url"); + } + const mimeStart = arr[0].indexOf(":"); + const mimeEnd = arr[0].indexOf(";"); + if (mimeStart < 0 || mimeEnd < 0 || mimeEnd <= mimeStart + 1) { + throw new Error("invalid mime"); + } + const mime = arr[0].slice(mimeStart + 1, mimeEnd); + const bstr = globalThis.atob(arr[1]); + let n = bstr.length; + const u8arr = new Uint8Array(n); + while (n--) { + u8arr[n] = bstr.codePointAt(n) ?? 0; + } + return new Blob([u8arr], { type: mime }); +} + +/** Human file size change. */ +function humanFileSize(sizeBytes: number | bigint): string { + let size = Math.abs(Number(sizeBytes)); + + let u = 0; + while (size >= BYTES_PER_KB && u < UNITS.length - 1) { + size /= BYTES_PER_KB; + ++u; + } + + return new Intl.NumberFormat([], { + style: "unit", + unit: UNITS[u], + unitDisplay: "short", + maximumFractionDigits: 1, + }).format(size); +} + +/** Initialise all tooltips in the component. */ +function initTooltips(): void { + setTimeout(() => { + if (imageInput.value === null) { + return; + } + tooltips.value = Tooltips.make({ + type: "dom", + elements: imageInput.value!.querySelectorAll("[data-bs-toggle=\"tooltip\"]"), + options: {container: imageInput.value} + }); + }, 500); +} +</script> + +<style lang="scss" scoped> + +.image-input-vue { + + /* Ensure the size of the image fit the container perfectly. */ + .image-modification { + display: block; + + /* This rule is very important, please don't ignore this. */ + max-width: 100%; + } + + .cropper-container-wrapper { + min-height: 400px; + + :deep(cropper-canvas) { + width: 100%; + height: 100%; + } + } + + .rotate-button { + display: flex; + flex-direction: column; + } + + .rotate-drag { + display: flex; + flex-direction: column-reverse; + width: 100%; + + &>input { + width: 100%; + } + } + + .preview-img { + min-height: 400px; + display: flex; + align-items: center; + justify-content: center; + + &>div { + position: static; + overflow: hidden; + border: 1px solid var(--bs-border-color, #dee2e6); + } + } + + input.right-aligned { + direction: ltr !important; + overflow: hidden !important; + } + + input.right-aligned :not(:focus) { + direction: rtl !important; + text-align: left !important; + text-overflow: ellipsis !important; + } +} +</style> diff --git a/resources/ts/bo/components/MapLocationPicker.vue b/resources/ts/bo/components/MapLocationPicker.vue new file mode 100644 index 00000000..1e732424 --- /dev/null +++ b/resources/ts/bo/components/MapLocationPicker.vue @@ -0,0 +1,169 @@ +<template> + <div class="map-location-picker"> + <div class="mb-2 d-flex justify-content-between align-items-center"> + <p class="text-muted small m-0"> + {{ __('Click on the map to place or move the pickup point.') }} + </p> + <span + v-if="lat && lng" + class="badge bg-light text-dark border" + > + Lat: {{ lat.toFixed(5) }} | Lng: {{ lng.toFixed(5) }} + </span> + </div> + + <div + ref="mapContainer" + class="map-container rounded border" + /> + + <input + type="hidden" + :name="latName" + :value="lat" + > + <input + type="hidden" + :name="lngName" + :value="lng" + > + </div> +</template> + +<script setup lang="ts"> +import "leaflet/dist/leaflet.css"; +import { + icon, LatLng, map as leafMap, marker as leafMarker, Marker, tileLayer +} from "leaflet"; +import markerIcon2x from "leaflet/dist/images/marker-icon-2x.png"; +import markerIcon from "leaflet/dist/images/marker-icon.png"; +import markerShadow from "leaflet/dist/images/marker-shadow.png"; +import { + onBeforeMount, onMounted, onUnmounted, ref, shallowRef, useAttrs +} from "vue"; + +import { __ } from "@modules/trans"; + +defineOptions({ name: "MapLocationPicker" }); + +const attrs = useAttrs(); +const mapContainer = ref<HTMLElement | null>(null); + +const map = shallowRef<L.Map | null>(null); +const marker = shallowRef<L.Marker | null>(null); + +const latName = ref<string>("latitude"); +const lngName = ref<string>("longitude"); +const lat = ref<number | null>(null); +const lng = ref<number | null>(null); + + + +const defaultIcon = icon({ + iconUrl: markerIcon, + iconRetinaUrl: markerIcon2x, + shadowUrl: markerShadow, + iconSize: [25, 41], + iconAnchor: [12, 41], + popupAnchor: [1, -34], + shadowSize: [41, 41] +}); + +Marker.prototype.options.icon = defaultIcon; + +onBeforeMount(() => { + if (!attrs.json) { + throw new Error("this component requires json"); + } +}); + +// --- NOUVEAUTÉ : Fonction qui gère l'événement reçu depuis l'autocomplétion --- +const handleAddressSelected = (e: Event) => { + const customEvent = e as CustomEvent<{ lat: number; lng: number }>; + const newLat = customEvent.detail.lat; + const newLng = customEvent.detail.lng; + + // Mise à jour des variables réactives (inputs cachés) + lat.value = newLat; + lng.value = newLng; + + if (map.value) { + + const newLatLng = new LatLng(newLat, newLng); + + // Recentrer la carte (le '16' est le niveau de zoom pour être assez proche) + map.value.setView(newLatLng, 16); + + // Mettre à jour le marqueur visuel + if (marker.value) { + marker.value.setLatLng(newLatLng); + } else { + + marker.value = leafMarker(newLatLng).addTo(map.value); + } + } +}; + +onMounted(() => { + const json = String(attrs.json ?? "{}"); + const data = JSON.parse(json); + + latName.value = data.latName ?? "latitude"; + lngName.value = data.lngName ?? "longitude"; + lat.value = data.lat ? Number.parseFloat(data.lat) : null; + lng.value = data.lng ? Number.parseFloat(data.lng) : null; + + initMap(); + + // On écoute l'événement dispatché par Blade + document.addEventListener("ban-address-selected", handleAddressSelected); +}); + +onUnmounted(() => { + // Toujours nettoyer les événements globaux + document.removeEventListener("ban-address-selected", handleAddressSelected); +}); + +const initMap = () => { + if (!mapContainer.value) return; + + const defaultCenter: [number, number] = [46.2276, 2.2137]; + const defaultZoom = lat.value && lng.value ? 15 : 5; + const center: [number, number] = lat.value && lng.value ? [lat.value, lng.value] : defaultCenter; + + + map.value = leafMap(mapContainer.value).setView(center, defaultZoom); + + + tileLayer( + "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", + {attribution: "© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors",} + ).addTo(map.value); + + if (lat.value && lng.value) { + + marker.value = leafMarker([lat.value, lng.value]).addTo(map.value); + } + + map.value.on("click", (e: L.LeafletMouseEvent) => { + lat.value = e.latlng.lat; + lng.value = e.latlng.lng; + + if (marker.value) { + marker.value.setLatLng(e.latlng); + } else { + marker.value = leafMarker(e.latlng).addTo(map.value!); + } + }); +}; +</script> + +<style lang="scss" scoped> +.map-location-picker { + .map-container { + height: 400px; + width: 100%; + z-index: 1; + } +} +</style> diff --git a/resources/ts/bo/components/ProductDragAndDropComponent.vue b/resources/ts/bo/components/ProductDragAndDropComponent.vue new file mode 100644 index 00000000..b1d2f245 --- /dev/null +++ b/resources/ts/bo/components/ProductDragAndDropComponent.vue @@ -0,0 +1,243 @@ +<template> + <div class="product-drag-drop"> + <div class="mb-4"> + <fieldset class="border border-secondary-subtle rounded p-2"> + <legend class="mb-3 h5"> + {{ __('Available products') }} + </legend> + <div class="d-flex justify-content-between align-items-center mb-3"> + <div + class="input-group input-group-sm w-auto" + style="max-width: 250px;" + > + <input + v-model="searchQuery" + type="text" + class="form-control" + :placeholder="__('Search...')" + :aria-label="__('Search...')" + > + <button + v-if="searchQuery" + class="btn btn-outline-secondary" + type="button" + :title="__('Clear')" + @click="searchQuery = ''" + > + <i class="fa-solid fa-xmark" /> + </button> + </div> + </div> + <draggable + v-model="filteredAvailable" + group="products" + item-key="id" + class="drag-container" + ghost-class="ghost-card" + animation="200" + > + <template #item="{ element }"> + <div class="card product-card"> + <img + v-if="element.picture" + :src="`/${element.picture}`" + :alt="element.name" + class="card-img-top product-img" + > + <div class="card-body p-2 text-center"> + <p + class="card-title m-0 product-name" + :title="element.name" + > + {{ element.name }} + </p> + </div> + </div> + </template> + </draggable> + </fieldset> + + <p + v-if="filteredAvailable.length === 0" + class="text-muted small mt-2" + > + <span v-if="searchQuery">{{ __('No product matches your search.') }}</span> + <span v-else>{{ __('All products have been selected.') }}</span> + </p> + </div> + + <fieldset class="border border-primary-subtle rounded p-2"> + <legend class="mb-3 h5"> + {{ __('Selected products') }} + </legend> + <draggable + v-model="selected" + group="products" + item-key="id" + class="drag-container" + ghost-class="ghost-card" + animation="200" + > + <template #item="{ element }"> + <div class="card product-card selected-card"> + <img + v-if="element.picture" + :src="`/${element.picture}`" + :alt="element.name" + class="card-img-top product-img" + > + <div class="card-body p-2 text-center"> + <p + class="card-title m-0 product-name" + :title="element.name" + > + {{ element.name }} + </p> + </div> + </div> + </template> + </draggable> + + <small + v-if="selected.length === 0" + class="text-muted small fst-italic text-center d-block" + > + {{ __('Drag products here to select them.') }} + </small> + </fieldset> + + <input + v-for="(sel, selIdx) of selected" + :key="selIdx" + type="hidden" + :name="`${name}[]`" + :value="sel.id" + > + </div> +</template> + +<script setup lang="ts"> +import { computed, onBeforeMount, onMounted, ref, useAttrs } from "vue"; +import draggable from "vuedraggable"; + +import { __ } from "@modules/trans"; + +defineOptions({ name: "ProductDragAndDrop" }); + +export interface Product { + id: string | number; + name: string; + picture: string | null; +} + +const attrs = useAttrs(); + +const name = ref<string>(""); +const available = ref<Product[]>([]); +const selected = ref<Product[]>([]); +const searchQuery = ref(""); + +const filteredAvailable = computed({ + get() { + if (!searchQuery.value) return available.value; + const lower = searchQuery.value.toLowerCase(); + return available.value.filter((p) => p.name.toLowerCase().includes(lower)); + }, + set(newVal) { + if (!searchQuery.value) { + available.value = newVal; + return; + } + const lower = searchQuery.value.toLowerCase(); + const hidden = available.value.filter((p) => !p.name.toLowerCase().includes(lower)); + available.value = [...hidden, ...newVal]; + } +}); + +onBeforeMount(() => { + if (!attrs.json) { + throw new Error("this component requires json"); + } +}); + +onMounted(() => { + const json = String(attrs.json ?? "{}"); + const data = JSON.parse(json); + + name.value = String(data.name); + available.value = data.available ?? []; + selected.value = data.selected ?? []; + +}); + +</script> + +<style lang="scss" scoped> +.product-drag-drop { + .drag-container { + display: flex; + overflow-x: auto; + gap: 1rem; + padding-bottom: 1rem; + min-height: 220px; + align-items: stretch; + + &::-webkit-scrollbar { + height: 8px; + } + &::-webkit-scrollbar-track { + background: #f1f1f1; + border-radius: 4px; + } + &::-webkit-scrollbar-thumb { + background: #c1c1c1; + border-radius: 4px; + } + &::-webkit-scrollbar-thumb:hover { + background: #a8a8a8; + } + } + + .product-card { + min-width: 160px; + max-width: 160px; + cursor: grab; + flex-shrink: 0; + transition: box-shadow 0.2s ease; + + &:active { + cursor: grabbing; + } + + &:hover { + box-shadow: 0 4px 8px rgba(0,0,0,0.1); + } + + &.selected-card { + border-color: var(--bs-primary, #0d6efd); + } + + .product-img { + height: 120px; + object-fit: contain; + padding: 0.5rem; + background-color: #fff; + } + + .product-name { + font-size: 0.875rem; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + } + } + + .ghost-card { + opacity: 0.5; + background: #f8f9fa; + border: 2px dashed #adb5bd; + } +} +</style> diff --git a/resources/ts/bo/components/WordCounterComponent.vue b/resources/ts/bo/components/WordCounterComponent.vue new file mode 100644 index 00000000..21e5cf26 --- /dev/null +++ b/resources/ts/bo/components/WordCounterComponent.vue @@ -0,0 +1,128 @@ +<template> + <div class="word-counter-varchar d-flex flex-row justify-content-around align-items-center w-100"> + <span> + {{ __("vue.WordCounterComponent.words") }} : <b>{{ inTwords }}</b> + </span> + <span> + {{ __("vue.WordCounterComponent.characters") }} : <b>{{ inTchars }}</b> + </span> + </div> +</template> + +<script setup lang="ts"> +import { + nextTick, + onBeforeUnmount, + onMounted, + ref, + useAttrs, + watch +} from "vue"; + +import { __ } from "@modules/trans"; + +defineOptions({ name: "WordCounterComponent" }); + +const props = defineProps({ + for: { + type: String, + default: null, + }, +}); + +const attrs = useAttrs(); + +const inTid = ref<string>(""); +const inTwords = ref<number>(0); +const inTchars = ref<number>(0); +const inTinput = ref<HTMLInputElement | HTMLTextAreaElement | null>(null); + +const calculateValues = (string: string): [number, number] => { + const arr = string.split(" "); + return [arr.filter((word) => word !== "").length, string.length]; +}; + +const updateValues = (string: string) => { + const [words, chars] = calculateValues(string); + inTwords.value = words; + inTchars.value = chars; +}; + +const handleInput = (e: Event) => { + const el = e.target as HTMLInputElement | HTMLTextAreaElement | null; + if (!el) { + throw new Error(`${inTid.value} is not an input or textarea`); + } + updateValues(el.value); +}; + +onMounted(() => { + const json = String(attrs.json ?? "{}"); + const data = JSON.parse(json); + + inTid.value = String(props.for ?? ""); + if (data.for) { + inTid.value = data.for; + } +}); + +watch( + () => props.for, + (newVal) => { + if (newVal) { + inTid.value = newVal; + } + } +); + +watch(inTid, async (newVal) => { + if (!newVal) return; + + await nextTick(); + const input = document.getElementById(newVal); + + if (!input || !(input instanceof HTMLInputElement || input instanceof HTMLTextAreaElement)) { + throw new Error(`${newVal} is not an input or textarea`); + } + + inTinput.value = input; +}); + +watch(inTinput, (newInput, oldInput) => { + if (oldInput) { + oldInput.removeEventListener("input", handleInput); + } + + if (!newInput) return; + + newInput.addEventListener("input", handleInput); + updateValues(newInput.value); +}); + +// Éviter les fuites de mémoire lors de la destruction du composant +onBeforeUnmount(() => { + if (inTinput.value) { + inTinput.value.removeEventListener("input", handleInput); + } +}); +</script> + +<style lang="scss"> +#word-counter+input[type="text"], +.word-counter+input[type="text"], +#word-counter+textarea, +.word-counter+textarea, +#word-counter-varchar+textarea, +.word-counter-varchar+textarea { + border-radius: 0 0 0.375rem 0.375rem; +} + +.word-counter-varchar { + color: var(--bs-body-color); + border: var(--bs-border-width) solid var(--bs-border-color); + border-bottom: 0; + background-color: rgb(var(--bs-secondary-bg-rgb)); + border-top-left-radius: 0.375rem; + border-top-right-radius: 0.375rem; +} +</style> diff --git a/resources/ts/bo/utilities/bootstrap.ts b/resources/ts/bo/utilities/bootstrap.ts new file mode 100644 index 00000000..3d8db352 --- /dev/null +++ b/resources/ts/bo/utilities/bootstrap.ts @@ -0,0 +1,15 @@ +import * as bootstrap from "bootstrap"; + +import { Tooltips } from "@modules/bs-tooltips"; + +globalThis.bootstrap = bootstrap; + +if (typeof document !== "undefined") { + if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", () => { + Tooltips.make(); + }, { once: true }); + } else { + Tooltips.make(); + } +} diff --git a/resources/ts/bo/utilities/checker.ts b/resources/ts/bo/utilities/checker.ts new file mode 100644 index 00000000..34af443c --- /dev/null +++ b/resources/ts/bo/utilities/checker.ts @@ -0,0 +1,101 @@ + +// Select with mouse +document.addEventListener("DOMContentLoaded", () => { + let activeRows = 0; + const checkerMassActions = document.getElementById("checker-mass-actions"); + const rows = document.querySelectorAll<HTMLTableRowElement>("tr.checker-line"); + + const toggleCheckerMassActionsVisibility = () => { + checkerMassActions?.classList.add("d-none"); + + if (activeRows) { + checkerMassActions?.classList.remove("d-none"); + } + }; + + const toggleRow = (row: HTMLTableRowElement) => { + const checkbox = row.querySelector<HTMLInputElement>("input.checker"); + + if (!checkbox) { + return; + } + + checkbox.checked = !checkbox.checked; + checkbox.dispatchEvent(new Event("change", { bubbles: true })); + + if (checkbox.checked) { + activeRows++; + } else { + activeRows--; + } + + toggleCheckerMassActionsVisibility(); + }; + + rows.forEach((row) => { + const checkbox = row.querySelector<HTMLInputElement>("input.checker"); + + if (checkbox?.checked) { + activeRows++; + } + + row.addEventListener("click", (event: MouseEvent) => { + const target = event.target as HTMLElement; + + if ( + target.tagName === "INPUT" || + target.tagName === "BUTTON" || + target.closest("button") || + target.tagName === "A" || + target.closest("a") + ) { + return; + } + + toggleRow(row); + }); + + row.addEventListener("mouseenter", (event: MouseEvent) => { + if (event.buttons === 1) { + toggleRow(row); + } + }); + }); + + toggleCheckerMassActionsVisibility(); +}); + +// Submit Mass action +document.addEventListener("DOMContentLoaded", () => { + const massActionsForm = document.querySelector<HTMLFormElement>("#checker-mass-actions form"); + + if (massActionsForm) { + massActionsForm.addEventListener("submit", () => { + massActionsForm.querySelectorAll(".dynamic-model-input").forEach(el => el.remove()); + const checkedBoxes = document.querySelectorAll<HTMLInputElement>("tr.checker-line input.checker:checked"); + + checkedBoxes.forEach((checkbox) => { + const hiddenInput = document.createElement("input"); + hiddenInput.type = "hidden"; + hiddenInput.name = "models[]"; + hiddenInput.value = checkbox.value; + hiddenInput.classList.add("dynamic-model-input"); + + massActionsForm.appendChild(hiddenInput); + }); + }); + } +}); + +// Select All Button +document.addEventListener("DOMContentLoaded", function () { + const selectAllBtn = document.getElementById("checker-mass-actions-select-all"); + const inputCheckBoxes = document.querySelectorAll<HTMLInputElement>("tr.checker-line input.checker"); + + selectAllBtn?.addEventListener("click", function () { + inputCheckBoxes.forEach(checkbox => { + checkbox.checked = true; + checkbox.dispatchEvent(new Event("change", { bubbles: true })); + }); + }); +}); diff --git a/resources/ts/bo/utilities/fontawesome.ts b/resources/ts/bo/utilities/fontawesome.ts new file mode 100644 index 00000000..420d64b9 --- /dev/null +++ b/resources/ts/bo/utilities/fontawesome.ts @@ -0,0 +1,136 @@ +import { config, dom, library } from "@fortawesome/fontawesome-svg-core"; +import { faCheckCircle, faFileWord } from "@fortawesome/free-regular-svg-icons"; +import { + faArrowAltCircleDown, + faArrowAltCircleUp, + faArrowDown, + faArrowLeft, + faArrowRight, + faArrowsAltH, + faArrowsAltV, + faArrowsRotate, + faArrowUp, + faBackspace, + faBox, + faCalendarDay, + faCalendarPlus, + faCalendarXmark, + faCashRegister, + faCheck, + faChevronLeft, + faChevronRight, + faCircleExclamation, + faCircleInfo, + faCloudArrowDown, + faCog, + faCrop, + faEraser, + faExternalLinkAlt, + faEye, + faFileLines, + faFloppyDisk, + faFolderOpen, + faHashtag, + faHourglassEnd, + faInfo, + faListOl, + faListUl, + faLocationDot, + faLock, + faMagnifyingGlass, + faPen, + faPencil, + faPlateWheat, + faPlus, + faQuestionCircle, + faRedoAlt, + faRobot, + faSearch, + faSearchMinus, + faSearchPlus, + faShoppingBag, + faSquarePlus, + faStar, + faSyncAlt, + faTachometerAlt, + faTimes, + faTrash, + faTriangleExclamation, + faTv, + faUndoAlt, + faWandMagic, + faWarehouse, +} from "@fortawesome/free-solid-svg-icons"; + +config.autoReplaceSvg = false; + +// Image editor +library.add(faEraser); +library.add(faPlus); +library.add(faTrash); +library.add(faEye); +library.add(faFolderOpen); +library.add(faCrop); +library.add(faQuestionCircle); +library.add(faCheck); +library.add(faUndoAlt); +library.add(faRedoAlt); +library.add(faSyncAlt); +library.add(faSearchPlus); +library.add(faSearchMinus); +library.add(faArrowLeft); +library.add(faArrowRight); +library.add(faArrowUp); +library.add(faArrowDown); +library.add(faArrowsAltH); +library.add(faArrowsAltV); +library.add(faWandMagic); +library.add(faPencil); +library.add(faTimes); +library.add(faBackspace); +library.add(faSearch); +library.add(faArrowAltCircleDown); +library.add(faArrowAltCircleUp); +library.add(faSquarePlus); +library.add(faPen); + +// Navigation / layout +library.add(faChevronLeft); +library.add(faChevronRight); +library.add(faTriangleExclamation); +library.add(faBox); +library.add(faCashRegister); +library.add(faFileWord); + +// BO specific +library.add(faTv); +library.add(faWarehouse); +library.add(faListUl); +library.add(faCheckCircle); +library.add(faStar); +library.add(faPlateWheat); +library.add(faTachometerAlt); +library.add(faExternalLinkAlt); +library.add(faShoppingBag); +library.add(faRobot); +library.add(faCalendarXmark); +library.add(faCalendarDay); +library.add(faFloppyDisk); +library.add(faCalendarPlus); +library.add(faHourglassEnd); +library.add(faCircleInfo); +library.add(faCircleExclamation); +library.add(faInfo); +library.add(faCog); +library.add(faLocationDot); +library.add(faLock); +library.add(faHashtag); +library.add(faCloudArrowDown); +library.add(faArrowsRotate); +library.add(faFileLines); +library.add(faMagnifyingGlass); + + +library.add(faListOl); + +dom.watch(); diff --git a/resources/ts/bo/utilities/money-input.ts b/resources/ts/bo/utilities/money-input.ts new file mode 100644 index 00000000..5a5d64aa --- /dev/null +++ b/resources/ts/bo/utilities/money-input.ts @@ -0,0 +1,45 @@ +document.addEventListener("DOMContentLoaded", () => { + const moneyInputs = document.querySelectorAll<HTMLInputElement>("input[data-money-input]"); + + moneyInputs.forEach((originalInput) => { + const displayInput = originalInput.cloneNode(true) as HTMLInputElement; + + delete displayInput.dataset["money-input"]; + displayInput.removeAttribute("name"); + displayInput.step = "0.01"; + + if (originalInput.id) { + displayInput.id = originalInput.id; + originalInput.id = `${originalInput.id}-hidden`; + } + + originalInput.type = "hidden"; + originalInput.step = "1"; + + if (originalInput.required) { + originalInput.removeAttribute("required"); + displayInput.required = true; + } + + if (originalInput.value) { + const cents = Number.parseInt(originalInput.value, 10); + if (!Number.isNaN(cents)) { + displayInput.value = (cents / 100).toFixed(2); + } + } + + originalInput.parentNode?.insertBefore(displayInput, originalInput); + + displayInput.addEventListener("input", (e) => { + const target = e.target as HTMLInputElement; + const euros = Number.parseFloat(target.value); + + if (Number.isNaN(euros)) { + originalInput.value = ""; + } else { + const cents = Math.round(euros * 100); + originalInput.value = cents.toString(); + } + }); + }); +}); diff --git a/resources/ts/bo/utilities/vue-bo.ts b/resources/ts/bo/utilities/vue-bo.ts new file mode 100644 index 00000000..33c45fb6 --- /dev/null +++ b/resources/ts/bo/utilities/vue-bo.ts @@ -0,0 +1,71 @@ +import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; +import type { App, Component } from "vue"; +import { createApp } from "vue"; + +type VueModuleMap = Record<string, () => Promise<{ default: Component }>>; + +const toSnakeCaseName = (componentName: string): string => { + return componentName + .split(".")[0] + .replaceAll(/\.?([A-Z])/g, (_match, p1) => { + return "-" + p1.toLowerCase(); + }) + .replace(/^-/, "") + .replace("-component", ""); +}; + +export const registerBoVueApps = (vues: VueModuleMap, doc: Document = document): void => { + + const setupApp = (app: App<Element>) => { + app.config.globalProperties.window = globalThis; + app.config.globalProperties.document = doc; + + app.component("FontAwesomeIcon", FontAwesomeIcon); + }; + + for (const [vueCptPathName, vueCptPromise] of Object.entries(vues)) { + const isInHiddenFolder = vueCptPathName + .split("/") + .some((part) => part.startsWith("_")); + + if (isInHiddenFolder) { + continue; + } + + const componentName = vueCptPathName.split("/").pop(); + if (!componentName) { + throw new Error(`Cannot load ${vueCptPathName}`); + } + const snakeCaseName = toSnakeCaseName(componentName); + + const el = doc.getElementById(snakeCaseName), + elGroup = doc.getElementsByClassName(snakeCaseName); + // * Init using ID + if (el) { + vueCptPromise().then((vueParsedFile) => { + const app = createApp(vueParsedFile.default, {json: el.dataset.json ?? {},}); + setupApp(app); + app.mount(el); + }); + } + // * Init Using class + for (const grpEl of elGroup) { + // * Hack to prevent loop weirdness + vueCptPromise().then((vueParsedFile) => { + setTimeout(() => { + const app = createApp(vueParsedFile.default, {json: (grpEl as HTMLElement).dataset.json ?? {},}); + setupApp(app); + app.mount(grpEl); + }, 500); + }); + } + } +}; + +document.addEventListener("DOMContentLoaded", () => { + // Register components + /// <reference types="vite/client" /> + const vues = import.meta.glob("./../components/**/*.vue") as VueModuleMap; + + registerBoVueApps(vues, document); +}); diff --git a/resources/ts/env.d.ts b/resources/ts/env.d.ts new file mode 100644 index 00000000..3428157a --- /dev/null +++ b/resources/ts/env.d.ts @@ -0,0 +1,8 @@ +/// <reference types="vite/client" /> + +declare module "*.vue" { + import type { DefineComponent } from "vue"; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const component: DefineComponent<object, object, any>; + export default component; +} diff --git a/resources/ts/fo/base/flashToasts.ts b/resources/ts/fo/base/flashToasts.ts new file mode 100644 index 00000000..614de861 --- /dev/null +++ b/resources/ts/fo/base/flashToasts.ts @@ -0,0 +1,5 @@ +import { initFlashToasts } from "@fo/services/toast.service"; + +document.addEventListener("DOMContentLoaded", () => { + initFlashToasts(); +}); diff --git a/resources/ts/fo/components/AssociatedProducts.vue b/resources/ts/fo/components/AssociatedProducts.vue new file mode 100644 index 00000000..c3801f16 --- /dev/null +++ b/resources/ts/fo/components/AssociatedProducts.vue @@ -0,0 +1,44 @@ +<template> + <section + v-if="products && products.length > 0" + class="mt-5 pt-5 border-top" + > + <h2 class="mb-4 h3 text-center"> + {{ __('Associated products') }} + </h2> + <div class="row row-cols-1 row-cols-md-2 row-cols-xl-3 g-4 justify-content-center"> + <div + v-for="product in products" + :key="product.id" + class="col" + > + <ProductCard :product="product" /> + </div> + </div> + </section> +</template> + +<script lang="ts" setup> +import { ref, useAttrs } from "vue"; + +import type { ProductModel } from "@fo/schemas/models/product-model.zod.ts"; +import { productModelSchema } from "@fo/schemas/models/product-model.zod.ts"; +import { __ } from "@modules/trans"; +import z from "@modules/zod"; + +import ProductCard from "./ProductsViewer/ProductCard.vue"; + + +defineOptions({ name: "AssociatedProducts" }); + +const attrs = useAttrs(); +const products = ref<ProductModel[]>([]); + +try { + const json = String(attrs.json ?? "[]"); + const data = JSON.parse(json); + products.value = z.array(productModelSchema).parse(data); +} catch (e) { + console.error("Failed to parse associated products JSON", e); +} +</script> diff --git a/resources/ts/fo/components/Basket/BasketButtons.vue b/resources/ts/fo/components/Basket/BasketButtons.vue new file mode 100644 index 00000000..3442321f --- /dev/null +++ b/resources/ts/fo/components/Basket/BasketButtons.vue @@ -0,0 +1,168 @@ +<template> + <div + ref="rootEl" + class="d-flex justify-content-center" + > + <div + class="btn-group rounded-pill border shadow-sm bg-light" + role="group" + :aria-label="__('Quantity controls')" + > + <button + type="button" + class="btn btn-primary px-3 rounded-start-pill d-flex align-items-center justify-content-center" + :title="__('Take one out')" + data-bs-toggle="tooltip" + @click="onRemoveOneFromBasket(productId)" + v-if="qttyInCart > 0" + > + <FontAwesomeIcon + icon="fa-solid fa-minus" + aria-hidden="true" + /> + </button> + + <span + class="text-center px-3 d-flex align-items-center justify-content-center fw-bold" + aria-live="polite" + aria-atomic="true" + v-if="qttyInCart > 0" + > + <span class="visually-hidden">{{ __('Quantity in Basket') }} : </span> + {{ qttyInCart }} + </span> + + <button + type="button" + class="btn btn-primary px-3 rounded-end-pill d-flex align-items-center justify-content-center" + :title="__('Add one')" + data-bs-toggle="tooltip" + @click="onAddOneToBasket(productId)" + v-if="qttyInCart > 0" + > + <FontAwesomeIcon + icon="fa-solid fa-plus" + aria-hidden="true" + /> + </button> + <button + type="button" + class="btn btn-primary rounded-pill px-4" + :title="__('Add to Basket')" + data-bs-toggle="tooltip" + @click="onAddOneToBasket(productId)" + v-if="qttyInCart === 0" + > + <FontAwesomeIcon + icon="fa-solid fa-basket-shopping" + size="lg" + aria-hidden="true" + /> + </button> + </div> + </div> +</template> + +<script setup lang="ts"> +import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; +import { + computed, + nextTick, + onBeforeUnmount, + onMounted, + ref, useAttrs, + watch, + type PropType +} from "vue"; + +import { useBasketService } from "@fo/services"; +import { useBasketStore } from "@fo/stores"; +import type { ProductId } from "@fo/types"; +import { Tooltips } from "@modules/bs-tooltips"; +import { __ } from "@modules/trans"; +import z from "@modules/zod"; + +defineOptions({ name: "BasketButtons" }); + +const tooltips = ref<Tooltips | null>(null); + +const attrs = useAttrs(); + +const props = defineProps({ + productId: { + required: false, + type: String as unknown as PropType<ProductId>, + default: "missing-product-id" + } +}); + +const rootEl = ref<HTMLDivElement | null>(null); + +const store = useBasketStore(); +const basketService = useBasketService(); + +const jsonProductId = ref<ProductId | null>(null); + +const productId = computed(() => (props.productId === "missing-product-id" ? jsonProductId.value : props.productId) ?? props.productId); +const qttyInCart = computed(() => store.basket.items.find(v => v.id === productId.value)?.qty ?? 0); + +function onAddOneToBasket(productId: ProductId): void { + basketService.addQty(productId, 1). + finally(() => + basketService.fetchBasket()); +} + +function onRemoveOneFromBasket(productId: ProductId): void { + basketService.removeQty(productId, 1). + finally(() => + basketService.fetchBasket()); +} + +onMounted(() => { + const json = String(attrs.json ?? "{}"); + + if (props.productId !== "missing-product-id" || !attrs.json) { + return; + } + + try { + const data = z.object({ + id: z.uuid() + .transform((val) => val as ProductId) + }).parse(JSON.parse(json)); + jsonProductId.value = data.id ?? null; + } catch (e) { + console.error("Invalid JSON data for BasketButtons", e); + } + + nextTick(() => { + initTooltips(); + }); +}); + + +onBeforeUnmount(() => { + if (tooltips.value) { + tooltips.value.destroy(); + } +}); + +watch(() => qttyInCart.value, async () => { + if (tooltips.value) { + tooltips.value.destroy(); + } + await nextTick(); + initTooltips(); +}); + +/** Initialise le tooltip directement sur la ref Vue */ +function initTooltips(): void { + if (!rootEl.value) return; + + tooltips.value = Tooltips.make({ + type: "dom", + elements: rootEl.value.querySelectorAll("[data-bs-toggle=\"tooltip\"]"), + options: {placement: "bottom"} + }); +} +</script> diff --git a/resources/ts/fo/components/Basket/BasketPanel.vue b/resources/ts/fo/components/Basket/BasketPanel.vue new file mode 100644 index 00000000..51d4cc82 --- /dev/null +++ b/resources/ts/fo/components/Basket/BasketPanel.vue @@ -0,0 +1,337 @@ +<template> + <div ref="BasketPanel"> + <div + id="basket" + ref="offcanvasRef" + class="offcanvas offcanvas-end offcanvas-wide" + tabindex="-1" + role="dialog" + aria-modal="true" + aria-labelledby="basket-label" + > + <div class="offcanvas-header border-bottom mx-2 mx-md-4 px-0"> + <h5 + id="basket-label" + class="offcanvas-title fw-semibold" + > + {{ __('Shopping Basket Preview') }} + </h5> + <button + type="button" + class="btn btn-outline-dark p-1 ms-auto" + data-bs-toggle="tooltip" + :aria-label="__('Close')" + :title="__('Close')" + @click="onBasketPanelClose" + > + <FontAwesomeIcon icon="fa-solid fa-xmark" /> + </button> + </div> + + <div class="offcanvas-body d-flex flex-column p-0 position-relative"> + <ul + v-if="basketIsEmpty" + class="list-group list-group-flush px-2 px-md-4" + > + <li class="list-group-item border-0 px-0 p-3 text-muted"> + <span>{{ __('Your basket is empty') }}</span> + </li> + </ul> + + <div class="flex-grow-1 overflow-y-auto px-2 px-md-4"> + <ul class="list-group list-group-flush"> + <li + v-for="item in basketItems" + :key="item.id" + class="list-group-item border-0 px-0 d-flex py-3" + > + <img + :src="item.picture?.toString()" + :alt="item.name" + :title="item.name" + loading="lazy" + class="img-fluid rounded small-product-picture flex-shrink-0 me-3" + > + + <div class="d-flex flex-column w-100"> + <div class="d-flex flex-row justify-content-between align-items-start w-100"> + <div class="d-flex flex-column justify-content-start align-items-start pe-2"> + <a + class="text-decoration-none text-dark m-0 fw-semibold lh-sm" + :href="route('PRODUCTS_SHOW', {slug: item.slug})" + :title="item.name" + target="_self" + > + <span>{{ item.name }}</span> + </a> + <p + v-if="item.weightVariable" + class="fst-italic small text-muted m-0 mt-1" + > + *{{ __('Sold by the pound') }} + </p> + </div> + + <div class="d-flex flex-row align-items-center ms-auto flex-shrink-0"> + <p class="m-0 fw-semibold me-3 text-nowrap"> + {{ item.totalTtc?.formatted ?? '-.--' }} + </p> + <button + class="btn btn-sm btn-outline-secondary" + :title="__('Remove from Basket')" + data-bs-toggle="tooltip" + :disabled="disableBtn" + @click="onRemoveItemFromBasket(item.id)" + > + <FontAwesomeIcon icon="fa-solid fa-trash" /> + </button> + </div> + </div> + + <div class="mt-2"> + <fieldset + class="btn-group btn-group-sm border rounded-pill overflow-hidden bg-light" + role="group" + > + <button + type="button" + class="btn btn-light px-2 py-0 border-0" + :title="__('Take one out')" + data-bs-toggle="tooltip" + @click="onRemoveOneFromBasket(item.id)" + > + <FontAwesomeIcon icon="fa-solid fa-minus" /> + </button> + <span class="px-2 bg-light d-flex align-items-center small fw-bold">{{ item.qty }}</span> + <button + type="button" + class="btn btn-light px-2 py-0 border-0" + :title="__('Add one')" + data-bs-toggle="tooltip" + @click="onAddOneToBasket(item.id)" + > + <FontAwesomeIcon icon="fa-solid fa-plus" /> + </button> + </fieldset> + </div> + </div> + </li> + </ul> + </div> + + <div + v-if="!basketIsEmpty" + class="p-3 border-top mt-auto bg-light" + > + <div class="d-flex flex-row justify-content-between align-items-center fw-semibold mb-3 px-1"> + <p class="m-0"> + {{ __('Total') }} + </p> + <p class="m-0 fs-5 text-primary-emphasis"> + {{ basketTotals.total.taxIncluded?.formatted ?? '-.--' }} + </p> + </div> + + <div class="d-flex flex-column-reverse flex-md-row gap-2"> + <button + type="button" + class="btn btn-outline-secondary fw-bold btn-sm text-uppercase rounded-pill w-100" + @click="onEmptyBasket()" + > + {{ __('Empty Basket') }} + </button> + <a + class="btn btn-primary fw-bold text-uppercase fw-semibold rounded-pill w-100" + :href="route('ORDER_RECAP')" + > + {{ __('Order') }} + </a> + </div> + </div> + </div> + </div> + </div> +</template> + +<script setup lang="ts"> +import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; +import { Offcanvas } from "bootstrap"; +import Swal from "sweetalert2"; +import { computed, onBeforeUnmount, onMounted, ref, watch } from "vue"; + +import { useBasketService } from "@fo/services/basket.service"; +import { useBasketStore } from "@fo/stores/basket.store"; +import type { ProductId } from "@fo/types/product.type"; +import { Tooltips } from "@modules/bs-tooltips"; +import route from "@modules/route"; +import { __, trans } from "@modules/trans"; + +defineOptions({ name: "BasketPanel" }); + +const basketService = useBasketService(); +const basketStore = useBasketStore(); + +const isVisible = computed(() => basketStore.baketPanelVisible); +const basketIsEmpty = computed(() => basketStore.basket.items.length === 0); +const basketItems = computed(() => basketStore.basket.items); +const basketTotals = computed(() => basketStore.basket); + +const BasketPanel = ref<HTMLDivElement | null>(null); +const tooltips = ref<Tooltips | null>(null); +const disableBtn = ref(false); + +const offcanvasRef = ref<HTMLElement | null>(null); +let bsOffcanvas: Offcanvas | null = null; + +onMounted(() => { + basketService.fetchBasket(); + + bsOffcanvas = new Offcanvas(offcanvasRef.value!, { + backdrop: true, + scroll: false, + keyboard: true + }); + + offcanvasRef.value!.addEventListener("hidden.bs.offcanvas", () => { + if (basketStore.baketPanelVisible) { + basketStore.closeBasketPanel(); + } + }); + + // * Focus trap + offcanvasRef.value!.addEventListener("keydown", (e: KeyboardEvent) => { + if (e.key !== "Tab" || !isVisible.value) return; + + const focusableElements = offcanvasRef.value!.querySelectorAll( + "a[href], button:not([disabled]), input, select, textarea, [tabindex]:not([tabindex=\"-1\"])" + ); + + if (focusableElements.length === 0) return; + + const firstElement = focusableElements[0] as HTMLElement; + const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement; + + if (e.shiftKey) { + if (document.activeElement === firstElement) { + lastElement.focus(); + e.preventDefault(); + } + } else if (document.activeElement === lastElement) { + firstElement.focus(); + e.preventDefault(); + } + }); + + setTimeout(() => { + tooltips.value = Tooltips.make({ + type: "dom", + elements: BasketPanel.value!.querySelectorAll("[data-bs-toggle=\"tooltip\"]"), + options: {placement: "bottom"} + }); + }, 500); +}); + +onBeforeUnmount(() => { + if (bsOffcanvas) { + bsOffcanvas.dispose(); + } + if (tooltips.value) { + tooltips.value.destroy(); + } +}); + +watch( + () => isVisible.value, + (newValue) => { + if (!bsOffcanvas) { + return; + } + + if (newValue) { + bsOffcanvas.show(); + basketService.fetchBasket(); + setTimeout(() => { + offcanvasRef.value?.focus(); + }, 150); + } else { + bsOffcanvas.hide(); + } + } +); + +// * EVENTS + +function onBasketPanelClose(): void { + basketStore.closeBasketPanel(); +} + +function onAddOneToBasket(productId: ProductId): void { + basketService.addQty(productId, 1). + finally(() => + basketService.fetchBasket()); +} + +function onRemoveOneFromBasket(productId: ProductId): void { + basketService.removeQty(productId, 1). + finally(() => + basketService.fetchBasket()); +} + +function onRemoveItemFromBasket(productId: ProductId): void { + disableBtn.value = true; + basketService.remove(productId) + .finally(() => { + disableBtn.value = false; + basketService.fetchBasket(); + }); +} + +function onEmptyBasket(): void { + Swal.fire({ + title: trans("Are you sure you want to empty your basket?"), + icon: "warning", + showCancelButton: true, + confirmButtonColor: "var(--bs-danger)", + cancelButtonColor: "var(--bs-secondary)", + confirmButtonText: trans("Yes, empty my basket"), + cancelButtonText: trans("Cancel"), + reverseButtons: true + }).then((result) => { + if (result.isConfirmed) { + basketService.emptyBasket().then(() => { + basketService.fetchBasket(); + Swal.fire({ + title: trans("Shopping basket emptied!"), + icon: "success", + timer: 1500, + showConfirmButton: false + }); + }); + } + }).finally(() => { + setTimeout(() => { + if (offcanvasRef.value && isVisible.value) { + offcanvasRef.value.focus(); + } + }, 50); + }); +} +</script> + +<style lang="css" scoped> +.small-product-picture { + width: 50px; + height: 50px; + object-fit: cover; +} + +.offcanvas-wide { + --bs-offcanvas-width: 520px; +} + +@media (max-width: 576px) { + .offcanvas-wide { + --bs-offcanvas-width: 100%; + } +} +</style> diff --git a/resources/ts/fo/components/Basket/BasketSummaryList.vue b/resources/ts/fo/components/Basket/BasketSummaryList.vue new file mode 100644 index 00000000..d3ca2ab3 --- /dev/null +++ b/resources/ts/fo/components/Basket/BasketSummaryList.vue @@ -0,0 +1,281 @@ +<template> + <div + ref="basketSummaryEl" + class="position-relative" + > + <div v-if="!basketIsEmpty"> + <div class="card border-0 shadow-sm mb-4"> + <ul + class="list-group list-group-flush" + :aria-label="__('List of products in your basket')" + > + <li + v-for="item in basketItems" + :key="item.id" + class="list-group-item p-4" + > + <div class="row align-items-center"> + <!-- Product --> + <div class="col-12 col-md-6 d-flex flex-column flex-md-row align-items-center mb-3 mb-md-0"> + <img + v-if="item.picture" + :src="item.picture?.toString()" + :alt="item.name" + class="img-thumbnail me-3 rounded object-fit-contain mh-10" + loading="lazy" + > + <div + v-else + class="bg-light border rounded text-center me-3 d-flex align-items-center justify-content-center text-muted wh-10rem" + aria-hidden="true" + > + <FontAwesomeIcon + icon="fa-solid fa-image" + size="2x" + /> + </div> + + <div> + <h2 class="h6 mb-1"> + <a + :href="route('PRODUCTS_SHOW', {slug: item.slug})" + class="text-decoration-none text-dark fw-bold" + :aria-label="__('View details of :name', {name: item.name})" + > + {{ item.name }} + </a> + </h2> + <p + v-if="!item.weightVariable" + class="small text-muted mb-0 fst-italic" + > + *{{ __('Sold by weight') }} + </p> + <p + class="small text-muted mb-0" + :aria-label="__('Unit price: :price', {price: item.unitPriceHt?.formatted})" + > + {{ __('Unit price: :price', {price: item.unitPriceHt?.formatted ?? '-.--'}) }} + </p> + </div> + </div> + + <!-- Quantity & Total --> + <div class="col-12 col-md-6 d-flex flex-column flex-md-row justify-content-md-end align-items-md-center gap-3"> + <!-- Quantity Controls --> + <BasketButtons :product-id="item.id" /> + + <div class="d-flex flex-row justify-content-center align-items-center gap-3"> + <div + class="fw-bold fs-5 ms-md-3 text-nowrap" + :aria-label="__('Total for this product: :total', {total: item.totalTtc?.formatted})" + > + {{ item.totalTtc?.formatted ?? '-.--' }} + </div> + + <button + type="button" + class="btn btn-outline-danger rounded-pill ms-md-2" + :aria-label="__('Delete :name from the basket', {name: item.name})" + :title="__('Delete')" + data-bs-toggle="tooltip" + :disabled="disableBtn" + @click="onRemoveItemFromBasket(item.id)" + > + <FontAwesomeIcon + icon="fa-solid fa-trash" + aria-hidden="true" + /> + </button> + </div> + </div> + </div> + </li> + </ul> + </div> + + <!-- Order Summary Totals --> + <div class="card border-0 shadow-sm bg-light"> + <div class="card-body p-4"> + <div class="d-flex justify-content-between align-items-center mb-4 border-bottom pb-3"> + <h2 class="h4 fw-bold mb-0"> + {{ __('Total to pay') }} + </h2> + <span + class="fs-3 fw-bold text-primary-emphasis" + aria-live="polite" + >{{ basketTotals.total.taxIncluded?.formatted ?? '-.--' }}</span> + </div> + <div class="d-flex flex-column flex-md-row justify-content-end gap-3"> + <button + type="button" + class="btn btn-outline-secondary rounded-pill px-4 text-uppercase" + :title="__('Completely empty the basket')" + data-bs-toggle="tooltip" + @click="onEmptyBasket" + > + {{ __('Empty Basket') }} + </button> + + <form + class="w-100 w-md-auto m-0" + :action="submitUrl" + method="POST" + > + <input + type="hidden" + name="_token" + :value="csrfToken" + > + <button + class="btn btn-primary w-100 fw-bold rounded-pill px-5 text-uppercase" + type="submit" + :title="__('Validate my basket and proceed to reservation')" + data-bs-toggle="tooltip" + > + {{ __('Validate my basket') }} + <FontAwesomeIcon + icon="fa-solid fa-arrow-right" + class="ms-2" + aria-hidden="true" + /> + </button> + </form> + </div> + </div> + </div> + </div> + <div + v-else + class="text-center py-5" + > + <div class="mb-4"> + <FontAwesomeIcon + icon="fa-solid fa-basket-shopping" + class="text-muted opacity-50" + size="6x" + /> + </div> + <h2 class="h4 fw-bold mb-3"> + {{ __('Your basket is empty') }} + </h2> + <p class="text-muted mb-4"> + {{ __('It seems you haven\'t added anything to your basket yet.') }} + </p> + <a + :href="shopUrl" + class="btn btn-primary rounded-pill px-4 py-2 fw-semibold" + data-bs-toggle="tooltip" + :title="__('Go to page :page', {page: __('Aisles')})" + > + {{ __('Discover our products') }} + </a> + </div> + </div> +</template> + +<script setup lang="ts"> +import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; +import Swal from "sweetalert2"; +import { computed, onBeforeUnmount, onMounted, ref, useAttrs } from "vue"; + +import BasketButtons from "@fo/components/Basket/BasketButtons.vue"; +import { useBasketService } from "@fo/services/basket.service"; +import { useBasketStore } from "@fo/stores/basket.store"; +import type { ProductId } from "@fo/types/product.type"; +import { Tooltips } from "@modules/bs-tooltips"; +import route from "@modules/route"; +import { __, trans } from "@modules/trans"; +import z from "@modules/zod"; + +defineOptions({ name: "BasketSummaryList" }); + + + +const basketSummaryEl = ref<HTMLDivElement | null>(null); + +const tooltips = ref<Tooltips | null>(null); + +const submitUrl = route("ORDER_RECAP_SUBMIT"); +const shopUrl = route("PRODUCTS_INDEX"); +const attrs = useAttrs(); +const json = String(attrs.json ?? "{}"); +let csrfToken = ""; +try { + const data = z.object({ csrf: z.string().min(1) }).parse(JSON.parse(json)); + csrfToken = data.csrf; +} catch (e) { + console.error("Invalid JSON data for BasketSummaryList: ", e); +} + +const basketService = useBasketService(); +const basketStore = useBasketStore(); + +const basketIsEmpty = computed(() => basketStore.basket.items.length === 0); +const basketItems = computed(() => basketStore.basket.items); +const basketTotals = computed(() => basketStore.basket); + +const disableBtn = ref(false); + +onMounted(() => { + basketService.fetchBasket(); +}); + +function onRemoveItemFromBasket(productId: ProductId): void { + disableBtn.value = true; + basketService.remove(productId) + .finally(() => { + disableBtn.value = false; + basketService.fetchBasket(); + }); +} + +onMounted(() => { + initTooltips(); +}); + +onBeforeUnmount(() => { + if (tooltips.value) { + tooltips.value.destroy(); + } +}); + +function onEmptyBasket(): void { + Swal.fire({ + title: trans("Are you sure you want to empty your basket?"), + icon: "warning", + showCancelButton: true, + confirmButtonColor: "var(--bs-danger)", + cancelButtonColor: "var(--bs-secondary)", + confirmButtonText: trans("Yes, empty my basket"), + cancelButtonText: trans("Cancel"), + reverseButtons: true + }).then((result) => { + if (result.isConfirmed) { + basketService.emptyBasket().then(() => { + basketService.fetchBasket(); + Swal.fire({ + title: trans("Shopping basket emptied!"), + icon: "success", + timer: 1500, + showConfirmButton: false + }); + }); + } + }); +} + +/** Initialise le tooltip directement sur la ref Vue */ +function initTooltips(): void { + setTimeout(() => { + if (!basketSummaryEl.value) { + return; + } + tooltips.value = Tooltips.make({ + type: "dom", + elements: basketSummaryEl.value.querySelectorAll("[data-bs-toggle=\"tooltip\"]"), + options: { placement: "bottom" } + }); + }, 500); +} +</script> diff --git a/resources/ts/fo/components/Basket/NavBasketButton.vue b/resources/ts/fo/components/Basket/NavBasketButton.vue new file mode 100644 index 00000000..05abf630 --- /dev/null +++ b/resources/ts/fo/components/Basket/NavBasketButton.vue @@ -0,0 +1,75 @@ +<template> + <button + ref="navBasketButton" + class="btn btn-tertiary border-dark focus-ring focus-ring-dark btn-lg text-decoration-none d-flex align-items-center gap-2" + :title="__('Show basket')" + data-bs-toggle="tooltip" + aria-label="Ouvrir le panier" + @click="onBasketButtonClick" + > + <div class="position-relative"> + <i class="fa-solid fa-basket-shopping" /> + + <span + v-show="count > 0" + class="position-absolute top-0 start-100 translate-middle ms-2 badge rounded-pill text-bg-info" + > + {{ count }} + <span class="visually-hidden">{{ __('articles dans le panier') }}</span> + </span> + </div> + + <span + v-if="amount" + class="d-none d-lg-block fw-bold" + > + {{ amount }} + </span> + </button> +</template> + +<script setup lang="ts"> +import { computed, onBeforeUnmount, onMounted, ref } from "vue"; + +import { useBasketStore } from "@fo/stores/basket.store"; +import { Tooltips } from "@modules/bs-tooltips"; +import { __ } from "@modules/trans"; + +defineOptions({ name: "NavBasketButton" }); + +const cartStore = useBasketStore(); + +const count = computed(() => cartStore.basket.items.reduce((acc, item) => acc + item.qty, 0)); +const amount = computed(() => cartStore.basket.total.taxIncluded?.formatted); + +const navBasketButton = ref<HTMLButtonElement | null>(null); +let tooltipsInstance: Tooltips | null = null; + +onMounted(() => { + initTooltips(); +}); + +onBeforeUnmount(() => { + if (tooltipsInstance) { + tooltipsInstance.destroy(); + } +}); + +function onBasketButtonClick() { + cartStore.toggleBaketPanel(); +} + +/** Initialise le tooltip directement sur la ref Vue */ +function initTooltips(): void { + setTimeout(() => { + if (!navBasketButton.value) { + return; + } + tooltipsInstance = Tooltips.make({ + type: "dom", + elements: navBasketButton.value, + options: {container: navBasketButton.value} + }); + }, 500); +} +</script> diff --git a/resources/ts/fo/components/MapLocationDisplay.vue b/resources/ts/fo/components/MapLocationDisplay.vue new file mode 100644 index 00000000..6ed573c2 --- /dev/null +++ b/resources/ts/fo/components/MapLocationDisplay.vue @@ -0,0 +1,106 @@ +<template> + <div class="map-location-display"> + <div + ref="mapContainer" + class="map-container rounded shadow-sm" + /> + </div> +</template> + +<script setup lang="ts"> +import { + icon, + map as leafMap, marker as leafMarker, Marker, tileLayer +} from "leaflet"; +import markerIcon2x from "leaflet/dist/images/marker-icon-2x.png"; +import markerIcon from "leaflet/dist/images/marker-icon.png"; +import markerShadow from "leaflet/dist/images/marker-shadow.png"; +import "leaflet/dist/leaflet.css"; +import { onBeforeMount, onMounted, ref, shallowRef, useAttrs } from "vue"; + +defineOptions({ name: "MapLocationDisplay" }); + +const attrs = useAttrs(); +const mapContainer = ref<HTMLElement | null>(null); +const map = shallowRef<L.Map | null>(null); + +const lat = ref<number | null>(null); +const lng = ref<number | null>(null); +const storeName = ref<string>(""); +const storeAddress = ref<string>(""); +const phone = ref<string>(""); + + +const defaultIcon = icon({ + iconUrl: markerIcon, + iconRetinaUrl: markerIcon2x, + shadowUrl: markerShadow, + iconSize: [25, 41], + iconAnchor: [12, 41], + popupAnchor: [1, -34], + shadowSize: [41, 41] +}); +Marker.prototype.options.icon = defaultIcon; + +onBeforeMount(() => { + if (!attrs.json) { + throw new Error("this component requires json"); + } +}); + +onMounted(() => { + const json = String(attrs.json ?? "{}"); + const data = JSON.parse(json); + + lat.value = data.lat ? Number.parseFloat(data.lat) : null; + lng.value = data.lng ? Number.parseFloat(data.lng) : null; + storeName.value = data.name || ""; + storeAddress.value = data.address || ""; + phone.value = data.phone || ""; + + if (lat.value && lng.value) { + initMap(); + } +}); + +const initMap = () => { + if (!mapContainer.value || !lat.value || !lng.value) return; + + const position: [number, number] = [lat.value, lng.value]; + + map.value = leafMap( + mapContainer.value, + { + // * Prevent scroll issues + scrollWheelZoom: false + }).setView(position, 15); + + tileLayer( + "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", + {attribution: "© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a>",} + ).addTo(map.value); + + const marker = leafMarker(position).addTo(map.value); + + if (storeName.value || storeAddress.value) { + const popupContent = ` + <div class="text-center"> + <strong class="leaflet-popup-title">${storeName.value}</strong> + <span>${storeAddress.value}</span><br> + <a href="tel:${phone.value}">${phone.value}</a> + </div> + `; + marker.bindPopup(popupContent).openPopup(); + } +}; +</script> + +<style lang="scss" scoped> +.map-location-display { + .map-container { + height: 350px; + width: 100%; + z-index: 1; + } +} +</style> diff --git a/resources/ts/fo/components/PasswordVisibility.vue b/resources/ts/fo/components/PasswordVisibility.vue new file mode 100644 index 00000000..04b33325 --- /dev/null +++ b/resources/ts/fo/components/PasswordVisibility.vue @@ -0,0 +1,140 @@ +<template> + <button + ref="passwordVisibility" + @click.prevent="toggleVisibility()" + @keydown="keydown" + :class="`btn btn-primary rounded-0 rounded-end password-visibility password-visibility-${id} h-100 border-0 p-0 overflow-hidden`" + :aria-pressed="!visible" + > + <span + :class="{ + 'text-bg-primary reveal d-flex justify-content-center align-items-center h-100': true, + 'd-none': visible + }" + type="button" + :title="__('vue.PasswordVisibility.hide')" + data-bs-toggle="tooltip" + > + <FontAwesomeIcon + icon="fas fa-eye-slash" + :aria-hidden="true" + /> + </span> + <span + ref="passwordVisibilitySpan" + :class="{ + 'text-bg-primary reveal d-flex justify-content-center align-items-center h-100': true, + 'd-none': !visible + }" + type="button" + :title="__('vue.PasswordVisibility.show')" + data-bs-toggle="tooltip" + > + <FontAwesomeIcon + icon="fas fa-eye" + :aria-hidden="true" + /> + </span> + </button> +</template> + +<script lang="ts" setup> +import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; +import { onBeforeUnmount, onMounted, ref, useAttrs } from "vue"; + +import { Tooltips } from "@modules/bs-tooltips"; +import { __ } from "@modules/trans"; +import z from "@modules/zod"; + +defineOptions({ name: "PasswordVisibility" }); + +// * ATTRIBUTES +const attrs = useAttrs(); + +// * REFS +const passwordVisibility = ref<HTMLButtonElement | null>(null); + +// * DATA +const id = ref<string>(""); +const input = ref<HTMLInputElement>(document.createElement("input")); +const visible = ref<boolean>(true); +const tooltips = ref<Tooltips | null>(null); + +// * LIFECYCLE +onMounted(() => { + const json = String(attrs.json ?? "{}"); + let data; + try { + data = z.object({ + id: z.string().nonempty() + .refine((val) => globalThis.document. + getElementById(val), { message: "The 'id' field must not be empty and exist in the DOM" }) + }).parse(JSON.parse(json)); + } catch (e) { + throw new Error(`Invalid JSON data for PasswordVisibility: ${e}`); + } + + id.value = data.id; + input.value = document.getElementById(id.value) as HTMLInputElement; + if (!input.value) { + throw new Error(`Cannot find input id '${id.value}'`); + } + if (input.value.tagName !== "INPUT") { + throw new Error(`id '${id.value}' is not an input`); + } + if ((input.value as HTMLInputElement).type !== "password") { + throw new Error(`id '${id.value}' is not an input password`); + } + initTooltips(); +}); + +// * METHODS + +/** Set event on key down. */ +function keydown(e: KeyboardEvent): void { + if ( + e.key === " " || + e.code === "Space" || + e.keyCode === 32 || + e.key === "Enter" || + e.code === "Enter" || + e.keyCode === 13 + ) { + toggleVisibility(); + e.preventDefault(); + } +} + +/** Update password status (visible, hidden). */ +function toggleVisibility(): void { + input.value.type = (input.value.type === "password") ? "text" : "password"; + visible.value = input.value.type === "password"; +} + +/** Initialise all tooltips in the component. */ +function initTooltips(): void { + setTimeout(() => { + tooltips.value = Tooltips.make({ + type: "dom", + elements: passwordVisibility.value!.querySelectorAll("[data-bs-toggle=\"tooltip\"]"), + options: null + }); + }, 500); +} + +onBeforeUnmount(() => { + if (tooltips.value) { + tooltips.value.destroy(); + } +}); +</script> + +<style lang="scss" scoped> +.password-visibility { + border-top-right-radius: 0 !important; +} + +.password-visibility .reveal { + width: 52px; +} +</style> diff --git a/resources/ts/fo/components/ProductsViewer/AisleViewer.vue b/resources/ts/fo/components/ProductsViewer/AisleViewer.vue new file mode 100644 index 00000000..29a25115 --- /dev/null +++ b/resources/ts/fo/components/ProductsViewer/AisleViewer.vue @@ -0,0 +1,106 @@ +<template> + <div> + <div class="h1 sticky-md-top sticky-top-offset bg-body py-2 z-3 text-uppercase"> + {{ pageTitle }} + </div> + + <div + v-if="!loading" + class="row row-cols-1 row-cols-md-2 row-cols-xl-3 g-4" + > + <template v-if="filteredProductList.length"> + <div + v-for="product in filteredProductList" + :key="product.id" + class="col" + > + <ProductCard + :product="product" + /> + </div> + </template> + <span + v-else + class="fs-5 fw-semibold" + > + {{ __('crud.helpers.no_results', {'model': trans_choice('models.classes.products', Infinity)}) }} + </span> + </div> + + <div + v-else + class="text-center py-5" + > + <output class="spinner-border text-primary"> + <span class="visually-hidden">{{ __('Loading') }}...</span> + </output> + </div> + + <div + ref="scrollSentinel" + class="text-center py-4 w-100" + v-show="filteredProductList.length && !loading" + > + <output + v-if="loading" + class="spinner-border text-secondary spinner-border-sm" + > + <span class="visually-hidden">{{ __('Loading more') }}...</span> + </output> + </div> + </div> +</template> + +<script lang="ts" setup> +import { storeToRefs } from "pinia"; +import { computed, onMounted, onUnmounted, ref } from "vue"; + +import { useProductViewerStore } from "@fo/stores"; +import { __, trans_choice } from "@modules/trans"; + +import ProductCard from "./ProductCard.vue"; + +defineOptions({ name: "AilesViewer" }); + +const store = useProductViewerStore(); +const { + loading, filteredProductList, activeBrands, activeRanges, activeTags, isDiscounted, currentSearchValue +} = storeToRefs(store); + +const scrollSentinel = ref<HTMLElement | null>(null); +let observer: IntersectionObserver | null = null; + +const anyBrandChecked = computed<boolean>(() => activeBrands.value.length > 0); +const anyRangeChecked = computed<boolean>(() => activeRanges.value.length > 0); +const anyTagChecked = computed<boolean>(() => activeTags.value.length > 0); +const hascheckedAnOption = computed<boolean>(() => currentSearchValue.value.length > 0 || anyBrandChecked.value + || anyRangeChecked.value || anyTagChecked.value|| anyBrandChecked.value || isDiscounted.value +); +const pageTitle = computed<string>(() => hascheckedAnOption.value ? __("Your search") : __("All aisles")); + +onMounted(() => { + observer = new IntersectionObserver((entries) => { + const firstEntry = entries[0]; + if (firstEntry.isIntersecting) { + store.triggerLoadMore(); + } + }, { + rootMargin: "200px", + threshold: 0.1 + }); + + if (scrollSentinel.value) { + observer.observe(scrollSentinel.value); + } +}); + +onUnmounted(() => { + if (observer) observer.disconnect(); +}); +</script> + +<style lang="css" scoped> +.sticky-top-offset { + top: 4.3rem; +} +</style> diff --git a/resources/ts/fo/components/ProductsViewer/ProductCard.vue b/resources/ts/fo/components/ProductsViewer/ProductCard.vue new file mode 100644 index 00000000..1e201f2f --- /dev/null +++ b/resources/ts/fo/components/ProductsViewer/ProductCard.vue @@ -0,0 +1,191 @@ +<template> + <div + ref="rootEl" + class="card h-100 w-100 rounded-4 position-relative d-flex flex-column justify-content-between border-0 shadow-sm" + :class="{ 'opacity-75': !product.is_available }" + > + <div + class="p-2 text-center position-relative" + aria-hidden="true" + > + <span + v-if="!product.is_available" + class="position-absolute top-50 start-50 translate-middle badge bg-dark text-uppercase fs-6 z-1 p-3 shadow" + > + {{ __('Coming soon') }} + </span> + + <img + v-if="product.picture" + class="img-fluid object-fit-contain mh-150px" + :src="product.picture.toString()" + :alt="product.picture_alt" + loading="lazy" + > + <img + v-else + class="img-fluid rounded-3" + :src="assetStatic('resources/assets/images/pl_nophoto.png')" + alt="" + loading="lazy" + > + </div> + + <div class="card-body d-flex flex-column justify-content-between pt-0"> + <div> + <h3 class="card-title fw-semibold h5 mb-2 text-center"> + <a + class="text-decoration-none stretched-link focus-ring" + :href="route('PRODUCTS_SHOW', {SLUG: product.slug})" + :aria-label="__('View product') + ' : ' + product.name" + > + {{ product.name }} + </a> + </h3> + + <div class="card-text w-100 text-muted small my-2 text-center"> + {{ product.shortDescription }} + </div> + </div> + </div> + + <div class="card-footer z-2 border-0 bg-transparent pb-3 pt-0"> + <ul class="list-unstyled mb-0"> + <li class="py-1 text-center"> + <span + v-if="product.weight_variable && product.is_available" + class="text-muted small d-block mb-1" + > + {{ __('Approximately') }}* + </span> + + <template v-if="product.priceTtc"> + <span + class="fw-semibold h4" + :class="{ 'text-danger': product.discountedPriceTtc }" + > + <span class="visually-hidden">{{ __('Current price') }} : </span> + {{ product.discountedPriceTtc?.formatted ?? product.priceTtc.formatted }} + </span> + <span + v-if="product.sell_unit_label" + class="text-lowercase text-muted small align-middle ms-1" + >/{{ product.sell_unit_label }}</span> + + <small + v-if="product.discountedPriceTtc && product.showStrippedPrice" + class="text-muted text-decoration-line-through ms-2" + > + <span class="visually-hidden">{{ __('Original price') }} : </span> + {{ product.priceTtc.formatted }} + </small> + + <br> + <small class="fst-italic text-muted"> + {{ product.weight_variable ? '*' + __('Product sold by the kilo') : __('Price per kilo') }} : {{ product.priceKgTtc?.formatted }}/kg + </small> + </template> + <template v-else> + <span class="fw-semibold h4">-.--</span> + <span + v-if="product.sell_unit_label" + class="text-lowercase text-muted small align-middle ms-1" + >/{{ product.sell_unit_label }}</span> + <br> + <small class="fst-italic text-muted"> + {{ product.weight_variable ? '*' + __('Product sold by the kilo') : __('Price per kilo') }} : -.-- /kg + </small> + </template> + </li> + + <li class="position-relative z-3 py-2 d-flex justify-content-between align-items-center"> + <div class="d-flex align-items-center"> + <img + v-if="product.nutriscore" + class="object-fit-contain nutriscore-tooltip mw-80px" + data-bs-toggle="tooltip" + :src="assetStatic(`resources/assets/images/nutriscore/nutriscore-${product.nutriscore.toUpperCase()}.png`)" + :data-bs-title="__('Nutriscore') + ' ' + product.nutriscore.toUpperCase()" + :alt="__('Nutriscore') + ' ' + product.nutriscore.toUpperCase()" + > + </div> + + <BasketButtons + v-if="product.can_add_to_basket" + :product-id="product.id" + /> + </li> + </ul> + </div> + </div> +</template> + +<script lang="ts" setup> +import { onBeforeUnmount, onMounted, ref, type PropType } from "vue"; + +import type { Money, Nutriscore, ProductId, ProductSlug } from "@fo/types"; +import { assetStatic } from "@modules/asset"; +import { Tooltips } from "@modules/bs-tooltips"; +import route from "@modules/route"; +import { __ } from "@modules/trans"; + +import BasketButtons from "../Basket/BasketButtons.vue"; + +interface FilteredProductProp { + id: ProductId; + name: string; + slug: ProductSlug; + shortDescription: string | null; + picture: URL | null, + picture_title: string; + picture_alt: string; + weight_variable: boolean; + priceTtc: Money | null; + priceKgTtc: Money | null; + discountedPriceTtc: Money | null; + showStrippedPrice?: boolean; + sell_unit_label?: string | null; + nutriscore: Nutriscore | null; + is_available: boolean; + can_add_to_basket: boolean; +} + +defineOptions({ name: "ProductCard" }); + +defineProps({ + product: { + type: Object as PropType<FilteredProductProp>, + required: true + } +}); + +const rootEl = ref<HTMLDivElement | null>(null); +let tooltipsInstance: Tooltips | null = null; + +onMounted(() => { + initTooltips(); +}); + +onBeforeUnmount(() => { + if (tooltipsInstance) { + tooltipsInstance.destroy(); + } +}); + +function initTooltips(): void { + setTimeout(() => { + if (!rootEl.value) return; + + const tooltipElements = Array.from(rootEl.value.querySelectorAll(".nutriscore-tooltip")) + .filter((el) => (el as HTMLElement).offsetParent !== null); + + if (tooltipElements.length > 0) { + tooltipsInstance = Tooltips.make({ + type: "dom", + elements: tooltipElements as unknown as NodeListOf<HTMLElement>, + options: {container: rootEl.value} + }); + } + }, 500); +} +</script> diff --git a/resources/ts/fo/components/ProductsViewer/ProductFilter.vue b/resources/ts/fo/components/ProductsViewer/ProductFilter.vue new file mode 100644 index 00000000..cce1be55 --- /dev/null +++ b/resources/ts/fo/components/ProductsViewer/ProductFilter.vue @@ -0,0 +1,252 @@ +<template> + <div class="mb-3 sticky-top-offset mh-95vh"> + <div class="mb-3"> + <label + class="fw-semibold fs-5 form-label" + for="filter-text" + > + {{ __('Filters') }} + </label> + <div class="d-flex align-items-center gap-2"> + <input + id="filter-text" + type="search" + class="form-control" + :placeholder="__('Search...')" + v-model="searchValue" + > + <button + v-if="hasActiveFilters" + type="button" + class="btn btn-outline-secondary btn-sm text-nowrap" + :title="__('Reset filters')" + @click="vm.clearFilters()" + > + × {{ __('Reset') }} + </button> + </div> + <small + v-if="errorOccured" + class="fw-semibold text-danger" + >{{ __('An error has occurred.') }}</small> + </div> + + <div + class="accordion" + id="accordion-filters" + > + <div class="accordion-item"> + <h2 class="accordion-header"> + <button + class="accordion-button" + type="button" + data-bs-toggle="collapse" + data-bs-target="#collapse-ranges" + > + <span class="fw-semibold fs-5">{{ titleCase(trans_choice('models.classes.ranges', Infinity)) }}</span> + <span + v-if="filterRange.length" + class="badge rounded-pill text-bg-dark ms-2" + >{{ filterRange.length }}</span> + </button> + </h2> + <div + id="collapse-ranges" + class="accordion-collapse collapse show" + data-bs-parent="#accordion-filters" + > + <div class="accordion-body p-0"> + <ul class="list-group rounded-0"> + <li + v-for="range in rangeList" + :key="range.id" + class="list-group-item d-flex align-items-center text-bg-light" + > + <input + class="form-check-input me-2 mt-0" + type="checkbox" + :id="`filter-range-${range.id}`" + :value="range.id" + v-model="filterRange" + > + <label + class="form-check-label w-100 cliquable" + :for="`filter-range-${range.id}`" + >{{ titleCase(range.name) }}</label> + </li> + </ul> + </div> + </div> + </div> + + <div class="accordion-item"> + <h2 class="accordion-header"> + <button + class="accordion-button collapsed" + type="button" + data-bs-toggle="collapse" + data-bs-target="#collapse-brands" + > + <span class="fw-semibold fs-5">{{ titleCase(trans_choice('models.classes.brands', Infinity)) }}</span> + <span + v-if="filterBrand.length" + class="badge rounded-pill text-bg-dark ms-2" + >{{ filterBrand.length }}</span> + </button> + </h2> + <div + id="collapse-brands" + class="accordion-collapse collapse" + data-bs-parent="#accordion-filters" + > + <div class="accordion-body p-0"> + <ul class="list-group rounded-0"> + <li + v-for="brand in brandList" + :key="brand.value" + class="list-group-item d-flex align-items-center text-bg-light" + > + <input + class="form-check-input me-2 mt-0" + type="checkbox" + :id="`filter-brand-${brand.value}`" + :value="brand.value" + v-model="filterBrand" + > + <label + class="form-check-label w-100 cliquable" + :for="`filter-brand-${brand.value}`" + >{{ titleCase(brand.label) }}</label> + </li> + </ul> + </div> + </div> + </div> + + <div class="accordion-item"> + <h2 class="accordion-header"> + <button + class="accordion-button collapsed" + type="button" + data-bs-toggle="collapse" + data-bs-target="#collapse-specials" + > + <span class="fw-semibold fs-5">{{ titleCase(__('Special')) }}</span> + <span + v-if="filterTag.length || filterIsDiscounted" + class="badge rounded-pill text-bg-dark ms-2" + >{{ filterTag.length + (filterIsDiscounted ? 1 : 0) }}</span> + </button> + </h2> + <div + id="collapse-specials" + class="accordion-collapse collapse" + data-bs-parent="#accordion-filters" + > + <div class="accordion-body p-0"> + <ul class="list-group rounded-0"> + <li + v-for="tag in tagList" + :key="tag.id" + class="list-group-item d-flex align-items-center text-bg-light" + > + <input + class="form-check-input me-2 mt-0" + type="checkbox" + :id="`filter-tag-${tag.id}`" + :value="tag.id" + v-model="filterTag" + > + <label + class="form-check-label w-100 cliquable" + :for="`filter-tag-${tag.id}`" + >{{ titleCase(tag.label) }}</label> + </li> + + <li class="list-group-item d-flex align-items-center text-bg-light"> + <input + class="form-check-input me-2 mt-0" + type="checkbox" + id="filter-discounted" + v-model="filterIsDiscounted" + > + <label + class="form-check-label w-100 cliquable" + for="filter-discounted" + > + {{ titleCase(trans_choice('models.classes.discounts', Infinity)) }} + </label> + </li> + </ul> + </div> + </div> + </div> + </div> + </div> +</template> + +<script lang="ts" setup> +import { watch } from "vue"; + +import { titleCase } from "@modules/strings"; +import { __, trans_choice } from "@modules/trans"; + +import { useProductFilterViewModel } from "./ProductFilterViewModel"; + +defineOptions({ name: "ProductFilter" }); + +const vm = useProductFilterViewModel(); + +const props = defineProps({perPage: { type: Number, required: true }}); + +const errorOccured = vm.errorOccured; +const searchValue = vm.searchValue; +const rangeList = vm.rangeList; +const filterRange = vm.filterRange; +const brandList = vm.brandList; +const filterBrand = vm.filterBrand; +const tagList = vm.tagList; +const filterTag = vm.filterTag; +const filterIsDiscounted = vm.filterIsDiscounted; +const hasActiveFilters = vm.hasActiveFilters; + +watch(() => props.perPage, (newVal) => { + vm.perPage.value = newVal; +}, { immediate: true }); + +</script> + +<style lang="css" scoped> +.sticky-top-offset { + top: 0; +} + +.mh-95vh { + max-height: none; +} + +.accordion-body { + max-height: 240px; + overflow-y: auto; +} + +@media (min-width: 992px) { + .sticky-top-offset { + position: sticky; + top: 4.5rem; + z-index: 1020; + } + + .mh-95vh { + max-height: 95vh; + } +} + +.accordion-body::-webkit-scrollbar { + width: 6px; +} +.accordion-body::-webkit-scrollbar-thumb { + background-color: #cbd5e1; + border-radius: 3px; +} +</style> diff --git a/resources/ts/fo/components/ProductsViewer/ProductFilterViewModel.ts b/resources/ts/fo/components/ProductsViewer/ProductFilterViewModel.ts new file mode 100644 index 00000000..a3d5239f --- /dev/null +++ b/resources/ts/fo/components/ProductsViewer/ProductFilterViewModel.ts @@ -0,0 +1,247 @@ +import { computed, ref, watch } from "vue"; + +import { useFilterProductService, type FilterProductService } from "@fo/services"; +import { useProductViewerStore, type ProductViewerStore } from "@fo/stores"; +import { + paginateWith, + type BrandValue, + type RangeId, + type TagId +} from "@fo/types"; +import { defineDebounce } from "@modules/debounce"; + +export class ProductFilterViewModel { + public readonly errorOccured = ref(false); + public readonly searchValue = ref(""); + + private readonly currentPage = ref(1); + public readonly perPage = ref(6); + + public readonly isNextPageLoading = ref(false); + public readonly hasMorePages = ref(true); + + public readonly rangeList = computed(() => this.store.rangeList); + public readonly tagList = computed(() => this.store.tagList); + public readonly brandList = computed(() => this.store.brandList.filter( + (brand) => brand.value.toLowerCase() !== "none" + )); + + public readonly filterRange = computed<RangeId[]>({ + get: () => this.store.activeRanges, + set: (v) => { + this.store.setActiveRanges(v); + this.syncUrl(); + this.refreshList(); + }, + }); + + public readonly filterTag = computed<TagId[]>({ + get: () => this.store.activeTags, + set: (v) => { + this.store.setActiveTags(v); + this.syncUrl(); + this.refreshList(); + }, + }); + + public readonly filterBrand = computed<BrandValue[]>({ + get: () => this.store.activeBrands, + set: (v) => { + this.store.setActiveBrands(v); + this.syncUrl(); + this.refreshList(); + }, + }); + + public readonly filterIsDiscounted = computed<boolean>({ + get: () => this.store.isDiscounted, + set: (v) => { + this.store.setIsDiscounted(v); + this.syncUrl(); + this.refreshList(); + }, + }); + + public readonly hasActiveFilters = computed<boolean>(() => + !!this.store.currentSearchValue + || this.store.activeRanges.length > 0 + || this.store.activeTags.length > 0 + || this.store.activeBrands.length > 0 + || this.store.isDiscounted + ); + + public clearFilters(): void { + this.searchValue.value = ""; + this.store.clearFilters(); + this.syncUrl(); + this.refreshList(); + } + + private syncUrl(): void { + const url = new URL(document.location.href); + const params = url.searchParams; + + params.delete("search"); + params.delete("ranges[]"); + params.delete("tags[]"); + params.delete("brands[]"); + params.delete("isDiscounted"); + + if (this.store.currentSearchValue) { + params.set("search", this.store.currentSearchValue); + } + this.store.activeRanges.forEach(id => params.append("ranges[]", String(id))); + this.store.activeTags.forEach(id => params.append("tags[]", String(id))); + this.store.activeBrands.forEach(v => params.append("brands[]", v)); + if (this.store.isDiscounted) { + params.set("isDiscounted", "1"); + } + + history.replaceState(null, "", url.toString()); + } + + private readonly debouncedStoreSearch = defineDebounce((text: string) => { + this.store.setSearchValue(text); + this.syncUrl(); + this.refreshList(); + }); + + private readonly debouncedRefreshList = defineDebounce(() => { + this.currentPage.value = 1; + this.hasMorePages.value = true; + this.errorOccured.value = false; + this.store.setLoading(true); + + this.filterProductService.fetchFilteredProducts( + paginateWith( + this.currentPage.value, + this.perPage.value, + ), + { + searchFor: this.searchValue.value, + brandValues: this.store.activeBrands, + rangesIds: this.store.activeRanges, + tagIds: this.store.activeTags, + discounted: this.filterIsDiscounted.value, + } + ) + .then(products => { + this.store.setFilteredProduct(products); + + if (products.length < this.perPage.value) { + this.hasMorePages.value = false; + } + }) + .catch(() => this.errorOccured.value = true) + .finally(() => this.store.setLoading(false)); + }); + + constructor( + private readonly filterProductService: FilterProductService, + private readonly store: ProductViewerStore + ) { + const urlParams = new URL(document.location.href).searchParams; + + const urlSearch = urlParams.get("search")?.trim() ?? ""; + const urlRanges = urlParams + .getAll("ranges[]") + .map(v => Number.parseInt(v.trim(), 10)) + .filter(v => !Number.isNaN(v)) as RangeId[]; + const urlTags = urlParams + .getAll("tags[]") + .map(v => Number.parseInt(v.trim(), 10)) + .filter(v => !Number.isNaN(v)) as TagId[]; + const urlBrands = urlParams + .getAll("brands[]") + .map(v => v.trim()) + .filter(v => v.length) as BrandValue[]; + + if (urlSearch.length) { + this.store.setSearchValue(urlSearch); + } + this.store.setActiveRanges(urlRanges); + this.store.setActiveTags(urlTags); + this.store.setActiveBrands(urlBrands); + this.searchValue.value = this.store.currentSearchValue; + + if (urlSearch.length || urlRanges.length || urlTags.length || urlBrands.length) { + this.store.setLoading(true); + this.refreshList(); + } + + + watch(this.searchValue, (newValue) => { + const cleanText = String(newValue || ""); + this.debouncedStoreSearch(cleanText); + }); + + watch(() => this.store.currentSearchValue, (newValue) => { + if (this.searchValue.value !== newValue) { + this.searchValue.value = newValue; + } + }); + + watch(() => this.store.loadMoreTrigger, (newValue) => { + if (newValue > 0) { + this.loadNextPage(); + } + }); + + watch(this.perPage, (newPerPage) => { + if (this.currentPage.value === 1) { + this.hasMorePages.value = this.store.filteredProductList.length >= newPerPage; + } + }); + } + + public refreshList(): void { + this.debouncedRefreshList(); + } + + public async loadNextPage(): Promise<void> { + if (this.isNextPageLoading.value || !this.hasMorePages.value || this.store.loading) { + return; + } + + this.isNextPageLoading.value = true; + this.currentPage.value += 1; + + try { + const nextProducts = await this.filterProductService.fetchFilteredProducts( + paginateWith(this.currentPage.value, this.perPage.value), + this.getCleanFilters() + ); + + if (nextProducts.length < this.perPage.value) { + this.hasMorePages.value = false; + } + + this.store.appendFilteredProducts(nextProducts); + } catch { + this.errorOccured.value = true; + } finally { + this.isNextPageLoading.value = false; + } + } + + private getCleanFilters() { + return { + searchFor: this.searchValue.value, + brandValues: this.store.activeBrands, + rangesIds: this.store.activeRanges, + tagIds: this.store.activeTags, + discounted: this.store.isDiscounted, + }; + } +} + +let vm: ProductFilterViewModel | null = null; + +export function useProductFilterViewModel(): ProductFilterViewModel { + vm = vm ??= new ProductFilterViewModel( + useFilterProductService(), + useProductViewerStore() + ); + + return vm; +} diff --git a/resources/ts/fo/components/ProductsViewer/ProductsViewer.vue b/resources/ts/fo/components/ProductsViewer/ProductsViewer.vue new file mode 100644 index 00000000..014f2b62 --- /dev/null +++ b/resources/ts/fo/components/ProductsViewer/ProductsViewer.vue @@ -0,0 +1,47 @@ +<template> + <div class="container-fluid"> + <div class="row g-4"> + <div class="col-12 col-lg-3"> + <ProductFilter :per-page="perPage" /> + </div> + + <div class="col-12 col-lg-9"> + <AisleViewer /> + </div> + </div> + </div> +</template> + +<script lang="ts" setup> +import { ref, useAttrs } from "vue"; + +import { tagModelSchema } from "@fo/schemas/index.ts"; +import { brandModelSchema } from "@fo/schemas/models/brand-model.zod.ts"; +import { productModelSchema } from "@fo/schemas/models/product-model.zod.ts"; +import { rangeModelSchema } from "@fo/schemas/models/range-model.zod.ts"; +import { useProductViewerStore } from "@fo/stores"; +import z from "@modules/zod"; + +import AisleViewer from "./AisleViewer.vue"; +import ProductFilter from "./ProductFilter.vue"; + +defineOptions({ name: "ProductsViewer" }); + +const store = useProductViewerStore(); +const attrs = useAttrs(); + + +const perPage = ref<number>(6); + +const json = String(attrs.json ?? "{}"); +const data = JSON.parse(json); + + +perPage.value = Number(data.perPage); + +store.setBrands(z.array(brandModelSchema).parse(data.brandList ?? [])); +const products = z.array(productModelSchema).parse(data.productList ?? []); +store.setProducts(products); +store.setRanges(z.array(rangeModelSchema).parse(data.rangeList ?? [])); +store.setTags(z.array(tagModelSchema).parse(data.tagList ?? [])); +</script> diff --git a/resources/ts/fo/components/WordCounterComponent.vue b/resources/ts/fo/components/WordCounterComponent.vue new file mode 100644 index 00000000..bdf87c31 --- /dev/null +++ b/resources/ts/fo/components/WordCounterComponent.vue @@ -0,0 +1,140 @@ +<template> + <div class="word-counter-varchar d-flex flex-row justify-content-around align-items-center w-100"> + <span> + {{ __("vue.WordCounterComponent.words") }} : <b>{{ inTwords }}</b> + </span> + <span> + {{ __("vue.WordCounterComponent.characters") }} : <b>{{ inTchars }}</b> + </span> + </div> +</template> + +<script setup lang="ts"> +import { + nextTick, + onBeforeUnmount, + onMounted, + ref, + useAttrs, + watch +} from "vue"; + +import { __ } from "@modules/trans"; +import z from "@modules/zod"; + +defineOptions({ name: "WordCounterComponent" }); + +const props = defineProps({ + for: { + type: String, + default: null, + }, +}); + +const attrs = useAttrs(); + +const inTid = ref<string>(""); +const inTwords = ref<number>(0); +const inTchars = ref<number>(0); +const inTinput = ref<HTMLInputElement | HTMLTextAreaElement | null>(null); + +const calculateValues = (string: string): [number, number] => { + const arr = string.split(" "); + return [arr.filter((word) => word !== "").length, string.length]; +}; + +const updateValues = (string: string) => { + const [words, chars] = calculateValues(string); + inTwords.value = words; + inTchars.value = chars; +}; + +const handleInput = (e: Event) => { + const el = e.target as HTMLInputElement | HTMLTextAreaElement | null; + if (!el) { + throw new Error(`${inTid.value} is not an input or textarea`); + } + updateValues(el.value); +}; + +onMounted(() => { + const json = String(attrs.json ?? "{}"); + let data; + try { + data = z.object({ + for: z.string() + .nonempty() + .refine((val) => globalThis.document + .getElementById(val), {message: "The 'for' field must not be empty and exist in the DOM" }) + }).parse(JSON.parse(json)); + } catch (e) { + console.error(`Invalid JSON data for WordCounterComponent: ${e}`); + data = {}; + } + + inTid.value = String(props.for ?? ""); + if (data.for) { + inTid.value = data.for; + } +}); + +watch( + () => props.for, + (newVal) => { + if (newVal) { + inTid.value = newVal; + } + } +); + +watch(inTid, async (newVal) => { + if (!newVal) return; + + await nextTick(); + const input = document.getElementById(newVal); + + if (!input || !(input instanceof HTMLInputElement || input instanceof HTMLTextAreaElement)) { + throw new Error(`${newVal} is not an input or textarea`); + } + + inTinput.value = input; +}); + +watch(inTinput, (newInput, oldInput) => { + if (oldInput) { + oldInput.removeEventListener("input", handleInput); + } + + if (!newInput) return; + + newInput.addEventListener("input", handleInput); + updateValues(newInput.value); +}); + +// Éviter les fuites de mémoire lors de la destruction du composant +onBeforeUnmount(() => { + if (inTinput.value) { + inTinput.value.removeEventListener("input", handleInput); + } +}); +</script> + +<style lang="scss"> +#word-counter+input[type="text"], +.word-counter+input[type="text"], +#word-counter+textarea, +.word-counter+textarea, +#word-counter-varchar+textarea, +.word-counter-varchar+textarea { + border-radius: 0 0 var(--bs-border-radius-xl) var(--bs-border-radius-xl); +} + +.word-counter-varchar { + color: var(--bs-body-color); + border: var(--bs-border-width) solid var(--bs-border-color); + border-bottom: 0; + background-color: rgb(var(--bs-secondary-bg-rgb)); + border-top-left-radius: var(--bs-border-radius-xl); + border-top-right-radius: var(--bs-border-radius-xl); +} +</style> diff --git a/resources/ts/fo/fo.ts b/resources/ts/fo/fo.ts new file mode 100644 index 00000000..262b9b90 --- /dev/null +++ b/resources/ts/fo/fo.ts @@ -0,0 +1,26 @@ +// ASSETS +import.meta.glob("../../assets/images/**/*", { eager: true }); +import CookieNotice from "@ldc-web/cookie-notice"; + +// COOKIES +globalThis.CookieNotice = CookieNotice; + +// UTILITIES +import "@fo/utilities/bootstrap"; +import "@fo/utilities/fontawesome"; +import "@fo/utilities/sliders"; +import { foVueModules } from "./utilities/fo-vue-modules"; +import { registerFoVueApps } from "./utilities/vue-fo"; + +// Local +import "@fo/base/flashToasts"; + +if (typeof document !== "undefined") { + if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", () => { + registerFoVueApps(foVueModules, document); + }, { once: true, }); + } else { + registerFoVueApps(foVueModules, document); + } +} diff --git a/resources/ts/fo/repositories/basket.repository.ts b/resources/ts/fo/repositories/basket.repository.ts new file mode 100644 index 00000000..e92e925b --- /dev/null +++ b/resources/ts/fo/repositories/basket.repository.ts @@ -0,0 +1,88 @@ +import type { AxiosStatic } from "axios"; +import axios from "axios"; + +import { basketApiResponseSchema, type BasketApiResponse } from "@fo/schemas/requests/basket-api-response.zod"; +import type { Basket, ProductId } from "@fo/types"; +import route from "@modules/route"; + +// Ton interface mise à jour + + +export interface BasketRepository { + fetchBasket(): Promise<Basket>; + add(product: ProductId, qty: number): Promise<void>; + remove(product: ProductId, qty: number): Promise<void>; + removeLine(product: ProductId): Promise<void>; + emptyBasket(): Promise<void>; +} + +export class BasketRepositoryImpl implements BasketRepository { + private readonly getBasketUrlPath = route("BASKET_GET"); + private readonly addToBasketUrlPath = route("BASKET_ADD_TO"); + private readonly removeFromBasketUrlPath = route("BASKET_REMOVE_FROM"); + private readonly emptyBasketUrlPath = route("BASKET_EMPTY"); + + constructor(private readonly axiosInstance: AxiosStatic) {} + + public async fetchBasket(): Promise<Basket> { + try { + const response = await this.axiosInstance.get(this.getBasketUrlPath); + const parsedData = basketApiResponseSchema.parse(response.data.data); + + return this.mapToCartItems(parsedData); + } catch (err) { + console.error(err); + throw new Error("Failed to fetch basket"); + } + } + + public async add(product: ProductId, qty: number): Promise<void> { + try { + await this.axiosInstance.post(this.addToBasketUrlPath, {rowId: product,qty}); + + } catch (err) { + console.error(err); + throw new Error("Failed to add to basket"); + } + } + + public async remove(product: ProductId, qty: number): Promise<void> { + try { + await this.axiosInstance.post(this.removeFromBasketUrlPath, {rowId: product, qty}); + } catch (err) { + console.error(err); + throw new Error("Failed to remove from basket"); + } + } + + public async removeLine(product: ProductId): Promise<void> { + try { + await this.axiosInstance.post(this.removeFromBasketUrlPath, {rowId: product}); + } catch (err) { + console.error(err); + throw new Error("Failed to remove from basket"); + } + } + + public async emptyBasket(): Promise<void> { + try { + await this.axiosInstance.post(this.emptyBasketUrlPath); + } catch (err) { + console.error(err); + throw new Error("Failed to empty basket"); + } + } + + private mapToCartItems(response: BasketApiResponse): Basket { + return { + taxIncluded: response.totalTTC, + items: response.items as unknown as Basket["items"], + }; + } +} + +const basketRepository = new BasketRepositoryImpl(axios); + +export function useBasketRepository(): BasketRepository { + return basketRepository; +} diff --git a/resources/ts/fo/repositories/index.ts b/resources/ts/fo/repositories/index.ts new file mode 100644 index 00000000..ff312c86 --- /dev/null +++ b/resources/ts/fo/repositories/index.ts @@ -0,0 +1,3 @@ +export * from "./basket.repository"; +export * from "./product.repository"; + diff --git a/resources/ts/fo/repositories/product.repository.ts b/resources/ts/fo/repositories/product.repository.ts new file mode 100644 index 00000000..591faadf --- /dev/null +++ b/resources/ts/fo/repositories/product.repository.ts @@ -0,0 +1,79 @@ +import type { AxiosStatic } from "axios"; +import axios from "axios"; + +import { productsFilterResponseSchema, type PageOf, type ProductFilterResponse } from "@fo/schemas"; +import type { Money, Nutriscore, Pagination, ProductId, ProductSlug } from "@fo/types"; +import route from "@modules/route"; + +interface PaginatedProduct { + id: ProductId; + name: string; + slug: ProductSlug; + shortDescription: string | null; + picture: URL | null; + picture_title: string; + picture_alt: string; + weight_variable: boolean; + priceTtc: Money | null; + priceKgTtc: Money | null; + discountedPriceTtc: Money | null; + showStrippedPrice: boolean; + nutriscore: Nutriscore | null; + is_available: boolean; + can_add_to_basket: boolean; + sell_unit: string + sell_unit_label: string; +} + +export interface ProductFilters { + search: string; + ranges: number[]; + brands: string[]; + tags: number[]; + isDiscounted: boolean; +} + +export interface ProductRepository { + getAll( + pagination: Pagination, + filters: ProductFilters + ): Promise<PageOf<PaginatedProduct>>; +} + +export class ProductRepositoryImpl implements ProductRepository { + private readonly productFilterUrl = route("PRODUCTS_FILTER"); + + constructor(private readonly axiosInstance: AxiosStatic) {} + + public async getAll(pagination: Pagination, filters: ProductFilters): Promise<PageOf<PaginatedProduct>> { + try { + const response = await this.axiosInstance.get(this.productFilterUrl, { + params: { + ...filters, + perPage: pagination.perPage, + page: pagination.page + } + }); + + const parsedData = productsFilterResponseSchema.parse(response.data); + + return { + ...parsedData, + data: this.mapToPaginatedProducts(parsedData.data) + }; + } catch (err) { + console.error(err); + throw new Error("Failed to fetch filtered products"); + } + } + + private mapToPaginatedProducts(data: ProductFilterResponse["data"][0][]): PaginatedProduct[] { + return data.map(v => ({...v,})); + } +} + +export const productRepository = new ProductRepositoryImpl(axios); + +export function useProductRepository(): ProductRepository { + return productRepository; +} diff --git a/resources/ts/fo/schemas/index.ts b/resources/ts/fo/schemas/index.ts new file mode 100644 index 00000000..522b1336 --- /dev/null +++ b/resources/ts/fo/schemas/index.ts @@ -0,0 +1,9 @@ +export * from "./models/brand-model.zod"; +export * from "./models/product-model.zod"; +export * from "./models/range-model.zod"; +export * from "./models/tag-model.schema"; +export * from "./money.zod"; +export * from "./paginated-resource.schema"; +export * from "./requests/basket-api-response.zod"; +export * from "./requests/product-filter.zod"; + diff --git a/resources/ts/fo/schemas/models/brand-model.zod.ts b/resources/ts/fo/schemas/models/brand-model.zod.ts new file mode 100644 index 00000000..19803bfd --- /dev/null +++ b/resources/ts/fo/schemas/models/brand-model.zod.ts @@ -0,0 +1,16 @@ +import z from "@modules/zod"; + +export type BrandModeValue = string & { + type: "BrandModelValue", + __Symbol: symbol +} + +export interface BrandModel { + value: BrandModeValue, + label: string +} + +export const brandModelSchema = z.object({ + value: z.string().nonempty().transform(v => v as BrandModeValue), + label: z.string().nonempty(), +}).transform(v => v as BrandModel); diff --git a/resources/ts/fo/schemas/models/product-model.zod.test.ts b/resources/ts/fo/schemas/models/product-model.zod.test.ts new file mode 100644 index 00000000..34a49ee9 --- /dev/null +++ b/resources/ts/fo/schemas/models/product-model.zod.test.ts @@ -0,0 +1,62 @@ +import { describe, expect, it } from "vitest"; + +import { productModelSchema } from "./product-model.zod"; + +describe("productModelSchema", () => { + const baseProductData = { + id: "a0000000-0000-4000-8000-000000000001", + name: "Terrine de Foie Gras", + slug: "terrine-de-foie-gras", + shortDescription: "Domaine de Lanvaux", + picture: "https://example.com/picture.jpg", + picture_title: "Terrine", + picture_alt: "Terrine", + weight_variable: false, + priceTtc: { amount: "1093", currency: "EUR", formatted: "€ 10.93" }, + priceKgTtc: { amount: "4372", currency: "EUR", formatted: "€ 43.72" }, + discountedPriceTtc: { amount: "993", currency: "EUR", formatted: "€ 9.93" }, + sell_unit_label: "pièce", + is_available: true, + can_add_to_basket: true, + nutriscore: null, + }; + + it("parses product with showStrippedPrice true", () => { + // GIVEN + const data = { + ...baseProductData, + showStrippedPrice: true, + }; + + // WHEN + const parsed = productModelSchema.parse(data); + + // THEN + expect(parsed.showStrippedPrice).toBe(true); + }); + + it("parses product with showStrippedPrice false", () => { + // GIVEN + const data = { + ...baseProductData, + showStrippedPrice: false, + }; + + // WHEN + const parsed = productModelSchema.parse(data); + + // THEN + expect(parsed.showStrippedPrice).toBe(false); + }); + + it("defaults showStrippedPrice to false when omitted", () => { + // GIVEN + const data = {...baseProductData,}; + + // WHEN + const parsed = productModelSchema.parse(data); + + // THEN + expect(parsed.showStrippedPrice).toBe(false); + }); +}); diff --git a/resources/ts/fo/schemas/models/product-model.zod.ts b/resources/ts/fo/schemas/models/product-model.zod.ts new file mode 100644 index 00000000..d7d4cc84 --- /dev/null +++ b/resources/ts/fo/schemas/models/product-model.zod.ts @@ -0,0 +1,26 @@ +import type { ProductId, ProductSlug } from "@fo/types"; +import { Nutriscore } from "@fo/types/nutriscore.type"; +import z from "@modules/zod"; + +import { moneySchema } from "../money.zod"; + +export const productModelSchema = z.object({ + id: z.uuid().transform(val => val as unknown as ProductId), + name: z.string().nonempty(), + slug: z.string().nonempty().transform(val => val as unknown as ProductSlug), + shortDescription: z.string().nullable(), + picture: z.string().nonempty().transform(v => new URL(v)), + picture_title: z.string().nullable().optional().transform(v => v ?? ""), + picture_alt: z.string().nullable().optional().transform(v => v ?? ""), + weight_variable: z.boolean(), + priceTtc: moneySchema.nullable(), + priceKgTtc: moneySchema.nullable(), + discountedPriceTtc: moneySchema.nullable(), + showStrippedPrice: z.boolean().default(false), + sell_unit_label: z.string().nullable().optional(), + is_available: z.boolean(), + can_add_to_basket: z.boolean(), + nutriscore: z.enum(Nutriscore).nullable(), +}); + +export type ProductModel = z.infer<typeof productModelSchema> diff --git a/resources/ts/fo/schemas/models/range-model.zod.ts b/resources/ts/fo/schemas/models/range-model.zod.ts new file mode 100644 index 00000000..74008106 --- /dev/null +++ b/resources/ts/fo/schemas/models/range-model.zod.ts @@ -0,0 +1,9 @@ +import z from "@modules/zod"; + +export const rangeModelSchema = z.object({ + id: z.int().positive(), + name: z.string().nonempty(), + slug: z.string().nonempty() +}); + +export type RangeModel = z.infer<typeof rangeModelSchema> diff --git a/resources/ts/fo/schemas/models/tag-model.schema.ts b/resources/ts/fo/schemas/models/tag-model.schema.ts new file mode 100644 index 00000000..2f1a78fd --- /dev/null +++ b/resources/ts/fo/schemas/models/tag-model.schema.ts @@ -0,0 +1,9 @@ +import z from "@modules/zod"; + +export const tagModelSchema = z.object({ + id: z.int().positive(), + label: z.string().nonempty(), + slug: z.string().nonempty() +}); + +export type TagModel = z.infer<typeof tagModelSchema> diff --git a/resources/ts/fo/schemas/money.zod.ts b/resources/ts/fo/schemas/money.zod.ts new file mode 100644 index 00000000..ad244068 --- /dev/null +++ b/resources/ts/fo/schemas/money.zod.ts @@ -0,0 +1,8 @@ +import type { Currency, Money } from "@fo/types"; +import z from "@modules/zod"; + +export const moneySchema = z.object({ + amount: z.coerce.number(), + currency: z.string().nonempty().transform(v => v as Currency), + formatted: z.string().nonempty() +}).transform(v => v as Money); diff --git a/resources/ts/fo/schemas/paginated-resource.schema.ts b/resources/ts/fo/schemas/paginated-resource.schema.ts new file mode 100644 index 00000000..90d8e65c --- /dev/null +++ b/resources/ts/fo/schemas/paginated-resource.schema.ts @@ -0,0 +1,39 @@ +import z from "@modules/zod"; + +interface PageOfInterface<T> { + perPage: number + page: number + first: number + last: number + data: T[] +} + +export const makePaginatedResourceSchema = <T extends z.ZodTypeAny>(dataSchema: T) => + z.object({ + data: z.array(dataSchema), + links: z.object({ + first: z.string(), + last: z.string(), + prev: z.string().nullable(), + next: z.string().nullable(), + }), + meta: z.object({ + current_page: z.coerce.number().int().positive(), + from: z.coerce.number().int().positive().nullable(), + last_page: z.coerce.number().int().positive(), + path: z.string(), + per_page: z.coerce.number().int().positive(), + to: z.coerce.number().int().positive().nullable(), + total: z.coerce.number().int().nonnegative(), + }), + }).transform((laravelObj): PageOfInterface<z.output<T>> => { + return { + perPage: laravelObj.meta.per_page, + page: laravelObj.meta.current_page, + first: laravelObj.meta.from ?? 0, + last: laravelObj.meta.to ?? 0, + data: laravelObj.data, + }; + }); + +export type PageOf<T> = z.infer<ReturnType<typeof makePaginatedResourceSchema<z.ZodType<T>>>>; diff --git a/resources/ts/fo/schemas/requests/basket-api-response.zod.ts b/resources/ts/fo/schemas/requests/basket-api-response.zod.ts new file mode 100644 index 00000000..1a7eb42c --- /dev/null +++ b/resources/ts/fo/schemas/requests/basket-api-response.zod.ts @@ -0,0 +1,29 @@ +import type { ProductId, ProductSlug } from "@fo/types"; +import z from "@modules/zod"; + +import { moneySchema } from "../money.zod"; + +export const basketProductSchema = z.object({ + id: z.uuid().transform(v => v as ProductId), + slug: z.string().transform(v => v as ProductSlug), + name: z.string().nonempty(), + description: z.string().nullable(), + qty: z.coerce.number().int().nonnegative(), + picture: z.string().nullable(), + + unitPriceHt: moneySchema.nullable(), + weight_variable: z.boolean(), + + subtotalHt: moneySchema.nullable(), + totalTtc: moneySchema.nullable(), + + discountedPriceTtc: moneySchema.nullable(), +}); + +export const basketApiResponseSchema = z.object({ + items: z.array(basketProductSchema), + totalTTC: moneySchema.nullable(), +}); + + +export type BasketApiResponse = z.infer<typeof basketApiResponseSchema>; diff --git a/resources/ts/fo/schemas/requests/product-filter.zod.ts b/resources/ts/fo/schemas/requests/product-filter.zod.ts new file mode 100644 index 00000000..ba7955b7 --- /dev/null +++ b/resources/ts/fo/schemas/requests/product-filter.zod.ts @@ -0,0 +1,29 @@ +import { Nutriscore, type ProductId, type ProductSlug } from "@fo/types"; +import z from "@modules/zod"; + +import { moneySchema } from "../money.zod"; +import { makePaginatedResourceSchema } from "../paginated-resource.schema"; + +export const productsFilterResponseSchema = makePaginatedResourceSchema( + z.object({ + id: z.uuid().transform(v => v as ProductId), + name: z.string().nonempty(), + slug: z.string().nonempty().transform(v => v as ProductSlug), + shortDescription: z.string().nullable(), + picture: z.string().nonempty().transform(v => new URL(v)).nullable(), + picture_title: z.string(), + picture_alt: z.string(), + weight_variable: z.boolean(), + is_available: z.boolean(), + can_add_to_basket: z.boolean(), + sell_unit: z.string(), + sell_unit_label: z.string(), + priceTtc: moneySchema.nullable(), + priceKgTtc: moneySchema.nullable(), + discountedPriceTtc: moneySchema.nullable(), + showStrippedPrice: z.boolean().default(false), + nutriscore: z.enum(Nutriscore).nullable() + }) +); + +export type ProductFilterResponse = z.infer<typeof productsFilterResponseSchema> diff --git a/resources/ts/fo/services/basket.service.test.ts b/resources/ts/fo/services/basket.service.test.ts new file mode 100644 index 00000000..6ebdd13d --- /dev/null +++ b/resources/ts/fo/services/basket.service.test.ts @@ -0,0 +1,107 @@ +// @vitest-environment jsdom +import { + beforeEach, describe, expect, it, vi, type Mocked +} from "vitest"; + +import type { BasketRepository } from "@fo/repositories"; +import type { BasketStore } from "@fo/stores"; +import type { Basket, ProductId } from "@fo/types"; + +import { BasketService } from "./basket.service"; +import type { ToastService } from "./toast.service"; + +// Mock route helper +vi.mock("@modules/route", () => ({ default: vi.fn(() => "/mock-route") })); +// Mock trans helper +vi.mock("@modules/trans", () => ({ + __: vi.fn((v) => v), + trans: vi.fn((v) => v), + trans_choice: vi.fn((v) => v) +})); + +describe("BasketService", () => { + let basketService: BasketService; + let toastServiceMock: Mocked<ToastService>; + let basketRepositoryMock: Mocked<BasketRepository>; + let basketStoreMock: Mocked<BasketStore>; + + beforeEach(() => { + toastServiceMock = { + notifyReplace: vi.fn(), + errorNotify: vi.fn(), + infoNotify: vi.fn(), + successNotify: vi.fn(), + } as unknown as Mocked<ToastService>; + + basketRepositoryMock = { + fetchBasket: vi.fn(), + add: vi.fn(), + remove: vi.fn(), + removeLine: vi.fn(), + emptyBasket: vi.fn(), + } as unknown as Mocked<BasketRepository>; + + basketStoreMock = {setBasket: vi.fn(),} as unknown as Mocked<BasketStore>; + + basketService = new BasketService( + toastServiceMock, + basketRepositoryMock, + basketStoreMock + ); + }); + + describe("addQty", () => { + it("throws an error if amount is less than 1", async () => { + // GIVEN + const productId = "prod_1" as ProductId; + + // WHEN & THEN + await expect(basketService.addQty(productId, 0)).rejects.toThrow(); + expect(basketRepositoryMock.add).not.toHaveBeenCalled(); + }); + + it("calls repository add and shows a success toast on success", async () => { + // GIVEN + const productId = "prod_1" as ProductId; + basketRepositoryMock.add.mockResolvedValue(); + + // WHEN + await basketService.addQty(productId, 2); + + // THEN + expect(basketRepositoryMock.add).toHaveBeenCalledWith(productId, 2); + expect(toastServiceMock.notifyReplace).toHaveBeenCalled(); + }); + + it("shows an error toast if repository fails", async () => { + // GIVEN + const productId = "prod_1" as ProductId; + basketRepositoryMock.add.mockRejectedValue(new Error("Network error")); + + // WHEN + await basketService.addQty(productId, 1); + + // THEN + expect(basketRepositoryMock.add).toHaveBeenCalledWith(productId, 1); + expect(toastServiceMock.errorNotify).toHaveBeenCalled(); + }); + }); + + describe("fetchBasket", () => { + it("fetches from repository and updates the store", async () => { + // GIVEN + const mockBasketData: Basket = { + taxIncluded: null, + items: [{ id: "prod_1" as ProductId, qty: 1 }] as Basket["items"] + }; + basketRepositoryMock.fetchBasket.mockResolvedValue(mockBasketData); + + // WHEN + await basketService.fetchBasket(); + + // THEN + expect(basketRepositoryMock.fetchBasket).toHaveBeenCalled(); + expect(basketStoreMock.setBasket).toHaveBeenCalledWith(mockBasketData.items, mockBasketData); + }); + }); +}); diff --git a/resources/ts/fo/services/basket.service.ts b/resources/ts/fo/services/basket.service.ts new file mode 100644 index 00000000..36893dde --- /dev/null +++ b/resources/ts/fo/services/basket.service.ts @@ -0,0 +1,81 @@ +import { useBasketRepository, type BasketRepository } from "@fo/repositories/basket.repository"; +import { useBasketStore, type BasketStore } from "@fo/stores"; +import type { ProductId } from "@fo/types"; +import { trans } from "@modules/trans"; + +import { useToastService, type ToastService } from "./toast.service"; + + +export class BasketService { + constructor( + private readonly toastService: ToastService, + private readonly basketRepository: BasketRepository, + private readonly basketStore: BasketStore, + ) { } + + public fetchBasket(): Promise<void> { + return this.basketRepository.fetchBasket() + .then(v => { + this.basketStore.setBasket(v.items, v); + }).catch(error => { + this.toastService.errorNotify(trans("Failed to fetch the basket")); + return error; + }); + } + + public async addQty(product: ProductId, amount: number = 1): Promise<void> { + if (amount < 1) { + throw new Error("Amount must be greater than or equal to 1"); + } + + return this.basketRepository.add(product, amount) + .then(() => this.toastService.notifyReplace(trans("Added :amount to basket", { amount }))) + .catch(error => { + this.toastService.errorNotify(trans("Failed to add item to basket")); + return error; + }); + } + + public async removeQty(product: ProductId, amount: number = 1): Promise<void> { + if (amount < 1) { + throw new Error("Amount must be greater than or equal to 1"); + } + + return this.basketRepository.remove(product, amount) + .then(() => this.toastService.notifyReplace(trans("Removed :amount from basket", { amount }))) + .catch(error => { + this.toastService.errorNotify(trans("Failed to add item to basket")); + return error; + }); + } + + public async remove(product: ProductId): Promise<void> { + return this.basketRepository.removeLine(product) + .then(() => this.toastService.notifyReplace(trans("Item removed from basket"))) + .catch(error => { + this.toastService.errorNotify(trans("Failed to remove item from basket")); + return error; + }); + } + + public async emptyBasket(): Promise<void> { + return this.basketRepository.emptyBasket() + .then(() => this.toastService.notifyReplace(trans("Basket has been cleared"))) + .catch(error => { + this.toastService.errorNotify(trans("Failed to clear the basket")); + return error; + }); + } +} + +let basketService: BasketService | null = null; + +export function useBasketService(): BasketService { + basketService = basketService ??= new BasketService( + useToastService(), + useBasketRepository(), + useBasketStore() + ); + + return basketService; +} diff --git a/resources/ts/fo/services/filter-product.service.test.ts b/resources/ts/fo/services/filter-product.service.test.ts new file mode 100644 index 00000000..38706753 --- /dev/null +++ b/resources/ts/fo/services/filter-product.service.test.ts @@ -0,0 +1,91 @@ +// @vitest-environment jsdom +import { + beforeEach, describe, expect, it, vi, type Mocked +} from "vitest"; + +import type { ProductRepository } from "@fo/repositories"; +import type { BrandValue, Pagination, RangeId, TagId } from "@fo/types"; + +import { FilterProductServiceImpl, type SearchFilters } from "./filter-product.service"; +import type { ToastService } from "./toast.service"; + +// Mock route helper +vi.mock("@modules/route", () => ({ default: vi.fn(() => "/mock-route") })); +// Mock trans helper +vi.mock("@modules/trans", () => ({ + __: vi.fn((v) => v), + trans: vi.fn((v) => v), + trans_choice: vi.fn((v) => v) +})); + +describe("FilterProductService", () => { + let service: FilterProductServiceImpl; + let toastMock: Mocked<ToastService>; + let repositoryMock: Mocked<ProductRepository>; + + beforeEach(() => { + toastMock = {errorNotify: vi.fn(),} as unknown as Mocked<ToastService>; + + repositoryMock = {getAll: vi.fn(),} as unknown as Mocked<ProductRepository>; + + service = new FilterProductServiceImpl(toastMock, repositoryMock); + }); + + it("fetches filtered products and returns mapped data", async () => { + // GIVEN + const pagination: Pagination = { page: 1, perPage: 10 }; + const filters: SearchFilters = { + searchFor: "test", + brandValues: ["b1" as BrandValue], + rangesIds: [1 as RangeId], + tagIds: [1 as TagId], + discounted: true + }; + + const apiResponse = { + data: [ + { id: "p1", slug: "product-1", name: "Product 1" } + ] + } as unknown as Awaited<ReturnType<ProductRepository["getAll"]>>; + + repositoryMock.getAll.mockResolvedValue(apiResponse); + + // WHEN + const result = await service.fetchFilteredProducts(pagination, filters); + + // THEN + expect(repositoryMock.getAll).toHaveBeenCalledWith(pagination, { + search: "test", + brands: ["b1" as BrandValue], + ranges: [1 as RangeId], + tags: [1 as TagId], + isDiscounted: true + }); + + expect(result).toHaveLength(1); + expect((result)[0].id).toBe("p1"); + expect(toastMock.errorNotify).not.toHaveBeenCalled(); + }); + + it("shows an error toast when fetch fails", async () => { + // GIVEN + const pagination: Pagination = { page: 1, perPage: 10 }; + const filters: SearchFilters = { + searchFor: "", + brandValues: [], + rangesIds: [], + tagIds: [], + discounted: false + }; + + repositoryMock.getAll.mockRejectedValue(new Error("Network Error")); + + // WHEN + const result = await service.fetchFilteredProducts(pagination, filters); + + // THEN + expect(repositoryMock.getAll).toHaveBeenCalled(); + expect(toastMock.errorNotify).toHaveBeenCalledWith("Failed to fetch products"); + expect(result).toBeInstanceOf(Error); + }); +}); diff --git a/resources/ts/fo/services/filter-product.service.ts b/resources/ts/fo/services/filter-product.service.ts new file mode 100644 index 00000000..8bdea0f4 --- /dev/null +++ b/resources/ts/fo/services/filter-product.service.ts @@ -0,0 +1,81 @@ +import { useProductRepository, type ProductRepository } from "@fo/repositories"; +import type { + BrandValue, Money, Nutriscore, ProductId, ProductSlug, RangeId, TagId +} from "@fo/types"; +import type { Pagination } from "@fo/types/pagination.type"; +import { trans } from "@modules/trans"; + +import { useToastService, type ToastService } from "./toast.service"; + +export interface ProductFiltered { + id: ProductId; + name: string; + slug: ProductSlug; + shortDescription: string | null; + picture: URL | null; + picture_title: string; + picture_alt: string; + weight_variable: boolean; + priceTtc: Money | null; + priceKgTtc: Money | null; + discountedPriceTtc: Money | null; + showStrippedPrice: boolean; + sell_unit_label?: string | null; + nutriscore: Nutriscore | null; + is_available: boolean; + can_add_to_basket: boolean; +} + +export interface SearchFilters { + searchFor: string, + brandValues: BrandValue[], + rangesIds: RangeId[], + tagIds: TagId[], + discounted: boolean +} + +export interface FilterProductService { + fetchFilteredProducts( + pagination: Pagination, + filters: SearchFilters + ): Promise<ProductFiltered[]>; +} + +export class FilterProductServiceImpl implements FilterProductService { + constructor( + private readonly toast: ToastService, + private readonly repository: ProductRepository + ) { } + + public async fetchFilteredProducts( + pagination: Pagination, + filters: SearchFilters + ): Promise<ProductFiltered[]> { + return this.repository.getAll( + pagination, { + search: filters.searchFor, + brands: filters.brandValues, + ranges: filters.rangesIds, + tags: filters.tagIds, + isDiscounted: filters.discounted, + }) + .then(v => v.data) + .catch(error => { + this.toast.errorNotify(trans("Failed to fetch products")); + + return error; + }); + } +} + +let filterProductService : FilterProductService | null = null; + +export function useFilterProductService(): FilterProductService { + + filterProductService = filterProductService ??= new FilterProductServiceImpl( + useToastService(), + useProductRepository(), + ); + + return filterProductService; +} diff --git a/resources/ts/fo/services/index.ts b/resources/ts/fo/services/index.ts new file mode 100644 index 00000000..d26c6057 --- /dev/null +++ b/resources/ts/fo/services/index.ts @@ -0,0 +1,4 @@ +export * from "./basket.service"; +export * from "./filter-product.service"; +export * from "./toast.service"; + diff --git a/resources/ts/fo/services/toast.service.ts b/resources/ts/fo/services/toast.service.ts new file mode 100644 index 00000000..0632a1bb --- /dev/null +++ b/resources/ts/fo/services/toast.service.ts @@ -0,0 +1,166 @@ +import { Toast } from "bootstrap"; + +export type ToastVariant = "success" | "danger" | "warning" | "info"; + +export interface ToastOptions { + autohide?: boolean; + /** Delay in ms. */ + delay?: number; + replace?: boolean; +} + +interface VariantConfig { + /** FontAwesome icon class */ + icon: string; + /** ARIA live urgency */ + live: "assertive" | "polite"; +} + +const CONTAINER_ID = "fo-toast-container"; + +const VARIANTS: Record<ToastVariant, VariantConfig> = { + success: { icon: "fa-solid fa-circle-check", live: "polite" }, + danger: { icon: "fa-solid fa-circle-xmark", live: "assertive" }, + warning: { icon: "fa-solid fa-circle-exclamation", live: "assertive" }, + info: { icon: "fa-solid fa-circle-info", live: "polite" }, +}; + +export class ToastService { + private singleton: { el: HTMLElement; bs: Toast } | null = null; + + private dismissSingleton(): void { + if (!this.singleton) { + return; + } + try { + this.singleton.bs.hide(); + } catch { + // already disposed + } + this.singleton.el.remove(); + this.singleton = null; + } + + private getContainer(): HTMLElement { + const existing = document.getElementById(CONTAINER_ID); + if (existing) { + return existing; + } + + const container = document.createElement("div"); + container.id = CONTAINER_ID; + container.className = "toast-container position-fixed bottom-0 end-0 p-3"; + document.body.appendChild(container); + + return container; + } + + private buildToastEl(message: string, variant: ToastVariant, opts: ToastOptions): HTMLElement { + const config = VARIANTS[variant]; + const el = document.createElement("div"); + + el.className = `toast fo-toast fo-toast--${variant} align-items-center`; + el.setAttribute("aria-atomic", "true"); + + if (config.live === "assertive") { + el.setAttribute("role", "alert"); + el.setAttribute("aria-live", "assertive"); + } else { + el.setAttribute("aria-live", "polite"); + } + + if (opts.autohide === false) { + el.dataset["bsAutohide"] = "false"; + } else { + el.dataset["bsAutohide"] = "true"; + el.dataset["bsDelay"] = String(opts.delay ?? 4000); + } + + el.innerHTML = `<div class="d-flex"><div class="toast-body"><i class="${config.icon} fo-toast-icon me-2" aria-hidden="true"></i>${message}</div><button type="button" class="btn-close me-2 m-auto flex-shrink-0" data-bs-dismiss="toast" aria-label="Fermer"></button></div>`; + + return el; + } + + /** + * Show a dynamic toast programmatically. + * + * @param replace - When true, the previous singleton toast is dismissed first. + * Defaults to false (toasts stack). + */ + public show(message: string, variant: ToastVariant = "success", opts: ToastOptions = {}): void { + if (opts.replace) { + this.dismissSingleton(); + } + + const container = this.getContainer(); + const el = this.buildToastEl(message, variant, opts); + container.appendChild(el); + + const bsToast = new Toast(el, { + autohide: opts.autohide !== false, + delay: opts.delay ?? 4000, + }); + + el.addEventListener("hidden.bs.toast", () => { + el.remove(); + if (this.singleton?.el === el) { + this.singleton = null; + } + }); + + if (opts.replace) { + this.singleton = { el, bs: bsToast }; + } + + bsToast.show(); + } + + public notify(message: string, delay = 4000): void { + this.show(message, "success", { autohide: true, delay }); + } + + public errorNotify(message: string, delay = 5000): void { + this.show(message, "danger", { autohide: true, delay }); + } + + public warnNotify(message: string, delay = 6000): void { + this.show(message, "warning", { autohide: true, delay }); + } + + public infoNotify(message: string, delay = 4000): void { + this.show(message, "info", { autohide: true, delay }); + } + + public toast(message: string, duration = 3000, variant: ToastVariant = "success"): void { + this.show(message, variant, { autohide: true, delay: duration, replace: true }); + } + + public notifyReplace(message: string, duration = 4000): void { + this.show(message, "success", { autohide: true, delay: duration, replace: true }); + } + + public errorNotifyReplace(message: string, duration = 5000): void { + this.show(message, "danger", { autohide: true, delay: duration, replace: true }); + } +} + +let toastService : ToastService | null = null; + +export function useToastService(): ToastService { + + toastService = toastService ??= new ToastService(); + + return toastService; +} + +export function initFlashToasts(containerId = CONTAINER_ID): void { + const container = document.getElementById(containerId); + if (!container) { + return; + } + container.querySelectorAll<HTMLElement>(".toast").forEach((el) => { + const bsToast = new Toast(el); + el.addEventListener("hidden.bs.toast", () => el.remove()); + bsToast.show(); + }); +} diff --git a/resources/ts/fo/stores/basket.store.test.ts b/resources/ts/fo/stores/basket.store.test.ts new file mode 100644 index 00000000..61b04b99 --- /dev/null +++ b/resources/ts/fo/stores/basket.store.test.ts @@ -0,0 +1,79 @@ +import { createPinia, setActivePinia } from "pinia"; +import { beforeEach, describe, expect, it } from "vitest"; + +import { EuroCurrency, type BasketItem } from "@fo/types"; + +import { useBasketStore, type BasketTotal } from "./basket.store"; + +describe("BasketStore", () => { + beforeEach(() => { + setActivePinia(createPinia()); + }); + + it("initializes with default values", () => { + // GIVEN + const store = useBasketStore(); + + // THEN + expect(store.baketPanelVisible).toBe(false); + expect(store.hasToReload).toBe(false); + expect(store.basket.items).toEqual([]); + expect(store.basket.total.taxIncluded).toBeNull(); + }); + + it("can set reload state", () => { + // GIVEN + const store = useBasketStore(); + + // WHEN + store.setReload(true); + + // THEN + expect(store.hasToReload).toBe(true); + }); + + it("can set the basket", () => { + // GIVEN + const store = useBasketStore(); + const mockItems = [{ id: "prod_1", qty: 2 }] as unknown as BasketItem[]; + const mockTotal: BasketTotal = { + taxIncluded: { + amount: 100, + currency: EuroCurrency(), + formatted: "100 €", + }, + }; + + // WHEN + store.setBasket(mockItems, mockTotal); + + // THEN + expect(store.basket.items).toEqual(mockItems); + expect(store.basket.total).toEqual(mockTotal); + }); + + it("can toggle and manage basket panel visibility", () => { + // GIVEN + const store = useBasketStore(); + + // WHEN + store.openBasketPanel(true); + // THEN + expect(store.baketPanelVisible).toBe(true); + + // WHEN + store.closeBasketPanel(); + // THEN + expect(store.baketPanelVisible).toBe(false); + + // WHEN + store.toggleBaketPanel(); + // THEN + expect(store.baketPanelVisible).toBe(true); + + // WHEN + store.toggleBaketPanel(); + // THEN + expect(store.baketPanelVisible).toBe(false); + }); +}); diff --git a/resources/ts/fo/stores/basket.store.ts b/resources/ts/fo/stores/basket.store.ts new file mode 100644 index 00000000..1b8bf873 --- /dev/null +++ b/resources/ts/fo/stores/basket.store.ts @@ -0,0 +1,59 @@ +import { defineStore } from "pinia"; +import { computed, ref } from "vue"; + +import type { BasketItem, Money } from "@fo/types"; + +export interface BasketTotal { + taxIncluded: Money | null; +} + +export type BasketStore = ReturnType<typeof useBasketStore> + +export const useBasketStore = defineStore("basket", () => { + + // * STATE + const baketPanelIsOpenned = ref<boolean>(false); + + const reload = ref<boolean>(false); + const basket = ref<BasketItem[]>([]); + const total = ref<BasketTotal>({taxIncluded: null,}); + + // * METHODS + function setReload(value: boolean) { + reload.value = value; + } + + function setBasket(items: BasketItem[], basketTotal: BasketTotal) { + basket.value = items; + total.value = basketTotal; + } + + function openBasketPanel(visible: boolean) { + baketPanelIsOpenned.value = visible; + } + + function closeBasketPanel() { + baketPanelIsOpenned.value = false; + } + + function toggleBaketPanel() { + baketPanelIsOpenned.value = !baketPanelIsOpenned.value; + } + + return { + // * State + baketPanelVisible: computed<boolean>(() => baketPanelIsOpenned.value), + hasToReload: computed<boolean>(() => reload.value), + basket: computed<{ items: BasketItem[], total: BasketTotal }>(() => ({ + items: basket.value, + total: total.value, + })), + + // * Methods + setReload, + setBasket, + openBasketPanel, + toggleBaketPanel, + closeBasketPanel, + }; +}); diff --git a/resources/ts/fo/stores/index.ts b/resources/ts/fo/stores/index.ts new file mode 100644 index 00000000..e2575c10 --- /dev/null +++ b/resources/ts/fo/stores/index.ts @@ -0,0 +1,3 @@ +export * from "./basket.store"; +export * from "./product-viewer.store"; + diff --git a/resources/ts/fo/stores/product-viewer.store.test.ts b/resources/ts/fo/stores/product-viewer.store.test.ts new file mode 100644 index 00000000..8fae1619 --- /dev/null +++ b/resources/ts/fo/stores/product-viewer.store.test.ts @@ -0,0 +1,96 @@ +import { createPinia, setActivePinia } from "pinia"; +import { beforeEach, describe, expect, it } from "vitest"; + +import type { BrandValue, RangeId, TagId } from "@fo/types"; + +import { useProductViewerStore, type ProductViewerStore } from "./product-viewer.store"; + +describe("ProductViewerStore", () => { + beforeEach(() => { + setActivePinia(createPinia()); + }); + + it("initializes with default values", () => { + // GIVEN + const store = useProductViewerStore(); + + // THEN + expect(store.loading).toBe(false); + expect(store.loadMoreTrigger).toBe(0); + expect(store.filteredProductList).toEqual([]); + expect(store.currentSearchValue).toBe(""); + expect(store.activeBrands).toEqual([]); + expect(store.activeRanges).toEqual([]); + expect(store.activeTags).toEqual([]); + expect(store.isDiscounted).toBe(false); + }); + + it("can set loading state", () => { + // GIVEN + const store = useProductViewerStore(); + + // WHEN + store.setLoading(true); + + // THEN + expect(store.loading).toBe(true); + }); + + it("can trigger load more", () => { + // GIVEN + const store = useProductViewerStore(); + expect(store.loadMoreTrigger).toBe(0); + + // WHEN + store.triggerLoadMore(); + + // THEN + expect(store.loadMoreTrigger).toBe(1); + }); + + it("can set and clear filters", () => { + // GIVEN + const store = useProductViewerStore(); + + // WHEN + store.setSearchValue("apple"); + store.setIsDiscounted(true); + store.setActiveBrands(["brand_1" as BrandValue]); + store.setActiveRanges([1 as unknown as RangeId]); + store.setActiveTags([1 as unknown as TagId]); + + // THEN + expect(store.currentSearchValue).toBe("apple"); + expect(store.isDiscounted).toBe(true); + expect(store.activeBrands).toContain("brand_1"); + expect(store.activeRanges).toContain(1); + expect(store.activeTags).toContain(1); + + // WHEN + store.clearFilters(); + + // THEN + expect(store.currentSearchValue).toBe(""); + expect(store.isDiscounted).toBe(false); + expect(store.activeBrands.length).toBe(0); + expect(store.activeRanges.length).toBe(0); + expect(store.activeTags.length).toBe(0); + }); + + it("can append filtered products", () => { + // GIVEN + const store = useProductViewerStore(); + const product1 = { id: "p1", name: "Product 1" } as unknown as ProductViewerStore["filteredProductList"][0]; + const product2 = { id: "p2", name: "Product 2" } as unknown as ProductViewerStore["filteredProductList"][0]; + + store.setFilteredProduct([product1]); + expect(store.filteredProductList.length).toBe(1); + + // WHEN + store.appendFilteredProducts([product2]); + + // THEN + expect(store.filteredProductList.length).toBe(2); + expect(store.filteredProductList[1].id).toBe("p2"); + }); +}); diff --git a/resources/ts/fo/stores/product-viewer.store.ts b/resources/ts/fo/stores/product-viewer.store.ts new file mode 100644 index 00000000..b42d0062 --- /dev/null +++ b/resources/ts/fo/stores/product-viewer.store.ts @@ -0,0 +1,150 @@ +import { defineStore } from "pinia"; +import { computed, ref } from "vue"; + +import { + type BrandModel, + type ProductModel, type RangeModel, type TagModel +} from "@fo/schemas"; +import type { + Brand, BrandValue, + Money, Nutriscore, Product, ProductId, + ProductSlug, Range, RangeId, RangeSlug, Tag, TagId, TagSlug +} from "@fo/types"; + +interface FilteredProduct { + id: ProductId; + name: string; + slug: ProductSlug; + shortDescription: string | null; + picture: URL | null; + picture_title: string; + picture_alt: string; + weight_variable: boolean; + priceTtc: Money | null; + priceKgTtc: Money | null; + discountedPriceTtc: Money | null; + showStrippedPrice: boolean; + sell_unit_label?: string | null; + nutriscore: Nutriscore | null; + is_available: boolean; + can_add_to_basket: boolean; + } + +export type ProductViewerStore = ReturnType<typeof useProductViewerStore> + +export const useProductViewerStore = defineStore("productViewer", () => { + + // * State + const isLoading = ref<boolean>(false); + const loadMoreTrigger = ref<number>(0); + const filteredProducts = ref<FilteredProduct[]>([]); + + const brands = ref<Brand[]>([]); + const products = ref<Product[]>([]); + const ranges = ref<Range[]>([]); + const tags = ref<Tag[]>([]); + const discounted = ref<boolean>(false); + + // * Filters + const searchValue = ref<string>(""); + const selectedBrands = ref(new Set<BrandValue>()); + const selectedRanges = ref(new Set<RangeId>()); + const selectedTags = ref(new Set<TagId>()); + + // * Methods + function setFilteredProduct(list: FilteredProduct[]) { filteredProducts.value = list.map(v => ({...v})); } + function setBrands(modelList: BrandModel[]) { brands.value = modelList.map(mapBrandModel); } + function setProducts(modelList: ProductModel[]) { + products.value = modelList.map(mapProductModel); + filteredProducts.value = modelList.map(p => ({ + ...p, + id: p.id as ProductId, + slug: p.slug as ProductSlug, + picture_title: p.name, + picture_alt: p.name + })); + } + function setRanges(modelList: RangeModel[]) { ranges.value = modelList.map(mapRangeModel); } + function setTags(modelList: TagModel[]) { tags.value = modelList.map(mapTagModel); } + + function setIsDiscounted(val: boolean) { + discounted.value = val; + } + + // * Actions + function setLoading(value: boolean) { + isLoading.value = value; + } + + function setSearchValue(value: string) { + searchValue.value = value; + } + + function setActiveRanges(values: RangeId[]) { + selectedRanges.value.clear(); + values.forEach(v => selectedRanges.value.add(v)); + } + + function setActiveTags(values: TagId[]) { + selectedTags.value.clear(); + values.forEach(v => selectedTags.value.add(v)); + } + + function setActiveBrands(values: BrandValue[]) { + selectedBrands.value.clear(); + values.forEach(v => selectedBrands.value.add(v)); + } + + function appendFilteredProducts(list: FilteredProduct[]) { + filteredProducts.value = [...filteredProducts.value, ...list.map(v => ({...v}))]; + } + + function clearFilters() { + searchValue.value = ""; + selectedBrands.value.clear(); + selectedRanges.value.clear(); + selectedTags.value.clear(); + discounted.value = false; + } + + function triggerLoadMore() { + loadMoreTrigger.value++; + } + + return { + // * Getters + loading: computed<boolean>(() => isLoading.value), + loadMoreTrigger: computed<number>(() => loadMoreTrigger.value), + filteredProductList: computed<FilteredProduct[]>(() => filteredProducts.value), + rangeList: computed<Range[]>(() => Array.from(ranges.value)), + tagList: computed<Tag[]>(() => Array.from(tags.value)), + brandList: computed<Brand[]>(() => Array.from(brands.value)), + currentSearchValue: computed<string>(() => searchValue.value), + activeBrands: computed<BrandValue[]>(() => Array.from(selectedBrands.value)), + activeRanges: computed<RangeId[]>(() => Array.from(selectedRanges.value)), + activeTags: computed<TagId[]>(() => Array.from(selectedTags.value)), + isDiscounted: computed<boolean>(() => discounted.value), + + // * Methods + setLoading, + triggerLoadMore, + setFilteredProduct, + setBrands, setProducts, setRanges, setTags, + setSearchValue, setIsDiscounted, clearFilters, + setActiveRanges, setActiveTags, setActiveBrands, + appendFilteredProducts + }; +}); + +function mapBrandModel(model: BrandModel): Brand { + return { ...model, value: model.value as unknown as BrandValue }; +} +function mapProductModel(model: ProductModel): Product { + return { ...model, id: model.id as ProductId, slug: model.slug as ProductSlug }; +} +function mapRangeModel(model: RangeModel): Range { + return { ...model, id: model.id as RangeId, slug: model.slug as RangeSlug }; +} +function mapTagModel(model: TagModel): Tag { + return { ...model, id: model.id as TagId, slug: model.slug as TagSlug }; +} diff --git a/resources/ts/fo/types/basket-item.type.ts b/resources/ts/fo/types/basket-item.type.ts new file mode 100644 index 00000000..db34b5f1 --- /dev/null +++ b/resources/ts/fo/types/basket-item.type.ts @@ -0,0 +1,23 @@ +import type { Money } from "./money.type"; +import type { ProductId, ProductSlug } from "./product.type"; + +export interface Basket { + items: BasketItem[]; + taxIncluded: Money | null; +} + +export interface BasketItem { + id: ProductId; + slug: ProductSlug; + name: string; + shortDescription: string | null; + qty: number; + picture: URL | null; + + unitPriceHt: Money; + weightVariable: boolean; + + subtotalHt: Money; + totalTtc: Money; + discountedPriceTtc: Money | null; +} diff --git a/resources/ts/fo/types/brand.type.ts b/resources/ts/fo/types/brand.type.ts new file mode 100644 index 00000000..7680633c --- /dev/null +++ b/resources/ts/fo/types/brand.type.ts @@ -0,0 +1,9 @@ +export type BrandValue = string & { + type: "BrandValue", + __Symbol: symbol +} + +export type Brand = { + value: BrandValue, + label: string +} diff --git a/resources/ts/fo/types/index.ts b/resources/ts/fo/types/index.ts new file mode 100644 index 00000000..fe970955 --- /dev/null +++ b/resources/ts/fo/types/index.ts @@ -0,0 +1,9 @@ +export * from "./basket-item.type"; +export * from "./brand.type"; +export * from "./money.type"; +export * from "./nutriscore.type"; +export * from "./pagination.type"; +export * from "./product.type"; +export * from "./range.type"; +export * from "./tag.type"; + diff --git a/resources/ts/fo/types/money.type.ts b/resources/ts/fo/types/money.type.ts new file mode 100644 index 00000000..60232ccf --- /dev/null +++ b/resources/ts/fo/types/money.type.ts @@ -0,0 +1,11 @@ +export type Currency = string & { + type: "Currency" +} + +export const EuroCurrency = (): Currency => "EUR" as Currency; + +export interface Money { + amount: number + currency: Currency + formatted: string +} diff --git a/resources/ts/fo/types/nutriscore.type.ts b/resources/ts/fo/types/nutriscore.type.ts new file mode 100644 index 00000000..e1f9fa97 --- /dev/null +++ b/resources/ts/fo/types/nutriscore.type.ts @@ -0,0 +1,7 @@ +export enum Nutriscore { + A = "A", + B = "B", + C = "C", + D = "D", + E = "E", +} diff --git a/resources/ts/fo/types/pagination.type.ts b/resources/ts/fo/types/pagination.type.ts new file mode 100644 index 00000000..376b80b6 --- /dev/null +++ b/resources/ts/fo/types/pagination.type.ts @@ -0,0 +1,25 @@ + +export function paginateWith( + page: number, + perPage: number +): Pagination { + + if (page < 1) { + throw new Error(`page shall be greater than 1 : '${page}'`); + } + + if (perPage < 1) { + throw new Error(`perPage shall be greater than 1 : '${perPage}'`); + } + + if (perPage >= 50) { + throw new Error(`perPage cannot be greater than 50 : '${perPage}'`); + } + + return {page, perPage}; +} + +export interface Pagination { + page: number, + perPage: number +} diff --git a/resources/ts/fo/types/product.type.ts b/resources/ts/fo/types/product.type.ts new file mode 100644 index 00000000..03c2f26c --- /dev/null +++ b/resources/ts/fo/types/product.type.ts @@ -0,0 +1,25 @@ +import type { Money } from "./money.type"; + +export type ProductId = string & { + type: "ProductId", + __Symbol: symbol +} + +export type ProductSlug = string & { + type: "ProductSlug", + __Symbol: symbol +} + +export interface Product { + id: ProductId + slug: ProductSlug + name: string + shortDescription: string | null + picture: URL + weight_variable: boolean + priceTtc: Money | null + priceKgTtc: Money | null + discountedPriceTtc: Money | null + showStrippedPrice?: boolean + sell_unit_label?: string | null +} diff --git a/resources/ts/fo/types/range.type.ts b/resources/ts/fo/types/range.type.ts new file mode 100644 index 00000000..e10fac55 --- /dev/null +++ b/resources/ts/fo/types/range.type.ts @@ -0,0 +1,15 @@ +export type RangeId = number & { + type: "RangeId", + __Symbol: symbol +} + +export type RangeSlug = string & { + type: "RangeSlug", + __Symbol: symbol +} + +export interface Range { + id: RangeId + name: string + slug: RangeSlug +} diff --git a/resources/ts/fo/types/tag.type.ts b/resources/ts/fo/types/tag.type.ts new file mode 100644 index 00000000..0f5c8ed6 --- /dev/null +++ b/resources/ts/fo/types/tag.type.ts @@ -0,0 +1,15 @@ +export type TagId = number & { + type: "TagId", + __Symbol: symbol +} + +export type TagSlug = string & { + type: "TagSlug", + __Symbol: symbol +} + +export interface Tag { + id: TagId + label: string + slug: TagSlug +} diff --git a/resources/ts/fo/utilities/bootstrap.ts b/resources/ts/fo/utilities/bootstrap.ts new file mode 100644 index 00000000..3d8db352 --- /dev/null +++ b/resources/ts/fo/utilities/bootstrap.ts @@ -0,0 +1,15 @@ +import * as bootstrap from "bootstrap"; + +import { Tooltips } from "@modules/bs-tooltips"; + +globalThis.bootstrap = bootstrap; + +if (typeof document !== "undefined") { + if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", () => { + Tooltips.make(); + }, { once: true }); + } else { + Tooltips.make(); + } +} diff --git a/resources/ts/fo/utilities/fo-vue-modules.ts b/resources/ts/fo/utilities/fo-vue-modules.ts new file mode 100644 index 00000000..8c25c1ab --- /dev/null +++ b/resources/ts/fo/utilities/fo-vue-modules.ts @@ -0,0 +1,4 @@ +import type { VueModuleMap } from "./vue-fo"; + +/// <reference types="vite/client" /> +export const foVueModules = import.meta.glob("./../components/**/*.vue") as VueModuleMap; diff --git a/resources/ts/fo/utilities/fontawesome.ts b/resources/ts/fo/utilities/fontawesome.ts new file mode 100644 index 00000000..d7ba424c --- /dev/null +++ b/resources/ts/fo/utilities/fontawesome.ts @@ -0,0 +1,60 @@ +import { config, dom, library } from "@fortawesome/fontawesome-svg-core"; +import { + faArrowLeft, + faArrowRight, + faBasketShopping, + faCashRegister, + faChevronLeft, + faChevronRight, + faCircleCheck, + faCircleExclamation, + faCircleInfo, + faCircleXmark, + faEye, + faEyeSlash, + faImage, + faMagnifyingGlass, + faMinus, + faPlus, + faRightFromBracket, + faTimes, + faTrash, + faUserLock +} from "@fortawesome/free-solid-svg-icons"; + +config.autoReplaceSvg = false; + +// Pages +library.add(faArrowLeft); + +// Flash messages +library.add(faCircleCheck); +library.add(faCircleXmark); +library.add(faCircleExclamation); +library.add(faCircleInfo); + +// Navbar +library.add(faMagnifyingGlass); +library.add(faUserLock); +library.add(faRightFromBracket); + +// Basket +library.add(faBasketShopping); +library.add(faMinus); +library.add(faPlus); +library.add(faTimes); + +// Password visibility +library.add(faEye); +library.add(faEyeSlash); + +// Basket summary +library.add(faImage); +library.add(faTrash); +library.add(faArrowRight); +library.add(faChevronRight); +library.add(faChevronLeft); + +library.add(faCashRegister); + +dom.watch(); diff --git a/resources/ts/fo/utilities/sliders.ts b/resources/ts/fo/utilities/sliders.ts new file mode 100644 index 00000000..58b17f34 --- /dev/null +++ b/resources/ts/fo/utilities/sliders.ts @@ -0,0 +1,58 @@ +import type { Carousel } from "bootstrap"; + +document.addEventListener("DOMContentLoaded", (): void => { + const carouselElement = document.querySelector<HTMLElement>("#products-carousel"); + + if (carouselElement) { + const carouselInner = carouselElement.querySelector<HTMLElement>(".carousel-inner"); + const carouselItems = carouselElement.querySelectorAll<HTMLElement>(".carousel-item"); + + if (carouselInner && carouselItems.length > 0) { + + const updateCarouselLayout = (): void => { + const windowWidth: number = window.innerWidth; + + carouselInner.style.display = "flex"; + carouselInner.style.flexDirection = "row"; + + let itemsPerView = 1; + if (windowWidth >= 768 && windowWidth < 992) { + itemsPerView = 2; + } + if (windowWidth >= 992){ + itemsPerView = 3; + } + + carouselItems.forEach((item: HTMLElement) => { + const widthPercent = 100 / itemsPerView; + item.style.flex = `0 0 ${widthPercent}%`; + item.style.display = "block"; + }); + }; + + carouselElement.addEventListener("slide.bs.carousel", (e: Event) => { + const direction = (e as unknown as Carousel.Event).direction; + + let itemsPerView = 1; + if (window.innerWidth >= 768) { + itemsPerView = 2; + } + if (window.innerWidth >= 992) { + itemsPerView = 3; + } + + const scrollAmount = carouselInner.clientWidth / itemsPerView; + if (direction === "left") { + carouselInner.scrollBy({ left: scrollAmount, behavior: "smooth" }); + } else { + carouselInner.scrollBy({ left: -scrollAmount, behavior: "smooth" }); + } + + e.preventDefault(); + }); + + updateCarouselLayout(); + window.addEventListener("resize", updateCarouselLayout); + } + } +}); diff --git a/resources/ts/fo/utilities/vue-fo.ts b/resources/ts/fo/utilities/vue-fo.ts new file mode 100644 index 00000000..9fa6319b --- /dev/null +++ b/resources/ts/fo/utilities/vue-fo.ts @@ -0,0 +1,82 @@ +import { createPinia } from "pinia"; +import type { App, Component } from "vue"; +import { createApp } from "vue"; + + +type AsyncVueModuleLoader = () => Promise<{ default: Component }>; +type SyncVueModule = { default: Component }; +export type VueModuleLoader = AsyncVueModuleLoader | SyncVueModule; +export type VueModuleMap = Record<string, VueModuleLoader>; + +const toSnakeCaseName = (componentName: string): string => { + return componentName + .split(".")[0] + .replaceAll(/\.?([A-Z])/g, (_match, p1) => { + return "-" + p1.toLowerCase(); + }) + .replace(/^-/, "") + .replace("-component", ""); +}; + +export const registerFoVueApps = (vues: VueModuleMap, doc: Document = document): void => { + const sharedPinia = createPinia(); + + const setupApp = (app: App<Element>) => { + app.config.globalProperties.window = globalThis; + app.config.globalProperties.document = doc; + + app.use(sharedPinia); + }; + + const resolveComponent = async (vueModuleLoader: VueModuleLoader): Promise<Component> => { + if (typeof vueModuleLoader === "function") { + const vueModule = await vueModuleLoader(); + return vueModule.default; + } + + return vueModuleLoader.default; + }; + + const mountApp = (vueCptPathName: string, vueModuleLoader: VueModuleLoader, mountEl: Element) => { + void resolveComponent(vueModuleLoader) + .then((component) => { + const app = createApp(component, {json: (mountEl as HTMLElement).dataset.json ?? {},}); + setupApp(app); + setTimeout(() => app.mount(mountEl)); + }) + .catch((error: unknown) => { + console.error(`Failed to load front-office component: ${vueCptPathName}`, error); + }); + }; + + for (const [vueCptPathName, vueCptPromise] of Object.entries(vues)) { + const isInHiddenFolder = vueCptPathName + .split("/") + .some((part) => part.startsWith("_")); + + if (isInHiddenFolder) { + continue; + } + + const componentName = vueCptPathName.split("/").pop(); + if (!componentName) { + throw new Error(`Cannot load ${vueCptPathName}`); + } + const snakeCaseName = toSnakeCaseName(componentName); + + const el = doc.getElementById(snakeCaseName), + elGroup = doc.getElementsByClassName(snakeCaseName); + + // * Init using ID + if (el) { + mountApp(vueCptPathName, vueCptPromise, el); + } + // * Init Using class + for (const grpEl of elGroup) { + // * Hack to prevent loop weirdness + setTimeout(() => { + mountApp(vueCptPathName, vueCptPromise, grpEl); + }, 500); + } + } +}; diff --git a/resources/ts/index.d.ts b/resources/ts/index.d.ts new file mode 100644 index 00000000..ca32101a --- /dev/null +++ b/resources/ts/index.d.ts @@ -0,0 +1,152 @@ +import type VueTagsInput from "@sipec/vue3-tags-input"; + + + +// * Enum +interface EnumInterface { + label: string; + value: number | string; +} + +type HexColorType = string; +type HexColorNameType = string; +type ColorType = { + name: HexColorNameType; + color: HexColorType; +} + +// * Product Option +type ProductOptionChoiceType = { + /** Nom du choix */ + label: string; + /** Valeur en centimes */ + value: number; +}; +type OrderOptionType = { + name: string; + choice: ProductOptionChoiceType, + /** Valeur en centimes */ + price: number; +} +type ProductOptionType = { + name: string; + choices: Array<ProductOptionChoiceType> +} + +// * Basket Item +type BasketItemType = { + id: number; + slug: string; + name: string; + url: string; + price: number; + price_ori: number; + discount_type: "product" | "customer" | null; + discount_value: number; + quantity: number; + tax: number; + weight: float; + color: Color|null; + options: BasketOptionsType; +} + +// * Basket Options +type BasketOptionsType = Record<string, OrderOptionType>; + +// * Laravel Paginator + +interface PaginatorLink { + url: null | string; + label: string; + active: boolean; +} + +interface Paginator { + current_page: number; + first_page_url: string; + from: number; + last_page: number; + last_page_url: string; + links: Array<PaginatorLink>; + next_page_url: string | null; + path: string; + per_page: number; + prev_page_url: string | null; + to: number; + total: number; +} + +// * Recursive List<string> +type StringList = Record<PropertyKey, string>; +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +interface NestedStringListInterface + extends Record<PropertyKey, NestedStringListInterface | StringList> {} + +// * Recursive List<number> +type NumberList = Record<PropertyKey, number>; +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +interface NestedNumberListInterface + extends Record<PropertyKey, NestedNumberListInterface | NumberList> {} + +// * Recursive List<Model> +type Model = Record< + string, + | string + | boolean + | number + | object + | NestedStringList + | NestedNumberList + | NestedModelInterface + | ModelListInterface +>; +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +interface NestedModelInterface extends Model {} + +type NestedStringList = NestedStringListInterface | StringList | string; +type NestedNumberList = NestedNumberListInterface | NumberList | number; + +type ModelList = Array<Model>; +type ModelListInterface = ModelList + + + +declare global { + type CustomTag = LaravelModel & VueTagsInput.ITag; + type LaravelModel = Model; + type LaravelModelList = ModelList; + type LaravelPaginator = Paginator; + type LaravelPaginatorLink = PaginatorLink; + + type Color = ColorType; + type HexColor = HexColorType; + type HexColorName = HexColorNameType; + type Enum = EnumInterface; + type ValueOf<T> = T[keyof T]; + type LaravelValidationErrors = Record<string, string[]>; + + var SweetAlertConfirm: confirm; + var bootstrap: typeof import("bootstrap"); + var CookieNotice: import("@ldc-web/cookie-notice"); + + var vueDebug: boolean | undefined; + + var __SYSTEM: { + _appEnv?: string; + _asset: Record<string, string>; + _vite_asset: Record<string, string>; + _locale: string; + _permissions?: Record<string, unknown>; + _routes: Record<string, string>; + _sentryDsn?: string; + _sentryTunnel?: string; + _paypal?: { + clientId: string; + currency: string; + }; + _translations: { + json: NestedStringList; + php: NestedStringList; + }; + }; +} diff --git a/resources/ts/modules/asset.ts b/resources/ts/modules/asset.ts new file mode 100644 index 00000000..66b7b8dc --- /dev/null +++ b/resources/ts/modules/asset.ts @@ -0,0 +1,10 @@ +function assetStatic(path: string) { + return `${globalThis.__SYSTEM._vite_asset[path] ?? path}`; +} + +function asset(path: string) { + return `/${path.startsWith("/") ? path.substring(1, path.length) : path}`; +} + +export { asset, assetStatic }; + diff --git a/resources/ts/modules/bs-tooltips.ts b/resources/ts/modules/bs-tooltips.ts new file mode 100644 index 00000000..39257c45 --- /dev/null +++ b/resources/ts/modules/bs-tooltips.ts @@ -0,0 +1,139 @@ +import { Tooltip } from "bootstrap"; + + +type ConstructorTypeParent = "parent"; +type ConstructorTypeDom = "dom"; + +interface ParentSelectorTooltips { + type: ConstructorTypeParent + /** The parent element that contains Dom elements for which tooltips shall be created. */ + parentSelector: string; +} + +interface DomProvidedTooltips { + type: ConstructorTypeDom; + /** Dom elements for which tooltips shall be created. */ + elements: HTMLElement | NodeListOf<HTMLElement>; +} + +interface TooltipsOptions { + /** Tooltip options. */ + options: Partial<Tooltip.Options>|null|undefined; +} + +export type TooltipsConstructor = TooltipsOptions & (ParentSelectorTooltips|DomProvidedTooltips); + +export class Tooltips { + /** BS tooltips instances */ + private tooltips: Array<Tooltip> = []; + + /** The parent element that contains Dom elements for which tooltips shall be created. */ + private parentSelector: string | null = null; + + /** Dom elements for which tooltips shall be created. */ + private elements: Array<HTMLElement> = []; + + /** Tooltip default options. */ + private static readonly defaultOptions: Partial<Tooltip.Options> = { + container: "body", + placement: "auto", + delay: { + show: 1250, + hide: 0, + }, + }; + + /** Tooltip options. */ + private options: Partial<Tooltip.Options> = {}; + + /** + * @param parentSelector + * @param options Tooltip options. + */ + constructor(params: TooltipsConstructor) { + if (params.type === "parent") { + this.parentSelectorConstructor(params); + } + if (params.type === "dom") { + this.domPrividedTooltipsContructor(params); + } + } + + public static make(params?: TooltipsConstructor) { + let fullParams: TooltipsConstructor; + if (!params || params.type === "parent") { + fullParams = { + type: "parent", + parentSelector: "body", + options: {}, + ...params + } as TooltipsOptions & ParentSelectorTooltips; + } else { + fullParams = { + type: "dom", + elements: (params as DomProvidedTooltips).elements, + options: params.options ?? {}, + } as TooltipsOptions & DomProvidedTooltips; + } + return new Tooltips(fullParams); + } + + private parentSelectorConstructor({ parentSelector, options }: TooltipsOptions & ParentSelectorTooltips) { + this.parentSelector = parentSelector; + this.options = { ...Tooltips.defaultOptions, ...options }; + this.initTooltips(); + } + + private domPrividedTooltipsContructor({ elements, options }: TooltipsOptions & DomProvidedTooltips) { + if (elements instanceof HTMLElement) { + this.elements = [elements]; + } else { + this.elements = Array.from(elements); + } + this.options = { ...Tooltips.defaultOptions, ...options }; + this.initTooltips(); + } + + /** + * Close all Bootstrap tooltips and reinstanciate them. + */ + public refreshTooltips(): void { + this.closeBootstrapTooltip(); + this.initTooltips(); + } + + /** + * Close all Bootstrap tooltips for ever. + */ + public closeBootstrapTooltip(): void { + for (const tooltip of this.tooltips) { + tooltip.hide(); + // * Prevent pending tooltips beeing shown after we asked to hide them + tooltip.disable(); + } + } + + /** + * Completely dispose all tooltips immediately. + */ + public destroy(): void { + for (const tooltip of this.tooltips) { + tooltip.dispose(); + } + this.tooltips = []; + } + + /** + * Initialize tooltips + */ + private initTooltips() { + this.closeBootstrapTooltip(); + /** data-bs-toggle tooltips elements */ + const elements = this.parentSelector ? Array.prototype.slice + .call(document.querySelectorAll(`${this.parentSelector} [data-bs-toggle="tooltip"]`)) : + this.elements; + this.tooltips = elements.map((tooltipTriggerEl) => { + return new Tooltip(tooltipTriggerEl, this.options); + }); + } +} diff --git a/resources/ts/modules/ckeditor-utils.ts b/resources/ts/modules/ckeditor-utils.ts new file mode 100644 index 00000000..7c7eca71 --- /dev/null +++ b/resources/ts/modules/ckeditor-utils.ts @@ -0,0 +1,6 @@ +export function normalizeEditorText(value: unknown): string { + if (value === null || value === undefined || value === "null" || value === "undefined") { + return ""; + } + return String(value); +} diff --git a/resources/ts/modules/ckeditor.test.ts b/resources/ts/modules/ckeditor.test.ts new file mode 100644 index 00000000..73d1d21c --- /dev/null +++ b/resources/ts/modules/ckeditor.test.ts @@ -0,0 +1,33 @@ +import { describe, expect, it } from "vitest"; + +import { normalizeEditorText } from "./ckeditor-utils"; + +describe("normalizeEditorText", () => { + it("converts null and undefined to empty string", () => { + // GIVEN / WHEN / THEN + expect(normalizeEditorText(null)).toBe(""); + expect(normalizeEditorText(undefined)).toBe(""); + }); + + it("converts string 'null' and 'undefined' to empty string", () => { + // GIVEN / WHEN / THEN + expect(normalizeEditorText("null")).toBe(""); + expect(normalizeEditorText("undefined")).toBe(""); + }); + + it("preserves valid empty string", () => { + // GIVEN / WHEN / THEN + expect(normalizeEditorText("")).toBe(""); + }); + + it("preserves HTML and text content", () => { + // GIVEN / WHEN / THEN + expect(normalizeEditorText("<p>Hello world</p>")).toBe("<p>Hello world</p>"); + expect(normalizeEditorText("Some regular text")).toBe("Some regular text"); + }); + + it("converts numbers to string", () => { + // GIVEN / WHEN / THEN + expect(normalizeEditorText(123)).toBe("123"); + }); +}); diff --git a/resources/ts/modules/ckeditor.ts b/resources/ts/modules/ckeditor.ts new file mode 100644 index 00000000..c728eba5 --- /dev/null +++ b/resources/ts/modules/ckeditor.ts @@ -0,0 +1,170 @@ +/** + * @license Copyright (c) 2014-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ +import type { Editor, PluginConstructor } from "ckeditor5"; +import { + Alignment, + Autoformat, + AutoLink, + BlockQuote, + Bold, + Code, + CodeBlock, + Essentials, + FindAndReplace, + FontBackgroundColor, + FontColor, + FontFamily, + FontSize, + GeneralHtmlSupport, + Heading, + Highlight, + HorizontalLine, + Image, + ImageCaption, + ImageInsert, + ImageResize, + ImageStyle, + ImageToolbar, + ImageUpload, + Indent, + IndentBlock, + Italic, + Link, + LinkImage, + List, + ListProperties, + MediaEmbed, + MediaEmbedEditing, + MediaEmbedUI, + Paragraph, + PasteFromOffice, + RemoveFormat, + SimpleUploadAdapter, + SourceEditing, + SpecialCharacters, + SpecialCharactersEssentials, + Strikethrough, + Style, + Table, + TableCaption, + TableCellProperties, + TableColumnResize, + TableProperties, + TableToolbar, + TextTransformation, + Underline, + WordCount, +} from "ckeditor5"; +import frTranslations from "ckeditor5/translations/fr.js"; + +/** + * Legacy emojies + * + * :-) 😊 + * :-P 😛 + * 8-) 😎 + * ;-) 😉 + * :-D 😄 + * :twisted: 😈 + * :mrgreen: 😁 + * :lol: 😆 + * :roll: 🙄 + * :-? 😕 + * :cry: 😢 + * :-o 😮 + * :evil: 😡 + * :-| 😐 + * :oops: 😳 + * :-x 😠 + * 8-O 😲 + * :-( 😧 + * :arrow: ➡️ + * :idea: 💡 + */ +const SpecialCharactersEmoji = function (editor: Editor): void { + editor.plugins.get("SpecialCharacters").addItems("Emoji", [ + { title: ":-)", character: "😊" }, + { title: ":-P", character: "😛" }, + { title: "8-)", character: "😎" }, + { title: ";-)", character: "😉" }, + { title: ":-D", character: "😄" }, + { title: ":twisted:", character: "😈" }, + { title: ":mrgreen:", character: "😁" }, + { title: ":lol:", character: "😆" }, + { title: ":roll:", character: "🙄" }, + { title: ":-?", character: "😕" }, + { title: ":cry:", character: "😢" }, + { title: ":-o", character: "😮" }, + { title: ":evil:", character: "😡" }, + { title: ":-|", character: "😐" }, + { title: ":oops:", character: "😳" }, + { title: ":-x", character: "😠" }, + { title: "8-O", character: "😲" }, + { title: ":-(", character: "😧" }, + { title: ":arrow:", character: "➡" }, + { title: ":idea:", character: "💡" }, + ]); +}; + +const builtinPlugins: Array<PluginConstructor | typeof SpecialCharactersEmoji> = [ + Alignment, + Autoformat, + AutoLink, + BlockQuote, + Bold, + Code, + CodeBlock, + Essentials, + FindAndReplace, + FontBackgroundColor, + FontColor, + FontFamily, + FontSize, + GeneralHtmlSupport, + Heading, + Highlight, + HorizontalLine, + Image, + ImageCaption, + ImageInsert, + ImageResize, + ImageStyle, + ImageToolbar, + ImageUpload, + Indent, + IndentBlock, + Italic, + Link, + LinkImage, + List, + ListProperties, + MediaEmbed, + MediaEmbedEditing, + MediaEmbedUI, + Paragraph, + PasteFromOffice, + RemoveFormat, + SimpleUploadAdapter, + SourceEditing, + SpecialCharacters, + SpecialCharactersEssentials, + SpecialCharactersEmoji, + Strikethrough, + Style, + Table, + TableCaption, + TableCellProperties, + TableColumnResize, + TableProperties, + TableToolbar, + TextTransformation, + Underline, + WordCount, +]; + +export { ClassicEditor } from "ckeditor5"; +export { builtinPlugins, frTranslations }; +export { normalizeEditorText } from "./ckeditor-utils"; + diff --git a/resources/ts/modules/currency-formatter.ts b/resources/ts/modules/currency-formatter.ts new file mode 100644 index 00000000..db4e017d --- /dev/null +++ b/resources/ts/modules/currency-formatter.ts @@ -0,0 +1,17 @@ +export default function number_format(amount: number|null, to_float: boolean = false): string | number { + if (Number.isNaN(amount) || amount === null) { + return "-.--"; + } + + const locale = "fr"; + const formatted_string = new Intl.NumberFormat(locale, { + style: "currency", + currency: "eur", + minimumFractionDigits: 2, + maximumFractionDigits: 2 + }).format(amount); + if (to_float) { + return Number.parseFloat(formatted_string.replace(",", ".").replace("€", "").replace(" ", "")); + } + return formatted_string; +} diff --git a/resources/ts/modules/debounce.ts b/resources/ts/modules/debounce.ts new file mode 100644 index 00000000..76a50301 --- /dev/null +++ b/resources/ts/modules/debounce.ts @@ -0,0 +1,13 @@ +type SetTimeoutReturn = ReturnType<typeof setTimeout> + +export function defineDebounce<Args>( + fn: (...args: Args[]) => void, + delay: number = 600 +): (...args: Args[]) => void { + let timeoutId: SetTimeoutReturn; + + return (...args: Args[]) => { + clearTimeout(timeoutId); + timeoutId = setTimeout(() => fn(...args), delay); + }; +} diff --git a/resources/ts/modules/parseLaravelErrorMessages.ts b/resources/ts/modules/parseLaravelErrorMessages.ts new file mode 100644 index 00000000..89383ee2 --- /dev/null +++ b/resources/ts/modules/parseLaravelErrorMessages.ts @@ -0,0 +1,47 @@ +/** + * Parse error messages for a specific input. + * + * @param inputName string + * @param allErrors Record<string, Array<string>> + * @return string + */ +export function parseValidationErrors( + allErrors: Record<string, Array<string>> = {} +): string | null { + const errorList = Object.values(allErrors); + if (!errorList.length) { + return null; + } + return errorList + .flat() + .reduce( + (oldInputString: string | null, inputString: string) => + (oldInputString ? `${oldInputString}, ` : "") + + inputString, + null + ); +} + +/** + * Parse error messages for a specific input. + * + * @param inputName string + * @param allErrors Record<string, Array<string>> + * @return string + */ +export function parseValidationInput( + inputName: string, + allErrors: Record<string, Array<string>> = {} +): string | null { + let errorList = [] as Array<string>; + for (const value of Object.keys(allErrors)) { + if (value == inputName) { + errorList = allErrors[inputName]; + } + } + return errorList.length + ? errorList.reduce((oldString: string | null, string) => { + return (oldString ? `${oldString}, ` : "") + string; + }, null) + : null; +} diff --git a/resources/ts/modules/route.ts b/resources/ts/modules/route.ts new file mode 100644 index 00000000..dcf4445f --- /dev/null +++ b/resources/ts/modules/route.ts @@ -0,0 +1,82 @@ +function flattenProperties( + obj: Record<PropertyKey, unknown>, + parent: string | null = null, + res: Record<PropertyKey, unknown> = {} +): Record<PropertyKey, unknown> { + for (const key of Object.keys(obj)) { + const propName = parent ? parent + "." + key : key; + if (obj[key] instanceof Object) { + flattenProperties( + obj[key] as Record<PropertyKey, unknown>, + propName, + res + ); + } else { + res[propName] = obj[key]; + } + } + return res; +} + +const route = function route( + routeName: string, + parameters: Record< + string, + string | number | null | undefined | Array<string | number> + > = {}, + keepActualQueries = false, + keepActualHashes = false +): string { + const routes = flattenProperties(globalThis.__SYSTEM._routes); + const routeUrl = + Object.prototype.hasOwnProperty.call(routes, routeName) // NOSONAR - Safari 15 does not support Object.hasOwn() + ? (routes[routeName] as string) + : null; + + // * Return null if route url could not be found + if (!routeUrl) { + throw new Error(`route '${routeName}' not found`); + } + + const queryParameters: Record<string, number | string> = {}, + url = new URL(globalThis.location.origin), + searchParams = new URL(String(globalThis.location)).searchParams, + hash = globalThis.location.hash; + let pathname = routeUrl.replace(origin, ""); + + // * Replace parameters in path name. + for (const paramName in parameters) { + const paramValue = String(parameters[paramName]); + if (pathname.includes(paramName)) { + // * Replace pathname part with parameter + pathname = pathname.replace(paramName, paramValue); + } else { + // * push parameter to be in queries + queryParameters[paramName] = paramValue; + } + } + url.pathname = pathname; + + // * Build query + if (keepActualQueries) { + // * Push actual queries + for (const param of searchParams) { + url.searchParams.set(param[0], param[1]); + } + } + // * Push request queries + for (const paramName in queryParameters) { + url.searchParams.set( + paramName, + String(queryParameters[paramName]) + ); + } + + if (keepActualHashes) { + url.hash = hash; + } + + return String(url); +}; + +export default route; diff --git a/resources/ts/modules/strings.ts b/resources/ts/modules/strings.ts new file mode 100644 index 00000000..46e0644d --- /dev/null +++ b/resources/ts/modules/strings.ts @@ -0,0 +1,50 @@ +export function titleCase(value: string): string { + return value + .toLowerCase() + .split(" ") + .map(word => word.charAt(0).toUpperCase() + word.slice(1)) + .join(" "); +} + +export function kebabCase(value: string): string { + return value + .trim() + .toLowerCase() + .replaceAll(/[^a-zA-Z0-9]/g, " ") + .split(/\s+/) + .filter(Boolean) + .join("-"); +} + +export function snakeCase(value: string): string { + return value + .trim() + .toLowerCase() + .replaceAll(/[^a-zA-Z0-9]/g, " ") + .split(/\s+/) + .filter(Boolean) + .join("_"); +} + +export function camelCase(value: string): string { + return value + .trim() + .toLowerCase() + .replaceAll(/[^a-zA-Z0-9]/g, " ") + .split(/\s+/) + .filter(Boolean) + .map((word, index) => index === 0 ? word : word.charAt(0).toUpperCase() + word.slice(1)) + .join(""); +} + +export function pascalCase(value: string): string { + if (!value) return ""; + return value + .trim() + .toLowerCase() + .replaceAll(/[^a-zA-Z0-9]/g, " ") + .split(/\s+/) + .filter(Boolean) + .map(word => word.charAt(0).toUpperCase() + word.slice(1)) + .join(""); +} diff --git a/resources/ts/modules/sweetalert-confirm.ts b/resources/ts/modules/sweetalert-confirm.ts new file mode 100644 index 00000000..7b260cd6 --- /dev/null +++ b/resources/ts/modules/sweetalert-confirm.ts @@ -0,0 +1,95 @@ +// SweetAlert +import type { SweetAlertOptions, SweetAlertResult } from "sweetalert2"; +import Swal from "sweetalert2"; + +import { trans } from "./trans"; + +function confirm( + title: string, + text: string, + self: object, + after: (response: SweetAlertResult<unknown>) => void = () => void 0, + options: SweetAlertOptions = {} +) { + const dialogText = text ?? ""; + if (!self) { + throw new Error("self is needed to set \"this\" on callback"); + } + if (!after) { + throw new Error("callback is needed when using confirm"); + } + Swal.fire({ + title: title, + text: dialogText, + color: getComputedStyle(document.body).getPropertyValue("--bs-body-color"), + icon: "warning", + showCancelButton: true, + confirmButtonText: + options.confirmButtonText ?? + trans("Yes"), + cancelButtonText: + options.cancelButtonText ?? + trans("Cancel"), + reverseButtons: true, + // * Bootstrap Styling + customClass: { + confirmButton: "btn btn-danger mx-1", + cancelButton: "btn btn-primary mx-1", + }, + buttonsStyling: false, + background: getComputedStyle(document.body).getPropertyValue("--bs-body-bg"), + ...options, + }).then((result) => { + if (result.isConfirmed) { + if (after) { + after.apply(self, [result]); + } + } else if ( + /* Read more about handling dismissals below */ + result.dismiss === Swal.DismissReason.cancel + ) { + Swal.fire({ + title: trans("The operation was not performed"), + color: getComputedStyle(document.body).getPropertyValue("--bs-body-color"), + confirmButtonText: trans("OK"), + // * Bootstrap Styling + customClass: {confirmButton: "btn btn-primary",}, + buttonsStyling: false, + background: getComputedStyle(document.body).getPropertyValue("--bs-body-bg"), + }); + } + }); + return false; +} + +function alert( + title: string, + text = "", + self: HTMLElement | null = null, + after: ((response: SweetAlertResult<unknown>) => void) | null = null, + options: SweetAlertOptions = {} +) { + const icon = options.icon ?? "info"; + Swal.fire({ + title: title, + text: text, + color: getComputedStyle(document.body).getPropertyValue("--bs-body-color"), + icon: icon, + // * Bootstrap Styling + customClass: {confirmButton: "btn btn-lg btn-primary",}, + buttonsStyling: false, + background: getComputedStyle(document.body).getPropertyValue("--bs-body-bg"), + }).then((result) => { + if (after) { + if (self) { + after.apply(self, [result]); + } else { + after(result); + } + } + }); + return false; +} + +export { alert, confirm }; + diff --git a/resources/ts/modules/sweetalert.ts b/resources/ts/modules/sweetalert.ts new file mode 100644 index 00000000..720c113f --- /dev/null +++ b/resources/ts/modules/sweetalert.ts @@ -0,0 +1,165 @@ +import type { SweetAlertResult } from "sweetalert2"; + +import { confirm } from "./sweetalert-confirm"; +import { trans } from "./trans"; + +function resolveTargetForm(target: EventTarget | null, errorMessage: string): HTMLFormElement { + if (!target || !(target instanceof HTMLFormElement)) { + throw new Error(errorMessage); + } + + return target; +} + +function resolveTargetElement(target: EventTarget | null): HTMLElement { + if (!target || !(target instanceof HTMLElement)) { + throw new Error("confirmJS can only be executed on a html element"); + } + + return target; +} + +function openConfirmDialog( + title: string, + text: string, + target: HTMLElement, + icon: "warning" | "error" | "info" = "warning" +): Promise<boolean> { + return new Promise((resolve) => { + confirm( + title, + text, + target, + (response: SweetAlertResult<unknown>) => { + resolve(response.isConfirmed); + }, + { icon } + ); + }); +} + +document.addEventListener("DOMContentLoaded", () => { + let elements = document.getElementsByClassName("confirmDeleteJSWithAssociated"); + for (const element of elements) { + element.addEventListener("submit", function (e) { + e.preventDefault(); + const el = resolveTargetForm(e.target, "confirmDoneJS can only be executed on an exising form"); + confirm( + trans("Confirm"), + trans("Do you really want to delete this item?"), + el, + function () { + confirm( + trans("Warning"), + trans("Deleting this item will also delete all associated items. You will not be able to undo this action. Do you really want to continue?"), + el, + function () { + el.submit(); + }, + { + icon: "warning", + reverseButtons: false, + background: getComputedStyle(document.body).getPropertyValue("--bs-body-bg"), + customClass: { + confirmButton: "btn btn-warning mx-1", + cancelButton: "btn btn-primary mx-1", + }, + } + ); + }, + { icon: "error" } + ); + return false; + }); + } + elements = document.getElementsByClassName("confirmDeleteJS"); + for (const element of elements) { + element.addEventListener("submit", function (e) { + e.preventDefault(); + const el = resolveTargetForm(e.target, "confirmDoneJS can only be executed on an exising form"); + confirm( + trans("Confirm"), + trans("Do you really want to delete this item?"), + el, + function () { + el.submit(); + }, + { icon: "error" } + ); + return false; + }); + } + elements = document.getElementsByClassName("confirmCancelJS"); + for (const element of elements) { + element.addEventListener("submit", function (e) { + e.preventDefault(); + const el = resolveTargetForm(e.target, "confirmCancelJS can only be executed on an exising form"); + confirm( + trans("Confirm"), + trans("Do you really want to cancel this item?"), + el, + function () { + el.submit(); + }, + { icon: "error" } + ); + return false; + }); + } + elements = document.getElementsByClassName("confirmDoneJS"); + for (const element of elements) { + element.addEventListener("submit", function (e) { + e.preventDefault(); + const el = resolveTargetForm(e.target, "confirmDoneJS can only be executed on an exising form"); + confirm( + trans("Confirm"), + trans("Do you really want to mark this item as processed?"), + el, + function () { + el.submit(); + }, + { icon: "info" } + ); + return false; + }); + } + elements = document.getElementsByClassName("confirmSubmitJS"); + for (const element of elements) { + element.addEventListener("submit", function (e) { + e.preventDefault(); + const el = resolveTargetForm(e.target, "confirmSubmitJS can only be executed on an exising form"); + confirm( + trans("Confirm"), + trans("Do you want to save this item as is?"), + el, + function () { + el.submit(); + }, + { icon: "warning" } + ); + return false; + }); + } + elements = document.getElementsByClassName("confirmJS"); + for (const element of elements) { + element.addEventListener( + "click", + async function (e) { + if (element.getAttribute("confirmJS")) { + return; + } + + e.preventDefault(); + const el = resolveTargetElement(e.target); + const confirmed = await openConfirmDialog(trans("Confirm"), trans("Are you sure?"), el, "warning"); + + if (confirmed) { + element.setAttribute("confirmJS", "true"); + el.click(); + element.removeAttribute("confirmJS"); + } + }, + false + ); + } +}); diff --git a/resources/ts/modules/trans.ts b/resources/ts/modules/trans.ts new file mode 100644 index 00000000..1419c7f0 --- /dev/null +++ b/resources/ts/modules/trans.ts @@ -0,0 +1,70 @@ +function locale() { + return {locale: globalThis.__SYSTEM._locale,}; +} +/** + * Translate the given key. + */ +function __(key: string, replace: Record<PropertyKey, string | number> = {}): string { + let translation: string, + translationNotFound = true; + + try { + translation = key + .split(".") + .reduce( + (t, i) => t[i as never] ?? null, + globalThis.__SYSTEM._translations.php + ) as string; + if (translation) { + translationNotFound = false; + } + } catch { + translation = key; + } + + if (translationNotFound) { + translation = (globalThis.__SYSTEM._translations.json[key as never] ?? key) as string; + } + const vars = translation.match(/:\w+/g); + if (vars) { + for (const match of vars) { + try { + translation = translation.replaceAll( + match, + String(replace[match.substring(1)] ?? match) + ); + } catch (e) { + console.error("String replace failed ", e); + } + } + } + return translation; +} + +function trans(key: string, replace: Record<PropertyKey, string | number> = {}): string{ + return __(key, replace); +} + +/** + * Translate a pluralized key based on count. + */ +function trans_choice(key: string, count: number, replace: Record<PropertyKey, string | number> = {}): string { + const translation = __(key, { ...replace, count, }); + const segments = translation.split("|"); + + if (segments.length <= 1) { + return translation; + } + + if (count <= 1) { + return __(segments[0], { ...replace, count, }); + } + + return __(segments.at(-1) ?? translation, { ...replace, count, }); +} + + +export { + __, locale, trans, + trans_choice +}; diff --git a/resources/ts/modules/uniqueid.ts b/resources/ts/modules/uniqueid.ts new file mode 100644 index 00000000..1fde76ca --- /dev/null +++ b/resources/ts/modules/uniqueid.ts @@ -0,0 +1,5 @@ +export function uniqueId() { + const timestamp = Date.now().toString(36); + const randomPart = Math.random().toString(36).substring(2, 9); + return `${timestamp}${randomPart}`; +} diff --git a/resources/ts/modules/vite-asset.ts b/resources/ts/modules/vite-asset.ts new file mode 100644 index 00000000..7d63cb8a --- /dev/null +++ b/resources/ts/modules/vite-asset.ts @@ -0,0 +1,11 @@ +function viteAsset(path: string) { + const assetPath = globalThis.__SYSTEM._asset[path]; + + if (assetPath !== "string") { + throw new TypeError(`Missing asset path '${path}'`); + } + + return assetPath; +} + +export default viteAsset; diff --git a/resources/ts/modules/zod.ts b/resources/ts/modules/zod.ts new file mode 100644 index 00000000..bfc6f005 --- /dev/null +++ b/resources/ts/modules/zod.ts @@ -0,0 +1,5 @@ +import * as z from "zod/v4"; // On importe tout directement dans 'z' + +z.config({ jitless: true }); + +export default z; diff --git a/resources/ts/types/shims-vue.d.ts b/resources/ts/types/shims-vue.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/resources/ts/types/vue-select/index.d.ts b/resources/ts/types/vue-select/index.d.ts new file mode 100644 index 00000000..52689d1f --- /dev/null +++ b/resources/ts/types/vue-select/index.d.ts @@ -0,0 +1,5 @@ +declare module "vue-select" { + export class vSelect {} + + export default vSelect; +} diff --git a/resources/ts/utilities/sass-safelist.ts b/resources/ts/utilities/sass-safelist.ts new file mode 100644 index 00000000..31938deb --- /dev/null +++ b/resources/ts/utilities/sass-safelist.ts @@ -0,0 +1,14 @@ +import type { UserDefinedSafelist } from "purgecss"; + +const sassSafelist: UserDefinedSafelist = [ + // Bootstrap + /^cropper-/, /^offcanvas-/, /^tooltip/, /^bs-tooltip/, /^data-popper/, /.*\[data-popper-placement].*/, + /^bs-popover/, /^popover/, /^modal-/, + // Vue + /-(leave|enter|appear)(-(to|from|active))?$/, + /^(?!(.*?:)cursor-move).+-move$/, + /^router-link(-exact)?-active$/, /data-v-.*/, + // Swiper + /^swiper-.*/ +]; +export { sassSafelist }; diff --git a/resources/ts/vite-env.d.ts b/resources/ts/vite-env.d.ts new file mode 100644 index 00000000..b4bddf52 --- /dev/null +++ b/resources/ts/vite-env.d.ts @@ -0,0 +1,9 @@ +/// <reference types="vite/client" /> + +interface ImportMetaEnv { + readonly VITE_SENTRY_TRACES_SAMPLE_RATE: string | undefined; +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +} diff --git a/resources/views/bo/auth/login.blade.php b/resources/views/bo/auth/login.blade.php new file mode 100644 index 00000000..af299b6f --- /dev/null +++ b/resources/views/bo/auth/login.blade.php @@ -0,0 +1,79 @@ +@extends('fo.layouts.layout') + +@section('title', __('Login')) +@section('description', __('Login') . 'Backoffice') + +@section('content') + <main class="container"> + <div class="row justify-content-center align-items-center py-5"> + <h1 class="my-5 text-center">{{ __('Login') }} Backoffice</h1> + <form class="col-md-8 col-xl-4 mx-auto" action="{{ route('bo.auth.login.post') }}" method="POST"> + @csrf + @if ($errors->any()) + <div> + <ul class="list-group"> + @foreach ($errors->all() as $error) + <li class="list-group-item text-red border-0 bg-transparent text-center">{{ $error }}</li> + @endforeach + </ul> + </div> + @endif + + {{-- LOGIN --}} + <div class="row justify-content-center mb-3"> + + <div class="col"> + <div class="form-floating"> + <input class="form-control @error('email') is-invalid @enderror" id="email" name="email" type="email" + value="{{ old('email') }}" placeholder="{{ __('Email Address') }}" required autocomplete="email" autofocus> + <label for="email">{{ __('Email Address') }}</label> + </div> + + @error('email') + <span class="invalid-feedback" role="alert"> + <strong>{{ $message }}</strong> + </span> + @enderror + </div> + </div> + + {{-- PASSWORD --}} + <div class="row justify-content-center mb-3"> + + <div class="col"> + <div class="form-floating"> + <input class="form-control @error('password') is-invalid @enderror" id="password" name="password" type="password" + autocomplete="current-password" placeholder="{{ __('Password') }}" required> + <label for="password">{{ __('Password') }}</label> + </div> + + @error('password') + <span class="invalid-feedback" role="alert"> + <strong>{{ $message }}</strong> + </span> + @enderror + </div> + </div> + + {{-- REMEMBER ME --}} + <div class="row justify-content-center mb-3"> + <div class="col"> + <div class="form-check"> + <input class="form-check-input" id="remember" name="remember" type="checkbox" {{ old('remember') ? 'checked' : '' }}> + + <label class="form-check-label" for="remember"> + {{ __('Remember Me') }} + </label> + </div> + </div> + </div> + <div class="row"> + <div class="text-center"> + <button class="btn btn-lg btn-primary rounded-4 my-3">{{ __('Login') }}</button> + </div> + </div> + + </form> + </div> + </main> +@endsection diff --git a/resources/views/bo/content/manage.blade.php b/resources/views/bo/content/manage.blade.php deleted file mode 100644 index d4d81bcb..00000000 --- a/resources/views/bo/content/manage.blade.php +++ /dev/null @@ -1,80 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') -<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2">Contenu {{$content->key}}</h1> - @if (session('success')) - <span class="float-right text-success">{{ session('success') }}</span> - @endif -</div> -<div class="container"> - <form action="{{route('bo.content', $content->key)}}" method="POST" enctype="multipart/form-data"> - @method('PUT') - @csrf - @if ($errors->any()) - <div class="alert alert-danger"> - <ul> - @foreach ($errors->all() as $error) - <li>{{ $error }}</li> - @endforeach - </ul> - </div> - @endif - <div class="form-group"> - <label for="banner">Bannière <small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('theme.content_banner_maxwidth') }} px par {{ Config::get('theme.content_banner_maxheight') }} px</small></label></br> - <input type="file" id="banner" name="banner" accept="image/png, image/jpeg"> - @if ($content->banner !== null) - <br/> - <br/> - <img src="/storage/images/content/{{$content->banner}}" alt="{{$content->banner}}" style="max-height: 100px;"> - @endif - </div> - <div class="form-group"> - <label for="title">Titre</label> - <input type="text" id="title" name="title" class="form-control" placeholder="Titre" value="{{$content->title}}"> - </div> - <div class="form-group"> - <label for="chapeau">Chapeau</label> - <textarea class="form-control" id="chapeau" name="chapeau" placeholder="Chapeau">{{$content->chapeau}}</textarea> - </div> - <div class="form-group"> - <label for="value">Contenu</label> - <textarea class="form-control" id="value" name="value" placeholder="Contenu *">{{$content->value}}</textarea> - </div> - <div class="text-center"> - <input type="submit" class="btn btn-success" value="Enregistrer"> - </div> - </form> -</div> -@endsection - -@section('scripts') - <script type="text/javascript"> - var editorConfig = { - removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"], - toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'blockQuote', 'insertTable', '|', 'undo', 'redo' ], - heading: { - options: [ - { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' }, - { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' }, - { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }, - { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' }, - { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' } - ] - }, - table: { - contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ] - } - }; - ClassicEditor - .create( document.querySelector( '#chapeau' ), editorConfig ) - .catch( error => { - console.error( error ); - } ); - ClassicEditor - .create( document.querySelector( '#value' ), editorConfig ) - .catch( error => { - console.error( error ); - } ); - </script> -@endsection diff --git a/resources/views/bo/creneaux/settings.blade.php b/resources/views/bo/creneaux/settings.blade.php deleted file mode 100644 index 59dd268f..00000000 --- a/resources/views/bo/creneaux/settings.blade.php +++ /dev/null @@ -1,144 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') -<form action="{{route('bo.creneaux.settings.update',$magasin->id)}}" method="POST" enctype="multipart/form-data"> - @csrf - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2"><a href="{{route('bo.magasins.edit',$magasin->id)}}" class="h2 text-decoration-none"><</a> Créneaux - {{$magasin->name}} <small class="text-muted">Règlages</small></h1> - @if (session('success')) - <span class="float-right text-success">{{ session('success') }}</span> - @endif - <div class="btn-toolbar mb-2 mb-md-0"> - <button type="submit" class="btn btn-sm btn-primary">Enregistrer</button> - </div> - </div> - @if ($errors->any()) - <div class="alert alert-danger"> - <ul> - @foreach ($errors->all() as $error) - <li>{{ $error }}</li> - @endforeach - </ul> - </div> - @endif - <div class=""> - <div class="row"> - <div class="form-group col"> - </div> - <div class="form-group col"> - Lundi - </div> - <div class="form-group col"> - Mardi - </div> - <div class="form-group col"> - Mercredi - </div> - <div class="form-group col"> - Jeudi - </div> - <div class="form-group col"> - Vendredi - </div> - <div class="form-group col"> - Samedi - </div> - <div class="form-group col"> - Dimanche - </div> - </div> - <div class="row"> - <div class="form-group col"> - Matinée Début - </div> - @foreach ($timeslotSettings as $zeDay) - <div class="form-group col"> - <input type="time" id="morning_start_time_{{$zeDay->day_index}}" name="plage[{{$zeDay->day_index}}][morning_start]" class="form-control" value="{{ old('plage['.$zeDay->day_index.'][morning_start]', $zeDay->morning_start ?? '') }}"> - </div> - @endforeach - </div> - <div class="row"> - <div class="form-group col"> - Matinée Fin - </div> - @foreach ($timeslotSettings as $zeDay) - <div class="form-group col"> - <input type="time" id="morning_end_time_{{$zeDay->day_index}}" name="plage[{{$zeDay->day_index}}][morning_end]" class="form-control" value="{{ old('plage['.$zeDay->day_index.'][morning_end]', $zeDay->morning_end ?? '') }}"> - </div> - @endforeach - </div> - <div class="row"> - <div class="form-group col"> - Après-midi Début - </div> - @foreach ($timeslotSettings as $zeDay) - <div class="form-group col"> - <input type="time" id="afternoon_start_time_{{$zeDay->day_index}}" name="plage[{{$zeDay->day_index}}][afternoon_start]" class="form-control" value="{{ old('plage['.$zeDay->day_index.'][afternoon_start]', $zeDay->afternoon_start ?? '') }}"> - </div> - @endforeach - </div> - <div class="row"> - <div class="form-group col"> - Après-midi Fin - </div> - @foreach ($timeslotSettings as $zeDay) - <div class="form-group col"> - <input type="time" id="afternoon_end_time_{{$zeDay->day_index}}" name="plage[{{$zeDay->day_index}}][afternoon_end]" class="form-control" value="{{ old('plage['.$zeDay->day_index.'][afternoon_end]', $zeDay->afternoon_end ?? '') }}"> - </div> - @endforeach - </div> - <div class="row"> - <div class="form-group col"> - Durée d'un crénaux - </div> - @foreach ($timeslotSettings as $zeDay) - <div class="form-group col"> - <input type="time" id="interval_{{$zeDay->day_index}}" name="plage[{{$zeDay->day_index}}][interval]" class="form-control" value="{{ old('plage['.$zeDay->day_index.'][interval]', $zeDay->interval ?? '') }}"> - </div> - @endforeach - </div> - <div class="row"> - <div class="form-group col"> - Nb de réservations maximum par crénau - </div> - @foreach ($timeslotSettings as $zeDay) - <div class="form-group col"> - <input type="number" id="max_orders_per_interval_{{$zeDay->day_index}}" name="plage[{{$zeDay->day_index}}][max_orders_per_interval]" class="form-control" value="{{ old('plage['.$zeDay->day_index.'][max_orders_per_interval]', $zeDay->max_orders_per_interval ?? '') }}"> - </div> - @endforeach - </div> - <div class="row"> - <div class="form-group col"> - Delai de préparation de commande - <small class="text-muted">(durée en heures:minutes, exemple : 02:00 pour 2 heures)</small> - </div> - @foreach ($timeslotSettings as $zeDay) - <div class="form-group col"> - <input type="text" pattern="\d*:\d{2}" placeholder="--:--" id="min_order_preparation_{{$zeDay->day_index}}" name="plage[{{$zeDay->day_index}}][min_order_preparation]" class="form-control" value="{{ old('plage['.$zeDay->day_index.'][min_order_preparation]', $zeDay->min_order_preparation ?? '') }}"> - </div> - @endforeach - </div> - {{--<div class="row"> - <div class="form-group col"> - Nombre de jours maximum avant la collecte - </div> - <div class="form-group col"> - <input type="number" id="plage_days" name="plage_days" class="form-control" value="{{ old('plage_days', $plage_days) }}"> - </div> - <div class="form-group col"></div> - <div class="form-group col"></div> - </div>--}} - <div class="row"> - <div class="form-group col"></div> - <div class="form-group col text-center"> - <button type="submit" class="btn btn-sm btn-primary">Enregistrer les règlages</button> - </div> - <div class="form-group col"></div> - </div> - </div> -</form> -@endsection - -@section('scripts') - -@endsection diff --git a/resources/views/bo/customer/info-card.blade.php b/resources/views/bo/customer/info-card.blade.php deleted file mode 100644 index dee03721..00000000 --- a/resources/views/bo/customer/info-card.blade.php +++ /dev/null @@ -1,12 +0,0 @@ -<div class="modal-container fancybox-content" style=""> - <div class="modal-title">{{$cust->apiData->firstname}} {{$cust->apiData->lastname}}</div> - <div class="modal-body"> - <p> - {{$cust->apiData->email}} {{$cust->apiData->phone}} - </p> - <p> - {{$cust->apiData->address}}<br/> - {{$cust->apiData->city}} {{$cust->apiData->postcode}} - </p> - </div> -</div> diff --git a/resources/views/bo/customer/info-popup.blade.php b/resources/views/bo/customer/info-popup.blade.php deleted file mode 100644 index c6f50d26..00000000 --- a/resources/views/bo/customer/info-popup.blade.php +++ /dev/null @@ -1,15 +0,0 @@ -<div class="modal-container fancybox-content" style=""> - <div class="modal-title">{{$cust->apiData->firstname}} {{$cust->apiData->lastname}}</div> - <div class="modal-body"> - <p> - {{$cust->apiData->email}} {{$cust->apiData->phone}} - </p> - <p> - {{$cust->apiData->address}} - {{$cust->apiData->city}} - {{$cust->apiData->postcode}} - </p> - </div> - <div class="modal-footer"><a href="javascript:;" class="btn btn-primary" data-fancybox-close="">{{__('Fermer')}}</a></div> - <button type="button" data-fancybox-close="" class="fancybox-button fancybox-close-small" title="Close"><svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 24 24"><path d="M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z"></path></svg></button> -</div> diff --git a/resources/views/bo/customer/tippy-card.blade.php b/resources/views/bo/customer/tippy-card.blade.php deleted file mode 100644 index 99ed9886..00000000 --- a/resources/views/bo/customer/tippy-card.blade.php +++ /dev/null @@ -1,10 +0,0 @@ - <div class="modal-title">{{$cust->apiData->firstname}} {{$cust->apiData->lastname}}</div> - <div class="modal-body"> - <p> - {{$cust->apiData->email}} {{$cust->apiData->phone}} - </p> - <p> - {{$cust->apiData->address}}<br/> - {{$cust->apiData->city}} {{$cust->apiData->postcode}} - </p> - </div> diff --git a/resources/views/bo/dashboard.blade.php b/resources/views/bo/dashboard.blade.php index de3360c4..49541ddf 100644 --- a/resources/views/bo/dashboard.blade.php +++ b/resources/views/bo/dashboard.blade.php @@ -1,200 +1,222 @@ -@extends('layouts.bo-layout') +@extends('bo.layouts.layout') +@section('title', __('Dashboard')) +@section('description', __('Site dashboard')) + +@section('breadcrumb', 'no') @section('content') - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2">Dashboard</h1> - </div> - <div class="container"> - <table class="table-responsive table-bordered table"> - <thead> - <tr class="table-secondary text-center"> - <th scope="col">{{ __('Nombre de salariés') }}</th> - <th scope="col">{{ __('Nombre de salariés inscrits') }}</th> - <th scope="col">{{ __('Taux d\'adhésion') }}</th> - </tr> - </thead> - <tbody> - <tr class="table-light text-bold fw-semibold text-center"> - <td>{{ number_format(App\Models\Salarie::count(), 0, ',', ' ') }}</td> - <td>{{ number_format(App\Models\Customers::has('salarie')->count(), 0, ',', ' ') }}</td> - <td>{{ number_format($adhesion, 2, ',', ' ') }} %</td> - </tr> - </tbody> - </table> - <br /> - {{-- DATES --}} - <form action="{{ route('bo.dashboard') }}"> - <div class="row"> - <div class="col"> - <label for="start">{{ __('Date de début') }}:</label> - <input class="form-control" type="date" id="start" name="start" value="{{ request()->start }}" required/> - @if (!empty($statsShop)) - <label for="previousStart">{{ __('Date de début de la période précédente') }}:</label> - <input class="form-control" type="date" id="previousStart" name="previousStart" value="{{ $prevDates->start->toDateString() }}" aria-label="disabled input" disabled> - @endif - <br> - </div> - <div class="col"> - <label for="end">{{ __('Date de fin') }}:</label> - <input class="form-control" type="date" id="end" name="end" value="{{ request()->end }}" required/> - @if (!empty($statsShop)) - <label for="previousEnd">{{ __('Date de fin de la période précédente') }}:</label> - <input class="form-control" type="date" id="previousEnd" name="previousEnd" value="{{ $prevDates->end->toDateString() }}" aria-label="disabled input" disabled> - @endif - </div> - <div class="col d-inline-flex align-items-center"> - <input class="btn btn-primary flex-end" type="submit" value="{{ __('Envoyer') }}" /> - </div> - </div> - </form> - {{-- CUSTOMERS DATA --}} - @if(!empty($statsCustomer)) - <table class="table table-responsive table-bordered table-hover"> - <thead> - <tr class="text-center bg-secondary bg-gradient bg-opacity-25"> - <th scope="col">{{-- keep empty --}}</th> - <th scope="col">{{ __('Période précédente') }}</th> - <th scope="col">{{ __('Période actuelle') }}</th> - <th scope="col">{{ __('Différence') }}</th> - </tr> - </thead> - <tbody> - @foreach ($statsCustomer as $k => $stat) - <tr class="text-center"> - <th @if ($stat['diff'] > 0) class="table-success" @else class="table-danger"@endif> - {{ App\Enums\StatsCustomerType::make($k)->label }} - </th> - <td @if ($stat['diff'] > 0) class="table-success" @else class="table-danger"@endif> - @switch($k) - @case(App\Enums\StatsCustomerType::membershipRate()->value) - {{ number_format($stat['previous'], 2, ",", " ") }} % - @break - @default - {{ $stat['previous'] }} - @endswitch - </td> - <td @if ($stat['diff'] > 0) class="table-success" @else class="table-danger"@endif> - @switch($k) - @case(App\Enums\StatsCustomerType::membershipRate()->value) - {{ number_format($stat['current'], 2, ",", " ") }} % - @break - @default - {{ $stat['current'] }} - @endswitch - </td> - <td @if ($stat['diff'] > 0) class="text-success table-success" @else class="text-danger table-danger" @endif> - <b> - @switch($k) - @case(App\Enums\StatsCustomerType::membershipRate()->value) - {{ number_format($stat['diff'], 2, ",", " ") }} % - @break - @default - {{ $stat['diff'] }} - @endswitch - </b> - </td> - </tr> - @endforeach - </tbody> - </table> - @endif - @if(!empty($statsShop)) - <table class="table table-responsive table-bordered table-hover"> - <thead> - <tr class="text-center bg-secondary bg-gradient bg-opacity-25"> - <th scope="col">{{-- keep empty --}}</th> - <th scope="col">{{ __('Période précédente') }}</th> - <th scope="col">{{ __('Période actuelle') }}</th> - <th scope="col">{{ __('Différence') }}</th> - </tr> - </thead> - <tbody> - @foreach ($statsShop as $k => $stat) - <tr class="text-center"> - @if ( - $k === App\Enums\StatsShopType::nbWaitingCmd()->value || - $k === App\Enums\StatsShopType::nbCanceledCmd()->value || - $k === App\Enums\StatsShopType::canceledRate()->value - ) - <th @if ($stat['diff'] < 0) class="table-success" @else class="table-danger"@endif>{{ App\Enums\StatsShopType::make($k)->label }}</th> - <td @if ($stat['diff'] < 0) class="table-success" @else class="table-danger"@endif> - @switch($k) - @case(App\Enums\StatsShopType::canceledRate()->value) - {{ number_format($stat['previous'], 2, ",", " ") }} % - @break - @default - {{ str_replace(".", ",", $stat['previous']) }} - @endswitch - </td> - <td @if ($stat['diff'] < 0) class="table-success" @else class="table-danger"@endif> - @switch($k) - @case(App\Enums\StatsShopType::canceledRate()->value) - {{ number_format($stat['current'], 2, ",", " ") }} % - @break - @default - {{ str_replace(".", ",", $stat['current']) }} - @endswitch - </td> - <td @if ($stat['diff'] < 0) class="text-success table-success" @else class="text-danger table-danger" @endif> - @switch($k) - @case(App\Enums\StatsShopType::canceledRate()->value) - <b>{{ number_format($stat['diff'], 2, ",", " ") }} %</b> - @break - @default - <b>{{ str_replace(".", ",", $stat['diff']) }}</b> - @endswitch - </td> - @else - <th @if ($stat['diff'] > 0) class="table-success" @else class="table-danger"@endif>{{ App\Enums\StatsShopType::make($k)->label }}</th> - <td @if ($stat['diff'] > 0) class="table-success" @else class="table-danger"@endif> - @switch($k) - @case(App\Enums\StatsShopType::caHt()->value) - @case(App\Enums\StatsShopType::caTtc()->value) - @case(App\Enums\StatsShopType::averageBasketHt()->value) - {{ number_format($stat['previous'], 2, ",", " ") }} € - @break - @case(App\Enums\StatsShopType::orderFrequency()->value) - {{ number_format($stat['previous'], 2, ",", " ") }} {{ __('jours') }} - @break - @default - {{ str_replace(".", ",", $stat['previous']) }} - @endswitch - </td> - <td @if ($stat['diff'] > 0) class="table-success" @else class="table-danger"@endif> - @switch($k) - @case(App\Enums\StatsShopType::caHt()->value) - @case(App\Enums\StatsShopType::caTtc()->value) - @case(App\Enums\StatsShopType::averageBasketHt()->value) - {{ number_format($stat['current'], 2, ",", " ") }} € - @break - @case(App\Enums\StatsShopType::orderFrequency()->value) - {{ number_format($stat['current'], 2, ",", " ") }} {{ __('jours') }} - @break - @default - {{ str_replace(".", ",", $stat['current']) }} - @endswitch - </td> - <td @if ($stat['diff'] > 0) class="text-success table-success" @else class="text-danger table-danger" @endif> - @switch($k) - @case(App\Enums\StatsShopType::caHt()->value) - @case(App\Enums\StatsShopType::caTtc()->value) - @case(App\Enums\StatsShopType::averageBasketHt()->value) - <b>{{ number_format($stat['diff'], 2, ",", " ") }} €</b> - @break - @case(App\Enums\StatsShopType::orderFrequency()->value) - <b>{{ number_format($stat['diff'], 2, ",", " ") }} {{ __('jours') }}</b> - @break - @default - <b>{{ str_replace(".", ",", $stat['diff']) }}</b> - @endswitch - </td> - @endif - </tr> - @endforeach - </tbody> - </table> - @else - <p>{{ __('Veuillez renseigner une période afin de visualiser les statistiques') }}</p> - @endif - </div> + <div class="d-flex justify-content-between flex-md-nowrap align-items-center border-bottom mb-3 flex-wrap pb-2 pt-3"> + <h1 class="h2">Dashboard</h1> + </div> + <div class="container"> + <table class="table-responsive table-bordered table"> + <thead> + <tr class="table-secondary text-center"> + <th scope="col">{{ __('Number of employees') }}</th> + <th scope="col">{{ __('Number of registered employees') }}</th> + <th scope="col">{{ __('Membership rate') }}</th> + </tr> + </thead> + <tbody> + <tr class="table-light text-bold fw-semibold text-center"> + <td>{{ $employeeCount }}</td> + <td>{{ $customersLinkedToEmployeeCount }}</td> + <td>{{ $adhesion }} %</td> + </tr> + </tbody> + </table> + <br /> + {{-- DATES --}} + <form action="{{ route('bo.dashboard') }}"> + <div class="row"> + <div class="col"> + <label for="start">{{ __('Start date') }}:</label> + <input class="form-control" id="start" name="start" type="date" value="{{ request()->start }}" required /> + @if (!empty($statsShop)) + <label for="previousStart">{{ __('Start date of the previous period') }}:</label> + <input class="form-control" id="previousStart" name="previousStart" type="date" + value="{{ $prevDates->start->toDateString() }}" aria-label="disabled input" disabled> + @endif + <br> + </div> + <div class="col"> + <label for="end">{{ __('End date') }}:</label> + <input class="form-control" id="end" name="end" type="date" value="{{ request()->end }}" required /> + @if (!empty($statsShop)) + <label for="previousEnd">{{ __('End date of the previous period') }}:</label> + <input class="form-control" id="previousEnd" name="previousEnd" type="date" value="{{ $prevDates->end->toDateString() }}" + aria-label="disabled input" disabled> + @endif + </div> + <div class="col d-inline-flex align-items-center"> + <input class="btn btn-primary flex-end" type="submit" value="{{ __('Send') }}" /> + </div> + </div> + </form> + {{-- CUSTOMERS DATA --}} + @if (!empty($statsCustomer)) + <table class="table-responsive table-bordered table-hover table"> + <thead> + <tr class="bg-secondary bg-gradient bg-opacity-25 text-center"> + <th scope="col">{{-- keep empty --}}</th> + <th scope="col">{{ __('Previous period') }}</th> + <th scope="col">{{ __('Current period') }}</th> + <th scope="col">{{ __('Difference') }}</th> + </tr> + </thead> + <tbody> + @foreach ($statsCustomer as $k => $stat) + <tr class="text-center"> + <th @if ($stat['diff'] > 0) class="table-success" @else class="table-danger" @endif> + {{ Domain\Enums\StatsCustomerType::make($k)->label() }} + </th> + <td @if ($stat['diff'] > 0) class="table-success" @else class="table-danger" @endif> + @switch($k) + @case(Domain\Enums\StatsCustomerType::membershipRate->value()) + {{ number_format($stat['previous'], 2, ',', ' ') }} % + @break + + @default + {{ $stat['previous'] }} + @endswitch + </td> + <td @if ($stat['diff'] > 0) class="table-success" @else class="table-danger" @endif> + @switch($k) + @case(Domain\Enums\StatsCustomerType::membershipRate->value()) + {{ number_format($stat['current'], 2, ',', ' ') }} % + @break + + @default + {{ $stat['current'] }} + @endswitch + </td> + <td @if ($stat['diff'] > 0) class="text-success table-success" @else class="text-danger table-danger" @endif> + <b> + @switch($k) + @case(Domain\Enums\StatsCustomerType::membershipRate->value()) + {{ number_format($stat['diff'], 2, ',', ' ') }} % + @break + + @default + {{ $stat['diff'] }} + @endswitch + </b> + </td> + </tr> + @endforeach + </tbody> + </table> + @endif + @if (!empty($statsShop)) + <table class="table-responsive table-bordered table-hover table"> + <thead> + <tr class="bg-secondary bg-gradient bg-opacity-25 text-center"> + <th scope="col">{{-- keep empty --}}</th> + <th scope="col">{{ __('Previous period') }}</th> + <th scope="col">{{ __('Current period') }}</th> + <th scope="col">{{ __('Difference') }}</th> + </tr> + </thead> + <tbody> + @foreach ($statsShop as $k => $stat) + <tr class="text-center"> + @if ( + $k === Domain\Enums\StatsShopType::nbWaitingCmd->value || + $k === Domain\Enums\StatsShopType::nbCanceledCmd->value || + $k === Domain\Enums\StatsShopType::canceledRate->value()) + <th @if ($stat['diff'] < 0) class="table-success" @else class="table-danger" @endif> + {{ Domain\Enums\StatsShopType::make($k)->label() }}</th> + <td @if ($stat['diff'] < 0) class="table-success" @else class="table-danger" @endif> + @switch($k) + @case(Domain\Enums\StatsShopType::canceledRate->value()) + {{ number_format($stat['previous'], 2, ',', ' ') }} % + @break + + @default + {{ str_replace('.', ',', $stat['previous']) }} + @endswitch + </td> + <td @if ($stat['diff'] < 0) class="table-success" @else class="table-danger" @endif> + @switch($k) + @case(Domain\Enums\StatsShopType::canceledRate->value()) + {{ number_format($stat['current'], 2, ',', ' ') }} % + @break + + @default + {{ str_replace('.', ',', $stat['current']) }} + @endswitch + </td> + <td @if ($stat['diff'] < 0) class="text-success table-success" @else class="text-danger table-danger" @endif> + @switch($k) + @case(Domain\Enums\StatsShopType::canceledRate->value()) + <b>{{ number_format($stat['diff'], 2, ',', ' ') }} %</b> + @break + + @default + <b>{{ str_replace('.', ',', $stat['diff']) }}</b> + @endswitch + </td> + @else + <th @if ($stat['diff'] > 0) class="table-success" @else class="table-danger" @endif> + {{ Domain\Enums\StatsShopType::make($k)->label() }}</th> + <td @if ($stat['diff'] > 0) class="table-success" @else class="table-danger" @endif> + @switch($k) + @case(Domain\Enums\StatsShopType::caHt->value()) + @case(Domain\Enums\StatsShopType::caTtc->value()) + + @case(Domain\Enums\StatsShopType::averageBasketHt->value()) + {{ number_format($stat['previous'], 2, ',', ' ') }} € + @break + + @case(Domain\Enums\StatsShopType::orderFrequency->value()) + {{ number_format($stat['previous'], 2, ',', ' ') }} {{ __('days') }} + @break + + @default + {{ str_replace('.', ',', $stat['previous']) }} + @endswitch + </td> + <td @if ($stat['diff'] > 0) class="table-success" @else class="table-danger" @endif> + @switch($k) + @case(Domain\Enums\StatsShopType::caHt->value()) + @case(Domain\Enums\StatsShopType::caTtc->value()) + + @case(Domain\Enums\StatsShopType::averageBasketHt->value()) + {{ number_format($stat['current'], 2, ',', ' ') }} € + @break + + @case(Domain\Enums\StatsShopType::orderFrequency->value()) + {{ number_format($stat['current'], 2, ',', ' ') }} {{ __('days') }} + @break + + @default + {{ str_replace('.', ',', $stat['current']) }} + @endswitch + </td> + <td @if ($stat['diff'] > 0) class="text-success table-success" @else class="text-danger table-danger" @endif> + @switch($k) + @case(Domain\Enums\StatsShopType::caHt->value()) + @case(Domain\Enums\StatsShopType::caTtc->value()) + + @case(Domain\Enums\StatsShopType::averageBasketHt->value()) + <b>{{ number_format($stat['diff'], 2, ',', ' ') }} €</b> + @break + + @case(Domain\Enums\StatsShopType::orderFrequency->value()) + <b>{{ number_format($stat['diff'], 2, ',', ' ') }} {{ __('days') }}</b> + @break + + @default + <b>{{ str_replace('.', ',', $stat['diff']) }}</b> + @endswitch + </td> + @endif + </tr> + @endforeach + </tbody> + </table> + @else + <p>{{ __('Please enter a period to view statistics') }}</p> + @endif + </div> @endsection diff --git a/resources/views/bo/discounts/create.blade.php b/resources/views/bo/discounts/create.blade.php new file mode 100644 index 00000000..7cc0a0b5 --- /dev/null +++ b/resources/views/bo/discounts/create.blade.php @@ -0,0 +1,33 @@ +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s', Str::ucfirst(__('creation')), Str::ucfirst(trans_choice('models.classes.discounts', 1)))) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <a class="btn btn-sm btn-primary" + href="{{ URL::previous() === request()->url() ? route('bo.discounts.index') : URL::previous() }}"><i + class="fa-solid fa-arrow-left"></i></a> + {{ Str::ucfirst(trans_choice('models.classes.discounts', 1)) }} {{ Str::ucfirst(__('crud.actions.create')) }} + </h1> + </div> + </div> + </div> + <div class="card-body"> + <form action="{{ route('bo.discounts.store') }}" method="POST" enctype='multipart/form-data'> + @csrf + @include('bo.discounts.form') + <div class="text-center"> + <button class="btn btn-primary" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> + </div> + </form> + </div> + </div> +@endsection diff --git a/resources/views/bo/discounts/display-discount-value.blade.php b/resources/views/bo/discounts/display-discount-value.blade.php new file mode 100644 index 00000000..fe57622f --- /dev/null +++ b/resources/views/bo/discounts/display-discount-value.blade.php @@ -0,0 +1,20 @@ +@php + /** @var \App\Models\Discount|\App\Dto\DiscountDto|null $discount */ + + if ($discount !== null && !($discount instanceof \App\Models\Discount) && !($discount instanceof \App\Dto\DiscountDto)) { + throw new \UnexpectedValueException('$discount shall be null, ' . \App\Models\Discount::class . ', or ' . \App\Dto\DiscountDto::class); + } +@endphp + +@if ($discount === null) + <span>{{ __('No Content') }}</span> +@else + <a class="btn btn-sm btn-primary" href="{{ route('bo.discounts.edit', $discount) }}" + title="{{ __('crud.helpers.edit_model', ['model' => trans_choice('models.classes.discounts', 1)]) }}"> + @if ($discount->value->isPercentage()) + <span>{{ $discount->value->getPercentageRate() }}%</span> + @else + <span>@money($discount->value->getAmount())</span> + @endif + </a> +@endif diff --git a/resources/views/bo/discounts/edit.blade.php b/resources/views/bo/discounts/edit.blade.php new file mode 100644 index 00000000..b8ac350f --- /dev/null +++ b/resources/views/bo/discounts/edit.blade.php @@ -0,0 +1,49 @@ +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s', Str::ucfirst(__('crud.actions.edit')), Str::ucfirst(trans_choice('models.classes.discounts', 1)))) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $discount) @endphp + +@section('content') + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <a class="btn btn-sm btn-primary" + href="{{ URL::previous() === request()->url() ? route('bo.discounts.index') : URL::previous() }}"><i + class="fa-solid fa-arrow-left"></i></a> + {{ Str::ucfirst(trans_choice('models.classes.discounts', 1)) }} {{ Str::ucfirst(__('crud.actions.edit')) }} + </h1> + </div> + <div class="col-3 text-end"> + <div class="btn-group"> + @can('delete', $discount) + <form class="d-inline confirmDeleteJS" action="{{ route('bo.discounts.destroy', $discount) }}" method="POST"> + @method('DELETE') + @csrf + <button class="btn btn-sm btn-danger" title="{{ __('crud.actions.delete') }}"><i class="fa-solid fa-trash"></i></button> + </form> + @endcan + </div> + </div> + </div> + </div> + <div class="card-body"> + <form action="{{ route('bo.discounts.update', $discount) }}" method="POST" enctype='multipart/form-data'> + @csrf + {{ method_field('PUT') }} + @include('bo.discounts.form', compact('discount')) + <div class="text-center"> + <span class="d-block mb-3"> + <span class="badge text-bg-info">{{ __('crud.helpers.required_fields_with_aster') }}</span> + </span> + <button class="btn btn-primary" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> + </div> + </form> + </div> + </div> +@endsection diff --git a/resources/views/bo/discounts/form.blade.php b/resources/views/bo/discounts/form.blade.php new file mode 100644 index 00000000..85df1b12 --- /dev/null +++ b/resources/views/bo/discounts/form.blade.php @@ -0,0 +1,180 @@ +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ __('Promotion configuration') }}</legend> + <div class="row mb-3"> + + {{-- DISCOUNT TYPE --}} + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="discount-type"> + <b>{{ Str::ucfirst(__('validation.custom.attributes.discount_type')) }}*</b> + </label> + <select class="form-select" id="discount-type" name="type" required> + <option value="" @if (!old('type', $discount->type ?? null)) selected @endif disabled> + {{ __('Select') . ' ' . __('validation.custom.attributes.discount_type') }} + </option> + @foreach ($discountTypes as $type) + <option value="{{ $type->value() }}" @selected(old('type', optional($discount ?? null)->type?->value() ?? null) == $type->value())> + {{ $type->label() }} + </option> + @endforeach + </select> + @include('bo.modules.input-error', ['inputName' => 'type']) + </div> + + {{-- DISCOUNT VALUE --}} + @php + $isPercent = old('type', optional($discount ?? null)->type?->value()) == \Domain\Enums\DiscountType::PERCENT->value; + $isAmount = old('type', optional($discount ?? null)->type?->value()) == \Domain\Enums\DiscountType::AMOUNT->value; + @endphp + + <div class="col-12 col-md-6 form-group"> + <span class="col-form-label"> + <b>{{ Str::ucfirst(__('validation.custom.attributes.discount_value')) }}*</b> + <span data-bs-toggle="tooltip" title="{{ __('The discount applies to the piece (sold unit).') }}"> + <i class="fas fa-question-circle"></i> + </span> + </span> + + {{-- INPUT MONTANT --}} + <div class="input-group {{ $isAmount ? '' : 'd-none' }} mb-3" id="wrapper-discount-amount"> + <input class="form-control" id="discount-value-amount" name="value" data-money-input type="number" + value="{{ $isAmount ? old('value', $discount->value?->value()->getAmount() ?? '') : '' }}" step="0.01" min="0" + aria-describedby="discount-value-help" {{ $isAmount ? 'required' : 'disabled' }}> + <span class="input-group-text">@currency()</span> + </div> + + {{-- INPUT POURCENT --}} + <div class="input-group {{ $isPercent ? '' : 'd-none' }} mb-3" id="wrapper-discount-percent"> + <input class="form-control" id="discount-value-percent" name="value" type="number" + value="{{ $isPercent ? old('value', $discount->value?->value() ?? '') : '' }}" step="1" min="0" + max="100" aria-describedby="discount-value-help" {{ $isPercent ? 'required' : 'disabled' }}> + <span class="input-group-text">%</span> + </div> + + @include('bo.modules.input-error', [ + 'inputName' => 'value', + 'helperId' => 'discount-value-help', + 'helper' => __('The discount applies to the piece (sold unit).'), + ]) + </div> + + </div> + + <div class="row mb-3"> + {{-- IS OLD PRICE DISPLAYED --}} + <div class="col-12 form-group pt-3"> + <input class="form-check-input mt-2" id="is-old-price-displayed" name="is_old_price_displayed" type="checkbox" value="1" + @checked(old('is_old_price_displayed', $discount->is_old_price_displayed ?? '0'))> + <label class="col-form-label form-check-label pt-1" for="is-old-price-displayed"> + <b>{{ Str::ucfirst(__('validation.custom.attributes.is_old_price_displayed')) }}</b> + </label><br> + @include('bo.modules.input-error', ['inputName' => 'is_old_price_displayed']) + </div> + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ __('Validity period') }}</legend> + <div class="row mb-3"> + + {{-- DATE START --}} + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="date-start"> + <b>{{ Str::ucfirst(__('validation.custom.attributes.date_start_show')) }}</b> + </label> + <input class="form-control" id="date-start" name="date_start" type="datetime-local" + value="{{ old('date_start', Date::toLocalInput($discount->date_start ?? '')) }}"> + @include('bo.modules.input-error', ['inputName' => 'date_start']) + </div> + + {{-- DATE END --}} + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="date-end"> + <b>{{ Str::ucfirst(__('validation.custom.attributes.date_end_show')) }}</b> + </label> + <input class="form-control" id="date-end" name="date_end" type="datetime-local" + value="{{ old('date_end', Date::toLocalInput($discount->date_end ?? '')) }}"> + @include('bo.modules.input-error', ['inputName' => 'date_end']) + </div> + + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend><span class="h4">{{ Str::ucfirst(__('validation.custom.attributes.associated_products')) }}</span></legend> + + <div class="row"> + <div class="col form-group"> + @php + $json = [ + 'name' => 'associated_products', + 'available' => $existingProds ?? [], + 'selected' => $selectedProds ?? [], + ]; + @endphp + + <div id="product-drag-and-drop" data-json='@json($json)'></div> + + @include('bo.modules.input-error', [ + 'inputName' => 'associated_products', + 'helperId' => 'associated-products-help', + 'helper' => __('Drag and drop products to associate them.'), + ]) + </div> + </div> + </fieldset> + </div> +</div> +<input id="client-timezone" name="client_timezone" type="hidden"> + +@push('scripts') + <script nonce="{{ Vite::cspNonce() }}"> + document.addEventListener('DOMContentLoaded', function() { + const tz = Intl.DateTimeFormat().resolvedOptions().timeZone; + document.getElementById('client-timezone').value = tz; + }); + </script> +@endpush + +@push('scripts') + <script nonce="{{ Vite::cspNonce() }}"> + document.addEventListener('DOMContentLoaded', function() { + const typeSelect = document.getElementById('discount-type'); + const amountWrapper = document.getElementById('wrapper-discount-amount'); + const percentWrapper = document.getElementById('wrapper-discount-percent'); + + function toggleDiscountInput() { + const isPercent = typeSelect.value === '{{ \Domain\Enums\DiscountType::PERCENT->value() }}'; + + if (isPercent) { + amountWrapper.classList.add('d-none'); + amountWrapper.querySelectorAll('input').forEach(i => i.disabled = true); + + percentWrapper.classList.remove('d-none'); + percentWrapper.querySelectorAll('input').forEach(i => i.disabled = false); + } else { + percentWrapper.classList.add('d-none'); + percentWrapper.querySelectorAll('input').forEach(i => i.disabled = true); + + amountWrapper.classList.remove('d-none'); + amountWrapper.querySelectorAll('input').forEach(i => i.disabled = false); + } + } + + typeSelect.addEventListener('change', toggleDiscountInput); + + if (typeSelect.value) { + toggleDiscountInput(); + } + }); + </script> +@endpush diff --git a/resources/views/bo/discounts/index-list.blade.php b/resources/views/bo/discounts/index-list.blade.php new file mode 100644 index 00000000..03bf7894 --- /dev/null +++ b/resources/views/bo/discounts/index-list.blade.php @@ -0,0 +1,71 @@ +<div class="table-responsive"> + <table class="fix-action table"> + <thead> + <tr class="visually-hidden"> + <th scope="col"></th> + </tr> + @php + $cols = [ + 'type' => Str::ucfirst(__('validation.custom.attributes.discount_type')), + 'value' => Str::ucfirst(__('validation.custom.attributes.discount_value')), + 'is_old_price_displayed' => Str::ucfirst(__('validation.custom.attributes.is_old_price_displayed')), + 'date_start' => Str::ucfirst(__('validation.custom.attributes.date_start_show')), + 'date_end' => Str::ucfirst(__('validation.custom.attributes.date_end_show')), + ]; + @endphp + @include('bo.modules.tableColSorter', ['cols' => $cols, 'mobileHide' => ['description']]) + </thead> + <tbody> + @forelse ($discounts as $discount) + <tr> + <td>{{ $discount->type->label() }}</td> + <td> + @include('bo.discounts.display-discount-value', ['discount' => $discount]) + </td> + <td>{{ $discount->is_old_price_displayed ? __('Yes') : __('No') }}</td> + <td>{{ Date::forHumans($discount->date_start) }}</td> + <td>{{ Date::forHumans($discount->date_end) }}</td> + <td> + <div class="btn-group"> + @can('viewAny', \App\Models\Product::class) + <a class="btn btn-sm btn-warning" + href="{{ route('bo.products.index', [ + 'search' => '', + 'brand' => '', + 'discount' => $discount->id, + 'tag' => '', + 'range' => '', + ]) }}" + title="{{ Str::ucfirst( + __('crud.helpers.view_associated', [ + 'model' => trans_choice('models.classes.products', \INF), + ]), + ) }}"><i + class="fa-solid fa-box"></i></a> + @endcan + @can('update', $discount) + <a class="btn btn-sm btn-primary" href="{{ route('bo.discounts.edit', $discount) }}" + title="{{ Str::ucfirst(__('crud.actions.update')) }}"><i class="fa-solid fa-pen"></i></a> + @endcan + @can('delete', $discount) + <form class="d-inline confirmDeleteJS" action="{{ route('bo.discounts.destroy', $discount) }}" method="POST"> + @method('DELETE') + @csrf + <button class="btn btn-sm btn-danger rounded-start-0" title="{{ Str::ucfirst(__('crud.actions.delete')) }}"><i + class="fa-solid fa-trash"></i></button> + </form> + @endcan + </div> + </td> + </tr> + + @empty + <tr> + <td class="text-center" colspan="20"> + <span class="h3">{{ __('crud.helpers.no_results') }}</span> + </td> + </tr> + @endforelse + </tbody> + </table> +</div> diff --git a/resources/views/bo/discounts/index.blade.php b/resources/views/bo/discounts/index.blade.php new file mode 100644 index 00000000..f59ad042 --- /dev/null +++ b/resources/views/bo/discounts/index.blade.php @@ -0,0 +1,47 @@ +@extends('bo.layouts.layout') + +@section('title', Str::ucfirst(trans_choice('models.classes.discounts', \INF))) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + {{ Str::ucfirst(trans_choice('models.classes.discounts', \INF)) }} {{ Str::ucfirst(__('crud.actions.list')) }} + </h1> + </div> + <div class="col-3"> + <div class="input-group justify-content-end"> + @can('create', \App\Models\Discount::class) + <a class="btn btn-primary" href="{{ route('bo.discounts.create') }}" + title="{{ Str::ucfirst(__('crud.actions.create')) }} {{ Str::ucfirst(trans_choice('models.classes.discounts', \INF)) }}"><i + class="fa-solid fa-square-plus"></i></a> + @endcan + </div> + </div> + </div> + </div> + <div class="card-body"> + @if ($discounts->count() > \Domain\Enums\Pagination\ItemsPerPaginationEnum::twelve->value()) + <div class="row justify-content-center"> + <div class="col-12 p-md-3 p-0"> + {{ $discounts->withQueryString()->onEachSide(1)->links() }} + </div> + </div> + @endif + <div class="row"> + <div class="col"> + @include('bo.discounts.index-list') + </div> + </div> + <div class="row justify-content-center"> + <div class="col-12 p-md-3 p-0"> + {{ $discounts->withQueryString()->onEachSide(1)->links() }} + </div> + </div> + </div> + </div> +@endsection diff --git a/resources/views/bo/faq/index.blade.php b/resources/views/bo/faq/index.blade.php deleted file mode 100644 index 048fabf6..00000000 --- a/resources/views/bo/faq/index.blade.php +++ /dev/null @@ -1,5 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') - <faq dbdatas='@json($faq)'></faq> -@endsection diff --git a/resources/views/bo/faqs/create.blade.php b/resources/views/bo/faqs/create.blade.php new file mode 100644 index 00000000..1e6de330 --- /dev/null +++ b/resources/views/bo/faqs/create.blade.php @@ -0,0 +1,31 @@ +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s', Str::ucfirst(__('creation')), __('models.classes.faqs'))) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <a class="btn btn-sm btn-primary" href="{{ route('bo.faqs.index') }}"><i class="fa-solid fa-arrow-left"></i></a> + {{ __('models.classes.faqs') }} {{ __('crud.actions.create') }} + </h1> + </div> + </div> + </div> + <div class="card-body"> + <form action="{{ route('bo.faqs.store') }}" method="POST" enctype='multipart/form-data'> + @csrf + @include('bo.faqs.form') + <div class="text-center"> + <button class="btn btn-primary" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> + </div> + </form> + </div> + </div> +@endsection diff --git a/resources/views/bo/faqs/edit.blade.php b/resources/views/bo/faqs/edit.blade.php new file mode 100644 index 00000000..f1f25a61 --- /dev/null +++ b/resources/views/bo/faqs/edit.blade.php @@ -0,0 +1,47 @@ +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s %s', Str::ucfirst(__('crud.actions.edit')), Str::ucfirst(trans_choice('models.classes.faqs', 1)), $faq)) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $faq) @endphp + +@section('content') + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <a class="btn btn-sm btn-primary" href="{{ route('bo.faqs.index') }}"><i class="fa-solid fa-arrow-left"></i></a> + {{ Str::ucfirst(trans_choice('models.classes.faqs', 1)) }} {{ Str::ucfirst(__('crud.actions.edit')) }} + </h1> + </div> + <div class="col-3 text-end"> + <div class="btn-group"> + @can('delete', $faq) + <form class="d-inline confirmDeleteJS" action="{{ route('bo.faqs.destroy', $faq) }}" method="POST"> + @method('DELETE') + @csrf + <button class="btn btn-sm btn-danger" title="{{ __('crud.actions.delete') }}"><i class="fa-solid fa-trash"></i></button> + </form> + @endcan + </div> + </div> + </div> + </div> + <div class="card-body"> + <form action="{{ route('bo.faqs.update', $faq) }}" method="POST" enctype='multipart/form-data'> + @csrf + {{ method_field('PUT') }} + @include('bo.faqs.form', compact('faq')) + <div class="text-center"> + <span class="d-block mb-3"> + <span class="badge text-bg-info">{{ __('crud.helpers.required_fields_with_aster') }}</span> + </span> + <button class="btn btn-primary" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> + </div> + </form> + </div> + </div> +@endsection diff --git a/resources/views/bo/faqs/form.blade.php b/resources/views/bo/faqs/form.blade.php new file mode 100644 index 00000000..14c8e4dc --- /dev/null +++ b/resources/views/bo/faqs/form.blade.php @@ -0,0 +1,65 @@ +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <div class="row mb-3"> + <!-- QUESTION --> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="faq-question"><b>{{ Str::ucfirst(__('validation.custom.attributes.question')) }}</b></label> + <div class="word-counter" data-json='@json(['for' => 'faq-question'])'></div> + <input class="form-control" id="faq-question" name="question" type="text" value="{{ old('question', $faq->question ?? '') }}" + aria-describedby="faq-question-help" placeholder="{{ Str::ucfirst(__('validation.custom.attributes.question')) }}" required> + @include('bo.modules.input-error', [ + 'inputName' => 'question', + 'helperId' => 'faq-question-help', + 'helper' => + __('Give your faq a title.') . + ' ' . + __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.attributes.question'), + 'inter' => __('validation.custom.of_the.female'), + 'model' => trans_choice('models.classes.faqs', 1), + ]), + 'min' => 4, + 'max' => 75, + ]), + ]) + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend><label class="h4" for="answer-text">{{ Str::ucfirst(__('validation.custom.attributes.answer')) }}</label></legend> + <div class="row"> + <div class="col form-group"> + @include('bo.modules.input-error', [ + 'inputName' => 'answer', + 'helper' => + __('The answer') . + ' ' . + __('validation.min.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.custom.attributes.answer'), + 'inter' => __('validation.custom.of_the.male'), + 'model' => trans_choice('models.classes.faqs', 1), + ]), + 'min' => 4, + ]), + ]) + @php + $editor = [ + 'id' => 'answer-text', + 'csrf' => csrf_token(), + 'name' => 'answer', + 'text' => old('answer', $faq->answer ?? '') ?? '', + ]; + @endphp + <div class="ck-editor" data-json='@json($editor)'></div> + </div> + </div> + </fieldset> + </div> +</div> diff --git a/resources/views/bo/faqs/index-list.blade.php b/resources/views/bo/faqs/index-list.blade.php new file mode 100644 index 00000000..7de825bc --- /dev/null +++ b/resources/views/bo/faqs/index-list.blade.php @@ -0,0 +1,53 @@ +<div class="table-responsive"> + <table class="fix-action table"> + <thead> + <tr class="visually-hidden"> + <th scope="col"></th> + </tr> + @php + $cols = [ + 'question' => Str::ucfirst(__('validation.custom.attributes.question')), + 'order' => Str::ucfirst(__('validation.custom.attributes.order')), + ]; + @endphp + @include('bo.modules.tableColSorter', ['cols' => $cols, 'mobileHide' => ['description']]) + </thead> + <tbody> + @forelse ($faqs as $faq) + <tr> + <td>{{ Str::limit($faq->question, 40) }}</td> + @include('bo.modules.change-order', [ + 'route' => 'bo.faqs.change-order', + 'model' => $faq, + 'first' => $loop->first, + 'last' => $loop->last, + 'isFirstPage' => $faqs->onFirstPage(), + 'isLastPage' => !$faqs->hasMorePages(), + ]) + <td> + <div class="btn-group"> + @can('update', $faq) + <a class="btn btn-sm btn-primary" href="{{ route('bo.faqs.edit', $faq) }}" + title="{{ Str::ucfirst(__('crud.actions.update')) }}"><i class="fa-solid fa-pen"></i></a> + @endcan + @can('delete', $faq) + <form class="d-inline confirmDeleteJS" action="{{ route('bo.faqs.destroy', $faq) }}" method="POST"> + @method('DELETE') + @csrf + <button class="btn btn-sm btn-danger rounded-start-0" title="{{ Str::ucfirst(__('crud.actions.delete')) }}"><i + class="fa-solid fa-trash"></i></button> + </form> + @endcan + </div> + </td> + </tr> + @empty + <tr> + <td class="text-center" colspan="20"> + <span class="h3">{{ __('crud.helpers.no_results') }}</span> + </td> + </tr> + @endforelse + </tbody> + </table> +</div> diff --git a/resources/views/bo/faqs/index.blade.php b/resources/views/bo/faqs/index.blade.php new file mode 100644 index 00000000..78b144b6 --- /dev/null +++ b/resources/views/bo/faqs/index.blade.php @@ -0,0 +1,45 @@ +@extends('bo.layouts.layout') + +@section('title', Str::ucfirst(trans_choice('models.classes.faqs', \INF))) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + {{ Str::ucfirst(trans_choice('models.classes.faqs', \INF)) }} {{ Str::ucfirst(__('crud.actions.list')) }} + </h1> + </div> + <div class="col-3"> + <div class="input-group justify-content-end"> + @can('create', \App\Models\Faq::class) + <a class="btn btn-primary" href="{{ route('bo.faqs.create') }}" + title="{{ Str::ucfirst(__('crud.actions.create')) }} {{ Str::ucfirst(trans_choice('models.classes.faqs', \INF)) }}"><i + class="fa-solid fa-square-plus"></i></a> + @endcan + </div> + </div> + </div> + </div> + <div class="card-body"> + <div class="row justify-content-center"> + <div class="col-12 p-md-3 p-0"> + {{ $faqs->withQueryString()->onEachSide(1)->links() }} + </div> + </div> + <div class="row"> + <div class="col"> + @include('bo.faqs.index-list') + </div> + </div> + <div class="row justify-content-center"> + <div class="col-12 p-md-3 p-0"> + {{ $faqs->withQueryString()->onEachSide(1)->links() }} + </div> + </div> + </div> + </div> +@endsection diff --git a/resources/views/bo/layouts/head.blade.php b/resources/views/bo/layouts/head.blade.php new file mode 100644 index 00000000..692ff316 --- /dev/null +++ b/resources/views/bo/layouts/head.blade.php @@ -0,0 +1,51 @@ +<head> + <!-- Title --> + <title>{{ config('app.name') }} - @yield('title') + + + + + + + + + @hasSection('canonical') + + @else + + @endif + + + @hasSection('metaIndex') + + @else + + @endif + + + + + + + + + + + + + + + + + + + @if (config('app.debug')) + + @endif + + + @vite(['resources/sass/bo/bo.scss']) + @stack('styles') + diff --git a/resources/views/bo/layouts/layout.blade.php b/resources/views/bo/layouts/layout.blade.php new file mode 100644 index 00000000..3372b49b --- /dev/null +++ b/resources/views/bo/layouts/layout.blade.php @@ -0,0 +1,30 @@ + + + +@include('bo.layouts.head') + + +
+ @include('bo.layouts.nav-top') +
+
+
+ @include('bo.layouts.nav-main') +
+
+
+ @include('bo.modules.breadcrumb.breadcrumb-body', $brParam ?? []) +
+
+ @include('bo.modules.flash-messages') + @yield('content') +
+
+
+ @include('fo.modules.script-routes') + @stack('scriptsConstants') + @vite(['resources/ts/bo/bo.ts']) + @stack('scripts') + + + diff --git a/resources/views/bo/layouts/nav-main.blade.php b/resources/views/bo/layouts/nav-main.blade.php new file mode 100644 index 00000000..a08b7312 --- /dev/null +++ b/resources/views/bo/layouts/nav-main.blade.php @@ -0,0 +1,261 @@ + diff --git a/resources/views/bo/layouts/nav-top.blade.php b/resources/views/bo/layouts/nav-top.blade.php new file mode 100644 index 00000000..715f1752 --- /dev/null +++ b/resources/views/bo/layouts/nav-top.blade.php @@ -0,0 +1,18 @@ + diff --git a/resources/views/bo/magasins/create.blade.php b/resources/views/bo/magasins/create.blade.php deleted file mode 100644 index e1cf8fc8..00000000 --- a/resources/views/bo/magasins/create.blade.php +++ /dev/null @@ -1,95 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') -
- @csrf -
-

< Magasin Création

-
-
-
- @if ($errors->any()) -
-
    - @foreach ($errors->all() as $error) -
  • {{ $error }}
  • - @endforeach -
-
- @endif -
- - -
-
- - -
-
-
- - -
-
- - -
-
-
- - -
-
-
- - -
-
- - -
-
-
-

Google Maps

-
-
- - -
-
- - -
-
- - -
-
-@endsection - -@section('scripts') - -@endsection diff --git a/resources/views/bo/magasins/edit.blade.php b/resources/views/bo/magasins/edit.blade.php deleted file mode 100644 index c426789d..00000000 --- a/resources/views/bo/magasins/edit.blade.php +++ /dev/null @@ -1,113 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') -
- @method('PUT') - @csrf -
-

- Magasin Modification

- @if (session('success')) - {{ session('success') }} - @endif -
-
-
- @if ($errors->any()) -
-
    - @foreach ($errors->all() as $error) -
  • {{ $error }}
  • - @endforeach -
-
- @endif -
-
- - -
- -
-
- - -
-
-
- - -
-
- - -
-
-
- - -
-
-
- - -
-
- - -
-
-
-

Google Maps

-
-
- - -
-
- - -
-
- - -
-
-
-
- -
-
-
-
- - @php - $exceptionType = collect(\App\Enums\ExceptionDayType::toLabels()) - ->map(function ($label, $key) { - return [ - 'label' => $label, - 'value' => \App\Enums\ExceptionDayType::toValues()[$key], - ]; - }) - ->values(); - @endphp - - -@endsection - -@section('scripts') -@endsection diff --git a/resources/views/bo/magasins/index.blade.php b/resources/views/bo/magasins/index.blade.php deleted file mode 100644 index e753add9..00000000 --- a/resources/views/bo/magasins/index.blade.php +++ /dev/null @@ -1,46 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') -
-

Points de retrait Liste

- - @if ($errors->any()) - @foreach($errors->all() as $error) - {{ $error }} - @endforeach - @endif - Ajouter -
- - - - - - - - - - @foreach ($magasins as $magasin) - - - - - - - - @endforeach - -
NomAdresseTéléphone
{{$magasin->name}}{{$magasin->address}}, {{$magasin->postcode}} {{$magasin->city}}{{$magasin->phone}} - Éditer - Editer Créneaux de collecte -
- @method('DELETE') - @csrf - -
- -
-@endsection - - diff --git a/resources/views/bo/magasins/info-card.blade.php b/resources/views/bo/magasins/info-card.blade.php deleted file mode 100644 index 737238fa..00000000 --- a/resources/views/bo/magasins/info-card.blade.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/resources/views/bo/magasins/info-popup.blade.php b/resources/views/bo/magasins/info-popup.blade.php deleted file mode 100644 index e7ced204..00000000 --- a/resources/views/bo/magasins/info-popup.blade.php +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/resources/views/bo/magasins/tippy-card.blade.php b/resources/views/bo/magasins/tippy-card.blade.php deleted file mode 100644 index b32bac87..00000000 --- a/resources/views/bo/magasins/tippy-card.blade.php +++ /dev/null @@ -1,13 +0,0 @@ - - diff --git a/resources/views/bo/modules/breadcrumb/breadcrumb-body.blade.php b/resources/views/bo/modules/breadcrumb/breadcrumb-body.blade.php new file mode 100644 index 00000000..534ba564 --- /dev/null +++ b/resources/views/bo/modules/breadcrumb/breadcrumb-body.blade.php @@ -0,0 +1,10 @@ +@hasSection('breadcrumb') + @if (Breadcrumbs::exists(app()->view->getSections()['breadcrumb'])) + {{ call_user_func_array( + 'Breadcrumbs::render', + array_merge([app()->view->getSections()['breadcrumb']], !empty($brParam) ? (is_array($brParam) ? $brParam : [$brParam]) : []), + ) }} + @endif +@elseif(Breadcrumbs::exists(request()->route()->getName())) + {{ Breadcrumbs::render(request()->route()->getName()) }} +@endif diff --git a/resources/views/bo/modules/change-model-order-select.blade.php b/resources/views/bo/modules/change-model-order-select.blade.php deleted file mode 100644 index fce70985..00000000 --- a/resources/views/bo/modules/change-model-order-select.blade.php +++ /dev/null @@ -1,23 +0,0 @@ - -
- {{ $value ?? '' }} - - -
- - diff --git a/resources/views/bo/modules/change-model-order.blade.php b/resources/views/bo/modules/change-model-order.blade.php deleted file mode 100644 index f0d6289f..00000000 --- a/resources/views/bo/modules/change-model-order.blade.php +++ /dev/null @@ -1,22 +0,0 @@ - - - diff --git a/resources/views/bo/modules/change-order.blade.php b/resources/views/bo/modules/change-order.blade.php new file mode 100644 index 00000000..4976f3e3 --- /dev/null +++ b/resources/views/bo/modules/change-order.blade.php @@ -0,0 +1,96 @@ +@php + /** @var string $route */ + /** @var \Illuminate\Database\Eloquent\Model $model */ + /** @var bool $first */ + /** @var bool $last */ + /** @var bool $isFirstPage */ + /** @var bool $isLastPage */ + + if (!isset($first) || !is_bool($first)) { + throw new \InvalidArgumentException('The $first variable must be set and must be a boolean.'); + } + + if (!isset($last) || !is_bool($last)) { + throw new \InvalidArgumentException('The $last variable must be set and must be a boolean.'); + } + + if (!isset($isFirstPage) || !is_bool($isFirstPage)) { + throw new \InvalidArgumentException('The $isFirstPage variable must be set and must be a boolean.'); + } + + if (!isset($isLastPage) || !is_bool($isLastPage)) { + throw new \InvalidArgumentException('The $isLastPage variable must be set and must be a boolean.'); + } + + // * Route vars + $routeName = request()->route()?->getName() ?? 'noroute'; + + // * Request vars + $currentSortCol = session()->get("{$routeName}.sort_col"); + $currentSortWay = session()->get("{$routeName}.sort_way"); + + $searchQuery = request()->input('search'); + + // * Vue vars + $noOrder = $noOrder ?? false; + $ignore = isset($ignore) && is_array($ignore) ? $ignore : []; + + // * Hide order column + $sortColIsOrder = $currentSortCol === 'order'; + $noOrder = $noOrder || (!$sortColIsOrder && $currentSortCol) || !empty($searchQuery); + View::share('noOrder', $noOrder); + + // * Reset button + $hasCustomSort = ($currentSortCol && $currentSortCol !== 'order') || ($currentSortCol === 'order' && $currentSortWay === 'desc'); + $showReset = !empty($searchQuery) || $hasCustomSort; + + $isFirst = $first && $isFirstPage; + $isLast = $last && $isLastPage; +@endphp +@if (!$noOrder) + +
+ #{{ $model->order }} + @if (isset($selectRoute)) + + @endif +
+
+
+ @csrf + @method('PATCH') + + @if (!$isFirst) + + @endif + @if (!$isLast) + + @endif +
+ +
+ +@endif diff --git a/resources/views/bo/modules/checker-mass-actions.blade.php b/resources/views/bo/modules/checker-mass-actions.blade.php new file mode 100644 index 00000000..14b9aa34 --- /dev/null +++ b/resources/views/bo/modules/checker-mass-actions.blade.php @@ -0,0 +1,60 @@ +@php + /** @var class-string<\Illuminate\Database\Eloquent\Model> $class */ + /** @var bool $publish */ + /** @var bool $unPublish */ + /** @var bool $star */ + + $authService = resolve(\Infrastructure\Adapters\Services\AppAdminAuthService::class); + $canTogglePublish = $authService->canWithUser('toggleStatus', $class); + $canToggleStar = $authService->canWithUser('toggleStar', $class); + + $togglePublish = $canTogglePublish && ($togglePublish ?? false); + $toggleStar = $canToggleStar && ($toggleStar ?? false); +@endphp +@if ($togglePublish || $toggleStar) +
+
+ +
+
+@endif diff --git a/resources/views/bo/modules/flash-messages.blade.php b/resources/views/bo/modules/flash-messages.blade.php new file mode 100644 index 00000000..7d93b396 --- /dev/null +++ b/resources/views/bo/modules/flash-messages.blade.php @@ -0,0 +1,41 @@ +@if (!request()->routeIs('bo.auth.login')) + @foreach (['info', 'success', 'error', 'warning'] as $type) + @if (Session::has($type)) + @php $alertClass = $type === 'error' ? 'danger' : $type; @endphp + + + @endif + @endforeach +@endif + +@if ($errors->any()) + +@endif diff --git a/resources/views/bo/modules/input-error.blade.php b/resources/views/bo/modules/input-error.blade.php new file mode 100644 index 00000000..5d564dc1 --- /dev/null +++ b/resources/views/bo/modules/input-error.blade.php @@ -0,0 +1,15 @@ +@php + $hasError = $errors->has($inputName) || $errors->has("{$inputName}.*"); + $errorMessages = array_merge( + $errors->get($inputName), + $errors->get("{$inputName}.*") + ); +@endphp +@if ($hasError) +
+ {{ implode(', ', $errorMessages) }} +
+@endif +@if (isset($helper)) + {{ $helper }} +@endif diff --git a/resources/views/bo/modules/pagination.blade.php b/resources/views/bo/modules/pagination.blade.php new file mode 100644 index 00000000..8def0391 --- /dev/null +++ b/resources/views/bo/modules/pagination.blade.php @@ -0,0 +1,112 @@ +@if ($paginator->items()) + + @push('styles') + + @endpush +@endif diff --git a/resources/views/bo/modules/search-bar-orders.blade.php b/resources/views/bo/modules/search-bar-orders.blade.php deleted file mode 100644 index e2c04474..00000000 --- a/resources/views/bo/modules/search-bar-orders.blade.php +++ /dev/null @@ -1,39 +0,0 @@ -@php - $iArgs = []; - if (request()->sort_col) { - $iArgs['sort_col'] = request()->sort_col; - } - - if (request()->search) { - $iArgs['search'] = request()->sort_way; - } -@endphp -
-
-
- - @if (request()->sort_col) - - @endif - @if (request()->sort_way) - - @endif - @if (request()->rangefilter) - - @endif - @if (request()->group) - - @endif - - - -
-
-
diff --git a/resources/views/bo/modules/search-bar.blade.php b/resources/views/bo/modules/search-bar.blade.php new file mode 100644 index 00000000..8b65d71d --- /dev/null +++ b/resources/views/bo/modules/search-bar.blade.php @@ -0,0 +1,53 @@ +
+
+
+
+ + + + + + + + @if (request()->input('sort_col')) + + @endif + @if (request()->input('sort_way')) + + @endif + @if (request()->input('rangefilter')) + + @endif + @if (request()->input('group')) + + @endif + + + + @push('scripts') + + @endpush +
+
+
+
diff --git a/resources/views/bo/modules/sorter.blade.php b/resources/views/bo/modules/sorter.blade.php deleted file mode 100644 index bcdad279..00000000 --- a/resources/views/bo/modules/sorter.blade.php +++ /dev/null @@ -1,6 +0,0 @@ -@if(!session($list.'.sort_way') or session($list.'.sort_col') !== $colname or (session($list.'.sort_way') === 'desc' and session($list.'.sort_col') === $colname)) - ↓  -@endif -@if(!session($list.'.sort_way') or session($list.'.sort_col') !== $colname or (session($list.'.sort_way') === 'asc' and session($list.'.sort_col') === $colname)) - ↑  -@endif diff --git a/resources/views/bo/modules/tableColSorter.blade.php b/resources/views/bo/modules/tableColSorter.blade.php new file mode 100644 index 00000000..ba916926 --- /dev/null +++ b/resources/views/bo/modules/tableColSorter.blade.php @@ -0,0 +1,94 @@ +@php + // * Route vars + $routeName = request()->route()?->getName() ?? 'noroute'; + + // * Default sort vars + $defaultSortCol = $defaultSortCol ?? 'order'; + $defaultSortWay = $defaultSortWay ?? 'asc'; + $defaultSortWayStr = $defaultSortWay instanceof \SortDirection + ? ($defaultSortWay === \SortDirection::Descending ? 'desc' : 'asc') + : (string) $defaultSortWay; + + // * Request vars + $currentSortCol = session()->get("{$routeName}.sort_col", $defaultSortCol); + $currentSortWay = session()->get("{$routeName}.sort_way", $defaultSortWayStr); + + $searchQuery = request()->input('search'); + + // * Vue vars + $noOrder = $noOrder ?? false; + $ignore = isset($ignore) && is_array($ignore) ? $ignore : []; + + // * Hide order column + $sortColIsOrder = $currentSortCol === 'order'; + $noOrder = $noOrder || (!$sortColIsOrder && $currentSortCol) || !empty($searchQuery); + View::share('noOrder', $noOrder); + + // * Reset button + $hasCustomSort = ($currentSortCol && $currentSortCol !== $defaultSortCol) || ($currentSortCol === $defaultSortCol && $currentSortWay !== $defaultSortWayStr); + $showReset = !empty($searchQuery) || $hasCustomSort; +@endphp + + + @foreach ($cols as $col => $colname) + @php + $iArgs = ['sort_col' => $col]; + if ($searchQuery) { + $iArgs['search'] = $searchQuery; + } + + $isCurrentCol = $currentSortCol === $col; + $mobileHiddenClass = + isset($mobileHide) && is_array($mobileHide) && in_array($col, $mobileHide) ? 'd-none d-md-table-cell text-center' : ''; + @endphp + + {{-- NO Sort for order column & ignored columns --}} + @if ($col === 'order' || in_array($col, $ignore)) + @if ($noOrder && $col === 'order') + @continue + @endif + + {{ $colname }} + + @continue + @endif + + {{-- Sortable Columns --}} + + + {{ $colname }} + + @if (!$isCurrentCol || $currentSortWay === 'desc') + + ↓ + + @endif + + @if (!$isCurrentCol || $currentSortWay === 'asc') + + ↑ + + @endif + + + @endforeach + + {{-- Buttons Col --}} + + @if ($showReset) + + + + @else + + + + @endif + + diff --git a/resources/views/bo/modules/toggle-star.blade.php b/resources/views/bo/modules/toggle-star.blade.php new file mode 100644 index 00000000..7ccc1204 --- /dev/null +++ b/resources/views/bo/modules/toggle-star.blade.php @@ -0,0 +1,27 @@ +@php + /** @var string $route */ + /** @var \Illuminate\Database\Eloquent\Model $model */ + /** @var bool $first */ + /** @var bool $last */ +@endphp + +@can('toggleStar', get_class($model)) +
+ @csrf + @method('PATCH') + + +
+@else + @if ($model->star) + + @else + + @endif +@endcan diff --git a/resources/views/bo/modules/toggle-status.blade.php b/resources/views/bo/modules/toggle-status.blade.php new file mode 100644 index 00000000..0d36f3c4 --- /dev/null +++ b/resources/views/bo/modules/toggle-status.blade.php @@ -0,0 +1,27 @@ +@php + /** @var string $route */ + /** @var \Illuminate\Database\Eloquent\Model $model */ + /** @var bool $first */ + /** @var bool $last */ +@endphp + +@can('toggleStatus', get_class($model)) +
+ @csrf + @method('PATCH') + + +
+@else + @if ($model->status) + + @else + + @endif +@endcan diff --git a/resources/views/bo/orders/detail.blade.php b/resources/views/bo/orders/detail.blade.php deleted file mode 100644 index d9513c02..00000000 --- a/resources/views/bo/orders/detail.blade.php +++ /dev/null @@ -1,82 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') -
-

<Commande - {{ $order->reference }}

- @if (session('success')) - {{ session('success') }} - @endif - -
- @if ($order->status_id < 6 && $order->status_id >=3 ) - {{$order->status->label}} - @endif - @if ($order->status_id < 6) - Annuler la commande - @endif -
-
-
- @include('bo.customer.info-card', ['cust' => $order->customer]) - - @if(!empty($order->timeslot)) - @include('bo.magasins.info-card', ['magasin' => $order->timeslot->magasin]) - @endif -
- - - - - - - - - - - - - - @foreach ($order->lines as $line) - - - - - - - - - - @endforeach - -
Ref ExterneProduitQuantitéPrix unitaire HTPrix Total HTTVATotal TTC
- @if($line->product->product_type == "foodProduct") - {{ $line->product->foodProduct->no_art }} - @endif - - {{ $line->product->name }} - {{$line->quantity}}{{number_format($line->unit_price - $line->discount, 2, ',', ' ')}}€{{number_format($line->total_ht - $line->total_discount, 2, ',', ' ')}}€{{number_format($line->total_tax, 2, ',', ' ')}}€{{number_format($line->total_ttc, 2, ',', ' ')}}€
-@endsection - -@section('scripts') - -@endsection diff --git a/resources/views/bo/orders/index-filters.blade.php b/resources/views/bo/orders/index-filters.blade.php new file mode 100644 index 00000000..49fca2db --- /dev/null +++ b/resources/views/bo/orders/index-filters.blade.php @@ -0,0 +1,185 @@ +
+ {{-- DATES --}} +
+ + {{-- ORDER DATE --}} +
+
+ {{ Str::ucfirst(__('validation.custom.attributes.order_date')) }} +
+
+ input('order_date_switch'))> + +
+
+ + + + + + + + + @if (!empty(request()->input('order_date_start')) || !empty(request()->input('order_date_end'))) + + @endif +
+ @include('bo.modules.input-error', ['inputName' => 'order_date_start']) + @include('bo.modules.input-error', ['inputName' => 'order_date_end']) +
+ + {{-- PICKUP DATE --}} +
+
+ {{ Str::ucfirst(__('validation.custom.attributes.pickup_date')) }} +
+
+ input('order_pickup_switch'))> + +
+
+ + + + + + + @if (!empty(request()->input('order_pickup_start')) || !empty(request()->input('order_pickup_end'))) + + @endif +
+ @include('bo.modules.input-error', ['inputName' => 'order_pickup_start']) + @include('bo.modules.input-error', ['inputName' => 'order_pickup_end']) +
+
+
+ {{-- STATUS --}} +
+
+ + +
+
+ + +@push('scripts') + +@endpush + +@push('scripts') + +@endpush diff --git a/resources/views/bo/orders/index-list.blade.php b/resources/views/bo/orders/index-list.blade.php new file mode 100644 index 00000000..3c58c7ae --- /dev/null +++ b/resources/views/bo/orders/index-list.blade.php @@ -0,0 +1,61 @@ +
+ + + @php + $cols = [ + 'customer' => Str::ucfirst(trans_choice('models.classes.customers', 1)), + 'reference' => Str::ucfirst(__('validation.custom.attributes.reference')), + 'date' => Str::ucfirst(__('validation.custom.attributes.order_date')), + 'total' => Str::ucfirst(__('validation.custom.attributes.total')), + 'pickup_date' => Str::ucfirst(__('validation.custom.attributes.pickup_date')), + 'shop' => Str::ucfirst(trans_choice('models.classes.shops', 1)), + 'status' => Str::ucfirst(__('validation.custom.attributes.order_status')), + ]; + @endphp + @include('bo.modules.tableColSorter', [ + 'cols' => $cols, + 'mobileHide' => [], + 'ignore' => ['customer', 'pickup_date'], + 'defaultSortCol' => 'date', + 'defaultSortWay' => 'desc', + ]) + + + @forelse ($orders as $order) + + + + + + + + + + @empty + + + + @endforelse + +
+ {{ Str::title($order->employee->lastname) }} {{ Str::title($order->employee->firstname) }} + {{ $order->reference }}{{ Date::forHumans($order->created_at) }}@money($order->total){{ $order->pickup_day ? Date::forHumans($order->pickup_day) : __('No Content') }}{{ $order->shop?->name ?? __('No Content') }}{{ $order->status->label() }} +
+ @can('view', $order) + + + + @endcan + @can('cancel', $order) +
+ @csrf + +
+ @endcan +
+
+ {{ __('crud.helpers.no_results') }} +
+
diff --git a/resources/views/bo/orders/index-today.blade.php b/resources/views/bo/orders/index-today.blade.php new file mode 100644 index 00000000..3109e867 --- /dev/null +++ b/resources/views/bo/orders/index-today.blade.php @@ -0,0 +1,40 @@ +@extends('bo.layouts.layout') + +@section('title', __('Today\'s Orders')) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') +
+
+
+
+

+ {{ __('Today\'s Orders') }} +

+
+
+
+
+ @if ($orders->count() > \Domain\Enums\Pagination\ItemsPerPaginationEnum::five->value()) +
+
+
+ {{ $orders->withQueryString()->onEachSide(1)->links() }} +
+
+
+ @endif +
+
+ @include('bo.orders.index-list') +
+
+
+
+ {{ $orders->withQueryString()->onEachSide(1)->links() }} +
+
+
+
+@endsection diff --git a/resources/views/bo/orders/index.blade.php b/resources/views/bo/orders/index.blade.php index 0c636547..4bcb860a 100644 --- a/resources/views/bo/orders/index.blade.php +++ b/resources/views/bo/orders/index.blade.php @@ -1,306 +1,52 @@ -@extends('layouts.bo-layout') +@extends('bo.layouts.layout') + +@if (request()->routeIs('bo.merch.starred')) + @section('title', __('crud.helpers.starred')) +@else + @section('title', Str::ucfirst(trans_choice('models.classes.orders', \INF))) +@endif + +@section('breadcrumb', request()->route()->getName()) @section('content') -
-

Commandes @if (isset($today)) - à retirer aujourd'hui - @endif -

- @if (session('success')) - {{ session('success') }} - @endif -
-
- @include('bo.modules.search-bar-orders') - @if (request()->routeIs('bo.orders')) -
-
-
- {{ __('Date de commande') }} -
-
- input('date-order-switch')) ? true : false) checked @endif> - -
-
- - - - -
- @include('modules.input-error', ['inputName' => 'date-order-start']) - @include('modules.input-error', ['inputName' => 'date-order-end']) -
-
-
- {{ __('Date de retrait') }} -
-
- input('date-retrait-switch')) ? true : false) checked @endif> - -
-
- - - - -
- @include('modules.input-error', ['inputName' => 'date-retrait-start']) - @include('modules.input-error', ['inputName' => 'date-retrait-end']) -
-
- - @push('scripts') - - @endpush - @endif -
-
+
+
+
- {{ __('Obligatoire') }} +

+ @if (request()->routeIs('bo.merch.starred')) + {{ __('crud.helpers.starred') }} + @else + {{ Str::ucfirst(trans_choice('models.classes.orders', \INF)) }} {{ Str::ucfirst(__('crud.actions.list')) }} + @endif +

+
-
- - - - - - - - - - - - - @foreach ($orders as $order) - - - - - - - - - - - @endforeach - -
{{ __('Client') }}  - @include('bo.modules.sorter', ['colname' => 'customer_id', 'list' => 'orders']) - {{ __('Référence') }} - {{ __('Date commande') }}  - @include('bo.modules.sorter', ['colname' => 'date', 'list' => 'orders']) - {{ __('Total en €') }}{{ __('Date de retrait') }}  - @include('bo.modules.sorter', ['colname' => 'date_retrait', 'list' => 'orders']) - - {{ __('Point de retrait') }}  - @include('bo.modules.sorter', ['colname' => 'magasin_id', 'list' => 'orders']) - - {{ __('Statut') }}  - @include('bo.modules.sorter', ['colname' => 'status_id', 'list' => 'orders']) - Réinitialiser - le - tri
- {{-- - Infos Client - --}} - Infos Client - {{ $order->reference }}{{ \Carbon\Carbon::parse($order->date)->format('d/m/Y') }}{{ number_format($order->total, 2, ',', ' ') }}€ - @if (!empty($order->timeslot)) - {{ optional($order->timeslot->day)->format('d/m/Y') }} - {{ optional($order->timeslot->time)->format('H:i') }} - @endif - - @if (!empty($order->timeslot)) - {{-- - {{$order->timeslot->magasin->name}} - --}} - {{ $order->timeslot->magasin->name }} - @endif - {{ $order->status->label }} - {{-- L'id du status 6 est le status "Retirée", la dernière étape d'une commande --}} - - @if ($order->status_id < 6 && $order->status_id >= 3) - - @endif - @if ($order->status_id < 6) - - @endif -
+
+ @if (!request()->routeIs('bo.merch.starred')) + @include('bo.modules.search-bar', compact('searchFields')) + @include('bo.orders.index-filters', compact('orders')) + @endif + @if ($orders->count() > \Domain\Enums\Pagination\ItemsPerPaginationEnum::five->value()) +
+
+
+ {{ $orders->withQueryString()->onEachSide(1)->links() }} +
+
+
+ @endif +
+
+ @include('bo.orders.index-list') +
+
+
+
+ {{ $orders->withQueryString()->onEachSide(1)->links() }} +
+
- @if ($orders instanceof \Illuminate\Pagination\LengthAwarePaginator) - {{ $orders->appends($_GET)->links() }} - @endif -@endsection - -@section('scripts') - +
@endsection diff --git a/resources/views/bo/orders/view.blade.php b/resources/views/bo/orders/view.blade.php new file mode 100644 index 00000000..a62a3ecc --- /dev/null +++ b/resources/views/bo/orders/view.blade.php @@ -0,0 +1,183 @@ +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s %s', Str::ucfirst(__('crud.actions.edit')), Str::ucfirst(trans_choice('models.classes.orders', 1)), + $order->reference)) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $order) @endphp + +@section('content') +
+
+
+
+

+ + {{ Str::ucfirst(trans_choice('models.classes.orders', 1)) }} - {{ $order->reference }} +

+
+
+
+ @can('forward', $order) + + + {{ Str::title($order->status->label()) }} + + @endcan + @can('cancel', $order) +
+ @csrf + +
+ @endcan +
+
+
+
+
+
+ {{-- EMPLOYEE --}} +
+
+

{{ str::title(trans_choice('models.classes.customers', 1)) }}

+
+

{{ __('Order data') }}

+

{{ Str::title($employee->firstname) }} {{ Str::title($employee->lastname) }}

+

+ + {{ __('Facility') }} + {{ $employee->facility }} + + + {{ __('Service') }} + {{ $employee->service }} + + + {{ __('Site') }} + {{ $employee->site }} + +

+ @if (!empty($crmCustomer)) +
+

{{ __('CRM data') }}

+

+ {{ $crmCustomer->email }} + @if ($crmCustomer->phone) + {{ $crmCustomer->phone }} + @endif +

+

+ {{ $crmCustomer->address }} + @if ($crmCustomer->address2) + {{ $crmCustomer->address2 }} + @endif + {{ $crmCustomer->postcode }} + {{ $crmCustomer->city }} +

+ @endif +
+
+
+ + {{-- ORDER --}} +
+
+

{{ __('Order details') }}

+
    +
  • + {{ Str::ucfirst(__('validation.custom.attributes.reference')) }} + {{ $order->reference }} +
  • +
  • + {{ Str::ucfirst(__('validation.custom.attributes.order_date')) }} + {{ Date::forHumans($order->created_at) }} +
  • +
  • + {{ Str::ucfirst(__('validation.custom.attributes.order_status')) }} + {{ Str::ucfirst($order->status->label()) }} +
  • +
  • + {{ Str::ucfirst(__('validation.custom.attributes.total')) }} + @money($order->total) +
  • +
+
+
+ + {{-- SHOP --}} +
+
+

{{ trans_choice('Pickup Locations', 1) }}

+ + @can('update', $shop) + + @endcan + +
+

{{ $shop->name }}

+

+ @if ($shop->phone) + {{ $shop->phone }} + @endif +

+

+ {{ $shop->address }} + {{ $shop->postcode }} + {{ $shop->city }} + + {{ $shop->latitude }} + {{ $shop->longitude }} + +

+
+ +
+
+ +
+
+
+
+ + + + + + + + + + + + + + @foreach ($order->lines as $line) + + + + + + + + + + + @endforeach + +
{{ Str::ucfirst(__('validation.custom.attributes.reference')) }}{{ Str::ucfirst(trans_choice('models.classes.products', 1)) }}{{ Str::ucfirst(__('validation.attributes.quantity')) }}{{ __('Unit price (excluding tax)') }}{{ __('Discounted unit price (excluding tax)') }}{{ __('Total Price (excluding tax)') }}{{ __('VAT') }}{{ __('Total (including tax)') }}
{{ $line->product->incoId->value }} + {{ $line->product->name }} + {{ $line->product->brand->label() }} + @money($line->product->discountedPrice ?? $line->product->price) + {{ $line->quantity }}@money($line->unit_price)@money($line->unitPriceDiscountedHt)@money($line->total_ht)@money($line->total_tax)@money($line->total_ttc)
+
+
+
+
+
+
+@endsection diff --git a/resources/views/bo/pages/edit.blade.php b/resources/views/bo/pages/edit.blade.php new file mode 100644 index 00000000..5be2aeb5 --- /dev/null +++ b/resources/views/bo/pages/edit.blade.php @@ -0,0 +1,35 @@ +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s %s', Str::ucfirst(__('crud.actions.edit')), trans_choice('models.classes.pages', 1), + $page->slug->label())) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $page) @endphp + +@section('content') +
+
+
+
+

+ {{ sprintf('%s - %s %s', Str::ucfirst(__('crud.actions.edit')), trans_choice('models.classes.pages', 1), $page->slug->label()) }} +

+
+
+
+
+
+ @csrf + {{ method_field('PUT') }} + @include('bo.pages.form', compact('page')) +
+ + {{ __('crud.helpers.required_fields_with_aster') }} + + +
+
+
+ @endsection diff --git a/resources/views/bo/pages/form.blade.php b/resources/views/bo/pages/form.blade.php new file mode 100644 index 00000000..44279de5 --- /dev/null +++ b/resources/views/bo/pages/form.blade.php @@ -0,0 +1,87 @@ +
+
+
+ {{ __('General Information') }} + +
+ {{-- SEO_TITLE --}} +
+
+
+ +
'page-seo_title'])'>
+ + @include('bo.modules.input-error', [ + 'inputName' => 'seo_title', + 'helperId' => 'page-seo_title-help', + 'helper' => __('Must accurately describe the page, recommendation for optimal search engine positioning ( tag).'), + ]) + </div> + </div> + </div> + {{-- SEO_DESCRIPTION --}} + <div class="col-12 col-md-6 mb-3"> + <div class="row"> + <div class="col-12 mb-3"> + <label class="col-form-label" + for="page-seo_description"><b>{{ Str::ucfirst(__('validation.custom.attributes.seo_description')) }}</b></label> + <div class="word-counter" data-json='@json(['for' => 'page-seo_description'])'></div> + <input class="form-control" id="page-seo_description" name="seo_description" type="text" + value="{{ old('seo_description', $page->seo_description ?? '') }}" aria-describedby="page-seo_description-help" + placeholder="{{ Str::ucfirst(__('validation.custom.attributes.seo_description')) }}" required> + @include('bo.modules.input-error', [ + 'inputName' => 'seo_description', + 'helperId' => 'page-seo_description-help', + 'helper' => __('Must accurately describe the page content (<meta> description tag).'), + ]) + </div> + </div> + </div> + </div> + + <div class="row mb-3"> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="page-title"><b>{{ Str::ucfirst(__('validation.attributes.title')) }}</b></label> + <div class="word-counter" data-json='@json(['for' => 'page-title'])'></div> + <input class="form-control" id="page-title" name="title" type="text" value="{{ old('title', $page->title ?? '') }}" + aria-describedby="page-title-help" placeholder="{{ Str::ucfirst(__('validation.attributes.title')) }}"> + @include('bo.modules.input-error', [ + 'inputName' => 'title', + 'helperId' => 'page-title-help', + 'helper' => __('Page title (can be empty for some keys).'), + ]) + </div> + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ __('Content') }}</legend> + + <div class="row"> + <div class="col form-group"> + <label class="col-form-label" for="page-content"><b>{{ Str::ucfirst(__('Main content (HTML)')) }}</b></label> + @include('bo.modules.input-error', [ + 'inputName' => 'content', + 'helper' => __('Complete content of the page.'), + ]) + @php + $editor = [ + 'id' => 'page-content', + 'csrf' => csrf_token(), + 'name' => 'content', + 'text' => old('content', $page->content ?? '') ?? '', + ]; + @endphp + <div class="ck-editor" data-json='@json($editor)'></div> + </div> + </div> + </fieldset> + </div> +</div> diff --git a/resources/views/bo/pickup-exceptions/create.blade.php b/resources/views/bo/pickup-exceptions/create.blade.php new file mode 100644 index 00000000..5da13908 --- /dev/null +++ b/resources/views/bo/pickup-exceptions/create.blade.php @@ -0,0 +1,31 @@ +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s', Str::ucfirst(__('creation')), Str::ucfirst(trans_choice('models.classes.pickup-exceptions', 1)))) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <a class="btn btn-sm btn-primary" href="{{ route('bo.pickup-exceptions.index') }}"><i class="fa-solid fa-arrow-left"></i></a> + {{ Str::ucfirst(trans_choice('models.classes.pickup-exceptions', 1)) }} {{ Str::ucfirst(__('crud.actions.create')) }} + </h1> + </div> + </div> + </div> + <div class="card-body"> + <form action="{{ route('bo.pickup-exceptions.store') }}" method="POST" enctype='multipart/form-data'> + @csrf + @include('bo.pickup-exceptions.form') + <div class="text-center"> + <button class="btn btn-primary" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> + </div> + </form> + </div> + </div> +@endsection diff --git a/resources/views/bo/pickup-exceptions/edit.blade.php b/resources/views/bo/pickup-exceptions/edit.blade.php new file mode 100644 index 00000000..48bc4db8 --- /dev/null +++ b/resources/views/bo/pickup-exceptions/edit.blade.php @@ -0,0 +1,48 @@ +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s %s', Str::ucfirst(__('crud.actions.edit')), Str::ucfirst(trans_choice('models.classes.pickup-exceptions', + 1)), $pickupException->label)) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $pickupException) @endphp + +@section('content') + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <a class="btn btn-sm btn-primary" href="{{ route('bo.pickup-exceptions.index') }}"><i class="fa-solid fa-arrow-left"></i></a> + {{ Str::ucfirst(trans_choice('models.classes.pickup-exceptions', 1)) }} {{ Str::ucfirst(__('crud.actions.edit')) }} + </h1> + </div> + <div class="col-3 text-end"> + <div class="btn-group"> + @can('delete', $pickupException) + <form class="d-inline confirmDeleteJS" action="{{ route('bo.pickup-exceptions.destroy', $pickupException) }}" method="POST"> + @method('DELETE') + @csrf + <button class="btn btn-sm btn-danger" title="{{ __('crud.actions.delete') }}"><i class="fa-solid fa-trash"></i></button> + </form> + @endcan + </div> + </div> + </div> + </div> + <div class="card-body"> + <form action="{{ route('bo.pickup-exceptions.update', $pickupException) }}" method="POST" enctype='multipart/form-data'> + @csrf + {{ method_field('PUT') }} + @include('bo.pickup-exceptions.form', compact('pickupException')) + <div class="text-center"> + <span class="d-block mb-3"> + <span class="badge text-bg-info">{{ __('crud.helpers.required_fields_with_aster') }}</span> + </span> + <button class="btn btn-primary" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> + </div> + </form> + </div> + </div> +@endsection diff --git a/resources/views/bo/pickup-exceptions/form.blade.php b/resources/views/bo/pickup-exceptions/form.blade.php new file mode 100644 index 00000000..584c1567 --- /dev/null +++ b/resources/views/bo/pickup-exceptions/form.blade.php @@ -0,0 +1,97 @@ +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ __('Exception information') }}</legend> + <div class="row mb-3"> + + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="exception-date"><b>{{ Str::ucfirst(__('validation.attributes.date')) }}</b></label> + <input class="form-control" id="exception-date" name="date" type="date" + value="{{ old('date', isset($pickupException->date) ? \Carbon\Carbon::parse($pickupException->date)->format('Y-m-d') : '') }}" + aria-describedby="exception-date-help" required> + @include('bo.modules.input-error', [ + 'inputName' => 'date', + 'helperId' => 'exception-date-help', + 'helper' => __('Select the date of this exception.'), + ]) + </div> + + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" + for="exception-label"><b>{{ Str::ucfirst(__('validation.custom.attributes.label')) ?? __('Label') }}</b></label> + <div class="word-counter" data-json='@json(['for' => 'exception-label'])'></div> + <input class="form-control" id="exception-label" name="label" type="text" + value="{{ old('label', $pickupException->label ?? '') }}" aria-describedby="exception-label-help" + placeholder="{{ __('Ex: Holiday, Exceptional closure...') }}" required> + @include('bo.modules.input-error', [ + 'inputName' => 'label', + 'helperId' => 'exception-label-help', + 'helper' => __('Give this exception an explicit name.'), + ]) + </div> + + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ __('Recurrence options') }}</legend> + <div class="row align-items-center mb-3"> + + <div class="col-12 col-md-6 form-group pt-3"> + <input class="form-check-input mt-2" id="exception-repeatable" name="repeatable" type="checkbox" value="1" + aria-describedby="exception-repeatable-help" @checked(old('repeatable', $pickupException->repeatable ?? 0))> + <label class="col-form-label form-check-label pt-1" for="exception-repeatable"> + <b>{{ Str::ucfirst(__('validation.custom.attributes.repeatable')) ?? __('Repeatable exception') }}</b> + </label><br> + @include('bo.modules.input-error', [ + 'inputName' => 'repeatable', + 'helperId' => 'exception-repeatable-help', + 'helper' => __('Check if this event repeats over time.'), + ]) + </div> + + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" + for="exception-frequency"><b>{{ Str::ucfirst(__('validation.custom.attributes.repeat_frequency')) ?? __('Frequency') }}</b></label> + <select class="form-control" id="exception-frequency" name="repeat_frequency" aria-describedby="exception-frequency-help"> + <option value="" @if (!old('repeat_frequency', $pickupException->repeat_frequency ?? null)) selected @endif disabled> + {{ __('Select') . ' ' . __('validation.custom.attributes.repeat_frequency') }} + </option> + @foreach (\Domain\Enums\RepeatFrequency::cases() as $frequency) + <option value="{{ $frequency->value }}" @selected(old('repeat_frequency', $pickupException->repeat_frequency ?? 'Weekly') == $frequency->value)> + {{ $frequency->label() }} + </option> + @endforeach + </select> + @include('bo.modules.input-error', [ + 'inputName' => 'repeat_frequency', + 'helperId' => 'exception-frequency-help', + 'helper' => __('Select the frequency if the event is repeatable (Default: Weekly).'), + ]) + </div> + + </div> + </fieldset> + </div> +</div> + +@push('scripts') + <script nonce="{{ Vite::cspNonce() }}"> + document.addEventListener('DOMContentLoaded', function() { + const repeatableCheckbox = document.getElementById('exception-repeatable'); + const frequencySelect = document.getElementById('exception-frequency'); + + if (repeatableCheckbox && frequencySelect) { + const toggleFrequency = () => { + frequencySelect.disabled = !repeatableCheckbox.checked; + }; + repeatableCheckbox.addEventListener('change', toggleFrequency); + toggleFrequency(); + } + }); + </script> +@endpush diff --git a/resources/views/bo/pickup-exceptions/index-list.blade.php b/resources/views/bo/pickup-exceptions/index-list.blade.php new file mode 100644 index 00000000..ba52cd30 --- /dev/null +++ b/resources/views/bo/pickup-exceptions/index-list.blade.php @@ -0,0 +1,57 @@ +<div class="table-responsive"> + <table class="fix-action table"> + <thead> + <tr class="visually-hidden"> + <th scope="col"></th> + </tr> + @php + $cols = [ + 'label' => Str::ucfirst(__('validation.custom.attributes.label')), + 'date' => Str::ucfirst(__('validation.attributes.date')), + 'repeatable' => Str::ucfirst(__('validation.custom.attributes.repeatable')), + 'repeat_frequency' => Str::ucfirst(__('validation.custom.attributes.repeat_frequency')), + ]; + @endphp + @include('bo.modules.tableColSorter', ['cols' => $cols, 'mobileHide' => []]) + </thead> + <tbody> + @forelse ($pickupExceptions as $pickupException) + <tr> + <td> + @if ($pickupException->auto_updated) + <span data-bs-toggle="tooltip" title="{{ __('Updated automatically') }}"> + <i class="fas fa-robot"></i>  + </span> + @endif + <span>{{ $pickupException->label }}</span> + </td> + <td>{{ Date::forHumans($pickupException->date) }}</td> + <td>{{ $pickupException->repeatable ? __('Yes') : __('No') }}</td> + <td>{{ $pickupException->repeat_frequency->label() }}</td> + <td> + <div class="btn-group"> + @can('update', $pickupException) + <a class="btn btn-sm btn-primary" href="{{ route('bo.pickup-exceptions.edit', $pickupException) }}" + title="{{ Str::ucfirst(__('crud.actions.update')) }}"><i class="fa-solid fa-pen"></i></a> + @endcan + @can('delete', $pickupException) + <form class="d-inline confirmDeleteJS" action="{{ route('bo.pickup-exceptions.destroy', $pickupException) }}" method="POST"> + @method('DELETE') + @csrf + <button class="btn btn-sm btn-danger rounded-start-0" title="{{ Str::ucfirst(__('crud.actions.delete')) }}"><i + class="fa-solid fa-trash"></i></button> + </form> + @endcan + </div> + </td> + </tr> + @empty + <tr> + <td class="text-center" colspan="20"> + <span class="h3">{{ __('crud.helpers.no_results') }}</span> + </td> + </tr> + @endforelse + </tbody> + </table> +</div> diff --git a/resources/views/bo/pickup-exceptions/index.blade.php b/resources/views/bo/pickup-exceptions/index.blade.php new file mode 100644 index 00000000..7628983f --- /dev/null +++ b/resources/views/bo/pickup-exceptions/index.blade.php @@ -0,0 +1,51 @@ +@extends('bo.layouts.layout') + +@section('title', Str::ucfirst(trans_choice('models.classes.pickup-exceptions', \INF))) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') + <div class="alert alert-info" role="alert"> + <p>{{ __('French public holidays are automatically provisioned and associated with stores') }}</p> + </div> + + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + {{ Str::ucfirst(trans_choice('models.classes.pickup-exceptions', \INF)) }} {{ Str::ucfirst(__('crud.actions.list')) }} + </h1> + </div> + <div class="col-3"> + <div class="input-group justify-content-end"> + @can('create', \App\Models\Slide::class) + <a class="btn btn-primary" href="{{ route('bo.pickup-exceptions.create') }}" + title="{{ Str::ucfirst(__('crud.actions.create')) }} {{ Str::ucfirst(trans_choice('models.classes.pickup-exceptions', \INF)) }}"><i + class="fa-solid fa-square-plus"></i></a> + @endcan + </div> + </div> + </div> + </div> + <div class="card-body"> + @if ($pickupExceptions->count() > \Domain\Enums\Pagination\ItemsPerPaginationEnum::twelve->value()) + <div class="row justify-content-center"> + <div class="col-12 p-md-3 p-0"> + {{ $pickupExceptions->withQueryString()->onEachSide(1)->links() }} + </div> + </div> + @endif + <div class="row"> + <div class="col"> + @include('bo.pickup-exceptions.index-list') + </div> + </div> + <div class="row justify-content-center"> + <div class="col-12 p-md-3 p-0"> + {{ $pickupExceptions->withQueryString()->onEachSide(1)->links() }} + </div> + </div> + </div> + </div> +@endsection diff --git a/resources/views/bo/product-incos/arcadia-card.blade.php b/resources/views/bo/product-incos/arcadia-card.blade.php new file mode 100644 index 00000000..79e24b4a --- /dev/null +++ b/resources/views/bo/product-incos/arcadia-card.blade.php @@ -0,0 +1,281 @@ +<div class="card mb-4 border-primary"> + <div class="card-header bg-primary text-white d-flex align-items-center justify-content-between"> + <h2 class="h5 mb-0"> + <i class="fa-solid fa-cloud-arrow-down me-2"></i>{{ __('Arcadia INCO Sheet') }} + </h2> + @if (isset($inco) && $inco->no_art) + <form action="{{ route('bo.products.incos.sync', $product) }}" method="POST" class="d-inline"> + @csrf + <button type="submit" class="btn btn-sm btn-light text-primary fw-bold" data-bs-toggle="tooltip" title="{{ __('Synchronize from Arcadia') }}"> + <i class="fa-solid fa-arrows-rotate me-1"></i> {{ __('Synchronize from Arcadia') }} + </button> + </form> + @endif + </div> + + <div class="card-body"> + @if (isset($inco) && $inco->no_art) + <p class="text-muted small mb-2"> + {{ __('Associating this INCO sheet will replace the currently linked INCO sheet for this product.') }} + </p> + @else + <p class="text-muted mb-3"> + {{ __('Associate an INCO sheet from the Arcadia API by entering the article number.') }} + </p> + @endif + + <div class="row g-2 align-items-center"> + <div class="col-12 col-md-9 col-lg-7"> + <div class="input-group"> + <span class="input-group-text"><i class="fa-solid fa-hashtag"></i></span> + <input type="number" id="arcadia-no-art-input" class="form-control" + placeholder="{{ __('Enter the Arcadia INCO article number') }}" + value="{{ old('arcadia_no_art', $inco->no_art ?? '') }}" min="1"> + <button type="button" id="btn-preview-arcadia" class="btn btn-primary"> + <i class="fa-solid fa-magnifying-glass me-1"></i> {{ __('Preview and Associate') }} + </button> + </div> + <div id="arcadia-error-feedback" class="text-danger small mt-1 d-none"></div> + </div> + </div> + </div> +</div> + +{{-- MODAL PREVIEW --}} +<div class="modal fade" id="arcadiaPreviewModal" tabindex="-1" aria-labelledby="arcadiaPreviewModalLabel" aria-hidden="true"> + <div class="modal-dialog modal-lg modal-dialog-scrollable"> + <div class="modal-content"> + <div class="modal-header"> + <h5 class="modal-title" id="arcadiaPreviewModalLabel"> + <i class="fa-solid fa-file-lines me-2 text-primary"></i>{{ __('Arcadia INCO Sheet Preview') }} + </h5> + <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{ __('Cancel') }}"></button> + </div> + + <div class="modal-body"> + {{-- SPINNER --}} + <div id="arcadia-preview-loading" class="text-center py-5 d-none"> + <div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;"> + <span class="visually-hidden">{{ __('Loading...') }}</span> + </div> + <p class="mt-3 text-muted fw-bold">{{ __('Fetching data from Arcadia API...') }}</p> + </div> + + {{-- ERROR ALERT --}} + <div id="arcadia-preview-error" class="alert alert-danger d-none"> + <i class="fa-solid fa-triangle-exclamation me-2"></i> + <span id="arcadia-preview-error-text"></span> + </div> + + {{-- CONTENT --}} + <div id="arcadia-preview-content" class="d-none"> + <div class="card mb-3 bg-light"> + <div class="card-body"> + <div class="row g-2"> + <div class="col-sm-6"> + <strong>{{ __('INCO article number') }} :</strong> + <span id="preview-no-art" class="badge bg-secondary ms-1"></span> + </div> + <div class="col-sm-6"> + <strong>{{ __('Brand') }} :</strong> + <span id="preview-brand"></span> + </div> + <div class="col-12"> + <strong>{{ __('Designation') }} :</strong> + <span id="preview-name" class="fw-bold"></span> + </div> + <div class="col-sm-6"> + <strong>{{ __('Nutriscore') }} :</strong> + <span id="preview-nutriscore" class="badge bg-success ms-1"></span> + </div> + <div class="col-sm-6"> + <strong>{{ __('Servings') }} :</strong> + <span id="preview-servings"></span> + </div> + <div class="col-12"> + <strong>{{ __('Allergens') }} :</strong> + <span id="preview-allergens" class="text-danger"></span> + </div> + </div> + </div> + </div> + + {{-- INGREDIENTS --}} + <div class="mb-3"> + <h6 class="fw-bold border-bottom pb-1">{{ __('Ingredients') }}</h6> + <div id="preview-ingredients" class="p-2 border rounded bg-white small"></div> + </div> + + {{-- PREPARATION --}} + <div class="mb-3" id="preview-prep-container"> + <h6 class="fw-bold border-bottom pb-1">{{ __('Preparation') }}</h6> + <div id="preview-preparation" class="p-2 border rounded bg-white small"></div> + </div> + + {{-- NUTRITION --}} + <div class="mb-3"> + <h6 class="fw-bold border-bottom pb-1">{{ __('Nutritional values') }} (100g)</h6> + <table class="table table-sm table-bordered mb-0 small"> + <tbody> + <tr> + <th class="w-50">{{ __('Energy (kJ / kcal)') }}</th> + <td id="preview-energy"></td> + </tr> + <tr> + <th>{{ __('Fat') }}</th> + <td id="preview-fat"></td> + </tr> + <tr> + <th class="ps-4 text-muted">{{ __('of which saturated fatty acids') }}</th> + <td id="preview-sat-fat"></td> + </tr> + <tr> + <th>{{ __('Carbohydrates') }}</th> + <td id="preview-carbs"></td> + </tr> + <tr> + <th class="ps-4 text-muted">{{ __('of which sugars') }}</th> + <td id="preview-sugar"></td> + </tr> + <tr> + <th>{{ __('Dietary fiber') }}</th> + <td id="preview-fiber"></td> + </tr> + <tr> + <th>{{ __('Proteins') }}</th> + <td id="preview-protein"></td> + </tr> + <tr> + <th>{{ __('Salt') }}</th> + <td id="preview-salt"></td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + + <div class="modal-footer"> + <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"> + {{ __('Cancel') }} + </button> + <form action="{{ route('bo.products.incos.associate', $product) }}" method="POST" id="form-confirm-associate"> + @csrf + <input type="hidden" name="no_art" id="modal-confirm-no-art" value=""> + <button type="submit" class="btn btn-success" id="btn-confirm-associate" disabled> + <i class="fa-solid fa-check me-1"></i> {{ __('Confirm association') }} + </button> + </form> + </div> + </div> + </div> +</div> + +@push('scripts') +<script nonce="{{ Vite::cspNonce() }}"> +document.addEventListener('DOMContentLoaded', function () { + const inputNoArt = document.getElementById('arcadia-no-art-input'); + const btnPreview = document.getElementById('btn-preview-arcadia'); + const errorFeedback = document.getElementById('arcadia-error-feedback'); + const modalEl = document.getElementById('arcadiaPreviewModal'); + const modalLoading = document.getElementById('arcadia-preview-loading'); + const modalError = document.getElementById('arcadia-preview-error'); + const modalErrorText = document.getElementById('arcadia-preview-error-text'); + const modalContent = document.getElementById('arcadia-preview-content'); + const btnConfirm = document.getElementById('btn-confirm-associate'); + const hiddenNoArt = document.getElementById('modal-confirm-no-art'); + + if (!btnPreview || !modalEl) return; + + const bsModal = window.bootstrap ? window.bootstrap.Modal.getOrCreateInstance(modalEl) : null; + + function doPreview() { + const noArt = inputNoArt.value.trim(); + if (!noArt || parseInt(noArt, 10) <= 0) { + errorFeedback.textContent = "{{ __('Please enter an article number.') }}"; + errorFeedback.classList.remove('d-none'); + return; + } + errorFeedback.classList.add('d-none'); + + modalLoading.classList.remove('d-none'); + modalError.classList.add('d-none'); + modalContent.classList.add('d-none'); + btnConfirm.disabled = true; + hiddenNoArt.value = ''; + + if (bsModal) { + bsModal.show(); + } + + const previewUrl = "{{ route('bo.products.incos.preview', ['product' => $product, 'no_art' => '__NO_ART__']) }}".replace('__NO_ART__', encodeURIComponent(noArt)); + + fetch(previewUrl, { + headers: { + 'Accept': 'application/json', + 'X-Requested-With': 'XMLHttpRequest' + } + }) + .then(async (response) => { + modalLoading.classList.add('d-none'); + if (!response.ok) { + const errData = await response.json().catch(() => ({})); + throw new Error(errData.message || "{{ __('No INCO sheet found on Arcadia for this article number.') }}"); + } + return response.json(); + }) + .then((data) => { + document.getElementById('preview-no-art').textContent = data.no_art; + document.getElementById('preview-name').textContent = data.libelle || data.name || '-'; + document.getElementById('preview-brand').textContent = data.brand || '-'; + document.getElementById('preview-nutriscore').textContent = data.nutriscore || 'N/A'; + document.getElementById('preview-servings').textContent = data.servings || '-'; + document.getElementById('preview-allergens').textContent = data.allergens || "{{ __('None') }}"; + + const ingEl = document.getElementById('preview-ingredients'); + if (data.ingredients) { + ingEl.innerHTML = data.ingredients; + } else { + ingEl.innerHTML = '<em class="text-muted">{{ __('None') }}</em>'; + } + + const prepEl = document.getElementById('preview-preparation'); + if (data.preparation) { + prepEl.innerHTML = data.preparation; + document.getElementById('preview-prep-container').classList.remove('d-none'); + } else { + document.getElementById('preview-prep-container').classList.add('d-none'); + } + + const kj = data.energy_kj !== null ? data.energy_kj + ' kJ' : '-'; + const kcal = data.energy_kcal !== null ? data.energy_kcal + ' kcal' : '-'; + document.getElementById('preview-energy').textContent = `${kj} / ${kcal}`; + document.getElementById('preview-fat').textContent = data.fat !== null ? data.fat + ' g' : '-'; + document.getElementById('preview-sat-fat').textContent = data.sat_fat !== null ? data.sat_fat + ' g' : '-'; + document.getElementById('preview-carbs').textContent = data.carbs !== null ? data.carbs + ' g' : '-'; + document.getElementById('preview-sugar').textContent = data.sugar !== null ? data.sugar + ' g' : '-'; + document.getElementById('preview-fiber').textContent = data.fiber !== null ? data.fiber + ' g' : '-'; + document.getElementById('preview-protein').textContent = data.protein !== null ? data.protein + ' g' : '-'; + document.getElementById('preview-salt').textContent = data.salt !== null ? data.salt + ' g' : '-'; + + hiddenNoArt.value = data.no_art; + btnConfirm.disabled = false; + modalContent.classList.remove('d-none'); + }) + .catch((err) => { + modalLoading.classList.add('d-none'); + modalErrorText.textContent = err.message || "{{ __('An error occurred while fetching the preview.') }}"; + modalError.classList.remove('d-none'); + }); + } + + btnPreview.addEventListener('click', doPreview); + inputNoArt.addEventListener('keydown', function (e) { + if (e.key === 'Enter') { + e.preventDefault(); + doPreview(); + } + }); +}); +</script> +@endpush diff --git a/resources/views/bo/product-incos/edit.blade.php b/resources/views/bo/product-incos/edit.blade.php new file mode 100644 index 00000000..f1c9fe18 --- /dev/null +++ b/resources/views/bo/product-incos/edit.blade.php @@ -0,0 +1,237 @@ +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s', Str::ucfirst(trans_choice('models.classes.product_incos', 1)), $product->name)) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $product) @endphp + +@section('content') + @include('bo.product-incos.arcadia-card') + + <div class="card"> + <div class="card-header"> + <div class="row align-items-center"> + <div class="col"> + <h1 class="h3 mb-0"> + <a class="btn btn-sm btn-primary me-2" href="{{ route('bo.products.edit', $product) }}"> + <i class="fa-solid fa-arrow-left"></i> + </a> + {{ Str::ucfirst(trans_choice('models.classes.product_incos', 1)) }} : {{ $product->name }} + </h1> + </div> + </div> + </div> + <div class="card-body"> + @if ($inco) + {{-- GENERAL INFO & NUTRISCORE --}} + <fieldset class="mb-4 rounded border p-3"> + <legend class="h5 px-2">{{ __('General Information & Nutriscore') }}</legend> + <div class="row g-3"> + <div class="col-12 col-md-3"> + <label class="form-label text-muted fw-bold mb-1">{{ __('INCO article number') }}</label> + <div> + <span class="badge bg-primary fs-6">#{{ $inco->no_art }}</span> + </div> + </div> + + <div class="col-12 col-md-3"> + <label class="form-label text-muted fw-bold mb-1">{{ __('Servings') }}</label> + <div class="fw-semibold">{{ $inco->servings ?: '-' }}</div> + </div> + + <div class="col-12 col-md-3"> + <label class="form-label text-muted fw-bold mb-1">{{ __('Nutriscore') }}</label> + <div> + @if ($inco->nutriscore) + <img src="{{ Vite::asset("resources/assets/images/nutriscore/nutriscore-{$inco->nutriscore->value()}.png") }}" + alt="{{ __('Nutriscore') }} {{ $inco->nutriscore->label() }}" style="height: 38px;"> + @else + <span class="badge bg-secondary">{{ __('None') }}</span> + @endif + </div> + </div> + + @if ($inco->nutriscore_args) + <div class="col-12 col-md-3"> + <label class="form-label text-muted fw-bold mb-1">{{ __('Nutriscore arguments') }}</label> + <div>{{ $inco->nutriscore_args }}</div> + </div> + @endif + </div> + </fieldset> + + {{-- COMPOSITION & PREPARATION --}} + <fieldset class="mb-4 rounded border p-3"> + <legend class="h5 px-2">{{ __('Composition & Preparation') }}</legend> + <div class="row g-3"> + <div class="col-12"> + <label class="form-label text-muted fw-bold mb-1">{{ __('Ingredients') }}</label> + <div class="bg-light rounded border p-3"> + @if ($inco->ingredients) + {!! clean($inco->ingredients) !!} + @else + <em class="text-muted">{{ __('None') }}</em> + @endif + </div> + </div> + + @if ($inco->allergens) + <div class="col-12"> + <div class="alert alert-warning mb-0"> + <i class="fa-solid fa-triangle-exclamation me-2"></i> + <strong>{{ __('Allergens') }} :</strong> {{ $inco->allergens }} + </div> + </div> + @endif + + @if ($inco->preparation) + <div class="col-12"> + <label class="form-label text-muted fw-bold mb-1">{{ __('Preparation') }}</label> + <div class="bg-light rounded border p-3"> + {!! clean($inco->preparation) !!} + </div> + </div> + @endif + + @if ($inco->selling_argument) + <div class="col-12"> + <label class="form-label text-muted fw-bold mb-1">{{ __('Selling argument') }}</label> + <div class="bg-light rounded border p-3"> + {!! clean($inco->selling_argument) !!} + </div> + </div> + @endif + </div> + </fieldset> + + {{-- NUTRITIONAL VALUES --}} + <fieldset class="mb-3 rounded border p-3"> + <legend class="h5 px-2">{{ __('Nutritional Values') }}</legend> + <div class="row mb-3"> + <div class="col-12 col-md-6"> + <span class="text-muted fw-bold">{{ __('Reference Weight') }} :</span> + <span class="fw-semibold">{{ $inco->nutrition->refWeightG ?? 100 }} g</span> + </div> + @if ($inco->nutrition->servingSizeG) + <div class="col-12 col-md-6"> + <span class="text-muted fw-bold">{{ __('Portion Size') }} :</span> + <span class="fw-semibold">{{ $inco->nutrition->servingSizeG }} g</span> + </div> + @endif + </div> + + <div class="table-responsive"> + <table class="table-bordered table-striped min-w-700px mb-0 table align-middle"> + <thead class="table-light text-nowrap"> + <tr> + <th class="w-40" scope="col">{{ __('Item') }}</th> + <th class="w-20 text-center" scope="col">{{ __('Per 100g / Ref') }}</th> + <th class="w-20 text-center" scope="col">{{ __('Per Serving') }}</th> + <th class="w-20 text-center" scope="col">{{ __('Daily Intake (% RI)') }}</th> + </tr> + </thead> + <tbody> + {{-- ENERGIE --}} + <tr> + <td><b>{{ __('Energy') }}</b></td> + <td class="text-center"> + @if ($inco->nutrition->kj !== null || $inco->nutrition->kcal !== null) + {{ $inco->nutrition->kj !== null ? $inco->nutrition->kj . ' kJ' : '' }} + @if ($inco->nutrition->kj !== null && $inco->nutrition->kcal !== null) + / + @endif + {{ $inco->nutrition->kcal !== null ? $inco->nutrition->kcal . ' kcal' : '' }} + @else + - + @endif + </td> + <td class="text-center"> + @if ($inco->nutrition->servingKj !== null || $inco->nutrition->servingKcal !== null) + {{ $inco->nutrition->servingKj !== null ? $inco->nutrition->servingKj . ' kJ' : '' }} + @if ($inco->nutrition->servingKj !== null && $inco->nutrition->servingKcal !== null) + / + @endif + {{ $inco->nutrition->servingKcal !== null ? $inco->nutrition->servingKcal . ' kcal' : '' }} + @else + - + @endif + </td> + <td class="text-center"> + {{ $inco->nutrition->dailyEnergy !== null ? $inco->nutrition->dailyEnergy . ' %' : '-' }} + </td> + </tr> + + {{-- MATIERES GRASSES --}} + <tr> + <td> + <b>{{ __('Fat') }}</b><br> + <small class="text-muted ps-2">{{ __('of which saturated fatty acids') }}</small> + </td> + <td class="text-center"> + {{ $inco->nutrition->fatG !== null ? $inco->nutrition->fatG . ' g' : '-' }}<br> + <small class="text-muted">{{ $inco->nutrition->satFatG !== null ? $inco->nutrition->satFatG . ' g' : '-' }}</small> + </td> + <td class="text-center"> + {{ $inco->nutrition->servingFatG !== null ? $inco->nutrition->servingFatG . ' g' : '-' }}<br> + <small + class="text-muted">{{ $inco->nutrition->servingSatFatG !== null ? $inco->nutrition->servingSatFatG . ' g' : '-' }}</small> + </td> + <td class="text-center"> + {{ $inco->nutrition->dailyFat !== null ? $inco->nutrition->dailyFat . ' %' : '-' }}<br> + <small + class="text-muted">{{ $inco->nutrition->dailySatFat !== null ? $inco->nutrition->dailySatFat . ' %' : '-' }}</small> + </td> + </tr> + + {{-- GLUCIDES --}} + <tr> + <td> + <b>{{ __('Carbohydrates') }}</b><br> + <small class="text-muted ps-2">{{ __('of which sugars') }}</small> + </td> + <td class="text-center"> + {{ $inco->nutrition->carbG !== null ? $inco->nutrition->carbG . ' g' : '-' }}<br> + <small class="text-muted">{{ $inco->nutrition->sugarG !== null ? $inco->nutrition->sugarG . ' g' : '-' }}</small> + </td> + <td class="text-center"> + {{ $inco->nutrition->servingCarbG !== null ? $inco->nutrition->servingCarbG . ' g' : '-' }}<br> + <small + class="text-muted">{{ $inco->nutrition->servingSugarG !== null ? $inco->nutrition->servingSugarG . ' g' : '-' }}</small> + </td> + <td class="text-center"> + {{ $inco->nutrition->dailyCarb !== null ? $inco->nutrition->dailyCarb . ' %' : '-' }}<br> + <small class="text-muted">{{ $inco->nutrition->dailySugar !== null ? $inco->nutrition->dailySugar . ' %' : '-' }}</small> + </td> + </tr> + + {{-- FIBRES, PROTEINES, SEL --}} + @foreach ([['label' => 'Fiber', 'prop' => 'fiberG', 'servingProp' => 'servingFiberG', 'dailyProp' => 'dailyFiber'], ['label' => 'Protein', 'prop' => 'proteinG', 'servingProp' => 'servingProteinG', 'dailyProp' => 'dailyProtein'], ['label' => 'Salt', 'prop' => 'saltG', 'servingProp' => 'servingSaltG', 'dailyProp' => 'dailySalt']] as $nutrient) + <tr> + <td><b>{{ __($nutrient['label']) }}</b></td> + <td class="text-center"> + {{ $inco->nutrition->{$nutrient['prop']} !== null ? $inco->nutrition->{$nutrient['prop']} . ' g' : '-' }} + </td> + <td class="text-center"> + {{ $inco->nutrition->{$nutrient['servingProp']} !== null ? $inco->nutrition->{$nutrient['servingProp']} . ' g' : '-' }} + </td> + <td class="text-center"> + {{ $inco->nutrition->{$nutrient['dailyProp']} !== null ? $inco->nutrition->{$nutrient['dailyProp']} . ' %' : '-' }} + </td> + </tr> + @endforeach + </tbody> + </table> + </div> + </fieldset> + @else + <div class="py-5 text-center"> + <i class="fa-solid fa-circle-info fa-3x text-muted d-block mb-3"></i> + <h2 class="h5 text-muted">{{ __('No INCO sheet is currently associated with this product.') }}</h2> + <p class="text-muted mb-0"> + {{ __('Use the Arcadia section above to search and associate an INCO sheet.') }} + </p> + </div> + @endif + </div> + </div> +@endsection diff --git a/resources/views/bo/products/anifood_product.blade.php b/resources/views/bo/products/anifood_product.blade.php deleted file mode 100644 index 13c53652..00000000 --- a/resources/views/bo/products/anifood_product.blade.php +++ /dev/null @@ -1,47 +0,0 @@ -<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h2><small class="text-muted">Aliment pour animaux</small></h2> - <input type="hidden" id="product_type" name="product_type" value="anifoodProduct"> -</div> -<!--adding fields (anifood_products)--> -<div class="row"> - <div class="form-group col"> - <label for="servings">Portions</label> - <input type="text" id="servings" name="servings" class="form-control" value="{{ old('servings', $product->anifoodProduct->servings) }}"> - </div> -</div> -<div class="row"> - <div class="form-group col"> - <label>Composition</label> - <textarea class="form-control" id="composition" name="composition" placeholder="Composition">{{ old('composition', $product->anifoodProduct->composition) }}</textarea> - </div> -</div> -@section('scripts') - <script type="text/javascript"> - var editorConfig = { - removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"], - toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'blockQuote', 'insertTable', '|', 'undo', 'redo' ], - heading: { - options: [ - { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' }, - { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' }, - { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }, - { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' }, - { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' } - ] - }, - table: { - contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ] - } - }; - var compositionEditor; - ClassicEditor - .create( document.querySelector( '#composition' ), editorConfig) - .then( editor => { - compositionEditor = editor; - }) - .catch( error => { - console.error( error ); - } ); - </script> - @parent -@endsection diff --git a/resources/views/bo/products/create.blade.php b/resources/views/bo/products/create.blade.php index c5ff7ce1..d89d358b 100644 --- a/resources/views/bo/products/create.blade.php +++ b/resources/views/bo/products/create.blade.php @@ -1,116 +1,31 @@ -@extends('layouts.bo-layout') +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s', Str::ucfirst(__('creation')), Str::ucfirst(trans_choice('models.classes.products', 1)))) + +@section('breadcrumb', request()->route()->getName()) @section('content') - <form action="{{route('bo.products.store')}}" method="POST" enctype="multipart/form-data"> - @csrf - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2"><a href="{{route('bo.products.index')}}" class="h2 text-decoration-none"><</a> Produits <small class="text-muted">Création</small></h1> - <div class="btn-toolbar mb-2 mb-md-0"> - <button type="submit" class="btn btn-sm btn-primary">Enregistrer</a> - </div> + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <a class="btn btn-sm btn-primary" href="{{ route('bo.products.index') }}"><i class="fa-solid fa-arrow-left"></i></a> + {{ Str::ucfirst(trans_choice('models.classes.products', 1)) }} {{ Str::ucfirst(__('crud.actions.create')) }} + </h1> </div> - @if ($errors->any()) - <div class="alert alert-danger"> - <ul> - @foreach ($errors->all() as $error) - <li>{{ $error }}</li> - @endforeach - </ul> - </div> - @endif - @include('bo.products.standard_form_inputs') - @if(!empty($product_type)) - @include('bo.products.' . Str::snake($product_type)) - @endif - </form> -@endsection - -@section('scripts') - <script type="text/javascript"> - function showPicture(id,filename) { - if ( $( id ).length ) { - $( id ).attr('href',"/storage/images/produits/" + filename); - $( id + " img" ).attr('src',"/storage/images/produits/" + filename); - } else { - id = id.replace("#img-",""); - console.log(id); - let template = `<br/><br/> - <a data-fancybox="gallery" href="/storage/images/produits/`+filename+`" id="#img-`+ id +`"> - <img src="/storage/images/produits/`+filename+`" alt="" style="max-height: 100px;"></a>`; - $( "#"+id ).after(template); - } - } - - function setPicture(imgname) { - axios.post('/bo/ajax/set-inco-images', { - picture: imgname, - product: {{ $product->id ?? 0}} - }).then( - (response) => { - if(typeof(response.data) == "object") { - showPicture("#img-picture",response.data.picture); - showPicture("#img-picture_large",response.data.picture_large); - } - } - ) - .catch(function (error) { - console.log(error); - alert('Erreur lors de la mise à jour.'); - this.processing = false; - }); - } - - function paste(from,to) { - if(window[to+'Editor']) { - window[to+'Editor'].setData(document.getElementById(from).innerHTML); - } else { - document.getElementById(to).value = document.getElementById(from).innerHTML; - } - } - - var editorConfig = { - removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"], - toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'blockQuote', 'insertTable', '|', 'undo', 'redo' ], - heading: { - options: [ - { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' }, - { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' }, - { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }, - { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' }, - { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' } - ] - }, - table: { - contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ] - } - }; - var descriptionEditor; - ClassicEditor - .create( document.querySelector( '#description' ), editorConfig) - .then( editor => { - descriptionEditor = editor; - }) - .catch( error => { - console.error( error ); - } ); - - $(document).ready(function(){ - $("#prepareIncoImages").click(function(){ - axios.post('/bo/ajax/get-inco-images', { - picture: @json($product->foodProduct->xmlInco->picture ?? ''), - }).then( - (response) => { - if(response.data.length) { - $('#inco_media').html(response.data); - } - } - ) - .catch(function (error) { - console.log(error); - alert('Erreur lors de la vérification.'); - this.processing = false; - }); - }); - }); - </script> + </div> + </div> + <div class="card-body"> + <form action="{{ route('bo.products.store') }}" method="POST" enctype='multipart/form-data'> + @csrf + @include('bo.products.form') + <div class="text-center"> + <button class="btn btn-primary" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> + </div> + </form> + </div> + </div> @endsection diff --git a/resources/views/bo/products/edit.blade.php b/resources/views/bo/products/edit.blade.php index f21b969a..ccb90ab0 100644 --- a/resources/views/bo/products/edit.blade.php +++ b/resources/views/bo/products/edit.blade.php @@ -1,120 +1,88 @@ -@extends('layouts.bo-layout') +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s %s', Str::ucfirst(__('crud.actions.edit')), Str::ucfirst(trans_choice('models.classes.products', 1)), + $product->name)) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $product) @endphp @section('content') - <form action="{{route('bo.products.update', $product->id)}}" method="POST" enctype="multipart/form-data"> - @method('PUT') - @csrf - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2"><a href="{{route('bo.products.index')}}" class="h2 text-decoration-none"><</a> Produits <small class="text-muted">Modification</small></h1> - @if (session('success')) - <span class="float-center text-success">{{ session('success') }}</span> - @endif - <div class="btn-toolbar mb-2 mb-md-0"> - <button type="submit" class="btn btn-sm btn-primary">Enregistrer</a> - </div> + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <span class="btn-group"> + @can('viewAny', \App\Models\Product::class) + <a class="btn btn-sm btn-primary" + href="{{ in_array(URL::previous(), [ + request()->url(), + route('bo.products.incos.edit', [ + 'product' => $product, + 'inco' => $product->inco ?? 'unknown', + ]), + ]) === true + ? route('bo.products.index') + : URL::previous() }}"> + <i class="fa-solid fa-arrow-left"></i> + </a> + @endcan + </span> + {{ Str::ucfirst(trans_choice('models.classes.products', 1)) }} {{ Str::ucfirst(__('crud.actions.edit')) }} + </h1> </div> - @if ($errors->any()) - <div class="alert alert-danger"> - <ul> - @foreach ($errors->all() as $error) - <li>{{ $error }}</li> - @endforeach - </ul> - </div> - @endif - @include('bo.products.standard_form_inputs') - @if(!empty($product->product_type)) - @include('bo.products.' . Str::snake($product->product_type)) - @endif - </form> -@endsection - -@section('scripts') - <script type="text/javascript"> - function showPicture(id,filename) { - if ( $( id ).length ) { - $( id ).attr('href',"/storage/images/produits/" + filename); - $( id + " img" ).attr('src',"/storage/images/produits/" + filename); - } else { - id = id.replace("#img-",""); - console.log(id); - let template = `<br/><br/> - <a data-fancybox="gallery" href="/storage/images/produits/`+filename+`" id="#img-`+ id +`"> - <img src="/storage/images/produits/`+filename+`" alt="" style="max-height: 100px;"></a>`; - $( "#"+id ).after(template); - } - } - - function setPicture(imgname) { - axios.post('/bo/ajax/set-inco-images', { - picture: imgname, - product: {{ $product->id}} - }).then( - (response) => { - if(typeof(response.data) == "object") { - showPicture("#img-picture",response.data.picture); - showPicture("#img-picture_large",response.data.picture_large); - } - } - ) - .catch(function (error) { - console.log(error); - alert('Erreur lors de la mise à jour.'); - this.processing = false; - }); - } - - function paste(from,to) { - if(window[to+'Editor']) { - window[to+'Editor'].setData(document.getElementById(from).innerHTML); - } else { - document.getElementById(to).value = document.getElementById(from).innerHTML; - } - } - - var editorConfig = { - removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"], - toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'blockQuote', 'insertTable', '|', 'undo', 'redo' ], - heading: { - options: [ - { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' }, - { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' }, - { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }, - { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' }, - { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' } - ] - }, - table: { - contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ] - } - }; - var descriptionEditor; - ClassicEditor - .create( document.querySelector( '#description' ), editorConfig) - .then( editor => { - descriptionEditor = editor; - }) - .catch( error => { - console.error( error ); - } ); - - $(document).ready(function(){ - $("#prepareIncoImages").click(function(){ - axios.post('/bo/ajax/get-inco-images', { - picture: @json($product->foodProduct->xmlInco->picture ?? ''), - }).then( - (response) => { - if(response.data.length) { - $('#inco_media').html(response.data); - } - } - ) - .catch(function (error) { - console.log(error); - alert('Erreur lors de la vérification.'); - this.processing = false; - }); - }); - }); - </script> + <div class="col-3 text-end"> + <div class="btn-group"> + @can('createInco', $product) + <a class="btn btn-sm btn-primary" class="d-inline" href="{{ route('bo.products.incos.create', $product) }}" + title="{{ __('crud.helpers.associate_model', ['model' => trans_choice('models.classes.product_incos', 1)]) }}"> + <i class="fa-solid fa-plus"></i> + <span>{{ Str::title(trans_choice('models.classes.product_incos', 1)) }}</span> + </a> + @endcan + @can('updateInco', $product) + <a class="btn btn-sm btn-info" class="d-inline" + href="{{ route('bo.products.incos.edit', [ + 'product' => $product, + 'inco' => $product->inco, + ]) }}" + title="{{ __('crud.helpers.update_model', ['model' => trans_choice('models.classes.product_incos', 1)]) }}"> + <i class="fa-solid fa-pencil"></i> + <span>{{ Str::title(trans_choice('models.classes.product_incos', 1)) }}</span> + </a> + @endcan + @can('viewPublished', $product) + <a class="btn btn-sm btn-warning" href="{{ route('fo.products.show', $product) }}" target="_blank"> + <i class="fa-solid fa-eye"></i> + </a> + @endcan + </span> + @can('delete', $product) + <form class="d-inline confirmDeleteJS" action="{{ route('bo.products.destroy', $product) }}" method="POST"> + @method('DELETE') + @csrf + <button class="btn btn-sm btn-danger rounded-start-0" title="{{ __('crud.actions.delete') }}"><i + class="fa-solid fa-trash"></i></button> + </form> + @endcan + </div> + </div> + </div> + </div> + <div class="card-body"> + <form action="{{ route('bo.products.update', $product) }}" method="POST" enctype='multipart/form-data'> + @csrf + {{ method_field('PUT') }} + @include('bo.products.form', compact('product')) + <div class="text-center"> + <span class="d-block mb-3"> + <span class="badge text-bg-info">{{ __('crud.helpers.required_fields_with_aster') }}</span> + </span> + <button class="btn btn-primary" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> + </div> + </form> + </div> + </div> @endsection diff --git a/resources/views/bo/products/food_product.blade.php b/resources/views/bo/products/food_product.blade.php deleted file mode 100644 index 49c11890..00000000 --- a/resources/views/bo/products/food_product.blade.php +++ /dev/null @@ -1,326 +0,0 @@ -<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h2><small class="text-muted">Produit Alimentaire</small></h2> - <input type="hidden" id="product_type" name="product_type" value="foodProduct"> -</div> -<!--adding fields (food_products)--> -<div class="row"> - <div class="form-group col"> - <label for="no_art">No Article</label> - <input type="text" id="no_art" name="no_art" class="form-control" onblur="checkIncoData(this)" value="{{ old('no_art', $product->foodProduct->no_art) }}" @if(!empty($product->foodProduct->no_art)) disabled @endif> - </div> - <div class="form-group col"> - <label for="servings">Portions</label> - <input type="text" id="servings" name="servings" class="form-control" value="{{ old('servings', $product->foodProduct->servings) }}"> - </div> -</div> -<div class="form-group"> - <label>Ingredients</label> - <textarea class="form-control" id="ingredients" name="ingredients" placeholder="Ingredients">{{ old('ingredients', $product->foodProduct->ingredients) }}</textarea> - {{--<a class="btn btn-outline-info btn-sm" data-bs-toggle="collapse" href="#inco_lst_ing" aria-expanded="false" aria-controls="collapseExample">Donnée inco</a> - <div class="collapse row" id="inco_lst_ing"> - <div class="input-group mb-2"> - <div class="input-group-prepend"> - <a class="btn btn-secondary" onclick="paste('lst_ing','ingredients')">Reprendre cette donnée</a> - </div> - <div class="inco_data form-control alert-info" id="lst_ing">{{ $product->foodProduct->xmlInco->lst_ing }}</div> - </div> - </div>--}} -</div> -<div class="form-group"> - <label>Conseils d'utilisation</label> - <textarea class="form-control" id="preparation" name="preparation" placeholder="Preparation">{{ old('preparation', $product->foodProduct->preparation) }}</textarea> - @if (!empty($product->foodProduct->xmlInco)) - <a class="btn btn-outline-info btn-sm" data-bs-toggle="collapse" href="#inco_conseil_prepa" aria-expanded="false" aria-controls="collapseExample">Donnée inco</a> - <div class="collapse row" id="inco_conseil_prepa"> - <div class="input-group mb-2"> - <div class="input-group-prepend"> - <a class="btn btn-secondary" onclick="paste('conseil_prepa','preparation')">Reprendre cette donnée</a> - </div> - <div class="inco_data form-control alert-info" id="conseil_prepa">{{ $product->foodProduct->xmlInco->conseil_prepa }}</div> - </div> - </div> - @endif -</div> -<div class="form-group"> - <label for="allergens">Allergènes</label> - <input type="text" id="allergens" name="allergens" class="form-control" placeholder="Allergènes" value="{{ old('allergens', $product->foodProduct->allergens) }}"> -</div> -<div class="form-group"> - <label>Argument de vente</label> - <textarea class="form-control" id="selling_argument" name="selling_argument" placeholder="Agruments de vente">{{ old('selling_argument', $product->foodProduct->selling_argument) }}</textarea> - @if (!empty($product->foodProduct->xmlInco)) - <a class="btn btn-outline-info btn-sm" data-bs-toggle="collapse" href="#inco_arg_vente" aria-expanded="false" aria-controls="collapseExample">Donnée inco</a> - <div class="collapse row" id="inco_arg_vente"> - <div class="input-group mb-2"> - <div class="input-group-prepend"> - <a class="btn btn-secondary" onclick="paste('arg_vente','selling_argument')">Reprendre cette donnée</a> - </div> - <div class="inco_data form-control alert-info" id="arg_vente">{{ $product->foodProduct->xmlInco->arg_vente }}</div> - </div> - </div> - @endif -</div> -<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h3><small class="text-muted">Valeurs Nutritionnelles</small></h3> -</div> -<div class="row"> - <div class="form-group col"> - <label for="nv_ref_weight_g">Poids de référence (en g)</label> - <input type="number" id="nv_ref_weight_g" name="nv_ref_weight_g" min="0" step=".01" class="form-control" value="{{ old('nv_ref_weight_g', $product->foodProduct->nv_ref_weight_g) }}"> - </div> - <div class="form-group col"></div> -</div> -<div class="row"> - <div class="form-group col"> - <label for="nv_kj">Energie en Kj</label> - <input type="number" id="nv_kj" name="nv_kj" min="0" step="1" class="form-control" value="{{ old('nv_kj', $product->foodProduct->nv_kj) }}"> - </div> - <div class="form-group col"> - <label for="nv_kcal">Energie en Kcal</label> - <input type="number" id="nv_kcal" name="nv_kcal" min="0" step="1" class="form-control" value="{{ old('nv_kcal', $product->foodProduct->nv_kcal) }}"> - </div> -</div> -<div class="row"> - <div class="form-group col"> - <label for="nv_fat_g">Graisses (en g)</label> - <input type="number" id="nv_fat_g" name="nv_fat_g" min="0" step=".01" class="form-control" value="{{ old('nv_fat_g', $product->foodProduct->nv_fat_g) }}"> - </div> - <div class="form-group col"> - <label for="nv_sat_fat_g">Dont acides gras saturés (en g)</label> - <input type="number" id="nv_sat_fat_g" name="nv_sat_fat_g" min="0" step=".01" class="form-control" value="{{ old('nv_sat_fat_g', $product->foodProduct->nv_sat_fat_g) }}"> - </div> -</div> -<div class="row"> - <div class="form-group col"> - <label for="nv_carb_g">Glucides (en g)</label> - <input type="number" id="nv_carb_g" name="nv_carb_g" min="0" step=".01" class="form-control" value="{{ old('nv_carb_g', $product->foodProduct->nv_carb_g) }}"> - </div> - <div class="form-group col"> - <label for="nv_sugar_g">Dont sucres (en g)</label> - <input type="number" id="nv_sugar_g" name="nv_sugar_g" min="0" step=".01" class="form-control" value="{{ old('nv_sugar_g', $product->foodProduct->nv_sugar_g) }}"> - </div> - <div class="form-group col"> - <label for="nv_fiber_g">Fibres alimentaires (en g)</label> - <input type="number" id="nv_fiber_g" name="nv_fiber_g" min="0" step=".01" class="form-control" value="{{ old('nv_fiber_g', $product->foodProduct->nv_fiber_g) }}"> - </div> -</div> -<div class="row"> - <div class="form-group col"> - <label for="nv_protein_g">Protéines (en g)</label> - <input type="number" id="nv_protein_g" name="nv_protein_g" min="0" step=".01" class="form-control" value="{{ old('nv_protein_g', $product->foodProduct->nv_protein_g) }}"> - </div> - <div class="form-group col"> - <label for="nv_salt_g">Sel (en g)</label> - <input type="number" id="nv_salt_g" name="nv_salt_g" min="0" step=".01" class="form-control" value="{{ old('nv_salt_g', $product->foodProduct->nv_salt_g) }}"> - </div> -</div> -<!-- par portion --> -<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <small class="text-muted">Par portion</small> -</div> -<div class="row"> - <div class="form-group col"> - <label for="nv_serving_size_g">Portion (en g)</label> - <input type="number" id="nv_serving_size_g" name="nv_serving_size_g" min="0" step=".01" class="form-control" value="{{ old('nv_serving_size_g', $product->foodProduct->nv_serving_size_g) }}"> - </div> - <div class="form-group col"></div> -</div> -<div class="row"> - <div class="form-group col"> - <label for="nv_serving_kj">Energie en Kj</label> - <input type="number" id="nv_serving_kj" name="nv_serving_kj" min="0" step="1" class="form-control" value="{{ old('nv_serving_kj', $product->foodProduct->nv_serving_kj) }}"> - </div> - <div class="form-group col"> - <label for="nv_serving_kcal">Energie en Kcal</label> - <input type="number" id="nv_serving_kcal" name="nv_serving_kcal" min="0" step="1" class="form-control" value="{{ old('nv_serving_kcal', $product->foodProduct->nv_serving_kcal) }}"> - </div> -</div> -<div class="row"> - <div class="form-group col"> - <label for="nv_serving_fat_g">Graisses (en g)</label> - <input type="number" id="nv_serving_fat_g" name="nv_serving_fat_g" min="0" step=".01" class="form-control" value="{{ old('nv_serving_fat_g', $product->foodProduct->nv_serving_fat_g) }}"> - </div> - <div class="form-group col"> - <label for="nv_serving_sat_fat_g">Dont acides gras saturés (en g)</label> - <input type="number" id="nv_serving_sat_fat_g" name="nv_serving_sat_fat_g" min="0" step=".01" class="form-control" value="{{ old('nv_serving_sat_fat_g', $product->foodProduct->nv_serving_sat_fat_g) }}"> - </div> -</div> -<div class="row"> - <div class="form-group col"> - <label for="nv_serving_carb_g">Glucides (en g)</label> - <input type="number" id="nv_serving_carb_g" name="nv_serving_carb_g" min="0" step=".01" class="form-control" value="{{ old('nv_serving_carb_g', $product->foodProduct->nv_serving_carb_g) }}"> - </div> - <div class="form-group col"> - <label for="nv_serving_sugar_g">Dont sucres (en g)</label> - <input type="number" id="nv_serving_sugar_g" name="nv_serving_sugar_g" min="0" step=".01" class="form-control" value="{{ old('nv_serving_sugar_g', $product->foodProduct->nv_serving_sugar_g) }}"> - </div> - <div class="form-group col"> - <label for="nv_serving_fiber_g">Fibres alimentaires (en g)</label> - <input type="number" id="nv_serving_fiber_g" name="nv_serving_fiber_g" min="0" step=".01" class="form-control" value="{{ old('nv_serving_fiber_g', $product->foodProduct->nv_serving_fiber_g) }}"> - </div> -</div> -<div class="row"> - <div class="form-group col"> - <label for="nv_serving_protein_g">Protéines (en g)</label> - <input type="number" id="nv_serving_protein_g" name="nv_serving_protein_g" min="0" step=".01" class="form-control" value="{{ old('nv_serving_protein_g', $product->foodProduct->nv_serving_protein_g) }}"> - </div> - <div class="form-group col"> - <label for="nv_serving_salt_g">Sel (en g)</label> - <input type="number" id="nv_serving_salt_g" name="nv_serving_salt_g" min="0" step=".01" class="form-control" value="{{ old('nv_serving_salt_g', $product->foodProduct->nv_serving_salt_g) }}"> - </div> -</div> -<!-- en pourcentage des APR--> -<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <small class="text-muted">% de APR</small> -</div> -<div class="row"> - <div class="form-group col"> - <label for="nv_daily_energy">Energie</label> - <input type="number" id="nv_daily_energy" name="nv_daily_energy" min="0" step="1" class="form-control" value="{{ old('nv_daily_energy', $product->foodProduct->nv_daily_energy) }}"> - </div> - <div class="form-group col"></div> -</div> -<div class="row"> - <div class="form-group col"> - <label for="nv_daily_fat">Graisses (en g)</label> - <input type="number" id="nv_daily_fat" name="nv_daily_fat" min="0" step=".01" class="form-control" value="{{ old('nv_daily_fat', $product->foodProduct->nv_daily_fat) }}"> - </div> - <div class="form-group col"> - <label for="nv_daily_sat_fat">Dont acides gras saturés (en g)</label> - <input type="number" id="nv_daily_sat_fat" name="nv_daily_sat_fat" min="0" step=".01" class="form-control" value="{{ old('nv_daily_sat_fat', $product->foodProduct->nv_daily_sat_fat) }}"> - </div> -</div> -<div class="row"> - <div class="form-group col"> - <label for="nv_daily_carb">Glucides (en g)</label> - <input type="number" id="nv_daily_carb" name="nv_daily_carb" min="0" step=".01" class="form-control" value="{{ old('nv_daily_carb', $product->foodProduct->nv_daily_carb) }}"> - </div> - <div class="form-group col"> - <label for="nv_daily_sugar">Dont sucres (en g)</label> - <input type="number" id="nv_daily_sugar" name="nv_daily_sugar" min="0" step=".01" class="form-control" value="{{ old('nv_daily_sugar', $product->foodProduct->nv_daily_sugar) }}"> - </div> - <div class="form-group col"> - <label for="nv_daily_fiber">Fibres alimentaires (en g)</label> - <input type="number" id="nv_daily_fiber" name="nv_daily_fiber" min="0" step=".01" class="form-control" value="{{ old('nv_daily_fiber', $product->foodProduct->nv_daily_fiber) }}"> - </div> -</div> -<div class="row"> - <div class="form-group col"> - <label for="nv_daily_protein">Protéines (en g)</label> - <input type="number" id="nv_daily_protein" name="nv_daily_protein" min="0" step=".01" class="form-control" value="{{ old('nv_daily_protein', $product->foodProduct->nv_daily_protein) }}"> - </div> - <div class="form-group col"> - <label for="nv_daily_salt">Sel (en g)</label> - <input type="number" id="nv_daily_salt" name="nv_daily_salt" min="0" step=".01" class="form-control" value="{{ old('nv_daily_salt', $product->foodProduct->nv_daily_salt) }}"> - </div> -</div> -<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <small class="text-muted">Nutriscore</small> -</div> -<div class="form-group"> - <label for="nutriscore">Nutriscore</label> - <input type="text" id="nutriscore" name="nutriscore" class="form-control" placeholder="Score nutriscore (A, B, C, D, E)" value="{{ old('nutriscore', $product->foodProduct->nutriscore) }}"> -</div> -<div class="form-group"> - <label>Arguments Nutriscore</label> - <textarea class="form-control" id="nutriscore_args" name="nutriscore_args" placeholder="Arguments Nutriscore">{{ old('nutriscore_args', $product->foodProduct->nutriscore_args) }}</textarea> -</div> -<!-- fin fields food products--> -<div id="fancybox"> -</div> - -@section('scripts') - <script type="text/javascript"> - var editorConfig = { - removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"], - toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'blockQuote', 'insertTable', '|', 'undo', 'redo' ], - heading: { - options: [ - { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' }, - { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' }, - { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }, - { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' }, - { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' } - ] - }, - table: { - contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ] - } - }; - var ingredientsEditor; - ClassicEditor - .create( document.querySelector( '#ingredients' ), editorConfig) - .then( editor => { - ingredientsEditor = editor; - }) - .catch( error => { - console.error( error ); - } ); - var preparationEditor; - ClassicEditor - .create( document.querySelector( '#preparation' ), editorConfig) - .then( editor => { - preparationEditor = editor; - }) - .catch( error => { - console.error( error ); - } ); - var selling_argumentEditor; - ClassicEditor - .create( document.querySelector( '#selling_argument' ), editorConfig) - .then( editor => { - selling_argumentEditor = editor; - }) - .catch( error => { - console.error( error ); - } ); - - - function checkIncoData(target) { - this.processing = true; - axios.post('/bo/ajax/check-inco-data', { - id: target.value, - }).then( - (response) => { - if(response.data.length) { - $('#fancybox').html(response.data); - $.fancybox.open({ - src : '#hidden-content', - type : 'inline', - opts : { - afterShow : function( instance, current ) { - console.info( 'done!' ); - } - } - }); - } - this.processing = false; - } - ) - .catch(function (error) { - console.log(error); - alert('Erreur lors de la vérification.'); - this.processing = false; - }); - } - - - //tooltips - // selector and a `content` prop: - tippy('#no_art', { - content: "Code article référence pour les imports de données externes", - animation: 'scale', - }); - - - - const tippyInstances = tippy('[id^=nv_],#nutriscore,#allergens,#servings', { - content: "Cette information est susceptible d'être mise à jour automatiquement lors d'un import INCO", - }); - const singleton = createSingleton(tippyInstances, { - delay: 500, - moveTransition: 'transform 0.2s ease-out', - }); - </script> - @parent -@endsection diff --git a/resources/views/bo/products/form.blade.php b/resources/views/bo/products/form.blade.php new file mode 100644 index 00000000..d44b6014 --- /dev/null +++ b/resources/views/bo/products/form.blade.php @@ -0,0 +1,476 @@ +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ __('General Information') }}</legend> + <div class="row mb-3"> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="product-name"><b>{{ Str::ucfirst(__('validation.attributes.name')) }}</b></label> + <div class="word-counter" data-json='@json(['for' => 'product-name'])'></div> + <input class="form-control" id="product-name" name="name" type="text" value="{{ old('name', $product->name ?? '') }}" + aria-describedby="product-name-help" placeholder="{{ Str::ucfirst(__('validation.attributes.name')) }}" required> + @include('bo.modules.input-error', [ + 'inputName' => 'name', + 'helperId' => 'product-name-help', + 'helper' => __('Give your product a name.'), + ]) + </div> + + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="product-brand"> + <b>{{ Str::ucfirst(__('validation.custom.attributes.brand')) }}*</b> + <span data-bs-toggle="tooltip" title="{{ __('Product brand') }}"> + <i class="fas fa-question-circle"></i> + </span> + </label> + <select class="form-select" id="product-brand" name="brand" aria-describedby="product-brand-help"> + <option value="" @if (!old('brand', $product->brand ?? null)) selected @endif disabled> + {{ __('Select') . ' ' . __('validation.custom.attributes.brand') }} + </option> + @foreach ($brands as $brand) + <option value="{{ $brand->value() }}" @if (old('brand', optional($product ?? null)->brand?->value() ?? null) == $brand->value()) selected @endif>{{ $brand->label() }} + </option> + @endforeach + </select> + @include('bo.modules.input-error', [ + 'inputName' => 'brand', + 'helperId' => 'product-brand-help', + 'helper' => __('The brand associated with the product'), + ]) + </div> + + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="product-range"><b>{{ Str::ucfirst(trans_choice('models.classes.ranges', 1)) }}</b></label> + <select class="form-select" id="product-range" name="range_id" aria-describedby="product-range-help" required> + <option value="" @if (!old('range_id', $product->range_id ?? null)) selected @endif disabled> + {{ __('Select') . ' ' . trans_choice('models.classes.ranges', 1) }} + </option> + @foreach ($ranges as $rangeId => $rangeName) + <option value="{{ $rangeId }}" @if (old('range_id', $product->range_id ?? null) == $rangeId) selected @endif>{{ $rangeName }} + </option> + @endforeach + </select> + @include('bo.modules.input-error', [ + 'inputName' => 'range_id', + 'helperId' => 'product-range-help', + 'helper' => __('The range associated with the product'), + ]) + </div> + + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="product-tags"><b>{{ Str::ucfirst(trans_choice('models.classes.tags', \INF)) }}</b></label> + @php + $data = [ + 'name' => 'tags', + 'allowNew' => true, + 'value' => $product->tags ?? [], + 'itemsList' => $tags, + 'placeholder' => __('Add :name', [ + 'name' => trans_choice('models.classes.tags', 1), + ]), + ]; + @endphp + <div class="belongs-to-many-dropdown" data-json='@json($data)'></div> + @include('bo.modules.input-error', [ + 'inputName' => 'tags', + 'helperId' => 'product-tags-help', + 'helper' => __('Keywords associated with the product'), + ]) + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend> + <label class="h4" for="product-description">{{ Str::ucfirst(__('validation.attributes.description')) }}</label> + </legend> + <div class="row"> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" + for="product-short-description"><b>{{ Str::ucfirst(__('validation.custom.attributes.short_description')) }}</b></label> + <div class="word-counter" data-json='@json(['for' => 'product-short-description'])'></div> + <input class="form-control" id="product-short-description" name="short_description" type="text" + value="{{ old('short_description', $product->short_description ?? '') }}" aria-describedby="product-short-description-help" + placeholder="{{ Str::ucfirst(__('validation.custom.attributes.short_description')) }}" required> + @include('bo.modules.input-error', [ + 'inputName' => 'short_description', + 'helperId' => 'product-short-description-help', + 'helper' => __('Give the product a short description'), + ]) + </div> + </div> + <div class="row"> + <div class="col form-group"> + @include('bo.modules.input-error', ['inputName' => 'description']) + @php + $editor = [ + 'id' => 'product-description', + 'csrf' => csrf_token(), + 'name' => 'description', + 'text' => old('description', $product->description ?? '') ?? '', + ]; + @endphp + <div class="ck-editor" data-json='@json($editor)'></div> + </div> + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend> + <span class="h4">{{ Str::ucfirst(__('Media (Images)')) }}</span> + </legend> + + <h6 class="mt-2">{{ Str::ucfirst(__('validation.attributes.image')) }}</h6> + <div class="row mb-4"> + @include('bo.modules.input-error', ['inputName' => 'picture']) + @php + $jsonPic = [ + 'name' => 'picture', + 'single' => true, + 'width' => 200, + 'height' => 200, + 'preview' => false, + 'helper' => __('JPEG/PNG, 2Mo max.'), + 'value' => $product->picture ?? '', + ]; + @endphp + <div class="image-input mb-2" data-json='@json($jsonPic)'></div> + + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="picture-alt"><b>{{ Str::ucfirst(__('validation.custom.attributes.picture_alt')) }}</b></label> + <input class="form-control" id="picture-alt" name="picture_alt" type="text" + value="{{ old('picture_alt', $product->picture_alt ?? '') }}"> + @include('bo.modules.input-error', [ + 'inputName' => 'picture_alt', + 'helperId' => 'product-picture-alt-help', + 'helper' => __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.custom.attributes.picture_alt'), + 'inter' => __('validation.custom.of_the.male'), + 'model' => trans_choice('models.classes.products', 1), + ]), + 'min' => 4, + 'max' => 75, + ]), + ]) + </div> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" + for="picture-title"><b>{{ Str::ucfirst(__('validation.custom.attributes.picture_title')) }}</b></label> + <input class="form-control" id="picture-title" name="picture_title" type="text" + value="{{ old('picture_title', $product->picture_title ?? '') }}"> + @include('bo.modules.input-error', [ + 'inputName' => 'picture_title', + 'helperId' => 'product-picture-title-help', + 'helper' => __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.custom.attributes.picture_title'), + 'inter' => __('validation.custom.of_the.male'), + 'model' => trans_choice('models.classes.products', 1), + ]), + 'min' => 4, + 'max' => 75, + ]), + ]) + </div> + </div> + + <hr> + + <h6 class="mt-2">{{ Str::ucfirst(__('validation.custom.attributes.picture_large')) }}</h6> + <div class="row"> + @include('bo.modules.input-error', ['inputName' => 'picture_large']) + @php + $jsonPicLarge = [ + 'name' => 'picture_large', + 'single' => true, + 'width' => 500, + 'height' => 500, + 'preview' => false, + 'helper' => __('JPEG/PNG, 2MB max.'), + 'value' => $product->picture_large ?? '', + ]; + @endphp + <div class="image-input mb-2" data-json='@json($jsonPicLarge)'></div> + + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" + for="picture-large-alt"><b>{{ Str::ucfirst(__('validation.custom.attributes.picture_large_alt')) }}</b></label> + <input class="form-control" id="picture-large-alt" name="picture_large_alt" type="text" + value="{{ old('picture_large_alt', $product->picture_large_alt ?? '') }}"> + @include('bo.modules.input-error', [ + 'inputName' => 'picture_large_alt', + 'helperId' => 'product-picture-large-alt-help', + 'helper' => __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.custom.attributes.picture_large_alt'), + 'inter' => __('validation.custom.of_the.male'), + 'model' => trans_choice('models.classes.products', 1), + ]), + 'min' => 4, + 'max' => 75, + ]), + ]) + </div> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" + for="picture-large-title"><b>{{ Str::ucfirst(__('validation.custom.attributes.picture_large_title')) }}</b></label> + <input class="form-control" id="picture-large-title" name="picture_large_title" type="text" + value="{{ old('picture_large_title', $product->picture_large_title ?? '') }}"> + @include('bo.modules.input-error', [ + 'inputName' => 'picture_large_title', + 'helperId' => 'product-picture-large-title-help', + 'helper' => __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.custom.attributes.picture_large_title'), + 'inter' => __('validation.custom.of_the.male'), + 'model' => trans_choice('models.classes.products', 1), + ]), + 'min' => 4, + 'max' => 75, + ]), + ]) + </div> + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ __('Pricing, Stock & Units') }}</legend> + <div class="row mb-3"> + <div class="col-12 col-md-4 form-group"> + <label class="col-form-label" for="product-price"><b>{{ Str::ucfirst(__('validation.attributes.price')) }}</b></label> + <div class="input-group mb-3"> + <input class="form-control" id="discount-value" name="price" data-money-input type="number" + value="{{ old('price', optional($product ?? null)->price?->getAmount() ?? '') }}" step="0.01" min="0" required> + <span class="input-group-text">@currency()</span> + </div> + @include('bo.modules.input-error', ['inputName' => 'price']) + </div> + + <div class="col-12 col-md-5 form-group"> + <label class="col-form-label" for="product-tax"><b>{{ Str::ucfirst(__('validation.custom.attributes.tax_rate')) }}</b></label> + <select class="form-select" id="product-tax" name="tax_rate" aria-describedby="product-tax-help" required> + <option value="" @if (!old('tax_rate', $product->tax_rate ?? null)) selected @endif disabled> + {{ __('Select') . ' ' . __('validation.custom.attributes.tax_rate') }} + </option> + @foreach ($taxes as $tax) + <option value="{{ $tax->value() }}" @if (old('tax_rate', optional($product ?? null)->tax_rate?->value() ?? null) == $tax->value()) selected @endif>{{ $tax->label() }} + </option> + @endforeach + </select> + @include('bo.modules.input-error', [ + 'inputName' => 'tax_rate', + ]) + </div> + + <div class="col-12 col-md-3 form-group"> + <label class="col-form-label" for="product-stock"><b>{{ Str::ucfirst(__('Stock')) }}</b></label> + <input class="form-control" id="product-stock" name="stock" type="number" + value="{{ old('stock', $product->stock ?? '') }}" step="1" min="0" required> + @include('bo.modules.input-error', ['inputName' => 'stock']) + </div> + + {{-- SELL UNIT --}} + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="product-sell-unit"> + <b>{{ Str::ucfirst(__('validation.custom.attributes.sell_unit')) }}</b> + <span data-bs-toggle="tooltip" title="{{ __('Consumer sales unit') }}"> + <i class="fas fa-question-circle"></i> + </span> + </label> + <select class="form-select" id="product-sell-unit" name="sell_unit" aria-describedby="product-sell-unit-help" required> + <option value="" @if (!old('sell_unit', $product->sell_unit ?? null)) selected @endif disabled> + {{ __('Select') . ' ' . __('validation.custom.attributes.sell_unit') }} + </option> + @foreach ($sellUnits as $sellUnit) + <option value="{{ $sellUnit->value() }}" @if (old('sell_unit', optional($product ?? null)->sell_unit?->value() ?? null) == $sellUnit->value()) selected @endif>{{ $sellUnit->label() }} + </option> + @endforeach + </select> + @include('bo.modules.input-error', [ + 'inputName' => 'sell_unit', + ]) + </div> + + {{-- ORDER UNIT --}} + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="product-order-unit"> + <b>{{ Str::ucfirst(__('validation.custom.attributes.order_unit')) }}</b> + <span data-bs-toggle="tooltip" title="{{ __('Unit used when transmitting the order to Regate') }}"> + <i class="fas fa-question-circle"></i> + </span> + </label> + <select class="form-select" id="product-order-unit" name="order_unit" aria-describedby="product-order-unit-help" required> + <option value="" @if (!old('order_unit', $product->order_unit ?? null)) selected @endif disabled> + {{ __('Select') . ' ' . __('validation.custom.attributes.order_unit') }} + </option> + @foreach ($orderUnits as $orderUnit) + <option value="{{ $orderUnit->value() }}" @if (old('order_unit', optional($product ?? null)->order_unit?->value() ?? null) == $orderUnit->value()) selected @endif>{{ $orderUnit->label() }} + </option> + @endforeach + </select> + @include('bo.modules.input-error', [ + 'inputName' => 'order_unit', + ]) + </div> + + {{-- INVOICE UNIT --}} + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="product-invoicing-unit"> + <b>{{ Str::ucfirst(__('validation.custom.attributes.invoicing_unit')) }}</b> + <span data-bs-toggle="tooltip" title="{{ __('Base unit used to determine the price') }}"> + <i class="fas fa-question-circle"></i> + </span> + </label> + <select class="form-select" id="product-invoicing-unit" name="invoicing_unit" aria-describedby="product-invoicing-unit-help" + required> + <option value="" @if (!old('invoicing_unit', $product->invoicing_unit ?? null)) selected @endif disabled> + {{ __('Select') . ' ' . __('validation.custom.attributes.invoicing_unit') }} + </option> + @foreach ($invoicingUnits as $invoicingUnit) + <option value="{{ $invoicingUnit->value() }}" @if (old('invoicing_unit', optional($product ?? null)->invoicing_unit?->value() ?? null) == $invoicingUnit->value()) selected @endif> + {{ $invoicingUnit->label() }} + </option> + @endforeach + </select> + @include('bo.modules.input-error', [ + 'inputName' => 'invoicing_unit', + ]) + </div> + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ Str::ucfirst(__('validation.custom.attributes.weight')) }}</legend> + <div class="row mb-3"> + <div class="col-12 col-md-4 form-group"> + <label class="col-form-label" for="product-weight"><b>{{ Str::ucfirst(__('validation.custom.attributes.weight')) }} (Kg)</b></label> + <input class="form-control" id="product-weight" name="weight" type="number" + value="{{ old('weight', isset($product->weight) ? round($product->weight / 1000, 3) : '') }}" step="0.001"> + @include('bo.modules.input-error', ['inputName' => 'weight']) + </div> + + <div class="col-12 col-md-4 form-group pt-4"> + <input class="form-check-input mt-2" id="product-weight-var" name="weight_variable" type="checkbox" value="1" + @checked(old('weight_variable', $product->weight_variable ?? '0'))> + <label class="col-form-label pt-1" + for="product-weight-var"><b>{{ Str::ucfirst(__('validation.custom.attributes.weight_variable')) }}</b></label> + </div> + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ __('Order period') }}</legend> + <div class="row mb-3"> + <div class="col-12 col-md-4 form-group"> + <label class="col-form-label" + for="orderable-start"><b>{{ Str::ucfirst(__('validation.custom.attributes.date_start_orderable')) }}</b></label> + <input class="form-control" id="orderable-start" name="orderable_start" type="datetime-local" + value="{{ old('orderable_start', Date::toLocalInput($product->orderable_start ?? '')) }}"> + @include('bo.modules.input-error', ['inputName' => 'orderable_start']) + </div> + + <div class="col-12 col-md-4 form-group"> + <label class="col-form-label" + for="orderable-end"><b>{{ Str::ucfirst(__('validation.custom.attributes.date_end_orderable')) }}</b></label> + <input class="form-control" id="orderable-end" name="orderable_end" type="datetime-local" + value="{{ old('orderable_end', Date::toLocalInput($product->orderable_end ?? '')) }}"> + @include('bo.modules.input-error', ['inputName' => 'orderable_end']) + </div> + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend><span class="h4">{{ Str::ucfirst(__('validation.custom.attributes.associated_products')) }}</span></legend> + + <div class="row"> + <div class="col form-group"> + @php + $json = [ + 'name' => 'associated_products', + 'available' => $existingProds ?? [], + 'selected' => $selectedProds ?? [], + ]; + @endphp + + <div id="product-drag-and-drop" data-json='@json($json)'></div> + + @include('bo.modules.input-error', [ + 'inputName' => 'associated_products', + 'helperId' => 'associated-products-help', + 'helper' => __('Drag and drop products to associate them.'), + ]) + </div> + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ Str::ucfirst(__('validation.custom.attributes.status')) }}</legend> + + <div class="row"> + <!-- STATUS --> + <div class="col form-group pt-3"> + <input class="form-check-input mt-2" id="product-status" name="status" type="checkbox" value="1" + aria-describedby="product-status-help" @checked(old('status', $product->status ?? ''))> + <label class="col-form-label pt-1" class="form-check-label" + for="product-status"><b>{{ Str::ucfirst(__('validation.custom.attributes.status')) }}</b></label><br> + @include('bo.modules.input-error', [ + 'inputName' => 'status', + 'helperId' => 'product-status-help', + 'helper' => __('Check to publish the product'), + ]) + </div> + + <!-- STAR --> + <div class="col form-group pt-3"> + <input class="form-check-input mt-2" id="product-star" name="star" type="checkbox" value="1" + aria-describedby="product-star-help" @checked(old('star', $product->star ?? ''))> + <label class="col-form-label pt-1" class="form-check-label" + for="product-star"><b>{{ Str::ucfirst(__('validation.custom.attributes.star')) }}</b></label><br> + @include('bo.modules.input-error', [ + 'inputName' => 'star', + 'helperId' => 'product-star-help', + 'helper' => __('Check to highlight the product'), + ]) + </div> + </div> + </fieldset> + </div> +</div> + +<input id="client-timezone" name="client_timezone" type="hidden"> + +@push('scripts') + <script nonce="{{ Vite::cspNonce() }}"> + document.addEventListener('DOMContentLoaded', function() { + const tz = Intl.DateTimeFormat().resolvedOptions().timeZone; + document.getElementById('client-timezone').value = tz; + }); + </script> +@endpush diff --git a/resources/views/bo/products/garment_product.blade.php b/resources/views/bo/products/garment_product.blade.php deleted file mode 100644 index d872264d..00000000 --- a/resources/views/bo/products/garment_product.blade.php +++ /dev/null @@ -1,21 +0,0 @@ -<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h2><small class="text-muted">Vêtement</small></h2> - <input type="hidden" id="product_type" name="product_type" value="garmentProduct"> -</div> -<!--adding fields (garment_products)--> -<div class="row"> - <div class="form-group col"> - <label for="size">Taille</label> - <input type="text" id="size" name="size" class="form-control" value="{{ old('size', $product->garmentProduct->size) }}"> - </div> - <div class="form-group col"> - <label for="color">Couleur</label> - <input type="text" id="color" name="color" class="form-control" value="{{ old('color', $product->garmentProduct->color) }}"> - </div> -</div> -<div class="row"> - <div class="form-group col"> - <label for="material">Matière</label> - <input type="text" id="material" name="material" class="form-control" value="{{ old('material', $product->garmentProduct->material) }}"> - </div> -</div> diff --git a/resources/views/bo/products/inco-images.blade.php b/resources/views/bo/products/inco-images.blade.php deleted file mode 100644 index 2d5e1ea0..00000000 --- a/resources/views/bo/products/inco-images.blade.php +++ /dev/null @@ -1,12 +0,0 @@ -@foreach ($preparedImages as $media) - <div class="input-group mb-2"> - <div class="input-group-prepend"> - <a class="btn btn-secondary" onclick="setPicture('{{ $media }}')">Ecraser les visuels actuel avec cette image</a> - </div> - <div class="inco_data form-control alert-info"> - <a data-fancybox="gallery" href="/storage/{{ $media }}"> - <img src="/storage/{{ $media }}" alt="visuel Inco" style="max-height: 100px;"> - </a> - </div> - </div> -@endforeach diff --git a/resources/views/bo/products/index-filters.blade.php b/resources/views/bo/products/index-filters.blade.php new file mode 100644 index 00000000..be7a38d9 --- /dev/null +++ b/resources/views/bo/products/index-filters.blade.php @@ -0,0 +1,140 @@ +<form class="row justify-content-center" id="filter-form" action="{{ request()->getRequestUri() }}"> + <div class="col-xl-6 mb-3"> + {{-- BRANDS --}} + <div class="input-group"> + <label class="input-group-text" for="filter-form-brand"> + {{ __('Filter by :value', [ + 'value' => __('validation.custom.attributes.brand'), + ]) }} + </label> + <select class="form-select" id="filter-form-brand" name="brand"> + <option value="" @selected(!Session::get('products.filter.brand'))> + {{ __('Select') . ' ' . __('validation.custom.attributes.brand') }} + </option> + @foreach ($brands as $brand) + <option value="{{ $brand->value() }}" @selected(Session::get('products.filter.brand') === strval($brand->value()))>{{ $brand->label() }}</option> + @endforeach + </select> + </div> + </div> + <div class="col-xl-6 mb-3"> + {{-- RANGES --}} + <div class="input-group"> + <label class="input-group-text" for="filter-form-range"> + {{ __('Filter by :value', [ + 'value' => trans_choice('models.classes.ranges', 1), + ]) }} + </label> + <select class="form-select" id="filter-form-range" name="range"> + <option value="" @selected(!Session::get('products.filter.range'))> + {{ __('Select') . ' ' . trans_choice('models.classes.ranges', 1) }} + </option> + @foreach ($ranges as $id => $rangeName) + <option value="{{ $id }}" @selected(Session::get('products.filter.range') === strval($id))>{{ $rangeName }}</option> + @endforeach + </select> + </div> + </div> + <div class="col-xl-6 mb-3"> + {{-- TAGS --}} + <div class="input-group"> + <label class="input-group-text" for="filter-form-tag"> + {{ __('Filter by :value', [ + 'value' => trans_choice('models.classes.tags', 1), + ]) }}</label> + <select class="form-select" id="filter-form-tag" name="tag"> + <option value="" @selected(!Session::get('products.filter.tag'))> + {{ __('Select') . ' ' . trans_choice('models.classes.tags', 1) }} + </option> + @foreach ($tags as $id => $tagLabel) + <option value="{{ $id }}" @selected(Session::get('products.filter.tag') === strval($id))>{{ $tagLabel }}</option> + @endforeach + </select> + </div> + </div> + <div class="col-xl-6 mb-3"> + {{-- DISCOUNT --}} + <div class="input-group"> + <label class="input-group-text" for="filter-form-discount"> + {{ __('Filter by :value', [ + 'value' => trans_choice('models.classes.discounts', 1), + ]) }} + </label> + <select class="form-select" id="filter-form-discount" name="discount"> + <option value="" @selected(!Session::has('products.filter.discount') || Session::get('products.filter.discount') === null || Session::get('products.filter.discount') === '')> + {{ __('Select') . ' ' . trans_choice('models.classes.discounts', 1) }} + </option> + <option value="0" @selected(Session::get('products.filter.discount') === '0')> + {{ __('All discounts') }} + </option> + @foreach ($discounts as $id => $discountLabel) + <option value="{{ $id }}" @selected(Session::get('products.filter.discount') === strval($id))> + {{ $discountLabel }} + </option> + @endforeach + </select> + </div> + </div> + <div class="col-xl-6 mb-3"> + {{-- STAR --}} + <div class="d-flex flex-row"> + <div class="input-group"> + <label class="input-group-text" for="filter-form-starred">{{ __('crud.helpers.starred') }}</label> + <div class="input-group-text"> + <input class="form-check-input" id="filter-form-starred" name="star" type="checkbox" @checked(Session::get('products.filter.star'))> + </div> + </div> + <a class="btn btn-sm btn-secondary mx-auto my-1 ms-2" data-bs-toggle="tooltip" + href="{{ request()->fullUrlWithQuery([ + 'brand' => '', + 'tag' => '', + 'range' => '', + 'discount' => '', + 'star' => null, + ]) }}" + title="{{ __('Reset filters') }}"> + <i class="fa-solid fa-rotate-left"></i></a> + </div> + </div> +</form> + +@push('scripts') + <script nonce="{{ Vite::cspNonce() }}"> + document.addEventListener('DOMContentLoaded', function() { + const filterForm = document.getElementById('filter-form'); + const filterFormRage = document.getElementById('filter-form-range'); + const filterFormBrand = document.getElementById('filter-form-brand'); + const filterFormTag = document.getElementById('filter-form-tag'); + const filterFormDiscount = document.getElementById('filter-form-discount'); + const filterFormStarred = document.getElementById('filter-form-starred'); + if ( + !filterForm || + !filterFormRage || + !filterFormBrand || + !filterFormTag || + !filterFormDiscount || + !filterFormStarred + ) { + console.error('missing element'); + return; + } + const submit = () => { + const url = new URL(window.location.href); + Object.values(filterForm).forEach((el) => { + if (el.tagName === 'SELECT') { + url.searchParams.set(el.name, el.value) + } + if (el.type === 'checkbox') { + url.searchParams.set(el.name, el.checked) + } + }); + window.location = url; + }; + filterFormRage.addEventListener('change', submit); + filterFormBrand.addEventListener('change', submit); + filterFormTag.addEventListener('change', submit); + filterFormDiscount.addEventListener('change', submit); + filterFormStarred.addEventListener('change', submit); + }); + </script> +@endpush diff --git a/resources/views/bo/products/index-list.blade.php b/resources/views/bo/products/index-list.blade.php new file mode 100644 index 00000000..a486f1a4 --- /dev/null +++ b/resources/views/bo/products/index-list.blade.php @@ -0,0 +1,150 @@ +<div class="table-responsive"> + <table class="fix-action table"> + <thead> + <tr class="visually-hidden"> + <th scope="col"></th> + </tr> + @php + $cols = [ + 'inco' => Str::ucfirst(__('validation.custom.attributes.inco_id')), + 'name' => Str::ucfirst(__('validation.attributes.name')), + 'picture' => Str::ucfirst(__('validation.attributes.image')), + 'picture_large' => Str::ucfirst(__('validation.custom.attributes.image_large')), + 'brand' => Str::ucfirst(__('validation.custom.attributes.brand')), + 'price' => Str::ucfirst(__('validation.attributes.price')), + 'discount_id' => Str::ucfirst(trans_choice('models.classes.discounts', 1)), + 'stock' => Str::ucfirst(__('validation.custom.attributes.stock')), + 'range_id' => Str::ucfirst(trans_choice('models.classes.ranges', 1)), + 'order' => Str::ucfirst(__('validation.custom.attributes.order')), + 'status' => Str::ucfirst(__('validation.custom.attributes.status')), + 'star' => Str::ucfirst(__('validation.custom.attributes.star')), + ]; + if ($products->count() > \Domain\Enums\Pagination\ItemsPerPaginationEnum::five->value()) { + $cols = array_merge(['checker' => ''], $cols); + } + if (request()->routeIs('bo.merch.starred')) { + unset($cols['order']); + unset($cols['star']); + } + @endphp + @include('bo.modules.tableColSorter', [ + 'cols' => $cols, + 'mobileHide' => ['picture', 'picture_large'], + 'ignore' => ['inco', 'checker', 'picture', 'picture_large'], + ]) + </thead> + <tbody> + @forelse ($products as $product) + <tr class="checker-line"> + @if ($products->count() > \Domain\Enums\Pagination\ItemsPerPaginationEnum::five->value()) + <td> + <input class="checker form-check-input" name="checker[{{ $product->id }}]" data-bs-toggle="tooltip" type="checkbox" + value="{{ $product->id }}" title="{{ __('Select the row') }}"> + </td> + @endif + <td>{{ $product->inco?->no_art ?? __('No Content') }}</td> + <td>{{ Str::limit($product->name, 45) }}</td> + <td class="d-none d-md-table-cell"> + @if (!empty($product->picture)) + <img class="img-fluid mw-5" src="{{ asset($product->picture) }}" title="{{ $product->picture_title }}" + alt="{{ $product->picture_alt }}"> + @else + <span>{{ __('No Content') }}</span> + @endif + </td> + <td class="d-none d-md-table-cell"> + @if (!empty($product->picture_large)) + <img class="img-fluid mw-5" src="{{ asset($product->picture_large) }}" title="{{ $product->picture_large_title }}" + alt="{{ $product->picture_large_alt }}"> + @else + <span>{{ __('No Content') }}</span> + @endif + </td> + <td>{{ Str::title($product->brand?->label()) }}</td> + <td>@money($product->price)</td> + <td>@include('bo.discounts.display-discount-value', [ + 'discount' => $product->discount, + ])</td> + <td>{{ Number::forHumans($product->stock) }}</td> + <td> + <a class="btn btn-sm btn-primary" href="{{ route('bo.ranges.edit', $product->range) }}" + title="{{ __('crud.helpers.edit_model', ['model' => trans_choice('models.classes.ranges', 1)]) }}"> + {{ Str::limit($product->range->name, 12) }} + </a> + </td> + @if (!request()->routeIs('bo.merch.starred')) + @include('bo.modules.change-order', [ + 'route' => 'bo.products.change-order', + 'selectRoute' => 'bo.products.change-selected-order', + 'model' => $product, + 'first' => $loop->first, + 'last' => $loop->last, + 'isFirstPage' => $products->onFirstPage(), + 'isLastPage' => !$products->hasMorePages(), + 'noOrder' => $noOrder ?? false, + ]) + @endif + <td> + @include('bo.modules.toggle-status', [ + 'route' => 'bo.products.toggle-status', + 'model' => $product, + ]) + </td> + @if (!request()->routeIs('bo.merch.starred')) + <td> + @include('bo.modules.toggle-star', [ + 'route' => 'bo.products.toggle-star', + 'model' => $product, + ]) + </td> + @endif + <td> + <div class="large-actionsbar-buttons"> + @can('viewPublished', $product) + <a class="btn btn-sm btn-warning g-0" href="{{ route('fo.products.show', $product) }}" target="_blank"> + <i class="fa-solid fa-eye"></i> + </a> + @endcan + @can('createInco', $product) + <a class="btn btn-sm btn-primary" class="d-inline" href="{{ route('bo.products.incos.create', $product) }}" + title="{{ __('crud.helpers.associate_model', ['model' => trans_choice('models.classes.product_incos', 1)]) }}"> + <i class="fa-solid fa-plate-wheat"></i> + </a> + @endcan + @can('updateInco', $product) + <a class="btn btn-sm btn-info" class="d-inline" + href="{{ route('bo.products.incos.edit', [ + 'product' => $product, + 'inco' => $product->inco, + ]) }}" + title="{{ __('crud.helpers.update_model', ['model' => trans_choice('models.classes.product_incos', 1)]) }}"> + <i class="fa-solid fa-plate-wheat"></i> + </a> + @endcan + @can('update', $product) + <a class="btn btn-sm btn-primary" href="{{ route('bo.products.edit', $product) }}" + title="{{ Str::ucfirst(__('crud.actions.update')) }}"><i class="fa-solid fa-pen"></i></a> + @endcan + @if (!request()->routeIs('bo.merch.starred')) + @can('delete', $product) + <form class="d-inline confirmDeleteJS" action="{{ route('bo.products.destroy', $product) }}" method="POST"> + @method('DELETE') + @csrf + <button class="btn btn-sm btn-danger" title="{{ Str::ucfirst(__('crud.actions.delete')) }}"><i + class="fa-solid fa-trash"></i></button> + </form> + @endcan + @endif + </div> + </td> + </tr> + @empty + <tr> + <td class="text-center" colspan="20"> + <span class="h3">{{ __('crud.helpers.no_results') }}</span> + </td> + </tr> + @endforelse + </tbody> + </table> +</div> diff --git a/resources/views/bo/products/index.blade.php b/resources/views/bo/products/index.blade.php index 2ac8205a..cb00b4fd 100644 --- a/resources/views/bo/products/index.blade.php +++ b/resources/views/bo/products/index.blade.php @@ -1,134 +1,71 @@ -@extends('layouts.bo-layout') +@extends('bo.layouts.layout') + +@if (request()->routeIs('bo.merch.starred')) + @section('title', __('crud.helpers.starred')) +@else + @section('title', Str::ucfirst(trans_choice('models.classes.products', \INF))) +@endif + +@section('breadcrumb', request()->route()->getName()) @section('content') -<div class="pt-3 pb-2 mb-3 border-bottom"> - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center "> - <h1 class="h2">Produits <small class="text-muted">Liste</small></h1> - <div class="dropdown"> - <button class="btn btn-primary float-right dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> - Ajouter un produit - </button> - <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> - @foreach (Config::get('theme.enum_product_types') as $productType => $label) - <a class="dropdown-item" href="{{route('bo.products.create', $productType)}}">{{ __($label) }}</a> - @endforeach - </div> - </div> - </div> - <form class="row" method="GET"> - <div class="col-12 col-md-6"> - <label for="filter_name" class="col-form-label">Nom</label> - <input class="form-control" type="text" - placeholder="Recherchez un produit" - id="filter_name" name="filter_name" - value="{{ $filter_name ?? ''}}"> - </div> - <div class="col-12 col-md-6"> - <label for="filter_range" class="col-form-label">Gamme</label> - <select class="form-control" id="filter_range" name="filter_range"> - <option value="" @if ($filter_range == '') selected @endif>Toutes</option> - @foreach($ranges as $range) - <option value="{{$range->id}}" @if ($range->id == $filter_range) selected @endif>{{$range->name}}</option> - @endforeach - </select> - </div> - <div class="col-12 col-md-6"> - <label for="filter_code_product" class="col-form-label">Code produit</label> - <input class="form-control" type="number" - placeholder="Recherchez un code produit" - id="filter_code_product" name="filter_code_product" - value="{{ $filter_code_product ?? ''}}"> - </div> - <div class="col-12 col-md-6"> - <label for="filter_range" class="col-form-label">Marque</label> - <select class="form-control" id="filter_brand" name="filter_brand"> - <option value="" @if ($filter_brand == '') selected @endif>Toutes</option> - @foreach (ProductBrand::toArray() as $productbrand) - <option value="{{ $productbrand->value }}" @if ($productbrand->value == $filter_brand) selected @endif>{{ $productbrand->label }}</option> - @endforeach - </select> - </div> - <div class="col-12 text-center mt-3 mb-2"> - <button class="btn btn-primary">Filtrer</button> - <a class="btn btn-info" href="{{ route('bo.products.index') }}">Effacer le filtre</a> - </div> - </form> -</div> -<table class="table"> - <thead> - @if(count(Config::get('theme.enum_product_types')) > 1) - <th scope="col">Type</th> - @endif - <th scope="col">Code produit</th> - <th scope="col">Image</th> - <th scope="col">Nom</th> - <th scope="col">Marque</th> - <th scope="col">Prix en €</th> - <th scope="col">Stock</th> - <th scope="col">Gamme</th> - <th scope="col">Publié</th> - <th scope="col">Ordre</th> - <th></th> - </thead> - <tbody> - @foreach ($products as $key => $product) - <tr> - @if(count(Config::get('theme.enum_product_types'))>1) - <td> - {{ Config::get('theme.enum_product_types')[$product->product_type] }} - </td> + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + @if (request()->routeIs('bo.merch.starred')) + {{ __('crud.helpers.starred') }} + @else + {{ Str::ucfirst(trans_choice('models.classes.products', \INF)) }} {{ Str::ucfirst(__('crud.actions.list')) }} @endif - <td> - @if($product->product_type == "foodProduct") - {{ $product->foodProduct->no_art }} - @endif - </td> - <td> - @if ($product->picture !== null) - <a data-fancybox="gallery" href="/storage/images/produits/{{ $product->picture }}"> - <img src="/storage/images/produits/{{ $product->picture }}" alt="{{ $product->name }}" style="max-height: 100px;"> - </a> - @endif - </td> - <td>{{ $product->name }}</td> - <td>{{ $product->brand->label ?? '' }}</td> - <td>{{ number_format($product->price, 2, ',', ' ') }}€</td> - <td>{{ number_format($product->stock, 0, ',', ' ') }}</td> - <td>{{ $product->range->name }}</td> - <td> - <form action="{{ route('bo.products.change-published', $product) }}" method="POST"> - @csrf - <button type="submit" - class="btn btn-sm" - title="{{ __($product->status ? __('Dépublier') : __('Publier')) }}" - data-bs-toggle="tooltip"> - @if($product->status) - <i class="fas fa-check check-green"></i> - @else - <i class="fas fa-times cross-red"></i> - @endif - </button> - </form> - </td> - @include('bo.modules.change-model-order-select', [ - 'model' => $product, - 'value' => $key + 1 + ($products->currentPage() - 1) * $products->perPage(), - ]) - <td class="text-center"> - <a href="{{ route('bo.products.edit', $product->id) }}" class="btn btn-sm btn-primary">Éditer</a> - <form action="{{ route('bo.products.destroy', $product->id) }}" method="POST" class="d-inline"> - @method('DELETE') - @csrf - <input type="submit" class="btn btn-sm btn-danger" value="Supprimer" - onclick="return confirm('Êtes-vous sûr(e) ?')"> - </form> - </td> - </tr> - @endforeach - </tbody> -</table> -@if($products instanceof \Illuminate\Pagination\LengthAwarePaginator ) -{{ $products->appends(['filter_name' => $filter_name,'filter_range' => $filter_range])->links() }} -@endif + </h1> + </div> + <div class="col-3"> + <div class="input-group justify-content-end"> + @if (!request()->routeIs('bo.merch.starred')) + @can('create', \App\Models\Product::class) + <a class="btn btn-primary" href="{{ route('bo.products.create') }}" + title="{{ Str::ucfirst(__('crud.actions.create')) }} {{ Str::ucfirst(trans_choice('models.classes.products', \INF)) }}"><i + class="fa-solid fa-square-plus"></i></a> + @endcan + @endif + </div> + </div> + </div> + </div> + <div class="card-body"> + @if (!request()->routeIs('bo.merch.starred')) + @include('bo.modules.search-bar', compact('searchFields')) + @include('bo.products.index-filters', compact('brands', 'ranges', 'tags', 'discounts')) + @endif + @if ($products->count() > \Domain\Enums\Pagination\ItemsPerPaginationEnum::five->value()) + <div class="row justify-content-center"> + <div class="col-12 p-md-3 d-sm-flex justify-between p-0"> + <div class="w-25 my-2 me-5"> + @include('bo.modules.checker-mass-actions', [ + 'class' => \App\Models\Product::class, + 'route' => route('bo.products.mass-actions'), + 'toggleStar' => true, + 'togglePublish' => true, + ]) + </div> + <div class="flex-grow-1 my-2"> + {{ $products->withQueryString()->onEachSide(1)->links() }} + </div> + </div> + </div> + @endif + <div class="row"> + <div class="col"> + @include('bo.products.index-list') + </div> + </div> + <div class="row justify-content-center"> + <div class="col-12 p-md-3 p-0"> + {{ $products->withQueryString()->onEachSide(1)->links() }} + </div> + </div> + </div> + </div> @endsection - diff --git a/resources/views/bo/products/load-inco.blade.php b/resources/views/bo/products/load-inco.blade.php deleted file mode 100644 index e2d410a0..00000000 --- a/resources/views/bo/products/load-inco.blade.php +++ /dev/null @@ -1,89 +0,0 @@ -<div class="modal-container fancybox-content" style="display: none;" id="hidden-content"> - <div class="modal-title">Des données Incos ont été trouvées</div> - <div class="modal-body"> - @if (!empty($hasInco)) - <div class="alert alert-success">{{ $hasInco }}</div> - <div class="alert alert-info"> - Article : {{ $xmlInco->id }} - {{ $xmlInco->nom }}<br/> - {{ $xmlInco->descriptif }} - @if (!empty($xmlInco->picture)) - <br/>Images : - @foreach ($preparedImages as $media) - <img src="/storage/{{ $media }}" alt="visuel Inco" style="max-height: 100px;"> - @endforeach - </div> - <div class="alert alert-danger"> - <i class="fas fa-exclamation-triangle"></i> Les images ne peuvent être importée directement, vous devez d'abord associer les données puis sauvegarder le produit. - Il sera alors possible de reprendre les images. - </div> - @else - </div> - @endif - @endif - </div> - <div class="modal-footer"> - <a href="javascript:;" class="btn btn-primary" onclick="loadInco()">{{__('Yes please!')}}</a> - <a href="javascript:;" class="btn btn-secondary" data-fancybox-close="">{{__('Non Merci')}}</a> - </div> - <button type="button" data-fancybox-close="" class="fancybox-button fancybox-close-small" title="Close"><svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 24 24"><path d="M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z"></path></svg></button> -</div> -<script> - var dataInco = @json($xmlInco); - function loadInco() { - //map all data - if($('[name="name"]').val()=='') { - $('[name="name"]').val(dataInco['nom'] ?? ''); - } - $('[name="description"]').val(dataInco['descriptif'] ?? ''); - window['descriptionEditor'].setData(dataInco['descriptif'] ?? ''); - - $('[name="ingredients"]').val(dataInco['lst_ing'] ?? ''); - window['ingredientsEditor'].setData(dataInco['lst_ing'] ?? ''); - $('[name="allergens"]').val(dataInco['lib_allergene'] ?? ''); - - $('[name="preparation"]').val(dataInco['conseil_prepa'] ?? ''); - window['preparationEditor'].setData(dataInco['conseil_prepa'] ?? ''); - $('[name="selling_argument"]').val(dataInco['arg_vente'] ?? ''); - window['selling_argumentEditor'].setData(dataInco['arg_vente'] ?? ''); - - - $('[name="servings"]').val(dataInco['nb_portion'] ?? ''); // problem les types de correspondent pas numeric = string (exemple this->nb_portion = '1/2') - - $('[name="nv_ref_weight_g"]').val(dataInco['nutritional_values']['taille_ref'] ?? ''); - $('[name="nv_kj"]').val(dataInco['nutritional_values']['val_energ_kj_r'] ?? ''); //Energie Kj - $('[name="nv_kcal"]').val(dataInco['nutritional_values']['val_energ_kcal_r'] ?? ''); //Energie Kcal - $('[name="nv_fat_g"]').val(dataInco['nutritional_values']['mat_grass_r'] ?? ''); //graisses - $('[name="nv_sat_fat_g"]').val(dataInco['nutritional_values']['ags_r'] ?? ''); //dont acides gras saturés - $('[name="nv_carb_g"]').val(dataInco['nutritional_values']['glucides_r'] ?? ''); //Glucides - $('[name="nv_sugar_g"]').val(dataInco['nutritional_values']['sucre_r'] ?? ''); //dont sucres - $('[name="nv_fiber_g"]').val(dataInco['nutritional_values']['fib_alim_r'] ?? ''); //fibres alimentaires - $('[name="nv_protein_g"]').val(dataInco['nutritional_values']['proteine_r'] ?? ''); //protéines - $('[name="nv_salt_g"]').val(dataInco['nutritional_values']['sel_r'] ?? ''); //sel - - $('[name="nv_serving_size_g"]').val(dataInco['nutritional_values']['taille_port'] ?? ''); //taille portion en grammes - $('[name="nv_serving_kj"]').val(dataInco['nutritional_values']['val_energ_kj_p'] ?? ''); //Energie Kj - $('[name="nv_serving_kcal"]').val(dataInco['nutritional_values']['val_energ_kcal_p'] ?? ''); //Energie Kcal - $('[name="nv_serving_fat_g"]').val(dataInco['nutritional_values']['mat_grass_p'] ?? ''); //graisses - $('[name="nv_serving_sat_fat_g"]').val(dataInco['nutritional_values']['ags_p'] ?? ''); //dont acides gras saturés - $('[name="nv_serving_carb_g"]').val(dataInco['nutritional_values']['glucides_p'] ?? ''); //Glucides - $('[name="nv_serving_sugar_g"]').val(dataInco['nutritional_values']['sucre_p'] ?? ''); //dont sucres - $('[name="nv_serving_fiber_g"]').val(dataInco['nutritional_values']['fib_alim_p'] ?? ''); //fibres alimentaires - $('[name="nv_serving_protein_g"]').val(dataInco['nutritional_values']['proteine_p'] ?? ''); //protéines - $('[name="nv_serving_salt_g"]').val(dataInco['nutritional_values']['sel_p'] ?? ''); //sel - - $('[name="nv_daily_energy"]').val(dataInco['nutritional_values']['pourcent_apport_ref_kjo_r'] ?? ''); //Energie % recommandé - $('[name="nv_daily_fat"]').val(dataInco['nutritional_values']['pourcent_apport_ref_fat_r'] ?? ''); //graisses - $('[name="nv_daily_sat_fat"]').val(dataInco['nutritional_values']['pourcent_apport_ref_fatsat_r'] ?? ''); //dont acides gras saturés - $('[name="nv_daily_carb"]').val(dataInco['nutritional_values']['pourcent_apport_ref_choval_r'] ?? ''); //Glucides - $('[name="nv_daily_sugar"]').val(dataInco['nutritional_values']['pourcent_apport_ref_sugar_r'] ?? ''); //dont sucres - $('[name="nv_daily_fiber"]').val(dataInco['nutritional_values']['pourcent_apport_ref_fibtg_r'] ?? ''); //fibres alimentaires - $('[name="nv_daily_protein"]').val(dataInco['nutritional_values']['pourcent_apport_ref_pro_r'] ?? ''); //protéines - $('[name="nv_daily_salt"]').val(dataInco['nutritional_values']['pourcent_apport_ref_salteq_r'] ?? ''); //sel - - //nutriscore - $('[name="nutriscore"]').val(dataInco['nutritional_values']['classement']) ?? ''; - - //then close the box - $.fancybox.close(); - } -</script> diff --git a/resources/views/bo/products/product-card.blade.php b/resources/views/bo/products/product-card.blade.php deleted file mode 100644 index 80e9c729..00000000 --- a/resources/views/bo/products/product-card.blade.php +++ /dev/null @@ -1,10 +0,0 @@ -<div class="card col-md-3"> - <img class="card-img-top" src="/storage/images/produits/{{$product->picture}}" alt="{{$product->name}}"> - <div class="card-body"> - <h5 class="card-title"><a href="{{route('bo.products.edit', $product->id)}}">{{$product->name}}</a></h5> - <small class="text-muted">Prix HT avant promo : {{$product->price}}</small> - <p class="card-text"> - {!! $product->description !!} - </p> - </div> -</div> diff --git a/resources/views/bo/products/standard_form_inputs.blade.php b/resources/views/bo/products/standard_form_inputs.blade.php deleted file mode 100644 index c7dac3f5..00000000 --- a/resources/views/bo/products/standard_form_inputs.blade.php +++ /dev/null @@ -1,249 +0,0 @@ -<div class="form-group"> - <label for="name">Nom du produit *</label> - <input type="text" id="name" name="name" class="form-control" placeholder="Nom du produit" value="{{ old('name', $product->name) }}" required> - @if ($product->product_type == "foodProduct") - @if (!empty($product->foodProduct->xmlInco)) - <a class="btn btn-outline-info btn-sm" data-bs-toggle="collapse" href="#inco_nom" aria-expanded="false" aria-controls="collapseExample">Donnée inco</a> - <div class="collapse row" id="inco_nom"> - <div class="input-group mb-2"> - <div class="input-group-prepend"> - <a class="btn btn-secondary" onclick="paste('nom','name')">Reprendre cette donnée</a> - </div> - <div class="inco_data form-control alert-info" id="nom">{{ $product->foodProduct->xmlInco->nom }}</div> - </div> - </div> - @endif - @endif -</div> -<div class="row"> - <div class="form-group col-md-3"> - <label for="order_unit">Marque - <span class="tipped" - data-tippy-content="Marque du produit"> - <i class="fas fa-question-circle"></i> - </span> - </label> - <select class="form-select" id="brand" name="brand"> - @foreach (ProductBrand::toArray() as $productbrand) - <option value="{{$productbrand->value}}" @if (old('brand', $product->brand) == $productbrand->value)selected @endif>{{$productbrand->label}}</option> - @endforeach - </select> - </div> - <div class="form-group col-md-9"> - <label for="name">Tags</label> - <auto-complete-tags - dbexistingtags='@json($existingTags)' - dbselectedtags='@json($selectedtags)' - element-id="tags" - id-field="id" - text-field="label" - ></auto-complete-tags> - </div> -</div> -<div class="form-group"> - <label>Description *</label> - <textarea class="form-control" id="description" name="description" placeholder="Description *">{{ old('description', $product->description) }}</textarea> - @if ($product->product_type == "foodProduct") - @if (!empty($product->foodProduct->xmlInco)) - <a class="btn btn-outline-info btn-sm" data-bs-toggle="collapse" href="#inco_descriptif" aria-expanded="false" aria-controls="collapseExample">Donnée inco</a> - <div class="collapse row" id="inco_descriptif"> - <div class="input-group mb-2"> - <div class="input-group-prepend"> - <a class="btn btn-secondary" onclick="paste('descriptif','description')">Reprendre cette donnée</a> - </div> - <div class="inco_data form-control alert-info" id="descriptif">{{ $product->foodProduct->xmlInco->descriptif }}</div> - </div> - </div> - @endif - @endif -</div> -<div class="form-group"> - <label for="picture">Image <small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('theme.product_image_maxwidth') }} px par {{ Config::get('theme.product_image_maxheight') }} px</small></label></br> - <input type="file" id="picture" name="picture" accept="image/png, image/jpeg"> - @if ($product->picture !== null) - <br/> - <br/> - <a data-fancybox="gallery" href="/storage/images/produits/{{$product->picture}}" id="img-picture"> - <img src="/storage/images/produits/{{$product->picture}}" alt="{{$product->name}}" style="max-height: 100px;"> - </a> - @endif - {{-- variante préparation d'images --}} - @if ($product->product_type == "foodProduct") - @if (!empty($product->foodProduct->xmlInco->picture)) - <a class="btn btn-outline-info btn-sm" data-bs-toggle="collapse" href="#inco_media" aria-expanded="false" aria-controls="collapseExample" id="prepareIncoImages">Images inco</a> - <div class="collapse row" id="inco_media"> - <!--inco images container--> - </div> - @endif - @endif -</div> -<div class="form-group"> - <label for="picture_large">Image (grande) <small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('theme.product_image_large_maxwidth') }} px par {{ Config::get('theme.product_image_large_maxheight') }} px</small></label></br> - <input type="file" id="picture_large" name="picture_large" accept="image/png, image/jpeg"> - @if ($product->picture_large !== null) - <br/> - <br/> - <a data-fancybox="gallery" href="/storage/images/produits/{{$product->picture_large}}" id="img-picture_large"> - <img src="/storage/images/produits/{{$product->picture_large}}" alt="{{$product->name}}" style="max-height: 100px;"> - </a> - @endif -</div> -<div class="row"> - <div class="form-group col"> - <label for="price">Prix en € *</label> - <input type="number" id="price" name="price" min="0" step=".01" class="form-control" value="{{ old('price', $product->price)}}" required> - </div> - <div class="form-group col"> - <label for="invoicing_unit">Unité de facturation - <span class="tipped" - data-tippy-content="Unité de base permettant d'établir le prix"> - <i class="fas fa-question-circle"></i> - </span> - </label> - <select class="form-select col-md-9" id="invoicing_unit" name="invoicing_unit"> - @foreach (InvoicingUnit::toArray() as $invoicingunit_type) - <option value="{{$invoicingunit_type->value}}" @if (old('invoicing_unit', $product->invoicing_unit) == $invoicingunit_type->value)selected @endif>{{$invoicingunit_type->label}}</option> - @endforeach - </select> - </div> - {{--<div class="form-group col"> - <label for="price_buy">Prix d'achat en €</label> - <input type="number" id="price_buy" name="price_buy" min="0" step=".01" class="form-control" value="{{ old('price_buy', $product->price_buy)}}"> - </div>--}} - <div class="form-group col"> - <label for="tax_rate_id">TVA Applicable</label> - <select class="form-select" id="tax_rate_id" name="tax_rate_id"> - @foreach($taxes as $taxe) - <option value="{{$taxe->id}}" @if ($taxe->id === old('tax_rate_id',$product->tax_rate_id)) selected @endif>{{$taxe->label}}</option> - @endforeach - </select> - </div> - <div class="form-group col"></div> -</div> -<div class="row"> - @if (config('bosettings.regate_orders')) - <div class="form-group col"> - <label for="order_unit">Unité de commande - <span class="tipped" - data-tippy-content="Unité utilisée lors de la transmission de commande à Regate"> - <i class="fas fa-question-circle"></i> - </span> - </label> - <select class="form-select col-md-9" id="order_unit" name="order_unit"> - @foreach (OrderUnit::toArray() as $orderunit_type) - <option value="{{$orderunit_type->value}}" @if (old('order_unit', $product->order_unit) == $orderunit_type->value)selected @endif>{{$orderunit_type->label}}</option> - @endforeach - </select> - </div> - @endif - <div class="form-group col"> - <label for="stock">Stock</label> - <input type="number" id="stock" name="stock" class="form-control" min="0" value="{{ old('stock', $product->stock)}}"> - </div> - <div class="form-group col"> - <label for="reference">Référence @if (config('bosettings.regate_orders')) * - <span class="tipped" - data-tippy-content="Code Article utilisé lors de la transmission de commande à Regate"> - <i class="fas fa-question-circle"></i> - </span> - @endif - </label> - <input type="text" id="reference" name="reference" class="form-control" value="{{ old('reference', $product->reference)}}" @if (config('bosettings.regate_orders')) required @endif> - </div> - <div class="form-group col"></div> - <div class="form-group col"></div> -</div> -<div class="row"> - <div class="form-group col"> - <label for="sell_unit">Unité de vente - <span class="tipped" - data-tippy-content="Unité de vente consommateur"> - <i class="fas fa-question-circle"></i> - </span> - </label> - @if (config('bosettings.sell_unit_management') == "strict") - <select class="form-select col-md-9" id="sell_unit" name="sell_unit"> - @foreach (SellUnit::toArray() as $sellunit_type) - <option value="{{$sellunit_type->value}}" @if (old('sell_unit', $product->sell_unit) == $sellunit_type->value)selected @endif>{{$sellunit_type->label}}</option> - @endforeach - </select> - @else - <input type="text" id="sell_unit" name="sell_unit" class="form-control" value="{{ old('sell_unit', $product->sell_unit)}}"> - @endif - </div> - <div class="form-group col"> - <label for="weight">Poids de l'article</label> - <input type="number" id="weight" name="weight" min="0" step=".01" class="form-control" value="{{ old('weight', $product->weight)}}"> - </div> - <div class="form-group col"> - <label for="weight_unit">Unité de poids - <span class="tipped" - data-tippy-content="Unité de poids normalisée"> - <i class="fas fa-question-circle"></i> - </span> - </label> - <select class="form-select col-md-9" id="weight_unit" name="weight_unit"> - @foreach (WeightUnit::toArray() as $wheightunit_type) - <option value="{{$wheightunit_type->value}}" @if (old('weight_unit', $product->weight_unit) == $wheightunit_type->value)selected @endif>{{$wheightunit_type->label}}</option> - @endforeach - </select> - {{--<input type="text" id="weight_unit" name="weight_unit" class="form-control" value="{{ old('weight_unit', $product->weight_unit)}}">--}} - </div> - <div class="form-group col"></div> -</div> -<div class="form-group"> - <label> - <input type="checkbox" name="weight_variable" @if ($product->weight_variable === 1) checked @endif> - Poids variable ? - </label> -</div> -<div class="form-group"> - <label> - <input type="checkbox" name="star" @if ($product->star === 1) checked @endif> - Mise en avant ? - </label> -</div> -<div class="row"> - <div class="form-group col"> - <label for="range_id">Gamme de produits</label> - <select class="form-select" id="range_id" name="range_id"> - @foreach($ranges as $range) - <option value="{{$range->id}}" @if ($range->id === old('range_id',$product->range_id)) selected @endif>{{$range->name}}</option> - @endforeach - </select> - </div> - <div class="form-group col"> - <div class="form-group"> - <label for="name">Produist associés</label> - <products-cards-dnd - dbexistingprods='@json($existingProds)' - dbselectedprods='@json($selectedProds)' - element-id="prods" - ></products-cards-dnd> - </div> - </div> - <div class="form-group col"></div> - <div class="form-group col"></div> -</div> -<div class="form-group"> - <label> - <input type="checkbox" name="status" @if ($product->status === 1) checked @endif> - Publié ? - </label> -</div> -<div class="row"> - <div class="form-group col"> - <label for="orderable_start_date">Le produit peut être commandé à partir de :</label> - <input type="date" id="orderable_start_date" name="orderable_start_date" class="form-control" value="{{ old('orderable_start_date', !is_null($product->orderable_start) ? date_format($product->orderable_start, "Y-m-d") : "") }}"> - <input type="time" id="orderable_start_time" name="orderable_start_time" class="form-control" value="{{ old('orderable_start_time', !is_null($product->orderable_start) ? date_format($product->orderable_start, "H:i") : "") }}"> - <small class="text-muted"> laisser vide pour que le produit puisse être commandé immédiatement </small> - </div> - <div class="form-group col"> - <label for="orderable_end_date">Le produit ne pourra pas être commandé après : </label> - <input type="date" id="orderable_end_date" name="orderable_end_date" class="form-control" value="{{ old('orderable_end_date', !is_null($product->orderable_end) ? date_format($product->orderable_end, "Y-m-d") : "") }}"> - <input type="time" id="orderable_end_time" name="orderable_end_time" class="form-control" value="{{ old('orderable_end_time', !is_null($product->orderable_end) ? date_format($product->orderable_end, "H:i") : "") }}"> - <small class="text-muted"> laisser vide pour que le produit puisse toujours être commandé </small> - </div> - <div class="form-group col"></div> - <div class="form-group col"></div> -</div> diff --git a/resources/views/bo/products/starred.blade.php b/resources/views/bo/products/starred.blade.php deleted file mode 100644 index e5d061cc..00000000 --- a/resources/views/bo/products/starred.blade.php +++ /dev/null @@ -1,63 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2">Produits - Selection du moment <small class="text-muted">Liste</small></h1> - - <!--<div class="dropdown"> - <button class="btn btn-primary float-right dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> - Ajouter un produit - </button> - <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> - @foreach (Config::get('theme.enum_product_types') as $productType=>$label) - <a class="dropdown-item" href="{{route('bo.products.create', $productType)}}">{{ __($label)}}</a> - @endforeach - </div> - </div>--> - </div> - <table class="table"> - <thead> - <th scope="col">Image</th> - <th scope="col">Nom</th> - <th scope="col">Prix en €</th> - <th scope="col">Stock</th> - <th scope="col">Référence</th> - <th scope="col">Slug</th> - <th scope="col">Gamme</th> - <th scope="col">Publié</th> - <!--<th></th>--> - </thead> - <tbody> - @foreach ($products as $product) - <tr> - <td>@if ($product->picture !== null)<img src="/storage/images/produits/{{$product->picture}}" alt="{{$product->name}}" style="max-height: 100px;">@endif</td> - <td>{{$product->name}}</td> - <td>{{number_format($product->price, 2, ',', ' ')}}€</td> - <td>{{number_format($product->stock, 0, ',', ' ')}}</td> - <td>{{$product->reference}}</td> - <td>{{$product->slug}}</td> - <td>{{$product->range->name}}</td> - <td> - @if ($product->status === 0) - <i class="fas fa-times cross-red"></i> - @else - <i class="fas fa-check check-green"></i> - @endif - </td> - <td class="text-center"> - <a href="{{route('bo.products.edit', $product->id)}}" class="btn btn-sm btn-primary">Éditer</a> - <!--<form action="{{route('bo.products.destroy', $product->id)}}" method="POST" class="d-inline"> - @method('DELETE') - @csrf - <input type="submit" class="btn btn-sm btn-danger" value="Supprimer" - onclick="return confirm('Êtes-vous sûr(e) ?')"> - </form>--> - </td> - </tr> - @endforeach - </tbody> - </table> - {{ $products->links() }} - -@endsection - diff --git a/resources/views/bo/products/tool_product.blade.php b/resources/views/bo/products/tool_product.blade.php deleted file mode 100644 index bfdbbb75..00000000 --- a/resources/views/bo/products/tool_product.blade.php +++ /dev/null @@ -1,5 +0,0 @@ -<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h2><small class="text-muted">Outil</small></h2> - <input type="hidden" id="product_type" name="product_type" value="toolProduct"> -</div> -<!--adding fields (tool_products)--> diff --git a/resources/views/bo/promotions/create.blade.php b/resources/views/bo/promotions/create.blade.php deleted file mode 100644 index 73560c13..00000000 --- a/resources/views/bo/promotions/create.blade.php +++ /dev/null @@ -1,67 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') -<form action="{{route('bo.promotions.store')}}" method="POST" enctype="multipart/form-data"> - @csrf - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2"><a href="{{route('bo.promotions.index')}}" class="h2 text-decoration-none"><</a> Promotions <small class="text-muted">Création</small></h1> - <div class="btn-toolbar mb-2 mb-md-0"> - <button type="submit" class="btn btn-sm btn-primary">Enregistrer</a> - </div> - </div> - @if ($errors->any()) - <div class="alert alert-danger"> - <ul> - @foreach ($errors->all() as $error) - <li>{{ $error }}</li> - @endforeach - </ul> - </div> - @endif - - <div class="form-group"> - <label for="name">Produit *</label> - <products-cards-dnd - dbexistingprods='@json($existingProds)' - dbselectedprods='@json($selectedProds)' - element-id="product_id" - ></products-cards-dnd> - {{--<input type="text" id="product_id" name="product_id" class="form-control" placeholder="Produit * " value="{{ old('product_id') }}" required>--}} - </div> - <div class="row"> - <div class="form-group col"> - <label for="discount_type_id">Type de remise *</label> - <select class="form-select" id="discount_type_id" name="discount_type_id"> - @foreach($discTypes as $discType) - <option value="{{$discType->id}}">{{$discType->label}}</option> - @endforeach - </select> - </div> - <div class="form-group col"> - <label for="discount_value">Valeur *</label> - <input type="number" id="discount_value" name="discount_value" min="0" step=".01" class="form-control" value="{{ old('discount_value') }}" required> - <small class="text-muted"> Montant ou pourcentage de remise selon le type choisi </small> - </div> - <div class="form-group col"> - <label for="is_old_price_displayed">Afficher l'ancien prix ?</label> - <input - type="checkbox" - id="is_old_price_displayed" - name="is_old_price_displayed" - class="form-check" - @if(old('is_old_price_displayed', false)) checked @endif> - <small class="text-muted"> Cocher pour afficher l'ancien prix </small> - </div> - <div class="form-group col"> - <label for="date_start_date">Début <small class="text-muted"> de la promotion </small></label> - <input type="date" id="date_start_date" name="date_start_date" class="form-control" value="{{ old('date_start_date') }}" required> - <input type="time" id="date_start_time" name="date_start_time" class="form-control" value="{{ old('date_start_time') }}" required> - </div> - <div class="form-group col"> - <label for="date_end_date">Fin <small class="text-muted"> de la promotion </small></label> - <input type="date" id="date_end_date" name="date_end_date" class="form-control" value="{{ old('date_end_date') }}" required> - <input type="time" id="date_end_time" name="date_end_time" class="form-control" value="{{ old('date_end_time') }}" required> - </div> - </div> -</form> -@endsection diff --git a/resources/views/bo/promotions/edit.blade.php b/resources/views/bo/promotions/edit.blade.php deleted file mode 100644 index dddd5501..00000000 --- a/resources/views/bo/promotions/edit.blade.php +++ /dev/null @@ -1,72 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') - <form action="{{route('bo.promotions.update', $promotion->id)}}" method="POST" enctype="multipart/form-data"> - @method('PUT') - @csrf - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2"><a href="{{route('bo.promotions.index')}}" class="h2 text-decoration-none"><</a> Promotion <small class="text-muted">Modification</small></h1> - @if (session('success')) - <span class="float-center text-success">{{ session('success') }}</span> - @endif - <div class="btn-toolbar mb-2 mb-md-0"> - <button type="submit" class="btn btn-sm btn-primary">Enregistrer</a> - </div> - </div> - @if ($errors->any()) - <div class="alert alert-danger"> - <ul> - @foreach ($errors->all() as $error) - <li>{{ $error }}</li> - @endforeach - </ul> - </div> - @endif - - <div class="form-group"> - <label for="name">Produit *</label> - <products-cards-dnd - dbexistingprods='@json($existingProds)' - dbselectedprods='@json($selectedProds)' - element-id="product_id" - ></products-cards-dnd> - {{--<input type="text" id="product_id" name="product_id" class="form-control" placeholder="Produit * " value="{{ old('product_id', implode(",",$promotion->products->pluck('id')->all())) }}" required>--}} - </div> - <div class="row"> - <div class="form-group col"> - <label for="discount_type_id">Type de remise *</label> - <select class="form-select" id="discount_type_id" name="discount_type_id"> - @foreach($discTypes as $discType) - <option value="{{$discType->id}}" @if ($discType->id === $promotion->discount_type_id) selected @endif>{{$discType->label}}</option> - @endforeach - </select> - </div> - <div class="form-group col"> - <label for="discount_value">Valeur *</label> - <input type="number" id="discount_value" name="discount_value" min="0" step=".01" class="form-control" value="{{ old('discount_value',$promotion->discount_value) }}" required> - <small class="text-muted"> Montant ou pourcentage de remise selon le type choisi </small> - </div> - <div class="form-group col"> - <label for="is_old_price_displayed">Afficher l'ancien prix ?</label><br> - <input - type="checkbox" - id="is_old_price_displayed" - name="is_old_price_displayed" - class="form-check" - @if(old('is_old_price_displayed', $promotion->is_old_price_displayed)) checked @endif> - <br> - <small class="text-muted"> Cocher pour afficher l'ancien prix </small> - </div> - <div class="form-group col"> - <label for="date_start_date">Début <small class="text-muted"> de la promotion </small></label> - <input type="date" id="date_start_date" name="date_start_date" class="form-control" value="{{ old('date_start_date', date_format($promotion->date_start, "Y-m-d")) }}" required> - <input type="time" id="date_start_time" name="date_start_time" class="form-control" value="{{ old('date_start_time', date_format($promotion->date_start, "H:i")) }}" required> - </div> - <div class="form-group col"> - <label for="date_end_date">Fin <small class="text-muted"> de la promotion </small></label> - <input type="date" id="date_end_date" name="date_end_date" class="form-control" value="{{ old('date_end_date', date_format($promotion->date_end, "Y-m-d")) }}" required> - <input type="time" id="date_end_time" name="date_end_time" class="form-control" value="{{ old('date_end_time', date_format($promotion->date_end, "H:i")) }}" required> - </div> - </div> -</form> -@endsection diff --git a/resources/views/bo/promotions/index.blade.php b/resources/views/bo/promotions/index.blade.php deleted file mode 100644 index 00d82012..00000000 --- a/resources/views/bo/promotions/index.blade.php +++ /dev/null @@ -1,63 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2">Promotions <small class="text-muted">Liste</small></h1> - - @if ($errors->any()) - @foreach($errors->all() as $error) - <span class="float-center text-danger">{{ $error }}</span> - @endforeach - @endif - <a href="{{route('bo.promotions.create')}}" class="btn btn-primary float-right">Créer une promotion</a> - </div> - <table class="table"> - <thead> - <th scope="col">Type</th> - <th scope="col">Valeur</th> - <th scope="col">Ancien prix affiché ?</th> - <th scope="col">Début</th> - <th scope="col">Fin</th> - <th scope="col">Produits Concernés</th> - <th></th> - </thead> - <tbody> - @foreach ($promotions as $promotion) - <tr> - <td>{{$promotion->discountType->label}}</td> - <td>{{$promotion->discount_value}}</td> - <td>{{ $promotion->is_old_price_displayed ? 'Oui' : 'Non' }}</td> - <td>{{$promotion->date_start}}</td> - <td>{{$promotion->date_end}}</td> - <td> - @foreach ($promotion->products as $product) - <div class="col-md-12 d-flex"> - <img src="/storage/images/produits/{{$product->picture}}" alt="{{$product->name}}" style="max-height: 100px;"> - <div class="card-body"> - <h5 class="card-title"><a href="{{route('bo.products.edit', $product->id)}}">{{$product->name}}</a></h5> - <small class="text-muted">Prix HT avant promo : {{$product->price}}</small> - <p class="card-text">Prix HT après promo : - @if ($promotion->discountType->id == 1) - {{$product->price-$promotion->discount_value}} - @else - {{$product->price-($product->price*$promotion->discount_value/100)}} - @endif - </p> - </div> - </div> - @endforeach - </td> - <td class="text-center"> - <a href="{{route('bo.promotions.edit', $promotion->id)}}" class="btn btn-sm btn-primary">Éditer</a> - <form action="{{route('bo.promotions.destroy', $promotion->id)}}" method="POST" class="d-inline"> - @method('DELETE') - @csrf - <input type="submit" class="btn btn-sm btn-danger" value="Supprimer" - onclick="return confirm('Êtes-vous sûr(e) ?')"> - </form> - </td> - </tr> - @endforeach - </tbody> - </table> -@endsection diff --git a/resources/views/bo/ranges/create.blade.php b/resources/views/bo/ranges/create.blade.php index 3b3a9d70..bff87687 100644 --- a/resources/views/bo/ranges/create.blade.php +++ b/resources/views/bo/ranges/create.blade.php @@ -1,66 +1,32 @@ -@extends('layouts.bo-layout') +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s', Str::ucfirst(__('creation')), Str::ucfirst(trans_choice('models.classes.ranges', \INF)))) + +@section('breadcrumb', request()->route()->getName()) @section('content') - <form action="{{route('bo.ranges.store')}}" method="POST" enctype="multipart/form-data"> + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <a class="btn btn-sm btn-primary" href="{{ URL::previous() === request()->url() ? route('bo.ranges.index') : URL::previous() }}"><i + class="fa-solid fa-arrow-left"></i></a> + {{ Str::ucfirst(trans_choice('models.classes.ranges', \INF)) }} {{ Str::ucfirst(__('crud.actions.create')) }} + </h1> + </div> + </div> + </div> + <div class="card-body"> + <form action="{{ route('bo.ranges.store') }}" method="POST" enctype='multipart/form-data'> @csrf - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2"><a href="{{route('bo.ranges.index')}}" class="h2 text-decoration-none"><</a> Gammes de produits <small class="text-muted">Création</small></h1> - <div class="btn-toolbar mb-2 mb-md-0"> - <button type="submit" class="btn btn-sm btn-primary">Enregistrer</a> - </div> + @include('bo.ranges.form') + <div class="text-center"> + <button class="btn btn-primary" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> </div> - @if ($errors->any()) - <div class="alert alert-danger"> - <ul> - @foreach ($errors->all() as $error) - <li>{{ $error }}</li> - @endforeach - </ul> - </div> - @endif - <div class="form-group"> - <label for="name">Nom de la gamme</label> - <input type="text" id="name" name="name" class="form-control" placeholder="Nom de la gamme" value="{{ old('name') }}" required> - </div> - <div class="form-group"> - <label>Description</label> - <textarea class="form-control" id="description" name="description" placeholder="Description *"></textarea> - </div> - <div class="form-group"> - <label for="picture">Image <small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('theme.range_image_maxwidth') }} px par {{ Config::get('theme.range_image_maxheight') }} px</small></label></br> - <input type="file" id="picture" name="picture" accept="image/png, image/jpeg"> - </div> - <div class="form-group"> - <label> - <input type="checkbox" name="status"> - Publié ? - </label> - </div> - </form> -@endsection - -@section('scripts') - <script type="text/javascript"> - var editorConfig = { - removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"], - toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'blockQuote', 'insertTable', '|', 'undo', 'redo' ], - heading: { - options: [ - { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' }, - { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' }, - { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }, - { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' }, - { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' } - ] - }, - table: { - contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ] - } - }; - ClassicEditor - .create( document.querySelector( '#description' ), editorConfig) - .catch( error => { - console.error( error ); - } ); - </script> + </form> + </div> + </div> @endsection diff --git a/resources/views/bo/ranges/edit.blade.php b/resources/views/bo/ranges/edit.blade.php index ee68f897..14531eb9 100644 --- a/resources/views/bo/ranges/edit.blade.php +++ b/resources/views/bo/ranges/edit.blade.php @@ -1,75 +1,49 @@ -@extends('layouts.bo-layout') +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s %s', Str::ucfirst(__('crud.actions.edit')), Str::ucfirst(trans_choice('models.classes.ranges', 1)), + $range->name)) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $range) @endphp @section('content') - <form action="{{route('bo.ranges.update', $range->id)}}" method="POST" enctype="multipart/form-data"> - @method('PUT') + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <a class="btn btn-sm btn-primary" href="{{ URL::previous() === request()->url() ? route('bo.ranges.index') : URL::previous() }}"><i + class="fa-solid fa-arrow-left"></i></a> + {{ Str::ucfirst(trans_choice('models.classes.ranges', 1)) }} {{ Str::ucfirst(__('crud.actions.edit')) }} + </h1> + </div> + <div class="col-3 text-end"> + <div class="btn-group"> + @can('delete', $range) + <form class="d-inline confirmDeleteJS" action="{{ route('bo.ranges.destroy', $range) }}" method="POST"> + @method('DELETE') + @csrf + <button class="btn btn-sm btn-danger" title="{{ __('crud.actions.delete') }}"><i class="fa-solid fa-trash"></i></button> + </form> + @endcan + </div> + </div> + </div> + </div> + <div class="card-body"> + <form action="{{ route('bo.ranges.update', $range) }}" method="POST" enctype='multipart/form-data'> @csrf - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2"><a href="{{route('bo.ranges.index')}}" class="h2 text-decoration-none"><</a> Gammes de produits <small class="text-muted">Modification</small></h1> - @if (session('success')) - <span class="float-center text-success">{{ session('success') }}</span> - @endif - <div class="btn-toolbar mb-2 mb-md-0"> - <button type="submit" class="btn btn-sm btn-primary">Enregistrer</a> - </div> + {{ method_field('PUT') }} + @include('bo.ranges.form', compact('range')) + <div class="text-center"> + <span class="d-block mb-3"> + <span class="badge text-bg-info">{{ __('crud.helpers.required_fields_with_aster') }}</span> + </span> + <button class="btn btn-primary" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> </div> - @if ($errors->any()) - <div class="alert alert-danger"> - <ul> - @foreach ($errors->all() as $error) - <li>{{ $error }}</li> - @endforeach - </ul> - </div> - @endif - <div class="form-group"> - <label for="name">Nom de la gamme</label> - <input type="text" id="name" name="name" class="form-control" placeholder="Nom de la gamme" value="{{$range->name}}" required> - </div> - <div class="form-group"> - <label>Description</label> - <textarea class="form-control" id="description" name="description" placeholder="Description *">{{$range->description}}</textarea> - </div> - <div class="form-group"> - <label for="picture">Image <small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('theme.range_image_maxwidth') }} px par {{ Config::get('theme.range_image_maxheight') }} px</small></label></br> - <input type="file" id="picture" name="picture" accept="image/png, image/jpeg"> - @if ($range->picture !== null) - <br/> - <br/> - <img src="/storage/images/gammes/{{$range->picture}}" alt="{{$range->name}}" style="max-height: 100px"> - @endif - </div> - <div class="form-group"> - <label> - <input type="checkbox" name="status" @if ($range->status === 1) checked @endif> - Publié ? - </label> - </div> - </form> -@endsection - -@section('scripts') - <script type="text/javascript"> - var editorConfig = { - removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"], - toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'blockQuote', 'insertTable', '|', 'undo', 'redo' ], - heading: { - options: [ - { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' }, - { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' }, - { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }, - { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' }, - { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' } - ] - }, - table: { - contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ] - } - }; - ClassicEditor - .create( document.querySelector( '#description' ), editorConfig) - .catch( error => { - console.error( error ); - } ); - </script> + </form> + </div> + </div> @endsection diff --git a/resources/views/bo/ranges/form.blade.php b/resources/views/bo/ranges/form.blade.php new file mode 100644 index 00000000..b80486df --- /dev/null +++ b/resources/views/bo/ranges/form.blade.php @@ -0,0 +1,146 @@ +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ __('Range information') }}</legend> + <div class="row mb-3"> + <!-- Titre --> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="range-name"><b>{{ Str::ucfirst(__('validation.attributes.name')) }}</b></label> + <div class="word-counter" data-json='@json(['for' => 'range-name'])'></div> + <input class="form-control" id="range-name" name="name" type="text" value="{{ old('name', $range->name ?? '') }}" + aria-describedby="range-name-help" placeholder="{{ Str::ucfirst(__('validation.attributes.name')) }}" required> + @include('bo.modules.input-error', [ + 'inputName' => 'name', + 'helperId' => 'range-name-help', + 'helper' => + __('Give your range a title.') . + ' ' . + __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.attributes.name'), + 'inter' => __('validation.custom.of_the.female'), + 'model' => trans_choice('models.classes.ranges', 1), + ]), + 'min' => 4, + 'max' => 75, + ]), + ]) + </div> + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ Str::ucfirst(__('validation.attributes.description')) }}</legend> + + <div class="row"> + <div class="col form-group"> + <label class="col-form-label" for="range-description"><b>{{ Str::ucfirst(__('Description (HTML)')) }}</b></label> + @include('bo.modules.input-error', [ + 'inputName' => 'description', + 'helper' => __('Complete content of the range.'), + ]) + @php + $editor = [ + 'id' => 'range-description', + 'csrf' => csrf_token(), + 'name' => 'description', + 'text' => old('description', $range->description ?? '') ?? '', + ]; + @endphp + <div class="ck-editor" data-json='@json($editor)'></div> + </div> + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend><label class="h4" for="range-picture">{{ Str::ucfirst(__('validation.attributes.image')) }}</label></legend> + <div class="row"> + @include('bo.modules.input-error', [ + 'inputName' => 'picture', + ]) + @php + $json = [ + 'name' => 'picture', + 'single' => true, + 'width' => 500, + 'height' => 500, + 'preview' => false, + 'helper' => __('JPEG/PNG, 2MB max. Recommended dimensions: :width px by :height px', [ + 'width' => 500, + 'height' => 500, + ]), + 'value' => $range->picture ?? '', + ]; + @endphp + <div class="image-input" data-json='@json($json)'></div> + </div> + + <!-- ALT --> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="range-alt"><b>{{ Str::ucfirst(__('validation.custom.attributes.picture_alt')) }}</b></label> + <div class="word-counter" data-json='@json(['for' => 'picture-alt'])'></div> + <input class="form-control" id="picture-alt" name="picture_alt" type="text" + value="{{ old('picture_alt', $range->picture_alt ?? '') }}" aria-describedby="range-alt-help" + placeholder="{{ __('Artist cat') }}"> + @include('bo.modules.input-error', [ + 'inputName' => 'picture_alt', + 'helperId' => 'range-alt-help', + 'helper' => __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.custom.attributes.picture_alt'), + 'inter' => __('validation.custom.of_the.male'), + 'model' => trans_choice('models.classes.ranges', 1), + ]), + 'min' => 4, + 'max' => 75, + ]), + ]) + </div> + + <!-- PICTURE --> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="range-title"><b>{{ Str::ucfirst(__('validation.custom.attributes.picture_title')) }}</b></label> + <div class="word-counter" data-json='@json(['for' => 'picture-title'])'></div> + <input class="form-control" id="picture-title" name="picture_title" type="text" + value="{{ old('picture_title', $range->picture_title ?? '') }}" aria-describedby="range-picture-title-help" + placeholder="{{ __('Image of a cat playing a grand piano') }}"> + @include('bo.modules.input-error', [ + 'inputName' => 'picture_title', + 'helperId' => 'range-picture-title-help', + 'helper' => __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.custom.attributes.picture_title'), + 'inter' => __('validation.custom.of_the.male'), + 'model' => trans_choice('models.classes.ranges', 1), + ]), + 'min' => 4, + 'max' => 75, + ]), + ]) + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <!-- Publication --> + <div class="col-12 form-group pt-3"> + <input class="form-check-input mt-2" id="range-status" name="status" type="checkbox" value="1" + aria-describedby="range-status-help" @checked(old('status', $range->status ?? ''))> + <label class="col-form-label pt-1" class="form-check-label" + for="range-status"><b>{{ Str::ucfirst(__('validation.custom.attributes.status')) }}</b></label><br> + @include('bo.modules.input-error', [ + 'inputName' => 'status', + 'helperId' => 'range-status-help', + 'helper' => __('Check to publish the range'), + ]) + </div> +</div> diff --git a/resources/views/bo/ranges/index-list.blade.php b/resources/views/bo/ranges/index-list.blade.php new file mode 100644 index 00000000..2b350213 --- /dev/null +++ b/resources/views/bo/ranges/index-list.blade.php @@ -0,0 +1,78 @@ +<div class="table-responsive"> + <table class="fix-action table"> + <thead> + <tr class="visually-hidden"> + <th scope="col"></th> + </tr> + @php + $cols = [ + 'name' => Str::ucfirst(__('validation.attributes.title')), + 'picture' => Str::ucfirst(__('validation.attributes.image')), + 'order' => Str::ucfirst(__('validation.custom.attributes.order')), + ]; + @endphp + @include('bo.modules.tableColSorter', ['cols' => $cols, 'mobileHide' => ['picture']]) + </thead> + <tbody> + @forelse ($ranges as $range) + <tr> + <td>{{ $range->name }}</td> + <td class="d-none d-md-table-cell"> + <img class="img-fluid mw-5" src="{{ asset($range->picture) }}" title="{{ $range->picture_title }}" alt="{{ $range->picture_alt }}"> + </td> + @include('bo.modules.change-order', [ + 'route' => 'bo.ranges.change-order', + 'model' => $range, + 'first' => $loop->first, + 'last' => $loop->last, + 'isFirstPage' => $ranges->onFirstPage(), + 'isLastPage' => !$ranges->hasMorePages(), + ]) + <td> + @include('bo.modules.toggle-status', [ + 'route' => 'bo.ranges.toggle-status', + 'model' => $range, + ]) + </td> + <td> + <div class="btn-group"> + @can('viewAny', \App\Models\Product::class) + <a class="btn btn-sm btn-warning" + href="{{ route('bo.products.index', [ + 'search' => '', + 'brand' => '', + 'tag' => '', + 'range' => $range->id, + ]) }}" + title="{{ Str::ucfirst( + __('crud.helpers.view_associated', [ + 'model' => trans_choice('models.classes.products', \INF), + ]), + ) }}"><i + class="fa-solid fa-box"></i></a> + @endcan + @can('update', $range) + <a class="btn btn-sm btn-primary" href="{{ route('bo.ranges.edit', $range) }}" + title="{{ Str::ucfirst(__('crud.actions.update')) }}"><i class="fa-solid fa-pen"></i></a> + @endcan + @can('delete', $range) + <form class="d-inline confirmDeleteJS" action="{{ route('bo.ranges.destroy', $range) }}" method="POST"> + @method('DELETE') + @csrf + <button class="btn btn-sm btn-danger rounded-start-0" title="{{ Str::ucfirst(__('crud.actions.delete')) }}"><i + class="fa-solid fa-trash"></i></button> + </form> + @endcan + </div> + </td> + </tr> + @empty + <tr> + <td class="text-center" colspan="20"> + <span class="h3">{{ __('crud.helpers.no_results') }}</span> + </td> + </tr> + @endforelse + </tbody> + </table> +</div> diff --git a/resources/views/bo/ranges/index.blade.php b/resources/views/bo/ranges/index.blade.php index a0ed47ac..288a4256 100644 --- a/resources/views/bo/ranges/index.blade.php +++ b/resources/views/bo/ranges/index.blade.php @@ -1,42 +1,47 @@ -@extends('layouts.bo-layout') +@extends('bo.layouts.layout') + +@section('title', Str::ucfirst(trans_choice('models.classes.ranges', \INF))) + +@section('breadcrumb', request()->route()->getName()) @section('content') - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2">Gammes de produits <small class="text-muted">Liste</small></h1> - <!-- TODO : Tester quand il y aura des produits la suppression d'une gamme qui en a --> - @if ($errors->any()) - @foreach($errors->all() as $error) - <span class="float-center text-danger">{{ $error }}</span> - @endforeach - @endif - <a href="{{route('bo.ranges.create')}}" class="btn btn-primary float-right">Ajouter</a> + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <span class="h3"> + {{ Str::ucfirst(trans_choice('models.classes.ranges', \INF)) }} {{ Str::ucfirst(__('crud.actions.list')) }} + </span> + </div> + <h1 class="col-3"> + <div class="input-group justify-content-end"> + @can('create', \App\Models\Tag::class) + <a class="btn btn-primary" href="{{ route('bo.ranges.create') }}" + title="{{ Str::ucfirst(__('crud.actions.create')) }} {{ __('models.classes.ranges') }}"><i + class="fa-solid fa-square-plus"></i></a> + @endcan + </div> + </h1> + </div> </div> - <table class="table"> - <thead> - <th scope="col">Image</th> - <th scope="col">Nom</th> - <th scope="col">Slug</th> - <th></th> - </thead> - <tbody> - @foreach ($ranges as $range) - <tr> - <td>@if ($range->picture !== null)<img src="/storage/images/gammes/{{$range->picture}}" alt="{{$range->name}}" style="max-height: 100px;">@endif</td> - <td>{{$range->name}}</td> - <td>{{$range->slug}}</td> - <td class="text-center"> - <a href="{{route('bo.ranges.edit', $range->id)}}" class="btn btn-sm btn-primary">Éditer</a> - <form action="{{route('bo.ranges.destroy', $range->id)}}" method="POST" class="d-inline"> - @method('DELETE') - @csrf - <input type="submit" class="btn btn-sm btn-danger" value="Supprimer" - onclick="return confirm('Êtes-vous sûr(e) ?')"> - </form> - - </td> - </tr> - @endforeach - </tbody> - </table> + <div class="card-body"> + @if ($ranges->count() > \Domain\Enums\Pagination\ItemsPerPaginationEnum::twelve->value()) + <div class="row justify-content-center"> + <div class="col-12 p-md-3 p-0"> + {{ $ranges->withQueryString()->onEachSide(1)->links() }} + </div> + </div> + @endif + <div class="row"> + <div class="col"> + @include('bo.ranges.index-list') + </div> + </div> + <div class="row justify-content-center"> + <div class="col-12 p-md-3 p-0"> + {{ $ranges->withQueryString()->onEachSide(1)->links() }} + </div> + </div> + </div> + </div> @endsection - diff --git a/resources/views/bo/salaries/index.blade.php b/resources/views/bo/salaries/index.blade.php deleted file mode 100644 index 5d90686b..00000000 --- a/resources/views/bo/salaries/index.blade.php +++ /dev/null @@ -1,31 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') - <div class="d-flex justify-content-between flex-md-nowrap align-items-center border-bottom mb-3 flex-wrap pb-2 pt-3"> - <h1 class="h2">{{ __('Paramètres Site Public') }}</h1> - @if (session('success')) - <span class="float-center text-success">{{ session('success') }}</span> - @endif - </div> - @include('modules.flash-messages') - <form action="{{ route('bo.salaries.file') }}" method="POST" enctype="multipart/form-data"> - <fieldset> - <legend>{{ __('Importer des salariés') }}</legend> - <div class="input-group my-2"> - <input class="form-control" name="import" data-bs-toggle="tooltip" type="file" title="{{ __('Sélectionner un fichier .csv') }}" - accept="text/csv,.csv" required> - @csrf - <button class="btn btn-primary" data-bs-toggle="tooltip" type="submit" title="{{ __('Importer le fichier .csv') }}"> - {{ __('Importer') }} - </button> - </div> - <p>{{ __("La première ligne du fichier CSV doit être :") }} matricule;nom;prenom;date_debut;date_fin;date_fin_prevue;etablissement;site;service</p> - @if (request()->session()->has('success')) - <span class="fw-bold text-success">{{ request()->session()->get('success') }}</span> - @endif - @if ($errors->has('import')) - <span class="fw-bold text-danger">{{ collect($errors->get('import'))->implode(', ') }}</span> - @endif - </fieldset> - </form> -@endsection diff --git a/resources/views/bo/settings.blade.php b/resources/views/bo/settings.blade.php deleted file mode 100644 index 4d286e91..00000000 --- a/resources/views/bo/settings.blade.php +++ /dev/null @@ -1,174 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') - <form method="POST" action="{{ route('bo.settings') }}"> - @method('PUT') - @csrf - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2">Paramètres</h1> - @if (session('success')) - <span class="float-center text-success">{{ session('success') }}</span> - @endif - <div class="text-right"> - <button type="submit" class="btn btn-primary">Enregistrer</button> - </div> - </div> - @if ($errors->any()) - <div class="alert alert-danger"> - <ul> - @foreach ($errors->all() as $error) - <li>{{ $error }}</li> - @endforeach - </ul> - </div> - @endif - <div class="form-group"> - <label class="col-form-label"> - Délai de retrait de la commande - <span class="tipped" - data-tippy-content="Il ne sera pas possible de choisir un moment de collecte au dela de ce délai."> - <i class="fas fa-question-circle"></i> - </span> - <input type="number" name="order_withdrawal_period" class="form-control" value="{{$settingsToPrint['order_withdrawal_period'] ?? ''}}"> - <small class="text-muted">Nombre de jours maximum avant la collecte</small> - </label> - </div> - <div class="form-group"> - <label class="col-form-label"> - Adresse de reception des messages "contactez nous" - <span class="tipped" - data-tippy-content="adresse email à laquelle seront envoyé les formulaires de contact"> - <i class="fas fa-question-circle"></i> - </span> - <input type="email" name="send_contact_mail_to" class="form-control" value="{{$settingsToPrint['send_contact_mail_to'] ?? ''}}"> - </label> - </div> - <div class="form-group"> - <label class="col-form-label"> - Adresse de reception des messages de confirmation de commande - <input type="email" name="send_order_confirm_mail_to" class="form-control" value="{{$settingsToPrint['send_order_confirm_mail_to'] ?? ''}}"> - <small class="text-muted">Information lorsqu'un client valide une commande</small> - </label> - </div> - <div class="form-group"> - Boutique Privée - <span class="tipped" - data-tippy-content="L'activation de ce paramètres va rendre la boutique privée. - <br/> Une connexion sera necéssaire pour afficher les pages publiques du site."> - <i class="fas fa-question-circle"></i> - </span> - <div class="row"> - <label class="col-form-label switch"> - <input type="checkbox" name="private_shop" value="1" @if($settingsToPrint['private_shop'] ?? 0)checked @endif> - <span class="slider round"></span> - </label> - </div> - </div> - <div class="form-group"> - Mode d'inscription - <span class="tipped" - data-tippy-content="La partie front office de votre boutique doit tenir compte de ce paramètre pour qu'il prenne effet. - <br/> Le thème doit indiquer quel modes sont pris en charge via la config de thème: <code>register_mode</code> - <br/> Si aucun choix ne s'affiche c'est que votre boutique ne gère que l'inscription tous publics."> - <i class="fas fa-question-circle"></i> - </span> - @foreach(SettingRegisterMode::toArray() as $registermode) - @if ($loop->first) - <div class="row"> - @endif - @if (in_array($registermode->value, config('theme.register_mode') ?? array())) - <label class="col-form-label"> - <input type="checkbox" name="register_{{ $registermode->value }}" value="{{ $registermode->value }}" @if(($settingsToPrint['register_'.$registermode->value]??'')==$registermode->value)checked @endif> - {{ $registermode->label }} - <small class="text-muted"></small> - </label> - @endif - @if($loop->last) - </div> - @else - </div> - <div class="row"> - @endif - @endforeach - </div> - <div class="form-group"> - Affichage des prix - <span class="tipped" - data-tippy-content="Affichage des prix sous certaines conditions : - <ul> - @foreach(PriceShowingMode::toArray() as $usercurrentstatus) - <li> - {{ $usercurrentstatus->label }} - </li> - @endforeach - </ul>"> - <i class="fas fa-question-circle"></i> - </span> - @foreach(PriceShowingMode::toArray() as $usercurrentstatus) - @if ($loop->first) - <div class="row"> - @endif - <label class="col-form-label"> - <input type="checkbox" name="show_prices_{{ $usercurrentstatus->value }}" value="{{ $usercurrentstatus->value }}" @if(($settingsToPrint['show_prices_'.$usercurrentstatus->value]??'')==$usercurrentstatus->value)checked @endif> - {{ $usercurrentstatus->label }} - <small class="text-muted"></small> - </label> - @if($loop->last) - </div> - @else - </div> - <div class="row"> - @endif - @endforeach - </div> - <div class="form-group"> - Envoi des commandes à Regate - <span class="tipped" - data-tippy-content="Activez pour qu'une commande soit automatiquement envoyée à Regate au moment de la validation du créneau de collecte par le client. - <br/>Activer ce paramètre va rendre obligatoire la saisie de la référence (EAN13) dans les fiches produits. - <br/>Activer ce paramètre va rendre obligatoire la saisie de l'unité de commande dans les fiches produits."> - <i class="fas fa-question-circle"></i> - </span> - <div class="row"> - <label class="col-form-label switch"> - <input type="checkbox" name="regate_orders" value="1" @if($settingsToPrint['regate_orders'] ?? 0)checked @endif> - <span class="slider round"></span> - </label> - </div> - </div> - <div class="form-group"> - Gestion stricte des unités de vente - <span class="tipped" - data-tippy-content="Activez pour limiter les valeurs possibles dans les unités de vente. - <br/>Il est indispensable que ce paramètre soit actif pour normaliser les envois de commande à Regate - <br/>Les valeurs autorisées seront : - <ul> - @foreach(SellUnit::toArray() as $sellunit) - <li> - {{ $sellunit->label }} - </li> - @endforeach - </ul>"> - <i class="fas fa-question-circle"></i> - </span> - <div class="row"> - <label class="col-form-label switch"> - <input type="checkbox" name="sell_unit_management" value="strict" @if($settingsToPrint['sell_unit_management'] ?? 0)checked @endif> - <span class="slider round"></span> - </label> - </div> - </div> - </form> - <div id="fancybox"> - <div class="modal-container fancybox-content" style="display: none;" id="hidden-content"> - <div class="modal-title">Informations</div> - <div class="modal-body"> - Ce paramètre doit être actif car l'envoi de commandes à Regate est actif. - </div> - <div class="modal-footer"> - <a href="javascript:;" class="btn btn-secondary" data-fancybox-close="">{{__('OK')}}</a> - </div> - <button type="button" data-fancybox-close="" class="fancybox-button fancybox-close-small" title="Close"><svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 24 24"><path d="M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z"></path></svg></button> - </div> - </div> -@endsection diff --git a/resources/views/bo/settings/edit.blade.php b/resources/views/bo/settings/edit.blade.php new file mode 100644 index 00000000..ccf16246 --- /dev/null +++ b/resources/views/bo/settings/edit.blade.php @@ -0,0 +1,66 @@ +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s', Str::ucfirst(__('crud.actions.edit')), __('Employee sites'))) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + {{ __('Employee sites') }} {{ Str::ucfirst(__('crud.actions.edit')) }} + </h1> + </div> + </div> + </div> + <div class="card-body"> + <form action="{{ route('bo.settings.update') }}" method="POST"> + @csrf + @method('PUT') + + <div class="mb-4"> + <label class="form-label fw-bold" for="employee_sites">{{ __('Employee site codes (Arcadia)') }}</label> + <div class="form-text mb-3"> + {{ __('Define one code per employee site (at least 2 uppercase letters, e.g. PA, NA, LY). These codes are used to query the Arcadia HR IS and synchronize employees in the employee store.') }} + </div> + + <div + id="employee-sites-input" + data-json='@json(old('employee_sites', $setting->employeeSites))' + > + @foreach(old('employee_sites', $setting->employeeSites) as $site) + <div class="input-group mb-2"> + <span class="input-group-text"><i class="fa-solid fa-location-dot"></i></span> + <input + type="text" + name="employee_sites[]" + class="form-control text-uppercase font-monospace" + value="{{ $site }}" + placeholder="ex: PA" + maxlength="20" + > + </div> + @endforeach + </div> + + @error('employee_sites') + <div class="invalid-feedback d-block mt-2">{{ $message }}</div> + @enderror + @error('employee_sites.*') + <div class="invalid-feedback d-block mt-1">{{ $message }}</div> + @enderror + </div> + + <div class="text-center"> + <button class="btn btn-primary" type="submit"> + <i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span> + </button> + </div> + </form> + </div> + </div> +@endsection diff --git a/resources/views/bo/settings/theme.blade.php b/resources/views/bo/settings/theme.blade.php deleted file mode 100644 index 4d10a147..00000000 --- a/resources/views/bo/settings/theme.blade.php +++ /dev/null @@ -1,46 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') - <form method="POST" action="{{route('bo.themesettings')}}"> - @method('PUT') - @csrf - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2">Paramètres Site Public</h1> - @if (session('success')) - <span class="float-center text-success">{{ session('success') }}</span> - @endif - <div class="text-right"> - <button type="submit" class="btn btn-primary">Enregistrer</button> - </div> - </div> - @if ($errors->any()) - <div class="alert alert-danger"> - <ul> - @foreach ($errors->all() as $error) - <li>{{ $error }}</li> - @endforeach - </ul> - </div> - @endif - - @foreach ($settingsToPrint as $key => $value) - <div class="form-group"> - @switch($config_settings[str_replace('theme_', '', $key)]['control_type']) - @case('bool') - <div class="custom-control custom-switch"> - <input type="checkbox" class="custom-control-input" id="{{$key}}" name="{{$key}}" @if($value) checked @endif> - <label class="custom-control-label" for="{{$key}}">{{ __($config_settings[str_replace('theme_', '', $key)]['label'] ?? $key) }}</label> - </div> - <small class="text-muted">{{ __($config_settings[str_replace('theme_', '', $key)]['help_text'] ?? '') }}</small> - @break - @default - <label class="col-form-label"> - {{ __($config_settings[str_replace('theme_', '', $key)]['label'] ?? $key) }} - <input type="text" name="{{$key}}" class="form-control" value="{{$value}}"> - <small class="text-muted">{{ __($config_settings[str_replace('theme_', '', $key)]['help_text'] ?? '') }}</small> - </label> - @endswitch - </div> - @endforeach - </form> -@endsection diff --git a/resources/views/bo/shops/create.blade.php b/resources/views/bo/shops/create.blade.php new file mode 100644 index 00000000..0b7dd5d6 --- /dev/null +++ b/resources/views/bo/shops/create.blade.php @@ -0,0 +1,31 @@ +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s', Str::ucfirst(__('crud.actions.create')), Str::ucfirst(trans_choice('models.classes.shops', 1)))) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <a class="btn btn-sm btn-primary" href="{{ route('bo.shops.index') }}"><i class="fa-solid fa-arrow-left"></i></a> + {{ Str::ucfirst(trans_choice('models.classes.shops', 1)) }} {{ Str::ucfirst(__('crud.actions.create')) }} + </h1> + </div> + </div> + </div> + <div class="card-body"> + <form action="{{ route('bo.shops.store') }}" method="POST" enctype='multipart/form-data'> + @csrf + @include('bo.shops.form') + <div class="text-center"> + <button class="btn btn-primary" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> + </div> + </form> + </div> + </div> +@endsection diff --git a/resources/views/bo/shops/edit.blade.php b/resources/views/bo/shops/edit.blade.php new file mode 100644 index 00000000..4b5dd879 --- /dev/null +++ b/resources/views/bo/shops/edit.blade.php @@ -0,0 +1,82 @@ +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s %s', Str::ucfirst(__('crud.actions.edit')), Str::ucfirst(trans_choice('models.classes.shops', 1)), + $shop->name)) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $shop) @endphp + +@section('content') + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <a class="btn btn-sm btn-primary" href="{{ URL::previous() === request()->url() ? route('bo.shops.index') : URL::previous() }}"><i + class="fa-solid fa-arrow-left"></i></a> + {{ Str::ucfirst(trans_choice('models.classes.shops', 1)) }} {{ Str::ucfirst(__('crud.actions.edit')) }} + </h1> + </div> + <div class="col-5 text-end"> + <div class="btn-group"> + @can('pickupExceptionUpdate', $shop) + <a class="btn btn-sm btn-info w-auto" data-bs-toggle="tooltip" href="{{ route('bo.shops.pickup-exceptions.edit', $shop) }}" + title="{{ Str::ucfirst( + __('crud.helpers.associate_model', [ + 'model' => Str::ucfirst(trans_choice('models.classes.pickup-exceptions', \INF)), + ]), + ) }}"><i + class="fa-solid fa-calendar-xmark"></i> + <span class="d-none d-sm-inline">{{ Str::ucfirst(trans_choice('models.classes.pickup-exceptions', \INF)) }}</span> + </a> + @endcan + <button class="btn btn-sm btn-primary" id="deported-submit-btn"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> + @can('delete', $shop) + <form class="d-inline confirmDeleteJS" action="{{ route('bo.shops.destroy', $shop) }}" method="POST"> + @method('DELETE') + @csrf + <button class="btn btn-sm btn-danger rounded-start-0" title="{{ __('crud.actions.delete') }}"><i + class="fa-solid fa-trash"></i></button> + </form> + @endcan + </div> + </div> + </div> + </div> + <div class="card-body"> + <form action="{{ route('bo.shops.update', $shop) }}" method="POST" enctype='multipart/form-data'> + @csrf + {{ method_field('PUT') }} + @include('bo.shops.form', compact('shop')) + <div class="text-center"> + <span class="d-block mb-3"> + <span class="badge text-bg-info">{{ __('crud.helpers.required_fields_with_aster') }}</span> + </span> + <button class="btn btn-primary" id="submit-btn" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> + </div> + </form> + </div> + </div> +@endsection + +@push('scripts') + <script nonce="{{ Vite::cspNonce() }}"> + document.addEventListener('DOMContentLoaded', function() { + const deportedSubmitBtn = document.getElementById('deported-submit-btn') + const submitBtn = document.getElementById('submit-btn') + + if (!deportedSubmitBtn) { + throw new Error('Missing btn#deported-submit-btn') + } + if (!submitBtn) { + throw new Error('Missing btn#submit-btn') + } + + deportedSubmitBtn.addEventListener('click', () => submitBtn.click()) + }) + </script> +@endpush diff --git a/resources/views/bo/shops/form.blade.php b/resources/views/bo/shops/form.blade.php new file mode 100644 index 00000000..dc875c02 --- /dev/null +++ b/resources/views/bo/shops/form.blade.php @@ -0,0 +1,176 @@ +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ __('General Information') }}</legend> + <div class="row mb-3"> + + <div class="col-12 col-md-8 form-group"> + <label class="col-form-label" for="shop-name"> + <b>{{ Str::ucfirst(__('Pickup point name')) }}*</b> + </label> + <input class="form-control" id="shop-name" name="name" type="text" value="{{ old('name', $shop->name ?? '') }}" required> + @include('bo.modules.input-error', ['inputName' => 'name']) + </div> + + <div class="col-12 col-md-4 form-group pt-4"> + <input class="form-check-input mt-2" id="shop-default" name="default" type="checkbox" value="1" @checked(old('default', $shop->default ?? '0'))> + <label class="col-form-label form-check-label pt-1" for="shop-default"> + <b>{{ Str::ucfirst(__('Default pickup point')) }}</b> + </label><br> + @include('bo.modules.input-error', ['inputName' => 'default']) + </div> + + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ __('Contact Information') }}</legend> + + <div class="row mb-3"> + <div class="col-12 form-group position-relative"> + <label class="col-form-label" for="shop-address"> + <b>{{ Str::ucfirst(__('Address')) }}*</b> + </label> + <input class="form-control" id="shop-address" name="address" type="text" value="{{ old('address', $shop->address ?? '') }}" + required autocomplete="off" placeholder="{{ __('Start typing an address..') }}"> + + <ul class="list-group position-absolute w-100 shadow-sm autocomplete-dropdown" id="address-suggestions"> + </ul> + + @include('bo.modules.input-error', ['inputName' => 'address']) + </div> + </div> + + <div class="row mb-3"> + <div class="col-12 col-md-4 form-group"> + <label class="col-form-label" for="shop-postcode"> + <b>{{ Str::ucfirst(__('Zip code')) }}*</b> + </label> + <input class="form-control" id="shop-postcode" name="postcode" type="text" value="{{ old('postcode', $shop->postcode ?? '') }}" + autocomplete="off" required> + @include('bo.modules.input-error', ['inputName' => 'postcode']) + </div> + + <div class="col-12 col-md-4 form-group"> + <label class="col-form-label" for="shop-city"> + <b>{{ Str::ucfirst(__('City')) }}*</b> + </label> + <input class="form-control" id="shop-city" name="city" type="text" value="{{ old('city', $shop->city ?? '') }}" + autocomplete="off" required> + @include('bo.modules.input-error', ['inputName' => 'city']) + </div> + + <div class="col-12 col-md-4 form-group"> + <label class="col-form-label" for="shop-phone"> + <b>{{ Str::ucfirst(__('Phone')) }}</b> + </label> + <input class="form-control" id="shop-phone" name="phone" type="text" value="{{ old('phone', $shop->phone ?? '') }}" + autocomplete="off"> + @include('bo.modules.input-error', ['inputName' => 'phone']) + </div> + </div> + + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ __('GPS & Maps Coordinates') }}</legend> + + <div class="row mb-3"> + <div class="col-12 form-group"> + <label class="col-form-label" for="map-location-picker"><b>{{ Str::ucfirst(__('Location on the map')) }}</b></label> + @php + $mapData = [ + 'latName' => 'latitude', + 'lngName' => 'longitude', + 'lat' => old('latitude', $shop->latitude ?? null), + 'lng' => old('longitude', $shop->longitude ?? null), + ]; + @endphp + <div id="map-location-picker" data-json='@json($mapData)'></div> + @include('bo.modules.input-error', ['inputName' => 'latitude']) + @include('bo.modules.input-error', ['inputName' => 'longitude']) + </div> + </div> + + </fieldset> + </div> +</div> + +@push('scripts') + <script nonce="{{ Vite::cspNonce() }}"> + document.addEventListener('DOMContentLoaded', function() { + const addressInput = document.getElementById('shop-address'); + const postcodeInput = document.getElementById('shop-postcode'); + const cityInput = document.getElementById('shop-city'); + const suggestionsList = document.getElementById('address-suggestions'); + + let debounceTimer; + + addressInput.addEventListener('input', function() { + clearTimeout(debounceTimer); + const query = this.value; + + if (query.length < 3) { + suggestionsList.style.display = 'none'; + return; + } + + debounceTimer = setTimeout(() => { + fetch(`https://api-adresse.data.gouv.fr/search/?q=${encodeURIComponent(query)}&limit=5&autocomplete=1`) + .then(response => response.json()) + .then(data => { + suggestionsList.innerHTML = ''; + + if (data.features && data.features.length > 0) { + data.features.forEach(feature => { + const li = document.createElement('li'); + li.className = 'list-group-item list-group-item-action'; + li.style.cursor = 'pointer'; + li.textContent = feature.properties.label; + + li.addEventListener('click', function() { + addressInput.value = feature.properties.name; + postcodeInput.value = feature.properties.postcode; + cityInput.value = feature.properties.city; + suggestionsList.style.display = 'none'; + + const lng = feature.geometry.coordinates[0]; + const lat = feature.geometry.coordinates[1]; + + const event = new CustomEvent('ban-address-selected', { + detail: { + lat: lat, + lng: lng + } + }); + document.dispatchEvent(event); + }); + + suggestionsList.appendChild(li); + }); + + suggestionsList.style.display = 'block'; + } else { + suggestionsList.style.display = 'none'; + } + }) + .catch(error => console.error('BAN error:', error)); + }, 300); + }); + + document.addEventListener('click', function(e) { + if (e.target !== addressInput && !suggestionsList.contains(e.target)) { + suggestionsList.style.display = 'none'; + } + }); + }); + </script> +@endpush diff --git a/resources/views/bo/shops/index-filters.blade.php b/resources/views/bo/shops/index-filters.blade.php new file mode 100644 index 00000000..c9dd8d58 --- /dev/null +++ b/resources/views/bo/shops/index-filters.blade.php @@ -0,0 +1,53 @@ +<form class="row justify-content-center" id="filter-form" action="{{ request()->getRequestUri() }}"> + <div class="col-md-8 mb-3"> + {{-- BRANDS --}} + <div class="input-group"> + <label class="input-group-text" for="filter-form-pickup-exception"> + {{ __('Filter by :value', [ + 'value' => Str::ucfirst(trans_choice('models.classes.pickup-exceptions', 1)), + ]) }} + </label> + <select class="form-select" id="filter-form-pickup-exception" name="pickup-exception"> + <option value="" @selected(!Session::get('shops.filter.pickup-exception'))> + {{ __('Select') . ' ' . Str::ucfirst(trans_choice('models.classes.pickup-exceptions', 1)) }} + </option> + @foreach ($pickupExceptions as $pickupException) + <option value="{{ $pickupException->id }}" @selected(Session::get('shops.filter.pickup-exception') === strval($pickupException->id))> + <span>({{ Date::forHumans($pickupException->date) }})</span>  + <span>{{ $pickupException->label }}</span> + </option> + @endforeach + </select> + </div> + </div> + </div> +</form> + +@push('scripts') + <script nonce="{{ Vite::cspNonce() }}"> + document.addEventListener('DOMContentLoaded', function() { + const filterForm = document.getElementById('filter-form'); + const filterFormPickupException = document.getElementById('filter-form-pickup-exception'); + if ( + !filterForm || + !filterFormPickupException + ) { + console.error('missing element'); + return; + } + const submit = () => { + const url = new URL(window.location.href); + Object.values(filterForm).forEach((el) => { + if (el.tagName === 'SELECT') { + url.searchParams.set(el.name, el.value) + } + if (el.type === 'checkbox') { + url.searchParams.set(el.name, el.checked) + } + }); + window.location = url; + }; + filterFormPickupException.addEventListener('change', submit); + }); + </script> +@endpush diff --git a/resources/views/bo/shops/index-list.blade.php b/resources/views/bo/shops/index-list.blade.php new file mode 100644 index 00000000..821ea841 --- /dev/null +++ b/resources/views/bo/shops/index-list.blade.php @@ -0,0 +1,62 @@ +<div class="table-responsive"> + <table class="fix-action table"> + <thead> + <tr class="visually-hidden"> + <th scope="col"></th> + </tr> + @php + $cols = [ + 'name' => Str::ucfirst(__('validation.attributes.name')), + 'address' => Str::ucfirst(__('validation.custom.attributes.postal_address')), + 'phone' => Str::ucfirst(__('validation.attributes.phone')), + ]; + @endphp + @include('bo.modules.tableColSorter', ['cols' => $cols, 'mobileHide' => ['description']]) + </thead> + <tbody> + @forelse ($shops as $shop) + <tr> + <td>{{ Str::limit($shop->name, 25) }}</td> + <td>{{ Str::limit($shop->address, 50) }}</td> + <td> + <a href="tel:{{ $shop->phone }}" + title="{{ __('Call the :phone', [ + 'phone' => $shop->phone, + ]) }}">{{ $shop->phone }}</a> + </td> + <td> + <div class="btn-group"> + @can('pickupExceptionUpdate', $shop) + <a class="btn btn-sm btn-info" href="{{ route('bo.shops.pickup-exceptions.edit', $shop) }}" + title="{{ Str::ucfirst( + __('crud.helpers.associate_model', [ + 'model' => Str::ucfirst(trans_choice('models.classes.pickup-exceptions', \INF)), + ]), + ) }}"><i + class="fa-solid fa-calendar-xmark"></i></a> + @endcan + @can('update', $shop) + <a class="btn btn-sm btn-primary" href="{{ route('bo.shops.edit', $shop) }}" + title="{{ Str::ucfirst(__('crud.actions.update')) }}"><i class="fa-solid fa-pen"></i></a> + @endcan + @can('delete', $shop) + <form class="d-inline confirmDeleteJS" action="{{ route('bo.shops.destroy', $shop) }}" method="POST"> + @method('DELETE') + @csrf + <button class="btn btn-sm btn-danger rounded-start-0" title="{{ Str::ucfirst(__('crud.actions.delete')) }}"><i + class="fa-solid fa-trash"></i></button> + </form> + @endcan + </div> + </td> + </tr> + @empty + <tr> + <td class="text-center" colspan="20"> + <span class="h3">{{ __('crud.helpers.no_results') }}</span> + </td> + </tr> + @endforelse + </tbody> + </table> +</div> diff --git a/resources/views/bo/shops/index.blade.php b/resources/views/bo/shops/index.blade.php new file mode 100644 index 00000000..2a9fe92b --- /dev/null +++ b/resources/views/bo/shops/index.blade.php @@ -0,0 +1,48 @@ +@extends('bo.layouts.layout') + +@section('title', Str::ucfirst(trans_choice('models.classes.shops', \INF))) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + {{ Str::ucfirst(trans_choice('models.classes.shops', \INF)) }} {{ Str::ucfirst(__('crud.actions.list')) }} + </h1> + </div> + <div class="col-3"> + <div class="input-group justify-content-end"> + @can('create', \App\Models\Shop::class) + <a class="btn btn-primary" href="{{ route('bo.shops.create') }}" + title="{{ Str::ucfirst(__('crud.actions.create')) }} {{ Str::ucfirst(trans_choice('models.classes.shops', \INF)) }}"><i + class="fa-solid fa-square-plus"></i></a> + @endcan + </div> + </div> + </div> + </div> + <div class="card-body"> + @include('bo.shops.index-filters', compact('pickupExceptions')) + @if ($shops->count() > \Domain\Enums\Pagination\ItemsPerPaginationEnum::twelve->value()) + <div class="row justify-content-center"> + <div class="col-12 p-md-3 p-0"> + {{ $shops->withQueryString()->onEachSide(1)->links() }} + </div> + </div> + @endif + <div class="row"> + <div class="col"> + @include('bo.shops.index-list') + </div> + </div> + <div class="row justify-content-center"> + <div class="col-12 p-md-3 p-0"> + {{ $shops->withQueryString()->onEachSide(1)->links() }} + </div> + </div> + </div> + </div> +@endsection diff --git a/resources/views/bo/shops/pickup-exceptions.blade.php b/resources/views/bo/shops/pickup-exceptions.blade.php new file mode 100644 index 00000000..7b542fd0 --- /dev/null +++ b/resources/views/bo/shops/pickup-exceptions.blade.php @@ -0,0 +1,279 @@ +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s %s %s', Str::ucfirst(__('crud.actions.edit')), Str::ucfirst(trans_choice('models.classes.shops', 1)), + Str::ucfirst(trans_choice('models.classes.pickup-exceptions', \INF)), $shop->name)) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $shop) @endphp + +@section('content') + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <a class="btn btn-sm btn-primary" href="{{ route('bo.shops.index') }}"><i class="fas fa-arrow-left"></i></a> + {{ sprintf( + '%s - %s %s %s', + Str::ucfirst(__('crud.actions.edit')), + Str::ucfirst(trans_choice('models.classes.shops', 1)), + Str::ucfirst(trans_choice('models.classes.pickup-exceptions', \INF)), + $shop->name, + ) }} + </h1> + </div> + </div> + </div> + <div class="card-body"> + <form action="{{ route('bo.shops.pickup-exceptions.update', $shop) }}" method="POST"> + @csrf + {{ method_field('PUT') }} + + <div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend> + <i class="fas fa-calendar-xmark text-primary me-2"></i> + {{ Str::ucfirst(trans_choice('models.classes.pickup-exceptions', \INF)) }} + </legend> + + <div class="row mb-3"> + <div class="col"> + <span class="h6 text-info text-decoration-underline"> + {!! clean( + __('The usual pickup day is :date', [ + 'date' => '<strong>' . $pickupPeriod->getEndDate()->translatedFormat('l') . '</strong>', + ]), + ) !!} + </span><br> + <span class="h6 text-info text-decoration-underline"> + {!! clean( + __('The usual limit to pass an order is :date', [ + 'date' => '<strong>' . $pickupPeriod->getStartDate()->translatedFormat('l H\h:i') . '</strong>', + ]), + ) !!} + </span> + </div> + </div> + + <div class="row mb-3"> + <div class="col-12 form-group"> + <span class="col-form-label mb-2"> + <b>{{ __('Select') . ' ' . Str::ucfirst(trans_choice('models.classes.pickup-exceptions', 1)) }}*</b> + </span><br> + + @include('bo.modules.input-error', [ + 'inputName' => 'pickup-exceptions', + 'helper' => __( + 'Check all collection exceptions that concern this store. Use the options button to configure postponements if necessary.'), + ]) + + <div class="row g-3 mt-2"> + @forelse($pickupExceptions as $dto) + @php + $exception = $dto->pickupException; + $associatedException = $shop->pickupExceptions->firstWhere('id', $exception->id); + + $isChecked = in_array($exception->id, old('pickup-exceptions', $shop->pickupExceptions->pluck('id')->toArray())); + + $replacement_date = old( + "replacement_date.{$exception->id}", + $associatedException?->pivot?->replacement_date?->format('Y-m-d'), + ); + $order_deadline_at = old( + "order_deadline_at.{$exception->id}", + $associatedException?->pivot?->order_deadline_at?->format('Y-m-d\TH:i'), + ); + + $noReplacement = $isChecked && empty($associatedException?->pivot?->replacement_date); + + $isCritical = $dto->missingSubsitute || $dto->passedDeadline; + + $criticalReason = $dto->missingSubsitute + ? __('No substitute days have been set up. No time slots will be generated for this week.') + : __('The order deadline has passed. This item will no longer be available for purchase.'); + @endphp + + <div class="col-12 col-md-6 col-lg-4"> + <div + class="bg-light d-flex flex-column justify-content-between {{ $isCritical ? 'border-danger border-2' : '' }} rounded border p-3 shadow-sm"> + + <div class="d-flex justify-content-between align-items-start w-100"> + <label class="form-check w-100 m-0 cursor-pointer" for="exception-{{ $exception->id }}"> + <input class="form-check-input exception-checkbox me-2" id="exception-{{ $exception->id }}" + name="pickup-exceptions[]" data-target="fields-{{ $exception->id }}" + data-btn="btn-toggle-{{ $exception->id }}" type="checkbox" value="{{ $exception->id }}" + @checked($isChecked)> + + <span class="form-check-label d-block text-wrap"> + <strong>{{ $exception->label }}</strong> + + <small class="d-block text-muted mt-1"> + <i class="fas fa-calendar-day me-1"></i> + {{ Date::forHumans(\Carbon\Carbon::parse($exception->date)) }} + @if ($dto->isPickupDay) + <small class="badge bg-secondary-subtle text-secondary-emphasis ms-1"> + {{ __('Pickup day') }} + </small> + @endif + </small> + + @if ($isCritical) + <span class="d-block text-danger small fw-bold mt-2" data-bs-toggle="tooltip" + title="{{ $criticalReason }}"> + <i class="fa-solid fa-triangle-exclamation text-danger me-1"></i> {{ __('Blocked week') }} + </span> + @elseif ($noReplacement) + <span class="d-block text-info small fw-bold mt-2"> + <i class="fa-solid fa-circle-info text-info me-1"></i> {{ __('No replacement date configured') }} + </span> + @elseif($associatedException?->pivot?->replacement_date) + <span class="d-block text-primary small fw-bold mt-2"> + <i class="fa-solid fa-circle-info me-1"></i> + <span>{{ __('Replacement date :date', [ + 'date' => Date::forHumans(\Carbon\Carbon::parse($associatedException?->pivot?->replacement_date)), + ]) }}</span> + </span> + @endif + </label> + + <button + class="btn btn-sm {{ $isCritical ? 'btn-danger' : 'btn-outline-secondary' }} {{ $isChecked ? '' : 'disabled opacity-25' }} ms-2" + id="btn-toggle-{{ $exception->id }}" data-bs-toggle="collapse" data-bs-target="#fields-{{ $exception->id }}" + type="button"> + <i class="fas fa-cog"></i> + </button> + </div> + <!-- COLLAPSIBLE --> + <div class="{{ $isChecked && $isCritical ? 'show' : '' }} border-top collapse mt-3 pt-3" + id="fields-{{ $exception->id }}"> + + @if ($isCritical) + <div class="alert alert-danger rounded-1 small mb-2 px-2 py-1"> + <i class="fas fa-circle-exclamation me-1"></i> + <small>{{ $criticalReason }}</small> + </div> + @else + <div class="alert alert-info rounded-1 mb-2 px-2 py-1"> + <i class="fas fa-circle-info me-1"></i> + <small>{{ __('Please note: The scheduled postponement is a one-time event and will not repeat automatically.') }}</small> + </div> + @endif + + <!-- REPLACEMENT_DATE --> + <div class="mb-2"> + <label class="form-label small fw-bold text-secondary mb-1" for="{{ "replacement-date-{$exception->id}" }}"> + <i class="fas fa-calendar-plus me-1"></i> + <span>{{ Str::ucfirst(__('validation.custom.attributes.replacement_date')) }}</span> + </label> + <div class="input-group input-group-sm"> + <input class="form-control {{ $isCritical && empty($replacement_date) ? 'is-invalid' : '' }}" + id="{{ "replacement-date-{$exception->id}" }}" name="replacement_date[{{ $exception->id }}]" + type="date" value="{{ $replacement_date }}"> + <button class="btn btn-outline-secondary btn-clean-input" type="button" title="{{ __('Clear') }}"> + <i class="fas fa-eraser"></i> + </button> + </div> + </div> + + <!-- ORDER_DEADLINE_AT --> + <div> + <label class="form-label small fw-bold text-secondary mb-1" for="{{ "order-deadline-at-{$exception->id}" }}"> + <i class="fas fa-hourglass-end me-1"></i> + <span>{{ Str::ucfirst(__('validation.custom.attributes.order_deadline_at')) }}</span> + </label> + <div class="input-group input-group-sm"> + <input class="form-control" id="{{ "order-deadline-at-{$exception->id}" }}" + name="order_deadline_at[{{ $exception->id }}]" type="datetime-local" + value="{{ Date::toLocalInput($order_deadline_at) }}"> + <button class="btn btn-outline-secondary btn-clean-input" type="button" title="{{ __('Clear') }}"> + <i class="fas fa-eraser"></i> + </button> + </div> + </div> + </div> + + </div> + </div> + @empty + <div class="col-12 py-4 text-center"> + <p class="text-muted mb-0">{{ __('No pickup exception has been created for now.') }}</p> + </div> + @endforelse + </div> + </div> + </div> + </fieldset> + </div> + </div> + + <input id="client-timezone" name="client_timezone" type="hidden"> + + <div class="text-center"> + <span class="d-block mb-3"> + <span class="badge text-bg-info">{{ __('crud.helpers.required_fields_with_aster') }}</span> + </span> + <button class="btn btn-primary" id="submit-btn" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> + </div> + </form> + </div> + </div> +@endsection + +@push('scripts') + <script nonce="{{ Vite::cspNonce() }}"> + document.addEventListener('DOMContentLoaded', function() { + const tz = Intl.DateTimeFormat().resolvedOptions().timeZone; + document.getElementById('client-timezone').value = tz; + }); + </script> +@endpush + +@push('scripts') + <script nonce="{{ Vite::cspNonce() }}"> + document.addEventListener('DOMContentLoaded', function() { + const checkboxes = document.querySelectorAll('.exception-checkbox'); + const cleanButtons = document.querySelectorAll('.btn-clean-input'); + + checkboxes.forEach(checkbox => { + const targetId = checkbox.getAttribute('data-target'); + const buttonId = checkbox.getAttribute('data-btn'); + + const targetDiv = document.getElementById(targetId); + const toggleBtn = document.getElementById(buttonId); + + const bsCollapse = new bootstrap.Collapse(targetDiv, { + toggle: false + }); + + checkbox.addEventListener('change', function() { + if (this.checked) { + toggleBtn.classList.remove('disabled', 'opacity-25'); + } else { + toggleBtn.classList.add('disabled', 'opacity-25'); + toggleBtn.setAttribute('aria-expanded', 'false'); + + bsCollapse.hide(); + + targetDiv.addEventListener('hidden.bs.collapse', function onHidden() { + targetDiv.querySelectorAll('input').forEach(input => input.value = ''); + targetDiv.removeEventListener('hidden.bs.collapse', onHidden); + }); + } + }); + }); + + cleanButtons.forEach(button => { + button.addEventListener('click', function() { + const inputField = this.closest('.input-group').querySelector('input'); + if (inputField) { + inputField.value = ''; + inputField.dispatchEvent(new Event('change')); + } + }); + }); + }); + </script> +@endpush diff --git a/resources/views/bo/sliders/create.blade.php b/resources/views/bo/sliders/create.blade.php deleted file mode 100644 index cdb2e7cd..00000000 --- a/resources/views/bo/sliders/create.blade.php +++ /dev/null @@ -1,36 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') -<form action="{{route('bo.sliders.store')}}" method="POST" enctype="multipart/form-data"> - @csrf - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2"><a href="{{route('bo.sliders.index')}}" class="h2 text-decoration-none"><</a> Sliders <small class="text-muted">Création</small></h1> - <div class="btn-toolbar mb-2 mb-md-0"> - <button type="submit" class="btn btn-sm btn-primary">Enregistrer</a> - </div> - </div> - @if ($errors->any()) - <div class="alert alert-danger"> - <ul> - @foreach ($errors->all() as $error) - <li>{{ $error }}</li> - @endforeach - </ul> - </div> - @endif - - <div class="form-group"> - <label for="name">Label *</label> - <input type="text" id="label" name="label" class="form-control" placeholder="Label * " value="{{ old('label') }}" required> - </div> - <div class="form-group"> - <label for="name">Slug</label> - <input type="text" id="slug" name="slug" class="form-control" placeholder="Slug" value="{{ old('slug') }}"> - <small class="text-muted"> laisser vide pour une génération automatique </small> - </div> - <div class="form-group"> - <label for="name">Commentaire</label> - <input type="text" id="commentaire" name="commentaire" class="form-control" placeholder="Commentaire" value="{{ old('commentaire') }}"> - </div> -</form> -@endsection diff --git a/resources/views/bo/sliders/edit.blade.php b/resources/views/bo/sliders/edit.blade.php deleted file mode 100644 index 1fbfc88f..00000000 --- a/resources/views/bo/sliders/edit.blade.php +++ /dev/null @@ -1,90 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') -<form action="{{ route('bo.sliders.update', $slider->id) }}" method="POST" enctype="multipart/form-data"> - @method('PUT') - @csrf - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2"><a href="{{route('bo.sliders.index')}}" class="h2 text-decoration-none"><</a> Slider <small class="text-muted">Edition</small></h1> - @if (session('success')) - <span class="float-center text-success">{{ session('success') }}</span> - @endif - <div class="btn-toolbar mb-2 mb-md-0"> - <button type="submit" class="btn btn-sm btn-primary">Enregistrer</a> - </div> - </div> - @if ($errors->any()) - <div class="alert alert-danger"> - <ul> - @foreach ($errors->all() as $error) - <li>{{ $error }}</li> - @endforeach - </ul> - </div> - @endif - <div class="row"> - <div class="form-group col"> - <label for="name">Label *</label> - <input type="text" id="label" name="label" class="form-control" placeholder="Label * " value="{{ old('label',$slider->label) }}" required> - </div> - <div class="form-group col"> - <label for="name">Slug</label> - <input type="text" id="slug" name="slug" class="form-control" placeholder="Slug" value="{{ old('slug',$slider->slug) }}" required> - </div> - </div> - <div class="form-group"> - <label for="name">Commentaire</label> - <input type="text" id="commentaire" name="commentaire" class="form-control" placeholder="Commentaire" value="{{ old('commentaire',$slider->commentaire) }}"> - </div> -</form> -<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h2><small class="text-muted">Slides</small></h2> -</div> -<table class="table"> - <thead class="thead-dark"> - <tr> - <th scope="col">Titre</th> - <th scope="col">Texte</th> - <th scope="col">Image</th> - <th scope="col">Lien</th> - <th scope="col">Début</th> - <th scope="col">Fin</th> - <th scope="col">Slider de regroupement</th> - <th scope="col">Ordre</th> - <th scope="col"></th> - </tr> - </thead> - <tbody> - @foreach($slider->slides as $slide) - <tr> - <td>{{$slide->title}}</td> - <td>{!! $slide->text !!}</td> - <td><img src="{{ asset('/storage/images/slides/' . $slide->picture) }}" height="50px"></td> - <td><a href="{{$slide->link}}" target="_slide">{{ $slide->link_label }}</a></td> - <td>{{$slide->date_start}}</td> - <td>{{$slide->date_end}}</td> - <td>{{$slide->slider->label}}</td> - <td> - @if ($loop->first) - <a href="{{route('bo.slides.change-order', ['id' => $slide->id, 'action' => 'down'])}}" class="btn-link text-decoration-none"> - <i name="down_arrow" class="icon-size far fa-arrow-alt-circle-down fa-2x"></i> - </a> - @elseif($loop->last) - <a href="{{route('bo.slides.change-order', ['id' => $slide->id, 'action' => 'up'])}}" class="btn-link text-decoration-none"> - <i name="up_arrow" class="icon-size far fa-arrow-alt-circle-up fa-2x"></i> - </a> - @else - <a href="{{route('bo.slides.change-order', ['id' => $slide->id, 'action' => 'up'])}}" class="btn-link text-decoration-none"> - <i name="up_arrow" class="icon-size far fa-arrow-alt-circle-up fa-2x"></i> - </a> - <a href="{{route('bo.slides.change-order', ['id' => $slide->id, 'action' => 'down'])}}" class="btn-link text-decoration-none"> - <i name="down_arrow" class="icon-size far fa-arrow-alt-circle-down fa-2x"></i> - </a> - @endif - </td> - <td><a href="{{route('bo.slides.edit', ['slide' => $slide->id])}}" class="btn btn-sm btn-primary">Éditer</a></td> - </tr> - @endforeach - </tbody> -</table> -@endsection diff --git a/resources/views/bo/sliders/index.blade.php b/resources/views/bo/sliders/index.blade.php deleted file mode 100644 index 313c3825..00000000 --- a/resources/views/bo/sliders/index.blade.php +++ /dev/null @@ -1,40 +0,0 @@ -@extends('layouts.bo-layout') - -@section('content') - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2">Sliders <small class="text-muted">Liste</small></h1> - - @if ($errors->any()) - @foreach($errors->all() as $error) - <span class="float-center text-danger">{{ $error }}</span> - @endforeach - @endif - <a href="{{route('bo.sliders.create')}}" class="btn btn-primary float-right">Créer un slider</a> - </div> -<table class="table"> - <thead> - <th scope="col">Label</th> - <th scope="col">Slug</th> - <th scope="col">Commentaire</th> - <th></th> - </thead> - <tbody> - @foreach ($sliders as $slider) - <tr> - <td>{{$slider->label}}</td> - <td>{{$slider->slug}}</td> - <td>{{$slider->commentaire}}</td> - <td class="text-center"> - <a href="{{route('bo.sliders.edit', $slider->id)}}" class="btn btn-sm btn-primary">Éditer</a> - <form action="{{route('bo.sliders.destroy', $slider->id)}}" method="POST" class="d-inline"> - @method('DELETE') - @csrf - <input type="submit" class="btn btn-sm btn-danger" value="Supprimer" - onclick="return confirm('Êtes-vous sûr(e) ?')"> - </form> - </td> - </tr> - @endforeach - </tbody> - </table> -@endsection diff --git a/resources/views/bo/slides/create.blade.php b/resources/views/bo/slides/create.blade.php index 636cc809..cc231b38 100644 --- a/resources/views/bo/slides/create.blade.php +++ b/resources/views/bo/slides/create.blade.php @@ -1,117 +1,31 @@ -@extends('layouts.bo-layout') +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s', Str::ucfirst(__('creation')), Str::ucfirst(trans_choice('models.classes.slides', 1)))) + +@section('breadcrumb', request()->route()->getName()) @section('content') -<form action="{{route('bo.slides.store')}}" method="POST" enctype="multipart/form-data"> - @csrf - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2"><a href="{{route('bo.slides.index')}}" class="h2 text-decoration-none"><</a> Slides <small class="text-muted">Création</small></h1> - <div class="btn-toolbar mb-2 mb-md-0"> - <button type="submit" class="btn btn-sm btn-primary">Enregistrer</a> + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <a class="btn btn-sm btn-primary" href="{{ route('bo.slides.index') }}"><i class="fa-solid fa-arrow-left"></i></a> + {{ Str::ucfirst(trans_choice('models.classes.slides', 1)) }} {{ Str::ucfirst(__('crud.actions.create')) }} + </h1> </div> + </div> </div> - @if ($errors->any()) - <div class="alert alert-danger"> - <ul> - @foreach ($errors->all() as $error) - <li>{{ $error }}</li> - @endforeach - </ul> + <div class="card-body"> + <form action="{{ route('bo.slides.store') }}" method="POST" enctype='multipart/form-data'> + @csrf + @include('bo.slides.form') + <div class="text-center"> + <button class="btn btn-primary" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> </div> - @endif - - <div class="form-group"> - <label for="name">Titre *</label> - <input type="text" id="title" name="title" class="form-control" placeholder="Titre * " value="{{ old('title') }}" required> + </form> </div> - <div class="form-group"> - <label for="name">Texte</label> - <textarea class="form-control" id="text" name="text" placeholder="Texte">{{ old('text') }}</textarea> - </div> - <div class="form-group"> - <label for="picture">Image <small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('theme.slide_image_maxwidth') }} px par {{ Config::get('theme.slide_image_maxheight') }} px</small></label></br> - <input type="file" id="picture" name="picture" accept="image/png, image/jpeg"> - </div> - - <div class="row"> - <div class="form-group col"> - <label for="slider_id">Slider de regroupement</label> - <select class="form-select" id="slider_id" name="slider_id"> - @foreach($sliders as $slider) - <option value="{{$slider->id}}">{{$slider->label}}</option> - @endforeach - </select> - </div> - <div class="form-group col"></div> - <div class="form-group col"></div> - <div class="form-group col"></div> - </div> - - <div class="form-group"> - <label> - <input type="checkbox" name="connected"> - Visible uniquement pour les utilisateurs connectés ? - </label> - </div> - - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h2><small class="text-muted">Période de parution</small></h2> - </div> - <div class="row"> - <div class="form-group col"> - <label for="date_start_date">Début <small class="text-muted"> de l'affichage</small></label> - <input type="date" id="date_start_date" name="date_start_date" class="form-control" value="{{ old('date_start_date') }}"> - <input type="time" id="date_start_time" name="date_start_time" class="form-control" value="{{ old('date_start_time') }}"> - <small class="text-muted">Laisser vide pour un affichage immédiat</small> - </div> - <div class="form-group col"> - <label for="date_end_date">Fin <small class="text-muted"> de l'affichage' </small></label> - <input type="date" id="date_end_date" name="date_end_date" class="form-control" value="{{ old('date_end_date') }}"> - <input type="time" id="date_end_time" name="date_end_time" class="form-control" value="{{ old('date_end_time') }}"> - <small class="text-muted">Laisser vide pour un affichage permanent</small> - </div> - </div> - - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h2><small class="text-muted">Options de lien</small></h2> - </div> - <div class="form-group"> - <label for="name">Texte du lien</label> - <input type="text" class="form-control" name="link_label" placeholder="Texte du lien" value="{{ old('link_label') }}"> - </div> - <div class="form-group"> - <label for="name">Cible du lien</label> - <input type="text" class="form-control" name="link" placeholder="Cible du Lien" value="{{ old('link') }}"> - </div> - <div class="form-group text-center"> - <input class="form-check-input" type="checkbox" id="new_tab_cb" name="link_new_tab" @if (old('link_new_tab') !== null)checked @endif> - <label class="form-check-label" for="new_tab_cb">Ouvrir dans un nouvel onglet</label> - </div> - -</form> -@endsection - -@section('scripts') - <script type="text/javascript"> - var editorConfig = { - removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"], - toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'blockQuote', 'insertTable', '|', 'undo', 'redo' ], - heading: { - options: [ - { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' }, - { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' }, - { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }, - { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' }, - { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' } - ] - }, - table: { - contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ] - } - }; - ClassicEditor - .create( document.querySelector( '#text' ), editorConfig) - .catch( error => { - console.error( error ); - } ); - </script> + </div> @endsection diff --git a/resources/views/bo/slides/edit.blade.php b/resources/views/bo/slides/edit.blade.php index 0355c4cd..c4881ffd 100644 --- a/resources/views/bo/slides/edit.blade.php +++ b/resources/views/bo/slides/edit.blade.php @@ -1,136 +1,48 @@ -@extends('layouts.bo-layout') +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s %s', Str::ucfirst(__('crud.actions.edit')), Str::ucfirst(trans_choice('models.classes.slides', 1)), + $slide->title)) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $slide) @endphp @section('content') -<form action="{{route('bo.slides.update', $slide->id)}}" method="POST" enctype="multipart/form-data"> - @method('PUT') - @csrf - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2"><a href="{{route('bo.slides.index')}}" class="h2 text-decoration-none"><</a> Slides <small class="text-muted">Edition</small></h1> - @if (session('success')) - <span class="float-center text-success">{{ session('success') }}</span> - @endif - <div class="btn-toolbar mb-2 mb-md-0"> - <button type="submit" class="btn btn-sm btn-primary">Enregistrer</a> + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <a class="btn btn-sm btn-primary" href="{{ route('bo.slides.index') }}"><i class="fa-solid fa-arrow-left"></i></a> + {{ Str::ucfirst(trans_choice('models.classes.slides', 1)) }} {{ Str::ucfirst(__('crud.actions.edit')) }} + </h1> </div> - </div> - @if ($errors->any()) - <div class="alert alert-danger"> - <ul> - @foreach ($errors->all() as $error) - <li>{{ $error }}</li> - @endforeach - </ul> + <div class="col-3 text-end"> + <div class="btn-group"> + @can('delete', $slide) + <form class="d-inline confirmDeleteJS" action="{{ route('bo.slides.destroy', $slide) }}" method="POST"> + @method('DELETE') + @csrf + <button class="btn btn-sm btn-danger" title="{{ __('crud.actions.delete') }}"><i class="fa-solid fa-trash"></i></button> + </form> + @endcan + </div> </div> - @endif - - <div class="form-group"> - <label for="name">Titre *</label> - <input type="text" id="title" name="title" class="form-control" placeholder="Titre * " value="{{ old('title', $slide->title) }}" required> + </div> </div> - <div class="form-group"> - <label for="name">Texte</label> - <textarea class="form-control" id="text" name="text" placeholder="Texte">{{ old('text', $slide->text) }}</textarea> - </div> - <div class="form-group"> - <label for="picture">Image <small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('theme.slide_image_maxwidth') }} px par {{ Config::get('theme.slide_image_maxheight') }} px</small></label></br> - <input type="file" id="picture" name="picture" accept="image/png, image/jpeg"> - @if ($slide->picture !== null) - <br/> - <br/> - <img src="/storage/images/slides/{{$slide->picture}}" alt="{{$slide->title}}" style="max-height: 100px;"> - @endif - </div> - - <div class="row"> - <div class="form-group col"> - <label for="slider_id">Slider de regroupement</label> - <select class="form-select" id="slider_id" name="slider_id"> - @foreach($sliders as $slider) - <option value="{{$slider->id}}" @if ($slider->id === $slide->slider_id) selected @endif>{{$slider->label}}</option> - @endforeach - </select> + <div class="card-body"> + <form action="{{ route('bo.slides.update', $slide) }}" method="POST" enctype='multipart/form-data'> + @csrf + {{ method_field('PUT') }} + @include('bo.slides.form', compact('slide')) + <div class="text-center"> + <span class="d-block mb-3"> + <span class="badge text-bg-info">{{ __('crud.helpers.required_fields_with_aster') }}</span> + </span> + <button class="btn btn-primary" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> </div> - <div class="form-group col"></div> - <div class="form-group col"></div> - <div class="form-group col"></div> + </form> </div> - - <div class="form-group"> - <label> - <input type="checkbox" name="connected" @if ($slide->connected) checked @endif> - Visible uniquement pour les utilisateurs connectés ? - </label> - </div> - - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h2><small class="text-muted">Période de parution</small></h2> - </div> - <div class="row"> - <div class="form-group col"> - <label for="date_start_date">Début <small class="text-muted"> de l'affichage</small></label> - @if($slide->date_start !== null) - <input type="date" id="date_start_date" name="date_start_date" class="form-control" value="{{ old('date_start_date', date_format($slide->date_start, "Y-m-d")) }}"> - <input type="time" id="date_start_time" name="date_start_time" class="form-control" value="{{ old('date_start_time', date_format($slide->date_start, "H:i")) }}"> - @else - <input type="date" id="date_start_date" name="date_start_date" class="form-control" value="{{ old('date_start_date') }}"> - <input type="time" id="date_start_time" name="date_start_time" class="form-control" value="{{ old('date_start_time') }}"> - @endif - <small class="text-muted">Laisser vide pour un affichage immédiat</small> - </div> - <div class="form-group col"> - <label for="date_end_date">Fin <small class="text-muted"> de l'affichage' </small></label> - @if($slide->date_end !== null) - <input type="date" id="date_end_date" name="date_end_date" class="form-control" value="{{ old('date_end_date', date_format($slide->date_end, "Y-m-d")) }}"> - <input type="time" id="date_end_time" name="date_end_time" class="form-control" value="{{ old('date_end_time', date_format($slide->date_end, "H:i")) }}"> - @else - <input type="date" id="date_end_date" name="date_end_date" class="form-control" value="{{ old('date_end_date') }}"> - <input type="time" id="date_end_time" name="date_end_time" class="form-control" value="{{ old('date_end_time') }}"> - @endif - <small class="text-muted">Laisser vide pour un affichage permanent</small> - </div> - </div> - - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h2><small class="text-muted">Options de lien</small></h2> - </div> - <div class="form-group"> - <label for="name">Texte du lien</label> - <input type="text" class="form-control" name="link_label" placeholder="Texte du lien" value="{{ old('link_label', $slide->link_label) }}"> - </div> - <div class="form-group"> - <label for="name">Cible du lien</label> - <input type="text" class="form-control" name="link" placeholder="Cible du Lien" value="{{ old('link', $slide->link) }}"> - </div> - <div class="form-group text-center"> - <input class="form-check-input" type="checkbox" id="new_tab_cb" name="link_new_tab" @if (old('link_new_tab', $slide->link_new_tab) !== 0)checked @endif> - <label class="form-check-label" for="new_tab_cb">Ouvrir dans un nouvel onglet</label> - </div> - -</form> -@endsection - -@section('scripts') - <script type="text/javascript"> - var editorConfig = { - removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"], - toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'blockQuote', 'insertTable', '|', 'undo', 'redo' ], - heading: { - options: [ - { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' }, - { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' }, - { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }, - { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' }, - { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' } - ] - }, - table: { - contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ] - } - }; - ClassicEditor - .create( document.querySelector( '#text' ), editorConfig) - .catch( error => { - console.error( error ); - } ); - </script> + </div> @endsection diff --git a/resources/views/bo/slides/form.blade.php b/resources/views/bo/slides/form.blade.php new file mode 100644 index 00000000..4f9d7dac --- /dev/null +++ b/resources/views/bo/slides/form.blade.php @@ -0,0 +1,240 @@ +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ __('Slide information') }}</legend> + <div class="row mb-3"> + <!-- Titre --> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="slide-title"><b>{{ Str::ucfirst(__('validation.attributes.title')) }}</b></label> + <div class="word-counter" data-json='@json(['for' => 'slide-title'])'></div> + <input class="form-control" id="slide-title" name="title" type="text" value="{{ old('title', $slide->title ?? '') }}" + aria-describedby="slide-title-help" placeholder="{{ Str::ucfirst(__('validation.attributes.title')) }}" required> + @include('bo.modules.input-error', [ + 'inputName' => 'title', + 'helperId' => 'slide-title-help', + 'helper' => + __('Give your slide a title.') . + ' ' . + __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.attributes.title'), + 'inter' => __('validation.custom.of_the.female'), + 'model' => trans_choice('models.classes.slides', 1), + ]), + 'min' => 4, + 'max' => 75, + ]), + ]) + </div> + + <!-- Visibilité utilisateurs connectés --> + <div class="col-12 form-group pt-3"> + <input class="form-check-input mt-2" id="slide-connected" name="connected" type="checkbox" value="1" + aria-describedby="slide-connected-help" @checked(old('connected', $slide->connected ?? ''))> + <label class="col-form-label pt-1" class="form-check-label" + for="slide-connected"><b>{{ Str::ucfirst(__('validation.custom.attributes.connected')) }}</b></label><br> + @include('bo.modules.input-error', [ + 'inputName' => 'connected', + 'helperId' => 'slide-connected-help', + 'helper' => __('Check to restrict display to logged-in members.'), + ]) + </div> + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend><label class="h4" for="slide-picture">{{ Str::ucfirst(__('validation.attributes.image')) }}</label></legend> + <div class="row"> + @include('bo.modules.input-error', [ + 'inputName' => 'picture', + ]) + @php + $json = [ + 'name' => 'picture', + 'single' => true, + 'width' => 1440, + 'height' => 960, + 'preview' => false, + 'helper' => __('JPEG/PNG, 2MB max. Recommended dimensions: :width px by :height px', [ + 'width' => 1440, + 'height' => 960, + ]), + 'value' => $slide->picture ?? '', + ]; + @endphp + <div class="image-input" data-json='@json($json)'></div> + </div> + + <!-- ALT --> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="slide-alt"><b>{{ Str::ucfirst(__('validation.custom.attributes.picture_alt')) }}</b></label> + <div class="word-counter" data-json='@json(['for' => 'picture-alt'])'></div> + <input class="form-control" id="picture-alt" name="picture_alt" type="text" + value="{{ old('picture_alt', $slide->picture_alt ?? '') }}" aria-describedby="slide-alt-help" + placeholder="{{ __('Artist cat') }}"> + @include('bo.modules.input-error', [ + 'inputName' => 'picture_alt', + 'helperId' => 'slide-alt-help', + 'helper' => __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.custom.attributes.picture_alt'), + 'inter' => __('validation.custom.of_the.male'), + 'model' => trans_choice('models.classes.slides', 1), + ]), + 'min' => 4, + 'max' => 75, + ]), + ]) + </div> + + <!-- PICTURE --> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="slide-title"><b>{{ Str::ucfirst(__('validation.custom.attributes.picture_title')) }}</b></label> + <div class="word-counter" data-json='@json(['for' => 'picture-title'])'></div> + <input class="form-control" id="picture-title" name="picture_title" type="text" + value="{{ old('picture_title', $slide->picture_title ?? '') }}" aria-describedby="slide-picture-title-help" + placeholder="{{ __('Image of a cat playing a grand piano') }}"> + @include('bo.modules.input-error', [ + 'inputName' => 'picture_title', + 'helperId' => 'slide-picture-title-help', + 'helper' => __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.custom.attributes.picture_title'), + 'inter' => __('validation.custom.of_the.male'), + 'model' => trans_choice('models.classes.slides', 1), + ]), + 'min' => 4, + 'max' => 75, + ]), + ]) + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend><label class="h4" for="slide-text">{{ Str::ucfirst(__('validation.attributes.text')) }}</label></legend> + <div class="row"> + <div class="col form-group"> + @include('bo.modules.input-error', [ + 'inputName' => 'text', + 'helper' => + __('The text that will accompany your slide image.') . + ' ' . + __('validation.min.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.attributes.text'), + 'inter' => __('validation.custom.of_the.male'), + 'model' => trans_choice('models.classes.slides', 1), + ]), + 'min' => 4, + ]), + ]) + @php + $editor = [ + 'id' => 'slide-text', + 'csrf' => csrf_token(), + 'name' => 'text', + 'text' => old('text', $slide->text ?? '') ?? '', + ]; + @endphp + <div class="ck-editor" data-json='@json($editor)'></div> + </div> + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ __('Publication period') }}</legend> + <div class="row mb-3"> + <!-- Début --> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" + for="date-start"><b>{{ Str::ucfirst(__('validation.custom.attributes.date_start_show')) }}</b></label> + <div class="d-flex gap-2"> + <input class="form-control" id="date-start" name="date_start" type="datetime-local" + value="{{ old('date_start', Date::toLocalInput($slide->date_start ?? '')) }}"> + </div> + @include('bo.modules.input-error', [ + 'inputName' => 'date_start', + 'helper' => __('Leave empty for immediate display'), + ]) + </div> + + <!-- Fin --> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="date-end"><b>{{ Str::ucfirst(__('validation.custom.attributes.date_end_show')) }}</b></label> + <div class="d-flex gap-2"> + <input class="form-control" id="date-end" name="date_end" type="datetime-local" + value="{{ old('date_end', Date::toLocalInput($slide->date_end ?? '')) }}"> + </div> + @include('bo.modules.input-error', [ + 'inputName' => 'date_end', + 'helper' => __('Leave empty for permanent display'), + ]) + </div> + </div> + </fieldset> + </div> +</div> + +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ __('Link options') }}</legend> + <div class="row mb-3"> + <!-- Texte du lien --> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="link-label"><b>{{ Str::ucfirst(__('validation.custom.attributes.link_label')) }}</b></label> + <div class="word-counter" data-json='@json(['for' => 'link-label'])'></div> + <input class="form-control" id="link-label" name="link_label" type="text" + value="{{ old('link_label', $slide->link_label ?? '') }}" placeholder="{{ __('Learn more...') }}"> + @include('bo.modules.input-error', [ + 'inputName' => 'link_label', + ]) + </div> + + <!-- Cible du lien --> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="link-target"><b>{{ Str::ucfirst(__('validation.custom.attributes.link')) }}</b></label> + <div class="word-counter" data-json='@json(['for' => 'link-target'])'></div> + <input class="form-control" id="link-target" name="link" type="text" value="{{ old('link', $slide->link ?? '') }}" + placeholder="{{ __('https://...') }}"> + @include('bo.modules.input-error', [ + 'inputName' => 'link', + ]) + </div> + + <!-- Nouvel onglet --> + <div class="col-12 form-group pt-3"> + <input class="form-check-input mt-2" id="new-tab-cb" name="link_new_tab" type="checkbox" @checked(old('link_new_tab', $slide->link_new_tab ?? ''))> + <label class="col-form-label pt-1" class="form-check-label" + for="new-tab-cb"><b>{{ Str::ucfirst(__('validation.custom.attributes.link_new_tab')) }}</b></label><br> + @include('bo.modules.input-error', [ + 'inputName' => 'link_new_tab', + ]) + </div> + </div> + </fieldset> + </div> +</div> + +<input id="client-timezone" name="client_timezone" type="hidden"> + +@push('scripts') + <script nonce="{{ Vite::cspNonce() }}"> + document.addEventListener('DOMContentLoaded', function() { + const tz = Intl.DateTimeFormat().resolvedOptions().timeZone; + document.getElementById('client-timezone').value = tz; + }); + </script> +@endpush diff --git a/resources/views/bo/slides/index-list.blade.php b/resources/views/bo/slides/index-list.blade.php new file mode 100644 index 00000000..c82a07da --- /dev/null +++ b/resources/views/bo/slides/index-list.blade.php @@ -0,0 +1,79 @@ +<div class="table-responsive"> + <table class="fix-action table"> + <thead> + <tr class="visually-hidden"> + <th scope="col"></th> + </tr> + @php + $cols = [ + 'title' => Str::ucfirst(__('validation.attributes.title')), + 'picture' => Str::ucfirst(__('validation.attributes.image')), + 'link' => Str::ucfirst(__('validation.custom.attributes.link')), + 'visible' => Str::ucfirst(__('Visible')), + 'date_start' => Str::ucfirst(__('validation.custom.attributes.date_start_show')), + 'date_end' => Str::ucfirst(__('validation.custom.attributes.date_end_show')), + 'order' => Str::ucfirst(__('validation.custom.attributes.order')), + ]; + @endphp + @include('bo.modules.tableColSorter', [ + 'cols' => $cols, + 'ignore' => ['visible', 'picture'], + 'mobileHide' => ['description'], + ]) + </thead> + <tbody> + @forelse ($slides as $slide) + <tr> + <td>{{ $slide->title }}</td> + <td> + <img src="{{ asset($slide->picture) }}" alt="{{ $slide->title }}" height="50px"> + </td> + <td><a href="{{ $slide->link }}" target="_slide">{{ $slide->link_label }}</a></td> + <td class="text-center align-middle"> + @if ($slide->isVisible()) + <i class="fas fa-check check-green" data-bs-toggle="tooltip" title="{{ __('Visible') }}"></i> + @if ($slide->connected) + <br><span class="badge bg-secondary" data-bs-toggle="tooltip" title="{{ __('Connected members only') }}"><i + class="fa-solid fa-lock"></i> {{ __('Connected') }}</span> + @endif + @else + <i class="fas fa-times cross-red" data-bs-toggle="tooltip" title="{{ __('Not visible') }}"></i> + @endif + </td> + <td>{{ Date::forHumans($slide->date_start) }}</td> + <td>{{ Date::forHumans($slide->date_end) }}</td> + @include('bo.modules.change-order', [ + 'route' => 'bo.slides.change-order', + 'model' => $slide, + 'first' => $loop->first, + 'last' => $loop->last, + 'isFirstPage' => $slides->onFirstPage(), + 'isLastPage' => !$slides->hasMorePages(), + ]) + <td> + <div class="btn-group"> + @can('update', $slide) + <a class="btn btn-sm btn-primary" href="{{ route('bo.slides.edit', $slide) }}" + title="{{ Str::ucfirst(__('crud.actions.update')) }}"><i class="fa-solid fa-pen"></i></a> + @endcan + @can('delete', $slide) + <form class="d-inline confirmDeleteJS" action="{{ route('bo.slides.destroy', $slide) }}" method="POST"> + @method('DELETE') + @csrf + <button class="btn btn-sm btn-danger rounded-start-0" title="{{ Str::ucfirst(__('crud.actions.delete')) }}"><i + class="fa-solid fa-trash"></i></button> + </form> + @endcan + </div> + </td> + </tr> + @empty + <tr> + <td class="text-center" colspan="20"> + <span class="h3">{{ __('crud.helpers.no_results') }}</span> + </td> + </tr> + @endforelse + </tbody> + </table> +</div> diff --git a/resources/views/bo/slides/index.blade.php b/resources/views/bo/slides/index.blade.php index 840c71d2..05857e89 100644 --- a/resources/views/bo/slides/index.blade.php +++ b/resources/views/bo/slides/index.blade.php @@ -1,69 +1,47 @@ -@extends('layouts.bo-layout') +@extends('bo.layouts.layout') + +@section('title', Str::ucfirst(trans_choice('models.classes.slides', \INF))) + +@section('breadcrumb', request()->route()->getName()) @section('content') - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2">Slides <small class="text-muted">Liste</small></h1> - - @if ($errors->any()) - @foreach($errors->all() as $error) - <span class="float-center text-danger">{{ $error }}</span> - @endforeach - @endif - <a href="{{route('bo.slides.create')}}" class="btn btn-primary float-right">Créer un slide</a> + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + {{ Str::ucfirst(trans_choice('models.classes.slides', \INF)) }} {{ Str::ucfirst(__('crud.actions.list')) }} + </h1> + </div> + <div class="col-3"> + <div class="input-group justify-content-end"> + @can('create', \App\Models\Slide::class) + <a class="btn btn-primary" href="{{ route('bo.slides.create') }}" + title="{{ Str::ucfirst(__('crud.actions.create')) }} {{ Str::ucfirst(trans_choice('models.classes.slides', \INF)) }}"><i + class="fa-solid fa-square-plus"></i></a> + @endcan + </div> + </div> + </div> </div> - <table class="table"> - <thead class="thead-dark"> - <tr> - <th scope="col">Titre</th> - <th scope="col">Texte</th> - <th scope="col">Image</th> - <th scope="col">Lien</th> - <th scope="col">Début</th> - <th scope="col">Fin</th> - <th scope="col">Slider de regroupement</th> - <th scope="col">Ordre</th> - <th scope="col"></th> - </tr> - </thead> - <tbody> - @foreach($slides as $slide) - <tr> - <td>{{$slide->title}}</td> - <td>{!! $slide->text !!}</td> - <td><img src="{{ asset('/storage/images/slides/' . $slide->picture) }}" height="50px"></td> - <td><a href="{{$slide->link}}" target="_slide">{{ $slide->link_label }}</a></td> - <td>{{$slide->date_start}}</td> - <td>{{$slide->date_end}}</td> - <td><a href="{{route('bo.sliders.edit', $slide->slider->id) }}">{{$slide->slider->label}}</a></td> - <td> - @if ($loop->first) - <a href="{{route('bo.slides.change-order', ['id' => $slide->id, 'action' => 'down'])}}" class="btn-link text-decoration-none"> - <i name="down_arrow" class="icon-size far fa-arrow-alt-circle-down fa-2x"></i> - </a> - @elseif($loop->last) - <a href="{{route('bo.slides.change-order', ['id' => $slide->id, 'action' => 'up'])}}" class="btn-link text-decoration-none"> - <i name="up_arrow" class="icon-size far fa-arrow-alt-circle-up fa-2x"></i> - </a> - @else - <a href="{{route('bo.slides.change-order', ['id' => $slide->id, 'action' => 'up'])}}" class="btn-link text-decoration-none"> - <i name="up_arrow" class="icon-size far fa-arrow-alt-circle-up fa-2x"></i> - </a> - <a href="{{route('bo.slides.change-order', ['id' => $slide->id, 'action' => 'down'])}}" class="btn-link text-decoration-none"> - <i name="down_arrow" class="icon-size far fa-arrow-alt-circle-down fa-2x"></i> - </a> - @endif - </td> - <td> - <a href="{{route('bo.slides.edit', ['slide' => $slide->id])}}" class="btn btn-sm btn-primary">Éditer</a> - <form action="{{route('bo.slides.destroy', $slide->id)}}" method="POST" class="d-inline"> - @method('DELETE') - @csrf - <input type="submit" class="btn btn-sm btn-danger" value="Supprimer" - onclick="return confirm('Êtes-vous sûr(e) ?')"> - </form> - </td> - </tr> - @endforeach - </tbody> - </table> + <div class="card-body"> + @if ($slides->count() > \Domain\Enums\Pagination\ItemsPerPaginationEnum::twelve->value()) + <div class="row justify-content-center"> + <div class="col-12 p-md-3 p-0"> + {{ $slides->withQueryString()->onEachSide(1)->links() }} + </div> + </div> + @endif + <div class="row"> + <div class="col"> + @include('bo.slides.index-list') + </div> + </div> + <div class="row justify-content-center"> + <div class="col-12 p-md-3 p-0"> + {{ $slides->withQueryString()->onEachSide(1)->links() }} + </div> + </div> + </div> + </div> @endsection diff --git a/resources/views/bo/tags/create.blade.php b/resources/views/bo/tags/create.blade.php index 4954a4ed..e70109b8 100644 --- a/resources/views/bo/tags/create.blade.php +++ b/resources/views/bo/tags/create.blade.php @@ -1,33 +1,31 @@ -@extends('layouts.bo-layout') +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s', Str::ucfirst(__('creation')), Str::ucfirst(trans_choice('models.classes.tags', 1)))) + +@section('breadcrumb', request()->route()->getName()) @section('content') - <form action="{{route('bo.tags.store')}}" method="POST" enctype="multipart/form-data"> + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <a class="btn btn-sm btn-primary" href="{{ route('bo.tags.index') }}"><i class="fa-solid fa-arrow-left"></i></a> + {{ Str::ucfirst(trans_choice('models.classes.tags', 1)) }} {{ Str::ucfirst(__('crud.actions.create')) }} + </h1> + </div> + </div> + </div> + <div class="card-body"> + <form action="{{ route('bo.tags.store') }}" method="POST" enctype='multipart/form-data'> @csrf - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2"><a href="{{route('bo.tags.index')}}" class="h2 text-decoration-none"><</a> Mot Clé <small class="text-muted">Création</small></h1> - <div class="btn-toolbar mb-2 mb-md-0"> - <button type="submit" class="btn btn-sm btn-primary">Enregistrer</a> - </div> + @include('bo.tags.form') + <div class="text-center"> + <button class="btn btn-primary" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> </div> - @if ($errors->any()) - <div class="alert alert-danger"> - <ul> - @foreach ($errors->all() as $error) - <li>{{ $error }}</li> - @endforeach - </ul> - </div> - @endif - <div class="form-group"> - <label for="label">Mot Clé</label> - <input type="text" id="label" name="label" class="form-control" placeholder="Mot Clé" value="{{ old('name') }}" required> - </div> - <div class="form-group"> - <div class="custom-control custom-switch"> - <input type="checkbox" class="custom-control-input" id="status" name="status"> - <label class="custom-control-label" for="status">{{ __('Publié ?') }}</label> - </div> - <small class="text-muted">{{ __('') }}</small> - </div> - </form> + </form> + </div> + </div> @endsection diff --git a/resources/views/bo/tags/edit.blade.php b/resources/views/bo/tags/edit.blade.php index cf2375f9..8f100aaf 100644 --- a/resources/views/bo/tags/edit.blade.php +++ b/resources/views/bo/tags/edit.blade.php @@ -1,82 +1,48 @@ -@extends('layouts.bo-layout') +@extends('bo.layouts.layout') + +@section('title', sprintf('%s - %s %s', Str::ucfirst(__('crud.actions.edit')), Str::ucfirst(trans_choice('models.classes.tags', 1)), + $tag->label)) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $tag) @endphp @section('content') - <form action="{{route('bo.tags.update', $tag->id)}}" method="POST" enctype="multipart/form-data"> - @method('PUT') - @csrf - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2"><a href="{{route('bo.tags.index')}}" class="h2 text-decoration-none"><</a> Mot Clé <small class="text-muted">Modification</small></h1> - @if (session('success')) - <span class="float-center text-success">{{ session('success') }}</span> - @endif - <div class="btn-toolbar mb-2 mb-md-0"> - <button type="submit" class="btn btn-sm btn-primary">Enregistrer</a> - </div> + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <h1 class="h3"> + <a class="btn btn-sm btn-primary" href="{{ route('bo.tags.index') }}"><i class="fa-solid fa-arrow-left"></i></a> + {{ Str::ucfirst(trans_choice('models.classes.tags', 1)) }} {{ Str::ucfirst(__('crud.actions.edit')) }} + </h1> </div> - @if ($errors->any()) - <div class="alert alert-danger"> - <ul> - @foreach ($errors->all() as $error) - <li>{{ $error }}</li> - @endforeach - </ul> - </div> - @endif - <div class="form-group"> - <label for="name">Mot Clé</label> - <input type="text" id="label" name="label" class="form-control" placeholder="Mot Clé" value="{{$tag->label}}" required> + <div class="col-3 text-end"> + <div class="btn-group"> + @can('delete', $tag) + <form class="d-inline confirmDeleteJS" action="{{ route('bo.tags.destroy', $tag) }}" method="POST"> + @method('DELETE') + @csrf + <button class="btn btn-sm btn-danger" title="{{ __('crud.actions.delete') }}"><i class="fa-solid fa-trash"></i></button> + </form> + @endcan + </div> </div> - <div class="form-group"> - <div class="custom-control custom-switch"> - <input type="checkbox" class="custom-control-input" id="status" name="status" @if ($tag->status === 1) checked @endif> - <label class="custom-control-label" for="status">{{ __('Publié ?') }}</label> - </div> - <small class="text-muted">{{ __('') }}</small> - </div> - </form> - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h2><small class="text-muted">Produits taggés</small></h2> + </div> </div> - <table class="table"> - <thead class="thead-dark"> - <th scope="col">Image</th> - <th scope="col">Nom</th> - <th scope="col">Prix en €</th> - <th scope="col">Stock</th> - <th scope="col">Référence</th> - <th scope="col">Slug</th> - <th scope="col">Gamme</th> - <th scope="col">Publié</th> - <th></th> - </thead> - <tbody> - @foreach ($tag->products as $product) - <tr> - <td>@if ($product->picture !== null)<img src="/storage/images/produits/{{$product->picture}}" alt="{{$product->name}}" style="max-height: 100px;">@endif</td> - <td>{{$product->name}}</td> - <td>{{number_format($product->price, 2, ',', ' ')}}€</td> - <td>{{number_format($product->stock, 0, ',', ' ')}}</td> - <td>{{$product->reference}}</td> - <td>{{$product->slug}}</td> - <td>{{$product->range->name}}</td> - <td> - @if ($product->status === 0) - <i class="fas fa-times cross-red"></i> - @else - <i class="fas fa-check check-green"></i> - @endif - </td> - <td class="text-center"> - <a href="{{route('bo.products.edit', $product->id)}}" class="btn btn-sm btn-primary">Éditer</a> - <!--<form action="{{route('bo.products.destroy', $product->id)}}" method="POST" class="d-inline"> - @method('DELETE') - @csrf - <input type="submit" class="btn btn-sm btn-danger" value="Supprimer" - onclick="return confirm('Êtes-vous sûr(e) ?')"> - </form>--> - </td> - </tr> - @endforeach - </tbody> - </table> + <div class="card-body"> + <form action="{{ route('bo.tags.update', $tag) }}" method="POST" enctype='multipart/form-data'> + @csrf + {{ method_field('PUT') }} + @include('bo.tags.form', compact('tag')) + <div class="text-center"> + <span class="d-block mb-3"> + <span class="badge text-bg-info">{{ __('crud.helpers.required_fields_with_aster') }}</span> + </span> + <button class="btn btn-primary" type="submit"><i class="fa fa-floppy-disk"></i> + <span class="d-none d-sm-inline" data-bs-toggle="tooltip" + title="{{ Str::ucfirst(__('crud.actions.save')) }}">{{ Str::ucfirst(__('crud.actions.save')) }}</span></button> + </div> + </form> + </div> + </div> @endsection diff --git a/resources/views/bo/tags/form.blade.php b/resources/views/bo/tags/form.blade.php new file mode 100644 index 00000000..811bbb2e --- /dev/null +++ b/resources/views/bo/tags/form.blade.php @@ -0,0 +1,45 @@ +<div class="row"> + <div class="col"> + <fieldset class="mb-3 border p-3"> + <legend>{{ __('Keyword information') }}</legend> + <div class="row mb-3"> + <!-- Label --> + <div class="col-12 col-md-6 form-group"> + <label class="col-form-label" for="slide-label"><b>{{ Str::ucfirst(__('validation.custom.attributes.label')) }}</b></label> + <div class="word-counter" data-json='@json(['for' => 'slide-label'])'></div> + <input class="form-control" id="slide-label" name="label" type="text" value="{{ old('label', $tag->label ?? '') }}" + aria-describedby="tag-label-help" placeholder="{{ Str::ucfirst(__('validation.custom.attributes.label')) }}" required> + @include('bo.modules.input-error', [ + 'inputName' => 'label', + 'helperId' => 'tag-label-help', + 'helper' => + __('Give your keyword a label.') . + ' ' . + __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.custom.attributes.label'), + 'inter' => __('validation.custom.of_the.female'), + 'model' => trans_choice('models.classes.tags', 1), + ]), + 'min' => 4, + 'max' => 75, + ]), + ]) + </div> + + <!-- Publication --> + <div class="col-12 form-group pt-3"> + <input class="form-check-input mt-2" id="tag-status" name="status" type="checkbox" value="1" + aria-describedby="tag-status-help" @checked(old('status', $tag->status ?? ''))> + <label class="col-form-label pt-1" class="form-check-label" + for="tag-status"><b>{{ Str::ucfirst(__('validation.custom.attributes.status')) }}</b></label><br> + @include('bo.modules.input-error', [ + 'inputName' => 'status', + 'helperId' => 'tag-status-help', + 'helper' => __('Check to publish the tag'), + ]) + </div> + </div> + </fieldset> + </div> +</div> diff --git a/resources/views/bo/tags/index-list.blade.php b/resources/views/bo/tags/index-list.blade.php new file mode 100644 index 00000000..07f9eba6 --- /dev/null +++ b/resources/views/bo/tags/index-list.blade.php @@ -0,0 +1,74 @@ +<div class="table-responsive"> + <table class="fix-action table"> + <thead> + <tr class="visually-hidden"> + <th scope="col"></th> + </tr> + @php + $cols = [ + 'label' => Str::ucfirst(__('validation.custom.attributes.label')), + 'order' => Str::ucfirst(__('validation.custom.attributes.order')), + ]; + @endphp + @include('bo.modules.tableColSorter', ['cols' => $cols, 'mobileHide' => ['description']]) + </thead> + <tbody> + @forelse ($tags as $tag) + <tr> + <td>{{ $tag->label }}</td> + @include('bo.modules.change-order', [ + 'route' => 'bo.tags.change-order', + 'model' => $tag, + 'first' => $loop->first, + 'last' => $loop->last, + 'isFirstPage' => $tags->onFirstPage(), + 'isLastPage' => !$tags->hasMorePages(), + ]) + <td> + @include('bo.modules.toggle-status', [ + 'route' => 'bo.tags.toggle-status', + 'model' => $tag, + ]) + </td> + <td> + <div class="btn-group"> + @can('viewAny', \App\Models\Product::class) + <a class="btn btn-sm btn-warning" + href="{{ route('bo.products.index', [ + 'search' => '', + 'brand' => '', + 'tag' => $tag, + 'range' => '', + ]) }}" + title="{{ Str::ucfirst( + __('crud.helpers.view_associated', [ + 'model' => trans_choice('models.classes.products', \INF), + ]), + ) }}"><i + class="fa-solid fa-box"></i></a> + @endcan + @can('update', $tag) + <a class="btn btn-sm btn-primary" href="{{ route('bo.tags.edit', $tag) }}" + title="{{ Str::ucfirst(__('crud.actions.update')) }}"><i class="fa-solid fa-pen"></i></a> + @endcan + @can('delete', $tag) + <form class="d-inline confirmDeleteJS" action="{{ route('bo.tags.destroy', $tag) }}" method="POST"> + @method('DELETE') + @csrf + <button class="btn btn-sm btn-danger rounded-start-0" title="{{ Str::ucfirst(__('crud.actions.delete')) }}"><i + class="fa-solid fa-trash"></i></button> + </form> + @endcan + </div> + </td> + </tr> + @empty + <tr> + <td class="text-center" colspan="20"> + <span class="h3">{{ __('crud.helpers.no_results') }}</span> + </td> + </tr> + @endforelse + </tbody> + </table> +</div> diff --git a/resources/views/bo/tags/index.blade.php b/resources/views/bo/tags/index.blade.php index 97383d9d..59b1a19b 100644 --- a/resources/views/bo/tags/index.blade.php +++ b/resources/views/bo/tags/index.blade.php @@ -1,82 +1,46 @@ -@extends('layouts.bo-layout') +@extends('bo.layouts.layout') + +@section('title', Str::ucfirst(trans_choice('models.classes.tags', \INF))) + +@section('breadcrumb', request()->route()->getName()) @section('content') - <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> - <h1 class="h2">Mots Clés <small class="text-muted">Liste</small></h1> - - @if ($errors->any()) - @foreach($errors->all() as $error) - <span class="float-center text-danger">{{ $error }}</span> - @endforeach - @endif - <a href="{{route('bo.tags.create')}}" class="btn btn-primary float-right">Créer un mot-clé</a> + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col"> + <span class="h3"> + {{ Str::ucfirst(trans_choice('models.classes.tags', \INF)) }} {{ Str::ucfirst(__('crud.actions.list')) }} + </span> + </div> + <h1 class="col-3"> + <div class="input-group justify-content-end"> + @can('create', \App\Models\Tag::class) + <a class="btn btn-primary" href="{{ route('bo.tags.create') }}" + title="{{ Str::ucfirst(__('crud.actions.create')) }} {{ __('models.classes.tags') }}"><i class="fa-solid fa-square-plus"></i></a> + @endcan + </div> + </h1> + </div> </div> - <table class="table"> - <thead class="thead-dark"> - <tr> - <th scope="col">Label</th> - <th scope="col">Slug</th> - <th scope="col">Ordre</th> - <th scope="col">Affiché ?</th> - <th scope="col"></th> - </tr> - </thead> - <tbody> - @foreach($tags as $tag) - <tr> - <td>{{$tag->label}}</td> - <td>{{$tag->slug}}</td> - <td> - @if ($loop->first) - <a href="{{route('bo.tags.change-order', ['id' => $tag->id, 'action' => 'down'])}}" class="btn-link text-decoration-none"> - <i name="down_arrow" class="icon-size far fa-arrow-alt-circle-down fa-2x"></i> - </a> - @elseif($loop->last) - <a href="{{route('bo.tags.change-order', ['id' => $tag->id, 'action' => 'up'])}}" class="btn-link text-decoration-none"> - <i name="up_arrow" class="icon-size far fa-arrow-alt-circle-up fa-2x"></i> - </a> - @else - <a href="{{route('bo.tags.change-order', ['id' => $tag->id, 'action' => 'up'])}}" class="btn-link text-decoration-none"> - <i name="up_arrow" class="icon-size far fa-arrow-alt-circle-up fa-2x"></i> - </a> - <a href="{{route('bo.tags.change-order', ['id' => $tag->id, 'action' => 'down'])}}" class="btn-link text-decoration-none"> - <i name="down_arrow" class="icon-size far fa-arrow-alt-circle-down fa-2x"></i> - </a> - @endif - </td> - <td> - {{--count($tag->products)--}} - <a href="{{route('bo.tags.toggle-status', ['id' => $tag->id])}}" class="status--toggler"> - @if ($tag->status === 0) - <i class="fas fa-times cross-red"></i> - @else - <i class="fas fa-check check-green"></i> - @endif - </a> - </td> - <td> - <a href="{{route('bo.tags.edit', ['tag' => $tag->id])}}" class="btn btn-sm btn-primary">Éditer</a> - <form action="{{route('bo.tags.destroy', $tag->id)}}" method="POST" class="d-inline"> - @method('DELETE') - @csrf - <input type="submit" class="btn btn-sm btn-danger" value="Supprimer" - onclick="return confirm('Êtes-vous sûr(e) ?')"> - </form> - </td> - </tr> - @endforeach - </tbody> - </table> -@endsection - -@section('scripts') - <script type="text/javascript"> - const tippyInstances = tippy('.status--toggler', { - content: "Cliquez ici pour changer le status de publication", - }); - const singleton = createSingleton(tippyInstances, { - delay: 500, - moveTransition: 'transform 0.2s ease-out', - }); - </script> + <div class="card-body"> + @if ($tags->count() > \Domain\Enums\Pagination\ItemsPerPaginationEnum::twelve->value()) + <div class="row justify-content-center"> + <div class="col-12 p-md-3 p-0"> + {{ $tags->withQueryString()->onEachSide(1)->links() }} + </div> + </div> + @endif + <div class="row"> + <div class="col"> + @include('bo.tags.index-list') + </div> + </div> + <div class="row justify-content-center"> + <div class="col-12 p-md-3 p-0"> + {{ $tags->withQueryString()->onEachSide(1)->links() }} + </div> + </div> + </div> + </div> @endsection diff --git a/resources/views/emails/exception-plain.blade.php b/resources/views/emails/exception-plain.blade.php deleted file mode 100644 index 0360447e..00000000 --- a/resources/views/emails/exception-plain.blade.php +++ /dev/null @@ -1,10 +0,0 @@ -{{ $appName }} Exception Handler - -Une erreur est survenue sur le site {{ $appName }} -{{ $exception->getMessage() }} -date : {{ date('Y-m-d H:i:s') }} -code : {{$exception->getCode() }} -file : {{$exception->getFile() }} -line : {{$exception->getLine() }} - -Veuillez vérifier les logs pour en voir la trace. diff --git a/resources/views/emails/exception.blade.php b/resources/views/emails/exception.blade.php deleted file mode 100644 index 80a46d6b..00000000 --- a/resources/views/emails/exception.blade.php +++ /dev/null @@ -1,16 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <title>{{ $appName }} Exception Handler - - - -

Une erreur est survenue sur le site {{ $appName }}

-

{{ $exception->getMessage() }}

-

date : {{ date('Y-m-d H:i:s') }}

-

code : {{$exception->getCode() }}

-

file : {{$exception->getFile() }}

-

line : {{$exception->getLine() }}

-

Veuillez vérifier les logs pour en voir la trace.

- - diff --git a/resources/views/emails/invalidxml.blade.php b/resources/views/emails/invalidxml.blade.php deleted file mode 100644 index e2126537..00000000 --- a/resources/views/emails/invalidxml.blade.php +++ /dev/null @@ -1,28 +0,0 @@ - - - - {{ $appName }} Exception Handler: Unvalid XML - - - -

{{ $appName }} à reçu un fichier xml non valide !!

-

{{ $strError }}

-

FICHIER: `{{ $filename }}`

-

{{ $exception->getMessage() }}

-

- date : {{ date('Y-m-d H:i:s') }}
- code : {{$exception->getCode() }}
- file : {{$exception->getFile() }}
- line : {{$exception->getLine() }}
-

- Merci de corriger le flux, puis de renvoyer le fichier en provoquant un mouvement EAI.

- Pour rappel : Il est recommandé de valider un fichier XML à l'aide d'un DTD
- https://www.w3schools.com/xml/xml_dtd.asp
- ou bien XSD https://www.w3schools.com/xml/schema_intro.asp

- Pourquoi ?
- Pour que les concepteurs puissent identifier les types de données qui transitent (les champs et leurs caratéristiques)
- Mais aussi valider les fichiers reçus. -

-

En l'absence de données valides, cette fiche va être mise de coté.

- - diff --git a/resources/views/emails/missing-order-reminder.blade.php b/resources/views/emails/missing-order-reminder.blade.php new file mode 100644 index 00000000..a2b874ba --- /dev/null +++ b/resources/views/emails/missing-order-reminder.blade.php @@ -0,0 +1,16 @@ +{{-- blade-formatter-disable --}} + +{{ __('Hello') }} {{ $employee->prenom }} {{ Str::upper($employee->nom) }}, + +{{ __('In order to give us time to prepare your products, order taking at the shop ends today at :closureTime for a delivery on :date at your usual collection point.', ['closureTime' => $closureTime, 'date' => $deliveryDate]) }} + +{{ __('Remember to validate your order on :url', ['url' => $appHost]) }} + + +{{ __('Access the shop') }} + + +**{{ __('Add a reminder to my calendar to place my order on :reminderDay at :reminderTime (Attached ICS file)', ['reminderDay' => $reminderDay, 'reminderTime' => $reminderTime]) }}** + +{{ __('The team') }} {{ config('app.name') }} + diff --git a/resources/views/emails/order-confirm-admin.blade.php b/resources/views/emails/order-confirm-admin.blade.php index 4abe3019..619cffa8 100644 --- a/resources/views/emails/order-confirm-admin.blade.php +++ b/resources/views/emails/order-confirm-admin.blade.php @@ -1,245 +1,28 @@ - - +{{-- blade-formatter-disable --}} + +# {{ __('New order registered!') }} - - - - - - - - - - - - - - - - - - +{{ __('To be collected on') }} **{{ $order->pickupDay->translatedFormat('l j F Y') }}**, {{ __('at the following address') }} : - -
- -
- - - - - - -
- -
- - - - - - - -
- - - - - - -
- -
-
-
Nouvelle commande enregistrée !
-
-
- -
-
- -
- - - - - - -
- -
- - - - - - - - - - - - - - - - - - - -
-
Bonjour,

La commande {{ $order->reference }} de {{ $order->customer->salarie->prenom }} {{ Str::upper($order->customer->salarie->nom) }} est confirmée
-
- - - - - - @foreach ($order->lines as $line) - - - - @endforeach -
ProduitQuantitéTotal TTC
{{ $line->product->name }}{{ $line->quantity }}@fmt_currency_without_auth($line->total_ttc)
-
-
Total estimé : @fmt_currency_without_auth($order->total) TTC
-
-

-

- -
-
A retirer le {{$order->timeslot->day}} à {{$order->timeslot->time}}, à l’adresse suivante :

- Point de retrait {{$magasin->name}}, {{$magasin->address}}, {{$magasin->postcode}} {{$magasin->city}} -
-
-


Message automatisé : {{ config('theme.site_name') }}
-
-
- -
-
- -
- - - +{{ __('Automated message') }} {{ config('app.name') }} +
diff --git a/resources/views/emails/order-confirm.blade.php b/resources/views/emails/order-confirm.blade.php new file mode 100644 index 00000000..50ad05eb --- /dev/null +++ b/resources/views/emails/order-confirm.blade.php @@ -0,0 +1,36 @@ +{{-- blade-formatter-disable --}} + +# {{ __('Your order is registered!') }} + +{{ __('Hello') }} {{ $order->employee->firstname }} {{ Str::upper($order->employee->lastname) }} ({{ $order->employee->matricule }}), + +{{ __('Your order') }} **{{ $order->reference }}** {{ __('is confirmed.') }} + + +| {{ __('Product') }} | {{ __('Quantity') }} | {{ __('Price per kilo TTC') }} | {{ __('Total TTC') }} | +|:--------|:--------:|:-------------:|----------:| +@foreach ($order->lines as $line) +| {{ $line->productIncoId->value }} - {{ $line->productName }}@if ($line->productWeightIsVariable) * @endif | {{ $line->quantity }} | @if ($line->productWeightIsVariable) @money($line->productPriceKgTtc) @endif | @money($line->totalTtc) | +@endforeach + + +**{{ __('Estimated order total') }} : @money($order->totalTtc) {{ __('TTC') }}** + +*\* {{ __('Product sold by the kilo. The price will be recalculated based on the weight of the product delivered when your order is handed over. The price is therefore subject to variation on your invoice.') }}* + +--- + +{{ __('To be collected on') }} **{{ $order->pickupDay->translatedFormat('l j F Y') }}**, {{ __('at the following address') }} : + + +**{{ __('My collection point') }} {{ $shop->name }}** {{ $shop->address }}, {{ $shop->postcode }} {{ $shop->city }} + + +**{{ __('NB') }} :** {{ __('We do our utmost to deliver your entire order, unfortunately some products may be out of stock. You will not be charged for undelivered products.') }} + +{{ __('The team') }} {{ config('app.name') }} + + +{{ __('For any questions related to your order, please contact reception by phone or via our section') }} [{{ __('contact us') }}]({{ route('fo.pages.contact') }}). + + diff --git a/resources/views/emails/order-reminder.blade.php b/resources/views/emails/order-reminder.blade.php index c864858b..244e6079 100644 --- a/resources/views/emails/order-reminder.blade.php +++ b/resources/views/emails/order-reminder.blade.php @@ -1,250 +1,35 @@ - - +{{-- blade-formatter-disable --}} + +# {{ Str::upper(__('Your order is ready for collection today at your collection point!')) }} - - - - - - - - - - - - - - - - - +### {{ __('Collection information') }} - -
- -
- - - - - - -
- -
- - - - - - - -
- - - - - - -
- -
-
-
- VOTRE COMMANDE EST À RÉCUPÉRER AUJOURD'HUI DANS VOTRE POINT DE RETRAIT ! -
-
-
- -
-
- -
- - - - - - -
- -
- - - - - - - - - - - - - -
-
- Bonjour {{ $order->customer->salarie->prenom }} {{ Str::upper($order->customer->salarie->nom) }}, -

- Votre commande {{ $order->reference }} est confirmée -

- - - - - - - - - @foreach ($order->lines as $line) - - - - - - - @endforeach - -
ProduitQuantitéPrix kilo TTCTotal TTC
{{ $line->product->name }}{{ $line->quantity }}{{ number_format($line->product->priceKgTtc, 2, ',', ' ') }}€{{ number_format($line->total_ttc, 2, ',', ' ') }}€
-
- Total estimé de la commande : {{ number_format($order->total, 2, ',', ' ') }}€ TTC -

- *Produit vendu au kilo. Le prix sera recalculé en fonction du poids du produit livré lors de la remise de votre commande. Le prix est donc susceptible de varier sur votre facture. -

- À retirer le {{ $order->timeslot->day->format('d/m/Y') }} à {{ $order->timeslot->time }}, à l'adresse suivante : -
-
-
- Mon point de retrait {{$magasin->name}}, {{$magasin->address}}, {{$magasin->postcode}} {{$magasin->city}} -
-
-
- NB: Nous faisons le maximum pour vous livrer l'intégralité de votre commande, malheureusement certains produits peuvent être en rupture. Vous ne serez pas facturé des produits non livrés. -
-
-
-
L'équipe {{ config('theme.site_name') }}
-
-
- -
-
- -
- - - +{{ __('The team') }} {{ config('app.name') }} +
diff --git a/resources/views/emails/password-has-reset.blade.php b/resources/views/emails/password-has-reset.blade.php new file mode 100644 index 00000000..78f2ac49 --- /dev/null +++ b/resources/views/emails/password-has-reset.blade.php @@ -0,0 +1,11 @@ +{{-- blade-formatter-disable --}} + + +# {{ __('Your password has been changed on :appname', ['appname' => config('app.name')]) }} + +{{ __('Hello') }}, + +{{ __('Your password has been changed. If you are not at the origin of this change, please contact us as soon as possible using the contact form or by contacting your manager.') }} + +{{ __('The team') }} {{ config('app.name') }} + diff --git a/resources/views/emails/send-contact.blade.php b/resources/views/emails/send-contact.blade.php new file mode 100644 index 00000000..5e63e1e0 --- /dev/null +++ b/resources/views/emails/send-contact.blade.php @@ -0,0 +1,24 @@ +{{-- blade-formatter-disable --}} + +# {{ __('Contact Message') }} + +{{ __('Hello') }}, + +{{ __('Here is a message sent from :app_name.', ['app_name' => config('app.name')]) }} + +--- + +**{{ __('Sender') }} :** {{ $data->firstName }} {{ $data->lastName }} +**{{ __('Email Address') }} :** [{{ $data->email }}](mailto:{{ $data->email }}) + +@if(!empty($data->orderRef)) +**{{ __('Order Reference') }} :** {{ $data->orderRef }} +@endif + +**{{ __('Message') }}** + +{{ $data->message }} + + +{{ __('The :app_name team', ['app_name' => config('app.name')]) }} + diff --git a/resources/views/errors/503.blade.php b/resources/views/errors/503.blade.php deleted file mode 100644 index f59cb6e0..00000000 --- a/resources/views/errors/503.blade.php +++ /dev/null @@ -1,22 +0,0 @@ - -Site Maintenance - - -
- -

{{ __('We\'ll be back soon!') }}

-
-

- {{ __('Sorry for the inconvenience but we’re performing some maintenance at the moment.') }} - {{ __("We'll be back soon!") }} -

-

— {{ __('The :sitename Team' , ['sitename' => Config::get('theme.site_name')] ) }}

-
-
diff --git a/resources/views/fo/auth/login.blade.php b/resources/views/fo/auth/login.blade.php new file mode 100644 index 00000000..86fd01c0 --- /dev/null +++ b/resources/views/fo/auth/login.blade.php @@ -0,0 +1,91 @@ +@extends('fo.layouts.layout') + +@section('title', __('Login')) +@section('description', __('Login to your personal account.')) + +@section('content') +
+
+
+ +

{{ __('Login') }}

+ +
+ @csrf + + {{-- GESTION DES ERREURS --}} + @if ($errors->any()) + + @endif + + {{-- EMAIL --}} +
+
+ + +
+ + @error('email') + + {{ $message }} + + @enderror +
+ + {{-- PASSWORD --}} +
+
+
+ + +
+ 'password'])'> +
+ @error('password') + + {{ $message }} + + @enderror +
+ + {{-- REMEMBER ME --}} +
+ + +
+ + {{-- BOUTON DE CONNEXION & MOT DE PASSE OUBLIÉ --}} +
+ + + {{ __('Forgot Your Password?') }} + +
+ +
+ + {{-- LIEN D'INSCRIPTION --}} +
+

{{ __('No account yet?') }}

+ + {{ __('Register') }} + +
+ +
+
+
+
+@endsection diff --git a/resources/views/fo/auth/passwords/email.blade.php b/resources/views/fo/auth/passwords/email.blade.php new file mode 100644 index 00000000..ab8e98b4 --- /dev/null +++ b/resources/views/fo/auth/passwords/email.blade.php @@ -0,0 +1,50 @@ +@extends('fo.layouts.layout') + +@section('title', __('Forgot password')) +@section('description', __('Procedure to recover the password linked to your account.')) + +@section('content') +
+
+
+ +

{{ __('Reset Password') }}

+ +
+ @csrf + + @if (session('status')) + + @endif + +

+ {{ __("So that we can send you a password reset link, please provide the email address you used when you registered.") }} +

+ +
+
+ + +
+ + @error('email') + + {{ $message }} + + @enderror +
+ +
+ +
+ +
+
+
+
+@endsection diff --git a/resources/views/fo/auth/passwords/reset.blade.php b/resources/views/fo/auth/passwords/reset.blade.php new file mode 100644 index 00000000..a532ddbd --- /dev/null +++ b/resources/views/fo/auth/passwords/reset.blade.php @@ -0,0 +1,83 @@ +@extends('fo.layouts.layout') + +@section('title', __('Reset your password')) +@section('description', __('Change your password.')) + +@section('content') +
+
+
+ +

{{ __('Reset Password') }}

+
{{ __('Choose your new password.') }}
+ +
+ @csrf + + {{-- GESTION DES ERREURS GLOBALES --}} + @if ($errors->any()) + + @endif + + {{-- MESSAGE DE SUCCÈS --}} + @if (session('success')) + + @endif + + {{-- EMAIL (HIDDEN) --}} + + + {{-- TOKEN (HIDDEN) --}} + + + {{-- PASSWORD --}} +
+
+
+ + +
+ 'password'])'> +
+ + @error('password') + + {{ $message }} + + @enderror +
+ + {{-- PASSWORD CONFIRM --}} +
+
+
+ + +
+ 'password-confirm'])'> +
+
+ + {{-- BOUTON DE SOUMISSION --}} +
+ +
+ +
+
+
+
+@endsection diff --git a/resources/views/fo/auth/register.blade.php b/resources/views/fo/auth/register.blade.php new file mode 100644 index 00000000..d25c1af0 --- /dev/null +++ b/resources/views/fo/auth/register.blade.php @@ -0,0 +1,242 @@ +@extends('fo.layouts.layout') + +@section('title', __('Register')) +@section('description', __('Registration procedure for the shop.')) + +@section('content') +
+
+
+ +

{{ __('Register') }}

+ +
+ @csrf + + {{-- GESTION DES ERREURS GLOBALES --}} + @if ($errors->any()) + + @endif + + {{-- CONSIGNES MATRICULE --}} + + + {{-- MATRICULE --}} +
+ + + @error('matricule') + {{ $message }} + @enderror +
+ + {{-- CONSIGNES CODE RH --}} + + + {{-- CODE_INSCRIPTION --}} +
+ + + @error('code') + {{ $message }} + @enderror +
+ + {{-- INFORMATIONS PERSONNELLES --}} +
+ {{-- LASTNAME --}} +
+
+ + +
+ @error('lastname') + {{ $message }} + @enderror +
+ + {{-- FIRSTNAME --}} +
+
+ + +
+ @error('firstname') + {{ $message }} + @enderror +
+
+ + {{-- BIRTHDATE & PHONE --}} +
+
+
+ + +
+ @error('birth_date') + {{ $message }} + @enderror +
+ +
+
+ + +
+ @error('phone') + {{ $message }} + @enderror +
+
+ + {{-- EMAIL --}} +
+ + + @error('email') + {{ $message }} + @enderror +
+ + {{-- COORDONNÉES POSTALES --}} +
+ + + @error('address') + {{ $message }} + @enderror +
+ +
+
+
+ + +
+ @error('postal_code') + {{ $message }} + @enderror +
+ +
+
+ + +
+ @error('city') + {{ $message }} + @enderror +
+
+ + {{-- MOT DE PASSE --}} +
+
+
+
+
+ + +
+ 'password'])'> +
+ @error('password') + {{ $message }} + @enderror +
+ +
+
+
+ + +
+ 'password-confirm'])'> +
+
+
+ + {{-- CRITÈRES DU MOT DE PASSE --}} +
+

{{ __('The password must contain') }} :

+ {{ __('- minimum 8 characters') }} + {{ __('- at least one uppercase letter') }} + {{ __('- at least one lowercase letter') }} + {{ __('- at least one number') }} + {{ __('- at least one special character.') }} +
+
+ + {{-- PRIVACY --}} +
+ + +
+ + {{-- NEWSLETTER --}} +
+ + +
+ +
{{ '*' . __('Mandatory fields') }}
+ + {{-- S'INSCRIRE --}} +
+ +
+
+ +
+ + {{-- ASIDE (DÉJÀ INSCRIT) --}} +
+

{{ __('Already registered?') }}

+ + {{ __('Log in') }} + +
+ +
+
+
+@endsection diff --git a/resources/views/fo/auth/verify.blade.php b/resources/views/fo/auth/verify.blade.php new file mode 100644 index 00000000..63ef28ee --- /dev/null +++ b/resources/views/fo/auth/verify.blade.php @@ -0,0 +1,39 @@ +@extends('fo.layouts.layout') + +@section('title', __('Activation')) +@section('description', __('Activation of your previously created account.')) + +@section('content') +
+
+
+ + {{-- TITRE PRINCIPAL --}} +

{{ __('Verify your email address') }}

+ + {{-- ALERTE SUCCÈS RE-ENVOI --}} + @if (session('resent')) + + @endif + + {{-- CONTENU TEXTE --}} +

+ {{ __('Before proceeding, please check your email for a verification link.') }} +

+ +

+ {{ __('If you did not receive the email') }}, +

+ @csrf + . +
+

+ +
+
+
+@endsection diff --git a/resources/views/fo/customer/dashboard.blade.php b/resources/views/fo/customer/dashboard.blade.php new file mode 100644 index 00000000..8ccbab26 --- /dev/null +++ b/resources/views/fo/customer/dashboard.blade.php @@ -0,0 +1,36 @@ +@extends('fo.layouts.layout') + +@section('title', __('My Account')) +@section('description', __('Personal account')) + +@section('content') +
+
+
+ +

+ {{ __('My Account') }} +

+

+ {{ __('Welcome to your account. What would you like to do ?') }} +

+ + + +
+
+
+@endsection diff --git a/resources/views/fo/customer/edit/infos.blade.php b/resources/views/fo/customer/edit/infos.blade.php new file mode 100644 index 00000000..887df7a5 --- /dev/null +++ b/resources/views/fo/customer/edit/infos.blade.php @@ -0,0 +1,144 @@ +@extends('fo.layouts.layout') + +@section('title', __('My details')) +@section('description', __('Update my personal details')) + +@section('content') +
+
+
+ +
+ + + +
+ +

+ {{ __('My details') }} +

+

+ {{ __('To update your personal information, fill in the new data below') }} +

+ +
+ @csrf + + {{-- Nom / Prénom --}} +
+
+
+ + +
+ @error('lastname') +
{{ $message }}
+ @enderror +
+
+
+ + +
+ @error('firstname') +
{{ $message }}
+ @enderror +
+
+ + {{-- Email (lecture seule) --}} +
+
+ + +
+
{{ __('Your email address cannot be changed.') }}
+
+ + {{-- Date de naissance --}} +
+
+ + +
+ @error('birth_date') +
{{ $message }}
+ @enderror +
+ + {{-- Adresse / Code postal --}} +
+
+
+ + +
+ @error('address') +
{{ $message }}
+ @enderror +
+
+
+ + +
+ @error('postcode') +
{{ $message }}
+ @enderror +
+
+ + {{-- Ville / Téléphone --}} +
+
+
+ + +
+ @error('city') +
{{ $message }}
+ @enderror +
+
+
+ + +
+ @error('phone') +
{{ $message }}
+ @enderror +
+
+ + {{-- Opt-in newsletter --}} +
+ optIn))> + +
+ +
+ +
+
+ +
+
+
+@endsection diff --git a/resources/views/fo/customer/edit/password.blade.php b/resources/views/fo/customer/edit/password.blade.php new file mode 100644 index 00000000..6d8f206c --- /dev/null +++ b/resources/views/fo/customer/edit/password.blade.php @@ -0,0 +1,82 @@ +@extends('fo.layouts.layout') + +@section('title', __('Password')) +@section('description', __('Change my password')) + +@section('content') +
+
+
+ +
+ + + +
+ +

+ {{ __('Password') }} +

+ +
+ @csrf + +
+
+
+ + +
+ 'passwor-old'])'> +
+ @error('password_old') +
{{ $message }}
+ @enderror +
+ +
+
+
+ + +
+ 'password'])'> +
+ @error('password') +
{{ $message }}
+ @enderror +
+ +
+
+
+ + +
+ 'password-confirm'])'> +
+ @error('password') +
{{ $message }}
+ @enderror +
+ +

+ {{ __('The new password must be at least 8 characters and contain uppercase, lowercase, number and special character.') }} +

+ +
+ +
+
+ +
+
+
+@endsection diff --git a/resources/views/fo/customer/orders/index.blade.php b/resources/views/fo/customer/orders/index.blade.php new file mode 100644 index 00000000..b922a86f --- /dev/null +++ b/resources/views/fo/customer/orders/index.blade.php @@ -0,0 +1,97 @@ +@extends('fo.layouts.layout') + +@section('title', __('My Orders')) +@section('description', __('My Orders')) + +@section('content') +
+
+ + + +
+ +

{{ __('My Orders') }}

+ +
+ + {{-- Pagination Haut --}} + @if ($orders->count() > \Domain\Enums\Pagination\ItemsPerPaginationEnum::twelve->value()) +
+ {{ $orders->withQueryString()->onEachSide(1)->links() }} +
+ @endif + + @if (count($orders) > 0) + + {{-- VUE BUREAU : Tableau standard Bootstrap (Caché sur mobile) --}} +
+ + + + + + + + + + + @foreach ($orders as $order) + + + + + + + @endforeach + +
{{ __('Reference') }}{{ __('Date') }}{{ __('Total') }}{{ __('Status') }}
+ + {{ $order->reference }} + + + {{ $order->created_at->isoFormat('ddd DD/MM/Y') }} + + @money($order->total) + {{ $order->status->label() }}
+
+ + {{-- VUE MOBILE : Cartes (Cachées sur bureau) --}} +
+ @foreach ($orders as $order) +
+
+
+ {{ __('Reference') }} + {{ $order->reference }} +
+
+ {{ __('Date') }} + {{ $order->created_at->isoFormat('ddd DD/MM/Y') }} +
+
+ {{ __('Total') }} + @money($order->total) +
+
+ {{ __('Status') }} + {{ $order->status->label() }} +
+
+
+ @endforeach +
+ @else +

{{ __('You have no orders') }}

+ @endif + + {{-- Pagination Bas --}} +
+ {{ $orders->withQueryString()->onEachSide(1)->links() }} +
+ +
+
+@endsection diff --git a/resources/views/fo/customer/orders/show.blade.php b/resources/views/fo/customer/orders/show.blade.php new file mode 100644 index 00000000..96a530d5 --- /dev/null +++ b/resources/views/fo/customer/orders/show.blade.php @@ -0,0 +1,142 @@ +@extends('fo.layouts.layout', ['brParam' => $order]) + +@section('title', __('Order detail of :date', ['date' => $order->created_at->isoFormat('ddd DD/MM/YY')])) +@section('description', __('Order detail of :date', ['date' => $order->created_at->isoFormat('ddd DD/MM/YY')])) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') +
+
+ + + +
+ +

+ {{ __('Order detail of :date', ['date' => $order->created_at->isoFormat('ddd DD/MM/YY')]) }} +

+ +

{{ __('ref: :reference', ['reference' => $order->reference]) }}

+ +
+ + {{-- DESKTOP --}} +
+ + + + + + + + + + + @foreach ($order->lines as $index => $line) + + @if ($index === 0) + + @endif + + + + + @endforeach + + + + + +
{{ __('Order status') }}{{ __('Order summary') }}{{ __('Price per kg (incl. tax)') }}{{ __('Unit price (incl. tax)') }}
+ {{ $order->status->label() }} + + {{ $line->quantity }} x {{ $line->product->name }} + + @if ($line->product->weight->isVariable) + @money($line->product->priceKgTtc) + @endif + + @money($line->product->discountedPrice ?? $line->product->price) +
+ {{ __('Estimated total incl. tax') }} + + @money($order->total) +
+
+ + {{-- MOBILE --}} +
+ +
+
+ {{ __('Order status') }} + {{ $order->status->label() }} +
+
+ +
{{ __('Order summary') }}
+ + @foreach ($order->lines as $line) +
+
+
+ {{ $line->quantity }} x {{ $line->product->name }} +
+ + @if ($line->product->weight->isVariable) +
+ {{ __('Price per kg (incl. tax)') }} + @money($line->product->priceKgTtc) +
+ @endif + +
+ {{ __('Unit price (incl. tax)') }} + @money($line->product->discountedPrice ?? $line->product->price) +
+
+
+ @endforeach + +
+
+ {{ __('Estimated total incl. tax') }} + + @money($order->total) + +
+
+
+ +
+ + {{-- DELIVERY --}} +
+
+ +

{{ __('Collection details') }}

+
+ +
+
+

{{ __('To be collected on') }}

+

+ {{ $order->pickup_day ? $order->pickup_day->translatedFormat('l j F Y') : '-' }} +

+
+
+

{{ __('at the following address') }}

+
+ {{ $order->delivery_address->name }}
+ {{ $order->delivery_address->address }}
+ {{ $order->delivery_address->postcode }} {{ $order->delivery_address->city }} +
+
+
+
+ +
+
+@endsection diff --git a/resources/views/fo/home-parts/ranges.blade.php b/resources/views/fo/home-parts/ranges.blade.php new file mode 100644 index 00000000..5da9b252 --- /dev/null +++ b/resources/views/fo/home-parts/ranges.blade.php @@ -0,0 +1,36 @@ +
+ @foreach ($rangeList as $range) +
+
+
+
+ {{ $range->picture_alt }} +
+
+
+
{{ $range->name }}
+ @if (!empty($range->description)) +
{!! clean($range->description) !!}
+ @endif + +
+
+
+
+
+ @endforeach +
+ + diff --git a/resources/views/fo/home-parts/services.blade.php b/resources/views/fo/home-parts/services.blade.php new file mode 100644 index 00000000..71c6982e --- /dev/null +++ b/resources/views/fo/home-parts/services.blade.php @@ -0,0 +1,125 @@ +
+
+ + {{-- ÉTAPE 1 : SÉLECTIONNER --}} +
+
+ {{ __('Step :number', ['number' => 1]) }} +
+ {!! __(':title Select :/title :desc your products online :/desc', [ + 'title' => '

', + '/title' => '

', + 'desc' => '

', + '/desc' => '

', + ]) !!} +
+
+
+ + + + {{-- ÉTAPE 2 : CHOISIR --}} +
+
+ {{ __('Step :number', ['number' => 2]) }} +
+ {!! __(':title Select :/title :desc your pickup day :/desc', [ + 'title' => '

', + '/title' => '

', + 'desc' => '

', + '/desc' => '

', + ]) !!} +
+
+
+ + + + {{-- ÉTAPE 3 : RETIRER --}} +
+
+ {{ __('Step :number', ['number' => 3]) }} +
+ {!! __(':title Pick up your order :/title :desc :/desc', [ + 'title' => '

', + '/title' => '

', + 'desc' => '

', + '/desc' => '

', + ]) !!} +
+
+
+
+ + {{-- AVANTAGES / ENGAGEMENTS --}} +
+ + {{-- ENGAGEMENT 1 : CHOIX --}} +
+
+ +
+ {!! __(':title A wide selection :/title :desc Quality products, a variety of options, portion sizes to suit your needs... :/desc', [ + 'title' => '

', + '/title' => '

', + 'desc' => '

', + '/desc' => '

', + ]) !!} +
+
+
+ + {{-- ENGAGEMENT 2 : ÉCONOMIES --}} +
+
+ +
+ {!! __(':title Save money :/title :desc Get even more out of our gourmet products by buying directly :/desc', [ + 'title' => '

', + '/title' => '

', + 'desc' => '

', + '/desc' => '

', + ]) !!} +
+
+
+ + {{-- ENGAGEMENT 3 : RAPIDE --}} +
+
+ +
+ {!! __(':title Convenient and fast :/title :desc What could be better than ordering online to save time? :/desc', [ + 'title' => '

', + '/title' => '

', + 'desc' => '

', + '/desc' => '

', + ]) !!} +
+
+
+ + {{-- ENGAGEMENT 4 : FRAÎCHEUR --}} +
+
+ +
+ {!! __(':title Freshness & Quality :/title :desc Your order is carefully prepared, with strict adherence to the cold chain :/desc', [ + 'title' => '

', + '/title' => '

', + 'desc' => '

', + '/desc' => '

', + ]) !!} +
+
+
+ +
+
diff --git a/resources/views/fo/home-parts/sliders/discounts.blade.php b/resources/views/fo/home-parts/sliders/discounts.blade.php new file mode 100644 index 00000000..f4c3c75d --- /dev/null +++ b/resources/views/fo/home-parts/sliders/discounts.blade.php @@ -0,0 +1,140 @@ +
+
+ + + +
+
+ + diff --git a/resources/views/fo/home-parts/sliders/main.blade.php b/resources/views/fo/home-parts/sliders/main.blade.php new file mode 100644 index 00000000..fc727aaa --- /dev/null +++ b/resources/views/fo/home-parts/sliders/main.blade.php @@ -0,0 +1,73 @@ +@if (!empty($slideList) && count($slideList) > 0) + +@endif diff --git a/resources/views/fo/layouts/footer.blade.php b/resources/views/fo/layouts/footer.blade.php new file mode 100644 index 00000000..c98395a0 --- /dev/null +++ b/resources/views/fo/layouts/footer.blade.php @@ -0,0 +1,55 @@ + diff --git a/resources/views/fo/layouts/head.blade.php b/resources/views/fo/layouts/head.blade.php new file mode 100644 index 00000000..c78dbf61 --- /dev/null +++ b/resources/views/fo/layouts/head.blade.php @@ -0,0 +1,48 @@ +{{-- Meta --}} + + + + + + +@hasSection('canonical') + +@else + +@endif + +{{-- META INDEX, FOLLOW --}} +@hasSection('metaIndex') + +@else + +@endif + +{{-- Open Graph --}} + + + + + + + +{{-- Favicon --}} + + + + + + + +{{-- Others --}} +@if (config('app.debug')) + +@endif + +{{-- STYLES --}} +@vite(['resources/sass/fo/fo.scss']) +@stack('styles') + +@include('fo.modules.breadcrumb.breadcrumb-head') diff --git a/resources/views/fo/layouts/layout.blade.php b/resources/views/fo/layouts/layout.blade.php new file mode 100644 index 00000000..8ae434d6 --- /dev/null +++ b/resources/views/fo/layouts/layout.blade.php @@ -0,0 +1,35 @@ + + + + + + {{ config('app.name') }} - @yield('title') + + @include('fo.layouts.head') + + + + +
+ + @include('fo.layouts.navbar') +
+ @include('fo.modules.breadcrumb.breadcrumb-body', $brParam ?? []) + @yield('content') +
+ +
+ @include('fo.layouts.footer') +
+ + @stack('scriptsConstants') + @include('fo.modules.script-routes') + + @vite(['resources/ts/fo/fo.ts']) + + @include('vendor.cn-cookies') + @include('fo.modules.flash-messages') + @stack('scripts') + + + diff --git a/resources/views/fo/layouts/navbar.blade.php b/resources/views/fo/layouts/navbar.blade.php new file mode 100644 index 00000000..d7c08dce --- /dev/null +++ b/resources/views/fo/layouts/navbar.blade.php @@ -0,0 +1,120 @@ + diff --git a/resources/views/fo/modules/breadcrumb/breadcrumb-body.blade.php b/resources/views/fo/modules/breadcrumb/breadcrumb-body.blade.php new file mode 100644 index 00000000..b0225b9b --- /dev/null +++ b/resources/views/fo/modules/breadcrumb/breadcrumb-body.blade.php @@ -0,0 +1,14 @@ +@hasSection('breadcrumb') + @if (Breadcrumbs::exists(app()->view->getSections()['breadcrumb'])) +
+ {{ call_user_func_array( + 'Breadcrumbs::render', + array_merge([app()->view->getSections()['breadcrumb']], !empty($brParam) ? (is_array($brParam) ? $brParam : [$brParam]) : []), + ) }} +
+ @endif +@elseif(Breadcrumbs::exists(request()->route()->getName())) +
+ {{ Breadcrumbs::render(request()->route()->getName()) }} +
+@endif diff --git a/resources/views/fo/modules/breadcrumb/breadcrumb-head.blade.php b/resources/views/fo/modules/breadcrumb/breadcrumb-head.blade.php new file mode 100644 index 00000000..10de2aba --- /dev/null +++ b/resources/views/fo/modules/breadcrumb/breadcrumb-head.blade.php @@ -0,0 +1,13 @@ +@hasSection('breadcrumb') + @if (Breadcrumbs::exists(app()->view->getSections()['breadcrumb'])) + {{ call_user_func_array( + 'Breadcrumbs::view', + array_merge( + ['breadcrumbs::json-ld', app()->view->getSections()['breadcrumb']], + !empty($brParam) ? (is_array($brParam) ? $brParam : [$brParam]) : [], + ), + ) }} + @endif +@elseif(Breadcrumbs::exists(request()->route()->getName())) + {{ Breadcrumbs::view('breadcrumbs::json-ld', request()->route()->getName()) }} +@endif diff --git a/resources/views/fo/modules/breadcrumb/breadcrumb-layout.blade.php b/resources/views/fo/modules/breadcrumb/breadcrumb-layout.blade.php new file mode 100644 index 00000000..8e60f255 --- /dev/null +++ b/resources/views/fo/modules/breadcrumb/breadcrumb-layout.blade.php @@ -0,0 +1,15 @@ +@if (isset($breadcrumbs)) + @unless ($breadcrumbs->isEmpty()) + + @endunless +@endif diff --git a/resources/views/fo/modules/flash-messages.blade.php b/resources/views/fo/modules/flash-messages.blade.php new file mode 100644 index 00000000..c7af5a07 --- /dev/null +++ b/resources/views/fo/modules/flash-messages.blade.php @@ -0,0 +1,97 @@ +
+ + @if ($raw = Session::get('success', Session::get('bo.success'))) + @php $msgs = is_array($raw) ? $raw : [$raw]; @endphp +
+
+
+ + @if (count($msgs) === 1) + {!! nl2br(e($msgs[0])) !!} + @else +
    @foreach ($msgs as $m)
  • {!! nl2br(e($m)) !!}
  • @endforeach
+ @endif +
+ +
+
+ @endif + + @if ($raw = Session::get('error', Session::get('bo.error'))) + @php $msgs = is_array($raw) ? $raw : [$raw]; @endphp + + @endif + + @if ($raw = Session::get('warning', Session::get('bo.warning'))) + @php $msgs = is_array($raw) ? $raw : [$raw]; @endphp + + @endif + + @if ($raw = Session::get('info', Session::get('bo.info'))) + @php $msgs = is_array($raw) ? $raw : [$raw]; @endphp +
+
+
+ + @if (count($msgs) === 1) + {!! nl2br(e($msgs[0])) !!} + @else +
    @foreach ($msgs as $m)
  • {!! nl2br(e($m)) !!}
  • @endforeach
+ @endif +
+ +
+
+ @endif + + @if ($errors->any()) + + @endif + +
diff --git a/resources/views/fo/modules/guarded-currency.blade.php b/resources/views/fo/modules/guarded-currency.blade.php new file mode 100644 index 00000000..14e9c1f9 --- /dev/null +++ b/resources/views/fo/modules/guarded-currency.blade.php @@ -0,0 +1,10 @@ +@php + /** @var \Money\Money $money */ + /** @var \App\Models\Product $product */ +@endphp + +@if (Gate::allows('viewPrices', $product)) + @money($money) +@else + {{ '-.--' }} +@endif diff --git a/resources/views/fo/modules/pagination.blade.php b/resources/views/fo/modules/pagination.blade.php new file mode 100644 index 00000000..e7e1d62e --- /dev/null +++ b/resources/views/fo/modules/pagination.blade.php @@ -0,0 +1,112 @@ +@if ($paginator->hasPages() || $paginator->total() > \Domain\Enums\Pagination\ItemsPerPaginationEnum::twelve->value) + + + @push('styles') + + @endpush +@endif diff --git a/resources/views/fo/modules/script-assets.blade.php b/resources/views/fo/modules/script-assets.blade.php new file mode 100644 index 00000000..a90d4c11 --- /dev/null +++ b/resources/views/fo/modules/script-assets.blade.php @@ -0,0 +1,19 @@ + diff --git a/resources/views/fo/modules/script-constants.blade.php b/resources/views/fo/modules/script-constants.blade.php new file mode 100644 index 00000000..6141b27d --- /dev/null +++ b/resources/views/fo/modules/script-constants.blade.php @@ -0,0 +1,9 @@ + diff --git a/resources/views/fo/modules/script-routes.blade.php b/resources/views/fo/modules/script-routes.blade.php new file mode 100644 index 00000000..88b35135 --- /dev/null +++ b/resources/views/fo/modules/script-routes.blade.php @@ -0,0 +1,17 @@ +@include('fo.modules.script-constants') +@include('fo.modules.script-assets') + diff --git a/resources/views/fo/news/singleoptin-unsubscribe.blade.php b/resources/views/fo/news/singleoptin-unsubscribe.blade.php new file mode 100644 index 00000000..03feb137 --- /dev/null +++ b/resources/views/fo/news/singleoptin-unsubscribe.blade.php @@ -0,0 +1,14 @@ +@extends('fo.layouts.layout') +@section('title', __('Newsletter unsubscription')) +@section('description', __('Newsletter unsubscription')) + +@section('content') +
+
+
+

{{ __('Newsletter unsubscription') }}

+

{{ $message }}

+
+
+
+@endsection diff --git a/resources/views/fo/pages/contact.blade.php b/resources/views/fo/pages/contact.blade.php new file mode 100644 index 00000000..61e9bab0 --- /dev/null +++ b/resources/views/fo/pages/contact.blade.php @@ -0,0 +1,143 @@ +@extends('fo.layouts.layout') + +@section('title', __('Contact us')) +@section('description', __('Procedure to contact the store managers.')) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $page) @endphp + +@section('content') +
+ @if ($page->title) +

{{ $page->title }}

+ @endif + +
+
+ {!! clean($page->content) !!} +
+ +
+ {{-- IF MAIL IS SENT --}} + @if (!is_null($status)) + @if ($status) +
+ {{ __('Success confirmation') }} +

{{ __('Your message has been sent!') }}

+

{{ __('Our team will do their best to reply as soon as possible.') }}

+
+ @else +
+ {{ __('Error confirmation') }} +

{{ __('Oops! An error occurred...') }}

+

{!! __('Your message could not be sent.
We are sorry and ask you to please try again later.') !!}

+
+ @endif + @else + {{-- FORM --}} +
+ @csrf + +
+
+ + + @error('last_name') +
{{ $message }}
+ @enderror +
+
+ + + @error('first_name') +
{{ $message }}
+ @enderror +
+
+ +
+
+ + + @error('email') +
{{ $message }}
+ @enderror +
+
+ +
+
+ + + @error('subject') +
{{ $message }}
+ @enderror +
+
+ + + @error('order_ref') +
{{ $message }}
+ @enderror +
+
+ +
+
+ +
'contact-message'])'>
+ + @error('message') +
{{ $message }}
+ @enderror +
+
+ +
+
+ + + @error('file') +
{{ $message }}
+ @enderror +
+
+ +
+ + + @error('ok_cgv') +
{{ $message }}
+ @enderror +
+ +

* {{ __('Mandatory fields') }}

+ +
+ +
+
+ @endif +
+
+
+@endsection diff --git a/resources/views/fo/pages/faq.blade.php b/resources/views/fo/pages/faq.blade.php new file mode 100644 index 00000000..4f40e9d4 --- /dev/null +++ b/resources/views/fo/pages/faq.blade.php @@ -0,0 +1,37 @@ +@extends('fo.layouts.layout') + +@section('title', __('FAQ')) +@section('description', __('Frequently asked questions.')) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $page) @endphp + +@section('content') +
+
+
+ @if ($page->title) +

{{ $page->title }}

+ @endif + +
+ @foreach ($faqs as $key => $faq) +
+

+ +

+
+
+
{!! clean($faq->answer) !!}
+
+
+
+ @endforeach +
+
+
+
+@endsection diff --git a/resources/views/fo/pages/home.blade.php b/resources/views/fo/pages/home.blade.php new file mode 100644 index 00000000..5bdc21ae --- /dev/null +++ b/resources/views/fo/pages/home.blade.php @@ -0,0 +1,54 @@ +@extends('fo.layouts.layout') + +@section('title', __('Home')) +@section('description', __('Shop homepage.')) + +@section('breadcrumb', 'no') +@section('bodyClass', 'full-page') + +@section('content') + {{-- MAIN SLIDER --}} + @if (!empty($slideList) && count($slideList) > 0) +
+
+ @include('fo.home-parts.sliders.main', compact('slideList')) +
+
+ @endif + + {{-- DISCOUNTS --}} +
+
+

{{ __('Offers') }}

+
+
+
+
+ @include('fo.home-parts.sliders.discounts', compact('starProductList')) +
+
+ + {{-- RANGES --}} +
+
+

{{ __('Aisles') }}

+
+
+
+
+ @include('fo.home-parts.ranges', compact('rangeList')) +
+
+ + {{-- SERVICES --}} +
+
+

{{ __('Services') }}

+
+
+
+
+ @include('fo.home-parts.services') +
+
+@endsection diff --git a/resources/views/fo/pages/legal-notice.blade.php b/resources/views/fo/pages/legal-notice.blade.php new file mode 100644 index 00000000..5e5d4d90 --- /dev/null +++ b/resources/views/fo/pages/legal-notice.blade.php @@ -0,0 +1,24 @@ +@extends('fo.layouts.layout') + +@section('title', __('Legal Notice & TOU')) +@section('description', __('Legal notice and terms of use of the shop.')) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $page) @endphp + +@section('content') +
+
+
+ @if ($page->title) +

{{ $page->title }}

+ @endif +
+
+ {!! clean($page->content) !!} +
+
+
+
+
+@endsection diff --git a/resources/views/fo/pages/privacy.blade.php b/resources/views/fo/pages/privacy.blade.php new file mode 100644 index 00000000..dd64ff64 --- /dev/null +++ b/resources/views/fo/pages/privacy.blade.php @@ -0,0 +1,25 @@ +@extends('fo.layouts.layout') + +@section('title', __('Privacy Policy')) +@section('description', __('Privacy policy of the shop.')) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $page) @endphp + +@section('content') +
+
+
+
+ @if ($page->title) +

{{ $page->title }}

+ @endif +
+
+ {!! clean($page->content) !!} +
+
+
+
+
+@endsection diff --git a/resources/views/fo/pages/products/index.blade.php b/resources/views/fo/pages/products/index.blade.php new file mode 100644 index 00000000..be0e390f --- /dev/null +++ b/resources/views/fo/pages/products/index.blade.php @@ -0,0 +1,37 @@ +@extends('fo.layouts.layout') + +@section('title', __('Products')) +@section('description', __('Complete list of shop products.')) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') +
+
+

{{ __('All aisles') }}

+
+ @php + $dataComponent = [ + 'productList' => $productListResource, + 'brandList' => $brandList->map( + fn($brand) => [ + 'name' => $brand->name, + 'value' => $brand->value(), + 'label' => $brand->label(), + ], + ), + 'rangeList' => $rangeList, + 'tagList' => $tagList, + 'perPage' => (int) $perPage, + ]; + @endphp + +
+
+ + {{ __('Loading') }}... + +
+
+
+@endsection diff --git a/resources/views/fo/pages/products/show-details.blade.php b/resources/views/fo/pages/products/show-details.blade.php new file mode 100644 index 00000000..cacbda88 --- /dev/null +++ b/resources/views/fo/pages/products/show-details.blade.php @@ -0,0 +1,98 @@ +
+ + @if (!empty($productWithPricing->product->inco->ingredients)) +
+

+ +

+
+
+ {!! clean($productWithPricing->product->inco->ingredients ?? '') !!} + @if (!empty($productWithPricing->product->inco->allergens)) +
+ {{ __('Allergens') }} : + {{ $productWithPricing->product->inco->allergens }} +
+ @endif +
+
+
+ @endif +
+

+ +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{ __('Average nutritional values') }}
{{ __('Nutrient') }}{{ __('Per') }} {{ $productWithPricing->product->inco->nv_ref_weight_g }}g +
{{ __('Energy') }} + {{ $productWithPricing->product->inco->nv_kj }} {{ __('Kj') }}
+ {{ $productWithPricing->product->inco->nv_kcal }} {{ __('Kcal') }} +
+ {{ __('Fat') }}
+ • {{ __('Of which saturated fatty acids') }} +
+ {{ $productWithPricing->product->inco->nv_fat_g }} g
+ {{ $productWithPricing->product->inco->nv_sat_fat_g }} g +
+ {{ __('Carbohydrates') }}
+ • {{ __('of which sugars') }} +
+ {{ $productWithPricing->product->inco->nv_carb_g }} g
+ {{ $productWithPricing->product->inco->nv_sugar_g }} g +
{{ __('Dietary fiber') }}{{ $productWithPricing->product->inco->nv_fiber_g }} g
{{ __('Proteins') }}{{ $productWithPricing->product->inco->nv_protein_g }} g
{{ __('Salt') }}{{ $productWithPricing->product->inco->nv_salt_g }} g
+
+

+ *{{ __('Reference Daily Intakes for an adult (8400kj/2000kcal).') }} +

+
+
+
+
+
diff --git a/resources/views/fo/pages/products/show-info.blade.php b/resources/views/fo/pages/products/show-info.blade.php new file mode 100644 index 00000000..0e806de6 --- /dev/null +++ b/resources/views/fo/pages/products/show-info.blade.php @@ -0,0 +1,36 @@ +{{-- blade-formatter-disable --}} +
product) class=" opacity-75" @endorderable> +

{{ $productWithPricing->product->name }}

+ +
+ {!! clean($productWithPricing->product->description) !!} +
+ + @if (!empty($productWithPricing->product->inco->preparation)) +
+

{{ __('Preparation advice') }} :

+
{!! clean($productWithPricing->product->inco->preparation ?? '') !!}
+
+ @endif + +
+

+ {{ __('Average product weight') }} : {{ $productWithPricing->product->product_weight?->forDisplay() }} +

+ @if ($productWithPricing->product->weight_variable) +

+ {{ __('Variable weight product') }} +

+ @endif +
+
+ +
+ @if (isset($productWithPricing->product->inco->nutriscore)) +
+ product->inco->nutriscore->value()}.png") }}" + alt="{{ __('Nutriscore') }} {{ Str::upper($productWithPricing->product->inco->nutriscore->label()) }}"> +
+ @endif +
diff --git a/resources/views/fo/pages/products/show-picture.blade.php b/resources/views/fo/pages/products/show-picture.blade.php new file mode 100644 index 00000000..29e63d3f --- /dev/null +++ b/resources/views/fo/pages/products/show-picture.blade.php @@ -0,0 +1,19 @@ +
+ @unlessorderable($productWithPricing->product) + + {{ __('Coming soon') }} + + @endorderable + + @if ($productWithPricing->product->picture_large) + {{ $productWithPricing->product->picture_alt }} + @elseif($productWithPricing->product->picture) + {{ $productWithPricing->product->picture_alt }} + @else + {{ __('No picture available') }} + @endif + +
diff --git a/resources/views/fo/pages/products/show-price-info.blade.php b/resources/views/fo/pages/products/show-price-info.blade.php new file mode 100644 index 00000000..8d25878a --- /dev/null +++ b/resources/views/fo/pages/products/show-price-info.blade.php @@ -0,0 +1,47 @@ +
+
+

+ @if ($productWithPricing->product->weight_variable) + {{ __('About') }}* + @endif +

+

+ + {{ __('Current price') }} :  + @include('fo.modules.guarded-currency', [ + 'money' => $productWithPricing->pricing->hasDiscount + ? $productWithPricing->pricing->discountedPriceTtc() + : $productWithPricing->pricing->basePriceTtc(), + 'product' => $productWithPricing->product, + ]) + + + @if ($productWithPricing->pricing->hasDiscount && $productWithPricing->product->validDiscount?->is_old_price_displayed) + + {{ __('Original price') }} :  + @include('fo.modules.guarded-currency', [ + 'money' => $productWithPricing->pricing->basePriceTtc(), + 'product' => $productWithPricing->product, + ]) + + @endif + /{{ $productWithPricing->product->sell_unit->label() }} +

+ +

+ {{ $productWithPricing->product->weight_variable ? '*' . __('Product sold by the kilo') : __('Price per kilo') }} : + @include('fo.modules.guarded-currency', [ + 'money' => $productWithPricing->pricing->priceKgTtc(), + 'product' => $productWithPricing->product, + ]) + /kg +

+
+ + @can('addToBasket', $productWithPricing->product) +
+
$productWithPricing->product->id])'>
+
+ @endcan +
diff --git a/resources/views/fo/pages/products/show.blade.php b/resources/views/fo/pages/products/show.blade.php new file mode 100644 index 00000000..39eabb47 --- /dev/null +++ b/resources/views/fo/pages/products/show.blade.php @@ -0,0 +1,37 @@ +@extends('fo.layouts.layout', ['brParam' => $productWithPricing->product]) + +@section('title', __('Specific product')) +@section('description', __('Specific store product.')) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') +
+
+ + + +
+ @include('fo.pages.products.show-info', compact('productWithPricing')) +
+ +
+ @include('fo.pages.products.show-price-info', compact('productWithPricing')) + + @if (!empty($productWithPricing->product->inco->nv_kj)) + + @endif +
+
+ + @if (!empty($associatedProducts)) +
+
+
+ @endif +
+@endsection diff --git a/resources/views/fo/pages/terms.blade.php b/resources/views/fo/pages/terms.blade.php new file mode 100644 index 00000000..146f9a83 --- /dev/null +++ b/resources/views/fo/pages/terms.blade.php @@ -0,0 +1,24 @@ +@extends('fo.layouts.layout') + +@section('title', __('General terms and conditions of sale')) +@section('description', __('General terms and conditions of sale of the shop.')) + +@section('breadcrumb', request()->route()->getName()) +@php view()->share('brParam', $page) @endphp + +@section('content') +
+
+
+ @if ($page->title) +

{{ $page->title }}

+ @endif +
+
+ {!! clean($page->content) !!} +
+
+
+
+
+@endsection diff --git a/resources/views/fo/tunnel/basket-summary.blade.php b/resources/views/fo/tunnel/basket-summary.blade.php new file mode 100644 index 00000000..a9d7ba74 --- /dev/null +++ b/resources/views/fo/tunnel/basket-summary.blade.php @@ -0,0 +1,32 @@ +@extends('fo.layouts.layout') + +@section('title', __('Order summary')) +@section('description', __('Check and confirm the content of your order before continuing.')) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') + @include('fo.tunnel.tunnel-stepper', compact('step')) + +
+
+
+

+ {{ __('Basket Summary') }} +

+ + @if ($errors->any()) +
+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+ @endif + +
csrf_token()])'>
+
+
+
+@endsection diff --git a/resources/views/fo/tunnel/confirmation.blade.php b/resources/views/fo/tunnel/confirmation.blade.php new file mode 100644 index 00000000..3c16ac6c --- /dev/null +++ b/resources/views/fo/tunnel/confirmation.blade.php @@ -0,0 +1,76 @@ +@extends('fo.layouts.layout') + +@section('title', __('Final order validation')) +@section('description', __('Check all your information before confirming.')) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') + @include('fo.tunnel.tunnel-stepper', ['step' => $step]) + +
+
+
+

+ {{ __('Final Validation') }} +

+ + @if (session()->has('message')) +
+ {{ session('message') }} +
+ @endif + +
+

{{ __('Your basket') }}

+
    + @foreach ($basket->items() as $item) +
  • + {{ $item->qty }} x {{ $item->name }} + @money($item->totalTtc()) +
  • + @endforeach +
  • + {{ __('Total TTC') }} + @money($basket->totalTaxIncluded()) +
  • +
+
+ +
+

{{ __('Your collection') }}

+

+ {{ __('Location') }} {{ $shop->name }} - {{ $shop->address }} +

+

+ {{ __('Collection date') }} + {{ __('On') }} {{ \Carbon\Carbon::instance($builder->getPickupTimeSlot()->getAt())->translatedFormat('l j F Y') }} +

+
+ +
+ @csrf +
+ + +
+ +
+ + {{ __('Back') }} + + +
+
+ +
+
+
+@endsection diff --git a/resources/views/fo/tunnel/confirmed.blade.php b/resources/views/fo/tunnel/confirmed.blade.php new file mode 100644 index 00000000..eba36863 --- /dev/null +++ b/resources/views/fo/tunnel/confirmed.blade.php @@ -0,0 +1,97 @@ +@extends('fo.layouts.layout') + +@section('title', __('Order validation')) +@section('description', __('Validation of your order.')) + +@section('breadcrumb', 'no') + +@section('content') + @include('fo.tunnel.tunnel-stepper', ['step' => $step]) + +
+
+ + +
+ +

{{ __('Your order is registered!') }}

+

{{ __('Thank you for this order!') }}

+

{{ __('A confirmation has just been sent to your email address') }}

+
+ + +
+

{{ __('Order details') }}

+

{{ __('Reminder of your order ref: :ref', ['ref' => $order->reference]) }}

+ +
+ + + + @foreach ($order->lines as $line) + + + + + @endforeach + + + + + + + +
{{ __('Order details') }}
+ {{ $line->quantity }} x {{ $line->product->name }} + @money($line->total_ttc)
{{ __('Estimated total') }}@money($order->total)
+
+
+ + +
+
+ +

{{ __('Collection details') }}

+
+ +
+
+

{{ __('To be collected on') }}

+

{{ $order->pickup_day->translatedFormat('l j F Y') }}

+
+
+

{{ __('at the following address') }}

+
+ {{ $shop->name }}
+ {{ $shop->address }}
+ {{ $shop->postcode }} {{ $shop->city }} +
+
+
+ + @if ($shop->latitude && $shop->longitude) +
+ @php + $displayData = [ + 'lat' => $shop->latitude, + 'lng' => $shop->longitude, + 'name' => $shop->name, + 'address' => $shop->address . ' - ' . $shop->postcode . ' ' . $shop->city, + ]; + @endphp +
+
+ @endif +
+ + + + +
+
+ +@endsection diff --git a/resources/views/fo/tunnel/pick-time-slot.blade.php b/resources/views/fo/tunnel/pick-time-slot.blade.php new file mode 100644 index 00000000..169348fe --- /dev/null +++ b/resources/views/fo/tunnel/pick-time-slot.blade.php @@ -0,0 +1,100 @@ +@extends('fo.layouts.layout') + +@section('title', __('Order reservation')) +@section('description', __('Reservation of your order')) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') + @include('fo.tunnel.tunnel-stepper', compact('step')) + +
+
+ +
+

+ {{ __('Select your pickup day') }} +

+ + @if ($errors->any()) +
+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+ @endif + +

+ {!! __('Your assigned pickup point is :shop', [ + 'shop' => + '' . + e($shop->name) . + '', + ]) !!} +

+ +
+ @csrf + +
+
+
{{ __('Available days') }}
+ + @php + $groupedSlots = collect($timeSlots)->groupBy(function ($slot) { + return $slot->getAt()->isoFormat('MMMM YYYY'); + }); + @endphp + + @forelse($groupedSlots as $month => $slots) +
{{ $month }}
+
+ @foreach ($slots as $slot) + @php + $slotDate = $slot->getAt()->format('Y-m-d'); + $isPast = $slot->getAt()->isPast(); + $displayDate = $slot->getAt()->isoFormat('dddd D MMMM YYYY'); + @endphp +
+
+ + +
+
+ @endforeach +
+ @empty +
+

{{ __('No pickup days available at the moment') }}

+
+ @endforelse +
+
+ +
+ + {{ __('Back to basket') }} + + + +
+
+
+
+
+@endsection diff --git a/resources/views/fo/tunnel/tunnel-stepper.blade.php b/resources/views/fo/tunnel/tunnel-stepper.blade.php new file mode 100644 index 00000000..de1a653a --- /dev/null +++ b/resources/views/fo/tunnel/tunnel-stepper.blade.php @@ -0,0 +1,33 @@ +@php + /** @var \Domain\Enums\OrderTunnelStep $step */ +@endphp +
+
+ + {{-- Step 1 --}} +
+ 1 + {{ __('Summary') }} +
+ +
+ + {{-- Step 2 --}} +
+ 2 + {{ __('Reservation') }} +
+ +
+ + {{-- Step 3 --}} +
+ 3 + {{ __('Confirmation') }} +
+ +
+
diff --git a/resources/views/front/.gitignore b/resources/views/front/.gitignore deleted file mode 100644 index c564a731..00000000 --- a/resources/views/front/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -ldc -!.gitignore -!basic/* -!README.txt diff --git a/resources/views/front/README.txt b/resources/views/front/README.txt deleted file mode 100644 index e4c31946..00000000 --- a/resources/views/front/README.txt +++ /dev/null @@ -1,4 +0,0 @@ -git init -git remote add origin https://ldc-web:phaeZ6ej@voight001.lesidc.com/boutique-cnc-themes -git fetch origin -git checkout -b boutique-du-canard --track origin/boutique-du-canard diff --git a/resources/views/front/sable/README.md b/resources/views/front/sable/README.md deleted file mode 100644 index d169c4fc..00000000 --- a/resources/views/front/sable/README.md +++ /dev/null @@ -1,2 +0,0 @@ -## Thème pour la boutique - diff --git a/resources/views/front/sable/auth/activate.blade.php b/resources/views/front/sable/auth/activate.blade.php deleted file mode 100644 index 69cde64d..00000000 --- a/resources/views/front/sable/auth/activate.blade.php +++ /dev/null @@ -1,22 +0,0 @@ -@extends('layouts.layout') - -@section('title', __('Activation')) -@section('description', 'Activation de votre compte précédemment créé.') - -@section('content') -
-
-
-

Activation de votre compte

-
-
-

{{ $message }}

-
- -
-
-
-
-@endsection diff --git a/resources/views/front/sable/auth/login-bo.blade.php b/resources/views/front/sable/auth/login-bo.blade.php deleted file mode 100644 index 40bebc52..00000000 --- a/resources/views/front/sable/auth/login-bo.blade.php +++ /dev/null @@ -1,50 +0,0 @@ -@extends('layouts.layout') - -@section('title', __('Connexion au back office')) -@section('description', 'Connexion au back office.') - -@section('content') -
-
-
-

Connexion

-
- @csrf - @if ($errors->any()) -
-
    - @foreach ($errors->all() as $error) -
  • {{ $error }}
  • - @endforeach -
-
- @endif -
- - -
-
- - -
-
-
- -
- -
-
-
-

Pas encore de compte ?

- Inscrivez-vous -
-
-
-
-
-
-@endsection diff --git a/resources/views/front/sable/auth/login.blade.php b/resources/views/front/sable/auth/login.blade.php deleted file mode 100644 index a87d8b06..00000000 --- a/resources/views/front/sable/auth/login.blade.php +++ /dev/null @@ -1,50 +0,0 @@ -@extends('layouts.layout') - -@section('title', __('Connexion')) -@section('description', 'Connexion à votre compte personnel.') - -@section('content') -
-
-
-

Connexion

-
- @csrf - @if ($errors->any()) -
-
    - @foreach ($errors->all() as $error) -
  • {{ $error }}
  • - @endforeach -
-
- @endif -
- - -
-
- - -
-
-
- -
- -
-
-
-

Pas encore de compte ?

- Inscrivez-vous -
-
-
-
-
-
-@endsection diff --git a/resources/views/front/sable/auth/passwords/forgot.blade.php b/resources/views/front/sable/auth/passwords/forgot.blade.php deleted file mode 100644 index abce601e..00000000 --- a/resources/views/front/sable/auth/passwords/forgot.blade.php +++ /dev/null @@ -1,33 +0,0 @@ -@extends('layouts.layout') - -@section('title', 'Mot de passe oublié') -@section('description', 'Procédure afin de retrouver son mot de passe lié à son compte.') - -@section('content') -
-
-
-

Mot de passe oublié

-
- @csrf - @if ($errors->any()) -
-
    - @foreach ($errors->all() as $error) -
  • {{ $error }}
  • - @endforeach -
-
- @elseif (session('success')) -
- {{ session('success') }} -
- @endif -

Pour que nous puissions vous envoyer un lien de réinitialisation de votre mot de passe, merci de nous indiquer l'adresse e-mail saisie lors de votre inscription.

- - -
-
-
-
-@endsection diff --git a/resources/views/front/sable/auth/passwords/reset-ok.blade.php b/resources/views/front/sable/auth/passwords/reset-ok.blade.php deleted file mode 100644 index 92b617d0..00000000 --- a/resources/views/front/sable/auth/passwords/reset-ok.blade.php +++ /dev/null @@ -1,22 +0,0 @@ -@extends('layouts.layout') - -@section('title', 'Mot de passe modifié') -@section('description', 'Votre mot de passe a bien été modifié.') - -@section('content') -
-
-
-

Changement de votre mot de passe

-
-
-

Votre mot de passe a bien été modifié.

-
- -
-
-
-
-@endsection diff --git a/resources/views/front/sable/auth/passwords/reset.blade.php b/resources/views/front/sable/auth/passwords/reset.blade.php deleted file mode 100644 index c438453a..00000000 --- a/resources/views/front/sable/auth/passwords/reset.blade.php +++ /dev/null @@ -1,51 +0,0 @@ -@extends('layouts.layout') - -@section('title', 'Mot de passe') -@section('description', 'Changement de votre mot de passe.') - -@section('content') -
-
-
-

Connexion

-
- @csrf - @if ($errors->any()) -
-
    - @foreach ($errors->all() as $error) -
  • {{ $error }}
  • - @endforeach -
-
- @endif - @if (session('success')) -
- {{ session('success') }} -
- @endif -
-
- - -
-
- -
-
- -
-
-
-
-
-
-@endsection diff --git a/resources/views/front/sable/auth/register-success.blade.php b/resources/views/front/sable/auth/register-success.blade.php deleted file mode 100644 index 9a9bbccc..00000000 --- a/resources/views/front/sable/auth/register-success.blade.php +++ /dev/null @@ -1,24 +0,0 @@ -@extends('layouts.layout') - -@section('title', __('Inscription')) -@section('description', 'Inscription à la boutique réussi.') - -@section('content') -
-
-
-

Création de votre compte

-
-
-

Félicitations

-

Votre compte a bien été créé !

-

Vous allez recevoir un mail de confirmation sur l'adresse {{ $mail }}

-
- -
-
-
-
-@endsection diff --git a/resources/views/front/sable/auth/register.blade.php b/resources/views/front/sable/auth/register.blade.php deleted file mode 100644 index 45ef772a..00000000 --- a/resources/views/front/sable/auth/register.blade.php +++ /dev/null @@ -1,212 +0,0 @@ -@extends('layouts.layout') - -@section('title', __('Inscription')) -@section('description', 'Procédure d\inscription à la boutique.') - -@section('content') -
-
-
-

{{ __('Inscription') }}

- @if (session('success')) -
-
-

{{ __('Félicitations') }}

-

{{ __('Votre compte a bien été créé !') }}

-

{{ __('Vous allez recevoir un mail de confirmation sur l\'adresse') }} {{ $mail }}

-
- -
- @else -
- @csrf - @if ($errors->any()) -
-
    - @foreach ($errors->all() as $error) -
  • {{ $error }}
  • - @endforeach -
-
- @endif - @if (config('bosettings.register_salaries') && config('bosettings.register_public')) -
-
- -
-
- - @elseif (config('bosettings.register_salaries') && !config('bosettings.register_public')) -
-
- - -
-
-
-
-

- {{ __('Merci de renseigner votre matricule (disponible sur votre bulletin de salaire), sur 7 caractères (ex : v00115590 --> 0115590).') }} -

-

- {{ __('Merci de vous rapprocher de votre service RH pour connaître votre code d\'inscription à usage unique.') }} -

-
-
- @endif -
-
- - -
-
-
-
-

{{ __('Date de naissance *') }}

- -
-
-
- -
-
-
- - - - - - -
-
-
-

- {{ __('Le mot de passe doit contenir :') }} -

-

- {{ __('- minimum 8 caractères') }} -

-

- {{ __('- au moins une majuscule') }} -

-

- {{ __('- au moins une minuscule') }} -

-

- {{ __('- au moins un chiffre') }} -

-

- {{ __('- au moins un caractère spécial.') }} -

-
-
- -
-
-
- - -
-
-
- -
- -
- - -
-
{{ __('*Champs obligatoires') }}
-
-
- -
-
-
-
-
-

{{ __('Déjà inscrit ?') }}

- {{ __('Connectez-vous') }} -
-
- @endif -
-
-
-@endsection - - diff --git a/resources/views/front/sable/breadcrumb/breadcrumb-body.blade.php b/resources/views/front/sable/breadcrumb/breadcrumb-body.blade.php deleted file mode 100644 index 97b0c0e3..00000000 --- a/resources/views/front/sable/breadcrumb/breadcrumb-body.blade.php +++ /dev/null @@ -1,7 +0,0 @@ -@hasSection('breadcrumb') - @if(Breadcrumbs::exists(app()->view->getSections()['breadcrumb'])) - {{ Breadcrumbs::render(app()->view->getSections()['breadcrumb'], $brParam ?? null) }} - @endif -@elseif(Breadcrumbs::exists(request()->route()->getName())) - {{ Breadcrumbs::render(request()->route()->getName()) }} -@endif diff --git a/resources/views/front/sable/breadcrumb/breadcrumb-head.blade.php b/resources/views/front/sable/breadcrumb/breadcrumb-head.blade.php deleted file mode 100644 index d4a4abfc..00000000 --- a/resources/views/front/sable/breadcrumb/breadcrumb-head.blade.php +++ /dev/null @@ -1,7 +0,0 @@ -@hasSection('breadcrumb') - @if(Breadcrumbs::exists(app()->view->getSections()['breadcrumb'])) - {{ Breadcrumbs::view('breadcrumbs::json-ld', app()->view->getSections()['breadcrumb'], $brParam ?? null) }} - @endif -@elseif(Breadcrumbs::exists(request()->route()->getName())) - {{ Breadcrumbs::view('breadcrumbs::json-ld', request()->route()->getName()) }} -@endif diff --git a/resources/views/front/sable/breadcrumb/layout.blade.php b/resources/views/front/sable/breadcrumb/layout.blade.php deleted file mode 100644 index feda101f..00000000 --- a/resources/views/front/sable/breadcrumb/layout.blade.php +++ /dev/null @@ -1,25 +0,0 @@ -@unless ($breadcrumbs->isEmpty()) -
-
-
-
-
-
-
- @foreach ($breadcrumbs as $breadcrumb) - @if (!is_null($breadcrumb->url) && !$loop->last) - {{ $breadcrumb->title }} - @else - {{ $breadcrumb->title }} - @endif - @if(count($breadcrumbs) > 1 and !$loop->last) - / - @endif - @endforeach -
-
-
-
-
-
-@endunless diff --git a/resources/views/front/sable/contact.blade.php b/resources/views/front/sable/contact.blade.php deleted file mode 100644 index 5e79ceeb..00000000 --- a/resources/views/front/sable/contact.blade.php +++ /dev/null @@ -1,115 +0,0 @@ -@extends('layouts.layout') - -@section('title', __('Contactez-nous')) -@section('description', 'Procédure afin de contacter les gérants de la boutique.') - -@section('breadcrumb', 'no') - -@section('content') -
-

{!! $content->title !!}

-
-
- @if ($content !== null) - {!! clean($content->value) !!} - @else -

{{ __('Bonjour,') }}

-

{{ __('Si vous avez une question à nous poser ou des remarques à formuler sur notre site, n\'hésitez pas à les inscrire dans le formulaire ci-contre. Merci d\'indiquer vos coordonnées exactes pour que nous puissions vous répondre prochainement.') }}

-

{{ __('Les informations qui vous concernent sont destinées à un usage interne et ne seront en aucun cas transmises à des tiers. Vous disposez d\'un droit d\'accès, de modification, de rectification et de suppression des données qui vous concernent (art. 34 de la loi "Informatique et Libertés").') }}

- @endif -
-
- @csrf - {{-- IF MAIL IS SENT --}} - @if(!is_null($status)) - @if(session()->get('status')) -
- -

Votre message a bien été envoyé !

-

Nos services mettent tout en oeuvre pour y répondre au plus vite.

-
- @else -
- -

Oups ! Une erreur s'est produite...

-

Votre message n'a pas pu être envoyé.
Nous en sommes désolés et vous prions
de bien vouloir réessayer plus tard.

-
- @endif - @else - @if ($errors->any()) -
-
    - @foreach ($errors->all() as $error) -
  • {{ $error }}
  • - @endforeach -
-
- @endif -
-
- - -
-
-
- -
-
- -
-
- -
-
- -
-
-
Pièce jointe (.pdf, .jpeg, .png, 5Mo max)
- -
- -
* {{ __('mandatory_fields') }}
-
-
- -
-
- @endif -
-
-
-@endsection diff --git a/resources/views/front/sable/customer/dashboard.blade.php b/resources/views/front/sable/customer/dashboard.blade.php deleted file mode 100644 index 2efe51b9..00000000 --- a/resources/views/front/sable/customer/dashboard.blade.php +++ /dev/null @@ -1,172 +0,0 @@ -@extends('layouts.layout') - -@section('title', __('Mon Compte')) -@section('description', 'Informations concernant votre compte personnel.') - -@section('content') -
-
-
- @if ($errors->any()) -
-
    - @foreach ($errors->all() as $error) -
  • {{ $error }}
  • - @endforeach -
-
- @elseif (session('success')) -
- {{ session('success') }} -
- @endif -

{{ __('Mon compte') }}

- -

{{ __('Mes coordonnées') }}

-

{{ __('Pour modifier vos informations personnelles,') }}

-

{{ __('il vous suffit de renseigner vos nouvelles données dans le formulaire ci-dessous :') }}

-
- @csrf -
-
- - -
-
-
-
-

{{ __('Date de naissance *') }}

- - - - - -
-
-
- -
-
-
- - -
-
-
-
- - -
-
-
- opt_in))checked @endif> - -
-
-
- -
-
-
-

{{ __('Mot de passe') }}

-
- @csrf -
-
- -
-
-
-
- - -
-
-

- {{ __('Le nouveau mot de passe doit avoir une longueur minimale de 8 caractères et doit contenir majuscule, minuscule, chiffre et caractère spécial.') }} -

-
-
- -
-
-
-
-
-
-@endsection diff --git a/resources/views/front/sable/customer/my-orders.blade.php b/resources/views/front/sable/customer/my-orders.blade.php deleted file mode 100644 index e1cea97d..00000000 --- a/resources/views/front/sable/customer/my-orders.blade.php +++ /dev/null @@ -1,48 +0,0 @@ -@extends('layouts.layout') - -@section('title', __('Mes Commandes')) -@section('description', 'Récapitulatif de vos commandes.') - -@section('content') -
-
-
-

Mes Commandes

-
-
-
- @if(count($orders) > 0) - - - - - - - - - - - @foreach ($orders as $order) - - - - - - - @endforeach - -
RéférenceDateTotal en €Statut
- {{$order->reference}} - - {{\Carbon\Carbon::parse($order->date)->format('d/m/Y')}} - @fmt_currency($order->total){{ $order->status->label }}
- @else -

Vous n'avez aucunes commandes

- @endif -
-
-
-
-
-
-@endsection diff --git a/resources/views/front/sable/customer/order-detail.blade.php b/resources/views/front/sable/customer/order-detail.blade.php deleted file mode 100644 index 5ca9e494..00000000 --- a/resources/views/front/sable/customer/order-detail.blade.php +++ /dev/null @@ -1,79 +0,0 @@ -@extends('layouts.layout',['brParam' => $order->reference]) - -@section('title', __('Détail Commande')) -@section('description', 'Informations concernant une commande spécifique.') - -@section('breadcrumb', request()->route()->getName()) - -@section('content') -
-
-
-

Détail de votre commande du {{\Carbon\Carbon::parse($order->date)->format('d/m/Y')}}

-

réf: {{ $order->reference }}

-
-
-
- @if (\Session::has('message')) -
- {!! \Session::get('message') !!} -
- @endif - - - - - - - - - - - - - - - - - - - - - - - -
Etat de votre commandeRappel de votre commandePrix au KG TTCPrix à la pièce TTC
- {{ $order->status->label }} - - @foreach ($order->lines as $line) -

{{ $line->quantity }} x {{ $line->product->name }}

- @endforeach -
- @foreach ($order->lines as $line) -

@fmt_currency($line->product->priceKgTtc)

- @endforeach -
- @foreach ($order->lines as $line) -

@fmt_currency($line->product->discountedPriceTtc)

- @endforeach -
- Total estimé TTC - {{ $order->formattedTotalTtc }} -
- @if (!empty($magasin)) -

- A retirer le {{$order->timeslot->day}} à {{$order->timeslot->time}}, à l'adresse suivante :
- Mon point de retrait {{$magasin->name}}, {{$magasin->address}}, {{$magasin->postcode}} {{$magasin->city}} -

- @else - - @endif -
-
-
-
-
-
-@endsection diff --git a/resources/views/front/sable/customer/singleoptin-unsubscribe.blade.php b/resources/views/front/sable/customer/singleoptin-unsubscribe.blade.php deleted file mode 100644 index ce190544..00000000 --- a/resources/views/front/sable/customer/singleoptin-unsubscribe.blade.php +++ /dev/null @@ -1,15 +0,0 @@ -@extends('layouts.layout') -@section('title', __('Désincription à la newsletter')) -@section('description', __('Désinscription à la newsletter')) - -@section('content') -
-
-
-

{{ __('Désincription à la newsletter') }}

-

{{ $message }}

-
-
-
-@endsection - diff --git a/resources/views/front/sable/faq.blade.php b/resources/views/front/sable/faq.blade.php deleted file mode 100644 index 8b5536ba..00000000 --- a/resources/views/front/sable/faq.blade.php +++ /dev/null @@ -1,32 +0,0 @@ -@extends('layouts.layout') - -@section('title', __('FAQ')) -@section('description', 'Foire aux questions fréquemment posées.') - -@section('breadcrumb', 'no') - -@section('content') -
-
-
-

{{ $content->value }}

- @if ($content !== null) - @foreach ($faq as $key => $f) -
-
- -
-

{{ $f->answer }}

-
-
-
- @endforeach - @endif -
-
-
-@endsection diff --git a/resources/views/front/sable/fonts/barlow/Barlow-Black.ttf b/resources/views/front/sable/fonts/barlow/Barlow-Black.ttf deleted file mode 100644 index 4d9bb93b..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-Black.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-BlackItalic.ttf b/resources/views/front/sable/fonts/barlow/Barlow-BlackItalic.ttf deleted file mode 100644 index 1947969e..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-BlackItalic.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-Bold.eot b/resources/views/front/sable/fonts/barlow/Barlow-Bold.eot deleted file mode 100644 index fdd4774b..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-Bold.eot and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-Bold.svg b/resources/views/front/sable/fonts/barlow/Barlow-Bold.svg deleted file mode 100644 index 2d5fe21a..00000000 --- a/resources/views/front/sable/fonts/barlow/Barlow-Bold.svg +++ /dev/null @@ -1,3518 +0,0 @@ - - - - -Created by FontForge 20170731 at Wed Nov 7 06:08:51 2018 - By Aleksey,,, -Copyright 2017 The Barlow Project Authors (https://github.com/jpt/barlow) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/views/front/sable/fonts/barlow/Barlow-Bold.ttf b/resources/views/front/sable/fonts/barlow/Barlow-Bold.ttf deleted file mode 100644 index 86f237c6..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-Bold.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-Bold.woff b/resources/views/front/sable/fonts/barlow/Barlow-Bold.woff deleted file mode 100644 index fd3fd846..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-Bold.woff and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-Bold.woff2 b/resources/views/front/sable/fonts/barlow/Barlow-Bold.woff2 deleted file mode 100644 index 537c719f..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-Bold.woff2 and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-BoldItalic.ttf b/resources/views/front/sable/fonts/barlow/Barlow-BoldItalic.ttf deleted file mode 100644 index bc59eaf3..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-BoldItalic.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-ExtraBold.ttf b/resources/views/front/sable/fonts/barlow/Barlow-ExtraBold.ttf deleted file mode 100644 index 0da03830..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-ExtraBold.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-ExtraBoldItalic.ttf b/resources/views/front/sable/fonts/barlow/Barlow-ExtraBoldItalic.ttf deleted file mode 100644 index a1f1612f..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-ExtraBoldItalic.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-ExtraLight.ttf b/resources/views/front/sable/fonts/barlow/Barlow-ExtraLight.ttf deleted file mode 100644 index b70214d1..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-ExtraLight.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-ExtraLightItalic.ttf b/resources/views/front/sable/fonts/barlow/Barlow-ExtraLightItalic.ttf deleted file mode 100644 index a5f9351b..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-ExtraLightItalic.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-Italic.ttf b/resources/views/front/sable/fonts/barlow/Barlow-Italic.ttf deleted file mode 100644 index 987594e7..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-Italic.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-Light.ttf b/resources/views/front/sable/fonts/barlow/Barlow-Light.ttf deleted file mode 100644 index a6f71f27..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-Light.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-LightItalic.ttf b/resources/views/front/sable/fonts/barlow/Barlow-LightItalic.ttf deleted file mode 100644 index 28b8a381..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-LightItalic.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-Medium.eot b/resources/views/front/sable/fonts/barlow/Barlow-Medium.eot deleted file mode 100644 index 1dbe49ff..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-Medium.eot and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-Medium.svg b/resources/views/front/sable/fonts/barlow/Barlow-Medium.svg deleted file mode 100644 index 66093b82..00000000 --- a/resources/views/front/sable/fonts/barlow/Barlow-Medium.svg +++ /dev/null @@ -1,3407 +0,0 @@ - - - - -Created by FontForge 20170731 at Wed Nov 7 06:08:48 2018 - By Aleksey,,, -Copyright 2017 The Barlow Project Authors (https://github.com/jpt/barlow) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/views/front/sable/fonts/barlow/Barlow-Medium.ttf b/resources/views/front/sable/fonts/barlow/Barlow-Medium.ttf deleted file mode 100644 index 18067831..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-Medium.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-Medium.woff b/resources/views/front/sable/fonts/barlow/Barlow-Medium.woff deleted file mode 100644 index 9a02ffec..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-Medium.woff and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-Medium.woff2 b/resources/views/front/sable/fonts/barlow/Barlow-Medium.woff2 deleted file mode 100644 index 9d83fe46..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-Medium.woff2 and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-MediumItalic.ttf b/resources/views/front/sable/fonts/barlow/Barlow-MediumItalic.ttf deleted file mode 100644 index 46e2a76b..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-MediumItalic.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-Regular.ttf b/resources/views/front/sable/fonts/barlow/Barlow-Regular.ttf deleted file mode 100644 index 340f1c63..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-Regular.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-SemiBold.ttf b/resources/views/front/sable/fonts/barlow/Barlow-SemiBold.ttf deleted file mode 100644 index e95527e7..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-SemiBold.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-SemiBoldItalic.ttf b/resources/views/front/sable/fonts/barlow/Barlow-SemiBoldItalic.ttf deleted file mode 100644 index ba4f5219..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-SemiBoldItalic.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-Thin.ttf b/resources/views/front/sable/fonts/barlow/Barlow-Thin.ttf deleted file mode 100644 index d8882fe3..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-Thin.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/Barlow-ThinItalic.ttf b/resources/views/front/sable/fonts/barlow/Barlow-ThinItalic.ttf deleted file mode 100644 index 869f1a34..00000000 Binary files a/resources/views/front/sable/fonts/barlow/Barlow-ThinItalic.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/BarlowCondensed-Medium.eot b/resources/views/front/sable/fonts/barlow/BarlowCondensed-Medium.eot deleted file mode 100644 index 8fbd77a9..00000000 Binary files a/resources/views/front/sable/fonts/barlow/BarlowCondensed-Medium.eot and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/BarlowCondensed-Medium.svg b/resources/views/front/sable/fonts/barlow/BarlowCondensed-Medium.svg deleted file mode 100644 index 27870a60..00000000 --- a/resources/views/front/sable/fonts/barlow/BarlowCondensed-Medium.svg +++ /dev/null @@ -1,2688 +0,0 @@ - - - - -Created by FontForge 20170731 at Thu Oct 26 18:31:46 2017 - By Aleksey,,, -Copyright 2017 The Barlow Project Authors (https://github.com/jpt/barlow) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/views/front/sable/fonts/barlow/BarlowCondensed-Medium.ttf b/resources/views/front/sable/fonts/barlow/BarlowCondensed-Medium.ttf deleted file mode 100644 index 8bedf8e2..00000000 Binary files a/resources/views/front/sable/fonts/barlow/BarlowCondensed-Medium.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/BarlowCondensed-Medium.woff b/resources/views/front/sable/fonts/barlow/BarlowCondensed-Medium.woff deleted file mode 100644 index 3a766490..00000000 Binary files a/resources/views/front/sable/fonts/barlow/BarlowCondensed-Medium.woff and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/BarlowCondensed-Medium.woff2 b/resources/views/front/sable/fonts/barlow/BarlowCondensed-Medium.woff2 deleted file mode 100644 index c7abf7ab..00000000 Binary files a/resources/views/front/sable/fonts/barlow/BarlowCondensed-Medium.woff2 and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/BarlowCondensed-SemiBold.eot b/resources/views/front/sable/fonts/barlow/BarlowCondensed-SemiBold.eot deleted file mode 100644 index 1e86ca44..00000000 Binary files a/resources/views/front/sable/fonts/barlow/BarlowCondensed-SemiBold.eot and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/BarlowCondensed-SemiBold.svg b/resources/views/front/sable/fonts/barlow/BarlowCondensed-SemiBold.svg deleted file mode 100644 index e935670c..00000000 --- a/resources/views/front/sable/fonts/barlow/BarlowCondensed-SemiBold.svg +++ /dev/null @@ -1,2758 +0,0 @@ - - - - -Created by FontForge 20170731 at Thu Oct 26 18:31:48 2017 - By Aleksey,,, -Copyright 2017 The Barlow Project Authors (https://github.com/jpt/barlow) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/views/front/sable/fonts/barlow/BarlowCondensed-SemiBold.ttf b/resources/views/front/sable/fonts/barlow/BarlowCondensed-SemiBold.ttf deleted file mode 100644 index e8e26ed6..00000000 Binary files a/resources/views/front/sable/fonts/barlow/BarlowCondensed-SemiBold.ttf and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/BarlowCondensed-SemiBold.woff b/resources/views/front/sable/fonts/barlow/BarlowCondensed-SemiBold.woff deleted file mode 100644 index ed7b89f8..00000000 Binary files a/resources/views/front/sable/fonts/barlow/BarlowCondensed-SemiBold.woff and /dev/null differ diff --git a/resources/views/front/sable/fonts/barlow/BarlowCondensed-SemiBold.woff2 b/resources/views/front/sable/fonts/barlow/BarlowCondensed-SemiBold.woff2 deleted file mode 100644 index 81db704a..00000000 Binary files a/resources/views/front/sable/fonts/barlow/BarlowCondensed-SemiBold.woff2 and /dev/null differ diff --git a/resources/views/front/sable/home.blade.php b/resources/views/front/sable/home.blade.php deleted file mode 100644 index 97630cd4..00000000 --- a/resources/views/front/sable/home.blade.php +++ /dev/null @@ -1,174 +0,0 @@ -@extends('layouts.layout') - -@section('title', __('Accueil')) -@section('description', 'Page d\'accueil de la boutique.') - -@section('breadcrumb', 'no') - -@section('content') -
- -
-

Offres

-
-
- @foreach ($products as $product) -
-
-
-
-

bientôt disponible

- picture) }}" class="h-100 mw-100" alt="{{ $product->name }}"> -
-
-
- {{ $product->name }} -
-
- {!! $product->description !!} -
-
-

- @if ($product->weight_variable) Environ* @endif - @fmt_currency($product->discountedPriceTtc) - @if ($product->promotions->count() && $product->promotions()->first()->is_old_price_displayed) - @fmt_currency_without_ttc($product->priceTtc) - @endif - /{{ $product->sell_unit }} -

-
- @if ($product->weight_variable) -

*Produit vendu au kilo : @fmt_currency($product->priceKgTtc)/kg

- @else -

Prix au kilo : @fmt_currency($product->priceKgTtc)/kg

- @endif -
- foodProduct->nutriscore . ".png") }}"> - @if( - Auth::guard('customer')->user() && - Auth::guard('customer')->user()->can('addToCart', $product) - ) - - @endif -
-
-
-
-
-
- @endforeach -
-
-
-
- voir toutes les offres -
- - -
-

Rayons

-
- @foreach ($quickorder_ranges as $quickorder_range) -
-
-
- ... -
-
-
-
{{ $quickorder_range->name }}
- {!! $quickorder_range->description !!} - Voir le rayon -
-
-
-
-
- @endforeach -
- voir tous les rayons -
- - -
-

Services

-
-
-
- Illustration d'un 'large choix' -
-
Sélectionner
-

vos produits en ligne

-
-
-
-
- Illustration des 'économies' -
-
-
- Illustration de 'pratique et rapide' -
-
Choisissez
-

votre créneau horaire

-
-
-
-
- Illustration de 'fraicheur et qualité' -
-
-
- Illustration de 'pratique et rapide' -
-
Retirez
-

votre commande

-
-
-
-
- - -
-
-
- Illustration d'un 'large choix' -
-
Un large choix
-

Des produits de qualité, des préparations variées, des quantités adaptées...

-
-
-
-
-
- Illustration des 'économies' -
-
Des économies
-

Profitez encore plus de nos produits gourmands en achetant en direct

-
-
-
-
-
- Illustration de 'pratique et rapide' -
-
Pratique et rapide
-

Quoi de mieux que la commande en ligne pour gagner du temps ?

-
-
-
-
-
- Illustration de 'fraicheur et qualité' -
-
Fraicheur & Qualité
-

Votre commande est préparée avec soin, dans le plus grand respect de la chaîne du froid

-
-
-
-
-
-
-@endsection diff --git a/resources/views/front/sable/icons/close.blade.php b/resources/views/front/sable/icons/close.blade.php deleted file mode 100644 index f8e0bee4..00000000 --- a/resources/views/front/sable/icons/close.blade.php +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/resources/views/front/sable/icons/orders.blade.php b/resources/views/front/sable/icons/orders.blade.php deleted file mode 100644 index 19c0e98f..00000000 --- a/resources/views/front/sable/icons/orders.blade.php +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - diff --git a/resources/views/front/sable/img/icons/icon_cart.png b/resources/views/front/sable/img/icons/icon_cart.png deleted file mode 100644 index c215ccbd..00000000 Binary files a/resources/views/front/sable/img/icons/icon_cart.png and /dev/null differ diff --git a/resources/views/front/sable/img/icons/step_2.png b/resources/views/front/sable/img/icons/step_2.png deleted file mode 100644 index 44ac3d61..00000000 Binary files a/resources/views/front/sable/img/icons/step_2.png and /dev/null differ diff --git a/resources/views/front/sable/img/icons/steps-arrow.png b/resources/views/front/sable/img/icons/steps-arrow.png deleted file mode 100644 index 7e65bb2f..00000000 Binary files a/resources/views/front/sable/img/icons/steps-arrow.png and /dev/null differ diff --git a/resources/views/front/sable/js/app.js b/resources/views/front/sable/js/app.js deleted file mode 100644 index 4199b8c0..00000000 --- a/resources/views/front/sable/js/app.js +++ /dev/null @@ -1,106 +0,0 @@ -import Axios from "axios"; -import Vue from "vue"; -import Vuex from "vuex"; -import VueContentPlaceholders from "vue-content-placeholders"; -import "../../../../../node_modules/@fortawesome/fontawesome-free/js/all.min.js"; -import CookieNotice from "@ldc-web/cookie-notice"; -import "./utilities/bootstrap"; -import "./utilities/swiper"; -import "./utilities/simplebar"; -import "./fo/common"; - -// COOKIES -window.CookieNotice = CookieNotice; - -Vue.use(VueContentPlaceholders); -Vue.component( - "filter-component", - require("./components/FilterComponent.vue").default -); - -Vue.use(Vuex); -Vue.component( - "timeslot-picker", - require("./components/TimeSlotPicker.vue").default -); -Vue.component("basket-panel", require("./components/BasketPanel.vue").default); -Vue.component("basket-counter", { - computed: { - count() { - return this.$store.state.cartTotals.countItems; - }, - }, - template: - '{{ count }}', -}); -Vue.component("basket-amount", { - computed: { - amount() { - return this.currencyFormatter( - this.$store.state.cartTotals.totalTTC - ); - }, - }, - methods: { - currencyFormatter(num) { - if (isNaN(num)) { - return num; - } - return new Intl.NumberFormat("fr-FR", { - style: "currency", - currency: "EUR", - }).format(num); - }, - }, - template: "{{ amount }}", -}); -Vue.component( - "basket-buttons", - require("./components/BasketButtons.vue").default -); -Vue.component("basket-recap", require("./components/BasketRecap.vue").default); - -const store = new Vuex.Store({ - state: { - panier: {}, - cartTotals: {}, - }, - mutations: { - Reload(state, payload) { - state.reload = payload.reload; - }, - updatePanier(state, payload) { - state.panier = payload.panier; - }, - updateCartTotals(state, payload) { - state.cartTotals = payload.cartTotals; - }, - }, -}); - -const metaCSRFToken = document.querySelector("meta[name='csrf-token']"); - -if (!metaCSRFToken) { - throw new Error("Missing meta CSRF token"); -} - -Axios.defaults.headers.common = { - Accept: "application/json, text/plain, */*", - "X-Requested-With": "XMLHttpRequest", - "X-CSRF-TOKEN": metaCSRFToken.getAttribute("content"), -}; - -window.axios = Axios; - -const app = new Vue({ - el: "#app", - store, - data: { - num: 1, //for the numeric stepper on product pages - }, - methods: { - addtocart(product, qtty) { - this.$refs.basketpanel.addtocart(product, qtty); - }, - }, -}); diff --git a/resources/views/front/sable/js/components/BasketButtons.vue b/resources/views/front/sable/js/components/BasketButtons.vue deleted file mode 100644 index 843f08af..00000000 --- a/resources/views/front/sable/js/components/BasketButtons.vue +++ /dev/null @@ -1,93 +0,0 @@ - - - - - diff --git a/resources/views/front/sable/js/components/BasketPanel.vue b/resources/views/front/sable/js/components/BasketPanel.vue deleted file mode 100644 index e1d79118..00000000 --- a/resources/views/front/sable/js/components/BasketPanel.vue +++ /dev/null @@ -1,196 +0,0 @@ - - - diff --git a/resources/views/front/sable/js/components/BasketRecap.vue b/resources/views/front/sable/js/components/BasketRecap.vue deleted file mode 100644 index a20364a6..00000000 --- a/resources/views/front/sable/js/components/BasketRecap.vue +++ /dev/null @@ -1,235 +0,0 @@ - - - diff --git a/resources/views/front/sable/js/components/FilterComponent.vue b/resources/views/front/sable/js/components/FilterComponent.vue deleted file mode 100644 index a578c4ea..00000000 --- a/resources/views/front/sable/js/components/FilterComponent.vue +++ /dev/null @@ -1,404 +0,0 @@ - - - diff --git a/resources/views/front/sable/js/components/TimeSlotPicker.vue b/resources/views/front/sable/js/components/TimeSlotPicker.vue deleted file mode 100644 index c0f05eeb..00000000 --- a/resources/views/front/sable/js/components/TimeSlotPicker.vue +++ /dev/null @@ -1,357 +0,0 @@ - - - diff --git a/resources/views/front/sable/js/fo/common.js b/resources/views/front/sable/js/fo/common.js deleted file mode 100644 index 33057b00..00000000 --- a/resources/views/front/sable/js/fo/common.js +++ /dev/null @@ -1,68 +0,0 @@ -window.showModalClearCart = function() { - $('#empty-basket-modal > div.modal').show(); -} - -window.closeModalClearCart = function() { - $('#empty-basket-modal > div.modal').hide(); -} - -document.addEventListener("DOMContentLoaded", function () { - /* ----- SALES ----- */ - var btnCross = document.querySelectorAll("#command .btn-cross"); - if (btnCross.length > 0) { - for (let i = 0 ; i < btnCross.length ; i ++) { - btnCross[i].addEventListener("click", () => { - console.log(btnCross[i].value) - axios.post('/ajax/remove-from-cart', { - rowId: btnCross[i].value, - instance: 'panier', - }).then( - (response) => { - location.reload() - } - ) - .catch(function (error) { - console.log(error); - this.response = "Erreur lors de la modification du panier."; - this.processing = false; - }); - }); - } - } - - /* ----- BASKET ----- */ - var basket = document.getElementById("basket"); - var basketBtn = document.querySelector("#navbar .btn-navbar"); - var basketCross = document.querySelector("#basket .icon-cross"); - - if (basket) - basket.addEventListener("click", (e) => { - var basketPreview = document.querySelector(".basket-preview"); - var basketEmpty = document.querySelector(".basket-empty") - if (basketEmpty.style.display == "none") { - if (e.clientX < basketPreview.offsetLeft || - e.clientX > (basketPreview.offsetLeft + basketPreview.clientWidth) || - e.clientY > (basketPreview.offsetTop + basketPreview.clientHeight)) { - showBasket(); - } - } - }) - - if (basketBtn) - basketBtn.addEventListener("click", showBasket); - if (basketCross) - basketCross.addEventListener("click", showBasket); - - function showBasket() { - basket.classList.toggle("basket-hidden"); - } - - /* ----- MENU ----- */ - var navCollapse = document.querySelector(".navbar-collapse"); - var navLink = navCollapse.querySelectorAll(".nav-link"); - navLink.forEach(element => { - element.addEventListener("click", () => { - navCollapse.classList.remove("show"); - }) - }); -}); diff --git a/resources/views/front/sable/js/utilities/bootstrap.js b/resources/views/front/sable/js/utilities/bootstrap.js deleted file mode 100644 index f866271d..00000000 --- a/resources/views/front/sable/js/utilities/bootstrap.js +++ /dev/null @@ -1,4 +0,0 @@ -import 'bootstrap'; - -window._ = require('lodash'); -window.$ = window.jQuery = require('jquery'); diff --git a/resources/views/front/sable/js/utilities/simplebar.js b/resources/views/front/sable/js/utilities/simplebar.js deleted file mode 100644 index d137498a..00000000 --- a/resources/views/front/sable/js/utilities/simplebar.js +++ /dev/null @@ -1 +0,0 @@ -import 'simplebar'; \ No newline at end of file diff --git a/resources/views/front/sable/js/utilities/swiper.js b/resources/views/front/sable/js/utilities/swiper.js deleted file mode 100644 index a2db0acb..00000000 --- a/resources/views/front/sable/js/utilities/swiper.js +++ /dev/null @@ -1,41 +0,0 @@ -import Swiper from 'swiper/swiper-bundle'; - -$(document).ready(function(){ - new Swiper("#home-slider .swiper-container", { - speed: 1000, - direction: "horizontal", - zoom: true, - loop: true, - navigation: { - nextEl: "#home-slider .swiper-button-next", - prevEl: "#home-slider .swiper-button-prev", - }, - keyboard: { - enabled: true, - onlyInViewport: false, - }, - autoplay: { - delay: 5000, - } - }); - - if (window.matchMedia("(min-width: 992px)").matches) { - var itemsPerView = 3; - } else { - var itemsPerView = 1; - } - new Swiper("#promotions .swiper-container", { - speed: 1000, - direction: "horizontal", - slidesPerView: itemsPerView, - zoom: true, - navigation: { - nextEl: "#promotions .swiper-button-next", - prevEl: "#promotions .swiper-button-prev", - }, - keyboard: { - enabled: true, - onlyInViewport: false, - } - }); -}); diff --git a/resources/views/front/sable/layouts/basket.blade.php b/resources/views/front/sable/layouts/basket.blade.php deleted file mode 100644 index aa44ef2c..00000000 --- a/resources/views/front/sable/layouts/basket.blade.php +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/resources/views/front/sable/layouts/footer.blade.php b/resources/views/front/sable/layouts/footer.blade.php deleted file mode 100644 index c0098696..00000000 --- a/resources/views/front/sable/layouts/footer.blade.php +++ /dev/null @@ -1,33 +0,0 @@ - diff --git a/resources/views/front/sable/layouts/head.blade.php b/resources/views/front/sable/layouts/head.blade.php deleted file mode 100644 index f220ae37..00000000 --- a/resources/views/front/sable/layouts/head.blade.php +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - {{ config('app.name') }} - @yield('title') - - - - - - - - - - - - - - - - - - - - - - - - - - - - @if(config('app.env') === 'local') - - @endif - - @include('breadcrumb.breadcrumb-head') - diff --git a/resources/views/front/sable/layouts/layout.blade.php b/resources/views/front/sable/layouts/layout.blade.php deleted file mode 100644 index 8f47e256..00000000 --- a/resources/views/front/sable/layouts/layout.blade.php +++ /dev/null @@ -1,23 +0,0 @@ -@include('layouts.head') - -parameter('filtersMenuIsOpen')) class="body-overflow" @endif> -
- @include('layouts.navbar') - - @include('layouts.basket') - - @include('partials.home-slider') - -
- @include('breadcrumb.breadcrumb-body') - @yield('content') -
- - @include('layouts.footer') -
- - @yield('scripts') - @include('vendor.cn-cookies') - - - diff --git a/resources/views/front/sable/layouts/navbar.blade.php b/resources/views/front/sable/layouts/navbar.blade.php deleted file mode 100644 index eda24d3b..00000000 --- a/resources/views/front/sable/layouts/navbar.blade.php +++ /dev/null @@ -1,58 +0,0 @@ - diff --git a/resources/views/front/sable/legal-notice.blade.php b/resources/views/front/sable/legal-notice.blade.php deleted file mode 100644 index 8529f38d..00000000 --- a/resources/views/front/sable/legal-notice.blade.php +++ /dev/null @@ -1,23 +0,0 @@ -@extends('layouts.layout') - -@section('title', __('Mentions légales & CGU')) -@section('description', 'Mentions légales et conditions générales d\'utilisations de la boutique.') - -@section('breadcrumb', 'no') - -@section('content') -
-
-
-

{{ $content->title }}

- @if ($content !== null) -
-
- {!! clean($content->value) !!} -
-
- @endif -
-
-
-@endsection diff --git a/resources/views/front/sable/mails/order-confirm.blade.php b/resources/views/front/sable/mails/order-confirm.blade.php deleted file mode 100644 index f7a5155c..00000000 --- a/resources/views/front/sable/mails/order-confirm.blade.php +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- -
- - - - - - - -
- - - - - - -
- -
-
-
Votre commande est enregistrée !
-
-
- -
-
- -
- - - - - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
Bonjour {{ $order->customer->salarie->prenom }} {{ Str::upper($order->customer->salarie->nom) }},

Votre commande {{ $order->reference }} est confirmée
-
- - - - - - - - @foreach ($order->lines as $line) - - - - - - - @endforeach -
ProduitQuantitéPrix kilo TTCTotal TTC
- {{ $line->product->name }}@if ($line->product->weight_variable)*@endif - {{ $line->quantity }} - @if ($line->product->weight_variable) @fmt_currency_without_auth($line->product->priceKgTtc) @endif - @fmt_currency_without_auth($line->total_ttc)
-
-
- Total estimé de la commande : @fmt_currency_without_auth($order->total) TTC -
-
-

*Produit vendu au kilo. Le prix sera recalculé en fonction du poids du produit livré lors de la remise de votre commande. - Le prix est donc susceptible de varier sur votre facture.

-
-

-

- -
-

-

- -
-
- A retirer le {{$order->timeslot->day}} à {{$order->timeslot->time}}, à l'adresse suivante :

- Mon point de retrait {{$magasin->name}}, {{$magasin->address}}, {{$magasin->postcode}} {{$magasin->city}} -
-
-

NB: Nous faisons le maximum pour vous livrer l'intégralité de votre commande, malheureusement certains produits peuvent - être en rupture. Vous ne serez pas facturé des produits non livrés.

-
-
-
L'équipe {{ config('theme.site_name') }}
-
-
- Pour toutes questions liées à votre commande, merci de contacter l'accueil par téléphone ou par notre rubrique contactez-nous -
-
-
- -
-
- -
- - - diff --git a/resources/views/front/sable/mails/order-status.blade.php b/resources/views/front/sable/mails/order-status.blade.php deleted file mode 100644 index bdb140b9..00000000 --- a/resources/views/front/sable/mails/order-status.blade.php +++ /dev/null @@ -1,328 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- -
- - - - - - - -
- - - - - - -
- -
-
-
Traitement de votre commande
-
-
- -
-
- -
- - - - - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @if (!empty($order->timeslot)) - - - - @endif - - - -
-
Bonjour,

Votre commande {{ $order->reference }} est {{ $order->status->label }}
-
-

-

- -
-
Détail de votre Commande :
-
- - - - - - - - @foreach ($order->lines as $line) - - - - - - - @endforeach -
ProduitQuantitéPrix kiloTotal
- {{ $line->product->name }}@if ($line->product->weight_variable)*@endif - {{ $line->quantity }} - @if ($line->product->weight_variable) @fmt_currency_without_auth($line->product->priceKgTtc) @endif - @fmt_currency_without_auth($line->total_ttc)
-
-

-

- -
-

*Produit vendu au kilo. Le prix sera recalculé en fonction du poids du produit livré lors de la remise de votre commande. - Le prix est donc susceptible de varier sur votre facture.

-
-

NB: Nous faisons le maximum pour vous livrer l'intégralité de votre commande, malheureusement certains produits peuvent - être en rupture. Vous ne serez pas facturé des produits non livrés.
- Pour toutes questions contactez-nous.

-
-

-

- -
-
- Total estimé de la commande : @fmt_currency_without_auth($order->total) TTC -
-
-

-

- -
-
- A retirer le {{$order->timeslot->day}} à {{$order->timeslot->time}}, à l’adresse suivante :

- Mon point de retrait {{$magasin->name}}, {{$magasin->address}}, {{$magasin->postcode}} {{$magasin->city}} -
-
-
-
L'équipe {{ config('theme.site_name') }}
-
-
- -
-
- -
- - - diff --git a/resources/views/front/sable/mails/password-reset.blade.php b/resources/views/front/sable/mails/password-reset.blade.php deleted file mode 100644 index 49b57911..00000000 --- a/resources/views/front/sable/mails/password-reset.blade.php +++ /dev/null @@ -1,218 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- -
- - - - - - - -
- - - - - - -
- -
-
-
Inscription {{ Config::get('theme.site_name') }}
-
-
- -
-
- -
- - - - - - -
- -
- - - - - - - - - - - - - -
-
Bonjour,

Pour réinitialiser votre mot de passe pour vous connecter à {{ Config::get('theme.site_name') }}, cliquez sur le lien suivant :
-
- - - - -
- Réinitialisez votre mot de passe -
-
-
Si le lien ci dessus ne fonctionne pas, veuillez entrer cette adresse dans votre navigateur :

- {{ route('auth.form-change-mdp', $token) }} -
-
-


L'équipe {{ config('theme.site_name') }}
-
-
- -
-
- -
- - - diff --git a/resources/views/front/sable/mails/register-ok.blade.php b/resources/views/front/sable/mails/register-ok.blade.php deleted file mode 100644 index ebf8b905..00000000 --- a/resources/views/front/sable/mails/register-ok.blade.php +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- -
- - - - - - - -
- - - - - - -
- -
-
-
Inscription {{ Config::get('theme.site_name') }}
-
-
- -
-
- -
- - - - - - -
- -
- - - - - - - - - - - - - -
-
Bonjour {{ $firstname !== null ? " " . $firstname : null }},

Vous venez de créer un compte sur {{ Config::get('theme.site_name') }}

Pour confirmer votre inscription, merci de confirmer votre email en cliquant sur le lien ci-dessous :
-
- - - - -
- Confirmer mon adresse email -
-
-
Si le lien ci dessus ne fonctionne pas, veuillez entrer cette adresse dans votre navigateur :

- {{ route('auth.activer', $customer->hashcode) }} -
-
-


L'équipe {{ config('theme.site_name') }}
-
-
- -
-
- -
- - - diff --git a/resources/views/front/sable/mails/send-contact.blade.php b/resources/views/front/sable/mails/send-contact.blade.php deleted file mode 100644 index 98987502..00000000 --- a/resources/views/front/sable/mails/send-contact.blade.php +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- -
- - - - - - - -
- - - - - - -
- -
-
-
Message Contact
-
-
- -
-
- -
- - - - - - -
- -
- - - - - - - - - - - - - -
-
Bonjour,

Voici un message envoyé depuis {{ config('theme.site_name', 'Boutique') }}

-
-

-

- -
-
Expediteur : {{ $data->first_name }} {{ $data->last_name }}

Email : {{ $data->email }}

Référence Commande : {{ $data->order_ref }}

Message :

- {{ $data->message }} -
-
-

L'équipe {{ config('theme.site_name') }}
-
-
- -
-
- -
- - - diff --git a/resources/views/front/sable/mails/send-csv.blade.php b/resources/views/front/sable/mails/send-csv.blade.php deleted file mode 100644 index 4e886be1..00000000 --- a/resources/views/front/sable/mails/send-csv.blade.php +++ /dev/null @@ -1,15 +0,0 @@ -@component('mail::message') - -
- -![{{ config('app.name') }}]({{ asset(config('app.theme') . "/img/logo.png") }}) - -
- -# {{ __('Bonjour :lastname :firstname', ['lastname' => $model->lastname, 'firstname' => $model->firstname]) }} - -{{ __("Vous venez de générer un fichier .csv suite à l'import de salariés, disponible en pièce jointe de cet email.") }} - -{{ config('app.name') }}. - -@endcomponent diff --git a/resources/views/front/sable/partials/home-slider.blade.php b/resources/views/front/sable/partials/home-slider.blade.php deleted file mode 100644 index c6971958..00000000 --- a/resources/views/front/sable/partials/home-slider.blade.php +++ /dev/null @@ -1,29 +0,0 @@ - -@if (Route::is('home')) - -@endif diff --git a/resources/views/front/sable/partials/tunnel-stepper.blade.php b/resources/views/front/sable/partials/tunnel-stepper.blade.php deleted file mode 100644 index 640440f8..00000000 --- a/resources/views/front/sable/partials/tunnel-stepper.blade.php +++ /dev/null @@ -1,23 +0,0 @@ -
-
-
1 ? "step-done" : "") }}"> -
- 1- -

Récapitulatif

-
-
-
2 ? "step-done" : "") }}"> -
- 2- -

Réservation

-
-
-
3 ? "step-done" : "") }}"> -
- 3- -

Confirmation

-
-
- {{ $activestep }}/3 -
-
diff --git a/resources/views/front/sable/privacy.blade.php b/resources/views/front/sable/privacy.blade.php deleted file mode 100644 index cf8c522a..00000000 --- a/resources/views/front/sable/privacy.blade.php +++ /dev/null @@ -1,23 +0,0 @@ -@extends('layouts.layout') - -@section('title', __('Politique de confidentialité')) -@section('description', 'Politique de confidentialité de la boutique.') - -@section('breadcrumb', 'no') - -@section('content') -
-
-
-

{{ $content->title }}

- @if ($content !== null) -
-
- {!! clean($content->value) !!} -
-
- @endif -
-
-
-@endsection diff --git a/resources/views/front/sable/product.blade.php b/resources/views/front/sable/product.blade.php deleted file mode 100644 index 797be0e5..00000000 --- a/resources/views/front/sable/product.blade.php +++ /dev/null @@ -1,182 +0,0 @@ -@extends('layouts.layout',['brParam' => $product]) - -@section('title', __('Produit spécifique')) -@section('description', 'Produit spécifique de la boutique.') - -@section('breadcrumb', request()->route()->getName()) - -@section('content') -
-
- -
-
-

bientôt disponible

- @if (isset($product->picture_large)) - - @elseif(isset($product->picture)) - - @else - - @endif -
-
- -
-
-

{{ $product->name }}

- {!! $product->description !!} - @if (!empty($product->foodProduct->preparation)) -

Conseil de préparation :

- {!! $product->foodProduct->preparation ?? '' !!} - @endif -
-

Poids moyen du produit : {{ $product->weight }} {{ $product->weight_unit }}

- @if ($product->weight_variable) -

Produit poids variable

- @endif -
-
-
- @if (isset($product->foodProduct->nutriscore)) - foodProduct->nutriscore . ".png") }}"> - @endif -
-
-
-

- @if ($product->weight_variable) Environ* @endif - @fmt_currency($product->discountedPriceTtc) - @if ($product->promotions->count() && $product->promotions()->first()->is_old_price_displayed) - @fmt_currency($product->priceTtc) - @endif - /{{ $product->sell_unit }} -

-
- @if( - Auth::guard('customer')->user() && - Auth::guard('customer')->user()->can('addToCart', $product) - ) - - @endif -
- @if ($product->weight_variable) -

*Produit vendu au kilo : @fmt_currency($product->priceKgTtc)/kg

- @else -

Prix au kilo : @fmt_currency($product->priceKgTtc)/kg

- @endif -
- -
- @if (!empty($product->foodProduct->ingredients)) -
- -
-
- {!! $product->foodProduct->ingredients ?? '' !!} - @if (!empty($product->foodProduct->allergens)) -

Allergenes : {{ $product->foodProduct->allergens }}

- @endif -
-
-
- @endif - @if (!empty($product->foodProduct->nv_kj )) -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Pour {{ $product->foodProduct->nv_ref_weight_g }}g
Énergie - {{ $product->foodProduct->nv_kj }} Kj
- {{ $product->foodProduct->nv_kcal }} Kcal
Matières Grasses
dont Acides Gras Saturés
{{ $product->foodProduct->nv_fat_g }} g
{{ $product->foodProduct->nv_sat_fat_g }} g
Glucides
dont sucres
{{ $product->foodProduct->nv_carb_g }} g
{{ $product->foodProduct->nv_sugar_g }} g
Fibres alimentaires{{ $product->foodProduct->nv_fiber_g }} g
Protéines{{ $product->foodProduct->nv_protein_g }} g
Sel{{ $product->foodProduct->nv_salt_g }} g
-

*Apports Quotidien de référence pour un adulte (8400kj/2000kcal).

-
-
-
- @endif - {{-- aucune fonctionnalité de recettes associées -
- -
-
- Voir la recette - Coucou c'est la recette ici ! -
-
-
- --}} - {{-- - en revanche il existe une fonctionnalité de produits associés - @if ($product->products->count()) - @include('partials.products-related') - @endif - --}} -
-
-
-@endsection diff --git a/resources/views/front/sable/ranges.blade.php b/resources/views/front/sable/ranges.blade.php deleted file mode 100644 index d315b69e..00000000 --- a/resources/views/front/sable/ranges.blade.php +++ /dev/null @@ -1,26 +0,0 @@ -@extends('layouts.layout') - -@section('title', __('Produits')) -@section('description', 'Liste complète des produits de la boutique.') - -@section('breadcrumb', request()->route()->getName()) - -@section('content') -
- @php - $dataComponent = [ - 'ranges' => $ranges, - 'brands' => $brands, - 'tags' => $tags, - 'products' => \App\Http\Resources\ProductResource::collection($products), - 'productsResults' => $products->perPage(), - 'productsCount' => $products->total(), - 'search' => $sessionFilter->search ?? '', - 'filters' => $sessionFilter, - 'filtersMenuIsOpen' => $filtersMenuIsOpen, - 'shouldDisplayPrices' => \App\Helpers\BladeDirectivesHelper::shouldShowPrices(), - ]; - @endphp - -
-@endsection diff --git a/resources/views/front/sable/sales/confirm.blade.php b/resources/views/front/sable/sales/confirm.blade.php deleted file mode 100644 index ac6b3b1f..00000000 --- a/resources/views/front/sable/sales/confirm.blade.php +++ /dev/null @@ -1,47 +0,0 @@ -@extends('layouts.layout') - -@section('title', __('Validation de commande')) -@section('description', 'Validation de votre commande.') - -@section('breadcrumb', 'no') - -@section('content') -
-
- @include('partials.tunnel-stepper') -
-

Confirmation

-

Votre commande est enregistrée !

-

Merci pour cette commande !

-

Une confirmation vient de vous être envoyée sur l'adresse mail {{ $order->customer->email }}

- - - - - - - - - @foreach ($order->lines as $line) - - - - - @endforeach - - - - - -
Rappel de votre commande ref: {{ $order->reference }} :
{{ $line->quantity }} x {{ $line->product->name }} :{{ $line->formattedTotalTtc }}
Total estimé : {{ $order->formattedTotalTtc }}
-

À retirer le {{ $order->timeslot->day }} à {{ $order->timeslot->time }}, à l'adresse suivante :

-

{{ $magasin->name }}

-

{{ $magasin->address }}

-

{{ $magasin->postcode }} {{ $magasin->city }}

- -
-
-
-@endsection diff --git a/resources/views/front/sable/sales/pick-slot.blade.php b/resources/views/front/sable/sales/pick-slot.blade.php deleted file mode 100644 index 310c98d2..00000000 --- a/resources/views/front/sable/sales/pick-slot.blade.php +++ /dev/null @@ -1,39 +0,0 @@ -@extends('layouts.layout',['brParam' => $order->reference]) - -@section('title', __('Réservation de commande')) -@section('description', 'Réservation de votre commande.') - -@section('breadcrumb', request()->route()->getName()) - -@section('content') -
-
- @include('partials.tunnel-stepper') -
- @csrf - @if ($errors->any()) -
- @foreach ($errors->all() as $error) -
{{ $error }}
- @endforeach -
- @elseif (session('success')) -
- {{ session('success') }} -
- @endif - - -
- - -
-
- -
-
-
-
-@endsection diff --git a/resources/views/front/sable/sales/recap.blade.php b/resources/views/front/sable/sales/recap.blade.php deleted file mode 100644 index 496e484f..00000000 --- a/resources/views/front/sable/sales/recap.blade.php +++ /dev/null @@ -1,26 +0,0 @@ -@extends('layouts.layout') - -@section('title', __('Recapitulatif de commande')) -@section('description', 'Recapitulatif de votre commande.') - -@section('breadcrumb', request()->route()->getName()) - -@section('content') -
-
- @if (\Session::has('message')) -
- {!! \Session::get('message') !!} -
- @endif - @include('partials.tunnel-stepper') -
-

- Récapitulatif de votre panier -

- -
-
-
-@endsection diff --git a/resources/views/front/sable/sass/app.scss b/resources/views/front/sable/sass/app.scss deleted file mode 100644 index d9f3118f..00000000 --- a/resources/views/front/sable/sass/app.scss +++ /dev/null @@ -1,28 +0,0 @@ -// LIBS -@import './vendor/bootstrap'; -@import './vendor/swiper'; -@import './vendor/simplebar'; -@import './vendor/fontawesome'; -@import './vendor/cookies'; - -// UTILITIES -@import './utilities/bs-custom'; -@import './utilities/variables'; -@import './utilities/mixins'; - -// BASE -@import './fo/base/fonts'; -@import './fo/base/common'; -@import './fo/base/utils'; - -// PARTIALS -@import './fo/partials/navbar'; -@import './fo/partials/footer'; -@import './fo/partials/basket'; -@import './fo/partials/calendar'; - -// PAGES -@import './fo/pages/home'; -@import './fo/pages/products'; -@import './fo/pages/ranges'; -@import './fo/pages/command'; diff --git a/resources/views/front/sable/sass/fo/base/_common.scss b/resources/views/front/sable/sass/fo/base/_common.scss deleted file mode 100644 index 4528aa14..00000000 --- a/resources/views/front/sable/sass/fo/base/_common.scss +++ /dev/null @@ -1,332 +0,0 @@ -* { - transition: .2s; -} - -body { - background-color: $light-grey; - font-family: 'Barlow_Regular', sans-serif; - font-weight: normal; - - &-overflow { - overflow: hidden; - } -} - -main { - min-height: calc(100vh - 5rem); -} - -img { - max-width: 100%; - height: auto; -} - -.filtre { - z-index: -1; - background-color: $white; - @include visibility(1, visible); -} - -.card { - &:hover { - .filtre { - background-color: $medium-grey; - @include visibility(1, visible); - } - - & .btn-product { - @include btn-hover($white, none, 2rem, $orange, $shadow); - } - } - - &-body { - min-height: 50%; - - .fst-italic { - font-size: .8em; - } - } - - &-text { - height: calc(1em * 1.5 * 2); - overflow: hidden; - text-overflow: ellipsis; - - p { - display: block; - display: -webkit-box; - max-width: 250px; - height: calc(1em * 1.5 * 2); - margin: 0; - font-size: 1em; - line-height: 1.5; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; - } - } - - &-activate { - .filtre, - .bkg-medium-grey { - background-color: $green !important; - } - - .filtre { - box-shadow: $shadow; - @include visibility(1, visible); - } - - &, - .card-price-new { - color: $white !important; - } - } - - &-available-soon { - .filtre, - .card-price, - .card-action { - display: none !important; - } - - img { - opacity: .5; - } - - .title-small { - display: block !important; - text-shadow: 0 0 10px $white, 0 0 10px $white, 0 0 10px $white, 0 0 10px $white; - z-index: 2; - } - } - - &-price { - &-new { - color: $dark; - margin: 0; - } - &-original { - &::after { - content: ''; - display: block; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%) rotate(-15deg); - width: 100%; - height: 1px; - background-color: $dark; - } - } - } - - &-action { - &-nutriscore { - width: 5rem; - } - } - - &-promotion { - .card-price-new { - color: $red; - margin-left: 1rem !important; - } - } -} - -.breadcrumb { - padding-left: 10rem !important; -} - -.form-check-input:checked { - background-color: $orange; - border-color: $orange; - background-image: none !important; -} - -.auth { - &-login { - form { - width: 100%; - max-width: 25rem; - - .form-control { - width: 20rem; - } - - img { - height: 5rem; - } - - textarea { - resize: none; - } - - select[name=day], - select[name=month] { - width: 30%; - } - - select[name=year] { - width: 40%; - } - } - - iframe { - height: 25rem !important; - } - } -} - -.contact { - &-content { - form { - width: 100%; - max-width: 25rem; - - .form-control { - width: 20rem; - } - - img { - height: 5rem; - } - - textarea { - resize: none; - } - } - } -} - -.pagination { - .page-link { - background-color: #f6c500; - border: 0; - color: $white; - &.active { - background-color: #81c56f !important; - } - } -} - -.accordion-button:not(.collapsed)::after { - background-image: var(--bs-accordion-btn-icon) !important; -} - -blockquote { - background-color: #909090; - padding: 1rem; - - p:last-child { - margin: 0; - } -} - -// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM -// SS:::::::::::::::SM:::::::M M:::::::M -// S:::::SSSSSS::::::SM::::::::M M::::::::M -// S:::::S SSSSSSSM:::::::::M M:::::::::M -// S:::::S M::::::::::M M::::::::::M -// S:::::S M:::::::::::M M:::::::::::M -// S::::SSSS M:::::::M::::M M::::M:::::::M -// SS::::::SSSSS M::::::M M::::M M::::M M::::::M -// SSS::::::::SS M::::::M M::::M::::M M::::::M -// SSSSSS::::S M::::::M M:::::::M M::::::M -// S:::::SM::::::M M:::::M M::::::M -// S:::::SM::::::M MMMMM M::::::M -// SSSSSSS S:::::SM::::::M M::::::M -// S::::::SSSSSS:::::SM::::::M M::::::M -// S:::::::::::::::SS M::::::M M::::::M -// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM -@include media-breakpoint-up(sm) { //576px - // -} -// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD -// M:::::::M M:::::::MD::::::::::::DDD -// M::::::::M M::::::::MD:::::::::::::::DD -// M:::::::::M M:::::::::MDDD:::::DDDDD:::::D -// M::::::::::M M::::::::::M D:::::D D:::::D -// M:::::::::::M M:::::::::::M D:::::D D:::::D -// M:::::::M::::M M::::M:::::::M D:::::D D:::::D -// M::::::M M::::M M::::M M::::::M D:::::D D:::::D -// M::::::M M::::M::::M M::::::M D:::::D D:::::D -// M::::::M M:::::::M M::::::M D:::::D D:::::D -// M::::::M M:::::M M::::::M D:::::D D:::::D -// M::::::M MMMMM M::::::M D:::::D D:::::D -// M::::::M M::::::MDDD:::::DDDDD:::::D -// M::::::M M::::::MD:::::::::::::::DD -// M::::::M M::::::MD::::::::::::DDD -// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD -@include media-breakpoint-up(md) { //768px - // -} -// LLLLLLLLLLL GGGGGGGGGGGGG -// L:::::::::L GGG::::::::::::G -// L:::::::::L GG:::::::::::::::G -// LL:::::::LL G:::::GGGGGGGG::::G -// L:::::L G:::::G GGGGGG -// L:::::L G:::::G -// L:::::L G:::::G -// L:::::L G:::::G GGGGGGGGGG -// L:::::L G:::::G G::::::::G -// L:::::L G:::::G GGGGG::::G -// L:::::L G:::::G G::::G -// L:::::L LLLLLL G:::::G G::::G -// LL:::::::LLLLLLLLL:::::L G:::::GGGGGGGG::::G -// L::::::::::::::::::::::L GG:::::::::::::::G -// L::::::::::::::::::::::L GGG::::::GGG:::G -// LLLLLLLLLLLLLLLLLLLLLLLL GGGGGG GGGG -@include media-breakpoint-up(lg) { //992px - .body-overflow { - overflow: auto; - } - - main { - min-height: calc(100vh - (8rem + 7rem)); - } - - .filtre { - @include visibility(0, hidden); - } -} -// XXXXXXX XXXXXXXLLLLLLLLLLL -// X:::::X X:::::XL:::::::::L -// X:::::X X:::::XL:::::::::L -// X::::::X X::::::XLL:::::::LL -// XXX:::::X X:::::XXX L:::::L -// X:::::X X:::::X L:::::L -// X:::::X:::::X L:::::L -// X:::::::::X L:::::L -// X:::::::::X L:::::L -// X:::::X:::::X L:::::L -// X:::::X X:::::X L:::::L -// XXX:::::X X:::::XXX L:::::L LLLLLL -// X::::::X X::::::XLL:::::::LLLLLLLLL:::::L -// X:::::X X:::::XL::::::::::::::::::::::L -// X:::::X X:::::XL::::::::::::::::::::::L -// XXXXXXX XXXXXXXLLLLLLLLLLLLLLLLLLLLLLLL -@include media-breakpoint-up(xl) { //1200px - // -} -// XXXXXXX XXXXXXXXXXXXXX XXXXXXXLLLLLLLLLLL -// X:::::X X:::::XX:::::X X:::::XL:::::::::L -// X:::::X X:::::XX:::::X X:::::XL:::::::::L -// X::::::X X::::::XX::::::X X::::::XLL:::::::LL -// XXX:::::X X:::::XXXXXX:::::X X:::::XXX L:::::L -// X:::::X X:::::X X:::::X X:::::X L:::::L -// X:::::X:::::X X:::::X:::::X L:::::L -// X:::::::::X X:::::::::X L:::::L -// X:::::::::X X:::::::::X L:::::L -// X:::::X:::::X X:::::X:::::X L:::::L -// X:::::X X:::::X X:::::X X:::::X L:::::L -// XXX:::::X X:::::XXXXXX:::::X X:::::XXX L:::::L LLLLLL -// X::::::X X::::::XX::::::X X::::::XLL:::::::LLLLLLLLL:::::L -// X:::::X X:::::XX:::::X X:::::XL::::::::::::::::::::::L -// X:::::X X:::::XX:::::X X:::::XL::::::::::::::::::::::L -// XXXXXXX XXXXXXXXXXXXXX XXXXXXXLLLLLLLLLLLLLLLLLLLLLLLL -@include media-breakpoint-up(xxl) { //1400px - // -} diff --git a/resources/views/front/sable/sass/fo/base/_fonts.scss b/resources/views/front/sable/sass/fo/base/_fonts.scss deleted file mode 100644 index f170b399..00000000 --- a/resources/views/front/sable/sass/fo/base/_fonts.scss +++ /dev/null @@ -1,61 +0,0 @@ -@font-face { - font-family: "Barlow_Extra_Bold"; - font-style: normal; - font-weight: normal; - src: url("../fonts/barlow/Barlow-ExtraBold.ttf") format("truetype"); -} - -@font-face { - font-family: "Barlow_Regular"; - font-style: normal; - font-weight: normal; - src: url("../fonts/barlow/Barlow-Regular.ttf") format("truetype"); -} - -@font-face { - font-family: "Barlow_Bold"; - font-style: normal; - font-weight: normal; - src: - url("../fonts/barlow/Barlow-Bold.woff2") format("ttf"), - url("../fonts/barlow/Barlow-Bold.woff") format("woff"), - url("../fonts/barlow/Barlow-Bold.ttf") format("ttf"), - url("../fonts/barlow/Barlow-Bold.svg") format("svg"), - url("../fonts/barlow/Barlow-Bold.eot") format("eot"); -} - -@font-face { - font-family: "Barlow_Condensed_Medium"; - font-style: normal; - font-weight: normal; - src: - url("../fonts/barlow/BarlowCondensed-Medium.woff2") format("ttf"), - url("../fonts/barlow/BarlowCondensed-Medium.woff") format("woff"), - url("../fonts/barlow/BarlowCondensed-Medium.ttf") format("ttf"), - url("../fonts/barlow/BarlowCondensed-Medium.svg") format("svg"), - url("../fonts/barlow/BarlowCondensed-Medium.eot") format("eot"); -} - -@font-face { - font-family: "Barlow_Condensed_Semi_Bold"; - font-style: normal; - font-weight: normal; - src: - url("../fonts/barlow/BarlowCondensed-SemiBold.woff2") format("ttf"), - url("../fonts/barlow/BarlowCondensed-SemiBold.woff") format("woff"), - url("../fonts/barlow/BarlowCondensed-SemiBold.ttf") format("ttf"), - url("../fonts/barlow/BarlowCondensed-SemiBold.svg") format("svg"), - url("../fonts/barlow/BarlowCondensed-SemiBold.eot") format("eot"); -} - -@font-face { - font-family: "Barlow_Medium"; - font-style: normal; - font-weight: normal; - src: - url("../fonts/barlow/Barlow-Medium.woff2") format("ttf"), - url("../fonts/barlow/Barlow-Medium.woff") format("woff"), - url("../fonts/barlow/Barlow-Medium.ttf") format("ttf"), - url("../fonts/barlow/Barlow-Medium.svg") format("svg"), - url("../fonts/barlow/Barlow-Medium.eot") format("eot"); -} diff --git a/resources/views/front/sable/sass/fo/base/_utils.scss b/resources/views/front/sable/sass/fo/base/_utils.scss deleted file mode 100644 index 01f7e450..00000000 --- a/resources/views/front/sable/sass/fo/base/_utils.scss +++ /dev/null @@ -1,274 +0,0 @@ -// Fonts. -.font-Barlow-extra-bold { - font-family: 'Barlow_Extra_Bold'; -} - -.font-Barlow-regular { - font-family: 'Barlow_Regular'; -} - -.font-Barlow-bold { - font-family: 'Barlow_Bold'; -} - -.font-Barlow-condensed-medium { - font-family: 'Barlow_Condensed_Medium'; -} - -.font-Barlow-condensed-semi-bold { - font-family: 'Barlow_Condensed_Semi_Bold'; -} - -.font-Barlow-medium { - font-family: 'Barlow_Medium'; -} - -// Titles. -.title-big { - font-size: 2em; -} - -.title-medium { - font-size: 1em; -} - -.title-small { - font-size: 1em; -} - -// Text. -.text-white { - color: $white; -} - -.text-dark { - color: $white; -} - -.text-green { - color: $green !important; -} - -.text-grey { - color: $grey; -} - -.text-red { - color: $red; -} - -// Background. -.bkg-white { - background-color: $white; -} - -.bkg-medium-grey { - background-color: $medium-grey; -} - -.bkg-orange { - background-color: $orange; -} - -.bkg-dark { - background-color: $dark; -} - -// Buttons. -.btn-product { - @include btn($white, none, $orange); -} - -.btn-more-products svg { - height: 2rem; -} - -.btn-section { - margin-top: 1rem; - @include btn($dark, 1px solid $dark, transparent); -} - -.btn-basket { - width: 4rem; - height: 2.5rem; - z-index: 50; -} - -// Icons. -.icon-medium { - width: 2.5rem; - height: 2.5rem; -} - -.icon-small { - width: 2rem; - height: 2rem; -} - -.icon-cart-dark { - background-image: url('../img/icons/icon_cart.png'); - @include backgroundImg; -} - -.icon-cart-white { - background-image: url('../img/icons/icon_cart_white.png'); - @include backgroundImg; -} -.icon-cross { - background-image: url('../img/icons/form_fail.png'); - @include backgroundImg; -} - -.basket-icon { - width: 5rem; - height: 5rem; -} - -// Others. -.svg { - width: 1rem; - height: 1rem; - fill: $dark; -} - -.shadow { - box-shadow: $shadow !important; -} - -// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM -// SS:::::::::::::::SM:::::::M M:::::::M -// S:::::SSSSSS::::::SM::::::::M M::::::::M -// S:::::S SSSSSSSM:::::::::M M:::::::::M -// S:::::S M::::::::::M M::::::::::M -// S:::::S M:::::::::::M M:::::::::::M -// S::::SSSS M:::::::M::::M M::::M:::::::M -// SS::::::SSSSS M::::::M M::::M M::::M M::::::M -// SSS::::::::SS M::::::M M::::M::::M M::::::M -// SSSSSS::::S M::::::M M:::::::M M::::::M -// S:::::SM::::::M M:::::M M::::::M -// S:::::SM::::::M MMMMM M::::::M -// SSSSSSS S:::::SM::::::M M::::::M -// S::::::SSSSSS:::::SM::::::M M::::::M -// S:::::::::::::::SS M::::::M M::::::M -// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM -@include media-breakpoint-up(sm) { //576px - .title-big { - font-size: 5em; - } - - .title-medium, .title-sm-medium { - font-size: 2em; - } - - .title-small { - font-size: 1.5em; - } -} -// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD -// M:::::::M M:::::::MD::::::::::::DDD -// M::::::::M M::::::::MD:::::::::::::::DD -// M:::::::::M M:::::::::MDDD:::::DDDDD:::::D -// M::::::::::M M::::::::::M D:::::D D:::::D -// M:::::::::::M M:::::::::::M D:::::D D:::::D -// M:::::::M::::M M::::M:::::::M D:::::D D:::::D -// M::::::M M::::M M::::M M::::::M D:::::D D:::::D -// M::::::M M::::M::::M M::::::M D:::::D D:::::D -// M::::::M M:::::::M M::::::M D:::::D D:::::D -// M::::::M M:::::M M::::::M D:::::D D:::::D -// M::::::M MMMMM M::::::M D:::::D D:::::D -// M::::::M M::::::MDDD:::::DDDDD:::::D -// M::::::M M::::::MD:::::::::::::::DD -// M::::::M M::::::MD::::::::::::DDD -// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD -@include media-breakpoint-up(md) { //768px - .title-big { - font-size: 7em; - } - - .title-medium, .title-sm-medium { - font-size: 1.5em; - } -} -// LLLLLLLLLLL GGGGGGGGGGGGG -// L:::::::::L GGG::::::::::::G -// L:::::::::L GG:::::::::::::::G -// LL:::::::LL G:::::GGGGGGGG::::G -// L:::::L G:::::G GGGGGG -// L:::::L G:::::G -// L:::::L G:::::G -// L:::::L G:::::G GGGGGGGGGG -// L:::::L G:::::G G::::::::G -// L:::::L G:::::G GGGGG::::G -// L:::::L G:::::G G::::G -// L:::::L LLLLLL G:::::G G::::G -// LL:::::::LLLLLLLLL:::::L G:::::GGGGGGGG::::G -// L::::::::::::::::::::::L GG:::::::::::::::G -// L::::::::::::::::::::::L GGG::::::GGG:::G -// LLLLLLLLLLLLLLLLLLLLLLLL GGGGGG GGGG -@include media-breakpoint-up(lg) { //992px - .title-big { - font-size: 7em; - } - - .title-medium, .title-sm-medium { - font-size: 2em; - } -} -// XXXXXXX XXXXXXXLLLLLLLLLLL -// X:::::X X:::::XL:::::::::L -// X:::::X X:::::XL:::::::::L -// X::::::X X::::::XLL:::::::LL -// XXX:::::X X:::::XXX L:::::L -// X:::::X X:::::X L:::::L -// X:::::X:::::X L:::::L -// X:::::::::X L:::::L -// X:::::::::X L:::::L -// X:::::X:::::X L:::::L -// X:::::X X:::::X L:::::L -// XXX:::::X X:::::XXX L:::::L LLLLLL -// X::::::X X::::::XLL:::::::LLLLLLLLL:::::L -// X:::::X X:::::XL::::::::::::::::::::::L -// X:::::X X:::::XL::::::::::::::::::::::L -// XXXXXXX XXXXXXXLLLLLLLLLLLLLLLLLLLLLLLL -@include media-breakpoint-up(xl) { //1200px - .title-medium, .title-sm-medium { - font-size: 3em; - } - - .title-small { - font-size: 1em; - } -} -// XXXXXXX XXXXXXXXXXXXXX XXXXXXXLLLLLLLLLLL -// X:::::X X:::::XX:::::X X:::::XL:::::::::L -// X:::::X X:::::XX:::::X X:::::XL:::::::::L -// X::::::X X::::::XX::::::X X::::::XLL:::::::LL -// XXX:::::X X:::::XXXXXX:::::X X:::::XXX L:::::L -// X:::::X X:::::X X:::::X X:::::X L:::::L -// X:::::X:::::X X:::::X:::::X L:::::L -// X:::::::::X X:::::::::X L:::::L -// X:::::::::X X:::::::::X L:::::L -// X:::::X:::::X X:::::X:::::X L:::::L -// X:::::X X:::::X X:::::X X:::::X L:::::L -// XXX:::::X X:::::XXXXXX:::::X X:::::XXX L:::::L LLLLLL -// X::::::X X::::::XX::::::X X::::::XLL:::::::LLLLLLLLL:::::L -// X:::::X X:::::XX:::::X X:::::XL::::::::::::::::::::::L -// X:::::X X:::::XX:::::X X:::::XL::::::::::::::::::::::L -// XXXXXXX XXXXXXXXXXXXXX XXXXXXXLLLLLLLLLLLLLLLLLLLLLLLL -@include media-breakpoint-up(xxl) { //1400px - .title-big { - font-size: 10em; - } - - .title-medium, .title-sm-medium { - font-size: 4em; - } - - .title-regular { - font-size: 2em; - } - - .title-small { - font-size: 1.5em; - } -} diff --git a/resources/views/front/sable/sass/fo/pages/_command.scss b/resources/views/front/sable/sass/fo/pages/_command.scss deleted file mode 100644 index 104d3c3b..00000000 --- a/resources/views/front/sable/sass/fo/pages/_command.scss +++ /dev/null @@ -1,131 +0,0 @@ -#command { - .order { - background-color: $medium-grey; - z-index: 100; - - .col-10:not(.active) { - display: none; - } - - .active { - color: $dark; - font-family: 'Barlow_Extra_Bold'; - font-size: 2em; - text-align: center; - text-transform: uppercase; - } - - .col-2 { - font-size: 1.5em; - } - } - - .timeslot-container .card-text { - height: initial; - overflow: initial; - text-overflow: initial; - } - - .table { - border-collapse: separate; - border-spacing: 0 0.5rem; - - &-total { - font-size: 1.5em; - font-family: 'Barlow_Extra_Bold'; - background-color: $white; - position: sticky; - top: 8rem; - z-index: 100; - } - - .btn-cross { - right: .5rem; - top: .5rem; - z-index: 1; - } - } - - .recap-actions { - width: calc(100% - 2rem); - z-index: $zindex-fixed; - } -} - -// LLLLLLLLLLL GGGGGGGGGGGGG -// L:::::::::L GGG::::::::::::G -// L:::::::::L GG:::::::::::::::G -// LL:::::::LL G:::::GGGGGGGG::::G -// L:::::L G:::::G GGGGGG -// L:::::L G:::::G -// L:::::L G:::::G -// L:::::L G:::::G GGGGGGGGGG -// L:::::L G:::::G G::::::::G -// L:::::L G:::::G GGGGG::::G -// L:::::L G:::::G G::::G -// L:::::L LLLLLL G:::::G G::::G -// LL:::::::LLLLLLLLL:::::L G:::::GGGGGGGG::::G -// L::::::::::::::::::::::L GG:::::::::::::::G -// L::::::::::::::::::::::L GGG::::::GGG:::G -// LLLLLLLLLLLLLLLLLLLLLLLL GGGGGG GGGG -@include media-breakpoint-up(lg) { - - //992px - #command { - .order { - background-color: transparent; - - .col-10:not(.active) { - display: block; - } - - .active, - .col-2 { - font-family: 'Barlow_Regular'; - font-size: 1em; - } - - .col-2 { - font-family: 'Barlow_Bold'; - } - - .active { - color: $green; - text-align: left; - text-transform: capitalize; - } - } - - .table { - border-collapse: collapse; - background-color: transparent; - - td.text-center { - width: 15%; - } - - .card:hover .filtre { - background-color: transparent; - } - - .btn-cross { - top: 50%; - left: 100%; - transform: translateY(-50%); - } - - &-total { - font-size: 1em; - position: initial; - - td:not(.font-Barlow-extra-bold) { - font-family: 'Barlow_Regular'; - } - } - } - - .recap-actions { - bottom: auto; - } - } -} diff --git a/resources/views/front/sable/sass/fo/pages/_home.scss b/resources/views/front/sable/sass/fo/pages/_home.scss deleted file mode 100644 index 06b96289..00000000 --- a/resources/views/front/sable/sass/fo/pages/_home.scss +++ /dev/null @@ -1,199 +0,0 @@ -#home-slider { - background-color: $orange; - - .swiper { - &-container { - overflow: hidden; - } - } -} - -#hidden-ranges-description { - display: none; -} - -#promotions, -#rayons, -#services { - scroll-margin-top: 8rem; - padding: 2rem 0; -} - -#promotions { - overflow: hidden; - - .swiper { - &-container { - max-width: 18rem; - margin: 0 auto 0 0 !important; - overflow: visible; - } - - &-slide { - height: 30rem !important; - } - - &-button-next { - right: 0; - } - - &-button-prev { - left: 0; - } - } -} - -#rayons { - .row-cols-2 .row { - .filtre { - @include visibility(1, visible); - } - - &:hover { - background-color: transparent; - - .filtre { - background-color: $medium-grey; - } - } - } -} - -#services { - #avantages { - .card { - .card-img-top { - width: 30%; - } - - .card-body { - width: 70%; - } - } - } -} - -// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD -// M:::::::M M:::::::MD::::::::::::DDD -// M::::::::M M::::::::MD:::::::::::::::DD -// M:::::::::M M:::::::::MDDD:::::DDDDD:::::D -// M::::::::::M M::::::::::M D:::::D D:::::D -// M:::::::::::M M:::::::::::M D:::::D D:::::D -// M:::::::M::::M M::::M:::::::M D:::::D D:::::D -// M::::::M M::::M M::::M M::::::M D:::::D D:::::D -// M::::::M M::::M::::M M::::::M D:::::D D:::::D -// M::::::M M:::::::M M::::::M D:::::D D:::::D -// M::::::M M:::::M M::::::M D:::::D D:::::D -// M::::::M MMMMM M::::::M D:::::D D:::::D -// M::::::M M::::::MDDD:::::DDDDD:::::D -// M::::::M M::::::MD:::::::::::::::DD -// M::::::M M::::::MD::::::::::::DDD -// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD -@include media-breakpoint-up(md) { //768px - #hidden-ranges-description { - display: inline-block; - } - #home-slider { - .swiper-button-next, - .swiper-button-prev { - width: 3rem; - height: 3rem; - background-color: $light-orange; - - &::after { - font-size: 2em; - color: $white; - } - } - } - - #promotions, - #rayons, - #services { - scroll-margin-top: 5rem; - } - - #rayons { - .row-cols-2 .row { - &:hover { - background-color: $medium-grey; - - & .btn-product { - @include btn-hover($white, none, 2rem, $orange, $shadow); - } - } - - .filtre { - @include visibility(0, hidden); - } - } - - #arrow-down { - transform: rotate(180deg); - } - } - #services { - #demarche { - .d-md-block { - height: 8rem; - } - - .card-body { - min-height: 5rem; - } - } - } -} -// LLLLLLLLLLL GGGGGGGGGGGGG -// L:::::::::L GGG::::::::::::G -// L:::::::::L GG:::::::::::::::G -// LL:::::::LL G:::::GGGGGGGG::::G -// L:::::L G:::::G GGGGGG -// L:::::L G:::::G -// L:::::L G:::::G -// L:::::L G:::::G GGGGGGGGGG -// L:::::L G:::::G G::::::::G -// L:::::L G:::::G GGGGG::::G -// L:::::L G:::::G G::::G -// L:::::L LLLLLL G:::::G G::::G -// LL:::::::LLLLLLLLL:::::L G:::::GGGGGGGG::::G -// L::::::::::::::::::::::L GG:::::::::::::::G -// L::::::::::::::::::::::L GGG::::::GGG:::G -// LLLLLLLLLLLLLLLLLLLLLLLL GGGGGG GGGG -@include media-breakpoint-up(lg) { //992px - #promotions { - .swiper { - &-container { - max-width: 100%; - } - - &-slide { - .row { - max-width: 20rem !important; - } - } - - &-button { - &-next, &-prev { - width: 2rem; - height: 2rem; - background-color: $orange; - - &::after { - color: $white; - font-size: 1em; - } - } - - &-disabled { - border: 1px solid $grey; - background-color: transparent; - - &::after { - color: $grey !important; - } - } - } - } - } -} diff --git a/resources/views/front/sable/sass/fo/pages/_products.scss b/resources/views/front/sable/sass/fo/pages/_products.scss deleted file mode 100644 index 1d7ee27c..00000000 --- a/resources/views/front/sable/sass/fo/pages/_products.scss +++ /dev/null @@ -1,152 +0,0 @@ -#product { - .card-action { - bottom: 0; - left: 0; - width: 100%; - height: 4rem; - background-color: $white; - z-index: 5; - } - - .product-title { - font-family: 'Barlow_Extra_Bold'; - top: 5rem; - left: 0; - width: 100%; - background-color: $medium-grey; - padding: 1rem 0; - text-transform: uppercase; - z-index: 1; - } -} - -// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM -// SS:::::::::::::::SM:::::::M M:::::::M -// S:::::SSSSSS::::::SM::::::::M M::::::::M -// S:::::S SSSSSSSM:::::::::M M:::::::::M -// S:::::S M::::::::::M M::::::::::M -// S:::::S M:::::::::::M M:::::::::::M -// S::::SSSS M:::::::M::::M M::::M:::::::M -// SS::::::SSSSS M::::::M M::::M M::::M M::::::M -// SSS::::::::SS M::::::M M::::M::::M M::::::M -// SSSSSS::::S M::::::M M:::::::M M::::::M -// S:::::SM::::::M M:::::M M::::::M -// S:::::SM::::::M MMMMM M::::::M -// SSSSSSS S:::::SM::::::M M::::::M -// S::::::SSSSSS:::::SM::::::M M::::::M -// S:::::::::::::::SS M::::::M M::::::M -// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM -@include media-breakpoint-up(sm) { //576px - // -} -// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD -// M:::::::M M:::::::MD::::::::::::DDD -// M::::::::M M::::::::MD:::::::::::::::DD -// M:::::::::M M:::::::::MDDD:::::DDDDD:::::D -// M::::::::::M M::::::::::M D:::::D D:::::D -// M:::::::::::M M:::::::::::M D:::::D D:::::D -// M:::::::M::::M M::::M:::::::M D:::::D D:::::D -// M::::::M M::::M M::::M M::::::M D:::::D D:::::D -// M::::::M M::::M::::M M::::::M D:::::D D:::::D -// M::::::M M:::::::M M::::::M D:::::D D:::::D -// M::::::M M:::::M M::::::M D:::::D D:::::D -// M::::::M MMMMM M::::::M D:::::D D:::::D -// M::::::M M::::::MDDD:::::DDDDD:::::D -// M::::::M M::::::MD:::::::::::::::DD -// M::::::M M::::::MD::::::::::::DDD -// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD -@include media-breakpoint-up(md) { //768px - // -} -// LLLLLLLLLLL GGGGGGGGGGGGG -// L:::::::::L GGG::::::::::::G -// L:::::::::L GG:::::::::::::::G -// LL:::::::LL G:::::GGGGGGGG::::G -// L:::::L G:::::G GGGGGG -// L:::::L G:::::G -// L:::::L G:::::G -// L:::::L G:::::G GGGGGGGGGG -// L:::::L G:::::G G::::::::G -// L:::::L G:::::G GGGGG::::G -// L:::::L G:::::G G::::G -// L:::::L LLLLLL G:::::G G::::G -// LL:::::::LLLLLLLLL:::::L G:::::GGGGGGGG::::G -// L::::::::::::::::::::::L GG:::::::::::::::G -// L::::::::::::::::::::::L GGG::::::GGG:::G -// LLLLLLLLLLLLLLLLLLLLLLLL GGGGGG GGGG -@include media-breakpoint-up(lg) { //992px - #product { - #list { - padding-bottom: 1rem; - background-color: transparent; - - .btn { - padding-right: 2rem; - - &:not(:nth-child(1)) { - margin-top: 1rem; - } - } - - .btn-product[aria-expanded=true] .icon-arrow { - transform: rotate(180deg); - } - } - - .card-action { - background-color: transparent; - - &-nutriscore:nth-child(1) { - margin-left: 0 !important; - } - } - - .product-title { - top: 0; - background-color: transparent; - text-transform: inherit; - - &::first-letter { - text-transform: capitalize; - } - } - } -} -// XXXXXXX XXXXXXXLLLLLLLLLLL -// X:::::X X:::::XL:::::::::L -// X:::::X X:::::XL:::::::::L -// X::::::X X::::::XLL:::::::LL -// XXX:::::X X:::::XXX L:::::L -// X:::::X X:::::X L:::::L -// X:::::X:::::X L:::::L -// X:::::::::X L:::::L -// X:::::::::X L:::::L -// X:::::X:::::X L:::::L -// X:::::X X:::::X L:::::L -// XXX:::::X X:::::XXX L:::::L LLLLLL -// X::::::X X::::::XLL:::::::LLLLLLLLL:::::L -// X:::::X X:::::XL::::::::::::::::::::::L -// X:::::X X:::::XL::::::::::::::::::::::L -// XXXXXXX XXXXXXXLLLLLLLLLLLLLLLLLLLLLLLL -@include media-breakpoint-up(xl) { //1200px - // -} -// XXXXXXX XXXXXXXXXXXXXX XXXXXXXLLLLLLLLLLL -// X:::::X X:::::XX:::::X X:::::XL:::::::::L -// X:::::X X:::::XX:::::X X:::::XL:::::::::L -// X::::::X X::::::XX::::::X X::::::XLL:::::::LL -// XXX:::::X X:::::XXXXXX:::::X X:::::XXX L:::::L -// X:::::X X:::::X X:::::X X:::::X L:::::L -// X:::::X:::::X X:::::X:::::X L:::::L -// X:::::::::X X:::::::::X L:::::L -// X:::::::::X X:::::::::X L:::::L -// X:::::X:::::X X:::::X:::::X L:::::L -// X:::::X X:::::X X:::::X X:::::X L:::::L -// XXX:::::X X:::::XXXXXX:::::X X:::::XXX L:::::L LLLLLL -// X::::::X X::::::XX::::::X X::::::XLL:::::::LLLLLLLLL:::::L -// X:::::X X:::::XX:::::X X:::::XL::::::::::::::::::::::L -// X:::::X X:::::XX:::::X X:::::XL::::::::::::::::::::::L -// XXXXXXX XXXXXXXXXXXXXX XXXXXXXLLLLLLLLLLLLLLLLLLLLLLLL -@include media-breakpoint-up(xxl) { //1400px - // -} diff --git a/resources/views/front/sable/sass/fo/pages/_ranges.scss b/resources/views/front/sable/sass/fo/pages/_ranges.scss deleted file mode 100644 index 3bc58d85..00000000 --- a/resources/views/front/sable/sass/fo/pages/_ranges.scss +++ /dev/null @@ -1,221 +0,0 @@ -#ranges { - .filters { - top: 0; - left: 0; - background-color: $light-grey; - z-index: 210; - transform: translateX(100%); - height: 100%; - - &-title { - text-transform: uppercase; - font-family: 'Barlow_Extra_Bold'; - background-color: $medium-grey; - } - - &-btn { - border-bottom: 2px solid $dark !important; - } - - &-show { - transform: translateX(0); - } - - &-list { - overflow-y: scroll; - height: 100%; - } - - .title-small { - font-size: 2em; - } - - button svg { - transform: rotate(-90deg); - } - - .form-check { - background-color: $medium-grey; - font-size: 2em; - } - } - - .filter-btn { - height: 4rem; - z-index: 100; - - img { - width: auto; - height: 1.5rem; - } - - .number { - width: 2rem; - height: 2rem; - font-size: 0.5em; - } - - &:hover, - &:focus { - background-color: $orange; - } - } - - .btn-results, .filter-btn { - font-size: 2em; - } - - .btn-results { - background-color: $orange !important; - } -} - -// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM -// SS:::::::::::::::SM:::::::M M:::::::M -// S:::::SSSSSS::::::SM::::::::M M::::::::M -// S:::::S SSSSSSSM:::::::::M M:::::::::M -// S:::::S M::::::::::M M::::::::::M -// S:::::S M:::::::::::M M:::::::::::M -// S::::SSSS M:::::::M::::M M::::M:::::::M -// SS::::::SSSSS M::::::M M::::M M::::M M::::::M -// SSS::::::::SS M::::::M M::::M::::M M::::::M -// SSSSSS::::S M::::::M M:::::::M M::::::M -// S:::::SM::::::M M:::::M M::::::M -// S:::::SM::::::M MMMMM M::::::M -// SSSSSSS S:::::SM::::::M M::::::M -// S::::::SSSSSS:::::SM::::::M M::::::M -// S:::::::::::::::SS M::::::M M::::::M -// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM -@include media-breakpoint-up(sm) { //576px - // -} -// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD -// M:::::::M M:::::::MD::::::::::::DDD -// M::::::::M M::::::::MD:::::::::::::::DD -// M:::::::::M M:::::::::MDDD:::::DDDDD:::::D -// M::::::::::M M::::::::::M D:::::D D:::::D -// M:::::::::::M M:::::::::::M D:::::D D:::::D -// M:::::::M::::M M::::M:::::::M D:::::D D:::::D -// M::::::M M::::M M::::M M::::::M D:::::D D:::::D -// M::::::M M::::M::::M M::::::M D:::::D D:::::D -// M::::::M M:::::::M M::::::M D:::::D D:::::D -// M::::::M M:::::M M::::::M D:::::D D:::::D -// M::::::M MMMMM M::::::M D:::::D D:::::D -// M::::::M M::::::MDDD:::::DDDDD:::::D -// M::::::M M::::::MD:::::::::::::::DD -// M::::::M M::::::MD::::::::::::DDD -// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD -@include media-breakpoint-up(md) { //768px - // -} -// LLLLLLLLLLL GGGGGGGGGGGGG -// L:::::::::L GGG::::::::::::G -// L:::::::::L GG:::::::::::::::G -// LL:::::::LL G:::::GGGGGGGG::::G -// L:::::L G:::::G GGGGGG -// L:::::L G:::::G -// L:::::L G:::::G -// L:::::L G:::::G GGGGGGGGGG -// L:::::L G:::::G G::::::::G -// L:::::L G:::::G GGGGG::::G -// L:::::L G:::::G G::::G -// L:::::L LLLLLL G:::::G G::::G -// LL:::::::LLLLLLLLL:::::L G:::::GGGGGGGG::::G -// L::::::::::::::::::::::L GG:::::::::::::::G -// L::::::::::::::::::::::L GGG::::::GGG:::G -// LLLLLLLLLLLLLLLLLLLLLLLL GGGGGG GGGG -@include media-breakpoint-up(lg) { //992px - #ranges { - .filters { - top: 8rem; - background-color: transparent; - z-index: 90; - transform: translateX(0); - height: fit-content; - - &-title { - background-color: transparent; - } - - &-btn { - border-bottom: 2px solid $medium-grey !important; - } - - &-list { - overflow-y: hidden; - height: fit-content; - } - - .title-small { - font-size: 1em; - } - - button { - &[aria-expanded=true] svg { - transform: rotate(180deg); - } - - svg { - transform: rotate(0deg); - } - } - - .form-check { - font-size: 1em; - background-color: transparent; - &-input { - float: none; - margin: 0; - } - } - } - } - - .products { - .card-body { - min-height: auto; - } - - .placeholder { - height: 20rem; - } - } -} -// XXXXXXX XXXXXXXLLLLLLLLLLL -// X:::::X X:::::XL:::::::::L -// X:::::X X:::::XL:::::::::L -// X::::::X X::::::XLL:::::::LL -// XXX:::::X X:::::XXX L:::::L -// X:::::X X:::::X L:::::L -// X:::::X:::::X L:::::L -// X:::::::::X L:::::L -// X:::::::::X L:::::L -// X:::::X:::::X L:::::L -// X:::::X X:::::X L:::::L -// XXX:::::X X:::::XXX L:::::L LLLLLL -// X::::::X X::::::XLL:::::::LLLLLLLLL:::::L -// X:::::X X:::::XL::::::::::::::::::::::L -// X:::::X X:::::XL::::::::::::::::::::::L -// XXXXXXX XXXXXXXLLLLLLLLLLLLLLLLLLLLLLLL -@include media-breakpoint-up(xl) { //1200px - // -} -// XXXXXXX XXXXXXXXXXXXXX XXXXXXXLLLLLLLLLLL -// X:::::X X:::::XX:::::X X:::::XL:::::::::L -// X:::::X X:::::XX:::::X X:::::XL:::::::::L -// X::::::X X::::::XX::::::X X::::::XLL:::::::LL -// XXX:::::X X:::::XXXXXX:::::X X:::::XXX L:::::L -// X:::::X X:::::X X:::::X X:::::X L:::::L -// X:::::X:::::X X:::::X:::::X L:::::L -// X:::::::::X X:::::::::X L:::::L -// X:::::::::X X:::::::::X L:::::L -// X:::::X:::::X X:::::X:::::X L:::::L -// X:::::X X:::::X X:::::X X:::::X L:::::L -// XXX:::::X X:::::XXXXXX:::::X X:::::XXX L:::::L LLLLLL -// X::::::X X::::::XX::::::X X::::::XLL:::::::LLLLLLLLL:::::L -// X:::::X X:::::XX:::::X X:::::XL::::::::::::::::::::::L -// X:::::X X:::::XX:::::X X:::::XL::::::::::::::::::::::L -// XXXXXXX XXXXXXXXXXXXXX XXXXXXXLLLLLLLLLLLLLLLLLLLLLLLL -@include media-breakpoint-up(xxl) { //1400px - // -} diff --git a/resources/views/front/sable/sass/fo/partials/_basket.scss b/resources/views/front/sable/sass/fo/partials/_basket.scss deleted file mode 100644 index aad8420b..00000000 --- a/resources/views/front/sable/sass/fo/partials/_basket.scss +++ /dev/null @@ -1,134 +0,0 @@ -#basket { - @include visibility(1, visible); - width: 100% !important; - z-index: $zindex-fixed; - - .basket-bg { - opacity: .5; - z-index: -1; - } - - .basket-preview { - width: 100%; - height: 100%; - background-color: $white; - } - - .list-group { - max-height: calc(100% - 9rem); - } -} - -.basket-hidden { - opacity: 0 !important; - z-index: -1 !important; -} - -// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM -// SS:::::::::::::::SM:::::::M M:::::::M -// S:::::SSSSSS::::::SM::::::::M M::::::::M -// S:::::S SSSSSSSM:::::::::M M:::::::::M -// S:::::S M::::::::::M M::::::::::M -// S:::::S M:::::::::::M M:::::::::::M -// S::::SSSS M:::::::M::::M M::::M:::::::M -// SS::::::SSSSS M::::::M M::::M M::::M M::::::M -// SSS::::::::SS M::::::M M::::M::::M M::::::M -// SSSSSS::::S M::::::M M:::::::M M::::::M -// S:::::SM::::::M M:::::M M::::::M -// S:::::SM::::::M MMMMM M::::::M -// SSSSSSS S:::::SM::::::M M::::::M -// S::::::SSSSSS:::::SM::::::M M::::::M -// S:::::::::::::::SS M::::::M M::::::M -// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM -@include media-breakpoint-up(sm) { //576px - #basket { - .basket-preview { - width: 25rem; - height: fit-content; - max-width: 100%; - padding: 1.5rem .5rem; - box-shadow: $shadow; - } - - .list-group { - height: fit-content; - max-height: 20rem; - } - } -} -// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD -// M:::::::M M:::::::MD::::::::::::DDD -// M::::::::M M::::::::MD:::::::::::::::DD -// M:::::::::M M:::::::::MDDD:::::DDDDD:::::D -// M::::::::::M M::::::::::M D:::::D D:::::D -// M:::::::::::M M:::::::::::M D:::::D D:::::D -// M:::::::M::::M M::::M:::::::M D:::::D D:::::D -// M::::::M M::::M M::::M M::::::M D:::::D D:::::D -// M::::::M M::::M::::M M::::::M D:::::D D:::::D -// M::::::M M:::::::M M::::::M D:::::D D:::::D -// M::::::M M:::::M M::::::M D:::::D D:::::D -// M::::::M MMMMM M::::::M D:::::D D:::::D -// M::::::M M::::::MDDD:::::DDDDD:::::D -// M::::::M M::::::MD:::::::::::::::DD -// M::::::M M::::::MD::::::::::::DDD -// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD -@include media-breakpoint-up(md) { //768px - // -} -// LLLLLLLLLLL GGGGGGGGGGGGG -// L:::::::::L GGG::::::::::::G -// L:::::::::L GG:::::::::::::::G -// LL:::::::LL G:::::GGGGGGGG::::G -// L:::::L G:::::G GGGGGG -// L:::::L G:::::G -// L:::::L G:::::G -// L:::::L G:::::G GGGGGGGGGG -// L:::::L G:::::G G::::::::G -// L:::::L G:::::G GGGGG::::G -// L:::::L G:::::G G::::G -// L:::::L LLLLLL G:::::G G::::G -// LL:::::::LLLLLLLLL:::::L G:::::GGGGGGGG::::G -// L::::::::::::::::::::::L GG:::::::::::::::G -// L::::::::::::::::::::::L GGG::::::GGG:::G -// LLLLLLLLLLLLLLLLLLLLLLLL GGGGGG GGGG -@include media-breakpoint-up(lg) { //992px - // -} -// XXXXXXX XXXXXXXLLLLLLLLLLL -// X:::::X X:::::XL:::::::::L -// X:::::X X:::::XL:::::::::L -// X::::::X X::::::XLL:::::::LL -// XXX:::::X X:::::XXX L:::::L -// X:::::X X:::::X L:::::L -// X:::::X:::::X L:::::L -// X:::::::::X L:::::L -// X:::::::::X L:::::L -// X:::::X:::::X L:::::L -// X:::::X X:::::X L:::::L -// XXX:::::X X:::::XXX L:::::L LLLLLL -// X::::::X X::::::XLL:::::::LLLLLLLLL:::::L -// X:::::X X:::::XL::::::::::::::::::::::L -// X:::::X X:::::XL::::::::::::::::::::::L -// XXXXXXX XXXXXXXLLLLLLLLLLLLLLLLLLLLLLLL -@include media-breakpoint-up(xl) { //1200px - // -} -// XXXXXXX XXXXXXXXXXXXXX XXXXXXXLLLLLLLLLLL -// X:::::X X:::::XX:::::X X:::::XL:::::::::L -// X:::::X X:::::XX:::::X X:::::XL:::::::::L -// X::::::X X::::::XX::::::X X::::::XLL:::::::LL -// XXX:::::X X:::::XXXXXX:::::X X:::::XXX L:::::L -// X:::::X X:::::X X:::::X X:::::X L:::::L -// X:::::X:::::X X:::::X:::::X L:::::L -// X:::::::::X X:::::::::X L:::::L -// X:::::::::X X:::::::::X L:::::L -// X:::::X:::::X X:::::X:::::X L:::::L -// X:::::X X:::::X X:::::X X:::::X L:::::L -// XXX:::::X X:::::XXXXXX:::::X X:::::XXX L:::::L LLLLLL -// X::::::X X::::::XX::::::X X::::::XLL:::::::LLLLLLLLL:::::L -// X:::::X X:::::XX:::::X X:::::XL::::::::::::::::::::::L -// X:::::X X:::::XX:::::X X:::::XL::::::::::::::::::::::L -// XXXXXXX XXXXXXXXXXXXXX XXXXXXXLLLLLLLLLLLLLLLLLLLLLLLL -@include media-breakpoint-up(xxl) { //1400px - // -} diff --git a/resources/views/front/sable/sass/fo/partials/_calendar.scss b/resources/views/front/sable/sass/fo/partials/_calendar.scss deleted file mode 100644 index ebccbf8b..00000000 --- a/resources/views/front/sable/sass/fo/partials/_calendar.scss +++ /dev/null @@ -1,172 +0,0 @@ -//couleurs -$main-bg: $white; -$calendar-bg: $light-grey; -$light-text: $white; -$dark-section-bg: $light-grey; - -//timeslot picker - -.timeslot-container { - margin: 1em 0; -} - -.timeslot-container + .cgv { - flex-direction: row-reverse; -} - -.calendar { - background-color: $main-bg; - h2 { - text-align: center; - font-weight: 500; - background-color: $main-bg; - line-height: 40px; - span { - color: #fff; - background-color: $primary; - vertical-align: middle; - text-align: center; - border-radius: 15px; - line-height: 0; - width:30px; - display: inline-block; - margin: 0 1em; - cursor: pointer; - &:hover { - background-color: $secondary; - } - } - } - .content { - .current>span { - border-radius: 20px; - width: 40px; - margin: auto; - display: inline-block; - background-color: #ccc; - } - .grey { - background-color: #ebebeb; - } - .selected>span { - border-radius: 20px; - width: 40px; - margin: auto; - color: $light-text; - background-color: $secondary; - display: inline-block; - } - .last, .next { - color: #999; - } - .unavailable{ - color: #999; - color: rgba(153,153,153,0.6); - cursor: initial; - } - } -} - - .calendar .content, - .calendar header { - background-color: $calendar-bg; - } - - .calendar .content, - .calendar header { - display: flex; - flex-wrap: wrap; - } - - .calendar .content>div, - .calendar header>div, - .creneaux__list div { - box-sizing: border-box; - line-height: 40px; - height: 40px; - width: 14.28571427%; - text-align: center; - } - - .calendar .content>div, - .calendar header>div, - .creneaux__list div.dispo { - cursor: pointer; - } - - .creneaux { - background-color: $dark-section-bg; - header { - font-weight: 500; - text-align: center; - line-height: 40px; - background-color: $light-grey; - } - - } - - .creneaux__list { - background-color: $white; - height: 240px; - position: relative; - .creneaux__slots { - scroll-behavior: smooth; - height: 240px; - overflow-y: hidden; - position: inherit; - top: initial; - &.hasDown { - height: 200px; - top: initial; - } - &.hasUp.hasDown { - height: 160px; - top: 40px; - } - &.hasUp { - height: 200px; - top: 40px; - } - } - div { - color: #999; - background-color: $dark-section-bg; - width:90%; - margin: 0.5em auto; - border-radius: 24px; - &.scroll-up, &.scroll-down{ - display:none; - color: #fff; - background-color: $grey; - border-radius: 15px; - width:30px; - height: 30px; - position: absolute; - bottom: 0; - left: 0; - right: 0; - z-index: 1; - margin: 5px auto; - &:hover { - background-color: $secondary; - } - &.active { - display:block; - } - } - &.scroll-up{ - top: 0; - } - &.dispo { - color : initial; - &:hover { - color: #fff; - background-color: $primary; - } - } - &.selected { - color: #fff; - background-color: $secondary; - } - } - } diff --git a/resources/views/front/sable/sass/fo/partials/_footer.scss b/resources/views/front/sable/sass/fo/partials/_footer.scss deleted file mode 100644 index 42340e04..00000000 --- a/resources/views/front/sable/sass/fo/partials/_footer.scss +++ /dev/null @@ -1,105 +0,0 @@ -#footer { - background-color: $orange; - - img { - height: 7rem; - } -} - -// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM -// SS:::::::::::::::SM:::::::M M:::::::M -// S:::::SSSSSS::::::SM::::::::M M::::::::M -// S:::::S SSSSSSSM:::::::::M M:::::::::M -// S:::::S M::::::::::M M::::::::::M -// S:::::S M:::::::::::M M:::::::::::M -// S::::SSSS M:::::::M::::M M::::M:::::::M -// SS::::::SSSSS M::::::M M::::M M::::M M::::::M -// SSS::::::::SS M::::::M M::::M::::M M::::::M -// SSSSSS::::S M::::::M M:::::::M M::::::M -// S:::::SM::::::M M:::::M M::::::M -// S:::::SM::::::M MMMMM M::::::M -// SSSSSSS S:::::SM::::::M M::::::M -// S::::::SSSSSS:::::SM::::::M M::::::M -// S:::::::::::::::SS M::::::M M::::::M -// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM -@include media-breakpoint-up(sm) { //576px - // -} -// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD -// M:::::::M M:::::::MD::::::::::::DDD -// M::::::::M M::::::::MD:::::::::::::::DD -// M:::::::::M M:::::::::MDDD:::::DDDDD:::::D -// M::::::::::M M::::::::::M D:::::D D:::::D -// M:::::::::::M M:::::::::::M D:::::D D:::::D -// M:::::::M::::M M::::M:::::::M D:::::D D:::::D -// M::::::M M::::M M::::M M::::::M D:::::D D:::::D -// M::::::M M::::M::::M M::::::M D:::::D D:::::D -// M::::::M M:::::::M M::::::M D:::::D D:::::D -// M::::::M M:::::M M::::::M D:::::D D:::::D -// M::::::M MMMMM M::::::M D:::::D D:::::D -// M::::::M M::::::MDDD:::::DDDDD:::::D -// M::::::M M::::::MD:::::::::::::::DD -// M::::::M M::::::MD::::::::::::DDD -// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD -@include media-breakpoint-up(md) { //768px - // -} -// LLLLLLLLLLL GGGGGGGGGGGGG -// L:::::::::L GGG::::::::::::G -// L:::::::::L GG:::::::::::::::G -// LL:::::::LL G:::::GGGGGGGG::::G -// L:::::L G:::::G GGGGGG -// L:::::L G:::::G -// L:::::L G:::::G -// L:::::L G:::::G GGGGGGGGGG -// L:::::L G:::::G G::::::::G -// L:::::L G:::::G GGGGG::::G -// L:::::L G:::::G G::::G -// L:::::L LLLLLL G:::::G G::::G -// LL:::::::LLLLLLLLL:::::L G:::::GGGGGGGG::::G -// L::::::::::::::::::::::L GG:::::::::::::::G -// L::::::::::::::::::::::L GGG::::::GGG:::G -// LLLLLLLLLLLLLLLLLLLLLLLL GGGGGG GGGG -@include media-breakpoint-up(lg) { //992px - .footer { - height: 8rem; - } -} -// XXXXXXX XXXXXXXLLLLLLLLLLL -// X:::::X X:::::XL:::::::::L -// X:::::X X:::::XL:::::::::L -// X::::::X X::::::XLL:::::::LL -// XXX:::::X X:::::XXX L:::::L -// X:::::X X:::::X L:::::L -// X:::::X:::::X L:::::L -// X:::::::::X L:::::L -// X:::::::::X L:::::L -// X:::::X:::::X L:::::L -// X:::::X X:::::X L:::::L -// XXX:::::X X:::::XXX L:::::L LLLLLL -// X::::::X X::::::XLL:::::::LLLLLLLLL:::::L -// X:::::X X:::::XL::::::::::::::::::::::L -// X:::::X X:::::XL::::::::::::::::::::::L -// XXXXXXX XXXXXXXLLLLLLLLLLLLLLLLLLLLLLLL -@include media-breakpoint-up(xl) { //1200px - // -} -// XXXXXXX XXXXXXXXXXXXXX XXXXXXXLLLLLLLLLLL -// X:::::X X:::::XX:::::X X:::::XL:::::::::L -// X:::::X X:::::XX:::::X X:::::XL:::::::::L -// X::::::X X::::::XX::::::X X::::::XLL:::::::LL -// XXX:::::X X:::::XXXXXX:::::X X:::::XXX L:::::L -// X:::::X X:::::X X:::::X X:::::X L:::::L -// X:::::X:::::X X:::::X:::::X L:::::L -// X:::::::::X X:::::::::X L:::::L -// X:::::::::X X:::::::::X L:::::L -// X:::::X:::::X X:::::X:::::X L:::::L -// X:::::X X:::::X X:::::X X:::::X L:::::L -// XXX:::::X X:::::XXXXXX:::::X X:::::XXX L:::::L LLLLLL -// X::::::X X::::::XX::::::X X::::::XLL:::::::LLLLLLLLL:::::L -// X:::::X X:::::XX:::::X X:::::XL::::::::::::::::::::::L -// X:::::X X:::::XX:::::X X:::::XL::::::::::::::::::::::L -// XXXXXXX XXXXXXXXXXXXXX XXXXXXXLLLLLLLLLLLLLLLLLLLLLLLL -@include media-breakpoint-up(xxl) { //1400px - // -} diff --git a/resources/views/front/sable/sass/fo/partials/_navbar.scss b/resources/views/front/sable/sass/fo/partials/_navbar.scss deleted file mode 100644 index 813b71d3..00000000 --- a/resources/views/front/sable/sass/fo/partials/_navbar.scss +++ /dev/null @@ -1,213 +0,0 @@ -#navbar { - height: 5rem; - font-family: 'Barlow_Bold', sans-serif; - background-color: $orange; - z-index: 100; - - .btn { - &-icon { - width: 3rem; - height: 3rem; - background-size: contain; - background-repeat: no-repeat; - background-position: center; - } - - &-basket-item { - color: $white; - background-color: $dark; - width: 1.5rem; - height: 1.5rem; - margin: -.5rem -1rem; - } - - &-basket-icon { - background-image: url(../img/icons/icon_cart.png); - } - - &-profile-icon { - background-image: url(../img/icons/icon_profile.png); - } - - &-search-icon { - background-image: url(../img/icons/icon_search_dark.png); - } - } - - .navbar-details { - position: absolute; - top: 100%; - left: 0; - width: 100%; - - .nav-link { - text-align: center; - text-transform: uppercase; - font-size: 1.5em; - background-color: $orange; - border-radius: 0; - border-top: 1px solid $white; - border-bottom: 1px solid $white; - } - } -} - -// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM -// SS:::::::::::::::SM:::::::M M:::::::M -// S:::::SSSSSS::::::SM::::::::M M::::::::M -// S:::::S SSSSSSSM:::::::::M M:::::::::M -// S:::::S M::::::::::M M::::::::::M -// S:::::S M:::::::::::M M:::::::::::M -// S::::SSSS M:::::::M::::M M::::M:::::::M -// SS::::::SSSSS M::::::M M::::M M::::M M::::::M -// SSS::::::::SS M::::::M M::::M::::M M::::::M -// SSSSSS::::S M::::::M M:::::::M M::::::M -// S:::::SM::::::M M:::::M M::::::M -// S:::::SM::::::M MMMMM M::::::M -// SSSSSSS S:::::SM::::::M M::::::M -// S::::::SSSSSS:::::SM::::::M M::::::M -// S:::::::::::::::SS M::::::M M::::::M -// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM -@include media-breakpoint-up(sm) { //576px - // -} - -// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD -// M:::::::M M:::::::MD::::::::::::DDD -// M::::::::M M::::::::MD:::::::::::::::DD -// M:::::::::M M:::::::::MDDD:::::DDDDD:::::D -// M::::::::::M M::::::::::M D:::::D D:::::D -// M:::::::::::M M:::::::::::M D:::::D D:::::D -// M:::::::M::::M M::::M:::::::M D:::::D D:::::D -// M::::::M M::::M M::::M M::::::M D:::::D D:::::D -// M::::::M M::::M::::M M::::::M D:::::D D:::::D -// M::::::M M:::::::M M::::::M D:::::D D:::::D -// M::::::M M:::::M M::::::M D:::::D D:::::D -// M::::::M MMMMM M::::::M D:::::D D:::::D -// M::::::M M::::::MDDD:::::DDDDD:::::D -// M::::::M M::::::MD:::::::::::::::DD -// M::::::M M::::::MD::::::::::::DDD -// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD -@include media-breakpoint-up(md) { //768px - // -} - -// LLLLLLLLLLL GGGGGGGGGGGGG -// L:::::::::L GGG::::::::::::G -// L:::::::::L GG:::::::::::::::G -// LL:::::::LL G:::::GGGGGGGG::::G -// L:::::L G:::::G GGGGGG -// L:::::L G:::::G -// L:::::L G:::::G -// L:::::L G:::::G GGGGGGGGGG -// L:::::L G:::::G G::::::::G -// L:::::L G:::::G GGGGG::::G -// L:::::L G:::::G G::::G -// L:::::L LLLLLL G:::::G G::::G -// LL:::::::LLLLLLLLL:::::L G:::::GGGGGGGG::::G -// L::::::::::::::::::::::L GG:::::::::::::::G -// L::::::::::::::::::::::L GGG::::::GGG:::G -// LLLLLLLLLLLLLLLLLLLLLLLL GGGGGG GGGG -@include media-breakpoint-up(lg) { //992px - #navbar { - height: 8rem; - - .container-fluid { - max-width: 82.5rem; - } - - .navbar { - &-details { - position: relative; - width: fit-content; - - .nav-link:not(.active) { - color: $dark !important; - } - - .nav-link { - border: 0; - font-size: 1em; - border-radius: 2rem; - text-transform: capitalize; - } - } - - &-collapse { - flex-grow: initial; - } - - &-brand { - height: 5rem; - - img { - height: 100%; - } - } - } - - .active { - color: $white !important; - background-color: $green !important; - } - - .btn { - &-basket-item { - color: $white; - background-color: $dark; - } - - &-basket-icon { - background-image: url(../img/icons/icon_cart.png); - } - - &-profile-icon { - background-image: url(../img/icons/icon_profile.png); - } - } - - form input { - width: 20rem; - } - } -} - -// XXXXXXX XXXXXXXLLLLLLLLLLL -// X:::::X X:::::XL:::::::::L -// X:::::X X:::::XL:::::::::L -// X::::::X X::::::XLL:::::::LL -// XXX:::::X X:::::XXX L:::::L -// X:::::X X:::::X L:::::L -// X:::::X:::::X L:::::L -// X:::::::::X L:::::L -// X:::::::::X L:::::L -// X:::::X:::::X L:::::L -// X:::::X X:::::X L:::::L -// XXX:::::X X:::::XXX L:::::L LLLLLL -// X::::::X X::::::XLL:::::::LLLLLLLLL:::::L -// X:::::X X:::::XL::::::::::::::::::::::L -// X:::::X X:::::XL::::::::::::::::::::::L -// XXXXXXX XXXXXXXLLLLLLLLLLLLLLLLLLLLLLLL -@include media-breakpoint-up(xl) { //1200px - // -} - -// XXXXXXX XXXXXXXXXXXXXX XXXXXXXLLLLLLLLLLL -// X:::::X X:::::XX:::::X X:::::XL:::::::::L -// X:::::X X:::::XX:::::X X:::::XL:::::::::L -// X::::::X X::::::XX::::::X X::::::XLL:::::::LL -// XXX:::::X X:::::XXXXXX:::::X X:::::XXX L:::::L -// X:::::X X:::::X X:::::X X:::::X L:::::L -// X:::::X:::::X X:::::X:::::X L:::::L -// X:::::::::X X:::::::::X L:::::L -// X:::::::::X X:::::::::X L:::::L -// X:::::X:::::X X:::::X:::::X L:::::L -// X:::::X X:::::X X:::::X X:::::X L:::::L -// XXX:::::X X:::::XXXXXX:::::X X:::::XXX L:::::L LLLLLL -// X::::::X X::::::XX::::::X X::::::XLL:::::::LLLLLLLLL:::::L -// X:::::X X:::::XX:::::X X:::::XL::::::::::::::::::::::L -// X:::::X X:::::XX:::::X X:::::XL::::::::::::::::::::::L -// XXXXXXX XXXXXXXXXXXXXX XXXXXXXLLLLLLLLLLLLLLLLLLLLLLLL -@include media-breakpoint-up(xxl) { //1400px - // -} diff --git a/resources/views/front/sable/sass/utilities/_bs-custom.scss b/resources/views/front/sable/sass/utilities/_bs-custom.scss deleted file mode 100644 index cf2c8adc..00000000 --- a/resources/views/front/sable/sass/utilities/_bs-custom.scss +++ /dev/null @@ -1,17 +0,0 @@ -// ADD SOME CLASSES IN BOOTSTRAP BREAKPOINTS -@each $type, $classes, $keys in $targets { - @each $key, $data in $keys { - @each $breakpoint in map-keys($grid-breakpoints) { - @include media-breakpoint-up($breakpoint) { - .#{$type}-#{$breakpoint}-#{$key} { - @each $class in $classes { - #{$class}: #{$data} !important; - } - } - } - } - } -} - -// ADDITIONAL BOOTSTRAP IMPORTS -.row {margin: 0;} \ No newline at end of file diff --git a/resources/views/front/sable/sass/utilities/_bs-variables.scss b/resources/views/front/sable/sass/utilities/_bs-variables.scss deleted file mode 100644 index a9f16b0a..00000000 --- a/resources/views/front/sable/sass/utilities/_bs-variables.scss +++ /dev/null @@ -1,28 +0,0 @@ -// ADD BOOTSTRAP SPACING -$spacers-override: ( - 6: $spacer * 5 -); -$spacers: map-merge($spacers-override, $spacers); - - -$h7-font-size: $font-size-base * 0.85; -$font-sizes-override: ( - 7: $h7-font-size -); -$font-sizes: map-merge($font-sizes-override, $font-sizes); - - -// RESPONSIVE VARIABLES FOR BOOTSTRAP -/** - * FORMAT : 'class name' ('attribute(s) added') (key:values, key:values...), - * EXAMPLE : 'w' ('width') (0:0%, 25:25%, 50:50%, 75:75%, 100:100%) - * RESULT : .w-sm-25 { width: 25%; } | .w-md-100 { width: 100%; } etc... - */ -$targets: ( - 'w' ('width') (0:0%, 8:8rem, 25:25%, 50:50%, 75:75%, 100:100%, auto:auto, fit:fit-content), - 'h' ('height') (0:0%, 25:25%, 50:50%, 75:75%, 100:100%, auto:auto, fit:fit-content), - 'opacity' ('opacity') (0:0, 25:0.25, 50:0.50, 75:0.75, 100:1), - 'position' ('position') (relative:relative, absolute:absolute, fixed:fixed, sticky:sticky), - 'text' ('text') (center:center, start:left, end:right), - 'd' ('display') (block:block, flex:flex, table-header-group:table-header-group, table-cell:table-cell, none:none) -); diff --git a/resources/views/front/sable/sass/utilities/_mixins.scss b/resources/views/front/sable/sass/utilities/_mixins.scss deleted file mode 100644 index 45a16bda..00000000 --- a/resources/views/front/sable/sass/utilities/_mixins.scss +++ /dev/null @@ -1,33 +0,0 @@ -@mixin d-flex($direction, $justify, $align) { - display: flex; - flex-direction: $direction !important; - justify-content: $justify !important; - $align-items: $align !important; -} - -@mixin btn($color, $border, $backgroundColor) { - color: $color; - border: $border; - background-color: $backgroundColor; - &:hover, &:focus { - @include btn-hover($dark, none, 0, $orange, $shadow); - } -} - -@mixin btn-hover($color, $border, $radius, $backgroundColor, $shadow) { - color: $color !important; - border: $border; - background-color: $backgroundColor !important; - box-shadow: $shadow; -} - -@mixin visibility($opacity, $visibility) { - opacity: $opacity; - $visibility: $visibility; -} - -@mixin backgroundImg { - background-size: 50%; - background-position: center; - background-repeat: no-repeat; -} diff --git a/resources/views/front/sable/sass/utilities/_variables.scss b/resources/views/front/sable/sass/utilities/_variables.scss deleted file mode 100644 index 1a72da78..00000000 --- a/resources/views/front/sable/sass/utilities/_variables.scss +++ /dev/null @@ -1,12 +0,0 @@ -// Colors -$orange: #f6c500; -$light-orange: #ffde5c; -$dark: #222222; -$grey: #909090; -$medium-grey: #d3d3d3; -$light-grey: #f1f1f1; -$white: #ffffff; -$light-white: #ffffff96; -$green: #81c56f; -$red: #ff0000; -$shadow: 0px 10px 15px $grey; \ No newline at end of file diff --git a/resources/views/front/sable/sass/vendor/_bootstrap.scss b/resources/views/front/sable/sass/vendor/_bootstrap.scss deleted file mode 100644 index c3277544..00000000 --- a/resources/views/front/sable/sass/vendor/_bootstrap.scss +++ /dev/null @@ -1,37 +0,0 @@ -// 1. Include functions first (so you can manipulate colors, SVGs, calc, etc) -@import '~bootstrap/scss/functions'; - -// 2. Include remainder of required Bootstrap stylesheets -@import '~bootstrap/scss/variables'; - -// 3. Include remainder of required parts -@import './../utilities/bs-variables'; - -// 3. Include remainder of required parts -@import '~bootstrap/scss/maps'; -@import '~bootstrap/scss/mixins'; -@import '~bootstrap/scss/root'; - -// 4. Optionally include any other parts as needed -@import '~bootstrap/scss/utilities'; -@import '~bootstrap/scss/reboot'; -@import '~bootstrap/scss/type'; -@import '~bootstrap/scss/images'; -@import '~bootstrap/scss/containers'; -@import '~bootstrap/scss/grid'; -@import '~bootstrap/scss/helpers'; -@import '~bootstrap/scss/alert'; -@import '~bootstrap/scss/buttons'; -@import '~bootstrap/scss/forms'; -@import '~bootstrap/scss/nav'; -@import '~bootstrap/scss/navbar'; -@import '~bootstrap/scss/accordion'; - -// 5. Optionally include utilities API last to generate classes based on the Sass map in `_utilities.scss` -@import "~bootstrap/scss/utilities/api"; - -// 6. Add additional custom code here -@import '~bootstrap/scss/list-group'; -@import '~bootstrap/scss/pagination'; -@import '~bootstrap/scss/transitions'; -@import '~bootstrap/scss/tables'; diff --git a/resources/views/front/sable/sass/vendor/_fontawesome.scss b/resources/views/front/sable/sass/vendor/_fontawesome.scss deleted file mode 100644 index 0fc9bfb9..00000000 --- a/resources/views/front/sable/sass/vendor/_fontawesome.scss +++ /dev/null @@ -1 +0,0 @@ -@import '~@fortawesome/fontawesome-free/scss/fontawesome.scss'; diff --git a/resources/views/front/sable/sass/vendor/_simplebar.scss b/resources/views/front/sable/sass/vendor/_simplebar.scss deleted file mode 100644 index de24ab7c..00000000 --- a/resources/views/front/sable/sass/vendor/_simplebar.scss +++ /dev/null @@ -1 +0,0 @@ -@import '~simplebar/dist/simplebar.css'; \ No newline at end of file diff --git a/resources/views/front/sable/sass/vendor/_swiper.scss b/resources/views/front/sable/sass/vendor/_swiper.scss deleted file mode 100644 index 1ba59062..00000000 --- a/resources/views/front/sable/sass/vendor/_swiper.scss +++ /dev/null @@ -1 +0,0 @@ -@import '~swiper/swiper-bundle.min.css'; \ No newline at end of file diff --git a/resources/views/front/sable/terms.blade.php b/resources/views/front/sable/terms.blade.php deleted file mode 100644 index 53412545..00000000 --- a/resources/views/front/sable/terms.blade.php +++ /dev/null @@ -1,23 +0,0 @@ -@extends('layouts.layout') - -@section('title', __('CGV')) -@section('description', 'Conditions générales de ventes de la boutique.') - -@section('breadcrumb', 'no') - -@section('content') -
-
-
-

{{ $content->title }}

- @if ($content !== null) -
-
- {!! clean($content->value) !!} -
-
- @endif -
-
-
-@endsection diff --git a/resources/views/front/sable/theme.config.php b/resources/views/front/sable/theme.config.php deleted file mode 100644 index 026f0d15..00000000 --- a/resources/views/front/sable/theme.config.php +++ /dev/null @@ -1,29 +0,0 @@ - 'sable', - 'site_name' => 'La Boutique de Cocotte', - 'company' => 'LDC', - 'product_image_maxwidth' => '500', - 'product_image_maxheight' => '500', - 'product_image_large_maxwidth' => '500', - 'product_image_large_maxheight' => '500', - 'range_image_maxwidth' => '500', - 'range_image_maxheight' => '500', - 'range_image_large_maxwidth' => '500', - 'range_image_large_maxheight' => '500', - 'content_banner_maxwidth' => '100', - 'content_banner_maxheight' => '100', - 'slide_image_maxwidth' => '830', - 'slide_image_maxheight' => '320', - 'register_mode' => ['public', 'salaries'], - /** - * attention ce paramètre est un paramètre de fonctionnement - * (y compris du back office) et non un paramète esthétique. - * il est lié au moteur de la boutique et ne doit pas changer - * (au moins jamais se reduire lors d'un changement de thème) - */ - 'enum_product_types' => [ - 'foodProduct' => 'Alimentaire', - ], -]; diff --git a/resources/views/icons/facebook.blade.php b/resources/views/icons/facebook.blade.php deleted file mode 100644 index e824012f..00000000 --- a/resources/views/icons/facebook.blade.php +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/resources/views/icons/google-plus.blade.php b/resources/views/icons/google-plus.blade.php deleted file mode 100644 index 83366a81..00000000 --- a/resources/views/icons/google-plus.blade.php +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/resources/views/icons/icon-upload.blade.php b/resources/views/icons/icon-upload.blade.php deleted file mode 100644 index 1bfafd27..00000000 --- a/resources/views/icons/icon-upload.blade.php +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/resources/views/icons/instagram.blade.php b/resources/views/icons/instagram.blade.php deleted file mode 100644 index f5a5849e..00000000 --- a/resources/views/icons/instagram.blade.php +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/resources/views/icons/loader.blade.php b/resources/views/icons/loader.blade.php deleted file mode 100644 index 7b90dde0..00000000 --- a/resources/views/icons/loader.blade.php +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - diff --git a/resources/views/icons/pinterest.blade.php b/resources/views/icons/pinterest.blade.php deleted file mode 100644 index e9b05afa..00000000 --- a/resources/views/icons/pinterest.blade.php +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/resources/views/icons/search.blade.php b/resources/views/icons/search.blade.php deleted file mode 100644 index 495d2d4e..00000000 --- a/resources/views/icons/search.blade.php +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/resources/views/icons/twitter.blade.php b/resources/views/icons/twitter.blade.php deleted file mode 100644 index 56757ff1..00000000 --- a/resources/views/icons/twitter.blade.php +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/resources/views/layouts/bo-layout.blade.php b/resources/views/layouts/bo-layout.blade.php deleted file mode 100644 index f542ce7d..00000000 --- a/resources/views/layouts/bo-layout.blade.php +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - {{ __('Tableau de bord') }} - - - - -
- -
-
- -
- @yield('content') -
-
-
-
- - @yield('scripts') - @stack('scripts') - - diff --git a/resources/views/modules/flash-messages.blade.php b/resources/views/modules/flash-messages.blade.php deleted file mode 100644 index b6ee1768..00000000 --- a/resources/views/modules/flash-messages.blade.php +++ /dev/null @@ -1,55 +0,0 @@ -@if (!request()->routeIs('login')) - @if ($message = session()->get('success', session()->get('bo.success'))) - - @endif - - @if ($message = session()->get('error', session()->get('bo.error'))) - - @endif - - @if ($message = session()->get('warning', session()->get('bo.warning'))) - - @endif - - @if ($message = session()->get('status', session()->get('bo.status'))) - - @endif - - @if ($message = session()->get('info', session()->get('bo.info'))) - - @endif - - @if ($errors->any()) - - @endif -@endif diff --git a/resources/views/modules/input-error.blade.php b/resources/views/modules/input-error.blade.php deleted file mode 100644 index 8f09499a..00000000 --- a/resources/views/modules/input-error.blade.php +++ /dev/null @@ -1,9 +0,0 @@ -@if ($errors->has($inputName)) -
- {{ implode(',', Arr::flatten(Arr::wrap($errors->get($inputName)))) }} -
-@endif -@if (isset($helper)) - {{ $helper }} -@endif diff --git a/resources/views/vendor/cn-cookies.blade.php b/resources/views/vendor/cn-cookies.blade.php index 5bf3c660..10ccc93d 100644 --- a/resources/views/vendor/cn-cookies.blade.php +++ b/resources/views/vendor/cn-cookies.blade.php @@ -2,9 +2,9 @@ @php $site_name = Str::ucfirst(config('app.name')); -$logo_picture_url = asset(config('app.theme')."/img/logo.png"); -$logo_title_text = __('Logo du site :name', ['name' => $site_name]); -$logo_alt_text = __('Logo :name', ['name' => $site_name]); +$logo_picture_url = Vite::asset('resources/assets/images/logo.png'); +$logo_title_text = __(':name site logo', ['name' => $site_name]); +$logo_alt_text = __(':name logo', ['name' => $site_name]); $strings = (object)[ 'modal_title' => __('cookie-notice.modal_title'), @@ -21,8 +21,8 @@ $strings = (object)[ 'banner_title' => __('cookie-notice.banner_title', ['site_name' => $site_name]), 'banner_text' => sprintf( "%s

%s", - "Nous utilisons des cookies pour nous assurer du bon fonctionnement de notre site et à des fins analytiques. Vous pouvez changer d'avis à tout moment en cliquant sur l'icône présente sur chaque page de notre site. En autorisant ces services tiers, vous acceptez le dépôt et la lecture de cookies et l'utilisation de technologies de suivi nécessaires à leur bon fonctionnement.", - "Charte de confidentialité" + __('cookie-notice.banner_text'), + "" . __('Privacy Policy') . "" ), 'panel_title' => __('cookie-notice.panel_title'), 'panel_content' => __('cookie-notice.panel_content'), @@ -65,7 +65,7 @@ $cookies['matomo'] = [ 'name' => __('cookie-notice.custom.matomo.title'), 'description' => __('cookie-notice.custom.matomo.description'), 'link' => 'https://fr.matomo.org/gdpr-analytics/', - 'labelLink' => __('En savoir +'), + 'labelLink' => __('cookie-notice.custom.matomo.labelLink'), 'cookies' => ['_pk'] ]; @@ -97,7 +97,7 @@ SCRIPT; 'logo_title_text', 'strings' )) - +@endpush diff --git a/resources/views/vendor/errors/429.blade.php b/resources/views/vendor/errors/429.blade.php new file mode 100644 index 00000000..f01b07b8 --- /dev/null +++ b/resources/views/vendor/errors/429.blade.php @@ -0,0 +1,5 @@ +@extends('errors::minimal') + +@section('title', __('Too Many Requests')) +@section('code', '429') +@section('message', __('Too Many Requests')) diff --git a/resources/views/vendor/errors/500.blade.php b/resources/views/vendor/errors/500.blade.php new file mode 100644 index 00000000..d9e95d9b --- /dev/null +++ b/resources/views/vendor/errors/500.blade.php @@ -0,0 +1,5 @@ +@extends('errors::minimal') + +@section('title', __('Server Error')) +@section('code', '500') +@section('message', __('Server Error')) diff --git a/resources/views/vendor/errors/illustrated-layout.blade.php b/resources/views/vendor/errors/illustrated-layout.blade.php new file mode 100644 index 00000000..49968d9e --- /dev/null +++ b/resources/views/vendor/errors/illustrated-layout.blade.php @@ -0,0 +1,49 @@ + + + + + + + + @yield('title') + + @vite(['resources/sass/fo/fo.scss']) + @stack('scripts') + + + +
+
+ +
+

+ @yield('code', __('Oh no')) +

+ +

+ @yield('message') +

+ +

+ @yield('submessage') +

+ + @hasSection('button') + + {{ __('Return to home') }} + + @endif +
+ +
+
+ @yield('image') +
+
+ +
+
+ + + diff --git a/resources/views/vendor/errors/minimal.blade.php b/resources/views/vendor/errors/minimal.blade.php new file mode 100644 index 00000000..081cae7a --- /dev/null +++ b/resources/views/vendor/errors/minimal.blade.php @@ -0,0 +1,34 @@ + + + + + + + + @yield('title') + + @vite(['resources/sass/fo/fo.scss']) + @stack('scripts') + + + +
+
+ +
+ @yield('code') +
+ +
+ +
+ +
+ @yield('message') +
+ +
+
+ + + diff --git a/resources/views/vendor/mail/html/header.blade.php b/resources/views/vendor/mail/html/header.blade.php new file mode 100644 index 00000000..6f483d6a --- /dev/null +++ b/resources/views/vendor/mail/html/header.blade.php @@ -0,0 +1,12 @@ + + + + @if (trim($slot) === 'Laravel') + + @else +
+ {{ $slot }} + @endif +
+ + diff --git a/routes/ajax-fo.php b/routes/ajax-fo.php new file mode 100644 index 00000000..a5d3e922 --- /dev/null +++ b/routes/ajax-fo.php @@ -0,0 +1,23 @@ +name('products.filter'); + +// * BASKET +Route::name('basket.')->prefix('basket')->group(function (): void { + Route::get('get', [BasketController::class, 'get'])->name('get'); + Route::post('add', [BasketController::class, 'add'])->name('add'); + Route::post('remove', [BasketController::class, 'remove'])->name('remove'); + Route::post('empty', [BasketController::class, 'empty'])->name('empty'); +}); + +// * ORDERS TUNNEL +Route::get('/shops/{shop}/pickup-timeslots', [PickupController::class, 'getAvailableTimeslots']) + ->name('shops.pickup-timeslots'); diff --git a/routes/api.php b/routes/api.php index ea9e286f..174d7fd7 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,19 +1,3 @@ get('/user', function (Request $request) { - return $request->user(); -}); +declare(strict_types=1); diff --git a/routes/breadcrumbs-bo.php b/routes/breadcrumbs-bo.php new file mode 100644 index 00000000..294cc549 --- /dev/null +++ b/routes/breadcrumbs-bo.php @@ -0,0 +1,219 @@ +push(trans('Dashboard'), route('bo.dashboard')); +}); + +// * Slides +Breadcrumbs::for('bo.slides.index', function (Generator $trail): void { + $trail->parent('bo.dashboard'); + $trail->push(Str::ucfirst(trans_choice('models.classes.slides', \INF)), route('bo.slides.index')); +}); +Breadcrumbs::for('bo.slides.create', function (Generator $trail) use ($creationLabel): void { + $trail->parent('bo.slides.index'); + $trail->push($creationLabel); +}); +Breadcrumbs::for('bo.slides.edit', function (Generator $trail, Slide | SlideDto $slide) use ($editionLabel): void { + $trail->parent('bo.slides.index'); + $trail->push($editionLabel, route('bo.slides.edit', $slide)); +}); + +// * Tags +Breadcrumbs::for('bo.tags.index', function (Generator $trail): void { + $trail->parent('bo.dashboard'); + $trail->push(Str::ucfirst(trans_choice('models.classes.tags', \INF)), route('bo.tags.index')); +}); +Breadcrumbs::for('bo.tags.create', function (Generator $trail) use ($creationLabel): void { + $trail->parent('bo.tags.index'); + $trail->push($creationLabel); +}); +Breadcrumbs::for('bo.tags.edit', function (Generator $trail, Tag $tag) use ($editionLabel): void { + $trail->parent('bo.tags.index'); + $trail->push($editionLabel, route('bo.tags.edit', $tag)); +}); + +// * Ranges +Breadcrumbs::for('bo.ranges.index', function (Generator $trail): void { + $trail->parent('bo.dashboard'); + $trail->push(Str::ucfirst(trans_choice('models.classes.ranges', \INF)), route('bo.ranges.index')); +}); +Breadcrumbs::for('bo.ranges.create', function (Generator $trail) use ($creationLabel): void { + $trail->parent('bo.ranges.index'); + $trail->push($creationLabel); +}); +Breadcrumbs::for('bo.ranges.edit', function (Generator $trail, Range | RangeDto $range) use ($editionLabel): void { + $trail->parent('bo.ranges.index'); + $trail->push($editionLabel, route('bo.ranges.edit', $range)); +}); + +// * Static Pages +Breadcrumbs::for('bo.pages.index', function (Generator $trail): void { + $trail->parent('bo.dashboard'); + $trail->push(Str::ucfirst(trans_choice('models.classes.pages', \INF))); +}); +Breadcrumbs::for('bo.pages.create', function (Generator $trail) use ($creationLabel): void { + $trail->parent('bo.pages.index'); + $trail->push($creationLabel); +}); +Breadcrumbs::for('bo.pages.edit', function (Generator $trail, Page | PageDto $page) use ($editionLabel): void { + $trail->parent('bo.pages.index'); + $trail->push("{$editionLabel} {$page->slug->label()}", route('bo.pages.edit', $page->slug->value())); +}); + +// * Faqs +Breadcrumbs::for('bo.faqs.index', function (Generator $trail): void { + $trail->parent('bo.pages.index'); + $trail->push(Str::ucfirst(trans_choice('models.classes.faqs', \INF)), route('bo.faqs.index')); +}); +Breadcrumbs::for('bo.faqs.create', function (Generator $trail) use ($creationLabel): void { + $trail->parent('bo.faqs.index'); + $trail->push($creationLabel); +}); +Breadcrumbs::for('bo.faqs.edit', function (Generator $trail, Faq $faq) use ($editionLabel): void { + $trail->parent('bo.faqs.index'); + $trail->push($editionLabel, route('bo.faqs.edit', $faq)); +}); + +// * Products +Breadcrumbs::for('bo.products.index', function (Generator $trail): void { + $trail->parent('bo.dashboard'); + $trail->push(Str::ucfirst(trans_choice('models.classes.products', \INF)), route('bo.products.index')); +}); +Breadcrumbs::for('bo.products.create', function (Generator $trail) use ($creationLabel): void { + $trail->parent('bo.products.index'); + $trail->push($creationLabel); +}); +Breadcrumbs::for('bo.products.edit', function (Generator $trail, Product | ProductDto $product) use ($editionLabel): void { + $trail->parent('bo.products.index'); + $trail->push($editionLabel, route('bo.products.edit', $product)); +}); + +// * Product Incos +Breadcrumbs::for('bo.products.incos.create', function (Generator $trail, Product | ProductDto $product) use ($creationLabel): void { + $trail->parent('bo.products.edit', $product); + $trail->push(Str::ucfirst(trans_choice('models.classes.product_incos', 1))); + $trail->push($creationLabel); +}); +Breadcrumbs::for('bo.products.incos.edit', function (Generator $trail, Product | ProductDto $product) use ($editionLabel): void { + $trail->parent('bo.products.edit', $product); + $trail->push(Str::ucfirst(trans_choice('models.classes.product_incos', 1))); + $trail->push($editionLabel); +}); + +// * Merchandising +Breadcrumbs::for('bo.merch', function (Generator $trail): void { + $trail->parent('bo.dashboard'); + $trail->push(trans('Merchandising')); +}); +Breadcrumbs::for('bo.merch.starred', function (Generator $trail): void { + $trail->parent('bo.merch'); + $trail->push(trans('crud.helpers.starred'), route('bo.merch.starred')); +}); + +Breadcrumbs::for('bo.discounts.index', function (Generator $trail): void { + $trail->parent('bo.merch'); + $trail->push(Str::ucfirst(trans_choice('models.classes.discounts', \INF)), route('bo.discounts.index')); +}); +Breadcrumbs::for('bo.discounts.create', function (Generator $trail) use ($creationLabel): void { + $trail->parent('bo.discounts.index'); + $trail->push($creationLabel); +}); +Breadcrumbs::for('bo.discounts.edit', function (Generator $trail, Discount | DiscountDto $discount) use ($editionLabel): void { + $trail->parent('bo.discounts.index'); + $trail->push($editionLabel, route('bo.discounts.edit', $discount)); +}); + +// * Pickup points +Breadcrumbs::for('bo.shops.index', function (Generator $trail): void { + $trail->parent('bo.dashboard'); + $trail->push(Str::ucfirst(trans_choice('models.classes.shops', \INF)), route('bo.shops.index')); +}); +Breadcrumbs::for('bo.shops.create', function (Generator $trail) use ($creationLabel): void { + $trail->parent('bo.shops.index'); + $trail->push($creationLabel); +}); +Breadcrumbs::for('bo.shops.edit', function (Generator $trail, Shop | ShopDto $shop) use ($editionLabel): void { + $trail->parent('bo.shops.index'); + $trail->push($editionLabel, route('bo.shops.edit', $shop)); +}); +Breadcrumbs::for('bo.shops.pickup-exceptions.edit', function (Generator $trail, Shop | ShopDto $shop): void { + $trail->parent('bo.shops.edit', $shop); + $trail->push( + Str::ucfirst(trans_choice('models.classes.pickup-exceptions', \INF)), + route('bo.pickup-exceptions.index') + ); +}); + +// * Pickup exceptions +Breadcrumbs::for('bo.pickup-exceptions.index', function (Generator $trail): void { + $trail->parent('bo.dashboard'); + $trail->push( + Str::ucfirst(trans_choice('models.classes.pickup-exceptions', \INF)), + route('bo.pickup-exceptions.index') + ); +}); +Breadcrumbs::for('bo.pickup-exceptions.create', function (Generator $trail) use ($creationLabel): void { + $trail->parent('bo.shops.index'); + $trail->push($creationLabel); +}); +Breadcrumbs::for( + 'bo.pickup-exceptions.edit', + function (Generator $trail, PickupException | PickupExceptionDto $pickupException) use ($editionLabel): void { + $trail->parent('bo.pickup-exceptions.index'); + $trail->push($editionLabel, route('bo.pickup-exceptions.edit', $pickupException)); + } +); + +// * Orders +Breadcrumbs::for('bo.orders.index', function (Generator $trail): void { + $trail->parent('bo.dashboard'); + $trail->push( + Str::ucfirst(trans_choice('models.classes.orders', \INF)), + route('bo.orders.index') + ); +}); +Breadcrumbs::for('bo.orders.today', function (Generator $trail): void { + $trail->parent('bo.orders.index'); + $trail->push(trans('Today\'s Orders')); +}); +Breadcrumbs::for('bo.orders.show', function (Generator $trail) use ($viewLabel): void { + $trail->parent('bo.orders.index'); + $trail->push($viewLabel); +}); + +// * Settings +Breadcrumbs::for('bo.settings.index', function (Generator $trail): void { + $trail->parent('bo.dashboard'); + $trail->push(trans('Settings')); +}); +Breadcrumbs::for('bo.settings.edit', function (Generator $trail): void { + $trail->parent('bo.dashboard'); + $trail->push(__('Employee sites'), route('bo.settings.edit')); +}); diff --git a/routes/breadcrumbs-fo.php b/routes/breadcrumbs-fo.php new file mode 100644 index 00000000..85a1e9cc --- /dev/null +++ b/routes/breadcrumbs-fo.php @@ -0,0 +1,114 @@ +push(trans('Home'), route('fo.pages.home')); +}); + +// * PAGES +Breadcrumbs::for('fo.pages.contact', function (Generator $trail, Page | PageDto $page): void { + $trail->parent('fo.pages.home'); + $trail->push($page->title, route('fo.pages.contact')); +}); +Breadcrumbs::for('fo.pages.legal-notice', function (Generator $trail, Page | PageDto $page): void { + $trail->parent('fo.pages.home'); + $trail->push($page->title, route('fo.pages.legal-notice')); +}); +Breadcrumbs::for('fo.pages.privacy', function (Generator $trail, Page | PageDto $page): void { + $trail->parent('fo.pages.home'); + $trail->push($page->title, route('fo.pages.privacy')); +}); +Breadcrumbs::for('fo.pages.faq', function (Generator $trail, Page | PageDto $page): void { + $trail->parent('fo.pages.home'); + $trail->push($page->title, route('fo.pages.faq')); +}); +Breadcrumbs::for('fo.pages.terms', function (Generator $trail, Page | PageDto $page): void { + $trail->parent('fo.pages.home'); + $trail->push($page->title, route('fo.pages.terms')); +}); + +// * PRODUCTS +Breadcrumbs::for('fo.products.index', function (Generator $trail): void { + $trail->parent('fo.pages.home'); + $trail->push(trans('All aisles'), route('fo.products.index')); +}); +Breadcrumbs::for('fo.ranges.show', function (Generator $trail, Product $product): void { + $trail->parent('fo.products.index'); + $trail->push( + str($product->range->name)->title()->value(), + route('fo.products.index', ['ranges[]' => $product->range->id]) + ); +}); +Breadcrumbs::for('fo.products.show', function (Generator $trail, Product $product): void { + $trail->parent('fo.ranges.show', $product); + $trail->push($product->name, route('fo.products.show', $product)); +}); + +// * ACCOUNT +Breadcrumbs::for('fo.account.dashboard', function (Generator $trail): void { + $trail->parent('fo.pages.home'); + $trail->push(trans('My Account'), route('fo.account.dashboard')); +}); +// * -- INFOS +Breadcrumbs::for('fo.account.edit.infos.show', function (Generator $trail): void { + $trail->parent('fo.account.dashboard'); + $trail->push(trans('My details'), route('fo.account.edit.infos.show')); +}); +// * -- SECURITY +Breadcrumbs::for('fo.account.edit.password.show', function (Generator $trail): void { + $trail->parent('fo.account.dashboard'); + $trail->push(trans('Password'), route('fo.account.edit.password.show')); +}); +// * -- ORDERS +Breadcrumbs::for('fo.account.orders.index', function (Generator $trail): void { + $trail->parent('fo.account.dashboard'); + $trail->push(trans('My Orders'), route('fo.account.orders.index')); +}); +Breadcrumbs::for('fo.account.orders.show', function (Generator $trail, Order | OrderDto $order): void { + $trail->parent('fo.account.orders.index'); + $trail->push( + trans('Order detail of :date', ['date' => $order->created_at->isoFormat('ddd DD/MM/YY')]), + route('fo.account.orders.show', $order) + ); +}); + +// * AUTH / REGISTER +Breadcrumbs::for(Login::class, function (Generator $trail): void { + $trail->parent('fo.pages.home'); + $trail->push(trans('Login'), route(Login::class)); +}); +Breadcrumbs::for('fo.auth.connexion', function (Generator $trail): void { + $trail->parent('fo.pages.home'); + $trail->push(trans('Login'), route('fo.auth.connexion')); +}); +Breadcrumbs::for('fo.auth.register', function (Generator $trail): void { + $trail->parent('fo.pages.home'); + $trail->push(trans('Register'), route('fo.auth.register')); +}); +Breadcrumbs::for('fo.auth.register.post', function (Generator $trail): void { + $trail->parent('fo.pages.home'); + $trail->push(trans('Register'), route('fo.auth.register.post')); +}); +Breadcrumbs::for('fo.auth.activer', function (Generator $trail): void { + $trail->parent('fo.pages.home'); + $trail->push(trans('Register'), route('fo.auth.verification.verify')); +}); +Breadcrumbs::for('fo.auth.ask-reset-password', function (Generator $trail): void { + $trail->parent('fo.pages.home'); + $trail->push(trans('Forgot Your Password?'), route('fo.auth.ask-reset-password')); +}); +Breadcrumbs::for('fo.auth.reset-password', function (Generator $trail): void { + $trail->parent('fo.pages.home'); + $trail->push(trans('Reset Password')); +}); diff --git a/routes/breadcrumbs.php b/routes/breadcrumbs.php deleted file mode 100644 index cea92735..00000000 --- a/routes/breadcrumbs.php +++ /dev/null @@ -1,107 +0,0 @@ -push(__('Accueil'), route('home')); -}); - -// First Level -// General content. -Breadcrumbs::for('contact', function ($trail) { - $trail->parent('home'); - $trail->push(__('Contactez-nous'), route('contact')); -}); -Breadcrumbs::for('legal-notice', function ($trail) { - $trail->parent('home'); - $trail->push(__('Mentions légales'), route('legal-notice')); -}); -Breadcrumbs::for('privacy', function ($trail) { - $trail->parent('home'); - $trail->push(__('Politique de confidentialité'), route('privacy')); -}); -Breadcrumbs::for('faq', function ($trail) { - $trail->parent('home'); - $trail->push(__('Foire aux questions'), route('faq')); -}); -Breadcrumbs::for('terms', function ($trail) { - $trail->parent('home'); - $trail->push(__('Conditions générales de vente'), route('terms')); -}); - -// Auth / inscription. -Breadcrumbs::for('auth.login', function ($trail) { - $trail->parent('home'); - $trail->push(__('Connexion'), route('auth.login')); -}); -Breadcrumbs::for('auth.connexion', function ($trail) { - $trail->parent('home'); - $trail->push(__('Connexion'), route('auth.connexion')); -}); -Breadcrumbs::for('auth.register', function ($trail) { - $trail->parent('home'); - $trail->push(__('Inscription'), route('auth.register')); -}); -Breadcrumbs::for('auth.register.post', function ($trail) { - $trail->parent('home'); - $trail->push(__('Inscription'), route('auth.register.post')); -}); -Breadcrumbs::for('auth.activer', function ($trail) { - $trail->parent('home'); - $trail->push(__('Inscription'), route('auth.activer', 'fake')); -}); -Breadcrumbs::for('auth.forgot-password', function ($trail) { - $trail->parent('home'); - $trail->push(__('Mot de passe oublié'), route('auth.forgot-password')); -}); -Breadcrumbs::for('auth.form-change-mdp', function ($trail) { - $trail->parent('home'); - $trail->push(__('Changement de mot de passe'), route('auth.form-change-mdp', 'fake')); -}); -Breadcrumbs::for('auth.change-password', function ($trail) { - $trail->parent('home'); - $trail->push(__('Changement de mot de passe'), route('auth.change-password', 'fake')); -}); - -// Tunnel commande. -Breadcrumbs::for('tunnel', function ($trail) { - $trail->parent('home'); - $trail->push(__('Panier'), null); -}); -Breadcrumbs::for('sales.recap', function ($trail) { - $trail->parent('tunnel'); - $trail->push(__('Récapitulatif'), route('sales.recap')); -}); -Breadcrumbs::for('sales.pick-slot', function ($trail, $reference) { - $trail->parent('tunnel'); - $trail->push(__('Réservation'), route('sales.pick-slot', ['reference' => $reference])); -}); -Breadcrumbs::for('sales.confirm', function ($trail, $reference) { - $trail->parent('tunnel'); - $trail->push(__('Confirmation'), route('sales.confirm', ['reference' => $reference])); -}); - -// Catalog. -Breadcrumbs::for('products', function ($trail) { - $trail->parent('home'); - $trail->push(__('Tous les produits'), route('products')); -}); -Breadcrumbs::for('product', function ($trail, $product) { - $trail->parent('products'); - $trail->push($product->name, route('product', ['productSlug' => $product->slug])); -}); - -// Account management. -Breadcrumbs::for('account.dashboard', function ($trail) { - $trail->parent('home'); - $trail->push(__('Mon compte'), route('account.dashboard')); -}); -Breadcrumbs::for('account.my-orders', function ($trail) { - $trail->parent('account.dashboard'); - $trail->push(__('Mes commandes'), route('account.my-orders')); -}); -Breadcrumbs::for('account.order-detail', function ($trail, $reference) { - $trail->parent('account.my-orders'); - $trail->push(__('Détails d\'une commande'), route('account.order-detail', ['reference', $reference])); -}); diff --git a/routes/channels.php b/routes/channels.php index b75e9e19..174d7fd7 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -1,18 +1,3 @@ id === (int)$id; -}); +declare(strict_types=1); diff --git a/routes/console.php b/routes/console.php index e2164657..174d7fd7 100644 --- a/routes/console.php +++ b/routes/console.php @@ -1,19 +1,3 @@ comment(Inspiring::quote()); -})->purpose('Display an inspiring quote'); +declare(strict_types=1); diff --git a/routes/web-bo.php b/routes/web-bo.php index 0ace7905..b4f82537 100644 --- a/routes/web-bo.php +++ b/routes/web-bo.php @@ -1,107 +1,110 @@ group(function () { - // Bo connect. - Route::get('/bo/login', [LoginController::class, 'index'])->name('login') - ->middleware('guest'); - Route::post('/bo/login', [LoginController::class, 'login'])->name('login.post') - ->middleware('guest'); - Route::get('/bo/logout', [LoginController::class, 'logout'])->name('logout') - ->middleware('auth:web'); - }); +Route::name('auth.')->middleware([ + 'guest:backend', + 'throttle:' . RouteServiceProvider::ROUTE_GROUP_WEB_CREDENTIALS, +])->group(function (): void { + Route::get('/login', [LoginController::class, 'showLoginForm'])->name('login'); + Route::post('/login', [LoginController::class, 'login'])->name('login.post'); +}); -Route::prefix('bo') - ->name('bo.') - ->middleware([ - 'auth', - 'is-admin', - 'admin-secure' - ]) - ->group(function () { - Route::get('/', [DashboardController::class, 'index'])->name('dashboard'); - Route::match(['get', 'put'], '/content/{key}', [ContentController::class, 'manage']) - ->name('content'); - Route::match(['get', 'put'], '/settings', [SettingsController::class, 'manage'])->name('settings'); - Route::match(['get', 'put'], '/themesettings', [SettingsController::class, 'manageTheme']) - ->name('themesettings'); - // Gestion des salariés. - Route::get('/salaries', [SalariesController::class, 'index'])->name('salaries.index'); - Route::post('/salaries/file', [SalariesController::class, 'import']) - ->name('salaries.file'); - // FAQ. - Route::get('/faq', [FaqController::class, 'index'])->name('faq'); - Route::post('/ajax/save-faq', [FaqController::class, 'saveDatas']); - Route::post('/ajax/delete-faq', [FaqController::class, 'destroy']); - // Creneaux. - Route::get('/magasins/{id}/creneaux', [CreneauxController::class, 'settings']) - ->name('creneaux.settings'); - Route::post('/magasins/{id}/creneaux', [CreneauxController::class, 'updateSettings']) - ->name('creneaux.settings.update'); - // Exceptions de collecte. - Route::post('/ajax/save-creneaux-exception', [MagasinsController::class, 'saveExceptions']); - Route::post('/ajax/delete-creneaux-exception', [MagasinsController::class, 'destroyExceptions']); - // Recherche d'inco. - Route::post('/ajax/check-inco-data', [ProductsController::class, 'checkIncoData']); - Route::post('/ajax/get-inco-images', [ProductsController::class, 'getPrepareIncoImages']); - Route::post('/ajax/set-inco-images', [ProductsController::class, 'setIncoImage']); - // Produits. - // Route ajoutée avant la déclaration de route resource. - // Sinon la forme /products/{product} l'emporte lors du routage. - Route::get('/products/starred', [ProductsController::class, 'starred'])->name('products.starred'); - Route::get('/products/create/{product_type?}', [ProductsController::class, 'create']) - ->name('products.create'); - Route::resource('products', ProductsController::class)->except(['create', 'show']); - Route::post('/products/{product}/change-published', [ProductsController::class, 'changePublished']) - ->name('products.change-published'); - Route::get('/products/change-order/{product}/{direction}', [ProductsController::class, 'changeOrder']) - ->where('direction', 'up|down')->name('products.change-order'); - Route::patch('/products/{product}/change-selected-order', [ - ProductsController::class, - 'changeSelectedOrder' - ])->name('product.change-selected-order'); - // Slides. - Route::resource('slides', SlidesController::class)->except(['show']); - Route::resource('sliders', SlidersController::class)->except(['show']); - Route::resource('tags', TagsController::class)->except(['show']); - Route::resource('promotions', PromotionsController::class)->except(['show']); - Route::resource('magasins', MagasinsController::class)->except(['show']); - Route::resources(['ranges' => RangesController::class]); - Route::get('/slide/change-order/{id}/{action}', [SlidesController::class, 'changeOrder']) - ->name('slides.change-order'); - Route::get('/tag/change-order/{id}/{action}', [TagsController::class, 'changeOrder']) - ->name('tags.change-order'); - Route::get('/tag/toggle-status/{id}', [TagsController::class, 'toggleStatus']) - ->name('tags.toggle-status'); - Route::get('/customer-info/{id}/{mode?}', [OrdersController::class, 'getCustomerInfo']) - ->name('get-customer-info'); - Route::get('/magasin-info/{id}/{mode?}', [MagasinsController::class, 'getMagasinInfo']) - ->name('get-magasin-info'); - // Commandes. - Route::get('/orders', [OrdersController::class, 'index'])->name('orders'); - Route::get('/orders/today', [OrdersController::class, 'today'])->name('orders.today'); - Route::get('/orders/{reference}', [OrdersController::class, 'orderDetail'])->name('order-detail'); - Route::get('/orders/{reference}/advance', [OrdersController::class, 'changeStatus']) - ->name('change-order-status'); - Route::get('/orders/{reference}/cancel', [OrdersController::class, 'cancelOrder']) - ->name('cancel-order'); - }); +Route::post('/logout', [LoginController::class, 'logout'])->name('auth.logout.post'); + +Route::middleware(['auth:backend', 'has-role:Admin'])->group(function (): void { + + // * DASHBOARD + Route::get('/', [DashboardController::class, 'index'])->name('dashboard'); + + // * STATIC PAGES + Route::resource('pages', PageController::class)->only(['edit', 'update']) + ->withoutMiddleware('htmlsanitize') + ->middleware('htmlsanitize:content'); + + // * FAQS + Route::resource('faqs', FaqsController::class)->except(['show']) + ->withoutMiddleware('htmlsanitize') + ->middleware('htmlsanitize:answer'); + Route::patch('/faqs/{faq}/{action}', [FaqsController::class, 'changeOrder'])->name('faqs.change-order'); + + // * SLIDES + Route::resource('slides', SlidesController::class)->except(['show']) + ->withoutMiddleware('htmlsanitize') + ->middleware('htmlsanitize:text'); + Route::patch('/slides/{slide}/{action}', [SlidesController::class, 'changeOrder'])->name('slides.change-order'); + + // * TAGS + Route::resource('tags', TagsController::class)->except(['show']); + Route::patch('/tags/{tag}/toggle-status', [TagsController::class, 'toggleStatus'])->name('tags.toggle-status'); + Route::patch('/tags/{tag}/{action}', [TagsController::class, 'changeOrder'])->name('tags.change-order'); + + // * EMPLOYEES + Route::post('/settings/employees/sync', [EmployeesController::class, 'launchSyncJob'])->name('settings.employees.sync'); + + // * SETTINGS + Route::get('/settings', [SettingsController::class, 'edit'])->name('settings.edit'); + Route::put('/settings', [SettingsController::class, 'update'])->name('settings.update'); + + // * RANGES + Route::resource('ranges', RangesController::class)->except(['show']) + ->withoutMiddleware('htmlsanitize') + ->middleware('htmlsanitize:description'); + Route::patch('/ranges/{range}/toggle-status', [RangesController::class, 'toggleStatus'])->name('ranges.toggle-status'); + Route::patch('/ranges/{range}/{action}', [RangesController::class, 'changeOrder'])->name('ranges.change-order'); + + // * PRODUCTS + Route::resource('products', ProductsController::class)->except(['show']) + ->withoutMiddleware('htmlsanitize') + ->middleware('htmlsanitize:description'); + Route::post('/products/mass-actions', [ProductsController::class, 'massActions'])->name('products.mass-actions'); + Route::patch('/products/{product}/toggle-status', [ProductsController::class, 'toggleStatus'])->name('products.toggle-status'); + Route::patch('/products/{product}/toggle-star', [ProductsController::class, 'toggleStar'])->name('products.toggle-star'); + Route::patch( + '/products/{product}/change-selected-order', + [ProductsController::class, 'changeSelectedOrder'] + )->name('products.change-selected-order'); + Route::patch('/products/{product}/{action}', [ProductsController::class, 'changeOrder'])->name('products.change-order'); + + // * PRODUCTS INCO + Route::get('/products/{product}/incos/preview/{no_art}', [ProductIncosController::class, 'preview'])->name('products.incos.preview'); + Route::post('/products/{product}/incos/associate', [ProductIncosController::class, 'associate'])->name('products.incos.associate'); + Route::post('/products/{product}/incos/sync', [ProductIncosController::class, 'sync'])->name('products.incos.sync'); + Route::get('/products/{product}/incos/create', [ProductIncosController::class, 'edit'])->name('products.incos.create'); + Route::get('/products/{product}/incos/{inco?}/edit', [ProductIncosController::class, 'edit'])->name('products.incos.edit'); + + // * MERCHANDISING + Route::get('/products/starred', [ProductsController::class, 'starred'])->name('merch.starred'); + Route::resource('discounts', DiscountsController::class)->except(['show']); + + // * SHOPS + Route::resource('shops', ShopsController::class)->except(['show']); + Route::get('/shops/{shop}/pickup-exceptions', [ShopsController::class, 'pickupExceptionsEdit'])->name('shops.pickup-exceptions.edit'); + Route::put('/shops/{shop}/pickup-exceptions', [ShopsController::class, 'pickupExceptionsUpdate'])->name('shops.pickup-exceptions.update'); + + // * PICKUP EXCEPTIONS + Route::resource('pickup-exceptions', PickupExceptionsController::class)->except(['show']); + + // * ORDERS + Route::get('orders/today', [OrdersController::class, 'today'])->name('orders.today'); + Route::resource('orders', OrdersController::class)->only(['index', 'show']); + Route::post('orders/{order}/cancel', [OrdersController::class, 'cancel'])->name('orders.cancel'); +}); diff --git a/routes/web-fo.php b/routes/web-fo.php index 12117fe3..de7ce398 100644 --- a/routes/web-fo.php +++ b/routes/web-fo.php @@ -1,103 +1,103 @@ group(function () { - // Customer connect. - Route::get('/connexion', [CustomerController::class, 'authenticateForm'])->name('connexion') - ->middleware('guest'); - Route::post('/connexion', [CustomerController::class, 'authenticate'])->name('connexion.post') - ->middleware('guest'); - Route::get('/deconnexion', [CustomerController::class, 'logout'])->name('deconnexion') - ->middleware('auth:customer'); - // Customer inscription. - Route::get('/inscription', [CustomerController::class, 'registerForm'])->name('register') - ->middleware('guest'); - Route::post('/inscription', [CustomerController::class, 'register'])->name('register.post') - ->middleware('guest'); - Route::get('/activer/{hashcode}', [CustomerController::class, 'activate'])->name('activer'); - // Formulaire de demande de réinit. - Route::get('/mot-de-passe-oublie', [CustomerController::class, 'forgotPasswordForm'])->name('forgot-password'); - // Réinit et envoi mail. - Route::post('/reinitialiser-mdp', [CustomerController::class, 'passwordReset'])->name('reinit-mdp'); - // Formulaire reinit. - Route::get('/reinitialiser-mdp/{token}', [CustomerController::class, 'viewChangePassword']) - ->name('form-change-mdp'); - // Changement en crm. - Route::post('/reinitialiser-mdp/{token}', [CustomerController::class, 'changePassword']) - ->name('change-password'); - }); +// * AUTH +Route::name('auth.')->prefix('auth')->middleware( + 'throttle:' . RouteServiceProvider::ROUTE_GROUP_WEB_CREDENTIALS +)->group(function (): void { -Route::name('account.') - ->prefix('compte') - ->middleware('auth:customer') - ->group(function () { - Route::get('/profil', [CustomerController::class, 'dashboard'])->name('dashboard'); - Route::post('/profil', [CustomerController::class, 'updateInfos'])->name('update-infos'); - Route::post( - '/profil/change-mdp', - [CustomerController::class, 'changePasswordWhenAuthenticated'] - )->name('change-password'); - Route::get('/commandes', [CustomerController::class, 'myOrders'])->name('my-orders'); - Route::get('/commandes/{reference}', [CustomerController::class, 'orderDetail'])->name('order-detail'); - }); - -// Tunnel de commande. -Route::prefix('commande') -->name('sales.') -->middleware('auth:customer') -->group(function () { - // Puisqu'on a le middleware on s'épargne une étape. - // Recap. - Route::get('/recap', [OrderTunnelController::class, 'recapOrder'])->name('recap'); - Route::post('/recap', [OrderTunnelController::class, 'store'])->name('order-init'); - // Choice timeslot. - Route::get('/collect/{reference}', [OrderTunnelController::class, 'timeSlotPick'])->name('pick-slot'); - Route::post('/collect', [OrderTunnelController::class, 'setTimeSlot'])->name('order-save-slot'); - // Confirm. - Route::get('/confirm/{reference}', [OrderTunnelController::class, 'confirmOrder'])->name('confirm'); + Route::get('connexion', [LoginController::class, 'showLoginForm'])->name('connexion'); + Route::post('connexion', [LoginController::class, 'login'])->name('connexion.post'); + Route::get('inscription', [RegisterController::class, 'showForm'])->name('register'); + Route::post('inscription', [RegisterController::class, 'submitForm'])->name('register.post'); + Route::get('mot-de-passe-oublie', [ForgotPasswordController::class, 'showLinkRequestForm'])->name('ask-reset-password'); + Route::post('mot-de-passe-oublie', [ForgotPasswordController::class, 'sendResetLinkEmail'])->name('ask-reset-password.post'); + Route::get('reinitialiser-mdp/{token}', [ResetPasswordController::class, 'showResetForm'])->name('reset-password'); + Route::post('reinitialiser-mdp/{token}', [ResetPasswordController::class, 'reset'])->name('reset-password.post'); + Route::get('email/verify', [VerificationController::class, 'show'])->name('verification.notice'); + Route::get('email/verify/{id}/{hash}', [VerificationController::class, 'verify'])->name('verification.verify'); + Route::post('email/resend', [VerificationController::class, 'resend'])->name('verification.resend'); + Route::post('deconnexion', [LoginController::class, 'logout'])->name('deconnexion'); }); -// WEB-SHOP. -Route::get('/', [HomeController::class, 'index'])->name('home'); -Route::get('/cgv', [IndexController::class, 'terms'])->name('terms'); -Route::get('/faq', [IndexController::class, 'faq'])->name('faq'); +// * CUSTOMER AUTHENTICATED +Route::middleware(['auth:frontend', 'verified', 'is-employed'])->group(function (): void { -// Products display. -Route::get('/produits/{filtersMenuIsOpen?}', [ProductsController::class, 'allProductsFiltered'])->name('products'); + // * ACCOUNT + Route::name('account.')->prefix('compte')->group(function (): void { + // * DASHBOARD + Route::get('/', [CustomerController::class, 'dashboard'])->name('dashboard'); -// Product. -Route::get('/produit/{productSlug}', [ProductsController::class, 'product'])->name('product') - ->middleware('redirect-slugs'); + // * CUSTOMER + Route::name('edit.')->group(function (): void { + // * INFOS + Route::get('profil', [CustomerController::class, 'editInfos'])->name('infos.show'); + Route::post('profil', [CustomerController::class, 'editInfosSubmit'])->name('infos.update'); -// Contact. -Route::get('/contactez-nous', [ContactController::class, 'contact'])->name('contact'); -Route::post('/contactez-nous', [ContactController::class, 'contactSubmit'])->name('contact-us.submit'); + // * SECURITY + Route::get('mot-de-passe', [PasswordController::class, 'editPassword'])->name('password.show'); + Route::post('mot-de-passe', [PasswordController::class, 'editPasswordSubmit'])->name('password.update'); + }); -// Legals. -Route::get('/mentions-legales', [IndexController::class, 'legalNotice'])->name('legal-notice'); -Route::get('/charte-de-confidentialite', [IndexController::class, 'privacy'])->name('privacy'); - -Route::prefix('ajax') - ->name('ajx.') - ->group(function () { - Route::post('/add-to-cart', [BasketController::class, 'addToCart'])->name('cart.add'); - Route::post('/multi-add-to-cart', [BasketController::class, 'addToCartLot'])->name('cart.addlot'); - Route::post('/get-cart', [BasketController::class, 'getCartRequest'])->name('cart.get'); - Route::post('/remove-from-cart', [BasketController::class, 'removeFromCart'])->name('cart.remove'); - Route::post('/empty-cart', [BasketController::class, 'emptyCart'])->name('cart.empty'); - Route::post('/get-time-slots', [OrderTunnelController::class, 'getAvailableCreneaux'])->name('get-creneaux'); + // * ORDERS + Route::get('commandes', [OrderController::class, 'index'])->name('orders.index'); + Route::get('commandes/{order:reference}', [OrderController::class, 'show'])->name('orders.show'); }); -// * Unsubscribe from newsletter -Route::get('/unsubscribe', [CustomerController::class, 'unsubscribeNewsletter']) - ->name('unsubscribeNewsletter'); + // * ORDER TUNNEL + Route::prefix('commande')->name('sales.')->group(function (): void { + // * 1. BASKET + Route::get('panier', [TunnelController::class, 'basketSummary'])->name('summary'); + Route::post('panier', [TunnelController::class, 'basketSummarySubmit'])->name('summary.submit'); + + // * 2. TIME SLOT + Route::get('creneaux', [TunnelController::class, 'pickTimeSlot'])->name('pick-time-slot'); + Route::post('creneaux', [TunnelController::class, 'pickTimeSlotSubmit'])->name('pick-time-slot.submit'); + + // * 3. CONFIRMATION & CHECKOUT + Route::get('confirmation', [TunnelController::class, 'confirmation'])->name('confirmation'); + Route::post('confirmation', [TunnelController::class, 'confirmationSubmit'])->name('confirmation.submit'); + + // * 4. CONFIRMATION DONE + Route::get('confirmation/{order:reference}', [TunnelController::class, 'confirmed'])->name('confirmation.show-confirmed'); + }); +}); + +// * PUBLIC +Route::group([], function (): void { + // * PAGES + Route::get('/', [HomeController::class, 'index'])->name('pages.home'); + Route::get('cgv', [PageController::class, 'terms'])->name('pages.terms'); + Route::get('faq', [PageController::class, 'faq'])->name('pages.faq'); + Route::get('mentions-legales', [PageController::class, 'legalNotice'])->name('pages.legal-notice'); + Route::get('charte-de-confidentialite', [PageController::class, 'privacy'])->name('pages.privacy'); + + // * CONTACT PAGE + Route::get('contactez-nous', [ContactController::class, 'showForm'])->name('pages.contact'); + Route::post('contactez-nous', [ContactController::class, 'submitForm'])->name('pages.contact.submit'); + + // * PRODUCTS + Route::get('produits', [ProductsController::class, 'index'])->name('products.index'); + Route::get('produit/{productWithPricingPublished}', [ProductsController::class, 'view'])->name('products.show'); + + // * NEWSLETTER + Route::get('unsubscribe', [NewsletterController::class, 'unsubscribe'])->name('newsletter.unsubscribe'); +}); diff --git a/server.php b/server.php deleted file mode 100644 index 5fb6379e..00000000 --- a/server.php +++ /dev/null @@ -1,21 +0,0 @@ - - */ - -$uri = urldecode( - parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) -); - -// This file allows us to emulate Apache's "mod_rewrite" functionality from the -// built-in PHP web server. This provides a convenient way to test a Laravel -// application without having installed a "real" web server software here. -if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { - return false; -} - -require_once __DIR__.'/public/index.php'; diff --git a/shared/DDD/Directory.php b/shared/DDD/Directory.php new file mode 100644 index 00000000..62c1023a --- /dev/null +++ b/shared/DDD/Directory.php @@ -0,0 +1,15 @@ +value->toString(); + } + + public function equals(mixed $other): bool + { + return $other instanceof self && $this->value->equals($other->value); + } +} diff --git a/shared/DDD/Equatable.php b/shared/DDD/Equatable.php new file mode 100644 index 00000000..11eaef57 --- /dev/null +++ b/shared/DDD/Equatable.php @@ -0,0 +1,10 @@ +value; + } + + public function label(): string + { + return self::toLabels()[$this->name] ?? ucfirst(strtolower($this->name)); + } + + public function name(): string + { + return $this->name; + } + + /** + * @return array + */ + public static function toLabels(): array + { + static $cache = null; + + if ($cache !== null) { + return $cache; + } + + $labels = defined(self::class . '::' . self::LABELS_CONSTANT_NAME) + ? constant(self::class . '::' . self::LABELS_CONSTANT_NAME) + : null; + + $result = []; + foreach (self::cases() as $enum) { + if ($labels !== null && ! isset($labels[$enum->name])) { + throw new \Error('Missing definition label ' . self::class . " for '{$enum->name}'"); + } + $result[$enum->name] = $labels[$enum->name] ?? ucfirst(strtolower($enum->name)); + } + + return $cache = $result; + } + + /** + * @return array + */ + public static function toValues(): array + { + static $cache = null; + + if ($cache !== null) { + return $cache; + } + + return $cache = array_column( + self::cases(), + 'value', + 'name' + ); + } + + /** + * @param self|V $value + */ + public static function make(self | int | string $value, string $field = 'value'): ?self + { + if ($value instanceof self) { + return $value; + } + + if ($field === 'value') { + $tryValue = null; + try { + $tryValue = self::tryFrom(intval($value)); + } catch (\ValueError) { + $tryValue = self::tryFrom(strval($value)); + } finally { + if ($tryValue !== null) { + return $tryValue; + } + } + } + + if ($field === 'label') { + $normalizedSearch = preg_replace('/[\W_]+/u', '', mb_strtolower((string) $value)); + + foreach (self::cases() as $enum) { + $normalizedLabel = preg_replace('/[\W_]+/u', '', mb_strtolower($enum->label())); + if ($normalizedLabel === $normalizedSearch) { + return $enum; + } + } + + return null; + } + + foreach (self::cases() as $enum) { + if ($enum->{$field} === $value) { + return $enum; + } + } + + return null; + } + + public function equals(object ...$others): bool + { + return in_array($this, $others, true); + } + + public function jsonSerialize(): mixed + { + return $this->value; + } + + // * PRIVATE + + /** + * @return array> + */ + private static function getCustomDefinitions(): array + { + static $cache = null; + + if ($cache !== null) { + return $cache; + } + + $names = array_column(self::cases(), 'name', 'name'); + $filteredConstants = []; + + foreach ((new \ReflectionClass(self::class))->getConstants() as $key => $constant) { + if ($key === self::LABELS_CONSTANT_NAME || ! \is_array($constant)) { + continue; + } + + if (! empty(array_intersect_key($constant, $names))) { + $filteredConstants[$key] = $constant; + } + } + + return $cache = $filteredConstants; + } +} diff --git a/shared/Exceptions/InvalidUuidException.php b/shared/Exceptions/InvalidUuidException.php new file mode 100644 index 00000000..8b97f27e --- /dev/null +++ b/shared/Exceptions/InvalidUuidException.php @@ -0,0 +1,13 @@ + $now->between($from, $to), + $from !== null => $now->greaterThanOrEqualTo($from), + $to !== null => $now->lessThanOrEqualTo($to), + default => true, + }; + } + + public static function toRfc3339(\DateTimeInterface | string $datetime): string + { + $datetime = is_string($datetime) ? self::parseDateTime($datetime) : $datetime; + + return $datetime->format(\DATE_RFC3339); + } + + public static function parseDateTime(string $datetime): \DateTimeInterface + { + $datetime = trim($datetime); + + /** @var \DateTimeInterface|null */ + $output = null; + + switch (true) { + case (bool) preg_match(self::FRENCH_DATE_REGEX, $datetime): + $output = self::parseFrench($datetime); + break; + case (bool) preg_match(self::FRENCH_DATE_INVERT_REGEX, $datetime): + $output = self::parseFrenchInverted($datetime); + break; + case (bool) preg_match(self::RFC3339_REGEX, $datetime): + $output = self::parseRfc3339($datetime); + break; + case (bool) preg_match(self::ISO8601_REGEX, $datetime): + $output = self::parseIso8601($datetime); + break; + default: + try { + $output = new \DateTimeImmutable($datetime); + } catch (\Exception) { + throw new \InvalidArgumentException('Unrecognized date/time format: ' . $datetime); + } + } + + return $output; + } + + protected static function parseFrench(string $datetime): \DateTimeInterface + { + $dt = \DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $datetime . ' 00:00:00'); + + return $dt ?: self::parseFallback($datetime); + } + + protected static function parseFrenchInverted(string $datetime): \DateTimeInterface + { + $dt = \DateTimeImmutable::createFromFormat('d-m-Y H:i:s', $datetime . ' 00:00:00'); + + return $dt ?: self::parseFallback($datetime); + } + + protected static function parseRfc3339(string $datetime): \DateTimeInterface + { + $dt = \DateTimeImmutable::createFromFormat(\DateTime::RFC3339, $datetime); + if ($dt !== false) { + return $dt; + } + + $dt = \DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.uP', $datetime); + + return $dt ?: self::parseFallback($datetime); + } + + protected static function parseIso8601(string $datetime): \DateTimeInterface + { + $dt = \DateTimeImmutable::createFromFormat(\DateTimeInterface::ATOM, $datetime); + + return $dt ?: self::parseFallback($datetime); + } + + protected static function parseFallback(string $datetime): \DateTimeInterface + { + try { + return new \DateTimeImmutable($datetime); + } catch (\Throwable) { + throw new \InvalidArgumentException("Unrecognized date/time format: {$datetime}"); + } + } +} diff --git a/shared/Helpers/StringEncoder.php b/shared/Helpers/StringEncoder.php new file mode 100644 index 00000000..aa1788e6 --- /dev/null +++ b/shared/Helpers/StringEncoder.php @@ -0,0 +1,330 @@ + + */ + private const array CANONICAL_ENCODINGS = [ + 'UTF-8', + 'Windows-1252', + 'ISO-8859-15', + ]; + + /** + * Lowercase alias -> canonical name. + * + * Windows-1252 absorbs ISO-8859-1/Latin-1 because it is a strict superset: + * bytes 0xA0-0xFF are identical, and 0x80-0x9F are defined in Win-1252 + * but undefined (and useless) in ISO-8859-1. + * + * @var array + */ + private const array ENCODING_ALIASES = [ + // UTF-8 + 'utf8' => 'UTF-8', + 'utf-8' => 'UTF-8', + + // Windows-1252 (absorbs Latin-1 / ISO-8859-1) + 'win1252' => 'Windows-1252', + 'windows1252' => 'Windows-1252', + 'cp1252' => 'Windows-1252', + 'latin1' => 'Windows-1252', + 'latin-1' => 'Windows-1252', + 'iso-8859-1' => 'Windows-1252', + + // ISO-8859-15 (Latin-9) + 'latin9' => 'ISO-8859-15', + 'latin-9' => 'ISO-8859-15', + 'iso-8859-15' => 'ISO-8859-15', + ]; + + /** + * Windows-1252 specific codepoints (0x80-0x9F) absent from ISO-8859-1. + * + * Bytes 0x81, 0x8D, 0x8F, 0x90, 0x9D are officially undefined in Windows-1252. + * They are intentionally absent - encountering them triggers the + * Latin-1 fallback (Unicode codepoint = byte value). + * + * @var array Byte value -> UTF-8 character. + */ + private const array WIN1252_SPECIAL_BYTES = [ + 0x80 => "\u{20AC}", // € + 0x82 => "\u{201A}", // ‚ + 0x83 => "\u{0192}", // ƒ + 0x84 => "\u{201E}", // „ + 0x85 => "\u{2026}", // … + 0x86 => "\u{2020}", // † + 0x87 => "\u{2021}", // ‡ + 0x88 => "\u{02C6}", // ˆ + 0x89 => "\u{2030}", // ‰ + 0x8A => "\u{0160}", // Š + 0x8B => "\u{2039}", // ‹ + 0x8C => "\u{0152}", // Œ + 0x8E => "\u{017D}", // Ž + 0x91 => "\u{2018}", // ' + 0x92 => "\u{2019}", // ' + 0x93 => "\u{201C}", // " + 0x94 => "\u{201D}", // " + 0x95 => "\u{2022}", // • + 0x96 => "\u{2013}", // – + 0x97 => "\u{2014}", // — + 0x98 => "\u{02DC}", // ˜ + 0x99 => "\u{2122}", // ™ + 0x9A => "\u{0161}", // š + 0x9B => "\u{203A}", // › + 0x9C => "\u{0153}", // œ + 0x9E => "\u{017E}", // ž + 0x9F => "\u{0178}", // Ÿ + ]; + + /** + * ISO-8859-15 bytes that differ from ISO-8859-1. + * Only 8 codepoints differ between Latin-1 and Latin-9. + * + * @var array Byte value -> UTF-8 character. + */ + private const array LATIN9_OVERRIDES = [ + 0xA4 => "\u{20AC}", // € (replaces ¤) + 0xA6 => "\u{0160}", // Š (replaces ¦) + 0xA8 => "\u{0161}", // š (replaces ¨) + 0xB4 => "\u{017D}", // Ž (replaces ´) + 0xB8 => "\u{017E}", // ž (replaces ¸) + 0xBC => "\u{0152}", // Œ (replaces ¼) + 0xBD => "\u{0153}", // œ (replaces ½) + 0xBE => "\u{0178}", // Ÿ (replaces ¾) + ]; + + private function __construct() + { + // Static class + } + + /** + * Converts a string from a known encoding to UTF-8. + * + * @param bool $stripBom Remove UTF-8 BOM from the result if present. + * + * @throws \ValueError If encoding is unsupported or the string is invalid. + */ + public static function toUtf8( + string $string, + string $sourceEncoding, + bool $stripBom = true, + ): string { + if ($string === '') { + return ''; + } + + $canonical = self::resolveEncoding($sourceEncoding); + + $result = match ($canonical) { + 'UTF-8' => self::ensureValidUtf8($string), + 'Windows-1252' => self::fromSingleByte($string, self::WIN1252_SPECIAL_BYTES), + 'ISO-8859-15' => self::fromSingleByte($string, self::LATIN9_OVERRIDES), + default => throw new \ValueError(sprintf( + 'Unsupported encoding "%s". Supported: %s', + $canonical, + implode(', ', self::supportedEncodings()), + )) + }; + + return $stripBom ? self::stripUtf8Bom($result) : $result; + } + + /** + * Attempts to detect the encoding and convert to UTF-8. + * + * Detection strategy: + * 1. If the string is valid UTF-8, it is treated as UTF-8. + * 2. Otherwise, the configured fallback encoding is used. + * + * This two-step approach is more reliable than mb_detect_encoding + * for single-byte encodings (which accept any byte sequence). + * + * @param string $fallbackEncoding Encoding to assume when the string is not valid UTF-8. + * Defaults to 'Windows-1252' (covers most Western European legacy data). + * @param bool $stripBom Remove UTF-8 BOM from the result if present. + * + * @throws \ValueError If fallbackEncoding is unsupported or is 'UTF-8'. + */ + public static function detectAndConvertToUtf8( + string $string, + string $fallbackEncoding = 'Windows-1252', + bool $stripBom = true, + ): string { + if ($string === '') { + return ''; + } + + $canonical = self::resolveEncoding($fallbackEncoding); + + if ($canonical === 'UTF-8') { + throw new \ValueError( + 'Fallback encoding cannot be UTF-8. Use toUtf8() for explicit UTF-8 validation.', + ); + } + + // UTF-8 is the only encoding we can reliably detect: + // it has strict byte sequence rules that reject invalid sequences. + if (mb_check_encoding($string, 'UTF-8')) { + $result = $string; + } else { + $result = self::toUtf8($string, $canonical, stripBom: false); + } + + return $stripBom ? self::stripUtf8Bom($result) : $result; + } + + /** + * Converts an array of strings to UTF-8 from a known encoding. + * + * @param list $strings + * @return list + */ + public static function arrayToUtf8( + array $strings, + string $sourceEncoding, + bool $stripBom = true, + ): array { + return array_map( + static fn (string $s): string => self::toUtf8($s, $sourceEncoding, $stripBom), + $strings, + ); + } + + /** + * Returns all supported encoding names (canonical + aliases). + * + * @return list + */ + public static function supportedEncodings(): array + { + return array_values(array_unique([ + ...self::CANONICAL_ENCODINGS, + ...array_keys(self::ENCODING_ALIASES), + ])); + } + + /** + * Resolves a user-supplied encoding name to its canonical form. + * + * @throws \ValueError If encoding is unknown. + */ + private static function resolveEncoding(string $encoding): string + { + $normalized = strtolower(trim($encoding)); + + if (isset(self::ENCODING_ALIASES[$normalized])) { + return self::ENCODING_ALIASES[$normalized]; + } + + $match = array_find( + self::CANONICAL_ENCODINGS, + static fn (string $canonical): bool => strtolower($canonical) === $normalized, + ); + + if ($match !== null) { + return $match; + } + + throw new \ValueError(sprintf( + 'Unsupported encoding "%s". Supported: %s', + $encoding, + implode(', ', self::supportedEncodings()), + )); + } + + /** + * Validates that a string is well-formed UTF-8. + * + * @throws \ValueError If the string contains invalid UTF-8 sequences. + */ + private static function ensureValidUtf8(string $string): string + { + if (! mb_check_encoding($string, 'UTF-8')) { + throw new \ValueError('String is not valid UTF-8.'); + } + + return $string; + } + + /** + * Converts a single-byte encoded string to UTF-8. + * + * All supported single-byte encodings share the same base: + * - 0x00-0x7F: ASCII (identity) + * - 0x80-0xFF: Encoding-specific - use overrides map first, then Latin-1 identity. + * + * @param array $overrides Byte -> UTF-8 mapping for encoding-specific codepoints. + * For Windows-1252: the 0x80-0x9F special range. + * For ISO-8859-15: the 8 bytes that differ from Latin-1. + */ + private static function fromSingleByte(string $string, array $overrides): string + { + /** @var array $bytes keyed from 1 (unpack behavior) */ + $bytes = unpack('C*', $string); + $parts = []; + + foreach ($bytes as $byte) { + $parts[] = match (true) { + $byte >= 0 && $byte <= 0x7F => chr($byte), + isset($overrides[$byte]) => $overrides[$byte], + default => self::encodeLatin1ByteAsUtf8($byte), + }; + } + + return implode('', $parts); + } + + /** + * Encodes a single byte (0x80-0xFF) as a two-byte UTF-8 sequence. + * + * For Latin-1 / ISO-8859-1, the Unicode codepoint equals the byte value, + * so the UTF-8 encoding is: 110xxxxx 10xxxxxx. + * + * @throws \ValueError If the byte is outside the expected range. + */ + private static function encodeLatin1ByteAsUtf8(int $byte): string + { + if ($byte < 0x80 || $byte > 0xFF) { + throw new \ValueError( + sprintf('Byte must be in range 0x80-0xFF, got 0x%02X.', $byte), + ); + } + + return chr(0xC0 | ($byte >> 6)) . chr(0x80 | ($byte & 0x3F)); + } + + /** + * Strips the UTF-8 BOM (EF BB BF) if present at the start of the string. + */ + private static function stripUtf8Bom(string $string): string + { + if (str_starts_with($string, self::UTF8_BOM)) { + return substr($string, 3); + } + + return $string; + } +} diff --git a/shared/Helpers/StringHelper.php b/shared/Helpers/StringHelper.php new file mode 100644 index 00000000..9f4f5fd8 --- /dev/null +++ b/shared/Helpers/StringHelper.php @@ -0,0 +1,196 @@ + mb_ucfirst(mb_strtolower($word)), + self::splitWords($value) + ); + + return implode('', $words); + } + + /** + * Convert a string to camelCase. + */ + public static function camelCase(string $value): string + { + return mb_lcfirst(self::pascalCase($value)); + } + + /** + * Split a string into words, respecting Unicode word boundaries. + */ + public static function words(string $value, int $words = 100, string $end = ' ...'): string + { + preg_match('/^\s*+(?:\S+\s*+){1,' . $words . '}/u', $value, $matches); + + if (! isset($matches[0]) || mb_strlen($value) === mb_strlen($matches[0])) { + return $value; + } + + return rtrim($matches[0]) . $end; + } + + /** + * Sanitizes and normalizes a text string (strips HTML, removes non-printable control characters, ensures valid UTF-8). + */ + public static function sanitize(?string $value): ?string + { + if ($value === null || $value === '') { + return $value; + } + + // Decode HTML entities then strip tags + $value = html_entity_decode($value, ENT_QUOTES | ENT_HTML5, 'UTF-8'); + $value = strip_tags($value); + + // Normalize newlines, temporarily convert to
to preserve paragraph breaks + $value = str_replace(["\r\n", "\r"], "\n", $value); + $value = str_replace("\n", '
', $value); + + // Ensure valid UTF-8 (handling Windows-1252 / ISO-8859-1 legacy strings) + $value = StringEncoder::detectAndConvertToUtf8($value); + + // Remove astral symbols (4-byte UTF-8) that may break storage/processing + $value = preg_replace('/[\x{10000}-\x{10FFFF}]/u', '', $value) ?? ''; + + // Remove control/non-printable characters but keep TAB(0x09), LF(0x0A) and CR(0x0D) + $value = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F\xA0\xAD]/u', '', $value) ?? ''; + + // Revert
back to newlines and final strip_tags as safety + $value = str_replace('
', "\n", $value); + + return strip_tags($value); + } + + /** + * Split an arbitrary string into individual word tokens. + * + * @return list + */ + private static function splitWords(string $value): array + { + // 1. Separate camelCase transitions (e.g., "fooBar" -> "foo Bar") + $value = preg_replace('/(?<=[a-z0-9])([A-Z])/u', ' $1', $value) ?? $value; + + // 2. Separate acronyms followed by regular words (e.g., "HTTPResponse" -> "HTTP Response") + $value = preg_replace('/(?<=[A-Z])([A-Z][a-z])/u', ' $1', $value) ?? $value; + + // 3. Replace non-alphanumeric characters with whitespace + $value = preg_replace('/[^\p{L}\p{N}]+/u', ' ', $value) ?? $value; + + return array_values(array_filter( + explode(' ', trim($value)), + static fn (string $word): bool => $word !== '' + )); + } +} diff --git a/shared/Helpers/UuidHelper.php b/shared/Helpers/UuidHelper.php new file mode 100644 index 00000000..1af7a150 --- /dev/null +++ b/shared/Helpers/UuidHelper.php @@ -0,0 +1,110 @@ +toString())->toBase58(); + } + + public static function fromBase58(string $base58): UuidInterface + { + $base58 = trim($base58); + + if ($base58 === '' || ! preg_match('/^[1-9A-HJ-NP-Za-km-z]{21,22}$/', $base58)) { + throw InvalidUuidException::forValue($base58); + } + + try { + return Uuid::fromString(SymfonyUuid::fromBase58($base58)->toString()); + } catch (\Throwable) { + throw InvalidUuidException::forValue($base58); + } + } + + public static function isV4(UuidInterface $uuid): bool + { + return self::version($uuid) === 4; + } + + public static function isV7(UuidInterface $uuid): bool + { + return self::version($uuid) === 7; + } + + public static function version(UuidInterface $uuid): int + { + $fields = $uuid->getFields(); + + if ($fields instanceof Rfc4122FieldsInterface) { + $version = $fields->getVersion(); + + if ($version !== null) { + return $version; + } + } + + $uuidString = $uuid->toString(); + + if (strlen($uuidString) >= 15) { + return (int) hexdec($uuidString[14]); + } + + return 0; + } + + public static function validateUuid(UuidInterface $uuid): void + { + if (! Uuid::isValid($uuid->toString())) { + throw InvalidUuidException::forValue($uuid->toString()); + } + } + + public static function toDateTime(UuidInterface $uuid): \DateTimeImmutable + { + if (! self::isV7($uuid)) { + throw new InvalidUuidException("Cannot extract datetime from non-V7 UUID: {$uuid->toString()}"); + } + + $fields = $uuid->getFields(); + + if ($fields instanceof Rfc4122FieldsInterface) { + $timeMsHex = $fields->getTimeLow()->toString() . $fields->getTimeMid()->toString(); + } else { + $hex = str_replace('-', '', $uuid->toString()); + $timeMsHex = substr($hex, 0, 12); + } + + $timeMs = (int) hexdec($timeMsHex); + $sec = intdiv($timeMs, 1000); + $ms = $timeMs % 1000; + + $dateTime = \DateTimeImmutable::createFromFormat('U.u', sprintf('%d.%06d', $sec, $ms * 1000)); + + if ($dateTime === false) { + throw new InvalidUuidException("Failed to extract datetime from UUID: {$uuid->toString()}"); + } + + return $dateTime->setTimezone(new \DateTimeZone('UTC')); + } +} diff --git a/shared/Pagination/PageNumber.php b/shared/Pagination/PageNumber.php new file mode 100644 index 00000000..a35ec177 --- /dev/null +++ b/shared/Pagination/PageNumber.php @@ -0,0 +1,53 @@ +value <= 0) { + throw new \InvalidArgumentException('Page number must be greater than 0'); + } + } + + public static function of(int $value): self + { + return new self($value); + } + + public static function default(): self + { + return new self(self::DEFAULT_PAGE); + } + + public function value(): int + { + return $this->value; + } + + public function equals(mixed $other): bool + { + return $other instanceof self && $this->value === $other->value; + } + + public function __toString(): string + { + return (string) $this->value; + } + + public function jsonSerialize(): int + { + return $this->value; + } +} diff --git a/shared/Pagination/PageOf.php b/shared/Pagination/PageOf.php new file mode 100644 index 00000000..f94f4732 --- /dev/null +++ b/shared/Pagination/PageOf.php @@ -0,0 +1,40 @@ +items as $item) { + /** @var T $item */ + $items[] = clone $item; + } + + return $items; + } + + public function getPagination(): Pagination + { + return $this->pagination; + } + + public function getTotal(): int + { + return $this->total; + } +} diff --git a/shared/Pagination/PageSize.php b/shared/Pagination/PageSize.php new file mode 100644 index 00000000..3d70fe11 --- /dev/null +++ b/shared/Pagination/PageSize.php @@ -0,0 +1,60 @@ +value <= 0) { + throw new \InvalidArgumentException('Page size must be greater than 0'); + } + + if ($this->value > self::MAX_PAGE_SIZE) { + throw new \InvalidArgumentException('Page size must be less than or equal to ' . self::MAX_PAGE_SIZE); + } + } + + public static function of(int $value): self + { + return new self($value); + } + + public static function default(): self + { + return new self(self::DEFAULT_SIZE); + } + + public function value(): int + { + return $this->value; + } + + public function equals(mixed $other): bool + { + return $other instanceof self && $this->value === $other->value; + } + + public function __toString(): string + { + return (string) $this->value; + } + + public function jsonSerialize(): int + { + return $this->value; + } +} diff --git a/shared/Pagination/Pagination.php b/shared/Pagination/Pagination.php new file mode 100644 index 00000000..ea8faa30 --- /dev/null +++ b/shared/Pagination/Pagination.php @@ -0,0 +1,84 @@ +from; + } + + public function to(): int + { + return $this->to; + } + + public function pageSize(): PageSize + { + return new PageSize($this->to - $this->from + 1); + } + + public function pageNumber(): PageNumber + { + return new PageNumber((int) ($this->from / $this->pageSize()->value()) + 1); + } + + public function equals(mixed $other): bool + { + return $other instanceof self && $this->from === $other->from && $this->to === $other->to; + } + + public static function ofIndexes(int $from, int $to): self + { + $from = max(0, $from); + $to = clamp($to, $from + 1, $from + self::MAX_PAGE_SIZE); + + return new self($from, $to); + } + + public static function ofPage(PageNumber $pageNumber, PageSize $pageSize = new PageSize()): self + { + $fromIndex = ($pageNumber->value - 1) * $pageSize->value; + $toIndex = $fromIndex + $pageSize->value - 1; + + return new self($fromIndex, $toIndex); + } + + public static function ofOffsetAndLimit(int $offset, int $limit): self + { + $offset = max(0, $offset); + $limit = clamp($limit, 1, self::MAX_PAGE_SIZE); + + $fromIndex = $offset; + $toIndex = $offset + $limit - 1; + + return new self($fromIndex, $toIndex); + } + + public static function firstPage(PageSize $pageSize = new PageSize()): self + { + return self::ofPage(new PageNumber(1), $pageSize); + } + + public function __toString(): string + { + return sprintf('Pagination{from=%d, to=%d}', $this->from, $this->to); + } +} diff --git a/shared/ValueObjects/CrmHashcode.php b/shared/ValueObjects/CrmHashcode.php new file mode 100644 index 00000000..49e4a9d4 --- /dev/null +++ b/shared/ValueObjects/CrmHashcode.php @@ -0,0 +1,35 @@ +value = $value->toString(); + } + + public function __toString(): string + { + return $this->value; + } + + public static function fromString(string $value): self + { + return new self(Uuid::fromString($value)); + } +} diff --git a/tests/Architecture/ApplicationTest.php b/tests/Architecture/ApplicationTest.php new file mode 100644 index 00000000..ce6c0104 --- /dev/null +++ b/tests/Architecture/ApplicationTest.php @@ -0,0 +1,82 @@ +expect('App\Http\Controllers') + ->not->toUse('Domain\Entities'); + + arch('No Domain Entities are used in Policies') + ->expect('App\Policies') + ->not->toUse('Domain\Entities'); + + arch('App Repositories implement App\Contracts\Repository') + ->expect('App\Repositories') + ->toImplement('App\Contracts\Repository'); + + arch('App Directories implement App\Contracts\Directory') + ->expect('App\Directories') + ->toImplement('App\Contracts\Directory'); + + arch('App DTOs are final readonly classes') + ->expect('App\Dto') + ->classes() + ->toBeFinal() + ->toBeReadonly(); + + arch('App Actions implement App\Contracts\Action and Inputs implement ActionInput', function (): void { + $path = __DIR__ . '/../../app/Actions'; + $files = (new Finder())->files()->in($path)->name('*.php'); + + foreach ($files as $file) { + $subPath = $file->getRelativePathname(); + $className = 'App\\Actions\\' . str_replace(['/', '.php'], ['\\', ''], $subPath); + $reflection = new \ReflectionClass($className); + + if (str_ends_with($className, 'Input')) { + expect($reflection->implementsInterface(ActionInput::class)) + ->toBeTrue("{$className} must implement App\Contracts\ActionInput"); + } elseif (str_ends_with($className, 'Output')) { + if ($reflection->isEnum()) { + expect($reflection->isEnum())->toBeTrue(); + } else { + expect($reflection->isFinal()) + ->toBeTrue("{$className} must be final"); + expect($reflection->isReadOnly()) + ->toBeTrue("{$className} must be readonly"); + } + } else { + expect($reflection->implementsInterface(Action::class)) + ->toBeTrue("{$className} must implement App\Contracts\Action"); + } + } + }); + + arch('App Queries implement App\Contracts\Query and Inputs implement QueryInput', function (): void { + $path = __DIR__ . '/../../app/Queries'; + $files = (new Finder())->files()->in($path)->name('*.php'); + + foreach ($files as $file) { + $subPath = $file->getRelativePathname(); + $className = 'App\\Queries\\' . str_replace(['/', '.php'], ['\\', ''], $subPath); + $reflection = new \ReflectionClass($className); + + if (str_ends_with($className, 'Input')) { + expect($reflection->implementsInterface(QueryInput::class)) + ->toBeTrue("{$className} must implement App\Contracts\QueryInput"); + } elseif (str_ends_with($className, 'Output')) { + expect($reflection->isFinal() && $reflection->isReadOnly()) + ->toBeTrue("{$className} must be final readonly"); + } else { + expect($reflection->implementsInterface(Query::class)) + ->toBeTrue("{$className} must implement App\Contracts\Query"); + } + } + }); +}); diff --git a/tests/Architecture/CodingStandardsTest.php b/tests/Architecture/CodingStandardsTest.php new file mode 100644 index 00000000..27932164 --- /dev/null +++ b/tests/Architecture/CodingStandardsTest.php @@ -0,0 +1,52 @@ +preset()->php(); + arch()->preset()->security(); + + arch('it has no shell execution functions are used') + ->expect(['exec', 'shell_exec', 'system', 'passthru', 'proc_open']) + ->not->toBeUsed(); + + arch('it has no eval usage') + ->expect(['eval']) + ->not->toBeUsed(); + + arch('it has no dangerous file functions') + ->expect(['file_get_contents', 'file_put_contents', 'fopen']) + ->not->toBeUsed(); + + arch('it has no globals are used') + ->expect(['$GLOBALS', 'global']) + ->not->toBeUsed(); + + arch('it has no singletons') + ->expect(['getInstance', 'instance']) + ->not->toBeUsed(); + + arch('it has no insecure hashing') + ->expect(['md5', 'sha1']) + ->not->toBeUsed(); + + arch('it has no sleep function are used') + ->expect(['sleep', 'usleep']) + ->not->toBeUsed(); + + arch('it has no debug globals are used') + ->expect(['var_dump', 'die', 'print_r']) + ->not->toBeUsed(); + + arch('all app source files use strict types') + ->expect('App') + ->toUseStrictTypes(); + + arch('all domain source files use strict types') + ->expect('Domain') + ->toUseStrictTypes(); + + arch('all shared source files use strict types') + ->expect('Shared') + ->toUseStrictTypes(); +}); diff --git a/tests/Architecture/DomainTest.php b/tests/Architecture/DomainTest.php new file mode 100644 index 00000000..792fde76 --- /dev/null +++ b/tests/Architecture/DomainTest.php @@ -0,0 +1,89 @@ +expect("Domain\Entities") + ->toImplement(Entity::class); + + arch('Entities are immutable (disabled due to mock-final-classes conflict)') + ->expect("Domain\Entities") + ->toBeReadonly() + ->toBeFinal(); + + arch('ValueObjects are immutable (disabled due to mock-final-classes conflict)') + ->expect("Domain\Models\ValueObjects") + ->toBeReadonly() + ->toBeFinal(); + + arch('Ports contains only interfaces') + ->expect("Domain\Ports") + ->classes() + ->toBeInterface(); + + arch('No App classes are used in Domain') + ->expect('Domain') + ->not->toUse('App'); + + arch('No Infrastructure classes are used in Domain') + ->expect('Domain') + ->not->toUse('Infrastructure'); + + arch('No Illuminate classes are used in Domain') + ->expect('Domain') + ->not->toUse('Illuminate'); + + arch('No Symfony components are used in Domain') + ->expect('Domain') + ->not->toUse('Symfony'); + + // * Deny some Laravel Functions in Domain + arch('it has no laravel helper functions') + ->expect('Domain') + ->not->toUse([ + 'abort', + 'app', + 'auth', + 'asset', + 'back', + 'bcrypt', + 'broadcast', + 'cache', + 'config', + 'cookie', + 'csrf_token', + 'dd', + 'dump', + 'decrypt', + 'dispatch', + 'event', + 'factory', + 'logger', + 'redirect', + 'request', + 'response', + 'route', + 'session', + 'storage', + 'url', + 'throw_if', + 'throw_unless', + '__', + 'trans', + 'trans_choice', + 'view', + ]); + + arch('Port Repositories extend Shared\DDD\Repository') + ->expect("Domain\Ports\Repositories") + ->toExtend(Repository::class); + + arch('Port Directories extend Shared\DDD\Directory') + ->expect("Domain\Ports\Directories") + ->toExtend(Directory::class); +}); diff --git a/tests/Architecture/InfraTest.php b/tests/Architecture/InfraTest.php new file mode 100644 index 00000000..8dc70ca5 --- /dev/null +++ b/tests/Architecture/InfraTest.php @@ -0,0 +1,9 @@ +expect('Infra') + ->not->toUse('App'); +}); diff --git a/tests/Architecture/NamingConventionsTest.php b/tests/Architecture/NamingConventionsTest.php new file mode 100644 index 00000000..0e108688 --- /dev/null +++ b/tests/Architecture/NamingConventionsTest.php @@ -0,0 +1,121 @@ +expect("App\Cast") + ->toHaveSuffix('Cast'); + + arch('adapters repositories have Repository suffix') + ->expect("App\Adapters\Repositories") + ->toHaveSuffix('Repository'); + + arch('dtos have Dto suffix') + ->expect("App\Dtos") + ->toHaveSuffix('Dto'); + + arch('exceptions have Exception suffix') + ->expect("App\Exceptions") + ->toHaveSuffix('Exception') + ->ignoring([ + GlobalHandler::class, + ]); + + arch('controllers have Controller suffix') + ->expect("App\Http\Controllers") + ->toHaveSuffix('Controller'); + + arch('requests have Request suffix') + ->expect("App\Http\Requests") + ->toHaveSuffix('Request'); + + arch('resources have Resource suffix') + ->expect("App\Http\Resources") + ->toHaveSuffix('Resource'); + + arch('policies have Policy suffix') + ->expect("App\Policies") + ->toHaveSuffix('Policy'); + + arch('providers have Provider suffix') + ->expect("App\Providers") + ->toHaveSuffix('Provider'); + + arch('services have Service suffix') + ->expect("App\Services") + ->toHaveSuffix('Service') + ->ignoring([ + ArcadiaEmployee::class, + EmployeeSyncServiceResult::class, + ]); + + arch('queries have Query, QueryInput or QueryOutput suffix', function (): void { + $path = __DIR__ . '/../../app/Queries'; + $files = (new Finder())->files()->in($path)->name('*.php'); + + foreach ($files as $file) { + $className = $file->getBasename('.php'); + expect( + str_ends_with($className, 'Query') + || str_ends_with($className, 'QueryInput') + || str_ends_with($className, 'QueryOutput') + )->toBeTrue("{$className} must have suffix Query, QueryInput or QueryOutput"); + } + }); +}); + +describe('naming conventions in domain', function (): void { + + arch('dtos have Dto suffix') + ->expect("Domain\Dto") + ->toHaveSuffix('Dto'); + + arch('exceptions have Exception suffix') + ->expect("Domain\Exceptions") + ->toHaveSuffix('Exception'); + + arch('policies have Policy suffix') + ->expect("Domain\Policies") + ->toHaveSuffix('Policy'); + + arch('port directories have Directory suffix') + ->expect("Domain\Ports\Directories") + ->toHaveSuffix('Directory'); + + arch('port repositories have Repository suffix') + ->expect("Domain\Ports\Repositories") + ->toHaveSuffix('Repository'); + + arch('domain services have Service suffix') + ->expect("Domain\Services") + ->toHaveSuffix('Service'); +}); + +describe('naming conventions in infrastructure', function (): void { + arch('adapters implement an interface from their domain ports', function (string $folder, string $infraNs, string $domainNs): void { + $path = __DIR__ . '/../../infra/' . $folder; + $files = (new Finder())->files()->in($path)->name('*.php'); + + foreach ($files as $file) { + $className = $infraNs . '\\' . $file->getFilenameWithoutExtension(); + $interfaces = (new \ReflectionClass($className))->getInterfaceNames(); + $hasDomainPort = ! empty(array_filter( + $interfaces, + fn ($interface) => str_starts_with($interface, $domainNs) + )); + + expect($hasDomainPort) + ->toBeTrue(message: "La classe {$className} n'implémente aucune interface de {$domainNs}."); + } + })->with([ + 'Directories' => ['Adapters/Directories', 'Infrastructure\Adapters\Directories', 'Domain\Ports\Directories\\'], + 'Repositories' => ['Adapters/Repositories', 'Infrastructure\Adapters\Repositories', 'Domain\Ports\Repositories\\'], + 'Services' => ['Adapters/Services', 'Infrastructure\Adapters\Services', 'Domain\Ports\Services\\'], + ]); +}); diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index 547152f6..df084d1e 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -1,5 +1,7 @@ make(Kernel::class)->bootstrap(); diff --git a/tests/Feature/App/Http/Controllers/Bo/DashboardControllerTest.php b/tests/Feature/App/Http/Controllers/Bo/DashboardControllerTest.php new file mode 100644 index 00000000..af9bc0b8 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Bo/DashboardControllerTest.php @@ -0,0 +1,57 @@ +create(['role' => UserRole::Admin]); + $this->actingAs($user, 'backend'); + }); + + it('renders dashboard for authenticated admin', function (): void { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->get('/bo'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.dashboard'); + $response->assertViewHasAll([ + 'employeeCount', + 'customersLinkedToEmployeeCount', + 'adhesion', + 'prevDates', + 'statsShop', + 'statsCustomer', + ]); + }); + + it('renders dashboard with date range filter', function (): void { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->get('/bo?start=2026-01-01&end=2026-01-31'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.dashboard'); + $response->assertViewHas('prevDates', fn ($prevDates) => $prevDates !== null); + }); + + it('redirects unauthenticated users to login', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + Auth::guard('backend')->logout(); + + // WHEN + $response = $this->get('/bo'); + + // THEN + $response->assertRedirect('/bo/login'); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Bo/DiscountsControllerTest.php b/tests/Feature/App/Http/Controllers/Bo/DiscountsControllerTest.php new file mode 100644 index 00000000..57b22010 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Bo/DiscountsControllerTest.php @@ -0,0 +1,225 @@ +user = User::factory()->create(['role' => UserRole::SuperAdmin]); + $this->actingAs($this->user, 'backend'); + + $this->range = new Range(); + $this->range->name = 'Gamme ' . uniqid(); + $this->range->status = true; + $this->range->order = random_int(1, 9999); + $this->range->picture_alt = 'alt'; + $this->range->picture_title = 'title'; + $this->range->save(); + }); + + $createProduct = function (string $name, Range $range): Product { + $product = new Product([ + 'range_id' => $range->id, + 'name' => $name . ' ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Description test', + 'status' => true, + ]); + $product->order = random_int(1, 999999); + $product->price = Money::EUR(1000); + $product->short_description = 'Court'; + $product->picture_alt = 'alt'; + $product->picture_title = 'title'; + $product->picture_large_alt = 'alt'; + $product->picture_large_title = 'title'; + $product->save(); + + return $product; + }; + + it('can access index', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $discount = new Discount(); + $discount->type = DiscountType::PERCENT; + $discount->value = DiscountValue::fromPercentage(20); + $discount->is_old_price_displayed = true; + $discount->save(); + + // WHEN + $response = $this->get('/bo/discounts'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.discounts.index'); + $response->assertSee("discount={$discount->id}"); + }); + + it('can access create', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + + // WHEN + $response = $this->get('/bo/discounts/create'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.discounts.create'); + }); + + it('can store a discount with associated products', function () use ($createProduct): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $product1 = $createProduct('Produit 1', $this->range); + $product2 = $createProduct('Produit 2', $this->range); + + $data = [ + 'type' => DiscountType::PERCENT->value, + 'value' => 15, + 'is_old_price_displayed' => true, + 'date_start' => null, + 'date_end' => null, + 'client_timezone' => 'UTC', + 'associated_products' => [(string) $product1->id, (string) $product2->id], + ]; + + // WHEN + $response = $this->post('/bo/discounts', $data); + + // THEN + $discount = Discount::query()->first(); + expect($discount)->not->toBeNull() + ->and($discount?->type)->toBe(DiscountType::PERCENT) + ->and($discount?->value->getPercentage())->toBe(15); + + $freshProduct1 = Product::query()->find($product1->id); + $freshProduct2 = Product::query()->find($product2->id); + expect($freshProduct1?->discount_id)->toBe($discount?->id) + ->and($freshProduct2?->discount_id)->toBe($discount?->id); + + $response->assertRedirect("/bo/discounts/{$discount?->id}/edit"); + }); + + it('can access edit', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $discount = new Discount(); + $discount->type = DiscountType::PERCENT; + $discount->value = DiscountValue::fromPercentage(10); + $discount->is_old_price_displayed = true; + $discount->save(); + + // WHEN + $response = $this->get("/bo/discounts/{$discount->id}/edit"); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.discounts.edit'); + }); + + it('can update a discount and sync products', function () use ($createProduct): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $product1 = $createProduct('P1', $this->range); + $product2 = $createProduct('P2', $this->range); + + $discount = new Discount(); + $discount->type = DiscountType::PERCENT; + $discount->value = DiscountValue::fromPercentage(10); + $discount->is_old_price_displayed = true; + $discount->save(); + + Product::query()->where('id', $product1->id)->update(['discount_id' => $discount->id]); + + $data = [ + 'type' => DiscountType::PERCENT->value, + 'value' => 20, + 'is_old_price_displayed' => false, + 'date_start' => null, + 'date_end' => null, + 'client_timezone' => 'UTC', + 'associated_products' => [(string) $product2->id], + ]; + + // WHEN + $response = $this->put("/bo/discounts/{$discount->id}", $data); + + // THEN + $discount->refresh(); + expect($discount->is_old_price_displayed)->toBeFalse() + ->and($discount->value->getPercentage())->toBe(20); + + $freshP1 = Product::query()->find($product1->id); + $freshP2 = Product::query()->find($product2->id); + expect($freshP1?->discount_id)->toBeNull() + ->and($freshP2?->discount_id)->toBe($discount->id); + + $response->assertRedirect("/bo/discounts/{$discount->id}/edit"); + }); + + it('can delete a discount', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $discount = new Discount(); + $discount->type = DiscountType::PERCENT; + $discount->value = DiscountValue::fromPercentage(10); + $discount->is_old_price_displayed = true; + $discount->save(); + + // WHEN + $response = $this->delete("/bo/discounts/{$discount->id}"); + + // THEN + expect(Discount::query()->find($discount->id))->toBeNull(); + $response->assertRedirect('/bo/discounts'); + }); + + describe('authorization rejections', function (): void { + it('redirects unauthenticated guest to login', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + auth('backend')->logout(); + + // WHEN + $response = $this->get('/bo/discounts'); + + // THEN + $response->assertRedirect('/bo/login'); + }); + + it('redirects frontend customer trying to access bo to login', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + auth('backend')->logout(); + $customer = new Customer(); + $this->actingAs($customer, 'frontend'); + + // WHEN + $response = $this->get('/bo/discounts'); + + // THEN + $response->assertRedirect('/bo/login'); + }); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Bo/EmployeesControllerTest.php b/tests/Feature/App/Http/Controllers/Bo/EmployeesControllerTest.php new file mode 100644 index 00000000..e918f8f2 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Bo/EmployeesControllerTest.php @@ -0,0 +1,44 @@ +create(['role' => UserRole::SuperAdmin]); + $this->actingAs($user, 'backend'); + }); + + // FIXME: The Arcadia refresh action is inhibited, uncomment this test when api acrcadia is up. + // it('can launch employee sync job', function () { + // // GIVEN + // /** @var \Tests\TestCase $this */ + // Queue::fake(); + + // // WHEN + // $response = $this->post('/bo/settings/employees/sync'); + + // // THEN + // $response->assertSessionHasNoErrors(); + // $response->assertRedirect(route('bo.dashboard')); + // Queue::assertPushed(FetchAndUpsertArcadiaEmployees::class); + // }); + + it('redirects unauthenticated users to login', function () { + // GIVEN + /** @var \Tests\TestCase $this */ + auth()->guard('backend')->logout(); + + // WHEN + $response = $this->post('/bo/settings/employees/sync'); + + // THEN + $response->assertRedirect('/bo/login'); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Bo/FaqsControllerTest.php b/tests/Feature/App/Http/Controllers/Bo/FaqsControllerTest.php new file mode 100644 index 00000000..17c95989 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Bo/FaqsControllerTest.php @@ -0,0 +1,126 @@ +create(['role' => UserRole::SuperAdmin]); + $this->actingAs($user, 'backend'); + }); + + it('can access index', function (): void { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->get('/bo/faqs'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.faqs.index'); + }); + + it('can access create', function (): void { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->get('/bo/faqs/create'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.faqs.create'); + }); + + it('can store a faq', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $data = [ + 'question' => 'How does it work?', + 'answer' => '

Like this.

', + ]; + + // WHEN + $response = $this->post('/bo/faqs', $data); + + // THEN + $faq = Faq::query()->firstOrFail(); + expect($faq->question)->toBe('How does it work?'); + expect($faq->answer)->toBe('

Like this.

'); + + $response->assertRedirect("/bo/faqs/{$faq->id}/edit"); + }); + + it('can access edit', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $faq = new Faq(); + $faq->question = 'What is this?'; + $faq->answer = 'This is an answer.'; + $faq->save(); + + // WHEN + $response = $this->get("/bo/faqs/{$faq->id}/edit"); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.faqs.edit'); + }); + + it('can update a faq', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $faq = new Faq(); + $faq->question = 'Initial question?'; + $faq->answer = 'Initial answer.'; + $faq->save(); + + $data = [ + 'question' => 'Updated question?', + 'answer' => '

Updated answer.

', + ]; + + // WHEN + $response = $this->put("/bo/faqs/{$faq->id}", $data); + + // THEN + $faq->refresh(); + expect($faq->question)->toBe('Updated question?'); + expect($faq->answer)->toBe('

Updated answer.

'); + + $response->assertRedirect("/bo/faqs/{$faq->id}/edit"); + }); + + it('can delete a faq', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $faq = new Faq(); + $faq->question = 'Question to delete?'; + $faq->answer = 'Answer to delete.'; + $faq->save(); + + // WHEN + $response = $this->delete("/bo/faqs/{$faq->id}"); + + // THEN + expect(Faq::query()->find($faq->id))->toBeNull(); + $response->assertRedirect('/bo/faqs'); + }); + + it('can change order', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $faq = new Faq(); + $faq->question = 'Question to reorder?'; + $faq->answer = 'Answer to reorder.'; + $faq->save(); + + // WHEN + $response = $this->patch("/bo/faqs/{$faq->id}/up"); + + // THEN + expect($response->status())->toBe(302); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Bo/OrdersControllerTest.php b/tests/Feature/App/Http/Controllers/Bo/OrdersControllerTest.php new file mode 100644 index 00000000..5d6d26e7 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Bo/OrdersControllerTest.php @@ -0,0 +1,304 @@ +create(['role' => UserRole::SuperAdmin]); + $this->actingAs($user, 'backend'); + }); + + it('can access index with paginated orders and filters', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $shop = Shop::factory()->create(['name' => 'Boutique Test']); + Order::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'shop_id' => $shop->id, + 'reference' => new OrderReference(Uuid::uuid7()), + 'status' => OrderStatus::VALIDATED->value, + 'total' => new Money(2500, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule('1000101'), 'Alice', 'Smith', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Shop Name', 'Address', '75000', 'Paris'), + 'pickup_day' => Date::now()->toDateString(), + ]); + + // WHEN + $response = $this->get('/bo/orders'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.orders.index'); + $response->assertViewHas('orders', fn ($orders) => $orders instanceof LengthAwarePaginator && $orders->total() >= 1); + $response->assertViewHas('searchFields'); + $response->assertViewHas('orderStatusList'); + }); + + it('can paginate orders across pages', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $shop = Shop::factory()->create(['name' => 'Boutique Pagination']); + for ($i = 0; $i < 30; $i++) { + Order::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'shop_id' => $shop->id, + 'reference' => new OrderReference(Uuid::uuid7()), + 'status' => OrderStatus::VALIDATED->value, + 'total' => new Money(2500, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule((string) (1000100 + $i)), 'Alice', 'Smith', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Shop Name', 'Address', '75000', 'Paris'), + 'pickup_day' => Date::now()->toDateString(), + ]); + } + + // WHEN + $response = $this->get('/bo/orders?page=2'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewHas('orders', function ($orders): bool { + return $orders instanceof LengthAwarePaginator + && $orders->currentPage() === 2; + }); + }); + + it('can filter index by search term', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $refUuid = Uuid::uuid7(); + $reference = new OrderReference($refUuid); + $ref = (string) $reference; + $shop = Shop::factory()->create(['name' => 'UniqueShopSearch']); + Order::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'shop_id' => $shop->id, + 'reference' => $reference, + 'status' => OrderStatus::VALIDATED->value, + 'total' => new Money(1500, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule('1000102'), 'Bob', 'Jones', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Shop Name', 'Address', '75000', 'Paris'), + 'pickup_day' => Date::now()->toDateString(), + ]); + + // WHEN + $response = $this->get("/bo/orders?search={$ref}"); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewHas('orders', function (mixed $orders) use ($ref): bool { + /** @var \Illuminate\Pagination\LengthAwarePaginator $orders */ + return $orders instanceof \Illuminate\Pagination\LengthAwarePaginator + && $orders->total() === 1 + && (string) $orders->first()?->reference === $ref; + }); + }); + + it('sorts index orders by default by date from newest to oldest', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $shop = Shop::factory()->create(); + $olderOrder = Order::forceCreate([ + 'id' => Uuid::uuid7(Date::now()->subHours(2))->toString(), + 'shop_id' => $shop->id, + 'reference' => new OrderReference(Uuid::uuid7()), + 'status' => OrderStatus::VALIDATED->value, + 'total' => new Money(1000, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule('1000198'), 'Old', 'Order', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Shop Name', 'Address', '75000', 'Paris'), + 'pickup_day' => Date::now()->addDays(7)->toDateString(), + ]); + $newerOrder = Order::forceCreate([ + 'id' => Uuid::uuid7(Date::now())->toString(), + 'shop_id' => $shop->id, + 'reference' => new OrderReference(Uuid::uuid7()), + 'status' => OrderStatus::VALIDATED->value, + 'total' => new Money(2000, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule('1000199'), 'New', 'Order', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Shop Name', 'Address', '75000', 'Paris'), + 'pickup_day' => Date::now()->addDays(7)->toDateString(), + ]); + + // WHEN + $response = $this->get('/bo/orders'); + + // THEN + expect($response->status())->toBe(200); + /** @var \Illuminate\Pagination\LengthAwarePaginator $orders */ + $orders = $response->viewData('orders'); + expect($orders->first()?->id)->toBe($newerOrder->id) + ->and($orders->last()?->id)->toBe($olderOrder->id); + }); + + it('can access today orders and filters out past orders', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $shop = Shop::factory()->create(); + $todayOrder = Order::forceCreate([ + 'id' => Uuid::uuid7(Date::now())->toString(), + 'shop_id' => $shop->id, + 'reference' => new OrderReference(Uuid::uuid7()), + 'status' => OrderStatus::VALIDATED->value, + 'total' => new Money(3000, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule('1000103'), 'Charlie', 'Brown', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Shop Name', 'Address', '75000', 'Paris'), + 'pickup_day' => Date::now()->addDays(7)->toDateString(), + ]); + $pastOrder = Order::forceCreate([ + 'id' => Uuid::uuid7(Date::now()->subDays(3))->toString(), + 'shop_id' => $shop->id, + 'reference' => new OrderReference(Uuid::uuid7()), + 'status' => OrderStatus::VALIDATED->value, + 'total' => new Money(4000, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule('1000104'), 'Past', 'Order', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Shop Name', 'Address', '75000', 'Paris'), + 'pickup_day' => Date::now()->toDateString(), + ]); + + // WHEN + $response = $this->get('/bo/orders/today'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.orders.index-today'); + /** @var \Illuminate\Pagination\LengthAwarePaginator $orders */ + $orders = $response->viewData('orders'); + expect($orders->total())->toBe(1) + ->and($orders->first()?->id)->toBe($todayOrder->id); + }); + + it('can access order show detail', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $shop = Shop::factory()->create(); + $customer = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('customer@example.com'), + ]); + Employee::forceCreate([ + 'id' => 9991, + 'customer_id' => $customer->id, + 'matricule' => new Matricule('1000999'), + 'nom' => 'Dupont', + 'prenom' => 'Jean', + 'code' => new Code('ABCDEF12'), + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now(), + 'updated_at' => CarbonImmutable::now(), + ]); + + $crmMock = \Mockery::mock(CrmService::class); + $crmMock->shouldReceive('getCustomerFromHashCode')->andReturn(null); + App::instance(CrmService::class, $crmMock); + + $order = Order::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'shop_id' => $shop->id, + 'reference' => new OrderReference(Uuid::uuid7()), + 'status' => OrderStatus::VALIDATED->value, + 'total' => new Money(4000, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule('1000999'), 'Jean', 'Dupont', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Shop Name', 'Address', '75000', 'Paris'), + 'pickup_day' => Date::now()->toDateString(), + ]); + + // WHEN + $response = $this->get("/bo/orders/{$order->id}"); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.orders.view'); + $response->assertViewHas('order', fn ($orderData) => $orderData instanceof OrderDto && $orderData->id === (string) $order->id); + }); + + it('can cancel an order', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $shop = Shop::factory()->create(); + $order = Order::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'shop_id' => $shop->id, + 'reference' => new OrderReference(Uuid::uuid7()), + 'status' => OrderStatus::VALIDATED->value, + 'total' => new Money(2000, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule('1000104'), 'David', 'Clark', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Shop Name', 'Address', '75000', 'Paris'), + 'pickup_day' => Date::now()->toDateString(), + ]); + + // WHEN + $response = $this->post("/bo/orders/{$order->id}/cancel"); + + // THEN + $response->assertRedirect(); + $response->assertSessionHas('warning', trans('Order cancelled')); + + $refreshedOrder = Order::query()->find($order->id); + expect($refreshedOrder)->not->toBeNull() + ->and($refreshedOrder?->status)->toBe(OrderStatus::CANCELED); + }); + + it('rejects unauthenticated users', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + auth('backend')->logout(); + + // WHEN + $response = $this->get('/bo/orders'); + + // THEN + $response->assertRedirect('/bo/login'); + }); + + it('rejects cancellation of already canceled order', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $shop = Shop::factory()->create(); + $order = Order::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'shop_id' => $shop->id, + 'reference' => new OrderReference(Uuid::uuid7()), + 'status' => OrderStatus::CANCELED->value, + 'total' => new Money(2000, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule('1000105'), 'Eve', 'Stone', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Shop Name', 'Address', '75000', 'Paris'), + 'pickup_day' => Date::now()->toDateString(), + ]); + + // WHEN + $response = $this->post("/bo/orders/{$order->id}/cancel"); + + // THEN + $response->assertStatus(403); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Bo/PageControllerTest.php b/tests/Feature/App/Http/Controllers/Bo/PageControllerTest.php new file mode 100644 index 00000000..7588c270 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Bo/PageControllerTest.php @@ -0,0 +1,87 @@ +create(['role' => UserRole::SuperAdmin]); + $this->actingAs($user, 'backend'); + }); + + it('can access edit', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $page = new Page(); + $page->slug = StaticPageSlug::LEGALS; + $page->seo_title = 'Mentions légales SEO Title Test'; + $page->seo_description = 'Mentions légales SEO Description Test suffisamment longue'; + $page->title = 'Mentions Légales'; + $page->content = '

Contenu mentions légales

'; + $page->saveOrFail(); + + // WHEN + $response = $this->get('/bo/pages/legals/edit'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.pages.edit'); + $response->assertViewHas('page', fn ($pageData) => $pageData instanceof PageDto && $pageData->slug === StaticPageSlug::LEGALS); + }); + + it('can update a page', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $page = new Page(); + $page->slug = StaticPageSlug::TERMS; + $page->seo_title = 'Ancien Titre SEO suffisamment long pour la validation'; + $page->seo_description = 'Ancienne Description SEO suffisamment longue pour la validation requise'; + $page->title = 'Ancien Titre'; + $page->content = '

Ancien contenu

'; + $page->saveOrFail(); + + $data = [ + 'seo_title' => 'Conditions Générales de Ventes - Notre Boutique', + 'seo_description' => 'Découvrez l\'ensemble de nos conditions générales de vente en ligne.', + 'title' => 'Conditions Générales de Vente', + 'content' => '

Nouveau contenu CGV avec HTML.

', + ]; + + // WHEN + $response = $this->put('/bo/pages/cgv', $data); + + // THEN + $page->refresh(); + expect($page->seo_title)->toBe('Conditions Générales de Ventes - Notre Boutique') + ->and($page->seo_description)->toBe('Découvrez l\'ensemble de nos conditions générales de vente en ligne.') + ->and($page->title)->toBe('Conditions Générales de Vente') + ->and($page->content)->toBe('

Nouveau contenu CGV avec HTML.

'); + + $response->assertRedirect('/bo/pages/cgv/edit'); + }); + + it('fails validation when required fields are missing on update', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $page = new Page(); + $page->slug = StaticPageSlug::PRIVACY; + $page->seo_title = 'Politique de Confidentialité Titre SEO pour la validation'; + $page->seo_description = 'Politique de Confidentialité Description SEO pour la validation requise'; + $page->title = 'Confidentialité'; + $page->content = '

Contenu

'; + $page->saveOrFail(); + + // WHEN + $response = $this->put('/bo/pages/confidentialite', []); + + // THEN + $response->assertSessionHasErrors(['seo_title', 'seo_description', 'content']); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Bo/PickupExceptionsControllerTest.php b/tests/Feature/App/Http/Controllers/Bo/PickupExceptionsControllerTest.php new file mode 100644 index 00000000..bc70e6a1 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Bo/PickupExceptionsControllerTest.php @@ -0,0 +1,111 @@ +user = User::factory()->create(['role' => UserRole::SuperAdmin]); + $this->actingAs($this->user, 'backend'); + }); + + it('can access index', function () { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->get('/bo/pickup-exceptions'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.pickup-exceptions.index'); + }); + + it('can access create', function () { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->get('/bo/pickup-exceptions/create'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.pickup-exceptions.create'); + }); + + it('can store a pickup exception', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $data = [ + 'date' => '2026-05-01', + 'label' => 'Fête du Travail', + 'repeatable' => true, + 'repeat_frequency' => RepeatFrequency::YEARLY->value, + ]; + + // WHEN + $response = $this->post('/bo/pickup-exceptions', $data); + + // THEN + $pickupException = PickupException::query()->where('label', 'Fête du Travail')->first(); + expect($pickupException)->not->toBeNull() + ->and($pickupException->repeatable)->toBeTrue() + ->and($pickupException->repeat_frequency)->toBe(RepeatFrequency::YEARLY); + + $response->assertRedirect("/bo/pickup-exceptions/{$pickupException->id}/edit"); + }); + + it('can access edit', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $pickupException = PickupException::factory()->create(); + + // WHEN + $response = $this->get("/bo/pickup-exceptions/{$pickupException->id}/edit"); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.pickup-exceptions.edit'); + }); + + it('can update a pickup exception', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $pickupException = PickupException::factory()->create([ + 'label' => 'Old Exception', + ]); + + $data = [ + 'date' => '2026-05-08', + 'label' => 'Victoire 1945', + 'repeatable' => false, + 'repeat_frequency' => RepeatFrequency::WEEKLY->value, + ]; + + // WHEN + $response = $this->put("/bo/pickup-exceptions/{$pickupException->id}", $data); + + // THEN + $pickupException->refresh(); + expect($pickupException->label)->toBe('Victoire 1945') + ->and($pickupException->repeatable)->toBeFalse() + ->and($pickupException->auto_updated)->toBeFalse(); + + $response->assertRedirect("/bo/pickup-exceptions/{$pickupException->id}/edit"); + }); + + it('can delete a pickup exception', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $pickupException = PickupException::factory()->create(); + + // WHEN + $response = $this->delete("/bo/pickup-exceptions/{$pickupException->id}"); + + // THEN + expect(PickupException::query()->find($pickupException->id))->toBeNull(); + $response->assertRedirect('/bo/pickup-exceptions'); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Bo/ProductIncosControllerTest.php b/tests/Feature/App/Http/Controllers/Bo/ProductIncosControllerTest.php new file mode 100644 index 00000000..790c8a94 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Bo/ProductIncosControllerTest.php @@ -0,0 +1,269 @@ +user = User::factory()->create(['role' => UserRole::SuperAdmin]); + $this->actingAs($this->user, 'backend'); + + $range = new Range(); + $range->name = 'Gamme ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + $this->product = new Product([ + 'range_id' => $range->id, + 'name' => 'Poulet ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Description test', + 'status' => true, + ]); + $this->product->order = random_int(1, 999999); + $this->product->price = Money::EUR(1000); + $this->product->short_description = 'Court'; + $this->product->picture_alt = 'alt'; + $this->product->picture_title = 'title'; + $this->product->picture_large_alt = 'alt'; + $this->product->picture_large_title = 'title'; + $this->product->save(); + }); + + it('can access inco management when product has no inco', function () { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->get(route('bo.products.incos.create', $this->product)); + + // THEN + $response->assertStatus(200); + $response->assertViewIs('bo.product-incos.edit'); + $response->assertViewHas('product', fn ($p) => $p instanceof ProductDto && $p->id === (string) $this->product->id); + $response->assertViewHas('inco', null); + }); + + it('can access edit when product has an inco', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $inco = new ProductInco(); + $inco->no_art = 102; + $inco->product()->associate($this->product); + $inco->save(); + + // WHEN + $response = $this->get(route('bo.products.incos.edit', [ + 'product' => $this->product, + 'inco' => $inco, + ])); + + // THEN + $response->assertStatus(200); + $response->assertViewIs('bo.product-incos.edit'); + $response->assertViewHas('product', fn ($p) => $p instanceof ProductDto); + $response->assertViewHas('inco', fn ($i) => $i instanceof ProductIncoDto && $i->id === $inco->id); + }); + + it('can preview an inco sheet from arcadia', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $arcadiaService = \Mockery::mock(ArcadiaIncoService::class); + $previewDto = new ArcadiaIncoPreviewDto( + noArt: 27996, + name: 'POULET FERMIER', + libelle: 'Poulet Fermier Label Rouge', + brand: 'Loué', + nutriscore: 'A', + servings: '4/5', + allergens: 'Aucun', + ingredients: '

Poulet 100%

', + preparation: '

Au four

', + energyKcal: 150.0, + energyKj: 630.0, + ); + + $arcadiaService->shouldReceive('getPreview') + ->once() + ->with(27996) + ->andReturn($previewDto); + + $this->app->instance(ArcadiaIncoService::class, $arcadiaService); + + // WHEN + $response = $this->getJson(route('bo.products.incos.preview', [ + 'product' => $this->product, + 'no_art' => 27996, + ])); + + // THEN + $response->assertOk(); + $response->assertJsonPath('no_art', 27996); + $response->assertJsonPath('name', 'POULET FERMIER'); + $response->assertJsonPath('brand', 'Loué'); + $response->assertJsonPath('nutriscore', 'A'); + }); + + it('returns 404 when previewing non-existent inco sheet on arcadia', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $arcadiaService = \Mockery::mock(ArcadiaIncoService::class); + $arcadiaService->shouldReceive('getPreview') + ->once() + ->with(99999) + ->andReturnNull(); + + $this->app->instance(ArcadiaIncoService::class, $arcadiaService); + + // WHEN + $response = $this->getJson(route('bo.products.incos.preview', [ + 'product' => $this->product, + 'no_art' => 99999, + ])); + + // THEN + $response->assertNotFound(); + }); + + it('returns 502 when preview fails due to Arcadia API error', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $arcadiaService = \Mockery::mock(ArcadiaIncoService::class); + $arcadiaService->shouldReceive('getPreview') + ->once() + ->with(50000) + ->andThrow(new \RuntimeException('Connection failed')); + + $this->app->instance(ArcadiaIncoService::class, $arcadiaService); + + // WHEN + $response = $this->getJson(route('bo.products.incos.preview', [ + 'product' => $this->product, + 'no_art' => 50000, + ])); + + // THEN + $response->assertStatus(502); + $response->assertJsonPath('message', __('Arcadia API error: :error', ['error' => 'Connection failed'])); + }); + + it('can associate an inco sheet from arcadia', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $arcadiaService = \Mockery::mock(ArcadiaIncoService::class); + $incoData = new ArcadiaIncoDataDto( + noArt: 27996, + name: 'POULET FERMIER', + libelle: 'Poulet Fermier Label Rouge', + brand: 'Loué', + ingredients: '

Poulet (100%)

', + preparation: '

Au four

', + servings: '4/5', + allergens: 'Aucun', + sellingArgument: '

Excellence

', + nutriscore: Nutriscore::A, + nutriscoreArgs: null, + nutrition: new NutritionalValues(refWeightG: 100.0, kj: 600.0, kcal: 143.0), + ); + + $arcadiaService->shouldReceive('fetchInco') + ->once() + ->with(27996) + ->andReturn($incoData); + + $this->app->instance(ArcadiaIncoService::class, $arcadiaService); + + // WHEN + $response = $this->post(route('bo.products.incos.associate', $this->product), [ + 'no_art' => 27996, + ]); + + // THEN + $inco = ProductInco::query()->where('product_id', $this->product->id)->first(); + expect($inco)->not->toBeNull() + ->and($inco->no_art)->toBe(27996) + ->and($inco->nutriscore)->toBe(Nutriscore::A) + ->and($inco->ingredients)->toBe('

Poulet (100%)

'); + + $response->assertRedirect(route('bo.products.incos.edit', [ + 'product' => $this->product, + 'inco' => $inco, + ])); + $response->assertSessionHas('success'); + }); + + it('can synchronize an existing inco sheet from arcadia', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $inco = new ProductInco(); + $inco->no_art = 27996; + $inco->product()->associate($this->product); + $inco->ingredients = '

Ancien

'; + $inco->save(); + + $arcadiaService = \Mockery::mock(ArcadiaIncoService::class); + $updatedData = new ArcadiaIncoDataDto( + noArt: 27996, + name: 'POULET FERMIER MAJ', + libelle: 'Poulet Fermier Label Rouge MAJ', + brand: 'Loué', + ingredients: '

Poulet (100%) MAJ

', + preparation: '

Au four MAJ

', + servings: '4/5', + allergens: 'Aucun', + sellingArgument: null, + nutriscore: Nutriscore::A, + nutriscoreArgs: null, + nutrition: new NutritionalValues(refWeightG: 100.0, kj: 650.0, kcal: 155.0), + ); + + $arcadiaService->shouldReceive('fetchInco') + ->once() + ->with(27996) + ->andReturn($updatedData); + + $this->app->instance(ArcadiaIncoService::class, $arcadiaService); + + // WHEN + $response = $this->post(route('bo.products.incos.sync', $this->product)); + + // THEN + $refreshed = ProductInco::query()->findOrFail($inco->id); + expect($refreshed->ingredients)->toBe('

Poulet (100%) MAJ

') + ->and($refreshed->preparation)->toBe('

Au four MAJ

') + ->and($refreshed->nutrition->kj)->toBe(650.0); + + $response->assertRedirect(route('bo.products.incos.edit', [ + 'product' => $this->product, + 'inco' => $refreshed, + ])); + $response->assertSessionHas('success'); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Bo/ProductsControllerTest.php b/tests/Feature/App/Http/Controllers/Bo/ProductsControllerTest.php new file mode 100644 index 00000000..25793f4c --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Bo/ProductsControllerTest.php @@ -0,0 +1,653 @@ +user = User::factory()->create(['role' => UserRole::SuperAdmin]); + $this->actingAs($this->user, 'backend'); + }); + + it('can access index', function () { + // WHEN + $this->withoutExceptionHandling(); + $response = $this->get('/bo/products'); + + // THEN + expect($response->status())->toBe(200); + }); + + it('can filter products by specific discount id and all discounts', function () { + // GIVEN + /** @var \Tests\TestCase $this */ + $discount1 = new Discount(); + $discount1->type = DiscountType::PERCENT; + $discount1->value = DiscountValue::fromPercentage(20); + $discount1->is_old_price_displayed = true; + $discount1->save(); + + $discount2 = new Discount(); + $discount2->type = DiscountType::AMOUNT; + $discount2->value = DiscountValue::fromAmount(Money::EUR(500)); + $discount2->is_old_price_displayed = false; + $discount2->save(); + + $range = new Range(); + $range->name = 'Range ' . uniqid(); + $range->status = true; + $range->order = 1; + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + $prod1 = new Product([ + 'range_id' => $range->id, + 'name' => 'Prod Discount 1 ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Test description', + 'status' => true, + 'picture_alt' => 'alt', + 'picture_title' => 'title', + 'picture_large_alt' => 'alt', + 'picture_large_title' => 'title', + ]); + $prod1->price = Money::EUR(1000); + $prod1->discount_id = $discount1->id; + $prod1->save(); + + $prod2 = new Product([ + 'range_id' => $range->id, + 'name' => 'Prod Discount 2 ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Test description', + 'status' => true, + 'picture_alt' => 'alt', + 'picture_title' => 'title', + 'picture_large_alt' => 'alt', + 'picture_large_title' => 'title', + ]); + $prod2->price = Money::EUR(1000); + $prod2->discount_id = $discount2->id; + $prod2->save(); + + $prod3 = new Product([ + 'range_id' => $range->id, + 'name' => 'Prod Regular 3 ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Test description', + 'status' => true, + 'picture_alt' => 'alt', + 'picture_title' => 'title', + 'picture_large_alt' => 'alt', + 'picture_large_title' => 'title', + ]); + $prod3->price = Money::EUR(1000); + $prod3->save(); + + // WHEN (filtering by specific discount1) + $response1 = $this->get("/bo/products?discount={$discount1->id}"); + + // THEN + $response1->assertOk(); + $response1->assertSee($prod1->name); + $response1->assertDontSee($prod2->name); + $response1->assertDontSee($prod3->name); + $response1->assertSee("value=\"{$discount1->id}\" selected", false); + + // WHEN (filtering by all discounts: discount=0) + $responseAll = $this->get('/bo/products?discount=0'); + + // THEN + $responseAll->assertOk(); + $responseAll->assertSee($prod1->name); + $responseAll->assertSee($prod2->name); + $responseAll->assertDontSee($prod3->name); + $responseAll->assertSee('value="0" selected', false); + }); + + it('can access create', function () { + // WHEN + $response = $this->get('/bo/products/create'); + + // THEN + expect($response->status())->toBe(200); + }); + + it('renders empty string instead of null for ckeditor text when old input is null', function () { + // GIVEN + /** @var \Tests\TestCase $this */ + session()->put('_old_input', ['description' => null]); + + // WHEN + $response = $this->get('/bo/products/create'); + + // THEN + $response->assertOk(); + $content = $response->getContent(); + expect($content)->not->toContain('"text":null') + ->and($content)->toContain('"text":""'); + }); + + it('can store a product', function () { + // GIVEN + $range = new Range(); + $range->name = 'Test Range ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + $tag = new Tag(['label' => 'Test Tag ' . uniqid(), 'status' => true]); + $tag->save(); + + $this->withoutExceptionHandling(); + $data = [ + 'name' => 'New Product', + 'status' => true, + 'star' => false, + 'weight_variable' => false, + 'picture_alt' => 'test alt', + 'picture_title' => 'test title', + 'picture_large_alt' => 'test alt', + 'picture_large_title' => 'test title', + 'brand' => ProductBrand::loue->value, + 'sell_unit' => SellUnit::PCE->value, + 'order_unit' => OrderUnit::PCE->value, + 'tax_rate' => TaxRate::TVA_20->value, + 'invoicing_unit' => InvoicingUnit::PCE->value, + 'short_description' => 'A short description for product', + 'description' => 'A long description for product', + 'stock' => 10, + 'price' => 15.5, + 'client_timezone' => 'Europe/Paris', + 'range_id' => $range->id, + 'tags' => [ + ['id' => $tag->id, 'label' => $tag->label], + ], + 'associated_products' => [], + ]; + + // WHEN + $response = $this->post('/bo/products', $data); + + // THEN + $response->assertSessionHasNoErrors(); + expect($response->status())->toBe(302); + $product = Product::where('name', 'New Product')->first(); + expect($product)->not->toBeNull(); + $response->assertRedirect("/bo/products/{$product->slug}/edit"); + }); + + it('can access edit', function () { + // GIVEN + $range = new Range(); + $range->name = 'Test Range ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + $product = new Product([ + 'range_id' => $range->id, + 'name' => 'Test Product', + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Test description', + 'status' => true, + ]); + $product->price = Money::EUR(1000); + $product->short_description = 'Short test description'; + $product->picture_alt = 'test alt'; + $product->picture_title = 'test title'; + $product->picture_large_alt = 'test alt'; + $product->picture_large_title = 'test title'; + $product->save(); + + // WHEN + $response = $this->get("/bo/products/{$product->slug}/edit"); + + // THEN + expect($response->status())->toBe(200); + }); + + it('can update a product', function () { + // GIVEN + $range = new Range(); + $range->name = 'Test Range ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + $product = new Product([ + 'range_id' => $range->id, + 'name' => 'Test Product', + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Test description', + 'status' => true, + ]); + $product->price = Money::EUR(1000); + $product->short_description = 'Short test description'; + $product->picture_alt = 'test alt'; + $product->picture_title = 'test title'; + $product->picture_large_alt = 'test alt'; + $product->picture_large_title = 'test title'; + $product->save(); + + $newRange = new Range(); + $newRange->name = 'Test Range ' . uniqid(); + $newRange->status = true; + $newRange->order = random_int(1, 9999); + $newRange->picture_alt = 'alt'; + $newRange->picture_title = 'title'; + $newRange->save(); + + $this->withoutExceptionHandling(); + $data = [ + 'name' => 'Test Product', + 'status' => true, + 'star' => false, + 'weight_variable' => false, + 'picture_alt' => 'test alt', + 'picture_title' => 'test title', + 'picture_large_alt' => 'test alt', + 'picture_large_title' => 'test title', + 'brand' => ProductBrand::loue->value, + 'sell_unit' => SellUnit::PCE->value, + 'order_unit' => OrderUnit::PCE->value, + 'tax_rate' => TaxRate::TVA_20->value, + 'invoicing_unit' => InvoicingUnit::PCE->value, + 'price' => 20, + 'short_description' => 'A short description for product', + 'description' => 'A long description for product', + 'stock' => 10, + 'client_timezone' => 'Europe/Paris', + 'range_id' => $newRange->id, + 'tags' => [], + 'associated_products' => [], + ]; + + // WHEN + $response = $this->put("/bo/products/{$product->slug}", $data); + + // THEN + $response->assertSessionHasNoErrors(); + $product->refresh(); + expect($product->price->getAmount())->toBe('20'); + }); + + it('can delete a product', function () { + // GIVEN + $range = new Range(); + $range->name = 'Test Range ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + $product = new Product([ + 'range_id' => $range->id, + 'name' => 'Test Product', + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Test description', + 'status' => true, + ]); + $product->price = Money::EUR(1000); + $product->short_description = 'Short test description'; + $product->picture_alt = 'test alt'; + $product->picture_title = 'test title'; + $product->picture_large_alt = 'test alt'; + $product->picture_large_title = 'test title'; + $product->save(); + + // WHEN + $response = $this->delete("/bo/products/{$product->slug}"); + + // THEN + expect(Product::find($product->id))->toBeNull(); + }); + + it('can toggle star', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $range = new Range(); + $range->name = 'Test Range ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + $product = new Product([ + 'range_id' => $range->id, + 'name' => 'Test Product ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Test description', + 'status' => true, + ]); + $product->price = Money::EUR(1000); + $product->short_description = 'Short test description'; + $product->picture_alt = 'test alt'; + $product->picture_title = 'test title'; + $product->picture_large_alt = 'test alt'; + $product->picture_large_title = 'test title'; + $product->star = false; + $product->save(); + + // WHEN + $response = $this->patch("/bo/products/{$product->slug}/toggle-star"); + + // THEN + $product->refresh(); + expect($product->star)->toBeTrue(); + $response->assertRedirect(); + }); + + it('can toggle status', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $range = new Range(); + $range->name = 'Test Range ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + $product = new Product([ + 'range_id' => $range->id, + 'name' => 'Test Product ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Test description', + 'status' => true, + ]); + $product->price = Money::EUR(1000); + $product->short_description = 'Short test description'; + $product->picture_alt = 'test alt'; + $product->picture_title = 'test title'; + $product->picture_large_alt = 'test alt'; + $product->picture_large_title = 'test title'; + $product->save(); + + // WHEN + $response = $this->patch("/bo/products/{$product->slug}/toggle-status"); + + // THEN + $product->refresh(); + expect($product->status)->toBeFalse(); + $response->assertRedirect(); + }); + + it('can change order', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $range = new Range(); + $range->name = 'Test Range ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + $product = new Product([ + 'range_id' => $range->id, + 'name' => 'Test Product ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Test description', + 'status' => true, + ]); + $product->price = Money::EUR(1000); + $product->short_description = 'Short test description'; + $product->picture_alt = 'test alt'; + $product->picture_title = 'test title'; + $product->picture_large_alt = 'test alt'; + $product->picture_large_title = 'test title'; + $product->save(); + + // WHEN + $response = $this->patch("/bo/products/{$product->slug}/up"); + + // THEN + expect($response->status())->toBe(302); + }); + + it('can change selected order to specific position', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $range = new Range(); + $range->name = 'Test Range ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + $product1 = new Product([ + 'range_id' => $range->id, + 'name' => 'Test Product 1 ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Test description', + 'status' => true, + ]); + $product1->price = Money::EUR(1000); + $product1->short_description = 'Short test description'; + $product1->picture_alt = 'test alt'; + $product1->picture_title = 'test title'; + $product1->picture_large_alt = 'test alt'; + $product1->picture_large_title = 'test title'; + $product1->save(); + $product1->setOrder(1); + $product1->save(); + + $product2 = new Product([ + 'range_id' => $range->id, + 'name' => 'Test Product 2 ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Test description', + 'status' => true, + ]); + $product2->price = Money::EUR(1000); + $product2->short_description = 'Short test description'; + $product2->picture_alt = 'test alt'; + $product2->picture_title = 'test title'; + $product2->picture_large_alt = 'test alt'; + $product2->picture_large_title = 'test title'; + $product2->save(); + $product2->setOrder(2); + $product2->save(); + + // WHEN + $response = $this->patch("/bo/products/{$product2->slug}/change-selected-order", [ + 'order' => 1, + ]); + + // THEN + $response->assertSessionHasNoErrors(); + $response->assertRedirect(); + $product1->refresh(); + $product2->refresh(); + expect($product2->getOrder())->toBe(1) + ->and($product1->getOrder())->toBe(2); + }); + + describe('mass actions', function () { + beforeEach(function (): void { + /** @var \Tests\TestCase $this */ + $range = new Range(); + $range->name = 'Test Range ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + $product = new Product([ + 'range_id' => $range->id, + 'name' => 'Test Product ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Test description', + 'status' => true, + ]); + $product->price = Money::EUR(1000); + $product->short_description = 'Short test description'; + $product->picture_alt = 'test alt'; + $product->picture_title = 'test title'; + $product->picture_large_alt = 'test alt'; + $product->picture_large_title = 'test title'; + $product->star = false; + $product->save(); + + $this->massProduct = $product; + }); + + it('can mass publish products', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->massProduct->status = false; + $this->massProduct->save(); + + // WHEN + $response = $this->post(route('bo.products.mass-actions'), [ + 'action' => 'publish', + 'models' => [(string) $this->massProduct->id], + ]); + + // THEN + $response->assertRedirect(); + expect($this->massProduct->fresh()?->status)->toBeTrue(); + }); + + it('can mass unpublish products', function () { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->post(route('bo.products.mass-actions'), [ + 'action' => 'unpublish', + 'models' => [(string) $this->massProduct->id], + ]); + + // THEN + $response->assertRedirect(); + expect($this->massProduct->fresh()?->status)->toBeFalse(); + }); + + it('can mass star products', function () { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->post(route('bo.products.mass-actions'), [ + 'action' => 'star', + 'models' => [(string) $this->massProduct->id], + ]); + + // THEN + $response->assertRedirect(); + expect($this->massProduct->fresh()?->star)->toBeTrue(); + }); + + it('can mass unstar products', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->massProduct->star = true; + $this->massProduct->save(); + + // WHEN + $response = $this->post(route('bo.products.mass-actions'), [ + 'action' => 'unstar', + 'models' => [(string) $this->massProduct->id], + ]); + + // THEN + $response->assertRedirect(); + expect($this->massProduct->fresh()?->star)->toBeFalse(); + }); + }); + + describe('authorization rejections', function () { + it('redirects unauthenticated guest to login', function () { + /** @var \Tests\TestCase $this */ + auth('backend')->logout(); + + $response = $this->get('/bo/products'); + $response->assertRedirect('/bo/login'); + }); + + it('redirects frontend customer trying to access bo to login', function () { + /** @var \Tests\TestCase $this */ + auth('backend')->logout(); + $customer = new Customer(); + $this->actingAs($customer, 'frontend'); + + $response = $this->get('/bo/products'); + $response->assertRedirect('/bo/login'); + }); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Bo/RangesControllerTest.php b/tests/Feature/App/Http/Controllers/Bo/RangesControllerTest.php new file mode 100644 index 00000000..05aa6f2d --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Bo/RangesControllerTest.php @@ -0,0 +1,169 @@ +user = User::factory()->create(['role' => UserRole::SuperAdmin]); + $this->actingAs($this->user, 'backend'); + }); + + it('can access index', function () { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->get('/bo/ranges'); + + // THEN + expect($response->status())->toBe(200); + }); + + it('can access create', function () { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->get('/bo/ranges/create'); + + // THEN + expect($response->status())->toBe(200); + }); + + it('can store a range', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $data = [ + 'name' => 'New Range', + 'status' => true, + 'picture' => UploadedFile::fake()->image('picture.jpg', 500, 500), + 'picture_alt' => 'some alt text', + 'picture_title' => 'some title text', + ]; + + // WHEN + $response = $this->post('/bo/ranges', $data); + + // THEN + $range = Range::query()->where('name', 'New Range')->first(); + expect($response->isRedirect())->toBeTrue() + ->and($range)->not->toBeNull() + ->and($range?->slug)->toBe('new-range'); + }); + + it('can access edit', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $range = new Range(); + $range->name = 'My Range'; + $range->status = true; + $range->picture_alt = 'alt text here'; + $range->picture_title = 'title text here'; + $range->save(); + + // WHEN + $response = $this->get("/bo/ranges/{$range->slug}/edit"); + + // THEN + expect($response->status())->toBe(200); + }); + + it('can update a range', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $range = new Range(); + $range->name = 'My Range'; + $range->status = true; + $range->picture_alt = 'alt text here'; + $range->picture_title = 'title text here'; + $range->save(); + + $data = [ + 'name' => 'Updated Range', + 'status' => false, + 'picture' => UploadedFile::fake()->image('picture.jpg', 500, 500), + 'picture_alt' => 'some alt text updated', + 'picture_title' => 'some title text updated', + ]; + + // WHEN + $response = $this->put("/bo/ranges/{$range->slug}", $data); + + // THEN + $range->refresh(); + expect($response->isRedirect())->toBeTrue() + ->and($range->name)->toBe('Updated Range') + ->and($range->status)->toBeFalse(); + }); + + it('can delete a range', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $range = new Range(); + $range->name = 'My Range'; + $range->status = true; + $range->picture_alt = 'alt text here'; + $range->picture_title = 'title text here'; + $range->save(); + + // WHEN + $response = $this->delete("/bo/ranges/{$range->slug}"); + + // THEN + expect($response->isRedirect())->toBeTrue() + ->and(Range::query()->find($range->id))->toBeNull(); + }); + + it('can change order', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $range1 = new Range(); + $range1->name = 'My Range 1'; + $range1->status = true; + $range1->order = 1; + $range1->picture_alt = 'alt'; + $range1->picture_title = 'title'; + $range1->save(); + + $range2 = new Range(); + $range2->name = 'My Range 2'; + $range2->status = true; + $range2->order = 2; + $range2->picture_alt = 'alt'; + $range2->picture_title = 'title'; + $range2->save(); + + // WHEN + $response = $this->from('/bo/ranges')->patch("/bo/ranges/{$range2->slug}/up"); + + // THEN + expect($response->status())->toBe(302); + $response->assertRedirect('/bo/ranges'); + }); + + it('can toggle status', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $range = new Range(); + $range->name = 'My Range'; + $range->status = false; + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + // WHEN + $response = $this->from('/bo/ranges')->patch("/bo/ranges/{$range->slug}/toggle-status"); + + // THEN + expect($response->status())->toBe(302); + $response->assertRedirect('/bo/ranges'); + $range->refresh(); + expect($range->status)->toBeTrue(); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Bo/ShopsControllerTest.php b/tests/Feature/App/Http/Controllers/Bo/ShopsControllerTest.php new file mode 100644 index 00000000..cdef77ef --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Bo/ShopsControllerTest.php @@ -0,0 +1,195 @@ +user = User::factory()->create(['role' => UserRole::SuperAdmin]); + $this->actingAs($this->user, 'backend'); + }); + + it('can access index', function () { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->get('/bo/shops'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.shops.index'); + }); + + it('can filter shops by pickup-exception and persist in session', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $shop1 = Shop::factory()->create(['name' => 'Shop With Exception']); + $shop2 = Shop::factory()->create(['name' => 'Shop Without Exception']); + $exception = PickupException::factory()->create(); + $shop1->pickupExceptions()->attach($exception->id); + + // WHEN + $response = $this->get('/bo/shops?pickup-exception=' . $exception->id); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.shops.index'); + $response->assertSessionHas(IndexShopRequest::SESSION_KEY, $exception->id); + }); + + it('clears pickup-exception filter from session when empty string is passed', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + session([IndexShopRequest::SESSION_KEY => 'some-id']); + + // WHEN + $response = $this->get('/bo/shops?pickup-exception='); + + // THEN + expect($response->status())->toBe(200); + $response->assertSessionMissing(IndexShopRequest::SESSION_KEY); + }); + + it('can access create', function () { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->get('/bo/shops/create'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.shops.create'); + }); + + it('can store a shop', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $data = [ + 'name' => 'New Shop', + 'email' => 'shop@test.com', + 'city' => 'Paris', + 'postcode' => '75000', + 'address' => '1 rue de la Paix', + 'phone' => '0102030405', + 'default' => true, + ]; + + // WHEN + $response = $this->post('/bo/shops', $data); + + // THEN + $shop = Shop::query()->where('name', 'New Shop')->first(); + expect($shop)->not->toBeNull(); + $response->assertRedirect("/bo/shops/{$shop->id}/edit"); + }); + + it('can access edit', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $shop = Shop::factory()->create(); + + // WHEN + $response = $this->get("/bo/shops/{$shop->id}/edit"); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.shops.edit'); + }); + + it('can update a shop', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $shop = Shop::factory()->create(); + + $data = [ + 'name' => 'Updated Shop', + 'email' => 'shop@test.com', + 'city' => 'Lyon', + 'postcode' => '69000', + 'address' => '1 rue de la République', + 'phone' => '0102030405', + 'default' => false, + ]; + + // WHEN + $response = $this->put("/bo/shops/{$shop->id}", $data); + + // THEN + $shop->refresh(); + expect($shop->name)->toBe('Updated Shop') + ->and($shop->default)->toBeFalse(); + $response->assertRedirect("/bo/shops/{$shop->id}/edit"); + }); + + it('can delete a shop', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $shop = Shop::factory()->create(); + + // WHEN + $response = $this->delete("/bo/shops/{$shop->id}"); + + // THEN + expect(Shop::query()->find($shop->id))->toBeNull(); + $response->assertRedirect('/bo/shops'); + }); + + it('can access pickup exceptions form', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $shop = Shop::factory()->create(); + + // WHEN + $response = $this->get("/bo/shops/{$shop->id}/pickup-exceptions"); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.shops.pickup-exceptions'); + }); + + it('can submit pickup exceptions', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $shop = Shop::factory()->create(); + $exception1 = PickupException::factory()->create(); + $exception2 = PickupException::factory()->create(); + + $data = [ + 'pickup-exceptions' => [$exception1->id, $exception2->id], + 'replacement_date' => [ + $exception1->id => '2026-10-15', + $exception2->id => null, + ], + 'order_deadline_at' => [ + $exception1->id => '2026-10-14T18:00', + $exception2->id => null, + ], + 'client_timezone' => 'Europe/Paris', + ]; + + // WHEN + $response = $this->from("/bo/shops/{$shop->id}/pickup-exceptions") + ->put("/bo/shops/{$shop->id}/pickup-exceptions", $data); + + // THEN + expect($response->status())->toBe(302); + $response->assertRedirect("/bo/shops/{$shop->id}/pickup-exceptions"); + + $this->assertDatabaseHas('shop_pickup_exception', [ + 'shop_id' => $shop->id, + 'pickup_exception_id' => $exception1->id, + 'replacement_date' => '2026-10-15', + ]); + $this->assertDatabaseHas('shop_pickup_exception', [ + 'shop_id' => $shop->id, + 'pickup_exception_id' => $exception2->id, + 'replacement_date' => null, + ]); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Bo/SlidesControllerTest.php b/tests/Feature/App/Http/Controllers/Bo/SlidesControllerTest.php new file mode 100644 index 00000000..e3187fee --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Bo/SlidesControllerTest.php @@ -0,0 +1,133 @@ +user = User::factory()->create(['role' => UserRole::SuperAdmin]); + $this->actingAs($this->user, 'backend'); + }); + + it('can access index', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + Slide::factory()->create(); + + // WHEN + $response = $this->get('/bo/slides'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.slides.index'); + $response->assertViewHas('slides', fn ($slides) => $slides->items()[0] instanceof SlideDto); + $response->assertSee(__('Visible')); + }); + + it('can access create', function (): void { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->get('/bo/slides/create'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.slides.create'); + }); + + it('can store a slide', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $data = [ + 'title' => 'New Slide Title', + 'text' => 'This is the new slide text', + 'link' => 'https://example.com', + 'link_label' => 'Click here', + 'link_new_tab' => false, + 'connected' => false, + 'is_mobile' => false, + 'is_published' => true, + 'client_timezone' => 'Europe/Paris', + ]; + + // WHEN + $response = $this->post('/bo/slides', $data); + + // THEN + $slide = Slide::query()->where('title', 'New Slide Title')->first(); + expect($slide)->not->toBeNull(); + $response->assertRedirect("/bo/slides/{$slide->id}/edit"); + }); + + it('can access edit', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $slide = Slide::factory()->create(); + + // WHEN + $response = $this->get("/bo/slides/{$slide->id}/edit"); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.slides.edit'); + $response->assertViewHas('slide', fn ($slideData) => $slideData instanceof SlideDto && $slideData->id === $slide->id); + }); + + it('can update a slide', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $slide = Slide::factory()->create(); + + $data = [ + 'title' => 'Updated Slide Title', + 'text' => 'This is the new slide text updated', + 'link' => 'https://example.com/updated', + 'link_label' => 'Click here updated', + 'link_new_tab' => true, + 'connected' => true, + 'is_mobile' => true, + 'is_published' => false, + 'client_timezone' => 'Europe/Paris', + ]; + + // WHEN + $response = $this->put("/bo/slides/{$slide->id}", $data); + + // THEN + $slide->refresh(); + expect($slide->title)->toBe('Updated Slide Title'); + $response->assertRedirect("/bo/slides/{$slide->id}/edit"); + }); + + it('can delete a slide', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $slide = Slide::factory()->create(); + + // WHEN + $response = $this->delete("/bo/slides/{$slide->id}"); + + // THEN + expect(Slide::query()->find($slide->id))->toBeNull(); + $response->assertRedirect('/bo/slides'); + }); + + it('can change order', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $slide1 = Slide::factory()->create(['order' => 1]); + $slide2 = Slide::factory()->create(['order' => 2]); + + // WHEN + $response = $this->from('/bo/slides')->patch("/bo/slides/{$slide2->id}/up"); + + // THEN + expect($response->status())->toBe(302); + $response->assertRedirect('/bo/slides'); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Bo/TagsControllerTest.php b/tests/Feature/App/Http/Controllers/Bo/TagsControllerTest.php new file mode 100644 index 00000000..2e71e3dc --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Bo/TagsControllerTest.php @@ -0,0 +1,126 @@ +create(['role' => UserRole::SuperAdmin]); + $this->actingAs($user, 'backend'); + }); + + it('can access index', function (): void { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->get('/bo/tags'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.tags.index'); + }); + + it('can access create', function (): void { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->get('/bo/tags/create'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.tags.create'); + }); + + it('can store a tag', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $data = [ + 'label' => 'New Tag', + 'status' => true, + ]; + + // WHEN + $response = $this->post('/bo/tags', $data); + + // THEN + $tag = Tag::query()->where('label', 'New Tag')->firstOrFail(); + $response->assertRedirect("/bo/tags/{$tag->id}/edit"); + }); + + it('can access edit', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $tag = Tag::factory()->create(); + + // WHEN + $response = $this->get("/bo/tags/{$tag->id}/edit"); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('bo.tags.edit'); + }); + + it('can update a tag', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $tag = Tag::factory()->create(); + + $data = [ + 'label' => 'Updated Tag', + 'status' => false, + ]; + + // WHEN + $response = $this->put("/bo/tags/{$tag->id}", $data); + + // THEN + $tag->refresh(); + expect($tag->label)->toBe('Updated Tag') + ->and($tag->status)->toBeFalse(); + $response->assertRedirect("/bo/tags/{$tag->id}/edit"); + }); + + it('can delete a tag', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $tag = Tag::factory()->create(); + + // WHEN + $response = $this->delete("/bo/tags/{$tag->id}"); + + // THEN + expect(Tag::query()->find($tag->id))->toBeNull(); + $response->assertRedirect('/bo/tags'); + }); + + it('can toggle status', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $tag = Tag::factory()->create(); + $tag->status = true; + $tag->save(); + + // WHEN + $response = $this->patch("/bo/tags/{$tag->id}/toggle-status"); + + // THEN + $tag->refresh(); + expect($tag->status)->toBeFalse(); + $response->assertRedirect(); + }); + + it('can change order', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $tag = Tag::factory()->create(); + + // WHEN + $response = $this->patch("/bo/tags/{$tag->id}/up"); + + // THEN + expect($response->status())->toBe(302); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/Ajax/BasketControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/Ajax/BasketControllerTest.php new file mode 100644 index 00000000..13768fed --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/Ajax/BasketControllerTest.php @@ -0,0 +1,78 @@ +seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->post('/ajax/basket/add', []); + + // THEN + $response->assertStatus(403); + }); + + it('can access post /ajax/basket/empty', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->post('/ajax/basket/empty', []); + + // THEN + $response->assertStatus(200); + }); + + it('can access get /ajax/basket/get', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/ajax/basket/get'); + + // THEN + $response->assertStatus(200); + }); + + it('can access post /ajax/basket/remove', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->post('/ajax/basket/remove', []); + + // THEN + $response->assertStatus(302); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/Ajax/PickupControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/Ajax/PickupControllerTest.php new file mode 100644 index 00000000..cd4d61bd --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/Ajax/PickupControllerTest.php @@ -0,0 +1,27 @@ +seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/ajax/shops/1/pickup-timeslots'); + + // THEN + $response->assertStatus(404); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/Ajax/ProductsControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/Ajax/ProductsControllerTest.php new file mode 100644 index 00000000..6734818f --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/Ajax/ProductsControllerTest.php @@ -0,0 +1,196 @@ +seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->getJson(route('ajax.products.filter', [ + 'page' => 1, + 'perPage' => 6, + ])); + + // THEN + $response->assertOk(); + $response->assertJsonStructure([ + 'data' => [ + '*' => [ + 'id', + 'slug', + 'name', + 'picture', + 'picture_alt', + 'picture_title', + 'weight_variable', + 'sell_unit', + 'sell_unit_label', + 'shortDescription', + 'priceTtc', + 'priceKgTtc', + 'discountedPriceTtc', + 'is_available', + 'can_add_to_basket', + 'showStrippedPrice', + 'nutriscore', + ], + ], + ]); + }); + + it('returns showStrippedPrice false when discount is_old_price_displayed is false', function () { + // GIVEN + /** @var \Tests\TestCase $this */ + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + $customer = new Customer(); + $customer->email = new Email('test1@example.com'); + $customer->hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->save(); + $this->actingAs($customer, 'frontend'); + + $range = new Range(); + $range->name = 'Gamme test sans ancien prix'; + $range->status = true; + $range->order = 1; + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + $discount = new Discount(); + $discount->type = DiscountType::AMOUNT; + $discount->value = DiscountValue::fromAmount(Money::EUR(100)); + $discount->is_old_price_displayed = false; + $discount->save(); + + $product = new Product([ + 'range_id' => $range->id, + 'name' => 'Produit Promo Sans Ancien Prix', + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Description test', + 'status' => true, + ]); + $product->order = 1; + $product->price = Money::EUR(1000); + $product->short_description = 'Court'; + $product->picture_alt = 'alt'; + $product->picture_title = 'title'; + $product->picture_large_alt = 'alt'; + $product->picture_large_title = 'title'; + $product->discount_id = $discount->id; + $product->save(); + + // WHEN + $response = $this->getJson(route('ajax.products.filter', [ + 'search' => 'Produit Promo Sans Ancien Prix', + ])); + + // THEN + $response->assertOk(); + /** @var array> $data */ + $data = $response->json('data'); + expect($data)->not->toBeEmpty() + ->and($data[0]['showStrippedPrice'])->toBeFalse() + ->and($data[0]['discountedPriceTtc'])->not->toBeNull(); + }); + + it('returns showStrippedPrice true when discount is_old_price_displayed is true', function () { + // GIVEN + /** @var \Tests\TestCase $this */ + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + $customer = new Customer(); + $customer->email = new Email('test2@example.com'); + $customer->hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->save(); + $this->actingAs($customer, 'frontend'); + + $range = new Range(); + $range->name = 'Gamme test avec ancien prix'; + $range->status = true; + $range->order = 2; + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + $discount = new Discount(); + $discount->type = DiscountType::AMOUNT; + $discount->value = DiscountValue::fromAmount(Money::EUR(100)); + $discount->is_old_price_displayed = true; + $discount->save(); + + $product = new Product([ + 'range_id' => $range->id, + 'name' => 'Produit Promo Avec Ancien Prix', + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Description test', + 'status' => true, + ]); + $product->order = 2; + $product->price = Money::EUR(1000); + $product->short_description = 'Court'; + $product->picture_alt = 'alt'; + $product->picture_title = 'title'; + $product->picture_large_alt = 'alt'; + $product->picture_large_title = 'title'; + $product->discount_id = $discount->id; + $product->save(); + + // WHEN + $response = $this->getJson(route('ajax.products.filter', [ + 'search' => 'Produit Promo Avec Ancien Prix', + ])); + + // THEN + $response->assertOk(); + /** @var array> $data */ + $data = $response->json('data'); + expect($data)->not->toBeEmpty() + ->and($data[0]['showStrippedPrice'])->toBeTrue() + ->and($data[0]['discountedPriceTtc'])->not->toBeNull(); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/Auth/ForgotPasswordControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/Auth/ForgotPasswordControllerTest.php new file mode 100644 index 00000000..49785b95 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/Auth/ForgotPasswordControllerTest.php @@ -0,0 +1,44 @@ +seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/auth/mot-de-passe-oublie'); + + // THEN + $response->assertStatus(200); + }); + + it('can access post /auth/mot-de-passe-oublie', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->post('/auth/mot-de-passe-oublie', []); + + // THEN + $response->assertStatus(302); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/Auth/LoginControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/Auth/LoginControllerTest.php new file mode 100644 index 00000000..b41e4a56 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/Auth/LoginControllerTest.php @@ -0,0 +1,230 @@ +seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/auth/connexion'); + + // THEN + $response->assertStatus(200); + }); + + it('renders a flashed warning message on the login page', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->withSession(['warning' => [__('Please log in to continue.')]]) + ->get('/auth/connexion'); + + // THEN + $response->assertOk(); + $response->assertSeeText(__('Please log in to continue.')); + }); + + it('flashes a warning when a guest hits a protected route', function () { + /** @var \Tests\TestCase $this */ + // WHEN + $response = $this->get(route('fo.account.dashboard')); + + // THEN + $response->assertRedirect(route('fo.auth.connexion')); + $response->assertSessionHas('warning', [__('Please log in to continue.')]); + }); + + it('can access post /auth/connexion', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->post('/auth/connexion', []); + + // THEN + $response->assertStatus(302); + }); + + it('can access post /auth/deconnexion', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + $user = \Mockery::mock(Customer::class)->makePartial(); + $user->shouldReceive('getAuthIdentifier')->andReturn(1); + $user->hashcode = 'dummy_hashcode'; + $user->shouldReceive('getAuthPassword')->andReturn('dummy'); + $this->actingAs($user, 'frontend'); + + // WHEN + $response = $this->post('/auth/deconnexion'); + + // THEN + $response->assertStatus(302); + }); + + it('throws CustomerNotEmployedException when shopper is not active during login', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + $customer = Customer::forceCreate([ + 'email' => new Email('test@example.com'), + 'hashcode' => (string) Str::uuid(), + ]); + + $crmCustomer = new CrmCustomer( + hashcode: $customer->hashcode->value, + email: 'test@example.com', + password: 'password', + firstname: 'John', + lastname: 'Doe', + birthDate: null, + phone: null, + address: null, + address2: null, + city: null, + postcode: null, + country: Country::france, + optIn: false, + status: true, + lastConnection: null, + ); + $crmService = $this->mock(CrmService::class); + $crmService->shouldReceive('getCustomerFromEmail')->with('test@example.com')->andReturn($crmCustomer); + $crmService->shouldReceive('login')->with('test@example.com', 'password')->andReturnTrue(); + + $shopperService = \Mockery::mock(ShopperService::class); + $shopperService->shouldReceive('getShopperFor') + ->withArgs(function ($arg) use ($customer) { + return $arg instanceof ShopperId && (string) $arg->value === $customer->id; + }) + ->andReturn(null); + $this->app->instance(ShopperService::class, $shopperService); + + // WHEN + $this->withoutExceptionHandling(); + $this->post('/auth/connexion', [ + 'email' => 'test@example.com', + 'password' => 'password', + ]); + })->throws(CustomerNotEmployedException::class); + + it('flashes success message when shopper is active during login', function () { + // GIVEN + /** @var \Tests\TestCase $this */ + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + $customer = Customer::forceCreate([ + 'email' => new Email('test2@example.com'), + 'hashcode' => (string) Str::uuid(), + ]); + + $crmCustomer = new CrmCustomer( + hashcode: $customer->hashcode->value, + email: 'test2@example.com', + password: 'password', + firstname: 'John', + lastname: 'Doe', + birthDate: null, + phone: null, + address: null, + address2: null, + city: null, + postcode: null, + country: Country::france, + optIn: false, + status: true, + lastConnection: null, + ); + $crmService = $this->mock(CrmService::class); + $crmService->shouldReceive('getCustomerFromEmail')->with('test2@example.com')->andReturn($crmCustomer); + $crmService->shouldReceive('login')->with('test2@example.com', 'password')->andReturnTrue(); + + $shopper = new Shopper( + id: clone $customer->getId(), + email: new Email('test2@example.com'), + matricule: new Matricule('1234567'), + nom: 'Doe', + prenom: 'John', + startDate: CarbonImmutable::now()->subDays(1), + endDate: null, + etablissement: new ShopperEstablishmentCode('FAC01'), + site: new ShopperSiteCode('SITE'), + service: new ShopperServiceCode('101'), + ); + + $shopperService = \Mockery::mock(ShopperService::class); + $shopperService->shouldReceive('getShopperFor') + ->withArgs(function ($arg) use ($customer) { + return $arg instanceof ShopperId && (string) $arg->value === $customer->id; + }) + ->andReturn($shopper); + $this->app->instance(ShopperService::class, $shopperService); + + // WHEN + $response = $this->post('/auth/connexion', [ + 'email' => 'test2@example.com', + 'password' => 'password', + ]); + + // THEN + $response->assertRedirect(route('fo.pages.home')); + $response->assertSessionHas('success', \trans('You are logged in!')); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/Auth/RegisterControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/Auth/RegisterControllerTest.php new file mode 100644 index 00000000..18f565b1 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/Auth/RegisterControllerTest.php @@ -0,0 +1,44 @@ +seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/auth/inscription'); + + // THEN + $response->assertStatus(200); + }); + + it('can access post /auth/inscription', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->post('/auth/inscription', []); + + // THEN + $response->assertStatus(302); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/Auth/ResetPasswordControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/Auth/ResetPasswordControllerTest.php new file mode 100644 index 00000000..52db2afe --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/Auth/ResetPasswordControllerTest.php @@ -0,0 +1,44 @@ +seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/auth/reinitialiser-mdp/1'); + + // THEN + $response->assertStatus(200); + }); + + it('can access post /auth/reinitialiser-mdp/1', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->post('/auth/reinitialiser-mdp/1', []); + + // THEN + $response->assertStatus(302); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/Auth/VerificationControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/Auth/VerificationControllerTest.php new file mode 100644 index 00000000..d4f02116 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/Auth/VerificationControllerTest.php @@ -0,0 +1,61 @@ +seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->post('/auth/email/resend', []); + + // THEN + $response->assertStatus(302); + }); + + it('can access get /auth/email/verify', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/auth/email/verify'); + + // THEN + $response->assertStatus(302); + }); + + it('can access get /auth/email/verify/1/1', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/auth/email/verify/1/1'); + + // THEN + $response->assertStatus(302); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/Customers/CustomerControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/Customers/CustomerControllerTest.php new file mode 100644 index 00000000..accc6d50 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/Customers/CustomerControllerTest.php @@ -0,0 +1,239 @@ +seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + $user = \Mockery::mock(Customer::class)->makePartial(); + $user->shouldReceive('getAuthIdentifier')->andReturn(1); + $user->hashcode = new CrmHashcode(Uuid::uuid4()); + $user->shouldReceive('getAuthPassword')->andReturn('dummy'); + $this->actingAs($user, 'frontend'); + $crmMock = \Mockery::mock(CrmService::class)->makePartial(); + $crmMock->shouldReceive('getCustomerFromHashCode')->andReturn(null); + App::instance(CrmService::class, $crmMock); + + // WHEN + $response = $this->get('/compte'); + + // THEN + $response->assertStatus(302); + }); + + it('can access get /compte/profil', function () { + // GIVEN + /** @var \Tests\TestCase $this */ + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + $user = \Mockery::mock(Customer::class)->makePartial(); + $user->shouldReceive('getAuthIdentifier')->andReturn(1); + $user->hashcode = new CrmHashcode(Uuid::uuid4()); + $user->shouldReceive('getAuthPassword')->andReturn('dummy'); + $this->actingAs($user, 'frontend'); + $crmMock = \Mockery::mock(CrmService::class)->makePartial(); + $crmMock->shouldReceive('getCustomerFromHashCode')->andReturn(null); + App::instance(CrmService::class, $crmMock); + + // WHEN + $response = $this->get('/compte/profil'); + + // THEN + $response->assertStatus(302); + }); + + it('can access post /compte/profil', function () { + // GIVEN + /** @var \Tests\TestCase $this */ + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + $user = \Mockery::mock(Customer::class)->makePartial(); + $user->shouldReceive('getAuthIdentifier')->andReturn(1); + $user->hashcode = new CrmHashcode(Uuid::uuid4()); + $user->shouldReceive('getAuthPassword')->andReturn('dummy'); + $this->actingAs($user, 'frontend'); + $crmMock = \Mockery::mock(CrmService::class)->makePartial(); + $crmMock->shouldReceive('getCustomerFromHashCode')->andReturn(null); + App::instance(CrmService::class, $crmMock); + + // WHEN + $response = $this->post('/compte/profil', []); + + // THEN + $response->assertStatus(302); + }); + + it('renders customer edit infos page with crm customer data', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + $hashcode = new CrmHashcode(Uuid::uuid4()); + $customer = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => $hashcode->value, + 'email' => new Email('jean.dupont@example.com'), + ]); + + Employee::forceCreate([ + 'id' => 8882, + 'customer_id' => $customer->id, + 'matricule' => new Matricule('8888002'), + 'nom' => 'Dupont', + 'prenom' => 'Jean', + 'code' => new Code('ABCDEF13'), + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now(), + 'updated_at' => CarbonImmutable::now(), + ]); + + $crmCustomer = new CrmCustomer( + hashcode: $hashcode->value, + email: 'jean.dupont@example.com', + password: 'pwd', + firstname: 'Jean', + lastname: 'Dupont', + birthDate: '1985-05-15', + phone: '0123456789', + address: '10 rue de la Paix', + address2: null, + city: 'Paris', + postcode: '75002', + country: Country::france, + optIn: true, + status: true, + lastConnection: null, + ); + + $crmMock = \Mockery::mock(CrmService::class)->makePartial(); + $crmMock->shouldReceive('getCustomerFromHashCode')->andReturn($crmCustomer); + App::instance(CrmService::class, $crmMock); + + $this->actingAs($customer, 'frontend'); + + // WHEN + $response = $this->get('/compte/profil'); + + // THEN + $response->assertOk(); + $response->assertViewIs('fo.customer.edit.infos'); + $response->assertViewHas('crmCustomer', $crmCustomer); + $response->assertSee('value="Dupont"', false); + $response->assertSee('value="Jean"', false); + }); + + it('successfully updates customer infos and redirects back', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + $hashcode = new CrmHashcode(Uuid::uuid4()); + $customer = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => $hashcode->value, + 'email' => new Email('jean.dupont@example.com'), + ]); + + Employee::forceCreate([ + 'id' => 8883, + 'customer_id' => $customer->id, + 'matricule' => new Matricule('8888003'), + 'nom' => 'Dupont', + 'prenom' => 'Jean', + 'code' => new Code('ABCDEF14'), + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now(), + 'updated_at' => CarbonImmutable::now(), + ]); + + $updatedCrmCustomer = new CrmCustomer( + hashcode: $hashcode->value, + email: 'jean.dupont@example.com', + password: 'pwd', + firstname: 'Jean-Pierre', + lastname: 'Durand', + birthDate: '1985-05-15', + phone: '0123456789', + address: '20 avenue Foch', + address2: null, + city: 'Lyon', + postcode: '69001', + country: Country::france, + optIn: true, + status: true, + lastConnection: null, + ); + + $crmMock = \Mockery::mock(CrmService::class); + $crmMock->shouldReceive('getCustomerFromHashCode') + ->andReturn($updatedCrmCustomer); + $crmMock->shouldReceive('updateCustomerInfos') + ->once() + ->andReturn($updatedCrmCustomer); + App::instance(CrmService::class, $crmMock); + + $this->actingAs($customer, 'frontend'); + + // WHEN + $response = $this->post('/compte/profil', [ + 'firstname' => 'Jean-Pierre', + 'lastname' => 'Durand', + 'birth_date' => '1985-05-15', + 'phone' => '0123456789', + 'address' => '20 avenue Foch', + 'city' => 'Lyon', + 'postcode' => '69001', + 'opt_in' => true, + ]); + + // THEN + $response->assertRedirect(); + $response->assertSessionHas('success', trans('Your information has been saved.')); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/Customers/OrderControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/Customers/OrderControllerTest.php new file mode 100644 index 00000000..96e3d88e --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/Customers/OrderControllerTest.php @@ -0,0 +1,249 @@ +seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + $user = \Mockery::mock(Customer::class)->makePartial(); + $user->shouldReceive('getAuthIdentifier')->andReturn(1); + $user->hashcode = new CrmHashcode(Uuid::uuid4()); + $user->shouldReceive('getAuthPassword')->andReturn('dummy'); + $this->actingAs($user, 'frontend'); + $crmMock = \Mockery::mock(CrmService::class)->makePartial(); + $crmMock->shouldReceive('getCustomerFromHashCode')->andReturn(null); + App::instance(CrmService::class, $crmMock); + + // WHEN + $response = $this->get('/compte/commandes'); + + // THEN + $response->assertStatus(302); + }); + + it('can access get /compte/commandes/1', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + $user = \Mockery::mock(Customer::class)->makePartial(); + $user->shouldReceive('getAuthIdentifier')->andReturn(1); + $user->hashcode = new CrmHashcode(Uuid::uuid4()); + $user->shouldReceive('getAuthPassword')->andReturn('dummy'); + $this->actingAs($user, 'frontend'); + $crmMock = \Mockery::mock(CrmService::class)->makePartial(); + $crmMock->shouldReceive('getCustomerFromHashCode')->andReturn(null); + App::instance(CrmService::class, $crmMock); + + // WHEN + $response = $this->get('/compte/commandes/1'); + + // THEN + $response->assertStatus(404); + }); + + it('renders customer orders index with DTOs when verified', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + $hashcode = new CrmHashcode(Uuid::uuid4()); + $customer = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => $hashcode->value, + 'email' => new Email('verified@example.com'), + ]); + + Employee::forceCreate([ + 'id' => 8881, + 'customer_id' => $customer->id, + 'matricule' => new Matricule('8888001'), + 'nom' => 'Dupont', + 'prenom' => 'Jean', + 'code' => new Code('ABCDEF12'), + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now(), + 'updated_at' => CarbonImmutable::now(), + ]); + + $shop = Shop::factory()->create(); + $refUuid = Uuid::uuid7(); + $reference = new OrderReference($refUuid); + $ref = (string) $reference; + Order::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'shop_id' => $shop->id, + 'reference' => $reference, + 'status' => OrderStatus::VALIDATED->value, + 'total' => new Money(5000, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule('8888001'), 'Jean', 'Dupont', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Shop Name', 'Address', '75000', 'Paris'), + 'pickup_day' => Date::now()->toDateString(), + ]); + + $crmCustomer = new CrmCustomer( + hashcode: $hashcode->value, + email: 'verified@example.com', + password: 'pwd', + firstname: 'Jean', + lastname: 'Dupont', + birthDate: null, + phone: '0123456789', + address: '10 rue test', + address2: null, + city: 'Paris', + postcode: '75000', + country: Country::france, + optIn: true, + status: true, + lastConnection: null, + ); + + $crmMock = \Mockery::mock(CrmService::class)->makePartial(); + $crmMock->shouldReceive('getCustomerFromHashCode')->andReturn($crmCustomer); + App::instance(CrmService::class, $crmMock); + + $this->actingAs($customer, 'frontend'); + + // WHEN + $response = $this->get('/compte/commandes'); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('fo.customer.orders.index'); + $response->assertViewHas('orders', function ($orders) use ($ref): bool { + return $orders instanceof LengthAwarePaginator + && $orders->total() === 1 + && (string) $orders->first()->reference === $ref; + }); + }); + + it('renders customer order detail when owned by customer', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + $hashcode = new CrmHashcode(Uuid::uuid4()); + $customer = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => $hashcode->value, + 'email' => new Email('verified_show@example.com'), + ]); + + Employee::forceCreate([ + 'id' => 8882, + 'customer_id' => $customer->id, + 'matricule' => new Matricule('8888002'), + 'nom' => 'Martin', + 'prenom' => 'Paul', + 'code' => new Code('ABCDEF34'), + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now(), + 'updated_at' => CarbonImmutable::now(), + ]); + + $shop = Shop::factory()->create(); + $refUuid = Uuid::uuid7(); + $reference = new OrderReference($refUuid); + $ref = (string) $reference; + $order = Order::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'shop_id' => $shop->id, + 'reference' => $reference, + 'status' => OrderStatus::VALIDATED->value, + 'total' => new Money(5000, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule('8888002'), 'Paul', 'Martin', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Shop Name', 'Address', '75000', 'Paris'), + 'pickup_day' => Date::now()->toDateString(), + ]); + + $crmCustomer = new CrmCustomer( + hashcode: $hashcode->value, + email: 'verified_show@example.com', + password: 'pwd', + firstname: 'Paul', + lastname: 'Martin', + birthDate: null, + phone: '0123456789', + address: '10 rue test', + address2: null, + city: 'Paris', + postcode: '75000', + country: Country::france, + optIn: true, + status: true, + lastConnection: null, + ); + + $crmMock = \Mockery::mock(CrmService::class)->makePartial(); + $crmMock->shouldReceive('getCustomerFromHashCode')->andReturn($crmCustomer); + App::instance(CrmService::class, $crmMock); + + $this->actingAs($customer, 'frontend'); + + // WHEN + $response = $this->get("/compte/commandes/{$ref}"); + + // THEN + expect($response->status())->toBe(200); + $response->assertViewIs('fo.customer.orders.show'); + $response->assertViewHas('order', fn ($orderData) => $orderData instanceof OrderDto && (string) $orderData->reference === $ref); + $response->assertViewHas('mapUrl'); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/Customers/PasswordControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/Customers/PasswordControllerTest.php new file mode 100644 index 00000000..4a6250e1 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/Customers/PasswordControllerTest.php @@ -0,0 +1,65 @@ +seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + $user = \Mockery::mock(Customer::class)->makePartial(); + $user->shouldReceive('getAuthIdentifier')->andReturn(1); + $user->hashcode = new CrmHashcode(Uuid::uuid4()); + $user->shouldReceive('getAuthPassword')->andReturn('dummy'); + $this->actingAs($user, 'frontend'); + $crmMock = \Mockery::mock(CrmService::class)->makePartial(); + $crmMock->shouldReceive('getCustomerFromHashCode')->andReturn(null); + App::instance(CrmService::class, $crmMock); + + // WHEN + $response = $this->get('/compte/mot-de-passe'); + + // THEN + $response->assertStatus(302); + }); + + it('can access post /compte/mot-de-passe', function () { + // GIVEN + /** @var \Tests\TestCase $this */ + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + $user = \Mockery::mock(Customer::class)->makePartial(); + $user->shouldReceive('getAuthIdentifier')->andReturn(1); + $user->hashcode = new CrmHashcode(Uuid::uuid4()); + $user->shouldReceive('getAuthPassword')->andReturn('dummy'); + $this->actingAs($user, 'frontend'); + $crmMock = \Mockery::mock(CrmService::class)->makePartial(); + $crmMock->shouldReceive('getCustomerFromHashCode')->andReturn(null); + App::instance(CrmService::class, $crmMock); + + // WHEN + $response = $this->post('/compte/mot-de-passe', []); + + // THEN + $response->assertStatus(302); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/NewsletterControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/NewsletterControllerTest.php new file mode 100644 index 00000000..6ed3777e --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/NewsletterControllerTest.php @@ -0,0 +1,49 @@ +mock(CrmService::class); + $crmMock->shouldReceive('unsubscribeCustomer')->andReturn(true); + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + $hashcode = Uuid::uuid4()->toString(); + + // WHEN + $response = $this->get('/unsubscribe?hashcode=' . $hashcode); + + // THEN + $response->assertStatus(200); + }); + + it('redirects when hashcode is missing', function () { + // GIVEN + /** @var \Tests\TestCase $this */ + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/unsubscribe'); + + // THEN + $response->assertStatus(302); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/Pages/ContactControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/Pages/ContactControllerTest.php new file mode 100644 index 00000000..dce49c08 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/Pages/ContactControllerTest.php @@ -0,0 +1,107 @@ +seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/contactez-nous'); + + // THEN + $response->assertStatus(404); + }); + + it('displays contact page with default shop and page content', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + $shop = new Shop(); + $shop->name = 'Boutique Cocotte'; + $shop->address = '1 rue des Poules'; + $shop->postcode = '75000'; + $shop->city = 'Paris'; + $shop->default = true; + $shop->save(); + + // WHEN + $response = $this->get('/contactez-nous'); + + // THEN + $response->assertStatus(200); + $response->assertViewIs('fo.pages.contact'); + $response->assertViewHas('magasin', fn ($magasin) => $magasin instanceof ShopDto && $magasin->name === 'Boutique Cocotte'); + }); + + it('submits contact form and sends email', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + Mail::fake(); + + $data = [ + 'first_name' => 'Jean', + 'last_name' => 'Dupont', + 'email' => 'jean.dupont@gmail.com', + 'subject' => 'Question', + 'order_ref' => '123456', + 'message' => 'Bonjour, ceci est un message de test qui contient au moins vingt caractères.', + 'ok_cgv' => '1', + ]; + + // WHEN + $response = $this->from('/contactez-nous')->post('/contactez-nous', $data); + + // THEN + $response->assertRedirect('/contactez-nous'); + $response->assertSessionHas('status', true); + Mail::assertQueued(SendContactMail::class); + }); + + it('redirects with validation errors when form data is invalid', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->from('/contactez-nous')->post('/contactez-nous', []); + + // THEN + $response->assertStatus(302); + $response->assertSessionHasErrors(['first_name', 'last_name', 'email', 'subject', 'message', 'ok_cgv']); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/Pages/HomeControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/Pages/HomeControllerTest.php new file mode 100644 index 00000000..be346894 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/Pages/HomeControllerTest.php @@ -0,0 +1,213 @@ +seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + + // WHEN + $response = $this->get('/'); + + // THEN + $response->assertOk(); + }); + + it('displays star products, slides and ranges', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + + $range = new Range(); + $range->name = 'Boucherie'; + $range->slug = 'boucherie'; + $range->picture = 'ranges/boucherie.jpg'; + $range->picture_alt = 'Boucherie'; + $range->picture_title = 'Boucherie'; + $range->status = true; + $range->order = 1; + $range->save(); + + $slide = new Slide(); + $slide->title = 'Super Promo'; + $slide->status = true; + $slide->order = 1; + $slide->connected = false; + $slide->link = 'https://example.com'; + $slide->date_start = Carbon::yesterday(); + $slide->date_end = Carbon::tomorrow(); + $slide->save(); + + $product = new Product(); + $product->id = (string) Uuid::uuid7(); + $product->name = 'Poulet Fermier'; + $product->brand = ProductBrand::loue; + $product->slug = 'poulet-fermier'; + $product->description = 'Délicieux poulet fermier'; + $product->picture_alt = 'Poulet Fermier'; + $product->picture_title = 'Poulet Fermier'; + $product->picture_large_alt = 'Poulet Fermier'; + $product->picture_large_title = 'Poulet Fermier'; + $product->price = Money::EUR(1500); + $product->invoicing_unit = InvoicingUnit::KGM; + $product->sell_unit = SellUnit::KGM; + $product->tax_rate = TaxRate::TVA_5_5; + $product->stock = 10; + $product->range_id = $range->id; + $product->order = 1; + $product->star = true; + $product->status = true; + $product->save(); + + // WHEN + $response = $this->get('/'); + + // THEN + $response->assertOk(); + $response->assertSee('id="hero-carousel"', false); + $response->assertSee('Poulet Fermier'); + $response->assertSee('Super Promo'); + $response->assertSee('Boucherie'); + }); + + it('does not display slider section when no slides are published', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + + $expiredSlide = new Slide(); + $expiredSlide->title = 'Expired Promo'; + $expiredSlide->status = true; + $expiredSlide->order = 1; + $expiredSlide->connected = false; + $expiredSlide->link = 'https://example.com'; + $expiredSlide->date_start = Carbon::now()->subDays(5); + $expiredSlide->date_end = Carbon::now()->subDays(2); + $expiredSlide->save(); + + // WHEN + $response = $this->get('/'); + + // THEN + $response->assertOk(); + $response->assertDontSee('id="hero-carousel"', false); + $response->assertDontSee('Expired Promo'); + }); + + it('displays promo prices in red for discounted star products on homepage', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + + $range = new Range(); + $range->name = 'Boucherie'; + $range->slug = 'boucherie'; + $range->picture = 'ranges/boucherie.jpg'; + $range->picture_alt = 'Boucherie'; + $range->picture_title = 'Boucherie'; + $range->status = true; + $range->order = 1; + $range->save(); + + $discount = new Discount(); + $discount->type = DiscountType::PERCENT; + $discount->value = DiscountValue::fromPercentage(10); + $discount->is_old_price_displayed = false; + $discount->date_start = Carbon::yesterday(); + $discount->date_end = Carbon::tomorrow(); + $discount->save(); + + $promoProduct = new Product(); + $promoProduct->id = (string) Uuid::uuid7(); + $promoProduct->name = 'Foie Gras Promo'; + $promoProduct->brand = ProductBrand::loue; + $promoProduct->slug = 'foie-gras-promo'; + $promoProduct->description = 'Foie Gras en promo'; + $promoProduct->picture_alt = 'Foie Gras Promo'; + $promoProduct->picture_title = 'Foie Gras Promo'; + $promoProduct->picture_large_alt = 'Foie Gras Promo'; + $promoProduct->picture_large_title = 'Foie Gras Promo'; + $promoProduct->price = Money::EUR(2000); + $promoProduct->invoicing_unit = InvoicingUnit::PCE; + $promoProduct->sell_unit = SellUnit::PCE; + $promoProduct->tax_rate = TaxRate::TVA_5_5; + $promoProduct->stock = 10; + $promoProduct->range_id = $range->id; + $promoProduct->order = 1; + $promoProduct->star = true; + $promoProduct->status = true; + $promoProduct->discount_id = $discount->id; + $promoProduct->save(); + + $regularProduct = new Product(); + $regularProduct->id = (string) Uuid::uuid7(); + $regularProduct->name = 'Poulet Standard'; + $regularProduct->brand = ProductBrand::loue; + $regularProduct->slug = 'poulet-standard'; + $regularProduct->description = 'Poulet standard sans promo'; + $regularProduct->picture_alt = 'Poulet Standard'; + $regularProduct->picture_title = 'Poulet Standard'; + $regularProduct->picture_large_alt = 'Poulet Standard'; + $regularProduct->picture_large_title = 'Poulet Standard'; + $regularProduct->price = Money::EUR(1500); + $regularProduct->invoicing_unit = InvoicingUnit::PCE; + $regularProduct->sell_unit = SellUnit::PCE; + $regularProduct->tax_rate = TaxRate::TVA_5_5; + $regularProduct->stock = 10; + $regularProduct->range_id = $range->id; + $regularProduct->order = 2; + $regularProduct->star = true; + $regularProduct->status = true; + $regularProduct->discount_id = null; + $regularProduct->save(); + + // WHEN + $response = $this->get('/'); + + // THEN + $response->assertOk(); + $content = $response->getContent(); + expect($content)->toContain('Foie Gras Promo') + ->and($content)->toContain('Poulet Standard'); + + // Promo product price span has text-danger class + expect($content)->toMatch('/Foie Gras Promo.*?/s') + // Regular product price span does NOT have text-danger class + ->and($content)->toMatch('/Poulet Standard.*?/s'); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/Pages/PageControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/Pages/PageControllerTest.php new file mode 100644 index 00000000..49aad6b9 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/Pages/PageControllerTest.php @@ -0,0 +1,78 @@ +seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/cgv'); + + // THEN + $response->assertStatus(200); + }); + + it('can access get /charte-de-confidentialite', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/charte-de-confidentialite'); + + // THEN + $response->assertStatus(200); + }); + + it('can access get /faq', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/faq'); + + // THEN + $response->assertStatus(200); + }); + + it('can access get /mentions-legales', function () { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/mentions-legales'); + + // THEN + $response->assertStatus(200); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/Pages/ProductsControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/Pages/ProductsControllerTest.php new file mode 100644 index 00000000..19e282c9 --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/Pages/ProductsControllerTest.php @@ -0,0 +1,26 @@ +seed(ContentSeeder::class); + $pages = Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ]); + View::share('PageList', $pages); + + // WHEN + $response = $this->get('/produits'); + + // THEN + $response->assertStatus(200); + }); +}); diff --git a/tests/Feature/App/Http/Controllers/Fo/TunnelControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/TunnelControllerTest.php new file mode 100644 index 00000000..10d5a56b --- /dev/null +++ b/tests/Feature/App/Http/Controllers/Fo/TunnelControllerTest.php @@ -0,0 +1,609 @@ +seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/commande/panier'); + + // THEN + $response->assertRedirectToRoute('fo.auth.connexion'); + }); + + it('redirects unauthenticated guest submitting basket summary to login', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->post('/commande/panier', []); + + // THEN + $response->assertRedirectToRoute('fo.auth.connexion'); + }); + + it('redirects unauthenticated guest accessing pick time slot to login', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/commande/creneaux'); + + // THEN + $response->assertRedirectToRoute('fo.auth.connexion'); + }); + + it('redirects unauthenticated guest submitting pick time slot to login', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->post('/commande/creneaux', []); + + // THEN + $response->assertRedirectToRoute('fo.auth.connexion'); + }); + + it('redirects unauthenticated guest accessing confirmation to login', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/commande/confirmation'); + + // THEN + $response->assertRedirectToRoute('fo.auth.connexion'); + }); + + it('redirects unauthenticated guest submitting confirmation to login', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->post('/commande/confirmation', []); + + // THEN + $response->assertRedirectToRoute('fo.auth.connexion'); + }); + + it('redirects unauthenticated guest accessing confirmed order to login', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + // WHEN + $response = $this->get('/commande/confirmation/1'); + + // THEN + $response->assertRedirectToRoute('fo.auth.connexion'); + }); + + it('displays basket summary when customer is authorized', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + $customer = new Customer(); + $customer->email = new Email('test@example.com'); + $customer->hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->save(); + $this->actingAs($customer, 'frontend'); + + $this->withoutMiddleware([ + CustomerIsEmployed::class, + EnsureCustomerEmailIsVerified::class, + ]); + Gate::before(fn () => true); + + $basket = new Basket(new BasketId(Uuid::uuid7())); + $this->mock(Executor::class, function ($mock) use ($basket): void { + $mock->shouldReceive('execute') + ->once() + ->andReturn(new GetBasketSummaryQueryOutput( + step: OrderTunnelStep::REVIEW, + basket: $basket, + )); + }); + + // WHEN + $response = $this->get('/commande/panier'); + + // THEN + $response->assertOk() + ->assertViewIs('fo.tunnel.basket-summary') + ->assertViewHas('step', OrderTunnelStep::REVIEW) + ->assertViewHas('basket', $basket); + }); + + it('submits basket summary and redirects to pick time slot', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + $customer = new Customer(); + $customer->email = new Email('test@example.com'); + $customer->hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->save(); + $this->actingAs($customer, 'frontend'); + + $this->withoutMiddleware([ + CustomerIsEmployed::class, + EnsureCustomerEmailIsVerified::class, + ]); + Gate::before(fn () => true); + + $this->mock(Executor::class, function ($mock): void { + $mock->shouldReceive('execute') + ->once(); + }); + + // WHEN + $response = $this->post('/commande/panier', []); + + // THEN + $response->assertRedirectToRoute('fo.sales.pick-time-slot'); + }); + + it('displays pick time slot when customer is authorized', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + $customer = new Customer(); + $customer->email = new Email('test@example.com'); + $customer->hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->save(); + $this->actingAs($customer, 'frontend'); + + $this->withoutMiddleware([ + CustomerIsEmployed::class, + EnsureCustomerEmailIsVerified::class, + ]); + Gate::before(fn () => true); + + $shopDto = new ShopDto( + id: 'test-shop', + name: 'Test Shop', + address: '1 rue Test', + postcode: '75001', + city: 'Paris', + phone: null, + latitude: null, + longitude: null, + default: true, + ); + + $this->mock(Executor::class, function ($mock) use ($shopDto): void { + $mock->shouldReceive('execute') + ->once() + ->andReturn(new GetPickTimeSlotQueryOutput( + step: OrderTunnelStep::BOOKING, + shop: $shopDto, + timeSlots: [], + mapUrl: 'https://maps.example.com', + )); + }); + + // WHEN + $response = $this->get('/commande/creneaux'); + + // THEN + $response->assertOk() + ->assertViewIs('fo.tunnel.pick-time-slot') + ->assertViewHas('step', OrderTunnelStep::BOOKING) + ->assertViewHas('shop', $shopDto) + ->assertViewHas('mapUrl', 'https://maps.example.com'); + }); + + it('submits pick time slot and redirects to confirmation when slot is valid', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + $customer = new Customer(); + $customer->email = new Email('test@example.com'); + $customer->hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->save(); + $this->actingAs($customer, 'frontend'); + + $this->withoutMiddleware([ + CustomerIsEmployed::class, + EnsureCustomerEmailIsVerified::class, + ]); + Gate::before(fn () => true); + + $shopper = new Shopper( + id: $customer->getId(), + email: new Email('test@example.com'), + matricule: new Matricule('1234567'), + nom: 'Dupont', + prenom: 'Jean', + startDate: now()->subMonth(), + endDate: null, + etablissement: new ShopperEstablishmentCode('FAC01'), + site: new ShopperSiteCode('SITE'), + service: new ShopperServiceCode('101'), + ); + $this->mock(ShopperRepository::class, function ($mock) use ($shopper): void { + $mock->shouldReceive('getByIdOrFail')->andReturn($shopper); + }); + $this->mock(OrderTunnelService::class, function ($mock): void { + $mock->shouldReceive('assertBasketWeeklyAmountWithinLimitFor'); + }); + + $slot = new PickupTimeSlot(now(), new \DateInterval('PT1H')); + $this->mock(Executor::class, function ($mock) use ($slot): void { + $mock->shouldReceive('execute') + ->once() + ->andReturn($slot); + }); + + // WHEN + $response = $this->post('/commande/creneaux', [ + 'timeslot' => now()->format('Y-m-d'), + ]); + + // THEN + $response->assertRedirectToRoute('fo.sales.confirmation'); + }); + + it('submits pick time slot and redirects back with error when slot is invalid', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + $customer = new Customer(); + $customer->email = new Email('test@example.com'); + $customer->hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->save(); + $this->actingAs($customer, 'frontend'); + + $this->withoutMiddleware([ + CustomerIsEmployed::class, + EnsureCustomerEmailIsVerified::class, + ]); + Gate::before(fn () => true); + + $shopper = new Shopper( + id: $customer->getId(), + email: new Email('test@example.com'), + matricule: new Matricule('1234567'), + nom: 'Dupont', + prenom: 'Jean', + startDate: now()->subMonth(), + endDate: null, + etablissement: new ShopperEstablishmentCode('FAC01'), + site: new ShopperSiteCode('SITE'), + service: new ShopperServiceCode('101'), + ); + $this->mock(ShopperRepository::class, function ($mock) use ($shopper): void { + $mock->shouldReceive('getByIdOrFail')->andReturn($shopper); + }); + $this->mock(OrderTunnelService::class, function ($mock): void { + $mock->shouldReceive('assertBasketWeeklyAmountWithinLimitFor'); + }); + + $this->mock(Executor::class, function ($mock): void { + $mock->shouldReceive('execute') + ->once() + ->andReturn(null); + }); + + // WHEN + $response = $this->from('/commande/creneaux')->post('/commande/creneaux', [ + 'timeslot' => now()->format('Y-m-d'), + ]); + + // THEN + $response->assertRedirect('/commande/creneaux') + ->assertSessionHasErrors('timeslot'); + }); + + it('displays order confirmation when customer is authorized', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + $customer = new Customer(); + $customer->email = new Email('test@example.com'); + $customer->hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->save(); + $this->actingAs($customer, 'frontend'); + + $this->withoutMiddleware([ + CustomerIsEmployed::class, + EnsureCustomerEmailIsVerified::class, + ]); + Gate::before(fn () => true); + + $basket = new Basket(new BasketId(Uuid::uuid7())); + $builder = \Mockery::mock(OrderBuilderCompleted::class); + $slot = new PickupTimeSlot(now(), new \DateInterval('PT1H')); + $builder->shouldReceive('getPickupTimeSlot')->andReturn($slot); + + $shopDto = new ShopDto( + id: 'test-shop', + name: 'Test Shop', + address: '1 rue Test', + postcode: '75001', + city: 'Paris', + phone: null, + latitude: null, + longitude: null, + default: true, + ); + + $this->mock(Executor::class, function ($mock) use ($basket, $builder, $shopDto): void { + $mock->shouldReceive('execute') + ->once() + ->andReturn(new GetOrderConfirmationQueryOutput( + step: OrderTunnelStep::CONFIRMATION, + basket: $basket, + builder: $builder, + shop: $shopDto, + )); + }); + + // WHEN + $response = $this->get('/commande/confirmation'); + + // THEN + $response->assertOk() + ->assertViewIs('fo.tunnel.confirmation') + ->assertViewHas('step', OrderTunnelStep::CONFIRMATION) + ->assertViewHas('basket', $basket) + ->assertViewHas('shop', $shopDto); + }); + + it('submits confirmation and redirects to confirmed view when cgv accepted', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + $customer = new Customer(); + $customer->email = new Email('test@example.com'); + $customer->hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->save(); + $this->actingAs($customer, 'frontend'); + + $this->withoutMiddleware([ + CustomerIsEmployed::class, + EnsureCustomerEmailIsVerified::class, + ]); + Gate::before(fn () => true); + + $orderReference = new OrderReference(Uuid::uuid7()); + $this->mock(Executor::class, function ($mock) use ($orderReference): void { + $mock->shouldReceive('execute') + ->once() + ->andReturn($orderReference); + }); + + // WHEN + $response = $this->post('/commande/confirmation', [ + 'ok_cgv' => '1', + ]); + + // THEN + $response->assertRedirectToRoute('fo.sales.confirmation.show-confirmed', (string) $orderReference); + }); + + it('redirects back with message when limit exception occurs on confirmation submit', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + $customer = new Customer(); + $customer->email = new Email('test@example.com'); + $customer->hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->save(); + $this->actingAs($customer, 'frontend'); + + $this->withoutMiddleware([ + CustomerIsEmployed::class, + EnsureCustomerEmailIsVerified::class, + ]); + Gate::before(fn () => true); + + $this->mock(Executor::class, function ($mock): void { + $mock->shouldReceive('execute') + ->once() + ->andThrow(new WeeklyLimitExceededException()); + }); + + // WHEN + $response = $this->from('/commande/confirmation')->post('/commande/confirmation', [ + 'ok_cgv' => '1', + ]); + + // THEN + $response->assertRedirect('/commande/confirmation') + ->assertSessionHas('message'); + }); + + it('displays confirmed order view when customer is authorized', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $this->seed(ContentSeeder::class); + View::share('PageList', Page::getCached() + ->mapWithKeys(fn ($page) => [ + $page->slug->value() => $page, + ])); + Cache::flush(); + + $customer = new Customer(); + $customer->email = new Email('test@example.com'); + $customer->hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->save(); + $this->actingAs($customer, 'frontend'); + + $this->withoutMiddleware([ + CustomerIsEmployed::class, + EnsureCustomerEmailIsVerified::class, + ]); + Gate::before(fn () => true); + + $shop = new Shop(); + $shop->name = 'Boutique Test'; + $shop->address = '1 rue Test'; + $shop->postcode = '75001'; + $shop->city = 'Paris'; + $shop->default = true; + $shop->save(); + + $orderReference = new OrderReference(Uuid::uuid7()); + $order = new Order(); + $order->reference = $orderReference; + $order->total = Money::EUR(3000); + $order->status = OrderStatus::WAITING; + $order->pickup_day = now()->addDays(2); + $order->shop_id = $shop->id; + $order->employee = new OrderEmployee( + firstname: 'Jean', + lastname: 'Dupont', + matricule: new Matricule('1234567'), + facility: new ShopperEstablishmentCode('FAC01'), + site: new ShopperSiteCode('SITE'), + service: new ShopperServiceCode('101'), + ); + $order->delivery_address = new DeliveryAddress( + name: $shop->name, + address: $shop->address, + postcode: $shop->postcode, + city: $shop->city, + ); + $order->save(); + + // WHEN + $response = $this->get('/commande/confirmation/' . (string) $orderReference); + + // THEN + $response->assertOk() + ->assertViewIs('fo.tunnel.confirmed') + ->assertViewHas('step', OrderTunnelStep::CONFIRMATION) + ->assertViewHas('order') + ->assertViewHas('shop') + ->assertViewHas('mapUrl'); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Basket/AddBasketRequestTest.php b/tests/Feature/App/Http/Requests/Basket/AddBasketRequestTest.php new file mode 100644 index 00000000..b7f974c5 --- /dev/null +++ b/tests/Feature/App/Http/Requests/Basket/AddBasketRequestTest.php @@ -0,0 +1,177 @@ + 'Test', 'slug' => 'test', 'order' => 1, 'picture_alt' => '', 'picture_title' => '']); + $product = Product::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'name' => 'Test', + 'slug' => Uuid::uuid7()->toString(), + 'brand' => ProductBrand::cases()[0]->value, + 'description' => 'Test', + 'price' => new Money(100, resolve(Currency::class)), + 'invoicing_unit' => InvoicingUnit::cases()[0]->value, + 'tax_rate' => TaxRate::cases()[0]->value, + 'stock' => 10, + 'picture_alt' => '', + 'picture_title' => '', + 'picture_large_alt' => '', + 'picture_large_title' => '', + 'sell_unit' => SellUnit::cases()[0]->value, + 'status' => true, + 'star' => false, + 'weight_variable' => false, + 'range_id' => $range->id, + ]); + + Gate::shouldReceive('allows') + ->with('addToBasket', \Mockery::on(fn ($p) => $p->id === $product->id)) + ->andReturn(true); + + $request = new AddBasketRequest(); + $request->initialize(); + + // WHEN + $request->merge(['rowId' => $product->id]); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('does not authorize when product does not exist', function () { + // GIVEN + $request = new AddBasketRequest(); + $request->initialize(); + + // WHEN + $request->merge(['rowId' => Uuid::uuid7()->toString()]); + + // THEN + expect($request->authorize())->toBeFalse(); + }); + + it('does not authorize when gate denies', function () { + // GIVEN + $range = Range::first() ?? Range::forceCreate(['name' => 'Test', 'slug' => 'test', 'order' => 1, 'picture_alt' => '', 'picture_title' => '']); + $product = Product::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'name' => 'Test', + 'slug' => Uuid::uuid7()->toString(), + 'brand' => ProductBrand::cases()[0]->value, + 'description' => 'Test', + 'price' => new Money(100, resolve(Currency::class)), + 'invoicing_unit' => InvoicingUnit::cases()[0]->value, + 'tax_rate' => TaxRate::cases()[0]->value, + 'stock' => 10, + 'picture_alt' => '', + 'picture_title' => '', + 'picture_large_alt' => '', + 'picture_large_title' => '', + 'sell_unit' => SellUnit::cases()[0]->value, + 'status' => true, + 'star' => false, + 'weight_variable' => false, + 'range_id' => $range->id, + ]); + + Gate::shouldReceive('allows') + ->with('addToBasket', \Mockery::any()) + ->andReturn(false); + + $request = new AddBasketRequest(); + $request->initialize(); + + // WHEN + $request->merge(['rowId' => $product->id]); + + // THEN + expect($request->authorize())->toBeFalse(); + }); + + it('validates correct rules', function () { + // GIVEN + $range = Range::first() ?? Range::forceCreate(['name' => 'Test', 'slug' => 'test', 'order' => 1, 'picture_alt' => '', 'picture_title' => '']); + $product = Product::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'name' => 'Test', + 'slug' => Uuid::uuid7()->toString(), + 'brand' => ProductBrand::cases()[0]->value, + 'description' => 'Test', + 'price' => new Money(100, resolve(Currency::class)), + 'invoicing_unit' => InvoicingUnit::cases()[0]->value, + 'tax_rate' => TaxRate::cases()[0]->value, + 'stock' => 10, + 'picture_alt' => '', + 'picture_title' => '', + 'picture_large_alt' => '', + 'picture_large_title' => '', + 'sell_unit' => SellUnit::cases()[0]->value, + 'status' => true, + 'star' => false, + 'weight_variable' => false, + 'range_id' => $range->id, + ]); + + $request = new AddBasketRequest(); + $request->initialize(); + $request->merge([ + 'rowId' => $product->id, + 'qty' => 1, + ]); + + // WHEN + $validator = Validator::make($request->all(), $request->rules()); + + // THEN + expect($validator->passes())->toBeTrue(); + }); + + it('fails validation on incorrect rules', function () { + // GIVEN + $request = new AddBasketRequest(); + $request->initialize(); + $request->merge([ + 'rowId' => 'not-a-uuid', + 'qty' => 0, + ]); + + // WHEN + $validator = Validator::make($request->all(), $request->rules()); + + // THEN + expect($validator->passes())->toBeFalse() + ->and($validator->errors()->keys())->toContain('rowId', 'qty'); + }); + + it('can get product id as value object', function () { + // GIVEN + $uuid = Uuid::uuid7()->toString(); + $request = new AddBasketRequest(); + $request->initialize(); + $request->merge(['rowId' => $uuid]); + + // WHEN + $productId = $request->getProductId(); + + // THEN + expect($productId)->toBeInstanceOf(ProductId::class) + ->and($productId->value->toString())->toBe($uuid); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Basket/RemoveBasketRequestTest.php b/tests/Feature/App/Http/Requests/Basket/RemoveBasketRequestTest.php new file mode 100644 index 00000000..21a9afd2 --- /dev/null +++ b/tests/Feature/App/Http/Requests/Basket/RemoveBasketRequestTest.php @@ -0,0 +1,69 @@ +initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('validates correct rules', function () { + // GIVEN + $request = new RemoveBasketRequest(); + $request->initialize(); + $request->merge([ + 'rowId' => Uuid::uuid7()->toString(), + 'qty' => 1, + ]); + + // WHEN + $validator = Validator::make($request->all(), $request->rules()); + + // THEN + expect($validator->passes())->toBeTrue(); + }); + + it('fails validation on incorrect rules', function () { + // GIVEN + $request = new RemoveBasketRequest(); + $request->initialize(); + $request->merge([ + 'rowId' => 'not-a-uuid', + 'qty' => 0, + ]); + + // WHEN + $validator = Validator::make($request->all(), $request->rules()); + + // THEN + expect($validator->passes())->toBeFalse() + ->and($validator->errors()->keys())->toContain('rowId', 'qty'); + }); + + it('can get product id as value object', function () { + // GIVEN + $uuid = Uuid::uuid7()->toString(); + $request = new RemoveBasketRequest(); + $request->initialize(); + $request->merge(['rowId' => $uuid]); + + // WHEN + $productId = $request->getProductId(); + + // THEN + expect($productId)->toBeInstanceOf(ProductId::class) + ->and($productId->value->toString())->toBe($uuid); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Bo/Dashboard/DashboardRequestTest.php b/tests/Feature/App/Http/Requests/Bo/Dashboard/DashboardRequestTest.php new file mode 100644 index 00000000..5debb823 --- /dev/null +++ b/tests/Feature/App/Http/Requests/Bo/Dashboard/DashboardRequestTest.php @@ -0,0 +1,86 @@ +shouldReceive('check')->once()->andReturn(true); + + $request = new DashboardRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('returns rules', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new DashboardRequest($authService); + $request->initialize(); + + // WHEN + $rules = $request->rules(); + + // THEN + expect($rules)->toHaveKeys(['start', 'end']); + }); + + it('gets start date', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new DashboardRequest($authService); + $request->initialize(); + + expect($request->getStart())->toBeNull(); + + // WHEN + $request->merge(['start' => '2023-01-01']); + + // THEN + expect($request->getStart()->format('Y-m-d'))->toBe('2023-01-01'); + }); + + it('gets end date', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new DashboardRequest($authService); + $request->initialize(); + + expect($request->getEnd())->toBeNull(); + + // WHEN + $request->merge(['end' => '2023-12-31']); + + // THEN + expect($request->getEnd()->format('Y-m-d'))->toBe('2023-12-31'); + }); + + it('maps to GetBoDashboardQueryInput', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new DashboardRequest($authService); + $request->initialize(query: [ + 'start' => '2026-01-01', + 'end' => '2026-01-31', + ]); + + // WHEN + $input = $request->toGetBoDashboardQueryInput(); + + // THEN + expect($input)->toBeInstanceOf(GetBoDashboardQueryInput::class) + ->and($input->start?->format('Y-m-d'))->toBe('2026-01-01') + ->and($input->end?->format('Y-m-d'))->toBe('2026-01-31'); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Bo/Discounts/StoreDiscountRequestTest.php b/tests/Feature/App/Http/Requests/Bo/Discounts/StoreDiscountRequestTest.php new file mode 100644 index 00000000..d2380260 --- /dev/null +++ b/tests/Feature/App/Http/Requests/Bo/Discounts/StoreDiscountRequestTest.php @@ -0,0 +1,186 @@ +shouldReceive('check')->once()->andReturn(true); + + $request = new StoreDiscountRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('prepares for validation', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreDiscountRequest($authService); + $request->initialize(); + + // WHEN + $request->merge([ + 'is_old_price_displayed' => '1', + 'associated_products' => ['1', '2'], + ]); + + $reflection = new \ReflectionClass($request); + $prepareMethod = $reflection->getMethod('prepareForValidation'); + $prepareMethod->setAccessible(true); + $prepareMethod->invoke($request); + + // THEN + expect($request->input('is_old_price_displayed'))->toBeTrue() + ->and($request->input('associated_products'))->toBe(['1', '2']); + }); + + it('gets associated products ids', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreDiscountRequest($authService); + $request->initialize(); + + // WHEN + $request->merge(['associated_products' => [1, 2]]); + + // THEN + expect($request->getAssociatedProductsIds())->toBe(['1', '2']); + }); + + it('gets discount value for percent', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreDiscountRequest($authService); + $request->initialize(); + $request->merge([ + 'type' => DiscountType::PERCENT->value, + 'value' => 10, + ]); + + // WHEN + $value = $request->getDiscountValue(); + + // THEN + expect($value->type)->toBe(DiscountType::PERCENT); + }); + + it('gets discount value for amount', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreDiscountRequest($authService); + $request->initialize(); + $request->merge([ + 'type' => DiscountType::AMOUNT->value, + 'value' => 1000, // 10.00 + ]); + + // WHEN + $value = $request->getDiscountValue(); + + // THEN + expect($value->type)->toBe(DiscountType::AMOUNT); + }); + + it('passes validation formats dates', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreDiscountRequest($authService); + $request->initialize(); + + // WHEN + $request->merge([ + 'date_start' => '2023-01-01T10:00', + 'date_end' => '2023-01-02T10:00', + 'client_timezone' => 'Europe/Paris', + ]); + + $reflection = new \ReflectionClass($request); + $passedMethod = $reflection->getMethod('passedValidation'); + $passedMethod->setAccessible(true); + $passedMethod->invoke($request); + + // THEN + expect($request->input('date_start'))->toBe('2023-01-01 09:00:00') // Paris is UTC+1 in winter + ->and($request->input('date_end'))->toBe('2023-01-02 09:00:00'); + }); + + it('throws exception if invalid date_start or date_end provided in passedValidation', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreDiscountRequest($authService); + $request->initialize(); + + $request->merge([ + 'date_start' => 'invalid', + 'client_timezone' => 'Europe/Paris', + ]); + + $reflection = new \ReflectionClass($request); + $passedMethod = $reflection->getMethod('passedValidation'); + $passedMethod->setAccessible(true); + + expect(fn () => $passedMethod->invoke($request))->toThrow(InvalidFormatException::class, ''); + + // WHEN + $request->merge([ + 'date_start' => null, + 'date_end' => 'invalid', + ]); + + // THEN + expect(fn () => $passedMethod->invoke($request))->toThrow(InvalidFormatException::class, ''); + }); + + it('returns rules and attributes', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreDiscountRequest($authService); + $request->initialize(); + + // WHEN + $request->merge(['type' => DiscountType::PERCENT->value]); + + // THEN + expect($request->rules())->toHaveKeys(['type', 'value', 'is_old_price_displayed', 'date_start', 'date_end', 'associated_products']) + ->and($request->attributes())->toHaveKeys(['type', 'value', 'is_old_price_displayed', 'date_start', 'date_end', 'associated_products']); + }); + + it('returns domain Value Objects and typed properties via to* methods', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreDiscountRequest($authService); + $request->initialize(); + $request->merge([ + 'type' => DiscountType::PERCENT->value, + 'value' => 25, + 'associated_products' => ['prod-1', 'prod-2'], + 'date_start' => '2026-06-01 10:00:00', + 'date_end' => '2026-06-30 20:00:00', + ]); + + // WHEN + $type = $request->toDiscountType(); + $value = $request->toDiscountValue(); + $productIds = $request->toAssociatedProductsIds(); + $period = $request->toDatePeriod(); + + // THEN + expect($type)->toBe(DiscountType::PERCENT) + ->and($value->getPercentage())->toBe(25) + ->and($productIds)->toBe(['prod-1', 'prod-2']) + ->and($period->start?->format('Y-m-d H:i:s'))->toBe('2026-06-01 10:00:00') + ->and($period->end?->format('Y-m-d H:i:s'))->toBe('2026-06-30 20:00:00'); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Bo/Faqs/StoreFaqRequestTest.php b/tests/Feature/App/Http/Requests/Bo/Faqs/StoreFaqRequestTest.php new file mode 100644 index 00000000..f4ca5fc1 --- /dev/null +++ b/tests/Feature/App/Http/Requests/Bo/Faqs/StoreFaqRequestTest.php @@ -0,0 +1,124 @@ +shouldReceive('check')->once()->andReturn(true); + + $request = new StoreFaqRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('fails authorization if auth service returns false', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $authService->shouldReceive('check')->once()->andReturn(false); + + $request = new StoreFaqRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeFalse(); + }); + + it('validates question and answer', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreFaqRequest($authService); + $request->initialize(); + + $rules = $request->rules(); + + expect($rules)->toHaveKeys(['question', 'answer']); + + // WHEN + $validator = Validator::make([ + 'question' => 'What is Pest?', + 'answer' => 'A testing framework.', + ], $rules); + + // THEN + expect($validator->passes())->toBeTrue(); + }); + + it('fails validation if required fields are missing', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreFaqRequest($authService); + $request->initialize(); + + // WHEN + $validator = Validator::make([], $request->rules()); + + // THEN + expect($validator->fails())->toBeTrue() + ->and($validator->errors()->keys())->toContain('question', 'answer'); + }); + + it('fails validation if question is too short or too long', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreFaqRequest($authService); + $request->initialize(); + + // WHEN + $rules = $request->rules(); + + $validatorShort = Validator::make(['question' => 'abc', 'answer' => 'Valid answer'], $rules); + expect($validatorShort->fails())->toBeTrue() + ->and($validatorShort->errors()->keys())->toContain('question'); + + $validatorLong = Validator::make(['question' => str_repeat('a', 256), 'answer' => 'Valid answer'], $rules); + + // THEN + expect($validatorLong->fails())->toBeTrue() + ->and($validatorLong->errors()->keys())->toContain('question'); + }); + + it('fails validation if answer is too short', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreFaqRequest($authService); + $request->initialize(); + + // WHEN + $rules = $request->rules(); + + $validatorShort = Validator::make(['question' => 'Valid question', 'answer' => 'abc'], $rules); + + // THEN + expect($validatorShort->fails())->toBeTrue() + ->and($validatorShort->errors()->keys())->toContain('answer'); + }); + + it('returns correct custom attributes', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreFaqRequest($authService); + $request->initialize(); + + // WHEN + $attributes = $request->attributes(); + + // THEN + expect($attributes)->toHaveKeys(['question', 'answer']) + ->and($attributes['question'])->toBe(trans('validation.custom.attributes.question')) + ->and($attributes['answer'])->toBe(trans('validation.custom.attributes.answer')); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Bo/MassActionRequestTest.php b/tests/Feature/App/Http/Requests/Bo/MassActionRequestTest.php new file mode 100644 index 00000000..7a39a22f --- /dev/null +++ b/tests/Feature/App/Http/Requests/Bo/MassActionRequestTest.php @@ -0,0 +1,97 @@ +shouldReceive('check')->once()->andReturn(true); + + $request = new MassActionRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('validates with action field and model list', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new MassActionRequest($authService); + $request->initialize(); + $request->merge([ + 'action' => 'publish', + 'models' => ['1', '2'], + ]); + + $rules = $request->rules(); + expect($rules)->toHaveKeys(['action', 'models', 'models.*']); + + // WHEN + $validator = Validator::make($request->all(), $rules); + + // THEN + expect($validator->passes())->toBeTrue(); + }); + + it('fails validation with an invalid action value', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new MassActionRequest($authService); + $request->initialize(); + $request->merge([ + 'action' => 'invalid-value', + 'models' => ['1'], + ]); + + // WHEN + $validator = Validator::make($request->all(), $request->rules()); + + // THEN + expect($validator->fails())->toBeTrue() + ->and($validator->errors()->has('action'))->toBeTrue(); + }); + + it('resolves MassActionType via getMassActionType()', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new MassActionRequest($authService); + $request->initialize(); + $request->merge(['action' => 'star', 'models' => ['1']]); + + // WHEN & THEN + expect($request->getMassActionType())->toBe(MassActionType::Star); + }); + + it('builds ExecuteMassActionInput via toExecuteMassActionInput()', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new MassActionRequest($authService); + $request->initialize(); + $request->merge([ + 'action' => 'unpublish', + 'models' => ['10', '20'], + ]); + + // WHEN + $input = $request->toExecuteMassActionInput(Product::class); + + // THEN + expect($input)->toBeInstanceOf(ExecuteMassActionInput::class) + ->and($input->modelClass)->toBe(Product::class) + ->and($input->action)->toBe(MassActionType::Unpublish) + ->and($input->modelKeyList)->toBe(['10', '20']); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Bo/Orders/IndexOrdersRequestTest.php b/tests/Feature/App/Http/Requests/Bo/Orders/IndexOrdersRequestTest.php new file mode 100644 index 00000000..6e8254c8 --- /dev/null +++ b/tests/Feature/App/Http/Requests/Bo/Orders/IndexOrdersRequestTest.php @@ -0,0 +1,183 @@ +shouldReceive('check')->once()->andReturn(true); + + $request = new IndexOrdersRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('prepares for validation by removing empty filter values while preserving other parameters', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new IndexOrdersRequest($authService); + $request->initialize(); + + // WHEN + $request->merge([ + 'order_date_start' => '2023-01-01', + 'order_date_end' => '', + 'order_pickup_start' => null, + 'status' => 'pending', + 'page' => '3', + 'other_field' => 'value', + ]); + + $reflection = new \ReflectionClass($request); + $prepareMethod = $reflection->getMethod('prepareForValidation'); + $prepareMethod->setAccessible(true); + $prepareMethod->invoke($request); + + // THEN + expect($request->all())->toBe([ + 'order_date_start' => '2023-01-01', + 'status' => 'pending', + 'page' => '3', + 'other_field' => 'value', + ]); + }); + + it('gets status', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new IndexOrdersRequest($authService); + $request->initialize(); + + expect($request->getStatus())->toBeNull(); + + // WHEN + $request->merge(['status' => OrderStatus::WAITING->value]); + + // THEN + expect($request->getStatus())->toBe(OrderStatus::WAITING); + }); + + it('gets order date start', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new IndexOrdersRequest($authService); + $request->initialize(); + expect($request->getOrderDateStart())->toBeNull(); + + // WHEN + $request->merge(['order_date_start' => '2023-01-01']); + + // THEN + expect($request->getOrderDateStart()->format('Y-m-d'))->toBe('2023-01-01'); + }); + + it('gets order date end', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new IndexOrdersRequest($authService); + $request->initialize(); + expect($request->getOrderDateEnd())->toBeNull(); + + // WHEN + $request->merge(['order_date_end' => '2023-01-02']); + + // THEN + expect($request->getOrderDateEnd()->format('Y-m-d'))->toBe('2023-01-02'); + }); + + it('gets order pickup start', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new IndexOrdersRequest($authService); + $request->initialize(); + expect($request->getOrderPickupStart())->toBeNull(); + + // WHEN + $request->merge(['order_pickup_start' => '2023-01-03']); + + // THEN + expect($request->getOrderPickupStart()->format('Y-m-d'))->toBe('2023-01-03'); + }); + + it('gets order pickup end', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new IndexOrdersRequest($authService); + $request->initialize(); + expect($request->getOrderPickupEnd())->toBeNull(); + + // WHEN + $request->merge(['order_pickup_end' => '2023-01-04']); + + // THEN + expect($request->getOrderPickupEnd()->format('Y-m-d'))->toBe('2023-01-04'); + }); + + it('validates rules', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new IndexOrdersRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->rules())->toHaveKeys([ + 'status', + 'order_date_start', + 'order_date_end', + 'order_pickup_start', + 'order_pickup_end', + ]); + }); + + it('returns attributes', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new IndexOrdersRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->attributes())->toHaveKeys([ + 'status', + 'order_date_start', + 'order_date_end', + 'order_pickup_start', + 'order_pickup_end', + ]); + }); + + it('maps to GetBoPaginatedOrdersQueryInput', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new IndexOrdersRequest($authService); + $request->initialize(query: [ + 'page' => 3, + 'search' => 'TEST-REF', + 'status' => (string) OrderStatus::VALIDATED->value, + ]); + + // WHEN + $input = $request->toGetBoPaginatedOrdersQueryInput(); + + // THEN + expect($input)->toBeInstanceOf(GetBoPaginatedOrdersQueryInput::class) + ->and($input->pagination->pageNumber()->value())->toBe(3) + ->and($input->search)->toBe('TEST-REF') + ->and($input->status)->toBe(OrderStatus::VALIDATED); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Bo/Pages/UpdatePageRequestTest.php b/tests/Feature/App/Http/Requests/Bo/Pages/UpdatePageRequestTest.php new file mode 100644 index 00000000..a24a8f98 --- /dev/null +++ b/tests/Feature/App/Http/Requests/Bo/Pages/UpdatePageRequestTest.php @@ -0,0 +1,50 @@ +shouldReceive('check')->once()->andReturn(true); + + $request = new UpdatePageRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('validates rules', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new UpdatePageRequest($authService); + $request->initialize(); + + // WHEN + $rules = $request->rules(); + + // THEN + expect($rules)->toHaveKeys(['seo_title', 'seo_description', 'title', 'content']); + }); + + it('returns attributes', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new UpdatePageRequest($authService); + $request->initialize(); + + // WHEN + $attributes = $request->attributes(); + + // THEN + expect($attributes)->toHaveKeys(['seo_title', 'seo_description', 'title', 'content']); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Bo/PickupExceptions/StorePickupExceptionRequestTest.php b/tests/Feature/App/Http/Requests/Bo/PickupExceptions/StorePickupExceptionRequestTest.php new file mode 100644 index 00000000..b031d2d0 --- /dev/null +++ b/tests/Feature/App/Http/Requests/Bo/PickupExceptions/StorePickupExceptionRequestTest.php @@ -0,0 +1,111 @@ +shouldReceive('check')->once()->andReturn(true); + + $request = new StorePickupExceptionRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('prepares for validation', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StorePickupExceptionRequest($authService); + $request->initialize(); + + // WHEN + $request->merge(['repeatable' => '1']); + + $reflection = new \ReflectionClass($request); + $prepareMethod = $reflection->getMethod('prepareForValidation'); + $prepareMethod->setAccessible(true); + $prepareMethod->invoke($request); + + // THEN + expect($request->input('repeatable'))->toBeTrue(); + }); + + it('passes validation resets repeat frequency to Weekly if not repeatable', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StorePickupExceptionRequest($authService); + $request->initialize(); + + // WHEN + $request->merge([ + 'repeatable' => false, + 'repeat_frequency' => RepeatFrequency::WEEKLY->value, + ]); + + $reflection = new \ReflectionClass($request); + $passedMethod = $reflection->getMethod('passedValidation'); + $passedMethod->setAccessible(true); + $passedMethod->invoke($request); + + // THEN + expect($request->input('repeat_frequency'))->toBe(RepeatFrequency::WEEKLY->value); + }); + + it('passes validation keeps repeat frequency if repeatable', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StorePickupExceptionRequest($authService); + $request->initialize(); + + // WHEN + $request->merge([ + 'repeatable' => true, + 'repeat_frequency' => RepeatFrequency::WEEKLY->value, + ]); + + $reflection = new \ReflectionClass($request); + $passedMethod = $reflection->getMethod('passedValidation'); + $passedMethod->setAccessible(true); + $passedMethod->invoke($request); + + // THEN + expect($request->input('repeat_frequency'))->toBe(RepeatFrequency::WEEKLY->value); + }); + + it('returns rules', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StorePickupExceptionRequest($authService); + $request->initialize(); + + // WHEN + $rules = $request->rules(); + + // THEN + expect($rules)->toHaveKeys(['date', 'label', 'repeatable', 'repeat_frequency']); + }); + + it('returns attributes', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StorePickupExceptionRequest($authService); + $request->initialize(); + + // WHEN + $attributes = $request->attributes(); + + // THEN + expect($attributes)->toHaveKeys(['date', 'label', 'repeatable', 'repeat_frequency']); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Bo/Products/IndexProductRequestTest.php b/tests/Feature/App/Http/Requests/Bo/Products/IndexProductRequestTest.php new file mode 100644 index 00000000..30325936 --- /dev/null +++ b/tests/Feature/App/Http/Requests/Bo/Products/IndexProductRequestTest.php @@ -0,0 +1,85 @@ +shouldReceive('check')->once()->andReturn(true); + $request = new IndexProductRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('returns rules', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new IndexProductRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->rules())->toBeArray(); + }); + + it('returns attributes', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new IndexProductRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->attributes())->toBeArray(); + }); + + it('prepares for validation', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new IndexProductRequest($authService); + $request->initialize(); + $method = new \ReflectionMethod($request, 'prepareForValidation'); + $method->setAccessible(true); + + // WHEN + $method->invoke($request); + + // THEN + expect(true)->toBeTrue(); + }); + + it('resolves discount filter correctly in toGetBoPaginatedProductsQueryInput', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new IndexProductRequest($authService); + $request->initialize(['discount' => '0']); + + // WHEN + $input = $request->toGetBoPaginatedProductsQueryInput(); + + // THEN + expect($input->discount)->toBe('0'); + + // GIVEN + $requestWithId = new IndexProductRequest($authService); + $requestWithId->initialize(['discount' => '42']); + + // WHEN + $inputWithId = $requestWithId->toGetBoPaginatedProductsQueryInput(); + + // THEN + expect($inputWithId->discount)->toBe('42'); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Bo/Products/StoreProductRequestTest.php b/tests/Feature/App/Http/Requests/Bo/Products/StoreProductRequestTest.php new file mode 100644 index 00000000..bf6179c4 --- /dev/null +++ b/tests/Feature/App/Http/Requests/Bo/Products/StoreProductRequestTest.php @@ -0,0 +1,77 @@ +shouldReceive('check')->once()->andReturn(true); + $request = new StoreProductRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('returns rules', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreProductRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->rules())->toBeArray(); + }); + + it('returns attributes', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreProductRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->attributes())->toBeArray(); + }); + + it('prepares for validation', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreProductRequest($authService); + $request->initialize(); + $method = new \ReflectionMethod($request, 'prepareForValidation'); + $method->setAccessible(true); + + // WHEN + $method->invoke($request); + + // THEN + expect(true)->toBeTrue(); // just making sure it runs without exception + }); + + it('passes validation', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreProductRequest($authService); + $request->initialize(); + $method = new \ReflectionMethod($request, 'passedValidation'); + $method->setAccessible(true); + + // WHEN + $method->invoke($request); + + // THEN + expect(true)->toBeTrue(); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Bo/Ranges/StoreRangeRequestTest.php b/tests/Feature/App/Http/Requests/Bo/Ranges/StoreRangeRequestTest.php new file mode 100644 index 00000000..3792430e --- /dev/null +++ b/tests/Feature/App/Http/Requests/Bo/Ranges/StoreRangeRequestTest.php @@ -0,0 +1,62 @@ +shouldReceive('check')->once()->andReturn(true); + $request = new StoreRangeRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('returns rules', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreRangeRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->rules())->toBeArray(); + }); + + it('returns attributes', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreRangeRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->attributes())->toBeArray(); + }); + + it('prepares for validation', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreRangeRequest($authService); + $request->initialize(); + $method = new \ReflectionMethod($request, 'prepareForValidation'); + $method->setAccessible(true); + + // WHEN + $method->invoke($request); + + // THEN + expect(true)->toBeTrue(); // just making sure it runs without exception + }); +}); diff --git a/tests/Feature/App/Http/Requests/Bo/Shops/IndexShopRequestTest.php b/tests/Feature/App/Http/Requests/Bo/Shops/IndexShopRequestTest.php new file mode 100644 index 00000000..ba7eeeaa --- /dev/null +++ b/tests/Feature/App/Http/Requests/Bo/Shops/IndexShopRequestTest.php @@ -0,0 +1,154 @@ +shouldReceive('check')->once()->andReturn(true); + $request = new IndexShopRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('returns rules', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new IndexShopRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->rules())->toBeArray() + ->and($request->rules())->toHaveKey('pickup-exception'); + }); + + it('prepares for validation and updates session', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $session = mock(Session::class); + $uuid = Uuid::uuid7()->toString(); + + $session->shouldReceive('put') + ->once() + ->with(IndexShopRequest::SESSION_KEY, $uuid); + + $request = new IndexShopRequest($authService); + $request->initialize(query: ['pickup-exception' => $uuid]); + $request->setLaravelSession($session); + + $method = new \ReflectionMethod($request, 'prepareForValidation'); + $method->setAccessible(true); + + // WHEN + $method->invoke($request); + + // THEN + expect(true)->toBeTrue(); + }); + + it('prepares for validation and forgets session when pickup-exception is empty', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $session = mock(Session::class); + + $session->shouldReceive('forget') + ->once() + ->with(IndexShopRequest::SESSION_KEY); + + $request = new IndexShopRequest($authService); + $request->initialize(query: ['pickup-exception' => '']); + $request->setLaravelSession($session); + + $method = new \ReflectionMethod($request, 'prepareForValidation'); + $method->setAccessible(true); + + // WHEN + $method->invoke($request); + + // THEN + expect(true)->toBeTrue(); + }); + + it('getPickupExceptionId returns PickupExceptionId from session', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $session = mock(Session::class); + $uuid = Uuid::uuid7(); + + $session->shouldReceive('get') + ->once() + ->with(IndexShopRequest::SESSION_KEY) + ->andReturn($uuid->toString()); + + $request = new IndexShopRequest($authService); + $request->initialize(); + $request->setLaravelSession($session); + + // WHEN + $id = $request->getPickupExceptionId(); + + // THEN + expect($id)->toBeInstanceOf(PickupExceptionId::class) + ->and((string) $id)->toBe($uuid->toString()); + }); + + it('getPickupExceptionId returns null when session is empty or invalid', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $session = mock(Session::class); + + $session->shouldReceive('get') + ->twice() + ->with(IndexShopRequest::SESSION_KEY) + ->andReturn(null); + + $request = new IndexShopRequest($authService); + $request->initialize(); + $request->setLaravelSession($session); + + // WHEN + $id = $request->getPickupExceptionId(); + + // THEN + expect($id)->toBeNull() + ->and($request->toPickupExceptionId())->toBeNull(); + }); + + it('toPickupExceptionId returns PickupExceptionId from valid session', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $session = mock(Session::class); + $uuid = Uuid::uuid7(); + + $session->shouldReceive('get') + ->once() + ->with(IndexShopRequest::SESSION_KEY) + ->andReturn($uuid->toString()); + + $request = new IndexShopRequest($authService); + $request->initialize(); + $request->setLaravelSession($session); + + // WHEN + $id = $request->toPickupExceptionId(); + + // THEN + expect($id)->toBeInstanceOf(PickupExceptionId::class) + ->and((string) $id)->toBe($uuid->toString()); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Bo/Shops/StoreShopRequestTest.php b/tests/Feature/App/Http/Requests/Bo/Shops/StoreShopRequestTest.php new file mode 100644 index 00000000..84ec3a4f --- /dev/null +++ b/tests/Feature/App/Http/Requests/Bo/Shops/StoreShopRequestTest.php @@ -0,0 +1,91 @@ +shouldReceive('check')->once()->andReturn(true); + $request = new StoreShopRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('returns rules', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreShopRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->rules())->toBeArray(); + }); + + it('returns attributes', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreShopRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->attributes())->toBeArray(); + }); + + it('prepares for validation', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreShopRequest($authService); + $request->initialize(); + $method = new \ReflectionMethod($request, 'prepareForValidation'); + $method->setAccessible(true); + + // WHEN + $method->invoke($request); + + // THEN + expect(true)->toBeTrue(); // just making sure it runs without exception + }); + + it('converts to coordinates', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreShopRequest($authService); + $request->initialize(query: ['latitude' => '48.8566', 'longitude' => '2.3522']); + + // WHEN + $coords = $request->toCoordinates(); + + // THEN + expect($coords)->not->toBeNull() + ->and($coords?->latitude)->toBe(48.8566) + ->and($coords?->longitude)->toBe(2.3522); + }); + + it('converts to phone number', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreShopRequest($authService); + $request->initialize(query: ['phone' => '+33102030405']); + + // WHEN + $phone = $request->toPhoneNumber(); + + // THEN + expect($phone)->not->toBeNull() + ->and((string) $phone)->toBe('tel:+33-1-02-03-04-05'); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Bo/Shops/UpdateShopPickupExceptionsRequestTest.php b/tests/Feature/App/Http/Requests/Bo/Shops/UpdateShopPickupExceptionsRequestTest.php new file mode 100644 index 00000000..e932daa8 --- /dev/null +++ b/tests/Feature/App/Http/Requests/Bo/Shops/UpdateShopPickupExceptionsRequestTest.php @@ -0,0 +1,236 @@ +shouldReceive('check')->once()->andReturn(true); + $request = new UpdateShopPickupExceptionsRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('returns rules with uuid and exists for pickup-exceptions', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new UpdateShopPickupExceptionsRequest($authService); + + // WHEN + $rules = $request->rules(); + + // THEN + expect($rules)->toHaveKey('pickup-exceptions') + ->and($rules['pickup-exceptions.*'])->toContain('uuid') + ->and($rules['pickup-exceptions.*'])->toContain('exists:pickup_exceptions,id') + ->and($rules['pickup-exceptions.*'])->not->toContain('integer'); + }); + + it('returns human friendly attributes', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new UpdateShopPickupExceptionsRequest($authService); + + // WHEN + $attributes = $request->attributes(); + + // THEN + expect($attributes)->toHaveKey('pickup-exceptions.*') + ->and($attributes['pickup-exceptions.*'])->toBe('fermeture exceptionnelle'); + }); + + it('validates successfully with valid pickup exceptions and dates', function () { + // GIVEN + $exception1 = PickupException::factory()->create(); + $exception2 = PickupException::factory()->create(); + + $authService = mock(AppAdminAuthService::class); + $request = new UpdateShopPickupExceptionsRequest($authService); + + $data = [ + 'pickup-exceptions' => [$exception1->id, $exception2->id], + 'replacement_date' => [ + $exception1->id => '2026-10-15', + $exception2->id => null, + ], + 'order_deadline_at' => [ + $exception1->id => '2026-10-14T18:00', + $exception2->id => null, + ], + 'client_timezone' => 'Europe/Paris', + ]; + + // WHEN + $validator = Validator::make($data, $request->rules(), $request->messages(), $request->attributes()); + + // THEN + expect($validator->passes())->toBeTrue(); + }); + + it('rejects invalid uuid with non cryptic message', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new UpdateShopPickupExceptionsRequest($authService); + + $data = [ + 'pickup-exceptions' => ['invalid-not-a-uuid'], + 'client_timezone' => 'Europe/Paris', + ]; + + // WHEN + $validator = Validator::make($data, $request->rules(), $request->messages(), $request->attributes()); + + // THEN + expect($validator->fails())->toBeTrue(); + $errors = $validator->errors()->all(); + expect($errors[0])->toBe('Le champ fermeture exceptionnelle doit être un UUID valide.'); + }); + + it('rejects nonexistent uuid with non cryptic message', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new UpdateShopPickupExceptionsRequest($authService); + + $data = [ + 'pickup-exceptions' => ['019ada93-f910-7000-859c-7f68731633a5'], + 'client_timezone' => 'Europe/Paris', + ]; + + // WHEN + $validator = Validator::make($data, $request->rules(), $request->messages(), $request->attributes()); + + // THEN + expect($validator->fails())->toBeTrue(); + $errors = $validator->errors()->all(); + expect($errors[0])->toBe('Le champ fermeture exceptionnelle sélectionné est invalide.'); + }); + + it('rejects order deadline after replacement date with human friendly message', function () { + // GIVEN + $exception = PickupException::factory()->create(); + + $authService = mock(AppAdminAuthService::class); + $request = new UpdateShopPickupExceptionsRequest($authService); + + $data = [ + 'pickup-exceptions' => [$exception->id], + 'replacement_date' => [ + $exception->id => '2026-10-02', + ], + 'order_deadline_at' => [ + $exception->id => '2026-10-11T14:53', + ], + 'client_timezone' => 'Europe/Paris', + ]; + + // WHEN + $validator = Validator::make($data, $request->rules(), $request->messages(), $request->attributes()); + + // THEN + expect($validator->fails())->toBeTrue(); + $errors = $validator->errors()->all(); + expect($errors)->toContain('Le champ date limite de commande doit être une date antérieure au jour de remplacement.'); + }); + + it('rejects order deadline equal to replacement date with human friendly message', function () { + // GIVEN + $exception = PickupException::factory()->create(); + + $authService = mock(AppAdminAuthService::class); + $request = new UpdateShopPickupExceptionsRequest($authService); + + $data = [ + 'pickup-exceptions' => [$exception->id], + 'replacement_date' => [ + $exception->id => '2026-10-02', + ], + 'order_deadline_at' => [ + $exception->id => '2026-10-02T14:00', + ], + 'client_timezone' => 'Europe/Paris', + ]; + + // WHEN + $validator = Validator::make($data, $request->rules(), $request->messages(), $request->attributes()); + + // THEN + expect($validator->fails())->toBeTrue(); + $errors = $validator->errors()->all(); + expect($errors)->toContain('Le champ date limite de commande doit être une date antérieure au jour de remplacement.'); + }); + + it('rejects order deadline without replacement date with human friendly message', function () { + // GIVEN + $exception = PickupException::factory()->create(); + + $authService = mock(AppAdminAuthService::class); + $request = new UpdateShopPickupExceptionsRequest($authService); + + $data = [ + 'pickup-exceptions' => [$exception->id], + 'replacement_date' => [ + $exception->id => null, + ], + 'order_deadline_at' => [ + $exception->id => '2026-10-01T14:00', + ], + 'client_timezone' => 'Europe/Paris', + ]; + + // WHEN + $validator = Validator::make($data, $request->rules(), $request->messages(), $request->attributes()); + + // THEN + expect($validator->fails())->toBeTrue(); + $errors = $validator->errors()->all(); + expect($errors)->toContain('Le champ jour de remplacement est obligatoire quand date limite de commande est présent.'); + }); + + it('transforms data to sync data format correctly', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new UpdateShopPickupExceptionsRequest($authService); + $request->initialize(); + $request->merge([ + 'pickup-exceptions' => ['uuid-1', 'uuid-2'], + 'replacement_date' => [ + 'uuid-1' => '2026-10-15', + 'uuid-2' => '', + ], + 'order_deadline_at' => [ + 'uuid-1' => '2026-10-14 16:00:00', + 'uuid-2' => '', + ], + ]); + + // WHEN + $syncData = $request->toSyncData(); + + // THEN + expect($syncData)->toBe([ + 'uuid-1' => [ + 'replacement_date' => '2026-10-15', + 'order_deadline_at' => '2026-10-14 16:00:00', + ], + 'uuid-2' => [ + 'replacement_date' => null, + 'order_deadline_at' => null, + ], + ]); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Bo/Slides/StoreSlideRequestTest.php b/tests/Feature/App/Http/Requests/Bo/Slides/StoreSlideRequestTest.php new file mode 100644 index 00000000..1426013b --- /dev/null +++ b/tests/Feature/App/Http/Requests/Bo/Slides/StoreSlideRequestTest.php @@ -0,0 +1,117 @@ +shouldReceive('check')->once()->andReturn(true); + $request = new StoreSlideRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('returns rules', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreSlideRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->rules())->toBeArray(); + }); + + it('returns attributes', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreSlideRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->attributes())->toBeArray(); + }); + + it('prepares for validation', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreSlideRequest($authService); + $request->initialize(); + $method = new \ReflectionMethod($request, 'prepareForValidation'); + $method->setAccessible(true); + + // WHEN + $method->invoke($request); + + // THEN + expect(true)->toBeTrue(); // just making sure it runs without exception + }); + + it('passes validation', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreSlideRequest($authService); + $request->initialize(); + $method = new \ReflectionMethod($request, 'passedValidation'); + $method->setAccessible(true); + + // WHEN + $method->invoke($request); + + // THEN + expect(true)->toBeTrue(); + }); + + it('normalizes empty text to null in prepareForValidation', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreSlideRequest($authService); + $request->initialize(request: ['text' => '


']); + $method = new \ReflectionMethod($request, 'prepareForValidation'); + $method->setAccessible(true); + + // WHEN + $method->invoke($request); + + // THEN + expect($request->input('text'))->toBeNull(); + }); + + it('allows empty text when picture is present', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreSlideRequest($authService); + $rules = $request->rules(); + + // WHEN + $validator = validator( + [ + 'title' => 'Slide Title', + 'picture' => 'some/picture.jpg', + 'picture_alt' => 'Alt text', + 'picture_title' => 'Title text', + 'text' => null, + 'link_new_tab' => false, + 'connected' => false, + 'client_timezone' => 'Europe/Paris', + ], + $rules + ); + + // THEN + expect($validator->errors()->has('text'))->toBeFalse(); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Bo/Tags/StoreTagRequestTest.php b/tests/Feature/App/Http/Requests/Bo/Tags/StoreTagRequestTest.php new file mode 100644 index 00000000..33dd80b1 --- /dev/null +++ b/tests/Feature/App/Http/Requests/Bo/Tags/StoreTagRequestTest.php @@ -0,0 +1,62 @@ +shouldReceive('check')->once()->andReturn(true); + $request = new StoreTagRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('returns rules', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreTagRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->rules())->toBeArray(); + }); + + it('returns attributes', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreTagRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->attributes())->toBeArray(); + }); + + it('prepares for validation', function () { + // GIVEN + $authService = mock(AppAdminAuthService::class); + $request = new StoreTagRequest($authService); + $request->initialize(); + $method = new \ReflectionMethod($request, 'prepareForValidation'); + $method->setAccessible(true); + + // WHEN + $method->invoke($request); + + // THEN + expect(true)->toBeTrue(); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Fo/Ajax/FilterProductsRequestTest.php b/tests/Feature/App/Http/Requests/Fo/Ajax/FilterProductsRequestTest.php new file mode 100644 index 00000000..f6664acb --- /dev/null +++ b/tests/Feature/App/Http/Requests/Fo/Ajax/FilterProductsRequestTest.php @@ -0,0 +1,116 @@ +initialize(); + + $reflection = new \ReflectionClass($request); + $method = $reflection->getMethod('prepareForValidation'); + $method->setAccessible(true); + + // WHEN + $method->invoke($request); + + // THEN + expect($request->all())->toHaveKeys(['ranges', 'tags', 'brands', 'isDiscounted', 'page', 'perPage']) + ->and($request->input('ranges'))->toBeArray()->toBeEmpty() + ->and($request->input('tags'))->toBeArray()->toBeEmpty() + ->and($request->input('brands'))->toBeArray()->toBeEmpty() + ->and($request->input('isDiscounted'))->toBeFalse() + ->and($request->input('page'))->toBe(1) + ->and($request->input('perPage'))->toBe(6); + }); + + it('merges provided values in prepareForValidation', function () { + // GIVEN + $request = new FilterProductsRequest(); + $request->initialize(); + $request->merge([ + 'ranges' => ['1', '2'], + 'tags' => ['3'], + 'brands' => ['brand1'], + 'isDiscounted' => '1', + 'page' => '2', + 'perPage' => '12', + ]); + + $reflection = new \ReflectionClass($request); + $method = $reflection->getMethod('prepareForValidation'); + $method->setAccessible(true); + + // WHEN + $method->invoke($request); + + // THEN + expect($request->input('ranges'))->toBe(['1', '2']) + ->and($request->input('tags'))->toBe(['3']) + ->and($request->input('brands'))->toBe(['brand1']) + ->and($request->input('isDiscounted'))->toBeTrue() + ->and($request->input('page'))->toBe(2) + ->and($request->input('perPage'))->toBe(12); + }); + + it('validates correct rules', function () { + // GIVEN + $request = new FilterProductsRequest(); + $request->initialize(); + $request->merge([ + 'search' => 'test', + 'ranges' => [], + 'tags' => [], + 'brands' => [], + 'page' => 1, + 'perPage' => 10, + ]); + + // WHEN + $validator = Validator::make($request->all(), $request->rules()); + + // THEN + expect($validator->passes())->toBeTrue(); + }); + + it('fails validation on incorrect rules', function () { + // GIVEN + $request = new FilterProductsRequest(); + $request->initialize(); + $request->merge([ + 'search' => '', + 'page' => 0, + 'perPage' => 100, + ]); + + // WHEN + $validator = Validator::make($request->all(), $request->rules()); + + // THEN + expect($validator->passes())->toBeFalse() + ->and($validator->errors()->keys())->toContain('ranges', 'tags', 'brands'); + }); + + it('returns custom attributes', function () { + // GIVEN + $request = new FilterProductsRequest(); + + // WHEN + $request->initialize(); + + // THEN + expect($request->attributes())->toBeArray() + ->and($request->attributes())->toHaveKeys([ + 'search', + 'tags', + 'ranges', + 'brands', + 'page', + 'perPage', + ]); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Fo/Auth/RegisterRequestTest.php b/tests/Feature/App/Http/Requests/Fo/Auth/RegisterRequestTest.php new file mode 100644 index 00000000..930d05d6 --- /dev/null +++ b/tests/Feature/App/Http/Requests/Fo/Auth/RegisterRequestTest.php @@ -0,0 +1,137 @@ +shouldReceive('guest')->once()->andReturn(true); + + $request = new RegisterRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('does not authorize when not guest', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $authService->shouldReceive('guest')->once()->andReturn(false); + + $request = new RegisterRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeFalse(); + }); + + it('validates rules', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $request = new RegisterRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->rules())->toBeArray() + ->and($request->rules())->toHaveKeys([ + 'matricule', + 'code', + 'lastname', + 'firstname', + 'phone', + 'address', + 'postal_code', + 'city', + 'email', + 'password', + 'ok_cgv', + 'optin', + 'birth_date', + ]); + }); + + it('builds RegisterCustomerInput via toRegisterCustomerInput()', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $request = new RegisterRequest($authService); + $request->initialize(); + $request->merge([ + 'matricule' => '1234567', + 'code' => 'ABCDEF', + 'lastname' => 'Doe', + 'firstname' => 'John', + 'postal_code' => '75000', + 'city' => 'Paris', + 'email' => 'john.doe@example.com', + 'password' => 'secret', + 'optin' => '1', + 'birth_date' => '1990-01-01', + ]); + + $reflection = new \ReflectionClass($request); + $method = $reflection->getMethod('prepareForValidation'); + $method->setAccessible(true); + $method->invoke($request); + + // WHEN + $input = $request->toRegisterCustomerInput(); + + // THEN + expect($input)->toBeInstanceOf(RegisterCustomerInput::class) + ->and($input->email->value)->toBe('john.doe@example.com') + ->and($input->firstname)->toBe('John') + ->and($input->birthDate->format('Y-m-d'))->toBe('1990-01-01') + ->and($input->optIn)->toBeTrue(); + }); + + it('throws InvalidArgumentException for invalid birth date in toRegisterCustomerInput()', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $request = new RegisterRequest($authService); + $request->initialize(); + $request->merge([ + 'birth_date' => 'invalid-date', + ]); + + // WHEN & THEN + $request->toRegisterCustomerInput(); + })->throws(\InvalidArgumentException::class, 'Invalid birth date format'); + + it('returns custom attributes', function () { + $authService = \Mockery::mock(AppCustomerAuthService::class); + // GIVEN + $request = new RegisterRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->attributes())->toBeArray() + ->and($request->attributes())->toHaveKeys([ + 'firstname', + 'lastname', + 'birth_date', + 'address', + 'phone', + 'city', + 'postcode', + 'password', + 'matricule', + 'code', + 'ok_cgv', + 'optin', + ]); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Fo/ContactFormRequestTest.php b/tests/Feature/App/Http/Requests/Fo/ContactFormRequestTest.php new file mode 100644 index 00000000..5f4dec67 --- /dev/null +++ b/tests/Feature/App/Http/Requests/Fo/ContactFormRequestTest.php @@ -0,0 +1,150 @@ +initialize(); + + // WHEN + $request->merge([ + 'last_name' => 'Doe', + 'first_name' => 'John', + 'email' => 'john.doe@example.com', + 'subject' => 'Help with my order', + 'order_ref' => '123456', + 'message' => 'This is a message that is longer than 20 characters.', + 'ok_cgv' => true, + ]); + + // THEN + expect(true)->toBeTrue(); + }); + + it('fails validation on incorrect rules', function () { + // GIVEN + $request = new ContactFormRequest(); + $request->initialize(); + $request->merge([ + 'last_name' => 'D', + 'first_name' => 'J', + 'email' => 'not-an-email', + 'subject' => '', + 'order_ref' => 'abc', + 'message' => 'short', + 'ok_cgv' => false, + ]); + + // WHEN + $validator = Validator::make($request->all(), $request->rules()); + + // THEN + expect($validator->passes())->toBeFalse() + ->and($validator->errors()->keys())->toContain( + 'last_name', + 'first_name', + 'email', + 'subject', + 'order_ref', + 'message', + 'ok_cgv' + ); + }); + + it('validates file upload', function () { + // GIVEN + $file = UploadedFile::fake()->image('document.jpg')->size(1000); + + $request = new ContactFormRequest(); + $request->initialize(); + $request->merge([ + 'last_name' => 'Doe', + 'first_name' => 'John', + 'email' => 'john.doe@example.com', + 'subject' => 'Help with my order', + 'message' => 'This is a message that is longer than 20 characters.', + 'ok_cgv' => true, + ]); + + // WHEN + $request->files->set('file', $file); + + // THEN + expect(true)->toBeTrue(); + }); + + it('converts to value object without file', function () { + // GIVEN + $request = new ContactFormRequest(); + $request->initialize(); + $request->merge([ + 'last_name' => 'Doe', + 'first_name' => 'John', + 'email' => 'john.doe@example.com', + 'subject' => 'Help', + 'order_ref' => '123', + 'message' => 'This is a message that is longer than 20 characters.', + ]); + + // WHEN + $vo = $request->toValueObject(); + + // THEN + expect($vo)->toBeInstanceOf(ContactFormData::class) + ->and($vo->lastName)->toBe('Doe') + ->and($vo->firstName)->toBe('John') + ->and($vo->email)->toBe('john.doe@example.com') + ->and($vo->subject)->toBe('Help') + ->and($vo->orderRef)->toBe('123') + ->and($vo->message)->toBe('This is a message that is longer than 20 characters.') + ->and($vo->file)->toBeNull(); + }); + + it('converts to value object with file', function () { + // GIVEN + $file = UploadedFile::fake()->create('document.pdf', 100, 'application/pdf'); + + $request = new ContactFormRequest(); + $request->initialize(); + $request->merge([ + 'last_name' => 'Doe', + 'first_name' => 'John', + 'email' => 'john.doe@example.com', + 'subject' => 'Help', + 'message' => 'This is a message that is longer than 20 characters.', + ]); + $request->files->set('file', $file); + + // WHEN + $vo = $request->toValueObject(); + + // THEN + expect($vo)->toBeInstanceOf(ContactFormData::class) + ->and($vo->file)->not->toBeNull() + ->and($vo->file->originalName)->toBe('document.pdf') + ->and($vo->file->mimeType)->toBe('application/pdf'); + }); + + it('returns custom messages', function () { + // GIVEN + $request = new ContactFormRequest(); + + // WHEN + $request->initialize(); + + // THEN + expect($request->messages())->toBeArray() + ->and($request->messages())->toHaveKeys([ + 'ok_cgv.accepted', + 'file.max', + 'file.mimes', + ]); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Fo/Customer/UpdateInfosRequestTest.php b/tests/Feature/App/Http/Requests/Fo/Customer/UpdateInfosRequestTest.php new file mode 100644 index 00000000..df6f6ea2 --- /dev/null +++ b/tests/Feature/App/Http/Requests/Fo/Customer/UpdateInfosRequestTest.php @@ -0,0 +1,171 @@ +shouldReceive('check')->once()->andReturn(true); + + $request = new UpdateInfosRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('does not authorize when user is not logged in', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $authService->shouldReceive('check')->once()->andReturn(false); + + $request = new UpdateInfosRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeFalse(); + }); + + it('merges opt_in in prepareForValidation', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $request = new UpdateInfosRequest($authService); + $request->initialize(); + $request->merge(['opt_in' => '1']); + + $reflection = new \ReflectionClass($request); + $method = $reflection->getMethod('prepareForValidation'); + $method->setAccessible(true); + + // WHEN + $method->invoke($request); + + // THEN + expect($request->input('opt_in'))->toBeTrue(); + }); + + it('converts to UpdateCustomerInput', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $request = new UpdateInfosRequest($authService); + $request->initialize(); + $request->merge([ + 'firstname' => 'John', + 'lastname' => 'Doe', + 'birth_date' => '1990-01-01', + 'phone' => '0102030405', + 'city' => 'Paris', + 'postcode' => '75000', + 'address' => '123 Main St', + 'opt_in' => true, + ]); + + // WHEN + $input = $request->toUpdateCustomerInput(); + + // THEN + expect($input)->toBeInstanceOf(UpdateCustomerInput::class) + ->and($input->firstname)->toBe('John') + ->and($input->lastname)->toBe('Doe') + ->and($input->birthDate)->toBe('1990-01-01') + ->and($input->phone)->toBe('0102030405') + ->and($input->city)->toBe('Paris') + ->and($input->postcode)->toBe('75000') + ->and($input->address)->toBe('123 Main St') + ->and($input->optIn)->toBeTrue(); + }); + + it('converts to UpdateCustomerInput with empty address and phone as null', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $request = new UpdateInfosRequest($authService); + $request->initialize(); + $request->merge([ + 'firstname' => 'John', + 'lastname' => 'Doe', + 'birth_date' => '1990-01-01', + 'phone' => '', + 'city' => 'Paris', + 'postcode' => '75000', + 'address' => '', + 'opt_in' => false, + ]); + + // WHEN + $input = $request->toUpdateCustomerInput(); + + // THEN + expect($input)->toBeInstanceOf(UpdateCustomerInput::class) + ->and($input->phone)->toBeNull() + ->and($input->address)->toBeNull(); + }); + + it('validates rules', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $request = new UpdateInfosRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->rules())->toBeArray() + ->and($request->rules())->toHaveKeys([ + 'firstname', + 'lastname', + 'birth_date', + 'address', + 'phone', + 'city', + 'postcode', + 'opt_in', + ]); + }); + + it('returns custom messages', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $request = new UpdateInfosRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->messages())->toBeArray() + ->and($request->messages())->toHaveKeys([ + 'birth_date.before_or_equal', + 'birth_date.date', + 'birth_date.date_format', + ]); + }); + + it('returns custom attributes', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $request = new UpdateInfosRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->attributes())->toBeArray() + ->and($request->attributes())->toHaveKeys([ + 'firstname', + 'lastname', + 'birth_date', + 'address', + 'phone', + 'city', + 'postcode', + ]); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Fo/Customer/UpdatePasswordRequestTest.php b/tests/Feature/App/Http/Requests/Fo/Customer/UpdatePasswordRequestTest.php new file mode 100644 index 00000000..98999b2f --- /dev/null +++ b/tests/Feature/App/Http/Requests/Fo/Customer/UpdatePasswordRequestTest.php @@ -0,0 +1,49 @@ +shouldReceive('check')->once()->andReturn(true); + + $request = new UpdatePasswordRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('does not authorize when user is not logged in', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $authService->shouldReceive('check')->once()->andReturn(false); + + $request = new UpdatePasswordRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeFalse(); + }); + + it('validates rules', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $request = new UpdatePasswordRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->rules())->toBeArray() + ->and($request->rules())->toHaveKeys(['password_old', 'password']); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Fo/Orders/ConfirmOrderRequestTest.php b/tests/Feature/App/Http/Requests/Fo/Orders/ConfirmOrderRequestTest.php new file mode 100644 index 00000000..f1dcabaf --- /dev/null +++ b/tests/Feature/App/Http/Requests/Fo/Orders/ConfirmOrderRequestTest.php @@ -0,0 +1,73 @@ +shouldReceive('check')->once()->andReturn(true); + + $request = new ConfirmOrderRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('does not authorize when user is not logged in', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $authService->shouldReceive('check')->once()->andReturn(false); + + $request = new ConfirmOrderRequest($authService); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeFalse(); + }); + + it('has required rules for cgv acceptance', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $request = new ConfirmOrderRequest($authService); + + // WHEN + $rules = $request->rules(); + + // THEN + expect($rules)->toHaveKey('ok_cgv') + ->and($rules['ok_cgv'])->toContain('accepted'); + }); + + it('maps to FinalizeOrderInput', function () { + // GIVEN + $shopperId = new ShopperId(Uuid::uuid7()); + $customer = \Mockery::mock(Customer::class); + $customer->shouldReceive('getId')->once()->andReturn($shopperId); + + $authService = \Mockery::mock(AppCustomerAuthService::class); + $authService->shouldReceive('getCustomerAsMandatory')->once()->andReturn($customer); + + $request = new ConfirmOrderRequest($authService); + $request->initialize(); + + // WHEN + $input = $request->toFinalizeOrderInput(); + + // THEN + expect($input)->toBeInstanceOf(FinalizeOrderInput::class) + ->and($input->shopperId)->toBe($shopperId); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Fo/Orders/PickTimeSlotRequestTest.php b/tests/Feature/App/Http/Requests/Fo/Orders/PickTimeSlotRequestTest.php new file mode 100644 index 00000000..08862a8f --- /dev/null +++ b/tests/Feature/App/Http/Requests/Fo/Orders/PickTimeSlotRequestTest.php @@ -0,0 +1,227 @@ +shouldReceive('check')->once()->andReturn(true); + + $request = new PickTimeSlotRequest( + $authService, + \Mockery::mock(BasketService::class), + \Mockery::mock(ShopperRepository::class), + \Mockery::mock(OrderTunnelService::class), + ); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('does not authorize when user is not logged in', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $authService->shouldReceive('check')->once()->andReturn(false); + + $request = new PickTimeSlotRequest( + $authService, + \Mockery::mock(BasketService::class), + \Mockery::mock(ShopperRepository::class), + \Mockery::mock(OrderTunnelService::class), + ); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeFalse(); + }); + + it('gets timeslot successfully', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $request = new PickTimeSlotRequest( + $authService, + \Mockery::mock(BasketService::class), + \Mockery::mock(ShopperRepository::class), + \Mockery::mock(OrderTunnelService::class), + ); + $request->initialize(); + $request->merge(['timeslot' => VALID_TIMESLOT_DATE]); + + // WHEN + $timeslot = $request->getTimeslot(); + + // THEN + expect($timeslot)->toBeInstanceOf(CarbonInterface::class) + ->and($timeslot->format('Y-m-d H:i:s'))->toBe(VALID_TIMESLOT_DATE . ' 00:00:00'); + }); + + it('throws exception on invalid timeslot format', function () { + $authService = \Mockery::mock(AppCustomerAuthService::class); + $request = new PickTimeSlotRequest( + $authService, + \Mockery::mock(BasketService::class), + \Mockery::mock(ShopperRepository::class), + \Mockery::mock(OrderTunnelService::class), + ); + $request->initialize(); + $request->merge(['timeslot' => 'invalid-date']); + + $request->getTimeslot(); + })->throws(\InvalidArgumentException::class); + + it('validates rules', function () { + $authService = \Mockery::mock(AppCustomerAuthService::class); + // GIVEN + $request = new PickTimeSlotRequest( + $authService, + \Mockery::mock(BasketService::class), + \Mockery::mock(ShopperRepository::class), + \Mockery::mock(OrderTunnelService::class), + ); + + // WHEN + $request->initialize(); + + // THEN + expect($request->rules())->toBeArray() + ->and($request->rules())->toHaveKeys(['timeslot']); + }); + + it('returns custom attributes', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $request = new PickTimeSlotRequest( + $authService, + \Mockery::mock(BasketService::class), + \Mockery::mock(ShopperRepository::class), + \Mockery::mock(OrderTunnelService::class), + ); + + // WHEN + $request->initialize(); + + // THEN + expect($request->attributes())->toBeArray() + ->and($request->attributes())->toHaveKeys(['timeslot']); + }); + + it('fails basketTotal rule when weekly limit is exceeded', function () { + // GIVEN + $shopperId = new ShopperId(Uuid::uuid7()); + + $customer = \Mockery::mock(Customer::class); + $customer->shouldReceive('getId')->once()->andReturn($shopperId); + + $basket = new Basket(new BasketId(Uuid::uuid7()), []); + $shopper = new Shopper( + $shopperId, + new Email('shopper@example.com'), + new Matricule('1234567'), + 'Nom', + 'Prenom', + now(), + null, + new ShopperEstablishmentCode('FAC01'), + new ShopperSiteCode('SITE'), + new ShopperServiceCode('101'), + ); + + $authService = \Mockery::mock(AppCustomerAuthService::class); + $authService->shouldReceive('getCustomerAsMandatory')->once()->andReturn($customer); + + $basketService = \Mockery::mock(BasketService::class); + $basketService->shouldReceive('getBasket')->once()->andReturn($basket); + + $shopperRepository = \Mockery::mock(ShopperRepository::class); + $shopperRepository->shouldReceive('getByIdOrFail')->once()->with($shopperId)->andReturn($shopper); + + $orderTunnelService = \Mockery::mock(OrderTunnelService::class); + $orderTunnelService->shouldReceive('assertBasketWeeklyAmountWithinLimitFor') + ->once() + ->withArgs(function ($receivedShopper, $receivedBasket, $receivedDate) use ($shopper, $basket) { + return $receivedShopper === $shopper + && $receivedBasket === $basket + && $receivedDate instanceof CarbonInterface + && $receivedDate->format('Y-m-d') === VALID_TIMESLOT_DATE; + }) + ->andThrow(new WeeklyLimitExceededException()); + + $request = new PickTimeSlotRequest( + $authService, + $basketService, + $shopperRepository, + $orderTunnelService, + ); + $request->initialize(); + $request->merge(['timeslot' => VALID_TIMESLOT_DATE]); + + $rules = $request->rules(); + $basketTotalFn = $rules['basketTotal'][0]; + $failMessages = []; + + // WHEN + $basketTotalFn('basketTotal', 1000, function (string $message) use (&$failMessages): void { + $failMessages[] = $message; + }); + + // THEN + expect($failMessages)->toHaveCount(1) + ->and($failMessages[0]) + ->toBe(trans('You will reach the maximum weekly order limit with this basket.')); + }); + + it('maps to ApplyPickTimeSlotInput', function () { + // GIVEN + $shopperId = new ShopperId(Uuid::uuid7()); + $customer = \Mockery::mock(Customer::class); + $customer->shouldReceive('getId')->once()->andReturn($shopperId); + + $authService = \Mockery::mock(AppCustomerAuthService::class); + $authService->shouldReceive('getCustomerAsMandatory')->once()->andReturn($customer); + + $request = new PickTimeSlotRequest( + $authService, + \Mockery::mock(BasketService::class), + \Mockery::mock(ShopperRepository::class), + \Mockery::mock(OrderTunnelService::class), + ); + $request->initialize(); + $request->merge(['timeslot' => VALID_TIMESLOT_DATE]); + + // WHEN + $input = $request->toApplyPickTimeSlotInput(); + + // THEN + expect($input)->toBeInstanceOf(ApplyPickTimeSlotInput::class) + ->and($input->shopperId)->toBe($shopperId) + ->and($input->timeslot->format('Y-m-d'))->toBe(VALID_TIMESLOT_DATE); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Fo/Orders/ValidateSummaryRequestTest.php b/tests/Feature/App/Http/Requests/Fo/Orders/ValidateSummaryRequestTest.php new file mode 100644 index 00000000..dd16bb0b --- /dev/null +++ b/tests/Feature/App/Http/Requests/Fo/Orders/ValidateSummaryRequestTest.php @@ -0,0 +1,117 @@ +shouldReceive('check')->once()->andReturn(true); + + $request = new ValidateSummaryRequest( + $authService, + \Mockery::mock(BasketService::class), + \Mockery::mock(OrderTunnelService::class), + ); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeTrue(); + }); + + it('does not authorize when user is not logged in', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $authService->shouldReceive('check')->once()->andReturn(false); + + $request = new ValidateSummaryRequest( + $authService, + \Mockery::mock(BasketService::class), + \Mockery::mock(OrderTunnelService::class), + ); + + // WHEN + $request->initialize(); + + // THEN + expect($request->authorize())->toBeFalse(); + }); + + it('fails basketTotal rule when order limit is exceeded', function () { + // GIVEN + $basket = new Basket(new BasketId(Uuid::uuid7()), []); + + $authService = \Mockery::mock(AppCustomerAuthService::class); + $basketService = \Mockery::mock(BasketService::class); + $basketService->shouldReceive('getBasket')->once()->andReturn($basket); + + $orderTunnelService = \Mockery::mock(OrderTunnelService::class); + $orderTunnelService->shouldReceive('assertBasketAmountWithinLimit') + ->once() + ->with($basket) + ->andThrow(new OrderLimitExceededException()); + + $request = new ValidateSummaryRequest( + $authService, + $basketService, + $orderTunnelService, + ); + $request->initialize(); + + $rules = $request->rules(); + $basketTotalFn = $rules['basketTotal'][0]; + $failMessages = []; + + // WHEN + $basketTotalFn('basketTotal', 1000, function (string $message) use (&$failMessages): void { + $failMessages[] = $message; + }); + + // THEN + expect($failMessages)->toHaveCount(1) + ->and($failMessages[0])->toBe(trans('You have reached the maximum order limit for this basket.')); + }); + + it('maps to InitializeOrderTunnelInput', function () { + // GIVEN + $shopperId = new ShopperId(Uuid::uuid7()); + $customer = \Mockery::mock(Customer::class); + $customer->shouldReceive('getId')->once()->andReturn($shopperId); + + $basket = new Basket(new BasketId(Uuid::uuid7()), []); + $authService = \Mockery::mock(AppCustomerAuthService::class); + $authService->shouldReceive('getCustomerAsMandatory')->once()->andReturn($customer); + + $basketService = \Mockery::mock(BasketService::class); + $basketService->shouldReceive('getBasket')->once()->andReturn($basket); + + $request = new ValidateSummaryRequest( + $authService, + $basketService, + \Mockery::mock(OrderTunnelService::class), + ); + $request->initialize(); + + // WHEN + $input = $request->toInitializeOrderTunnelInput(); + + // THEN + expect($input)->toBeInstanceOf(InitializeOrderTunnelInput::class) + ->and($input->basket)->toBe($basket) + ->and($input->shopperId)->toBe($shopperId); + }); +}); diff --git a/tests/Feature/App/Http/Requests/Fo/UnsubscribeNewsletterRequestTest.php b/tests/Feature/App/Http/Requests/Fo/UnsubscribeNewsletterRequestTest.php new file mode 100644 index 00000000..38a9c610 --- /dev/null +++ b/tests/Feature/App/Http/Requests/Fo/UnsubscribeNewsletterRequestTest.php @@ -0,0 +1,72 @@ +initialize(); + $request->merge([ + 'hashcode' => Uuid::uuid4()->toString(), + ]); + + // WHEN + $validator = Validator::make($request->all(), $request->rules()); + + // THEN + expect($validator->passes())->toBeTrue(); + }); + + it('fails validation on incorrect rules', function () { + // GIVEN + $request = new UnsubscribeNewsletterRequest(); + $request->initialize(); + $request->merge([ + 'hashcode' => 'not-a-uuid', + ]); + + // WHEN + $validator = Validator::make($request->all(), $request->rules()); + + // THEN + expect($validator->passes())->toBeFalse() + ->and($validator->errors()->keys())->toContain('hashcode'); + }); + + it('returns null for hashcode if invalid or missing', function () { + // GIVEN + $request = new UnsubscribeNewsletterRequest(); + $request->initialize(); + + // WHEN + $request->merge([ + 'hashcode' => 'not-a-uuid', + ]); + + // THEN + expect($request->getHashcode())->toBeNull(); + }); + + it('returns CrmHashcode if valid uuid', function () { + // GIVEN + $request = new UnsubscribeNewsletterRequest(); + $request->initialize(); + $uuid = Uuid::uuid4(); + $request->merge([ + 'hashcode' => $uuid->toString(), + ]); + + // WHEN + $result = $request->getHashcode(); + + // THEN + expect($result)->toBeInstanceOf(CrmHashcode::class) + ->and($result->value)->toBe($uuid->toString()); + }); +}); diff --git a/tests/Feature/Bo/AuthTest.php b/tests/Feature/Bo/AuthTest.php new file mode 100644 index 00000000..59c1e897 --- /dev/null +++ b/tests/Feature/Bo/AuthTest.php @@ -0,0 +1,15 @@ +get($route); + + // THEN + $reponse->assertRedirect(route('bo.auth.login')); +}); diff --git a/tests/Feature/Bo/Employees/EmployeeSyncFeatureTest.php b/tests/Feature/Bo/Employees/EmployeeSyncFeatureTest.php new file mode 100644 index 00000000..afb38eef --- /dev/null +++ b/tests/Feature/Bo/Employees/EmployeeSyncFeatureTest.php @@ -0,0 +1,102 @@ +toBeTruthy(); + + return; + + /** @var \Tests\TestCase $this */ + + // GIVEN + // An admin user updates the employee sites in Back Office + $admin = User::factory()->createOne(); + + $updateResponse = $this->actingAs($admin, 'backend')->put(route('bo.settings.update'), [ + 'employee_sites' => ['PA', 'LY'], + ]); + + $updateResponse->assertRedirect(route('bo.settings.edit')) + ->assertSessionHas('success'); + + $setting = Setting::getSingleton(); + expect($setting->employee_sites)->toBe(['PA', 'LY']); + + // Mock ArcadiaEmployeeService to return employee data for site PA + $mockArcadia = \Mockery::mock(ArcadiaEmployeeService::class); + $mockArcadia->shouldReceive('getEmployeesOfSiteSince') + ->once() + ->with(\Mockery::on(static fn (ShopperSiteCode $code): bool => $code->value === 'PA'), \Mockery::any()) + ->andReturn([ + new ArcadiaEmployee( + matricule: new Matricule('7654321'), + lastname: 'Martin', + firstname: 'Alice', + startDate: CarbonImmutable::parse('2026-02-01'), + endDate: null, + etablissement: new ShopperEstablishmentCode('ETAB01'), + site: new ShopperSiteCode('PA'), + service: new ShopperServiceCode('202') + ), + ]); + + $mockArcadia->shouldReceive('getEmployeesOfSiteSince') + ->once() + ->with(\Mockery::on(static fn (ShopperSiteCode $code): bool => $code->value === 'LY'), \Mockery::any()) + ->andReturn([]); + + $this->app->instance(ArcadiaEmployeeService::class, $mockArcadia); + + // WHEN + // Admin launches sync job via controller endpoint (executed synchronously by default queue driver) + $syncResponse = $this->actingAs($admin, 'backend')->post(route('bo.settings.employees.sync')); + $syncResponse->assertRedirect(route('bo.dashboard')) + ->assertSessionHas('success'); + + // THEN + // Employee exists in database with all attributes populated + $employee = Employee::query()->where('matricule', '7654321')->first(); + expect($employee)->not->toBeNull() + ->and($employee->nom)->toBe('Martin') + ->and($employee->prenom)->toBe('Alice') + ->and($employee->site)->toBeInstanceOf(ShopperSiteCode::class) + ->and($employee->site->value)->toBe('PA') + ->and($employee->service)->toBeInstanceOf(ShopperServiceCode::class) + ->and($employee->service->value)->toBe('202') + ->and($employee->etablissement)->toBeInstanceOf(ShopperEstablishmentCode::class) + ->and($employee->etablissement->value)->toBe('ETAB01') + ->and($employee->code)->not->toBeNull() + ->and($employee->last_sync)->not->toBeNull(); + + // Verify sync timestamps + $syncService = resolve(EmployeeSyncService::class); + expect($syncService->getLastSync())->not->toBeNull(); + + $employeeRepo = resolve(EmployeeRepository::class); + expect($employeeRepo->getMostRecentSyncDate())->not->toBeNull(); + }); +}); diff --git a/tests/Feature/Bo/Modules/ChangeOrderBladeTest.php b/tests/Feature/Bo/Modules/ChangeOrderBladeTest.php new file mode 100644 index 00000000..0c0a11d1 --- /dev/null +++ b/tests/Feature/Bo/Modules/ChangeOrderBladeTest.php @@ -0,0 +1,92 @@ +id = 1; + $tag->order = 15; + $paginator = new LengthAwarePaginator([$tag], 30, 15, 1); + + // WHEN + $html = view('bo.modules.change-order', [ + 'route' => 'bo.tags.change-order', + 'model' => $tag, + 'first' => false, + 'last' => true, + 'isFirstPage' => $paginator->onFirstPage(), + 'isLastPage' => ! $paginator->hasMorePages(), + ])->render(); + + // THEN + expect($html)->toContain('name="down_arrow"'); + }); + + it('shows up arrow on the first item of page 2 when there are multiple pages', function (): void { + // GIVEN + $tag = new Tag(); + $tag->id = 2; + $tag->order = 16; + $paginator = new LengthAwarePaginator([$tag], 30, 15, 2); + + // WHEN + $html = view('bo.modules.change-order', [ + 'route' => 'bo.tags.change-order', + 'model' => $tag, + 'first' => true, + 'last' => false, + 'isFirstPage' => $paginator->onFirstPage(), + 'isLastPage' => ! $paginator->hasMorePages(), + ])->render(); + + // THEN + expect($html)->toContain('name="down_up"'); + }); + + it('hides up arrow on the first item of the first page', function (): void { + // GIVEN + $tag = new Tag(); + $tag->id = 1; + $tag->order = 1; + $paginator = new LengthAwarePaginator([$tag], 30, 15, 1); + + // WHEN + $html = view('bo.modules.change-order', [ + 'route' => 'bo.tags.change-order', + 'model' => $tag, + 'first' => true, + 'last' => false, + 'isFirstPage' => $paginator->onFirstPage(), + 'isLastPage' => ! $paginator->hasMorePages(), + ])->render(); + + // THEN + expect($html)->not->toContain('name="down_up"'); + }); + + it('hides down arrow on the last item of the last page', function (): void { + // GIVEN + $tag = new Tag(); + $tag->id = 2; + $tag->order = 30; + $paginator = new LengthAwarePaginator([$tag], 30, 15, 2); + + // WHEN + $html = view('bo.modules.change-order', [ + 'route' => 'bo.tags.change-order', + 'model' => $tag, + 'first' => false, + 'last' => true, + 'isFirstPage' => $paginator->onFirstPage(), + 'isLastPage' => ! $paginator->hasMorePages(), + ])->render(); + + // THEN + expect($html)->not->toContain('name="down_arrow"'); + }); +}); diff --git a/tests/Feature/Bo/Settings/SettingsControllerTest.php b/tests/Feature/Bo/Settings/SettingsControllerTest.php new file mode 100644 index 00000000..3c9b2fba --- /dev/null +++ b/tests/Feature/Bo/Settings/SettingsControllerTest.php @@ -0,0 +1,82 @@ +createOne(); + $route = route('bo.settings.edit'); + + // WHEN + $response = $this->actingAs($user, 'backend')->get($route); + + // THEN + $response->assertForbidden(); + // $response->assertOk() + // ->assertViewIs('bo.settings.edit') + // ->assertViewHas('setting'); + }); + + it('updates employee sites with array input and redirects', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $user = User::factory()->createOne(); + $route = route('bo.settings.update'); + $formData = [ + 'employee_sites' => ['PA', 'LY', 'NA'], + ]; + + // WHEN + $response = $this->actingAs($user, 'backend')->put($route, $formData); + + // THEN + $response->assertForbidden(); + // $response->assertRedirect(route('bo.settings.edit')) + // ->assertSessionHas('success'); + + // $setting = Setting::getSingleton(); + // expect($setting->employee_sites)->toBe(['PA', 'LY', 'NA']); + }); + + it('updates employee sites with comma string input and redirects', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $user = User::factory()->createOne(); + $route = route('bo.settings.update'); + $formData = [ + 'employee_sites' => 'PA, LY, NA', + ]; + + // WHEN + $response = $this->actingAs($user, 'backend')->put($route, $formData); + + // THEN + $response->assertForbidden(); + // $response->assertRedirect(route('bo.settings.edit')) + // ->assertSessionHas('success'); + + // $setting = Setting::getSingleton(); + // expect($setting->employee_sites)->toBe(['PA', 'LY', 'NA']); + }); + + it('rejects invalid site code formats', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $user = User::factory()->createOne(); + $route = route('bo.settings.update'); + $formData = [ + 'employee_sites' => ['PA', '123', 'INVALID!'], + ]; + + // WHEN + $response = $this->actingAs($user, 'backend')->put($route, $formData); + + // THEN + $response->assertSessionHasErrors(['employee_sites.1', 'employee_sites.2']); + }); +}); diff --git a/tests/Feature/Bo/Slides/CrudSlideTest.php b/tests/Feature/Bo/Slides/CrudSlideTest.php new file mode 100644 index 00000000..d63d8c49 --- /dev/null +++ b/tests/Feature/Bo/Slides/CrudSlideTest.php @@ -0,0 +1,114 @@ +withoutExceptionHandling(); + // GIVEN + $htmlDateInputFormat = 'Y-m-d\TH:i'; + $user = User::factory()->createOne(); + $route = route('bo.slides.store'); + $formData = [ + 'title' => '1rst Slide', + 'text' => 'Super slide content', + 'date_start' => Date::now()->format($htmlDateInputFormat), + 'date_end' => Date::now()->addDay()->format($htmlDateInputFormat), + 'client_timezone' => 'Europe/Paris', + ]; + + // WHEN + $reponse = $this->actingAs($user, 'backend')->post($route, $formData); + + // THEN + $reponse->assertRedirect( + route( + 'bo.slides.edit', + Slide::query()->latest()->firstOrFail() + ) + ); + }); + + it('Can edit a slide', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $user = User::factory()->createOne(); + $slide = Slide::factory()->createOne(); + $route = route('bo.slides.edit', $slide); + + // WHEN + $reponse = $this->actingAs($user, 'backend')->get($route); + + // THEN + $reponse->assertOk(); + }); + + it('Can update a slide', function (): void { + /** @var \Tests\TestCase $this */ + $this->withoutExceptionHandling(); + // GIVEN + $user = User::factory()->createOne(); + $slide = Slide::factory()->createOne(); + $route = route('bo.slides.update', $slide); + $formData = [ + 'title' => 'Update Slide', + 'text' => 'Super slide content updated', + 'date_start' => Date::now()->format('Y-m-d\TH:i'), + 'date_end' => Date::now()->addDay()->format('Y-m-d\TH:i'), + 'client_timezone' => 'Europe/Paris', + ]; + + // WHEN + $reponse = $this->actingAs($user, 'backend')->put($route, $formData); + + // THEN + $reponse->assertRedirect( + route('bo.slides.edit', $slide) + ); + }); + + it('Can delete a slide', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $user = User::factory()->createOne(); + $slide = Slide::factory()->createOne(); + $route = route('bo.slides.destroy', $slide); + + // WHEN + $reponse = $this->actingAs($user, 'backend')->delete($route); + + // THEN + $reponse->assertRedirect(route('bo.slides.index')); + }); + + it('Can update a slide order', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $user = User::factory()->createOne(); + $slide = Slide::factory()->createOne(); + $slide2 = Slide::factory()->createOne(); + $route = route('bo.slides.change-order', [$slide, 'down']); + $fromRoute = route('bo.slides.index'); + + $slideOrder = $slide->order; + $slide2Order = $slide2->order; + + // WHEN + $this->actingAs($user, 'backend')->get($fromRoute); // * First Navigation + $reponse = $this->actingAs($user, 'backend')->patch($route); + + $slide->refresh(); + $slide2->refresh(); + + // THEN + $reponse->assertRedirect($fromRoute); + expect($slideOrder)->toBe($slide2->order); + expect($slide2Order)->toBe($slide->order); + }); +}); diff --git a/tests/Feature/Bo/Tags/CrudTagTest.php b/tests/Feature/Bo/Tags/CrudTagTest.php new file mode 100644 index 00000000..fea4e100 --- /dev/null +++ b/tests/Feature/Bo/Tags/CrudTagTest.php @@ -0,0 +1,126 @@ +withoutExceptionHandling(); + // GIVEN + $user = User::factory()->createOne(); + $route = route('bo.tags.store'); + $formData = [ + 'label' => '1rst Tag', + 'status' => true, + ]; + + // WHEN + $reponse = $this->actingAs($user, 'backend')->post($route, $formData); + + // THEN + $reponse->assertRedirect( + route( + 'bo.tags.edit', + Tag::query()->latest('order')->firstOrFail() + ) + ); + }); + + it('Can edit a tag', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $user = User::factory()->createOne(); + $tag = Tag::factory()->createOne(); + $route = route('bo.tags.edit', $tag); + + // WHEN + $reponse = $this->actingAs($user, 'backend')->get($route); + + // THEN + $reponse->assertOk(); + }); + + it('Can update a tag', function (): void { + /** @var \Tests\TestCase $this */ + $this->withoutExceptionHandling(); + // GIVEN + $user = User::factory()->createOne(); + $tag = Tag::factory()->createOne(); + $route = route('bo.tags.update', $tag); + $formData = [ + 'label' => 'Update Tag', + 'status' => false, + ]; + + // WHEN + $reponse = $this->actingAs($user, 'backend')->put($route, $formData); + + // THEN + $reponse->assertRedirect( + route('bo.tags.edit', $tag) + ); + }); + + it('Can delete a tag', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $user = User::factory()->createOne(); + $tag = Tag::factory()->createOne(); + $route = route('bo.tags.destroy', $tag); + + // WHEN + $reponse = $this->actingAs($user, 'backend')->delete($route); + + // THEN + $reponse->assertRedirect(route('bo.tags.index')); + }); + + it('Can update a tag order', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $user = User::factory()->createOne(); + $tag = Tag::factory()->createOne(); + $tag2 = Tag::factory()->createOne(); + $route = route('bo.tags.change-order', [$tag, 'down']); + $fromRoute = route('bo.tags.index'); + + $tagOrder = $tag->order; + $tag2Order = $tag2->order; + + // WHEN + $this->actingAs($user, 'backend')->get($fromRoute); // * First Navigation + $reponse = $this->actingAs($user, 'backend')->patch($route); + + $tag->refresh(); + $tag2->refresh(); + + // THEN + $reponse->assertRedirect($fromRoute); + expect($tagOrder)->toBe($tag2->order); + expect($tag2Order)->toBe($tag->order); + }); + + it('Can toggle a tag status', function (): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $user = User::factory()->createOne(); + $tag = Tag::factory()->createOne(); + $route = route('bo.tags.toggle-status', $tag); + $fromRoute = route('bo.tags.index'); + $tagStatus = $tag->status; + + // WHEN + $this->actingAs($user, 'backend')->get($fromRoute); // * First Navigation + $reponse = $this->actingAs($user, 'backend')->patch($route); + + $tag->refresh(); + + // THEN + $reponse->assertRedirect($fromRoute); + expect($tagStatus)->toBe(! $tag->status); + }); +}); diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php deleted file mode 100644 index cdb51119..00000000 --- a/tests/Feature/ExampleTest.php +++ /dev/null @@ -1,21 +0,0 @@ -get('/'); - - $response->assertStatus(200); - } -} diff --git a/tests/Feature/Fo/AuthTest.php b/tests/Feature/Fo/AuthTest.php new file mode 100644 index 00000000..b584cf3a --- /dev/null +++ b/tests/Feature/Fo/AuthTest.php @@ -0,0 +1,16 @@ +get($route); + + // THEN + $response->assertRedirect(route('fo.auth.connexion')); +}); diff --git a/tests/Feature/Jobs/UpsertShopsPickupExceptionsUsingApiForYearTest.php b/tests/Feature/Jobs/UpsertShopsPickupExceptionsUsingApiForYearTest.php new file mode 100644 index 00000000..b934283e --- /dev/null +++ b/tests/Feature/Jobs/UpsertShopsPickupExceptionsUsingApiForYearTest.php @@ -0,0 +1,83 @@ + new UpsertShopsPickupExceptionsUsingApiForYear($invalidYear)) + ->toThrow(\InvalidArgumentException::class); +}); + +it('upserts holidays from the api and syncs them to all shops', function (): void { + // GIVEN + $year = 2026; + $shops = Shop::factory()->count(2)->create(); + + Http::fake([ + '*' => Http::response([ + '2026-01-01' => '1er janvier', + '2026-12-25' => 'Jour de Noël', + ], 200), + ]); + + // WHEN + $job = new UpsertShopsPickupExceptionsUsingApiForYear($year); + $job->handle(); + + // THEN + expect(PickupException::query()->count())->toBe(2); + + $newYear = PickupException::query()->where('label', '1er janvier')->first(); + expect($newYear)->not->toBeNull() + ->and($newYear->date->format('Y-m-d'))->toBe('2026-01-01') + ->and($newYear->repeatable)->toBeTrue() + ->and($newYear->repeat_frequency)->toBe(RepeatFrequency::YEARLY); + + expect($shops->first()->pickupExceptions()->count())->toBe(2) + ->and($shops->last()->pickupExceptions()->count())->toBe(2); +}); + +it('updates existing pickup exceptions without creating duplicates', function (): void { + // GIVEN + $year = 2026; + $shop = Shop::factory()->create(); + + PickupException::factory()->create([ + 'label' => '1er janvier', + 'date' => '2026-01-01', + 'repeatable' => false, + 'repeat_frequency' => 'Weekly', + ]); + + Http::fake([ + '*' => Http::response([ + '2026-01-01' => '1er janvier', + ], 200), + ]); + + // WHEN + $job = new UpsertShopsPickupExceptionsUsingApiForYear($year); + $job->handle(); + + // THEN + expect(PickupException::query()->count())->toBe(1); + + $updatedException = PickupException::query()->firstOrFail(); + expect($updatedException->date->format('Y-m-d'))->toBe('2026-01-01') + ->and($updatedException->repeatable)->toBeTrue() + ->and($updatedException->repeat_frequency)->toBe(RepeatFrequency::YEARLY); + + expect($shop->pickupExceptions()->count())->toBe(1); +}); diff --git a/tests/Integration/Standalones/.gitkeep b/tests/Integration/Standalones/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/tests/Integration/WithApp/App/Actions/Common/ChangeModelOrderPositionTest.php b/tests/Integration/WithApp/App/Actions/Common/ChangeModelOrderPositionTest.php new file mode 100644 index 00000000..263bf96b --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Common/ChangeModelOrderPositionTest.php @@ -0,0 +1,202 @@ +name = 'Test Range ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->saveOrFail(); + + $product = new Product([ + 'range_id' => $range->id, + 'name' => 'Test Product ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Test description', + 'status' => true, + ]); + $product->price = Money::EUR(1000); + $product->short_description = 'Short test description'; + $product->picture_alt = 'test alt'; + $product->picture_title = 'test title'; + $product->picture_large_alt = 'test alt'; + $product->picture_large_title = 'test title'; + $product->order = $order; + $product->star = false; + $product->saveOrFail(); + + return $product; +} + +describe('ChangeModelOrderPosition action', function (): void { + it('shifts orders when moving a model up to target position', function (): void { + // GIVEN + $tag1 = Tag::factory()->create(); + $tag1->setOrder(1); + $tag1->save(); + + $tag2 = Tag::factory()->create(); + $tag2->setOrder(2); + $tag2->save(); + + $tag3 = Tag::factory()->create(); + $tag3->setOrder(3); + $tag3->save(); + + $action = new ChangeModelOrderPosition(); + $input = new ChangeModelOrderPositionInput($tag3, 1); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBeTrue(); + + $fresh1 = Tag::query()->find($tag1->id); + $fresh2 = Tag::query()->find($tag2->id); + $fresh3 = Tag::query()->find($tag3->id); + + expect($fresh3?->getOrder())->toBe(1) + ->and($fresh1?->getOrder())->toBe(2) + ->and($fresh2?->getOrder())->toBe(3); + }); + + it('shifts orders when moving a model down to target position', function (): void { + // GIVEN + $tag1 = Tag::factory()->create(); + $tag1->setOrder(1); + $tag1->save(); + + $tag2 = Tag::factory()->create(); + $tag2->setOrder(2); + $tag2->save(); + + $tag3 = Tag::factory()->create(); + $tag3->setOrder(3); + $tag3->save(); + + $action = new ChangeModelOrderPosition(); + $input = new ChangeModelOrderPositionInput($tag1, 3); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBeTrue(); + + $fresh1 = Tag::query()->find($tag1->id); + $fresh2 = Tag::query()->find($tag2->id); + $fresh3 = Tag::query()->find($tag3->id); + + expect($fresh2?->getOrder())->toBe(1) + ->and($fresh3?->getOrder())->toBe(2) + ->and($fresh1?->getOrder())->toBe(3); + }); + + it('returns true without modification when target order is identical to current order', function (): void { + // GIVEN + $tag = Tag::factory()->create(); + $tag->setOrder(2); + $tag->save(); + + $action = new ChangeModelOrderPosition(); + $input = new ChangeModelOrderPositionInput($tag, 2); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBeTrue(); + $fresh = Tag::query()->find($tag->id); + expect($fresh?->getOrder())->toBe(2); + }); + + it('clamps target order to maximum existing order when target exceeds max', function (): void { + // GIVEN + $tag1 = Tag::factory()->create(); + $tag1->setOrder(1); + $tag1->save(); + + $tag2 = Tag::factory()->create(); + $tag2->setOrder(2); + $tag2->save(); + + $action = new ChangeModelOrderPosition(); + $input = new ChangeModelOrderPositionInput($tag1, 100); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBeTrue(); + + $fresh1 = Tag::query()->find($tag1->id); + $fresh2 = Tag::query()->find($tag2->id); + + expect($fresh2?->getOrder())->toBe(1) + ->and($fresh1?->getOrder())->toBe(2); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new ChangeModelOrderPosition(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); + + it('shifts soft-deleted models when moving a model across them', function (): void { + // GIVEN + $product1 = createChangeModelOrderPositionProduct(1); + $product2 = createChangeModelOrderPositionProduct(2); + $product3 = createChangeModelOrderPositionProduct(3); + + $product2->delete(); + + $action = new ChangeModelOrderPosition(); + $input = new ChangeModelOrderPositionInput($product1, 3); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBeTrue(); + + $fresh1 = Product::query()->withTrashed()->find($product1->id); + $fresh2 = Product::query()->withTrashed()->find($product2->id); + $fresh3 = Product::query()->withTrashed()->find($product3->id); + + expect($fresh1?->getOrder())->toBe(3) + ->and($fresh2?->getOrder())->toBe(1) + ->and($fresh3?->getOrder())->toBe(2); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Common/ChangeModelOrderTest.php b/tests/Integration/WithApp/App/Actions/Common/ChangeModelOrderTest.php new file mode 100644 index 00000000..af023f8b --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Common/ChangeModelOrderTest.php @@ -0,0 +1,136 @@ +name = 'Test Range ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->saveOrFail(); + + $product = new Product([ + 'range_id' => $range->id, + 'name' => 'Test Product ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Test description', + 'status' => true, + ]); + $product->price = Money::EUR(1000); + $product->short_description = 'Short test description'; + $product->picture_alt = 'test alt'; + $product->picture_title = 'test title'; + $product->picture_large_alt = 'test alt'; + $product->picture_large_title = 'test title'; + $product->order = $order; + $product->star = false; + $product->saveOrFail(); + + return $product; +} + +describe('ChangeModelOrder action', function (): void { + it('permutes order between adjacent models', function (): void { + // GIVEN + $tag1 = Tag::factory()->create(); + $tag1->setOrder(1); + $tag1->save(); + + $tag2 = Tag::factory()->create(); + $tag2->setOrder(2); + $tag2->save(); + + $action = new ChangeModelOrder(); + $input = new ChangeModelOrderInput($tag2, \SortDirection::Ascending); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBeTrue(); + + $fresh1 = Tag::query()->find($tag1->id); + $fresh2 = Tag::query()->find($tag2->id); + + expect($fresh1?->getOrder())->toBe(2) + ->and($fresh2?->getOrder())->toBe(1); + }); + + it('returns false when no adjacent model exists', function (): void { + // GIVEN + $tag = Tag::factory()->create(); + $tag->setOrder(1); + $tag->save(); + + $action = new ChangeModelOrder(); + $input = new ChangeModelOrderInput($tag, \SortDirection::Ascending); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBeFalse(); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new ChangeModelOrder(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); + + it('takes into account soft-deleted models when permuting order', function (): void { + // GIVEN + $product1 = createChangeModelOrderProduct(1); + $product2 = createChangeModelOrderProduct(2); + $product3 = createChangeModelOrderProduct(3); + + $product2->delete(); + + $action = new ChangeModelOrder(); + $input = new ChangeModelOrderInput($product1, \SortDirection::Descending); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBeTrue(); + + $fresh1 = Product::query()->withTrashed()->find($product1->id); + $fresh2 = Product::query()->withTrashed()->find($product2->id); + $fresh3 = Product::query()->withTrashed()->find($product3->id); + + expect($fresh1?->getOrder())->toBe(2) + ->and($fresh2?->getOrder())->toBe(1) + ->and($fresh3?->getOrder())->toBe(3); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Common/ExecuteMassActionTest.php b/tests/Integration/WithApp/App/Actions/Common/ExecuteMassActionTest.php new file mode 100644 index 00000000..cce33895 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Common/ExecuteMassActionTest.php @@ -0,0 +1,168 @@ +name = 'Test Range ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->saveOrFail(); + + $product = new Product([ + 'range_id' => $range->id, + 'name' => 'Test Product ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Test description', + 'status' => true, + ]); + $product->price = Money::EUR(1000); + $product->short_description = 'Short test description'; + $product->picture_alt = 'test alt'; + $product->picture_title = 'test title'; + $product->picture_large_alt = 'test alt'; + $product->picture_large_title = 'test title'; + $product->order = (int) Product::query()->max('order') + 1; + $product->star = false; + $product->saveOrFail(); + + return $product; +} + +describe('ExecuteMassAction', function (): void { + it('publishes a list of products', function (): void { + // GIVEN + $p1 = createMassActionProduct(); + $p1->update(['status' => false]); + $p2 = createMassActionProduct(); + $p2->update(['status' => false]); + + $action = new ExecuteMassAction(); + $input = new ExecuteMassActionInput( + modelClass: Product::class, + action: MassActionType::Publish, + modelKeyList: [$p1->id, $p2->id], + ); + + // WHEN + $count = $action($input); + + // THEN + expect($count)->toBe(2) + ->and($p1->fresh()?->status)->toBeTrue() + ->and($p2->fresh()?->status)->toBeTrue(); + }); + + it('unpublishes a list of products', function (): void { + // GIVEN + $p1 = createMassActionProduct(); + $p2 = createMassActionProduct(); + + $action = new ExecuteMassAction(); + $input = new ExecuteMassActionInput( + modelClass: Product::class, + action: MassActionType::Unpublish, + modelKeyList: [$p1->id, $p2->id], + ); + + // WHEN + $count = $action($input); + + // THEN + expect($count)->toBe(2) + ->and($p1->fresh()?->status)->toBeFalse() + ->and($p2->fresh()?->status)->toBeFalse(); + }); + + it('stars a list of products', function (): void { + // GIVEN + $p1 = createMassActionProduct(); + $p2 = createMassActionProduct(); + + $action = new ExecuteMassAction(); + $input = new ExecuteMassActionInput( + modelClass: Product::class, + action: MassActionType::Star, + modelKeyList: [$p1->id, $p2->id], + ); + + // WHEN + $count = $action($input); + + // THEN + expect($count)->toBe(2) + ->and($p1->fresh()?->star)->toBeTrue() + ->and($p2->fresh()?->star)->toBeTrue(); + }); + + it('unstars a list of products', function (): void { + // GIVEN + $p1 = createMassActionProduct(); + $p1->update(['star' => true]); + $p2 = createMassActionProduct(); + $p2->update(['star' => true]); + + $action = new ExecuteMassAction(); + $input = new ExecuteMassActionInput( + modelClass: Product::class, + action: MassActionType::Unstar, + modelKeyList: [$p1->id, $p2->id], + ); + + // WHEN + $count = $action($input); + + // THEN + expect($count)->toBe(2) + ->and($p1->fresh()?->star)->toBeFalse() + ->and($p2->fresh()?->star)->toBeFalse(); + }); + + it('returns 0 when no model ids match', function (): void { + // GIVEN + $action = new ExecuteMassAction(); + $input = new ExecuteMassActionInput( + modelClass: Product::class, + action: MassActionType::Publish, + modelKeyList: ['non-existing-id-1'], + ); + + // WHEN + $count = $action($input); + + // THEN + expect($count)->toBe(0); + }); + + it('rejects star action when model does not implement ModelWithStar', function (): void { + // GIVEN — Range does not implement ModelWithStar + $action = new ExecuteMassAction(); + $input = new ExecuteMassActionInput( + modelClass: Range::class, + action: MassActionType::Star, + modelKeyList: ['1'], + ); + + // WHEN & THEN + expect(fn () => $action($input))->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Common/ToggleModelStarTest.php b/tests/Integration/WithApp/App/Actions/Common/ToggleModelStarTest.php new file mode 100644 index 00000000..67680f7a --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Common/ToggleModelStarTest.php @@ -0,0 +1,77 @@ +name = 'Test Range ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + $product = new Product([ + 'range_id' => $range->id, + 'name' => 'Test Product ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Test description', + 'status' => true, + ]); + $product->price = Money::EUR(1000); + $product->short_description = 'Short test description'; + $product->picture_alt = 'test alt'; + $product->picture_title = 'test title'; + $product->picture_large_alt = 'test alt'; + $product->picture_large_title = 'test title'; + $product->star = false; + $product->save(); + + $action = new ToggleModelStar(); + $input = new ToggleModelStarInput($product); + + // WHEN + $result = $action($input); + + // THEN + expect($result->getAttribute('star'))->toBeTrue(); + + $fresh = Product::query()->find($product->id); + assert($fresh instanceof Product); + expect($fresh->getAttribute('star'))->toBeTrue(); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new ToggleModelStar(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Common/ToggleModelStatusTest.php b/tests/Integration/WithApp/App/Actions/Common/ToggleModelStatusTest.php new file mode 100644 index 00000000..cbdcac8b --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Common/ToggleModelStatusTest.php @@ -0,0 +1,45 @@ +create([ + 'status' => true, + ]); + + $action = new ToggleModelStatus(); + $input = new ToggleModelStatusInput($tag); + + // WHEN + $result = $action($input); + + // THEN + expect($result->getAttribute('status'))->toBeFalse(); + + $fresh = Tag::query()->find($tag->id); + expect($fresh?->getAttribute('status'))->toBeFalse(); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new ToggleModelStatus(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Customers/RegisterCustomerTest.php b/tests/Integration/WithApp/App/Actions/Customers/RegisterCustomerTest.php new file mode 100644 index 00000000..241f65bd --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Customers/RegisterCustomerTest.php @@ -0,0 +1,349 @@ +matricule = $matricule; + $employee->code = $code; + $employee->nom = 'Doe'; + $employee->prenom = 'John'; + $employee->etablissement = new ShopperEstablishmentCode('ETAB01'); + $employee->site = new ShopperSiteCode('SITE'); + $employee->service = new ShopperServiceCode('1'); + $employee->saveOrFail(); + + $crmReturnedHashcode = Uuid::uuid4()->toString(); + + $crmService = \Mockery::mock(CrmService::class); + $crmService->shouldReceive('persist') + ->once() + ->withArgs(function (CrmCustomer $crmCust) use ($email): bool { + return $crmCust->email === $email->value + && $crmCust->firstname === 'John' + && $crmCust->lastname === 'Doe' + && $crmCust->city === 'Paris' + && $crmCust->country === Country::france; + }) + ->andReturn(new CrmCustomer( + hashcode: $crmReturnedHashcode, + email: $email->value, + password: null, + firstname: 'John', + lastname: 'Doe', + birthDate: '1990-01-01', + phone: '+33612345678', + address: '10 rue de Paris', + address2: null, + city: 'Paris', + postcode: '75001', + country: Country::france, + optIn: true, + status: false, + lastConnection: null, + )); + App::instance(CrmService::class, $crmService); + + $authService = \Mockery::mock(AppCustomerAuthService::class); + $authService->shouldReceive('logIn') + ->once() + ->withArgs(fn (Customer $c) => $c->email->value === $email->value); + App::instance(AppCustomerAuthService::class, $authService); + + $employeeRepo = resolve(EmployeeRepository::class); + + $action = new RegisterCustomer( + authService: $authService, + crmService: $crmService, + employeeRepository: $employeeRepo, + ); + + $input = new RegisterCustomerInput( + matricule: $matricule, + code: $code, + firstname: 'John', + lastname: 'Doe', + email: $email, + password: 'secretPassword123!', + birthDate: $birthDate, + phone: $phone, + address: '10 rue de Paris', + postcode: '75001', + city: 'Paris', + optIn: true, + ); + + // WHEN + $customer = $action($input); + + // THEN + expect($customer)->toBeInstanceOf(Customer::class) + ->and($customer->email->value)->toBe('john.doe@example.com') + ->and($customer->hashcode->value)->toBe($crmReturnedHashcode); + + $freshEmployee = Employee::query()->find($employee->id); + expect($freshEmployee?->customer_id)->toBe($customer->id); + }); + + it('throws ModelNotFoundException when employee does not exist', function (): void { + // GIVEN + $crmService = \Mockery::mock(CrmService::class); + $authService = \Mockery::mock(AppCustomerAuthService::class); + App::instance(CrmService::class, $crmService); + App::instance(AppCustomerAuthService::class, $authService); + + $employeeRepo = resolve(EmployeeRepository::class); + + $action = new RegisterCustomer( + authService: $authService, + crmService: $crmService, + employeeRepository: $employeeRepo, + ); + + $input = new RegisterCustomerInput( + matricule: new Matricule('9999999'), + code: new Code('ABCDYZ'), // no I, L, O, V in Code VO + firstname: 'John', + lastname: 'Doe', + email: new Email('ghost@example.com'), + password: 'secretPassword123!', + birthDate: new \DateTimeImmutable('1990-01-01'), + phone: null, + address: null, + postcode: '75001', + city: 'Paris', + ); + + // WHEN & THEN + expect(fn () => $action($input))->toThrow(ModelNotFoundException::class); + }); + + it('throws ValidationException when CRM indicates customer already exists', function (): void { + // GIVEN + $matricule = new Matricule('2345678'); + $code = new Code('BCDEFG'); + $email = new Email('existing@example.com'); + + $employee = new Employee(); + $employee->matricule = $matricule; + $employee->code = $code; + $employee->nom = 'Existing'; + $employee->prenom = 'User'; + $employee->etablissement = new ShopperEstablishmentCode('ETAB01'); + $employee->site = new ShopperSiteCode('SITE'); + $employee->service = new ShopperServiceCode('1'); + $employee->saveOrFail(); + + $crmService = \Mockery::mock(CrmService::class); + $crmService->shouldReceive('persist') + ->once() + ->andThrow(new CrmCustomerExistsException()); + App::instance(CrmService::class, $crmService); + + $authService = \Mockery::mock(AppCustomerAuthService::class); + App::instance(AppCustomerAuthService::class, $authService); + + $employeeRepo = resolve(EmployeeRepository::class); + + $action = new RegisterCustomer( + authService: $authService, + crmService: $crmService, + employeeRepository: $employeeRepo, + ); + + $input = new RegisterCustomerInput( + matricule: $matricule, + code: $code, + firstname: 'User', + lastname: 'Existing', + email: $email, + password: 'secretPassword123!', + birthDate: new \DateTimeImmutable('1990-01-01'), + phone: null, + address: null, + postcode: '75001', + city: 'Paris', + ); + + // WHEN & THEN + expect(fn () => $action($input))->toThrow(ValidationException::class); + }); + + it('throws ValidationException when CRM fails with CrmServiceException', function (): void { + // GIVEN + $matricule = new Matricule('3456789'); + $code = new Code('CDEFGH'); + $email = new Email('crmerror@example.com'); + + $employee = new Employee(); + $employee->matricule = $matricule; + $employee->code = $code; + $employee->nom = 'Error'; + $employee->prenom = 'Crm'; + $employee->etablissement = new ShopperEstablishmentCode('ETAB01'); + $employee->site = new ShopperSiteCode('SITE'); + $employee->service = new ShopperServiceCode('1'); + $employee->saveOrFail(); + + $crmService = \Mockery::mock(CrmService::class); + $crmService->shouldReceive('persist') + ->once() + ->andThrow(CrmServiceException::of('CRM service offline')); + App::instance(CrmService::class, $crmService); + + $authService = \Mockery::mock(AppCustomerAuthService::class); + App::instance(AppCustomerAuthService::class, $authService); + + $employeeRepo = resolve(EmployeeRepository::class); + + $action = new RegisterCustomer( + authService: $authService, + crmService: $crmService, + employeeRepository: $employeeRepo, + ); + + $input = new RegisterCustomerInput( + matricule: $matricule, + code: $code, + firstname: 'Crm', + lastname: 'Error', + email: $email, + password: 'secretPassword123!', + birthDate: new \DateTimeImmutable('1990-01-01'), + phone: null, + address: null, + postcode: '75001', + city: 'Paris', + ); + + // WHEN & THEN + expect(fn () => $action($input))->toThrow(ValidationException::class); + }); + + it('throws UnexpectedValueException when CRM returns no hashcode', function (): void { + // GIVEN + $matricule = new Matricule('4567890'); + $code = new Code('DEFGHJ'); + $email = new Email('nohash@example.com'); + + $employee = new Employee(); + $employee->matricule = $matricule; + $employee->code = $code; + $employee->nom = 'No'; + $employee->prenom = 'Hash'; + $employee->etablissement = new ShopperEstablishmentCode('ETAB01'); + $employee->site = new ShopperSiteCode('SITE'); + $employee->service = new ShopperServiceCode('1'); + $employee->saveOrFail(); + + $crmService = \Mockery::mock(CrmService::class); + $crmService->shouldReceive('persist') + ->once() + ->andReturn(new CrmCustomer( + hashcode: null, + email: $email->value, + password: null, + firstname: 'Hash', + lastname: 'No', + birthDate: '1990-01-01', + phone: null, + address: null, + address2: null, + city: 'Paris', + postcode: '75001', + country: Country::france, + optIn: false, + status: false, + lastConnection: null, + )); + App::instance(CrmService::class, $crmService); + + $authService = \Mockery::mock(AppCustomerAuthService::class); + App::instance(AppCustomerAuthService::class, $authService); + + $employeeRepo = resolve(EmployeeRepository::class); + + $action = new RegisterCustomer( + authService: $authService, + crmService: $crmService, + employeeRepository: $employeeRepo, + ); + + $input = new RegisterCustomerInput( + matricule: $matricule, + code: $code, + firstname: 'Hash', + lastname: 'No', + email: $email, + password: 'secretPassword123!', + birthDate: new \DateTimeImmutable('1990-01-01'), + phone: null, + address: null, + postcode: '75001', + city: 'Paris', + ); + + // WHEN & THEN + expect(fn () => $action($input))->toThrow(\UnexpectedValueException::class); + }); + + it('throws when invalid ActionInput is passed', function (): void { + // GIVEN + $crmService = \Mockery::mock(CrmService::class); + $authService = \Mockery::mock(AppCustomerAuthService::class); + App::instance(CrmService::class, $crmService); + App::instance(AppCustomerAuthService::class, $authService); + + $employeeRepo = resolve(EmployeeRepository::class); + + $action = new RegisterCustomer( + authService: $authService, + crmService: $crmService, + employeeRepository: $employeeRepo, + ); + + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN & THEN + expect(fn () => $action($invalidInput))->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Discounts/CreateDiscountTest.php b/tests/Integration/WithApp/App/Actions/Discounts/CreateDiscountTest.php new file mode 100644 index 00000000..81d37d46 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Discounts/CreateDiscountTest.php @@ -0,0 +1,140 @@ +range = new Range(); + $this->range->name = 'Gamme ' . uniqid(); + $this->range->status = true; + $this->range->order = random_int(1, 9999); + $this->range->picture_alt = 'alt'; + $this->range->picture_title = 'title'; + $this->range->save(); + }); + + $createProduct = function (string $name, Range $range): Product { + $product = new Product([ + 'range_id' => $range->id, + 'name' => $name . ' ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Description test', + 'status' => true, + ]); + $product->order = random_int(1, 999999); + $product->price = Money::EUR(1000); + $product->short_description = 'Court'; + $product->picture_alt = 'alt'; + $product->picture_title = 'title'; + $product->picture_large_alt = 'alt'; + $product->picture_large_title = 'title'; + $product->save(); + + return $product; + }; + + it('creates and persists a percent discount in database with associated products', function () use ($createProduct): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $product1 = $createProduct('Produit 1', $this->range); + $product2 = $createProduct('Produit 2', $this->range); + + $action = new CreateDiscount(); + $start = new \DateTimeImmutable('2026-06-01 10:00:00'); + $end = new \DateTimeImmutable('2026-06-30 20:00:00'); + $period = new DatePeriod($start, $end); + $value = DiscountValue::fromPercentage(20); + + $input = new CreateDiscountInput( + type: DiscountType::PERCENT, + value: $value, + is_old_price_displayed: true, + period: $period, + associatedProductsIds: [(string) $product1->id, (string) $product2->id], + ); + + // WHEN + $discount = $action($input); + + // THEN + expect($discount)->toBeInstanceOf(Discount::class) + ->and($discount->id)->toBeGreaterThan(0) + ->and($discount->type)->toBe(DiscountType::PERCENT) + ->and($discount->is_old_price_displayed)->toBeTrue() + ->and($discount->value->getPercentage())->toBe(20); + + $fresh = Discount::query()->find($discount->id); + expect($fresh)->not->toBeNull() + ->and($fresh?->type)->toBe(DiscountType::PERCENT); + + $freshProduct1 = Product::query()->find($product1->id); + $freshProduct2 = Product::query()->find($product2->id); + expect($freshProduct1?->discount_id)->toBe($discount->id) + ->and($freshProduct2?->discount_id)->toBe($discount->id); + }); + + it('creates and persists an amount discount in database', function (): void { + // GIVEN + $action = new CreateDiscount(); + $value = DiscountValue::fromAmount(new Money(1000, new Currency('EUR'))); + + $input = new CreateDiscountInput( + type: DiscountType::AMOUNT, + value: $value, + is_old_price_displayed: false, + ); + + // WHEN + $discount = $action($input); + + // THEN + expect($discount)->toBeInstanceOf(Discount::class) + ->and($discount->id)->toBeGreaterThan(0) + ->and($discount->type)->toBe(DiscountType::AMOUNT) + ->and($discount->is_old_price_displayed)->toBeFalse(); + + $fresh = Discount::query()->find($discount->id); + expect($fresh)->not->toBeNull() + ->and($fresh?->value->getAmount()->getAmount())->toBe('1000'); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new CreateDiscount(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Discounts/DeleteDiscountTest.php b/tests/Integration/WithApp/App/Actions/Discounts/DeleteDiscountTest.php new file mode 100644 index 00000000..d72ef9a6 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Discounts/DeleteDiscountTest.php @@ -0,0 +1,102 @@ +range = new Range(); + $this->range->name = 'Gamme ' . uniqid(); + $this->range->status = true; + $this->range->order = random_int(1, 9999); + $this->range->picture_alt = 'alt'; + $this->range->picture_title = 'title'; + $this->range->save(); + }); + + $createProduct = function (string $name, Range $range): Product { + $product = new Product([ + 'range_id' => $range->id, + 'name' => $name . ' ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Description test', + 'status' => true, + ]); + $product->order = random_int(1, 999999); + $product->price = Money::EUR(1000); + $product->short_description = 'Court'; + $product->picture_alt = 'alt'; + $product->picture_title = 'title'; + $product->picture_large_alt = 'alt'; + $product->picture_large_title = 'title'; + $product->save(); + + return $product; + }; + + it('deletes a discount and nullifies product discount_id', function () use ($createProduct): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $product = $createProduct('P1', $this->range); + + $discount = new Discount(); + $discount->type = DiscountType::PERCENT; + $discount->value = DiscountValue::fromPercentage(15); + $discount->is_old_price_displayed = true; + $discount->save(); + + Product::query()->where('id', $product->id)->update(['discount_id' => $discount->id]); + + $action = new DeleteDiscount(); + $input = new DeleteDiscountInput(discount: $discount); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBeTrue(); + + $freshDiscount = Discount::query()->find($discount->id); + expect($freshDiscount)->toBeNull(); + + $freshProduct = Product::query()->find($product->id); + expect($freshProduct?->discount_id)->toBeNull(); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new DeleteDiscount(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Discounts/UpdateDiscountTest.php b/tests/Integration/WithApp/App/Actions/Discounts/UpdateDiscountTest.php new file mode 100644 index 00000000..731ff4b2 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Discounts/UpdateDiscountTest.php @@ -0,0 +1,127 @@ +range = new Range(); + $this->range->name = 'Gamme ' . uniqid(); + $this->range->status = true; + $this->range->order = random_int(1, 9999); + $this->range->picture_alt = 'alt'; + $this->range->picture_title = 'title'; + $this->range->save(); + }); + + $createProduct = function (string $name, Range $range): Product { + $product = new Product([ + 'range_id' => $range->id, + 'name' => $name . ' ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Description test', + 'status' => true, + ]); + $product->order = random_int(1, 999999); + $product->price = Money::EUR(1000); + $product->short_description = 'Court'; + $product->picture_alt = 'alt'; + $product->picture_title = 'title'; + $product->picture_large_alt = 'alt'; + $product->picture_large_title = 'title'; + $product->save(); + + return $product; + }; + + it('updates and persists a discount in database with synchronised products', function () use ($createProduct): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $product1 = $createProduct('P1', $this->range); + $product2 = $createProduct('P2', $this->range); + $product3 = $createProduct('P3', $this->range); + + $discount = new Discount(); + $discount->type = DiscountType::PERCENT; + $discount->value = DiscountValue::fromPercentage(10); + $discount->is_old_price_displayed = true; + $discount->save(); + + Product::query()->whereIn('id', [$product1->id, $product2->id])->update(['discount_id' => $discount->id]); + + $action = new UpdateDiscount(); + $start = new \DateTimeImmutable('2026-07-01 10:00:00'); + $end = new \DateTimeImmutable('2026-07-31 20:00:00'); + $period = new DatePeriod($start, $end); + $value = DiscountValue::fromPercentage(30); + + // Keep product2, remove product1, add product3 + $input = new UpdateDiscountInput( + discount: $discount, + type: DiscountType::PERCENT, + value: $value, + is_old_price_displayed: false, + period: $period, + associatedProductsIds: [(string) $product2->id, (string) $product3->id], + ); + + // WHEN + $updated = $action($input); + + // THEN + expect($updated->id)->toBe($discount->id) + ->and($updated->value->getPercentage())->toBe(30) + ->and($updated->is_old_price_displayed)->toBeFalse(); + + $fresh = Discount::query()->find($discount->id); + expect($fresh)->not->toBeNull() + ->and($fresh?->value->getPercentage())->toBe(30) + ->and($fresh?->is_old_price_displayed)->toBeFalse(); + + $freshP1 = Product::query()->find($product1->id); + $freshP2 = Product::query()->find($product2->id); + $freshP3 = Product::query()->find($product3->id); + + expect($freshP1?->discount_id)->toBeNull() + ->and($freshP2?->discount_id)->toBe($discount->id) + ->and($freshP3?->discount_id)->toBe($discount->id); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new UpdateDiscount(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Faqs/CreateFaqTest.php b/tests/Integration/WithApp/App/Actions/Faqs/CreateFaqTest.php new file mode 100644 index 00000000..e676edbc --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Faqs/CreateFaqTest.php @@ -0,0 +1,49 @@ +toBeInstanceOf(Faq::class) + ->and($faq->id)->toBeInt() + ->and($faq->question)->toBe('Comment contacter le support ?') + ->and($faq->answer)->toBe('Via notre formulaire de contact en ligne.'); + + $fresh = Faq::query()->find($faq->id); + expect($fresh)->not->toBeNull() + ->and($fresh?->question)->toBe('Comment contacter le support ?') + ->and($fresh?->answer)->toBe('Via notre formulaire de contact en ligne.'); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new CreateFaq(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Faqs/DeleteFaqTest.php b/tests/Integration/WithApp/App/Actions/Faqs/DeleteFaqTest.php new file mode 100644 index 00000000..43bbca79 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Faqs/DeleteFaqTest.php @@ -0,0 +1,45 @@ +fill([ + 'question' => 'Question à supprimer ?', + 'answer' => 'Réponse à supprimer.', + ]); + $faq->saveOrFail(); + + $action = new DeleteFaq(); + $input = new DeleteFaqInput(faq: $faq); + + // WHEN + $action($input); + + // THEN + expect(Faq::query()->find($faq->id))->toBeNull(); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new DeleteFaq(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Faqs/UpdateFaqTest.php b/tests/Integration/WithApp/App/Actions/Faqs/UpdateFaqTest.php new file mode 100644 index 00000000..ead8286a --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Faqs/UpdateFaqTest.php @@ -0,0 +1,56 @@ +fill([ + 'question' => 'Ancienne question ?', + 'answer' => 'Ancienne réponse.', + ]); + $faq->saveOrFail(); + + $action = new UpdateFaq(); + $input = new UpdateFaqInput( + faq: $faq, + question: 'Question mise à jour ?', + answer: 'Réponse mise à jour.', + ); + + // WHEN + $updatedFaq = $action($input); + + // THEN + expect($updatedFaq->id)->toBe($faq->id) + ->and($updatedFaq->question)->toBe('Question mise à jour ?') + ->and($updatedFaq->answer)->toBe('Réponse mise à jour.'); + + $fresh = Faq::query()->find($faq->id); + expect($fresh)->not->toBeNull() + ->and($fresh?->question)->toBe('Question mise à jour ?') + ->and($fresh?->answer)->toBe('Réponse mise à jour.'); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new UpdateFaq(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Pages/UpdatePageTest.php b/tests/Integration/WithApp/App/Actions/Pages/UpdatePageTest.php new file mode 100644 index 00000000..06dd69f7 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Pages/UpdatePageTest.php @@ -0,0 +1,65 @@ +slug = StaticPageSlug::LEGALS; + $page->seo_title = 'Ancien SEO Title'; + $page->seo_description = 'Ancienne SEO Description'; + $page->title = 'Ancien titre'; + $page->content = '

Ancien contenu

'; + $page->saveOrFail(); + + $action = new UpdatePage(); + $seo = new SeoMetadata('Nouveau SEO Title', 'Nouvelle SEO Description'); + $input = new UpdatePageInput( + page: $page, + seo: $seo, + title: 'Nouveau titre', + content: '

Nouveau contenu

', + ); + + // WHEN + $updatedPage = $action($input); + + // THEN + expect($updatedPage->id)->toBe($page->id) + ->and($updatedPage->seo_title)->toBe('Nouveau SEO Title') + ->and($updatedPage->seo_description)->toBe('Nouvelle SEO Description') + ->and($updatedPage->title)->toBe('Nouveau titre') + ->and($updatedPage->content)->toBe('

Nouveau contenu

'); + + $fresh = Page::query()->find($page->id); + expect($fresh)->not->toBeNull() + ->and($fresh?->seo_title)->toBe('Nouveau SEO Title') + ->and($fresh?->seo_description)->toBe('Nouvelle SEO Description') + ->and($fresh?->title)->toBe('Nouveau titre') + ->and($fresh?->content)->toBe('

Nouveau contenu

'); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new UpdatePage(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/PickupExceptions/CreatePickupExceptionTest.php b/tests/Integration/WithApp/App/Actions/PickupExceptions/CreatePickupExceptionTest.php new file mode 100644 index 00000000..7c299d08 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/PickupExceptions/CreatePickupExceptionTest.php @@ -0,0 +1,49 @@ +toBeInstanceOf(PickupException::class) + ->and($pickupException->date->format('Y-m-d'))->toBe('2026-05-01') + ->and($pickupException->label)->toBe('1er Mai') + ->and($pickupException->repeatable)->toBeTrue() + ->and($pickupException->repeat_frequency)->toBe(RepeatFrequency::YEARLY) + ->and($pickupException->auto_updated)->toBeFalse(); + + expect(PickupException::query()->where('label', '1er Mai')->exists())->toBeTrue(); + }); + + test('it throws when an invalid input is passed', function () { + // GIVEN + $action = new CreatePickupException(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN & THEN + expect(fn () => $action($invalidInput))->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/PickupExceptions/DeletePickupExceptionTest.php b/tests/Integration/WithApp/App/Actions/PickupExceptions/DeletePickupExceptionTest.php new file mode 100644 index 00000000..8dc9fd5f --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/PickupExceptions/DeletePickupExceptionTest.php @@ -0,0 +1,41 @@ +create(); + + $action = new DeletePickupException(); + $input = new DeletePickupExceptionInput( + pickupException: $pickupException, + ); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBeTrue(); + expect(PickupException::query()->find($pickupException->id))->toBeNull(); + }); + + test('it throws when an invalid input is passed', function () { + // GIVEN + $action = new DeletePickupException(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN & THEN + expect(fn () => $action($invalidInput))->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/PickupExceptions/UpdatePickupExceptionTest.php b/tests/Integration/WithApp/App/Actions/PickupExceptions/UpdatePickupExceptionTest.php new file mode 100644 index 00000000..e6b0f31d --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/PickupExceptions/UpdatePickupExceptionTest.php @@ -0,0 +1,61 @@ +create([ + 'date' => '2026-05-01', + 'label' => 'Old Label', + 'repeatable' => false, + 'repeat_frequency' => RepeatFrequency::WEEKLY, + 'auto_updated' => true, + ]); + + $action = new UpdatePickupException(); + $input = new UpdatePickupExceptionInput( + pickupException: $pickupException, + date: '2026-05-08', + label: 'New Label', + repeatable: true, + repeat_frequency: RepeatFrequency::YEARLY, + ); + + // WHEN + $updated = $action($input); + + // THEN + expect($updated->id)->toBe($pickupException->id) + ->and($updated->date->format('Y-m-d'))->toBe('2026-05-08') + ->and($updated->label)->toBe('New Label') + ->and($updated->repeatable)->toBeTrue() + ->and($updated->repeat_frequency)->toBe(RepeatFrequency::YEARLY) + ->and($updated->auto_updated)->toBeFalse(); + + $fresh = PickupException::query()->find($pickupException->id); + expect($fresh)->not->toBeNull() + ->and($fresh?->label)->toBe('New Label') + ->and($fresh?->auto_updated)->toBeFalse(); + }); + + test('it throws when an invalid input is passed', function () { + // GIVEN + $action = new UpdatePickupException(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN & THEN + expect(fn () => $action($invalidInput))->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/ProductIncos/AssociateProductIncoTest.php b/tests/Integration/WithApp/App/Actions/ProductIncos/AssociateProductIncoTest.php new file mode 100644 index 00000000..cef767a5 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/ProductIncos/AssociateProductIncoTest.php @@ -0,0 +1,176 @@ +name = 'Gamme ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + $product = new Product([ + 'range_id' => $range->id, + 'name' => 'Produit ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Description test', + 'status' => true, + ]); + $product->order = random_int(1, 999999); + $product->price = Money::EUR(1000); + $product->short_description = 'Court'; + $product->picture_alt = 'alt'; + $product->picture_title = 'title'; + $product->picture_large_alt = 'alt'; + $product->picture_large_title = 'title'; + $product->save(); + + return $product; + }; + + it('associates an INCO sheet to a product without prior INCO', function () use ($createProduct): void { + // GIVEN + $product = $createProduct(); + + $arcadiaService = \Mockery::mock(ArcadiaIncoService::class); + $incoData = new ArcadiaIncoDataDto( + noArt: 27996, + name: 'POULET FERMIER', + libelle: 'Poulet Fermier Label Rouge', + brand: 'Loué', + ingredients: '

Poulet (100%)

', + preparation: '

Au four

', + servings: '4/5', + allergens: 'Aucun', + sellingArgument: '

Excellence

', + nutriscore: Nutriscore::A, + nutriscoreArgs: null, + nutrition: new NutritionalValues(refWeightG: 100.0, kj: 600.0, kcal: 143.0), + ); + + $arcadiaService->shouldReceive('fetchInco') + ->once() + ->with(27996) + ->andReturn($incoData); + + $action = new AssociateProductInco($arcadiaService); + $input = new AssociateProductIncoInput(product: $product, no_art: 27996); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBeInstanceOf(ProductInco::class) + ->and($result->product_id)->toBe($product->id) + ->and($result->no_art)->toBe(27996) + ->and($result->ingredients)->toBe('

Poulet (100%)

') + ->and($result->preparation)->toBe('

Au four

') + ->and($result->servings)->toBe('4/5') + ->and($result->allergens)->toBe('Aucun') + ->and($result->selling_argument)->toBe('

Excellence

') + ->and($result->nutriscore)->toBe(Nutriscore::A) + ->and($result->nutrition->kj)->toBe(600.0); + + expect(ProductInco::query()->where('product_id', $product->id)->count())->toBe(1); + }); + + it('replaces existing INCO row when re-associating a product to a different INCO', function () use ($createProduct): void { + // GIVEN + $product = $createProduct(); + + // Existing old INCO + $oldInco = new ProductInco(); + $oldInco->product_id = (string) $product->id; + $oldInco->no_art = 11111; + $oldInco->ingredients = 'Old ingredients'; + $oldInco->save(); + + $arcadiaService = \Mockery::mock(ArcadiaIncoService::class); + $newIncoData = new ArcadiaIncoDataDto( + noArt: 22222, + name: 'NOUVEAU POULET', + libelle: 'Nouveau Poulet', + brand: 'Loué', + ingredients: '

Nouveaux ingrédients

', + preparation: null, + servings: null, + allergens: null, + sellingArgument: null, + nutriscore: Nutriscore::B, + nutriscoreArgs: null, + nutrition: new NutritionalValues(refWeightG: 100.0), + ); + + $arcadiaService->shouldReceive('fetchInco') + ->once() + ->with(22222) + ->andReturn($newIncoData); + + $action = new AssociateProductInco($arcadiaService); + $input = new AssociateProductIncoInput(product: $product, no_art: 22222); + + // WHEN + $newInco = $action($input); + + // THEN + expect($newInco->no_art)->toBe(22222); + expect(ProductInco::query()->where('id', $oldInco->id)->exists())->toBeFalse(); + expect(ProductInco::query()->where('product_id', $product->id)->count())->toBe(1); + expect(ProductInco::query()->where('product_id', $product->id)->first()?->no_art)->toBe(22222); + }); + + it('throws when INCO sheet is not found on Arcadia', function () use ($createProduct): void { + // GIVEN + $product = $createProduct(); + $arcadiaService = \Mockery::mock(ArcadiaIncoService::class); + $arcadiaService->shouldReceive('fetchInco') + ->once() + ->with(99999) + ->andReturnNull(); + + $action = new AssociateProductInco($arcadiaService); + $input = new AssociateProductIncoInput(product: $product, no_art: 99999); + + // WHEN & THEN + expect(fn () => $action($input))->toThrow(\RuntimeException::class); + }); + + it('throws when invalid input is passed', function (): void { + // GIVEN + $arcadiaService = \Mockery::mock(ArcadiaIncoService::class); + $action = new AssociateProductInco($arcadiaService); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN & THEN + expect(fn () => $action($invalidInput))->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/ProductIncos/SynchronizeProductIncosWithArcadiaApiTest.php b/tests/Integration/WithApp/App/Actions/ProductIncos/SynchronizeProductIncosWithArcadiaApiTest.php new file mode 100644 index 00000000..ba72ed2c --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/ProductIncos/SynchronizeProductIncosWithArcadiaApiTest.php @@ -0,0 +1,125 @@ +name = 'Gamme ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + $product = new Product([ + 'range_id' => $range->id, + 'name' => 'Produit ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Description test', + 'status' => true, + ]); + $product->order = random_int(1, 999999); + $product->price = Money::EUR(1000); + $product->short_description = 'Court'; + $product->picture_alt = 'alt'; + $product->picture_title = 'title'; + $product->picture_large_alt = 'alt'; + $product->picture_large_title = 'title'; + $product->save(); + + $inco = new ProductInco(); + $inco->product_id = (string) $product->id; + $inco->no_art = $noArt; + $inco->ingredients = 'Anciens ingrédients'; + $inco->save(); + + return $inco; + }; + + it('synchronizes all product incos in database', function () use ($createProductWithInco): void { + // GIVEN + $inco1 = $createProductWithInco(1001); + $inco2 = $createProductWithInco(1002); + + $arcadiaService = \Mockery::mock(ArcadiaIncoService::class); + $logger = \Mockery::mock(LoggerInterface::class); + $logger->shouldReceive('info'); + $logger->shouldReceive('warning'); + + $data1 = new ArcadiaIncoDataDto( + noArt: 1001, + name: 'P1', + libelle: 'Produit 1', + brand: 'LDC', + ingredients: '

Nouveaux ingrédients 1

', + preparation: null, + servings: null, + allergens: 'Gluten', + sellingArgument: null, + nutriscore: Nutriscore::A, + nutriscoreArgs: null, + nutrition: new NutritionalValues(refWeightG: 100.0, kj: 550.0), + ); + + $data2 = new ArcadiaIncoDataDto( + noArt: 1002, + name: 'P2', + libelle: 'Produit 2', + brand: 'LDC', + ingredients: '

Nouveaux ingrédients 2

', + preparation: null, + servings: null, + allergens: 'Lait', + sellingArgument: null, + nutriscore: Nutriscore::B, + nutriscoreArgs: null, + nutrition: new NutritionalValues(refWeightG: 100.0, kj: 700.0), + ); + + $arcadiaService->shouldReceive('fetchInco')->with(1001)->once()->andReturn($data1); + $arcadiaService->shouldReceive('fetchInco')->with(1002)->once()->andReturn($data2); + + $action = new SynchronizeProductIncosWithArcadiaApi($arcadiaService, $logger); + + // WHEN + $synced = $action(new ActionInputEmpty()); + + // THEN + expect($synced)->toBe(2); + + $fresh1 = ProductInco::query()->find($inco1->id); + $fresh2 = ProductInco::query()->find($inco2->id); + + expect($fresh1?->ingredients)->toBe('

Nouveaux ingrédients 1

') + ->and($fresh1?->allergens)->toBe('Gluten') + ->and($fresh1?->nutriscore)->toBe(Nutriscore::A) + ->and($fresh2?->ingredients)->toBe('

Nouveaux ingrédients 2

') + ->and($fresh2?->allergens)->toBe('Lait') + ->and($fresh2?->nutriscore)->toBe(Nutriscore::B); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Ranges/CreateRangeTest.php b/tests/Integration/WithApp/App/Actions/Ranges/CreateRangeTest.php new file mode 100644 index 00000000..7d2064ea --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Ranges/CreateRangeTest.php @@ -0,0 +1,61 @@ +Une superbe gamme

', + picture: UploadedFile::fake()->image('range.jpg', 500, 500), + pictureMetadata: new PictureMetadata(alt: 'Image alt range', title: 'Image title range'), + status: true, + ); + + // WHEN + $range = $action($input); + + // THEN + expect($range)->toBeInstanceOf(Range::class) + ->and($range->name)->toBe('Gamme Décoration') + ->and($range->slug)->toBe('gamme-decoration') + ->and($range->description)->toBe('

Une superbe gamme

') + ->and($range->picture_alt)->toBe('Image alt range') + ->and($range->picture_title)->toBe('Image title range') + ->and($range->status)->toBeTrue() + ->and($range->exists)->toBeTrue(); + + $this->assertDatabaseHas('ranges', [ + 'id' => $range->id, + 'name' => 'Gamme Décoration', + 'slug' => 'gamme-decoration', + ]); + }); + + test('it throws when an invalid input is passed', function () { + // GIVEN + $action = new CreateRange(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN & THEN + expect(fn () => $action($invalidInput)) + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Ranges/DeleteRangeTest.php b/tests/Integration/WithApp/App/Actions/Ranges/DeleteRangeTest.php new file mode 100644 index 00000000..6c433f09 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Ranges/DeleteRangeTest.php @@ -0,0 +1,48 @@ +name = 'Gamme Temporaire'; + $range->picture_alt = 'Alt'; + $range->picture_title = 'Title'; + $range->status = true; + $range->save(); + + $action = new DeleteRange(); + $input = new DeleteRangeInput(range: $range); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBeTrue(); + $this->assertDatabaseMissing('ranges', [ + 'id' => $range->id, + ]); + }); + + test('it throws when an invalid input is passed', function () { + // GIVEN + $action = new DeleteRange(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN & THEN + expect(fn () => $action($invalidInput)) + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Ranges/UpdateRangeTest.php b/tests/Integration/WithApp/App/Actions/Ranges/UpdateRangeTest.php new file mode 100644 index 00000000..a0dfcdfd --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Ranges/UpdateRangeTest.php @@ -0,0 +1,69 @@ +name = 'Gamme Initiale'; + $range->description = 'Ancien contenu'; + $range->picture_alt = 'Ancien alt'; + $range->picture_title = 'Ancien title'; + $range->status = true; + $range->save(); + + $action = new UpdateRange(); + $input = new UpdateRangeInput( + range: $range, + name: 'Gamme Renommée', + description: 'Nouveau contenu', + picture: UploadedFile::fake()->image('new-range.jpg', 500, 500), + pictureMetadata: new PictureMetadata(alt: 'Nouveau alt', title: 'Nouveau title'), + status: false, + ); + + // WHEN + $updatedRange = $action($input); + + // THEN + expect($updatedRange->id)->toBe($range->id) + ->and($updatedRange->name)->toBe('Gamme Renommée') + ->and($updatedRange->slug)->toBe('gamme-renommee') + ->and($updatedRange->description)->toBe('Nouveau contenu') + ->and($updatedRange->picture_alt)->toBe('Nouveau alt') + ->and($updatedRange->picture_title)->toBe('Nouveau title') + ->and($updatedRange->status)->toBeFalse(); + + $this->assertDatabaseHas('ranges', [ + 'id' => $range->id, + 'name' => 'Gamme Renommée', + 'status' => 0, + ]); + }); + + test('it throws when an invalid input is passed', function () { + // GIVEN + $action = new UpdateRange(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN & THEN + expect(fn () => $action($invalidInput)) + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Settings/UpdateSettingsTest.php b/tests/Integration/WithApp/App/Actions/Settings/UpdateSettingsTest.php new file mode 100644 index 00000000..5c1df5c5 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Settings/UpdateSettingsTest.php @@ -0,0 +1,38 @@ +toBeInstanceOf(Setting::class) + ->and($setting->employee_sites)->toBe(['PA', 'LY']); + + $this->assertDatabaseHas('settings', [ + 'id' => Setting::SINGLETON_ID, + ]); + + $fresh = Setting::getSingleton(); + expect($fresh->employee_sites)->toBe(['PA', 'LY']); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Shops/CreateShopTest.php b/tests/Integration/WithApp/App/Actions/Shops/CreateShopTest.php new file mode 100644 index 00000000..d8c6cef3 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Shops/CreateShopTest.php @@ -0,0 +1,62 @@ +toBeInstanceOf(Shop::class) + ->and($shop->name)->toBe('Boutique Bastille') + ->and($shop->address)->toBe('5 Place de la Bastille') + ->and($shop->postcode)->toBe('75011') + ->and($shop->city)->toBe('Paris') + ->and($shop->phone)->toBe('+33140506070') + ->and((float) $shop->latitude)->toBe(48.8530) + ->and((float) $shop->longitude)->toBe(2.3690) + ->and($shop->default)->toBeTrue() + ->and($shop->exists)->toBeTrue(); + + $this->assertDatabaseHas('shops', [ + 'id' => $shop->id, + 'name' => 'Boutique Bastille', + ]); + }); + + test('it throws when an invalid input is passed', function () { + // GIVEN + $action = new CreateShop(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN & THEN + expect(fn () => $action($invalidInput)) + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Shops/DeleteShopTest.php b/tests/Integration/WithApp/App/Actions/Shops/DeleteShopTest.php new file mode 100644 index 00000000..9eb38171 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Shops/DeleteShopTest.php @@ -0,0 +1,42 @@ +create(); + $action = new DeleteShop(); + $input = new DeleteShopInput(shop: $shop); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBeTrue(); + $this->assertDatabaseMissing('shops', [ + 'id' => $shop->id, + ]); + }); + + test('it throws when an invalid input is passed', function () { + // GIVEN + $action = new DeleteShop(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN & THEN + expect(fn () => $action($invalidInput)) + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Shops/UpdateShopPickupExceptionsTest.php b/tests/Integration/WithApp/App/Actions/Shops/UpdateShopPickupExceptionsTest.php new file mode 100644 index 00000000..df17c93e --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Shops/UpdateShopPickupExceptionsTest.php @@ -0,0 +1,66 @@ +create(); + $exception1 = PickupException::factory()->create(); + $exception2 = PickupException::factory()->create(); + + $action = new UpdateShopPickupExceptions(); + $input = new UpdateShopPickupExceptionsInput( + shop: $shop, + syncData: [ + $exception1->id => [ + 'replacement_date' => '2026-06-01', + 'order_deadline_at' => '2026-05-31 12:00:00', + ], + $exception2->id => [ + 'replacement_date' => null, + 'order_deadline_at' => null, + ], + ], + ); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBeTrue(); + + $this->assertDatabaseHas('shop_pickup_exception', [ + 'shop_id' => $shop->id, + 'pickup_exception_id' => $exception1->id, + 'replacement_date' => '2026-06-01', + ]); + $this->assertDatabaseHas('shop_pickup_exception', [ + 'shop_id' => $shop->id, + 'pickup_exception_id' => $exception2->id, + 'replacement_date' => null, + ]); + }); + + test('it throws when an invalid input is passed', function () { + // GIVEN + $action = new UpdateShopPickupExceptions(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN & THEN + expect(fn () => $action($invalidInput)) + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Shops/UpdateShopTest.php b/tests/Integration/WithApp/App/Actions/Shops/UpdateShopTest.php new file mode 100644 index 00000000..23311324 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Shops/UpdateShopTest.php @@ -0,0 +1,70 @@ +create([ + 'name' => 'Ancien Nom', + 'address' => 'Ancienne Adresse', + 'postcode' => '75001', + 'city' => 'Paris', + 'default' => true, + ]); + + $action = new UpdateShop(); + $input = new UpdateShopInput( + shop: $shop, + name: 'Nouveau Nom', + address: 'Nouvelle Adresse', + postcode: '69001', + city: 'Lyon', + phone: new PhoneNumber('+33478000000'), + coordinates: new Coordinates(45.7640, 4.8357), + default: false, + ); + + // WHEN + $updatedShop = $action($input); + + // THEN + expect($updatedShop->id)->toBe($shop->id) + ->and($updatedShop->name)->toBe('Nouveau Nom') + ->and($updatedShop->address)->toBe('Nouvelle Adresse') + ->and($updatedShop->postcode)->toBe('69001') + ->and($updatedShop->city)->toBe('Lyon') + ->and($updatedShop->phone)->toBe('+33478000000') + ->and((float) $updatedShop->latitude)->toBe(45.7640) + ->and((float) $updatedShop->longitude)->toBe(4.8357) + ->and($updatedShop->default)->toBeFalse(); + + $this->assertDatabaseHas('shops', [ + 'id' => $shop->id, + 'name' => 'Nouveau Nom', + ]); + }); + + test('it throws when an invalid input is passed', function () { + // GIVEN + $action = new UpdateShop(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN & THEN + expect(fn () => $action($invalidInput)) + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Slides/CreateSlideTest.php b/tests/Integration/WithApp/App/Actions/Slides/CreateSlideTest.php new file mode 100644 index 00000000..d2b0f2c9 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Slides/CreateSlideTest.php @@ -0,0 +1,62 @@ +Contenu promo

', + link: 'https://example.com/promo', + linkLabel: 'En profiter', + linkNewTab: true, + connected: false, + period: $period, + ); + + // WHEN + $slide = $action($input); + + // THEN + expect($slide)->toBeInstanceOf(Slide::class) + ->and($slide->id)->toBeGreaterThan(0) + ->and($slide->title)->toBe('Nouvelle Bannière') + ->and($slide->text)->toBe('

Contenu promo

') + ->and($slide->link)->toBe('https://example.com/promo') + ->and($slide->link_label)->toBe('En profiter') + ->and($slide->link_new_tab)->toBeTrue() + ->and($slide->connected)->toBeFalse(); + + $fresh = Slide::query()->find($slide->id); + expect($fresh)->not->toBeNull() + ->and($fresh?->title)->toBe('Nouvelle Bannière'); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new CreateSlide(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Slides/DeleteSlideTest.php b/tests/Integration/WithApp/App/Actions/Slides/DeleteSlideTest.php new file mode 100644 index 00000000..f62eee68 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Slides/DeleteSlideTest.php @@ -0,0 +1,44 @@ +title = 'Slide à supprimer'; + $slide->text = '

Contenu

'; + $slide->saveOrFail(); + + $action = new DeleteSlide(); + $input = new DeleteSlideInput(slide: $slide); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBeTrue(); + expect(Slide::query()->find($slide->id))->toBeNull(); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new DeleteSlide(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Slides/UpdateSlideTest.php b/tests/Integration/WithApp/App/Actions/Slides/UpdateSlideTest.php new file mode 100644 index 00000000..254f666c --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Slides/UpdateSlideTest.php @@ -0,0 +1,68 @@ +title = 'Ancien Titre'; + $slide->text = '

Ancien texte

'; + $slide->saveOrFail(); + + $action = new UpdateSlide(); + $start = new \DateTimeImmutable('2026-07-01 10:00:00'); + $end = new \DateTimeImmutable('2026-07-31 20:00:00'); + $period = new DatePeriod($start, $end); + + $input = new UpdateSlideInput( + slide: $slide, + title: 'Titre Mis à Jour', + text: '

Texte mis à jour

', + link: 'https://example.com/updated', + linkLabel: 'Lien mis à jour', + linkNewTab: true, + connected: true, + period: $period, + ); + + // WHEN + $updatedSlide = $action($input); + + // THEN + expect($updatedSlide->id)->toBe($slide->id) + ->and($updatedSlide->title)->toBe('Titre Mis à Jour') + ->and($updatedSlide->text)->toBe('

Texte mis à jour

') + ->and($updatedSlide->link)->toBe('https://example.com/updated') + ->and($updatedSlide->link_label)->toBe('Lien mis à jour') + ->and($updatedSlide->link_new_tab)->toBeTrue() + ->and($updatedSlide->connected)->toBeTrue(); + + $fresh = Slide::query()->find($slide->id); + expect($fresh)->not->toBeNull() + ->and($fresh?->title)->toBe('Titre Mis à Jour') + ->and($fresh?->text)->toBe('

Texte mis à jour

'); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new UpdateSlide(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Tags/CreateTagTest.php b/tests/Integration/WithApp/App/Actions/Tags/CreateTagTest.php new file mode 100644 index 00000000..81f6d107 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Tags/CreateTagTest.php @@ -0,0 +1,46 @@ +toBeInstanceOf(Tag::class) + ->and($tag->id)->toBeInt() + ->and($tag->label)->toBe('Offre Spéciale') + ->and($tag->status)->toBeTrue(); + + $fresh = Tag::query()->find($tag->id); + expect($fresh)->not->toBeNull() + ->and($fresh?->label)->toBe('Offre Spéciale') + ->and($fresh?->status)->toBeTrue(); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new CreateTag(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Tags/DeleteTagTest.php b/tests/Integration/WithApp/App/Actions/Tags/DeleteTagTest.php new file mode 100644 index 00000000..480ecc87 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Tags/DeleteTagTest.php @@ -0,0 +1,39 @@ +create(); + $action = new DeleteTag(); + $input = new DeleteTagInput(tag: $tag); + + // WHEN + $action($input); + + // THEN + expect(Tag::query()->find($tag->id))->toBeNull(); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new DeleteTag(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Actions/Tags/UpdateTagTest.php b/tests/Integration/WithApp/App/Actions/Tags/UpdateTagTest.php new file mode 100644 index 00000000..78c99082 --- /dev/null +++ b/tests/Integration/WithApp/App/Actions/Tags/UpdateTagTest.php @@ -0,0 +1,46 @@ +create(['label' => 'Ancien Label', 'status' => false]); + $action = new UpdateTag(); + $input = new UpdateTagInput(tag: $tag, label: 'Nouveau Label', status: true); + + // WHEN + $updatedTag = $action($input); + + // THEN + expect($updatedTag->id)->toBe($tag->id) + ->and($updatedTag->label)->toBe('Nouveau Label') + ->and($updatedTag->status)->toBeTrue(); + + $fresh = Tag::query()->find($tag->id); + expect($fresh)->not->toBeNull() + ->and($fresh?->label)->toBe('Nouveau Label') + ->and($fresh?->status)->toBeTrue(); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $action = new UpdateTag(); + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $action($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Dto/PickupExceptionDtoTest.php b/tests/Integration/WithApp/App/Dto/PickupExceptionDtoTest.php new file mode 100644 index 00000000..8024198f --- /dev/null +++ b/tests/Integration/WithApp/App/Dto/PickupExceptionDtoTest.php @@ -0,0 +1,48 @@ +create(); + + // WHEN + $dto = PickupExceptionDto::fromModel($exception); + + // THEN + expect($dto->id)->toBe($exception->id) + ->and($dto->label)->toBe($exception->label) + ->and($dto->pivot)->toBeNull(); + }); + + test('fromModel works with pivot loaded from shop relationship', function () { + // GIVEN + $shop = Shop::factory()->create(); + $exception = PickupException::factory()->create(); + + $shop->pickupExceptions()->attach($exception->id, [ + 'replacement_date' => '2026-05-02', + 'order_deadline_at' => '2026-05-01 18:00:00', + ]); + + $loadedShop = Shop::query()->with('pickupExceptions')->find($shop->id); + $loadedException = $loadedShop?->pickupExceptions->first(); + + // WHEN + $dto = PickupExceptionDto::fromModel($loadedException); + + // THEN + expect($dto->id)->toBe($exception->id) + ->and($dto->pivot)->not->toBeNull() + ->and($dto->pivot?->replacement_date?->format('Y-m-d'))->toBe('2026-05-02') + ->and($dto->pivot?->order_deadline_at?->format('Y-m-d H:i:s'))->toBe('2026-05-01 18:00:00'); + }); +}); diff --git a/tests/Integration/WithApp/App/Dto/RangeDtoTest.php b/tests/Integration/WithApp/App/Dto/RangeDtoTest.php new file mode 100644 index 00000000..472735f5 --- /dev/null +++ b/tests/Integration/WithApp/App/Dto/RangeDtoTest.php @@ -0,0 +1,36 @@ +name = 'Gamme Bio'; + $range->description = 'Description de la gamme bio'; + $range->picture_alt = 'Image gamme bio'; + $range->picture_title = 'Titre image bio'; + $range->status = true; + $range->save(); + + // WHEN + $dto = RangeDto::fromModel($range); + + // THEN + expect($dto->id)->toBe($range->id) + ->and($dto->name)->toBe('Gamme Bio') + ->and($dto->slug)->toBe($range->slug) + ->and($dto->description)->toBe('Description de la gamme bio') + ->and($dto->picture_alt)->toBe('Image gamme bio') + ->and($dto->picture_title)->toBe('Titre image bio') + ->and($dto->status)->toBeTrue() + ->and($dto->order)->toBe($range->order) + ->and($dto->getRouteKey())->toBe($range->slug); + }); +}); diff --git a/tests/Integration/WithApp/App/Dto/ShopDtoTest.php b/tests/Integration/WithApp/App/Dto/ShopDtoTest.php new file mode 100644 index 00000000..e5577b3c --- /dev/null +++ b/tests/Integration/WithApp/App/Dto/ShopDtoTest.php @@ -0,0 +1,58 @@ +name = 'Boutique Centre'; + $shop->address = '10 rue Centrale'; + $shop->postcode = '69002'; + $shop->city = 'Lyon'; + $shop->phone = '+33472000000'; + $shop->default = true; + $shop->save(); + + // WHEN + $dto = ShopDto::fromModel($shop); + + // THEN + expect($dto->id)->toBe($shop->id) + ->and($dto->name)->toBe('Boutique Centre') + ->and($dto->address)->toBe('10 rue Centrale') + ->and($dto->postcode)->toBe('69002') + ->and($dto->city)->toBe('Lyon') + ->and($dto->phone)->toBe('+33472000000') + ->and($dto->default)->toBeTrue() + ->and($dto->getRouteKey())->toBe($shop->id); + }); + + test('it maps loaded pickupExceptions relation correctly', function () { + // GIVEN + $shop = Shop::factory()->create(); + $exception = PickupException::factory()->create(); + $shop->pickupExceptions()->attach($exception->id, [ + 'replacement_date' => '2026-06-01', + 'order_deadline_at' => '2026-05-31 12:00:00', + ]); + $shop->load('pickupExceptions'); + + // WHEN + $dto = ShopDto::fromModel($shop); + + // THEN + expect($dto->pickupExceptions)->not->toBeNull() + ->and($dto->pickupExceptions)->toHaveCount(1) + ->and($dto->pickupExceptions->first()->id)->toBe($exception->id) + ->and($dto->pickupExceptions->first()->pivot)->not->toBeNull() + ->and($dto->pickupExceptions->first()->pivot->replacement_date?->format('Y-m-d'))->toBe('2026-06-01'); + }); +}); diff --git a/tests/Integration/WithApp/App/Dto/SlideDtoTest.php b/tests/Integration/WithApp/App/Dto/SlideDtoTest.php new file mode 100644 index 00000000..ef6291ef --- /dev/null +++ b/tests/Integration/WithApp/App/Dto/SlideDtoTest.php @@ -0,0 +1,51 @@ +id = 42; + $slide->title = 'Bannière Été'; + $slide->text = '

Découvrez notre nouvelle collection

'; + $slide->picture = 'storage/modelfiles/slides/26/06/01/ab/summer.jpg'; + $slide->picture_alt = 'Collection Été'; + $slide->picture_title = 'Bannière promotionnelle été'; + $slide->link = 'https://example.com/ete'; + $slide->link_label = 'Voir les offres'; + $slide->link_new_tab = true; + $slide->connected = false; + $slide->date_start = $dateStart; + $slide->date_end = $dateEnd; + $slide->order = 3; + $slide->status = true; + + // WHEN + $dto = SlideDto::fromModel($slide); + + // THEN + expect($dto->id)->toBe(42) + ->and($dto->title)->toBe('Bannière Été') + ->and($dto->text)->toBe('

Découvrez notre nouvelle collection

') + ->and($dto->picture)->toBe('storage/modelfiles/slides/26/06/01/ab/summer.jpg') + ->and($dto->picture_alt)->toBe('Collection Été') + ->and($dto->picture_title)->toBe('Bannière promotionnelle été') + ->and($dto->link)->toBe('https://example.com/ete') + ->and($dto->link_label)->toBe('Voir les offres') + ->and($dto->link_new_tab)->toBeTrue() + ->and($dto->connected)->toBeFalse() + ->and($dto->date_start)->toEqual($dateStart) + ->and($dto->date_end)->toEqual($dateEnd) + ->and($dto->order)->toBe(3) + ->and($dto->status)->toBeTrue() + ->and($dto->isVisible())->toBeFalse(); + }); +}); diff --git a/tests/Integration/WithApp/App/Models/DiscountTest.php b/tests/Integration/WithApp/App/Models/DiscountTest.php new file mode 100644 index 00000000..4aab365a --- /dev/null +++ b/tests/Integration/WithApp/App/Models/DiscountTest.php @@ -0,0 +1,86 @@ + published + $permanent = new Discount(); + $permanent->type = DiscountType::PERCENT; + $permanent->value = DiscountValue::fromPercentage(10); + $permanent->is_old_price_displayed = true; + $permanent->date_start = null; + $permanent->date_end = null; + $permanent->save(); + + // 2. Immediate discount with end date in future -> published + $immediate = new Discount(); + $immediate->type = DiscountType::PERCENT; + $immediate->value = DiscountValue::fromPercentage(15); + $immediate->is_old_price_displayed = true; + $immediate->date_start = null; + $immediate->date_end = Carbon::parse('2026-06-20 23:59:59'); + $immediate->save(); + + // 3. Started discount with no end date -> published + $ongoing = new Discount(); + $ongoing->type = DiscountType::PERCENT; + $ongoing->value = DiscountValue::fromPercentage(20); + $ongoing->is_old_price_displayed = true; + $ongoing->date_start = Carbon::parse('2026-06-10 00:00:00'); + $ongoing->date_end = null; + $ongoing->save(); + + // 4. Bounded active discount -> published + $bounded = new Discount(); + $bounded->type = DiscountType::PERCENT; + $bounded->value = DiscountValue::fromPercentage(25); + $bounded->is_old_price_displayed = true; + $bounded->date_start = Carbon::parse('2026-06-10 00:00:00'); + $bounded->date_end = Carbon::parse('2026-06-20 23:59:59'); + $bounded->save(); + + // 5. Future discount -> not published + $future = new Discount(); + $future->type = DiscountType::PERCENT; + $future->value = DiscountValue::fromPercentage(30); + $future->is_old_price_displayed = true; + $future->date_start = Carbon::parse('2026-06-20 00:00:00'); + $future->date_end = Carbon::parse('2026-06-25 23:59:59'); + $future->save(); + + // 6. Expired discount -> not published + $expired = new Discount(); + $expired->type = DiscountType::PERCENT; + $expired->value = DiscountValue::fromPercentage(35); + $expired->is_old_price_displayed = true; + $expired->date_start = Carbon::parse('2026-06-01 00:00:00'); + $expired->date_end = Carbon::parse('2026-06-10 23:59:59'); + $expired->save(); + + // WHEN + $publishedDiscounts = Discount::query()->published()->get(); + + // THEN + $publishedIds = $publishedDiscounts->pluck('id')->all(); + + expect($publishedIds)->toContain($permanent->id) + ->and($publishedIds)->toContain($immediate->id) + ->and($publishedIds)->toContain($ongoing->id) + ->and($publishedIds)->toContain($bounded->id) + ->and($publishedIds)->not->toContain($future->id) + ->and($publishedIds)->not->toContain($expired->id); + + Carbon::setTestNow(); + }); +}); diff --git a/tests/Integration/WithApp/App/Queries/Customers/GetCustomerByEmailQueryTest.php b/tests/Integration/WithApp/App/Queries/Customers/GetCustomerByEmailQueryTest.php new file mode 100644 index 00000000..7e41426a --- /dev/null +++ b/tests/Integration/WithApp/App/Queries/Customers/GetCustomerByEmailQueryTest.php @@ -0,0 +1,47 @@ + $email]); + $customer->hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->save(); + + $query = app(GetCustomerByEmailQuery::class); + $input = new GetCustomerByEmailQueryInput($email); + + // WHEN + $result = $query($input); + + // THEN + expect($result)->toBeInstanceOf(ShopperId::class) + ->and($result->value->toString())->toBe($customer->id); + }); + + it('returns null when customer with email does not exist', function (): void { + // GIVEN + $email = new Email('nonexistent@example.com'); + $query = app(GetCustomerByEmailQuery::class); + $input = new GetCustomerByEmailQueryInput($email); + + // WHEN + $result = $query($input); + + // THEN + expect($result)->toBeNull(); + }); +}); diff --git a/tests/Integration/WithApp/App/Queries/Discounts/GetDiscountFormDataQueryTest.php b/tests/Integration/WithApp/App/Queries/Discounts/GetDiscountFormDataQueryTest.php new file mode 100644 index 00000000..2813618c --- /dev/null +++ b/tests/Integration/WithApp/App/Queries/Discounts/GetDiscountFormDataQueryTest.php @@ -0,0 +1,124 @@ +range = new Range(); + $this->range->name = 'Gamme ' . uniqid(); + $this->range->status = true; + $this->range->order = random_int(1, 9999); + $this->range->picture_alt = 'alt'; + $this->range->picture_title = 'title'; + $this->range->save(); + }); + + $createProduct = function (string $name, Range $range): Product { + $product = new Product([ + 'range_id' => $range->id, + 'name' => $name . ' ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Description test', + 'status' => true, + ]); + $product->order = random_int(1, 999999); + $product->price = Money::EUR(1000); + $product->short_description = 'Court'; + $product->picture_alt = 'alt'; + $product->picture_title = 'title'; + $product->picture_large_alt = 'alt'; + $product->picture_large_title = 'title'; + $product->save(); + + return $product; + }; + + it('returns form data for create mode when discount is null', function () use ($createProduct): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $product1 = $createProduct('Poulet', $this->range); + $product2 = $createProduct('Canard', $this->range); + + $query = new GetDiscountFormDataQuery(); + $input = new GetDiscountFormDataQueryInput(); + + // WHEN + $output = $query($input); + + // THEN + expect($output->discount)->toBeNull() + ->and($output->discountTypes)->toHaveCount(count(DiscountType::cases())) + ->and($output->selectedProds)->toBeEmpty() + ->and($output->existingProds->pluck('id')->all())->toContain((string) $product1->id, (string) $product2->id) + ->and($output->existingProds->first())->toBeInstanceOf(DiscountProductDto::class); + }); + + it('returns form data for edit mode when discount is provided', function () use ($createProduct): void { + /** @var \Tests\TestCase $this */ + // GIVEN + $productAssociated = $createProduct('Associe', $this->range); + $productNotAssociated = $createProduct('NonAssocie', $this->range); + + $discount = new Discount(); + $discount->type = DiscountType::PERCENT; + $discount->value = DiscountValue::fromPercentage(15); + $discount->is_old_price_displayed = true; + $discount->save(); + + Product::query()->where('id', $productAssociated->id)->update(['discount_id' => $discount->id]); + + $query = new GetDiscountFormDataQuery(); + $input = new GetDiscountFormDataQueryInput(discount: $discount); + + // WHEN + $output = $query($input); + + // THEN + expect($output->discount)->toBeInstanceOf(DiscountDto::class) + ->and($output->discount?->id)->toBe($discount->id) + ->and($output->discountTypes)->toHaveCount(count(DiscountType::cases())) + ->and($output->selectedProds->pluck('id')->all())->toBe([(string) $productAssociated->id]) + ->and($output->existingProds->pluck('id')->all())->toContain((string) $productNotAssociated->id) + ->and($output->existingProds->pluck('id')->all())->not->toContain((string) $productAssociated->id); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $query = new GetDiscountFormDataQuery(); + $invalidInput = new class () implements QueryInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $query($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Queries/Discounts/GetPaginatedDiscountsQueryTest.php b/tests/Integration/WithApp/App/Queries/Discounts/GetPaginatedDiscountsQueryTest.php new file mode 100644 index 00000000..139cf3bf --- /dev/null +++ b/tests/Integration/WithApp/App/Queries/Discounts/GetPaginatedDiscountsQueryTest.php @@ -0,0 +1,64 @@ +type = DiscountType::PERCENT; + $discount1->value = DiscountValue::fromPercentage(10); + $discount1->is_old_price_displayed = true; + $discount1->save(); + + $discount2 = new Discount(); + $discount2->type = DiscountType::PERCENT; + $discount2->value = DiscountValue::fromPercentage(20); + $discount2->is_old_price_displayed = false; + $discount2->save(); + + $query = new GetPaginatedDiscountsQuery(app(DataTableService::class)); + $input = new GetPaginatedDiscountsQueryInput( + pagination: Pagination::ofPage(new PageNumber(1), new PageSize(10)), + ); + + // WHEN + $paginator = $query($input); + + // THEN + expect($paginator->total())->toBe(2) + ->and($paginator->items())->toHaveCount(2) + ->and($paginator->items()[0])->toBeInstanceOf(DiscountDto::class) + ->and($paginator->items()[1])->toBeInstanceOf(DiscountDto::class); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $query = new GetPaginatedDiscountsQuery(app(DataTableService::class)); + $invalidInput = new class () implements QueryInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $query($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Queries/Faqs/GetFaqsQueryTest.php b/tests/Integration/WithApp/App/Queries/Faqs/GetFaqsQueryTest.php new file mode 100644 index 00000000..65273798 --- /dev/null +++ b/tests/Integration/WithApp/App/Queries/Faqs/GetFaqsQueryTest.php @@ -0,0 +1,41 @@ +question = 'Second question?'; + $faq2->answer = 'Second answer.'; + $faq2->order = 2; + $faq2->save(); + + $faq1 = new Faq(); + $faq1->question = 'First question?'; + $faq1->answer = 'First answer.'; + $faq1->order = 1; + $faq1->save(); + + $query = app(GetFaqsQuery::class); + + // WHEN + $faqs = $query(new QueryInputEmpty()); + + // THEN + expect($faqs)->toBeInstanceOf(Collection::class) + ->and($faqs)->toHaveCount(2) + ->and($faqs->first())->toBeInstanceOf(FaqDto::class) + ->and($faqs->first()->question)->toBe('First question?') + ->and($faqs->last()->question)->toBe('Second question?'); + }); +}); diff --git a/tests/Integration/WithApp/App/Queries/Faqs/GetPaginatedFaqsQueryTest.php b/tests/Integration/WithApp/App/Queries/Faqs/GetPaginatedFaqsQueryTest.php new file mode 100644 index 00000000..c191c6d2 --- /dev/null +++ b/tests/Integration/WithApp/App/Queries/Faqs/GetPaginatedFaqsQueryTest.php @@ -0,0 +1,41 @@ +question = 'First question?'; + $faq1->answer = 'First answer.'; + $faq1->save(); + + $faq2 = new Faq(); + $faq2->question = 'Second question?'; + $faq2->answer = 'Second answer.'; + $faq2->save(); + + /** @var GetPaginatedFaqsQuery $query */ + $query = app(GetPaginatedFaqsQuery::class); + $input = new GetPaginatedFaqsQueryInput( + pagination: Pagination::ofPage(new PageNumber(1), new PageSize(10)), + ); + + // WHEN + $paginator = $query($input); + + // THEN + expect($paginator->total())->toBe(2); + expect($paginator->items())->toHaveCount(2); + expect($paginator->items()[0])->toBeInstanceOf(FaqDto::class) + ->and($paginator->items()[1])->toBeInstanceOf(FaqDto::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Queries/Orders/GetTunnelOrderConfirmedQueryTest.php b/tests/Integration/WithApp/App/Queries/Orders/GetTunnelOrderConfirmedQueryTest.php new file mode 100644 index 00000000..827b5d74 --- /dev/null +++ b/tests/Integration/WithApp/App/Queries/Orders/GetTunnelOrderConfirmedQueryTest.php @@ -0,0 +1,111 @@ +name = 'Boutique Retrait'; + $shop->address = '10 rue Principale'; + $shop->postcode = '75001'; + $shop->city = 'Paris'; + $shop->default = true; + $shop->save(); + + $reference = new OrderReference(Uuid::uuid7()); + + $order = new Order(); + $order->reference = $reference; + $order->total = Money::EUR(2500); + $order->status = OrderStatus::WAITING; + $order->pickup_day = now()->addDays(2); + $order->shop_id = $shop->id; + $order->delivery_address = new DeliveryAddress( + name: $shop->name, + address: $shop->address, + postcode: $shop->postcode, + city: $shop->city, + ); + $order->employee = new OrderEmployee( + matricule: new Matricule('1234567'), + firstname: 'Jean', + lastname: 'Dupont', + facility: new ShopperEstablishmentCode('FAC01'), + site: new ShopperSiteCode('SITE'), + service: new ShopperServiceCode('101'), + ); + $order->save(); + + /** @var GetTunnelOrderConfirmedQuery $query */ + $query = app(GetTunnelOrderConfirmedQuery::class); + $input = new GetTunnelOrderConfirmedQueryInput($order); + + // WHEN + $output = $query($input); + + // THEN + expect($output)->toBeInstanceOf(GetTunnelOrderConfirmedQueryOutput::class) + ->and($output->step)->toBe(OrderTunnelStep::CONFIRMATION) + ->and($output->order)->toBeInstanceOf(OrderDto::class) + ->and((string) $output->order->reference)->toBe((string) $reference) + ->and($output->shop)->toBeInstanceOf(ShopDto::class) + ->and($output->shop->name)->toBe('Boutique Retrait') + ->and($output->mapUrl)->toBeString(); + }); + + it('throws UnexpectedValueException when order has no shop', function (): void { + // GIVEN + $reference = new OrderReference(Uuid::uuid7()); + + $order = new Order(); + $order->reference = $reference; + $order->total = Money::EUR(2500); + $order->status = OrderStatus::WAITING; + $order->pickup_day = now()->addDays(2); + $order->shop_id = null; + $order->employee = new OrderEmployee( + matricule: new Matricule('1234567'), + firstname: 'Jean', + lastname: 'Dupont', + facility: new ShopperEstablishmentCode('FAC01'), + site: new ShopperSiteCode('SITE'), + service: new ShopperServiceCode('101'), + ); + $order->delivery_address = new DeliveryAddress( + name: 'Nom', + address: '1 rue Test', + postcode: '75001', + city: 'Paris', + ); + $order->save(); + + /** @var GetTunnelOrderConfirmedQuery $query */ + $query = app(GetTunnelOrderConfirmedQuery::class); + $input = new GetTunnelOrderConfirmedQueryInput($order); + + // WHEN & THEN + expect(fn () => $query($input))->toThrow(\UnexpectedValueException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Queries/Pages/GetPageBySlugQueryTest.php b/tests/Integration/WithApp/App/Queries/Pages/GetPageBySlugQueryTest.php new file mode 100644 index 00000000..bac78717 --- /dev/null +++ b/tests/Integration/WithApp/App/Queries/Pages/GetPageBySlugQueryTest.php @@ -0,0 +1,70 @@ +slug = StaticPageSlug::LEGALS; + $page->seo_title = 'Mentions légales SEO'; + $page->seo_description = 'Mentions légales description SEO'; + $page->title = 'Mentions légales'; + $page->content = '

Contenu des mentions légales

'; + $page->save(); + + /** @var GetPageQuery $query */ + $query = app(GetPageQuery::class); + + // WHEN + $dto = $query(new GetPageQueryInput(new Slug(StaticPageSlug::LEGALS->value))); + + // THEN + expect($dto)->toBeInstanceOf(PageDto::class) + ->and($dto->id)->toBe($page->id) + ->and($dto->slug)->toBe(StaticPageSlug::LEGALS) + ->and($dto->seo_title)->toBe('Mentions légales SEO') + ->and($dto->title)->toBe('Mentions légales'); + }); + + it('returns a PageDto when page exists by string slug', function (): void { + // GIVEN + $page = new Page(); + $page->slug = StaticPageSlug::TERMS; + $page->seo_title = 'CGV SEO Title'; + $page->seo_description = 'CGV SEO Description'; + $page->title = 'Conditions Générales de Vente'; + $page->content = '

Contenu CGV

'; + $page->save(); + + /** @var GetPageQuery $query */ + $query = app(GetPageQuery::class); + + // WHEN + $dto = $query(new GetPageQueryInput(new Slug('cgv'))); + + // THEN + expect($dto)->toBeInstanceOf(PageDto::class) + ->and($dto->id)->toBe($page->id) + ->and($dto->slug)->toBe(StaticPageSlug::TERMS); + }); + + it('throws ModelNotFoundException when page does not exist', function (): void { + // GIVEN + /** @var GetPageQuery $query */ + $query = app(GetPageQuery::class); + + // WHEN + expect(fn () => $query(new GetPageQueryInput(new Slug('non-existent-slug')))) + // THEN + ->toThrow(ModelNotFoundException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryTest.php b/tests/Integration/WithApp/App/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryTest.php new file mode 100644 index 00000000..66104389 --- /dev/null +++ b/tests/Integration/WithApp/App/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryTest.php @@ -0,0 +1,38 @@ +count(3)->create(); + + $dataTableService = resolve(DataTableService::class); + $query = new GetPaginatedPickupExceptionsQuery($dataTableService); + $input = new GetPaginatedPickupExceptionsQueryInput( + pagination: Pagination::ofPage(new PageNumber(1), new PageSize(10)), + ); + + // WHEN + $paginator = $query($input); + + // THEN + expect($paginator)->toBeInstanceOf(LengthAwarePaginator::class) + ->and($paginator->total())->toBe(3) + ->and($paginator->items())->toHaveCount(3) + ->and($paginator->items()[0])->toBeInstanceOf(PickupExceptionDto::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Queries/Products/GetBoPaginatedProductsQueryTest.php b/tests/Integration/WithApp/App/Queries/Products/GetBoPaginatedProductsQueryTest.php new file mode 100644 index 00000000..6fd5ecd3 --- /dev/null +++ b/tests/Integration/WithApp/App/Queries/Products/GetBoPaginatedProductsQueryTest.php @@ -0,0 +1,116 @@ +name = 'Gamme ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + return $range; + }; + + $createProduct = function (string $name, Range $range, ?int $discountId = null): Product { + $product = new Product([ + 'range_id' => $range->id, + 'name' => $name . ' ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Description test', + 'status' => true, + 'picture_alt' => 'alt', + 'picture_title' => 'title', + 'picture_large_alt' => 'alt', + 'picture_large_title' => 'title', + ]); + $product->order = random_int(1, 999999); + $product->price = Money::EUR(1000); + $product->discount_id = $discountId; + $product->save(); + + return $product; + }; + + it('returns discounts collection and filters by specific discount or all discounts', function () use ($createRange, $createProduct): void { + // GIVEN + $discount1 = new Discount(); + $discount1->type = DiscountType::PERCENT; + $discount1->value = DiscountValue::fromPercentage(20); + $discount1->is_old_price_displayed = true; + $discount1->save(); + + $discount2 = new Discount(); + $discount2->type = DiscountType::AMOUNT; + $discount2->value = DiscountValue::fromAmount(Money::EUR(500)); + $discount2->is_old_price_displayed = false; + $discount2->save(); + + $range = $createRange(); + $prod1 = $createProduct('Prod with Discount 1', $range, $discount1->id); + $prod2 = $createProduct('Prod with Discount 2', $range, $discount2->id); + $prod3 = $createProduct('Prod without Discount', $range, null); + + $query = app(GetBoPaginatedProductsQuery::class); + $pagination = Pagination::ofPage(new PageNumber(1), new PageSize(10)); + + // WHEN: no filter + $outputAll = $query(new GetBoPaginatedProductsQueryInput(pagination: $pagination)); + + // THEN + expect($outputAll->discounts->count())->toBeGreaterThanOrEqual(2) + ->and($outputAll->discounts->has($discount1->id))->toBeTrue() + ->and($outputAll->discounts->get($discount1->id))->toContain("#{$discount1->id} - Pourcentage (20 %)") + ->and($outputAll->products->total())->toBeGreaterThanOrEqual(3); + + // WHEN: filter by specific discount 1 + $outputDiscount1 = $query(new GetBoPaginatedProductsQueryInput( + pagination: $pagination, + discount: (string) $discount1->id, + )); + + // THEN + $ids1 = collect($outputDiscount1->products->items())->pluck('id')->all(); + expect($ids1)->toContain($prod1->id) + ->and($ids1)->not->toContain($prod2->id) + ->and($ids1)->not->toContain($prod3->id); + + // WHEN: filter by all discounts (discount: '0') + $outputDiscountAll = $query(new GetBoPaginatedProductsQueryInput( + pagination: $pagination, + discount: '0', + )); + + // THEN + $idsAll = collect($outputDiscountAll->products->items())->pluck('id')->all(); + expect($idsAll)->toContain($prod1->id) + ->and($idsAll)->toContain($prod2->id) + ->and($idsAll)->not->toContain($prod3->id); + }); +}); diff --git a/tests/Integration/WithApp/App/Queries/Products/GetProductFormDataQueryTest.php b/tests/Integration/WithApp/App/Queries/Products/GetProductFormDataQueryTest.php new file mode 100644 index 00000000..9d385a11 --- /dev/null +++ b/tests/Integration/WithApp/App/Queries/Products/GetProductFormDataQueryTest.php @@ -0,0 +1,123 @@ +name = 'Gamme ' . uniqid(); + $range->status = true; + $range->order = random_int(1, 9999); + $range->picture_alt = 'alt'; + $range->picture_title = 'title'; + $range->save(); + + return $range; + }; + + $createProduct = function (string $name, Range $range): Product { + $product = new Product([ + 'range_id' => $range->id, + 'name' => $name . ' ' . uniqid(), + 'brand' => ProductBrand::loue, + 'invoicing_unit' => InvoicingUnit::PCE, + 'sell_unit' => SellUnit::PCE, + 'order_unit' => OrderUnit::PCE, + 'tax_rate' => TaxRate::TVA_20, + 'description' => 'Description test', + 'status' => true, + ]); + $product->order = random_int(1, 999999); + $product->price = Money::EUR(1000); + $product->short_description = 'Court'; + $product->picture_alt = 'alt'; + $product->picture_title = 'title'; + $product->picture_large_alt = 'alt'; + $product->picture_large_title = 'title'; + $product->save(); + + return $product; + }; + + it('returns form data for create mode when product is null', function () use ($createRange, $createProduct): void { + // GIVEN + $range = $createRange(); + $product1 = $createProduct('Poulet', $range); + $product2 = $createProduct('Canard', $range); + + $tag = new Tag(['label' => 'Tag ' . uniqid(), 'status' => true]); + $tag->save(); + + $query = new GetProductFormDataQuery(); + $input = new GetProductFormDataQueryInput(); + + // WHEN + $output = $query($input); + + // THEN + expect($output)->toBeInstanceOf(ProductFormDataDto::class) + ->and($output->selectedProds)->toBeEmpty() + ->and($output->existingProds->pluck('id')->all())->toContain((string) $product1->id, (string) $product2->id) + ->and($output->existingProds->first())->toBeInstanceOf(ProductDto::class) + ->and($output->brands)->toHaveCount(count(ProductBrand::cases())) + ->and($output->tags->pluck('id')->all())->toContain($tag->id); + }); + + it('returns form data for edit mode with associated and existing products', function () use ($createRange, $createProduct): void { + // GIVEN + $range = $createRange(); + $mainProduct = $createProduct('Principal', $range); + $productAssociated = $createProduct('Associe', $range); + $productNotAssociated = $createProduct('NonAssocie', $range); + + $mainProduct->products()->attach($productAssociated->id, ['sort_order' => 1]); + + $query = new GetProductFormDataQuery(); + $input = new GetProductFormDataQueryInput(product: $mainProduct); + + // WHEN + $output = $query($input); + + // THEN + expect($output)->toBeInstanceOf(ProductFormDataDto::class) + ->and($output->selectedProds->pluck('id')->all())->toBe([(string) $productAssociated->id]) + ->and($output->selectedProds->first())->toBeInstanceOf(ProductDto::class) + ->and($output->existingProds->pluck('id')->all())->toContain((string) $productNotAssociated->id) + ->and($output->existingProds->pluck('id')->all())->not->toContain((string) $mainProduct->id) + ->and($output->existingProds->pluck('id')->all())->not->toContain((string) $productAssociated->id) + ->and($output->existingProds->first())->toBeInstanceOf(ProductDto::class); + }); + + it('throws when an invalid input is passed', function (): void { + // GIVEN + $query = new GetProductFormDataQuery(); + $invalidInput = new class () implements QueryInput + { + }; + + // WHEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $query($invalidInput) + ) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Queries/Ranges/GetPaginatedRangesQueryTest.php b/tests/Integration/WithApp/App/Queries/Ranges/GetPaginatedRangesQueryTest.php new file mode 100644 index 00000000..0e501014 --- /dev/null +++ b/tests/Integration/WithApp/App/Queries/Ranges/GetPaginatedRangesQueryTest.php @@ -0,0 +1,49 @@ +name = 'Gamme Alpha'; + $range1->picture_alt = 'Alt 1'; + $range1->picture_title = 'Title 1'; + $range1->status = true; + $range1->save(); + + $range2 = new Range(); + $range2->name = 'Gamme Beta'; + $range2->picture_alt = 'Alt 2'; + $range2->picture_title = 'Title 2'; + $range2->status = true; + $range2->save(); + + $dataTableService = resolve(DataTableService::class); + $query = new GetPaginatedRangesQuery($dataTableService); + $input = new GetPaginatedRangesQueryInput( + pagination: Pagination::ofPage(new PageNumber(1), new PageSize(10)), + ); + + // WHEN + $result = $query($input); + + // THEN + expect($result->total())->toBe(2) + ->and($result->items())->toHaveCount(2) + ->and($result->items()[0])->toBeInstanceOf(RangeDto::class) + ->and($result->items()[1])->toBeInstanceOf(RangeDto::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Queries/Settings/GetSettingsQueryTest.php b/tests/Integration/WithApp/App/Queries/Settings/GetSettingsQueryTest.php new file mode 100644 index 00000000..82ec5574 --- /dev/null +++ b/tests/Integration/WithApp/App/Queries/Settings/GetSettingsQueryTest.php @@ -0,0 +1,30 @@ +employee_sites = ['NA', 'BO']; + $setting->saveOrFail(); + + $query = new GetSettingsQuery(); + + // WHEN + $dto = $query(new QueryInputEmpty()); + + // THEN + expect($dto)->toBeInstanceOf(SettingDto::class) + ->and($dto->id)->toBe(Setting::SINGLETON_ID) + ->and($dto->employeeSites)->toBe(['NA', 'BO']); + }); +}); diff --git a/tests/Integration/WithApp/App/Queries/Shops/GetPaginatedShopsQueryTest.php b/tests/Integration/WithApp/App/Queries/Shops/GetPaginatedShopsQueryTest.php new file mode 100644 index 00000000..e7025210 --- /dev/null +++ b/tests/Integration/WithApp/App/Queries/Shops/GetPaginatedShopsQueryTest.php @@ -0,0 +1,67 @@ +create(['name' => 'Shop A']); + $shop2 = Shop::factory()->create(['name' => 'Shop B']); + $exception = PickupException::factory()->create(); + + $dataTableService = resolve(DataTableService::class); + $query = new GetPaginatedShopsQuery($dataTableService); + $input = new GetPaginatedShopsQueryInput( + pagination: Pagination::ofPage(new PageNumber(1), new PageSize(10)), + ); + + // WHEN + $output = $query($input); + + // THEN + expect($output)->toBeInstanceOf(GetPaginatedShopsQueryOutput::class) + ->and($output->shops->total())->toBe(2) + ->and($output->shops->items())->toHaveCount(2) + ->and($output->shops->items()[0])->toBeInstanceOf(ShopDto::class) + ->and($output->pickupExceptions)->toHaveCount(1) + ->and($output->pickupExceptions->first())->toBeInstanceOf(PickupExceptionDto::class); + }); + + test('it filters shops by pickupExceptionId', function () { + // GIVEN + $shop1 = Shop::factory()->create(['name' => 'Shop A']); + $shop2 = Shop::factory()->create(['name' => 'Shop B']); + $exception = PickupException::factory()->create(); + + $shop1->pickupExceptions()->attach($exception->id); + + $dataTableService = resolve(DataTableService::class); + $query = new GetPaginatedShopsQuery($dataTableService); + $input = new GetPaginatedShopsQueryInput( + pagination: Pagination::ofPage(new PageNumber(1), new PageSize(10)), + pickupExceptionId: $exception->getId(), + ); + + // WHEN + $output = $query($input); + + // THEN + expect($output->shops->total())->toBe(1) + ->and($output->shops->items()[0]->id)->toBe($shop1->id); + }); +}); diff --git a/tests/Integration/WithApp/App/Queries/Shops/GetShopPickupExceptionsQueryTest.php b/tests/Integration/WithApp/App/Queries/Shops/GetShopPickupExceptionsQueryTest.php new file mode 100644 index 00000000..b5b89aa1 --- /dev/null +++ b/tests/Integration/WithApp/App/Queries/Shops/GetShopPickupExceptionsQueryTest.php @@ -0,0 +1,34 @@ +create(); + + /** @var GetShopPickupExceptionsQuery $query */ + $query = app(GetShopPickupExceptionsQuery::class); + $input = new GetShopPickupExceptionsQueryInput(shop: $shop); + + // WHEN + $output = $query($input); + + // THEN + expect($output)->toBeInstanceOf(GetShopPickupExceptionsQueryOutput::class) + ->and($output->shop)->toBeInstanceOf(ShopDto::class) + ->and($output->shop->id)->toBe($shop->id) + ->and($output->pickupExceptions)->toBeArray() + ->and($output->pickupDay)->not->toBeNull() + ->and($output->pickupPeriod)->not->toBeNull(); + }); +}); diff --git a/tests/Integration/WithApp/App/Queries/Shops/GetShopQueryTest.php b/tests/Integration/WithApp/App/Queries/Shops/GetShopQueryTest.php new file mode 100644 index 00000000..e84cc5d0 --- /dev/null +++ b/tests/Integration/WithApp/App/Queries/Shops/GetShopQueryTest.php @@ -0,0 +1,81 @@ +name = 'Boutique Par Défaut'; + $shop->address = '10 rue Principale'; + $shop->postcode = '75001'; + $shop->city = 'Paris'; + $shop->default = true; + $shop->save(); + + $exception = new PickupException(); + $exception->date = Carbon::parse('2026-12-25'); + $exception->label = 'Noël'; + $exception->repeatable = true; + $exception->repeat_frequency = RepeatFrequency::YEARLY; + $exception->auto_updated = true; + $exception->save(); + + $shop->pickupExceptions()->attach($exception->id, [ + 'replacement_date' => '2026-12-26', + 'order_deadline_at' => '2026-12-24 12:00:00', + ]); + + /** @var GetShopQuery $query */ + $query = app(GetShopQuery::class); + $input = new GetShopQueryInput(); + + // WHEN + $result = $query($input); + + // THEN + expect($result)->toBeInstanceOf(ShopDto::class) + ->and($result->name)->toBe('Boutique Par Défaut') + ->and($result->city)->toBe('Paris') + ->and($result->default)->toBeTrue() + ->and($result->pickupExceptions)->toHaveCount(1) + ->and($result->pickupExceptions->first()?->label)->toBe('Noël'); + }); + + it('throws ModelNotFoundException when no default shop exists', function (): void { + // GIVEN + /** @var GetShopQuery $query */ + $query = app(GetShopQuery::class); + $input = new GetShopQueryInput(); + + // WHEN & THEN + expect(fn () => $query($input))->toThrow(ModelNotFoundException::class); + }); + + it('throws InvalidArgumentException when invalid input is passed', function (): void { + // GIVEN + /** @var GetShopQuery $query */ + $query = app(GetShopQuery::class); + $invalidInput = new class () implements QueryInput + { + }; + + // WHEN & THEN + expect( + /** @phpstan-ignore argument.type */ + fn () => $query($invalidInput) + )->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Integration/WithApp/App/Queries/Slides/GetPaginatedSlidesQueryTest.php b/tests/Integration/WithApp/App/Queries/Slides/GetPaginatedSlidesQueryTest.php new file mode 100644 index 00000000..bf5bfdde --- /dev/null +++ b/tests/Integration/WithApp/App/Queries/Slides/GetPaginatedSlidesQueryTest.php @@ -0,0 +1,86 @@ +title = 'Premier Slide'; + $slide1->text = 'Texte premier slide'; + $slide1->order = 1; + $slide1->save(); + + $slide2 = new Slide(); + $slide2->title = 'Deuxième Slide'; + $slide2->text = 'Texte deuxième slide'; + $slide2->order = 2; + $slide2->save(); + + /** @var GetPaginatedSlidesQuery $query */ + $query = app(GetPaginatedSlidesQuery::class); + $input = new GetPaginatedSlidesQueryInput( + pagination: Pagination::ofPage(new PageNumber(1), new PageSize(10)), + ); + + // WHEN + $paginator = $query($input); + + // THEN + expect($paginator->total())->toBe(2) + ->and($paginator->items())->toHaveCount(2) + ->and($paginator->items()[0])->toBeInstanceOf(SlideDto::class) + ->and($paginator->items()[1])->toBeInstanceOf(SlideDto::class); + }); + + it('filters slides by publication date when publishedOnly is true', function (): void { + // GIVEN + $now = Date::now(); + + $activeSlide = new Slide(); + $activeSlide->title = 'Active Slide'; + $activeSlide->date_start = $now->copy()->subDay(); + $activeSlide->date_end = $now->copy()->addDay(); + $activeSlide->save(); + + $permanentSlide = new Slide(); + $permanentSlide->title = 'Permanent Slide'; + $permanentSlide->save(); + + $expiredSlide = new Slide(); + $expiredSlide->title = 'Expired Slide'; + $expiredSlide->date_start = $now->copy()->subDays(5); + $expiredSlide->date_end = $now->copy()->subDays(2); + $expiredSlide->save(); + + $futureSlide = new Slide(); + $futureSlide->title = 'Future Slide'; + $futureSlide->date_start = $now->copy()->addDays(2); + $futureSlide->date_end = $now->copy()->addDays(5); + $futureSlide->save(); + + /** @var GetPaginatedSlidesQuery $query */ + $query = app(GetPaginatedSlidesQuery::class); + $input = new GetPaginatedSlidesQueryInput( + pagination: Pagination::ofPage(new PageNumber(1), new PageSize(10)), + publishedOnly: true, + ); + + // WHEN + $paginator = $query($input); + + // THEN + $titles = array_map(fn (SlideDto $dto) => $dto->title, $paginator->items()); + expect($titles)->toContain('Active Slide', 'Permanent Slide') + ->and($titles)->not->toContain('Expired Slide', 'Future Slide'); + }); +}); diff --git a/tests/Integration/WithApp/App/Services/ActionExecutorServiceTest.php b/tests/Integration/WithApp/App/Services/ActionExecutorServiceTest.php new file mode 100644 index 00000000..a4808de7 --- /dev/null +++ b/tests/Integration/WithApp/App/Services/ActionExecutorServiceTest.php @@ -0,0 +1,86 @@ + */ + public array $logs = []; + + #[\Override] + public function log($level, string | \Stringable $message, array $context = []): void + { + $this->logs[] = (string) $message; + } + }; + + $action = new class () implements Action + { + #[\Override] + public function __invoke(ActionInput $input): string + { + return 'done'; + } + }; + + $input = new class () implements ActionInput + { + }; + $executor = new ActionExecutorService($logger); + + // WHEN + $result = $executor->execute($action, $input); + + // THEN + expect($result)->toBe('done') + ->and($logger->logs)->toHaveCount(2) + ->and($logger->logs[0])->toContain('Executing') + ->and($logger->logs[1])->toContain('Succeeded'); + }); + + it('logs error and rethrows when action fails', function (): void { + // GIVEN + $logger = new class () extends AbstractLogger + { + /** @var array */ + public array $logs = []; + + #[\Override] + public function log($level, string | \Stringable $message, array $context = []): void + { + $this->logs[] = (string) $message; + } + }; + + $action = new class () implements Action + { + #[\Override] + public function __invoke(ActionInput $input): never + { + throw new \RuntimeException('Database failure'); + } + }; + + $input = new class () implements ActionInput + { + }; + $executor = new ActionExecutorService($logger); + + // WHEN + expect(fn () => $executor->execute($action, $input)) + // THEN + ->toThrow(\RuntimeException::class, 'Database failure'); + + expect($logger->logs)->toHaveCount(2) + ->and($logger->logs[0])->toContain('Executing') + ->and($logger->logs[1])->toContain('Failed'); + }); +}); diff --git a/tests/Integration/WithApp/App/Services/EmployeeSyncServiceTest.php b/tests/Integration/WithApp/App/Services/EmployeeSyncServiceTest.php new file mode 100644 index 00000000..f608434d --- /dev/null +++ b/tests/Integration/WithApp/App/Services/EmployeeSyncServiceTest.php @@ -0,0 +1,118 @@ +employee_sites = ['PA', 'LY']; + $setting->saveOrFail(); + + $logger = app(LoggerInterface::class); + $cache = app(CacheRepository::class); + $codeService = app(CodeGenerationService::class); + $storageService = \Mockery::mock(EmployeeImportStorageService::class); + + $employee = new ArcadiaEmployee( + matricule: new Matricule('1234567'), + lastname: 'Dupont', + firstname: 'Jean', + startDate: CarbonImmutable::parse('2026-01-01'), + endDate: null, + etablissement: new ShopperEstablishmentCode('ETAB'), + site: new ShopperSiteCode('PA'), + service: new ShopperServiceCode('101') + ); + + $storageService->shouldReceive('upsertEmployees') + ->once() + ->with(\Mockery::on(static function (array $data): bool { + return count($data) === 1 && $data[0]->matricule->value === '1234567'; + })); + + $storageService->shouldReceive('getImportedAfter') + ->once() + ->andReturn((object) [ + 'insertedCount' => 1, + 'updatedCount' => 0, + 'matriculesInserted' => [new Matricule('1234567')], + ]); + + $arcadiaService = \Mockery::mock(ArcadiaEmployeeService::class); + $arcadiaService->shouldReceive('getEmployeesOfSiteSince') + ->once() + ->with(\Mockery::on(static fn (ShopperSiteCode $code): bool => $code->value === 'PA'), \Mockery::any()) + ->andReturn([$employee]); + $arcadiaService->shouldReceive('getEmployeesOfSiteSince') + ->once() + ->with(\Mockery::on(static fn (ShopperSiteCode $code): bool => $code->value === 'LY'), \Mockery::any()) + ->andReturn([]); + + $service = new EmployeeSyncService( + $logger, + $cache, + $arcadiaService, + $codeService, + $storageService, + app(GetSettingsQuery::class) + ); + + // WHEN + $service->synchronize(); + + // THEN + expect($service->getLastSync())->not->toBeNull(); + }); + + it('can use explicitly provided sites instead of settings', function (): void { + // GIVEN + $logger = app(LoggerInterface::class); + $cache = app(CacheRepository::class); + $codeService = app(CodeGenerationService::class); + $storageService = \Mockery::mock(EmployeeImportStorageService::class); + + $arcadiaService = \Mockery::mock(ArcadiaEmployeeService::class); + $arcadiaService->shouldReceive('getEmployeesOfSiteSince') + ->once() + ->with(\Mockery::on(static fn (ShopperSiteCode $code): bool => $code->value === 'BO'), \Mockery::any()) + ->andReturn([]); + + $service = new EmployeeSyncService( + $logger, + $cache, + $arcadiaService, + $codeService, + $storageService, + app(GetSettingsQuery::class) + ); + + // WHEN + $service->synchronize(sites: [new ShopperSiteCode('BO')]); + + // THEN + expect($service->getLastSync())->not->toBeNull(); + }); +}); diff --git a/tests/Integration/WithApp/App/Services/FlashMessageServiceTest.php b/tests/Integration/WithApp/App/Services/FlashMessageServiceTest.php new file mode 100644 index 00000000..ba92e410 --- /dev/null +++ b/tests/Integration/WithApp/App/Services/FlashMessageServiceTest.php @@ -0,0 +1,110 @@ +with('info', [])->andReturn(['First message']); + Session::shouldReceive('flash')->with('info', ['First message', 'Second message'])->once(); + + $service = new FlashMessageService(); + + // WHEN + $service->add('info', 'Second message'); + + // THEN + expect(true)->toBeTrue(); + }); + + it('adds a message when existing is not an array', function () { + // GIVEN + Session::shouldReceive('get')->with('info', [])->andReturn('First message'); + Session::shouldReceive('flash')->with('info', ['First message', 'Second message'])->once(); + + $service = new FlashMessageService(); + + // WHEN + $service->add('info', 'Second message'); + + // THEN + expect(true)->toBeTrue(); + }); + }); + + describe('info()', function () { + it('adds an info message', function () { + // GIVEN + Session::shouldReceive('get')->with('info', [])->andReturn([]); + Session::shouldReceive('flash')->with('info', ['Info msg'])->once(); + + $service = new FlashMessageService(); + + // WHEN + $service->info('Info msg'); + + // THEN + expect(true)->toBeTrue(); + }); + }); + + describe('success()', function () { + it('adds a success message', function () { + // GIVEN + Session::shouldReceive('get')->with('success', [])->andReturn([]); + Session::shouldReceive('flash')->with('success', ['Success msg'])->once(); + + $service = new FlashMessageService(); + + // WHEN + $service->success('Success msg'); + + // THEN + expect(true)->toBeTrue(); + }); + }); + + describe('error()', function () { + it('adds an error message', function () { + // GIVEN + Session::shouldReceive('get')->with('error', [])->andReturn([]); + Session::shouldReceive('flash')->with('error', ['Error msg'])->once(); + + $service = new FlashMessageService(); + + // WHEN + $service->error('Error msg'); + + // THEN + expect(true)->toBeTrue(); + }); + }); + + describe('warning()', function () { + it('adds a warning message', function () { + // GIVEN + Session::shouldReceive('get')->with('warning', [])->andReturn([]); + Session::shouldReceive('flash')->with('warning', ['Warning msg'])->once(); + + $service = new FlashMessageService(); + + // WHEN + $service->warning('Warning msg'); + + // THEN + expect(true)->toBeTrue(); + }); + }); +}); diff --git a/tests/Integration/WithApp/App/Services/OrderServiceTest.php b/tests/Integration/WithApp/App/Services/OrderServiceTest.php new file mode 100644 index 00000000..c8a1aeda --- /dev/null +++ b/tests/Integration/WithApp/App/Services/OrderServiceTest.php @@ -0,0 +1,135 @@ + Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('owner@example.com'), + ]); + + Employee::forceCreate([ + 'id' => 301, + 'customer_id' => $customer->id, + 'matricule' => new Matricule('1000301'), + 'nom' => 'Doe', + 'prenom' => 'John', + 'code' => new Code('ABCDEF31'), + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now(), + 'updated_at' => CarbonImmutable::now(), + ]); + + $order = Order::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'reference' => new OrderReference(Uuid::uuid7()), + 'status' => OrderStatus::VALIDATED->value, + 'total' => new Money(1000, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule('1000301'), 'John', 'Doe', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Name', 'Addr', '00000', 'City'), + ]); + + $service = new OrderService(); + + // WHEN + $result = $service->isOrderOwnedBy($order, $customer); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns false if order is not owned by customer', function () { + // GIVEN + $customer = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('notowner@example.com'), + ]); + + Employee::forceCreate([ + 'id' => 302, + 'customer_id' => $customer->id, + 'matricule' => new Matricule('1000302'), + 'nom' => 'Doe', + 'prenom' => 'John', + 'code' => new Code('ABCDEF32'), + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now(), + 'updated_at' => CarbonImmutable::now(), + ]); + + $order = Order::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'reference' => new OrderReference(Uuid::uuid7()), + 'status' => OrderStatus::VALIDATED->value, + 'total' => new Money(1000, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule('1000999'), 'Other', 'Person', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Name', 'Addr', '00000', 'City'), + ]); + + $service = new OrderService(); + + // WHEN + $result = $service->isOrderOwnedBy($order, $customer); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns false if customer has no employee', function () { + // GIVEN + $customer = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('noemp@example.com'), + ]); + + $order = Order::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'reference' => new OrderReference(Uuid::uuid7()), + 'status' => OrderStatus::VALIDATED->value, + 'total' => new Money(1000, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule('1000999'), 'Other', 'Person', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Name', 'Addr', '00000', 'City'), + ]); + + $service = new OrderService(); + + // WHEN + $result = $service->isOrderOwnedBy($order, $customer); + + // THEN + expect($result)->toBeFalse(); + }); +}); diff --git a/tests/Integration/WithApp/Casts/OrderLineProductCastTest.php b/tests/Integration/WithApp/Casts/OrderLineProductCastTest.php new file mode 100644 index 00000000..baafe54e --- /dev/null +++ b/tests/Integration/WithApp/Casts/OrderLineProductCastTest.php @@ -0,0 +1,155 @@ + 123456, + 'original_id' => Uuid::uuid7()->toString(), + 'name' => 'Poulet Fermier', + 'weight' => 1500, + 'weight_variable' => true, + 'brand' => ProductBrand::loue->value, + 'order_unit' => OrderUnit::PCE->value, + 'price' => 1050, + 'discounted_price' => 950, + 'price_kg_ttc' => 700, + 'tax_rate' => TaxRate::TVA_5_5->percent(), + 'picture' => 'poulet.jpg', + ]); + + // WHEN + $vo = $cast->get($model, 'product', $json, []); + + // THEN + expect($vo)->toBeInstanceOf(OrderLineProduct::class) + ->and($vo->incoId->value)->toBe(123456) + ->and($vo->name)->toBe('Poulet Fermier') + ->and($vo->weight->value)->toBe(1500) + ->and($vo->weight->isVariable)->toBeTrue() + ->and($vo->brand)->toBe(ProductBrand::loue) + ->and($vo->orderUnit)->toBe(OrderUnit::PCE) + ->and($vo->taxRate)->toBe(TaxRate::TVA_5_5) + ->and($vo->picture)->toBe('poulet.jpg'); + }); + + it('can cast JSON to OrderLineProduct with TVA 20% and null picture correctly', function () { + // GIVEN + $cast = new OrderLineProductCast(); + $model = new class () extends Model + { + }; + + $json = json_encode([ + 'inco_id' => 123456, + 'original_id' => Uuid::uuid7()->toString(), + 'name' => 'Produit TVA 20', + 'weight' => 500, + 'weight_variable' => false, + 'brand' => ProductBrand::loue->value, + 'order_unit' => OrderUnit::PCE->value, + 'price' => 1050, + 'discounted_price' => 950, + 'price_kg_ttc' => 700, + 'tax_rate' => TaxRate::TVA_20->percent(), // json_encode encodes 20.0 as 20 + 'picture' => null, + ]); + + // WHEN + $vo = $cast->get($model, 'product', $json, []); + + // THEN + expect($vo)->toBeInstanceOf(OrderLineProduct::class) + ->and($vo->taxRate)->toBe(TaxRate::TVA_20) + ->and($vo->picture)->toBeNull(); + }); + + it('can set OrderLineProduct to JSON correctly', function () { + // GIVEN + $cast = new OrderLineProductCast(); + $model = new class () extends Model + { + }; + + $vo = new OrderLineProduct( + incoId: new IncoId(123456), + originalId: new ProductId(Uuid::uuid7()), + name: 'Poulet Fermier', + weight: new ProductWeight(1500, true), + brand: ProductBrand::loue, + orderUnit: OrderUnit::PCE, + price: new Money(1050, new Currency('EUR')), + discountedPrice: new Money(950, new Currency('EUR')), + priceKgTtc: new Money(700, new Currency('EUR')), + taxRate: TaxRate::TVA_5_5, + picture: 'poulet.jpg' + ); + + // WHEN + $json = $cast->set($model, 'product', $vo, []); + $data = json_decode($json, true); + + // THEN + expect($data) + ->toBeArray() + ->toHaveKey('weight', 1500) + ->toHaveKey('weight_variable', true) + ->not->toHaveKey('weight_unit'); + }); + + it('throws exception if value is null on get', function () { + // GIVEN + $cast = new OrderLineProductCast(); + $model = new class () extends Model + { + }; + + // WHEN / THEN + $cast->get($model, 'product', null, []); + })->throws(\InvalidArgumentException::class); + + it('throws exception if value is not string on get', function () { + // GIVEN + $cast = new OrderLineProductCast(); + $model = new class () extends Model + { + }; + + // WHEN / THEN + $cast->get($model, 'product', ['array' => 'invalid'], []); + })->throws(\InvalidArgumentException::class); + + it('throws exception if value is not an OrderLineProduct on set', function () { + // GIVEN + $cast = new OrderLineProductCast(); + $model = new class () extends Model + { + }; + + // WHEN / THEN + $cast->set($model, 'product', 'not a VO', []); + })->throws(\InvalidArgumentException::class); +}); diff --git a/tests/Integration/WithApp/Directories/EloquentCustomerDirectoryTest.php b/tests/Integration/WithApp/Directories/EloquentCustomerDirectoryTest.php new file mode 100644 index 00000000..dc9a7790 --- /dev/null +++ b/tests/Integration/WithApp/Directories/EloquentCustomerDirectoryTest.php @@ -0,0 +1,68 @@ + Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('test@example.com'), + ]); + + // WHEN + $result = $directory->find(Uuid::fromString($customer->id)); + + // THEN + expect($result)->not->toBeNull(); + expect($result->id)->toBe($customer->id); + }); + + it('returns null if customer not found', function () { + // GIVEN + $directory = new EloquentCustomerDirectory(); + + // WHEN + $result = $directory->find(Uuid::uuid7()); + + // THEN + expect($result)->toBeNull(); + }); + + it('gets a customer by email', function () { + // GIVEN + $directory = new EloquentCustomerDirectory(); + $email = new Email('testfind@example.com'); + $customer = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => $email, + ]); + + // WHEN + $result = $directory->getCustomerByEmail($email); + + // THEN + expect($result)->not->toBeNull(); + expect($result->id)->toBe($customer->id); + }); + + it('returns null if customer by email not found', function () { + // GIVEN + $directory = new EloquentCustomerDirectory(); + $email = new Email('notfound@example.com'); + + // WHEN + $result = $directory->getCustomerByEmail($email); + + // THEN + expect($result)->toBeNull(); + }); +}); diff --git a/tests/Integration/WithApp/Directories/EloquentEmployeeDirectoryTest.php b/tests/Integration/WithApp/Directories/EloquentEmployeeDirectoryTest.php new file mode 100644 index 00000000..9840cbf6 --- /dev/null +++ b/tests/Integration/WithApp/Directories/EloquentEmployeeDirectoryTest.php @@ -0,0 +1,213 @@ + 100, + 'customer_id' => null, + 'matricule' => new Matricule('1000100'), + 'code' => new Code('C1111115'), + 'nom' => 'Doe', + 'prenom' => 'John', + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now(), + 'updated_at' => CarbonImmutable::now(), + ]); + + // WHEN + $result = $directory->find(100); + + // THEN + expect($result)->not->toBeNull(); + expect($result->id)->toBe($employee->id); + }); + + it('returns null if employee not found', function () { + // GIVEN + $directory = new EloquentEmployeeDirectory(); + + // WHEN + $result = $directory->find(9999); + + // THEN + expect($result)->toBeNull(); + }); + + it('gets the number of salaries in date range', function () { + // GIVEN + $directory = new EloquentEmployeeDirectory(); + + Employee::forceCreate([ + 'id' => 101, + 'customer_id' => null, + 'matricule' => new Matricule('1000101'), + 'code' => new Code('C1111116'), + 'nom' => 'Doe', + 'prenom' => 'John', + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now()->subDays(5), + 'updated_at' => CarbonImmutable::now()->subDays(5), + ]); + + Employee::forceCreate([ + 'id' => 102, + 'customer_id' => null, + 'matricule' => new Matricule('1000102'), + 'code' => new Code('C1111117'), + 'nom' => 'Doe', + 'prenom' => 'John', + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now()->subDays(15), + 'updated_at' => CarbonImmutable::now()->subDays(15), + ]); + + // WHEN + $start = CarbonImmutable::now()->subDays(10); + $end = CarbonImmutable::now(); + $count = $directory->countActiveEmployeesWithin($start, $end); + + // THEN + expect($count)->toBeGreaterThanOrEqual(1); + }); + it('gets the number of registered active salaries in date range', function () { + // GIVEN + $directory = new EloquentEmployeeDirectory(); + + $customer1 = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('test1_emp@example.com'), + 'created_at' => CarbonImmutable::now()->subDays(5), + ]); + Employee::forceCreate([ + 'id' => 103, + 'customer_id' => $customer1->id, + 'matricule' => new Matricule('1000103'), + 'code' => new Code('C1111118'), + 'nom' => 'Doe', + 'prenom' => 'John', + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now()->subDays(5), + 'updated_at' => CarbonImmutable::now()->subDays(5), + ]); + + $customer2 = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('test2_emp@example.com'), + 'created_at' => CarbonImmutable::now()->subDays(15), + ]); + Employee::forceCreate([ + 'id' => 104, + 'customer_id' => $customer2->id, + 'matricule' => new Matricule('1000104'), + 'code' => new Code('C1111119'), + 'nom' => 'Doe', + 'prenom' => 'John', + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now()->subDays(15), + 'updated_at' => CarbonImmutable::now()->subDays(15), + ]); + + // Customer without employee + Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('test3_emp@example.com'), + 'created_at' => CarbonImmutable::now()->subDays(5), + ]); + + // WHEN + $start = CarbonImmutable::now()->subDays(10); + $end = CarbonImmutable::now(); + $count = $directory->countActiveRegisteredEmployeesWithin($start, $end); + + // THEN + expect($count)->toBeGreaterThanOrEqual(1); + }); + + it('gets total registered active salaries', function () { + // GIVEN + $directory = new EloquentEmployeeDirectory(); + + $customer1 = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('test1t_emp@example.com'), + ]); + Employee::forceCreate([ + 'id' => 105, + 'customer_id' => $customer1->id, + 'matricule' => new Matricule('1000105'), + 'code' => new Code('C111111A'), + 'nom' => 'Doe', + 'prenom' => 'John', + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now(), + 'updated_at' => CarbonImmutable::now(), + ]); + + $customer2 = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('test2t_emp@example.com'), + ]); + // no employee for customer2 + + // WHEN + $count = $directory->countActiveRegisteredEmployees(); + + // THEN + expect($count)->toBeGreaterThanOrEqual(1); + }); + + it('gets total active employees', function () { + // GIVEN + $directory = new EloquentEmployeeDirectory(); + + Employee::forceCreate([ + 'id' => 106, + 'customer_id' => null, + 'matricule' => new Matricule('1000106'), + 'code' => new Code('C1111121'), + 'nom' => 'Doe', + 'prenom' => 'John', + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now(), + 'updated_at' => CarbonImmutable::now(), + ]); + + // WHEN + $count = $directory->countActiveEmployees(); + + // THEN + expect($count)->toBeGreaterThanOrEqual(1); + }); +}); diff --git a/tests/Integration/WithApp/Directories/EloquentOrderDirectoryTest.php b/tests/Integration/WithApp/Directories/EloquentOrderDirectoryTest.php new file mode 100644 index 00000000..da594880 --- /dev/null +++ b/tests/Integration/WithApp/Directories/EloquentOrderDirectoryTest.php @@ -0,0 +1,323 @@ + Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('noemp@example.com'), + ]); + + $pagination = Pagination::ofPage(new PageNumber(1), new PageSize(10)); + + // WHEN + $result = $directory->getPaginatedOrdersOf($customer, $pagination); + + // THEN + expect($result->total())->toBe(0); + }); + + it('returns paginated orders for customer with employee', function () { + // GIVEN + $directory = new EloquentOrderDirectory(); + $customer = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('hasemp@example.com'), + ]); + Employee::forceCreate([ + 'id' => 201, + 'customer_id' => $customer->id, + 'matricule' => new Matricule('1000201'), + 'nom' => 'Doe', + 'prenom' => 'John', + 'code' => new Code('ABCDEF19'), + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now(), + 'updated_at' => CarbonImmutable::now(), + ]); + + Order::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'reference' => new OrderReference(Uuid::uuid7()), + 'status' => OrderStatus::VALIDATED->value, + 'total' => new Money(1000, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule('1000201'), 'John', 'Doe', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Name', 'Addr', '00000', 'City'), + ]); + + Order::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'reference' => new OrderReference(Uuid::uuid7()), + 'status' => OrderStatus::VALIDATED->value, + 'total' => new Money(1000, new Currency('EUR')), + 'employee' => new OrderEmployee(new Matricule('1000999'), 'John', 'Doe', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Name', 'Addr', '00000', 'City'), + ]); + + $pagination = Pagination::ofPage(new PageNumber(1), new PageSize(10)); + + // WHEN + $result = $directory->getPaginatedOrdersOf($customer, $pagination); + + // THEN + expect($result->total())->toBe(1); + }); + + it('finds an order by uuid', function () { + // GIVEN + $directory = new EloquentOrderDirectory(); + $order = Order::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'reference' => new OrderReference(Uuid::uuid7()), + 'total' => new Money(1000, new Currency('EUR')), + 'status' => OrderStatus::VALIDATED->value, + 'employee' => new OrderEmployee(new Matricule('1000999'), 'John', 'Doe', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Name', 'Addr', '00000', 'City'), + ]); + + // WHEN + $result = $directory->find(Uuid::fromString($order->id)); + + // THEN + expect($result)->not->toBeNull(); + expect($result->id)->toBe($order->id); + }); + + it('returns null if order not found', function () { + // GIVEN + $directory = new EloquentOrderDirectory(); + + // WHEN + $result = $directory->find(Uuid::uuid7()); + + // THEN + expect($result)->toBeNull(); + }); + + it('finds order of customer', function () { + // GIVEN + $directory = new EloquentOrderDirectory(); + $customer = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('findof@example.com'), + ]); + Employee::forceCreate([ + 'id' => 202, + 'customer_id' => $customer->id, + 'matricule' => new Matricule('1000202'), + 'nom' => 'Doe', + 'prenom' => 'John', + 'code' => new Code('ABCDEF22'), + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now(), + 'updated_at' => CarbonImmutable::now(), + ]); + + $orderId = Uuid::uuid7()->toString(); + Order::forceCreate([ + 'id' => $orderId, + 'reference' => new OrderReference(Uuid::uuid7()), + 'total' => new Money(1000, new Currency('EUR')), + 'status' => OrderStatus::VALIDATED->value, + 'employee' => new OrderEmployee(new Matricule('1000202'), 'John', 'Doe', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Name', 'Addr', '00000', 'City'), + ]); + + // WHEN + $result = $directory->findOf($customer, Uuid::fromString($orderId)); + + // THEN + expect($result)->not->toBeNull(); + expect($result->id)->toBe($orderId); + }); + + it('gets validated orders in date range', function () { + // GIVEN + $directory = new EloquentOrderDirectory(); + + $pastDate = CarbonImmutable::now()->subDays(5); + Order::forceCreate([ + 'id' => Uuid::uuid7($pastDate)->toString(), + 'reference' => new OrderReference(Uuid::uuid7()), + 'total' => new Money(1000, new Currency('EUR')), + 'status' => OrderStatus::VALIDATED->value, + 'employee' => new OrderEmployee(new Matricule('1000999'), 'John', 'Doe', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Name', 'Addr', '00000', 'City'), + ]); + Order::forceCreate([ + 'id' => Uuid::uuid7($pastDate)->toString(), + 'reference' => new OrderReference(Uuid::uuid7()), + 'total' => new Money(1000, new Currency('EUR')), + 'status' => OrderStatus::WAITING->value, + 'employee' => new OrderEmployee(new Matricule('1000999'), 'John', 'Doe', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Name', 'Addr', '00000', 'City'), + ]); + + // WHEN + $start = CarbonImmutable::now()->subDays(10); + $end = CarbonImmutable::now(); + $results = $directory->getValidatedOrders($start, $end); + + // THEN + expect($results->count())->toBeGreaterThanOrEqual(1); + }); + + it('gets orders by status in date range', function () { + // GIVEN + $directory = new EloquentOrderDirectory(); + + $pastDate = CarbonImmutable::now()->subDays(5); + Order::forceCreate([ + 'id' => Uuid::uuid7($pastDate)->toString(), + 'reference' => new OrderReference(Uuid::uuid7()), + 'total' => new Money(1000, new Currency('EUR')), + 'status' => OrderStatus::CANCELED->value, + 'employee' => new OrderEmployee(new Matricule('1000999'), 'John', 'Doe', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Name', 'Addr', '00000', 'City'), + ]); + + // WHEN + $start = CarbonImmutable::now()->subDays(10); + $end = CarbonImmutable::now(); + $results = $directory->getOrdersByStatus(OrderStatus::CANCELED, $start, $end); + + // THEN + expect($results)->toBeInstanceOf(Collection::class); + }); + + it('gets number of active clients in date range', function () { + // GIVEN + $directory = new EloquentOrderDirectory(); + + $customer = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('active@example.com'), + ]); + Employee::forceCreate([ + 'id' => 203, + 'customer_id' => $customer->id, + 'matricule' => new Matricule('1000203'), + 'nom' => 'Doe', + 'prenom' => 'John', + 'code' => new Code('ABCDEF21'), + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'created_at' => CarbonImmutable::now(), + 'updated_at' => CarbonImmutable::now(), + ]); + + $pastDate = CarbonImmutable::now()->subDays(5); + Order::forceCreate([ + 'id' => Uuid::uuid7($pastDate)->toString(), + 'reference' => new OrderReference(Uuid::uuid7()), + 'total' => new Money(1000, new Currency('EUR')), + 'status' => OrderStatus::VALIDATED->value, + 'employee' => new OrderEmployee(new Matricule('1000203'), 'John', 'Doe', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Name', 'Addr', '00000', 'City'), + ]); + + // WHEN + $start = CarbonImmutable::now()->subDays(10); + $end = CarbonImmutable::now(); + $count = $directory->getNbActiveClients($start, $end); + + // THEN + expect($count)->toBeGreaterThanOrEqual(1); + }); + + it('gets CA HT', function () { + // GIVEN + $directory = new EloquentOrderDirectory(); + + $pastDate = CarbonImmutable::now()->subDays(5); + $order = Order::forceCreate([ + 'id' => Uuid::uuid7($pastDate)->toString(), + 'reference' => new OrderReference(Uuid::uuid7()), + 'total' => new Money(1000, new Currency('EUR')), + 'status' => OrderStatus::VALIDATED->value, + 'employee' => new OrderEmployee(new Matricule('1000999'), 'John', 'Doe', new ShopperEstablishmentCode('FAC01'), new ShopperSiteCode('SITE'), new ShopperServiceCode('101')), + 'delivery_address' => new DeliveryAddress('Name', 'Addr', '00000', 'City'), + ]); + + OrderLine::forceCreate([ + 'id' => 1, + 'order_id' => $order->id, + 'quantity' => 2, + 'unit_price' => new Money(500, new Currency('EUR')), + 'unit_tax' => new Money(100, new Currency('EUR')), + 'unit_discount' => new Money(0, new Currency('EUR')), + 'tax_rate' => TaxRate::TVA_20, + 'total_ht' => new Money(1000, new Currency('EUR')), + 'total_tax' => new Money(200, new Currency('EUR')), + 'total_discount' => new Money(0, new Currency('EUR')), + 'total_ttc' => new Money(1200, new Currency('EUR')), + 'product' => new OrderLineProduct( + incoId: new IncoId(12345), + originalId: new ProductId(Uuid::uuid7()), + name: 'test product', + weight: new ProductWeight(1000, false), + brand: ProductBrand::none, + orderUnit: OrderUnit::PCE, + price: new Money(500, new Currency('EUR')), + discountedPrice: new Money(500, new Currency('EUR')), + priceKgTtc: new Money(600, new Currency('EUR')), + taxRate: TaxRate::TVA_20 + ), + ]); + + // WHEN + $start = CarbonImmutable::now()->subDays(10); + $end = CarbonImmutable::now(); + $caHt = $directory->getCaHt($start, $end); + $caTtc = $directory->getCaTtc($start, $end); + $qty = $directory->getTotalQuantity($start, $end); + + // THEN + expect($caHt)->toBeGreaterThanOrEqual(10.0); + expect($caTtc)->toBeGreaterThanOrEqual(12.0); + expect($qty)->toBeGreaterThanOrEqual(2); + }); +}); diff --git a/tests/Integration/WithApp/Helpers/DateHelperTest.php b/tests/Integration/WithApp/Helpers/DateHelperTest.php new file mode 100644 index 00000000..8ef55b3b --- /dev/null +++ b/tests/Integration/WithApp/Helpers/DateHelperTest.php @@ -0,0 +1,86 @@ +toBeTruthy(); + }); + + it('returns true when both from and to are null (unbounded interval)', function (): void { + // GIVEN + $now = Date::create(2025, 12, 25, 12, 0, 0); + + // WHEN + Date::setTestNow($now); + $result = DatesHelper::isIn(null, null); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns true when only from is set and now is after from', function (): void { + // GIVEN + $now = Date::create(2025, 12, 25, 12, 0, 0); + $from = Date::createFromDate(2025, 12, 24); + + // WHEN + Date::setTestNow($now); + $result = DatesHelper::isIn($from, null); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns false when only from is set and now is before from', function (): void { + // GIVEN + $now = Date::create(2025, 12, 25, 12, 0, 0); + $from = Date::createFromDate(2025, 12, 26); + + // WHEN + Date::setTestNow($now); + $result = DatesHelper::isIn($from, null); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns true when only to is set and now is before to', function (): void { + // GIVEN + $now = Date::create(2025, 12, 25, 12, 0, 0); + $to = Date::createFromDate(2025, 12, 26); + + // WHEN + Date::setTestNow($now); + $result = DatesHelper::isIn(null, $to); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns false when only to is set and now is after to', function (): void { + // GIVEN + $now = Date::create(2025, 12, 25, 12, 0, 0); + $to = Date::createFromDate(2025, 12, 24); + + // WHEN + Date::setTestNow($now); + $result = DatesHelper::isIn(null, $to); + + // THEN + expect($result)->toBeFalse(); + }); +}); diff --git a/tests/Integration/WithApp/Helpers/FileStorageHelperTest.php b/tests/Integration/WithApp/Helpers/FileStorageHelperTest.php new file mode 100644 index 00000000..5245c216 --- /dev/null +++ b/tests/Integration/WithApp/Helpers/FileStorageHelperTest.php @@ -0,0 +1,139 @@ +toBe('my-fancy-file.PNG') + ->and($sanitized)->toBe('inv-lid-name.jpg'); +}); + +it('extracts href/src/url files from html', function (): void { + // GIVEN + $html = <<<'HTML' +
+ A + + +
+HTML; + + // WHEN + $files = FileStorageHelper::findFilesInHtml($html); + + // THEN + expect($files)->toHaveCount(3) + ->and($files[0])->toContain('file-a.pdf') + ->and($files[1])->toContain('file-b.png') + ->and($files[2])->toContain('file-c.jpg'); +}); + +it('filters uploaded files that exist on public disk', function (): void { + // GIVEN + Storage::fake('public'); + Storage::disk('public')->put('modelfiles/orders/26/03/04/aa/file-1.png', 'ok'); + + $urls = [ + '/storage/modelfiles/orders/26/03/04/aa/file-1.png', + '/storage/modelfiles/orders/26/03/04/aa/file-missing.png', + 'https://other.test/storage/modelfiles/orders/26/03/04/aa/file-1.png', + '/uploads/file.jpg', + ]; + + // WHEN + $filtered = FileStorageHelper::onlyUploadedFilesWithFileStorageHelper($urls); + + // THEN + expect($filtered)->toHaveCount(2) + ->and($filtered)->toContain('/storage/modelfiles/orders/26/03/04/aa/file-1.png') + ->and($filtered)->toContain('https://other.test/storage/modelfiles/orders/26/03/04/aa/file-1.png'); +}); + +it('removes old files that are no longer referenced', function (): void { + // GIVEN + Storage::fake('public'); + + $keptPath = 'modelfiles/orders/26/03/04/aa/keep.png'; + $removedPath = 'modelfiles/orders/26/03/04/aa/remove.png'; + + Storage::disk('public')->put($keptPath, 'keep'); + Storage::disk('public')->put($removedPath, 'remove'); + + $oldFiles = [ + '/storage/' . $keptPath, + '/storage/' . $removedPath, + ]; + $newFiles = [ + '/storage/' . $keptPath, + ]; + + // WHEN + FileStorageHelper::removeOldFiles($oldFiles, $newFiles); + + // THEN + expect(Storage::disk('public')->exists($keptPath))->toBeTrue() + ->and(Storage::disk('public')->exists($removedPath))->toBeFalse(); +}); + +it('returns string input as-is when storing file with string path', function (): void { + // GIVEN + /** @var Model $model */ + $model = new Product(); + $existingPath = '/storage/modelfiles/orders/26/03/04/ab/existing.pdf'; + + // WHEN + $stored = FileStorageHelper::storeFile($model, $existingPath); + + // THEN + expect($stored)->toBe($existingPath); +}); + +it('removes file from model attribute when prefixed by storage', function (): void { + // GIVEN + Storage::fake('public'); + $path = 'modelfiles/orders/26/03/04/aa/model-file.png'; + Storage::disk('public')->put($path, 'file-content'); + + $product = new Product(); + $product->picture = '/storage/' . $path; + + // WHEN + FileStorageHelper::removeFile($product, 'picture'); + + // THEN + expect(Storage::disk('public')->exists($path))->toBeFalse(); +}); + +it('removes old model file only when attribute changed', function (): void { + // GIVEN + Storage::fake('public'); + $oldPath = 'modelfiles/orders/26/03/04/aa/old.png'; + $newPath = 'modelfiles/orders/26/03/04/aa/new.png'; + + Storage::disk('public')->put($oldPath, 'old-content'); + + $product = new Product(); + $product->setRawAttributes([ + 'picture' => '/storage/' . $oldPath, + ], true); + $product->picture = '/storage/' . $newPath; + + // WHEN + FileStorageHelper::removeOldFile($product, 'picture'); + + // THEN + expect(Storage::disk('public')->exists($oldPath))->toBeFalse(); +}); diff --git a/tests/Integration/WithApp/Helpers/ToolboxHelperCoreHarness.php b/tests/Integration/WithApp/Helpers/ToolboxHelperCoreHarness.php new file mode 100644 index 00000000..81841045 --- /dev/null +++ b/tests/Integration/WithApp/Helpers/ToolboxHelperCoreHarness.php @@ -0,0 +1,20 @@ +toBeFalse(); +}); + +it('replaces recursively in nested array subject', function (): void { + // GIVEN + $count = 0; + $subject = ['a.b', ['a.b', 'z']]; + + // WHEN + $result = ToolboxHelperCoreHarness::mbReplace('.', '-', $subject, $count); + + // THEN + expect($result)->toBe(['a-b', ['a-b', 'z']]) + ->and($count)->toBe(0); +}); + +it('replaces with search array and scalar replacement', function (): void { + // GIVEN + $count = 0; + + // WHEN + $result = ToolboxHelperCoreHarness::mbReplace(['ab', 'cd'], '_', 'ab-cd', $count); + + // THEN + expect($result)->toBe('_-_'); +}); + +it('replaces with paired search and replace arrays', function (): void { + // GIVEN + $count = 0; + + // WHEN + $result = ToolboxHelperCoreHarness::mbReplace(['ab', 'cd'], ['X', 'Y'], 'ab-cd', $count); + + // THEN + expect($result)->toBe('X-Y'); +}); + +it('converts nested object to array and array to object', function (): void { + // GIVEN + $object = (object) [ + 'name' => 'demo', + 'nested' => (object) [ + 'value' => 10, + ], + ]; + + // WHEN + $asArray = ToolboxHelperCoreHarness::objectToArray($object); + $asObject = ToolboxHelperCoreHarness::arrayToObject($asArray); + + // THEN + expect($asArray)->toBe([ + 'name' => 'demo', + 'nested' => ['value' => 10], + ]) + ->and($asObject)->toBeObject() + ->and($asObject->nested)->toBeObject() + ->and($asObject->nested->value)->toBe(10); +}); + +it('throws for unsupported scalar structure conversion', function (): void { + // WHEN / THEN + expect(fn () => ToolboxHelperCoreHarness::objectToArray('x')) + ->toThrow(UnsupportedStructureConversionException::class) + ->and(fn () => ToolboxHelperCoreHarness::arrayToObject(12)) + ->toThrow(UnsupportedStructureConversionException::class); +}); + +it('resolves full path and mime type without storage disk', function (): void { + // GIVEN + $tmpFile = tempnam(sys_get_temp_dir(), 'tbx-'); + expect($tmpFile)->toBeString(); + file_put_contents((string) $tmpFile, 'hello'); + + // WHEN + $fullPath = ToolboxHelperCoreHarness::exposeGetUploadedFileFullPath((string) $tmpFile, false); + $mimeType = ToolboxHelperCoreHarness::exposeGetUploadedFileMimeType((string) $tmpFile, false); + + // THEN + expect($fullPath)->toBe(realpath((string) $tmpFile) ?: (string) $tmpFile) + ->and($mimeType)->toBeString(); + + unlink((string) $tmpFile); +}); + +it('resolves full path and mime type through storage disk', function (): void { + // GIVEN + $path = 'tests/toolbox-core/demo.txt'; + Storage::disk()->put($path, 'hello world'); + + // WHEN + $fullPath = ToolboxHelperCoreHarness::exposeGetUploadedFileFullPath($path, true); + $mimeType = ToolboxHelperCoreHarness::exposeGetUploadedFileMimeType($path, true); + + // THEN + expect($fullPath)->toBeString() + ->and($fullPath)->toContain('demo.txt') + ->and($mimeType)->toBeString(); + + Storage::disk()->delete($path); +}); diff --git a/tests/Integration/WithApp/Infra/Adapters/Directories/EloquentCodeDirectoryTest.php b/tests/Integration/WithApp/Infra/Adapters/Directories/EloquentCodeDirectoryTest.php new file mode 100644 index 00000000..300adb16 --- /dev/null +++ b/tests/Integration/WithApp/Infra/Adapters/Directories/EloquentCodeDirectoryTest.php @@ -0,0 +1,55 @@ +id(); + $table->string('code')->nullable(); + $table->timestamps(); + }); + } + Employee::query()->delete(); +}); + +it('confirms the existence of a given code in the repository', function () { + // GIVEN + Employee::forceCreate([ + 'code' => new Code('99999998'), + 'matricule' => new Matricule('9999999'), + 'nom' => 'N', + 'prenom' => 'P', + 'etablissement' => 'ETAB', + 'service' => '101', + 'site' => 'SITE', + 'start_date' => '2023-01-01', + ]); + $repo = new EloquentCodeDirectory(); + + // WHEN + $result = $repo->exists(new Code('99999998')); + + // THEN + expect($result)->toBeTrue(); +}); + +it('denies the existence of an unknown code in the repository', function () { + // GIVEN + $repo = new EloquentCodeDirectory(); + + // WHEN + $result = $repo->exists(new Code('99999999')); + + // THEN + expect($result)->toBeFalse(); +}); diff --git a/tests/Integration/WithApp/Infra/Adapters/Directories/EloquentShopDirectoryTest.php b/tests/Integration/WithApp/Infra/Adapters/Directories/EloquentShopDirectoryTest.php new file mode 100644 index 00000000..c11fe1b5 --- /dev/null +++ b/tests/Integration/WithApp/Infra/Adapters/Directories/EloquentShopDirectoryTest.php @@ -0,0 +1,87 @@ +id(); + $table->string('name'); + $table->string('address'); + $table->string('postcode'); + $table->string('city'); + $table->string('phone')->nullable(); + $table->string('latitude')->nullable(); + $table->string('longitude')->nullable(); + $table->boolean('default')->default(false); + $table->timestamps(); + }); + } + DB::table('shops')->delete(); +}); + +it('retrieves all available shops', function () { + // GIVEN + Shop::forceCreate([ + 'name' => 'Shop 1', + 'address' => 'Addr 1', + 'postcode' => '75000', + 'city' => 'Paris', + 'default' => false, + ]); + Shop::forceCreate([ + 'name' => 'Shop 2', + 'address' => 'Addr 2', + 'postcode' => '75001', + 'city' => 'Paris', + 'default' => false, + ]); + $directory = new EloquentShopDirectory(); + + // WHEN + $shops = $directory->getAll(); + + // THEN + expect($shops)->toHaveCount(2) + ->and($shops[0])->toBeInstanceOf(\Domain\Models\Entities\Shop::class); +}); + +it('finds a shop by its identifier', function () { + // GIVEN + $model = Shop::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'name' => 'Shop X', + 'address' => 'Addr X', + 'postcode' => '75000', + 'city' => 'Paris', + 'default' => false, + ]); + $directory = new EloquentShopDirectory(); + + // WHEN + $shop = $directory->find(new ShopId(Uuid::fromString($model->id))); + + // THEN + expect($shop)->not->toBeNull() + ->and($shop->id->value->toString())->toBe($model->id) + ->and($shop->name)->toBe($model->name); +}); + +it('returns null if shop by id is not found', function () { + // GIVEN + $directory = new EloquentShopDirectory(); + + // WHEN + $shop = $directory->find(new ShopId(Uuid::uuid7())); + + // THEN + expect($shop)->toBeNull(); +}); diff --git a/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentOrderRepositoryTest.php b/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentOrderRepositoryTest.php new file mode 100644 index 00000000..d6c22341 --- /dev/null +++ b/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentOrderRepositoryTest.php @@ -0,0 +1,98 @@ +string('id')->primary(); + $table->uuid('shop_id'); + $table->string('reference'); + $table->json('employee'); + $table->json('delivery_address'); + $table->date('pickup_day'); + $table->string('status'); + $table->integer('total'); + $table->string('employee_matricule')->nullable(); + $table->timestamps(); + }); + } + + if (! Schema::hasTable('order_lines')) { + Schema::create('order_lines', function (Blueprint $table) { + $table->id(); + $table->string('order_id'); + $table->json('product'); + $table->integer('quantity'); + $table->integer('tax_rate'); + $table->integer('unit_price'); + $table->integer('unit_tax'); + $table->integer('unit_discount'); + $table->integer('total_discount'); + $table->integer('total_ht'); + $table->integer('total_tax'); + $table->integer('total_ttc'); + $table->timestamps(); + }); + } + + DB::table('orders')->delete(); + DB::table('order_lines')->delete(); +}); + +it('returns null when finding a non-existent order by id', function () { + // GIVEN + $repo = new EloquentOrderRepository(new Currency('EUR')); + $orderId = new OrderId(Uuid::fromString('018e4567-e89b-72d3-a456-426614174001')); + + // WHEN + $result = $repo->find($orderId); + + // THEN + expect($result)->toBeNull(); +}); + +it('updates an existing order in the repository', function () { + // GIVEN + $shopId = Uuid::uuid7()->toString(); + DB::table('shops')->insertOrIgnore(['id' => $shopId, 'name' => 'Shop 1', 'postcode' => '75000', 'city' => 'Paris', 'address' => 'Addr']); + + DB::table('orders')->insert([ + 'id' => '018e4567-e89b-72d3-a456-426614174002', + 'shop_id' => $shopId, + 'reference' => Uuid::uuid7()->toString(), + 'employee' => json_encode([ + 'matricule' => '1234567', + 'firstname' => 'Jean', + 'lastname' => 'Dupont', + 'facility' => 'FAC01', + 'site' => 'HQ', + 'service' => '101', + ]), + 'delivery_address' => '{}', + 'pickup_day' => '2023-01-05', + 'status' => OrderStatus::WAITING->value, + 'total' => 1000, + ]); + + $repo = new EloquentOrderRepository(new Currency('EUR')); + + $domainOrder = $repo->find(new OrderId(Uuid::fromString('018e4567-e89b-72d3-a456-426614174002'))); + $domainOrder->status = OrderStatus::VALIDATED; + + // WHEN + $repo->persist($domainOrder); + + // THEN + $updatedOrder = DB::table('orders')->where('id', '018e4567-e89b-72d3-a456-426614174002')->first(); + expect($updatedOrder->status)->toBe(OrderStatus::VALIDATED->value); +}); diff --git a/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentPickupExceptionRepositoryTest.php b/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentPickupExceptionRepositoryTest.php new file mode 100644 index 00000000..0718e9db --- /dev/null +++ b/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentPickupExceptionRepositoryTest.php @@ -0,0 +1,157 @@ +id(); + $table->string('name')->nullable(); + $table->string('address')->nullable(); + $table->string('postcode')->nullable(); + $table->string('city')->nullable(); + $table->string('phone')->nullable(); + $table->string('latitude')->nullable(); + $table->string('longitude')->nullable(); + $table->boolean('default')->default(false); + $table->timestamps(); + }); + } + + if (! Schema::hasTable('pickup_exceptions')) { + Schema::create('pickup_exceptions', function (Blueprint $table) { + $table->id(); + $table->date('date'); + $table->string('label'); + $table->boolean('repeatable')->default(false); + $table->string('repeat_frequency')->default('Weekly'); + $table->boolean('auto_updated')->default(false); + $table->timestamps(); + }); + } + + if (! Schema::hasTable('shop_pickup_exception')) { + Schema::create('shop_pickup_exception', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('shop_id'); + $table->unsignedBigInteger('pickup_exception_id'); + $table->date('replacement_date')->nullable(); + $table->dateTime('order_deadline_at')->nullable(); + $table->timestamps(); + }); + } + + DB::table('shops')->delete(); + DB::table('pickup_exceptions')->delete(); + DB::table('shop_pickup_exception')->delete(); +}); + +it('retrieves exceptions within a period for a shop', function () { + // GIVEN + $shopUuid = Uuid::uuid7(); + $shop = Shop::forceCreate(['id' => $shopUuid->toString(), 'name' => 'Shop 1', 'postcode' => '75000', 'city' => 'Paris', 'address' => 'Addr']); + + $exUuid = Uuid::uuid7(); + $ex1 = PickupException::forceCreate([ + 'id' => $exUuid->toString(), + 'date' => '2023-01-10', + 'label' => 'Fermé', + 'repeatable' => false, + 'repeat_frequency' => RepeatFrequency::WEEKLY->value, + 'auto_updated' => false, + ]); + + DB::table('shop_pickup_exception')->insert([ + 'shop_id' => $shop->id, + 'pickup_exception_id' => $ex1->id, + 'replacement_date' => '2023-01-11', + 'order_deadline_at' => '2023-01-09 10:00:00', + ]); + + $shopId = new ShopId($shopUuid); + $period = CarbonPeriod::create('2023-01-01', '2023-01-31'); + + $repo = new EloquentPickupExceptionRepository(); + + // WHEN + $result = $repo->getExceptionsForShop($shopId, $period); + + // THEN + expect($result)->toHaveCount(1) + ->and($result[0])->toBeInstanceOf(ShopPickupOverride::class) + ->and($result[0]->exception->id->value->toString())->toBe($exUuid->toString()) + ->and($result[0]->replacementDate?->format('Y-m-d'))->toBe('2023-01-11') + ->and($result[0]->orderDeadlineAt?->format('Y-m-d H:i:s'))->toBe('2023-01-09 10:00:00'); +}); + +it('retrieves all exceptions', function () { + // GIVEN + $exUuid = Uuid::uuid7(); + PickupException::forceCreate([ + 'id' => $exUuid->toString(), + 'date' => '2023-01-10', + 'label' => 'Fermé', + 'repeatable' => false, + 'repeat_frequency' => RepeatFrequency::WEEKLY->value, + 'auto_updated' => false, + ]); + + $repo = new EloquentPickupExceptionRepository(); + + // WHEN + $result = $repo->getAllExceptions(); + + // THEN + expect($result)->toHaveCount(1) + ->and($result[0])->toBeInstanceOf(PickupExceptionOnDate::class) + ->and($result[0]->id->value->toString())->toBe($exUuid->toString()); +}); + +it('retrieves exceptions associated with a shop', function () { + // GIVEN + $shopUuid = Uuid::uuid7(); + $shop = Shop::forceCreate(['id' => $shopUuid->toString(), 'name' => 'Shop 1', 'postcode' => '75000', 'city' => 'Paris', 'address' => 'Addr']); + + $exUuid = Uuid::uuid7(); + $ex1 = PickupException::forceCreate([ + 'id' => $exUuid->toString(), + 'date' => '2023-01-10', + 'label' => 'Fermé', + 'repeatable' => false, + 'repeat_frequency' => RepeatFrequency::WEEKLY->value, + 'auto_updated' => false, + ]); + + DB::table('shop_pickup_exception')->insert([ + 'shop_id' => $shop->id, + 'pickup_exception_id' => $ex1->id, + 'replacement_date' => '2023-01-11', + 'order_deadline_at' => '2023-01-09 10:00:00', + ]); + + $shopId = new ShopId($shopUuid); + + $repo = new EloquentPickupExceptionRepository(); + + // WHEN + $result = $repo->getExceptionsAssociatedWithShop($shopId); + + // THEN + expect($result)->toHaveCount(1) + ->and($result[0])->toBeInstanceOf(ShopPickupOverride::class) + ->and($result[0]->exception->id->value->toString())->toBe($exUuid->toString()) + ->and($result[0]->replacementDate->format('Y-m-d'))->toBe('2023-01-11'); +}); diff --git a/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentProductRepositoryTest.php b/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentProductRepositoryTest.php new file mode 100644 index 00000000..37d35260 --- /dev/null +++ b/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentProductRepositoryTest.php @@ -0,0 +1,141 @@ +id(); + $table->string('name'); + $table->string('slug'); + $table->timestamps(); + }); + } + DB::table('ranges')->insertOrIgnore(['id' => 1, 'name' => 'test', 'slug' => 'test']); + + if (! Schema::hasTable('products')) { + Schema::create('products', function (Blueprint $table) { + $table->uuid('id')->primary(); + $table->string('name'); + $table->integer('tax_rate'); + $table->integer('weight'); + $table->string('brand')->nullable(); + $table->string('order_unit')->nullable(); + $table->string('slug'); + $table->string('picture')->nullable(); + $table->text('description')->nullable(); + $table->boolean('weight_variable')->default(false); + + // Required for toDomain + $table->string('status')->nullable(); + $table->integer('price')->nullable(); + $table->integer('price_kg')->nullable(); + $table->string('origin_country')->nullable(); + $table->text('conservation')->nullable(); + + $table->timestamps(); + }); + } + + DB::table('products')->delete(); +}); + +it('retrieves a basket product', function () { + // GIVEN + $uuid = Uuid::uuid7()->toString(); + $currency = new Currency('EUR'); + + Product::forceCreate([ + 'id' => $uuid, + 'name' => 'Product Name', + 'tax_rate' => 1, + 'weight' => 1000, + 'brand' => 'none', + 'order_unit' => OrderUnit::PCE->value, + 'invoicing_unit' => 'PCE', + 'sell_unit' => 'PCE', + 'range_id' => 1, + 'slug' => 'product-name', + 'picture' => 'pic.jpg', + 'picture_alt' => '', + 'picture_title' => '', + 'picture_large_alt' => '', + 'picture_large_title' => '', + 'description' => 'Desc', + 'weight_variable' => false, + 'status' => 1, + 'price' => new Money(100, $currency), + ]); + + $id = new ProductId(Uuid::fromString($uuid)); + + $repo = new EloquentProductRepository(); + + // WHEN + $result = $repo->getBasketProduct($id, 2); + + // THEN + expect($result)->toBeInstanceOf(BasketProduct::class) + ->and($result->name)->toBe('Product Name') + ->and($result->qty)->toBe(2); +}); + +it('finds a product by id', function () { + // GIVEN + $uuid = Uuid::uuid7()->toString(); + + Product::forceCreate([ + 'id' => $uuid, + 'name' => 'Product Name', + 'tax_rate' => 1, + 'weight' => 1000, + 'brand' => 'none', + 'slug' => 'product-name', + 'invoicing_unit' => 'PCE', + 'sell_unit' => 'PCE', + 'range_id' => 1, + 'picture_alt' => '', + 'picture_title' => '', + 'picture_large_alt' => '', + 'picture_large_title' => '', + 'description' => '', + 'status' => 1, + 'price' => new Money(100, new Currency('EUR')), + ]); + + $id = new ProductId(Uuid::fromString($uuid)); + + $repo = new EloquentProductRepository(); + + // WHEN + $result = $repo->find($id); + + // THEN + expect($result)->toBeInstanceOf(DomainProduct::class); +}); + +it('returns null if product by id is not found', function () { + // GIVEN + $id = new ProductId(Uuid::uuid7()); + + $repo = new EloquentProductRepository(); + + // WHEN + $result = $repo->find($id); + + // THEN + expect($result)->toBeNull(); +}); diff --git a/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentShopRepositoryTest.php b/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentShopRepositoryTest.php new file mode 100644 index 00000000..a3b7d31f --- /dev/null +++ b/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentShopRepositoryTest.php @@ -0,0 +1,236 @@ +id(); + $table->string('name'); + $table->string('address'); + $table->string('postcode'); + $table->string('city'); + $table->string('phone')->nullable(); + $table->string('latitude')->nullable(); + $table->string('longitude')->nullable(); + $table->boolean('default')->default(false); + $table->timestamps(); + }); + } + + if (! Schema::hasTable('shop_employee_exception')) { + Schema::create('shop_employee_exception', function (Blueprint $table) { + $table->id(); + $table->string('matricule'); + $table->unsignedBigInteger('shop_id'); + $table->timestamps(); + }); + } + + if (! Schema::hasTable('shop_employees')) { + Schema::create('shop_employees', function (Blueprint $table) { + $table->id(); + $table->string('site_code'); + $table->string('service_code')->nullable(); + $table->unsignedBigInteger('shop_id'); + $table->timestamps(); + }); + } + + DB::table('shops')->delete(); + DB::table('employees')->delete(); + DB::table('shop_employee_exception')->delete(); + DB::table('shop_employees')->delete(); +}); + +it('finds exception shop for a matricule', function () { + // GIVEN + $shop = Shop::forceCreate([ + 'name' => 'Shop X', + 'address' => 'Addr X', + 'postcode' => '75000', + 'city' => 'Paris', + 'default' => false, + ]); + + Employee::forceCreate([ + 'matricule' => new Matricule('1234567'), + 'nom' => 'Doe', + 'prenom' => 'John', + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'code' => new Code('ABCDEFGH'), + ]); + DB::table('shop_employee_exception')->insert([ + 'matricule' => '1234567', + 'shop_id' => $shop->id, + ]); + + $repo = new EloquentShopRepository(); + + // WHEN + $result = $repo->findExceptionShopFor(new Matricule('1234567')); + + // THEN + expect($result)->not->toBeNull() + ->and($result->id->value->toString())->toBe($shop->id); +}); + +it('returns null if exception shop is not found', function () { + // GIVEN + $repo = new EloquentShopRepository(); + + // WHEN + $result = $repo->findExceptionShopFor(new Matricule('9999999')); + + // THEN + expect($result)->toBeNull(); +}); + +it('finds shop for site and service', function () { + // GIVEN + $shop = Shop::forceCreate([ + 'name' => 'Shop Y', + 'address' => 'Addr Y', + 'postcode' => '75000', + 'city' => 'Paris', + 'default' => false, + ]); + + DB::table('shop_employees')->insert([ + 'site_code' => 'PA', + 'service_code' => '101', + 'shop_id' => $shop->id, + ]); + + $repo = new EloquentShopRepository(); + + // WHEN + $result = $repo->findShopForSiteAndService(new ShopperSiteCode('PA'), new ShopperServiceCode('101')); + + // THEN + expect($result)->not->toBeNull() + ->and($result->id->value->toString())->toBe($shop->id); +}); + +it('finds shop for site and null service', function () { + // GIVEN + $shop = Shop::forceCreate([ + 'name' => 'Shop Z', + 'address' => 'Addr Z', + 'postcode' => '75000', + 'city' => 'Paris', + 'default' => false, + ]); + + DB::table('shop_employees')->insert([ + 'site_code' => 'LY', + 'service_code' => null, + 'shop_id' => $shop->id, + ]); + + $repo = new EloquentShopRepository(); + + // WHEN + $result = $repo->findShopForSiteAndService(new ShopperSiteCode('LY'), null); + + // THEN + expect($result)->not->toBeNull() + ->and($result->id->value->toString())->toBe($shop->id); +}); + +it('returns null if shop for site and service is not found', function () { + // GIVEN + $repo = new EloquentShopRepository(); + + // WHEN + $result = $repo->findShopForSiteAndService(new ShopperSiteCode('ZZ'), new ShopperServiceCode('999')); + + // THEN + expect($result)->toBeNull(); +}); + +it('finds shop by id', function () { + // GIVEN + $shop = Shop::forceCreate([ + 'name' => 'Shop 1', + 'address' => 'Addr 1', + 'postcode' => '75000', + 'city' => 'Paris', + 'default' => false, + ]); + + $repo = new EloquentShopRepository(); + + // WHEN + $result = $repo->find(new ShopId(Uuid::fromString($shop->id))); + + // THEN + expect($result)->not->toBeNull() + ->and($result->id->value->toString())->toBe($shop->id); +}); + +it('returns null if shop by id is not found', function () { + // GIVEN + $repo = new EloquentShopRepository(); + + // WHEN + $result = $repo->find(new ShopId(Uuid::uuid7())); + + // THEN + expect($result)->toBeNull(); +}); + +it('retrieves default shop', function () { + // GIVEN + Shop::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'name' => 'Shop 1', + 'address' => 'Addr 1', + 'postcode' => '75000', + 'city' => 'Paris', + 'default' => false, + ]); + $defaultShop = Shop::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'name' => 'Shop Default', + 'address' => 'Addr Default', + 'postcode' => '75000', + 'city' => 'Paris', + 'default' => true, + ]); + + $repo = new EloquentShopRepository(); + + // WHEN + $result = $repo->getDefaultShop(); + + // THEN + expect($result->id->value->toString())->toBe($defaultShop->id); +}); + +it('throws exception if default shop is not found', function () { + // GIVEN + $repo = new EloquentShopRepository(); + + // WHEN + $action = fn () => $repo->getDefaultShop(); + + // THEN + expect($action)->toThrow(ModelNotFoundException::class); +}); diff --git a/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentShopperRepositoryTest.php b/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentShopperRepositoryTest.php new file mode 100644 index 00000000..a13bb24c --- /dev/null +++ b/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentShopperRepositoryTest.php @@ -0,0 +1,149 @@ +uuid('id')->primary(); + $table->string('email'); + $table->string('hashcode')->nullable(); + $table->timestamps(); + }); + } + + if (! Schema::hasTable('employees')) { + Schema::create('employees', function (Blueprint $table) { + $table->id(); + $table->uuid('customer_id')->nullable(); + $table->string('matricule'); + $table->string('nom')->nullable(); + $table->string('prenom')->nullable(); + $table->date('start_date')->nullable(); + $table->date('end_date')->nullable(); + $table->string('etablissement')->nullable(); + $table->string('site')->nullable(); + $table->string('service')->nullable(); + $table->timestamps(); + }); + } + + DB::table('customers')->delete(); + DB::table('employees')->delete(); +}); + +it('retrieves shopper by id', function () { + // GIVEN + $uuid = Uuid::uuid7()->toString(); + + Customer::forceCreate([ + 'id' => $uuid, + 'email' => new Email('test@example.com'), + 'hashcode' => Uuid::uuid4()->toString(), + ]); + + Employee::forceCreate([ + 'customer_id' => $uuid, + 'matricule' => new Matricule('1234567'), + 'nom' => 'Doe', + 'prenom' => 'John', + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'code' => new Code('ABCDEFGH'), + ]); + + $repo = new EloquentShopperRepository(); + + // WHEN + $result = $repo->find(new ShopperId(Uuid::fromString($uuid))); + + // THEN + expect($result)->toBeInstanceOf(Shopper::class) + ->and($result->email->value)->toBe('test@example.com'); +}); + +it('returns null if shopper not found by id', function () { + // GIVEN + $repo = new EloquentShopperRepository(); + + // WHEN + $result = $repo->find(new ShopperId(Uuid::uuid7())); + + // THEN + expect($result)->toBeNull(); +}); + +it('returns null if customer exists but has no employee', function () { + // GIVEN + $uuid = Uuid::uuid7()->toString(); + + Customer::forceCreate([ + 'id' => $uuid, + 'email' => new Email('test@example.com'), + 'hashcode' => Uuid::uuid4()->toString(), + ]); + + $repo = new EloquentShopperRepository(); + + // WHEN + $result = $repo->find(new ShopperId(Uuid::fromString($uuid))); + + // THEN + expect($result)->toBeNull(); +}); + +it('retrieves shopper by id or fails', function () { + // GIVEN + $uuid = Uuid::uuid7()->toString(); + + Customer::forceCreate([ + 'id' => $uuid, + 'email' => new Email('test@example.com'), + 'hashcode' => Uuid::uuid4()->toString(), + ]); + + Employee::forceCreate([ + 'customer_id' => $uuid, + 'matricule' => new Matricule('1234569'), + 'nom' => 'Doe', + 'prenom' => 'John', + 'etablissement' => 'ETAB', + 'site' => 'SITE', + 'service' => '101', + 'code' => new Code('ABCDEFGH'), + ]); + + $repo = new EloquentShopperRepository(); + + // WHEN + $result = $repo->getByIdOrFail(new ShopperId(Uuid::fromString($uuid))); + + // THEN + expect($result)->toBeInstanceOf(Shopper::class); +}); + +it('throws exception if shopper not found in getByIdOrFail', function () { + // GIVEN + $repo = new EloquentShopperRepository(); + $id = Uuid::uuid7(); + + // WHEN + $action = fn () => $repo->getByIdOrFail(new ShopperId($id)); + + // THEN + expect($action)->toThrow(\DomainException::class, "Shopper with id '{$id->toString()}' not found or is not linked to any employee."); +}); diff --git a/tests/Integration/WithApp/Infra/Adapters/Services/EloquentEmployeeImportStorageServiceTest.php b/tests/Integration/WithApp/Infra/Adapters/Services/EloquentEmployeeImportStorageServiceTest.php new file mode 100644 index 00000000..ee8fa769 --- /dev/null +++ b/tests/Integration/WithApp/Infra/Adapters/Services/EloquentEmployeeImportStorageServiceTest.php @@ -0,0 +1,117 @@ +id(); + $table->string('matricule')->unique(); + $table->string('nom')->nullable(); + $table->string('prenom')->nullable(); + $table->string('etablissement')->nullable(); + $table->string('service')->nullable(); + $table->string('site')->nullable(); + $table->string('start_date')->nullable(); + $table->string('end_date')->nullable(); + $table->timestamps(); + }); + } + Employee::query()->delete(); +}); + +it('upserts a large batch of employees in chunks', function () { + // GIVEN + $upsertData = []; + for ($k = 0; $k < 2500; $k++) { + $upsertData[] = new EmployeeUpsertData( + matricule: new Matricule(str_pad((string) $k, 7, '0', STR_PAD_LEFT)), + firstname: 'Prenom', + lastname: 'Nom', + etablissement: new ShopperEstablishmentCode('ETAB'), + service: new ShopperServiceCode('101'), + site: new ShopperSiteCode('SITE'), + startDate: CarbonImmutable::parse('2023-01-01'), + endDate: null, + code: new Code(str_replace('0', 'A', (string) (11111111 + $k))) + ); + } + + $repo = new EloquentEmployeeImportStorageService(); + + // WHEN + $repo->upsertEmployees($upsertData); + + // THEN + expect(Employee::query()->count())->toBe(2500); +}); + +it('retrieves correct import statistics based on a start time', function () { + // GIVEN + $importStartTime = CarbonImmutable::parse('2023-01-01 12:00:00'); + + // Inserted after + Employee::forceCreate([ + 'matricule' => new Matricule('1234567'), + 'nom' => 'Nom', + 'prenom' => 'Prenom', + 'etablissement' => 'ETAB', + 'service' => '101', + 'site' => 'SITE', + 'start_date' => '2023-01-01', + 'code' => new Code('CADE1234'), + 'created_at' => CarbonImmutable::parse('2023-01-01 12:05:00'), + 'updated_at' => CarbonImmutable::parse('2023-01-01 12:05:00'), + ]); + + // Updated after + Employee::forceCreate([ + 'matricule' => new Matricule('1234568'), + 'nom' => 'N', + 'prenom' => 'P', + 'etablissement' => 'ETAB', + 'service' => '101', + 'site' => 'SITE', + 'start_date' => '2023-01-01', + 'code' => new Code('CADE1235'), + 'created_at' => CarbonImmutable::parse('2022-01-01 12:00:00'), + 'updated_at' => CarbonImmutable::parse('2023-01-01 12:05:00'), + ]); + + // Not updated after + Employee::forceCreate([ + 'matricule' => new Matricule('1234569'), + 'nom' => 'N', + 'prenom' => 'P', + 'etablissement' => 'ETAB', + 'service' => '101', + 'site' => 'SITE', + 'start_date' => '2023-01-01', + 'code' => new Code('CADE1236'), + 'created_at' => CarbonImmutable::parse('2022-01-01 12:00:00'), + 'updated_at' => CarbonImmutable::parse('2022-01-01 12:00:00'), + ]); + $repo = new EloquentEmployeeImportStorageService(); + + // WHEN + $result = $repo->getImportedAfter(['1234567', '1234568', '1234569'], $importStartTime); + + // THEN + expect($result->insertedCount)->toBe(1) + ->and($result->updatedCount)->toBe(1) + ->and($result->matriculesInserted)->toHaveCount(3); +}); diff --git a/tests/Integration/WithApp/Infra/Adapters/Services/EloquentEmployeeStatisticsServiceTest.php b/tests/Integration/WithApp/Infra/Adapters/Services/EloquentEmployeeStatisticsServiceTest.php new file mode 100644 index 00000000..88483682 --- /dev/null +++ b/tests/Integration/WithApp/Infra/Adapters/Services/EloquentEmployeeStatisticsServiceTest.php @@ -0,0 +1,65 @@ +string('id')->primary(); + $table->unsignedBigInteger('shop_id'); + $table->string('reference'); + $table->json('employee'); + $table->json('delivery_address'); + $table->date('pickup_day'); + $table->string('status'); + $table->integer('total'); + $table->string('employee_matricule')->nullable(); + $table->timestamps(); + }); + } + + DB::table('orders')->delete(); +}); + +it('retrieves the weekly order total for a given employee', function () { + // GIVEN + DB::table('shops')->insertOrIgnore(['id' => 1, 'name' => 'Shop 1', 'postcode' => '75000', 'city' => 'Paris', 'address' => 'Addr']); + + DB::table('orders')->insert([ + 'id' => '018e4567-e89b-72d3-a456-426614174000', + 'shop_id' => 1, + 'reference' => Uuid::uuid7()->toString(), + 'employee' => json_encode([ + 'matricule' => '1234567', + 'firstname' => 'Jean', + 'lastname' => 'Dupont', + 'facility' => 'Main Facility', + 'site' => 'HQ', + 'service' => 'IT', + ]), + 'delivery_address' => '{}', + 'pickup_day' => '2023-01-05', + 'status' => OrderStatus::VALIDATED->value, + 'total' => 1500, // 15.00 EUR + ]); + + $service = new EloquentEmployeeStatisticsService(); + $start = CarbonImmutable::parse('2023-01-01'); + $end = CarbonImmutable::parse('2023-01-07'); + + // WHEN + $result = $service->getWeeklyTotalForEmployee(new Matricule('1234567'), $start, $end); + + // THEN + expect($result->getAmount())->toBe('1500') + ->and($result->getCurrency()->getCode())->toBe('EUR'); +}); diff --git a/tests/Integration/WithApp/Infra/Adapters/Services/LaravelTransactionManagerTest.php b/tests/Integration/WithApp/Infra/Adapters/Services/LaravelTransactionManagerTest.php new file mode 100644 index 00000000..7d720c0a --- /dev/null +++ b/tests/Integration/WithApp/Infra/Adapters/Services/LaravelTransactionManagerTest.php @@ -0,0 +1,22 @@ +once()->andReturnUsing(function ($callback) { + return $callback(); + }); + $manager = new LaravelTransactionManager(); + + // WHEN + $result = $manager->execute(function () { + return 'success'; + }); + + // THEN + expect($result)->toBe('success'); +}); diff --git a/tests/Integration/WithApp/Infra/Repositories/SessionBasketRepositoryTest.php b/tests/Integration/WithApp/Infra/Repositories/SessionBasketRepositoryTest.php new file mode 100644 index 00000000..93e3914b --- /dev/null +++ b/tests/Integration/WithApp/Infra/Repositories/SessionBasketRepositoryTest.php @@ -0,0 +1,128 @@ +find($basketId); + + // THEN + expect($basket)->toBeNull(); + }); + + it('can save a basket into the session and retrieve it identically', function (BasketProduct $product) { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $basket = new Basket($basketId, [$product->id->value->toString() => $product]); + $repository = getRepository(); + + // WHEN + $repository->persist($basket); + $retrievedBasket = $repository->find($basketId); + + // THEN + expect($retrievedBasket)->toBeInstanceOf(Basket::class) + ->and($retrievedBasket->id->value->toString())->toBe($basketId->value->toString()) + ->and($retrievedBasket->items())->toHaveCount(1); + + $retrievedProduct = $retrievedBasket->items()[$product->id->value->toString()]; + + expect($retrievedProduct)->toBeInstanceOf(BasketProduct::class) + ->and($retrievedProduct->name)->toBe($product->name) + ->and($retrievedProduct->qty)->toBe($product->qty) + ->and($retrievedProduct->unitPriceHt->getAmount())->toBe($product->unitPriceHt->getAmount()) + ->and($retrievedProduct->unitDiscount->getAmount())->toBe($product->unitDiscount->getAmount()) + ->and($retrievedProduct->taxRate->value)->toBe($product->taxRate->value) + ->and($retrievedProduct->weightGrams)->toBe($product->weightGrams) + ->and($retrievedProduct->brand?->value)->toBe($product->brand?->value) + ->and($retrievedProduct->incoId?->value)->toBe($product->incoId?->value) + ->and($retrievedProduct->orderUnit->value)->toBe($product->orderUnit->value) + ->and($retrievedProduct->slug)->toBe($product->slug) + ->and($retrievedProduct->picture)->toBe($product->picture) + ->and($retrievedProduct->description)->toBe($product->description) + ->and($retrievedProduct->weightVariable)->toBe($product->weightVariable) + ->and($retrievedProduct->discountRate->basisPoints())->toBe($product->discountRate->basisPoints()) + ->and($retrievedProduct->priceKgTtc->getAmount())->toBe($product->priceKgTtc->getAmount()) + ->and($retrievedProduct->options)->toBe($product->options); + })->with([ + 'Full product' => fn () => new BasketProduct( + id: new ProductId(Uuid::uuid7()), + name: 'Poulet Rôti', + qty: 2, + unitPriceHt: new Money(1200, new Currency('EUR')), + unitDiscount: new Money(100, new Currency('EUR')), + taxRate: TaxRate::from(2), // 5.5% + weightGrams: 1200, + brand: ProductBrand::from('loue'), + incoId: new IncoId(456789), + orderUnit: OrderUnit::from('KGM'), + slug: 'poulet-roti', + picture: 'poulet.jpg', + description: 'Un bon poulet', + weightVariable: true, + discountRate: DiscountRate::fromRatio(0.05), + priceKgTtc: new Money(1500, new Currency('EUR')), + options: ['cut' => 'halves'] + ), + 'Minimal product without optional fields' => fn () => new BasketProduct( + id: new ProductId(Uuid::uuid7()), + name: 'Pâtes', + qty: 1, + unitPriceHt: new Money(200, new Currency('EUR')), + unitDiscount: new Money(0, new Currency('EUR')), + taxRate: TaxRate::from(1), // 20% + weightGrams: 500, + brand: null, + incoId: null, + orderUnit: OrderUnit::from('PCE'), + slug: 'pates-500g', + picture: null, + description: null, + weightVariable: false, + discountRate: DiscountRate::fromRatio(0.0), + priceKgTtc: new Money(400, new Currency('EUR')), + options: [] + ), + ]); + + it('can destroy the basket from the session', function () { + // GIVEN + $repository = getRepository(); + $basketId = new BasketId(Uuid::uuid7()); + $basket = new Basket($basketId, []); + $repository->persist($basket); + + // WHEN + $repository->delete($basket); + $retrievedBasket = $repository->find($basketId); + + // THEN + expect($retrievedBasket)->toBeNull(); + }); +}); diff --git a/tests/Pest.php b/tests/Pest.php new file mode 100644 index 00000000..b27afdfe --- /dev/null +++ b/tests/Pest.php @@ -0,0 +1,41 @@ +extend(LaravelTestCase::class) + ->use(RefreshDatabase::class) + ->beforeEach(function (): void { + Http::preventStrayRequests(); + }) + ->in('Feature'); + +pest() + ->extend(LaravelTestCase::class) + ->use(RefreshDatabase::class) + ->in('Integration/WithApp'); + +pest() + ->extend(BasePHPUnitTestCase::class) + ->in('Integration/Standalones'); + +pest() + ->extend(BasePHPUnitTestCase::class) + ->in('Unit'); +pest()->extend(LaravelTestCase::class)->in('Unit/App/Casts'); +pest()->extend(LaravelTestCase::class)->in('Unit/Services'); diff --git a/tests/TestCase.php b/tests/TestCase.php index 2932d4a6..7de55c2f 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,10 +1,57 @@ mockCrmTransport(); + } + + private function mockCrmTransport(): void + { + $apiInterface = Mockery::mock(ApiInterface::class); + $apiInterface->shouldReceive('call')->byDefault()->andReturn( + new CrmResponse( + ApiStatus::OK, + new GuzzleResponse(200, [], (string) json_encode([ + 'version' => Utils::getPackageInfo()['version'], + 'data' => [], + ])) + ) + ); + + $refClientModel = new \ReflectionProperty(ClientModel::class, 'apiInterface'); + $refClientModel->setValue(null, $apiInterface); + + $refCrmApi = new \ReflectionProperty(CrmApiV4::class, 'apiInterface'); + $refCrmApi->setValue(null, $apiInterface); + } + + /** + * Create and bind a mock CrmService to the container to ensure no real CRM calls are made in tests. + */ + protected function mockCrmService(): CrmService + { + return $this->mock(CrmService::class); + } } diff --git a/tests/Unit/App/Actions/Common/ChangeModelOrderInputTest.php b/tests/Unit/App/Actions/Common/ChangeModelOrderInputTest.php new file mode 100644 index 00000000..529b7b61 --- /dev/null +++ b/tests/Unit/App/Actions/Common/ChangeModelOrderInputTest.php @@ -0,0 +1,31 @@ +model)->toBe($mock) + ->and($input->direction)->toBe(\SortDirection::Ascending); + }); +}); diff --git a/tests/Unit/App/Actions/Common/ChangeModelOrderPositionInputTest.php b/tests/Unit/App/Actions/Common/ChangeModelOrderPositionInputTest.php new file mode 100644 index 00000000..ed3aadf2 --- /dev/null +++ b/tests/Unit/App/Actions/Common/ChangeModelOrderPositionInputTest.php @@ -0,0 +1,50 @@ +model)->toBe($mock) + ->and($input->targetOrder)->toBe(5); + }); + + it('throws when target order is less than 1', function (): void { + // GIVEN + $mock = new class () extends Model implements ModelWithOrder + { + public function getOrder(): int + { + return 1; + } + + public function setOrder(int $order): void + { + } + }; + + // WHEN & THEN + expect(fn () => new ChangeModelOrderPositionInput(model: $mock, targetOrder: 0)) + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Unit/App/Actions/Common/ExecuteMassActionInputTest.php b/tests/Unit/App/Actions/Common/ExecuteMassActionInputTest.php new file mode 100644 index 00000000..f5dab1ab --- /dev/null +++ b/tests/Unit/App/Actions/Common/ExecuteMassActionInputTest.php @@ -0,0 +1,47 @@ +modelClass)->toBe($modelClass) + ->and($input->action)->toBe(MassActionType::Publish) + ->and($input->modelKeyList)->toBe([1, 2, 3]); + }); + + it('rejects a non-Eloquent model class', function (): void { + // GIVEN + $invalidModelClass = \stdClass::class; + + // WHEN & THEN + expect(fn () => new ExecuteMassActionInput( + modelClass: $invalidModelClass, + action: MassActionType::Star, + modelKeyList: [1], + ))->toThrow(\InvalidArgumentException::class); + }); + + it('rejects an empty model key list', function (): void { + // WHEN & THEN + expect(fn () => new ExecuteMassActionInput( + modelClass: Product::class, + action: MassActionType::Unstar, + modelKeyList: [], + ))->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Unit/App/Actions/Common/ToggleModelStarInputTest.php b/tests/Unit/App/Actions/Common/ToggleModelStarInputTest.php new file mode 100644 index 00000000..5bfdc681 --- /dev/null +++ b/tests/Unit/App/Actions/Common/ToggleModelStarInputTest.php @@ -0,0 +1,29 @@ +model)->toBe($mock); + }); +}); diff --git a/tests/Unit/App/Actions/Common/ToggleModelStatusInputTest.php b/tests/Unit/App/Actions/Common/ToggleModelStatusInputTest.php new file mode 100644 index 00000000..c7535aff --- /dev/null +++ b/tests/Unit/App/Actions/Common/ToggleModelStatusInputTest.php @@ -0,0 +1,29 @@ +model)->toBe($mock); + }); +}); diff --git a/tests/Unit/App/Actions/Customers/RegisterCustomerInputTest.php b/tests/Unit/App/Actions/Customers/RegisterCustomerInputTest.php new file mode 100644 index 00000000..b031465a --- /dev/null +++ b/tests/Unit/App/Actions/Customers/RegisterCustomerInputTest.php @@ -0,0 +1,148 @@ +matricule)->toBe($matricule) + ->and($input->code)->toBe($code) + ->and($input->firstname)->toBe('John') + ->and($input->lastname)->toBe('Doe') + ->and($input->email)->toBe($email) + ->and($input->password)->toBe('secretPassword123!') + ->and($input->birthDate)->toBe($birthDate) + ->and($input->phone)->toBe($phone) + ->and($input->address)->toBe('10 rue de Paris') + ->and($input->postcode)->toBe('75001') + ->and($input->city)->toBe('Paris') + ->and($input->optIn)->toBeTrue(); + }); + + it('creates a valid instance with nullable fields as null', function () { + // GIVEN + $matricule = new Matricule('1234567'); + $code = new Code('ABCDEF'); + $email = new Email('jane.doe@example.com'); + $birthDate = new \DateTimeImmutable('1995-05-15'); + + // WHEN + $input = new RegisterCustomerInput( + matricule: $matricule, + code: $code, + firstname: 'Jane', + lastname: 'Doe', + email: $email, + password: 'secretPassword123!', + birthDate: $birthDate, + phone: null, + address: null, + postcode: '75001', + city: 'Paris', + optIn: false + ); + + // THEN + expect($input->phone)->toBeNull() + ->and($input->address)->toBeNull() + ->and($input->optIn)->toBeFalse(); + }); + + it('throws when firstname is empty', function () { + // GIVEN + $matricule = new Matricule('1234567'); + $code = new Code('ABCDEF'); + $email = new Email('jane.doe@example.com'); + $birthDate = new \DateTimeImmutable('1995-05-15'); + + // WHEN & THEN + expect(fn () => new RegisterCustomerInput( + matricule: $matricule, + code: $code, + firstname: ' ', + lastname: 'Doe', + email: $email, + password: 'secretPassword123!', + birthDate: $birthDate, + phone: null, + address: null, + postcode: '75001', + city: 'Paris' + ))->toThrow(\InvalidArgumentException::class); + }); + + it('throws when lastname is empty', function () { + // GIVEN + $matricule = new Matricule('1234567'); + $code = new Code('ABCDEF'); + $email = new Email('jane.doe@example.com'); + $birthDate = new \DateTimeImmutable('1995-05-15'); + + // WHEN & THEN + expect(fn () => new RegisterCustomerInput( + matricule: $matricule, + code: $code, + firstname: 'Jane', + lastname: '', + email: $email, + password: 'secretPassword123!', + birthDate: $birthDate, + phone: null, + address: null, + postcode: '75001', + city: 'Paris' + ))->toThrow(\InvalidArgumentException::class); + }); + + it('throws when postcode is empty', function () { + // GIVEN + $matricule = new Matricule('1234567'); + $code = new Code('ABCDEF'); + $email = new Email('jane.doe@example.com'); + $birthDate = new \DateTimeImmutable('1995-05-15'); + + // WHEN & THEN + expect(fn () => new RegisterCustomerInput( + matricule: $matricule, + code: $code, + firstname: 'Jane', + lastname: 'Doe', + email: $email, + password: 'secretPassword123!', + birthDate: $birthDate, + phone: null, + address: null, + postcode: ' ', + city: 'Paris' + ))->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Unit/App/Actions/Discounts/CreateDiscountInputTest.php b/tests/Unit/App/Actions/Discounts/CreateDiscountInputTest.php new file mode 100644 index 00000000..6456490b --- /dev/null +++ b/tests/Unit/App/Actions/Discounts/CreateDiscountInputTest.php @@ -0,0 +1,87 @@ +type)->toBe(DiscountType::PERCENT) + ->and($input->value)->toBe($value) + ->and($input->is_old_price_displayed)->toBeTrue() + ->and($input->period)->toBe($period) + ->and($input->associatedProductsIds)->toBe(['018f-product-1', '018f-product-2']); + }); + + it('creates a valid CreateDiscountInput instance with amount', function (): void { + // GIVEN + $type = DiscountType::AMOUNT; + $value = DiscountValue::fromAmount(new Money(500, new Currency('EUR'))); + + // WHEN + $input = new CreateDiscountInput( + type: $type, + value: $value, + is_old_price_displayed: false, + ); + + // THEN + expect($input->type)->toBe(DiscountType::AMOUNT) + ->and($input->value)->toBe($value) + ->and($input->is_old_price_displayed)->toBeFalse() + ->and($input->associatedProductsIds)->toBeEmpty(); + }); + + it('throws when discount value type does not match discount type', function (): void { + // GIVEN + $type = DiscountType::PERCENT; + $value = DiscountValue::fromAmount(new Money(500, new Currency('EUR'))); + + // WHEN + expect(fn () => new CreateDiscountInput( + type: $type, + value: $value, + is_old_price_displayed: true, + )) + // THEN + ->toThrow(\InvalidArgumentException::class, 'The discount value type must match the discount type.'); + }); + + it('throws when associatedProductsIds contains non-string items', function (): void { + // GIVEN + $type = DiscountType::PERCENT; + $value = DiscountValue::fromPercentage(10); + + // WHEN + expect(fn () => new CreateDiscountInput( + type: $type, + value: $value, + is_old_price_displayed: true, + associatedProductsIds: [123], // @phpstan-ignore argument.type + )) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Unit/App/Actions/Discounts/DeleteDiscountInputTest.php b/tests/Unit/App/Actions/Discounts/DeleteDiscountInputTest.php new file mode 100644 index 00000000..a7572f0a --- /dev/null +++ b/tests/Unit/App/Actions/Discounts/DeleteDiscountInputTest.php @@ -0,0 +1,21 @@ +discount)->toBe($discount); + }); +}); diff --git a/tests/Unit/App/Actions/Discounts/UpdateDiscountInputTest.php b/tests/Unit/App/Actions/Discounts/UpdateDiscountInputTest.php new file mode 100644 index 00000000..0cfb6731 --- /dev/null +++ b/tests/Unit/App/Actions/Discounts/UpdateDiscountInputTest.php @@ -0,0 +1,97 @@ +discount)->toBe($discount) + ->and($input->type)->toBe(DiscountType::PERCENT) + ->and($input->value)->toBe($value) + ->and($input->is_old_price_displayed)->toBeTrue() + ->and($input->period)->toBe($period) + ->and($input->associatedProductsIds)->toBe(['prod-1', 'prod-2']); + }); + + it('creates a valid UpdateDiscountInput instance with amount', function (): void { + // GIVEN + $discount = new Discount(); + $type = DiscountType::AMOUNT; + $value = DiscountValue::fromAmount(new Money(1500, new Currency('EUR'))); + + // WHEN + $input = new UpdateDiscountInput( + discount: $discount, + type: $type, + value: $value, + is_old_price_displayed: false, + ); + + // THEN + expect($input->type)->toBe(DiscountType::AMOUNT) + ->and($input->value)->toBe($value) + ->and($input->is_old_price_displayed)->toBeFalse() + ->and($input->associatedProductsIds)->toBeEmpty(); + }); + + it('throws when discount value type does not match discount type', function (): void { + // GIVEN + $discount = new Discount(); + $type = DiscountType::AMOUNT; + $value = DiscountValue::fromPercentage(15); + + // WHEN + expect(fn () => new UpdateDiscountInput( + discount: $discount, + type: $type, + value: $value, + is_old_price_displayed: true, + )) + // THEN + ->toThrow(\InvalidArgumentException::class, 'The discount value type must match the discount type.'); + }); + + it('throws when associatedProductsIds contains non-string items', function (): void { + // GIVEN + $discount = new Discount(); + $type = DiscountType::PERCENT; + $value = DiscountValue::fromPercentage(10); + + // WHEN + expect(fn () => new UpdateDiscountInput( + discount: $discount, + type: $type, + value: $value, + is_old_price_displayed: true, + associatedProductsIds: [123], // @phpstan-ignore argument.type + )) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Unit/App/Actions/Faqs/CreateFaqInputTest.php b/tests/Unit/App/Actions/Faqs/CreateFaqInputTest.php new file mode 100644 index 00000000..d513a29b --- /dev/null +++ b/tests/Unit/App/Actions/Faqs/CreateFaqInputTest.php @@ -0,0 +1,53 @@ +question)->toBe($question) + ->and($input->answer)->toBe($answer); + }); +}); + +describe('CreateFaqInput validation rules', function (): void { + it('throws when question is empty or too short', function (string $invalidQuestion): void { + // GIVEN + $answer = 'Une réponse valide.'; + + // WHEN + expect(fn () => new CreateFaqInput(question: $invalidQuestion, answer: $answer)) + // THEN + ->toThrow(\InvalidArgumentException::class); + })->with(['', ' ', 'abc']); + + it('throws when question exceeds 255 characters', function (): void { + // GIVEN + $question = str_repeat('a', 256); + $answer = 'Une réponse valide.'; + + // WHEN + expect(fn () => new CreateFaqInput(question: $question, answer: $answer)) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); + + it('throws when answer is empty or too short', function (string $invalidAnswer): void { + // GIVEN + $question = 'Une question valide ?'; + + // WHEN + expect(fn () => new CreateFaqInput(question: $question, answer: $invalidAnswer)) + // THEN + ->toThrow(\InvalidArgumentException::class); + })->with(['', ' ', 'abc']); +}); diff --git a/tests/Unit/App/Actions/Faqs/DeleteFaqInputTest.php b/tests/Unit/App/Actions/Faqs/DeleteFaqInputTest.php new file mode 100644 index 00000000..2da29d69 --- /dev/null +++ b/tests/Unit/App/Actions/Faqs/DeleteFaqInputTest.php @@ -0,0 +1,19 @@ +faq)->toBe($faq); + }); +}); diff --git a/tests/Unit/App/Actions/Faqs/UpdateFaqInputTest.php b/tests/Unit/App/Actions/Faqs/UpdateFaqInputTest.php new file mode 100644 index 00000000..9d805fce --- /dev/null +++ b/tests/Unit/App/Actions/Faqs/UpdateFaqInputTest.php @@ -0,0 +1,59 @@ +faq)->toBe($faq) + ->and($input->question)->toBe($question) + ->and($input->answer)->toBe($answer); + }); +}); + +describe('UpdateFaqInput validation rules', function (): void { + it('throws when question is empty or too short', function (string $invalidQuestion): void { + // GIVEN + $faq = new Faq(); + $answer = 'Une réponse valide.'; + + // WHEN + expect(fn () => new UpdateFaqInput(faq: $faq, question: $invalidQuestion, answer: $answer)) + // THEN + ->toThrow(\InvalidArgumentException::class); + })->with(['', ' ', 'abc']); + + it('throws when question exceeds 255 characters', function (): void { + // GIVEN + $faq = new Faq(); + $question = str_repeat('a', 256); + $answer = 'Une réponse valide.'; + + // WHEN + expect(fn () => new UpdateFaqInput(faq: $faq, question: $question, answer: $answer)) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); + + it('throws when answer is empty or too short', function (string $invalidAnswer): void { + // GIVEN + $faq = new Faq(); + $question = 'Une question valide ?'; + + // WHEN + expect(fn () => new UpdateFaqInput(faq: $faq, question: $question, answer: $invalidAnswer)) + // THEN + ->toThrow(\InvalidArgumentException::class); + })->with(['', ' ', 'abc']); +}); diff --git a/tests/Unit/App/Actions/Orders/ApplyPickTimeSlotInputTest.php b/tests/Unit/App/Actions/Orders/ApplyPickTimeSlotInputTest.php new file mode 100644 index 00000000..dc6f4e30 --- /dev/null +++ b/tests/Unit/App/Actions/Orders/ApplyPickTimeSlotInputTest.php @@ -0,0 +1,26 @@ +shopperId)->toBe($shopperId) + ->and($input->timeslot)->toBe($timeslot); + }); +}); diff --git a/tests/Unit/App/Actions/Orders/ApplyPickTimeSlotTest.php b/tests/Unit/App/Actions/Orders/ApplyPickTimeSlotTest.php new file mode 100644 index 00000000..371c4f58 --- /dev/null +++ b/tests/Unit/App/Actions/Orders/ApplyPickTimeSlotTest.php @@ -0,0 +1,62 @@ +shouldReceive('getBuilderFromBasketOrFail') + ->once() + ->andReturn($builder); + $orderTunnelService->shouldReceive('getShopForCustomer') + ->once() + ->with($shopperId) + ->andReturn($shop); + $orderTunnelService->shouldReceive('getAvailableTimeSlots') + ->once() + ->with($shop) + ->andReturn($timeSlots); + $orderTunnelService->shouldReceive('applyTimeSlot') + ->once() + ->with($builder, $shop, $timeslot, $timeSlots) + ->andReturn($slot); + + $action = new ApplyPickTimeSlot($orderTunnelService); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBe($slot); + }); +}); diff --git a/tests/Unit/App/Actions/Orders/FinalizeOrderInputTest.php b/tests/Unit/App/Actions/Orders/FinalizeOrderInputTest.php new file mode 100644 index 00000000..f3341781 --- /dev/null +++ b/tests/Unit/App/Actions/Orders/FinalizeOrderInputTest.php @@ -0,0 +1,28 @@ +shopperId)->toBeNull(); + }); + + it('can be instantiated with valid shopperId', function (): void { + // GIVEN + $shopperId = new ShopperId(Uuid::uuid7()); + + // WHEN + $input = new FinalizeOrderInput(shopperId: $shopperId); + + // THEN + expect($input->shopperId)->toBe($shopperId); + }); +}); diff --git a/tests/Unit/App/Actions/Orders/FinalizeOrderTest.php b/tests/Unit/App/Actions/Orders/FinalizeOrderTest.php new file mode 100644 index 00000000..6e3cb009 --- /dev/null +++ b/tests/Unit/App/Actions/Orders/FinalizeOrderTest.php @@ -0,0 +1,73 @@ +shouldReceive('getBuilderCompletedOrFail') + ->once() + ->andReturn($builder); + $orderTunnelService->shouldReceive('finalizeOrder') + ->once() + ->with($builder) + ->andReturn($order); + + $action = new FinalizeOrder($orderTunnelService); + + // WHEN + $result = $action($input); + + // THEN + expect($result)->toBeInstanceOf(OrderReference::class) + ->and($result->value)->toBe($orderReference->value); + }); +}); diff --git a/tests/Unit/App/Actions/Orders/InitializeOrderTunnelInputTest.php b/tests/Unit/App/Actions/Orders/InitializeOrderTunnelInputTest.php new file mode 100644 index 00000000..88a00f54 --- /dev/null +++ b/tests/Unit/App/Actions/Orders/InitializeOrderTunnelInputTest.php @@ -0,0 +1,27 @@ +basket)->toBe($basket) + ->and($input->shopperId)->toBe($shopperId); + }); +}); diff --git a/tests/Unit/App/Actions/Orders/InitializeOrderTunnelTest.php b/tests/Unit/App/Actions/Orders/InitializeOrderTunnelTest.php new file mode 100644 index 00000000..3ebc0cde --- /dev/null +++ b/tests/Unit/App/Actions/Orders/InitializeOrderTunnelTest.php @@ -0,0 +1,36 @@ +shouldReceive('initializeFromBasket') + ->once() + ->with($basket, $shopperId); + + $action = new InitializeOrderTunnel($orderTunnelService); + + // WHEN + $action($input); + + // THEN + expect(true)->toBeTrue(); + }); +}); diff --git a/tests/Unit/App/Actions/Pages/UpdatePageInputTest.php b/tests/Unit/App/Actions/Pages/UpdatePageInputTest.php new file mode 100644 index 00000000..73b8c8b3 --- /dev/null +++ b/tests/Unit/App/Actions/Pages/UpdatePageInputTest.php @@ -0,0 +1,98 @@ +Contenu HTML de la page

'; + + // WHEN + $input = new UpdatePageInput( + page: $page, + seo: $seo, + title: $title, + content: $content, + ); + + // THEN + expect($input->page)->toBe($page) + ->and($input->seo)->toBe($seo) + ->and($input->title)->toBe($title) + ->and($input->content)->toBe($content); + }); + + it('allows null title', function (): void { + // GIVEN + $page = new Page(); + $seo = new SeoMetadata('Titre SEO valide', 'Description SEO valide'); + $content = '

Contenu HTML

'; + + // WHEN + $input = new UpdatePageInput( + page: $page, + seo: $seo, + title: null, + content: $content, + ); + + // THEN + expect($input->title)->toBeNull(); + }); + + it('throws when title is empty string', function (): void { + // GIVEN + $page = new Page(); + $seo = new SeoMetadata('Titre SEO valide', 'Description SEO valide'); + + // WHEN + expect(fn () => new UpdatePageInput( + page: $page, + seo: $seo, + title: ' ', + content: '

Contenu

', + )) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); + + it('throws when title exceeds 255 characters', function (): void { + // GIVEN + $page = new Page(); + $seo = new SeoMetadata('Titre SEO valide', 'Description SEO valide'); + $longTitle = str_repeat('a', 256); + + // WHEN + expect(fn () => new UpdatePageInput( + page: $page, + seo: $seo, + title: $longTitle, + content: '

Contenu

', + )) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); + + it('throws when content is empty', function (): void { + // GIVEN + $page = new Page(); + $seo = new SeoMetadata('Titre SEO valide', 'Description SEO valide'); + + // WHEN + expect(fn () => new UpdatePageInput( + page: $page, + seo: $seo, + title: 'Titre', + content: ' ', + )) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Unit/App/Actions/PickupExceptions/CreatePickupExceptionInputTest.php b/tests/Unit/App/Actions/PickupExceptions/CreatePickupExceptionInputTest.php new file mode 100644 index 00000000..3f6f21e7 --- /dev/null +++ b/tests/Unit/App/Actions/PickupExceptions/CreatePickupExceptionInputTest.php @@ -0,0 +1,60 @@ +date)->toBe('2026-05-01') + ->and($input->label)->toBe('Fête du Travail') + ->and($input->repeatable)->toBeTrue() + ->and($input->repeat_frequency)->toBe(RepeatFrequency::YEARLY); + }); + + test('it throws when date is invalid format', function () { + // GIVEN & WHEN & THEN + expect(fn () => new CreatePickupExceptionInput( + date: '01/05/2026', + label: 'Fête du Travail', + repeatable: true, + repeat_frequency: RepeatFrequency::YEARLY, + ))->toThrow(\InvalidArgumentException::class, 'Date must be in Y-m-d format.'); + }); + + test('it throws when label is empty', function () { + // GIVEN & WHEN & THEN + expect(fn () => new CreatePickupExceptionInput( + date: '2026-05-01', + label: ' ', + repeatable: true, + repeat_frequency: RepeatFrequency::YEARLY, + ))->toThrow(\InvalidArgumentException::class, 'Label cannot be empty.'); + }); + + test('it throws when label exceeds 255 characters', function () { + // GIVEN & WHEN & THEN + expect(fn () => new CreatePickupExceptionInput( + date: '2026-05-01', + label: str_repeat('a', 256), + repeatable: true, + repeat_frequency: RepeatFrequency::YEARLY, + ))->toThrow(\InvalidArgumentException::class, 'Label cannot exceed 255 characters.'); + }); +}); diff --git a/tests/Unit/App/Actions/PickupExceptions/DeletePickupExceptionInputTest.php b/tests/Unit/App/Actions/PickupExceptions/DeletePickupExceptionInputTest.php new file mode 100644 index 00000000..7dc01fb0 --- /dev/null +++ b/tests/Unit/App/Actions/PickupExceptions/DeletePickupExceptionInputTest.php @@ -0,0 +1,21 @@ +pickupException)->toBe($pickupException); + }); +}); diff --git a/tests/Unit/App/Actions/PickupExceptions/UpdatePickupExceptionInputTest.php b/tests/Unit/App/Actions/PickupExceptions/UpdatePickupExceptionInputTest.php new file mode 100644 index 00000000..8bf9a8f5 --- /dev/null +++ b/tests/Unit/App/Actions/PickupExceptions/UpdatePickupExceptionInputTest.php @@ -0,0 +1,76 @@ +pickupException)->toBe($pickupException) + ->and($input->date)->toBe('2026-05-08') + ->and($input->label)->toBe('Victoire 1945') + ->and($input->repeatable)->toBeTrue() + ->and($input->repeat_frequency)->toBe(RepeatFrequency::YEARLY); + }); + + test('it throws when date is invalid format', function () { + // GIVEN + $pickupException = new PickupException(); + + // WHEN & THEN + expect(fn () => new UpdatePickupExceptionInput( + pickupException: $pickupException, + date: '08/05/2026', + label: 'Victoire 1945', + repeatable: true, + repeat_frequency: RepeatFrequency::YEARLY, + ))->toThrow(\InvalidArgumentException::class, 'Date must be in Y-m-d format.'); + }); + + test('it throws when label is empty', function () { + // GIVEN + $pickupException = new PickupException(); + + // WHEN & THEN + expect(fn () => new UpdatePickupExceptionInput( + pickupException: $pickupException, + date: '2026-05-08', + label: ' ', + repeatable: true, + repeat_frequency: RepeatFrequency::YEARLY, + ))->toThrow(\InvalidArgumentException::class, 'Label cannot be empty.'); + }); + + test('it throws when label exceeds 255 characters', function () { + // GIVEN + $pickupException = new PickupException(); + + // WHEN & THEN + expect(fn () => new UpdatePickupExceptionInput( + pickupException: $pickupException, + date: '2026-05-08', + label: str_repeat('a', 256), + repeatable: true, + repeat_frequency: RepeatFrequency::YEARLY, + ))->toThrow(\InvalidArgumentException::class, 'Label cannot exceed 255 characters.'); + }); +}); diff --git a/tests/Unit/App/Actions/ProductIncos/AssociateProductIncoInputTest.php b/tests/Unit/App/Actions/ProductIncos/AssociateProductIncoInputTest.php new file mode 100644 index 00000000..fd0feff0 --- /dev/null +++ b/tests/Unit/App/Actions/ProductIncos/AssociateProductIncoInputTest.php @@ -0,0 +1,33 @@ +product)->toBe($product) + ->and($input->no_art)->toBe(27996); + }); + + it('throws when no_art is less than 1', function (): void { + // GIVEN + $product = new Product(); + $noArt = 0; + + // WHEN & THEN + expect(fn () => new AssociateProductIncoInput($product, $noArt)) + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Unit/App/Actions/Ranges/CreateRangeInputTest.php b/tests/Unit/App/Actions/Ranges/CreateRangeInputTest.php new file mode 100644 index 00000000..6855b9f1 --- /dev/null +++ b/tests/Unit/App/Actions/Ranges/CreateRangeInputTest.php @@ -0,0 +1,124 @@ +Belle gamme

'; + $pictureMetadata = new PictureMetadata(); + $status = true; + + // WHEN + $input = new CreateRangeInput( + name: $name, + description: $description, + picture: null, + pictureMetadata: $pictureMetadata, + status: $status, + ); + + // THEN + expect($input->name)->toBe($name) + ->and($input->description)->toBe($description) + ->and($input->picture)->toBeNull() + ->and($input->status)->toBeTrue(); + }); + + test('it can be instantiated with valid picture and metadata', function () { + // GIVEN + $picture = UploadedFile::fake()->image('range.jpg'); + $pictureMetadata = new PictureMetadata(alt: 'Image alt', title: 'Image title'); + + // WHEN + $input = new CreateRangeInput( + name: 'Gamme Spéciale', + description: null, + picture: $picture, + pictureMetadata: $pictureMetadata, + status: false, + ); + + // THEN + expect($input->picture)->toBe($picture) + ->and($input->pictureMetadata->alt)->toBe('Image alt') + ->and($input->pictureMetadata->title)->toBe('Image title'); + }); + + test('it throws when name is empty', function () { + // GIVEN + $emptyName = ' '; + + // WHEN & THEN + expect(fn () => new CreateRangeInput( + name: $emptyName, + description: null, + picture: null, + pictureMetadata: new PictureMetadata(), + status: true, + ))->toThrow(\InvalidArgumentException::class, 'The range name cannot be empty.'); + }); + + test('it throws when name is shorter than 2 characters', function () { + // GIVEN + $shortName = 'A'; + + // WHEN & THEN + expect(fn () => new CreateRangeInput( + name: $shortName, + description: null, + picture: null, + pictureMetadata: new PictureMetadata(), + status: true, + ))->toThrow(\InvalidArgumentException::class, 'The range name must be at least 2 characters.'); + }); + + test('it throws when name exceeds 45 characters', function () { + // GIVEN + $longName = str_repeat('a', 46); + + // WHEN & THEN + expect(fn () => new CreateRangeInput( + name: $longName, + description: null, + picture: null, + pictureMetadata: new PictureMetadata(), + status: true, + ))->toThrow(\InvalidArgumentException::class, 'The range name cannot exceed 45 characters.'); + }); + + test('it throws when picture is provided without alt', function () { + // GIVEN + $picture = UploadedFile::fake()->image('range.jpg'); + $pictureMetadata = new PictureMetadata(alt: null, title: 'Title only'); + + // WHEN & THEN + expect(fn () => new CreateRangeInput( + name: 'Gamme', + description: null, + picture: $picture, + pictureMetadata: $pictureMetadata, + status: true, + ))->toThrow(\InvalidArgumentException::class, 'Picture alt is required when picture is provided.'); + }); + + test('it throws when picture is provided without title', function () { + // GIVEN + $picture = UploadedFile::fake()->image('range.jpg'); + $pictureMetadata = new PictureMetadata(alt: 'Alt only', title: null); + + // WHEN & THEN + expect(fn () => new CreateRangeInput( + name: 'Gamme', + description: null, + picture: $picture, + pictureMetadata: $pictureMetadata, + status: true, + ))->toThrow(\InvalidArgumentException::class, 'Picture title is required when picture is provided.'); + }); +}); diff --git a/tests/Unit/App/Actions/Ranges/DeleteRangeInputTest.php b/tests/Unit/App/Actions/Ranges/DeleteRangeInputTest.php new file mode 100644 index 00000000..4e2be89e --- /dev/null +++ b/tests/Unit/App/Actions/Ranges/DeleteRangeInputTest.php @@ -0,0 +1,19 @@ +range)->toBe($range); + }); +}); diff --git a/tests/Unit/App/Actions/Ranges/UpdateRangeInputTest.php b/tests/Unit/App/Actions/Ranges/UpdateRangeInputTest.php new file mode 100644 index 00000000..76c9b49d --- /dev/null +++ b/tests/Unit/App/Actions/Ranges/UpdateRangeInputTest.php @@ -0,0 +1,66 @@ +Contenu modifié

'; + $pictureMetadata = new PictureMetadata(); + $status = false; + + // WHEN + $input = new UpdateRangeInput( + range: $range, + name: $name, + description: $description, + picture: null, + pictureMetadata: $pictureMetadata, + status: $status, + ); + + // THEN + expect($input->range)->toBe($range) + ->and($input->name)->toBe($name) + ->and($input->description)->toBe($description) + ->and($input->status)->toBeFalse(); + }); + + test('it throws when name is invalid', function () { + // GIVEN + $range = new Range(); + + // WHEN & THEN + expect(fn () => new UpdateRangeInput( + range: $range, + name: '', + description: null, + picture: null, + pictureMetadata: new PictureMetadata(), + status: true, + ))->toThrow(\InvalidArgumentException::class, 'The range name cannot be empty.'); + }); + + test('it throws when picture is provided without alt or title', function () { + // GIVEN + $range = new Range(); + $picture = UploadedFile::fake()->image('range.jpg'); + + // WHEN & THEN + expect(fn () => new UpdateRangeInput( + range: $range, + name: 'Gamme', + description: null, + picture: $picture, + pictureMetadata: new PictureMetadata(alt: null, title: 'Title'), + status: true, + ))->toThrow(\InvalidArgumentException::class, 'Picture alt is required when picture is provided.'); + }); +}); diff --git a/tests/Unit/App/Actions/Settings/UpdateSettingsInputTest.php b/tests/Unit/App/Actions/Settings/UpdateSettingsInputTest.php new file mode 100644 index 00000000..5904f798 --- /dev/null +++ b/tests/Unit/App/Actions/Settings/UpdateSettingsInputTest.php @@ -0,0 +1,43 @@ +employeeSites)->toBe($sites); + }); + + it('creates an empty input', function (): void { + // GIVEN + $sites = []; + + // WHEN + $input = new UpdateSettingsInput(employeeSites: $sites); + + // THEN + expect($input->employeeSites)->toBeEmpty(); + }); + + it('throws when site elements are not ShopperSiteCode', function (): void { + // GIVEN + $invalidSites = ['PA', 'LY']; + + // WHEN / THEN + /** @phpstan-ignore argument.type */ + expect(fn () => new UpdateSettingsInput(employeeSites: $invalidSites)) + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Unit/App/Actions/Shops/CreateShopInputTest.php b/tests/Unit/App/Actions/Shops/CreateShopInputTest.php new file mode 100644 index 00000000..7a92f4fc --- /dev/null +++ b/tests/Unit/App/Actions/Shops/CreateShopInputTest.php @@ -0,0 +1,123 @@ +name)->toBe($name) + ->and($input->address)->toBe($address) + ->and($input->postcode)->toBe($postcode) + ->and($input->city)->toBe($city) + ->and($input->phone)->toBe($phone) + ->and($input->coordinates)->toBe($coordinates) + ->and($input->default)->toBeTrue(); + }); + + test('it can be instantiated with null optional values', function () { + // GIVEN & WHEN + $input = new CreateShopInput( + name: 'Boutique Lyon', + address: '1 Place Bellecour', + postcode: '69002', + city: 'Lyon', + phone: null, + coordinates: null, + default: false, + ); + + // THEN + expect($input->phone)->toBeNull() + ->and($input->coordinates)->toBeNull() + ->and($input->default)->toBeFalse(); + }); + + test('it throws when name is empty', function () { + // GIVEN & WHEN & THEN + expect(fn () => new CreateShopInput( + name: ' ', + address: '1 rue de Paris', + postcode: '75000', + city: 'Paris', + phone: null, + coordinates: null, + default: false, + ))->toThrow(\InvalidArgumentException::class, 'Shop name cannot be empty.'); + }); + + test('it throws when address is empty', function () { + // GIVEN & WHEN & THEN + expect(fn () => new CreateShopInput( + name: 'Boutique', + address: ' ', + postcode: '75000', + city: 'Paris', + phone: null, + coordinates: null, + default: false, + ))->toThrow(\InvalidArgumentException::class, 'Shop address cannot be empty.'); + }); + + test('it throws when postcode is empty', function () { + // GIVEN & WHEN & THEN + expect(fn () => new CreateShopInput( + name: 'Boutique', + address: '1 rue de Paris', + postcode: ' ', + city: 'Paris', + phone: null, + coordinates: null, + default: false, + ))->toThrow(\InvalidArgumentException::class, 'Shop postcode cannot be empty.'); + }); + + test('it throws when city is empty', function () { + // GIVEN & WHEN & THEN + expect(fn () => new CreateShopInput( + name: 'Boutique', + address: '1 rue de Paris', + postcode: '75000', + city: ' ', + phone: null, + coordinates: null, + default: false, + ))->toThrow(\InvalidArgumentException::class, 'Shop city cannot be empty.'); + }); + + test('it throws when name exceeds 255 characters', function () { + // GIVEN & WHEN & THEN + expect(fn () => new CreateShopInput( + name: str_repeat('a', 256), + address: '1 rue de Paris', + postcode: '75000', + city: 'Paris', + phone: null, + coordinates: null, + default: false, + ))->toThrow(\InvalidArgumentException::class, 'Shop name cannot exceed 255 characters.'); + }); +}); diff --git a/tests/Unit/App/Actions/Shops/DeleteShopInputTest.php b/tests/Unit/App/Actions/Shops/DeleteShopInputTest.php new file mode 100644 index 00000000..bf988822 --- /dev/null +++ b/tests/Unit/App/Actions/Shops/DeleteShopInputTest.php @@ -0,0 +1,19 @@ +shop)->toBe($shop); + }); +}); diff --git a/tests/Unit/App/Actions/Shops/UpdateShopInputTest.php b/tests/Unit/App/Actions/Shops/UpdateShopInputTest.php new file mode 100644 index 00000000..7a17ec02 --- /dev/null +++ b/tests/Unit/App/Actions/Shops/UpdateShopInputTest.php @@ -0,0 +1,129 @@ +shop)->toBe($shop) + ->and($input->name)->toBe($name) + ->and($input->address)->toBe($address) + ->and($input->postcode)->toBe($postcode) + ->and($input->city)->toBe($city) + ->and($input->phone)->toBe($phone) + ->and($input->coordinates)->toBe($coordinates) + ->and($input->default)->toBeFalse(); + }); + + test('it throws when name is empty', function () { + // GIVEN + $shop = new Shop(); + + // WHEN & THEN + expect(fn () => new UpdateShopInput( + shop: $shop, + name: ' ', + address: '1 rue de Paris', + postcode: '75000', + city: 'Paris', + phone: null, + coordinates: null, + default: false, + ))->toThrow(\InvalidArgumentException::class, 'Shop name cannot be empty.'); + }); + + test('it throws when address is empty', function () { + // GIVEN + $shop = new Shop(); + + // WHEN & THEN + expect(fn () => new UpdateShopInput( + shop: $shop, + name: 'Boutique', + address: ' ', + postcode: '75000', + city: 'Paris', + phone: null, + coordinates: null, + default: false, + ))->toThrow(\InvalidArgumentException::class, 'Shop address cannot be empty.'); + }); + + test('it throws when postcode is empty', function () { + // GIVEN + $shop = new Shop(); + + // WHEN & THEN + expect(fn () => new UpdateShopInput( + shop: $shop, + name: 'Boutique', + address: '1 rue de Paris', + postcode: ' ', + city: 'Paris', + phone: null, + coordinates: null, + default: false, + ))->toThrow(\InvalidArgumentException::class, 'Shop postcode cannot be empty.'); + }); + + test('it throws when city is empty', function () { + // GIVEN + $shop = new Shop(); + + // WHEN & THEN + expect(fn () => new UpdateShopInput( + shop: $shop, + name: 'Boutique', + address: '1 rue de Paris', + postcode: '75000', + city: ' ', + phone: null, + coordinates: null, + default: false, + ))->toThrow(\InvalidArgumentException::class, 'Shop city cannot be empty.'); + }); + + test('it throws when name exceeds 255 characters', function () { + // GIVEN + $shop = new Shop(); + + // WHEN & THEN + expect(fn () => new UpdateShopInput( + shop: $shop, + name: str_repeat('a', 256), + address: '1 rue de Paris', + postcode: '75000', + city: 'Paris', + phone: null, + coordinates: null, + default: false, + ))->toThrow(\InvalidArgumentException::class, 'Shop name cannot exceed 255 characters.'); + }); +}); diff --git a/tests/Unit/App/Actions/Shops/UpdateShopPickupExceptionsInputTest.php b/tests/Unit/App/Actions/Shops/UpdateShopPickupExceptionsInputTest.php new file mode 100644 index 00000000..1c00d986 --- /dev/null +++ b/tests/Unit/App/Actions/Shops/UpdateShopPickupExceptionsInputTest.php @@ -0,0 +1,168 @@ + [ + 'replacement_date' => '2026-06-01', + 'order_deadline_at' => '2026-05-31 18:00:00', + ], + 123 => [ + 'replacement_date' => null, + 'order_deadline_at' => null, + ], + ]; + + // WHEN + $input = new UpdateShopPickupExceptionsInput( + shop: $shop, + syncData: $syncData, + ); + + // THEN + expect($input->shop)->toBe($shop) + ->and($input->syncData)->toBe($syncData); + }); + + test('it can be instantiated with empty sync data', function () { + // GIVEN + $shop = new Shop(); + + // WHEN + $input = new UpdateShopPickupExceptionsInput( + shop: $shop, + syncData: [], + ); + + // THEN + expect($input->shop)->toBe($shop) + ->and($input->syncData)->toBe([]); + }); + + test('it throws when sync item is not an array', function () { + // GIVEN + $shop = new Shop(); + $invalidSyncData = [ + 'key1' => 'invalid-not-array', + ]; + + // WHEN & THEN + /** @phpstan-ignore-next-line */ + expect(fn () => new UpdateShopPickupExceptionsInput(shop: $shop, syncData: $invalidSyncData)) + ->toThrow(\InvalidArgumentException::class, 'Each sync item must be an array.'); + }); + + test('it throws when replacement_date key is missing', function () { + // GIVEN + $shop = new Shop(); + $invalidSyncData = [ + 'key1' => [ + 'order_deadline_at' => '2026-05-31 18:00:00', + ], + ]; + + // WHEN & THEN + /** @phpstan-ignore-next-line */ + expect(fn () => new UpdateShopPickupExceptionsInput(shop: $shop, syncData: $invalidSyncData)) + ->toThrow(\InvalidArgumentException::class, 'Sync item must contain replacement_date key.'); + }); + + test('it throws when order_deadline_at key is missing', function () { + // GIVEN + $shop = new Shop(); + $invalidSyncData = [ + 'key1' => [ + 'replacement_date' => '2026-06-01', + ], + ]; + + // WHEN & THEN + /** @phpstan-ignore-next-line */ + expect(fn () => new UpdateShopPickupExceptionsInput(shop: $shop, syncData: $invalidSyncData)) + ->toThrow(\InvalidArgumentException::class, 'Sync item must contain order_deadline_at key.'); + }); + + test('it throws when replacement_date is not string or null', function () { + // GIVEN + $shop = new Shop(); + $invalidSyncData = [ + 'key1' => [ + 'replacement_date' => 12345, + 'order_deadline_at' => null, + ], + ]; + + // WHEN & THEN + /** @phpstan-ignore-next-line */ + expect(fn () => new UpdateShopPickupExceptionsInput(shop: $shop, syncData: $invalidSyncData)) + ->toThrow(\InvalidArgumentException::class, 'replacement_date must be a string or null.'); + }); + + test('it throws when order_deadline_at is not string or null', function () { + // GIVEN + $shop = new Shop(); + $invalidSyncData = [ + 'key1' => [ + 'replacement_date' => null, + 'order_deadline_at' => ['invalid'], + ], + ]; + + // WHEN & THEN + /** @phpstan-ignore-next-line */ + expect(fn () => new UpdateShopPickupExceptionsInput(shop: $shop, syncData: $invalidSyncData)) + ->toThrow(\InvalidArgumentException::class, 'order_deadline_at must be a string or null.'); + }); + + test('it throws when order_deadline_at is set but replacement_date is null', function () { + // GIVEN + $shop = new Shop(); + $invalidSyncData = [ + 'key1' => [ + 'replacement_date' => null, + 'order_deadline_at' => '2026-06-01 10:00:00', + ], + ]; + + // WHEN & THEN + expect(fn () => new UpdateShopPickupExceptionsInput(shop: $shop, syncData: $invalidSyncData)) + ->toThrow(\InvalidArgumentException::class, 'A replacement date is required when an order deadline is set.'); + }); + + test('it throws when order_deadline_at is after replacement_date', function () { + // GIVEN + $shop = new Shop(); + $invalidSyncData = [ + 'key1' => [ + 'replacement_date' => '2026-10-02', + 'order_deadline_at' => '2026-10-11 14:53:00', + ], + ]; + + // WHEN & THEN + expect(fn () => new UpdateShopPickupExceptionsInput(shop: $shop, syncData: $invalidSyncData)) + ->toThrow(\InvalidArgumentException::class, 'Order deadline must be strictly before the replacement date.'); + }); + + test('it throws when order_deadline_at is equal to replacement_date', function () { + // GIVEN + $shop = new Shop(); + $invalidSyncData = [ + 'key1' => [ + 'replacement_date' => '2026-10-02', + 'order_deadline_at' => '2026-10-02 00:00:00', + ], + ]; + + // WHEN & THEN + expect(fn () => new UpdateShopPickupExceptionsInput(shop: $shop, syncData: $invalidSyncData)) + ->toThrow(\InvalidArgumentException::class, 'Order deadline must be strictly before the replacement date.'); + }); +}); diff --git a/tests/Unit/App/Actions/Slides/CreateSlideInputTest.php b/tests/Unit/App/Actions/Slides/CreateSlideInputTest.php new file mode 100644 index 00000000..78393926 --- /dev/null +++ b/tests/Unit/App/Actions/Slides/CreateSlideInputTest.php @@ -0,0 +1,98 @@ +Contenu du slide

'; + $period = new DatePeriod(); + + // WHEN + $input = new CreateSlideInput( + title: $title, + text: $text, + period: $period, + ); + + // THEN + expect($input->title)->toBe($title) + ->and($input->text)->toBe($text) + ->and($input->picture)->toBeNull() + ->and($input->period)->toBe($period); + }); + + it('creates a valid CreateSlideInput instance with picture', function (): void { + // GIVEN + $title = 'Nouveau Slide Photo'; + $picture = 'storage/modelfiles/slides/picture.jpg'; + + // WHEN + $input = new CreateSlideInput( + title: $title, + picture: $picture, + pictureAlt: 'Description alternative', + pictureTitle: 'Titre image', + ); + + // THEN + expect($input->title)->toBe($title) + ->and($input->picture)->toBe($picture) + ->and($input->pictureAlt)->toBe('Description alternative') + ->and($input->pictureTitle)->toBe('Titre image'); + }); + + it('throws when title is empty', function (): void { + // GIVEN + $emptyTitle = ' '; + + // WHEN + expect(fn () => new CreateSlideInput(title: $emptyTitle, text: 'Texte')) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); + + it('throws when title exceeds 75 characters', function (): void { + // GIVEN + $tooLongTitle = str_repeat('a', 76); + + // WHEN + expect(fn () => new CreateSlideInput(title: $tooLongTitle, text: 'Texte')) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); + + it('throws when neither picture nor text is provided', function (): void { + // GIVEN + $title = 'Slide sans contenu'; + + // WHEN + expect(fn () => new CreateSlideInput(title: $title)) + // THEN + ->toThrow(\InvalidArgumentException::class, 'A slide must have either a picture or text.'); + }); + + it('throws when picture_alt exceeds 75 characters', function (): void { + // GIVEN + $tooLongAlt = str_repeat('a', 76); + + // WHEN + expect(fn () => new CreateSlideInput(title: 'Slide', picture: 'pic.jpg', pictureAlt: $tooLongAlt)) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); + + it('throws when link exceeds 255 characters', function (): void { + // GIVEN + $tooLongLink = 'https://example.com/' . str_repeat('a', 256); + + // WHEN + expect(fn () => new CreateSlideInput(title: 'Slide', text: 'Texte', link: $tooLongLink)) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Unit/App/Actions/Slides/DeleteSlideInputTest.php b/tests/Unit/App/Actions/Slides/DeleteSlideInputTest.php new file mode 100644 index 00000000..b4f26324 --- /dev/null +++ b/tests/Unit/App/Actions/Slides/DeleteSlideInputTest.php @@ -0,0 +1,19 @@ +slide)->toBe($slide); + }); +}); diff --git a/tests/Unit/App/Actions/Slides/UpdateSlideInputTest.php b/tests/Unit/App/Actions/Slides/UpdateSlideInputTest.php new file mode 100644 index 00000000..dd5d605d --- /dev/null +++ b/tests/Unit/App/Actions/Slides/UpdateSlideInputTest.php @@ -0,0 +1,65 @@ +picture = 'storage/modelfiles/slides/existing.jpg'; + $title = 'Slide Modifié'; + + // WHEN + $input = new UpdateSlideInput( + slide: $slide, + title: $title, + ); + + // THEN + expect($input->slide)->toBe($slide) + ->and($input->title)->toBe($title) + ->and($input->picture)->toBeNull(); + }); + + it('creates a valid UpdateSlideInput instance with new text', function (): void { + // GIVEN + $slide = new Slide(); + $title = 'Slide Modifié Texte'; + $text = '

Nouveau texte

'; + + // WHEN + $input = new UpdateSlideInput( + slide: $slide, + title: $title, + text: $text, + ); + + // THEN + expect($input->slide)->toBe($slide) + ->and($input->title)->toBe($title) + ->and($input->text)->toBe($text); + }); + + it('throws when title is empty', function (): void { + // GIVEN + $slide = new Slide(); + + // WHEN + expect(fn () => new UpdateSlideInput(slide: $slide, title: ' ', text: 'Texte')) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); + + it('throws when neither new nor existing picture nor text exists', function (): void { + // GIVEN + $slide = new Slide(); + + // WHEN + expect(fn () => new UpdateSlideInput(slide: $slide, title: 'Slide')) + // THEN + ->toThrow(\InvalidArgumentException::class, 'A slide must have either a picture or text.'); + }); +}); diff --git a/tests/Unit/App/Actions/Tags/CreateTagInputTest.php b/tests/Unit/App/Actions/Tags/CreateTagInputTest.php new file mode 100644 index 00000000..7323ebe1 --- /dev/null +++ b/tests/Unit/App/Actions/Tags/CreateTagInputTest.php @@ -0,0 +1,44 @@ +label)->toBe($label) + ->and($input->status)->toBe($status); + }); +}); + +describe('CreateTagInput validation rules', function (): void { + it('throws when label is empty or whitespace only', function (string $invalidLabel): void { + // GIVEN + $status = true; + $label = $invalidLabel; + + // WHEN + expect(fn () => new CreateTagInput(label: $label, status: $status)) + // THEN + ->toThrow(\InvalidArgumentException::class); + })->with(['', ' ', "\t\n"]); + + it('throws when label exceeds 255 characters', function (): void { + // GIVEN + $status = true; + $label = str_repeat('a', 256); + + // WHEN + expect(fn () => new CreateTagInput(label: $label, status: $status)) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Unit/App/Actions/Tags/DeleteTagInputTest.php b/tests/Unit/App/Actions/Tags/DeleteTagInputTest.php new file mode 100644 index 00000000..6431d855 --- /dev/null +++ b/tests/Unit/App/Actions/Tags/DeleteTagInputTest.php @@ -0,0 +1,19 @@ +tag)->toBe($tag); + }); +}); diff --git a/tests/Unit/App/Actions/Tags/UpdateTagInputTest.php b/tests/Unit/App/Actions/Tags/UpdateTagInputTest.php new file mode 100644 index 00000000..b104861e --- /dev/null +++ b/tests/Unit/App/Actions/Tags/UpdateTagInputTest.php @@ -0,0 +1,49 @@ +tag)->toBe($tag) + ->and($input->label)->toBe($label) + ->and($input->status)->toBe($status); + }); +}); + +describe('UpdateTagInput validation rules', function (): void { + it('throws when label is empty or whitespace only', function (string $invalidLabel): void { + // GIVEN + $tag = new Tag(); + $status = true; + $label = $invalidLabel; + + // WHEN + expect(fn () => new UpdateTagInput(tag: $tag, label: $label, status: $status)) + // THEN + ->toThrow(\InvalidArgumentException::class); + })->with(['', ' ', "\t\n"]); + + it('throws when label exceeds 255 characters', function (): void { + // GIVEN + $tag = new Tag(); + $status = true; + $label = str_repeat('a', 256); + + // WHEN + expect(fn () => new UpdateTagInput(tag: $tag, label: $label, status: $status)) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Unit/App/Casts/CodeCastTest.php b/tests/Unit/App/Casts/CodeCastTest.php new file mode 100644 index 00000000..988ad5d4 --- /dev/null +++ b/tests/Unit/App/Casts/CodeCastTest.php @@ -0,0 +1,61 @@ +get($model, 'code', 'ABCDEFGH', []); + + // THEN + expect($code)->toBeInstanceOf(Code::class) + ->and($code->value)->toBe('ABCDEFGH'); +}); + +it('throws exception when getting null code', function () { + // GIVEN + $cast = new CodeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'code', null, []); + + // THEN +})->throws( + \UnexpectedValueException::class, + 'Code must be a string.' +); + +it('sets a code', function () { + // GIVEN + $cast = new CodeCast(); + $model = \Mockery::mock(Model::class); + $code = new Code('ABCDEFGH'); + + // WHEN + $value = $cast->set($model, 'code', $code, []); + + // THEN + expect($value)->toBe('ABCDEFGH'); +}); + +it('throws exception when setting invalid code', function () { + // GIVEN + $cast = new CodeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->set($model, 'code', 'ABCDEFGH', []); + + // THEN +})->throws( + \UnexpectedValueException::class, + 'The given value is not an instance of Code.' +); diff --git a/tests/Unit/App/Casts/DeliveryAddressCastTest.php b/tests/Unit/App/Casts/DeliveryAddressCastTest.php new file mode 100644 index 00000000..979aa75f --- /dev/null +++ b/tests/Unit/App/Casts/DeliveryAddressCastTest.php @@ -0,0 +1,107 @@ +get($model, 'address', null, []); + + // THEN + expect($address)->toBeInstanceOf(DeliveryAddress::class) + ->and($address->name)->toBe('Non renseigné') + ->and($address->address)->toBe('Non renseigné') + ->and($address->postcode)->toBe('00000') + ->and($address->city)->toBe('Non renseigné'); +}); + +it('throws exception when getting invalid value type', function () { + // GIVEN + $cast = new DeliveryAddressCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'address', 123, []); + + // THEN +})->throws(\InvalidArgumentException::class, 'The value must be a string.'); + +it('gets a delivery address from json string', function () { + // GIVEN + $cast = new DeliveryAddressCast(); + $model = \Mockery::mock(Model::class); + + $json = json_encode([ + 'name' => 'John', + 'address' => '123 Street', + 'postcode' => '12345', + 'city' => 'City', + 'phone' => '0102030405', + 'latitude' => '48.0', + 'longitude' => '2.0', + ]); + + // WHEN + $address = $cast->get($model, 'address', $json, []); + + // THEN + expect($address)->toBeInstanceOf(DeliveryAddress::class) + ->and($address->name)->toBe('John') + ->and($address->address)->toBe('123 Street') + ->and($address->postcode)->toBe('12345') + ->and($address->city)->toBe('City') + ->and($address->phone)->toBe('0102030405') + ->and($address->latitude)->toBe('48.0') + ->and($address->longitude)->toBe('2.0'); +}); + +it('throws exception when setting invalid type', function () { + // GIVEN + $cast = new DeliveryAddressCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->set($model, 'address', 'invalid', []); + + // THEN +})->throws( + \InvalidArgumentException::class, + 'The value must be an instance of DeliveryAddress.' +); + +it('sets a delivery address', function () { + // GIVEN + $cast = new DeliveryAddressCast(); + $model = \Mockery::mock(Model::class); + $address = new DeliveryAddress( + name: 'John', + address: '123 Street', + postcode: '12345', + city: 'City', + phone: '0102030405', + latitude: '48.0', + longitude: '2.0' + ); + + // WHEN + $value = $cast->set($model, 'address', $address, []); + + // THEN + expect($value)->toBeJson() + ->and(json_decode($value, true))->toMatchArray([ + 'name' => 'John', + 'address' => '123 Street', + 'postcode' => '12345', + 'city' => 'City', + 'phone' => '0102030405', + 'latitude' => '48.0', + 'longitude' => '2.0', + ]); +}); diff --git a/tests/Unit/App/Casts/DiscountValueCastTest.php b/tests/Unit/App/Casts/DiscountValueCastTest.php new file mode 100644 index 00000000..e8bd1b0c --- /dev/null +++ b/tests/Unit/App/Casts/DiscountValueCastTest.php @@ -0,0 +1,165 @@ +get( + $model, + 'discount', + 10, + ['type' => DiscountType::PERCENT->value] + ); + + // THEN + expect($value)->toBeInstanceOf(DiscountValue::class) + ->and($value->value())->toBe(10); +}); + +it('gets a discount value from amount', function () { + // GIVEN + $cast = new DiscountValueCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $value = $cast->get( + $model, + 'discount', + 1000, + ['type' => DiscountType::AMOUNT->value] + ); + + // THEN + expect($value)->toBeInstanceOf(DiscountValue::class) + ->and($value->value())->toBeInstanceOf(Money::class) + ->and($value->value()->getAmount())->toBe('1000'); +}); + +it('gets a discount value from amount string', function () { + // GIVEN + $cast = new DiscountValueCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $value = $cast->get( + $model, + 'discount', + '1000', + ['type' => (string) DiscountType::AMOUNT->value] + ); + + // THEN + expect($value)->toBeInstanceOf(DiscountValue::class) + ->and($value->value())->toBeInstanceOf(Money::class) + ->and($value->value()->getAmount())->toBe('1000'); +}); + +it('throws exception when type is missing', function () { + // GIVEN + $cast = new DiscountValueCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'discount', 10, []); + + // THEN +})->throws( + \UnexpectedValueException::class, + 'The discount type attribute is missing to cast the value.' +); + +it('throws exception when type is invalid', function () { + // GIVEN + $cast = new DiscountValueCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'discount', 10, ['type' => 'invalid']); + + // THEN +})->throws( + \UnexpectedValueException::class, + 'Unknown discount type raw value: invalid' +); + +it('throws exception when value is invalid', function () { + // GIVEN + $cast = new DiscountValueCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get( + $model, + 'discount', + 'invalid', + ['type' => DiscountType::PERCENT->value] + ); + + // THEN +})->throws( + \UnexpectedValueException::class, + 'The discount value must be an integer or a numeric string.' +); + +it('throws exception when setting null', function () { + // GIVEN + $cast = new DiscountValueCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->set($model, 'discount', null, []); + + // THEN +})->throws(\InvalidArgumentException::class, 'The value cannot be null.'); + +it('throws exception when setting invalid type', function () { + // GIVEN + $cast = new DiscountValueCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->set($model, 'discount', 10, []); + + // THEN +})->throws( + \InvalidArgumentException::class, + 'The value must be an instance of DiscountValue.' +); + +it('sets a discount value percentage', function () { + // GIVEN + $cast = new DiscountValueCast(); + $model = \Mockery::mock(Model::class); + $discount = DiscountValue::fromPercentage(10); + + // WHEN + $value = $cast->set($model, 'discount', $discount, []); + + // THEN + expect($value)->toBe(10); +}); + +it('sets a discount value amount', function () { + // GIVEN + $cast = new DiscountValueCast(); + $model = \Mockery::mock(Model::class); + $currency = resolve(Currency::class); + $discount = DiscountValue::fromAmount(new Money(1000, $currency)); + + // WHEN + $value = $cast->set($model, 'discount', $discount, []); + + // THEN + expect($value)->toBe(1000); +}); diff --git a/tests/Unit/App/Casts/EmailCastTest.php b/tests/Unit/App/Casts/EmailCastTest.php new file mode 100644 index 00000000..df906c3d --- /dev/null +++ b/tests/Unit/App/Casts/EmailCastTest.php @@ -0,0 +1,80 @@ +get($model, 'email', 'test@example.com', []); + + // THEN + expect($email)->toBeInstanceOf(Email::class) + ->and($email->value)->toBe('test@example.com'); +}); + +it('throws exception when getting invalid email', function () { + // GIVEN + $cast = new EmailCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'email', 123, []); + + // THEN +})->throws(\UnexpectedValueException::class, 'Email must be a string.'); + +it('throws exception when getting null email', function () { + // GIVEN + $cast = new EmailCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'email', null, []); + + // THEN +})->throws(\UnexpectedValueException::class, 'Email must be a string.'); + +it('throws exception when setting null email', function () { + // GIVEN + $cast = new EmailCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->set($model, 'email', null, []); + + // THEN +})->throws(\InvalidArgumentException::class, 'Email cannot be null.'); + +it('throws exception when setting invalid email type', function () { + // GIVEN + $cast = new EmailCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->set($model, 'email', 'test@example.com', []); + + // THEN +})->throws( + \InvalidArgumentException::class, + 'The given value is not an instance of Email.' +); + +it('sets an email', function () { + // GIVEN + $cast = new EmailCast(); + $model = \Mockery::mock(Model::class); + $email = new Email('test@example.com'); + + // WHEN + $value = $cast->set($model, 'email', $email, []); + + // THEN + expect($value)->toBe('test@example.com'); +}); diff --git a/tests/Unit/App/Casts/EmployeeSitesCastTest.php b/tests/Unit/App/Casts/EmployeeSitesCastTest.php new file mode 100644 index 00000000..8928b119 --- /dev/null +++ b/tests/Unit/App/Casts/EmployeeSitesCastTest.php @@ -0,0 +1,105 @@ +get($model, 'employee_sites', null, []); + $resultEmpty = $cast->get($model, 'employee_sites', '', []); + + // THEN + expect($resultNull)->toBe([]) + ->and($resultEmpty)->toBe([]); +}); + +it('gets array of strings from json string', function (): void { + // GIVEN + $cast = new EmployeeSitesCast(); + $model = \Mockery::mock(Model::class); + $json = json_encode(['PA', 'LY', 'NA']); + + // WHEN + $sites = $cast->get($model, 'employee_sites', $json, []); + + // THEN + expect($sites)->toBe(['PA', 'LY', 'NA']); +}); + +it('gets array of strings from mixed array', function (): void { + // GIVEN + $cast = new EmployeeSitesCast(); + $model = \Mockery::mock(Model::class); + $input = ['PA', new ShopperSiteCode('LY'), 123]; + + // WHEN + $sites = $cast->get($model, 'employee_sites', $input, []); + + // THEN + expect($sites)->toBe(['PA', 'LY', '123']); +}); + +it('sets json empty array when value is null', function (): void { + // GIVEN + $cast = new EmployeeSitesCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $value = $cast->set($model, 'employee_sites', null, []); + + // THEN + expect($value)->toBe('[]'); +}); + +it('sets json array from array of strings', function (): void { + // GIVEN + $cast = new EmployeeSitesCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $value = $cast->set($model, 'employee_sites', ['PA', 'LY', 'NA'], []); + + // THEN + expect($value)->toBe(json_encode(['PA', 'LY', 'NA'])); +}); + +it('sets json array from array of Stringable objects', function (): void { + // GIVEN + $cast = new EmployeeSitesCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $value = $cast->set($model, 'employee_sites', [new ShopperSiteCode('PA'), new ShopperSiteCode('LY')], []); + + // THEN + expect($value)->toBe(json_encode(['PA', 'LY'])); +}); + +it('throws exception when setting invalid type', function (): void { + // GIVEN + $cast = new EmployeeSitesCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + expect(fn () => $cast->set($model, 'employee_sites', 12345, [])) + // THEN + ->toThrow(\UnexpectedValueException::class, 'Employee sites must be an array, string or null.'); +}); + +it('throws exception when setting array with non-convertible items', function (): void { + // GIVEN + $cast = new EmployeeSitesCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + expect(fn () => $cast->set($model, 'employee_sites', [new \stdClass()], [])) + // THEN + ->toThrow(\UnexpectedValueException::class, 'Each employee site must be convertable to string.'); +}); diff --git a/tests/Unit/App/Casts/MatriculeCastTest.php b/tests/Unit/App/Casts/MatriculeCastTest.php new file mode 100644 index 00000000..f4075e6c --- /dev/null +++ b/tests/Unit/App/Casts/MatriculeCastTest.php @@ -0,0 +1,69 @@ +get($model, 'matricule', '1234567', []); + + // THEN + expect($matricule)->toBeInstanceOf(Matricule::class) + ->and($matricule->value)->toBe('1234567'); +}); + +it('throws exception when getting invalid matricule', function () { + // GIVEN + $cast = new MatriculeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'matricule', 123, []); + + // THEN +})->throws(\UnexpectedValueException::class, 'Matricule must be a string.'); + +it('throws exception when getting null matricule', function () { + // GIVEN + $cast = new MatriculeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'matricule', null, []); + + // THEN +})->throws(\UnexpectedValueException::class, 'Matricule must be a string.'); + +it('throws exception when setting invalid matricule type', function () { + // GIVEN + $cast = new MatriculeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->set($model, 'matricule', '1234567', []); + + // THEN +})->throws( + \UnexpectedValueException::class, + 'The given value is not an instance of Matricule.' +); + +it('sets a matricule', function () { + // GIVEN + $cast = new MatriculeCast(); + $model = \Mockery::mock(Model::class); + $matricule = new Matricule('1234567'); + + // WHEN + $value = $cast->set($model, 'matricule', $matricule, []); + + // THEN + expect($value)->toBe('1234567'); +}); diff --git a/tests/Unit/App/Casts/MoneyCastTest.php b/tests/Unit/App/Casts/MoneyCastTest.php new file mode 100644 index 00000000..ddd92a16 --- /dev/null +++ b/tests/Unit/App/Casts/MoneyCastTest.php @@ -0,0 +1,89 @@ +get($model, 'price', '1000', []); + + // THEN + expect($money)->toBeInstanceOf(Money::class) + ->and($money->getAmount())->toBe('1000') + ->and($money->getCurrency()->getCode())->toBe(resolve(Currency::class)->getCode()); +}); + +it('gets a money from int', function () { + // GIVEN + $cast = new MoneyCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $money = $cast->get($model, 'price', 1000, []); + + // THEN + expect($money)->toBeInstanceOf(Money::class) + ->and($money->getAmount())->toBe('1000'); +}); + +it('throws exception when getting invalid money type', function () { + // GIVEN + $cast = new MoneyCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'price', 'abc', []); + + // THEN +})->throws( + \InvalidArgumentException::class, + 'The given value is not numeric.' +); + +it('throws exception when setting invalid money type', function () { + // GIVEN + $cast = new MoneyCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->set($model, 'price', '1000', []); + + // THEN +})->throws( + \InvalidArgumentException::class, + 'The given value is not an instance of Money.' +); + +it('sets a money', function () { + // GIVEN + $cast = new MoneyCast(); + $model = \Mockery::mock(Model::class); + $money = new Money(1000, resolve(Currency::class)); + + // WHEN + $value = $cast->set($model, 'price', $money, []); + + // THEN + expect($value)->toBe('1000'); +}); +it('throws exception when getting float', function () { + // GIVEN + $cast = new MoneyCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'price', 10.5, []); + + // THEN +})->throws( + \InvalidArgumentException::class, + 'The given value must be a string or integer.' +); diff --git a/tests/Unit/App/Casts/NutritionalValuesCastTest.php b/tests/Unit/App/Casts/NutritionalValuesCastTest.php new file mode 100644 index 00000000..d552bde3 --- /dev/null +++ b/tests/Unit/App/Casts/NutritionalValuesCastTest.php @@ -0,0 +1,84 @@ +get($model, 'nutritional', null, [ + 'nv_ref_weight_g' => 100.5, + 'nv_kj' => 200.0, + 'nv_kcal' => null, + ]); + + // THEN + expect($values)->toBeInstanceOf(NutritionalValues::class) + ->and($values->refWeightG)->toBe(100.5) + ->and($values->kj)->toBe(200.0) + ->and($values->kcal)->toBeNull(); +}); + +it('throws exception when getting invalid float type', function () { + // GIVEN + $cast = new NutritionalValuesCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'nutritional', null, [ + 'nv_ref_weight_g' => 'abc', + ]); + + // THEN +})->throws( + \Exception::class, + 'Expected `nv_ref_weight_g` to be numeric of null' +); + +it('sets nutritional values', function () { + // GIVEN + $cast = new NutritionalValuesCast(); + $model = \Mockery::mock(Model::class); + $values = new NutritionalValues(refWeightG: 100.5, kj: 200.0); + + // WHEN + $array = $cast->set($model, 'nutritional', $values, []); + + // THEN + expect($array)->toBeArray() + ->and($array['nv_ref_weight_g'])->toBe(100.5) + ->and($array['nv_kj'])->toBe(200.0); +}); + +it('sets default when null', function () { + // GIVEN + $cast = new NutritionalValuesCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $array = $cast->set($model, 'nutritional', null, []); + + // THEN + expect($array)->toBeArray() + ->and($array['nv_ref_weight_g'])->toBeNull(); +}); + +it('throws exception when setting invalid type', function () { + // GIVEN + $cast = new NutritionalValuesCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->set($model, 'nutritional', 'invalid', []); + + // THEN +})->throws( + \InvalidArgumentException::class, + 'The given value is not a NutritionalValues instance.' +); diff --git a/tests/Unit/App/Casts/OrderEmployeeCastTest.php b/tests/Unit/App/Casts/OrderEmployeeCastTest.php new file mode 100644 index 00000000..b0087466 --- /dev/null +++ b/tests/Unit/App/Casts/OrderEmployeeCastTest.php @@ -0,0 +1,123 @@ +get($model, 'employee', null, []); + + // THEN + expect($employee)->toBeNull(); +}); + +it('throws exception when getting invalid value type', function () { + // GIVEN + $cast = new OrderEmployeeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'employee', 123, []); + + // THEN +})->throws( + \InvalidArgumentException::class, + 'The value must be a string.' +); + +use Domain\Models\ValueObjects\ShopperEstablishmentCode; +use Domain\Models\ValueObjects\ShopperServiceCode; +use Domain\Models\ValueObjects\ShopperSiteCode; + +it('gets an order employee from json string', function () { + // GIVEN + $cast = new OrderEmployeeCast(); + $model = \Mockery::mock(Model::class); + + $json = json_encode([ + 'matricule' => '1234567', + 'firstname' => 'John', + 'lastname' => 'Doe', + 'facility' => 'FAC01', + 'site' => 'SITE', + 'service' => '101', + ]); + + // WHEN + $employee = $cast->get($model, 'employee', $json, []); + + // THEN + expect($employee)->toBeInstanceOf(OrderEmployee::class) + ->and($employee->matricule)->toBeInstanceOf(Matricule::class) + ->and($employee->matricule->value)->toBe('1234567') + ->and($employee->firstname)->toBe('John') + ->and($employee->lastname)->toBe('Doe') + ->and($employee->facility)->toBeInstanceOf(ShopperEstablishmentCode::class) + ->and($employee->facility->value)->toBe('FAC01') + ->and($employee->site)->toBeInstanceOf(ShopperSiteCode::class) + ->and($employee->site->value)->toBe('SITE') + ->and($employee->service)->toBeInstanceOf(ShopperServiceCode::class) + ->and($employee->service->value)->toBe('101'); +}); + +it('sets null when value is null', function () { + // GIVEN + $cast = new OrderEmployeeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $value = $cast->set($model, 'employee', null, []); + + // THEN + expect($value)->toBeNull(); +}); + +it('throws exception when setting invalid type', function () { + // GIVEN + $cast = new OrderEmployeeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->set($model, 'employee', 'invalid', []); + + // THEN +})->throws( + \InvalidArgumentException::class, + 'The given value is not an instance of OrderEmployee.' +); + +it('sets an order employee', function () { + // GIVEN + $cast = new OrderEmployeeCast(); + $model = \Mockery::mock(Model::class); + $employee = new OrderEmployee( + matricule: new Matricule('1234567'), + firstname: 'John', + lastname: 'Doe', + facility: new ShopperEstablishmentCode('FAC01'), + site: new ShopperSiteCode('SITE'), + service: new ShopperServiceCode('101') + ); + + // WHEN + $value = $cast->set($model, 'employee', $employee, []); + + // THEN + expect($value)->toBeJson() + ->and(json_decode($value, true))->toMatchArray([ + 'matricule' => '1234567', + 'firstname' => 'John', + 'lastname' => 'Doe', + 'facility' => 'FAC01', + 'site' => 'SITE', + 'service' => '101', + ]); +}); diff --git a/tests/Unit/App/Casts/OrderLineProductCastTest.php b/tests/Unit/App/Casts/OrderLineProductCastTest.php new file mode 100644 index 00000000..104d71a7 --- /dev/null +++ b/tests/Unit/App/Casts/OrderLineProductCastTest.php @@ -0,0 +1,144 @@ +get($model, 'product', null, []); + + // THEN +})->throws(\InvalidArgumentException::class, 'The value cannot be null.'); + +it('throws exception when getting non-string', function () { + // GIVEN + $cast = new OrderLineProductCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'product', 123, []); + + // THEN +})->throws(\InvalidArgumentException::class, 'The value must be a string.'); + +it('gets an order line product', function () { + // GIVEN + $cast = new OrderLineProductCast(); + $model = \Mockery::mock(Model::class); + $uuid = Uuid::uuid7()->toString(); + + $json = json_encode([ + 'inco_id' => 123, + 'original_id' => $uuid, + 'name' => 'Product Name', + 'weight' => 1000, + 'weight_variable' => false, + 'brand' => ProductBrand::loue->value, + 'order_unit' => OrderUnit::PCE->value, + 'price' => '1000', + 'discounted_price' => '800', + 'price_kg_ttc' => '1000', + 'tax_rate' => TaxRate::TVA_5_5->percent(), + 'picture' => 'pic.jpg', + ]); + + // WHEN + $product = $cast->get($model, 'product', $json, []); + + // THEN + expect($product)->toBeInstanceOf(OrderLineProduct::class) + ->and($product->incoId->value)->toBe(123) + ->and($product->originalId->value->toString())->toBe($uuid) + ->and($product->name)->toBe('Product Name') + ->and($product->weight->value)->toBe(1000) + ->and($product->weight->isVariable)->toBeFalse() + ->and($product->taxRate)->toBe(TaxRate::TVA_5_5) + ->and($product->picture)->toBe('pic.jpg'); +}); + +it('gets an order line product with integer tax rate and null picture', function () { + // GIVEN + $cast = new OrderLineProductCast(); + $model = \Mockery::mock(Model::class); + $uuid = Uuid::uuid7()->toString(); + + $json = json_encode([ + 'inco_id' => 123, + 'original_id' => $uuid, + 'name' => 'Product Name', + 'weight' => 1000, + 'weight_variable' => false, + 'brand' => ProductBrand::loue->value, + 'order_unit' => OrderUnit::PCE->value, + 'price' => '1000', + 'discounted_price' => '800', + 'price_kg_ttc' => '1000', + 'tax_rate' => 20, // integer from json_decode for 20% + 'picture' => null, + ]); + + // WHEN + $product = $cast->get($model, 'product', $json, []); + + // THEN + expect($product)->toBeInstanceOf(OrderLineProduct::class) + ->and($product->taxRate)->toBe(TaxRate::TVA_20) + ->and($product->picture)->toBeNull(); +}); + +it('throws exception when setting invalid type', function () { + // GIVEN + $cast = new OrderLineProductCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->set($model, 'product', 'invalid', []); + + // THEN +})->throws( + \InvalidArgumentException::class, + 'The given value is not an instance of OrderLineProduct.' +); + +it('sets an order line product', function () { + // GIVEN + $cast = new OrderLineProductCast(); + $model = \Mockery::mock(Model::class); + $currency = resolve(Currency::class); + + $product = new OrderLineProduct( + incoId: new IncoId(123), + originalId: new ProductId(Uuid::uuid7()), + name: 'Product Name', + weight: new ProductWeight(1000, false), + brand: ProductBrand::cases()[0], // Pick first enum case + orderUnit: OrderUnit::cases()[0], // Pick first enum case + price: new Money(1000, $currency), + discountedPrice: new Money(800, $currency), + priceKgTtc: new Money(1000, $currency), + taxRate: TaxRate::TVA_20, + picture: 'pic.jpg' + ); + + // WHEN + $value = $cast->set($model, 'product', $product, []); + + // THEN + expect($value)->toBeJson(); +}); diff --git a/tests/Unit/App/Casts/OrderReferenceCastTest.php b/tests/Unit/App/Casts/OrderReferenceCastTest.php new file mode 100644 index 00000000..2b1b48d9 --- /dev/null +++ b/tests/Unit/App/Casts/OrderReferenceCastTest.php @@ -0,0 +1,92 @@ +get($model, 'reference', $value, []); + + // THEN + expect($reference)->toBeInstanceOf(OrderReference::class) + ->and((string) $reference)->toBe($value) + ->and($reference->value->equals($uuid))->toBeTrue(); +}); + +it('gets a reference from raw uuid string', function () { + // GIVEN + $cast = new OrderReferenceCast(); + $model = \Mockery::mock(Model::class); + $uuid = Uuid::uuid7(); + $value = $uuid->toString(); + + // WHEN + $reference = $cast->get($model, 'reference', $value, []); + + // THEN + expect($reference)->toBeInstanceOf(OrderReference::class) + ->and((string) $reference)->toBe(UuidHelper::toBase58($uuid)) + ->and($reference->value->equals($uuid))->toBeTrue(); +}); + +it('throws exception when getting invalid reference', function () { + // GIVEN + $cast = new OrderReferenceCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'reference', 123, []); + + // THEN +})->throws(\UnexpectedValueException::class, 'OrderReference cannot be null.'); + +it('throws exception when getting null reference', function () { + // GIVEN + $cast = new OrderReferenceCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'reference', null, []); + + // THEN +})->throws(\UnexpectedValueException::class, 'OrderReference cannot be null.'); + +it('throws exception when setting invalid reference type', function () { + // GIVEN + $cast = new OrderReferenceCast(); + $model = \Mockery::mock(Model::class); + $value = UuidHelper::toBase58(Uuid::uuid7()); + + // WHEN + $cast->set($model, 'reference', $value, []); + + // THEN +})->throws( + \UnexpectedValueException::class, + 'The given value is not an instance of OrderReference.' +); + +it('sets a reference', function () { + // GIVEN + $cast = new OrderReferenceCast(); + $model = \Mockery::mock(Model::class); + $uuid = Uuid::uuid7(); + $reference = new OrderReference($uuid); + + // WHEN + $value = $cast->set($model, 'reference', $reference, []); + + // THEN + expect($value)->toBe(UuidHelper::toBase58($uuid)); +}); diff --git a/tests/Unit/App/Casts/ShopperEstablishmentCodeCastTest.php b/tests/Unit/App/Casts/ShopperEstablishmentCodeCastTest.php new file mode 100644 index 00000000..5c8576be --- /dev/null +++ b/tests/Unit/App/Casts/ShopperEstablishmentCodeCastTest.php @@ -0,0 +1,78 @@ +get($model, 'etablissement', 'ETAB01', []); + + // THEN + expect($code)->toBeInstanceOf(ShopperEstablishmentCode::class) + ->and($code->value)->toBe('ETAB01'); +}); + +it('throws exception when getting invalid ShopperEstablishmentCode type', function () { + // GIVEN + $cast = new ShopperEstablishmentCodeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'etablissement', 123, []); + + // THEN +})->throws(\UnexpectedValueException::class, 'ShopperEstablishmentCode must be a string.'); + +it('throws exception when getting null ShopperEstablishmentCode', function () { + // GIVEN + $cast = new ShopperEstablishmentCodeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'etablissement', null, []); + + // THEN +})->throws(\UnexpectedValueException::class, 'ShopperEstablishmentCode must be a string.'); + +it('sets a ShopperEstablishmentCode from instance', function () { + // GIVEN + $cast = new ShopperEstablishmentCodeCast(); + $model = \Mockery::mock(Model::class); + $vo = new ShopperEstablishmentCode('ETAB01'); + + // WHEN + $value = $cast->set($model, 'etablissement', $vo, []); + + // THEN + expect($value)->toBe('ETAB01'); +}); + +it('sets a ShopperEstablishmentCode from valid string', function () { + // GIVEN + $cast = new ShopperEstablishmentCodeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $value = $cast->set($model, 'etablissement', 'ETAB01', []); + + // THEN + expect($value)->toBe('ETAB01'); +}); + +it('throws exception when setting invalid ShopperEstablishmentCode type', function () { + // GIVEN + $cast = new ShopperEstablishmentCodeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->set($model, 'etablissement', 123, []); + + // THEN +})->throws(\UnexpectedValueException::class, 'The given value is not an instance of ShopperEstablishmentCode.'); diff --git a/tests/Unit/App/Casts/ShopperServiceCodeCastTest.php b/tests/Unit/App/Casts/ShopperServiceCodeCastTest.php new file mode 100644 index 00000000..02c3ad3c --- /dev/null +++ b/tests/Unit/App/Casts/ShopperServiceCodeCastTest.php @@ -0,0 +1,78 @@ +get($model, 'service', '101', []); + + // THEN + expect($code)->toBeInstanceOf(ShopperServiceCode::class) + ->and($code->value)->toBe('101'); +}); + +it('throws exception when getting invalid ShopperServiceCode type', function () { + // GIVEN + $cast = new ShopperServiceCodeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'service', 123, []); + + // THEN +})->throws(\UnexpectedValueException::class, 'ShopperServiceCode must be a string.'); + +it('throws exception when getting null ShopperServiceCode', function () { + // GIVEN + $cast = new ShopperServiceCodeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'service', null, []); + + // THEN +})->throws(\UnexpectedValueException::class, 'ShopperServiceCode must be a string.'); + +it('sets a ShopperServiceCode from instance', function () { + // GIVEN + $cast = new ShopperServiceCodeCast(); + $model = \Mockery::mock(Model::class); + $vo = new ShopperServiceCode('101'); + + // WHEN + $value = $cast->set($model, 'service', $vo, []); + + // THEN + expect($value)->toBe('101'); +}); + +it('sets a ShopperServiceCode from valid string', function () { + // GIVEN + $cast = new ShopperServiceCodeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $value = $cast->set($model, 'service', '101', []); + + // THEN + expect($value)->toBe('101'); +}); + +it('throws exception when setting invalid ShopperServiceCode type', function () { + // GIVEN + $cast = new ShopperServiceCodeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->set($model, 'service', 123, []); + + // THEN +})->throws(\UnexpectedValueException::class, 'The given value is not an instance of ShopperServiceCode.'); diff --git a/tests/Unit/App/Casts/ShopperSiteCodeCastTest.php b/tests/Unit/App/Casts/ShopperSiteCodeCastTest.php new file mode 100644 index 00000000..2209806c --- /dev/null +++ b/tests/Unit/App/Casts/ShopperSiteCodeCastTest.php @@ -0,0 +1,78 @@ +get($model, 'site', 'PA', []); + + // THEN + expect($code)->toBeInstanceOf(ShopperSiteCode::class) + ->and($code->value)->toBe('PA'); +}); + +it('throws exception when getting invalid ShopperSiteCode type', function () { + // GIVEN + $cast = new ShopperSiteCodeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'site', 123, []); + + // THEN +})->throws(\UnexpectedValueException::class, 'ShopperSiteCode must be a string.'); + +it('throws exception when getting null ShopperSiteCode', function () { + // GIVEN + $cast = new ShopperSiteCodeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->get($model, 'site', null, []); + + // THEN +})->throws(\UnexpectedValueException::class, 'ShopperSiteCode must be a string.'); + +it('sets a ShopperSiteCode from instance', function () { + // GIVEN + $cast = new ShopperSiteCodeCast(); + $model = \Mockery::mock(Model::class); + $vo = new ShopperSiteCode('PA'); + + // WHEN + $value = $cast->set($model, 'site', $vo, []); + + // THEN + expect($value)->toBe('PA'); +}); + +it('sets a ShopperSiteCode from valid string', function () { + // GIVEN + $cast = new ShopperSiteCodeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $value = $cast->set($model, 'site', 'PA', []); + + // THEN + expect($value)->toBe('PA'); +}); + +it('throws exception when setting invalid ShopperSiteCode type', function () { + // GIVEN + $cast = new ShopperSiteCodeCast(); + $model = \Mockery::mock(Model::class); + + // WHEN + $cast->set($model, 'site', 123, []); + + // THEN +})->throws(\UnexpectedValueException::class, 'The given value is not an instance of ShopperSiteCode.'); diff --git a/tests/Unit/App/Dto/DiscountDtoTest.php b/tests/Unit/App/Dto/DiscountDtoTest.php new file mode 100644 index 00000000..7a41406f --- /dev/null +++ b/tests/Unit/App/Dto/DiscountDtoTest.php @@ -0,0 +1,51 @@ +id)->toBe(42) + ->and($dto->type)->toBe(DiscountType::PERCENT) + ->and($dto->value)->toBe($value) + ->and($dto->is_old_price_displayed)->toBeTrue() + ->and($dto->date_start)->toEqual($dateStart) + ->and($dto->date_end)->toEqual($dateEnd) + ->and($dto->getRouteKey())->toBe(42) + ->and($dto->getRouteKeyName())->toBe('id') + ->and($dto->resolveRouteBinding(42))->toBeNull() + ->and($dto->resolveChildRouteBinding('child', 'val', 'field'))->toBeNull() + ->and($dto->toArray())->toBe([ + 'id' => 42, + 'type' => DiscountType::PERCENT->value(), + 'value' => 20, + 'is_old_price_displayed' => true, + 'date_start' => $dateStart, + 'date_end' => $dateEnd, + 'created_at' => null, + 'updated_at' => null, + ]); + }); +}); diff --git a/tests/Unit/App/Dto/DiscountProductDtoTest.php b/tests/Unit/App/Dto/DiscountProductDtoTest.php new file mode 100644 index 00000000..130f410b --- /dev/null +++ b/tests/Unit/App/Dto/DiscountProductDtoTest.php @@ -0,0 +1,37 @@ +id)->toBe($id) + ->and($dto->name)->toBe($name) + ->and($dto->toArray())->toBe([ + 'id' => $id, + 'name' => $name, + 'picture' => $picture, + ]) + ->and($dto->jsonSerialize())->toBe([ + 'id' => $id, + 'name' => $name, + 'picture' => $picture, + ]); + }); +}); diff --git a/tests/Unit/App/Dto/IcsContentDtoTest.php b/tests/Unit/App/Dto/IcsContentDtoTest.php new file mode 100644 index 00000000..b4090dc4 --- /dev/null +++ b/tests/Unit/App/Dto/IcsContentDtoTest.php @@ -0,0 +1,52 @@ +uid)->toBe('uid-123') + ->and($dto->summary)->toBe('My Event') + ->and($dto->description)->toBe('Event Description') + ->and($dto->startsAt)->toBe($startsAt) + ->and($dto->endsAt)->toBe($endsAt) + ->and($dto->url)->toBe('https://example.com'); + }); + + it('can be instantiated without optional url property', function (): void { + // GIVEN + $startsAt = CarbonImmutable::parse('2024-01-01 10:00:00'); + $endsAt = CarbonImmutable::parse('2024-01-01 12:00:00'); + + // WHEN + $dto = new IcsContentDto( + uid: 'uid-456', + summary: 'My Event 2', + description: 'Event Description 2', + startsAt: $startsAt, + endsAt: $endsAt, + ); + + // THEN + expect($dto->url)->toBeNull(); + }); +}); diff --git a/tests/Unit/App/Dto/OrderReminderDtoTest.php b/tests/Unit/App/Dto/OrderReminderDtoTest.php new file mode 100644 index 00000000..818714e0 --- /dev/null +++ b/tests/Unit/App/Dto/OrderReminderDtoTest.php @@ -0,0 +1,55 @@ +firstname)->toBe($firstname) + ->and($dto->lastname)->toBe($lastname) + ->and($dto->reference)->toBe($reference) + ->and($dto->total)->toBe($total) + ->and($dto->pickupDayFormatted)->toBe($pickupDayFormatted) + ->and($dto->lines)->toBe($lines) + ->and($dto->shopName)->toBe($shopName) + ->and($dto->shopAddress)->toBe($shopAddress) + ->and($dto->shopPostcode)->toBe($shopPostcode) + ->and($dto->shopCity)->toBe($shopCity); + }); +}); diff --git a/tests/Unit/App/Dto/OrderReminderLineDtoTest.php b/tests/Unit/App/Dto/OrderReminderLineDtoTest.php new file mode 100644 index 00000000..becbd5fb --- /dev/null +++ b/tests/Unit/App/Dto/OrderReminderLineDtoTest.php @@ -0,0 +1,29 @@ +name)->toBe($name) + ->and($dto->quantity)->toBe($quantity) + ->and($dto->priceKgTtc)->toBe($priceKgTtc) + ->and($dto->totalTtc)->toBe($totalTtc); + }); +}); diff --git a/tests/Unit/App/Dto/PageDtoTest.php b/tests/Unit/App/Dto/PageDtoTest.php new file mode 100644 index 00000000..3cdf6b9f --- /dev/null +++ b/tests/Unit/App/Dto/PageDtoTest.php @@ -0,0 +1,43 @@ +id = 1; + $page->slug = StaticPageSlug::FAQ; + $page->seo_title = 'FAQ SEO Title'; + $page->seo_description = 'FAQ SEO Description'; + $page->title = 'Foire aux questions'; + $page->content = '

Questions et réponses

'; + + // WHEN + $dto = PageDto::fromModel($page); + + // THEN + expect($dto->id)->toBe(1) + ->and($dto->slug)->toBe(StaticPageSlug::FAQ) + ->and($dto->seo_title)->toBe('FAQ SEO Title') + ->and($dto->seo_description)->toBe('FAQ SEO Description') + ->and($dto->title)->toBe('Foire aux questions') + ->and($dto->content)->toBe('

Questions et réponses

') + ->and($dto->getRouteKey())->toBe('faq') + ->and($dto->getRouteKeyName())->toBe('slug') + ->and($dto->resolveRouteBinding('faq'))->toBeNull() + ->and($dto->resolveChildRouteBinding('child', 'val', 'field'))->toBeNull() + ->and($dto->toArray())->toBe([ + 'id' => 1, + 'slug' => StaticPageSlug::FAQ, + 'seo_title' => 'FAQ SEO Title', + 'seo_description' => 'FAQ SEO Description', + 'title' => 'Foire aux questions', + 'content' => '

Questions et réponses

', + ]); + }); +}); diff --git a/tests/Unit/App/Dto/PickupExceptionDtoTest.php b/tests/Unit/App/Dto/PickupExceptionDtoTest.php new file mode 100644 index 00000000..7e211f76 --- /dev/null +++ b/tests/Unit/App/Dto/PickupExceptionDtoTest.php @@ -0,0 +1,47 @@ +id)->toBe('018f6c40-1234-7123-8123-123456789012') + ->and($dto->label)->toBe('1er Mai') + ->and($dto->repeatable)->toBeTrue() + ->and($dto->repeat_frequency)->toBe(RepeatFrequency::YEARLY) + ->and($dto->auto_updated)->toBeFalse() + ->and($dto->pivot)->not->toBeNull() + ->and($dto->getRouteKey())->toBe('018f6c40-1234-7123-8123-123456789012') + ->and($dto->getRouteKeyName())->toBe('id') + ->and($dto->resolveRouteBinding('some-id'))->toBeNull() + ->and($dto->resolveChildRouteBinding('child', 'some-id', 'field'))->toBeNull(); + + $array = $dto->toArray(); + expect($array)->toHaveKey('id', '018f6c40-1234-7123-8123-123456789012') + ->and($array)->toHaveKey('label', '1er Mai') + ->and($array)->toHaveKey('repeat_frequency', RepeatFrequency::YEARLY->value); + }); +}); diff --git a/tests/Unit/App/Dto/ProductDtoTest.php b/tests/Unit/App/Dto/ProductDtoTest.php new file mode 100644 index 00000000..0ca9fce3 --- /dev/null +++ b/tests/Unit/App/Dto/ProductDtoTest.php @@ -0,0 +1,55 @@ +id)->toBe($id) + ->and($dto->name)->toBe($name) + ->and($dto->slug)->toBe($slug) + ->and($dto->getRouteKey())->toBe($slug) + ->and($dto->getRouteKeyName())->toBe('slug') + ->and($dto->resolveRouteBinding('some-id'))->toBeNull() + ->and($dto->resolveChildRouteBinding('child', 'some-id', 'field'))->toBeNull(); + + $array = $dto->toArray(); + expect($array)->toBe([ + 'id' => $id, + 'name' => $name, + 'slug' => $slug, + 'brand' => null, + 'inco' => null, + 'picture' => null, + 'picture_alt' => null, + 'picture_title' => null, + 'picture_large' => null, + 'picture_large_alt' => null, + 'picture_large_title' => null, + 'price' => null, + 'discount' => null, + 'stock' => 0, + 'sell_unit' => null, + 'range' => null, + 'order' => 0, + 'status' => false, + 'star' => false, + 'short_description' => null, + 'description' => null, + ]); + }); +}); diff --git a/tests/Unit/App/Dto/ProductIncoDtoTest.php b/tests/Unit/App/Dto/ProductIncoDtoTest.php new file mode 100644 index 00000000..755e6401 --- /dev/null +++ b/tests/Unit/App/Dto/ProductIncoDtoTest.php @@ -0,0 +1,52 @@ +id)->toBe(42) + ->and($dto->no_art)->toBe(105) + ->and($dto->product_id)->toBe('018f6c40-1234-7123-8123-123456789012') + ->and($dto->ingredients)->toBe('Volaille, sel') + ->and($dto->preparation)->toBe('Au four 30min') + ->and($dto->servings)->toBe('4 personnes') + ->and($dto->allergens)->toBe('Aucun') + ->and($dto->selling_argument)->toBe('Origine France') + ->and($dto->nutriscore)->toBe(Nutriscore::A) + ->and($dto->nutriscore_args)->toBe('Faible en gras') + ->and($dto->nutrition)->toBe($nutrition) + ->and($dto->getRouteKey())->toBe(42) + ->and($dto->getRouteKeyName())->toBe('id') + ->and($dto->resolveRouteBinding('some-id'))->toBeNull() + ->and($dto->resolveChildRouteBinding('child', 'some-id', 'field'))->toBeNull(); + + $array = $dto->toArray(); + expect($array)->toHaveKey('id', 42) + ->and($array)->toHaveKey('no_art', 105) + ->and($array)->toHaveKey('nutriscore', Nutriscore::A->value) + ->and($array['nutrition'])->toHaveKey('nv_ref_weight_g', 100.0); + }); +}); diff --git a/tests/Unit/App/Dto/RangeDtoTest.php b/tests/Unit/App/Dto/RangeDtoTest.php new file mode 100644 index 00000000..83440bed --- /dev/null +++ b/tests/Unit/App/Dto/RangeDtoTest.php @@ -0,0 +1,43 @@ + 1, + 'name' => 'Gamme Découverte', + 'slug' => 'gamme-decouverte', + 'description' => '

Description

', + 'picture' => 'ranges/pic.jpg', + 'picture_alt' => 'Alt text', + 'picture_title' => 'Title text', + 'order' => 2, + 'status' => true, + ]; + + // WHEN + $dto = new RangeDto(...$data); + + // THEN + expect($dto->id)->toBe(1) + ->and($dto->name)->toBe('Gamme Découverte') + ->and($dto->slug)->toBe('gamme-decouverte') + ->and($dto->getRouteKey())->toBe('gamme-decouverte') + ->and($dto->getRouteKeyName())->toBe('slug') + ->and($dto->toArray())->toBe([ + 'id' => 1, + 'name' => 'Gamme Découverte', + 'slug' => 'gamme-decouverte', + 'description' => '

Description

', + 'picture' => 'ranges/pic.jpg', + 'picture_alt' => 'Alt text', + 'picture_title' => 'Title text', + 'order' => 2, + 'status' => true, + ]); + }); +}); diff --git a/tests/Unit/App/Dto/SettingDtoTest.php b/tests/Unit/App/Dto/SettingDtoTest.php new file mode 100644 index 00000000..f7d35f6e --- /dev/null +++ b/tests/Unit/App/Dto/SettingDtoTest.php @@ -0,0 +1,34 @@ +id)->toBe(1) + ->and($dto->employeeSites)->toBe(['PA', 'LY']) + ->and($dto->employeeSitesAsString())->toBe('PA, LY') + ->and($dto->getShopperSiteCodes())->toHaveCount(2) + ->and($dto->getShopperSiteCodes()[0])->toBeInstanceOf(ShopperSiteCode::class) + ->and($dto->getShopperSiteCodes()[0]->value)->toBe('PA') + ->and($dto->getShopperSiteCodes()[1]->value)->toBe('LY') + ->and($dto->getRouteKey())->toBe(1) + ->and($dto->getRouteKeyName())->toBe('setting') + ->and($dto->resolveRouteBinding(1))->toBeNull() + ->and($dto->resolveChildRouteBinding('child', 'val', 'field'))->toBeNull() + ->and($dto->toArray())->toBe([ + 'id' => 1, + 'employee_sites' => ['PA', 'LY'], + ]); + }); +}); diff --git a/tests/Unit/App/Dto/ShopDtoTest.php b/tests/Unit/App/Dto/ShopDtoTest.php new file mode 100644 index 00000000..a35702d0 --- /dev/null +++ b/tests/Unit/App/Dto/ShopDtoTest.php @@ -0,0 +1,74 @@ +id)->toBe('018f4a2b-3c4d-7e8f-9a0b-1c2d3e4f5a6b') + ->and($dto->name)->toBe('Boutique Principale') + ->and($dto->getRouteKey())->toBe('018f4a2b-3c4d-7e8f-9a0b-1c2d3e4f5a6b') + ->and($dto->getRouteKeyName())->toBe('id') + ->and($dto->default)->toBeTrue() + ->and($dto->toArray())->toBe([ + 'id' => '018f4a2b-3c4d-7e8f-9a0b-1c2d3e4f5a6b', + 'name' => 'Boutique Principale', + 'address' => '1 rue de Paris', + 'postcode' => '75001', + 'city' => 'Paris', + 'phone' => '+33102030405', + 'latitude' => '48.8566', + 'longitude' => '2.3522', + 'default' => true, + ]); + }); + + test('it can be created from domain Shop entity', function () { + // GIVEN + $uuid = Uuid::uuid7(); + $shopId = new ShopId($uuid); + $domainShop = new Shop( + id: $shopId, + name: 'Boutique Domain', + address: '10 avenue de la Gare', + postcode: '69001', + city: 'Lyon', + phone: '0478000000', + latitude: '45.75', + longitude: '4.85', + isDefault: true, + ); + + // WHEN + $dto = ShopDto::fromDomain($domainShop); + + // THEN + expect($dto->id)->toBe($uuid->toString()) + ->and($dto->name)->toBe('Boutique Domain') + ->and($dto->address)->toBe('10 avenue de la Gare') + ->and($dto->postcode)->toBe('69001') + ->and($dto->city)->toBe('Lyon') + ->and($dto->phone)->toBe('0478000000') + ->and($dto->latitude)->toBe('45.75') + ->and($dto->longitude)->toBe('4.85') + ->and($dto->default)->toBeTrue(); + }); +}); diff --git a/tests/Unit/App/Dto/SlideDtoTest.php b/tests/Unit/App/Dto/SlideDtoTest.php new file mode 100644 index 00000000..46d8eec2 --- /dev/null +++ b/tests/Unit/App/Dto/SlideDtoTest.php @@ -0,0 +1,71 @@ +Découvrez notre nouvelle collection

', + picture: 'storage/modelfiles/slides/26/06/01/ab/summer.jpg', + picture_alt: 'Collection Été', + picture_title: 'Bannière promotionnelle été', + link: 'https://example.com/ete', + link_label: 'Voir les offres', + link_new_tab: true, + connected: false, + date_start: $dateStart, + date_end: $dateEnd, + order: 3, + status: true, + isVisible: true, + ); + + // THEN + expect($dto->id)->toBe(42) + ->and($dto->title)->toBe('Bannière Été') + ->and($dto->text)->toBe('

Découvrez notre nouvelle collection

') + ->and($dto->picture)->toBe('storage/modelfiles/slides/26/06/01/ab/summer.jpg') + ->and($dto->picture_alt)->toBe('Collection Été') + ->and($dto->picture_title)->toBe('Bannière promotionnelle été') + ->and($dto->link)->toBe('https://example.com/ete') + ->and($dto->link_label)->toBe('Voir les offres') + ->and($dto->link_new_tab)->toBeTrue() + ->and($dto->connected)->toBeFalse() + ->and($dto->date_start)->toEqual($dateStart) + ->and($dto->date_end)->toEqual($dateEnd) + ->and($dto->order)->toBe(3) + ->and($dto->status)->toBeTrue() + ->and($dto->isVisible())->toBeTrue() + ->and($dto->getRouteKey())->toBe(42) + ->and($dto->getRouteKeyName())->toBe('id') + ->and($dto->resolveRouteBinding(42))->toBeNull() + ->and($dto->resolveChildRouteBinding('child', 'val', 'field'))->toBeNull() + ->and($dto->toArray())->toBe([ + 'id' => 42, + 'title' => 'Bannière Été', + 'text' => '

Découvrez notre nouvelle collection

', + 'picture' => 'storage/modelfiles/slides/26/06/01/ab/summer.jpg', + 'picture_alt' => 'Collection Été', + 'picture_title' => 'Bannière promotionnelle été', + 'link' => 'https://example.com/ete', + 'link_label' => 'Voir les offres', + 'link_new_tab' => true, + 'connected' => false, + 'date_start' => $dateStart, + 'date_end' => $dateEnd, + 'order' => 3, + 'status' => true, + 'is_visible' => true, + ]); + }); +}); diff --git a/tests/Unit/App/Http/Middleware/EnsureCustomerEmailIsVerifiedTest.php b/tests/Unit/App/Http/Middleware/EnsureCustomerEmailIsVerifiedTest.php new file mode 100644 index 00000000..e36c3031 --- /dev/null +++ b/tests/Unit/App/Http/Middleware/EnsureCustomerEmailIsVerifiedTest.php @@ -0,0 +1,105 @@ +shouldReceive('getCustomer')->andReturn($customer); + $authService->shouldReceive('hasVerifiedEmail')->with($customer)->andReturn(false); + + $middleware = new EnsureCustomerEmailIsVerified($authService); + + $request = Request::create('/some-url', 'GET'); + + URL::shouldReceive('route')->with('fo.auth.verification.notice')->andReturn('http://localhost/verification-notice'); + Redirect::shouldReceive('guest')->with('http://localhost/verification-notice')->andReturn(new RedirectResponse('http://localhost/verification-notice')); + + // WHEN + $response = $middleware->handle($request, function ($req) { + return new Response('Next'); + }); + + // THEN + expect($response)->toBeInstanceOf(RedirectResponse::class); + expect($response->getTargetUrl())->toBe('http://localhost/verification-notice'); + }); + + it('aborts with 403 if customer is not verified and expects JSON', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $customer = \Mockery::mock(Customer::class); + $authService->shouldReceive('getCustomer')->andReturn($customer); + $authService->shouldReceive('hasVerifiedEmail')->with($customer)->andReturn(false); + + $middleware = new EnsureCustomerEmailIsVerified($authService); + + $request = Request::create('/some-url', 'GET'); + $request->headers->set('Accept', 'application/json'); + + URL::shouldReceive('route')->with('fo.auth.verification.notice')->andReturn('http://localhost/verification-notice'); + + // WHEN / THEN + expect(fn () => $middleware->handle($request, function ($req) { + return new Response('Next'); + }))->toThrow(HttpException::class, 'Your email address is not verified.'); + }); + + it('proceeds if customer is verified', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $customer = \Mockery::mock(Customer::class); + $authService->shouldReceive('getCustomer')->andReturn($customer); + $authService->shouldReceive('hasVerifiedEmail')->with($customer)->andReturn(true); + + $middleware = new EnsureCustomerEmailIsVerified($authService); + + $request = Request::create('/some-url', 'GET'); + + // WHEN + $response = $middleware->handle($request, function ($req) { + return new Response('Next'); + }); + + // THEN + expect($response->getContent())->toBe('Next'); + }); + + it('proceeds if no customer is logged in', function () { + // GIVEN + $authService = \Mockery::mock(AppCustomerAuthService::class); + $authService->shouldReceive('getCustomer')->andReturn(null); + + $middleware = new EnsureCustomerEmailIsVerified($authService); + + $request = Request::create('/some-url', 'GET'); + + // WHEN + $response = $middleware->handle($request, function ($req) { + return new Response('Next'); + }); + + // THEN + expect($response->getContent())->toBe('Next'); + }); + + it('returns redirectTo static method', function () { + // GIVEN / WHEN / THEN + expect(EnsureCustomerEmailIsVerified::redirectTo('my.route'))->toBe(EnsureCustomerEmailIsVerified::class . ':my.route'); + }); +}); diff --git a/tests/Unit/App/Policies/Backend/DiscountPolicyTest.php b/tests/Unit/App/Policies/Backend/DiscountPolicyTest.php new file mode 100644 index 00000000..4cb45afe --- /dev/null +++ b/tests/Unit/App/Policies/Backend/DiscountPolicyTest.php @@ -0,0 +1,142 @@ +viewAny($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('viewAny returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new DiscountPolicy(); + + // WHEN + $result = $policy->viewAny($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('view returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new DiscountPolicy(); + $modelInstance = new Discount(); + + // WHEN + $result = $policy->view($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('view returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new DiscountPolicy(); + $modelInstance = new Discount(); + + // WHEN + $result = $policy->view($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('create returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new DiscountPolicy(); + + // WHEN + $result = $policy->create($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('create returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new DiscountPolicy(); + + // WHEN + $result = $policy->create($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('update returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new DiscountPolicy(); + $modelInstance = new Discount(); + + // WHEN + $result = $policy->update($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('update returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new DiscountPolicy(); + $modelInstance = new Discount(); + + // WHEN + $result = $policy->update($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('delete returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new DiscountPolicy(); + $modelInstance = new Discount(); + + // WHEN + $result = $policy->delete($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('delete returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new DiscountPolicy(); + $modelInstance = new Discount(); + + // WHEN + $result = $policy->delete($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); +}); diff --git a/tests/Unit/App/Policies/Backend/FaqPolicyTest.php b/tests/Unit/App/Policies/Backend/FaqPolicyTest.php new file mode 100644 index 00000000..e73b51f7 --- /dev/null +++ b/tests/Unit/App/Policies/Backend/FaqPolicyTest.php @@ -0,0 +1,142 @@ +viewAny($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('viewAny returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new FaqPolicy(); + + // WHEN + $result = $policy->viewAny($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('view returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new FaqPolicy(); + $modelInstance = new Faq(); + + // WHEN + $result = $policy->view($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('view returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new FaqPolicy(); + $modelInstance = new Faq(); + + // WHEN + $result = $policy->view($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('create returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new FaqPolicy(); + + // WHEN + $result = $policy->create($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('create returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new FaqPolicy(); + + // WHEN + $result = $policy->create($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('update returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new FaqPolicy(); + $modelInstance = new Faq(); + + // WHEN + $result = $policy->update($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('update returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new FaqPolicy(); + $modelInstance = new Faq(); + + // WHEN + $result = $policy->update($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('delete returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new FaqPolicy(); + $modelInstance = new Faq(); + + // WHEN + $result = $policy->delete($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('delete returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new FaqPolicy(); + $modelInstance = new Faq(); + + // WHEN + $result = $policy->delete($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); +}); diff --git a/tests/Unit/App/Policies/Backend/OrderPolicyTest.php b/tests/Unit/App/Policies/Backend/OrderPolicyTest.php new file mode 100644 index 00000000..f12f0630 --- /dev/null +++ b/tests/Unit/App/Policies/Backend/OrderPolicyTest.php @@ -0,0 +1,132 @@ +viewAnyToday($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('viewAnyToday returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new OrderPolicy(); + + // WHEN + $result = $policy->viewAnyToday($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('viewAny returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new OrderPolicy(); + + // WHEN + $result = $policy->viewAny($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('viewAny returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new OrderPolicy(); + + // WHEN + $result = $policy->viewAny($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('view returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new OrderPolicy(); + $order = new Order(); + + // WHEN + $result = $policy->view($customer, $order); + + // THEN + expect($result)->toBeFalse(); + }); + + test('view returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new OrderPolicy(); + $order = new Order(); + + // WHEN + $result = $policy->view($user, $order); + + // THEN + expect($result)->toBeTrue(); + }); + + test('cancel returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new OrderPolicy(); + $order = new Order(); + + // WHEN + $result = $policy->cancel($customer, $order); + + // THEN + expect($result)->toBeFalse(); + }); + + test('cancel returns true for admin user when order is not canceled', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $order = new Order(); + $order->status = OrderStatus::WAITING; + $policy = new OrderPolicy(); + + // WHEN + $result = $policy->cancel($user, $order); + + // THEN + expect($result)->toBeTrue(); + }); + + test('cancel returns false for admin user when order is canceled', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $order = new Order(); + $order->status = OrderStatus::CANCELED; + $policy = new OrderPolicy(); + + // WHEN + $result = $policy->cancel($user, $order); + + // THEN + expect($result)->toBeFalse(); + }); +}); diff --git a/tests/Unit/App/Policies/Backend/PagePolicyTest.php b/tests/Unit/App/Policies/Backend/PagePolicyTest.php new file mode 100644 index 00000000..30b755f7 --- /dev/null +++ b/tests/Unit/App/Policies/Backend/PagePolicyTest.php @@ -0,0 +1,61 @@ +update($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('update returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new PagePolicy(); + $modelInstance = new Page(); + + // WHEN + $result = $policy->update($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('update returns true for admin user with PageDto', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new PagePolicy(); + $page = new Page(); + $page->id = 1; + $page->slug = StaticPageSlug::FAQ; + $page->seo_title = 'SEO Title'; + $page->seo_description = 'SEO Description'; + $page->title = 'Title'; + $page->content = 'Content'; + $dto = PageDto::fromModel($page); + + // WHEN + $result = $policy->update($user, $dto); + + // THEN + expect($result)->toBeTrue(); + }); +}); diff --git a/tests/Unit/App/Policies/Backend/PickupExceptionPolicyTest.php b/tests/Unit/App/Policies/Backend/PickupExceptionPolicyTest.php new file mode 100644 index 00000000..d2d215b0 --- /dev/null +++ b/tests/Unit/App/Policies/Backend/PickupExceptionPolicyTest.php @@ -0,0 +1,165 @@ +viewAny($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('viewAny returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new PickupExceptionPolicy(); + + // WHEN + $result = $policy->viewAny($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('view returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new PickupExceptionPolicy(); + $modelInstance = new PickupException(); + + // WHEN + $result = $policy->view($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('view returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new PickupExceptionPolicy(); + $modelInstance = new PickupException(); + + // WHEN + $result = $policy->view($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('create returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new PickupExceptionPolicy(); + + // WHEN + $result = $policy->create($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('create returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new PickupExceptionPolicy(); + + // WHEN + $result = $policy->create($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('update returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new PickupExceptionPolicy(); + $modelInstance = new PickupException(); + + // WHEN + $result = $policy->update($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('update returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new PickupExceptionPolicy(); + $modelInstance = new PickupException(); + + // WHEN + $result = $policy->update($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('delete returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new PickupExceptionPolicy(); + $modelInstance = new PickupException(); + + // WHEN + $result = $policy->delete($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('delete returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new PickupExceptionPolicy(); + $modelInstance = new PickupException(); + + // WHEN + $result = $policy->delete($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('policy methods work with PickupExceptionDto', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new PickupExceptionPolicy(); + $dto = new PickupExceptionDto( + id: '018f6c40-1234-7123-8123-123456789012', + date: Carbon::parse('2026-05-01'), + label: '1er Mai', + repeatable: true, + repeat_frequency: RepeatFrequency::YEARLY, + auto_updated: false, + ); + + // WHEN & THEN + expect($policy->view($user, $dto))->toBeTrue() + ->and($policy->update($user, $dto))->toBeTrue() + ->and($policy->delete($user, $dto))->toBeTrue(); + }); +}); diff --git a/tests/Unit/App/Policies/Backend/ProductPolicyTest.php b/tests/Unit/App/Policies/Backend/ProductPolicyTest.php new file mode 100644 index 00000000..0507393b --- /dev/null +++ b/tests/Unit/App/Policies/Backend/ProductPolicyTest.php @@ -0,0 +1,371 @@ +viewAny($customer); + + // THEN + expect($result)->toBeFalse(); + }); + test('viewAny returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = getProductPolicy(); + + // WHEN + $result = $policy->viewAny($user); + + // THEN + expect($result)->toBeTrue(); + }); + + // create + test('create returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = getProductPolicy(); + + // WHEN + $result = $policy->create($customer); + + // THEN + expect($result)->toBeFalse(); + }); + test('create returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = getProductPolicy(); + + // WHEN + $result = $policy->create($user); + + // THEN + expect($result)->toBeTrue(); + }); + + // update + test('update returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $product = new Product(); + $policy = getProductPolicy(); + + // WHEN + $result = $policy->update($customer, $product); + + // THEN + expect($result)->toBeFalse(); + }); + test('update returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $product = new Product(); + $policy = getProductPolicy(); + + // WHEN + $result = $policy->update($user, $product); + + // THEN + expect($result)->toBeTrue(); + }); + + // delete + test('delete returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $product = new Product(); + $policy = getProductPolicy(); + + // WHEN + $result = $policy->delete($customer, $product); + + // THEN + expect($result)->toBeFalse(); + }); + test('delete returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $product = new Product(); + $policy = getProductPolicy(); + + // WHEN + $result = $policy->delete($user, $product); + + // THEN + expect($result)->toBeTrue(); + }); + + // toggleStatus + test('toggleStatus returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = getProductPolicy(); + + // WHEN + $result = $policy->toggleStatus($customer); + + // THEN + expect($result)->toBeFalse(); + }); + test('toggleStatus returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = getProductPolicy(); + + // WHEN + $result = $policy->toggleStatus($user); + + // THEN + expect($result)->toBeTrue(); + }); + + // toggleStar + test('toggleStar returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = getProductPolicy(); + + // WHEN + $result = $policy->toggleStar($customer); + + // THEN + expect($result)->toBeFalse(); + }); + test('toggleStar returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = getProductPolicy(); + + // WHEN + $result = $policy->toggleStar($user); + + // THEN + expect($result)->toBeTrue(); + }); + + // viewStarred + test('viewStarred returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = getProductPolicy(); + + // WHEN + $result = $policy->viewStarred($customer); + + // THEN + expect($result)->toBeFalse(); + }); + test('viewStarred returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = getProductPolicy(); + + // WHEN + $result = $policy->viewStarred($user); + + // THEN + expect($result)->toBeTrue(); + }); + + // createInco + test('createInco returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $product = new Product(); + $policy = getProductPolicy(); + + // WHEN + $result = $policy->createInco($customer, $product); + + // THEN + expect($result)->toBeFalse(); + }); + test('createInco returns true for admin when inco does not exist', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $product = \Mockery::mock(Product::class); + $incoMock = \Mockery::mock(HasOne::class); + $incoMock->shouldReceive('exists')->andReturn(false); + $product->shouldReceive('inco')->andReturn($incoMock); + $policy = getProductPolicy(); + + // WHEN + $result = $policy->createInco($user, $product); + + // THEN + expect($result)->toBeTrue(); + }); + test('createInco returns false for admin when inco exists', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $product = \Mockery::mock(Product::class); + $incoMock = \Mockery::mock(HasOne::class); + $incoMock->shouldReceive('exists')->andReturn(true); + $product->shouldReceive('inco')->andReturn($incoMock); + $policy = getProductPolicy(); + + // WHEN + $result = $policy->createInco($user, $product); + + // THEN + expect($result)->toBeFalse(); + }); + + // updateInco + test('updateInco returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $product = new Product(); + $policy = getProductPolicy(); + + // WHEN + $result = $policy->updateInco($customer, $product); + + // THEN + expect($result)->toBeFalse(); + }); + test('updateInco returns false for admin when inco does not exist', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $product = \Mockery::mock(Product::class); + $incoMock = \Mockery::mock(HasOne::class); + $incoMock->shouldReceive('exists')->andReturn(false); + $product->shouldReceive('inco')->andReturn($incoMock); + $policy = getProductPolicy(); + + // WHEN + $result = $policy->updateInco($user, $product); + + // THEN + expect($result)->toBeFalse(); + }); + test('updateInco returns true for admin when inco exists', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $product = \Mockery::mock(Product::class); + $incoMock = \Mockery::mock(HasOne::class); + $incoMock->shouldReceive('exists')->andReturn(true); + $product->shouldReceive('inco')->andReturn($incoMock); + $policy = getProductPolicy(); + + // WHEN + $result = $policy->updateInco($user, $product); + + // THEN + expect($result)->toBeTrue(); + }); + + // viewPublished + test('viewPublished returns false when product not found in domain repo', function () { + // GIVEN + $product = \Mockery::mock(Product::class); + $productId = new ProductId(Uuid::uuid7()); + $product->shouldReceive('getId')->andReturn($productId); + + $repo = \Mockery::mock(ProductRepository::class); + $repo->shouldReceive('find')->andReturn(null); + $policy = getProductPolicy($repo); + + // WHEN + $result = $policy->viewPublished(null, $product); + + // THEN + expect($result)->toBeFalse(); + }); + + test('viewPublished returns true when product found and is published', function () { + // GIVEN + $product = \Mockery::mock(Product::class); + $productId = new ProductId(Uuid::uuid7()); + $product->shouldReceive('getId')->andReturn($productId); + + $domainProduct = createDomainProduct(status: true); + $repo = \Mockery::mock(ProductRepository::class); + $repo->shouldReceive('find')->andReturn($domainProduct); + + $policy = getProductPolicy($repo); + + // WHEN + $result = $policy->viewPublished(null, $product); + + // THEN + expect($result)->toBeTrue(); + }); + + test('viewPublished returns false when product found and is not published', function () { + // GIVEN + $product = \Mockery::mock(Product::class); + $productId = new ProductId(Uuid::uuid7()); + $product->shouldReceive('getId')->andReturn($productId); + + $domainProduct = createDomainProduct(status: false); + $repo = \Mockery::mock(ProductRepository::class); + $repo->shouldReceive('find')->andReturn($domainProduct); + + $policy = getProductPolicy($repo); + + // WHEN + $result = $policy->viewPublished(null, $product); + + // THEN + expect($result)->toBeFalse(); + }); +}); diff --git a/tests/Unit/App/Policies/Backend/RangePolicyTest.php b/tests/Unit/App/Policies/Backend/RangePolicyTest.php new file mode 100644 index 00000000..ff82dd8d --- /dev/null +++ b/tests/Unit/App/Policies/Backend/RangePolicyTest.php @@ -0,0 +1,191 @@ +viewAny($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('viewAny returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new RangePolicy(); + + // WHEN + $result = $policy->viewAny($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('view returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new RangePolicy(); + $modelInstance = new Range(); + + // WHEN + $result = $policy->view($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('view returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new RangePolicy(); + $modelInstance = new Range(); + + // WHEN + $result = $policy->view($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('create returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new RangePolicy(); + + // WHEN + $result = $policy->create($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('create returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new RangePolicy(); + + // WHEN + $result = $policy->create($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('update returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new RangePolicy(); + $modelInstance = new Range(); + + // WHEN + $result = $policy->update($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('update returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new RangePolicy(); + $modelInstance = new Range(); + + // WHEN + $result = $policy->update($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('delete returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new RangePolicy(); + $modelInstance = new Range(); + + // WHEN + $result = $policy->delete($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('delete returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new RangePolicy(); + $modelInstance = new Range(); + + // WHEN + $result = $policy->delete($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('toggleStatus returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new RangePolicy(); + + // WHEN + $result = $policy->toggleStatus($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('toggleStatus returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new RangePolicy(); + + // WHEN + $result = $policy->toggleStatus($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('view, update, delete return true for admin user with RangeDto', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new RangePolicy(); + $dto = new RangeDto( + id: 1, + name: 'Gamme Test', + slug: 'gamme-test', + description: null, + picture: null, + picture_alt: '', + picture_title: '', + order: 1, + status: true, + ); + + // WHEN & THEN + expect($policy->view($user, $dto))->toBeTrue() + ->and($policy->update($user, $dto))->toBeTrue() + ->and($policy->delete($user, $dto))->toBeTrue(); + }); +}); diff --git a/tests/Unit/App/Policies/Backend/ShopPolicyTest.php b/tests/Unit/App/Policies/Backend/ShopPolicyTest.php new file mode 100644 index 00000000..a08b7fc0 --- /dev/null +++ b/tests/Unit/App/Policies/Backend/ShopPolicyTest.php @@ -0,0 +1,167 @@ +viewAny($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('viewAny returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new ShopPolicy(); + + // WHEN + $result = $policy->viewAny($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('view returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new ShopPolicy(); + $modelInstance = new Shop(); + + // WHEN + $result = $policy->view($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('view returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new ShopPolicy(); + $modelInstance = new Shop(); + + // WHEN + $result = $policy->view($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('create returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new ShopPolicy(); + + // WHEN + $result = $policy->create($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('create returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new ShopPolicy(); + + // WHEN + $result = $policy->create($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('update returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new ShopPolicy(); + $modelInstance = new Shop(); + + // WHEN + $result = $policy->update($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('update returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new ShopPolicy(); + $modelInstance = new Shop(); + + // WHEN + $result = $policy->update($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('delete returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new ShopPolicy(); + $modelInstance = new Shop(); + + // WHEN + $result = $policy->delete($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('delete returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new ShopPolicy(); + $modelInstance = new Shop(); + + // WHEN + $result = $policy->delete($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('pickupExceptionUpdate returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new ShopPolicy(); + + // WHEN + $result = $policy->pickupExceptionUpdate($customer, new Shop()); + + // THEN + expect($result)->toBeFalse(); + }); + + test('pickupExceptionUpdate returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new ShopPolicy(); + + // WHEN + $result = $policy->pickupExceptionUpdate($user, new Shop()); + + // THEN + expect($result)->toBeTrue(); + }); +}); diff --git a/tests/Unit/App/Policies/Backend/SlidePolicyTest.php b/tests/Unit/App/Policies/Backend/SlidePolicyTest.php new file mode 100644 index 00000000..0c6802c1 --- /dev/null +++ b/tests/Unit/App/Policies/Backend/SlidePolicyTest.php @@ -0,0 +1,196 @@ +viewAny($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('viewAny returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new SlidePolicy(); + + // WHEN + $result = $policy->viewAny($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('view returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new SlidePolicy(); + $modelInstance = new Slide(); + + // WHEN + $result = $policy->view($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('view returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new SlidePolicy(); + $modelInstance = new Slide(); + + // WHEN + $result = $policy->view($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('create returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new SlidePolicy(); + + // WHEN + $result = $policy->create($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('create returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new SlidePolicy(); + + // WHEN + $result = $policy->create($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('update returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new SlidePolicy(); + $modelInstance = new Slide(); + + // WHEN + $result = $policy->update($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('update returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new SlidePolicy(); + $modelInstance = new Slide(); + + // WHEN + $result = $policy->update($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('delete returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new SlidePolicy(); + $modelInstance = new Slide(); + + // WHEN + $result = $policy->delete($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('delete returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new SlidePolicy(); + $modelInstance = new Slide(); + + // WHEN + $result = $policy->delete($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('toggleStatus returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new SlidePolicy(); + + // WHEN + $result = $policy->toggleStatus($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('toggleStatus returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new SlidePolicy(); + + // WHEN + $result = $policy->toggleStatus($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('view, update, delete return true for admin user with SlideDto', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new SlidePolicy(); + $dto = new SlideDto( + id: 1, + title: 'Titre', + text: null, + picture: 'pic.jpg', + picture_alt: null, + picture_title: null, + link: null, + link_label: null, + link_new_tab: false, + connected: false, + date_start: null, + date_end: null, + order: 1, + status: true, + ); + + // WHEN & THEN + expect($policy->view($user, $dto))->toBeTrue() + ->and($policy->update($user, $dto))->toBeTrue() + ->and($policy->delete($user, $dto))->toBeTrue(); + }); +}); diff --git a/tests/Unit/App/Policies/Backend/TagPolicyTest.php b/tests/Unit/App/Policies/Backend/TagPolicyTest.php new file mode 100644 index 00000000..f956b8ca --- /dev/null +++ b/tests/Unit/App/Policies/Backend/TagPolicyTest.php @@ -0,0 +1,167 @@ +viewAny($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('viewAny returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new TagPolicy(); + + // WHEN + $result = $policy->viewAny($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('view returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new TagPolicy(); + $modelInstance = new Tag(); + + // WHEN + $result = $policy->view($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('view returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new TagPolicy(); + $modelInstance = new Tag(); + + // WHEN + $result = $policy->view($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('create returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new TagPolicy(); + + // WHEN + $result = $policy->create($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('create returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new TagPolicy(); + + // WHEN + $result = $policy->create($user); + + // THEN + expect($result)->toBeTrue(); + }); + + test('update returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new TagPolicy(); + $modelInstance = new Tag(); + + // WHEN + $result = $policy->update($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('update returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new TagPolicy(); + $modelInstance = new Tag(); + + // WHEN + $result = $policy->update($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('delete returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new TagPolicy(); + $modelInstance = new Tag(); + + // WHEN + $result = $policy->delete($customer, $modelInstance); + + // THEN + expect($result)->toBeFalse(); + }); + + test('delete returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new TagPolicy(); + $modelInstance = new Tag(); + + // WHEN + $result = $policy->delete($user, $modelInstance); + + // THEN + expect($result)->toBeTrue(); + }); + + test('toggleStatus returns false for customer', function () { + // GIVEN + $customer = new Customer(); + $policy = new TagPolicy(); + + // WHEN + $result = $policy->toggleStatus($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + test('toggleStatus returns true for admin user', function () { + // GIVEN + $user = new User(); + $user->role = UserRole::Admin; + $policy = new TagPolicy(); + + // WHEN + $result = $policy->toggleStatus($user); + + // THEN + expect($result)->toBeTrue(); + }); +}); diff --git a/tests/Unit/App/Policies/Frontend/BasketPolicyTest.php b/tests/Unit/App/Policies/Frontend/BasketPolicyTest.php new file mode 100644 index 00000000..1987ecf8 --- /dev/null +++ b/tests/Unit/App/Policies/Frontend/BasketPolicyTest.php @@ -0,0 +1,177 @@ +viewTotal($customer); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns true when user is a User instance', function () { + // GIVEN + $productRepository = \Mockery::mock(ProductRepository::class); + $policy = new BasketPolicy($productRepository); + $user = \Mockery::mock(User::class); + + // WHEN + $result = $policy->viewTotal($user); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns false when user is null', function () { + // GIVEN + $productRepository = \Mockery::mock(ProductRepository::class); + $policy = new BasketPolicy($productRepository); + + // WHEN + $result = $policy->viewTotal(null); + + // THEN + expect($result)->toBeFalse(); + }); + }); + + describe('viewPrices', function () { + it('returns false when user is null', function () { + // GIVEN + $productRepository = \Mockery::mock(ProductRepository::class); + $policy = new BasketPolicy($productRepository); + $product = createDummyBasketProduct(); + + // WHEN + $result = $policy->viewPrices(null, $product); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns true when user is not null and product is published', function () { + // GIVEN + $productRepository = \Mockery::mock(ProductRepository::class); + $policy = new BasketPolicy($productRepository); + $customer = \Mockery::mock(Customer::class); + $product = createDummyBasketProduct(); + + $domainProduct = createTestDomainProduct(status: true); + + $productRepository->shouldReceive('find') + ->once() + ->with($product->id) + ->andReturn($domainProduct); + + // WHEN + $result = $policy->viewPrices($customer, $product); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns false when user is not null and product is not published', function () { + // GIVEN + $productRepository = \Mockery::mock(ProductRepository::class); + $policy = new BasketPolicy($productRepository); + $user = \Mockery::mock(User::class); + $product = createDummyBasketProduct(); + + $domainProduct = createTestDomainProduct(status: false); + + $productRepository->shouldReceive('find') + ->once() + ->with($product->id) + ->andReturn($domainProduct); + + // WHEN + $result = $policy->viewPrices($user, $product); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns false when user is not null and product is not found', function () { + // GIVEN + $productRepository = \Mockery::mock(ProductRepository::class); + $policy = new BasketPolicy($productRepository); + $user = \Mockery::mock(User::class); + $product = createDummyBasketProduct(); + + $productRepository->shouldReceive('find') + ->once() + ->with($product->id) + ->andReturn(null); + + // WHEN + $result = $policy->viewPrices($user, $product); + + // THEN + expect($result)->toBeFalse(); + }); + }); +}); diff --git a/tests/Unit/App/Policies/Frontend/CustomerPolicyTest.php b/tests/Unit/App/Policies/Frontend/CustomerPolicyTest.php new file mode 100644 index 00000000..ad2bfd30 --- /dev/null +++ b/tests/Unit/App/Policies/Frontend/CustomerPolicyTest.php @@ -0,0 +1,48 @@ +manageOwnProfile($user); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns true when user is a Customer instance', function () { + // GIVEN + $policy = new CustomerPolicy(); + $customer = \Mockery::mock(Customer::class); + + // WHEN + $result = $policy->manageOwnProfile($customer); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns false when user is null', function () { + // GIVEN + $policy = new CustomerPolicy(); + + // WHEN + $result = $policy->manageOwnProfile(null); + + // THEN + expect($result)->toBeFalse(); + }); + }); +}); diff --git a/tests/Unit/App/Policies/Frontend/OrderPolicyTest.php b/tests/Unit/App/Policies/Frontend/OrderPolicyTest.php new file mode 100644 index 00000000..9f7ace55 --- /dev/null +++ b/tests/Unit/App/Policies/Frontend/OrderPolicyTest.php @@ -0,0 +1,120 @@ +viewAnyOwn($user); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns true when user is a Customer instance', function () { + // GIVEN + $orderService = \Mockery::mock(OrderService::class); + $policy = new OrderPolicy($orderService); + $customer = \Mockery::mock(Customer::class); + + // WHEN + $result = $policy->viewAnyOwn($customer); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns true when user is null', function () { + // GIVEN + $orderService = \Mockery::mock(OrderService::class); + $policy = new OrderPolicy($orderService); + + // WHEN + $result = $policy->viewAnyOwn(null); + + // THEN + expect($result)->toBeTrue(); + }); + }); + + describe('viewOwn', function () { + it('returns false when user is null', function () { + // GIVEN + $orderService = \Mockery::mock(OrderService::class); + $policy = new OrderPolicy($orderService); + $order = \Mockery::mock(Order::class); + + // WHEN + $result = $policy->viewOwn(null, $order); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns false when user is a User instance', function () { + // GIVEN + $orderService = \Mockery::mock(OrderService::class); + $policy = new OrderPolicy($orderService); + $user = \Mockery::mock(User::class); + $order = \Mockery::mock(Order::class); + + // WHEN + $result = $policy->viewOwn($user, $order); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns true when user is a Customer and owns the order', function () { + // GIVEN + $orderService = \Mockery::mock(OrderService::class); + $policy = new OrderPolicy($orderService); + $customer = \Mockery::mock(Customer::class); + $order = \Mockery::mock(Order::class); + + $orderService->shouldReceive('isOrderOwnedBy') + ->once() + ->with($order, $customer) + ->andReturn(true); + + // WHEN + $result = $policy->viewOwn($customer, $order); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns false when user is a Customer and does not own the order', function () { + // GIVEN + $orderService = \Mockery::mock(OrderService::class); + $policy = new OrderPolicy($orderService); + $customer = \Mockery::mock(Customer::class); + $order = \Mockery::mock(Order::class); + + $orderService->shouldReceive('isOrderOwnedBy') + ->once() + ->with($order, $customer) + ->andReturn(false); + + // WHEN + $result = $policy->viewOwn($customer, $order); + + // THEN + expect($result)->toBeFalse(); + }); + }); +}); diff --git a/tests/Unit/App/Policies/Frontend/OrderTunnelStepPolicyTest.php b/tests/Unit/App/Policies/Frontend/OrderTunnelStepPolicyTest.php new file mode 100644 index 00000000..a8688c79 --- /dev/null +++ b/tests/Unit/App/Policies/Frontend/OrderTunnelStepPolicyTest.php @@ -0,0 +1,239 @@ +returns; + } + }; +} + +describe('OrderTunnelStepPolicy', function () { + describe('canReviewBasketSummary', function () { + it('returns false when user is a User instance', function () { + // GIVEN + $orderTunnelService = \Mockery::mock(OrderTunnelService::class); + $policy = new OrderTunnelStepPolicy($orderTunnelService); + $user = new User(); + + // WHEN + $result = $policy->canReviewBasketSummary($user); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns false when gate denies customerPassOrders', function () { + // GIVEN + $orderTunnelService = \Mockery::mock(OrderTunnelService::class); + $policy = new OrderTunnelStepPolicy($orderTunnelService); + $customer = new Customer(); + + Gate::swap(createFakeGate(false)); + + // WHEN + $result = $policy->canReviewBasketSummary($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns false when orderTunnelService denies access to REVIEW step', function () { + // GIVEN + $orderTunnelService = \Mockery::mock(OrderTunnelService::class); + $policy = new OrderTunnelStepPolicy($orderTunnelService); + $customer = new Customer(); + + Gate::swap(createFakeGate(true)); + + $orderTunnelService->shouldReceive('canAccessStep') + ->once() + ->with(OrderTunnelStep::REVIEW) + ->andReturn(false); + + // WHEN + $result = $policy->canReviewBasketSummary($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns true when gate allows and orderTunnelService allows', function () { + // GIVEN + $orderTunnelService = \Mockery::mock(OrderTunnelService::class); + $policy = new OrderTunnelStepPolicy($orderTunnelService); + $customer = new Customer(); + + Gate::swap(createFakeGate(true)); + + $orderTunnelService->shouldReceive('canAccessStep') + ->once() + ->with(OrderTunnelStep::REVIEW) + ->andReturn(true); + + // WHEN + $result = $policy->canReviewBasketSummary($customer); + + // THEN + expect($result)->toBeTrue(); + }); + }); + + describe('canPickTimeSlot', function () { + it('returns false when user is a User instance', function () { + // GIVEN + $orderTunnelService = \Mockery::mock(OrderTunnelService::class); + $policy = new OrderTunnelStepPolicy($orderTunnelService); + $user = new User(); + + // WHEN + $result = $policy->canPickTimeSlot($user); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns false when gate denies customerPassOrders', function () { + // GIVEN + $orderTunnelService = \Mockery::mock(OrderTunnelService::class); + $policy = new OrderTunnelStepPolicy($orderTunnelService); + $customer = new Customer(); + + Gate::swap(createFakeGate(false)); + + // WHEN + $result = $policy->canPickTimeSlot($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns false when orderTunnelService denies access to BOOKING step', function () { + // GIVEN + $orderTunnelService = \Mockery::mock(OrderTunnelService::class); + $policy = new OrderTunnelStepPolicy($orderTunnelService); + $customer = new Customer(); + + Gate::swap(createFakeGate(true)); + + $orderTunnelService->shouldReceive('canAccessStep') + ->once() + ->with(OrderTunnelStep::BOOKING) + ->andReturn(false); + + // WHEN + $result = $policy->canPickTimeSlot($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns true when gate allows and orderTunnelService allows', function () { + // GIVEN + $orderTunnelService = \Mockery::mock(OrderTunnelService::class); + $policy = new OrderTunnelStepPolicy($orderTunnelService); + $customer = new Customer(); + + Gate::swap(createFakeGate(true)); + + $orderTunnelService->shouldReceive('canAccessStep') + ->once() + ->with(OrderTunnelStep::BOOKING) + ->andReturn(true); + + // WHEN + $result = $policy->canPickTimeSlot($customer); + + // THEN + expect($result)->toBeTrue(); + }); + }); + + describe('canFinalizeOrder', function () { + it('returns false when user is a User instance', function () { + // GIVEN + $orderTunnelService = \Mockery::mock(OrderTunnelService::class); + $policy = new OrderTunnelStepPolicy($orderTunnelService); + $user = new User(); + + // WHEN + $result = $policy->canFinalizeOrder($user); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns false when gate denies customerPassOrders', function () { + // GIVEN + $orderTunnelService = \Mockery::mock(OrderTunnelService::class); + $policy = new OrderTunnelStepPolicy($orderTunnelService); + $customer = new Customer(); + + Gate::swap(createFakeGate(false)); + + // WHEN + $result = $policy->canFinalizeOrder($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns false when orderTunnelService denies access to CONFIRMATION step', function () { + // GIVEN + $orderTunnelService = \Mockery::mock(OrderTunnelService::class); + $policy = new OrderTunnelStepPolicy($orderTunnelService); + $customer = new Customer(); + + Gate::swap(createFakeGate(true)); + + $orderTunnelService->shouldReceive('canAccessStep') + ->once() + ->with(OrderTunnelStep::CONFIRMATION) + ->andReturn(false); + + // WHEN + $result = $policy->canFinalizeOrder($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns true when gate allows and orderTunnelService allows', function () { + // GIVEN + $orderTunnelService = \Mockery::mock(OrderTunnelService::class); + $policy = new OrderTunnelStepPolicy($orderTunnelService); + $customer = new Customer(); + + Gate::swap(createFakeGate(true)); + + $orderTunnelService->shouldReceive('canAccessStep') + ->once() + ->with(OrderTunnelStep::CONFIRMATION) + ->andReturn(true); + + // WHEN + $result = $policy->canFinalizeOrder($customer); + + // THEN + expect($result)->toBeTrue(); + }); + }); +}); diff --git a/tests/Unit/App/Policies/Frontend/ProductPolicyTest.php b/tests/Unit/App/Policies/Frontend/ProductPolicyTest.php new file mode 100644 index 00000000..91596a4c --- /dev/null +++ b/tests/Unit/App/Policies/Frontend/ProductPolicyTest.php @@ -0,0 +1,248 @@ +subDay(), + $orderableEnd ?? CarbonImmutable::now()->addDay(), + $hasInco + ); +} + +describe('ProductPolicy', function () { + describe('viewPublished', function () { + it('returns false when domain product is not found', function () { + // GIVEN + $productRepository = \Mockery::mock(ProductRepository::class); + $policy = new ProductPolicy($productRepository); + + $productId = new ProductId(Uuid::uuid7()); + $eloquentProduct = \Mockery::mock(EloquentProduct::class); + $eloquentProduct->shouldReceive('getId')->once()->andReturn($productId); + + $productRepository->shouldReceive('find')->once()->with($productId)->andReturn(null); + + // WHEN + $result = $policy->viewPublished(null, $eloquentProduct); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns false when domain product is found but not published', function () { + // GIVEN + $productRepository = \Mockery::mock(ProductRepository::class); + $policy = new ProductPolicy($productRepository); + + $productId = new ProductId(Uuid::uuid7()); + $eloquentProduct = \Mockery::mock(EloquentProduct::class); + $eloquentProduct->shouldReceive('getId')->once()->andReturn($productId); + + $domainProduct = createDummyDomainProduct(status: false); + + $productRepository->shouldReceive('find')->once()->with($productId)->andReturn($domainProduct); + + // WHEN + $result = $policy->viewPublished(null, $eloquentProduct); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns true when domain product is found and published', function () { + // GIVEN + $productRepository = \Mockery::mock(ProductRepository::class); + $policy = new ProductPolicy($productRepository); + + $productId = new ProductId(Uuid::uuid7()); + $eloquentProduct = \Mockery::mock(EloquentProduct::class); + $eloquentProduct->shouldReceive('getId')->once()->andReturn($productId); + + $domainProduct = createDummyDomainProduct(status: true); + + $productRepository->shouldReceive('find')->once()->with($productId)->andReturn($domainProduct); + + // WHEN + $result = $policy->viewPublished(null, $eloquentProduct); + + // THEN + expect($result)->toBeTrue(); + }); + }); + + describe('addToBasket', function () { + it('returns false when domain product is not found', function () { + // GIVEN + $productRepository = \Mockery::mock(ProductRepository::class); + $policy = new ProductPolicy($productRepository); + + $productId = new ProductId(Uuid::uuid7()); + $eloquentProduct = \Mockery::mock(EloquentProduct::class); + $eloquentProduct->shouldReceive('getId')->once()->andReturn($productId); + + $productRepository->shouldReceive('find')->once()->with($productId)->andReturn(null); + + // WHEN + $result = $policy->addToBasket(null, $eloquentProduct); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns false when domain product is found but not orderable', function () { + // GIVEN + $productRepository = \Mockery::mock(ProductRepository::class); + $policy = new ProductPolicy($productRepository); + + $productId = new ProductId(Uuid::uuid7()); + $eloquentProduct = \Mockery::mock(EloquentProduct::class); + $eloquentProduct->shouldReceive('getId')->once()->andReturn($productId); + + $domainProduct = createDummyDomainProduct( + orderableStart: CarbonImmutable::now()->addDays(2), + orderableEnd: CarbonImmutable::now()->addDays(5) + ); + + $productRepository->shouldReceive('find')->once()->with($productId)->andReturn($domainProduct); + + // WHEN + $result = $policy->addToBasket(null, $eloquentProduct); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns true when domain product is found and orderable', function () { + // GIVEN + $productRepository = \Mockery::mock(ProductRepository::class); + $policy = new ProductPolicy($productRepository); + + $productId = new ProductId(Uuid::uuid7()); + $eloquentProduct = \Mockery::mock(EloquentProduct::class); + $eloquentProduct->shouldReceive('getId')->once()->andReturn($productId); + + $domainProduct = createDummyDomainProduct( + orderableStart: CarbonImmutable::now()->subDay(), + orderableEnd: CarbonImmutable::now()->addDay() + ); + + $productRepository->shouldReceive('find')->once()->with($productId)->andReturn($domainProduct); + + // WHEN + $result = $policy->addToBasket(null, $eloquentProduct); + + // THEN + expect($result)->toBeTrue(); + }); + }); + + describe('viewPrices', function () { + it('returns false when user is null', function () { + // GIVEN + $productRepository = \Mockery::mock(ProductRepository::class); + $policy = new ProductPolicy($productRepository); + + $eloquentProduct = \Mockery::mock(EloquentProduct::class); + + // WHEN + $result = $policy->viewPrices(null, $eloquentProduct); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns false when user is a Customer and domain product is not found', function () { + // GIVEN + $productRepository = \Mockery::mock(ProductRepository::class); + $policy = new ProductPolicy($productRepository); + + $customer = \Mockery::mock(Customer::class); + $productId = new ProductId(Uuid::uuid7()); + $eloquentProduct = \Mockery::mock(EloquentProduct::class); + $eloquentProduct->shouldReceive('getId')->once()->andReturn($productId); + + $productRepository->shouldReceive('find')->once()->with($productId)->andReturn(null); + + // WHEN + $result = $policy->viewPrices($customer, $eloquentProduct); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns false when user is a User and domain product is found but not published', function () { + // GIVEN + $productRepository = \Mockery::mock(ProductRepository::class); + $policy = new ProductPolicy($productRepository); + + $user = \Mockery::mock(User::class); + $productId = new ProductId(Uuid::uuid7()); + $eloquentProduct = \Mockery::mock(EloquentProduct::class); + $eloquentProduct->shouldReceive('getId')->once()->andReturn($productId); + + $domainProduct = createDummyDomainProduct(status: false); + + $productRepository->shouldReceive('find')->once()->with($productId)->andReturn($domainProduct); + + // WHEN + $result = $policy->viewPrices($user, $eloquentProduct); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns true when user is a Customer and domain product is found and published', function () { + // GIVEN + $productRepository = \Mockery::mock(ProductRepository::class); + $policy = new ProductPolicy($productRepository); + + $customer = \Mockery::mock(Customer::class); + $productId = new ProductId(Uuid::uuid7()); + $eloquentProduct = \Mockery::mock(EloquentProduct::class); + $eloquentProduct->shouldReceive('getId')->once()->andReturn($productId); + + $domainProduct = createDummyDomainProduct(status: true); + + $productRepository->shouldReceive('find')->once()->with($productId)->andReturn($domainProduct); + + // WHEN + $result = $policy->viewPrices($customer, $eloquentProduct); + + // THEN + expect($result)->toBeTrue(); + }); + }); +}); diff --git a/tests/Unit/App/Policies/Frontend/ShopPolicyTest.php b/tests/Unit/App/Policies/Frontend/ShopPolicyTest.php new file mode 100644 index 00000000..e31ac60c --- /dev/null +++ b/tests/Unit/App/Policies/Frontend/ShopPolicyTest.php @@ -0,0 +1,52 @@ +viewPickupTimeslots($user, $shop); + + // THEN + expect($result)->toBeFalse(); + }); + + it('viewPickupTimeslots returns true when user is a Customer instance', function () { + // GIVEN + $policy = new ShopPolicy(); + $customer = \Mockery::mock(Customer::class); + $shop = \Mockery::mock(Shop::class); + + // WHEN + $result = $policy->viewPickupTimeslots($customer, $shop); + + // THEN + expect($result)->toBeTrue(); + }); + + it('viewPickupTimeslots returns true when user is null', function () { + // GIVEN + $policy = new ShopPolicy(); + $shop = \Mockery::mock(Shop::class); + + // WHEN + $result = $policy->viewPickupTimeslots(null, $shop); + + // THEN + expect($result)->toBeTrue(); + }); + }); +}); diff --git a/tests/Unit/App/Queries/Orders/GetBasketSummaryQueryTest.php b/tests/Unit/App/Queries/Orders/GetBasketSummaryQueryTest.php new file mode 100644 index 00000000..a92df208 --- /dev/null +++ b/tests/Unit/App/Queries/Orders/GetBasketSummaryQueryTest.php @@ -0,0 +1,34 @@ +shouldReceive('getBasket') + ->once() + ->andReturn($basket); + + $query = new GetBasketSummaryQuery($basketService); + $input = new GetBasketSummaryQueryInput(); + + // WHEN + $output = $query($input); + + // THEN + expect($output)->toBeInstanceOf(GetBasketSummaryQueryOutput::class) + ->and($output->step)->toBe(OrderTunnelStep::REVIEW) + ->and($output->basket)->toBe($basket); + }); +}); diff --git a/tests/Unit/App/Queries/Orders/GetOrderConfirmationQueryTest.php b/tests/Unit/App/Queries/Orders/GetOrderConfirmationQueryTest.php new file mode 100644 index 00000000..bd37aa72 --- /dev/null +++ b/tests/Unit/App/Queries/Orders/GetOrderConfirmationQueryTest.php @@ -0,0 +1,88 @@ +shouldReceive('getBasket')->once()->andReturn($basket); + $builder->shouldReceive('getShopId')->once()->andReturn($shopId); + + $shop = new Shop( + id: $shopId, + name: 'Shop 1', + address: '1 rue Test', + postcode: '75001', + city: 'Paris', + ); + + $orderTunnelService = \Mockery::mock(OrderTunnelService::class); + $orderTunnelService->shouldReceive('getBuilderCompletedOrFail') + ->once() + ->andReturn($builder); + + $shopRepository = \Mockery::mock(ShopRepository::class); + $shopRepository->shouldReceive('find') + ->once() + ->with($shopId) + ->andReturn($shop); + + $query = new GetOrderConfirmationQuery($orderTunnelService, $shopRepository); + $input = new GetOrderConfirmationQueryInput(); + + // WHEN + $output = $query($input); + + // THEN + expect($output)->toBeInstanceOf(GetOrderConfirmationQueryOutput::class) + ->and($output->step)->toBe(OrderTunnelStep::CONFIRMATION) + ->and($output->basket)->toBe($basket) + ->and($output->builder)->toBe($builder) + ->and($output->shop)->toBeInstanceOf(ShopDto::class) + ->and($output->shop->name)->toBe('Shop 1'); + }); + + it('throws NotFoundHttpException when shop is not found', function (): void { + // GIVEN + $shopId = new ShopId(Uuid::uuid7()); + $basket = new Basket(new BasketId(Uuid::uuid7())); + $builder = \Mockery::mock(OrderBuilderCompleted::class); + $builder->shouldReceive('getBasket')->once()->andReturn($basket); + $builder->shouldReceive('getShopId')->once()->andReturn($shopId); + + $orderTunnelService = \Mockery::mock(OrderTunnelService::class); + $orderTunnelService->shouldReceive('getBuilderCompletedOrFail') + ->once() + ->andReturn($builder); + + $shopRepository = \Mockery::mock(ShopRepository::class); + $shopRepository->shouldReceive('find') + ->once() + ->with($shopId) + ->andReturn(null); + + $query = new GetOrderConfirmationQuery($orderTunnelService, $shopRepository); + $input = new GetOrderConfirmationQueryInput(); + + // WHEN & THEN + expect(fn () => $query($input))->toThrow(NotFoundHttpException::class, 'Shop not found'); + }); +}); diff --git a/tests/Unit/App/Queries/Orders/GetPickTimeSlotQueryTest.php b/tests/Unit/App/Queries/Orders/GetPickTimeSlotQueryTest.php new file mode 100644 index 00000000..f7d824e9 --- /dev/null +++ b/tests/Unit/App/Queries/Orders/GetPickTimeSlotQueryTest.php @@ -0,0 +1,63 @@ +shouldReceive('getShopForCustomer') + ->once() + ->with($shopperId) + ->andReturn($shop); + $orderTunnelService->shouldReceive('getAvailableTimeSlots') + ->once() + ->with($shop) + ->andReturn($timeSlots); + + $mapUrlService = \Mockery::mock(MapUrlService::class); + $mapUrlService->shouldReceive('generateUrl') + ->once() + ->withArgs(fn ($arg) => $arg instanceof ShopDto && $arg->name === 'Shop 1') + ->andReturn('https://maps.example.com'); + + $query = new GetPickTimeSlotQuery($orderTunnelService, $mapUrlService); + + // WHEN + $output = $query($input); + + // THEN + expect($output)->toBeInstanceOf(GetPickTimeSlotQueryOutput::class) + ->and($output->step)->toBe(OrderTunnelStep::BOOKING) + ->and($output->shop)->toBeInstanceOf(ShopDto::class) + ->and($output->shop->name)->toBe('Shop 1') + ->and($output->mapUrl)->toBe('https://maps.example.com') + ->and($output->timeSlots)->toBe($timeSlots); + }); +}); diff --git a/tests/Unit/App/Queries/ProductIncos/GetArcadiaIncoPreviewQueryTest.php b/tests/Unit/App/Queries/ProductIncos/GetArcadiaIncoPreviewQueryTest.php new file mode 100644 index 00000000..a1e23d58 --- /dev/null +++ b/tests/Unit/App/Queries/ProductIncos/GetArcadiaIncoPreviewQueryTest.php @@ -0,0 +1,52 @@ +Poulet

', + energyKcal: 149.0, + energyKj: 623.0 + ); + + $service->shouldReceive('getPreview') + ->once() + ->with(27996) + ->andReturn($previewDto); + + $query = new GetArcadiaIncoPreviewQuery($service); + $input = new GetArcadiaIncoPreviewQueryInput(noArt: 27996); + + // WHEN + $result = $query($input); + + // THEN + expect($result)->toBe($previewDto); + }); + + it('throws when noArt is less than 1', function (): void { + // GIVEN + $invalidNoArt = 0; + + // WHEN & THEN + expect(fn () => new GetArcadiaIncoPreviewQueryInput(noArt: $invalidNoArt)) + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Unit/App/Queries/Shops/GetShopQueryInputTest.php b/tests/Unit/App/Queries/Shops/GetShopQueryInputTest.php new file mode 100644 index 00000000..a34c3c7a --- /dev/null +++ b/tests/Unit/App/Queries/Shops/GetShopQueryInputTest.php @@ -0,0 +1,20 @@ +toBeInstanceOf(GetShopQueryInput::class); + }); +}); diff --git a/tests/Unit/App/Services/ArcadiaIncoServiceTest.php b/tests/Unit/App/Services/ArcadiaIncoServiceTest.php new file mode 100644 index 00000000..552ca91f --- /dev/null +++ b/tests/Unit/App/Services/ArcadiaIncoServiceTest.php @@ -0,0 +1,226 @@ +shouldReceive('debug'); + $logger->shouldReceive('error'); + + $apiError = \Mockery::mock(ApiError::class); + $apiError->shouldReceive('message')->andReturn('Unauthorized'); + + $incoService->shouldReceive('findBy') + ->once() + ->with(\Mockery::type(IncoId::class)) + ->andReturn($apiError); + + $service = new ArcadiaIncoService($incoService, $logger); + + // WHEN & THEN + expect(fn () => $service->fetchInco(27996))->toThrow(\RuntimeException::class, 'Unauthorized'); + }); + + it('returns null when INCO sheet is not found (404)', function (): void { + // GIVEN + $incoService = \Mockery::mock(LibIncoService::class); + $logger = \Mockery::mock(LoggerInterface::class); + $logger->shouldReceive('debug'); + $logger->shouldReceive('info'); + + $incoService->shouldReceive('findBy') + ->once() + ->with(\Mockery::type(IncoId::class)) + ->andReturnNull(); + + $service = new ArcadiaIncoService($incoService, $logger); + + // WHEN + $result = $service->fetchInco(99999); + + // THEN + expect($result)->toBeNull(); + }); + + it('fetches and maps complete INCO and composition data', function (): void { + // GIVEN + $incoService = \Mockery::mock(LibIncoService::class); + $logger = \Mockery::mock(LoggerInterface::class); + $logger->shouldReceive('debug'); + $logger->shouldReceive('warning'); + + $incoId = new IncoId('27996'); + $libInco = new LibInco( + id: $incoId, + name: 'POULET JAUNE FERMIER', + libelle: 'Poulet Jaune PAC Le Gaulois', + description: 'Volaille fermière de qualité.', + allegations: new Allegations([]), + sellArguments: 'Un poulet savoureux.', + preparationAdvices: 'Cuire à 200°C pendant 1h30.', + tips: 'Arroser régulièrement.', + sellFamilly: 'VOLAILLES', + ingredients: new Ingredients([ + 'Ingrédients' => ['Poulet Jaune (100%)'], + ]), + portions: new PortionAmount(4, 5, true), + allergens: [ + new Allergen(1, 'Aucun allergène'), + ], + brand: new Brand(new BrandCode('LGL01'), 'Le Gaulois'), + isSeasonal: false, + weight: null, + nutriscore: new IncoNutriscore('A', null), + storageCondition: null, + additives: [], + compo: new IncoCompoId('88888'), + createdAt: new \DateTimeImmutable('2025-01-01T00:00:00Z'), + updatedAt: new \DateTimeImmutable('2025-01-01T00:00:00Z'), + ); + + $libCompo = new LibIncoCompo( + id: new IncoCompoId('88888'), + idInco: $incoId, + identification: new Identification('Poulet Jaune', '27996', 'SNV'), + energie: new Energie('100', '623', '149', '150', '935', '224'), + macronutrimentsRef: new MacronutrimentsRef( + '7.2', '=', '2.0', '=', '0.0', '=', '0.0', '=', '0.0', '=', '21.0', '=', '0.16', '=', '64' + ), + macronutrimentsPortion: new MacronutrimentsPortion( + '10.8', '=', '3.0', '=', '0.0', '=', '0.0', '=', '0.0', '=', '31.5', '=', '0.24', '=', '96' + ), + fnl: new FruitLegumeNoix('0', '0', '0', '0', '0', '0', '0', '0'), + apportsReference: new ApportsReference( + '11', '11', '15', '15', '0', '0', '63', '4', '150g', '2.9' + ), + nutriScore: new CompoNutriScore( + '2', '2', '5', '5', '-3', '-3', 'A', 'A', '1', '0' + ), + pointsNutriScore: new PointsNutriScore('0', '0', '0', '0', '0', '0', '0'), + mineraux: new Mineraux('0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'), + vitamines: new Vitamines('0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'), + glucidesDetail: new GlucidesDetail('0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'), + acideGras: new AcideGras( + '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', + '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', + '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', + '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', + '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', + '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', + '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0' + ), + acidesAmines: new AcidesAmines('0', '0', '0'), + composesSpeciaux: new ComposesSpeciaux('0', '0', '0', '0'), + ); + + $incoService->shouldReceive('findBy')->once()->andReturn($libInco); + $incoService->shouldReceive('findCompo')->once()->andReturn($libCompo); + + $service = new ArcadiaIncoService($incoService, $logger); + + // WHEN + $result = $service->fetchInco(27996); + + // THEN + expect($result)->toBeInstanceOf(ArcadiaIncoDataDto::class) + ->and($result->noArt)->toBe(27996) + ->and($result->name)->toBe('POULET JAUNE FERMIER') + ->and($result->brand)->toBe('Le Gaulois') + ->and($result->nutriscore)->toBe(Nutriscore::A) + ->and($result->allergens)->toBe('Aucun allergène') + ->and($result->servings)->toBe('entre 4 et 5') + ->and($result->preparation)->toContain('Cuire à 200°C') + ->and($result->ingredients)->toContain('Poulet Jaune (100%)') + ->and($result->nutrition->kj)->toBe(623.0) + ->and($result->nutrition->kcal)->toBe(149.0) + ->and($result->nutrition->fatG)->toBe(7.2) + ->and($result->nutrition->proteinG)->toBe(21.0); + }); + + it('returns preview DTO correctly', function (): void { + // GIVEN + $incoService = \Mockery::mock(LibIncoService::class); + $logger = \Mockery::mock(LoggerInterface::class); + $logger->shouldReceive('debug'); + + $incoId = new IncoId('27996'); + $libInco = new LibInco( + id: $incoId, + name: 'POULET JAUNE FERMIER', + libelle: 'Poulet Jaune PAC Le Gaulois', + description: 'Volaille fermière.', + allegations: new Allegations([]), + sellArguments: 'Savoureux.', + preparationAdvices: 'Four.', + tips: null, + sellFamilly: null, + ingredients: new Ingredients([ + ['Poulet'], + ]), + portions: null, + allergens: [], + brand: new Brand(new BrandCode('LGL01'), 'Le Gaulois'), + isSeasonal: false, + weight: null, + nutriscore: new IncoNutriscore('A', null), + storageCondition: null, + additives: [], + compo: null, + createdAt: null, + updatedAt: null, + ); + + $incoService->shouldReceive('findBy')->once()->andReturn($libInco); + $incoService->shouldReceive('findCompo')->once()->andReturnNull(); + + $service = new ArcadiaIncoService($incoService, $logger); + + // WHEN + $preview = $service->getPreview(27996); + + // THEN + expect($preview)->toBeInstanceOf(ArcadiaIncoPreviewDto::class) + ->and($preview->noArt)->toBe(27996) + ->and($preview->name)->toBe('POULET JAUNE FERMIER') + ->and($preview->brand)->toBe('Le Gaulois') + ->and($preview->nutriscore)->toBe('A'); + }); +}); diff --git a/tests/Unit/App/Services/CodeGenerationServiceTest.php b/tests/Unit/App/Services/CodeGenerationServiceTest.php new file mode 100644 index 00000000..d48aac40 --- /dev/null +++ b/tests/Unit/App/Services/CodeGenerationServiceTest.php @@ -0,0 +1,67 @@ +withShuffler(new FisherYatesShuffler()) + ->withSeed(12345); + + $service = new CodeGenerationService($builder); + $matricule = new Matricule('0100759'); + + // WHEN + $code = $service->generateFrom($matricule); + + // THEN + expect($code)->toBeInstanceOf(Code::class) + ->and(strlen($code->value))->toBe(Code::LENGTH) + ->and(preg_match('/^[' . Code::ALLOWED_CHARACTERS . ']+$/', $code->value))->toBe(1); + }); + + it('generates deterministic codes for the same matricule', function (): void { + // GIVEN + $builder = (new SerialCasterBuilder(new NativeBaseConverter())) + ->withShuffler(new FisherYatesShuffler()) + ->withSeed(12345); + + $service = new CodeGenerationService($builder); + $matricule = new Matricule('0100759'); + + // WHEN + $code1 = $service->generateFrom($matricule); + $code2 = $service->generateFrom($matricule); + + // THEN + expect($code1->value)->toBe($code2->value); + }); + + it('generates different codes for different matricules', function (): void { + // GIVEN + $builder = (new SerialCasterBuilder(new NativeBaseConverter())) + ->withShuffler(new FisherYatesShuffler()) + ->withSeed(12345); + + $service = new CodeGenerationService($builder); + + // WHEN + $code1 = $service->generateFrom(new Matricule('0100759')); + $code2 = $service->generateFrom(new Matricule('0100760')); + + // THEN + expect($code1->value)->not->toBe($code2->value); + }); +}); diff --git a/tests/Unit/App/Services/IcsGeneratorServiceTest.php b/tests/Unit/App/Services/IcsGeneratorServiceTest.php new file mode 100644 index 00000000..064e92d3 --- /dev/null +++ b/tests/Unit/App/Services/IcsGeneratorServiceTest.php @@ -0,0 +1,73 @@ + new IcsGeneratorService($appName); + + // THEN + expect($action)->toThrow(\InvalidArgumentException::class, 'App name must be provided for ICS generation.'); + }); + + it('generates ics format without url', function (): void { + // GIVEN + $service = new IcsGeneratorService('MyApp'); + $dto = new IcsContentDto( + uid: 'uid-123', + summary: 'My Event, with comma', + description: "Line 1\nLine 2;", + startsAt: Carbon::parse('2026-06-11 10:00:00'), + endsAt: Carbon::parse('2026-06-11 11:00:00'), + url: null, + ); + + Carbon::setTestNow('2026-06-11 09:00:00'); + + // WHEN + $ics = $service->generate($dto); + + // THEN + expect($ics) + ->toContain('BEGIN:VCALENDAR') + ->toContain('PRODID:-//MyApp//NONSGML v1.0//EN') + ->toContain('UID:uid-123') + ->toContain('DTSTAMP:20260611T090000Z') + ->toContain('DTSTART:20260611T100000Z') + ->toContain('DTEND:20260611T110000Z') + ->toContain('SUMMARY:My Event\, with comma') + ->toContain('DESCRIPTION:Line 1\nLine 2\;') + ->not->toContain('URL:'); + + Carbon::setTestNow(); + }); + + it('generates ics format with url', function (): void { + // GIVEN + $service = new IcsGeneratorService('MyApp'); + $dto = new IcsContentDto( + uid: 'uid-123', + summary: 'Event', + description: 'Desc', + startsAt: Carbon::parse('2026-06-11 10:00:00'), + endsAt: Carbon::parse('2026-06-11 11:00:00'), + url: 'http://example.com', + ); + + // WHEN + $ics = $service->generate($dto); + + // THEN + expect($ics)->toContain('URL:http://example.com'); + }); +}); diff --git a/tests/Unit/App/Services/MapUrlServiceTest.php b/tests/Unit/App/Services/MapUrlServiceTest.php new file mode 100644 index 00000000..a7a91f62 --- /dev/null +++ b/tests/Unit/App/Services/MapUrlServiceTest.php @@ -0,0 +1,74 @@ +generateUrl($address); + + // THEN + expect($url)->toBe('https://www.openstreetmap.org/?mlat=48.8566&mlon=2.3522#map=16/48.8566/2.3522'); + }); + + it('generates a Google Maps URL when coordinates are missing', function () { + // GIVEN + $service = new MapUrlService(); + $address = new DeliveryAddress( + name: 'My Shop', + address: '123 Test St', + postcode: '12345', + city: 'Test City', + phone: null, + latitude: null, + longitude: null, + ); + + // WHEN + $url = $service->generateUrl($address); + + // THEN + $query = urlencode('My Shop 123 Test St 12345 Test City'); + expect($url)->toBe("https://maps.google.com/?q={$query}"); + }); + + it('generates an OpenStreetMap URL for a ShopDto', function () { + // GIVEN + $service = new MapUrlService(); + $shopDto = new ShopDto( + id: 'test-id', + name: 'DTO Shop', + address: '456 DTO St', + postcode: '69001', + city: 'Lyon', + phone: null, + latitude: '45.75', + longitude: '4.85', + default: false, + ); + + // WHEN + $url = $service->generateUrl($shopDto); + + // THEN + expect($url)->toBe('https://www.openstreetmap.org/?mlat=45.75&mlon=4.85#map=16/45.75/4.85'); + }); +}); diff --git a/tests/Unit/Domain/Builders/OrderBuilderTest.php b/tests/Unit/Domain/Builders/OrderBuilderTest.php new file mode 100644 index 00000000..02ce2903 --- /dev/null +++ b/tests/Unit/Domain/Builders/OrderBuilderTest.php @@ -0,0 +1,58 @@ +toBeInstanceOf(OrderBuilderWithBasket::class) + ->and($builder->getBuilderType())->toBe(OrderBuilderType::FROM_BASKET) + ->and($builder->isFromBasket())->toBeTrue() + ->and($builder->isCompleted())->toBeFalse() + ->and($builder->getBasket())->toBe($basket) + ->and($builder->getShopperId())->toBe($customerId); + }); + + it('transitions to with_pickup state when adding a timeslot', function (): void { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $basket = new Basket($basketId); + $customerId = new ShopperId(Uuid::uuid7()); + $shopId = new ShopId(Uuid::uuid7()); + $timeSlot = new PickupTimeSlot(new \DateTimeImmutable(), new \DateInterval('PT1H')); + + $builder = OrderBuilder::fromBasket($basket, $customerId); + + // WHEN + $completedBuilder = $builder->withPickupTimeSlot($shopId, $timeSlot); + + // THEN + expect($completedBuilder) + ->toBeInstanceOf(OrderBuilderCompleted::class) + ->and($completedBuilder->getBuilderType())->toBe(OrderBuilderType::WITH_PICKUP) + ->and($completedBuilder->isFromBasket())->toBeTrue() + ->and($completedBuilder->isCompleted())->toBeTrue() + ->and($completedBuilder->getShopId())->toBe($shopId) + ->and($completedBuilder->getPickupTimeSlot())->toBe($timeSlot); + }); +}); diff --git a/tests/Unit/Domain/Enums/CountryTest.php b/tests/Unit/Domain/Enums/CountryTest.php new file mode 100644 index 00000000..ea25089e --- /dev/null +++ b/tests/Unit/Domain/Enums/CountryTest.php @@ -0,0 +1,98 @@ +iso(); + + // THEN + expect($iso)->toBe('FR'); + }); + + it('throws exception if iso code is missing', function () { + // GIVEN + $country = Country::afghanistan; + + // WHEN + $action = fn () => $country->iso(); + + // THEN + expect($action)->toThrow(UnknownCountryIsoCodeException::class); + }); + + it('returns iso num for France', function () { + // GIVEN + $country = Country::france; + + // WHEN + $isoNum = $country->isoNum(); + + // THEN + expect($isoNum)->toBe(250); + }); + + it('throws exception if iso num is missing', function () { + // GIVEN + $country = Country::afghanistan; + + // WHEN + $action = fn () => $country->isoNum(); + + // THEN + expect($action)->toThrow(UnknownCountryIsoCodeException::class); + }); + + it('returns null if iso code is missing via isoCode method', function () { + // GIVEN + $country = Country::afghanistan; + + // WHEN + $isoCode = $country->isoCode(); + + // THEN + expect($isoCode)->toBeNull(); + }); + + it('can be created from iso code', function () { + // GIVEN + $iso = 'FR'; + + // WHEN + $country = Country::fromIsoCode($iso); + + // THEN + expect($country)->toBe(Country::france); + }); + + it('throws exception if created from invalid iso code', function () { + // GIVEN + $iso = 'ZZ'; + + // WHEN + $action = fn () => Country::fromIsoCode($iso); + + // THEN + expect($action)->toThrow(UnknownCountryIsoCodeException::class); + }); + + it('can list all iso codes', function () { + // GIVEN + $dummy = true; + + // WHEN + $isoCodes = Country::toIsoCodes(); + + // THEN + expect($isoCodes)->toBeArray()->toHaveKey('france', 'FR'); + }); +}); diff --git a/tests/Unit/Domain/Enums/GeneralEnumTest.php b/tests/Unit/Domain/Enums/GeneralEnumTest.php new file mode 100644 index 00000000..67523bcf --- /dev/null +++ b/tests/Unit/Domain/Enums/GeneralEnumTest.php @@ -0,0 +1,55 @@ +toBeArray(); + } else { + expect(true)->toBeTrue(); + } + })->with([ + DiscountType::class, + EmployeeSite::class, + Nutriscore::class, + OrderStatus::class, + OrderTunnelStep::class, + ItemsPerPaginationEnum::class, + PriceShowingMode::class, + ProductBrand::class, + RepeatFrequency::class, + SellUnit::class, + StaticPageSlug::class, + StatsCustomerType::class, + StatsShopType::class, + InvoicingUnit::class, + OrderUnit::class, + ]); +}); diff --git a/tests/Unit/Domain/Enums/TaxRateTest.php b/tests/Unit/Domain/Enums/TaxRateTest.php new file mode 100644 index 00000000..bb0170d4 --- /dev/null +++ b/tests/Unit/Domain/Enums/TaxRateTest.php @@ -0,0 +1,103 @@ +percent(); + $percent55 = $tax55->percent(); + + // THEN + expect($percent20)->toBe(20.0) + ->and($percent55)->toBe(5.5); + }); + + it('returns correct rate', function () { + // GIVEN + $tax20 = TaxRate::TVA_20; + $tax55 = TaxRate::TVA_5_5; + + // WHEN + $rate20 = $tax20->rate(); + $rate55 = $tax55->rate(); + + // THEN + expect($rate20)->toBe(0.2) + ->and($rate55)->toBe(0.055); + }); + + it('applies tax correctly to money', function () { + // GIVEN + $price = new Money(10000, new Currency('EUR')); // 100.00 EUR + $tax20 = TaxRate::TVA_20; + $tax55 = TaxRate::TVA_5_5; + + // WHEN + $amountWithTax20 = $tax20->applyTo($price)->getAmount(); + $amountWithTax55 = $tax55->applyTo($price)->getAmount(); + + // THEN + expect($amountWithTax20)->toBe('12000') // 120.00 EUR + ->and($amountWithTax55)->toBe('10550'); // 105.50 EUR + }); + + it('creates TaxRate from percent with float, int, or string', function () { + // GIVEN + $int20 = 20; + $float20 = 20.0; + $float55 = 5.5; + + // WHEN + $rateFromInt = TaxRate::fromPercent($int20); + $rateFromFloat20 = TaxRate::fromPercent($float20); + $rateFromFloat55 = TaxRate::fromPercent($float55); + + // THEN + expect($rateFromInt)->toBe(TaxRate::TVA_20) + ->and($rateFromFloat20)->toBe(TaxRate::TVA_20) + ->and($rateFromFloat55)->toBe(TaxRate::TVA_5_5); + }); + + it('creates TaxRate from enum value fallback', function () { + // GIVEN + $val1 = 1; + $val2 = 2; + + // WHEN + $rate1 = TaxRate::fromPercent($val1); + $rate2 = TaxRate::fromPercent($val2); + + // THEN + expect($rate1)->toBe(TaxRate::TVA_20) + ->and($rate2)->toBe(TaxRate::TVA_5_5); + }); + + it('throws when percent is not numeric', function () { + // GIVEN + $invalid = 0.8; + + // WHEN / THEN + expect(fn () => TaxRate::fromPercent($invalid)) + ->toThrow(\UnexpectedValueException::class, 'Unhandled tax rate: 0.8'); + }); + + it('throws when percent is unhandled', function () { + // GIVEN + $unhandled = 10.0; + + // WHEN / THEN + expect(fn () => TaxRate::fromPercent($unhandled)) + ->toThrow(\UnexpectedValueException::class, 'Unhandled tax rate: 10'); + }); +}); diff --git a/tests/Unit/Domain/Enums/Units/OrderUnitTest.php b/tests/Unit/Domain/Enums/Units/OrderUnitTest.php new file mode 100644 index 00000000..dedb110a --- /dev/null +++ b/tests/Unit/Domain/Enums/Units/OrderUnitTest.php @@ -0,0 +1,24 @@ +toRegateCode(); + + // THEN + expect($code)->toBe($expectedCode); + })->with([ + 'colis' => [OrderUnit::COLIS, 'UEA'], + 'kgm' => [OrderUnit::KGM, 'KGM'], + 'pce' => [OrderUnit::PCE, 'UB'], + ]); +}); diff --git a/tests/Unit/Domain/Enums/UserRoleTest.php b/tests/Unit/Domain/Enums/UserRoleTest.php new file mode 100644 index 00000000..3023ffff --- /dev/null +++ b/tests/Unit/Domain/Enums/UserRoleTest.php @@ -0,0 +1,27 @@ +isAtLeastEqualsTo($superAdmin); + $superAdminAtLeastAdmin = $superAdmin->isAtLeastEqualsTo($admin); + $adminEqualsAdmin = $admin->isAtLeastEqualsTo($admin); + $adminAtLeastSuperAdmin = $admin->isAtLeastEqualsTo($superAdmin); + + // THEN + expect($superAdminEqualsSuperAdmin)->toBeTrue() + ->and($superAdminAtLeastAdmin)->toBeTrue() + ->and($adminEqualsAdmin)->toBeTrue() + ->and($adminAtLeastSuperAdmin)->toBeFalse(); + }); +}); diff --git a/tests/Unit/Domain/Events/AnOrderHasBeenPlacedTest.php b/tests/Unit/Domain/Events/AnOrderHasBeenPlacedTest.php new file mode 100644 index 00000000..fa95f53e --- /dev/null +++ b/tests/Unit/Domain/Events/AnOrderHasBeenPlacedTest.php @@ -0,0 +1,64 @@ +orderId)->toBe($orderId) + ->and($event->reference)->toBe($reference); + }); + + it('throws exception if lines are empty', function () { + // GIVEN + $uuid = Uuid::uuid7(); + $orderId = new OrderId($uuid); + $reference = new OrderReference(Uuid::uuid7()); + $totalTtc = new Money(1000, new Currency('EUR')); + $matricule = new Matricule('1234567'); + $employee = new OrderEmployee($matricule, 'John', 'Doe', new ShopperEstablishmentCode('ETAB01'), new ShopperSiteCode('SITEA'), new ShopperServiceCode('101')); + $shop = new OrderPlacedShop('Shop', 'Address', '12345', 'City'); + $pickupDay = new \DateTimeImmutable(); + $lines = []; + + // WHEN + $action = fn () => new AnOrderHasBeenPlaced($orderId, $reference, $totalTtc, $matricule, $employee, $shop, $pickupDay, $lines); + + // THEN + expect($action)->toThrow(\DomainException::class, 'An order must have at least one line'); + }); +}); diff --git a/tests/Unit/Domain/Events/DtoTest.php b/tests/Unit/Domain/Events/DtoTest.php new file mode 100644 index 00000000..92f2d762 --- /dev/null +++ b/tests/Unit/Domain/Events/DtoTest.php @@ -0,0 +1,218 @@ +quantity)->toBe(2); + }); + + it('throws exception if quantity is zero or less for OrderPlacedLine', function () { + // GIVEN + $productName = 'Product'; + $incoId = new IncoId(1); + $unit = OrderUnit::PCE; + $price = new Money(2000, new Currency('EUR')); + + // WHEN + $action = fn () => new OrderPlacedLine($productName, $incoId, false, null, $unit, 0, $price); + + // THEN + expect($action)->toThrow(\DomainException::class, 'Quantity must be greater than 0'); + }); + + it('creates OrderPlacedLine from OrderLine', function () { + // GIVEN + $product = new OrderLineProduct( + incoId: new IncoId(42), + originalId: new ProductId(Uuid::uuid7()), + name: 'Poulet rôti', + weight: new ProductWeight(1000, false), + brand: ProductBrand::none, + orderUnit: OrderUnit::PCE, + price: Money::EUR(1000), + discountedPrice: Money::EUR(1000), + priceKgTtc: Money::EUR(1200), + taxRate: TaxRate::TVA_20, + picture: null + ); + + $line = new OrderLine( + product: $product, + quantity: 3, + unitPriceHt: Money::EUR(1000), + unitDiscount: Money::EUR(0), + unitTax: Money::EUR(200), + totalHt: Money::EUR(3000), + totalDiscount: Money::EUR(0), + totalTax: Money::EUR(600), + totalTtc: Money::EUR(3600) + ); + + // WHEN + $dto = OrderPlacedLine::fromOrderLine($line); + + // THEN + expect($dto->productName)->toBe('Poulet rôti') + ->and($dto->productIncoId->value)->toBe(42) + ->and($dto->quantity)->toBe(3) + ->and($dto->totalTtc->getAmount())->toBe('3600') + ->and($dto->productOrderUnit)->toBe(OrderUnit::PCE); + }); +}); + +describe('OrderPlacedShop', function () { + it('creates OrderPlacedShop correctly', function () { + // GIVEN + $name = 'Name'; + $address = 'Addr'; + $zip = '12345'; + $city = 'City'; + + // WHEN + $shop = new OrderPlacedShop($name, $address, $zip, $city); + + // THEN + expect($shop->name)->toBe('Name'); + }); + + it('creates OrderPlacedShop from DeliveryAddress', function () { + // GIVEN + $address = new DeliveryAddress( + name: 'Boutique Paris', + address: '10 avenue des Champs', + postcode: '75008', + city: 'Paris' + ); + + // WHEN + $dto = OrderPlacedShop::fromDeliveryAddress($address); + + // THEN + expect($dto->name)->toBe('Boutique Paris') + ->and($dto->address)->toBe('10 avenue des Champs') + ->and($dto->postcode)->toBe('75008') + ->and($dto->city)->toBe('Paris'); + }); + + it('throws exception if shop name is empty', function () { + // GIVEN + $name = ' '; + $address = 'Addr'; + $zip = '12345'; + $city = 'City'; + + // WHEN + $action = fn () => new OrderPlacedShop($name, $address, $zip, $city); + // THEN + expect($action)->toThrow(\DomainException::class, 'Shop name is required'); + }); + + it('throws exception if shop address is empty', function () { + // GIVEN + $name = 'Name'; + $address = ''; + $zip = '12345'; + $city = 'City'; + + // WHEN + $action = fn () => new OrderPlacedShop($name, $address, $zip, $city); + // THEN + expect($action)->toThrow(\DomainException::class, 'Shop address is required'); + }); + + it('throws exception if shop postcode is empty', function () { + // GIVEN + $name = 'Name'; + $address = 'Addr'; + $zip = ''; + $city = 'City'; + + // WHEN + $action = fn () => new OrderPlacedShop($name, $address, $zip, $city); + // THEN + expect($action)->toThrow(\DomainException::class, 'Shop postcode is required'); + }); + + it('throws exception if shop city is empty', function () { + // GIVEN + $name = 'Name'; + $address = 'Addr'; + $zip = '12345'; + $city = ' '; + + // WHEN + $action = fn () => new OrderPlacedShop($name, $address, $zip, $city); + // THEN + expect($action)->toThrow(\DomainException::class, 'Shop city is required'); + }); +}); + +describe('RegateOrderCsvGenerated', function () { + it('creates RegateOrderCsvGenerated correctly', function () { + // GIVEN + $csvContent = 'csv'; + $fileName = 'file.csv'; + + // WHEN + $dto = new RegateOrderCsvGenerated($csvContent, $fileName); + + // THEN + expect($dto->csvContent)->toBe('csv') + ->and($dto->fileName)->toBe('file.csv'); + }); +}); + +describe('SalariesHaveBeenSynced', function () { + it('creates SalariesHaveBeenSynced correctly', function () { + // GIVEN + $matricules = [new Matricule('1234567')]; + + // WHEN + $dto = new SalariesHaveBeenSynced($matricules); + + // THEN + expect($dto->matricules)->toBe($matricules); + }); + + it('throws exception if SalariesHaveBeenSynced gets non-matricule', function () { + // GIVEN + /** @var array $matricules */ + $matricules = ['1234567']; + + // WHEN + $action = fn () => new SalariesHaveBeenSynced($matricules); + // THEN + expect($action)->toThrow(\UnexpectedValueException::class); + }); +}); diff --git a/tests/Unit/Domain/Exceptions/ExceptionsTest.php b/tests/Unit/Domain/Exceptions/ExceptionsTest.php new file mode 100644 index 00000000..473e549e --- /dev/null +++ b/tests/Unit/Domain/Exceptions/ExceptionsTest.php @@ -0,0 +1,86 @@ +getMessage())->toBe($expectedMessage); + }); + + it('creates MissingOrderBuilderException with custom args', function () { + // GIVEN + $message = 'Custom error'; + $code = 123; + $previous = new RuntimeException('Prev'); + + // WHEN + $e = new MissingOrderBuilderException($message, $code, $previous); + + // THEN + expect($e->getMessage())->toBe($message) + ->and($e->getCode())->toBe($code) + ->and($e->getPrevious())->toBe($previous); + }); + + it('creates OrderLimitExceededException correctly', function () { + // GIVEN + $expectedMessage = 'The total amount of this order has been exceeded. Please modify it to validate.'; + + // WHEN + $e = new OrderLimitExceededException(); + + // THEN + expect($e->getMessage())->toBe($expectedMessage); + }); + + it('creates WeeklyLimitExceededException correctly', function () { + // GIVEN + $expectedMessage = 'The total amount for this delivery date has been exceeded. Please modify it to validate.'; + + // WHEN + $e = new WeeklyLimitExceededException(); + + // THEN + expect($e->getMessage())->toBe($expectedMessage); + }); + + it('creates UnknownCountryIsoCodeException from iso code', function () { + // GIVEN + $isoCode = 'ZZ'; + $expectedMessage = "No country found for ISO code 'ZZ'"; + + // WHEN + $e = UnknownCountryIsoCodeException::fromIsoCode($isoCode); + + // THEN + expect($e->getMessage())->toBe($expectedMessage); + }); + + it('creates UnknownCountryIsoCodeException from country', function () { + // GIVEN + $country = Country::france; + $expectedMessage = "No ISO code found for country 'france'"; + + // WHEN + $e = UnknownCountryIsoCodeException::fromCountry($country); + + // THEN + expect($e->getMessage())->toBe($expectedMessage); + }); +}); diff --git a/tests/Unit/Domain/Models/Entities/BasketTest.php b/tests/Unit/Domain/Models/Entities/BasketTest.php new file mode 100644 index 00000000..2535812b --- /dev/null +++ b/tests/Unit/Domain/Models/Entities/BasketTest.php @@ -0,0 +1,255 @@ + new ProductId(Uuid::fromString('019e9e37-f2a1-74ef-b9c2-66d222470128')), + 'name' => 'Poulet Rôti', + 'qty' => 2, + 'unitPriceHt' => Money::EUR(1000), + 'unitDiscount' => Money::EUR(200), + 'taxRate' => TaxRate::TVA_5_5, + 'weightGrams' => 1200, + 'brand' => ProductBrand::marie, + 'incoId' => new IncoId(45), + 'orderUnit' => OrderUnit::PCE, + 'slug' => 'poulet-roti', + 'picture' => 'images/poulet.jpg', + 'description' => 'Un bon poulet rôti', + 'weightVariable' => true, + 'discountRate' => DiscountRate::fromRatio(0.2), + 'priceKgTtc' => Money::EUR(1500), + 'options' => ['extra' => 'crispy'], + ], $overrides); + + return new BasketProduct(...$data); + } + + it('can instantiate a basket product with all new typed properties', function (): void { + // GIVEN + $productId = new ProductId(Uuid::fromString('019e9e37-f2a1-74ef-b9c2-66d222470128')); + $brand = ProductBrand::marie; + $orderUnit = OrderUnit::PCE; + $price = Money::EUR(1000); + $discount = Money::EUR(200); + $priceKgTtc = Money::EUR(1500); + + // WHEN + $item = new BasketProduct( + id: $productId, + name: 'Poulet Rôti', + qty: 2, + unitPriceHt: $price, + unitDiscount: $discount, + taxRate: TaxRate::TVA_5_5, + weightGrams: 1200, + brand: $brand, + incoId: new IncoId(45), + orderUnit: $orderUnit, + slug: 'poulet-roti', + picture: 'images/poulet.jpg', + description: 'Un bon poulet rôti', + weightVariable: true, + discountRate: DiscountRate::fromRatio(0.2), + priceKgTtc: $priceKgTtc, + options: ['extra' => 'crispy'] + ); + + // THEN + expect((string) $item->id->value)->toBe('019e9e37-f2a1-74ef-b9c2-66d222470128'); + expect($item->name)->toBe('Poulet Rôti'); + expect($item->qty)->toBe(2); + expect($item->unitPriceHt->getAmount())->toBe('1000'); + expect($item->unitDiscount->getAmount())->toBe('200'); + expect($item->taxRate)->toBe(TaxRate::TVA_5_5); + expect($item->weightGrams)->toBe(1200); + expect($item->brand)->toBe(ProductBrand::marie); + expect($item->incoId->value)->toBe(45); + expect($item->orderUnit)->toBe(OrderUnit::PCE); + expect($item->slug)->toBe('poulet-roti'); + expect($item->picture)->toBe('images/poulet.jpg'); + expect($item->description)->toBe('Un bon poulet rôti'); + expect($item->weightVariable)->toBeTrue(); + expect($item->discountRate->basisPoints())->toBe(2000); + expect($item->priceKgTtc->getAmount())->toBe('1500'); + expect($item->options)->toBe(['extra' => 'crispy']); + }); + + it('can clone a basket product with new quantity and keep properties', function (): void { + // GIVEN + $productId = new ProductId(Uuid::fromString('019e9e37-f2a1-74ef-b9c2-66d222470128')); + $item = getNewBasketProduct(['id' => $productId, 'qty' => 2]); + $basketId = new BasketId(Uuid::fromString('019e9e37-f2a1-74ef-b9c2-66d222470128')); + $basket = new Basket($basketId); + + // WHEN + $basket->addOrUpdate($item); + $basket->addOrUpdate(getNewBasketProduct([ + 'id' => $productId, + 'qty' => 3, // Add 3 + ])); + + // THEN + expect($basket->countItems())->toBe(5); + + $updatedItem = $basket->items()[(string) $productId->value]; + expect($updatedItem->qty)->toBe(5); + expect($updatedItem->brand)->toBe(ProductBrand::marie); + expect($updatedItem->incoId->value)->toBe(45); + expect($updatedItem->orderUnit)->toBe(OrderUnit::PCE); + expect($updatedItem->slug)->toBe('poulet-roti'); + expect($updatedItem->picture)->toBe('images/poulet.jpg'); + expect($updatedItem->description)->toBe('Un bon poulet rôti'); + expect($updatedItem->weightVariable)->toBeTrue(); + expect($updatedItem->discountRate->basisPoints())->toBe(2000); + expect($updatedItem->priceKgTtc->getAmount())->toBe('1500'); + expect($updatedItem->options)->toBe(['extra' => 'crispy']); + }); +}); + +describe('Basket additional coverage', function (): void { + it('throws if item is not BasketProduct', function (): void { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + // WHEN + $action = fn () => new Basket($basketId, ['not-an-item']); + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('returns id', function (): void { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $basket = new Basket($basketId); + // WHEN + $id = $basket->id(); + // THEN + expect($id)->toBe($basketId); + }); + + it('removes item completely if quantity is greater or equal', function (): void { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $basket = new Basket($basketId); + $productId = new ProductId(Uuid::uuid7()); + + $item = getNewBasketProduct(['id' => $productId, 'qty' => 2]); + $basket->addOrUpdate($item); + + // WHEN + $basket->remove($productId, 2); + + // THEN + expect($basket->has($productId))->toBeFalse(); + }); + + it('decreases quantity when removing', function (): void { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $basket = new Basket($basketId); + $productId = new ProductId(Uuid::uuid7()); + + $item = getNewBasketProduct(['id' => $productId, 'qty' => 5]); + $basket->addOrUpdate($item); + + // WHEN + $basket->remove($productId, 2); + + // THEN + expect($basket->items()[(string) $productId->value]->qty)->toBe(3); + }); + + it('throws when removing less than 1', function (): void { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $basket = new Basket($basketId); + $productId = new ProductId(Uuid::uuid7()); + + // WHEN + $action = fn () => $basket->remove($productId, 0); + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws when removing non-existing item', function (): void { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $basket = new Basket($basketId); + $productId = new ProductId(Uuid::uuid7()); + + // WHEN + $action = fn () => $basket->remove($productId, 1); + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('removes line directly', function (): void { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $basket = new Basket($basketId); + $productId = new ProductId(Uuid::uuid7()); + + $item = getNewBasketProduct(['id' => $productId, 'qty' => 5]); + $basket->addOrUpdate($item); + + // WHEN + $basket->removeLine($productId); + + // THEN + expect($basket->has($productId))->toBeFalse(); + }); + + it('throws when removeLine on non-existing item', function (): void { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $basket = new Basket($basketId); + $productId = new ProductId(Uuid::uuid7()); + + // WHEN + $action = fn () => $basket->removeLine($productId); + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('computes totals', function (): void { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $basket = new Basket($basketId); + $productId = new ProductId(Uuid::uuid7()); + + $item = getNewBasketProduct(['id' => $productId, 'qty' => 1]); + $basket->addOrUpdate($item); + + // WHEN + $taxInc = $basket->totalTaxIncluded(); + $vat = $basket->totalVat(); + $raw = $basket->totalRaw(); + $discount = $basket->totalDiscount(); + $weight = $basket->totalWeight(); + + // THEN + expect($taxInc->getAmount())->toBe('844') // (1000 - 200) * 1.055 = 844 + ->and($vat->getAmount())->toBe('44') + ->and($raw->getAmount())->toBe('800') + ->and($discount->getAmount())->toBe('200') + ->and($weight)->toBe(1200); + }); +}); diff --git a/tests/Unit/Domain/Models/Entities/OrderTest.php b/tests/Unit/Domain/Models/Entities/OrderTest.php new file mode 100644 index 00000000..c258cc93 --- /dev/null +++ b/tests/Unit/Domain/Models/Entities/OrderTest.php @@ -0,0 +1,304 @@ + [$line]]); + + // THEN + expect($order)->toBeInstanceOf(Order::class) + ->and($order->status)->toBe(OrderStatus::VALIDATED) + ->and($order->getTotal()->getAmount())->toBe('3798') + ->and($order->getLines())->toHaveCount(1); + }); + + it('throws if total is zero or negative', function (): void { + // GIVEN + $total = Money::EUR(0); + + // WHEN + $action = fn () => makeOrder(['total' => $total]); + + // THEN + expect($action)->toThrow(\DomainException::class, 'Total amount must be greater than zero'); + }); + + it('throws if lines contain non-OrderLine instances', function (): void { + // GIVEN + $lines = ['not-an-order-line']; + + // WHEN + $action = fn () => makeOrder(['lines' => $lines]); + + // THEN + expect($action)->toThrow(\DomainException::class, 'All lines must be instances of OrderLine'); + }); +}); + +describe('Order - Cancellation', function (): void { + + it('cancels a validated order', function (): void { + // GIVEN + $order = makeOrder(['status' => OrderStatus::VALIDATED]); + + // WHEN + $order->cancel(); + + // THEN + expect($order->status)->toBe(OrderStatus::CANCELED); + }); + + it('cancels a waiting order', function (): void { + // GIVEN + $order = makeOrder(['status' => OrderStatus::WAITING]); + + // WHEN + $order->cancel(); + + // THEN + expect($order->status)->toBe(OrderStatus::CANCELED); + }); + + it('is idempotent when cancelling an already cancelled order', function (): void { + // GIVEN + $order = makeOrder(['status' => OrderStatus::CANCELED]); + + // WHEN + $order->cancel(); + + // THEN + expect($order->status)->toBe(OrderStatus::CANCELED); + }); +}); + +describe('Order - Getters immutability', function (): void { + + it('returns a clone of total', function (): void { + // GIVEN + $order = makeOrder(['total' => Money::EUR(5000)]); + + // WHEN + $total1 = $order->getTotal(); + $total2 = $order->getTotal(); + + // THEN + expect($total1)->toEqual($total2); + }); + + it('returns clones of lines', function (): void { + // GIVEN + $order = makeOrder(); + + // WHEN + $lines1 = $order->getLines(); + $lines2 = $order->getLines(); + + // THEN + expect($lines1[0])->toEqual($lines2[0]); + }); +}); + +describe('Order - id', function (): void { + it('returns id', function (): void { + // GIVEN + $order = makeOrder(); + // WHEN + $id = $order->id(); + // THEN + expect($id)->toBeInstanceOf(OrderId::class); + }); +}); + +describe('Order - fromBasket factory', function (): void { + it('creates an order from a basket with all lines mapped', function (): void { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $basket = new Basket($basketId); + + $basketProduct = new BasketProduct( + id: new ProductId(Uuid::uuid7()), + name: 'Poulet Rôti', + qty: 2, + unitPriceHt: Money::EUR(1000), + unitDiscount: Money::EUR(100), + taxRate: TaxRate::TVA_5_5, + weightGrams: 1200, + brand: ProductBrand::marie, + incoId: new IncoId(45), + orderUnit: OrderUnit::PCE, + slug: 'poulet-roti', + picture: 'images/poulet.jpg', + description: 'Un bon poulet', + weightVariable: false, + discountRate: DiscountRate::fromRatio(0.1), + priceKgTtc: Money::EUR(1500) + ); + $basket->addOrUpdate($basketProduct); + + $orderId = new OrderId(Uuid::uuid7()); + $reference = new OrderReference(Uuid::uuid7()); + $pickupTimeSlot = new PickupTimeSlot( + new \DateTimeImmutable('+1 day 10:00'), + new \DateInterval('PT10M') + ); + + $shopper = new Shopper( + id: new ShopperId(Uuid::uuid7()), + email: new Email('jean.dupont@example.com'), + matricule: new Matricule('1234567'), + nom: 'Dupont', + prenom: 'Jean', + startDate: CarbonImmutable::now(), + endDate: null, + etablissement: new ShopperEstablishmentCode('ETAB01'), + site: new ShopperSiteCode('SITEA'), + service: new ShopperServiceCode('101') + ); + + $shop = new Shop( + id: new ShopId(Uuid::uuid7()), + name: 'Cocotte Lyon', + address: '12 rue de la Paix', + postcode: '69001', + city: 'Lyon', + phone: '0478123456' + ); + + // WHEN + $order = Order::fromBasket($orderId, $reference, $basket, $pickupTimeSlot, $shopper, $shop); + + // THEN + expect($order->id())->toBe($orderId) + ->and($order->reference)->toBe($reference) + ->and($order->status)->toBe(OrderStatus::VALIDATED) + ->and($order->employee->firstname)->toBe('Jean') + ->and($order->employee->lastname)->toBe('Dupont') + ->and($order->deliveryAddress->name)->toBe('Cocotte Lyon') + ->and($order->getLines())->toHaveCount(1) + ->and($order->getLines()[0]->product->name)->toBe('Poulet Rôti') + ->and($order->getLines()[0]->quantity)->toBe(2); + }); +}); + +describe('Order - Domain Events', function (): void { + + it('produces an AnOrderHasBeenPlaced domain event', function (): void { + // GIVEN + $order = makeOrder(); + + // WHEN + $event = $order->toPlacedEvent(); + + // THEN + expect($event)->toBeInstanceOf(AnOrderHasBeenPlaced::class) + ->and($event->orderId)->toBe($order->id()) + ->and($event->reference)->toBe($order->reference) + ->and($event->totalTtc->getAmount())->toBe($order->getTotal()->getAmount()) + ->and($event->byMatricule)->toBe($order->employee->matricule) + ->and($event->employee->matricule)->toBe($order->employee->matricule) + ->and($event->shop->name)->toBe($order->deliveryAddress->name) + ->and($event->lines)->toHaveCount(count($order->getLines())) + ->and($event->lines[0]->productName)->toBe($order->getLines()[0]->product->name); + }); +}); diff --git a/tests/Unit/Domain/Models/Entities/PickupExceptionOnDateTest.php b/tests/Unit/Domain/Models/Entities/PickupExceptionOnDateTest.php new file mode 100644 index 00000000..24331f24 --- /dev/null +++ b/tests/Unit/Domain/Models/Entities/PickupExceptionOnDateTest.php @@ -0,0 +1,70 @@ +id())->toBe($id) + ->and($entity->id)->toBe($id) + ->and($entity->date)->toBe($date) + ->and($entity->label)->toBe($label) + ->and($entity->repeatable)->toBe($repeatable) + ->and($entity->repeatFrequency)->toBe($repeatFrequency) + ->and($entity->autoUpdated)->toBe($autoUpdated); + }); + + it('determines if exception falls on a pickup day', function (): void { + // GIVEN + $fridayDate = CarbonImmutable::create(2025, 1, 3); // 2025-01-03 is Friday + $mondayDate = CarbonImmutable::create(2025, 1, 6); // 2025-01-06 is Monday + + $fridayException = new PickupExceptionOnDate( + new PickupExceptionId(Uuid::uuid7()), + $fridayDate, + 'Friday holiday', + false, + RepeatFrequency::YEARLY, + false + ); + + $mondayException = new PickupExceptionOnDate( + new PickupExceptionId(Uuid::uuid7()), + $mondayDate, + 'Monday holiday', + false, + RepeatFrequency::YEARLY, + false + ); + + // WHEN & THEN + expect($fridayException->isPickupDay())->toBeTrue() + ->and($mondayException->isPickupDay())->toBeFalse(); + }); +}); diff --git a/tests/Unit/Domain/Models/Entities/ProductTest.php b/tests/Unit/Domain/Models/Entities/ProductTest.php new file mode 100644 index 00000000..135ee112 --- /dev/null +++ b/tests/Unit/Domain/Models/Entities/ProductTest.php @@ -0,0 +1,498 @@ +subDay(); + $orderableEnd = CarbonImmutable::now()->addDay(); + $hasInco = true; + + // WHEN + $entity = new Product( + $id, + $price, + $taxRate, + $weight, + $invoicingUnit, + $sellUnit, + $discount, + $status, + $orderableStart, + $orderableEnd, + $hasInco + ); + + // THEN + expect($entity->id())->toBe($id) + ->and($entity->price)->toBe($price) + ->and($entity->tax_rate)->toBe($taxRate) + ->and($entity->product_weight)->toBe($weight) + ->and($entity->invoicing_unit)->toBe($invoicingUnit) + ->and($entity->sell_unit)->toBe($sellUnit) + ->and($entity->validDiscount)->toBe($discount) + ->and($entity->status)->toBe($status) + ->and($entity->orderable_start)->toBe($orderableStart) + ->and($entity->orderable_end)->toBe($orderableEnd) + ->and($entity->hasInco)->toBe($hasInco); + }); + + describe('isPublished', function (): void { + it('returns true when status is active', function (): void { + // GIVEN + $product = makeProduct(status: true); + + // WHEN + $result = $product->isPublished(); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns false when status is inactive', function (): void { + // GIVEN + $product = makeProduct(status: false); + + // WHEN + $result = $product->isPublished(); + + // THEN + expect($result)->toBeFalse(); + }); + }); + + describe('hasInco', function (): void { + it('reflects the hasInco property', function (): void { + // GIVEN + $withInco = makeProduct(hasInco: true); + $withoutInco = makeProduct(hasInco: false); + + // WHEN & THEN + expect($withInco->hasInco())->toBeTrue() + ->and($withoutInco->hasInco())->toBeFalse(); + }); + }); + + describe('hasDiscount', function (): void { + it('returns true when validDiscount exists', function (): void { + // GIVEN + $product = makeProduct(discount: DiscountValue::fromPercentage(15)); + + // WHEN + $result = $product->hasDiscount(); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns false when validDiscount is null', function (): void { + // GIVEN + $product = makeProduct(discount: null); + + // WHEN + $result = $product->hasDiscount(); + + // THEN + expect($result)->toBeFalse(); + }); + }); + + describe('canBeOrderOn', function (): void { + it('returns true when orderable dates are not defined and product is active with inco', function (): void { + // GIVEN + $product = makeProduct(orderableStart: null, orderableEnd: null, status: true, hasInco: true); + $now = CarbonImmutable::now(); + + // WHEN + $result = $product->canBeOrderOn($now); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns true when date is between start and end', function (): void { + // GIVEN + $now = CarbonImmutable::now(); + $product = makeProduct( + status: true, + orderableStart: $now->subDay(), + orderableEnd: $now->addDay(), + hasInco: true + ); + + // WHEN + $result = $product->canBeOrderOn($now); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns false when date is before start', function (): void { + // GIVEN + $now = CarbonImmutable::now(); + $product = makeProduct( + status: true, + orderableStart: $now->addDay(), + orderableEnd: $now->addDays(3), + hasInco: true + ); + + // WHEN + $result = $product->canBeOrderOn($now); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns false when date is after end', function (): void { + // GIVEN + $now = CarbonImmutable::now(); + $product = makeProduct( + status: true, + orderableStart: $now->subDays(3), + orderableEnd: $now->subDay(), + hasInco: true + ); + + // WHEN + $result = $product->canBeOrderOn($now); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns false when product has no inco', function (): void { + // GIVEN + $now = CarbonImmutable::now(); + $product = makeProduct( + status: true, + orderableStart: null, + orderableEnd: null, + hasInco: false + ); + + // WHEN + $result = $product->canBeOrderOn($now); + + // THEN + expect($result)->toBeFalse(); + }); + }); + + describe('isOrderable', function (): void { + it('returns true when published and within orderable range', function (): void { + // GIVEN + $now = CarbonImmutable::now(); + $product = makeProduct( + status: true, + orderableStart: $now->subDay(), + orderableEnd: $now->addDay(), + hasInco: true + ); + + // WHEN + $result = $product->isOrderable($now); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns false when not published even if within date range', function (): void { + // GIVEN + $now = CarbonImmutable::now(); + $product = makeProduct( + status: false, + orderableStart: $now->subDay(), + orderableEnd: $now->addDay(), + hasInco: true + ); + + // WHEN + $result = $product->isOrderable($now); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns false when published but outside date range', function (): void { + // GIVEN + $now = CarbonImmutable::now(); + $product = makeProduct( + status: true, + orderableStart: $now->addDay(), + orderableEnd: $now->addDays(2), + hasInco: true + ); + + // WHEN + $result = $product->isOrderable($now); + + // THEN + expect($result)->toBeFalse(); + }); + }); + + describe('pricing calculations', function (): void { + it('calculates standard pricing without discounts', function (): void { + // GIVEN + $product = makeProduct( + price: Money::EUR(1000), // 10.00 EUR HT + taxRate: TaxRate::TVA_20, + invoicingUnit: InvoicingUnit::PCE, + sellUnit: SellUnit::PCE + ); + + // WHEN + $pricing = $product->pricing(); + + // THEN + expect($pricing)->toBeInstanceOf(ProductPricing::class) + ->and($pricing->basePriceHt())->toEqual(Money::EUR(1000)) + ->and($pricing->basePriceTtc())->toEqual(Money::EUR(1200)) + ->and($pricing->discountAmountHt())->toEqual(Money::EUR(0)) + ->and($pricing->discountedPriceHt())->toEqual(Money::EUR(1000)) + ->and($pricing->discountedPriceTtc())->toEqual(Money::EUR(1200)) + ->and($pricing->hasDiscount)->toBeFalse() + ->and($pricing->discountRate->ratio())->toBe(0.0); + }); + + it('calculates weighted base price HT when invoiced by KGM and sold by PCE', function (): void { + // GIVEN + // 20€/kg HT, 500g weight => 10€ HT + $product = makeProduct( + price: Money::EUR(2000), + taxRate: TaxRate::TVA_20, + weight: new ProductWeight(500, false), + invoicingUnit: InvoicingUnit::KGM, + sellUnit: SellUnit::PCE + ); + + // WHEN + $basePriceHt = $product->basePriceHt(); + + // THEN + expect($basePriceHt)->toEqual(Money::EUR(1000)); + }); + + it('applies percentage discount properly', function (): void { + // GIVEN + $product = makeProduct( + price: Money::EUR(1000), // 10.00 EUR HT + taxRate: TaxRate::TVA_20, + discount: DiscountValue::fromPercentage(20) // 20% discount + ); + + // WHEN + $pricing = $product->pricing(); + + // THEN + expect($pricing->hasDiscount)->toBeTrue() + ->and($pricing->discountAmountHt())->toEqual(Money::EUR(200)) + ->and($pricing->discountedPriceHt())->toEqual(Money::EUR(800)) + ->and($pricing->discountedPriceTtc())->toEqual(Money::EUR(960)) + ->and($pricing->discountRate->percentage())->toBe(20.0); + }); + + it('applies fixed discount properly and caps at base price HT', function (): void { + // GIVEN + $product = makeProduct( + price: Money::EUR(1000), // 10.00 EUR HT + taxRate: TaxRate::TVA_20, + discount: DiscountValue::fromAmount(Money::EUR(1500)) // 15.00 EUR discount > 10.00 EUR + ); + + // WHEN + $pricing = $product->pricing(); + + // THEN + expect($pricing->discountAmountHt())->toEqual(Money::EUR(1000)) + ->and($pricing->discountedPriceHt())->toEqual(Money::EUR(0)) + ->and($pricing->discountedPriceTtc())->toEqual(Money::EUR(0)); + }); + + it('calculates virtual price per KG TTC for PCE product with weight', function (): void { + // GIVEN + // 10€ HT, 20% VAT => 12€ TTC. Weight: 500g (0.5kg) => 24€/kg TTC + $product = makeProduct( + price: Money::EUR(1000), + taxRate: TaxRate::TVA_20, + weight: new ProductWeight(500, false), + invoicingUnit: InvoicingUnit::PCE, + sellUnit: SellUnit::PCE + ); + + // WHEN + $priceKgTtc = $product->priceKgTtc(); + + // THEN + expect($priceKgTtc)->toEqual(Money::EUR(2400)); + }); + + it('returns standard price as price per KG TTC if the product status is false', function (): void { + // GIVEN + $product = makeProduct( + price: Money::EUR(1000), + taxRate: TaxRate::TVA_20, + weight: new ProductWeight(250, false), + invoicingUnit: InvoicingUnit::PCE, + sellUnit: SellUnit::PCE, + status: false + ); + + // WHEN + $result = $product->pricing(); + + // THEN + expect($result->priceKgTtc())->toEqual(Money::EUR(1200)); + }); + + it('returns a 0.0 discount rate if base price HT is 0', function (): void { + // GIVEN + $product = makeProduct( + price: Money::EUR(0), + discount: DiscountValue::fromAmount(Money::EUR(0)) + ); + + // WHEN + $result = $product->pricing(); + + // THEN + expect($result->discountRate->basisPoints())->toBe(0); + }); + + it('calculates the price per KG TTC for a product invoiced by KGM and sold by PCE', function (): void { + // GIVEN + $product = makeProduct( + price: Money::EUR(865), // 8.65 €/kg + taxRate: TaxRate::TVA_5_5, + weight: new ProductWeight(360, false), // 360g + invoicingUnit: InvoicingUnit::KGM, + sellUnit: SellUnit::PCE, + status: true + ); + + // WHEN + $result = $product->pricing(); + + // THEN + expect($result->basePriceHt())->toEqual(Money::EUR(312)) + ->and($result->basePriceTtc())->toEqual(Money::EUR(330)) + ->and($result->priceKgTtc())->toEqual(Money::EUR(913)); + }); + + it('calculates the price per KG TTC for a product invoiced by KGM with percentage discount', function (): void { + // GIVEN + $product = makeProduct( + price: Money::EUR(865), // 8.65 €/kg + taxRate: TaxRate::TVA_5_5, + weight: new ProductWeight(360, false), // 360g + invoicingUnit: InvoicingUnit::KGM, + sellUnit: SellUnit::PCE, + discount: DiscountValue::fromPercentage(10), + status: true + ); + + // WHEN + $result = $product->pricing(); + + // THEN + expect($result->discountedPriceHt())->toEqual(Money::EUR(280)) + ->and($result->discountedPriceTtc())->toEqual(Money::EUR(296)) + ->and($result->priceKgTtc())->toEqual(Money::EUR(821)); + }); + + it('calculates the price per KG TTC for a product invoiced by KGM with fixed amount discount', function (): void { + // GIVEN + $product = makeProduct( + price: Money::EUR(865), // 8.65 €/kg + taxRate: TaxRate::TVA_5_5, + weight: new ProductWeight(360, false), + invoicingUnit: InvoicingUnit::KGM, + sellUnit: SellUnit::PCE, + discount: DiscountValue::fromAmount(Money::EUR(50)), // 50 cts discount on piece + status: true + ); + + // WHEN + $result = $product->pricing(); + + // THEN + // 50 cts off a 360 g piece => 139 cts off per kg: (865 - 139) HT x 1.055 + expect($result->discountedPriceTtc())->toEqual(Money::EUR(277)) + ->and($result->priceKgTtc())->toEqual(Money::EUR(766)); + }); + + it('caps the discount at the piece price when a fixed discount exceeds the piece price for KGM', function (): void { + // GIVEN + $product = makeProduct( + price: Money::EUR(865), // 8.65 €/kg => 3.12 € HT for 360g + taxRate: TaxRate::TVA_5_5, + weight: new ProductWeight(360, false), + invoicingUnit: InvoicingUnit::KGM, + sellUnit: SellUnit::PCE, + discount: DiscountValue::fromAmount(Money::EUR(500)), // 5.00 € discount > 3.12 € + status: true + ); + + // WHEN + $result = $product->pricing(); + + // THEN + expect($result->discountAmountHt())->toEqual(Money::EUR(312)) + ->and($result->discountedPriceHt())->toEqual(Money::EUR(0)) + ->and($result->discountedPriceTtc())->toEqual(Money::EUR(0)) + ->and($result->priceKgTtc())->toEqual(Money::EUR(0)) + ->and($result->discountRate->basisPoints())->toBe(10000); + }); + }); +}); diff --git a/tests/Unit/Domain/Models/Entities/ShopTest.php b/tests/Unit/Domain/Models/Entities/ShopTest.php new file mode 100644 index 00000000..55407ed5 --- /dev/null +++ b/tests/Unit/Domain/Models/Entities/ShopTest.php @@ -0,0 +1,93 @@ +id())->toBe($id) + ->and($entity->id)->toBe($id) + ->and($entity->name)->toBe($name) + ->and($entity->address)->toBe($address) + ->and($entity->postcode)->toBe($postcode) + ->and($entity->city)->toBe($city) + ->and($entity->phone)->toBe($phone) + ->and($entity->latitude)->toBe($lat) + ->and($entity->longitude)->toBe($lon) + ->and($entity->isDefault)->toBe($isDefault); + }); + + it('throws exception if name is empty', function (): void { + // GIVEN + $id = new ShopId(Uuid::uuid7()); + + // WHEN + $action = fn () => new Shop($id, '', 'Address', '12345', 'City'); + + // THEN + expect($action)->toThrow(\DomainException::class, 'name cannot be empty'); + }); + + it('throws exception if address is empty', function (): void { + // GIVEN + $id = new ShopId(Uuid::uuid7()); + + // WHEN + $action = fn () => new Shop($id, 'Name', '', '12345', 'City'); + + // THEN + expect($action)->toThrow(\DomainException::class, 'address cannot be empty'); + }); + + it('throws exception if postcode is empty', function (): void { + // GIVEN + $id = new ShopId(Uuid::uuid7()); + + // WHEN + $action = fn () => new Shop($id, 'Name', 'Address', '', 'City'); + + // THEN + expect($action)->toThrow(\DomainException::class, 'postcode cannot be empty'); + }); + + it('throws exception if city is empty', function (): void { + // GIVEN + $id = new ShopId(Uuid::uuid7()); + + // WHEN + $action = fn () => new Shop($id, 'Name', 'Address', '12345', ''); + + // THEN + expect($action)->toThrow(\DomainException::class, 'city cannot be empty'); + }); +}); diff --git a/tests/Unit/Domain/Models/Entities/ShopperTest.php b/tests/Unit/Domain/Models/Entities/ShopperTest.php new file mode 100644 index 00000000..50dc9f29 --- /dev/null +++ b/tests/Unit/Domain/Models/Entities/ShopperTest.php @@ -0,0 +1,138 @@ +subDay(); + $endDate = null; + $etablissement = new ShopperEstablishmentCode('ETAB01'); + $site = new ShopperSiteCode('SITE'); + $service = new ShopperServiceCode('101'); + + // WHEN + $entity = new Shopper( + $id, + $email, + $matricule, + 'Nom', + 'Prenom', + $startDate, + $endDate, + $etablissement, + $site, + $service + ); + + // THEN + expect($entity->id())->toBe($id) + ->and($entity->email)->toBe($email) + ->and($entity->matricule)->toBe($matricule) + ->and($entity->nom)->toBe('Nom') + ->and($entity->prenom)->toBe('Prenom') + ->and($entity->startDate)->toBe($startDate) + ->and($entity->endDate)->toBeNull() + ->and($entity->etablissement)->toBe($etablissement) + ->and($entity->site)->toBe($site) + ->and($entity->service)->toBe($service) + ->and($entity->isActive())->toBeTrue(); + }); + + it('is inactive when endDate is in the past', function (): void { + // GIVEN + $endDate = CarbonImmutable::now()->subDay(); + + // WHEN + $entity = new Shopper( + new ShopperId(Uuid::uuid7()), + new Email('test@example.com'), + new Matricule('1234567'), + 'Nom', + 'Prenom', + CarbonImmutable::now()->subDays(2), + $endDate, + new ShopperEstablishmentCode('ETAB01'), + new ShopperSiteCode('SITE'), + new ShopperServiceCode('101') + ); + + // THEN + expect($entity->isActive())->toBeFalse(); + }); + + it('is active when endDate is in the future', function (): void { + // GIVEN + $endDate = CarbonImmutable::now()->addDay(); + + // WHEN + $entity = new Shopper( + new ShopperId(Uuid::uuid7()), + new Email('test@example.com'), + new Matricule('1234567'), + 'Nom', + 'Prenom', + CarbonImmutable::now()->subDays(2), + $endDate, + new ShopperEstablishmentCode('ETAB01'), + new ShopperSiteCode('SITE'), + new ShopperServiceCode('101') + ); + + // THEN + expect($entity->isActive())->toBeTrue(); + }); + + it('throws exception if nom is empty', function (): void { + // WHEN + $action = fn () => new Shopper( + new ShopperId(Uuid::uuid7()), + new Email('test@example.com'), + new Matricule('1234567'), + '', + 'Prenom', + CarbonImmutable::now()->subDays(2), + null, + new ShopperEstablishmentCode('ETAB01'), + new ShopperSiteCode('SITE'), + new ShopperServiceCode('101') + ); + + // THEN + expect($action)->toThrow(\DomainException::class, 'nom cannot be empty'); + }); + + it('throws exception if prenom is empty', function (): void { + // WHEN + $action = fn () => new Shopper( + new ShopperId(Uuid::uuid7()), + new Email('test@example.com'), + new Matricule('1234567'), + 'Nom', + '', + CarbonImmutable::now()->subDays(2), + null, + new ShopperEstablishmentCode('ETAB01'), + new ShopperSiteCode('SITE'), + new ShopperServiceCode('101') + ); + + // THEN + expect($action)->toThrow(\DomainException::class, 'prenom cannot be empty'); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/AttachedFileTest.php b/tests/Unit/Domain/Models/ValueObjects/AttachedFileTest.php new file mode 100644 index 00000000..f9864afc --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/AttachedFileTest.php @@ -0,0 +1,71 @@ + 'path/to/file', + 'originalName' => 'file.pdf', + 'mimeType' => 'application/pdf', + ], $overrides); + + return new AttachedFile(...$data); + } + + it('can instantiate', function () { + // GIVEN + $path = 'path/to/file'; + $originalName = 'file.pdf'; + $mimeType = 'application/pdf'; + + // WHEN + $vo = new AttachedFile( + path: $path, + originalName: $originalName, + mimeType: $mimeType + ); + + // THEN + expect($vo)->toBeInstanceOf(AttachedFile::class); + }); + + it('throws exception if path is empty', function () { + // GIVEN + $path = ' '; + + // WHEN + $action = fn () => getNewAttachedFile(['path' => $path]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if original name is empty', function () { + // GIVEN + $originalName = ' '; + + // WHEN + $action = fn () => getNewAttachedFile(['originalName' => $originalName]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if mime type is empty', function () { + // GIVEN + $mimeType = ' '; + + // WHEN + $action = fn () => getNewAttachedFile(['mimeType' => $mimeType]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/BasketProductTest.php b/tests/Unit/Domain/Models/ValueObjects/BasketProductTest.php new file mode 100644 index 00000000..f4769633 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/BasketProductTest.php @@ -0,0 +1,303 @@ + new ProductId(Uuid::uuid7()), + 'name' => 'Product Name', + 'qty' => 1, + 'unitPriceHt' => getMoney(100), + 'unitDiscount' => getMoney(10), + 'taxRate' => TaxRate::TVA_20, + 'weightGrams' => 500, + 'brand' => ProductBrand::none, + 'incoId' => null, + 'orderUnit' => OrderUnit::PCE, + 'slug' => 'product-slug', + 'picture' => null, + 'description' => null, + 'weightVariable' => false, + 'discountRate' => DiscountRate::fromRatio(0.1), + 'priceKgTtc' => getMoney(240), + ], $overrides); + + return new BasketProduct(...$data); + } + + // --- Tests d'instanciation et de validation (Invariants) --- + + it('can instantiate', function () { + // GIVEN + $id = new ProductId(Uuid::uuid7()); + $name = 'Product Name'; + $qty = 2; + $unitPriceHt = getMoney(100); + $unitDiscount = getMoney(10); + $taxRate = TaxRate::TVA_20; + $weightGrams = 500; + $brand = ProductBrand::none; + $incoId = null; + $orderUnit = OrderUnit::PCE; + $slug = 'product-slug'; + $picture = null; + $description = null; + $weightVariable = false; + $discountRate = DiscountRate::fromRatio(0.1); + $priceKgTtc = getMoney(240); + + // WHEN + $vo = new BasketProduct( + id: $id, + name: $name, + qty: $qty, + unitPriceHt: $unitPriceHt, + unitDiscount: $unitDiscount, + taxRate: $taxRate, + weightGrams: $weightGrams, + brand: $brand, + incoId: $incoId, + orderUnit: $orderUnit, + slug: $slug, + picture: $picture, + description: $description, + weightVariable: $weightVariable, + discountRate: $discountRate, + priceKgTtc: $priceKgTtc + ); + + // THEN + expect($vo)->toBeInstanceOf(BasketProduct::class); + }); + + it('throws exception if name is empty', function () { + // GIVEN + $name = ' '; + + // WHEN + $action = fn () => getNewProduct([ + 'name' => $name, + + ]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if slug is empty', function () { + // GIVEN + $slug = ' '; + + // WHEN + $action = fn () => getNewProduct([ + 'slug' => $slug, + + ]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if qty is zero or negative', function () { + // GIVEN + $qty = 0; + + // WHEN + $action = fn () => getNewProduct([ + 'qty' => $qty, + + ]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if unitPriceHt is zero or negative', function () { + // GIVEN + $unitPriceHt = getMoney(0); + + // WHEN + $action = fn () => getNewProduct([ + 'unitPriceHt' => $unitPriceHt, + + ]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if unitDiscount is negative', function () { + // GIVEN + $unitDiscount = getMoney(-1); + + // WHEN + $action = fn () => getNewProduct([ + 'unitDiscount' => $unitDiscount, + + ]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if priceKgTtc is zero or negative', function () { + // GIVEN + $priceKgTtc = getMoney(0); + + // WHEN + $action = fn () => getNewProduct([ + 'priceKgTtc' => $priceKgTtc, + + ]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + // --- Tests des méthodes de calcul et de logique métier --- + + it('returns a clone of unitPriceHt', function () { + // GIVEN + $price = getMoney(100); + $product = getNewProduct(['unitPriceHt' => $price]); + + // WHEN + $unitPriceHt = $product->unitPriceHt(); + + // THEN + expect($unitPriceHt)->toBe($price); // It returns the identical immutable reference + }); + + it('calculates unitTtc correctly', function () { + // GIVEN + $product = getNewProduct([ + 'unitPriceHt' => getMoney(1000), // ex: 10.00 + 'unitDiscount' => getMoney(100), // ex: 1.00 + 'taxRate' => TaxRate::TVA_20, + ]); + + // WHEN + // Discounted HT = 900 + // Tax (20%) = 180 + // unitTtc = 1080 + $unitTtc = $product->unitTtc(); + + // THEN + expect($unitTtc->getAmount())->toBe('1080'); + }); + + it('calculates discountTotal correctly', function () { + // GIVEN + $product = getNewProduct([ + 'qty' => 3, + 'unitDiscount' => getMoney(150), + ]); + + // WHEN + $discountTotal = $product->discountTotal(); + + // THEN + expect($discountTotal->getAmount())->toBe('450'); + }); + + it('calculates priceTotalHt correctly', function () { + // GIVEN + $product = getNewProduct([ + 'qty' => 4, + 'unitPriceHt' => getMoney(1000), + ]); + + // WHEN + $priceTotalHt = $product->priceTotalHt(); + + // THEN + expect($priceTotalHt->getAmount())->toBe('4000'); + }); + + it('calculates subtotalHt correctly', function () { + // GIVEN + $product = getNewProduct([ + 'qty' => 2, + 'unitPriceHt' => getMoney(1000), + 'unitDiscount' => getMoney(200), + ]); + + // WHEN + // priceTotal = 2000, discountTotal = 400 => subtotalHt = 1600 + $subtotalHt = $product->subtotalHt(); + + // THEN + expect($subtotalHt->getAmount())->toBe('1600'); + }); + + it('calculates taxTotal correctly', function () { + // GIVEN + $product = getNewProduct([ + 'qty' => 3, + 'unitPriceHt' => getMoney(1000), + 'unitDiscount' => getMoney(100), + 'taxRate' => TaxRate::TVA_20, + ]); + + // WHEN + // (1000 - 100) * 3 = 2700 + // 20% of 2700 = 540 + $taxTotal = $product->taxTotal(); + + // THEN + expect($taxTotal->getAmount())->toBe('540'); + }); + + it('calculates totalTtc correctly', function () { + // GIVEN + $product = getNewProduct([ + 'qty' => 3, + 'unitPriceHt' => getMoney(1000), + 'unitDiscount' => getMoney(100), + 'taxRate' => TaxRate::TVA_20, + ]); + + // WHEN + // subtotalHt = 2700 + // taxTotal = 540 + // totalTtc = 3240 + $totalTtc = $product->totalTtc(); + + // THEN + expect($totalTtc->getAmount())->toBe('3240'); + }); + + it('calculates weightTotal correctly', function () { + // GIVEN + $product = getNewProduct([ + 'qty' => 5, + 'weightGrams' => 200, + ]); + + // WHEN + $weightTotal = $product->weightTotal(); + + // THEN + expect($weightTotal)->toBe(1000); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/CodeTest.php b/tests/Unit/Domain/Models/ValueObjects/CodeTest.php new file mode 100644 index 00000000..7ee20aab --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/CodeTest.php @@ -0,0 +1,89 @@ +toBeInstanceOf(Code::class) + ->and($vo->value)->toBe($value); + })->with([ + 'standard length 6' => 'ABCDEF', + 'legacy code length 8' => 'ABCDEFGH', + 'length 9' => '123456789', + 'length 10' => 'ABCDEFGH12', + ]); + + it('throws exception if code is empty', function () { + // GIVEN + $value = ' '; + + // WHEN + $action = fn () => new Code($value); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if code length is invalid', function (string $value) { + // GIVEN + // WHEN + $action = fn () => new Code($value); + + // THEN + expect($action)->toThrow(\DomainException::class); + })->with([ + 'too short (5)' => '12345', + 'too long (11)' => '12345678911', + ]); + + it('throws exception if code contains invalid chars', function (string $value) { + // GIVEN + // WHEN + $action = fn () => new Code($value); + + // THEN + expect($action)->toThrow(\DomainException::class, 'Code contains invalid characters'); + })->with([ + 'special char' => 'ABCDEF#123', + 'contains uppercase O' => 'ABCDEFGHO1', + 'contains lowercase o' => 'abcdefgho1', + 'contains zero' => 'ABCDEFGH01', + 'contains uppercase I' => 'ABCDEFGH1I', + 'contains lowercase l' => 'abcdefgh1l', + ]); +}); + +describe('Code methods', function (): void { + it('can be cast to string', function (): void { + // GIVEN + $vo = new Code('ABCDEFGH12'); + // WHEN + $str = (string) $vo; + // THEN + expect($str)->toBe('ABCDEFGH12'); + }); + + it('can equate', function (): void { + // GIVEN + $vo1 = new Code('ABCDEFGH12'); + $vo2 = new Code('ABCDEFGH12'); + $vo3 = new Code('1234567891'); + // WHEN + $eq1 = $vo1->equals($vo2); + $eq2 = $vo1->equals($vo3); + $eq3 = $vo1->equals('ABCDEFGH12'); + // THEN + expect($eq1)->toBeTrue() + ->and($eq2)->toBeFalse() + ->and($eq3)->toBeFalse(); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/ContactFormDataTest.php b/tests/Unit/Domain/Models/ValueObjects/ContactFormDataTest.php new file mode 100644 index 00000000..66efa15c --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/ContactFormDataTest.php @@ -0,0 +1,134 @@ + 'Doe', + 'firstName' => 'John', + 'email' => 'john@example.com', + 'subject' => 'Inquiry', + 'message' => 'This is a message.', + 'orderRef' => null, + 'file' => null, + ], $overrides); + + return new ContactFormData(...$data); + } + + it('can instantiate', function () { + // GIVEN + $lastName = 'Doe'; + $firstName = 'John'; + $email = 'john@example.com'; + $subject = 'Inquiry'; + $message = 'This is a message.'; + $orderRef = 'REF-123'; + $file = null; + + // WHEN + $vo = new ContactFormData( + lastName: $lastName, + firstName: $firstName, + email: $email, + subject: $subject, + message: $message, + orderRef: $orderRef, + file: $file + ); + + // THEN + expect($vo)->toBeInstanceOf(ContactFormData::class); + }); + + it('throws exception if lastName is empty', function () { + // GIVEN + $lastName = ' '; + + // WHEN + $action = fn () => getNewContactFormData([ + 'lastName' => $lastName, + + ]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if firstName is empty', function () { + // GIVEN + $firstName = ' '; + + // WHEN + $action = fn () => getNewContactFormData([ + 'firstName' => $firstName, + + ]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if email is empty', function () { + // GIVEN + $email = ' '; + + // WHEN + $action = fn () => getNewContactFormData([ + 'email' => $email, + + ]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if subject is empty', function () { + // GIVEN + $subject = ' '; + + // WHEN + $action = fn () => getNewContactFormData([ + 'subject' => $subject, + + ]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if message is empty', function () { + // GIVEN + $message = ' '; + + // WHEN + $action = fn () => getNewContactFormData([ + 'message' => $message, + + ]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); +}); + +it('throws exception if orderRef is provided but empty', function () { + // GIVEN + $orderRef = ' '; + + // WHEN + $action = fn () => getNewContactFormData([ + 'orderRef' => $orderRef, + + ]); + + // THEN + expect($action)->toThrow(\DomainException::class); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/CoordinatesTest.php b/tests/Unit/Domain/Models/ValueObjects/CoordinatesTest.php new file mode 100644 index 00000000..0338565d --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/CoordinatesTest.php @@ -0,0 +1,38 @@ +latitude)->toBe(48.8566) + ->and($coords->longitude)->toBe(2.3522); + }); + + test('it throws when latitude is out of bounds', function () { + // GIVEN & WHEN & THEN + expect(fn () => new Coordinates(91.0, 0.0)) + ->toThrow(\InvalidArgumentException::class, 'Latitude must be between -90 and 90 degrees.'); + + expect(fn () => new Coordinates(-91.0, 0.0)) + ->toThrow(\InvalidArgumentException::class, 'Latitude must be between -90 and 90 degrees.'); + }); + + test('it throws when longitude is out of bounds', function () { + // GIVEN & WHEN & THEN + expect(fn () => new Coordinates(0.0, 181.0)) + ->toThrow(\InvalidArgumentException::class, 'Longitude must be between -180 and 180 degrees.'); + + expect(fn () => new Coordinates(0.0, -181.0)) + ->toThrow(\InvalidArgumentException::class, 'Longitude must be between -180 and 180 degrees.'); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/CrmCustomerTest.php b/tests/Unit/Domain/Models/ValueObjects/CrmCustomerTest.php new file mode 100644 index 00000000..29c14e4f --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/CrmCustomerTest.php @@ -0,0 +1,54 @@ +toArray())->toBe([ + 'hashcode' => 'hash', + 'email' => 'test@example.com', + 'password' => 'pass', + 'firstname' => 'John', + 'lastname' => 'Doe', + 'birthDate' => '1990-01-01', + 'phone' => '1234567890', + 'address' => '1 rue', + 'address2' => 'bis', + 'city' => 'Paris', + 'postcode' => '75001', + 'country' => Country::france, + 'optIn' => true, + 'status' => true, + 'lastConnection' => $date, + ]); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/DatePeriodTest.php b/tests/Unit/Domain/Models/ValueObjects/DatePeriodTest.php new file mode 100644 index 00000000..29518f99 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/DatePeriodTest.php @@ -0,0 +1,89 @@ +isActiveAt(); + + // THEN + expect($period->start)->toBeNull() + ->and($period->end)->toBeNull() + ->and($isActive)->toBeTrue(); + }); + + it('creates a period with start and end dates', function (): void { + // GIVEN + $start = new \DateTimeImmutable('2026-01-01 00:00:00'); + $end = new \DateTimeImmutable('2026-12-31 23:59:59'); + + // WHEN + $period = new DatePeriod($start, $end); + + // THEN + expect($period->start)->toEqual($start) + ->and($period->end)->toEqual($end); + }); + + it('throws when start date is after end date', function (): void { + // GIVEN + $start = new \DateTimeImmutable('2026-12-31 23:59:59'); + $end = new \DateTimeImmutable('2026-01-01 00:00:00'); + + // WHEN + expect(fn () => new DatePeriod($start, $end)) + // THEN + ->toThrow(\InvalidArgumentException::class, 'The start date must be before or equal to the end date.'); + }); + + it('evaluates isActiveAt correctly', function (): void { + // GIVEN + $start = new \DateTimeImmutable('2026-06-01 00:00:00'); + $end = new \DateTimeImmutable('2026-06-30 23:59:59'); + $period = new DatePeriod($start, $end); + + // WHEN + $before = $period->isActiveAt(new \DateTimeImmutable('2026-05-31 23:59:59')); + $during = $period->isActiveAt(new \DateTimeImmutable('2026-06-15 12:00:00')); + $after = $period->isActiveAt(new \DateTimeImmutable('2026-07-01 00:00:00')); + + // THEN + expect($before)->toBeFalse() + ->and($during)->toBeTrue() + ->and($after)->toBeFalse(); + }); + + it('evaluates isActiveAt with only start date', function (): void { + // GIVEN + $start = new \DateTimeImmutable('2026-06-01 00:00:00'); + $period = new DatePeriod(start: $start); + + // WHEN + $before = $period->isActiveAt(new \DateTimeImmutable('2026-05-31 23:59:59')); + $during = $period->isActiveAt(new \DateTimeImmutable('2026-06-15 12:00:00')); + + // THEN + expect($before)->toBeFalse() + ->and($during)->toBeTrue(); + }); + + it('evaluates isActiveAt with only end date', function (): void { + // GIVEN + $end = new \DateTimeImmutable('2026-06-30 23:59:59'); + $period = new DatePeriod(end: $end); + + // WHEN + $during = $period->isActiveAt(new \DateTimeImmutable('2026-06-15 12:00:00')); + $after = $period->isActiveAt(new \DateTimeImmutable('2026-07-01 00:00:00')); + + // THEN + expect($during)->toBeTrue() + ->and($after)->toBeFalse(); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/DeliveryAddressTest.php b/tests/Unit/Domain/Models/ValueObjects/DeliveryAddressTest.php new file mode 100644 index 00000000..78fb81bc --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/DeliveryAddressTest.php @@ -0,0 +1,74 @@ +toArray())->toBe([ + 'name' => 'Name', + 'address' => '1 rue', + 'postcode' => '75001', + 'city' => 'Paris', + 'phone' => '0123456789', + 'latitude' => '48.8', + 'longitude' => '2.3', + ]); + }); + + it('throws exception if name is empty', function (): void { + // GIVEN + // WHEN + $action = fn () => new DeliveryAddress('', '1 rue', '75001', 'Paris'); + // THEN + expect($action)->toThrow(\DomainException::class, 'Store name cannot be empty.'); + }); + + it('throws exception if address is empty', function (): void { + // GIVEN + // WHEN + $action = fn () => new DeliveryAddress('Name', '', '75001', 'Paris'); + // THEN + expect($action)->toThrow(\DomainException::class, 'Address cannot be empty.'); + }); + + it('throws exception if postcode is empty', function (): void { + // GIVEN + // WHEN + $action = fn () => new DeliveryAddress('Name', '1 rue', '', 'Paris'); + // THEN + expect($action)->toThrow(\DomainException::class, 'Postcode cannot be empty.'); + }); + + it('throws exception if city is empty', function (): void { + // GIVEN + // WHEN + $action = fn () => new DeliveryAddress('Name', '1 rue', '75001', ''); + // THEN + expect($action)->toThrow(\DomainException::class, 'City cannot be empty.'); + }); + + it('throws exception if latitude is set without longitude', function (): void { + // GIVEN + // WHEN + $action = fn () => new DeliveryAddress('Name', '1 rue', '75001', 'Paris', null, '48.8', null); + // THEN + expect($action)->toThrow(\DomainException::class, 'Longitude must be provided if latitude is.'); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/DiscountRateTest.php b/tests/Unit/Domain/Models/ValueObjects/DiscountRateTest.php new file mode 100644 index 00000000..5072582c --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/DiscountRateTest.php @@ -0,0 +1,153 @@ +basisPoints())->toBe(1550) + ->and($rate->ratio())->toBe(0.155) + ->and($rate->percentage())->toBe(15.5) + ->and($rate->isZero())->toBeFalse(); + }); + + it('creates a zero rate', function (): void { + // GIVEN / WHEN + $rate = DiscountRate::zero(); + + // THEN + expect($rate->basisPoints())->toBe(0) + ->and($rate->isZero())->toBeTrue(); + }); + + it('creates a rate from a percentage', function (int | float $percentage, int $expectedBasisPoints): void { + // GIVEN / WHEN + $rate = DiscountRate::fromPercentage($percentage); + + // THEN + expect($rate->basisPoints())->toBe($expectedBasisPoints); + })->with([ + 'integer percent' => [15, 1500], + 'decimal percent' => [5.5, 550], + 'zero' => [0, 0], + 'full' => [100, 10000], + ]); + + it('creates a rate from a ratio without float drift', function (float $ratio, int $expectedBasisPoints): void { + // GIVEN / WHEN + $rate = DiscountRate::fromRatio($ratio); + + // THEN + expect($rate->basisPoints())->toBe($expectedBasisPoints); + })->with([ + 'ten percent' => [0.1, 1000], + 'classic drift' => [0.29, 2900], // 0.29 * 10000 = 2899.9999999999995 in IEEE 754 + 'five point five' => [0.055, 550], + ]); + + it('computes the rate of a fixed amount discount on a base price', function (): void { + // GIVEN + $basePrice = Money::EUR(1000); + $discount = Money::EUR(200); + + // WHEN + $rate = DiscountRate::fromAmounts($discount, $basePrice); + + // THEN + expect($rate->basisPoints())->toBe(2000) + ->and($rate->ratio())->toBe(0.2); + }); + + it('rounds the rate of a fixed amount discount to the nearest basis point', function (): void { + // GIVEN + $basePrice = Money::EUR(300); + $discount = Money::EUR(100); // 33.333...% + + // WHEN + $rate = DiscountRate::fromAmounts($discount, $basePrice); + + // THEN + expect($rate->basisPoints())->toBe(3333); + }); + + it('caps a fixed amount discount greater than the base price at 100 percent', function (): void { + // GIVEN + $basePrice = Money::EUR(500); + $discount = Money::EUR(900); + + // WHEN + $rate = DiscountRate::fromAmounts($discount, $basePrice); + + // THEN + expect($rate->basisPoints())->toBe(10000); + }); + + it('returns a zero rate when the base price or the discount is not positive', function (): void { + // GIVEN / WHEN + $noPrice = DiscountRate::fromAmounts(Money::EUR(100), Money::EUR(0)); + $noDiscount = DiscountRate::fromAmounts(Money::EUR(0), Money::EUR(1000)); + + // THEN + expect($noPrice->isZero())->toBeTrue() + ->and($noDiscount->isZero())->toBeTrue(); + }); + + it('applies the rate to an amount', function (): void { + // GIVEN + $rate = DiscountRate::fromPercentage(15); + $amount = Money::EUR(1000); + + // WHEN + $discount = $rate->applyTo($amount); + + // THEN + expect($discount->getAmount())->toBe('150'); + }); + + it('formats the rate as a percentage', function (int $basisPoints, string $expected): void { + // GIVEN + $rate = DiscountRate::fromBasisPoints($basisPoints); + + // WHEN + $formatted = (string) $rate; + + // THEN + expect($formatted)->toBe($expected); + })->with([ + 'integer' => [1500, '15 %'], + 'decimal' => [550, '5.5 %'], + 'zero' => [0, '0 %'], + 'hundred' => [10000, '100 %'], + ]); + + it('compares two rates', function (): void { + // GIVEN + $a = DiscountRate::fromPercentage(10); + $b = DiscountRate::fromRatio(0.1); + $c = DiscountRate::fromPercentage(20); + + // WHEN / THEN + expect($a->equals($b))->toBeTrue() + ->and($a->equals($c))->toBeFalse(); + }); + + it('throws when the rate is negative or above 100 percent', function (int $basisPoints): void { + // GIVEN / WHEN + $action = fn () => DiscountRate::fromBasisPoints($basisPoints); + + // THEN + expect($action)->toThrow(\InvalidArgumentException::class); + })->with([ + 'negative' => [-1], + 'above 100%' => [10001], + ]); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/DiscountValueTest.php b/tests/Unit/Domain/Models/ValueObjects/DiscountValueTest.php new file mode 100644 index 00000000..cae74ff3 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/DiscountValueTest.php @@ -0,0 +1,230 @@ +toBeInstanceOf(DiscountValue::class); + expect($vo->isPercentage())->toBeFalse(); + }); + + it('can instantiate from percentage', function () { + // GIVEN + $rate = 20; + + // WHEN + $vo = DiscountValue::fromPercentage($rate); + + // THEN + expect($vo)->toBeInstanceOf(DiscountValue::class); + expect($vo->isPercentage())->toBeTrue(); + }); + + it('throws exception if percentage is negative', function () { + // GIVEN + // WHEN + $action = fn () => DiscountValue::fromPercentage(-1); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if percentage is greater than 100', function () { + // GIVEN + $rate = 101; + + // WHEN + $action = fn () => DiscountValue::fromPercentage($rate); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if amount is negative', function () { + // GIVEN + $amount = getDiscountMoney(-1); + + // WHEN + $action = fn () => DiscountValue::fromAmount($amount); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('returns the correct value for amount discount', function () { + // GIVEN + $amount = getDiscountMoney(50); + + // WHEN + $vo = DiscountValue::fromAmount($amount); + + // THEN + expect($vo->value())->toEqual($amount); + }); + + it('returns the correct value for percentage discount', function () { + // GIVEN + $rate = 20; + + // WHEN + $vo = DiscountValue::fromPercentage($rate); + + // THEN + expect($vo->value())->toBe($rate); + }); + + it('returns the correct percentage rate', function () { + // GIVEN + $percentage = 20; + + // WHEN + $vo = DiscountValue::fromPercentage($percentage); + + // THEN + expect($vo->getPercentageRate())->toBe(0.2); + }); + + it('throws exception when getting percentage rate from amount discount', function () { + // GIVEN + $amount = getDiscountMoney(100); + $vo = DiscountValue::fromAmount($amount); + + // WHEN + $action = fn () => $vo->getPercentageRate(); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('returns the correct amount', function () { + // GIVEN + $amount = getDiscountMoney(100); + + // WHEN + $vo = DiscountValue::fromAmount($amount); + + // THEN + expect($vo->getAmount())->toEqual($amount); + }); + + it('throws exception when getting amount from percentage discount', function () { + // GIVEN + $vo = DiscountValue::fromPercentage(10); + + // WHEN + $action = fn () => $vo->getAmount(); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('calculates discount amount correctly for percentage', function () { + // GIVEN + $basePrice = getDiscountMoney(1000); + $vo = DiscountValue::fromPercentage(20); // 20% + + // WHEN + $result = $vo->calculateDiscountAmount($basePrice); + + // THEN + expect($result->getAmount())->toBe('200'); + }); + + it('calculates discount amount correctly for fixed amount', function () { + // GIVEN + $basePrice = getDiscountMoney(1000); + $vo = DiscountValue::fromAmount(getDiscountMoney(50)); + + // WHEN + $result = $vo->calculateDiscountAmount($basePrice); + + // THEN + expect($result->getAmount())->toBe('50'); + }); + + it('throws exception on currency mismatch when calculating discount', function () { + // GIVEN + $basePrice = getDiscountMoney(1000, 'EUR'); + $vo = DiscountValue::fromAmount(getDiscountMoney(50, 'USD')); + + // WHEN + $action = fn () => $vo->calculateDiscountAmount($basePrice); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); +}); + +describe('DiscountValue exceptions', function (): void { + it('throws when percentage is missing for percent type', function (): void { + // GIVEN + $reflection = new \ReflectionClass(DiscountValue::class); + $method = $reflection->getMethod('__construct'); + $vo = $reflection->newInstanceWithoutConstructor(); + // WHEN + $action = fn () => $method->invoke($vo, DiscountType::PERCENT, null, null); + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws when amount is missing for amount type', function (): void { + // GIVEN + $reflection = new \ReflectionClass(DiscountValue::class); + $method = $reflection->getMethod('__construct'); + $vo = $reflection->newInstanceWithoutConstructor(); + // WHEN + $action = fn () => $method->invoke($vo, DiscountType::AMOUNT, null, null); + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws unexpected value if percentage is null', function (): void { + // GIVEN + $reflection = new \ReflectionClass(DiscountValue::class); + $vo = $reflection->newInstanceWithoutConstructor(); + $prop = $reflection->getProperty('type'); + $prop->setValue($vo, DiscountType::PERCENT); + $prop2 = $reflection->getProperty('percentage'); + $prop2->setValue($vo, null); + + // WHEN + $action = fn () => $vo->getPercentage(); + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws unexpected value if amount is null', function (): void { + // GIVEN + $reflection = new \ReflectionClass(DiscountValue::class); + $vo = $reflection->newInstanceWithoutConstructor(); + $prop = $reflection->getProperty('type'); + $prop->setValue($vo, DiscountType::AMOUNT); + $prop2 = $reflection->getProperty('amount'); + $prop2->setValue($vo, null); + + // WHEN + $action = fn () => $vo->getAmount(); + // THEN + expect($action)->toThrow(\DomainException::class); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/EditablePickupExceptionForShopTest.php b/tests/Unit/Domain/Models/ValueObjects/EditablePickupExceptionForShopTest.php new file mode 100644 index 00000000..d0c649d9 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/EditablePickupExceptionForShopTest.php @@ -0,0 +1,41 @@ +pickupException)->not->toBe($exception) // It should be a clone + ->and($editable->pickupException->id())->toBe($exception->id()) + ->and($editable->isPickupDay)->toBeTrue() + ->and($editable->missingSubsitute)->toBeFalse() + ->and($editable->passedDeadline)->toBeTrue(); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/EmailTest.php b/tests/Unit/Domain/Models/ValueObjects/EmailTest.php new file mode 100644 index 00000000..5da14970 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/EmailTest.php @@ -0,0 +1,31 @@ +toBeInstanceOf(Email::class); + }); + + it('throws exception if email format is invalid', function () { + // GIVEN + $email = 'not-an-email'; + + // WHEN + $action = fn () => new Email($email); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/EmployeeUpsertDataTest.php b/tests/Unit/Domain/Models/ValueObjects/EmployeeUpsertDataTest.php new file mode 100644 index 00000000..89091dc6 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/EmployeeUpsertDataTest.php @@ -0,0 +1,49 @@ +matricule)->toBe($matricule) + ->and($data->firstname)->toBe('Jean') + ->and($data->lastname)->toBe('Dupont') + ->and($data->etablissement)->toBe($etablissement) + ->and($data->service)->toBe($service) + ->and($data->site)->toBe($site) + ->and($data->startDate)->toBe($start) + ->and($data->endDate)->toBeNull() + ->and($data->code)->toBe($code); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/Entities/BasketIdTest.php b/tests/Unit/Domain/Models/ValueObjects/Entities/BasketIdTest.php new file mode 100644 index 00000000..636ec9fa --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/Entities/BasketIdTest.php @@ -0,0 +1,28 @@ +value)->toBe($uuid); + }); + + it('throws exception with non v7 uuid', function (): void { + // GIVEN + $uuid = Uuid::uuid4(); + // WHEN + $action = fn () => new BasketId($uuid); + // THEN + expect($action)->toThrow(\DomainException::class); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/Entities/OrderIdTest.php b/tests/Unit/Domain/Models/ValueObjects/Entities/OrderIdTest.php new file mode 100644 index 00000000..f041a985 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/Entities/OrderIdTest.php @@ -0,0 +1,28 @@ +value)->toBe($uuid); + }); + + it('throws exception with non v7 uuid', function (): void { + // GIVEN + $uuid = Uuid::uuid4(); + // WHEN + $action = fn () => new OrderId($uuid); + // THEN + expect($action)->toThrow(\DomainException::class); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/Entities/PickupExceptionIdTest.php b/tests/Unit/Domain/Models/ValueObjects/Entities/PickupExceptionIdTest.php new file mode 100644 index 00000000..22198a86 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/Entities/PickupExceptionIdTest.php @@ -0,0 +1,28 @@ +value)->toBe($uuid); + }); + + it('throws exception with non v7 uuid', function (): void { + // GIVEN + $uuid = Uuid::uuid4(); + // WHEN + $action = fn () => new PickupExceptionId($uuid); + // THEN + expect($action)->toThrow(\DomainException::class); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/Entities/ProductIdTest.php b/tests/Unit/Domain/Models/ValueObjects/Entities/ProductIdTest.php new file mode 100644 index 00000000..038fe1c4 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/Entities/ProductIdTest.php @@ -0,0 +1,28 @@ +value)->toBe($uuid); + }); + + it('throws exception with non v7 uuid', function (): void { + // GIVEN + $uuid = Uuid::uuid4(); + // WHEN + $action = fn () => new ProductId($uuid); + // THEN + expect($action)->toThrow(\DomainException::class); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/Entities/ShopIdTest.php b/tests/Unit/Domain/Models/ValueObjects/Entities/ShopIdTest.php new file mode 100644 index 00000000..bf78dcf3 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/Entities/ShopIdTest.php @@ -0,0 +1,28 @@ +value)->toBe($uuid); + }); + + it('throws exception with non v7 uuid', function (): void { + // GIVEN + $uuid = Uuid::uuid4(); + // WHEN + $action = fn () => new ShopId($uuid); + // THEN + expect($action)->toThrow(\DomainException::class); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/Entities/ShopperIdTest.php b/tests/Unit/Domain/Models/ValueObjects/Entities/ShopperIdTest.php new file mode 100644 index 00000000..46e8a2d9 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/Entities/ShopperIdTest.php @@ -0,0 +1,28 @@ +value)->toBe($uuid); + }); + + it('throws exception with non v7 uuid', function (): void { + // GIVEN + $uuid = Uuid::uuid4(); + // WHEN + $action = fn () => new ShopperId($uuid); + // THEN + expect($action)->toThrow(\DomainException::class); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/IncoIdTest.php b/tests/Unit/Domain/Models/ValueObjects/IncoIdTest.php new file mode 100644 index 00000000..dff358a0 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/IncoIdTest.php @@ -0,0 +1,32 @@ +toBeInstanceOf(IncoId::class); + }); + + it('throws exception if value is zero or negative', function () { + // GIVEN + $value = 0; + + // WHEN + $action = fn () => new IncoId($value); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/MatriculeTest.php b/tests/Unit/Domain/Models/ValueObjects/MatriculeTest.php new file mode 100644 index 00000000..dc085663 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/MatriculeTest.php @@ -0,0 +1,78 @@ +toBeInstanceOf(Matricule::class) + ->and($vo->value)->toBe($value); + })->with([ + '7 digits with leading zero' => '0111123', + '8 digits with leading zero' => '01111234', + ]); + + it('throws exception if it contains non-digit characters', function (string $value) { + // WHEN + $action = fn () => new Matricule($value); + + // THEN + expect($action)->toThrow(\DomainException::class); + })->with([ + '7 chars with letters' => 'AB01162', + '8 chars with letters' => 'AB011623', + ]); + + it('throws exception if length is not 7 or 8 digits', function (string $value) { + // WHEN + $action = fn () => new Matricule($value); + + // THEN + expect($action)->toThrow(\DomainException::class); + })->with([ + 'too short (6 digits)' => '123456', + 'too short (5 digits)' => '12345', + 'too long (9 digits)' => '123456789', + ]); +}); + +describe('Matricule methods', function (): void { + it('can be cast to string', function (string $value): void { + // GIVEN + $vo = new Matricule($value); + + // WHEN + $str = (string) $vo; + + // THEN + expect($str)->toBe($value); + })->with([ + '7 digits' => '1234567', + '8 digits' => '12345678', + ]); + + it('can equate', function (): void { + // GIVEN + $vo1 = new Matricule('1234567'); + $vo2 = new Matricule('1234567'); + $vo3 = new Matricule('12345678'); + + // WHEN + $eq1 = $vo1->equals($vo2); + $eq2 = $vo1->equals($vo3); + $eq3 = $vo1->equals('1234567'); + + // THEN + expect($eq1)->toBeTrue() + ->and($eq2)->toBeFalse() + ->and($eq3)->toBeFalse(); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/NutritionalValuesTest.php b/tests/Unit/Domain/Models/ValueObjects/NutritionalValuesTest.php new file mode 100644 index 00000000..08c49f28 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/NutritionalValuesTest.php @@ -0,0 +1,86 @@ +toBeInstanceOf(NutritionalValues::class); + }); + + it('throws exception if reference weight is negative', function () { + // GIVEN + $refWeightG = -10; + + // WHEN + $action = fn () => getNewNutritionalValues(['refWeightG' => $refWeightG]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if energy (kj) is negative', function () { + // GIVEN + $kj = -1; + + // WHEN + $action = fn () => getNewNutritionalValues(['kj' => $kj]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if fat is negative', function () { + // GIVEN + $fatG = -0.5; + + // WHEN + $action = fn () => getNewNutritionalValues(['fatG' => $fatG]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if daily energy is negative', function () { + // GIVEN + $dailyEnergy = -5; + + // WHEN + $action = fn () => getNewNutritionalValues(['dailyEnergy' => $dailyEnergy]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('can convert to array', function () { + // GIVEN + $vo = new NutritionalValues(refWeightG: 100, kj: 500, proteinG: 10.5); + + // WHEN + $array = $vo->toArray(); + + // THEN + expect($array)->toBeArray(); + expect($array['nv_ref_weight_g'])->toBe(100.0); + expect($array['nv_kj'])->toBe(500.0); + expect($array['nv_protein_g'])->toBe(10.5); + expect($array['nv_fat_g'])->toBeNull(); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/OrderEmployeeTest.php b/tests/Unit/Domain/Models/ValueObjects/OrderEmployeeTest.php new file mode 100644 index 00000000..3d9e01bc --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/OrderEmployeeTest.php @@ -0,0 +1,67 @@ +matricule)->toBe($matricule) + ->and($employee->firstname)->toBe('John') + ->and($employee->lastname)->toBe('Doe') + ->and($employee->facility)->toBe($facility) + ->and($employee->site)->toBe($site) + ->and($employee->service)->toBe($service); + }); + + it('throws exception if firstname is empty', function (): void { + // GIVEN + $matricule = new Matricule('1234567'); + $facility = new ShopperEstablishmentCode('ETAB01'); + $site = new ShopperSiteCode('SITEA'); + $service = new ShopperServiceCode('101'); + + // WHEN + $action = fn () => new OrderEmployee($matricule, '', 'Doe', $facility, $site, $service); + + // THEN + expect($action)->toThrow(\DomainException::class, 'firstname cannot be empty'); + }); + + it('throws exception if lastname is empty', function (): void { + // GIVEN + $matricule = new Matricule('1234567'); + $facility = new ShopperEstablishmentCode('ETAB01'); + $site = new ShopperSiteCode('SITEA'); + $service = new ShopperServiceCode('101'); + + // WHEN + $action = fn () => new OrderEmployee($matricule, 'John', '', $facility, $site, $service); + + // THEN + expect($action)->toThrow(\DomainException::class, 'lastname cannot be empty'); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/OrderLineProductTest.php b/tests/Unit/Domain/Models/ValueObjects/OrderLineProductTest.php new file mode 100644 index 00000000..97800f57 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/OrderLineProductTest.php @@ -0,0 +1,100 @@ +incoId)->toBe($incoId) + ->and($product->originalId)->toBe($productId) + ->and($product->name)->toBe('Product Name') + ->and($product->weight)->toBe($weight) + ->and($product->brand)->toBe(ProductBrand::marie) + ->and($product->orderUnit)->toBe(OrderUnit::KGM) + ->and($product->price->getAmount())->toBe('1000') + ->and($product->discountedPrice->getAmount())->toBe('900') + ->and($product->priceKgTtc->getAmount())->toBe('2000') + ->and($product->taxRate)->toBe(TaxRate::TVA_5_5) + ->and($product->picture)->toBe('pic.jpg'); + }); + + it('throws exception if name is empty', function (): void { + // GIVEN + // WHEN + $action = fn () => new OrderLineProduct(new IncoId(1), new ProductId(Uuid::uuid7()), '', new ProductWeight(1, false), ProductBrand::marie, OrderUnit::KGM, Money::EUR(100), Money::EUR(100), Money::EUR(100), TaxRate::TVA_5_5); + // THEN + expect($action)->toThrow(\DomainException::class, 'Product name cannot be empty'); + }); + + it('throws exception if price is negative', function (): void { + // GIVEN + // WHEN + $action = fn () => new OrderLineProduct(new IncoId(1), new ProductId(Uuid::uuid7()), 'Name', new ProductWeight(1, false), ProductBrand::marie, OrderUnit::KGM, Money::EUR(-100), Money::EUR(100), Money::EUR(100), TaxRate::TVA_5_5); + // THEN + expect($action)->toThrow(\DomainException::class, 'Product price cannot be negative'); + }); + + it('throws exception if discounted price is negative', function (): void { + // GIVEN + // WHEN + $action = fn () => new OrderLineProduct(new IncoId(1), new ProductId(Uuid::uuid7()), 'Name', new ProductWeight(1, false), ProductBrand::marie, OrderUnit::KGM, Money::EUR(100), Money::EUR(-100), Money::EUR(100), TaxRate::TVA_5_5); + // THEN + expect($action)->toThrow(\DomainException::class, 'Product discounted price cannot be negative'); + }); + + it('throws exception if price per kg ttc is negative', function (): void { + // GIVEN + // WHEN + $action = fn () => new OrderLineProduct(new IncoId(1), new ProductId(Uuid::uuid7()), 'Name', new ProductWeight(1, false), ProductBrand::marie, OrderUnit::KGM, Money::EUR(100), Money::EUR(100), Money::EUR(-100), TaxRate::TVA_5_5); + // THEN + expect($action)->toThrow(\DomainException::class, 'Price per kg TTC cannot be negative'); + }); + + it('throws exception if discounted price is greater than price', function (): void { + // GIVEN + // WHEN + $action = fn () => new OrderLineProduct(new IncoId(1), new ProductId(Uuid::uuid7()), 'Name', new ProductWeight(1, false), ProductBrand::marie, OrderUnit::KGM, Money::EUR(100), Money::EUR(150), Money::EUR(100), TaxRate::TVA_5_5); + // THEN + expect($action)->toThrow(\DomainException::class, 'Product discounted price cannot be greater than original price'); + }); + + it('throws exception if price per kg ttc is zero', function (): void { + // GIVEN + // WHEN + $action = fn () => new OrderLineProduct(new IncoId(1), new ProductId(Uuid::uuid7()), 'Name', new ProductWeight(1, false), ProductBrand::marie, OrderUnit::KGM, Money::EUR(100), Money::EUR(100), Money::EUR(0), TaxRate::TVA_5_5); + // THEN + expect($action)->toThrow(\DomainException::class, 'Price per kg TTC has to be positive'); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/OrderLineTest.php b/tests/Unit/Domain/Models/ValueObjects/OrderLineTest.php new file mode 100644 index 00000000..cb601c10 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/OrderLineTest.php @@ -0,0 +1,337 @@ + new IncoId(1), + 'originalId' => new ProductId(Uuid::uuid7()), + 'name' => 'poulet blanc', + 'weight' => new ProductWeight(200, false), + 'brand' => ProductBrand::loue, + 'orderUnit' => OrderUnit::KGM, + 'price' => Money::EUR(100), + 'discountedPrice' => Money::EUR(100), + 'priceKgTtc' => Money::EUR(500), + 'taxRate' => TaxRate::TVA_20, + 'picture' => null, + ], $overrides); + + return new OrderLineProduct(...$data); + } + + it('can instantiate correctly', function (): void { + // GIVEN + $product = getNewOrderLineProduct(); + $quantity = 2; + $unitPriceHt = Money::EUR(100); + $unitDiscount = Money::EUR(10); + $unitTax = Money::EUR(20); + $totalHt = Money::EUR(200); + $totalDiscount = Money::EUR(20); + $totalTax = Money::EUR(40); + $totalTtc = Money::EUR(220); + + // WHEN + $line = new OrderLine( + $product, + $quantity, + $unitPriceHt, + $unitDiscount, + $unitTax, + $totalHt, + $totalDiscount, + $totalTax, + $totalTtc + ); + + // THEN + expect($line->product)->toBe($product) + ->and($line->quantity)->toBe(2) + ->and($line->unitPriceHt->getAmount())->toBe('100') + ->and($line->unitDiscount->getAmount())->toBe('10') + ->and($line->unitTax->getAmount())->toBe('20') + ->and($line->unitTtc->getAmount())->toBe('110') + ->and($line->totalHt->getAmount())->toBe('200') + ->and($line->totalDiscount->getAmount())->toBe('20') + ->and($line->totalTax->getAmount())->toBe('40') + ->and($line->totalTtc->getAmount())->toBe('220'); + }); + + it('throws exception if quantity <= 0', function (): void { + // GIVEN + $product = getNewOrderLineProduct(); + $quantity = 0; + $unitPriceHt = Money::EUR(100); + $unitDiscount = Money::EUR(0); + $unitTax = Money::EUR(0); + $totalHt = Money::EUR(0); + $totalDiscount = Money::EUR(0); + $totalTax = Money::EUR(0); + $totalTtc = Money::EUR(0); + + // WHEN + $action = fn () => new OrderLine( + $product, + $quantity, + $unitPriceHt, + $unitDiscount, + $unitTax, + $totalHt, + $totalDiscount, + $totalTax, + $totalTtc + ); + + // THEN + expect($action)->toThrow(\DomainException::class, 'Quantity must be greater than 0'); + }); + + it('throws exception if unit price is negative', function (): void { + // GIVEN + $product = getNewOrderLineProduct(); + $quantity = 1; + $unitPriceHt = Money::EUR(-100); + $unitDiscount = Money::EUR(0); + $unitTax = Money::EUR(0); + $totalHt = Money::EUR(0); + $totalDiscount = Money::EUR(0); + $totalTax = Money::EUR(0); + $totalTtc = Money::EUR(0); + + // WHEN + $action = fn () => new OrderLine( + $product, + $quantity, + $unitPriceHt, + $unitDiscount, + $unitTax, + $totalHt, + $totalDiscount, + $totalTax, + $totalTtc + ); + + // THEN + expect($action)->toThrow(\DomainException::class, 'Unit price must be non-negative'); + }); + + it('throws exception if unit discount is negative', function (): void { + // GIVEN + $product = getNewOrderLineProduct(); + $quantity = 1; + $unitPriceHt = Money::EUR(100); + $unitDiscount = Money::EUR(-10); + $unitTax = Money::EUR(0); + $totalHt = Money::EUR(0); + $totalDiscount = Money::EUR(0); + $totalTax = Money::EUR(0); + $totalTtc = Money::EUR(0); + + // WHEN + $action = fn () => new OrderLine( + $product, + $quantity, + $unitPriceHt, + $unitDiscount, + $unitTax, + $totalHt, + $totalDiscount, + $totalTax, + $totalTtc + ); + + // THEN + expect($action)->toThrow(\DomainException::class, 'Unit discount must be non-negative'); + }); + + it('throws exception if unit tax is negative', function (): void { + // GIVEN + $product = getNewOrderLineProduct(); + $quantity = 1; + $unitPriceHt = Money::EUR(100); + $unitDiscount = Money::EUR(0); + $unitTax = Money::EUR(-10); + $unitTtc = Money::EUR(100); + $totalHt = Money::EUR(0); + $totalDiscount = Money::EUR(0); + $totalTax = Money::EUR(0); + $totalTtc = Money::EUR(0); + + // WHEN + $action = fn () => new OrderLine( + $product, + $quantity, + $unitPriceHt, + $unitDiscount, + $unitTax, + $totalHt, + $totalDiscount, + $totalTax, + $totalTtc + ); + + // THEN + expect($action)->toThrow(\DomainException::class, 'Unit tax must be non-negative'); + }); + + it('throws exception if unit ttc is negative', function (): void { + // GIVEN + $product = getNewOrderLineProduct(); + $quantity = 1; + $unitPriceHt = Money::EUR(100); + $unitDiscount = Money::EUR(200); + $unitTax = Money::EUR(0); + $totalHt = Money::EUR(0); + $totalDiscount = Money::EUR(0); + $totalTax = Money::EUR(0); + $totalTtc = Money::EUR(0); + + // WHEN + $action = fn () => new OrderLine( + $product, + $quantity, + $unitPriceHt, + $unitDiscount, + $unitTax, + $totalHt, + $totalDiscount, + $totalTax, + $totalTtc + ); + + // THEN + expect($action)->toThrow(\DomainException::class, 'Unit TTC must be non-negative'); + }); + + it('throws exception if total ht is negative', function (): void { + // GIVEN + $product = getNewOrderLineProduct(); + $quantity = 1; + $unitPriceHt = Money::EUR(100); + $unitDiscount = Money::EUR(0); + $unitTax = Money::EUR(0); + $totalHt = Money::EUR(-100); + $totalDiscount = Money::EUR(0); + $totalTax = Money::EUR(0); + $totalTtc = Money::EUR(0); + + // WHEN + $action = fn () => new OrderLine( + $product, + $quantity, + $unitPriceHt, + $unitDiscount, + $unitTax, + $totalHt, + $totalDiscount, + $totalTax, + $totalTtc + ); + + // THEN + expect($action)->toThrow(\DomainException::class, 'Total HT must be non-negative'); + }); + + it('throws exception if total discount is negative', function (): void { + // GIVEN + $product = getNewOrderLineProduct(); + $quantity = 1; + $unitPriceHt = Money::EUR(100); + $unitDiscount = Money::EUR(0); + $unitTax = Money::EUR(0); + $totalHt = Money::EUR(100); + $totalDiscount = Money::EUR(-10); + $totalTax = Money::EUR(0); + $totalTtc = Money::EUR(0); + + // WHEN + $action = fn () => new OrderLine( + $product, + $quantity, + $unitPriceHt, + $unitDiscount, + $unitTax, + $totalHt, + $totalDiscount, + $totalTax, + $totalTtc + ); + + // THEN + expect($action)->toThrow(\DomainException::class, 'Total discount must be non-negative'); + }); + + it('throws exception if total tax is negative', function (): void { + // GIVEN + $product = getNewOrderLineProduct(); + $quantity = 1; + $unitPriceHt = Money::EUR(100); + $unitDiscount = Money::EUR(0); + $unitTax = Money::EUR(0); + $totalHt = Money::EUR(100); + $totalDiscount = Money::EUR(0); + $totalTax = Money::EUR(-10); + $totalTtc = Money::EUR(0); + + // WHEN + $action = fn () => new OrderLine( + $product, + $quantity, + $unitPriceHt, + $unitDiscount, + $unitTax, + $totalHt, + $totalDiscount, + $totalTax, + $totalTtc + ); + + // THEN + expect($action)->toThrow(\DomainException::class, 'Total tax must be non-negative'); + }); + + it('throws exception if total ttc is negative', function (): void { + // GIVEN + $product = getNewOrderLineProduct(); + $quantity = 1; + $unitPriceHt = Money::EUR(100); + $unitDiscount = Money::EUR(0); + $unitTax = Money::EUR(0); + $totalHt = Money::EUR(100); + $totalDiscount = Money::EUR(0); + $totalTax = Money::EUR(0); + $totalTtc = Money::EUR(-100); + + // WHEN + $action = fn () => new OrderLine( + $product, + $quantity, + $unitPriceHt, + $unitDiscount, + $unitTax, + $totalHt, + $totalDiscount, + $totalTax, + $totalTtc + ); + + // THEN + expect($action)->toThrow(\DomainException::class, 'Total TTC must be non-negative'); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/OrderReferenceTest.php b/tests/Unit/Domain/Models/ValueObjects/OrderReferenceTest.php new file mode 100644 index 00000000..9f98ac5f --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/OrderReferenceTest.php @@ -0,0 +1,106 @@ +toBeInstanceOf(OrderReference::class) + ->and((string) $vo)->toBe(UuidHelper::toBase58($uuidV7)) + ->and($vo->value)->toBe($uuidV7); + }); + + it('can instantiate from a valid base-58 UUID v7 string', function () { + // GIVEN + $uuidV7 = Uuid::uuid7(); + $base58 = UuidHelper::toBase58($uuidV7); + + // WHEN + $vo = OrderReference::fromBase58($base58); + + // THEN + expect($vo)->toBeInstanceOf(OrderReference::class) + ->and((string) $vo)->toBe($base58) + ->and($vo->value->equals($uuidV7))->toBeTrue(); + }); + + it('can instantiate from a valid UUID v7 string via fromString', function () { + // GIVEN + $uuidV7 = Uuid::uuid7(); + $uuidString = $uuidV7->toString(); + + // WHEN + $vo = OrderReference::fromString($uuidString); + + // THEN + expect($vo)->toBeInstanceOf(OrderReference::class) + ->and((string) $vo)->toBe(UuidHelper::toBase58($uuidV7)) + ->and($vo->value->equals($uuidV7))->toBeTrue(); + }); + + it('can instantiate from a valid base-58 string via fromString', function () { + // GIVEN + $uuidV7 = Uuid::uuid7(); + $base58 = UuidHelper::toBase58($uuidV7); + + // WHEN + $vo = OrderReference::fromString($base58); + + // THEN + expect($vo)->toBeInstanceOf(OrderReference::class) + ->and((string) $vo)->toBe($base58) + ->and($vo->value->equals($uuidV7))->toBeTrue(); + }); + + it('throws exception if provided UUID is not v7', function () { + // GIVEN + $uuidV4 = Uuid::uuid4(); + + // WHEN + $action = fn () => getNewOrderReference($uuidV4); + + // THEN + expect($action)->toThrow(\DomainException::class, 'value must be a valid UUID v7'); + }); + + it('throws exception if base-58 string is invalid', function () { + // GIVEN + $invalidBase58 = 'invalid-base58-string!'; + + // WHEN + $action = fn () => OrderReference::fromBase58($invalidBase58); + + // THEN + expect($action)->toThrow(\DomainException::class, 'Order reference must be a valid base-58 string'); + }); + + it('throws exception if base-58 string is not from a UUID v7', function () { + // GIVEN + $uuidV4 = Uuid::uuid4(); + $base58 = UuidHelper::toBase58($uuidV4); + + // WHEN + $action = fn () => OrderReference::fromBase58($base58); + + // THEN + expect($action)->toThrow(\DomainException::class, 'value must be a valid UUID v7'); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/PaginationTest.php b/tests/Unit/Domain/Models/ValueObjects/PaginationTest.php new file mode 100644 index 00000000..482fe15f --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/PaginationTest.php @@ -0,0 +1,149 @@ +from())->toBe(20) + ->and($pagination->to())->toBe(39) + ->and($pagination->pageSize()->value)->toBe(20) + ->and($pagination->pageNumber()->value)->toBe(2); + }); + + it('can be created from offset and limit', function (): void { + // GIVEN + $offset = 20; + $limit = 10; + + // WHEN + $pagination = Pagination::ofOffsetAndLimit($offset, $limit); + + // THEN + expect($pagination->from())->toBe(20) + ->and($pagination->to())->toBe(29) + ->and($pagination->pageSize()->value)->toBe(10) + ->and($pagination->pageNumber()->value)->toBe(3); + }); + + it('can be created from explicit indexes using ofIndexes', function (): void { + // GIVEN + $from = 5; + $to = 14; + + // WHEN + $pagination = Pagination::ofIndexes($from, $to); + + // THEN + expect($pagination->from())->toBe(5) + ->and($pagination->to())->toBe(14) + ->and($pagination->pageSize()->value)->toBe(10); + }); + + it('can be created using first page helper with default size', function (): void { + // WHEN + $pagination = Pagination::firstPage(); + + // THEN + expect($pagination->from())->toBe(0) + ->and($pagination->to())->toBe(24) + ->and($pagination->pageSize()->value)->toBe(25) + ->and($pagination->pageNumber()->value)->toBe(1); + }); + + it('can be created using first page helper with explicit size', function (): void { + // GIVEN + $pageSize = new PageSize(15); + + // WHEN + $pagination = Pagination::firstPage($pageSize); + + // THEN + expect($pagination->from())->toBe(0) + ->and($pagination->to())->toBe(14) + ->and($pagination->pageSize()->value)->toBe(15) + ->and($pagination->pageNumber()->value)->toBe(1); + }); + + it('formats pagination as string representation via __toString', function (): void { + // GIVEN + $pagination = Pagination::ofIndexes(0, 9); + + // WHEN + $stringRepresentation = (string) $pagination; + + // THEN + expect($stringRepresentation)->toBe('Pagination{from=0, to=9}'); + }); + + it('clamps invalid constructor-level values via ofIndexes', function (int $from, int $to, int $expectedFrom, int $expectedTo): void { + // GIVEN / WHEN + $pagination = Pagination::ofIndexes($from, $to); + + // THEN + expect($pagination->from())->toBe($expectedFrom) + ->and($pagination->to())->toBe($expectedTo); + })->with([ + 'negative from is clamped to 0' => [-1, 10, 0, 10], + 'to below from+1 is clamped to from+1' => [10, 5, 10, 11], + 'to equal from is clamped to from+1' => [10, 10, 10, 11], + 'oversized range is clamped to max' => [0, 10001, 0, 10000], + ]); + + it('clamps invalid ofOffsetAndLimit parameters', function (int $offset, int $limit, int $expectedFrom, int $expectedSize): void { + // GIVEN / WHEN + $pagination = Pagination::ofOffsetAndLimit($offset, $limit); + + // THEN + expect($pagination->from())->toBe($expectedFrom) + ->and($pagination->pageSize()->value)->toBe($expectedSize); + })->with([ + 'negative offset clamped to 0' => [-1, 10, 0, 10], + 'limit 0 clamped to 1' => [0, 0, 0, 1], + 'negative limit clamped to 1' => [0, -5, 0, 1], + 'oversized limit clamped' => [0, 20000, 0, 10000], + ]); + + it('creates pagination using ofPage with Value Objects', function (): void { + // GIVEN + $pageNumber = new PageNumber(3); + $pageSize = new PageSize(15); + + // WHEN + $pagination = Pagination::ofPage($pageNumber, $pageSize); + + // THEN + expect($pagination->from())->toBe(30) + ->and($pagination->to())->toBe(44) + ->and($pagination->pageNumber())->toEqual($pageNumber) + ->and($pagination->pageSize())->toEqual($pageSize); + }); + + it('checks equality with another Pagination instance', function (): void { + // GIVEN + $p1 = Pagination::ofPage(new PageNumber(1), new PageSize(20)); + $p2 = Pagination::ofPage(new PageNumber(1), new PageSize(20)); + $p3 = Pagination::ofPage(new PageNumber(2), new PageSize(20)); + + // THEN + expect($p1->equals($p2))->toBeTrue() + ->and($p1->equals($p3))->toBeFalse() + ->and($p1->equals(null))->toBeFalse() + ->and($p1->equals('pagination'))->toBeFalse(); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/PhoneNumberTest.php b/tests/Unit/Domain/Models/ValueObjects/PhoneNumberTest.php new file mode 100644 index 00000000..d63099b5 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/PhoneNumberTest.php @@ -0,0 +1,55 @@ +value)->toBe('+33102030405') + ->and((string) $phone)->toBe('+33102030405'); + }); + + test('it throws when phone is empty', function () { + // GIVEN & WHEN & THEN + expect(fn () => new PhoneNumber(' ')) + ->toThrow(\InvalidArgumentException::class, 'Phone number cannot be empty.'); + }); + + test('it throws when phone is shorter than 4 characters', function () { + // GIVEN & WHEN & THEN + expect(fn () => new PhoneNumber('123')) + ->toThrow(\InvalidArgumentException::class, 'Phone number must have at least 4 characters.'); + }); + + test('it throws when phone exceeds 30 characters', function () { + // GIVEN & WHEN & THEN + expect(fn () => new PhoneNumber(str_repeat('1', 31))) + ->toThrow(\InvalidArgumentException::class, 'Phone number cannot exceed 30 characters.'); + }); + + test('it throws when phone contains invalid characters', function () { + // GIVEN & WHEN & THEN + expect(fn () => new PhoneNumber('01 02 03 ab cd')) + ->toThrow(\InvalidArgumentException::class, 'Phone number format is invalid.'); + }); + + test('it can be instantiated with RFC3966 tel: format', function () { + // GIVEN + $raw = 'tel:+33-1-02-03-04-05'; + + // WHEN + $phone = new PhoneNumber($raw); + + // THEN + expect($phone->value)->toBe('tel:+33-1-02-03-04-05') + ->and((string) $phone)->toBe('tel:+33-1-02-03-04-05'); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/PickupTimeSlotTest.php b/tests/Unit/Domain/Models/ValueObjects/PickupTimeSlotTest.php new file mode 100644 index 00000000..74384fde --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/PickupTimeSlotTest.php @@ -0,0 +1,79 @@ +toBeInstanceOf(PickupTimeSlot::class); + }); +}); + +describe('PickupTimeSlot methods', function (): void { + it('returns getAt as immutable when passed mutable', function (): void { + // GIVEN + $at = new \DateTime(); + $for = new \DateInterval('PT10M'); + $vo = new PickupTimeSlot($at, $for); + // WHEN + $res = $vo->getAt(); + // THEN + expect($res)->toBeInstanceOf(\DateTimeImmutable::class); + }); + + it('returns getAt as immutable when passed immutable', function (): void { + // GIVEN + $at = new \DateTimeImmutable(); + $for = new \DateInterval('PT10M'); + $vo = new PickupTimeSlot($at, $for); + // WHEN + $res = $vo->getAt(); + // THEN + expect($res)->toBeInstanceOf(\DateTimeImmutable::class); + }); + + it('returns getFor', function (): void { + // GIVEN + $at = new \DateTimeImmutable(); + $for = new \DateInterval('PT10M'); + $vo = new PickupTimeSlot($at, $for); + // WHEN + $res = $vo->getFor(); + // THEN + expect($res->i)->toBe(10); + }); + + it('returns getEndsAt', function (): void { + // GIVEN + $at = new \DateTimeImmutable('2024-01-01 10:00:00'); + $for = new \DateInterval('PT10M'); + $vo = new PickupTimeSlot($at, $for); + // WHEN + $res = $vo->getEndsAt(); + // THEN + expect($res->format('H:i'))->toBe('10:10'); + }); + + it('can be cast to string', function (): void { + // GIVEN + $at = new \DateTimeImmutable('2024-01-01 10:00:00', new \DateTimeZone('UTC')); + $for = new \DateInterval('PT10M'); + $vo = new PickupTimeSlot($at, $for); + // WHEN + $res = (string) $vo; + // THEN + expect($res)->toContain('2024-01-01T10:00:00') + ->and($res)->toContain('PT10M'); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/PictureMetadataTest.php b/tests/Unit/Domain/Models/ValueObjects/PictureMetadataTest.php new file mode 100644 index 00000000..1cb03777 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/PictureMetadataTest.php @@ -0,0 +1,83 @@ +alt)->toBeNull() + ->and($metadata->title)->toBeNull(); + }); + + test('it can be instantiated with valid alt and title', function () { + // GIVEN + $alt = 'Belle image de chat'; + $title = 'Un chat qui joue'; + + // WHEN + $metadata = new PictureMetadata(alt: $alt, title: $title); + + // THEN + expect($metadata->alt)->toBe($alt) + ->and($metadata->title)->toBe($title); + }); + + test('it throws when alt is empty string', function () { + // GIVEN + $invalidAlt = ' '; + + // WHEN & THEN + expect(fn () => new PictureMetadata(alt: $invalidAlt)) + ->toThrow(\InvalidArgumentException::class, 'Picture alt cannot be empty when provided.'); + }); + + test('it throws when alt is shorter than 4 characters', function () { + // GIVEN + $shortAlt = 'abc'; + + // WHEN & THEN + expect(fn () => new PictureMetadata(alt: $shortAlt)) + ->toThrow(\InvalidArgumentException::class, 'Picture alt must be at least 4 characters.'); + }); + + test('it throws when alt exceeds 75 characters', function () { + // GIVEN + $longAlt = str_repeat('a', 76); + + // WHEN & THEN + expect(fn () => new PictureMetadata(alt: $longAlt)) + ->toThrow(\InvalidArgumentException::class, 'Picture alt cannot exceed 75 characters.'); + }); + + test('it throws when title is empty string', function () { + // GIVEN + $invalidTitle = ' '; + + // WHEN & THEN + expect(fn () => new PictureMetadata(title: $invalidTitle)) + ->toThrow(\InvalidArgumentException::class, 'Picture title cannot be empty when provided.'); + }); + + test('it throws when title is shorter than 4 characters', function () { + // GIVEN + $shortTitle = 'xyz'; + + // WHEN & THEN + expect(fn () => new PictureMetadata(title: $shortTitle)) + ->toThrow(\InvalidArgumentException::class, 'Picture title must be at least 4 characters.'); + }); + + test('it throws when title exceeds 75 characters', function () { + // GIVEN + $longTitle = str_repeat('b', 76); + + // WHEN & THEN + expect(fn () => new PictureMetadata(title: $longTitle)) + ->toThrow(\InvalidArgumentException::class, 'Picture title cannot exceed 75 characters.'); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/ProductPricingTest.php b/tests/Unit/Domain/Models/ValueObjects/ProductPricingTest.php new file mode 100644 index 00000000..1b593abe --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/ProductPricingTest.php @@ -0,0 +1,151 @@ + getPricingMoney(1000), + 'basePriceTtc' => getPricingMoney(1200), + 'discountAmountHt' => getPricingMoney(100), + 'discountedPriceHt' => getPricingMoney(900), + 'discountedPriceTtc' => getPricingMoney(1080), + 'priceKgTtc' => getPricingMoney(2000), + 'discountRate' => DiscountRate::fromRatio(0.1), + 'hasDiscount' => false, + ], $overrides); + + return new ProductPricing(...$data); + } + + it('can instantiate', function () { + // GIVEN + $data = []; + + // WHEN + $vo = getNewProductPricing($data); + + // THEN + expect($vo)->toBeInstanceOf(ProductPricing::class); + }); + + it('throws exception if basePriceHt is negative', function () { + // GIVEN + $basePriceHt = getPricingMoney(-1); + + // WHEN + $action = fn () => getNewProductPricing(['basePriceHt' => $basePriceHt]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if basePriceTtc is negative', function () { + // GIVEN + $basePriceTtc = getPricingMoney(-1); + + // WHEN + $action = fn () => getNewProductPricing(['basePriceTtc' => $basePriceTtc]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if discountAmountHt is negative', function () { + // GIVEN + $discountAmountHt = getPricingMoney(-1); + + // WHEN + $action = fn () => getNewProductPricing(['discountAmountHt' => $discountAmountHt]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if discountedPriceHt is negative', function () { + // GIVEN + $discountedPriceHt = getPricingMoney(-1); + + // WHEN + $action = fn () => getNewProductPricing(['discountedPriceHt' => $discountedPriceHt]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if discountedPriceTtc is negative', function () { + // GIVEN + $discountedPriceTtc = getPricingMoney(-1); + + // WHEN + $action = fn () => getNewProductPricing(['discountedPriceTtc' => $discountedPriceTtc]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('throws exception if priceKgTtc is negative', function () { + // GIVEN + $priceKgTtc = getPricingMoney(-1); + + // WHEN + $action = fn () => getNewProductPricing(['priceKgTtc' => $priceKgTtc]); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('returns clones of money objects', function () { + // GIVEN + $price = getPricingMoney(1000); + $vo = getNewProductPricing(['basePriceHt' => $price]); + + // WHEN + $result = $vo->basePriceHt(); + + // THEN + expect($result)->toBe($price); + }); +}); + +describe('ProductPricing methods', function (): void { + it('returns clones of all other money properties', function (): void { + // GIVEN + $pricing = new ProductPricing( + basePriceHt: Money::EUR(100), + basePriceTtc: Money::EUR(120), + discountAmountHt: Money::EUR(10), + discountedPriceHt: Money::EUR(90), + discountedPriceTtc: Money::EUR(108), + priceKgTtc: Money::EUR(150), + discountRate: DiscountRate::fromRatio(0.1), + hasDiscount: true + ); + // WHEN + $ttc = $pricing->basePriceTtc(); + $discHt = $pricing->discountAmountHt(); + $discPriceHt = $pricing->discountedPriceHt(); + $discPriceTtc = $pricing->discountedPriceTtc(); + $priceKg = $pricing->priceKgTtc(); + // THEN + expect($ttc->getAmount())->toBe('120') + ->and($discHt->getAmount())->toBe('10') + ->and($discPriceHt->getAmount())->toBe('90') + ->and($discPriceTtc->getAmount())->toBe('108') + ->and($priceKg->getAmount())->toBe('150'); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/ProductWeightTest.php b/tests/Unit/Domain/Models/ValueObjects/ProductWeightTest.php new file mode 100644 index 00000000..594ede82 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/ProductWeightTest.php @@ -0,0 +1,78 @@ +toBeInstanceOf(ProductWeight::class) + ->and($vo->value)->toBe(1600) + ->and($vo->toGrams())->toBe(1600); + }); + + it('throws exception if weight is less than 1', function () { + // GIVEN + // WHEN + $action = fn () => new ProductWeight(0, false); + + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('formats weight in grams when under 1000', function () { + // GIVEN + $vo = new ProductWeight(250, false); + + // WHEN + $result = $vo->forDisplay(); + + // THEN + expect($result)->toBe('250 g'); + }); + + it('formats weight in kg when 1000 or more', function () { + // GIVEN + $vo = new ProductWeight(1600, false); + + // WHEN + $result = $vo->forDisplay(); + + // THEN + expect($result)->toBe('1,6 kg'); + }); + + it('formats weight as integer kg when no decimal part', function () { + // GIVEN + $vo = new ProductWeight(12000, false); + + // WHEN + $result = $vo->forDisplay(); + + // THEN + expect($result)->toBe('12 kg'); + }); + + it('formats weight correctly for exactly 1 kg', function () { + // GIVEN + $vo = new ProductWeight(1000, false); + + // WHEN + $result = $vo->forDisplay(); + + // THEN + expect($result)->toBe('1 kg'); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/SeoMetadataTest.php b/tests/Unit/Domain/Models/ValueObjects/SeoMetadataTest.php new file mode 100644 index 00000000..241d7c7e --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/SeoMetadataTest.php @@ -0,0 +1,64 @@ +title)->toBe($title) + ->and($seo->description)->toBe($description); + }); + + it('throws when title is empty', function (): void { + // GIVEN + $emptyTitle = ' '; + $description = 'Description valide'; + + // WHEN + expect(fn () => new SeoMetadata(title: $emptyTitle, description: $description)) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); + + it('throws when title exceeds 255 characters', function (): void { + // GIVEN + $tooLongTitle = str_repeat('a', 256); + $description = 'Description valide'; + + // WHEN + expect(fn () => new SeoMetadata(title: $tooLongTitle, description: $description)) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); + + it('throws when description is empty', function (): void { + // GIVEN + $title = 'Titre valide'; + $emptyDescription = ' '; + + // WHEN + expect(fn () => new SeoMetadata(title: $title, description: $emptyDescription)) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); + + it('throws when description exceeds 500 characters', function (): void { + // GIVEN + $title = 'Titre valide'; + $tooLongDescription = str_repeat('a', 501); + + // WHEN + expect(fn () => new SeoMetadata(title: $title, description: $tooLongDescription)) + // THEN + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/SessionIdTest.php b/tests/Unit/Domain/Models/ValueObjects/SessionIdTest.php new file mode 100644 index 00000000..45774709 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/SessionIdTest.php @@ -0,0 +1,28 @@ +value)->toBe($uuid); + }); + + it('throws exception with non v7 uuid', function (): void { + // GIVEN + $uuid = Uuid::uuid4(); + // WHEN + $action = fn () => new SessionId($uuid); + // THEN + expect($action)->toThrow(\DomainException::class); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/ShopPickupOverrideTest.php b/tests/Unit/Domain/Models/ValueObjects/ShopPickupOverrideTest.php new file mode 100644 index 00000000..678f9a27 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/ShopPickupOverrideTest.php @@ -0,0 +1,105 @@ +addDay(); + $deadline = CarbonImmutable::now()->subDay(); + + // WHEN + $shopPickup = new ShopPickupOverride( + $exception, + $replacement, + $deadline + ); + + // THEN + expect($shopPickup->exception)->toBe($exception) + ->and($shopPickup->replacementDate)->toBe($replacement) + ->and($shopPickup->orderDeadlineAt)->toBe($deadline); + }); + + it('throws exception if orderDeadlineAt is not strictly before replacementDate', function (): void { + // GIVEN + $exception = new PickupExceptionOnDate( + new PickupExceptionId(Uuid::uuid7()), + CarbonImmutable::now(), + 'Label', + true, + RepeatFrequency::YEARLY, + false + ); + + $replacement = CarbonImmutable::now(); + $deadline = CarbonImmutable::now()->addDay(); + + // WHEN + $action = fn () => new ShopPickupOverride( + $exception, + $replacement, + $deadline + ); + + // THEN + expect($action)->toThrow(\DomainException::class, 'Order deadline must be strictly before the replacement date'); + }); + + it('correctly handles replacement and deadlines', function (): void { + // GIVEN + $exception = new PickupExceptionOnDate( + new PickupExceptionId(Uuid::uuid7()), + CarbonImmutable::create(2025, 5, 1), + 'Labour Day', + false, + RepeatFrequency::YEARLY, + false + ); + + $defaultDeadline = CarbonImmutable::create(2025, 4, 28, 14, 0, 0); + + $blockedOverride = new ShopPickupOverride( + exception: $exception, + replacementDate: null, + orderDeadlineAt: null + ); + + $customDeadline = CarbonImmutable::create(2025, 4, 29, 12, 0, 0); + $activeOverride = new ShopPickupOverride( + exception: $exception, + replacementDate: CarbonImmutable::create(2025, 5, 2), + orderDeadlineAt: $customDeadline + ); + + // WHEN & THEN + expect($blockedOverride->hasReplacement())->toBeFalse() + ->and($blockedOverride->effectiveDeadline($defaultDeadline)->equalTo($defaultDeadline))->toBeTrue() + ->and($activeOverride->hasReplacement())->toBeTrue() + ->and($activeOverride->effectiveDeadline($defaultDeadline)->equalTo($customDeadline))->toBeTrue(); + + $beforeCustom = CarbonImmutable::create(2025, 4, 29, 10, 0, 0); + $afterCustom = CarbonImmutable::create(2025, 4, 29, 15, 0, 0); + + expect($activeOverride->isDeadlinePassed($beforeCustom, $defaultDeadline))->toBeFalse() + ->and($activeOverride->isDeadlinePassed($afterCustom, $defaultDeadline))->toBeTrue(); + }); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/SlugTest.php b/tests/Unit/Domain/Models/ValueObjects/SlugTest.php new file mode 100644 index 00000000..6e817f55 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/SlugTest.php @@ -0,0 +1,67 @@ +value)->toBe('ma-belle-gamme') + ->and((string) $slug)->toBe('ma-belle-gamme'); + }); + + test('it throws when slug is empty', function () { + // GIVEN + $empty = ' '; + + // WHEN & THEN + expect(fn () => new Slug($empty)) + ->toThrow(\InvalidArgumentException::class, 'Slug cannot be empty.'); + }); + + test('it throws when slug exceeds 255 characters', function () { + // GIVEN + $long = str_repeat('a', 256); + + // WHEN & THEN + expect(fn () => new Slug($long)) + ->toThrow(\InvalidArgumentException::class, 'Slug cannot exceed 255 characters.'); + }); + + test('it throws when slug format is invalid', function () { + // GIVEN + $invalid = 'Invalid Slug With Spaces!'; + + // WHEN & THEN + expect(fn () => new Slug($invalid)) + ->toThrow(\InvalidArgumentException::class, 'Slug format is invalid.'); + }); + + test('it creates slug from raw string with fromString', function () { + // GIVEN + $raw = 'Nouvelle Gamme Spéciale 2026 !'; + + // WHEN + $slug = Slug::fromString($raw); + + // THEN + expect($slug->value)->toBe('nouvelle-gamme-speciale-2026') + ->and((string) $slug)->toBe('nouvelle-gamme-speciale-2026'); + }); + + test('it throws fromString when string produces empty slug', function () { + // GIVEN + $raw = '??? !!!'; + + // WHEN & THEN + expect(fn () => Slug::fromString($raw)) + ->toThrow(\InvalidArgumentException::class, 'Cannot generate a valid slug from given string.'); + }); +}); diff --git a/tests/Unit/Domain/Policies/CustomerOrderLimitPolicyTest.php b/tests/Unit/Domain/Policies/CustomerOrderLimitPolicyTest.php new file mode 100644 index 00000000..94b6dd8e --- /dev/null +++ b/tests/Unit/Domain/Policies/CustomerOrderLimitPolicyTest.php @@ -0,0 +1,104 @@ +assertCanPlaceOrder($basketTotal); + + // THEN + expect(true)->toBeTrue(); + }); + + it('asserts can place order successfully when exactly at limit', function () { + // GIVEN + $policy = new CustomerOrderLimitPolicy(20000); + $basketTotal = new Money(20000, new Currency('EUR')); + + // WHEN + $policy->assertCanPlaceOrder($basketTotal); + + // THEN + expect(true)->toBeTrue(); + }); + + it('throws OrderLimitExceededException when above limit', function () { + // GIVEN + $policy = new CustomerOrderLimitPolicy(20000); + $basketTotal = new Money(20001, new Currency('EUR')); + + // WHEN + $action = fn () => $policy->assertCanPlaceOrder($basketTotal); + + // THEN + expect($action)->toThrow(OrderLimitExceededException::class); + }); + + it('asserts can place weekly order successfully when below limit', function () { + // GIVEN + $policy = new CustomerOrderLimitPolicy(20000, 30000); + $basketTotal = new Money(10000, new Currency('EUR')); + $weeklyTotal = new Money(19999, new Currency('EUR')); + + // WHEN + $policy->assertCanPlaceWeeklyOrder($basketTotal, $weeklyTotal); + + // THEN + expect(true)->toBeTrue(); + }); + + it('asserts can place weekly order successfully when exactly at limit', function () { + // GIVEN + $policy = new CustomerOrderLimitPolicy(20000, 30000); + $basketTotal = new Money(10000, new Currency('EUR')); + $weeklyTotal = new Money(20000, new Currency('EUR')); + + // WHEN + $policy->assertCanPlaceWeeklyOrder($basketTotal, $weeklyTotal); + + // THEN + expect(true)->toBeTrue(); + }); + + it('throws WeeklyLimitExceededException when above limit', function () { + // GIVEN + $policy = new CustomerOrderLimitPolicy(20000, 30000); + $basketTotal = new Money(10000, new Currency('EUR')); + $weeklyTotal = new Money(20001, new Currency('EUR')); + + // WHEN + $action = fn () => $policy->assertCanPlaceWeeklyOrder($basketTotal, $weeklyTotal); + + // THEN + expect($action)->toThrow(WeeklyLimitExceededException::class); + }); + + it('uses custom currency when provided', function () { + // GIVEN + $currency = new Currency('USD'); + $policy = new CustomerOrderLimitPolicy(20000, 30000, $currency); + $basketTotal = new Money(20001, $currency); + $weeklyTotal = new Money(10000, $currency); + + // WHEN + $actionOrder = fn () => $policy->assertCanPlaceOrder($basketTotal); + $actionWeekly = fn () => $policy->assertCanPlaceWeeklyOrder($basketTotal, $weeklyTotal); + + // THEN + expect($actionOrder)->toThrow(OrderLimitExceededException::class) + ->and($actionWeekly)->toThrow(WeeklyLimitExceededException::class); + }); +}); diff --git a/tests/Unit/Domain/Services/BasketServiceTest.php b/tests/Unit/Domain/Services/BasketServiceTest.php new file mode 100644 index 00000000..dbaa524a --- /dev/null +++ b/tests/Unit/Domain/Services/BasketServiceTest.php @@ -0,0 +1,214 @@ + new ProductId(Uuid::fromString('019e9e37-f2a1-74ef-b9c2-66d222470128')), + 'name' => 'Poulet Rôti', + 'qty' => 1, + 'unitPriceHt' => Money::EUR(1000), + 'unitDiscount' => Money::EUR(0), + 'taxRate' => TaxRate::TVA_5_5, + 'weightGrams' => 1200, + 'brand' => ProductBrand::marie, + 'incoId' => new IncoId(45), + 'orderUnit' => OrderUnit::PCE, + 'slug' => 'poulet-roti', + 'picture' => 'images/poulet.jpg', + 'description' => 'Un bon poulet', + 'weightVariable' => false, + 'discountRate' => DiscountRate::fromRatio(0.0), + 'priceKgTtc' => Money::EUR(1500), + ], $overrides); + + return new BasketProduct(...$data); +} + +describe('BasketService', function (): void { + + it('adds a new product to the basket and saves it', function (): void { + // GIVEN + $productId = new ProductId(Uuid::uuid7()); + $qty = 2; + $basket = new Basket(new BasketId(Uuid::uuid7())); + $basketProduct = makeBasketProduct(['id' => $productId, 'qty' => $qty]); + + $basketRepository = Mockery::mock(BasketRepository::class); + $sessionService = Mockery::mock(SessionService::class); + $sessionService->shouldReceive('get')->andReturn(new SessionId(Uuid::uuid7()))->byDefault(); + $basketRepository->shouldReceive('find')->once()->andReturn($basket); + $basketRepository->shouldReceive('persist')->once()->with(Mockery::on(function (Basket $b) use ($productId) { + return $b->has($productId) && $b->countItems() === 2; + })); + + $productRepository = Mockery::mock(ProductRepository::class); + $productRepository->shouldReceive('getBasketProduct')->once()->with($productId, $qty)->andReturn($basketProduct); + + $service = new BasketService($basketRepository, $productRepository, $sessionService); + + // WHEN + $service->add($productId, $qty); + + // THEN + expect($basket->has($productId))->toBeTrue(); + }); + + it('removes a quantity from the basket', function (): void { + // GIVEN + $productId = new ProductId(Uuid::uuid7()); + $basket = new Basket(new BasketId(Uuid::uuid7())); + $basket->addOrUpdate(makeBasketProduct(['id' => $productId, 'qty' => 3])); + + $basketRepository = Mockery::mock(BasketRepository::class); + $sessionService = Mockery::mock(SessionService::class); + $sessionService->shouldReceive('get')->andReturn(new SessionId(Uuid::uuid7()))->byDefault(); + $basketRepository->shouldReceive('find')->once()->andReturn($basket); + $basketRepository->shouldReceive('persist')->once()->with(Mockery::on(function (Basket $b) use ($productId) { + $items = $b->items(); + + return $items[(string) $productId->value]->qty === 1; + })); + + $productRepository = Mockery::mock(ProductRepository::class); + + $service = new BasketService($basketRepository, $productRepository, $sessionService); + + // WHEN + $service->remove($productId, 2); + + // THEN + $items = $basket->items(); + expect($items[(string) $productId->value]->qty)->toBe(1); + }); + + it('removes the entire line when quantity to remove equals current quantity', function (): void { + // GIVEN + $productId = new ProductId(Uuid::uuid7()); + $basket = new Basket(new BasketId(Uuid::uuid7())); + $basket->addOrUpdate(makeBasketProduct(['id' => $productId, 'qty' => 3])); + + $basketRepository = Mockery::mock(BasketRepository::class); + $sessionService = Mockery::mock(SessionService::class); + $sessionService->shouldReceive('get')->andReturn(new SessionId(Uuid::uuid7()))->byDefault(); + $basketRepository->shouldReceive('find')->once()->andReturn($basket); + $basketRepository->shouldReceive('persist')->once()->with(Mockery::on(function (Basket $b) use ($productId) { + return ! $b->has($productId); + })); + + $productRepository = Mockery::mock(ProductRepository::class); + + $service = new BasketService($basketRepository, $productRepository, $sessionService); + + // WHEN + $service->remove($productId, 3); + + // THEN + expect($basket->has($productId))->toBeFalse(); + }); + + it('removes an entire line directly via removeLine', function (): void { + // GIVEN + $productId = new ProductId(Uuid::uuid7()); + $basket = new Basket(new BasketId(Uuid::uuid7())); + $basket->addOrUpdate(makeBasketProduct(['id' => $productId, 'qty' => 5])); + + $basketRepository = Mockery::mock(BasketRepository::class); + $sessionService = Mockery::mock(SessionService::class); + $sessionService->shouldReceive('get')->andReturn(new SessionId(Uuid::uuid7()))->byDefault(); + $basketRepository->shouldReceive('find')->once()->andReturn($basket); + $basketRepository->shouldReceive('persist')->once()->with(Mockery::on(function (Basket $b) use ($productId) { + return ! $b->has($productId); + })); + + $productRepository = Mockery::mock(ProductRepository::class); + + $service = new BasketService($basketRepository, $productRepository, $sessionService); + + // WHEN + $service->removeLine($productId); + + // THEN + expect($basket->has($productId))->toBeFalse(); + }); + + it('empties the basket by destroying it from repository', function (): void { + // GIVEN + $basketRepository = Mockery::mock(BasketRepository::class); + $sessionService = Mockery::mock(SessionService::class); + $sessionService->shouldReceive('get')->andReturn(new SessionId(Uuid::uuid7()))->byDefault(); + $basketRepository->shouldReceive('find')->once()->andReturn(new Basket(new BasketId(Uuid::uuid7()))); + $basketRepository->shouldReceive('delete')->once(); + + $productRepository = Mockery::mock(ProductRepository::class); + + $service = new BasketService($basketRepository, $productRepository, $sessionService); + + // WHEN + $service->empty(); + + // THEN + expect(true)->toBeTrue(); + }); + + it('gets the basket from repository', function (): void { + // GIVEN + $basket = new Basket(new BasketId(Uuid::uuid7())); + $basketRepository = Mockery::mock(BasketRepository::class); + $sessionService = Mockery::mock(SessionService::class); + $sessionService->shouldReceive('get')->andReturn(new SessionId(Uuid::uuid7()))->byDefault(); + $basketRepository->shouldReceive('find')->once()->andReturn($basket); + + $productRepository = Mockery::mock(ProductRepository::class); + + $service = new BasketService($basketRepository, $productRepository, $sessionService); + + // WHEN + $returnedBasket = $service->getBasket(); + + // THEN + expect($returnedBasket)->toBe($basket); + }); + + it('returns a new basket if not found in repository', function (): void { + // GIVEN + $sessionId = new SessionId(Uuid::uuid7()); + $basketRepository = Mockery::mock(BasketRepository::class); + $sessionService = Mockery::mock(SessionService::class); + $sessionService->shouldReceive('get')->andReturn($sessionId)->byDefault(); + $basketRepository->shouldReceive('find')->once()->andReturn(null); + + $productRepository = Mockery::mock(ProductRepository::class); + + $service = new BasketService($basketRepository, $productRepository, $sessionService); + + // WHEN + $returnedBasket = $service->getBasket(); + + // THEN + expect($returnedBasket)->toBeInstanceOf(Basket::class) + ->and($returnedBasket->id->value)->toBe($sessionId->value) + ->and($returnedBasket->countItems())->toBe(0); + }); +}); diff --git a/tests/Unit/Domain/Services/OrderServiceTest.php b/tests/Unit/Domain/Services/OrderServiceTest.php new file mode 100644 index 00000000..d9e63424 --- /dev/null +++ b/tests/Unit/Domain/Services/OrderServiceTest.php @@ -0,0 +1,296 @@ +shouldReceive('find')->with($orderId)->andReturn($order); + $repository->shouldReceive('persist')->with($order)->once(); + + $service = new OrderService($repository); + + // WHEN + $service->cancelOrder($orderId); + + // THEN + expect($order->status)->toBe(OrderStatus::CANCELED); + }); + + it('throws exception if order not found', function () { + // GIVEN + $orderId = new OrderId(Uuid::uuid7()); + + /** @var OrderRepository|\Mockery\MockInterface $repository */ + $repository = Mockery::mock(OrderRepository::class); + $repository->shouldReceive('find')->with($orderId)->andReturn(null); + + $service = new OrderService($repository); + + // WHEN + $action = fn () => $service->cancelOrder($orderId); + + // THEN + expect($action)->toThrow(\DomainException::class, 'Order not found'); + }); +}); + +describe('Order Creation', function () { + it('creates an order from a basket correctly', function () { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $basket = new Basket($basketId); + + $basketProduct = new BasketProduct( + id: new ProductId(Uuid::uuid7()), + name: 'Poulet Rôti', + qty: 2, + unitPriceHt: Money::EUR(1000), + unitDiscount: Money::EUR(100), + taxRate: TaxRate::TVA_5_5, + weightGrams: 1200, + brand: ProductBrand::marie, + incoId: new IncoId(45), + orderUnit: OrderUnit::PCE, + slug: 'poulet-roti', + picture: 'images/poulet.jpg', + description: 'Un bon poulet', + weightVariable: false, + discountRate: DiscountRate::fromRatio(0.1), + priceKgTtc: Money::EUR(1500) + ); + $basket->addOrUpdate($basketProduct); + + $pickupTimeSlot = new PickupTimeSlot( + new \DateTimeImmutable('2023-12-01 10:00:00'), + new \DateInterval('PT10M') + ); + + $shopper = new Shopper( + id: new ShopperId(Uuid::uuid7()), + email: new Email('jean.dupont@example.com'), + matricule: new Matricule('1234567'), + nom: 'Dupont', + prenom: 'Jean', + startDate: CarbonImmutable::now(), + endDate: null, + etablissement: new ShopperEstablishmentCode('ETAB01'), + site: new ShopperSiteCode('SITEA'), + service: new ShopperServiceCode('101') + ); + + $shop = new Shop( + id: new ShopId(Uuid::uuid7()), + name: 'Cocotte Lyon', + address: '12 rue de la Paix', + postcode: '69001', + city: 'Lyon', + phone: '0478123456' + ); + + /** @var OrderRepository|\Mockery\MockInterface $repository */ + $repository = Mockery::mock(OrderRepository::class); + + $service = new OrderService($repository); + + // WHEN + $order = $service->createOrderFromBasket($basket, $pickupTimeSlot, $shopper, $shop); + + // THEN + expect($order)->toBeInstanceOf(Order::class); + expect($order->status)->toBe(OrderStatus::VALIDATED); + expect(UuidHelper::isV7($order->reference->value))->toBeTrue(); + + // * Employee + $employee = $order->employee; + expect($employee->matricule->value)->toBe('1234567'); + expect($employee->firstname)->toBe('Jean'); + expect($employee->lastname)->toBe('Dupont'); + expect($employee->facility->value)->toBe('ETAB01'); + expect($employee->site->value)->toBe('SITEA'); + expect($employee->service->value)->toBe('101'); + + // * Delivery Address + $delivery = $order->deliveryAddress; + expect($delivery->name)->toBe('Cocotte Lyon'); + expect($delivery->address)->toBe('12 rue de la Paix'); + expect($delivery->postcode)->toBe('69001'); + expect($delivery->city)->toBe('Lyon'); + expect($delivery->phone)->toBe('0478123456'); + + // * Total + expect($order->getTotal()->getAmount())->toBe('1899'); + + // * Lines + $lines = $order->getLines(); + expect($lines)->toHaveCount(1); + $line = $lines[0]; + expect($line->quantity)->toBe(2); + + expect($line->unitPriceHt->getAmount())->toBe('1000'); + expect($line->unitDiscount->getAmount())->toBe('100'); + expect($line->unitTtc->getAmount())->toBe('950'); + expect($line->totalHt->getAmount())->toBe('1800'); + expect($line->totalDiscount->getAmount())->toBe('200'); + expect($line->totalTtc->getAmount())->toBe('1899'); + + // * product mapping + $product = $line->product; + expect($product->name)->toBe('Poulet Rôti'); + expect($product->weight->toGrams())->toBe(1200); + expect($product->brand)->toBe(ProductBrand::marie); + expect($product->incoId->value)->toBe(45); + expect($product->orderUnit)->toBe(OrderUnit::PCE); + expect($product->picture)->toBe('images/poulet.jpg'); + }); + + it('throws exception if basket product has no incoId', function () { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $basket = new Basket($basketId); + + $basketProduct = new BasketProduct( + id: new ProductId(Uuid::uuid7()), + name: 'Poulet Rôti', + qty: 2, + unitPriceHt: Money::EUR(1000), + unitDiscount: Money::EUR(100), + taxRate: TaxRate::TVA_5_5, + weightGrams: 1200, + brand: ProductBrand::marie, + incoId: null, // NO INCO ID + orderUnit: OrderUnit::PCE, + slug: 'poulet-roti', + picture: null, + description: null, + weightVariable: false, + discountRate: DiscountRate::fromRatio(0.1), + priceKgTtc: Money::EUR(1500) + ); + $basket->addOrUpdate($basketProduct); + + $pickupTimeSlot = new PickupTimeSlot(new \DateTimeImmutable(), new \DateInterval('PT10M')); + $shopper = new Shopper( + id: new ShopperId(Uuid::uuid7()), + email: new Email('a@a.com'), + matricule: new Matricule('1234567'), + nom: 'A', + prenom: 'B', + startDate: CarbonImmutable::now(), + endDate: null, + etablissement: new ShopperEstablishmentCode('ETAB01'), + site: new ShopperSiteCode('SITEA'), + service: new ShopperServiceCode('101') + ); + $shop = new Shop( + id: new ShopId(Uuid::uuid7()), + name: 'S', + address: 'A', + postcode: 'P', + city: 'C' + ); + + $repository = Mockery::mock(OrderRepository::class); + + $service = new OrderService($repository); + + // WHEN + $action = fn () => $service->createOrderFromBasket($basket, $pickupTimeSlot, $shopper, $shop); + + // THEN + expect($action)->toThrow(\DomainException::class, 'incoId cannot be null for an order'); + }); +}); diff --git a/tests/Unit/Domain/Services/OrderTunnelServiceTest.php b/tests/Unit/Domain/Services/OrderTunnelServiceTest.php new file mode 100644 index 00000000..1efbf9db --- /dev/null +++ b/tests/Unit/Domain/Services/OrderTunnelServiceTest.php @@ -0,0 +1,726 @@ + 0) { + $productId = new ProductId(Uuid::fromString('019e9e37-f2a1-74ef-b9c2-66d222470128')); + $basketProduct = new BasketProduct( + id: $productId, + name: 'Test Product', + qty: $qty, + unitPriceHt: Money::EUR(100), + unitDiscount: Money::EUR(0), + taxRate: TaxRate::TVA_20, + weightGrams: 100, + brand: null, + incoId: new IncoId(123), + orderUnit: OrderUnit::PCE, + slug: 'test-product', + picture: null, + description: null, + weightVariable: false, + discountRate: DiscountRate::fromRatio(0.0), + priceKgTtc: Money::EUR(120) + ); + $items[(string) $productId->value] = $basketProduct; + } + + $basketId = new BasketId(Uuid::fromString('019e9e37-f2a1-74ef-b9c2-66d222470128')); + + return new Basket($basketId, $items); +} + +function createTestBuilder(bool $completed = false): OrderBuilder +{ + $basket = createTestBasket(1); + $shopperId = new ShopperId(Uuid::uuid7()); + $builder = OrderBuilder::fromBasket($basket, $shopperId); + + if ($completed) { + $shopId = new ShopId(Uuid::uuid7()); + $timeSlot = new PickupTimeSlot(CarbonImmutable::create(2025, 1, 1), new DateInterval('PT1H')); + $builder = $builder->withPickupTimeSlot($shopId, $timeSlot); + } + + /** @var OrderBuilder $builder */ + return $builder; +} + +function createOrderTunnelService( + ?BasketRepository $basketRepository = null, + ?ProductRepository $productRepository = null, + ?ShopRepository $shopRepository = null, + ?ShopperRepository $shopperRepository = null, + ?PickupExceptionRepository $pickupExceptionRepository = null, + ?OrderBuilderSessionManager $orderBuilderSessionManager = null, + ?OrderRepository $orderRepository = null, + ?TransactionManager $transactionManager = null, + ?DomainEventDispatcher $eventDispatcher = null, +): OrderTunnelService { + if ($basketRepository === null) { + $basketRepository = mock(BasketRepository::class); + $basketRepository->shouldReceive('persist')->byDefault(); + } + if ($productRepository === null) { + $productRepository = mock(ProductRepository::class); + $productRepository->shouldReceive('getBasketProduct')->andReturnUsing(function ($id, $qty) { + return new BasketProduct( + id: $id, + name: 'Test Product', + qty: $qty, + unitPriceHt: Money::EUR(100), + unitDiscount: Money::EUR(0), + taxRate: TaxRate::TVA_20, + weightGrams: 100, + brand: null, + incoId: new IncoId(123), + orderUnit: OrderUnit::PCE, + slug: 'test-product', + picture: null, + description: null, + weightVariable: false, + discountRate: DiscountRate::fromRatio(0.0), + priceKgTtc: Money::EUR(120) + ); + })->byDefault(); + } + $shopRepository ??= mock(ShopRepository::class); + $shopperRepository ??= mock(ShopperRepository::class); + $pickupExceptionRepository ??= mock(PickupExceptionRepository::class); + $orderBuilderSessionManager ??= mock(OrderBuilderSessionManager::class); + $orderRepository ??= mock(OrderRepository::class); + + $transactionManager ??= mock(TransactionManager::class); + $eventDispatcher ??= mock(DomainEventDispatcher::class); + + $sessionService = \Mockery::mock(SessionService::class); + $sessionService->shouldReceive('get')->andReturn(new SessionId(Uuid::uuid7()))->byDefault(); + + $employeeStatisticsService = \Mockery::mock(EmployeeStatisticsService::class); + $employeeStatisticsService->shouldReceive('getWeeklyTotalForEmployee')->andReturn(Money::EUR(0))->byDefault(); + + $basketService = new BasketService($basketRepository, $productRepository, $sessionService); + $shopperService = new ShopperService($shopRepository, $shopperRepository); + $pickupService = new PickupSchedulingService($pickupExceptionRepository); + $orderService = new OrderService($orderRepository); + + $orderLimitPolicy = new CustomerOrderLimitPolicy(500000, 500000); + + return new OrderTunnelService( + $basketService, + $eventDispatcher, + $shopperService, + $orderBuilderSessionManager, + $pickupService, + $orderRepository, + $orderLimitPolicy, + $transactionManager, + $shopRepository, + $shopperRepository, + $orderService, + $employeeStatisticsService + ); +} + +describe('OrderTunnelService', function (): void { + it('validates basket is valid when it has items', function (): void { + // GIVEN + $basketRepo = mock(BasketRepository::class); + $basketRepo->shouldReceive('find')->andReturn(createTestBasket(2)); + + $service = createOrderTunnelService(basketRepository: $basketRepo); + + // WHEN + $isValid = $service->hasValidBasket(); + + // THEN + expect($isValid)->toBeTrue(); + }); + + it('invalidates basket when it is empty', function (): void { + // GIVEN + $basketRepo = mock(BasketRepository::class); + $basketRepo->shouldReceive('find')->andReturn(createTestBasket(0)); + + $service = createOrderTunnelService(basketRepository: $basketRepo); + + // WHEN + $isValid = $service->hasValidBasket(); + + // THEN + expect($isValid)->toBeFalse(); + }); + + it('allows access to REVIEW step when basket is valid', function (): void { + // GIVEN + $basketRepo = mock(BasketRepository::class); + $basketRepo->shouldReceive('find')->andReturn(createTestBasket(1)); + + $orderBuilderRepository = mock(OrderBuilderSessionManager::class); + $orderBuilderRepository->shouldReceive('get')->andReturn(null); + + $service = createOrderTunnelService( + basketRepository: $basketRepo, + orderBuilderSessionManager: $orderBuilderRepository + ); + + // WHEN + $canAccess = $service->canAccessStep(OrderTunnelStep::REVIEW); + + // THEN + expect($canAccess)->toBeTrue(); + }); + + it('denies access to REVIEW step when basket is empty', function (): void { + // GIVEN + $basketRepo = mock(BasketRepository::class); + $basketRepo->shouldReceive('find')->andReturn(createTestBasket(0)); + + $orderBuilderRepository = mock(OrderBuilderSessionManager::class); + $orderBuilderRepository->shouldReceive('get')->andReturn(null); + + $service = createOrderTunnelService( + basketRepository: $basketRepo, + orderBuilderSessionManager: $orderBuilderRepository + ); + + // WHEN + $canAccess = $service->canAccessStep(OrderTunnelStep::REVIEW); + + // THEN + expect($canAccess)->toBeFalse(); + }); + + it('allows access to BOOKING step when builder is from basket and basket is valid', function (): void { + // GIVEN + $basketRepo = mock(BasketRepository::class); + $basketRepo->shouldReceive('find')->andReturn(createTestBasket(1)); + + $builder = createTestBuilder(); + $orderBuilderRepository = mock(OrderBuilderSessionManager::class); + $orderBuilderRepository->shouldReceive('get')->andReturn($builder); + + $service = createOrderTunnelService( + basketRepository: $basketRepo, + orderBuilderSessionManager: $orderBuilderRepository + ); + + // WHEN + $canAccess = $service->canAccessStep(OrderTunnelStep::BOOKING); + + // THEN + expect($canAccess)->toBeTrue(); + }); + + it('denies access to BOOKING step when builder is missing', function (): void { + // GIVEN + $basketRepo = mock(BasketRepository::class); + $basketRepo->shouldReceive('find')->andReturn(createTestBasket(1)); + + $orderBuilderRepository = mock(OrderBuilderSessionManager::class); + $orderBuilderRepository->shouldReceive('get')->andReturn(null); + + $service = createOrderTunnelService( + basketRepository: $basketRepo, + orderBuilderSessionManager: $orderBuilderRepository + ); + + // WHEN + $canAccess = $service->canAccessStep(OrderTunnelStep::BOOKING); + + // THEN + expect($canAccess)->toBeFalse(); + }); + + it('allows access to CONFIRMATION step when builder is completed and basket is valid', function (): void { + // GIVEN + $basketRepo = mock(BasketRepository::class); + $basketRepo->shouldReceive('find')->andReturn(createTestBasket(1)); + + $builder = createTestBuilder(completed: true); + $orderBuilderRepository = mock(OrderBuilderSessionManager::class); + $orderBuilderRepository->shouldReceive('get')->andReturn($builder); + + $service = createOrderTunnelService( + basketRepository: $basketRepo, + orderBuilderSessionManager: $orderBuilderRepository + ); + + // WHEN + $canAccess = $service->canAccessStep(OrderTunnelStep::CONFIRMATION); + + // THEN + expect($canAccess)->toBeTrue(); + }); + + it('denies access to CONFIRMATION step when builder is not completed', function (): void { + // GIVEN + $basketRepo = mock(BasketRepository::class); + $basketRepo->shouldReceive('find')->andReturn(createTestBasket(1)); + + $builder = createTestBuilder(completed: false); + $orderBuilderRepository = mock(OrderBuilderSessionManager::class); + $orderBuilderRepository->shouldReceive('get')->andReturn($builder); + + $service = createOrderTunnelService( + basketRepository: $basketRepo, + orderBuilderSessionManager: $orderBuilderRepository + ); + + // WHEN + $canAccess = $service->canAccessStep(OrderTunnelStep::CONFIRMATION); + + // THEN + expect($canAccess)->toBeFalse(); + }); + + it('denies access to CONFIRMATION step when builder is missing', function (): void { + // GIVEN + $basketRepo = mock(BasketRepository::class); + $basketRepo->shouldReceive('find')->andReturn(createTestBasket(1)); + + $orderBuilderRepository = mock(OrderBuilderSessionManager::class); + $orderBuilderRepository->shouldReceive('get')->andReturn(null); + + $service = createOrderTunnelService( + basketRepository: $basketRepo, + orderBuilderSessionManager: $orderBuilderRepository + ); + + // WHEN + $canAccess = $service->canAccessStep(OrderTunnelStep::CONFIRMATION); + + // THEN + expect($canAccess)->toBeFalse(); + }); + + it('gets shop for customer successfully', function (): void { + // GIVEN + $shopperId = new ShopperId(Uuid::uuid7()); + $shopper = new Shopper( + id: $shopperId, + email: new Email('test@test.com'), + matricule: new Matricule('1234567'), + nom: 'Doe', + prenom: 'John', + startDate: CarbonImmutable::now()->subYear(), + endDate: null, + etablissement: new ShopperEstablishmentCode('ETAB01'), + site: new ShopperSiteCode('SITEA'), + service: new ShopperServiceCode('101') + ); + + $shopId = new ShopId(Uuid::uuid7()); + $shop = new Shop( + id: $shopId, + name: 'Shop', + address: 'Address', + postcode: '75000', + city: 'Paris' + ); + + $shopperRepo = mock(ShopperRepository::class); + $shopperRepo->shouldReceive('find')->with($shopperId)->andReturn($shopper); + + $shopRepo = mock(ShopRepository::class); + $shopRepo->shouldReceive('findExceptionShopFor')->with($shopper->matricule)->andReturn(null); + $shopRepo->shouldReceive('findShopForSiteAndService')->with($shopper->site, $shopper->service)->andReturn(null); + $shopRepo->shouldReceive('findShopForSiteAndService')->with($shopper->site, null)->andReturn(null); + $shopRepo->shouldReceive('getDefaultShop')->andReturn($shop); + + $service = createOrderTunnelService( + shopRepository: $shopRepo, + shopperRepository: $shopperRepo + ); + + // WHEN + $result = $service->getShopForCustomer($shopperId); + + // THEN + expect($result)->toBe($shop); + }); + + it('throws exception when get shop for customer fails', function (): void { + // GIVEN + $shopperId = new ShopperId(Uuid::uuid7()); + $shopperRepo = mock(ShopperRepository::class); + $shopperRepo->shouldReceive('find')->with($shopperId)->andReturn(null); + + $service = createOrderTunnelService(shopperRepository: $shopperRepo); + + // WHEN + $action = fn () => $service->getShopForCustomer($shopperId); + // THEN + expect($action)->toThrow(\UnexpectedValueException::class); + }); + + it('gets available time slots', function (): void { + // GIVEN + $shopId = new ShopId(Uuid::uuid7()); + $shop = new Shop($shopId, 'Shop', 'Address', '75000', 'Paris'); + + $pickupExceptionRepo = mock(PickupExceptionRepository::class); + $pickupExceptionRepo->shouldReceive('getExceptionsForShop')->andReturn([]); + + $service = createOrderTunnelService(pickupExceptionRepository: $pickupExceptionRepo); + + // WHEN + $slots = $service->getAvailableTimeSlots($shop); + + // THEN + expect($slots)->toBeArray(); + }); + + it('initializes order from basket', function (): void { + // GIVEN + $basket = createTestBasket(1); + $customerId = new ShopperId(Uuid::uuid7()); + + $orderBuilderRepo = mock(OrderBuilderSessionManager::class); + $orderBuilderRepo->shouldReceive('save')->once(); + + $service = createOrderTunnelService(orderBuilderSessionManager: $orderBuilderRepo); + + // WHEN + $service->initializeFromBasket($basket, $customerId); + + // THEN + expect(true)->toBeTrue(); + }); + + it('gets builder from basket or fail', function (): void { + // GIVEN + $builder = createTestBuilder(); + $orderBuilderRepo = mock(OrderBuilderSessionManager::class); + $orderBuilderRepo->shouldReceive('get')->once()->andReturn($builder); + + $service = createOrderTunnelService(orderBuilderSessionManager: $orderBuilderRepo); + + // WHEN + $result = $service->getBuilderFromBasketOrFail(); + + // THEN + expect($result)->toBe($builder); + }); + + it('throws exception if builder not from basket', function (): void { + // GIVEN + $orderBuilderRepo = mock(OrderBuilderSessionManager::class); + $orderBuilderRepo->shouldReceive('get')->once()->andReturn(null); + + $service = createOrderTunnelService(orderBuilderSessionManager: $orderBuilderRepo); + + // WHEN + $action = fn () => $service->getBuilderFromBasketOrFail(); + // THEN + expect($action)->toThrow(MissingOrderBuilderException::class); + }); + + it('gets completed builder or fail', function (): void { + // GIVEN + $builder = createTestBuilder(completed: true); + $orderBuilderRepo = mock(OrderBuilderSessionManager::class); + $orderBuilderRepo->shouldReceive('get')->once()->andReturn($builder); + + $service = createOrderTunnelService(orderBuilderSessionManager: $orderBuilderRepo); + + // WHEN + $result = $service->getBuilderCompletedOrFail(); + + // THEN + expect($result)->toBe($builder); + }); + + it('throws exception if builder not completed', function (): void { + // GIVEN + $builder = createTestBuilder(completed: false); + $orderBuilderRepo = mock(OrderBuilderSessionManager::class); + $orderBuilderRepo->shouldReceive('get')->once()->andReturn($builder); + + $service = createOrderTunnelService(orderBuilderSessionManager: $orderBuilderRepo); + + // WHEN + $action = fn () => $service->getBuilderCompletedOrFail(); + // THEN + expect($action)->toThrow(MissingOrderBuilderException::class); + }); + + it('applies time slot', function (): void { + // GIVEN + $builder = createTestBuilder(completed: false); + $shop = new Shop(new ShopId(Uuid::uuid7()), 'Shop', 'Address', '75000', 'Paris'); + $selectedDate = CarbonImmutable::create(2025, 1, 1); + $ts1 = new PickupTimeSlot($selectedDate, new DateInterval('PT1H')); + $ts2 = new PickupTimeSlot(CarbonImmutable::create(2025, 1, 2), new DateInterval('PT1H')); + $availableSlots = [$ts1, $ts2]; + + $orderBuilderRepo = mock(OrderBuilderSessionManager::class); + $orderBuilderRepo->shouldReceive('save')->once(); + + $service = createOrderTunnelService(orderBuilderSessionManager: $orderBuilderRepo); + + // WHEN + $matched = $service->applyTimeSlot($builder, $shop, $selectedDate, $availableSlots); + + // THEN + expect($matched)->toBe($ts1); + }); + + it('returns null if no matching time slot', function (): void { + // GIVEN + $builder = createTestBuilder(completed: false); + $shop = new Shop(new ShopId(Uuid::uuid7()), 'Shop', 'Address', '75000', 'Paris'); + $selectedDate = CarbonImmutable::create(2025, 1, 1); + $ts1 = new PickupTimeSlot(CarbonImmutable::create(2025, 1, 2), new DateInterval('PT1H')); + $availableSlots = [$ts1]; + + $service = createOrderTunnelService(); + + // WHEN + $matched = $service->applyTimeSlot($builder, $shop, $selectedDate, $availableSlots); + + // THEN + expect($matched)->toBeNull(); + }); + + it('finalizes order', function (): void { + // GIVEN + $basketRepo = mock(BasketRepository::class); + $basketRepo->shouldReceive('find')->once()->andReturn(createTestBasket(1)); + $basketRepo->shouldReceive('persist')->once(); + $basketRepo->shouldReceive('delete')->once(); + + $builder = createTestBuilder(completed: true); + $shopperId = $builder->getShopperId(); + $shopper = new Shopper( + id: $shopperId, + email: new Email('test@test.com'), + matricule: new Matricule('1234567'), + nom: 'Doe', + prenom: 'John', + startDate: CarbonImmutable::now()->subYear(), + endDate: null, + etablissement: new ShopperEstablishmentCode('ETAB01'), + site: new ShopperSiteCode('SITEA'), + service: new ShopperServiceCode('101') + ); + $shopperRepo = mock(ShopperRepository::class); + $shopperRepo->shouldReceive('getByIdOrFail')->with(\Mockery::type(ShopperId::class))->andReturn($shopper); + + $shopId = clone clone $builder->getShopId(); + $shop = new Shop($shopId, 'Shop', 'Address', '75000', 'Paris'); + $shopRepo = mock(ShopRepository::class); + $shopRepo->shouldReceive('find')->andReturn($shop); // any with shopId is fine + + $orderRepo = mock(OrderRepository::class); + $orderRepo->shouldReceive('getWeeklyTotalForEmployee')->andReturn(Money::EUR(5000)); + $orderRepo->shouldReceive('persist')->once(); + + $transactionManager = mock(TransactionManager::class); + $transactionManager->shouldReceive('execute')->once()->andReturnUsing(function ($callback) { + return $callback(); + }); + + $eventDispatcher = mock(DomainEventDispatcher::class); + $eventDispatcher->shouldReceive('dispatch')->once(); + + $builderRepo = mock(OrderBuilderSessionManager::class); + $builderRepo->shouldReceive('clear')->once(); + + $service = createOrderTunnelService( + basketRepository: $basketRepo, + shopRepository: $shopRepo, + shopperRepository: $shopperRepo, + orderBuilderSessionManager: $builderRepo, + orderRepository: $orderRepo, + transactionManager: $transactionManager, + eventDispatcher: $eventDispatcher + ); + + // WHEN + $order = $service->finalizeOrder($builder); + + // THEN + expect($order)->toBeInstanceOf(Order::class); + expect($order->employee->matricule->value)->toBe('1234567'); + expect($order->deliveryAddress->name)->toBe('Shop'); + }); + + it('throws exception if shop not found during finalize order', function (): void { + // GIVEN + $builder = createTestBuilder(completed: true); + $shopperId = clone clone $builder->getShopperId(); + $shopper = new Shopper( + id: $shopperId, + email: new Email('test@test.com'), + matricule: new Matricule('1234567'), + nom: 'Doe', + prenom: 'John', + startDate: CarbonImmutable::now()->subYear(), + endDate: null, + etablissement: new ShopperEstablishmentCode('ETAB01'), + site: new ShopperSiteCode('SITEA'), + service: new ShopperServiceCode('101') + ); + $shopperRepo = mock(ShopperRepository::class); + $shopperRepo->shouldReceive('getByIdOrFail')->with(\Mockery::type(ShopperId::class))->andReturn($shopper); + + $shopRepo = mock(ShopRepository::class); + $shopRepo->shouldReceive('find')->andReturn(null); + + $orderRepo = mock(OrderRepository::class); + $orderRepo->shouldReceive('getWeeklyTotalForEmployee')->andReturn(Money::EUR(5000)); + + $transactionManager = mock(TransactionManager::class); + $transactionManager->shouldReceive('execute')->once()->andReturnUsing(function ($callback) { + return $callback(); + }); + + $service = createOrderTunnelService( + shopRepository: $shopRepo, + shopperRepository: $shopperRepo, + orderRepository: $orderRepo, + transactionManager: $transactionManager + ); + + // WHEN + $action = fn () => $service->finalizeOrder($builder); + // THEN + expect($action)->toThrow(\DomainException::class); + }); + + it('revalidates basket prices from product repository when finalizing order', function (): void { + // GIVEN + $builder = createTestBuilder(completed: true); + $shopperId = $builder->getShopperId(); + $shopper = new Shopper( + id: $shopperId, + email: new Email('test@test.com'), + matricule: new Matricule('1234567'), + nom: 'Doe', + prenom: 'John', + startDate: CarbonImmutable::now()->subYear(), + endDate: null, + etablissement: new ShopperEstablishmentCode('ETAB01'), + site: new ShopperSiteCode('SITEA'), + service: new ShopperServiceCode('101') + ); + $shopperRepo = mock(ShopperRepository::class); + $shopperRepo->shouldReceive('getByIdOrFail')->with(\Mockery::type(ShopperId::class))->andReturn($shopper); + + $shopId = clone $builder->getShopId(); + $shop = new Shop($shopId, 'Shop', 'Address', '75000', 'Paris'); + $shopRepo = mock(ShopRepository::class); + $shopRepo->shouldReceive('find')->andReturn($shop); + + $orderRepo = mock(OrderRepository::class); + $orderRepo->shouldReceive('getWeeklyTotalForEmployee')->andReturn(Money::EUR(5000)); + $orderRepo->shouldReceive('persist')->once(); + + $transactionManager = mock(TransactionManager::class); + $transactionManager->shouldReceive('execute')->once()->andReturnUsing(function ($callback) { + return $callback(); + }); + + $eventDispatcher = mock(DomainEventDispatcher::class); + $eventDispatcher->shouldReceive('dispatch')->once(); + + $builderRepo = mock(OrderBuilderSessionManager::class); + $builderRepo->shouldReceive('clear')->once(); + + $basketRepo = mock(BasketRepository::class); + $basketRepo->shouldReceive('find')->once()->andReturn(createTestBasket(1)); + $basketRepo->shouldReceive('persist')->once(); + $basketRepo->shouldReceive('delete')->once(); + + $productRepo = mock(ProductRepository::class); + $productRepo->shouldReceive('getBasketProduct')->once()->andReturnUsing(function ($id, $qty) { + return new BasketProduct( + id: $id, + name: 'Updated Product Name', + qty: $qty, + unitPriceHt: Money::EUR(250), + unitDiscount: Money::EUR(50), + taxRate: TaxRate::TVA_20, + weightGrams: 200, + brand: null, + incoId: new IncoId(123), + orderUnit: OrderUnit::PCE, + slug: 'updated-product', + picture: null, + description: null, + weightVariable: false, + discountRate: DiscountRate::fromRatio(0.0), + priceKgTtc: Money::EUR(240) + ); + }); + + $service = createOrderTunnelService( + basketRepository: $basketRepo, + productRepository: $productRepo, + shopRepository: $shopRepo, + shopperRepository: $shopperRepo, + orderBuilderSessionManager: $builderRepo, + orderRepository: $orderRepo, + transactionManager: $transactionManager, + eventDispatcher: $eventDispatcher + ); + + // WHEN + $order = $service->finalizeOrder($builder); + + // THEN + expect($order)->toBeInstanceOf(Order::class); + }); +}); diff --git a/tests/Unit/Domain/Services/PickupSchedulingServiceTest.php b/tests/Unit/Domain/Services/PickupSchedulingServiceTest.php new file mode 100644 index 00000000..da9b5199 --- /dev/null +++ b/tests/Unit/Domain/Services/PickupSchedulingServiceTest.php @@ -0,0 +1,420 @@ + ['2026-05-11 10:00:00', true], + 'Right on the edge (Monday 14:00)' => ['2026-05-11 14:00:00', true], + 'After limit (Monday 14:01)' => ['2026-05-11 14:01:00', false], +]); + +dataset('example_2_deadlines', [ + 'Before nominal limit (Monday 11:00)' => ['2026-05-04 11:00:00', true], + 'After nominal limit (Monday 15:00)' => ['2026-05-04 15:00:00', false], +]); + +dataset('example_3_deadlines', [ + 'Before limit custom (Wednesday 22:00)' => ['2026-04-29 22:00:00', true], + 'After limit custom (Thursday 00:01)' => ['2026-04-30 00:01:00', false], +]); + +dataset('next_pickup_scenarios', [ + 'Monday 10:00' => ['2026-05-11 10:00:00', '2026-05-15 14:00:00'], + 'Friday 10:00 (Before cutoff hour)' => ['2026-05-15 10:00:00', '2026-05-15 14:00:00'], + 'Friday 15:00 (After cutoff hour)' => ['2026-05-15 15:00:00', '2026-05-22 14:00:00'], +]); + +dataset('current_cutoff_scenarios', [ + 'Monday 10:00' => ['2026-05-11 10:00:00', '2026-05-11 14:00:00'], + 'Tuesday 10:00' => ['2026-05-12 10:00:00', '2026-05-11 14:00:00'], +]); + +describe('Pickup Scheduling Service', function (): void { + + it( + 'can sets Friday\'s visibility based on the standard deadline', + function (string $mockCurrentTime, bool $expectedVisibility): void { + // GIVEN + $now = CarbonImmutable::parse($mockCurrentTime); + $until = $now->addWeeks(2); + $shop = createTestShop(1); + + $service = createServiceWithExceptions($now); + + // WHEN + $results = $service->getTimeSlotsFor($shop, $until); + + // THEN + $targetFriday = '2026-05-15'; + $hasFridaySlot = collect($results) + ->contains(fn (PickupTimeSlot $slot) => Date::createFromInterface($slot->getAt()) + ->isSameDay($targetFriday)); + + // THEN + + expect($hasFridaySlot)->toBe($expectedVisibility); + } + )->with('nominal_deadlines'); + + it('can remove pickup day if its a hollyday without replacement', function (): void { + // GIVEN + $now = CarbonImmutable::parse('2026-05-04 10:00:00'); + $until = $now->addDays(10); + $shop = createTestShop(1); + + $exceptions = [ + createExceptionPivot(date: '2026-05-08', replacementDate: null, orderDeadlineAt: null), + ]; + + $service = createServiceWithExceptions($now, $exceptions); + + // WHEN + $results = $service->getTimeSlotsFor($shop, $until); + + // THEN + expect($results)->toBeEmpty(); + }); + + it( + 'it can replace the holiday pickup day with another day if ordered before the default deadline', + function (string $mockCurrentTime, bool $expectedVisibility): void { + // GIVEN + $now = CarbonImmutable::parse($mockCurrentTime); + $until = $now->addDays(10); + $shop = createTestShop(1); + + $exceptions = [ + createExceptionPivot(date: '2026-05-08', replacementDate: '2026-05-07', orderDeadlineAt: null), + ]; + + $service = createServiceWithExceptions($now, $exceptions); + + // WHEN + $results = $service->getTimeSlotsFor($shop, $until); + + // THEN + $targetReplacementDay = '2026-05-07'; + $hasThursdaySlot = collect($results) + ->contains(fn (PickupTimeSlot $slot) => Date::createFromInterface($slot->getAt()) + ->isSameDay($targetReplacementDay)); + + // THEN + + expect($hasThursdaySlot)->toBe($expectedVisibility); + } + )->with('example_2_deadlines'); + + it( + 'can replace the holiday pickup day with another day if ordered before the custom deadline', + function (string $mockCurrentTime, bool $expectedVisibility): void { + // GIVEN + $now = CarbonImmutable::parse($mockCurrentTime); + $until = $now->addDays(15); + $shop = createTestShop(1); + + $exceptions = [ + createExceptionPivot(date: '2026-05-08', replacementDate: '2026-05-05', orderDeadlineAt: '2026-04-29 23:59:00'), + ]; + + $service = createServiceWithExceptions($now, $exceptions); + + // WHEN + $results = $service->getTimeSlotsFor($shop, $until); + + // THEN + $targetReplacementDay = '2026-05-05'; + $hasTuesdaySlot = collect($results) + ->contains(fn (PickupTimeSlot $slot) => Date::createFromInterface($slot->getAt()) + ->isSameDay($targetReplacementDay)); + + // THEN + + expect($hasTuesdaySlot)->toBe($expectedVisibility); + } + )->with('example_3_deadlines'); + + it('cannot get timeslots except for a futur date', function (): void { + // GIVEN + $now = CarbonImmutable::parse('2026-05-15 12:00:00'); + $pastUntilDate = $now->subDay(); + $shop = createTestShop(1); + + $service = createServiceWithExceptions($now); + + // WHEN + // THEN + expect(fn () => $service->getTimeSlotsFor($shop, $pastUntilDate)) + ->toThrow(\InvalidArgumentException::class, 'Cannot get time slots for past days'); + }); + + it('can return multiple chronological pickup days for a long period', function (): void { + // GIVEN + $now = CarbonImmutable::parse('2026-05-11 10:00:00'); // Monday + $until = $now->addWeeks(3); + $shop = createTestShop(1); + + $service = createServiceWithExceptions($now); + + // WHEN + $results = $service->getTimeSlotsFor($shop, $until); + + // THEN + expect($results)->toHaveCount(3); + // THEN + expect(Date::createFromInterface($results[0]->getAt())->isSameDay('2026-05-15'))->toBeTrue(); + // THEN + expect(Date::createFromInterface($results[1]->getAt())->isSameDay('2026-05-22'))->toBeTrue(); + // THEN + expect(Date::createFromInterface($results[2]->getAt())->isSameDay('2026-05-29'))->toBeTrue(); + }); + + it('ignores pickup exceptions that do not fall on a Friday', function (): void { + // GIVEN + $now = CarbonImmutable::parse('2026-05-11 10:00:00'); // Monday + $until = $now->addDays(10); + $shop = createTestShop(1); + + $exceptions = [ + createExceptionPivot( + date: '2026-05-12', // Friday + replacementDate: '2026-05-14', // Thursday + orderDeadlineAt: null + ), + ]; + + $service = createServiceWithExceptions($now, $exceptions); + + // WHEN + $results = $service->getTimeSlotsFor($shop, $until); + + // THEN + expect($results)->toHaveCount(1); + // THEN + expect(Date::createFromInterface($results[0]->getAt())->isSameDay('2026-05-15'))->toBeTrue(); + }); + + it('excludes the current day if the order is placed on pickup day morning', function (): void { + // GIVEN + $now = CarbonImmutable::parse('2026-05-15 08:00:00'); // Friday + $until = $now->addWeeks(2); + $shop = createTestShop(1); + + $service = createServiceWithExceptions($now); + + // WHEN + $results = $service->getTimeSlotsFor($shop, $until); + + // THEN + $hasTodaySlot = collect($results) + ->contains(fn (PickupTimeSlot $slot) => Date::createFromInterface($slot->getAt()) + ->isSameDay('2026-05-15')); + + // THEN + + expect($hasTodaySlot)->toBeFalse(); + }); + + it('calculates nextPickup correctly depending on current day and time', function (string $mockCurrentTime, string $expectedPickupTime): void { + // GIVEN + $now = CarbonImmutable::parse($mockCurrentTime); + $service = createServiceWithExceptions($now); + + // WHEN + $pickup = $service->nextPickup(); + + // THEN + expect($pickup->format('Y-m-d H:i:s'))->toBe($expectedPickupTime); + })->with('next_pickup_scenarios'); + + it('calculates currentCutoff correctly', function (string $mockCurrentTime, string $expectedCutoffTime): void { + // GIVEN + $now = CarbonImmutable::parse($mockCurrentTime); + $service = createServiceWithExceptions($now); + + // WHEN + $cutoff = $service->currentCutoff(); + + // THEN + expect($cutoff->format('Y-m-d H:i:s'))->toBe($expectedCutoffTime); + })->with('current_cutoff_scenarios'); + + it('returns the pickup day', function (): void { + // GIVEN + $now = CarbonImmutable::parse('2026-05-04 10:00:00'); + $service = createServiceWithExceptions($now); + + // WHEN + $pickupDay = $service->getPickupDay(); + + // THEN + expect($pickupDay->value)->toBe(WeekDay::Friday->value); + }); + + it('gets period from pickup day', function (): void { + // GIVEN + $now = CarbonImmutable::parse('2026-05-04 10:00:00'); // Monday 10:00 + $service = createServiceWithExceptions($now); + // WHEN + $period = $service->getPeriodFromPickUpDay(); + // next pickup is 2026-05-08 14:00:00 + // default deadline is 2026-05-04 14:00:00 + + // THEN + expect($period->getStartDate()->format('Y-m-d H:i:s'))->toBe('2026-05-04 14:00:00') + ->and($period->getEndDate()->format('Y-m-d H:i:s'))->toBe('2026-05-08 23:59:59'); + }); + + it('gets period for pickup date', function (): void { + // GIVEN + $now = CarbonImmutable::parse('2026-05-04 10:00:00'); + $service = createServiceWithExceptions($now); + $pickupDate = CarbonImmutable::parse('2026-05-15 14:00:00'); + // WHEN + $period = $service->getPeriodForPickupDate($pickupDate); + + // THEN + expect($period->getStartDate()->format('Y-m-d H:i:s'))->toBe('2026-05-11 14:00:00') + ->and($period->getEndDate()->format('Y-m-d H:i:s'))->toBe('2026-05-15 23:59:59'); + }); + + it('gets editable pickup exceptions for shop', function (): void { + // GIVEN + $now = CarbonImmutable::parse('2026-05-04 10:00:00'); + + $exception1 = new PickupExceptionOnDate( + id: new PickupExceptionId(Uuid::uuid7()), + date: CarbonImmutable::parse('2026-05-08'), // Friday + label: 'Test 1', + repeatable: false, + repeatFrequency: RepeatFrequency::YEARLY, + autoUpdated: false + ); + + $exception2 = new PickupExceptionOnDate( + id: new PickupExceptionId(Uuid::uuid7()), + date: CarbonImmutable::parse('2026-05-09'), // Saturday + label: 'Test 2', + repeatable: false, + repeatFrequency: RepeatFrequency::YEARLY, + autoUpdated: false + ); + + $shopException = new ShopPickupOverride( + exception: $exception1, + replacementDate: null, + orderDeadlineAt: null + ); + + $repo = \Mockery::mock(PickupExceptionRepository::class); + $repo->shouldReceive('getAllExceptions')->andReturn([$exception1, $exception2]); + $repo->shouldReceive('getExceptionsAssociatedWithShop')->andReturn([$shopException]); + + $service = new class ($repo, $now) extends PickupSchedulingService + { + public function __construct(PickupExceptionRepository $repo, private readonly CarbonImmutable $now) + { + parent::__construct($repo); + } + + protected function getNow(): CarbonImmutable + { + return $this->now; + } + }; + + $shop = createTestShop(1); + // WHEN + $editable = $service->getEditablePickupExceptionsFor($shop); + + // THEN + + expect($editable)->toHaveCount(2); + + // Test 1: is Friday, associated -> checked, replacement null + // THEN + expect($editable[0]->pickupException->id->value)->toBeInstanceOf(UuidInterface::class) + ->and($editable[0]->isPickupDay)->toBeTrue() + ->and($editable[0]->missingSubsitute)->toBeTrue() + ->and($editable[0]->passedDeadline)->toBeFalse(); + + // Test 2: not Friday, not associated + // THEN + expect($editable[1]->pickupException->id->value)->toBeInstanceOf(UuidInterface::class) + ->and($editable[1]->isPickupDay)->toBeFalse() + ->and($editable[1]->missingSubsitute)->toBeFalse() + ->and($editable[1]->passedDeadline)->toBeFalse(); + }); + +}); + +/** + * @param array $exceptions + */ +function createServiceWithExceptions(CarbonImmutable $now, array $exceptions = []): PickupSchedulingService +{ + /** @var \Mockery\MockInterface&\Domain\Ports\Repositories\PickupExceptionRepository $repo */ + $repo = \Mockery::mock(PickupExceptionRepository::class); + $repo->shouldReceive('getExceptionsForShop')->andReturn($exceptions); + + return new class ($repo, $now) extends PickupSchedulingService + { + public function __construct( + PickupExceptionRepository $repo, + private readonly CarbonImmutable $now + ) { + parent::__construct($repo); + } + + #[\Override] + protected function getNow(): CarbonImmutable + { + return $this->now; + } + }; +} + +function createExceptionPivot(string $date, ?string $replacementDate = null, ?string $orderDeadlineAt = null): ShopPickupOverride +{ + static $idCounter = 1; + + $exception = new PickupExceptionOnDate( + id: new PickupExceptionId(Uuid::uuid7()), + date: CarbonImmutable::parse($date), + label: 'Test Exception', + repeatable: false, + repeatFrequency: RepeatFrequency::YEARLY, + autoUpdated: false + ); + + return new ShopPickupOverride( + exception: $exception, + replacementDate: $replacementDate ? CarbonImmutable::parse($replacementDate) : null, + orderDeadlineAt: $orderDeadlineAt ? CarbonImmutable::parse($orderDeadlineAt) : null + ); +} diff --git a/tests/Unit/Domain/Services/RegateServiceTest.php b/tests/Unit/Domain/Services/RegateServiceTest.php new file mode 100644 index 00000000..05c2e485 --- /dev/null +++ b/tests/Unit/Domain/Services/RegateServiceTest.php @@ -0,0 +1,90 @@ +shouldReceive('generate')->once()->with( + Mockery::type('array'), + Mockery::on(function (array $rows) use ($orderReferenceValue): bool { + return count($rows) === 3 + && $rows[0][5] === 'UB' + && $rows[1][5] === 'UEA' + && $rows[2][5] === 'KGM' + && $rows[0][0] === '45' + && $rows[0][7] === '01/01/2025' + && $rows[0][9] === $orderReferenceValue; + }) + )->andReturn('csv_content'); + + $dispatcher->shouldReceive('dispatch')->once()->with(Mockery::on(function (object $event) use ($orderReferenceValue): bool { + return $event instanceof RegateOrderCsvGenerated + && $event->csvContent === 'csv_content' + && str_contains($event->fileName, sprintf('BTQ-%s-', $orderReferenceValue)); + })); + + // WHEN + $service->processOrder($reference, $employeeMatricule, $pickupDay, [$line1, $line2, $line3]); + + // THEN + expect(true)->toBeTrue(); + }); +}); diff --git a/tests/Unit/Domain/Services/ShopperServiceTest.php b/tests/Unit/Domain/Services/ShopperServiceTest.php new file mode 100644 index 00000000..6d1500e5 --- /dev/null +++ b/tests/Unit/Domain/Services/ShopperServiceTest.php @@ -0,0 +1,278 @@ +subDay(), + null, + new ShopperEstablishmentCode('ETAB01'), + new ShopperSiteCode('SITEA'), + new ShopperServiceCode('101') + ); + $shopperRepo->shouldReceive('find')->once()->with($id)->andReturn($shopper); + + // WHEN + $result = $service->getShopperFor($id); + + // THEN + expect($result)->toBe($shopper); + }); + + it('resolves shop for employee based on exception shop', function (): void { + // GIVEN + $shopRepo = Mockery::mock(ShopRepository::class); + $shopperRepo = Mockery::mock(ShopperRepository::class); + $service = new ShopperService($shopRepo, $shopperRepo); + + $shopper = new Shopper( + new ShopperId(Uuid::uuid7()), + new Email('test@test.com'), + new Matricule('1234567'), + 'Nom', + 'Prenom', + CarbonImmutable::now()->subDay(), + null, + new ShopperEstablishmentCode('ETAB01'), + new ShopperSiteCode('SITEA'), + new ShopperServiceCode('101') + ); + + $shop = new Shop( + new ShopId(Uuid::uuid7()), + 'Shop', + 'Addr', + '00000', + 'City' + ); + $shopRepo->shouldReceive('findExceptionShopFor')->once()->with($shopper->matricule)->andReturn($shop); + + // WHEN + $result = $service->resolveShopForEmployee($shopper); + + // THEN + expect($result)->toBe($shop); + }); + + it('resolves shop for employee based on site and service', function (): void { + // GIVEN + $shopRepo = Mockery::mock(ShopRepository::class); + $shopperRepo = Mockery::mock(ShopperRepository::class); + $service = new ShopperService($shopRepo, $shopperRepo); + + $shopper = new Shopper( + isset($id) ? $id : new ShopperId(Uuid::uuid7()), + new Email('test@test.com'), + new Matricule('1234567'), + 'Nom', + 'Prenom', + CarbonImmutable::now()->subDay(), + null, + new ShopperEstablishmentCode('ETAB01'), + new ShopperSiteCode('SITEA'), + new ShopperServiceCode('101') + ); + + $shop = new Shop(new ShopId(Uuid::uuid7()), 'Shop', 'Addr', '00000', 'City'); + $shopRepo->shouldReceive('findExceptionShopFor')->once()->with($shopper->matricule)->andReturn(null); + $shopRepo->shouldReceive('findShopForSiteAndService')->once()->with($shopper->site, $shopper->service)->andReturn($shop); + + // WHEN + $result = $service->resolveShopForEmployee($shopper); + + // THEN + expect($result)->toBe($shop); + }); + + it('resolves shop for employee based on site only', function (): void { + // GIVEN + $shopRepo = Mockery::mock(ShopRepository::class); + $shopperRepo = Mockery::mock(ShopperRepository::class); + $service = new ShopperService($shopRepo, $shopperRepo); + + $shopper = new Shopper( + new ShopperId(Uuid::uuid7()), + new Email('test@test.com'), + new Matricule('1234567'), + 'Nom', + 'Prenom', + CarbonImmutable::now()->subDay(), + null, + new ShopperEstablishmentCode('ETAB01'), + new ShopperSiteCode('SITEA'), + new ShopperServiceCode('101') + ); + + $shop = new Shop(new ShopId(Uuid::uuid7()), 'Shop', 'Addr', '00000', 'City'); + $shopRepo->shouldReceive('findExceptionShopFor')->once()->with($shopper->matricule)->andReturn(null); + $shopRepo->shouldReceive('findShopForSiteAndService')->once()->with($shopper->site, $shopper->service)->andReturn(null); + $shopRepo->shouldReceive('findShopForSiteAndService')->once()->with($shopper->site, null)->andReturn($shop); + + // WHEN + $result = $service->resolveShopForEmployee($shopper); + + // THEN + expect($result)->toBe($shop); + }); + + it('resolves shop for employee using default fallback', function (): void { + // GIVEN + $shopRepo = Mockery::mock(ShopRepository::class); + $shopperRepo = Mockery::mock(ShopperRepository::class); + $service = new ShopperService($shopRepo, $shopperRepo); + + $shopper = new Shopper( + new ShopperId(Uuid::uuid7()), + new Email('test@test.com'), + new Matricule('1234567'), + 'Nom', + 'Prenom', + CarbonImmutable::now()->subDay(), + null, + new ShopperEstablishmentCode('ETAB01'), + new ShopperSiteCode('SITEA'), + new ShopperServiceCode('101') + ); + + $shop = new Shop(new ShopId(Uuid::uuid7()), 'Shop', 'Addr', '00000', 'City'); + $shopRepo->shouldReceive('findExceptionShopFor')->once()->with($shopper->matricule)->andReturn(null); + $shopRepo->shouldReceive('findShopForSiteAndService')->once()->with($shopper->site, $shopper->service)->andReturn(null); + $shopRepo->shouldReceive('findShopForSiteAndService')->once()->with($shopper->site, null)->andReturn(null); + $shopRepo->shouldReceive('getDefaultShop')->once()->andReturn($shop); + + // WHEN + $result = $service->resolveShopForEmployee($shopper); + + // THEN + expect($result)->toBe($shop); + }); + + it('returns null when shopper is not found for id', function (): void { + // GIVEN + $shopRepo = Mockery::mock(ShopRepository::class); + $shopperRepo = Mockery::mock(ShopperRepository::class); + $service = new ShopperService($shopRepo, $shopperRepo); + + $id = new ShopperId(Uuid::uuid7()); + $shopperRepo->shouldReceive('find')->once()->with($id)->andReturn(null); + + // WHEN + $result = $service->getShopFor($id); + + // THEN + expect($result)->toBeNull(); + }); + + it('gets shop when shopper is found for id', function (): void { + // GIVEN + $shopRepo = Mockery::mock(ShopRepository::class); + $shopperRepo = Mockery::mock(ShopperRepository::class); + $service = new ShopperService($shopRepo, $shopperRepo); + + $id = new ShopperId(Uuid::uuid7()); + $shopper = new Shopper( + $id, + new Email('test@test.com'), + new Matricule('1234567'), + 'Nom', + 'Prenom', + CarbonImmutable::now()->subDay(), + null, + new ShopperEstablishmentCode('ETAB01'), + new ShopperSiteCode('SITEA'), + new ShopperServiceCode('101') + ); + + $shop = new Shop( + new ShopId(Uuid::uuid7()), + 'Shop', + 'Addr', + '00000', + 'City' + ); + $shopperRepo->shouldReceive('find')->once()->with($id)->andReturn($shopper); + $shopRepo->shouldReceive('findExceptionShopFor')->once()->with($shopper->matricule)->andReturn($shop); + + // WHEN + $result = $service->getShopFor($id); + + // THEN + expect($result)->toBe($shop); + }); + + it('returns false when customer not found checking app pass orders', function (): void { + // GIVEN + $shopRepo = Mockery::mock(ShopRepository::class); + $shopperRepo = Mockery::mock(ShopperRepository::class); + $service = new ShopperService($shopRepo, $shopperRepo); + + $id = new ShopperId(Uuid::uuid7()); + $shopperRepo->shouldReceive('find')->once()->with($id)->andReturn(null); + + // WHEN + $result = $service->canCustomerPassOrdersApp($id); + + // THEN + expect($result)->toBeFalse(); + }); + + it('returns customer active status for pass orders app', function (): void { + // GIVEN + $shopRepo = Mockery::mock(ShopRepository::class); + $shopperRepo = Mockery::mock(ShopperRepository::class); + $service = new ShopperService($shopRepo, $shopperRepo); + + $id = new ShopperId(Uuid::uuid7()); + $shopper = new Shopper( + $id, + new Email('test@test.com'), + new Matricule('1234567'), + 'Nom', + 'Prenom', + CarbonImmutable::now()->subDay(), + null, + new ShopperEstablishmentCode('ETAB01'), + new ShopperSiteCode('SITEA'), + new ShopperServiceCode('101') + ); + + $shopperRepo->shouldReceive('find')->once()->with($id)->andReturn($shopper); + + // WHEN + $result = $service->canCustomerPassOrdersApp($id); + + // THEN + expect($result)->toBeTrue(); + }); +}); diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php deleted file mode 100644 index 358cfc88..00000000 --- a/tests/Unit/ExampleTest.php +++ /dev/null @@ -1,18 +0,0 @@ -assertTrue(true); - } -} diff --git a/tests/Unit/Infra/Adapters/Events/LaravelDomainEventDispatcherTest.php b/tests/Unit/Infra/Adapters/Events/LaravelDomainEventDispatcherTest.php new file mode 100644 index 00000000..c5c39d29 --- /dev/null +++ b/tests/Unit/Infra/Adapters/Events/LaravelDomainEventDispatcherTest.php @@ -0,0 +1,27 @@ +dispatch($event); + + // THEN + Event::assertDispatched(get_class($event)); + }); +}); diff --git a/tests/Unit/Infra/Adapters/Repositories/SessionBasketRepositoryTest.php b/tests/Unit/Infra/Adapters/Repositories/SessionBasketRepositoryTest.php new file mode 100644 index 00000000..6710ce64 --- /dev/null +++ b/tests/Unit/Infra/Adapters/Repositories/SessionBasketRepositoryTest.php @@ -0,0 +1,122 @@ +shouldReceive('has')->with('basket_key' . $basketId->value->toString())->andReturn(false); + + $serializer = \Mockery::mock(BasketSerializer::class); + + $repo = new SessionBasketRepository($session, 'basket_key', $serializer); + + // WHEN + $basket = $repo->find($basketId); + + // THEN + expect($basket)->toBeNull(); +}); + +it('returns deserialized basket if session has data', function () { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $session = \Mockery::mock(Session::class); + $session->shouldReceive('has')->with('basket_key' . $basketId->value->toString())->andReturn(true); + $session->shouldReceive('get')->with('basket_key' . $basketId->value->toString())->andReturn('{"id":"123"}'); + + $serializer = \Mockery::mock(BasketSerializer::class); + $basket = new Basket($basketId, []); + $serializer->shouldReceive('fromArray')->with(['id' => '123'])->andReturn($basket); + + $repo = new SessionBasketRepository($session, 'basket_key', $serializer); + + // WHEN + $result = $repo->find($basketId); + + // THEN + expect($result)->toBe($basket); +}); + +it('returns null if session data is invalid json', function () { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $session = \Mockery::mock(Session::class); + $session->shouldReceive('has')->with('basket_key' . $basketId->value->toString())->andReturn(true); + $session->shouldReceive('get')->with('basket_key' . $basketId->value->toString())->andReturn('invalid-json'); + + $serializer = \Mockery::mock(BasketSerializer::class); + + $repo = new SessionBasketRepository($session, 'basket_key', $serializer); + + // WHEN + $basket = $repo->find($basketId); + + // THEN + expect($basket)->toBeNull(); +}); + +it('returns null if deserialization throws exception', function () { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $session = \Mockery::mock(Session::class); + $session->shouldReceive('has')->with('basket_key' . $basketId->value->toString())->andReturn(true); + $session->shouldReceive('get')->with('basket_key' . $basketId->value->toString())->andReturn('{"id":"123"}'); + + $serializer = \Mockery::mock(BasketSerializer::class); + $serializer->shouldReceive('fromArray')->andThrow(new \Exception('error')); + + $repo = new SessionBasketRepository($session, 'basket_key', $serializer); + + // WHEN + $basket = $repo->find($basketId); + + // THEN + expect($basket)->toBeNull(); +}); + +it('persists basket to session', function () { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $session = \Mockery::mock(Session::class); + + $serializer = \Mockery::mock(BasketSerializer::class); + $basket = new Basket($basketId, []); + $serializer->shouldReceive('toArray')->with($basket)->andReturn(['id' => '123']); + + $session->shouldReceive('put')->with('basket_key' . $basketId->value->toString(), '{"id":"123"}')->once(); + + $repo = new SessionBasketRepository($session, 'basket_key', $serializer); + + // WHEN + $repo->persist($basket); + + // THEN + // Expectations handled by Mockery counts automatically (the `once()` call above) +}); + +it('deletes basket from session', function () { + // GIVEN + $basketId = new BasketId(Uuid::uuid7()); + $session = \Mockery::mock(Session::class); + $session->shouldReceive('forget')->with('basket_key' . $basketId->value->toString())->once(); + + $serializer = \Mockery::mock(BasketSerializer::class); + + $repo = new SessionBasketRepository($session, 'basket_key', $serializer); + $basket = new Basket($basketId, []); + + // WHEN + $repo->delete($basket); + + // THEN + // Expectations handled by Mockery automatically +}); diff --git a/tests/Unit/Infra/Adapters/Serializers/BasketSerializerTest.php b/tests/Unit/Infra/Adapters/Serializers/BasketSerializerTest.php new file mode 100644 index 00000000..ca9eb2b2 --- /dev/null +++ b/tests/Unit/Infra/Adapters/Serializers/BasketSerializerTest.php @@ -0,0 +1,205 @@ +toRfc4122(); + $productIdStr = \Symfony\Component\Uid\Uuid::v7()->toRfc4122(); + + $basketProduct = new BasketProduct( + id: new ProductId(Uuid::fromString($productIdStr)), + name: 'Product 1', + qty: 2, + unitPriceHt: new Money(1000, new Currency('EUR')), + unitDiscount: new Money(100, new Currency('EUR')), + taxRate: TaxRate::TVA_20, + weightGrams: 500, + brand: ProductBrand::loue, + incoId: new IncoId(12345), + orderUnit: OrderUnit::PCE, + slug: 'product-1', + picture: 'pic.png', + description: 'desc', + weightVariable: true, + discountRate: DiscountRate::fromRatio(0.1), + priceKgTtc: new Money(2000, new Currency('EUR')), + options: ['color' => 'red'] + ); + + $basket = new Basket( + id: new BasketId(Uuid::fromString($basketIdStr)), + items: [$productIdStr => $basketProduct] + ); + + // WHEN + $array = $serializer->toArray($basket); + $array = json_decode(json_encode($array), true); + $deserializedBasket = $serializer->fromArray($array); + + // THEN + expect($array)->toBeArray() + ->and($array['id'])->toBe($basketIdStr) + ->and($array['items'][0]['id'])->toBe($productIdStr) + ->and($array['items'][0]['name'])->toBe('Product 1') + ->and($array['items'][0]['taxRate'])->toBe(TaxRate::TVA_20->value) + ->and($deserializedBasket->id->value->toString())->toBe($basketIdStr) + ->and($deserializedBasket->items())->toHaveCount(1) + ->and($deserializedBasket->items()[$productIdStr]->name)->toBe('Product 1') + ->and($deserializedBasket->items()[$productIdStr]->weightVariable)->toBeTrue() + ->and($deserializedBasket->items()[$productIdStr]->options)->toBe(['color' => 'red']) + ->and($array['items'][0]['discountRateBp'])->toBe(1000) + ->and($deserializedBasket->items()[$productIdStr]->discountRate->basisPoints())->toBe(1000); + }); + + it('hydrates the discount rate from the legacy float ratio stored in older sessions', function (float $legacyRatio, int $expectedBasisPoints) { + // GIVEN + $serializer = new BasketSerializer(); + $productIdStr = \Symfony\Component\Uid\Uuid::v7()->toRfc4122(); + $data = [ + 'id' => \Symfony\Component\Uid\Uuid::v7()->toRfc4122(), + 'items' => [ + [ + 'id' => $productIdStr, + 'name' => 'Test', + 'qty' => 1, + 'unitPriceHt' => ['amount' => 1000, 'currency' => 'EUR'], + 'unitDiscount' => ['amount' => 100, 'currency' => 'EUR'], + 'taxRate' => TaxRate::TVA_20->value, + 'weightGrams' => 500, + 'orderUnit' => OrderUnit::PCE->value, + 'slug' => 'test', + 'weightVariable' => false, + 'discountRate' => $legacyRatio, + 'priceKgTtc' => ['amount' => 2000, 'currency' => 'EUR'], + ], + ], + ]; + + // WHEN + $basket = $serializer->fromArray($data); + + // THEN + expect($basket->items()[$productIdStr]->discountRate->basisPoints())->toBe($expectedBasisPoints); + })->with([ + 'regular ratio' => [0.15, 1500], + 'no discount' => [0.0, 0], + 'out of range value is clamped' => [20.0, 10000], + ]); + + it('throws exception if currency is missing during deserialization', function () { + // GIVEN + $serializer = new BasketSerializer(); + $productIdStr = \Symfony\Component\Uid\Uuid::v7()->toRfc4122(); + $data = [ + 'id' => \Symfony\Component\Uid\Uuid::v7()->toRfc4122(), + 'items' => [ + [ + 'id' => $productIdStr, + 'name' => 'Test', + 'qty' => 1, + 'unitPriceHt' => ['amount' => 1000, 'currency' => ''], + 'unitDiscount' => ['amount' => 100, 'currency' => 'EUR'], + 'taxRate' => TaxRate::TVA_20->value, + 'weightGrams' => 500, + 'orderUnit' => OrderUnit::PCE->value, + 'slug' => 'test', + 'weightVariable' => false, + 'priceKgTtc' => ['amount' => 2000, 'currency' => 'EUR'], + ], + ], + ]; + + // WHEN + $action = fn () => $serializer->fromArray($data); + + // THEN + expect($action)->toThrow( + \DomainException::class, + 'Currency is required for unitPriceHt of item with id ' . $productIdStr + ); + }); + + it('throws exception if currency is missing for unitDiscount', function () { + // GIVEN + $serializer = new BasketSerializer(); + $productIdStr = \Symfony\Component\Uid\Uuid::v7()->toRfc4122(); + $data = [ + 'id' => \Symfony\Component\Uid\Uuid::v7()->toRfc4122(), + 'items' => [ + [ + 'id' => $productIdStr, + 'name' => 'Test', + 'qty' => 1, + 'unitPriceHt' => ['amount' => 1000, 'currency' => 'EUR'], + 'unitDiscount' => ['amount' => 100, 'currency' => ''], + 'taxRate' => TaxRate::TVA_20->value, + 'weightGrams' => 500, + 'orderUnit' => OrderUnit::PCE->value, + 'slug' => 'test', + 'weightVariable' => false, + 'priceKgTtc' => ['amount' => 2000, 'currency' => 'EUR'], + ], + ], + ]; + + // WHEN + $action = fn () => $serializer->fromArray($data); + + // THEN + expect($action)->toThrow( + \DomainException::class, + 'Currency is required for unitDiscount of item with id ' . $productIdStr + ); + }); + + it('throws exception if currency is missing for priceKgTtc', function () { + // GIVEN + $serializer = new BasketSerializer(); + $productIdStr = \Symfony\Component\Uid\Uuid::v7()->toRfc4122(); + $data = [ + 'id' => \Symfony\Component\Uid\Uuid::v7()->toRfc4122(), + 'items' => [ + [ + 'id' => $productIdStr, + 'name' => 'Test', + 'qty' => 1, + 'unitPriceHt' => ['amount' => 1000, 'currency' => 'EUR'], + 'unitDiscount' => ['amount' => 100, 'currency' => 'EUR'], + 'taxRate' => TaxRate::TVA_20->value, + 'weightGrams' => 500, + 'orderUnit' => OrderUnit::PCE->value, + 'slug' => 'test', + 'weightVariable' => false, + 'priceKgTtc' => ['amount' => 2000, 'currency' => ''], + ], + ], + ]; + + // WHEN + $action = fn () => $serializer->fromArray($data); + + // THEN + expect($action)->toThrow( + \DomainException::class, + 'Currency is required for priceKgTtc of item with id ' . $productIdStr + ); + }); +}); diff --git a/tests/Unit/Infra/Adapters/Services/AppAdminAuthServiceTest.php b/tests/Unit/Infra/Adapters/Services/AppAdminAuthServiceTest.php new file mode 100644 index 00000000..a74d6375 --- /dev/null +++ b/tests/Unit/Infra/Adapters/Services/AppAdminAuthServiceTest.php @@ -0,0 +1,121 @@ +shouldReceive('can')->with('create-post', [])->andReturn(true); + $guard->shouldReceive('user')->andReturn($user); + + $service = new AppAdminAuthService($guard); + + // WHEN + $result = $service->canWithUser('create-post'); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns false for abilities if user is null', function () { + // GIVEN + $guard = \Mockery::mock(StatefulGuard::class); + $guard->shouldReceive('user')->andReturn(null); + + $service = new AppAdminAuthService($guard); + + // WHEN + $result = $service->canWithUser('create-post'); + + // THEN + expect($result)->toBeFalse(); + }); + + it('checks if user is logged in', function () { + // GIVEN + $guard = \Mockery::mock(StatefulGuard::class); + $guard->shouldReceive('check')->andReturn(true); + + $service = new AppAdminAuthService($guard); + + // WHEN + $check = $service->check(); + $guest = $service->guest(); + + // THEN + expect($check)->toBeTrue() + ->and($guest)->toBeFalse(); + }); + + it('gets user safely', function () { + // GIVEN + $guard = \Mockery::mock(StatefulGuard::class); + $user = \Mockery::mock(User::class); + $guard->shouldReceive('user')->andReturn($user); + + $service = new AppAdminAuthService($guard); + + // WHEN + $returned = $service->getUser(); + + // THEN + expect($returned)->toBeInstanceOf(User::class) + ->and($returned)->not->toBe($user); // cloned + }); + + it('throws exception when user is not a backend User model', function () { + // GIVEN + $guard = \Mockery::mock(StatefulGuard::class); + $guard->shouldReceive('user')->andReturn(new \stdClass()); + + $service = new AppAdminAuthService($guard); + + // WHEN + $action = fn () => $service->getUser(); + + // THEN + expect($action)->toThrow(\InvalidArgumentException::class, 'Auth service needs a backend guard'); + }); + + it('gets user as mandatory', function () { + // GIVEN + $guard = \Mockery::mock(StatefulGuard::class); + $user = new User(); + $user->id = '123'; + $guard->shouldReceive('user')->andReturn($user); + + $service = new AppAdminAuthService($guard); + + // WHEN + $returned = $service->getUserAsMandatory(); + $id = $service->getMandatoryUserId(); + + // THEN + expect($returned)->toBeInstanceOf(User::class) + ->and($id)->toBe('123'); + }); + + it('throws exception when getting user as mandatory but user is null', function () { + // GIVEN + $guard = \Mockery::mock(StatefulGuard::class); + $guard->shouldReceive('user')->andReturn(null); + + $service = new AppAdminAuthService($guard); + + // WHEN + $action = fn () => $service->getUserAsMandatory(); + + // THEN + expect($action)->toThrow(AuthServiceException::class, 'Authenticated user is required from here'); + }); +}); diff --git a/tests/Unit/Infra/Adapters/Services/AppCustomerAuthServiceTest.php b/tests/Unit/Infra/Adapters/Services/AppCustomerAuthServiceTest.php new file mode 100644 index 00000000..016f247d --- /dev/null +++ b/tests/Unit/Infra/Adapters/Services/AppCustomerAuthServiceTest.php @@ -0,0 +1,404 @@ +shouldReceive('user')->andReturn($customer); + + $service = new AppCustomerAuthService($guard, $crmService, $shopperService); + + // WHEN + $result = $service->canWithCustomer('view-order'); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns false for abilities if customer is null', function (): void { + // GIVEN + $guard = Mockery::mock(StatefulGuard::class); + $crmService = Mockery::mock(CrmService::class); + $shopperService = Mockery::mock(ShopperService::class); + $guard->shouldReceive('user')->andReturn(null); + + $service = new AppCustomerAuthService($guard, $crmService, $shopperService); + + // WHEN + $result = $service->canWithCustomer('view-order'); + + // THEN + expect($result)->toBeFalse(); + }); + + it('logs in customer when active', function (): void { + // GIVEN + $guard = Mockery::mock(StatefulGuard::class); + $crmService = Mockery::mock(CrmService::class); + $shopperService = Mockery::mock(ShopperService::class); + $customer = new Customer(); + $customer->id = (string) Uuid::uuid7(); + + $shopperService->shouldReceive('canCustomerPassOrdersApp')->withAnyArgs()->andReturn(true); + $guard->shouldReceive('login')->with($customer)->once(); + + $service = new AppCustomerAuthService($guard, $crmService, $shopperService); + + // WHEN + $service->logIn($customer); + + // THEN + expect(true)->toBeTrue(); + }); + + it('throws exception if logging in non-authenticatable', function (): void { + // GIVEN + $guard = Mockery::mock(StatefulGuard::class); + $crmService = Mockery::mock(CrmService::class); + $shopperService = Mockery::mock(ShopperService::class); + + $invalidCustomer = new class () implements CustomerDetails + { + }; + + $service = new AppCustomerAuthService($guard, $crmService, $shopperService); + + // WHEN + $action = fn () => $service->logIn($invalidCustomer); + + // THEN + expect($action)->toThrow(\InvalidArgumentException::class, 'Expected an instance of Authenticatable and Customer for logging in'); + }); + + it('logs out', function (): void { + // GIVEN + $guard = Mockery::mock(StatefulGuard::class); + $crmService = Mockery::mock(CrmService::class); + $shopperService = Mockery::mock(ShopperService::class); + $guard->shouldReceive('logout')->once(); + + $service = new AppCustomerAuthService($guard, $crmService, $shopperService); + + // WHEN + $service->logout(); + + // THEN + expect(true)->toBeTrue(); + }); + + it('checks if user is logged in', function (): void { + // GIVEN + $guard = Mockery::mock(StatefulGuard::class); + $crmService = Mockery::mock(CrmService::class); + $shopperService = Mockery::mock(ShopperService::class); + $guard->shouldReceive('check')->andReturn(true); + + $service = new AppCustomerAuthService($guard, $crmService, $shopperService); + + // WHEN + $check = $service->check(); + $guest = $service->guest(); + + // THEN + expect($check)->toBeTrue() + ->and($guest)->toBeFalse(); + }); + + it('gets customer safely', function (): void { + // GIVEN + $guard = Mockery::mock(StatefulGuard::class); + $crmService = Mockery::mock(CrmService::class); + $shopperService = Mockery::mock(ShopperService::class); + $customer = new Customer(); + $guard->shouldReceive('user')->andReturn($customer); + + $service = new AppCustomerAuthService($guard, $crmService, $shopperService); + + // WHEN + $returned = $service->getCustomer(); + + // THEN + expect($returned)->toBeInstanceOf(Customer::class) + ->and($returned)->not->toBe($customer); // Should be a clone + }); + + it('throws exception when customer is not a frontend Customer model', function (): void { + // GIVEN + $guard = Mockery::mock(StatefulGuard::class); + $crmService = Mockery::mock(CrmService::class); + $shopperService = Mockery::mock(ShopperService::class); + + $user = new class () implements Authenticatable + { + public function getAuthIdentifierName() + { + return 'id'; + } + + public function getAuthIdentifier() + { + return 1; + } + + public function getAuthPassword() + { + return 'password'; + } + + public function getAuthPasswordName() + { + return 'password'; + } + + public function getRememberToken() + { + return ''; + } + + public function setRememberToken($value) + { + } + + public function getRememberTokenName() + { + return ''; + } + }; + $guard->shouldReceive('user')->andReturn($user); + + $service = new AppCustomerAuthService($guard, $crmService, $shopperService); + + // WHEN + $action = fn () => $service->getCustomer(); + + // THEN + expect($action)->toThrow(\InvalidArgumentException::class, 'Auth service needs a frontend guard'); + }); + + it('gets customer as mandatory', function (): void { + // GIVEN + $guard = Mockery::mock(StatefulGuard::class); + $crmService = Mockery::mock(CrmService::class); + $shopperService = Mockery::mock(ShopperService::class); + $customer = new Customer(); + $guard->shouldReceive('user')->andReturn($customer); + + $service = new AppCustomerAuthService($guard, $crmService, $shopperService); + + // WHEN + $returned = $service->getCustomerAsMandatory(); + + // THEN + expect($returned)->toBeInstanceOf(Customer::class); + }); + + it('throws exception when getting customer as mandatory but null', function (): void { + // GIVEN + $guard = Mockery::mock(StatefulGuard::class); + $crmService = Mockery::mock(CrmService::class); + $shopperService = Mockery::mock(ShopperService::class); + $guard->shouldReceive('user')->andReturn(null); + + $service = new AppCustomerAuthService($guard, $crmService, $shopperService); + + // WHEN + $action = fn () => $service->getCustomerAsMandatory(); + + // THEN + expect($action)->toThrow(AuthServiceException::class, 'Authenticated user is required from here'); + }); + + it('resets password', function (): void { + // GIVEN + $guard = Mockery::mock(StatefulGuard::class); + $crmService = Mockery::mock(CrmService::class); + $shopperService = Mockery::mock(ShopperService::class); + $customer = new Customer(); + $customer->email = new Email('test@example.com'); + + $crmService->shouldReceive('resetPasswordFor')->with($customer->email, 'newpass')->andReturn(true); + + $service = new AppCustomerAuthService($guard, $crmService, $shopperService); + + // WHEN + $result = $service->resetPasswordFor($customer, 'newpass'); + + // THEN + expect($result)->toBeTrue(); + }); + + it('checks if email is verified', function (): void { + // GIVEN + $guard = Mockery::mock(StatefulGuard::class); + $crmService = Mockery::mock(CrmService::class); + $shopperService = Mockery::mock(ShopperService::class); + $customer = new Customer(); + $hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->hashcode = $hashcode; + + // DO NOT MOCK CrmCustomer + $crmCustomer = new CrmCustomer( + hashcode: $hashcode->value, + email: 'test@example.com', + password: 'password', + firstname: 'John', + lastname: 'Doe', + birthDate: '1990-01-01', + phone: '123456789', + address: '123 Main St', + address2: null, + city: 'Paris', + postcode: '75000', + country: Country::france, + optIn: true, + status: true, + lastConnection: null + ); + + $crmService->shouldReceive('getCustomerFromHashCode')->with($customer->hashcode)->andReturn($crmCustomer); + + $service = new AppCustomerAuthService($guard, $crmService, $shopperService); + + // WHEN + $result = $service->hasVerifiedEmail($customer); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns false for hasVerifiedEmail if crm customer not found', function (): void { + // GIVEN + $guard = Mockery::mock(StatefulGuard::class); + $crmService = Mockery::mock(CrmService::class); + $shopperService = Mockery::mock(ShopperService::class); + $customer = new Customer(); + $hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->hashcode = $hashcode; + + $crmService->shouldReceive('getCustomerFromHashCode')->with($customer->hashcode)->andReturn(null); + + $service = new AppCustomerAuthService($guard, $crmService, $shopperService); + + // WHEN + $result = $service->hasVerifiedEmail($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + it('verifies email successfully', function (): void { + // GIVEN + $guard = Mockery::mock(StatefulGuard::class); + $crmService = Mockery::mock(CrmService::class); + $shopperService = Mockery::mock(ShopperService::class); + $customer = new Customer(); + $hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->hashcode = $hashcode; + + $crmCustomer = new CrmCustomer( + hashcode: $hashcode->value, + email: 'test@example.com', + password: 'password', + firstname: 'John', + lastname: 'Doe', + birthDate: '1990-01-01', + phone: '123456789', + address: '123 Main St', + address2: null, + city: 'Paris', + postcode: '75000', + country: Country::france, + optIn: true, + status: true, + lastConnection: null + ); + + $crmService->shouldReceive('getCustomerFromHashCode')->with($customer->hashcode)->andReturn($crmCustomer); + + $activation = new \stdClass(); + $activation->result = true; + $crmService->shouldReceive('activate')->with($crmCustomer)->andReturn($activation); + + $service = new AppCustomerAuthService($guard, $crmService, $shopperService); + + // WHEN + $result = $service->verifyEmail($customer); + + // THEN + expect($result)->toBeTrue(); + }); + + it('returns false for verifyEmail if crm customer not found', function (): void { + // GIVEN + $guard = Mockery::mock(StatefulGuard::class); + $crmService = Mockery::mock(CrmService::class); + $shopperService = Mockery::mock(ShopperService::class); + $customer = new Customer(); + $hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->hashcode = $hashcode; + + $crmService->shouldReceive('getCustomerFromHashCode')->with($customer->hashcode)->andReturn(null); + + $service = new AppCustomerAuthService($guard, $crmService, $shopperService); + + // WHEN + $result = $service->verifyEmail($customer); + + // THEN + expect($result)->toBeFalse(); + }); + + it('throws CrmServiceException from getCrmCustomerFrom', function (): void { + // GIVEN + $guard = Mockery::mock(StatefulGuard::class); + $crmService = Mockery::mock(CrmService::class); + $shopperService = Mockery::mock(ShopperService::class); + $customer = new Customer(); + $hashcode = new CrmHashcode(Uuid::uuid4()); + $customer->hashcode = $hashcode; + + app()->instance(ExceptionHandler::class, Mockery::mock(ExceptionHandler::class)->shouldIgnoreMissing()); + + $exception = new CrmServiceException('Crm Error'); + $crmService->shouldReceive('getCustomerFromHashCode')->with($customer->hashcode)->andReturn($exception); + + $service = new AppCustomerAuthService($guard, $crmService, $shopperService); + + // WHEN + $action = fn () => $service->hasVerifiedEmail($customer); + + // THEN + expect($action)->toThrow(CrmServiceException::class, 'Crm Error'); + }); +}); diff --git a/tests/Unit/Infra/Adapters/Services/CsvGeneratorImplTest.php b/tests/Unit/Infra/Adapters/Services/CsvGeneratorImplTest.php new file mode 100644 index 00000000..b577f8aa --- /dev/null +++ b/tests/Unit/Infra/Adapters/Services/CsvGeneratorImplTest.php @@ -0,0 +1,24 @@ +generate($header, $rows); + + // THEN + $expected = "id;name\n1;\"John Doe\"\n2;\"Jane Doe\"\n"; + expect($result)->toBe($expected); + }); +}); diff --git a/tests/Unit/Infra/Adapters/Services/LaravelTransactionManagerTest.php b/tests/Unit/Infra/Adapters/Services/LaravelTransactionManagerTest.php new file mode 100644 index 00000000..6f2d055b --- /dev/null +++ b/tests/Unit/Infra/Adapters/Services/LaravelTransactionManagerTest.php @@ -0,0 +1,29 @@ + $expectedResult; + + DB::shouldReceive('transaction') + ->once() + ->andReturnUsing(function ($closure) { + return $closure(); + }); + + // WHEN + $result = $manager->execute($callback); + + // THEN + expect($result)->toBe($expectedResult); + }); +}); diff --git a/tests/Unit/Infra/Adapters/Services/SessionOrderBuilderManagerTest.php b/tests/Unit/Infra/Adapters/Services/SessionOrderBuilderManagerTest.php new file mode 100644 index 00000000..fb790147 --- /dev/null +++ b/tests/Unit/Infra/Adapters/Services/SessionOrderBuilderManagerTest.php @@ -0,0 +1,85 @@ + new SessionOrderBuilderManager($session, ' '); + + // THEN + expect($action)->toThrow(\InvalidArgumentException::class, 'Session key cannot be empty'); +}); + +it('gets order builder from session', function () { + // GIVEN + $session = \Mockery::mock(Session::class); + $builder = \Mockery::mock(OrderBuilder::class); + $session->shouldReceive('get')->with('builder_key')->andReturn($builder); + $repo = new SessionOrderBuilderManager($session, 'builder_key'); + + // WHEN + $result = $repo->get(); + + // THEN + expect($result)->toBe($builder); +}); + +it('returns null if order builder not in session', function () { + // GIVEN + $session = \Mockery::mock(Session::class); + $session->shouldReceive('get')->with('builder_key')->andReturn(null); + $repo = new SessionOrderBuilderManager($session, 'builder_key'); + + // WHEN + $result = $repo->get(); + + // THEN + expect($result)->toBeNull(); +}); + +it('throws exception if invalid session data for order builder', function () { + // GIVEN + $session = \Mockery::mock(Session::class); + $session->shouldReceive('get')->with('builder_key')->andReturn('invalid-data'); + $repo = new SessionOrderBuilderManager($session, 'builder_key'); + + // WHEN + $action = fn () => $repo->get(); + + // THEN + expect($action)->toThrow(\UnexpectedValueException::class, 'Invalid session data for order builder'); +}); + +it('saves order builder to session', function () { + // GIVEN + $session = \Mockery::mock(Session::class); + $builder = \Mockery::mock(OrderBuilder::class); + $session->shouldReceive('put')->with('builder_key', $builder)->once(); + $repo = new SessionOrderBuilderManager($session, 'builder_key'); + + // WHEN + $repo->save($builder); + + // THEN + expect(true)->toBeTrue(); +}); + +it('clears order builder from session', function () { + // GIVEN + $session = \Mockery::mock(Session::class); + $session->shouldReceive('forget')->with('builder_key')->once(); + $repo = new SessionOrderBuilderManager($session, 'builder_key'); + + // WHEN + $repo->clear(); + + // THEN + expect(true)->toBeTrue(); +}); diff --git a/tests/Unit/Services/CrmServiceTest.php b/tests/Unit/Services/CrmServiceTest.php new file mode 100644 index 00000000..b8a1b546 --- /dev/null +++ b/tests/Unit/Services/CrmServiceTest.php @@ -0,0 +1,217 @@ +toString(); + + $libCustomer = new Customer([ + 'hashcode' => $uuid, + 'email' => 'john@example.com', + 'password' => 'Secret123!', + 'firstname' => 'John', + 'lastname' => 'Doe', + 'birth_date' => '1990-01-01', + 'phone' => '0123456789', + 'address' => '123 Main St', + 'address2' => null, + 'city' => 'Paris', + 'postcode' => '75000', + 'country' => EnumsCountry::france, + 'opt_in' => true, + 'status' => true, + 'last_connection' => null, + ]); + + $cacheKey = "crm_customer_hashcode_{$uuid}"; + + $cacheRepository->shouldReceive('remember') + ->once() + ->with($cacheKey, Mockery::any(), Mockery::on(function ($closure) use ($crmApi, $libCustomer, $uuid) { + $crmApi->shouldReceive('getCustomer')->with((string) $uuid)->once()->andReturn($libCustomer); + $result = $closure(); + + return $result instanceof CrmCustomer && $result->hashcode === (string) $uuid; + })) + ->andReturn(new CrmCustomer( + hashcode: (string) $uuid, + email: 'john@example.com', + password: 'Secret123!', + firstname: 'John', + lastname: 'Doe', + birthDate: '1990-01-01', + phone: '0123456789', + address: '123 Main St', + address2: null, + city: 'Paris', + postcode: '75000', + country: Country::france, + optIn: true, + status: true, + lastConnection: null, + )); + + $service = new CrmService($crmApi, $cacheRepository); + $hashcode = new CrmHashcode($uuidObj); + + // WHEN + $firstCall = $service->getCustomerFromHashCode($hashcode); + + // Second call should return from internal memory cache without querying CacheRepository again + $secondCall = $service->getCustomerFromHashCode($hashcode); + + // THEN + expect($firstCall)->toBeInstanceOf(CrmCustomer::class) + ->and($firstCall->hashcode)->toBe($uuid) + ->and($secondCall)->toBe($firstCall); + }); + + it('returns customer from email with sha256 cache key', function (): void { + // GIVEN + $crmApi = Mockery::mock(CrmApiV4::class); + $cacheRepository = Mockery::mock(CacheRepository::class); + + $email = 'test@example.com'; + $cacheKey = 'crm_customer_email_' . hash('sha256', $email); + + $expectedCustomer = new CrmCustomer( + hashcode: (string) Uuid::uuid4(), + email: $email, + password: 'Secret123!', + firstname: 'Jane', + lastname: 'Doe', + birthDate: '1992-05-10', + phone: '0123456789', + address: '456 Side St', + address2: null, + city: 'Lyon', + postcode: '69000', + country: Country::france, + optIn: false, + status: true, + lastConnection: null, + ); + + $cacheRepository->shouldReceive('remember') + ->once() + ->with($cacheKey, Mockery::any(), Mockery::type('Closure')) + ->andReturn($expectedCustomer); + + $service = new CrmService($crmApi, $cacheRepository); + + // WHEN + $result = $service->getCustomerFromEmail($email); + + // THEN + expect($result)->toBeInstanceOf(CrmCustomer::class) + ->and($result->email)->toBe($email); + }); + + it('returns null on modelNotFound ApiErrorException and caches result', function (): void { + // GIVEN + $crmApi = Mockery::mock(CrmApiV4::class); + $cacheRepository = Mockery::mock(CacheRepository::class); + + $uuid = Uuid::uuid4(); + $cacheKey = "crm_customer_hashcode_{$uuid}"; + + $cacheRepository->shouldReceive('remember') + ->once() + ->with($cacheKey, Mockery::any(), Mockery::on(function ($closure) use ($crmApi, $uuid) { + $exception = Mockery::mock(ApiErrorException::class); + $exception->shouldReceive('getApiError')->andReturn(ApiError::modelNotFound); + $crmApi->shouldReceive('getCustomer')->with((string) $uuid)->once()->andThrow($exception); + $res = $closure(); + + return $res === null; + })) + ->andReturnNull(); + + $service = new CrmService($crmApi, $cacheRepository); + + // WHEN + $result = $service->getCustomerFromHashCode(new CrmHashcode($uuid)); + + // THEN + expect($result)->toBeNull(); + }); + + it('invalidates cache on activate', function (): void { + // GIVEN + $crmApi = Mockery::mock(CrmApiV4::class); + $cacheRepository = Mockery::mock(CacheRepository::class); + + $uuid = (string) Uuid::uuid4(); + + $customer = new CrmCustomer( + hashcode: $uuid, + email: 'activate@example.com', + password: 'Secret123!', + firstname: 'John', + lastname: 'Doe', + birthDate: '1990-01-01', + phone: '0123456789', + address: '123 Main St', + address2: null, + city: 'Paris', + postcode: '75000', + country: Country::france, + optIn: true, + status: false, + lastConnection: null, + ); + + $expectedHashKey = "crm_customer_hashcode_{$uuid}"; + $expectedEmailKey = 'crm_customer_email_' . hash('sha256', 'activate@example.com'); + + $cacheRepository->shouldReceive('delete')->with($expectedHashKey)->once(); + $cacheRepository->shouldReceive('delete')->with($expectedEmailKey)->once(); + + $apiInterface = Mockery::mock(ApiInterface::class); + $apiInterface->shouldReceive('call')->once()->andReturn( + new \LDC\LDCCRM\Transport\Response( + ApiStatus::OK, + new Response(200, [], (string) json_encode([ + 'version' => Utils::getPackageInfo()['version'], + 'data' => [], + ])) + ) + ); + $refProp = new \ReflectionProperty(ClientModel::class, 'apiInterface'); + $refProp->setValue(null, $apiInterface); + + $service = new CrmService($crmApi, $cacheRepository); + + // WHEN + $result = $service->activate($customer); + + // THEN + expect($result)->toHaveProperty('result'); + }); +}); diff --git a/tests/Unit/Services/DataTableServiceTest.php b/tests/Unit/Services/DataTableServiceTest.php new file mode 100644 index 00000000..26f6b3b3 --- /dev/null +++ b/tests/Unit/Services/DataTableServiceTest.php @@ -0,0 +1,193 @@ + 'name', + 'sort_way' => 'desc', + ]); + $session = mock(Session::class); + $session->shouldReceive('get')->andReturn(null); + + $service = new DataTableService($request, $session); + + // WHEN + $sort = $service->getSortRequest(); + + // THEN + expect($sort['sort_col'])->toBe('name'); + expect($sort['sort_way'])->toBe(SortDirection::Descending); + }); + + it('falls back to session when sort request input is not provided', function () { + // GIVEN + $request = Request::create('/bo/products', 'GET'); + $session = mock(Session::class); + $session->shouldReceive('get')->with('noroute.sort_col', 'undefined')->andReturn('name'); + $session->shouldReceive('get')->with('noroute.sort_way')->andReturn('asc'); + + $service = new DataTableService($request, $session); + + // WHEN + $sort = $service->getSortRequest(); + + // THEN + expect($sort['sort_col'])->toBe('name'); + expect($sort['sort_way'])->toBe(SortDirection::Ascending); + }); + + it('resets sort session when rst parameter is present', function () { + // GIVEN + $request = Request::create('/bo/products', 'GET', ['rst' => '1']); + $session = mock(Session::class); + $session->shouldReceive('forget')->with([ + 'noroute.sort_col', + 'noroute.sort_way', + 'noroute.sorted', + ])->once(); + $session->shouldReceive('get')->andReturn(null); + + $service = new DataTableService($request, $session); + + // WHEN + $service->resetSortSession('noroute'); + + // THEN + // Mockery verifies on teardown that forget() was called exactly once with the sort keys. + }); + + it('sorts query using cached table column listing', function () { + // GIVEN + $request = Request::create('/bo/products', 'GET', [ + 'sort_col' => 'name', + 'sort_way' => 'asc', + ]); + $session = mock(Session::class); + $session->shouldReceive('get')->andReturn(null); + $session->shouldReceive('put')->times(4); + + Schema::shouldReceive('getColumnListing') + ->once() + ->with('products') + ->andReturn(['id', 'name', 'order', 'created_at']); + + $query = mock(Builder::class); + $query->shouldReceive('orderBy')->once()->with('products.name', 'asc'); + + $query2 = mock(Builder::class); + $query2->shouldReceive('orderBy')->once()->with('products.name', 'asc'); + + $service = new DataTableService($request, $session); + + // WHEN + // First call triggers getColumnListing + $service->sortQuery(Product::class, $query); + + // Second call uses columnsCache without re-calling getColumnListing + $service->sortQuery(Product::class, $query2); + + // THEN + // Mockery verifies on teardown: getColumnListing() once, orderBy() once per query. + }); + + it('sorts by default order column if model has order attribute and no sort column is specified', function () { + // GIVEN + $request = Request::create('/bo/products', 'GET'); + $session = mock(Session::class); + $session->shouldReceive('get')->andReturn(null); + + Schema::shouldReceive('getColumnListing') + ->once() + ->with('products') + ->andReturn(['id', 'name', 'order', 'created_at']); + + $query = mock(Builder::class); + $query->shouldReceive('orderBy')->once()->with('order', 'asc'); + + $service = new DataTableService($request, $session); + + // WHEN + $service->sortQuery(Product::class, $query); + + // THEN + // Mockery verifies on teardown that orderBy('order', 'asc') was called once. + }); + + it('sorts by custom default column and way when no sort column is specified', function () { + // GIVEN + $request = Request::create('/bo/orders', 'GET'); + $session = mock(Session::class); + $session->shouldReceive('get')->andReturn(null); + + Schema::shouldReceive('getColumnListing') + ->once() + ->with('orders') + ->andReturn(['id', 'reference', 'status', 'total']); + + $query = mock(Builder::class); + $query->shouldReceive('orderBy')->once()->with('orders.id', 'desc'); + + $service = new DataTableService($request, $session); + + // WHEN + $service->sortQuery( + Order::class, + $query, + defaultSortCol: 'date', + defaultSortWay: SortDirection::Descending, + columnMap: ['date' => 'id'], + ); + + // THEN + // Mockery verifies on teardown that orderBy('orders.id', 'desc') was called once. + }); + + it('uses columnMap when sorting by an explicit virtual column', function () { + // GIVEN + $request = Request::create('/bo/orders', 'GET', [ + 'sort_col' => 'date', + 'sort_way' => 'asc', + ]); + $session = mock(Session::class); + $session->shouldReceive('get')->andReturn(null); + $session->shouldReceive('put')->twice(); + + Schema::shouldReceive('getColumnListing') + ->once() + ->with('orders') + ->andReturn(['id', 'reference', 'status', 'total']); + + $query = mock(Builder::class); + $query->shouldReceive('orderBy')->once()->with('orders.id', 'asc'); + + $service = new DataTableService($request, $session); + + // WHEN + $service->sortQuery( + Order::class, + $query, + columnMap: ['date' => 'id'], + ); + + // THEN + // Mockery verifies on teardown that orderBy('orders.id', 'asc') was called once. + }); +}); diff --git a/tests/Unit/Services/IcsGeneratorServiceTest.php b/tests/Unit/Services/IcsGeneratorServiceTest.php new file mode 100644 index 00000000..9cfcf290 --- /dev/null +++ b/tests/Unit/Services/IcsGeneratorServiceTest.php @@ -0,0 +1,43 @@ +generate($event); + + // THEN + expect($ics)->toContain('BEGIN:VCALENDAR') + ->toContain('VERSION:2.0') + ->toContain('PRODID:-//La Boutique de Cocotte//NONSGML v1.0//EN') + ->toContain('BEGIN:VEVENT') + ->toContain('UID:test-uid@laboutiquedecocotte.fr') + ->toContain('DTSTAMP:20240101T100000Z') + // 12:00 Europe/Paris in winter is 11:00 UTC + ->toContain('DTSTART:20240101T110000Z') + ->toContain('DTEND:20240101T111500Z') + ->toContain('SUMMARY:Test Event') + ->toContain('DESCRIPTION:This is a test description with a comma\, and a newline\n') + ->toContain('URL:https://laboutiquedecocotte.fr') + ->toContain('END:VEVENT') + ->toContain('END:VCALENDAR'); +}); diff --git a/tests/Unit/Services/StatsServiceTest.php b/tests/Unit/Services/StatsServiceTest.php new file mode 100644 index 00000000..8c5b3dcd --- /dev/null +++ b/tests/Unit/Services/StatsServiceTest.php @@ -0,0 +1,124 @@ +shouldReceive('countActiveEmployeesWithin')->andReturn(100); + $employeeDirectory->shouldReceive('countActiveRegisteredEmployeesWithin')->andReturn(25); + + $service = new StatsService($employeeDirectory, $orderDirectory); + + $start = CarbonImmutable::now()->subDays(10); + $end = CarbonImmutable::now(); + + // WHEN + $rate = $service->getMembershipRate($start, $end); + + // THEN + expect($rate)->toBe(25.0); + }); + + it('returns 0 for membership rate when no active employees', function () { + // GIVEN + $employeeDirectory = mock(EmployeeDirectory::class); + $orderDirectory = mock(OrderDirectory::class); + + $employeeDirectory->shouldReceive('countActiveEmployeesWithin')->andReturn(0); + $employeeDirectory->shouldReceive('countActiveRegisteredEmployeesWithin')->andReturn(0); + + $service = new StatsService($employeeDirectory, $orderDirectory); + + $start = CarbonImmutable::now()->subDays(10); + $end = CarbonImmutable::now(); + + // WHEN + $rate = $service->getMembershipRate($start, $end); + + // THEN + expect($rate)->toBe(0.0); + }); + + it('calculates membership percentage correctly', function () { + // GIVEN + $employeeDirectory = mock(EmployeeDirectory::class); + $orderDirectory = mock(OrderDirectory::class); + + $employeeDirectory->shouldReceive('countActiveEmployees')->andReturn(200); + $employeeDirectory->shouldReceive('countActiveRegisteredEmployees')->andReturn(150); + + $service = new StatsService($employeeDirectory, $orderDirectory); + + // WHEN + $percentage = $service->getMembershipPercentage(); + + // THEN + expect($percentage)->toBe(75.0); + }); + + it('returns 0 for membership percentage when no active employees', function () { + // GIVEN + $employeeDirectory = mock(EmployeeDirectory::class); + $orderDirectory = mock(OrderDirectory::class); + + $employeeDirectory->shouldReceive('countActiveEmployees')->andReturn(0); + $employeeDirectory->shouldReceive('countActiveRegisteredEmployees')->andReturn(0); + + $service = new StatsService($employeeDirectory, $orderDirectory); + + // WHEN + $percentage = $service->getMembershipPercentage(); + + // THEN + expect($percentage)->toBe(0.0); + }); + + it('gets the previous period', function () { + // GIVEN + $employeeDirectory = mock(EmployeeDirectory::class); + $orderDirectory = mock(OrderDirectory::class); + + $service = new StatsService($employeeDirectory, $orderDirectory); + + $start = CarbonImmutable::now()->subDays(10); + $end = CarbonImmutable::now(); + + // WHEN + $previousPeriod = $service->getPreviousPeriod($start, $end); + + // THEN + expect($previousPeriod->getStartDate()->toDateString())->toBe($start->copy()->subDays(11)->toDateString()); + expect($previousPeriod->getIncludedEndDate()->toDateString())->toBe($start->copy()->subDays(1)->toDateString()); + }); + + it('calculates nbSalarie stat correctly', function () { + // GIVEN + $employeeDirectory = mock(EmployeeDirectory::class); + $orderDirectory = mock(OrderDirectory::class); + + $employeeDirectory->shouldReceive('countActiveEmployeesWithin')->andReturnValues([50, 100]); // previous, current + + $service = new StatsService($employeeDirectory, $orderDirectory); + + $start = CarbonImmutable::now()->subDays(10); + $end = CarbonImmutable::now(); + + // WHEN + $stats = $service->getStats([StatsCustomerType::nbSalarie], $start, $end); + + // THEN + expect($stats[StatsCustomerType::nbSalarie->value]['previous'])->toBe(50); + expect($stats[StatsCustomerType::nbSalarie->value]['current'])->toBe(100); + expect($stats[StatsCustomerType::nbSalarie->value]['diff'])->toBe(50); + }); +}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..8c29bae0 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,39 @@ +{ + "extends": "@vue/tsconfig/tsconfig.dom.json", + "sourceMap": true, + "compilerOptions": { + "paths": { + "@/*": [ + "./resources/assets/*" + ], + "@bo/*": [ + "./resources/ts/bo/*" + ], + "@fo/*": [ + "./resources/ts/fo/*" + ], + "@modules/*": [ + "./resources/ts/modules/*" + ], + "@defs/*": [ + "./resources/ts/types/*" + ], + "@utilities/*": [ + "./resources/ts/utilities/*" + ] + }, + "typeRoots": [ + "./node_modules/@types", + "./node_modules/vuex/types", + "./resources/ts/", + ] + }, + "include": [ + "./resources/**/*.js", + "./resources/**/*.ts", + "./resources/**/*.vue" + ], + "exclude": [ + "./node_modules" + ] +} diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 00000000..de0310d8 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,176 @@ +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +import basicSsl from "@vitejs/plugin-basic-ssl"; +import vue from "@vitejs/plugin-vue"; +import autoprefixer from "autoprefixer"; +import laravel from "laravel-vite-plugin"; +import postcssDiscard from "postcss-discard-comments"; +import { defineConfig, loadEnv } from "vite"; +import { checker } from "vite-plugin-checker"; +import eslint from "vite-plugin-eslint2"; +import { viteStaticCopy } from "vite-plugin-static-copy"; + +const env = loadEnv("r", process.cwd(), ""); + +const isCI = !!process.env.CI; +const debugMode = ["local", "development"].includes(process.env.NODE_ENV ?? ""); +const browserTargets = ["es2019", "edge92", "firefox88", "chrome92", "safari15"]; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +export default defineConfig({ + build: { + chunkSizeWarningLimit: 1500, + target: browserTargets, + rollupOptions: { + output: { + entryFileNames: `assets/${ + debugMode ? "[name]-" : "" + }[hash].js`, + chunkFileNames: `assets/${ + debugMode ? "[name]-" : "" + }[hash].js`, + manualChunks(id) { + if (id.includes("node_modules")) { + // ! Isole Bootstrap + if (id.includes("bootstrap")) { + return "vendor-bootstrap"; + } + // ! Isole Vue + if (id.includes("vue")) { + return "vendor-vue"; + } + // ! Isole FontAwesome + if (id.includes("@fortawesome")) { + return "vendor-fontawesome"; + } + // ! Isole Leaflet + if (id.includes("leaflet")) { + return "vendor-leaflet"; + } + + // ! Isole Ckeditor + if (id.includes("ckeditor")) { + return "vendor-ckeditor"; + } + + // ! Le reste des node_modules dans un fichier vendor global + return "vendor"; + } + }, + assetFileNames: (chunk) => { + if ( + Array.isArray(chunk.names) && + (chunk.names.some(name => String(name).endsWith("mail-theme.scss")) || + chunk.names.includes("mail-theme.css")) + ) { + return "vendor/mail/html/themes/default.[ext]"; + } + return `assets/${debugMode ? "[name]-" : "" + }[hash].[ext]`; + }, + }, + }, + emptyOutDir: true, + sourcemap: debugMode ? "inline" : false, + cssTarget: browserTargets, + }, + css: { + preprocessorOptions: {scss: {silenceDeprecations: ["color-functions", "global-builtin", "import", "if-function"]},}, + devSourcemap: debugMode, + postcss: { + map: {inline: true,}, + plugins: [ + { + // Hack pour dégager les code css invalid de cookie notice + postcssPlugin: "remove-empty-var", + Declaration(decl) { + if (decl?.value.includes("var()")) { + decl.remove(); + } + } + }, + postcssDiscard({removeAll: true,}), + autoprefixer(), + ], + }, + }, + plugins: [ + basicSsl(), + ...(isCI ? [] : [checker({ + vueTsc: { root: ".", tsconfigPath: "tsconfig.json" }, + typescript: { root: ".", tsconfigPath: "tsconfig.json" }, + stylelint: {lintCommand: "stylelint --quiet -c .stylelintrc.json --fix **/resources/**/*.scss",}, + })]), + laravel({ + input: [ + "resources/sass/bo/bo.scss", + "resources/ts/bo/bo.ts", + "resources/sass/fo/fo.scss", + "resources/ts/fo/fo.ts", + ], + refresh: !isCI, + }), + viteStaticCopy({ + targets: [ + // Favicons + { + src: "resources/favicon/*", + dest: "..", + rename: { stripBase: true }, + }, + ], + }), + eslint({ + cache: false, + include: "**/*.ts", + exclude: ["node_modules", "vendor"], + lintOnStart: false, + emitWarning: true, + emitError: true, + }), + vue({ + isProduction: !debugMode, + exclude: ["node_modules", "vendor"], + }) + ], + server: { + host: env["APP_URL"] ? new URL(env["APP_URL"]).hostname : "", + port: 4443, + watch: {usePolling: true,}, + }, + resolve: { + extensions: ["*", ".js", ".ts", ".vue"], + alias: [ + { + find: "vue", + replacement: "vue/dist/vue.runtime.esm-bundler.js", + }, + { + find: "@", + replacement: "/resources/assets", + }, + { + find: "@bo", + replacement: path.resolve(__dirname, "./resources/ts/bo"), + }, + { + find: "@fo", + replacement: path.resolve(__dirname, "./resources/ts/fo"), + }, + { + find: "@modules", + replacement: path.resolve(__dirname, "./resources/ts/modules"), + }, + { + find: "@defs", + replacement: path.resolve(__dirname, "./resources/ts/types"), + }, + { + find: "@utilities", + replacement: path.resolve(__dirname, "./resources/ts/utilities"), + }, + ], + }, +}); diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 00000000..ceeb4484 --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,43 @@ +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +import { defineConfig } from "vitest/config"; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +export default defineConfig({ + resolve: { + alias: { + "@": path.resolve(__dirname, "./resources/assets"), + "@bo": path.resolve(__dirname, "./resources/ts/bo"), + "@fo": path.resolve(__dirname, "./resources/ts/fo"), + "@modules": path.resolve(__dirname, "./resources/ts/modules"), + "@defs": path.resolve(__dirname, "./resources/ts/types"), + "@utilities": path.resolve(__dirname, "./resources/ts/utilities"), + }, + }, + test: { + reporters: process.env.CI ? ["default", "junit"] : ["default"], + outputFile: process.env.CI ? { junit: "coverage/junit-vitest.xml" } : undefined, + include: ["resources/ts/**/*.test.ts"], + globals: false, + environment: "node", + coverage: { + provider: "v8", + reportsDirectory: "coverage/frontend", + reporter: ["text", "lcov", "html"], + include: [ + "resources/ts/**/*.ts", + ], + exclude: [ + "resources/ts/**/*.test.ts", + "resources/ts/**/*.d.ts", + "resources/ts/bo/bo.ts", + "resources/ts/fo/fo.ts", + "resources/ts/**/utilities/bootstrap.ts", + "resources/ts/**/utilities/fontawesome.ts", + "resources/ts/types/**/*.ts", + ], + }, + }, +}); diff --git a/webpack.mix.js b/webpack.mix.js deleted file mode 100644 index e08e03fd..00000000 --- a/webpack.mix.js +++ /dev/null @@ -1,40 +0,0 @@ -const mix = require('laravel-mix'); - -/* - |-------------------------------------------------------------------------- - | Mix Asset Management - |-------------------------------------------------------------------------- - | - | Mix provides a clean, fluent API for defining some Webpack build steps - | for your Laravel applications. By default, we are compiling the CSS - | file for the application as well as bundling up all the JS files. - | - */ - -mix.options({ - postCss: [ - require('postcss-discard-comments')({ - removeAll: true - }) - ] -}); - -mix.js("resources/js/app.js", "public/b-o/js") - .vue({ version: 2 }) - .sass("resources/sass/app.scss", "public/b-o/css") - .copy( - "node_modules/@fortawesome/fontawesome-free/webfonts", - "public/webfonts" - ); - -//add front theme mix -mix.js('resources/views/front/sable/js/app.js', 'public/sable/js') - .sass('resources/views/front/sable/sass/app.scss', 'public/sable/css') - .options({ - processCssUrls: false - }) - .version(); - - -mix.copyDirectory('resources/views/front/sable/img', 'public/sable/img/') - .copyDirectory('resources/views/front/sable/fonts', 'public/sable/fonts/');