Compare commits
18 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73eeec3e75 | ||
|
|
1f34c77256 | ||
|
|
aca7083436 | ||
|
|
ecbf1a8837 | ||
|
|
0d61ee8295 | ||
|
|
00865f4eff | ||
|
|
f01db43447 | ||
|
|
05de5830f8 | ||
|
|
765f9a06df | ||
|
|
a57525226f | ||
|
|
b6d081ec26 | ||
|
|
993d1358a6 | ||
|
|
f37200aedf | ||
|
|
785a6db60f | ||
|
|
d6b3cb767e | ||
|
|
7d768bda93 | ||
|
|
c346fb350b | ||
|
|
aa4de0d001 |
3755 changed files with 153058 additions and 433226 deletions
|
|
@ -1,13 +0,0 @@
|
||||||
# Browsers that we support
|
|
||||||
|
|
||||||
# https://github.com/browserslist/browserslist#readme
|
|
||||||
|
|
||||||
>= 0.5%
|
|
||||||
last 2 major versions
|
|
||||||
not dead
|
|
||||||
Chrome >= 60
|
|
||||||
Firefox >= 60
|
|
||||||
Firefox ESR
|
|
||||||
iOS >= 12
|
|
||||||
Safari >= 12
|
|
||||||
not Explorer <= 11
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
.git
|
|
||||||
*.md
|
|
||||||
node_modules/
|
|
||||||
npm-debug.log
|
|
||||||
.npmrc
|
|
||||||
tests/
|
|
||||||
Dockerfile*
|
|
||||||
.dockerignore
|
|
||||||
.git
|
|
||||||
.gitignore
|
|
||||||
README.md
|
|
||||||
LICENSE
|
|
||||||
.vscode
|
|
||||||
vendor/
|
|
||||||
public/build/
|
|
||||||
auth.json
|
|
||||||
|
|
@ -3,9 +3,9 @@ root = true
|
||||||
[*]
|
[*]
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
indent_size = 4
|
|
||||||
indent_style = space
|
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
[*.md]
|
[*.md]
|
||||||
|
|
@ -13,9 +13,3 @@ trim_trailing_whitespace = false
|
||||||
|
|
||||||
[*.{yml,yaml}]
|
[*.{yml,yaml}]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
[docker-compose.yml]
|
|
||||||
indent_size = 4
|
|
||||||
|
|
||||||
[*.vue]
|
|
||||||
indent_size = 2
|
|
||||||
|
|
|
||||||
147
.env.example
147
.env.example
|
|
@ -1,113 +1,100 @@
|
||||||
APP_NAME=Laravel
|
### APPLICATION
|
||||||
APP_ENV=local
|
APP_NAME="Le Gaulois"
|
||||||
APP_KEY=
|
APP_KEY=
|
||||||
|
APP_ENV=local
|
||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
APP_URL=http://localhost
|
APP_URL=
|
||||||
|
|
||||||
|
## LOG LEVEL
|
||||||
LOG_CHANNEL=stack
|
LOG_CHANNEL=stack
|
||||||
LOG_DEPRECATIONS_CHANNEL=null
|
|
||||||
LOG_LEVEL=debug
|
|
||||||
|
|
||||||
|
## DATABASE
|
||||||
DB_CONNECTION=mysql
|
DB_CONNECTION=mysql
|
||||||
DB_HOST=127.0.0.1
|
DB_HOST=127.0.0.1
|
||||||
DB_PORT=3306
|
DB_PORT=3306
|
||||||
DB_DATABASE=laravel
|
DB_DATABASE=
|
||||||
DB_USERNAME=root
|
DB_USERNAME=
|
||||||
DB_PASSWORD=
|
DB_PASSWORD=
|
||||||
|
|
||||||
|
## DATABASE MIGRATION
|
||||||
|
DB_DATABASE_2016=legaulois2016
|
||||||
|
DB_USERNAME_2016=
|
||||||
|
DB_PASSWORD_2016=
|
||||||
|
|
||||||
|
## DATABASE OPINSTA
|
||||||
|
DB_DATABASE_OPINSTA=
|
||||||
|
DB_USERNAME_OPINSTA=
|
||||||
|
DB_PASSWORD_OPINSTA=
|
||||||
|
DB_HOST_OPINSTA=
|
||||||
|
DB_PORT_OPINSTA=
|
||||||
|
|
||||||
|
## MIGRATION
|
||||||
|
MIGRATIONPAGINATION=20000
|
||||||
|
|
||||||
|
## OTHERS
|
||||||
BROADCAST_DRIVER=log
|
BROADCAST_DRIVER=log
|
||||||
CACHE_DRIVER=file
|
CACHE_DRIVER=file
|
||||||
FILESYSTEM_DISK=local
|
QUEUE_CONNECTION=database
|
||||||
QUEUE_CONNECTION=sync
|
|
||||||
SESSION_DRIVER=file
|
SESSION_DRIVER=file
|
||||||
SESSION_LIFETIME=120
|
SESSION_LIFETIME=120
|
||||||
|
|
||||||
MEMCACHED_HOST=127.0.0.1
|
## MAIL
|
||||||
|
|
||||||
MAIL_MAILER=smtp
|
MAIL_MAILER=smtp
|
||||||
MAIL_HOST=mailpit
|
MAIL_HOST=
|
||||||
MAIL_PORT=1025
|
MAIL_PORT=
|
||||||
MAIL_USERNAME=null
|
MAIL_USERNAME=
|
||||||
MAIL_PASSWORD=null
|
MAIL_PASSWORD=
|
||||||
MAIL_ENCRYPTION=null
|
MAIL_ENCRYPTION=
|
||||||
MAIL_FROM_ADDRESS="hello@example.com"
|
MAIL_FROM_ADDRESS=no-reply@legaulois.fr
|
||||||
MAIL_FROM_NAME="${APP_NAME}"
|
MAIL_FROM_NAME="Contact Le Gaulois (legaulois.fr)"
|
||||||
MAIL_LIST_CONTACT=
|
|
||||||
MAIL_LIST_PASSERELLE=
|
## MAIL ADDRESSES
|
||||||
MAIL_LIST_NL=
|
MAIL_LIST_CONTACT=contact@legaulois.fr
|
||||||
MAIL_MKT_JEUX=
|
MAIL_LIST_PASSERELLE=passerelle.ldc@ldc.fr
|
||||||
|
|
||||||
# Sentry
|
# Sentry
|
||||||
SENTRY_LARAVEL_DSN=
|
SENTRY_LARAVEL_DSN=
|
||||||
|
|
||||||
# CRM
|
## ARCHADIA
|
||||||
|
BOUTIQUE_ARCHADIA_OP_CODE=16
|
||||||
|
|
||||||
|
## CRM
|
||||||
CRM_ENDPOINT=
|
CRM_ENDPOINT=
|
||||||
CRM_TOKEN=
|
CRM_API_TOKEN=
|
||||||
CRM_PASSWORD=
|
|
||||||
CRM_QUESTION_ID=
|
|
||||||
# - JSON ONLY (like this: {"subject1":44,"subject2":55,"subject3":66})
|
|
||||||
CRM_SUBJECTS=
|
|
||||||
|
|
||||||
# DIGITAL RECRUITER
|
## MES BR
|
||||||
DIGITAL_RECRUITER_URL=
|
|
||||||
|
|
||||||
# UWIL ADMIN SECURE
|
|
||||||
# - LIST SEPARATED WITH ',' (Required)
|
|
||||||
UWIL_ADMIN_SECURE_CIDR_LIST=""
|
|
||||||
# - LIST SEPARATED WITH ',' (Optional)
|
|
||||||
UWIL_ADMIN_SECURE_CIDR_PROJECT_ALLOWED_LIST=""
|
|
||||||
|
|
||||||
#MESBR
|
|
||||||
MESBR_REF_SITE=
|
|
||||||
MESBR_REF_CAMP=
|
|
||||||
MESBR_ENDPOINT=
|
MESBR_ENDPOINT=
|
||||||
|
MESBR_REF_CAMP=
|
||||||
|
|
||||||
# SAML
|
## OP BR CHARCUT
|
||||||
SAML2_DEFAULT_TENANT_UUID=
|
MESBR_REF_SITE_CHARCUT=
|
||||||
SAML2_SP_CERT_x509=
|
MESBR_REF_CAMP_CHARCUT=
|
||||||
SAML2_SP_CERT_PRIVATEKEY=
|
MESBR_COUPON_1_CHARCUT=""
|
||||||
SAML2_CONTACT_TECHNICAL_EMAIL=
|
MESBR_COUPON_2_CHARCUT=""
|
||||||
SAML2_CONTACT_SUPPORT_EMAIL=
|
MESBR_COUPON_3_CHARCUT=""
|
||||||
|
|
||||||
# RECAPTCHA
|
## GOOGLE
|
||||||
|
ANALYTICS_GOOGLE_ID=
|
||||||
|
GOOGLE_MAP_API_KEY=
|
||||||
|
|
||||||
|
# Google Recaptcha
|
||||||
GOOGLE_RECAPTCHA_PUBLIC=
|
GOOGLE_RECAPTCHA_PUBLIC=
|
||||||
GOOGLE_RECAPTCHA_PRIVATE=
|
GOOGLE_RECAPTCHA_PRIVATE=
|
||||||
GOOGLE_RECAPTCHA_VERSION=
|
GOOGLE_RECAPTCHA_VERSION=
|
||||||
|
|
||||||
## TELESCOPE
|
# Matomo
|
||||||
TELESCOPE_ENABLED=
|
|
||||||
|
|
||||||
# MATOMO
|
|
||||||
MATOMO_SITE_ID=
|
MATOMO_SITE_ID=
|
||||||
|
|
||||||
# MEILISEARCH
|
## MERCANET
|
||||||
MEILISEARCH_HOST=
|
MERCANET_SECRET=
|
||||||
MEILISEARCH_KEY=
|
MERCANET_MERCHAND_ID=
|
||||||
|
MERCANET_ENV=
|
||||||
|
|
||||||
# LARAVEL SCOUT
|
# BYPASS THE CRM JUST LOGIN (needs debug mode)
|
||||||
SCOUT_PREFIX=''
|
NOCRM=false
|
||||||
SCOUT_QUEUE=
|
|
||||||
|
|
||||||
# REDIS
|
#OP INSTA
|
||||||
REDIS_HOST=
|
## Démarre le à d-m-YYYY
|
||||||
REDIS_PORT=
|
OPINSTA_START=
|
||||||
REDIS_USERNAME=
|
## Fin le à d-m-YYYY
|
||||||
REDIS_PASSWORD=
|
OPINSTA_END=
|
||||||
REDIS_PREFIX=
|
|
||||||
REDIS_SCHEME=
|
|
||||||
|
|
||||||
## AXEPTA
|
|
||||||
AXEPTA_ENDPOINT=
|
|
||||||
AXEPTA_MERCHANT_ID=
|
|
||||||
AXEPTA_APIKEY=
|
|
||||||
AXEPTA_HMAC=
|
|
||||||
|
|
||||||
# GOLDEN CRUSH (ex : 2026-05-24)
|
|
||||||
GOLDEN_GAME_START=2026-06-01
|
|
||||||
GOLDEN_VOTE_START_AT=2026-06-16
|
|
||||||
GOLDEN_VOTE_END_AT=2026-07-01
|
|
||||||
GOLDEN_END_PARTICIPATION_END_AT=2026-07-02
|
|
||||||
GOLDEN_END_GAME_END_AT=2026-07-17
|
|
||||||
|
|
||||||
# MJML
|
|
||||||
MJML_BINARY_PATH=/app/srcs/node_modules/.bin/mjml
|
|
||||||
|
|
|
||||||
14
.gitattributes
vendored
14
.gitattributes
vendored
|
|
@ -1,11 +1,5 @@
|
||||||
* text=auto eol=lf
|
* text=auto
|
||||||
|
*.css linguist-vendored
|
||||||
*.blade.php diff=html
|
*.scss linguist-vendored
|
||||||
*.css diff=css
|
*.js linguist-vendored
|
||||||
*.html diff=html
|
|
||||||
*.md diff=markdown
|
|
||||||
*.php diff=php
|
|
||||||
|
|
||||||
/.github export-ignore
|
|
||||||
CHANGELOG.md export-ignore
|
CHANGELOG.md export-ignore
|
||||||
.styleci.yml export-ignore
|
|
||||||
|
|
|
||||||
84
.gitignore
vendored
84
.gitignore
vendored
|
|
@ -1,66 +1,32 @@
|
||||||
|
/node_modules
|
||||||
|
/public/hot
|
||||||
|
/public/storage/*
|
||||||
|
/public/images/*
|
||||||
|
/public/js/*
|
||||||
|
/public/css/*
|
||||||
|
/public/fonts/*
|
||||||
|
/public/uploads/*
|
||||||
|
/public/assets/*
|
||||||
|
/public/cache/*
|
||||||
|
/public/storage
|
||||||
|
/public/sitemap.xml
|
||||||
|
/storage/*.key
|
||||||
|
/storage/inco/*.*
|
||||||
|
/storage/eleveur/*.*
|
||||||
|
/storage/app/public/*.*
|
||||||
|
/storage/debugbar
|
||||||
|
/vendor
|
||||||
.env
|
.env
|
||||||
.env.backup
|
.env.backup
|
||||||
.env.testing
|
|
||||||
.env.production
|
|
||||||
.phpunit.result.cache
|
.phpunit.result.cache
|
||||||
.stylelintcache
|
|
||||||
/.fleet
|
|
||||||
/.idea
|
|
||||||
/.phpunit.cache
|
|
||||||
/.vscode
|
|
||||||
/node_modules
|
|
||||||
/bootstrap
|
|
||||||
/public/build
|
|
||||||
/public/cache
|
|
||||||
/public/hot
|
|
||||||
/public/sitemap.xml
|
|
||||||
/public/storage
|
|
||||||
/storage/*.key
|
|
||||||
/vendor
|
|
||||||
auth.json
|
|
||||||
docker-compose.override.yml
|
|
||||||
Homestead.json
|
Homestead.json
|
||||||
Homestead.yaml
|
Homestead.yaml
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
.npmrc
|
.idea/
|
||||||
/tests/coverage
|
.vscode/
|
||||||
.zshrc
|
mix-manifest.json
|
||||||
.npm/
|
workspace.code-workspace
|
||||||
.composer/
|
storage/crm_migration.csv
|
||||||
|
auth.json
|
||||||
# Ignore public favicon
|
.npmrc
|
||||||
/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
|
|
||||||
|
|
||||||
# Ignore Storage Arcadia (orders)
|
|
||||||
storage/arcadia
|
|
||||||
|
|
||||||
# Ignore Storage Inco (images)
|
|
||||||
storage/inco
|
|
||||||
|
|
||||||
# Ignore Storage tracabilite (eleveurs, lots, miseenplace)
|
|
||||||
storage/tracabilite
|
|
||||||
|
|
||||||
# For new LG version ignore old assets
|
|
||||||
oldAssets
|
|
||||||
|
|
||||||
/public/*
|
|
||||||
!/public/newsletters/
|
|
||||||
!/public/tdf-downloads
|
|
||||||
|
|
||||||
# Folders from new VMs
|
|
||||||
/.npm
|
|
||||||
/.composer
|
|
||||||
psysh_history
|
|
||||||
.zshrc
|
|
||||||
.viminfo
|
|
||||||
|
|
@ -1,23 +1,11 @@
|
||||||
include:
|
include:
|
||||||
- project: "ldc-web/shared-ci"
|
- project: 'ldc-web/shared-ci'
|
||||||
ref: "main"
|
ref: 'main'
|
||||||
file: "lint/lint.yml"
|
file: 'lint/lint7.3.yml'
|
||||||
- project: "ldc-web/shared-ci"
|
- project: 'ldc-web/shared-ci'
|
||||||
ref: "main"
|
ref: 'main'
|
||||||
file: "security/security.yml"
|
file: 'security/security7.3.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"
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- lint
|
- lint
|
||||||
- security
|
- security
|
||||||
- build
|
|
||||||
- test
|
|
||||||
- deploy
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
npx commitlint --config node_modules/@uwil/husky-config/commitlint.config.js --edit $1
|
|
||||||
13
.styleci.yml
Normal file
13
.styleci.yml
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
php:
|
||||||
|
preset: laravel
|
||||||
|
disabled:
|
||||||
|
- unused_use
|
||||||
|
finder:
|
||||||
|
not-name:
|
||||||
|
- index.php
|
||||||
|
- server.php
|
||||||
|
js:
|
||||||
|
finder:
|
||||||
|
not-name:
|
||||||
|
- webpack.mix.js
|
||||||
|
css: true
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
{
|
|
||||||
"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,
|
|
||||||
"declaration-colon-newline-after": null,
|
|
||||||
"value-list-comma-newline-after": null,
|
|
||||||
"scss/double-slash-comment-empty-line-before": [
|
|
||||||
"always",
|
|
||||||
{
|
|
||||||
"ignore": [
|
|
||||||
"between-comments",
|
|
||||||
"stylelint-commands",
|
|
||||||
"inside-block"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
17
.vscode/settings.json
vendored
17
.vscode/settings.json
vendored
|
|
@ -1,33 +1,24 @@
|
||||||
{
|
{
|
||||||
"phpcs.executablePath": "vendor/bin/phpcs",
|
"phpcs.executablePath": "vendor/bin/phpcs",
|
||||||
"workbench.colorCustomizations": {
|
"workbench.colorCustomizations": {
|
||||||
"activityBar.activeBorder": "#e7e7e7",
|
|
||||||
"activityBar.activeBackground": "#145bac",
|
"activityBar.activeBackground": "#145bac",
|
||||||
|
"activityBar.activeBorder": "#eb549a",
|
||||||
"activityBar.background": "#145bac",
|
"activityBar.background": "#145bac",
|
||||||
"activityBar.foreground": "#e7e7e7",
|
"activityBar.foreground": "#e7e7e7",
|
||||||
"activityBar.inactiveForeground": "#e7e7e799",
|
"activityBar.inactiveForeground": "#e7e7e799",
|
||||||
"activityBarBadge.background": "#eb549a",
|
"activityBarBadge.background": "#eb549a",
|
||||||
"activityBarBadge.foreground": "#15202b",
|
"activityBarBadge.foreground": "#15202b",
|
||||||
"commandCenter.border": "#e7e7e799",
|
|
||||||
"sash.hoverBorder": "#145bac",
|
"sash.hoverBorder": "#145bac",
|
||||||
"statusBar.background": "#0f437e",
|
"statusBar.background": "#0f437e",
|
||||||
"statusBar.foreground": "#e7e7e7",
|
"statusBar.foreground": "#e7e7e7",
|
||||||
"statusBarItem.hoverBackground": "#145bac",
|
"statusBarItem.hoverBackground": "#145bac",
|
||||||
"statusBarItem.remoteBackground": "#000000",
|
"statusBarItem.remoteBackground": "#0f437e",
|
||||||
"statusBarItem.remoteForeground": "#e7e7e7",
|
"statusBarItem.remoteForeground": "#e7e7e7",
|
||||||
"titleBar.activeBackground": "#0f437e",
|
"titleBar.activeBackground": "#0f437e",
|
||||||
"titleBar.activeForeground": "#e7e7e7",
|
"titleBar.activeForeground": "#e7e7e7",
|
||||||
"titleBar.inactiveBackground": "#0f437e99",
|
"titleBar.inactiveBackground": "#0f437e99",
|
||||||
"titleBar.inactiveForeground": "#e7e7e799",
|
"titleBar.inactiveForeground": "#e7e7e799",
|
||||||
"activityBarTop.activeBackground": "#145bac",
|
"commandCenter.border": "#e7e7e799"
|
||||||
"activityBarTop.activeBorder": "#e7e7e7",
|
|
||||||
"activityBarTop.background": "#145bac",
|
|
||||||
"activityBarTop.foreground": "#e7e7e7",
|
|
||||||
"activityBarTop.inactiveForeground": "#e7e7e799",
|
|
||||||
"commandCenter.foreground": "#e7e7e7",
|
|
||||||
"statusBar.debuggingBackground": "#0f437e",
|
|
||||||
"statusBar.debuggingForeground": "#e7e7e7"
|
|
||||||
},
|
},
|
||||||
"peacock.remoteColor": "#0f437e",
|
"peacock.remoteColor": "#0f437e"
|
||||||
"intelephense.environment.phpVersion": "8.3.0"
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
67
Dockerfile
67
Dockerfile
|
|
@ -1,67 +0,0 @@
|
||||||
# --- COMPOSER INSTALL
|
|
||||||
FROM composer:2.9.2 AS vendor
|
|
||||||
|
|
||||||
ARG GITLAB_USER
|
|
||||||
ARG GITLAB_PASSWORD
|
|
||||||
|
|
||||||
COPY database/ database/
|
|
||||||
|
|
||||||
COPY composer.json composer.json
|
|
||||||
COPY composer.lock composer.lock
|
|
||||||
|
|
||||||
RUN composer config gitlab-token.lab.s-web.fr ${GITLAB_USER} ${GITLAB_PASSWORD}
|
|
||||||
RUN composer install \
|
|
||||||
--ignore-platform-reqs \
|
|
||||||
--no-interaction \
|
|
||||||
--no-plugins \
|
|
||||||
--no-scripts \
|
|
||||||
--no-dev \
|
|
||||||
--prefer-dist
|
|
||||||
|
|
||||||
# --- BUILD MJML BINARY
|
|
||||||
FROM node:24-trixie AS mjml-builder
|
|
||||||
|
|
||||||
WORKDIR /build
|
|
||||||
|
|
||||||
RUN npm init -y && \
|
|
||||||
npm install mjml @yao-pkg/pkg
|
|
||||||
|
|
||||||
RUN npm pkg set pkg.scripts="node_modules/mjml*/**/*.js"
|
|
||||||
|
|
||||||
RUN npx @yao-pkg/pkg node_modules/mjml/bin/mjml \
|
|
||||||
--target linuxstatic-x64 \
|
|
||||||
--output /build/mjml-bin
|
|
||||||
|
|
||||||
# --- BUILD ASSETS
|
|
||||||
FROM node:24-alpine AS frontend
|
|
||||||
|
|
||||||
ARG GITLAB_PASSWORD
|
|
||||||
|
|
||||||
RUN mkdir -p /app/public/build
|
|
||||||
|
|
||||||
COPY package*.json tsconfig.json vite.config.ts eslint.config.js .stylelintrc.json /app/
|
|
||||||
COPY resources/ /app/resources/
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
RUN npm config set @ldc-web:registry https://lab.s-web.fr/api/v4/packages/npm/
|
|
||||||
RUN npm config set -- '//lab.s-web.fr/api/v4/packages/npm/:_authToken' "${GITLAB_PASSWORD}"
|
|
||||||
RUN npm config set @uwil:registry https://lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/
|
|
||||||
RUN npm config set -- '//lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/:_authToken' "${GITLAB_PASSWORD}"
|
|
||||||
RUN npm ci --no-audit --no-fund --loglevel=error && npm run prod
|
|
||||||
|
|
||||||
# --- RUN
|
|
||||||
FROM registry.s-web.fr/ldc-web/projets/ldc-web-images-docker/uwil-production-8.5:${PHP_8_5_TAG}
|
|
||||||
|
|
||||||
ARG USER=www-data
|
|
||||||
|
|
||||||
# MJML binary
|
|
||||||
COPY --chown=${USER}:${USER} --from=mjml-builder /build/mjml-bin /usr/local/bin/mjml
|
|
||||||
|
|
||||||
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 ${USER}
|
|
||||||
133
README.md
133
README.md
|
|
@ -1,112 +1,33 @@
|
||||||
# Le Gaulois
|
# Le Gaulois
|
||||||
|
|
||||||
## Features
|
## .env
|
||||||
|
En DEV et PROD mettre :
|
||||||
### Club
|
```
|
||||||
|
LOG_CHANNEL=stackProd
|
||||||
#### Messages et Notifications
|
|
||||||
|
|
||||||
Page : `/club/notifications`
|
|
||||||
|
|
||||||
Les notifications de l'utilisateur connecté (`Customer`) sont affichées par date de création (`created_at`), du plus récent au plus ancien (`DESC`)
|
|
||||||
|
|
||||||
Au clic sur une notification de type `message`, nous sommes redirigé vers `/club/messages?m=[MESSAGE ID]`
|
|
||||||
|
|
||||||
Page : `/club/messages?m=[MESSAGE ID]`
|
|
||||||
|
|
||||||
Les messages sont affichés du plus récent au plus ancien.
|
|
||||||
|
|
||||||
Au clic sur une conversation, un call (DELETE `/club/conversations/mark-as-read`) est fait pour set comme "lues", les notifications des messages de la conversation séléctionnée.
|
|
||||||
|
|
||||||
##### Crons
|
|
||||||
Tous les jours à 14:15, lancement du job `DeleteOldMessages` qui supprime tous les messages dont la date de mise à jour (`updated_at`) est supérieur à 30 jours ainsi que les notifications dont le type est `message` dont la date de mise à jour (`updated_at`) est supérieur à 30 jours.
|
|
||||||
|
|
||||||
## Optimiser Images
|
|
||||||
|
|
||||||
### PNG
|
|
||||||
|
|
||||||
apt install imagick
|
|
||||||
convert -colors 256 -depth 8 +dither bg-footer-ori.png bg-footer-test.png
|
|
||||||
<https://compresspng.com/>
|
|
||||||
|
|
||||||
### Autre
|
|
||||||
|
|
||||||
apt install trimage
|
|
||||||
|
|
||||||
# Copy paste from the admin secure readme.md
|
|
||||||
Put every min in PROD :
|
|
||||||
```php
|
|
||||||
php artisan schedule:run
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# Unit tests
|
## Flux
|
||||||
Create new `.env.testing` with a new empty database `le-gaulois-testing` and just run this command :
|
Flux INCO dans :
|
||||||
```php
|
|
||||||
php artisan test
|
|
||||||
```
|
```
|
||||||
To see more details, please read the documentation of [uwil/unit-tests-laravel](https://lab.s-web.fr/ldc-web/projets/unit-tests-laravel/-/blob/main/README.md?ref_type=heads#documentation)
|
storage/inco
|
||||||
|
|
||||||
Legend : ✅ test added & operational, ⚠️ test added & operational but modified, ❌ no test (because no CRUD or specific model)
|
|
||||||
|
|
||||||
Models list :
|
|
||||||
|
|
||||||
✅ ActivityLog
|
|
||||||
⚠️ Approach (label/demarche)
|
|
||||||
❌ BlockList
|
|
||||||
✅ BrandAdvantage
|
|
||||||
❌ Breeder
|
|
||||||
✅ Claim
|
|
||||||
✅ ConsumptionMoment
|
|
||||||
❌ Customer
|
|
||||||
❌ DeliveryAddress
|
|
||||||
✅ DemarcheSlide
|
|
||||||
❌ DepartaimantsCollection
|
|
||||||
✅ Discount
|
|
||||||
❌ GeneralSetting
|
|
||||||
✅ HistoricalMilestone
|
|
||||||
❌ IncoNutritionalValue
|
|
||||||
✅ KeyNumber
|
|
||||||
✅ MainSlide
|
|
||||||
✅ Meat
|
|
||||||
⚠️ MenuNodeData
|
|
||||||
❌ Message
|
|
||||||
⚠️ News
|
|
||||||
✅ NewsBreeding
|
|
||||||
✅ NewsCategory
|
|
||||||
⚠️ NewsClub (News/Survey)
|
|
||||||
✅ NewsCorporate
|
|
||||||
❌ Notification
|
|
||||||
✅ Offer
|
|
||||||
❌ Order
|
|
||||||
❌ OrderSellItem
|
|
||||||
✅ Product
|
|
||||||
✅ ProductType
|
|
||||||
✅ Profession
|
|
||||||
✅ Range
|
|
||||||
✅ Recipe
|
|
||||||
✅ SellItem
|
|
||||||
✅ StaticPage
|
|
||||||
✅ Submeat
|
|
||||||
✅ Subrange
|
|
||||||
✅ SurveysAnswer
|
|
||||||
✅ Testimonial
|
|
||||||
❌ User
|
|
||||||
✅ Video
|
|
||||||
|
|
||||||
# Meilisearch
|
|
||||||
When deploying, if there any modification to a concerned Model, you may refresh Meilisearch cache. Concerned models are :
|
|
||||||
- News
|
|
||||||
- NewsBreeding
|
|
||||||
- Product
|
|
||||||
- Recipe
|
|
||||||
|
|
||||||
```sh
|
|
||||||
php artisan scout:flush "\App\Models\News"
|
|
||||||
php artisan scout:import "\App\Models\News"
|
|
||||||
php artisan scout:flush "\App\Models\NewsBreeding"
|
|
||||||
php artisan scout:import "\App\Models\NewsBreeding"
|
|
||||||
php artisan scout:flush "\App\Models\Product"
|
|
||||||
php artisan scout:import "\App\Models\Product"
|
|
||||||
php artisan scout:flush "\App\Models\Recipe"
|
|
||||||
php artisan scout:import "\App\Models\Recipe"
|
|
||||||
```
|
```
|
||||||
|
Flux Tracabilité dans :
|
||||||
|
```
|
||||||
|
storage/tracabilite
|
||||||
|
```
|
||||||
|
|
||||||
|
## Scheduled Jobs
|
||||||
|
- DeleteOrders : daily at 14
|
||||||
|
|
||||||
|
## Boutique
|
||||||
|
Expédition de fond de carte magnétique
|
||||||
|
Poids : 540
|
||||||
|
Code Opération : 16
|
||||||
|
Code Support : 1
|
||||||
|
|
||||||
|
Expédition de fond de carte papier
|
||||||
|
Poids : 0
|
||||||
|
Code Opération : 16
|
||||||
|
Code Support : 0
|
||||||
|
|
||||||
|
- !! Vérifier que sell_items.archadia_id contient bien la bone valeur (Code support)
|
||||||
|
|
|
||||||
181
RGPD.md
181
RGPD.md
|
|
@ -1,181 +0,0 @@
|
||||||
# RGPD
|
|
||||||
|
|
||||||
## Site
|
|
||||||
|
|
||||||
### En base de données
|
|
||||||
|
|
||||||
| Table | Colonne | Contenu | Utilisation |
|
|
||||||
| ----- | ------- | ------- | ----------- |
|
|
||||||
| activity_logs | user_id | Identifiant de l'utilisateur (back) | Tracer les modifications dans le BO |
|
|
||||||
| ----- | ------- | ------- | ----------- |
|
|
||||||
| block_lists | customer_id | Id d'un client | Gérer les blocages sur le club (client qui a mis en place le blocage) |
|
|
||||||
| block_lists | blocked_id | Id d'un client | Gérer les blocages sur le club (client qui a été bloqué) |
|
|
||||||
| block_lists | created_at | Date | Date du blocage |
|
|
||||||
| ----- | ------- | ------- | ----------- |
|
|
||||||
| breeders | first_name | Prénom de l'éleveur | Actuellement caché. Sinon, à afficher sur une carte des éleveurs |
|
|
||||||
| breeders | last_name | Nom de l'éleveur | Actuellement caché. Sinon, à afficher sur une carte des éleveurs |
|
|
||||||
| breeders | picture | Photo de l'éleveur | Actuellement caché. Sinon, à afficher sur une carte des éleveurs |
|
|
||||||
| breeders | picture_alt | Texte alternatif de la photo de l'éleveur | Actuellement caché. Sinon, à afficher sur une carte des éleveurs |
|
|
||||||
| breeders | picture_title | Titre de la photo de l'éleveur | Actuellement caché. Sinon, à afficher sur une carte des éleveurs |
|
|
||||||
| breeders | postal_code | Code postal de l'éleveur | Actuellement caché. Sinon, à afficher sur une carte des éleveurs |
|
|
||||||
| breeders | department | Département de l'éleveur | Actuellement caché. Sinon, à afficher sur une carte des éleveurs |
|
|
||||||
| breeders | place | Ville de l'éleveur | Actuellement caché. Sinon, à afficher sur une carte des éleveurs |
|
|
||||||
| breeders | latitude | Latitude (exacte ou de la commune) | Actuellement caché. Sinon, sert à faire un marqueur sur une carte des éleveurs |
|
|
||||||
| breeders | longitude | Longitude (exacte ou de la commune) | Actuellement caché. Sinon, sert à faire un marqueur sur une carte des éleveurs |
|
|
||||||
| breeders | picture1 | Photo de l'éleveur | Actuellement caché. Sinon, à afficher sur une carte des éleveurs |
|
|
||||||
| breeders | picture2 | Photo de l'éleveur | Actuellement caché. Sinon, à afficher sur une carte des éleveurs |
|
|
||||||
| breeders | picture3 | Photo de l'éleveur | Actuellement caché. Sinon, à afficher sur une carte des éleveurs |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| customerables | customer_id | Identifiant du client | Sert à définir à qui appartiennent les données |
|
|
||||||
| customerables | customerable_type | Type de donnée | Peut être : un produit mis en favoris, une recette mise en favoris, une réponse à une question posée |
|
|
||||||
| customerables | customerable_id | Identifiant de l'objet | Peut être : un produit, une recette, une réponse |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| customers | email | Adresse email | Identifiant du client |
|
|
||||||
| customers | hashcode | Code unique de l'utilisateur en CRM | Identifiant du client en CRM |
|
|
||||||
| customers | username | Nom d'utilisateur | Nom affiché sur le club |
|
|
||||||
| customers | email_verified_at | Date | Savoir depuis quand l'utilisateur a un compte valide |
|
|
||||||
| customers | last_connection | Date | Suivi d'activité |
|
|
||||||
| customers | created_at | Date | Suivi d'activité |
|
|
||||||
| customers | updated_at | Date | Suivi d'activité |
|
|
||||||
| customers | deleted_at | Date | Gestion du compte (suppression) |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| customer_password_resets | email | Adresse email | Gestion de la réinitialisation des mots de passe |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| delivery_adresses | firstname | Prénom | Destinataire de l'envoi d'une commande |
|
|
||||||
| delivery_adresses | lastname | Nom | Destinataire de l'envoi d'une commande |
|
|
||||||
| delivery_adresses | address | Adresse | Adresse à laquelle envoyer la commande |
|
|
||||||
| delivery_adresses | postcode | Code postal | Code postal de l'adresse à laquelle envoyer la commande |
|
|
||||||
| delivery_adresses | city | Ville | Ville de l'adresse à laquelle envoyer la commande |
|
|
||||||
| delivery_adresses | phone | Numéro de téléphone | Numéro de téléphone si besoin de contacter le client |
|
|
||||||
| delivery_adresses | civility | Civilité | Identifier le client |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| departaimants | customer_id | Identifiant du client | Gestion des magnets détenus par le client |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| messages | from | Identifiant du client expéditeur | Gestion du service de messagerie du club |
|
|
||||||
| messages | to | Identifiant du client destinataire | Gestion du service de messagerie du club |
|
|
||||||
| messages | created_at | Date | Gestion du service de messagerie du club |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| notifications | customer_id | Identifiant du client | Avertir le client d'une nouvelle action sur le club |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| notifications_read | notification_id | Identifiant de la notification | Suivi d'activité, gestion des notifications |
|
|
||||||
| notifications_read | customer_id | Identifiant du client | Suivi d'activité, gestion des notifications |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| ocb_breeders | first_name | Prénom de l'éleveur | Affichage sur la page [Oui c'est bon](https://www.legaulois.fr/les-elevages/oui-c-est-bon) |
|
|
||||||
| ocb_breeders | last_name | Nom de l'éleveur | Affichage sur la page [Oui c'est bon](https://www.legaulois.fr/les-elevages/oui-c-est-bon) |
|
|
||||||
| ocb_breeders | department | Département dans lequel exerce l'éleveur | Affichage sur la page [Oui c'est bon](https://www.legaulois.fr/les-elevages/oui-c-est-bon) |
|
|
||||||
| ocb_breeders | postal_code | Code postal du département dans lequel exerce l'éleveur | Affichage sur la page [Oui c'est bon](https://www.legaulois.fr/les-elevages/oui-c-est-bon) |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| offers | picture | Illustration de l'offre. Peut contenir des visages. | Affiché sur la page "[Recrutement](https://www.legaulois.fr/recrutement)" |
|
|
||||||
| offers | recruiter_firstname | Prénom du recruteur | Utilisé dans les micro-datas |
|
|
||||||
| offers | recruiter_lastname | Nom du recruteur | Utilisé dans les micro-datas |
|
|
||||||
| offers | recruiter_job | Poste du recruteur | Utilisé dans les micro-datas |
|
|
||||||
| offers | recruiter_picture | Photo du recruteur | Utilisé dans les micro-datas |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| optin_consents | email | Adresse mail | Permettre l'envoi de NL de consentement afin d'inscrire ou non la personne en CRM |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| orders | firstname | Prénom | Personne ayant fait une commande sur la boutique du site |
|
|
||||||
| orders | lastname | Nom | Personne ayant fait une commande sur la boutique du site |
|
|
||||||
| orders | address | Adresse | Adresse de facturation |
|
|
||||||
| orders | postcode | Code postal | Code postal de l'adresse de facturation |
|
|
||||||
| orders | city | Ville | Ville de l'adresse de facturation |
|
|
||||||
| orders | phone | Numéro de téléphone | Numéro de téléphone si besoin de contacter la personne ayant passer une commande |
|
|
||||||
| orders | email | Adresse mail | Adresse mail si besoin de contacter la personne ayant passer une commande |
|
|
||||||
| orders | civility | Civilité | Identifier le client |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| professions | picture | Illustration du métier. Peut contenir des visages | Affichage sur la page "[Recrutement](https://www.legaulois.fr/recrutement)" |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| ratings | customer_id | Identifiant du client | Permet de savoir qui a mis la note. Le pseudonyme est affiché sur la page du produit ou de la recette concernée |
|
|
||||||
| ratings | rating_id | Identifiant du produit ou de la recette | Endroit où sera affichée la note |
|
|
||||||
| ratings | rate | Note | Note mise par le client, sur une échelle de 1 à 5 |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| testimonials | identity | Nom et Prénom | Affichage sur la page "[Recrutement](https://www.legaulois.fr/recrutement)" |
|
|
||||||
| testimonials | job | Métier | Affichage sur la page "[Recrutement](https://www.legaulois.fr/recrutement)" |
|
|
||||||
| testimonials | picture | Photo | Affichage sur la page "[Recrutement](https://www.legaulois.fr/recrutement)" |
|
|
||||||
| testimonials | picture_alt | Descriptif de la photo, pouvant inclure le nom et/ou la fonction | Affichage sur la page "[Recrutement](https://www.legaulois.fr/recrutement)" |
|
|
||||||
| testimonials | picture_title | Titre de la photo, pouvant inclure le nom et/ou la fonction | Affichage sur la page "[Recrutement](https://www.legaulois.fr/recrutement)" |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| 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 (Passerelle et marketing)
|
|
||||||
|
|
||||||
| Donnée | Contenu |
|
|
||||||
| ------ | ------- |
|
|
||||||
| Civilité | M/Mme |
|
|
||||||
| Nom | Nom de la personne |
|
|
||||||
| Prénom | Prénom de la personne |
|
|
||||||
| Adresse | Adresse de la personne |
|
|
||||||
| Code postal | Code postal de la personne |
|
|
||||||
| Ville | Ville de la personne |
|
|
||||||
| Adresse E-mail | Adresse email de la personne |
|
|
||||||
| Téléphone | Numéro de téléphone de la personne |
|
|
||||||
| Pièce jointe | Photo renseignée par la personne |
|
|
||||||
|
|
||||||
## CRM
|
|
||||||
|
|
||||||
| Table | Colonne | Contenu |
|
|
||||||
| ----- | ------- | ------- |
|
|
||||||
| customers | email | Adresse mail du client |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| customer_infos | firstname | Prénom du client |
|
|
||||||
| customer_infos | lastname | Nom du client |
|
|
||||||
| customer_infos | birth_date | Date de naissance du client |
|
|
||||||
| customer_infos | address | Adresse du client |
|
|
||||||
| customer_infos | address2 | Complément d'adresse du client |
|
|
||||||
| customer_infos | phone | Numéro de téléphone du client |
|
|
||||||
| customer_infos | country | Pays du client |
|
|
||||||
| customer_infos | city | Ville du client |
|
|
||||||
| customer_infos | postcode | Code postal du client |
|
|
||||||
| customer_infos | opt_in | Consentement du client pour recevoir les newsletters |
|
|
||||||
| customer_infos | hashcode | Identifiant unique |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| customer_logins | last_connection | Date et heure de dernière connexion |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| customer_opt_in_history | new_value | Nouvelle valeur d'optin |
|
|
||||||
| customer_opt_in_history | created_at | Date du changement |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| single_optins | email | Adresse mail des personnes voulant recevoir les newsletters sans créer de compte |
|
|
||||||
| single_optins | created_at | Date de l'inscription |
|
|
||||||
|
|
||||||
## Jeux (GGW)
|
|
||||||
|
|
||||||
| Table | Colonne | Contenu |
|
|
||||||
| ----- | ------- | ------- |
|
|
||||||
| banned_ips | ip | Adresse IP |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| customers | email | Adresse email du client |
|
|
||||||
| customer | hashcode | Identifiant unique |
|
|
||||||
| customers | email_verified_at | Date de vérification de l'adresse mail du client |
|
|
||||||
| customers | last_connection | Date et heure de dernière connexion du client |
|
|
||||||
| customers | created_at | Date de création du compte |
|
|
||||||
| customers | updated_at | Date de dernière mise à jour du compte |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| instant_wins | available_at | Date et heure de l'instant gagnant |
|
|
||||||
| instant_wins | prize_id | Numéro du lot à gagner |
|
|
||||||
| instant_wins | participation_id | Numéro de la participation ayant servi à gagner le lot |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| participations | ip | Adresse ip de la personne participant |
|
|
||||||
| participations | sticker | Photo du sticker comme preuve d'achat |
|
|
||||||
| participations | ticket | Photo du ticket de caisse comme preuve d'achat |
|
|
||||||
| participations | barcode | Photo du code barres comme preuve d'achat |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| settings | notification_emails | Liste de mails qui recevront les notifications de gain du jeu |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| users | first_name | Prénom de l'utilisateur (BO) |
|
|
||||||
| users | last_name | Nom de l'utilisateur (BO) |
|
|
||||||
| users | email | Adresse mail de l'utilisateur (BO) |
|
|
||||||
| users | role | Niveau de permissions de l'utilisateur (BO) |
|
|
||||||
| users | published | Etat de publication de l'utilisateur (BO) |
|
|
||||||
| users | published_at | Date de publication de l'utilisateur (BO) |
|
|
||||||
| users | created_at | Date de création de l'utilisateur (BO) |
|
|
||||||
| users | updated_at | Date de dernière mise à jour de l'utilisateur (BO) |
|
|
||||||
|
|
||||||
## Cookies
|
|
||||||
|
|
||||||
| Service | Utilité |
|
|
||||||
| ------- | ------- |
|
|
||||||
| Matomo | Mesure d'audience |
|
|
||||||
| Google Recaptcha | Empêcher la soumission de formulaire par des robots |
|
|
||||||
| Vimeo | Visionner du contenu disponible sur la plateforme Vimeo |
|
|
||||||
| Youtube | Visionner du contenu disponible sur la plateforme Youtube |
|
|
||||||
28365
_ide_helper.php
28365
_ide_helper.php
File diff suppressed because it is too large
Load diff
|
|
@ -1,178 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Auth;
|
|
||||||
|
|
||||||
use App\Models\Customer;
|
|
||||||
use Illuminate\Auth\EloquentUserProvider;
|
|
||||||
use Illuminate\Contracts\Auth\Authenticatable;
|
|
||||||
use Illuminate\Contracts\Auth\UserProvider;
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
use Illuminate\Support\Facades\Session;
|
|
||||||
use Illuminate\Support\Str;
|
|
||||||
use LDC\LDCCRM\Enums\ApiError;
|
|
||||||
use LDC\LDCCRM\Exceptions\ApiErrorException;
|
|
||||||
use LDC\LDCCRM\Exceptions\CrmException;
|
|
||||||
use LDC\LDCCRM\Models\Customer as CrmCustomer;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Crm user provider to integrate nicely with Laravel
|
|
||||||
*/
|
|
||||||
class CrmUserProvider extends EloquentUserProvider implements UserProvider
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* The model to use, specified in auth config guard.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $usedModel = Customer::class;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve a user by the given credentials.
|
|
||||||
*/
|
|
||||||
public function retrieveByCredentials(array $credentials): ?Authenticatable
|
|
||||||
{
|
|
||||||
// * Let laravel find a model
|
|
||||||
$model = parent::retrieveByCredentials($credentials) ?? self::retrieveTrashed($credentials);
|
|
||||||
|
|
||||||
try {
|
|
||||||
/** @var \LDC\LDCCRM\CrmApiV4 */
|
|
||||||
$crm = app('crmAPI');
|
|
||||||
|
|
||||||
// Si pas de compte local.
|
|
||||||
if (! $model) {
|
|
||||||
$crmCustomer = $crm->getCustomer($credentials['email']);
|
|
||||||
|
|
||||||
if (! $crmCustomer) {
|
|
||||||
// * Customer is not found on CRM.
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
$model = $this->createLocalCustomer($crmCustomer);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $model;
|
|
||||||
} catch (ApiErrorException $e) {
|
|
||||||
// * Customer is not found.
|
|
||||||
if ($e->getApiError()->equals(ApiError::modelNotFound)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
report($e);
|
|
||||||
Log::error('Unhandled response ' . $e->getApiError()->label());
|
|
||||||
} catch (CrmException | \Exception $e) {
|
|
||||||
report($e);
|
|
||||||
|
|
||||||
// Une erreur critique est survenue avec la CRM.
|
|
||||||
return null;
|
|
||||||
} // end try
|
|
||||||
Log::error(__CLASS__ . '::retrieveByCredentials reached end of possibilities.');
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate a user against the given 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.
|
|
||||||
*/
|
|
||||||
public function validateCredentials(Authenticatable $model, array $credentials): bool
|
|
||||||
{
|
|
||||||
/** @var \Illuminate\Database\Eloquent\Model $model */
|
|
||||||
if (\get_class($model) !== $this->usedModel) {
|
|
||||||
throw new \RuntimeException('Cannot authenticate any thing else than ' . $this->usedModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
/** @var \LDC\LDCCRM\CrmApiV4 */
|
|
||||||
$crm = app('crmAPI');
|
|
||||||
|
|
||||||
// * If has trait soft delete and customer trashed, then restore customer.
|
|
||||||
if (
|
|
||||||
\in_array(SoftDeletes::class, \class_uses_recursive($model)) and // @phpstan-ignore-next-line
|
|
||||||
$model->trashed()
|
|
||||||
) {
|
|
||||||
// @phpstan-ignore-next-line
|
|
||||||
$model->restore();
|
|
||||||
}
|
|
||||||
|
|
||||||
// * Ne devrait pas survenir, $crm->login throws ApiError::authFailed
|
|
||||||
return $crm->login($credentials['email'], $credentials['password']);
|
|
||||||
} catch (ApiErrorException $e) {
|
|
||||||
// @phpstan-ignore-next-line
|
|
||||||
if (! $model->hashcode or ! CrmCustomer::find($model->hashcode)) {
|
|
||||||
$model->forceDelete();
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if ($e->getApiError()->equals(ApiError::authFailed)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// ! Assert Authenticable model must be valided (MustValidate trait).
|
|
||||||
if ($e->getApiError()->equals(ApiError::customerNotActivated)) {
|
|
||||||
Session::flash('warning', \trans('Vous devez activer votre compte'));
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} catch (CrmException | \Exception $e) {
|
|
||||||
report($e);
|
|
||||||
if (config('app.debug')) {
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
} // end try
|
|
||||||
|
|
||||||
Log::error(__CLASS__ . '::validateCredentials reached end of possibilities.');
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a local customer
|
|
||||||
*
|
|
||||||
* @throws \Throwable If saving to DB failed.
|
|
||||||
*/
|
|
||||||
private function createLocalCustomer(CrmCustomer $crmCustomer): Model
|
|
||||||
{
|
|
||||||
/** @var \Illuminate\Database\Eloquent\Model $model */
|
|
||||||
$model = $this->usedModel::firstOrNew([
|
|
||||||
'email' => $crmCustomer->email,
|
|
||||||
]);
|
|
||||||
// @phpstan-ignore-next-line
|
|
||||||
$model->hashcode = $crmCustomer->hashcode;
|
|
||||||
// @phpstan-ignore-next-line
|
|
||||||
$model->email_verified_at = $crmCustomer->status ? now() : null;
|
|
||||||
$model->saveOrFail();
|
|
||||||
|
|
||||||
return $model;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve a trashed customer by the given credentials.
|
|
||||||
*
|
|
||||||
* @throws \ErrorException If cannot connect to LDAP.
|
|
||||||
*/
|
|
||||||
private function retrieveTrashed(array $credentials): ?Authenticatable
|
|
||||||
{
|
|
||||||
// * Make changes
|
|
||||||
if (empty($credentials)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// First we will add each credential element to the query as a where clause.
|
|
||||||
// Then we can execute the query and, if we found a customer, return it in a
|
|
||||||
// Eloquent User "model" that will be utilized by the Guard instances.
|
|
||||||
$query = $this->createModel()->newQuery();
|
|
||||||
|
|
||||||
foreach ($credentials as $key => $value) {
|
|
||||||
if (! Str::contains($key, 'password')) {
|
|
||||||
$query->where($key, $value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// @phpstan-ignore-next-line
|
|
||||||
return $query->withTrashed()->first();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Auth;
|
|
||||||
|
|
||||||
use App\Models\Customer;
|
|
||||||
use Illuminate\Auth\EloquentUserProvider;
|
|
||||||
use Illuminate\Contracts\Auth\Authenticatable;
|
|
||||||
use Illuminate\Contracts\Auth\UserProvider;
|
|
||||||
use Illuminate\Support\Str;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overload EloquentUserProvider to handle
|
|
||||||
* Soft deleted Customers
|
|
||||||
*/
|
|
||||||
class ReactivateCustomerProvider extends EloquentUserProvider implements UserProvider
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Retrieve a customer by the given credentials.
|
|
||||||
*
|
|
||||||
* @throws \ErrorException If cannot connect to LDAP.
|
|
||||||
*/
|
|
||||||
public function retrieveByCredentials(array $credentials): ?Authenticatable
|
|
||||||
{
|
|
||||||
// * Make changes
|
|
||||||
if (empty($credentials)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// First we will add each credential element to the query as a where clause.
|
|
||||||
// Then we can execute the query and, if we found a customer, return it in a
|
|
||||||
// Eloquent User "model" that will be utilized by the Guard instances.
|
|
||||||
$query = $this->createModel()->newQuery();
|
|
||||||
|
|
||||||
foreach ($credentials as $key => $value) {
|
|
||||||
if (! Str::contains($key, 'password')) {
|
|
||||||
$query->where($key, $value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// @phpstan-ignore-next-line
|
|
||||||
return $query->withTrashed()->first();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate a customer against the given credentials.
|
|
||||||
*
|
|
||||||
* @throws \ErrorException If model provided is not a Customer or connection to server fails.
|
|
||||||
*/
|
|
||||||
public function validateCredentials(Authenticatable $customer, array $credentials): bool
|
|
||||||
{
|
|
||||||
/** @var \App\Models\Customer $customer */
|
|
||||||
if ($customer instanceof Customer) {
|
|
||||||
throw new \ErrorException('Cannot authenticate any thing else than ' . Customer::class);
|
|
||||||
}
|
|
||||||
|
|
||||||
// @phpstan-ignore-next-line
|
|
||||||
$plain = $credentials['password'];
|
|
||||||
|
|
||||||
/** @var \App\Models\Customer $customer */
|
|
||||||
if ($this->hasher->check($plain, $customer->getAuthPassword())) {
|
|
||||||
// * Restore customer
|
|
||||||
return boolval($customer->restore());
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -3,36 +3,45 @@
|
||||||
namespace App\Casts;
|
namespace App\Casts;
|
||||||
|
|
||||||
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
|
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom cast Html Color
|
* Custom cast Html Color
|
||||||
|
* https://laravel.com/docs/8.x/eloquent-mutators#custom-casts
|
||||||
*/
|
*/
|
||||||
// phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceAfterLastUsed
|
//phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceAfterLastUsed
|
||||||
// phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceBeforeLastUsed
|
//phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceBeforeLastUsed
|
||||||
class HtmlColor implements CastsAttributes
|
class HtmlColor implements CastsAttributes
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Cast the given value.
|
* Cast the given value.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Database\Eloquent\Model $model
|
||||||
|
* @param string $key
|
||||||
|
* @param mixed $value
|
||||||
|
* @param array $attributes
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function get(Model $model, string $key, mixed $value, array $attributes): string
|
public function get($model, $key, $value, $attributes)
|
||||||
{
|
{
|
||||||
return '#' . $this->zeropad(dechex($value), 6);
|
return "#" . $this->zeropad(dechex($value), 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare the given value for storage.
|
* Prepare the given value for storage.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Database\Eloquent\Model $model
|
||||||
|
* @param string $key
|
||||||
|
* @param array $value
|
||||||
|
* @param array $attributes
|
||||||
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function set(Model $model, string $key, mixed $value, array $attributes): int
|
public function set($model, $key, $value, $attributes)
|
||||||
{
|
{
|
||||||
return \intval(hexdec(ltrim($value, '#')));
|
return \intval(hexdec(ltrim($value, '#')));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private function zeropad($num, $lim)
|
||||||
* Pad with zeros a numeric string
|
|
||||||
*/
|
|
||||||
protected function zeropad(string $num, int $lim): string
|
|
||||||
{
|
{
|
||||||
return (strlen($num) >= $lim) ? $num : $this->zeropad('0' . $num, $lim);
|
return (strlen($num) >= $lim) ? $num : $this->zeropad("0" . $num, $lim);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,37 +3,39 @@
|
||||||
namespace App\Casts;
|
namespace App\Casts;
|
||||||
|
|
||||||
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
|
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
class NiceDate implements CastsAttributes
|
class NiceDate implements CastsAttributes
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Cast the given value.
|
* Accessor
|
||||||
*
|
|
||||||
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceAfterLastUsed
|
|
||||||
*
|
*
|
||||||
|
* @param mixed $model
|
||||||
|
* @param mixed $key
|
||||||
|
* @param mixed $value
|
||||||
|
* @param mixed $attributes
|
||||||
|
* @return mixed
|
||||||
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceBeforeLastUsed
|
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceBeforeLastUsed
|
||||||
|
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceAfterLastUsed
|
||||||
*/
|
*/
|
||||||
public function get(?Model $model, string $key, mixed $value, array $attributes): string
|
public function get($model, $key, $value, $attributes)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
|
||||||
$value = Carbon::parse($value);
|
$value = Carbon::parse($value);
|
||||||
|
|
||||||
return $value->isToday() ?
|
return $value->isToday() ?
|
||||||
trans('Aujourd\'hui à :time', ['time' => $value->format('H:i')]) : $value->format('Y/m/d à H:i');
|
trans('Aujourd\'hui à :time', ['time' => $value->format('H:i')]) : $value->format('Y/m/d H:i');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare the given value for storage.
|
* Mutator
|
||||||
*
|
*
|
||||||
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceAfterLastUsed
|
* @param mixed $model
|
||||||
*
|
* @param mixed $key
|
||||||
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceBeforeLastUsed
|
* @param mixed $value
|
||||||
|
* @param mixed $attributes
|
||||||
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function set(Model $model, string $key, mixed $value, array $attributes): string
|
public function set($model, $key, $value, $attributes)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
|
||||||
return Carbon::parse($value)->format('Y-m-d H:i:s');
|
return Carbon::parse($value)->format('Y-m-d H:i:s');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands;
|
|
||||||
|
|
||||||
use App\Jobs\FetchDigitalRecruiterOffers;
|
|
||||||
use Illuminate\Console\Command;
|
|
||||||
|
|
||||||
class FetchDigitalRecruiterOffersCommand extends Command
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'uwil:digital-recruiter';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Fetch digital recruiter offers';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute the console command.
|
|
||||||
*/
|
|
||||||
public function handle(): void
|
|
||||||
{
|
|
||||||
(new FetchDigitalRecruiterOffers())->handle();
|
|
||||||
$this->info('Offers fetch 👌');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands;
|
|
||||||
|
|
||||||
use App\Jobs\FetchMesBr;
|
|
||||||
use Illuminate\Console\Command;
|
|
||||||
|
|
||||||
class FetchMesBrCommand extends Command
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'uwil:mesbr';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Fetch mesbr discounts';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute the console command.
|
|
||||||
*/
|
|
||||||
public function handle(): void
|
|
||||||
{
|
|
||||||
(new FetchMesBr())->handle();
|
|
||||||
$this->info('Discounts fetch 👌');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
77
app/Console/Commands/LdcWebStatusChecker.php
Normal file
77
app/Console/Commands/LdcWebStatusChecker.php
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Command Name: LDC Web Status Checker
|
||||||
|
* Description: Envoi des infos Serveur/Laravel vers LDC Web
|
||||||
|
* Version: 1.1
|
||||||
|
* Author: Vincent BRIDIER
|
||||||
|
* Author URI: vincent.bridier@ldc.fr
|
||||||
|
*/
|
||||||
|
|
||||||
|
class LdcWebStatusChecker extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'ldcweb:statuschecker';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Envoi des infos Serveur/Laravel vers LDC Web';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$data = [];
|
||||||
|
$data['uuid'] = config('ldcweb.project_uuid');
|
||||||
|
|
||||||
|
// Sitemap.xml ?
|
||||||
|
if (file_exists(public_path() . '/sitemap.xml')) {
|
||||||
|
$data['sitemap'] = 'true';
|
||||||
|
} else {
|
||||||
|
$data['sitemap'] = 'false';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Robots.txt ?
|
||||||
|
if (file_exists(public_path() . '/robots.txt')) {
|
||||||
|
$data['robots'] = 'true';
|
||||||
|
} else {
|
||||||
|
$data['robots'] = 'false';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check logs
|
||||||
|
$data['logs'] = 0;
|
||||||
|
$patherror = storage_path('/logs');
|
||||||
|
$files = glob($patherror . '/*.log');
|
||||||
|
if (count($files) > 0) {
|
||||||
|
foreach ($files as $file) {
|
||||||
|
$data['logs'] = $data['logs'] + filesize($file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['code']['version'] = app()->version();
|
||||||
|
|
||||||
|
// Send by cURL
|
||||||
|
$url = 'https://ldc-web.ldc.fr/api/status-checker';
|
||||||
|
$ch = curl_init($url);
|
||||||
|
$payload = ['token' => 'CE8S52Qq7stf5k8frF4T', 'datas' => json_encode($data)];
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_exec($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands;
|
|
||||||
|
|
||||||
use App\Models\Message;
|
|
||||||
use Illuminate\Console\Command;
|
|
||||||
use Illuminate\Support\Facades\Crypt;
|
|
||||||
|
|
||||||
class MigrateOldMessage extends Command
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'app:migrate-old-message';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Command description';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute the console command.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function handle()
|
|
||||||
{
|
|
||||||
// Comment casting before run this command.
|
|
||||||
$messages = Message::all();
|
|
||||||
foreach ($messages as $message) {
|
|
||||||
$message->setAttribute('message', Crypt::encryptString($message->getRawOriginal('message')));
|
|
||||||
$message->save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
37
app/Console/Commands/PurgeNotifications.php
Normal file
37
app/Console/Commands/PurgeNotifications.php
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Jobs\PurgeNotifications as JobsPurgeNotifications;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
//phpcs:disable Generic.Files.LineLength.TooLong
|
||||||
|
class PurgeNotifications extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'notifications:purge';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Purge the notifications table where the created_at date of a notification is older than 30 days';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return integer
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$this->info('Running the Job, this could take some time.');
|
||||||
|
$job = new JobsPurgeNotifications();
|
||||||
|
$job->handle();
|
||||||
|
$this->info('Job completed');
|
||||||
|
}
|
||||||
|
}
|
||||||
38
app/Console/Commands/UpdateReductions.php
Normal file
38
app/Console/Commands/UpdateReductions.php
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Jobs\UpdateReductions as JobsUpdateReductions;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
//phpcs:disable Generic.Files.LineLength.TooLong
|
||||||
|
class UpdateReductions extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'reductions:update';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Update the reductions that the application get from MesBR';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return integer
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$this->info('Running the Job, this could take some time.');
|
||||||
|
$job = new JobsUpdateReductions();
|
||||||
|
$job->console = $this;
|
||||||
|
$job->handle();
|
||||||
|
$this->info('Job completed');
|
||||||
|
}
|
||||||
|
}
|
||||||
43
app/Console/Commands/UserChangePassword.php
Normal file
43
app/Console/Commands/UserChangePassword.php
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\User;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
|
||||||
|
class UserChangePassword extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'user:password';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Changes a user password';
|
||||||
|
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$email = $this->ask('What is the email?');
|
||||||
|
$user = User::where('email', $email)->first();
|
||||||
|
|
||||||
|
if (!$user) {
|
||||||
|
$this->error(sprintf('User %s could not be found', $email));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$password = $this->secret('What is the password?');
|
||||||
|
|
||||||
|
$user->password = Hash::make($password);
|
||||||
|
$user->saveOrFail();
|
||||||
|
|
||||||
|
$this->info('User updated.');
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,13 +2,9 @@
|
||||||
|
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use App\Enums\Users\RoleEnum;
|
use App\User;
|
||||||
use App\Models\User;
|
|
||||||
use Carbon\Carbon;
|
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\Validator;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Support\Str;
|
|
||||||
use Illuminate\Validation\ValidationException;
|
|
||||||
|
|
||||||
class UserCreate extends Command
|
class UserCreate extends Command
|
||||||
{
|
{
|
||||||
|
|
@ -17,183 +13,38 @@ class UserCreate extends Command
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $signature = 'uwil:user:create';
|
protected $signature = 'user:create';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $description = 'Create a backend admin user';
|
protected $description = 'Create a backend user';
|
||||||
|
|
||||||
/**
|
|
||||||
* The first name of the new user.
|
|
||||||
*
|
|
||||||
* @var string|null
|
|
||||||
*/
|
|
||||||
protected $first_name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The last name of the new user.
|
|
||||||
*
|
|
||||||
* @var string|null
|
|
||||||
*/
|
|
||||||
protected $last_name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The email of the new user.
|
|
||||||
*
|
|
||||||
* @var string|null
|
|
||||||
*/
|
|
||||||
protected $email;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The role of the new user.
|
|
||||||
*
|
|
||||||
* @var string|null
|
|
||||||
*/
|
|
||||||
protected $role;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function handle(): void
|
public function handle()
|
||||||
{
|
{
|
||||||
$this->first_name = null;
|
$firstname = $this->ask('What is the firstname?');
|
||||||
$this->addFirstName();
|
$lastname = $this->ask('What is the lastname?');
|
||||||
|
$email = $this->ask('What is the email?');
|
||||||
|
$role = $this->ask('What is the role 1 (SuperAdmin) or 2 (Admin) ?') == '1' ? 1 : 2;
|
||||||
|
$pwd = $this->secret('What is the password?');
|
||||||
|
|
||||||
$this->last_name = null;
|
$user = new User();
|
||||||
$this->addLastName();
|
$user->firstname = $firstname;
|
||||||
|
$user->lastname = $lastname;
|
||||||
$this->email = null;
|
$user->email = $email;
|
||||||
$this->addEmail();
|
$user->role = $role;
|
||||||
|
$user->password = Hash::make($pwd);
|
||||||
$this->role = null;
|
$user->email_verified_at = date('Y-m-d H:i:s');
|
||||||
$this->addRole();
|
|
||||||
|
|
||||||
$user = new User([
|
|
||||||
'first_name' => $this->first_name,
|
|
||||||
'last_name' => $this->last_name,
|
|
||||||
'email' => $this->email,
|
|
||||||
'role' => $this->role,
|
|
||||||
'published' => true,
|
|
||||||
'published_at' => Carbon::now(),
|
|
||||||
]);
|
|
||||||
$user->saveOrFail();
|
$user->saveOrFail();
|
||||||
|
|
||||||
$this->info('User created 👌');
|
$this->info('User created.');
|
||||||
}
|
return 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a first name to the user.
|
|
||||||
*/
|
|
||||||
private function addFirstName(): void
|
|
||||||
{
|
|
||||||
while (is_null($this->first_name)) {
|
|
||||||
try {
|
|
||||||
$tmp = $this->ask('Type the wanted user first name', 'Admin');
|
|
||||||
$validator = Validator::make(['first_name' => $tmp], [
|
|
||||||
'first_name' => 'required|min:3|max:255',
|
|
||||||
]);
|
|
||||||
$validator->validate();
|
|
||||||
$this->first_name = $tmp;
|
|
||||||
} catch (ValidationException $e) {
|
|
||||||
$this->error(sprintf(
|
|
||||||
'Please provide a valid first name %s',
|
|
||||||
\implode(',', collect($e->errors())->flatten()->all())
|
|
||||||
));
|
|
||||||
|
|
||||||
continue;
|
|
||||||
} // end try
|
|
||||||
} // end while
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a last name to the user.
|
|
||||||
*/
|
|
||||||
private function addLastName(): void
|
|
||||||
{
|
|
||||||
while (is_null($this->last_name)) {
|
|
||||||
try {
|
|
||||||
$tmp = $this->ask('Type the wanted user last name', 'Saïtama');
|
|
||||||
$validator = Validator::make(['last_name' => $tmp], [
|
|
||||||
'last_name' => 'required|min:3|max:255',
|
|
||||||
]);
|
|
||||||
$validator->validate();
|
|
||||||
$this->last_name = $tmp;
|
|
||||||
} catch (ValidationException $e) {
|
|
||||||
$this->error(sprintf(
|
|
||||||
'Please provide a valid last_name %s',
|
|
||||||
\implode(',', collect($e->errors())->flatten()->all())
|
|
||||||
));
|
|
||||||
|
|
||||||
continue;
|
|
||||||
} // end try
|
|
||||||
} // end while
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add an email to the user.
|
|
||||||
*/
|
|
||||||
private function addEmail(): void
|
|
||||||
{
|
|
||||||
while (is_null($this->email)) {
|
|
||||||
try {
|
|
||||||
$tmp = $this->ask('Type the wanted user email', 'equipe.web@ldc.fr');
|
|
||||||
$validator = Validator::make(['email' => $tmp], [
|
|
||||||
'email' => 'required|unique:users,email|email:rfc,dns',
|
|
||||||
]);
|
|
||||||
$validator->validate();
|
|
||||||
$this->email = $tmp;
|
|
||||||
} catch (ValidationException $e) {
|
|
||||||
$this->error(sprintf(
|
|
||||||
'Please provide a valid email %s',
|
|
||||||
\implode(',', collect($e->errors())->flatten()->all())
|
|
||||||
));
|
|
||||||
|
|
||||||
continue;
|
|
||||||
} // end try
|
|
||||||
} // end while
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a role to the user.
|
|
||||||
*/
|
|
||||||
private function addRole(): void
|
|
||||||
{
|
|
||||||
while (is_null($this->role)) {
|
|
||||||
try {
|
|
||||||
$tmp = $this->choice(
|
|
||||||
'Select his role',
|
|
||||||
[
|
|
||||||
Str::ucFirst(RoleEnum::conceptor->label()),
|
|
||||||
Str::ucFirst(RoleEnum::admin->label()),
|
|
||||||
Str::ucFirst(RoleEnum::visitor->label()),
|
|
||||||
],
|
|
||||||
Str::ucFirst(RoleEnum::visitor->label()),
|
|
||||||
);
|
|
||||||
if ($tmp === Str::ucFirst(RoleEnum::conceptor->label())) {
|
|
||||||
$tmp = RoleEnum::conceptor;
|
|
||||||
}
|
|
||||||
if ($tmp === Str::ucFirst(RoleEnum::admin->label())) {
|
|
||||||
$tmp = RoleEnum::admin;
|
|
||||||
}
|
|
||||||
if ($tmp === Str::ucFirst(RoleEnum::visitor->label())) {
|
|
||||||
$tmp = RoleEnum::visitor;
|
|
||||||
}
|
|
||||||
$validator = Validator::make(['role' => $tmp], [
|
|
||||||
'role' => 'required',
|
|
||||||
]);
|
|
||||||
$validator->validate();
|
|
||||||
$this->role = $tmp;
|
|
||||||
} catch (ValidationException $e) {
|
|
||||||
$this->error(sprintf(
|
|
||||||
'Please choose from the selection %s',
|
|
||||||
\implode(',', collect($e->errors())->flatten()->all())
|
|
||||||
));
|
|
||||||
|
|
||||||
continue;
|
|
||||||
} // end try
|
|
||||||
} // end while
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
37
app/Console/Commands/XSCVMepReader.php
Normal file
37
app/Console/Commands/XSCVMepReader.php
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Jobs\XSCVMepReader as JobsXSCVMepReader;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
class XSCVMepReader extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'csv:mep';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Run the XSCVMepReader manually';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return integer
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$this->info('Running the Job, this could take some time.');
|
||||||
|
$job = new JobsXSCVMepReader();
|
||||||
|
$job->console = $this;
|
||||||
|
$job->handle();
|
||||||
|
$this->info('Job completed');
|
||||||
|
}
|
||||||
|
}
|
||||||
37
app/Console/Commands/XmlEleveursReader.php
Normal file
37
app/Console/Commands/XmlEleveursReader.php
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Jobs\XmlEleveursReader as JobsXmlEleveursReader;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
class XmlEleveursReader extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'xml:eleveur';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Run the XmlEleveursReaderJob manually';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return integer
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$this->info('Running the Job, this could take some time.');
|
||||||
|
$job = new JobsXmlEleveursReader();
|
||||||
|
$job->console = $this;
|
||||||
|
$job->handle();
|
||||||
|
$this->info('Job completed');
|
||||||
|
}
|
||||||
|
}
|
||||||
37
app/Console/Commands/XmlIncoReader.php
Normal file
37
app/Console/Commands/XmlIncoReader.php
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Jobs\XmlIncoReader as JobsXmlIncoReader;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
class XmlIncoReader extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'xml:inco';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Run the XmlIncoReaderJob manually';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$this->info('Running the Job, this could take some time.');
|
||||||
|
$job = new JobsXmlIncoReader();
|
||||||
|
$job->console = $this;
|
||||||
|
$job->handle();
|
||||||
|
$this->info('Job completed');
|
||||||
|
}
|
||||||
|
}
|
||||||
37
app/Console/Commands/XmlTracaReader.php
Normal file
37
app/Console/Commands/XmlTracaReader.php
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Jobs\XmlTracaReader as JobsXmlTracaReader;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
class XmlTracaReader extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'xml:traca';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Run the XmlTracaReaderJob manually';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$this->info('Running the Job, this could take some time.');
|
||||||
|
$job = new JobsXmlTracaReader();
|
||||||
|
$job->console = $this;
|
||||||
|
$job->handle();
|
||||||
|
$this->info('Job completed');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,31 +2,68 @@
|
||||||
|
|
||||||
namespace App\Console;
|
namespace App\Console;
|
||||||
|
|
||||||
|
use App\Console\Commands\LdcWebStatusChecker;
|
||||||
|
use App\Console\Commands\PurgeNotifications;
|
||||||
|
use App\Console\Commands\UpdateReductions;
|
||||||
|
use App\Console\Commands\UserChangePassword;
|
||||||
|
use App\Console\Commands\UserCreate;
|
||||||
|
use App\Console\Commands\XmlEleveursReader;
|
||||||
|
use App\Console\Commands\XmlIncoReader;
|
||||||
|
use App\Console\Commands\XmlTracaReader;
|
||||||
|
use App\Console\Commands\XSCVMepReader;
|
||||||
use App\Jobs\DeleteOldMessages;
|
use App\Jobs\DeleteOldMessages;
|
||||||
use App\Jobs\FetchDigitalRecruiterOffers;
|
use App\Jobs\DeleteOldNotifications;
|
||||||
use App\Jobs\FetchMesBr;
|
use App\Jobs\DeleteOrders;
|
||||||
|
use App\Jobs\PurgeNotifications as JobsPurgeNotifications;
|
||||||
|
use App\Jobs\PurgeOldResetPasswords;
|
||||||
|
use App\Jobs\UpdateReductions as JobsUpdateReductions;
|
||||||
|
use App\Jobs\XmlEleveursReader as JobsXmlEleveursReader;
|
||||||
|
use App\Jobs\XmlIncoReader as JobsXmlIncoReader;
|
||||||
|
use App\Jobs\XmlTracaReader as JobsXmlTracaReader;
|
||||||
|
use App\Jobs\XSCVMepReader as JobsXSCVMepReader;
|
||||||
use Illuminate\Console\Scheduling\Schedule;
|
use Illuminate\Console\Scheduling\Schedule;
|
||||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||||
|
|
||||||
class Kernel extends ConsoleKernel
|
class Kernel extends ConsoleKernel
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Define the application's command schedule.
|
* The Artisan commands provided by your application.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected function schedule(Schedule $schedule): void
|
protected $commands = [
|
||||||
{
|
PurgeNotifications::class,
|
||||||
$schedule->job(FetchDigitalRecruiterOffers::class)->everyFourHours(15);
|
UpdateReductions::class,
|
||||||
$schedule->job(DeleteOldMessages::class)->dailyAt('14:15');
|
XmlEleveursReader::class,
|
||||||
$schedule->job(FetchMesBr::class)->daily();
|
XmlIncoReader::class,
|
||||||
}
|
XmlTracaReader::class,
|
||||||
|
UserCreate::class,
|
||||||
|
UserChangePassword::class,
|
||||||
|
XSCVMepReader::class,
|
||||||
|
LdcWebStatusChecker::class
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register the commands for the application.
|
* Define the application's command schedule.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function commands(): void
|
protected function schedule(Schedule $schedule)
|
||||||
{
|
{
|
||||||
$this->load(__DIR__ . '/Commands');
|
// $schedule->job(SendOcbMissingBreederReminder::class)->dailyAt('07:30');
|
||||||
|
$schedule->job(DeleteOrders::class)->dailyAt('14:00');
|
||||||
|
$schedule->job(DeleteOldMessages::class)->dailyAt('14:15');
|
||||||
|
$schedule->job(DeleteOldNotifications::class)->dailyAt('14:30');
|
||||||
|
$schedule->job(JobsUpdateReductions::class)->dailyAt('14:45');
|
||||||
|
$schedule->job(JobsXmlIncoReader::class)->name('xml-inco-reader')->dailyAt('15:00');
|
||||||
|
$schedule->job(JobsXmlTracaReader::class)->name('xml-traca-reader')->dailyAt('15:15');
|
||||||
|
$schedule->job(JobsXmlEleveursReader::class)->name('xml-eleveurs-reader')->dailyAt('15:30');
|
||||||
|
$schedule->job(JobsXSCVMepReader::class)->name('csv-mep-reader')->dailyAt('16:00');
|
||||||
|
$schedule->job(JobsPurgeNotifications::class)->dailyAt('00:15');
|
||||||
|
$schedule->job(PurgeOldResetPasswords::class)->dailyAt('00:25');
|
||||||
|
|
||||||
require base_path('routes/console.php');
|
// * Remove Old traca
|
||||||
|
$schedule->command('xml:clean_olds')->dailyAt('06:00');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\ActivityLogs;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum ActivityLogsEventEnum: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case created = 1;
|
|
||||||
case updated = 2;
|
|
||||||
case duplicated = 3;
|
|
||||||
case deleted = 4;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::created->name => 'Création',
|
|
||||||
self::updated->name => 'Mise à jour',
|
|
||||||
self::duplicated->name => 'Duplication',
|
|
||||||
self::deleted->name => 'Suppression',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Custom added classes definition
|
|
||||||
*/
|
|
||||||
private const BOOTSTRAPCLASS = [
|
|
||||||
self::created->name => 'success',
|
|
||||||
self::updated->name => 'warning',
|
|
||||||
self::duplicated->name => 'secondary',
|
|
||||||
self::deleted->name => 'danger',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Class
|
|
||||||
*/
|
|
||||||
public function bootstrapClass(): string
|
|
||||||
{
|
|
||||||
return self::BOOTSTRAPCLASS[$this->name];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Approaches;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum ApproachTypeEnum: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case label = 1;
|
|
||||||
case demarche = 2;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::label->name => 'validation.custom.label',
|
|
||||||
self::demarche->name => 'validation.custom.demarche',
|
|
||||||
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Arcadia;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum ArcadiaOrderType: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case cb = 1;
|
|
||||||
case check = 2;
|
|
||||||
}
|
|
||||||
31
app/Enums/ArticleCategory.php
Normal file
31
app/Enums/ArticleCategory.php
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self actu()
|
||||||
|
* @method static self jeux()
|
||||||
|
* @method static self video()
|
||||||
|
* @method static self sondage()
|
||||||
|
* @method static self astuce()
|
||||||
|
*/
|
||||||
|
final class ArticleCategory extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'actu' => __('Actus'),
|
||||||
|
'jeux' => __('Jeux-Concours'),
|
||||||
|
'video' => __('Vidéo'),
|
||||||
|
'sondage' => __('Sondage'),
|
||||||
|
'astuce' => __('Astuces')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Block;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum BlockContentTypeEnum: string
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case Cta = 'cta';
|
|
||||||
case Actu = 'actu';
|
|
||||||
case Both = 'both';
|
|
||||||
|
|
||||||
private const LABELS = [
|
|
||||||
'Cta' => 'Bouton',
|
|
||||||
'Actu' => 'Encart actu',
|
|
||||||
'Both' => 'Les deux',
|
|
||||||
];
|
|
||||||
|
|
||||||
public static function options(): array
|
|
||||||
{
|
|
||||||
return self::all();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function validationRule(): string
|
|
||||||
{
|
|
||||||
return 'required|in:' . implode(',', array_column(self::cases(), 'value'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Block;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum BlockPositionEnum: string
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case Gauche = 'gauche';
|
|
||||||
case Centre = 'centre';
|
|
||||||
case Droite = 'droite';
|
|
||||||
|
|
||||||
public const LABELS = [
|
|
||||||
'Gauche' => 'Gauche',
|
|
||||||
'Centre' => 'Centre',
|
|
||||||
'Droite' => 'Droite',
|
|
||||||
];
|
|
||||||
|
|
||||||
public static function options(): array
|
|
||||||
{
|
|
||||||
return self::all();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function validationRule(): string
|
|
||||||
{
|
|
||||||
return 'required|in:' . implode(',', array_column(self::cases(), 'value'));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function toBootstrap(): string
|
|
||||||
{
|
|
||||||
return match ($this) {
|
|
||||||
self::Gauche => 'start',
|
|
||||||
self::Centre => 'center',
|
|
||||||
self::Droite => 'end',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,127 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums;
|
|
||||||
|
|
||||||
use App\Enums\Block\BlockContentTypeEnum;
|
|
||||||
use App\Enums\Block\BlockPositionEnum;
|
|
||||||
use App\Models\News;
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum BlockTypeEnum: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case redirection = 1;
|
|
||||||
case picto = 2;
|
|
||||||
case bienfait = 3;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::redirection->name => 'Redirection',
|
|
||||||
self::picto->name => 'Pictogramme',
|
|
||||||
self::bienfait->name => 'Autres blocs',
|
|
||||||
];
|
|
||||||
|
|
||||||
public function defaultConfig(): array
|
|
||||||
{
|
|
||||||
return match ($this) {
|
|
||||||
self::redirection => [
|
|
||||||
'type' => self::redirection,
|
|
||||||
'data' => [
|
|
||||||
'position' => [
|
|
||||||
'label' => 'Position',
|
|
||||||
'inputType' => InputType::selectEnum->value,
|
|
||||||
'options' => BlockPositionEnum::options(),
|
|
||||||
'value' => 'gauche',
|
|
||||||
'validate' => BlockPositionEnum::validationRule(),
|
|
||||||
'required' => true,
|
|
||||||
],
|
|
||||||
'block_type' => [
|
|
||||||
'label' => 'Type de contenu',
|
|
||||||
'inputType' => InputType::selectEnum->value,
|
|
||||||
'options' => BlockContentTypeEnum::options(),
|
|
||||||
'value' => 'cta',
|
|
||||||
'validate' => BlockContentTypeEnum::validationRule(),
|
|
||||||
'required' => true,
|
|
||||||
],
|
|
||||||
'cta_url' => [
|
|
||||||
'label' => 'URL du bouton',
|
|
||||||
'inputType' => InputType::url->value,
|
|
||||||
'value' => null,
|
|
||||||
'validate' => 'required|url',
|
|
||||||
'required' => true,
|
|
||||||
'showWhen' => ['block_type' => [BlockContentTypeEnum::Cta->value, BlockContentTypeEnum::Both->value]],
|
|
||||||
],
|
|
||||||
'cta_label' => [
|
|
||||||
'label' => 'Nom du CTA',
|
|
||||||
'inputType' => InputType::string->value,
|
|
||||||
'value' => null,
|
|
||||||
'validate' => 'required|string|between:3,100',
|
|
||||||
'required' => true,
|
|
||||||
'showWhen' => ['block_type' => [BlockContentTypeEnum::Cta->value, BlockContentTypeEnum::Both->value]],
|
|
||||||
],
|
|
||||||
'article_id' => [
|
|
||||||
'label' => 'Article associé',
|
|
||||||
'inputType' => InputType::searchBelongsTo->value,
|
|
||||||
'source' => News::class,
|
|
||||||
'required' => true,
|
|
||||||
'value' => null,
|
|
||||||
'validate' => ['integer', 'exists:news,id'],
|
|
||||||
'showWhen' => ['block_type' => [BlockContentTypeEnum::Actu->value, BlockContentTypeEnum::Both->value]],
|
|
||||||
],
|
|
||||||
'visibility' => [
|
|
||||||
'label' => 'Afficher le bloc',
|
|
||||||
'inputType' => InputType::boolean->value,
|
|
||||||
'value' => false,
|
|
||||||
'validate' => 'required|boolean',
|
|
||||||
'required' => true,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
self::bienfait => [
|
|
||||||
'type' => self::bienfait,
|
|
||||||
'data' => [
|
|
||||||
'name_onglet' => [
|
|
||||||
'label' => 'Nom onglet :',
|
|
||||||
'inputType' => InputType::string->value,
|
|
||||||
'value' => null,
|
|
||||||
'validate' => 'required|string|between:3,100',
|
|
||||||
'required' => true,
|
|
||||||
],
|
|
||||||
'title' => [
|
|
||||||
'label' => 'Titre',
|
|
||||||
'inputType' => InputType::string->value,
|
|
||||||
'value' => '',
|
|
||||||
'validate' => 'required|string|between:3,255',
|
|
||||||
'required' => true,
|
|
||||||
],
|
|
||||||
'description' => [
|
|
||||||
'label' => 'Section 2 : Description',
|
|
||||||
'inputType' => InputType::text->value,
|
|
||||||
'value' => '',
|
|
||||||
'validate' => 'required|string|min:15',
|
|
||||||
'required' => true,
|
|
||||||
],
|
|
||||||
'picture' => [
|
|
||||||
'label' => 'Picto ',
|
|
||||||
'inputType' => InputType::image->value,
|
|
||||||
'dimensions' => [
|
|
||||||
'width' => 70,
|
|
||||||
'height' => 60,
|
|
||||||
],
|
|
||||||
'alt' => '',
|
|
||||||
'title' => '',
|
|
||||||
'value' => '',
|
|
||||||
'validate' => 'required',
|
|
||||||
'required' => true,
|
|
||||||
],
|
|
||||||
|
|
||||||
],
|
|
||||||
]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Breeders;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum GeoType: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case exact = 0;
|
|
||||||
case commune = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::exact->name => 'Exacte',
|
|
||||||
self::commune->name => 'Code commune',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Breeders;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum OCBStatus: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case none = 0;
|
|
||||||
case pending = 1;
|
|
||||||
case no = 2;
|
|
||||||
case yes = 3;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::none->name => 'Non',
|
|
||||||
self::pending->name => 'En attente',
|
|
||||||
self::no->name => 'Réfusé',
|
|
||||||
self::yes->name => 'Valide',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Breeders;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum OCBType: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case rabbit = 1;
|
|
||||||
case chicken = 2;
|
|
||||||
case turkey = 3;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::rabbit->name => 'Lapin',
|
|
||||||
self::chicken->name => 'Poulet',
|
|
||||||
self::turkey->name => 'Dinde',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Breeders;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum PresentationType: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case picture = 0;
|
|
||||||
case video = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::picture->name => 'Photo',
|
|
||||||
self::video->name => 'Video',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
36
app/Enums/BreedingBlocType.php
Normal file
36
app/Enums/BreedingBlocType.php
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self bloc1()
|
||||||
|
* Text et dropdowns array
|
||||||
|
*/
|
||||||
|
final class BreedingBlocType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'bloc1' => 0,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'bloc1' => __('Bloc 1, (Text et dropdowns array)')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
52
app/Enums/BreedingPageType.php
Normal file
52
app/Enums/BreedingPageType.php
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self breeding()
|
||||||
|
* @method static self job()
|
||||||
|
* @method static self food()
|
||||||
|
* @method static self health()
|
||||||
|
*/
|
||||||
|
final class BreedingPageType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
$labels = self::labels();
|
||||||
|
return [
|
||||||
|
'breeding' => Str::slug($labels['breeding']),
|
||||||
|
'job' => Str::slug($labels['job']),
|
||||||
|
'food' => Str::slug($labels['food']),
|
||||||
|
'health' => Str::slug($labels['health']),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attention avant de modifier ceci, celà aura
|
||||||
|
* un impact sur l'affichage du site puisque
|
||||||
|
* les labels servent de clé primaire
|
||||||
|
* au modèle BreedingPage
|
||||||
|
*
|
||||||
|
* Les label sont utilisé pour les slug nottament
|
||||||
|
* mais aussi pour identifier le type de page cf values()
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'breeding' => __('L\'élevage des volailles'),
|
||||||
|
'job' => __('Le métier d\'éleveur de volailles'),
|
||||||
|
'food' => __('L\'alimentation des volailles'),
|
||||||
|
'health' => __('La santé des volailles')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum CkEditorConfigName: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case minimal = 1;
|
|
||||||
case basic = 2;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::minimal->name => 'minimal',
|
|
||||||
self::basic->name => 'basic',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -2,22 +2,47 @@
|
||||||
|
|
||||||
namespace App\Enums;
|
namespace App\Enums;
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
enum ContactFormCivility: int
|
/**
|
||||||
|
* @method static self m()
|
||||||
|
* @method static self mme()
|
||||||
|
*/
|
||||||
|
final class ContactFormCivility extends BaseEnumRoutable
|
||||||
{
|
{
|
||||||
use BaseEnum;
|
/**
|
||||||
|
* Enum values
|
||||||
case m = 1;
|
*
|
||||||
case mme = 2;
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'm' => 1,
|
||||||
|
'mme' => 2
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optionnal labels definition.
|
* Enum labels
|
||||||
*
|
*
|
||||||
* @phpstan-ignore-next-line
|
* @return array
|
||||||
*/
|
*/
|
||||||
private const LABELS = [
|
protected static function labels(): array
|
||||||
self::m->name => 'M',
|
{
|
||||||
self::mme->name => 'Mme',
|
return [
|
||||||
];
|
'mme' => __('Mme'),
|
||||||
|
'm' => __('M')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Output the value as a string
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function __toString(): string
|
||||||
|
{
|
||||||
|
return (string)$this->label;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,143 +2,61 @@
|
||||||
|
|
||||||
namespace App\Enums;
|
namespace App\Enums;
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
enum ContactFormType: int
|
/**
|
||||||
|
* @method static self none()
|
||||||
|
* @method static self abuse()
|
||||||
|
* @method static self complain()
|
||||||
|
* @method static self recipe()
|
||||||
|
* @method static self games()
|
||||||
|
* @method static self onepage()
|
||||||
|
*/
|
||||||
|
final class ContactFormType extends BaseEnumRoutable
|
||||||
{
|
{
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case none = 0;
|
|
||||||
case club = 1;
|
|
||||||
case complain = 3;
|
|
||||||
case games = 9;
|
|
||||||
case nl = 10;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optionnal labels definition.
|
* Enum values
|
||||||
*
|
*
|
||||||
* @phpstan-ignore-next-line
|
* @return array
|
||||||
*/
|
*/
|
||||||
private const LABELS = [
|
protected static function values(): array
|
||||||
self::none->name => 'enums.contact-form-type.none.label',
|
|
||||||
self::complain->name => 'enums.contact-form-type.complain.label',
|
|
||||||
self::club->name => 'enums.contact-form-type.club.label',
|
|
||||||
self::games->name => 'enums.contact-form-type.games.label',
|
|
||||||
self::nl->name => 'enums.contact-form-type.nl.label',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the description.
|
|
||||||
*/
|
|
||||||
public function description(): string
|
|
||||||
{
|
{
|
||||||
return match ($this) {
|
|
||||||
self::none => trans('enums.contact-form-type.none.description'),
|
|
||||||
self::complain => trans('enums.contact-form-type.complain.description'),
|
|
||||||
self::club => trans('enums.contact-form-type.club.description'),
|
|
||||||
self::games => trans('enums.contact-form-type.games.description'),
|
|
||||||
default => '',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the picto src/alt.
|
|
||||||
*/
|
|
||||||
public function picto(): array
|
|
||||||
{
|
|
||||||
return match ($this) {
|
|
||||||
self::complain => [
|
|
||||||
'src' => 'resources/assets/images/contact/exclamation.svg',
|
|
||||||
'alt' => 'enums.contact-form-type.misc.picto-exclamation-alt',
|
|
||||||
],
|
|
||||||
self::club,
|
|
||||||
self::games,
|
|
||||||
self::none => [
|
|
||||||
'src' => 'resources/assets/images/contact/question-mark.svg',
|
|
||||||
'alt' => 'enums.contact-form-type.misc.picto-question-mark-alt',
|
|
||||||
],
|
|
||||||
default => [
|
|
||||||
'src' => '',
|
|
||||||
'alt' => '',
|
|
||||||
],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all contact types except 'none'.
|
|
||||||
*/
|
|
||||||
public static function getContactTypes(): array
|
|
||||||
{
|
|
||||||
if (request()->routeIs('fo.*.export')) {
|
|
||||||
return [
|
|
||||||
self::complain,
|
|
||||||
self::none,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
self::complain,
|
'none' => 0,
|
||||||
self::club,
|
'abuse' => 1,
|
||||||
self::games,
|
// * special case passerelle
|
||||||
self::none,
|
'complain' => 3,
|
||||||
|
'recipe' => 5,
|
||||||
|
'games' => 9,
|
||||||
|
// * special case page nl
|
||||||
|
'onepage' => 10,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all 'locales' contact types.
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function getLocalesContactType(): array
|
protected static function labels(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
self::nl,
|
'none' => trans('Aucun'),
|
||||||
|
'abuse' => trans('Le Club des Gaulois et Les Départ’aimants'),
|
||||||
|
'complain' => __('Réclamation Produit'),
|
||||||
|
'recipe' => __('Les Recettes'),
|
||||||
|
'games' => __('Les Jeux'),
|
||||||
|
'onepage' => 'Used for one page'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the current subject has a file input.
|
* Output the value as a string
|
||||||
*/
|
|
||||||
public function hasFileInput(): bool
|
|
||||||
{
|
|
||||||
return match ($this) {
|
|
||||||
self::complain,
|
|
||||||
self::club,
|
|
||||||
self::games => true,
|
|
||||||
default => false,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// * CRM CUBJECTS
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the CRM subject ID for the current enum case.
|
|
||||||
*/
|
|
||||||
public function crmId(): ?string
|
|
||||||
{
|
|
||||||
return self::getCrmSubjects()[$this->name] ?? null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all CRM subject IDs keyed by enum case name.
|
|
||||||
*
|
*
|
||||||
* @return array<string, string>
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function crmIds(): array
|
public function __toString(): string
|
||||||
{
|
{
|
||||||
$subjects = self::getCrmSubjects();
|
return (string)$this->label;
|
||||||
$subjectIds = collect(self::cases())
|
|
||||||
->mapWithKeys(fn ($case) => [$case->name => $subjects[$case->name] ?? null])
|
|
||||||
->all();
|
|
||||||
|
|
||||||
return array_filter($subjectIds, fn ($v) => ! is_null($v));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get CRM subjects config as an array.
|
|
||||||
*
|
|
||||||
* @return array<string, string>
|
|
||||||
*/
|
|
||||||
private static function getCrmSubjects(): array
|
|
||||||
{
|
|
||||||
return json_decode(config('crm.subjects'), true) ?? [];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Customers;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
use Illuminate\Support\Facades\Vite;
|
|
||||||
|
|
||||||
enum Civility: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case m = 1;
|
|
||||||
case mme = 2;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::m->name => 'Un poulet',
|
|
||||||
self::mme->name => 'Une poule',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get picture
|
|
||||||
*/
|
|
||||||
public function picture(): string
|
|
||||||
{
|
|
||||||
return match ($this) {
|
|
||||||
self::m => Vite::asset('resources/assets/images/club/game-points/chicken.png'),
|
|
||||||
self::mme => Vite::asset('resources/assets/images/club/game-points/hen.png'),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get autocomplete
|
|
||||||
*/
|
|
||||||
public function autoComplete(): string
|
|
||||||
{
|
|
||||||
return match ($this) {
|
|
||||||
self::m => 'Monsieur',
|
|
||||||
self::mme => 'Madame',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Customers;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum LivingStatus: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case teenage = 1;
|
|
||||||
case youngAdult = 2;
|
|
||||||
case parent = 3;
|
|
||||||
case parentAlone = 4;
|
|
||||||
case elder = 5;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::teenage->name => 'Adolescent/Étudiant',
|
|
||||||
self::youngAdult->name => 'Jeune actif sans enfant',
|
|
||||||
self::parent->name => 'Parents',
|
|
||||||
self::parentAlone->name => 'Adulte sans enfant',
|
|
||||||
self::elder->name => 'Grand-parent',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
38
app/Enums/DansLesPresType.php
Normal file
38
app/Enums/DansLesPresType.php
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self description()
|
||||||
|
* @method static self media()
|
||||||
|
*/
|
||||||
|
final class DansLesPresType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'description' => 0,
|
||||||
|
'media' => 1,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'description' => __('La demarche en description'),
|
||||||
|
'media' => __('La demarche en media'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
77
app/Enums/Days.php
Normal file
77
app/Enums/Days.php
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self none()
|
||||||
|
* @method static self mon()
|
||||||
|
* @method static self tue()
|
||||||
|
* @method static self wed()
|
||||||
|
* @method static self thu()
|
||||||
|
* @method static self fri()
|
||||||
|
* @method static self sat()
|
||||||
|
* @method static self sun()
|
||||||
|
*/
|
||||||
|
final class Days extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'none' => 0,
|
||||||
|
'mon' => 1,
|
||||||
|
'tue' => 1 << 1,
|
||||||
|
'wed' => 1 << 2,
|
||||||
|
'thu' => 1 << 3,
|
||||||
|
'fri' => 1 << 4,
|
||||||
|
'sat' => 1 << 5,
|
||||||
|
'sun' => 1 << 6,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'none' => __('None'),
|
||||||
|
'mon' => __('Monday'),
|
||||||
|
'tue' => __('Tuesday'),
|
||||||
|
'wed' => __('Wednesday'),
|
||||||
|
'thu' => __('Thursday'),
|
||||||
|
'fri' => __('Friday'),
|
||||||
|
'sat' => __('Saturday'),
|
||||||
|
'sun' => __('Sunday')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Output the value as a string
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function __toString(): string
|
||||||
|
{
|
||||||
|
return (string)$this->label;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if days contain this day
|
||||||
|
*
|
||||||
|
* @param integer $days
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function has(int $days)
|
||||||
|
{
|
||||||
|
return (bool)($this->value & $days);
|
||||||
|
}
|
||||||
|
}
|
||||||
32
app/Enums/Departaimant.php
Normal file
32
app/Enums/Departaimant.php
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
abstract class Departaimant extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Output the value as a string
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function __toString(): string
|
||||||
|
{
|
||||||
|
return (string)$this->label;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get All departaimants
|
||||||
|
*
|
||||||
|
* @return array<Departaimant>
|
||||||
|
*/
|
||||||
|
public static function all(): array
|
||||||
|
{
|
||||||
|
$o = [];
|
||||||
|
foreach (static::toArray() as $value => $label) {
|
||||||
|
$o[] = static::make($value);
|
||||||
|
}
|
||||||
|
return $o;
|
||||||
|
}
|
||||||
|
}
|
||||||
51
app/Enums/DepartaimantCollectionType.php
Normal file
51
app/Enums/DepartaimantCollectionType.php
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self vintage()
|
||||||
|
* @method static self current()
|
||||||
|
*/
|
||||||
|
final class DepartaimantCollectionType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'vintage' => 0,
|
||||||
|
'current' => 1,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum label
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'vintage' => __('Collection Vintage'),
|
||||||
|
'current' => __('Collection Actuelle')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Json serialize implementation.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function jsonSerialize(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'value' => $this->value,
|
||||||
|
'label' => $this->label
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
333
app/Enums/DepartaimantCurrent.php
Normal file
333
app/Enums/DepartaimantCurrent.php
Normal file
|
|
@ -0,0 +1,333 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self ain()
|
||||||
|
* @method static self aisne()
|
||||||
|
* @method static self allier()
|
||||||
|
* @method static self alpesdehauteprovence()
|
||||||
|
* @method static self hautesalpes()
|
||||||
|
* @method static self alpesmaritimes()
|
||||||
|
* @method static self ardeche()
|
||||||
|
* @method static self ardennes()
|
||||||
|
* @method static self ariege()
|
||||||
|
* @method static self aube()
|
||||||
|
* @method static self aude()
|
||||||
|
* @method static self aveyron()
|
||||||
|
* @method static self bouchesdurhone()
|
||||||
|
* @method static self calvados()
|
||||||
|
* @method static self cantal()
|
||||||
|
* @method static self charente()
|
||||||
|
* @method static self charentemaritime()
|
||||||
|
* @method static self cher()
|
||||||
|
* @method static self correze()
|
||||||
|
* @method static self corsedusud()
|
||||||
|
* @method static self hautecorse()
|
||||||
|
* @method static self cotedor()
|
||||||
|
* @method static self cotesdarmor()
|
||||||
|
* @method static self creuse()
|
||||||
|
* @method static self dordogne()
|
||||||
|
* @method static self doubs()
|
||||||
|
* @method static self drome()
|
||||||
|
* @method static self eure()
|
||||||
|
* @method static self eureetloir()
|
||||||
|
* @method static self finistere()
|
||||||
|
* @method static self gard()
|
||||||
|
* @method static self hautegaronne()
|
||||||
|
* @method static self gers()
|
||||||
|
* @method static self gironde()
|
||||||
|
* @method static self herault()
|
||||||
|
* @method static self illeetvilaine()
|
||||||
|
* @method static self indre()
|
||||||
|
* @method static self indreetloire()
|
||||||
|
* @method static self isere()
|
||||||
|
* @method static self jura()
|
||||||
|
* @method static self landes()
|
||||||
|
* @method static self loiretcher()
|
||||||
|
* @method static self loire()
|
||||||
|
* @method static self hauteloire()
|
||||||
|
* @method static self loireatlantique()
|
||||||
|
* @method static self loiret()
|
||||||
|
* @method static self lot()
|
||||||
|
* @method static self lotetgaronne()
|
||||||
|
* @method static self lozere()
|
||||||
|
* @method static self maineetloire()
|
||||||
|
* @method static self manche()
|
||||||
|
* @method static self marne()
|
||||||
|
* @method static self hautemarne()
|
||||||
|
* @method static self mayenne()
|
||||||
|
* @method static self meurtheetmoselle()
|
||||||
|
* @method static self meuse()
|
||||||
|
* @method static self morbihan()
|
||||||
|
* @method static self moselle()
|
||||||
|
* @method static self nievre()
|
||||||
|
* @method static self nord()
|
||||||
|
* @method static self oise()
|
||||||
|
* @method static self orne()
|
||||||
|
* @method static self pasdecalais()
|
||||||
|
* @method static self puydedome()
|
||||||
|
* @method static self pyreneesatlantiques()
|
||||||
|
* @method static self hautespyrenees()
|
||||||
|
* @method static self pyreneesorientales()
|
||||||
|
* @method static self basrhin()
|
||||||
|
* @method static self hautrhin()
|
||||||
|
* @method static self rhone()
|
||||||
|
* @method static self hautesaone()
|
||||||
|
* @method static self saoneetloire()
|
||||||
|
* @method static self sarthe()
|
||||||
|
* @method static self savoie()
|
||||||
|
* @method static self hautesavoie()
|
||||||
|
* @method static self paris()
|
||||||
|
* @method static self seinemaritime()
|
||||||
|
* @method static self seineetmarne()
|
||||||
|
* @method static self yvelines()
|
||||||
|
* @method static self deuxsevres()
|
||||||
|
* @method static self somme()
|
||||||
|
* @method static self tarn()
|
||||||
|
* @method static self tarnetgaronne()
|
||||||
|
* @method static self var()
|
||||||
|
* @method static self vaucluse()
|
||||||
|
* @method static self vendee()
|
||||||
|
* @method static self vienne()
|
||||||
|
* @method static self hautevienne()
|
||||||
|
* @method static self vosges()
|
||||||
|
* @method static self yonne()
|
||||||
|
* @method static self territoiredebelfort()
|
||||||
|
* @method static self essonne()
|
||||||
|
* @method static self hautsdeseine()
|
||||||
|
* @method static self seinesaintdenis()
|
||||||
|
* @method static self valdemarne()
|
||||||
|
* @method static self valdoise()
|
||||||
|
* @method static self guadeloupe()
|
||||||
|
* @method static self martinique()
|
||||||
|
* @method static self guyane()
|
||||||
|
* @method static self lareunion()
|
||||||
|
* @method static self mayotte()
|
||||||
|
*/
|
||||||
|
final class DepartaimantCurrent extends Departaimant
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'ain' => '01',
|
||||||
|
'aisne' => '02',
|
||||||
|
'allier' => '03',
|
||||||
|
'alpesdehauteprovence' => '04',
|
||||||
|
'hautesalpes' => '05',
|
||||||
|
'alpesmaritimes' => '06',
|
||||||
|
'ardeche' => '07',
|
||||||
|
'ardennes' => '08',
|
||||||
|
'ariege' => '09',
|
||||||
|
'aube' => '10',
|
||||||
|
'aude' => '11',
|
||||||
|
'aveyron' => '12',
|
||||||
|
'bouchesdurhone' => '13',
|
||||||
|
'calvados' => '14',
|
||||||
|
'cantal' => '15',
|
||||||
|
'charente' => '16',
|
||||||
|
'charentemaritime' => '17',
|
||||||
|
'cher' => '18',
|
||||||
|
'correze' => '19',
|
||||||
|
'corsedusud' => '2A',
|
||||||
|
'hautecorse' => '2B',
|
||||||
|
'cotedor' => '21',
|
||||||
|
'cotesdarmor' => '22',
|
||||||
|
'creuse' => '23',
|
||||||
|
'dordogne' => '24',
|
||||||
|
'doubs' => '25',
|
||||||
|
'drome' => '26',
|
||||||
|
'eure' => '27',
|
||||||
|
'eureetloir' => '28',
|
||||||
|
'finistere' => '29',
|
||||||
|
'gard' => '30',
|
||||||
|
'hautegaronne' => '31',
|
||||||
|
'gers' => '32',
|
||||||
|
'gironde' => '33',
|
||||||
|
'herault' => '34',
|
||||||
|
'illeetvilaine' => '35',
|
||||||
|
'indre' => '36',
|
||||||
|
'indreetloire' => '37',
|
||||||
|
'isere' => '38',
|
||||||
|
'jura' => '39',
|
||||||
|
'landes' => '40',
|
||||||
|
'loiretcher' => '41',
|
||||||
|
'loire' => '42',
|
||||||
|
'hauteloire' => '43',
|
||||||
|
'loireatlantique' => '44',
|
||||||
|
'loiret' => '45',
|
||||||
|
'lot' => '46',
|
||||||
|
'lotetgaronne' => '47',
|
||||||
|
'lozere' => '48',
|
||||||
|
'maineetloire' => '49',
|
||||||
|
'manche' => '50',
|
||||||
|
'marne' => '51',
|
||||||
|
'hautemarne' => '52',
|
||||||
|
'mayenne' => '53',
|
||||||
|
'meurtheetmoselle' => '54',
|
||||||
|
'meuse' => '55',
|
||||||
|
'morbihan' => '56',
|
||||||
|
'moselle' => '57',
|
||||||
|
'nievre' => '58',
|
||||||
|
'nord' => '59',
|
||||||
|
'oise' => '60',
|
||||||
|
'orne' => '61',
|
||||||
|
'pasdecalais' => '62',
|
||||||
|
'puydedome' => '63',
|
||||||
|
'pyreneesatlantiques' => '64',
|
||||||
|
'hautespyrenees' => '65',
|
||||||
|
'pyreneesorientales' => '66',
|
||||||
|
'basrhin' => '67',
|
||||||
|
'hautrhin' => '68',
|
||||||
|
'rhone' => '69',
|
||||||
|
'hautesaone' => '70',
|
||||||
|
'saoneetloire' => '71',
|
||||||
|
'sarthe' => '72',
|
||||||
|
'savoie' => '73',
|
||||||
|
'hautesavoie' => '74',
|
||||||
|
'paris' => '75',
|
||||||
|
'seinemaritime' => '76',
|
||||||
|
'seineetmarne' => '77',
|
||||||
|
'yvelines' => '78',
|
||||||
|
'deuxsevres' => '79',
|
||||||
|
'somme' => '80',
|
||||||
|
'tarn' => '81',
|
||||||
|
'tarnetgaronne' => '82',
|
||||||
|
'var' => '83',
|
||||||
|
'vaucluse' => '84',
|
||||||
|
'vendee' => '85',
|
||||||
|
'vienne' => '86',
|
||||||
|
'hautevienne' => '87',
|
||||||
|
'vosges' => '88',
|
||||||
|
'yonne' => '89',
|
||||||
|
'territoiredebelfort' => '90',
|
||||||
|
'essonne' => '91',
|
||||||
|
'hautsdeseine' => '92',
|
||||||
|
'seinesaintdenis' => '93',
|
||||||
|
'valdemarne' => '94',
|
||||||
|
'valdoise' => '95',
|
||||||
|
'guadeloupe' => '971',
|
||||||
|
'martinique' => '972',
|
||||||
|
'guyane' => '973',
|
||||||
|
'lareunion' => '974',
|
||||||
|
'mayotte' => '976'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum label
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'ain' => 'Ain',
|
||||||
|
'aisne' => 'Aisne',
|
||||||
|
'allier' => 'Allier',
|
||||||
|
'alpesdehauteprovence' => 'Alpes-de-Haute-Provence',
|
||||||
|
'hautesalpes' => 'Hautes-alpes',
|
||||||
|
'alpesmaritimes' => 'Alpes-maritimes',
|
||||||
|
'ardeche' => 'Ardèche',
|
||||||
|
'ardennes' => 'Ardennes',
|
||||||
|
'ariege' => 'Ariège',
|
||||||
|
'aube' => 'Aube',
|
||||||
|
'aude' => 'Aude',
|
||||||
|
'aveyron' => 'Aveyron',
|
||||||
|
'bouchesdurhone' => 'Bouches-du-Rhône',
|
||||||
|
'calvados' => 'Calvados',
|
||||||
|
'cantal' => 'Cantal',
|
||||||
|
'charente' => 'Charente',
|
||||||
|
'charentemaritime' => 'Charente-maritime',
|
||||||
|
'cher' => 'Cher',
|
||||||
|
'correze' => 'Corrèze',
|
||||||
|
'corsedusud' => 'Corse-du-sud',
|
||||||
|
'hautecorse' => 'Haute-Corse',
|
||||||
|
'cotedor' => 'Côte-d\'Or',
|
||||||
|
'cotesdarmor' => 'Côtes-d\'Armor',
|
||||||
|
'creuse' => 'Creuse',
|
||||||
|
'dordogne' => 'Dordogne',
|
||||||
|
'doubs' => 'Doubs',
|
||||||
|
'drome' => 'Drôme',
|
||||||
|
'eure' => 'Eure',
|
||||||
|
'eureetloir' => 'Eure-et-loir',
|
||||||
|
'finistere' => 'Finistère',
|
||||||
|
'gard' => 'Gard',
|
||||||
|
'hautegaronne' => 'Haute-garonne',
|
||||||
|
'gers' => 'Gers',
|
||||||
|
'gironde' => 'Gironde',
|
||||||
|
'herault' => 'Hérault',
|
||||||
|
'illeetvilaine' => 'Ille-et-vilaine',
|
||||||
|
'indre' => 'Indre',
|
||||||
|
'indreetloire' => 'Indre-et-loire',
|
||||||
|
'isere' => 'Isère',
|
||||||
|
'jura' => 'Jura',
|
||||||
|
'landes' => 'Landes',
|
||||||
|
'loiretcher' => 'Loir-et-cher',
|
||||||
|
'loire' => 'Loire',
|
||||||
|
'hauteloire' => 'Haute-loire',
|
||||||
|
'loireatlantique' => 'Loire-atlantique',
|
||||||
|
'loiret' => 'Loiret',
|
||||||
|
'lot' => 'Lot',
|
||||||
|
'lotetgaronne' => 'Lot-et-garonne',
|
||||||
|
'lozere' => 'Lozère',
|
||||||
|
'maineetloire' => 'Maine-et-loire',
|
||||||
|
'manche' => 'Manche',
|
||||||
|
'marne' => 'Marne',
|
||||||
|
'hautemarne' => 'Haute-marne',
|
||||||
|
'mayenne' => 'Mayenne',
|
||||||
|
'meurtheetmoselle' => 'Meurthe-et-moselle',
|
||||||
|
'meuse' => 'Meuse',
|
||||||
|
'morbihan' => 'Morbihan',
|
||||||
|
'moselle' => 'Moselle',
|
||||||
|
'nievre' => 'Nièvre',
|
||||||
|
'nord' => 'Nord',
|
||||||
|
'oise' => 'Oise',
|
||||||
|
'orne' => 'Orne',
|
||||||
|
'pasdecalais' => 'Pas-de-calais',
|
||||||
|
'puydedome' => 'Puy-de-dôme',
|
||||||
|
'pyreneesatlantiques' => 'Pyrénées-atlantiques',
|
||||||
|
'hautespyrenees' => 'Hautes-Pyrénées',
|
||||||
|
'pyreneesorientales' => 'Pyrénées-orientales',
|
||||||
|
'basrhin' => 'Bas-rhin',
|
||||||
|
'hautrhin' => 'Haut-rhin',
|
||||||
|
'rhone' => 'Rhône',
|
||||||
|
'hautesaone' => 'Haute-saône',
|
||||||
|
'saoneetloire' => 'Saône-et-loire',
|
||||||
|
'sarthe' => 'Sarthe',
|
||||||
|
'savoie' => 'Savoie',
|
||||||
|
'hautesavoie' => 'Haute-savoie',
|
||||||
|
'paris' => 'Paris',
|
||||||
|
'seinemaritime' => 'Seine-maritime',
|
||||||
|
'seineetmarne' => 'Seine-et-marne',
|
||||||
|
'yvelines' => 'Yvelines',
|
||||||
|
'deuxsevres' => 'Deux-sèvres',
|
||||||
|
'somme' => 'Somme',
|
||||||
|
'tarn' => 'Tarn',
|
||||||
|
'tarnetgaronne' => 'Tarn-et-Garonne',
|
||||||
|
'var' => 'Var',
|
||||||
|
'vaucluse' => 'Vaucluse',
|
||||||
|
'vendee' => 'Vendée',
|
||||||
|
'vienne' => 'Vienne',
|
||||||
|
'hautevienne' => 'Haute-vienne',
|
||||||
|
'vosges' => 'Vosges',
|
||||||
|
'yonne' => 'Yonne',
|
||||||
|
'territoiredebelfort' => 'Territoire de belfort',
|
||||||
|
'essonne' => 'Essonne',
|
||||||
|
'hautsdeseine' => 'Hauts-de-seine',
|
||||||
|
'seinesaintdenis' => 'Seine-Saint-Denis',
|
||||||
|
'valdemarne' => 'Val-de-marne',
|
||||||
|
'valdoise' => 'Val-d\'Oise',
|
||||||
|
'guadeloupe' => 'Guadeloupe',
|
||||||
|
'martinique' => 'Martinique',
|
||||||
|
'guyane' => 'Guyane',
|
||||||
|
'lareunion' => 'La réunion',
|
||||||
|
'mayotte' => 'Mayotte'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
84
app/Enums/DepartaimantStatus.php
Normal file
84
app/Enums/DepartaimantStatus.php
Normal file
|
|
@ -0,0 +1,84 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self none()
|
||||||
|
* @method static self has()
|
||||||
|
* @method static self wants()
|
||||||
|
* @method static self gives()
|
||||||
|
*/
|
||||||
|
final class DepartaimantStatus extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'none' => 0,
|
||||||
|
'has' => 1,
|
||||||
|
'gives' => 2,
|
||||||
|
'wants' => 3,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'none' => __('Non possédé'),
|
||||||
|
'has' => __('Je possède'),
|
||||||
|
'gives' => __("J'échange"),
|
||||||
|
'wants' => __('Je cherche'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Output the value as a string
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function __toString(): string
|
||||||
|
{
|
||||||
|
return (string)$this->label;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To Array
|
||||||
|
*
|
||||||
|
* @return \Kwaadpepper\Enum\BaseEnum[]
|
||||||
|
*/
|
||||||
|
public static function toArray(): array
|
||||||
|
{
|
||||||
|
$array = [];
|
||||||
|
foreach (parent::toArray() as $enum) {
|
||||||
|
$array[$enum->getDefinition()] = [
|
||||||
|
'value' => $enum->value,
|
||||||
|
'label' => $enum->label
|
||||||
|
];
|
||||||
|
}
|
||||||
|
return $array;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Json serialize implementation.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function jsonSerialize(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'value' => $this->value,
|
||||||
|
'label' => \stripslashes($this->label)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
327
app/Enums/DepartaimantVintage.php
Normal file
327
app/Enums/DepartaimantVintage.php
Normal file
|
|
@ -0,0 +1,327 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self ain()
|
||||||
|
* @method static self aisne()
|
||||||
|
* @method static self allier()
|
||||||
|
* @method static self alpesdehauteprovence()
|
||||||
|
* @method static self hautesalpes()
|
||||||
|
* @method static self alpesmaritimes()
|
||||||
|
* @method static self ardeche()
|
||||||
|
* @method static self ardennes()
|
||||||
|
* @method static self ariege()
|
||||||
|
* @method static self aube()
|
||||||
|
* @method static self aude()
|
||||||
|
* @method static self aveyron()
|
||||||
|
* @method static self bouchesdurhone()
|
||||||
|
* @method static self calvados()
|
||||||
|
* @method static self cantal()
|
||||||
|
* @method static self charente()
|
||||||
|
* @method static self charentemaritime()
|
||||||
|
* @method static self cher()
|
||||||
|
* @method static self correze()
|
||||||
|
* @method static self corsedusud()
|
||||||
|
* @method static self hautecorse()
|
||||||
|
* @method static self cotedor()
|
||||||
|
* @method static self cotesdarmor()
|
||||||
|
* @method static self creuse()
|
||||||
|
* @method static self dordogne()
|
||||||
|
* @method static self doubs()
|
||||||
|
* @method static self drome()
|
||||||
|
* @method static self eure()
|
||||||
|
* @method static self eureetloir()
|
||||||
|
* @method static self finistere()
|
||||||
|
* @method static self gard()
|
||||||
|
* @method static self hautegaronne()
|
||||||
|
* @method static self gers()
|
||||||
|
* @method static self gironde()
|
||||||
|
* @method static self herault()
|
||||||
|
* @method static self illeetvilaine()
|
||||||
|
* @method static self indre()
|
||||||
|
* @method static self indreetloire()
|
||||||
|
* @method static self isere()
|
||||||
|
* @method static self jura()
|
||||||
|
* @method static self landes()
|
||||||
|
* @method static self loiretcher()
|
||||||
|
* @method static self loire()
|
||||||
|
* @method static self hauteloire()
|
||||||
|
* @method static self loireatlantique()
|
||||||
|
* @method static self loiret()
|
||||||
|
* @method static self lot()
|
||||||
|
* @method static self lotetgaronne()
|
||||||
|
* @method static self lozere()
|
||||||
|
* @method static self maineetloire()
|
||||||
|
* @method static self manche()
|
||||||
|
* @method static self marne()
|
||||||
|
* @method static self hautemarne()
|
||||||
|
* @method static self mayenne()
|
||||||
|
* @method static self meurtheetmoselle()
|
||||||
|
* @method static self meuse()
|
||||||
|
* @method static self morbihan()
|
||||||
|
* @method static self moselle()
|
||||||
|
* @method static self nievre()
|
||||||
|
* @method static self nord()
|
||||||
|
* @method static self oise()
|
||||||
|
* @method static self orne()
|
||||||
|
* @method static self pasdecalais()
|
||||||
|
* @method static self puydedome()
|
||||||
|
* @method static self pyreneesatlantiques()
|
||||||
|
* @method static self hautespyrenees()
|
||||||
|
* @method static self pyreneesorientales()
|
||||||
|
* @method static self basrhin()
|
||||||
|
* @method static self hautrhin()
|
||||||
|
* @method static self rhone()
|
||||||
|
* @method static self hautesaone()
|
||||||
|
* @method static self saoneetloire()
|
||||||
|
* @method static self sarthe()
|
||||||
|
* @method static self savoie()
|
||||||
|
* @method static self hautesavoie()
|
||||||
|
* @method static self paris()
|
||||||
|
* @method static self seinemaritime()
|
||||||
|
* @method static self seineetmarne()
|
||||||
|
* @method static self yvelines()
|
||||||
|
* @method static self deuxsevres()
|
||||||
|
* @method static self somme()
|
||||||
|
* @method static self tarn()
|
||||||
|
* @method static self tarnetgaronne()
|
||||||
|
* @method static self var()
|
||||||
|
* @method static self vaucluse()
|
||||||
|
* @method static self vendee()
|
||||||
|
* @method static self vienne()
|
||||||
|
* @method static self hautevienne()
|
||||||
|
* @method static self vosges()
|
||||||
|
* @method static self yonne()
|
||||||
|
* @method static self territoiredebelfort()
|
||||||
|
* @method static self essonne()
|
||||||
|
* @method static self hautsdeseine()
|
||||||
|
* @method static self seinesaintdenis()
|
||||||
|
* @method static self valdemarne()
|
||||||
|
* @method static self valdoise()
|
||||||
|
* @method static self guadeloupeMartinique()
|
||||||
|
* @method static self guyane()
|
||||||
|
* @method static self lareunion()
|
||||||
|
*/
|
||||||
|
final class DepartaimantVintage extends Departaimant
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'ain' => '01',
|
||||||
|
'aisne' => '02',
|
||||||
|
'allier' => '03',
|
||||||
|
'alpesdehauteprovence' => '04',
|
||||||
|
'hautesalpes' => '05',
|
||||||
|
'alpesmaritimes' => '06',
|
||||||
|
'ardeche' => '07',
|
||||||
|
'ardennes' => '08',
|
||||||
|
'ariege' => '09',
|
||||||
|
'aube' => '10',
|
||||||
|
'aude' => '11',
|
||||||
|
'aveyron' => '12',
|
||||||
|
'bouchesdurhone' => '13',
|
||||||
|
'calvados' => '14',
|
||||||
|
'cantal' => '15',
|
||||||
|
'charente' => '16',
|
||||||
|
'charentemaritime' => '17',
|
||||||
|
'cher' => '18',
|
||||||
|
'correze' => '19',
|
||||||
|
'corsedusud' => '2A',
|
||||||
|
'hautecorse' => '2B',
|
||||||
|
'cotedor' => '21',
|
||||||
|
'cotesdarmor' => '22',
|
||||||
|
'creuse' => '23',
|
||||||
|
'dordogne' => '24',
|
||||||
|
'doubs' => '25',
|
||||||
|
'drome' => '26',
|
||||||
|
'eure' => '27',
|
||||||
|
'eureetloir' => '28',
|
||||||
|
'finistere' => '29',
|
||||||
|
'gard' => '30',
|
||||||
|
'hautegaronne' => '31',
|
||||||
|
'gers' => '32',
|
||||||
|
'gironde' => '33',
|
||||||
|
'herault' => '34',
|
||||||
|
'illeetvilaine' => '35',
|
||||||
|
'indre' => '36',
|
||||||
|
'indreetloire' => '37',
|
||||||
|
'isere' => '38',
|
||||||
|
'jura' => '39',
|
||||||
|
'landes' => '40',
|
||||||
|
'loiretcher' => '41',
|
||||||
|
'loire' => '42',
|
||||||
|
'hauteloire' => '43',
|
||||||
|
'loireatlantique' => '44',
|
||||||
|
'loiret' => '45',
|
||||||
|
'lot' => '46',
|
||||||
|
'lotetgaronne' => '47',
|
||||||
|
'lozere' => '48',
|
||||||
|
'maineetloire' => '49',
|
||||||
|
'manche' => '50',
|
||||||
|
'marne' => '51',
|
||||||
|
'hautemarne' => '52',
|
||||||
|
'mayenne' => '53',
|
||||||
|
'meurtheetmoselle' => '54',
|
||||||
|
'meuse' => '55',
|
||||||
|
'morbihan' => '56',
|
||||||
|
'moselle' => '57',
|
||||||
|
'nievre' => '58',
|
||||||
|
'nord' => '59',
|
||||||
|
'oise' => '60',
|
||||||
|
'orne' => '61',
|
||||||
|
'pasdecalais' => '62',
|
||||||
|
'puydedome' => '63',
|
||||||
|
'pyreneesatlantiques' => '64',
|
||||||
|
'hautespyrenees' => '65',
|
||||||
|
'pyreneesorientales' => '66',
|
||||||
|
'basrhin' => '67',
|
||||||
|
'hautrhin' => '68',
|
||||||
|
'rhone' => '69',
|
||||||
|
'hautesaone' => '70',
|
||||||
|
'saoneetloire' => '71',
|
||||||
|
'sarthe' => '72',
|
||||||
|
'savoie' => '73',
|
||||||
|
'hautesavoie' => '74',
|
||||||
|
'paris' => '75',
|
||||||
|
'seinemaritime' => '76',
|
||||||
|
'seineetmarne' => '77',
|
||||||
|
'yvelines' => '78',
|
||||||
|
'deuxsevres' => '79',
|
||||||
|
'somme' => '80',
|
||||||
|
'tarn' => '81',
|
||||||
|
'tarnetgaronne' => '82',
|
||||||
|
'var' => '83',
|
||||||
|
'vaucluse' => '84',
|
||||||
|
'vendee' => '85',
|
||||||
|
'vienne' => '86',
|
||||||
|
'hautevienne' => '87',
|
||||||
|
'vosges' => '88',
|
||||||
|
'yonne' => '89',
|
||||||
|
'territoiredebelfort' => '90',
|
||||||
|
'essonne' => '91',
|
||||||
|
'hautsdeseine' => '92',
|
||||||
|
'seinesaintdenis' => '93',
|
||||||
|
'valdemarne' => '94',
|
||||||
|
'valdoise' => '95',
|
||||||
|
'guadeloupeMartinique' => '971/972',
|
||||||
|
'guyane' => '973',
|
||||||
|
'lareunion' => '974',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'ain' => 'Ain',
|
||||||
|
'aisne' => 'Aisne',
|
||||||
|
'allier' => 'Allier',
|
||||||
|
'alpesdehauteprovence' => 'Alpes-de-Haute-Provence',
|
||||||
|
'hautesalpes' => 'Hautes-alpes',
|
||||||
|
'alpesmaritimes' => 'Alpes-maritimes',
|
||||||
|
'ardeche' => 'Ardèche',
|
||||||
|
'ardennes' => 'Ardennes',
|
||||||
|
'ariege' => 'Ariège',
|
||||||
|
'aube' => 'Aube',
|
||||||
|
'aude' => 'Aude',
|
||||||
|
'aveyron' => 'Aveyron',
|
||||||
|
'bouchesdurhone' => 'Bouches-du-Rhône',
|
||||||
|
'calvados' => 'Calvados',
|
||||||
|
'cantal' => 'Cantal',
|
||||||
|
'charente' => 'Charente',
|
||||||
|
'charentemaritime' => 'Charente-maritime',
|
||||||
|
'cher' => 'Cher',
|
||||||
|
'correze' => 'Corrèze',
|
||||||
|
'corsedusud' => 'Corse-du-sud',
|
||||||
|
'hautecorse' => 'Haute-Corse',
|
||||||
|
'cotedor' => 'Côte-d\'Or',
|
||||||
|
'cotesdarmor' => 'Côtes-d\'Armor',
|
||||||
|
'creuse' => 'Creuse',
|
||||||
|
'dordogne' => 'Dordogne',
|
||||||
|
'doubs' => 'Doubs',
|
||||||
|
'drome' => 'Drôme',
|
||||||
|
'eure' => 'Eure',
|
||||||
|
'eureetloir' => 'Eure-et-loir',
|
||||||
|
'finistere' => 'Finistère',
|
||||||
|
'gard' => 'Gard',
|
||||||
|
'hautegaronne' => 'Haute-garonne',
|
||||||
|
'gers' => 'Gers',
|
||||||
|
'gironde' => 'Gironde',
|
||||||
|
'herault' => 'Hérault',
|
||||||
|
'illeetvilaine' => 'Ille-et-vilaine',
|
||||||
|
'indre' => 'Indre',
|
||||||
|
'indreetloire' => 'Indre-et-loire',
|
||||||
|
'isere' => 'Isère',
|
||||||
|
'jura' => 'Jura',
|
||||||
|
'landes' => 'Landes',
|
||||||
|
'loiretcher' => 'Loir-et-cher',
|
||||||
|
'loire' => 'Loire',
|
||||||
|
'hauteloire' => 'Haute-loire',
|
||||||
|
'loireatlantique' => 'Loire-atlantique',
|
||||||
|
'loiret' => 'Loiret',
|
||||||
|
'lot' => 'Lot',
|
||||||
|
'lotetgaronne' => 'Lot-et-garonne',
|
||||||
|
'lozere' => 'Lozère',
|
||||||
|
'maineetloire' => 'Maine-et-loire',
|
||||||
|
'manche' => 'Manche',
|
||||||
|
'marne' => 'Marne',
|
||||||
|
'hautemarne' => 'Haute-marne',
|
||||||
|
'mayenne' => 'Mayenne',
|
||||||
|
'meurtheetmoselle' => 'Meurthe-et-moselle',
|
||||||
|
'meuse' => 'Meuse',
|
||||||
|
'morbihan' => 'Morbihan',
|
||||||
|
'moselle' => 'Moselle',
|
||||||
|
'nievre' => 'Nièvre',
|
||||||
|
'nord' => 'Nord',
|
||||||
|
'oise' => 'Oise',
|
||||||
|
'orne' => 'Orne',
|
||||||
|
'pasdecalais' => 'Pas-de-calais',
|
||||||
|
'puydedome' => 'Puy-de-dôme',
|
||||||
|
'pyreneesatlantiques' => 'Pyrénées-atlantiques',
|
||||||
|
'hautespyrenees' => 'Hautes-Pyrénées',
|
||||||
|
'pyreneesorientales' => 'Pyrénées-orientales',
|
||||||
|
'basrhin' => 'Bas-rhin',
|
||||||
|
'hautrhin' => 'Haut-rhin',
|
||||||
|
'rhone' => 'Rhône',
|
||||||
|
'hautesaone' => 'Haute-saône',
|
||||||
|
'saoneetloire' => 'Saône-et-loire',
|
||||||
|
'sarthe' => 'Sarthe',
|
||||||
|
'savoie' => 'Savoie',
|
||||||
|
'hautesavoie' => 'Haute-savoie',
|
||||||
|
'paris' => 'Paris',
|
||||||
|
'seinemaritime' => 'Seine-maritime',
|
||||||
|
'seineetmarne' => 'Seine-et-marne',
|
||||||
|
'yvelines' => 'Yvelines',
|
||||||
|
'deuxsevres' => 'Deux-sèvres',
|
||||||
|
'somme' => 'Somme',
|
||||||
|
'tarn' => 'Tarn',
|
||||||
|
'tarnetgaronne' => 'Tarn-et-Garonne',
|
||||||
|
'var' => 'Var',
|
||||||
|
'vaucluse' => 'Vaucluse',
|
||||||
|
'vendee' => 'Vendée',
|
||||||
|
'vienne' => 'Vienne',
|
||||||
|
'hautevienne' => 'Haute-vienne',
|
||||||
|
'vosges' => 'Vosges',
|
||||||
|
'yonne' => 'Yonne',
|
||||||
|
'territoiredebelfort' => 'Territoire de belfort',
|
||||||
|
'essonne' => 'Essonne',
|
||||||
|
'hautsdeseine' => 'Hauts-de-seine',
|
||||||
|
'seinesaintdenis' => 'Seine-Saint-Denis',
|
||||||
|
'valdemarne' => 'Val-de-marne',
|
||||||
|
'valdoise' => 'Val-d\'Oise',
|
||||||
|
'guadeloupeMartinique' => 'Guadeloupe et Martinique',
|
||||||
|
'guyane' => 'Guyane',
|
||||||
|
'lareunion' => 'La réunion'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Departaimants;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum DepartaimantCollectionType: string
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case vintage = '1';
|
|
||||||
case current = '2';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::vintage->name => 'Collection Vintage',
|
|
||||||
self::current->name => 'Collection Actuelle',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,207 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Departaimants;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum DepartaimantCurrent: string implements IDepartaimant
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case ain = '01';
|
|
||||||
case aisne = '02';
|
|
||||||
case allier = '03';
|
|
||||||
case alpesdehauteprovence = '04';
|
|
||||||
case hautesalpes = '05';
|
|
||||||
case alpesmaritimes = '06';
|
|
||||||
case ardeche = '07';
|
|
||||||
case ardennes = '08';
|
|
||||||
case ariege = '09';
|
|
||||||
case aube = '10';
|
|
||||||
case aude = '11';
|
|
||||||
case aveyron = '12';
|
|
||||||
case bouchesdurhone = '13';
|
|
||||||
case calvados = '14';
|
|
||||||
case cantal = '15';
|
|
||||||
case charente = '16';
|
|
||||||
case charentemaritime = '17';
|
|
||||||
case cher = '18';
|
|
||||||
case correze = '19';
|
|
||||||
case corsedusud = '2A';
|
|
||||||
case hautecorse = '2B';
|
|
||||||
case cotedor = '21';
|
|
||||||
case cotesdarmor = '22';
|
|
||||||
case creuse = '23';
|
|
||||||
case dordogne = '24';
|
|
||||||
case doubs = '25';
|
|
||||||
case drome = '26';
|
|
||||||
case eure = '27';
|
|
||||||
case eureetloir = '28';
|
|
||||||
case finistere = '29';
|
|
||||||
case gard = '30';
|
|
||||||
case hautegaronne = '31';
|
|
||||||
case gers = '32';
|
|
||||||
case gironde = '33';
|
|
||||||
case herault = '34';
|
|
||||||
case illeetvilaine = '35';
|
|
||||||
case indre = '36';
|
|
||||||
case indreetloire = '37';
|
|
||||||
case isere = '38';
|
|
||||||
case jura = '39';
|
|
||||||
case landes = '40';
|
|
||||||
case loiretcher = '41';
|
|
||||||
case loire = '42';
|
|
||||||
case hauteloire = '43';
|
|
||||||
case loireatlantique = '44';
|
|
||||||
case loiret = '45';
|
|
||||||
case lot = '46';
|
|
||||||
case lotetgaronne = '47';
|
|
||||||
case lozere = '48';
|
|
||||||
case maineetloire = '49';
|
|
||||||
case manche = '50';
|
|
||||||
case marne = '51';
|
|
||||||
case hautemarne = '52';
|
|
||||||
case mayenne = '53';
|
|
||||||
case meurtheetmoselle = '54';
|
|
||||||
case meuse = '55';
|
|
||||||
case morbihan = '56';
|
|
||||||
case moselle = '57';
|
|
||||||
case nievre = '58';
|
|
||||||
case nord = '59';
|
|
||||||
case oise = '60';
|
|
||||||
case orne = '61';
|
|
||||||
case pasdecalais = '62';
|
|
||||||
case puydedome = '63';
|
|
||||||
case pyreneesatlantiques = '64';
|
|
||||||
case hautespyrenees = '65';
|
|
||||||
case pyreneesorientales = '66';
|
|
||||||
case basrhin = '67';
|
|
||||||
case hautrhin = '68';
|
|
||||||
case rhone = '69';
|
|
||||||
case saoneetloire = '71';
|
|
||||||
case sarthe = '72';
|
|
||||||
case savoie = '73';
|
|
||||||
case hautesavoie = '74';
|
|
||||||
case seinemaritime = '76';
|
|
||||||
case seineetmarne = '77';
|
|
||||||
case deuxsevres = '79';
|
|
||||||
case somme = '80';
|
|
||||||
case tarn = '81';
|
|
||||||
case tarnetgaronne = '82';
|
|
||||||
case var = '83';
|
|
||||||
case vaucluse = '84';
|
|
||||||
case vendee = '85';
|
|
||||||
case vienne = '86';
|
|
||||||
case hautevienne = '87';
|
|
||||||
case vosges = '88';
|
|
||||||
case yonne = '89';
|
|
||||||
case territoiredebelfort = '90';
|
|
||||||
case essonne = '91';
|
|
||||||
case guadeloupe = '971';
|
|
||||||
case martinique = '972';
|
|
||||||
case guyane = '973';
|
|
||||||
case lareunion = '974';
|
|
||||||
case mayotte = '976';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::ain->name => 'Ain',
|
|
||||||
self::aisne->name => 'Aisne',
|
|
||||||
self::allier->name => 'Allier',
|
|
||||||
self::alpesdehauteprovence->name => 'Alpes-de-Haute-Provence',
|
|
||||||
self::hautesalpes->name => 'Hautes-alpes',
|
|
||||||
self::alpesmaritimes->name => 'Alpes-maritimes',
|
|
||||||
self::ardeche->name => 'Ardèche',
|
|
||||||
self::ardennes->name => 'Ardennes',
|
|
||||||
self::ariege->name => 'Ariège',
|
|
||||||
self::aube->name => 'Aube',
|
|
||||||
self::aude->name => 'Aude',
|
|
||||||
self::aveyron->name => 'Aveyron',
|
|
||||||
self::bouchesdurhone->name => 'Bouches-du-Rhône',
|
|
||||||
self::calvados->name => 'Calvados',
|
|
||||||
self::cantal->name => 'Cantal',
|
|
||||||
self::charente->name => 'Charente',
|
|
||||||
self::charentemaritime->name => 'Charente-maritime',
|
|
||||||
self::cher->name => 'Cher',
|
|
||||||
self::correze->name => 'Corrèze',
|
|
||||||
self::corsedusud->name => 'Corse-du-sud',
|
|
||||||
self::hautecorse->name => 'Haute-Corse',
|
|
||||||
self::cotedor->name => 'Côte-d\'Or',
|
|
||||||
self::cotesdarmor->name => 'Côtes-d\'Armor',
|
|
||||||
self::creuse->name => 'Creuse',
|
|
||||||
self::dordogne->name => 'Dordogne',
|
|
||||||
self::doubs->name => 'Doubs',
|
|
||||||
self::drome->name => 'Drôme',
|
|
||||||
self::eure->name => 'Eure',
|
|
||||||
self::eureetloir->name => 'Eure-et-loir',
|
|
||||||
self::finistere->name => 'Finistère',
|
|
||||||
self::gard->name => 'Gard',
|
|
||||||
self::hautegaronne->name => 'Haute-garonne',
|
|
||||||
self::gers->name => 'Gers',
|
|
||||||
self::gironde->name => 'Gironde',
|
|
||||||
self::herault->name => 'Hérault',
|
|
||||||
self::illeetvilaine->name => 'Ille-et-vilaine',
|
|
||||||
self::indre->name => 'Indre',
|
|
||||||
self::indreetloire->name => 'Indre-et-loire',
|
|
||||||
self::isere->name => 'Isère',
|
|
||||||
self::jura->name => 'Jura',
|
|
||||||
self::landes->name => 'Landes',
|
|
||||||
self::loiretcher->name => 'Loir-et-cher',
|
|
||||||
self::loire->name => 'Loire',
|
|
||||||
self::hauteloire->name => 'Haute-loire',
|
|
||||||
self::loireatlantique->name => 'Loire-atlantique',
|
|
||||||
self::loiret->name => 'Loiret',
|
|
||||||
self::lot->name => 'Lot',
|
|
||||||
self::lotetgaronne->name => 'Lot-et-garonne',
|
|
||||||
self::lozere->name => 'Lozère',
|
|
||||||
self::maineetloire->name => 'Maine-et-loire',
|
|
||||||
self::manche->name => 'Manche',
|
|
||||||
self::marne->name => 'Marne',
|
|
||||||
self::hautemarne->name => 'Haute-marne',
|
|
||||||
self::mayenne->name => 'Mayenne',
|
|
||||||
self::meurtheetmoselle->name => 'Meurthe-et-moselle',
|
|
||||||
self::meuse->name => 'Meuse',
|
|
||||||
self::morbihan->name => 'Morbihan',
|
|
||||||
self::moselle->name => 'Moselle',
|
|
||||||
self::nievre->name => 'Nièvre',
|
|
||||||
self::nord->name => 'Nord',
|
|
||||||
self::oise->name => 'Oise',
|
|
||||||
self::orne->name => 'Orne',
|
|
||||||
self::pasdecalais->name => 'Pas-de-calais',
|
|
||||||
self::puydedome->name => 'Puy-de-dôme',
|
|
||||||
self::pyreneesatlantiques->name => 'Pyrénées-atlantiques',
|
|
||||||
self::hautespyrenees->name => 'Hautes-Pyrénées',
|
|
||||||
self::pyreneesorientales->name => 'Pyrénées-orientales',
|
|
||||||
self::basrhin->name => 'Bas-rhin',
|
|
||||||
self::hautrhin->name => 'Haut-rhin',
|
|
||||||
self::rhone->name => 'Rhône',
|
|
||||||
self::saoneetloire->name => 'Saône-et-loire',
|
|
||||||
self::sarthe->name => 'Sarthe',
|
|
||||||
self::savoie->name => 'Savoie',
|
|
||||||
self::hautesavoie->name => 'Haute-savoie',
|
|
||||||
self::seinemaritime->name => 'Seine-maritime',
|
|
||||||
self::seineetmarne->name => 'Seine-et-marne',
|
|
||||||
self::deuxsevres->name => 'Deux-sèvres',
|
|
||||||
self::somme->name => 'Somme',
|
|
||||||
self::tarn->name => 'Tarn',
|
|
||||||
self::tarnetgaronne->name => 'Tarn-et-Garonne',
|
|
||||||
self::var->name => 'Var',
|
|
||||||
self::vaucluse->name => 'Vaucluse',
|
|
||||||
self::vendee->name => 'Vendée',
|
|
||||||
self::vienne->name => 'Vienne',
|
|
||||||
self::hautevienne->name => 'Haute-vienne',
|
|
||||||
self::vosges->name => 'Vosges',
|
|
||||||
self::yonne->name => 'Yonne',
|
|
||||||
self::territoiredebelfort->name => 'Territoire de belfort',
|
|
||||||
self::essonne->name => 'Essonne',
|
|
||||||
self::guadeloupe->name => 'Guadeloupe',
|
|
||||||
self::martinique->name => 'Martinique',
|
|
||||||
self::guyane->name => 'Guyane',
|
|
||||||
self::lareunion->name => 'La réunion',
|
|
||||||
self::mayotte->name => 'Mayotte',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Departaimants;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum DepartaimantStatus: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case none = 0;
|
|
||||||
case has = 1;
|
|
||||||
case gives = 2;
|
|
||||||
case wants = 3;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::none->name => 'Non possédé',
|
|
||||||
self::has->name => 'Mes magnets',
|
|
||||||
self::wants->name => 'Je cherche un magnet',
|
|
||||||
self::gives->name => 'J\'échange un magnet',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,203 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Departaimants;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum DepartaimantVintage: string implements IDepartaimant
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case ain = '01';
|
|
||||||
case aisne = '02';
|
|
||||||
case allier = '03';
|
|
||||||
case alpesdehauteprovence = '04';
|
|
||||||
case hautesalpes = '05';
|
|
||||||
case alpesmaritimes = '06';
|
|
||||||
case ardeche = '07';
|
|
||||||
case ardennes = '08';
|
|
||||||
case ariege = '09';
|
|
||||||
case aube = '10';
|
|
||||||
case aude = '11';
|
|
||||||
case aveyron = '12';
|
|
||||||
case bouchesdurhone = '13';
|
|
||||||
case calvados = '14';
|
|
||||||
case cantal = '15';
|
|
||||||
case charente = '16';
|
|
||||||
case charentemaritime = '17';
|
|
||||||
case cher = '18';
|
|
||||||
case correze = '19';
|
|
||||||
case corsedusud = '2A';
|
|
||||||
case hautecorse = '2B';
|
|
||||||
case cotedor = '21';
|
|
||||||
case cotesdarmor = '22';
|
|
||||||
case creuse = '23';
|
|
||||||
case dordogne = '24';
|
|
||||||
case doubs = '25';
|
|
||||||
case drome = '26';
|
|
||||||
case eure = '27';
|
|
||||||
case eureetloir = '28';
|
|
||||||
case finistere = '29';
|
|
||||||
case gard = '30';
|
|
||||||
case hautegaronne = '31';
|
|
||||||
case gers = '32';
|
|
||||||
case gironde = '33';
|
|
||||||
case herault = '34';
|
|
||||||
case illeetvilaine = '35';
|
|
||||||
case indre = '36';
|
|
||||||
case indreetloire = '37';
|
|
||||||
case isere = '38';
|
|
||||||
case jura = '39';
|
|
||||||
case landes = '40';
|
|
||||||
case loiretcher = '41';
|
|
||||||
case loire = '42';
|
|
||||||
case hauteloire = '43';
|
|
||||||
case loireatlantique = '44';
|
|
||||||
case loiret = '45';
|
|
||||||
case lot = '46';
|
|
||||||
case lotetgaronne = '47';
|
|
||||||
case lozere = '48';
|
|
||||||
case maineetloire = '49';
|
|
||||||
case manche = '50';
|
|
||||||
case marne = '51';
|
|
||||||
case hautemarne = '52';
|
|
||||||
case mayenne = '53';
|
|
||||||
case meurtheetmoselle = '54';
|
|
||||||
case meuse = '55';
|
|
||||||
case morbihan = '56';
|
|
||||||
case moselle = '57';
|
|
||||||
case nievre = '58';
|
|
||||||
case nord = '59';
|
|
||||||
case oise = '60';
|
|
||||||
case orne = '61';
|
|
||||||
case pasdecalais = '62';
|
|
||||||
case puydedome = '63';
|
|
||||||
case pyreneesatlantiques = '64';
|
|
||||||
case hautespyrenees = '65';
|
|
||||||
case pyreneesorientales = '66';
|
|
||||||
case basrhin = '67';
|
|
||||||
case hautrhin = '68';
|
|
||||||
case rhone = '69';
|
|
||||||
case saoneetloire = '71';
|
|
||||||
case sarthe = '72';
|
|
||||||
case savoie = '73';
|
|
||||||
case hautesavoie = '74';
|
|
||||||
case seinemaritime = '76';
|
|
||||||
case seineetmarne = '77';
|
|
||||||
case deuxsevres = '79';
|
|
||||||
case somme = '80';
|
|
||||||
case tarn = '81';
|
|
||||||
case tarnetgaronne = '82';
|
|
||||||
case var = '83';
|
|
||||||
case vaucluse = '84';
|
|
||||||
case vendee = '85';
|
|
||||||
case vienne = '86';
|
|
||||||
case hautevienne = '87';
|
|
||||||
case vosges = '88';
|
|
||||||
case yonne = '89';
|
|
||||||
case territoiredebelfort = '90';
|
|
||||||
case essonne = '91';
|
|
||||||
case guadeloupeMartinique = '971/972';
|
|
||||||
case guyane = '973';
|
|
||||||
case lareunion = '974';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::ain->name => 'Ain',
|
|
||||||
self::aisne->name => 'Aisne',
|
|
||||||
self::allier->name => 'Allier',
|
|
||||||
self::alpesdehauteprovence->name => 'Alpes-de-Haute-Provence',
|
|
||||||
self::hautesalpes->name => 'Hautes-alpes',
|
|
||||||
self::alpesmaritimes->name => 'Alpes-maritimes',
|
|
||||||
self::ardeche->name => 'Ardèche',
|
|
||||||
self::ardennes->name => 'Ardennes',
|
|
||||||
self::ariege->name => 'Ariège',
|
|
||||||
self::aube->name => 'Aube',
|
|
||||||
self::aude->name => 'Aude',
|
|
||||||
self::aveyron->name => 'Aveyron',
|
|
||||||
self::bouchesdurhone->name => 'Bouches-du-Rhône',
|
|
||||||
self::calvados->name => 'Calvados',
|
|
||||||
self::cantal->name => 'Cantal',
|
|
||||||
self::charente->name => 'Charente',
|
|
||||||
self::charentemaritime->name => 'Charente-maritime',
|
|
||||||
self::cher->name => 'Cher',
|
|
||||||
self::correze->name => 'Corrèze',
|
|
||||||
self::corsedusud->name => 'Corse-du-sud',
|
|
||||||
self::hautecorse->name => 'Haute-Corse',
|
|
||||||
self::cotedor->name => 'Côte-d\'Or',
|
|
||||||
self::cotesdarmor->name => 'Côtes-d\'Armor',
|
|
||||||
self::creuse->name => 'Creuse',
|
|
||||||
self::dordogne->name => 'Dordogne',
|
|
||||||
self::doubs->name => 'Doubs',
|
|
||||||
self::drome->name => 'Drôme',
|
|
||||||
self::eure->name => 'Eure',
|
|
||||||
self::eureetloir->name => 'Eure-et-loir',
|
|
||||||
self::finistere->name => 'Finistère',
|
|
||||||
self::gard->name => 'Gard',
|
|
||||||
self::hautegaronne->name => 'Haute-garonne',
|
|
||||||
self::gers->name => 'Gers',
|
|
||||||
self::gironde->name => 'Gironde',
|
|
||||||
self::herault->name => 'Hérault',
|
|
||||||
self::illeetvilaine->name => 'Ille-et-vilaine',
|
|
||||||
self::indre->name => 'Indre',
|
|
||||||
self::indreetloire->name => 'Indre-et-loire',
|
|
||||||
self::isere->name => 'Isère',
|
|
||||||
self::jura->name => 'Jura',
|
|
||||||
self::landes->name => 'Landes',
|
|
||||||
self::loiretcher->name => 'Loir-et-cher',
|
|
||||||
self::loire->name => 'Loire',
|
|
||||||
self::hauteloire->name => 'Haute-loire',
|
|
||||||
self::loireatlantique->name => 'Loire-atlantique',
|
|
||||||
self::loiret->name => 'Loiret',
|
|
||||||
self::lot->name => 'Lot',
|
|
||||||
self::lotetgaronne->name => 'Lot-et-garonne',
|
|
||||||
self::lozere->name => 'Lozère',
|
|
||||||
self::maineetloire->name => 'Maine-et-loire',
|
|
||||||
self::manche->name => 'Manche',
|
|
||||||
self::marne->name => 'Marne',
|
|
||||||
self::hautemarne->name => 'Haute-marne',
|
|
||||||
self::mayenne->name => 'Mayenne',
|
|
||||||
self::meurtheetmoselle->name => 'Meurthe-et-moselle',
|
|
||||||
self::meuse->name => 'Meuse',
|
|
||||||
self::morbihan->name => 'Morbihan',
|
|
||||||
self::moselle->name => 'Moselle',
|
|
||||||
self::nievre->name => 'Nièvre',
|
|
||||||
self::nord->name => 'Nord',
|
|
||||||
self::oise->name => 'Oise',
|
|
||||||
self::orne->name => 'Orne',
|
|
||||||
self::pasdecalais->name => 'Pas-de-calais',
|
|
||||||
self::puydedome->name => 'Puy-de-dôme',
|
|
||||||
self::pyreneesatlantiques->name => 'Pyrénées-atlantiques',
|
|
||||||
self::hautespyrenees->name => 'Hautes-Pyrénées',
|
|
||||||
self::pyreneesorientales->name => 'Pyrénées-orientales',
|
|
||||||
self::basrhin->name => 'Bas-rhin',
|
|
||||||
self::hautrhin->name => 'Haut-rhin',
|
|
||||||
self::rhone->name => 'Rhône',
|
|
||||||
self::saoneetloire->name => 'Saône-et-loire',
|
|
||||||
self::sarthe->name => 'Sarthe',
|
|
||||||
self::savoie->name => 'Savoie',
|
|
||||||
self::hautesavoie->name => 'Haute-savoie',
|
|
||||||
self::seinemaritime->name => 'Seine-maritime',
|
|
||||||
self::seineetmarne->name => 'Seine-et-marne',
|
|
||||||
self::deuxsevres->name => 'Deux-sèvres',
|
|
||||||
self::somme->name => 'Somme',
|
|
||||||
self::tarn->name => 'Tarn',
|
|
||||||
self::tarnetgaronne->name => 'Tarn-et-Garonne',
|
|
||||||
self::var->name => 'Var',
|
|
||||||
self::vaucluse->name => 'Vaucluse',
|
|
||||||
self::vendee->name => 'Vendée',
|
|
||||||
self::vienne->name => 'Vienne',
|
|
||||||
self::hautevienne->name => 'Haute-vienne',
|
|
||||||
self::vosges->name => 'Vosges',
|
|
||||||
self::yonne->name => 'Yonne',
|
|
||||||
self::territoiredebelfort->name => 'Territoire de belfort',
|
|
||||||
self::essonne->name => 'Essonne',
|
|
||||||
self::guadeloupeMartinique->name => 'Guadeloupe et Martinique',
|
|
||||||
self::guyane->name => 'Guyane',
|
|
||||||
self::lareunion->name => 'La réunion',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Departaimants;
|
|
||||||
|
|
||||||
interface IDepartaimant
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Get enum value.
|
|
||||||
*/
|
|
||||||
public function value(): string | int;
|
|
||||||
}
|
|
||||||
|
|
@ -1,221 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum Department: string
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case ain = '01';
|
|
||||||
case aisne = '02';
|
|
||||||
case allier = '03';
|
|
||||||
case alpesdehauteprovence = '04';
|
|
||||||
case hautesalpes = '05';
|
|
||||||
case alpesmaritimes = '06';
|
|
||||||
case ardeche = '07';
|
|
||||||
case ardennes = '08';
|
|
||||||
case ariege = '09';
|
|
||||||
case aube = '10';
|
|
||||||
case aude = '11';
|
|
||||||
case aveyron = '12';
|
|
||||||
case bouchesdurhone = '13';
|
|
||||||
case calvados = '14';
|
|
||||||
case cantal = '15';
|
|
||||||
case charente = '16';
|
|
||||||
case charentemaritime = '17';
|
|
||||||
case cher = '18';
|
|
||||||
case correze = '19';
|
|
||||||
case corsedusud = '2A';
|
|
||||||
case hautecorse = '2B';
|
|
||||||
case cotedor = '21';
|
|
||||||
case cotesdarmor = '22';
|
|
||||||
case creuse = '23';
|
|
||||||
case dordogne = '24';
|
|
||||||
case doubs = '25';
|
|
||||||
case drome = '26';
|
|
||||||
case eure = '27';
|
|
||||||
case eureetloir = '28';
|
|
||||||
case finistere = '29';
|
|
||||||
case gard = '30';
|
|
||||||
case hautegaronne = '31';
|
|
||||||
case gers = '32';
|
|
||||||
case gironde = '33';
|
|
||||||
case herault = '34';
|
|
||||||
case illeetvilaine = '35';
|
|
||||||
case indre = '36';
|
|
||||||
case indreetloire = '37';
|
|
||||||
case isere = '38';
|
|
||||||
case jura = '39';
|
|
||||||
case landes = '40';
|
|
||||||
case loiretcher = '41';
|
|
||||||
case loire = '42';
|
|
||||||
case hauteloire = '43';
|
|
||||||
case loireatlantique = '44';
|
|
||||||
case loiret = '45';
|
|
||||||
case lot = '46';
|
|
||||||
case lotetgaronne = '47';
|
|
||||||
case lozere = '48';
|
|
||||||
case maineetloire = '49';
|
|
||||||
case manche = '50';
|
|
||||||
case marne = '51';
|
|
||||||
case hautemarne = '52';
|
|
||||||
case mayenne = '53';
|
|
||||||
case meurtheetmoselle = '54';
|
|
||||||
case meuse = '55';
|
|
||||||
case morbihan = '56';
|
|
||||||
case moselle = '57';
|
|
||||||
case nievre = '58';
|
|
||||||
case nord = '59';
|
|
||||||
case oise = '60';
|
|
||||||
case orne = '61';
|
|
||||||
case pasdecalais = '62';
|
|
||||||
case puydedome = '63';
|
|
||||||
case pyreneesatlantiques = '64';
|
|
||||||
case hautespyrenees = '65';
|
|
||||||
case pyreneesorientales = '66';
|
|
||||||
case basrhin = '67';
|
|
||||||
case hautrhin = '68';
|
|
||||||
case rhone = '69';
|
|
||||||
case hautesaone = '70';
|
|
||||||
case saoneetloire = '71';
|
|
||||||
case sarthe = '72';
|
|
||||||
case savoie = '73';
|
|
||||||
case hautesavoie = '74';
|
|
||||||
case paris = '75';
|
|
||||||
case seinemaritime = '76';
|
|
||||||
case seineetmarne = '77';
|
|
||||||
case yvelines = '78';
|
|
||||||
case deuxsevres = '79';
|
|
||||||
case somme = '80';
|
|
||||||
case tarn = '81';
|
|
||||||
case tarnetgaronne = '82';
|
|
||||||
case var = '83';
|
|
||||||
case vaucluse = '84';
|
|
||||||
case vendee = '85';
|
|
||||||
case vienne = '86';
|
|
||||||
case hautevienne = '87';
|
|
||||||
case vosges = '88';
|
|
||||||
case yonne = '89';
|
|
||||||
case territoiredebelfort = '90';
|
|
||||||
case essonne = '91';
|
|
||||||
case hautsdeseine = '92';
|
|
||||||
case seinesaintdenis = '93';
|
|
||||||
case valdemarne = '94';
|
|
||||||
case valdoise = '95';
|
|
||||||
case guadeloupe = '971';
|
|
||||||
case martinique = '972';
|
|
||||||
case guyane = '973';
|
|
||||||
case lareunion = '974';
|
|
||||||
case mayotte = '976';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::ain->name => 'Ain',
|
|
||||||
self::aisne->name => 'Aisne',
|
|
||||||
self::allier->name => 'Allier',
|
|
||||||
self::alpesdehauteprovence->name => 'Alpes-de-Haute-Provence',
|
|
||||||
self::hautesalpes->name => 'Hautes-alpes',
|
|
||||||
self::alpesmaritimes->name => 'Alpes-maritimes',
|
|
||||||
self::ardeche->name => 'Ardèche',
|
|
||||||
self::ardennes->name => 'Ardennes',
|
|
||||||
self::ariege->name => 'Ariège',
|
|
||||||
self::aube->name => 'Aube',
|
|
||||||
self::aude->name => 'Aude',
|
|
||||||
self::aveyron->name => 'Aveyron',
|
|
||||||
self::bouchesdurhone->name => 'Bouches-du-Rhône',
|
|
||||||
self::calvados->name => 'Calvados',
|
|
||||||
self::cantal->name => 'Cantal',
|
|
||||||
self::charente->name => 'Charente',
|
|
||||||
self::charentemaritime->name => 'Charente-maritime',
|
|
||||||
self::cher->name => 'Cher',
|
|
||||||
self::correze->name => 'Corrèze',
|
|
||||||
self::corsedusud->name => 'Corse-du-sud',
|
|
||||||
self::hautecorse->name => 'Haute-Corse',
|
|
||||||
self::cotedor->name => 'Côte-d\'Or',
|
|
||||||
self::cotesdarmor->name => 'Côtes-d\'Armor',
|
|
||||||
self::creuse->name => 'Creuse',
|
|
||||||
self::dordogne->name => 'Dordogne',
|
|
||||||
self::doubs->name => 'Doubs',
|
|
||||||
self::drome->name => 'Drôme',
|
|
||||||
self::eure->name => 'Eure',
|
|
||||||
self::eureetloir->name => 'Eure-et-loir',
|
|
||||||
self::finistere->name => 'Finistère',
|
|
||||||
self::gard->name => 'Gard',
|
|
||||||
self::hautegaronne->name => 'Haute-garonne',
|
|
||||||
self::gers->name => 'Gers',
|
|
||||||
self::gironde->name => 'Gironde',
|
|
||||||
self::herault->name => 'Hérault',
|
|
||||||
self::illeetvilaine->name => 'Ille-et-vilaine',
|
|
||||||
self::indre->name => 'Indre',
|
|
||||||
self::indreetloire->name => 'Indre-et-loire',
|
|
||||||
self::isere->name => 'Isère',
|
|
||||||
self::jura->name => 'Jura',
|
|
||||||
self::landes->name => 'Landes',
|
|
||||||
self::loiretcher->name => 'Loir-et-cher',
|
|
||||||
self::loire->name => 'Loire',
|
|
||||||
self::hauteloire->name => 'Haute-loire',
|
|
||||||
self::loireatlantique->name => 'Loire-atlantique',
|
|
||||||
self::loiret->name => 'Loiret',
|
|
||||||
self::lot->name => 'Lot',
|
|
||||||
self::lotetgaronne->name => 'Lot-et-garonne',
|
|
||||||
self::lozere->name => 'Lozère',
|
|
||||||
self::maineetloire->name => 'Maine-et-loire',
|
|
||||||
self::manche->name => 'Manche',
|
|
||||||
self::marne->name => 'Marne',
|
|
||||||
self::hautemarne->name => 'Haute-marne',
|
|
||||||
self::mayenne->name => 'Mayenne',
|
|
||||||
self::meurtheetmoselle->name => 'Meurthe-et-moselle',
|
|
||||||
self::meuse->name => 'Meuse',
|
|
||||||
self::morbihan->name => 'Morbihan',
|
|
||||||
self::moselle->name => 'Moselle',
|
|
||||||
self::nievre->name => 'Nièvre',
|
|
||||||
self::nord->name => 'Nord',
|
|
||||||
self::oise->name => 'Oise',
|
|
||||||
self::orne->name => 'Orne',
|
|
||||||
self::pasdecalais->name => 'Pas-de-calais',
|
|
||||||
self::puydedome->name => 'Puy-de-dôme',
|
|
||||||
self::pyreneesatlantiques->name => 'Pyrénées-atlantiques',
|
|
||||||
self::hautespyrenees->name => 'Hautes-Pyrénées',
|
|
||||||
self::pyreneesorientales->name => 'Pyrénées-orientales',
|
|
||||||
self::basrhin->name => 'Bas-rhin',
|
|
||||||
self::hautrhin->name => 'Haut-rhin',
|
|
||||||
self::rhone->name => 'Rhône',
|
|
||||||
self::hautesaone->name => 'Haute-saône',
|
|
||||||
self::saoneetloire->name => 'Saône-et-loire',
|
|
||||||
self::sarthe->name => 'Sarthe',
|
|
||||||
self::savoie->name => 'Savoie',
|
|
||||||
self::hautesavoie->name => 'Haute-savoie',
|
|
||||||
self::paris->name => 'Paris',
|
|
||||||
self::seinemaritime->name => 'Seine-maritime',
|
|
||||||
self::seineetmarne->name => 'Seine-et-marne',
|
|
||||||
self::yvelines->name => 'Yvelines',
|
|
||||||
self::deuxsevres->name => 'Deux-sèvres',
|
|
||||||
self::somme->name => 'Somme',
|
|
||||||
self::tarn->name => 'Tarn',
|
|
||||||
self::tarnetgaronne->name => 'Tarn-et-Garonne',
|
|
||||||
self::var->name => 'Var',
|
|
||||||
self::vaucluse->name => 'Vaucluse',
|
|
||||||
self::vendee->name => 'Vendée',
|
|
||||||
self::vienne->name => 'Vienne',
|
|
||||||
self::hautevienne->name => 'Haute-vienne',
|
|
||||||
self::vosges->name => 'Vosges',
|
|
||||||
self::yonne->name => 'Yonne',
|
|
||||||
self::territoiredebelfort->name => 'Territoire de belfort',
|
|
||||||
self::essonne->name => 'Essonne',
|
|
||||||
self::hautsdeseine->name => 'Hauts-de-seine',
|
|
||||||
self::seinesaintdenis->name => 'Seine-Saint-Denis',
|
|
||||||
self::valdemarne->name => 'Val-de-marne',
|
|
||||||
self::valdoise->name => 'Val-d\'Oise',
|
|
||||||
self::guadeloupe->name => 'Guadeloupe',
|
|
||||||
self::martinique->name => 'Martinique',
|
|
||||||
self::guyane->name => 'Guyane',
|
|
||||||
self::lareunion->name => 'La réunion',
|
|
||||||
self::mayotte->name => 'Mayotte',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
54
app/Enums/EleveurOcbStatus.php
Normal file
54
app/Enums/EleveurOcbStatus.php
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self none()
|
||||||
|
* @method static self pending()
|
||||||
|
* @method static self no()
|
||||||
|
* @method static self yes()
|
||||||
|
*/
|
||||||
|
final class EleveurOcbStatus extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'none' => 0,
|
||||||
|
'pending' => 1,
|
||||||
|
'no' => 2,
|
||||||
|
'yes' => 3
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'none' => 'Non',
|
||||||
|
'pending' => 'En attente',
|
||||||
|
'no' => 'Réfusé',
|
||||||
|
'yes' => 'Valide'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Output the value as a string
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function __toString(): string
|
||||||
|
{
|
||||||
|
return (string)$this->label;
|
||||||
|
}
|
||||||
|
}
|
||||||
47
app/Enums/EngagementBlocType.php
Normal file
47
app/Enums/EngagementBlocType.php
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self bloc1()
|
||||||
|
* @method static self bloc2()
|
||||||
|
* @method static self bloc3()
|
||||||
|
* @method static self bloc4()
|
||||||
|
* @method static self bloc5()
|
||||||
|
*/
|
||||||
|
final class EngagementBlocType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'bloc1' => 0,
|
||||||
|
'bloc2' => 1,
|
||||||
|
'bloc3' => 2,
|
||||||
|
'bloc4' => 3,
|
||||||
|
'bloc5' => 4
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'bloc1' => __('Bloc 1'),
|
||||||
|
'bloc2' => __('Bloc 2 (mise en avant)'),
|
||||||
|
'bloc3' => __('Bloc 3'),
|
||||||
|
'bloc4' => __('Bloc 4 (bloc 3 inversé)'),
|
||||||
|
'bloc5' => __('Bloc 5 (info horizontale)')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
38
app/Enums/EngagementType.php
Normal file
38
app/Enums/EngagementType.php
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self header()
|
||||||
|
* @method static self article()
|
||||||
|
*/
|
||||||
|
final class EngagementType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'header' => 0,
|
||||||
|
'article' => 1
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'header' => __('Entête'),
|
||||||
|
'article' => __('Article')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
25
app/Enums/GMapDataType.php
Normal file
25
app/Enums/GMapDataType.php
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self portrait()
|
||||||
|
* @method static self ocbbreeder()
|
||||||
|
*/
|
||||||
|
final class GMapDataType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'portrait' => 0,
|
||||||
|
'ocbbreeder' => 1
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Games;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum GameForAge: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case from3To6 = 3;
|
|
||||||
case from6To9 = 6;
|
|
||||||
case from9To12 = 9;
|
|
||||||
case from12AndMore = 12;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::from3To6->name => '3 à 6 ans',
|
|
||||||
self::from6To9->name => '6 à 9 ans',
|
|
||||||
self::from9To12->name => '9 à 12 ans',
|
|
||||||
self::from12AndMore->name => '12 ans et plus',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,116 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Games;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
use Illuminate\Support\Facades\Vite;
|
|
||||||
|
|
||||||
enum GamePointLevel: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case egg = 1;
|
|
||||||
case hatchedEgg = 2;
|
|
||||||
case chick = 3;
|
|
||||||
case hen = 4;
|
|
||||||
case chicken = 5;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::egg->name => 'oeuf',
|
|
||||||
self::hatchedEgg->name => 'oeuf éclos',
|
|
||||||
self::chick->name => 'poussin',
|
|
||||||
self::hen->name => 'poule',
|
|
||||||
self::chicken->name => 'poulet',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Point levels definition.
|
|
||||||
*/
|
|
||||||
private const LEVELS = [
|
|
||||||
self::egg->name => 0,
|
|
||||||
self::hatchedEgg->name => 50,
|
|
||||||
self::chick->name => 130,
|
|
||||||
self::hen->name => 230,
|
|
||||||
self::chicken->name => 1000,
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Level
|
|
||||||
*/
|
|
||||||
public function level(): int
|
|
||||||
{
|
|
||||||
return self::LEVELS[$this->name];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get picture
|
|
||||||
*/
|
|
||||||
public function picture(): string
|
|
||||||
{
|
|
||||||
return Vite::asset("resources/assets/images/club/game-points/{$this->name()}.png");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get enum Levels
|
|
||||||
*
|
|
||||||
* @return array<int>
|
|
||||||
*/
|
|
||||||
public static function toLevels(): array
|
|
||||||
{
|
|
||||||
return self::LEVELS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Level from point value
|
|
||||||
*/
|
|
||||||
public static function fromPoints(int $points): self
|
|
||||||
{
|
|
||||||
$levels = array_reverse(self::all());
|
|
||||||
foreach ($levels as $level) {
|
|
||||||
if ($points >= $level->level()) {
|
|
||||||
return $level;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// * This should not happen while egg level is 0
|
|
||||||
return self::egg;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Next Level
|
|
||||||
*/
|
|
||||||
public static function fromPointsNextLevel(int $points): ?self
|
|
||||||
{
|
|
||||||
$currentLevel = self::fromPoints($points);
|
|
||||||
|
|
||||||
return collect(self::all())
|
|
||||||
->filter(fn ($level) => $level->level() > $currentLevel->level())
|
|
||||||
->first();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Percent from points
|
|
||||||
*/
|
|
||||||
public static function percentFromPoints(int $points): float
|
|
||||||
{
|
|
||||||
$levels = collect(self::toValues());
|
|
||||||
$level = self::fromPoints($points);
|
|
||||||
$nextLevel = self::fromPointsNextLevel($points);
|
|
||||||
|
|
||||||
if (! $nextLevel) {
|
|
||||||
return 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
// * Bars between 2 levels
|
|
||||||
$ratio = 4;
|
|
||||||
$percentBetween2Levels = 100 / ($levels->count() - 1);
|
|
||||||
$adjustment = $percentBetween2Levels * ($nextLevel->level() - $points) / ($nextLevel->level() - $level->level());
|
|
||||||
|
|
||||||
return round((($level->value() * 100) / $levels->last()) + $percentBetween2Levels - $adjustment);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
44
app/Enums/GeneralConfigType.php
Normal file
44
app/Enums/GeneralConfigType.php
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self actu()
|
||||||
|
* @method static self rsm()
|
||||||
|
* @method static self poultryPage()
|
||||||
|
* @method static self breedingPage()
|
||||||
|
*/
|
||||||
|
final class GeneralConfigType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'actu' => 1,
|
||||||
|
'rsm' => 2,
|
||||||
|
'poultryPage' => 3,
|
||||||
|
'breedingPage' => 4
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'actu' => __('Actualité'),
|
||||||
|
'rsm' => __('RSM Block'),
|
||||||
|
'poultryPage' => __('Pages Volaille'),
|
||||||
|
'breedingPage' => __('Pages Élevage des volailles')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
38
app/Enums/GeoType.php
Normal file
38
app/Enums/GeoType.php
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self exact()
|
||||||
|
* @method static self commune()
|
||||||
|
*/
|
||||||
|
final class GeoType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'exact' => 0,
|
||||||
|
'commune' => 1
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'exact' => __('Exacte'),
|
||||||
|
'commune' => __('Code commune')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\HistoricalMilestones;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum HistoricalMilestonePosition: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case topLeft = 1;
|
|
||||||
case topRight = 2;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::topLeft->name => 'Haut gauche',
|
|
||||||
self::topRight->name => 'Haut droit',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -2,29 +2,43 @@
|
||||||
|
|
||||||
namespace App\Enums;
|
namespace App\Enums;
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
enum InputType: int
|
/**
|
||||||
|
* @method static self boolean()
|
||||||
|
* @method static self image()
|
||||||
|
* @method static self string()
|
||||||
|
* @method static self text()
|
||||||
|
* html autorisé
|
||||||
|
* @method static self url()
|
||||||
|
* @method static self imageArray()
|
||||||
|
* @method static self labelArray()
|
||||||
|
* @method static self dropdownArray()
|
||||||
|
* html autorisé
|
||||||
|
* @method static self miniblocArray()
|
||||||
|
* html autorisé
|
||||||
|
* @method static self videoVimeo()
|
||||||
|
*/
|
||||||
|
final class InputType extends BaseEnumRoutable
|
||||||
{
|
{
|
||||||
use BaseEnum;
|
/**
|
||||||
|
* Enum values
|
||||||
case boolean = 1;
|
*
|
||||||
case dropdownArray = 2;
|
* @return array
|
||||||
case email = 3;
|
*/
|
||||||
case image = 4;
|
protected static function values(): array
|
||||||
case imageArray = 5;
|
{
|
||||||
case labelArray = 6;
|
return [
|
||||||
case miniblocArray = 7;
|
'boolean' => 0,
|
||||||
case number = 8;
|
'image' => 1,
|
||||||
case selectEnum = 9;
|
'string' => 2,
|
||||||
case password = 10;
|
'text' => 3,
|
||||||
case string = 11;
|
'url' => 4,
|
||||||
case text = 12;
|
'imageArray' => 5,
|
||||||
case url = 13;
|
'labelArray' => 6,
|
||||||
case videoVimeo = 14;
|
'dropdownArray' => 7,
|
||||||
case videoYoutube = 15;
|
'miniblocArray' => 8,
|
||||||
case video = 16;
|
'videoVimeo' => 9
|
||||||
case slider = 17;
|
];
|
||||||
case selectImageVideo = 18;
|
}
|
||||||
case searchBelongsTo = 19;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
17
app/Enums/LogType.php
Normal file
17
app/Enums/LogType.php
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self debug()
|
||||||
|
* @method static self log()
|
||||||
|
* @method static self warning()
|
||||||
|
* @method static self info()
|
||||||
|
* @method static self error()
|
||||||
|
* @method static self critical()
|
||||||
|
*/
|
||||||
|
final class LogType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum MailToTest: string
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case ValidateAccount = 'validate_account';
|
|
||||||
case ForgottenPassword = 'forgotten_password';
|
|
||||||
case UpdatePassword = 'update_password';
|
|
||||||
case OrderRecap = 'order_recap';
|
|
||||||
case DestroyCustomer = 'destroy_customer';
|
|
||||||
case DestroyedCustomer = 'destroyed_customer';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::ValidateAccount->name => 'Validation du compte',
|
|
||||||
self::ForgottenPassword->name => 'Mot de passe oublié',
|
|
||||||
self::UpdatePassword->name => 'Mise à jour du mot de passe',
|
|
||||||
self::OrderRecap->name => 'Récapitulatif de la commande',
|
|
||||||
self::DestroyCustomer->name => 'Demande de suppression',
|
|
||||||
self::DestroyedCustomer->name => 'Compte supprimé',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
63
app/Enums/Mercanet/PaymentResponse.php
Normal file
63
app/Enums/Mercanet/PaymentResponse.php
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums\Mercanet;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self ok()
|
||||||
|
* Situation normale suivie du processus normal d'affichage des pages de paiement.
|
||||||
|
* @method static self invalidIds()
|
||||||
|
* L’identifiant commerçant ou le contrat acquéreur sont invalides.
|
||||||
|
* @method static self invalidParameters()
|
||||||
|
* Les paramètres de la transaction sont invalides. Vérifiez les paramètres de la requête.
|
||||||
|
* @method static self canceled()
|
||||||
|
* Transaction annulée
|
||||||
|
* @method static self invalidRequestFormat()
|
||||||
|
* Le format de la requête est invalide.
|
||||||
|
* @method static self securityIssue()
|
||||||
|
* Problème de sécurité, par ex. le sceau calculé est incorrect.
|
||||||
|
* @method static self transactionAlreadyExists()
|
||||||
|
* La transaction existe déjà.
|
||||||
|
* @method static self expired()
|
||||||
|
* La transaction a expiré
|
||||||
|
* @method static self unreachableService()
|
||||||
|
* Service temporairement indisponible
|
||||||
|
* @method static self internalIssue()
|
||||||
|
* (interne à la classe) = Pb appel cUrl
|
||||||
|
*/
|
||||||
|
final class PaymentResponse extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'ok' => '00',
|
||||||
|
'invalidIds' => '03',
|
||||||
|
'invalidParameters' => '12',
|
||||||
|
'canceled' => '17',
|
||||||
|
'invalidRequestFormat' => '30',
|
||||||
|
'securityIssue' => '34',
|
||||||
|
'transactionAlreadyExists' => '94',
|
||||||
|
'expired' => '97',
|
||||||
|
'unreachableService' => '99',
|
||||||
|
'internalIssue' => '500'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// phpcs:disable Generic.Files.LineLength.TooLong
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'ok' => 'Situation normale suivie du processus normal d\'affichage des pages de paiement.',
|
||||||
|
'invalidIds' => 'L’identifiant commerçant ou le contrat acquéreur sont invalides.',
|
||||||
|
'invalidParameters' => 'Les paramètres de la transaction sont invalides. Vérifiez les paramètres de la requête.',
|
||||||
|
'canceled' => 'Transaction annulée',
|
||||||
|
'invalidRequestFormat' => 'Le format de la requête est invalide.',
|
||||||
|
'securityIssue' => 'Problème de sécurité, par ex. le sceau calculé est incorrect.',
|
||||||
|
'transactionAlreadyExists' => 'La transaction existe déjà.',
|
||||||
|
'expired' => 'Délais expiré',
|
||||||
|
'unreachableService' => 'Service temporairement indisponible',
|
||||||
|
'internalIssue' => 'Erreur interne, eg: probleme appel CURL'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
58
app/Enums/Mercanet/RedirectionStatusCode.php
Normal file
58
app/Enums/Mercanet/RedirectionStatusCode.php
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums\Mercanet;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self redirect()
|
||||||
|
* Ce cas doit être suivi de la redirection de l’utilisateur vers la page de paiement.
|
||||||
|
*
|
||||||
|
* @method static self requestError03()
|
||||||
|
* @method static self requestError12()
|
||||||
|
* @method static self requestError30()
|
||||||
|
* @method static self requestError34()
|
||||||
|
* Ces codes d’erreur indiquent que la requête comporte un problème qui doit être résolu.
|
||||||
|
* Le processus de paiement doit alors être interrompu.
|
||||||
|
*
|
||||||
|
* @method static self referenceAlreadyUsed()
|
||||||
|
* La référence de transaction a déjà été utilisée.
|
||||||
|
* Le commerçant doit réessayer avec une autre référence de transaction.
|
||||||
|
*
|
||||||
|
* @method static self serviceDisponibiltyIssue()
|
||||||
|
* Problème de disponibilité du service de paiement. Le commerçant doit essayer de renvoyer la requête.
|
||||||
|
* Il convient d’utiliser une nouvelle référence de transaction pour éviter un code de réponse 94.
|
||||||
|
*
|
||||||
|
* @method static self internalIssue()
|
||||||
|
* (interne à la classe) = Pb appel cUrl
|
||||||
|
*/
|
||||||
|
final class RedirectionStatusCode extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'redirect' => 0,
|
||||||
|
'requestError03' => 3,
|
||||||
|
'requestError12' => 12,
|
||||||
|
'requestError30' => 30,
|
||||||
|
'requestError34' => 34,
|
||||||
|
'referenceAlreadyUsed' => 94,
|
||||||
|
'serviceDisponibiltyIssue' => 99,
|
||||||
|
'internalIssue' => 500
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'redirect' => 'Redirection Acceptée',
|
||||||
|
'requestError03' => 'Problème de request code 03',
|
||||||
|
'requestError12' => 'Problème de request code 12',
|
||||||
|
'requestError30' => 'Problème de request code 30',
|
||||||
|
'requestError34' => 'Problème de request code 34',
|
||||||
|
'referenceAlreadyUsed' => 'La référence de transaction à déja été utilisée',
|
||||||
|
'serviceDisponibiltyIssue' => 'Problème de disponibilité du service de paiement',
|
||||||
|
'internalIssue' => 'Erreur interne, eg: probleme appel CURL'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
58
app/Enums/Mercanet/TransactionResponse.php
Normal file
58
app/Enums/Mercanet/TransactionResponse.php
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums\Mercanet;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self accepted()
|
||||||
|
* Paiement accepté
|
||||||
|
* @method static self refused()
|
||||||
|
* Paiement refusé
|
||||||
|
* @method static self canceled()
|
||||||
|
* Paiement annulée
|
||||||
|
* @method static self fraud()
|
||||||
|
* Paiement refusé pour fraude
|
||||||
|
* @method static self maxReached()
|
||||||
|
* Paiement refusé pour nombre max essais atteint
|
||||||
|
* @method static self technicalIssue()
|
||||||
|
* Paiement refusé pour problème technique
|
||||||
|
* @method static self duplicate()
|
||||||
|
* Transaction dupliquée
|
||||||
|
* @method static self expired()
|
||||||
|
* Paiement expiré
|
||||||
|
* @method static self internalIssue()
|
||||||
|
* (interne à la classe) = Pb appel cUrl
|
||||||
|
*/
|
||||||
|
final class TransactionResponse extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'accepted' => 00,
|
||||||
|
'refused' => 05,
|
||||||
|
'canceled' => 17,
|
||||||
|
'fraud' => 34,
|
||||||
|
'maxReached' => 75,
|
||||||
|
'technicalIssue' => 90,
|
||||||
|
'duplicate' => 94,
|
||||||
|
'expired' => 97,
|
||||||
|
'internalIssue' => 500
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'accepted' => 'Paiement accepté',
|
||||||
|
'refused' => 'Paiement refusé',
|
||||||
|
'canceled' => 'Paiement annulé',
|
||||||
|
'fraud' => 'Paiement refusé pour fraude',
|
||||||
|
'maxReached' => 'Paiement refusé pour nombre max essais atteint',
|
||||||
|
'technicalIssue' => 'Paiement refusé pour problème technique',
|
||||||
|
'duplicate' => 'Transaction dupliquée',
|
||||||
|
'expired' => 'Paiement expiré',
|
||||||
|
'internalIssue' => 'Erreur interne, eg: probleme appel CURL'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\News;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum NewsClubTypeEnum: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case news = 1;
|
|
||||||
case survey = 2;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::news->name => 'Actualité',
|
|
||||||
self::survey->name => 'Sondage',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the icon.
|
|
||||||
*/
|
|
||||||
public function icon(): string
|
|
||||||
{
|
|
||||||
return match ($this) {
|
|
||||||
self::news => 'fa-newspaper',
|
|
||||||
self::survey => 'fa-chart-simple',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the color.
|
|
||||||
*/
|
|
||||||
public function color(): string
|
|
||||||
{
|
|
||||||
return match ($this) {
|
|
||||||
self::news => 'text-bg-tertiary',
|
|
||||||
self::survey => 'text-bg-warning',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -2,28 +2,46 @@
|
||||||
|
|
||||||
namespace App\Enums;
|
namespace App\Enums;
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
enum NotificationType: int
|
/**
|
||||||
|
* @method static self all()
|
||||||
|
* @method static self reduction()
|
||||||
|
* @method static self recipe()
|
||||||
|
* @method static self info()
|
||||||
|
* @method static self message()
|
||||||
|
*/
|
||||||
|
final class NotificationType extends BaseEnumRoutable
|
||||||
{
|
{
|
||||||
use BaseEnum;
|
/**
|
||||||
|
* Enum values
|
||||||
case all = 1;
|
*
|
||||||
case reduction = 2;
|
* @return array
|
||||||
case recipe = 3;
|
*/
|
||||||
case info = 4;
|
protected static function values(): array
|
||||||
case message = 5;
|
{
|
||||||
|
return [
|
||||||
|
'all' => 1,
|
||||||
|
'reduction' => 2,
|
||||||
|
'recipe' => 3,
|
||||||
|
'info' => 4,
|
||||||
|
'message' => 5
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optionnal labels definition.
|
* Enum labels
|
||||||
*
|
*
|
||||||
* @phpstan-ignore-next-line
|
* @return array
|
||||||
*/
|
*/
|
||||||
private const LABELS = [
|
protected static function labels(): array
|
||||||
self::all->name => 'Toutes les notifications',
|
{
|
||||||
self::reduction->name => 'Les réductions',
|
return [
|
||||||
self::recipe->name => 'Les recettes',
|
'all' => __("Toutes les notifications"),
|
||||||
self::info->name => 'Les infos du club',
|
'reduction' => __("Les réductions"),
|
||||||
self::message->name => 'Les messages',
|
'recipe' => __("Les recettes"),
|
||||||
];
|
'info' => __("Les infos du club"),
|
||||||
|
'message' => __("Les message")
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
52
app/Enums/NutritionBlocType.php
Normal file
52
app/Enums/NutritionBlocType.php
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self bloc1()
|
||||||
|
* Text et dropdowns array
|
||||||
|
* @method static self bloc2()
|
||||||
|
* Text et label array
|
||||||
|
* @method static self bloc3()
|
||||||
|
* Big image et optional button
|
||||||
|
* @method static self bloc4()
|
||||||
|
* Big image et dropdowns array
|
||||||
|
* @method static self bloc5()
|
||||||
|
* Green encart
|
||||||
|
*/
|
||||||
|
final class NutritionBlocType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'bloc1' => 0,
|
||||||
|
'bloc2' => 1,
|
||||||
|
'bloc3' => 2,
|
||||||
|
'bloc4' => 3,
|
||||||
|
'bloc5' => 4
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'bloc1' => __('Bloc 1, (Text et dropdowns array)'),
|
||||||
|
'bloc2' => __('Bloc 2 (Text et label array)'),
|
||||||
|
'bloc3' => __('Bloc 3 (Big image et optional button'),
|
||||||
|
'bloc4' => __('Bloc 4 (Big image et dropdowns array)'),
|
||||||
|
'bloc5' => __('Bloc 5 (Green encart)')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
38
app/Enums/NutritionPageType.php
Normal file
38
app/Enums/NutritionPageType.php
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self poultry()
|
||||||
|
* @method static self quality()
|
||||||
|
*/
|
||||||
|
final class NutritionPageType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'poultry' => 0,
|
||||||
|
'quality' => 1
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'poultry' => __('Page volaille'),
|
||||||
|
'quality' => __('Page qualité nutrition')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
38
app/Enums/OCBType.php
Normal file
38
app/Enums/OCBType.php
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self rabbit()
|
||||||
|
* @method static self poultry()
|
||||||
|
*/
|
||||||
|
final class OCBType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'rabbit' => 1,
|
||||||
|
'poultry' => 2
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'rabbit' => __('Lapin'),
|
||||||
|
'poultry' => __('Volaille')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
46
app/Enums/OrderStatus.php
Normal file
46
app/Enums/OrderStatus.php
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self waiting()
|
||||||
|
* @method static self failed()
|
||||||
|
* @method static self waitingCheck()
|
||||||
|
* @method static self sentCheck()
|
||||||
|
* @method static self payed()
|
||||||
|
*/
|
||||||
|
final class OrderStatus extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'waiting' => 0,
|
||||||
|
'failed' => 1,
|
||||||
|
'payed' => 2,
|
||||||
|
'waitingCheck' => 3,
|
||||||
|
'sentCheck' => 4
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'waiting' => __('En attente'),
|
||||||
|
'failed' => __('Échec'),
|
||||||
|
'payed' => __('Réglée'),
|
||||||
|
'sentCheck' => __('Par chèque bancaire')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
38
app/Enums/OrderType.php
Normal file
38
app/Enums/OrderType.php
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self cb()
|
||||||
|
* @method static self check()
|
||||||
|
*/
|
||||||
|
final class OrderType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'cb' => 0,
|
||||||
|
'check' => 1
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'cb' => __('Carte Bancaire'),
|
||||||
|
'check' => __('Chèque')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Pagination;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum ItemsPerPaginationEnum: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case five = 5;
|
|
||||||
case twelve = 12;
|
|
||||||
case twentyfive = 25;
|
|
||||||
case fifty = 50;
|
|
||||||
case onehundred = 100;
|
|
||||||
}
|
|
||||||
40
app/Enums/PoultryBlocType.php
Normal file
40
app/Enums/PoultryBlocType.php
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self bloc1()
|
||||||
|
* Text seulement
|
||||||
|
* @method static self bloc2()
|
||||||
|
* Text et video
|
||||||
|
*/
|
||||||
|
final class PoultryBlocType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'bloc1' => 0,
|
||||||
|
'bloc2' => 1
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'bloc1' => __('Bloc 1, (Text seulement)'),
|
||||||
|
'bloc2' => __('Bloc 2 (Text et video)')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
38
app/Enums/PoultryPageType.php
Normal file
38
app/Enums/PoultryPageType.php
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self engage()
|
||||||
|
* @method static self tracable()
|
||||||
|
*/
|
||||||
|
final class PoultryPageType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'engage' => 0,
|
||||||
|
'tracable' => 1
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'engage' => __('Page eleveurs 100% engagés'),
|
||||||
|
'tracable' => __('Page production 100% tracable')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
38
app/Enums/PresentationType.php
Normal file
38
app/Enums/PresentationType.php
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self picture()
|
||||||
|
* @method static self video()
|
||||||
|
*/
|
||||||
|
final class PresentationType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'picture' => 0,
|
||||||
|
'video' => 1
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'picture' => __('Photo'),
|
||||||
|
'video' => __('Video'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
65
app/Enums/RangeColor.php
Normal file
65
app/Enums/RangeColor.php
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self color1()
|
||||||
|
* @method static self color2()
|
||||||
|
* @method static self color3()
|
||||||
|
* @method static self color4()
|
||||||
|
* @method static self color5()
|
||||||
|
* @method static self color6()
|
||||||
|
* @method static self color7()
|
||||||
|
* @method static self color8()
|
||||||
|
* @method static self color9()
|
||||||
|
* @method static self color10()
|
||||||
|
* @method static self color11()
|
||||||
|
*/
|
||||||
|
final class RangeColor extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'color1' => 'color-1',
|
||||||
|
'color2' => 'color-2',
|
||||||
|
'color3' => 'color-3',
|
||||||
|
'color4' => 'color-4',
|
||||||
|
'color5' => 'color-5',
|
||||||
|
'color6' => 'color-6',
|
||||||
|
'color7' => 'color-7',
|
||||||
|
'color8' => 'color-8',
|
||||||
|
'color9' => 'color-9',
|
||||||
|
'color10' => 'color-10',
|
||||||
|
'color11' => 'color-11'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'color1' => 'Couleur 1',
|
||||||
|
'color2' => 'Couleur 2',
|
||||||
|
'color3' => 'Couleur 3',
|
||||||
|
'color4' => 'Couleur 4',
|
||||||
|
'color5' => 'Couleur 5',
|
||||||
|
'color6' => 'Couleur 6',
|
||||||
|
'color7' => 'Couleur 7',
|
||||||
|
'color8' => 'Couleur 8',
|
||||||
|
'color9' => 'Couleur 9',
|
||||||
|
'color10' => 'Couleur 10',
|
||||||
|
'color11' => 'Couleur 11'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum RatingEnum: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case inedible = 0;
|
|
||||||
case bad = 1;
|
|
||||||
case mid = 2;
|
|
||||||
case good = 3;
|
|
||||||
case great = 4;
|
|
||||||
case amazing = 5;
|
|
||||||
}
|
|
||||||
54
app/Enums/RecipeDifficulty.php
Normal file
54
app/Enums/RecipeDifficulty.php
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self veryeasy()
|
||||||
|
* @method static self easy()
|
||||||
|
* @method static self confirmed()
|
||||||
|
* @method static self expert()
|
||||||
|
*/
|
||||||
|
final class RecipeDifficulty extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'veryeasy' => 1,
|
||||||
|
'easy' => 2,
|
||||||
|
'confirmed' => 3,
|
||||||
|
'expert' => 4
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'veryeasy' => __('Très facile'),
|
||||||
|
'easy' => __('Facile'),
|
||||||
|
'confirmed' => __('Confirmé'),
|
||||||
|
'expert' => __('Expert'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Output the value as a string
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function __toString(): string
|
||||||
|
{
|
||||||
|
return (string)$this->label;
|
||||||
|
}
|
||||||
|
}
|
||||||
46
app/Enums/RecipeFilter.php
Normal file
46
app/Enums/RecipeFilter.php
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self range()
|
||||||
|
* @method static self consumption()
|
||||||
|
* @method static self cooking()
|
||||||
|
* @method static self preparation()
|
||||||
|
*/
|
||||||
|
final class RecipeFilter extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
$labels = self::labels();
|
||||||
|
return [
|
||||||
|
'range' => Str::slug($labels['range']),
|
||||||
|
'consumption' => Str::slug($labels['consumption']),
|
||||||
|
'cooking' => Str::slug($labels['cooking']),
|
||||||
|
'preparation' => Str::slug($labels['preparation'])
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'range' => __('Gamme'),
|
||||||
|
'consumption' => __('Moment de consommation'),
|
||||||
|
'cooking' => __('Temps de cuisson'),
|
||||||
|
'preparation' => __('Temps de préparation')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
43
app/Enums/RecipeFilterTimes.php
Normal file
43
app/Enums/RecipeFilterTimes.php
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self less15()
|
||||||
|
* @method static self between15and30()
|
||||||
|
* @method static self more30()
|
||||||
|
*/
|
||||||
|
final class RecipeFilterTimes extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
$labels = self::labels();
|
||||||
|
return [
|
||||||
|
'less15' => Str::slug($labels['less15']),
|
||||||
|
'between15and30' => Str::slug($labels['between15and30']),
|
||||||
|
'more30' => Str::slug($labels['more30']),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'less15' => __('Moins de 15 minutes'),
|
||||||
|
'between15and30' => __('Entre 15 et 30 minutes'),
|
||||||
|
'more30' => __('Plus de 30 minutes'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
38
app/Enums/RecipeType.php
Normal file
38
app/Enums/RecipeType.php
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static self classic()
|
||||||
|
* @method static self video()
|
||||||
|
*/
|
||||||
|
final class RecipeType extends BaseEnumRoutable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Enum values
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function values(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'classic' => 0,
|
||||||
|
'video' => 1
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum labels
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function labels(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'classic' => __('Classic'),
|
||||||
|
'video' => __('Video')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Recipes;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Will caracterise the setting row (ID)
|
|
||||||
*/
|
|
||||||
enum DifficultyEnum: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case very_easy = 1;
|
|
||||||
case easy = 2;
|
|
||||||
case confirmed = 3;
|
|
||||||
case expert = 4;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::very_easy->name => 'Très facile',
|
|
||||||
self::easy->name => 'Facile',
|
|
||||||
self::confirmed->name => 'Confirmé',
|
|
||||||
self::expert->name => 'Expert',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Settings;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum MenuNodeType: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case ourProducts = 1;
|
|
||||||
case ourRecipes = 2;
|
|
||||||
case ourCommitments = 3;
|
|
||||||
case siteLogo = 4;
|
|
||||||
case breedings = 5;
|
|
||||||
case ourBrand = 6;
|
|
||||||
case recruitment = 7;
|
|
||||||
case news = 8;
|
|
||||||
case link = 9;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::ourProducts->name => 'Nos produits',
|
|
||||||
self::ourRecipes->name => 'Nos recettes',
|
|
||||||
self::ourCommitments->name => 'Nos engagments',
|
|
||||||
self::siteLogo->name => 'Logo du site',
|
|
||||||
self::breedings->name => 'Les élevages',
|
|
||||||
self::ourBrand->name => 'Notre marque',
|
|
||||||
self::recruitment->name => 'Recrutement',
|
|
||||||
self::news->name => 'Actus',
|
|
||||||
self::link->name => 'Lien',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*/
|
|
||||||
private const ROUTENAMES = [
|
|
||||||
self::ourProducts->name => 'fo.products.index',
|
|
||||||
self::ourRecipes->name => 'fo.recipes.index',
|
|
||||||
self::ourCommitments->name => 'fo.commitments.brand',
|
|
||||||
self::siteLogo->name => 'fo.home.show',
|
|
||||||
self::breedings->name => 'fo.breeding.index',
|
|
||||||
self::ourBrand->name => 'fo.brand.story',
|
|
||||||
self::recruitment->name => 'fo.recruitment.show',
|
|
||||||
self::news->name => 'fo.news.index',
|
|
||||||
self::link->name => '',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Class
|
|
||||||
*/
|
|
||||||
public function routeName(): ?string
|
|
||||||
{
|
|
||||||
return ! empty(self::ROUTENAMES[$this->name]) ?
|
|
||||||
self::ROUTENAMES[$this->name] : null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Settings;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Will caracterise the setting row (ID)
|
|
||||||
*/
|
|
||||||
enum SettingsType: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case mainMenu = 1;
|
|
||||||
case hotNews = 2;
|
|
||||||
case offersCount = 3;
|
|
||||||
case breederMap = 4;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition.
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::mainMenu->name => 'Menu principal',
|
|
||||||
self::hotNews->name => 'Infos chaudes',
|
|
||||||
self::offersCount->name => 'Total des offres de la marque',
|
|
||||||
self::breederMap->name => 'Carte des éleveurs',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Shop;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum ContactFormCivility: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case m = 1;
|
|
||||||
case mme = 2;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::m->name => 'M',
|
|
||||||
self::mme->name => 'Mme',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Enums\Shop;
|
|
||||||
|
|
||||||
use App\Traits\Enums\BaseEnum;
|
|
||||||
|
|
||||||
enum OrderStatus: int
|
|
||||||
{
|
|
||||||
use BaseEnum;
|
|
||||||
|
|
||||||
case waiting = 1;
|
|
||||||
case failed = 2;
|
|
||||||
case payed = 3;
|
|
||||||
case waitingCheck = 4;
|
|
||||||
case sentCheck = 5;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionnal labels definition
|
|
||||||
*
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
private const LABELS = [
|
|
||||||
self::waiting->name => 'En attente',
|
|
||||||
self::failed->name => 'Échec',
|
|
||||||
self::payed->name => 'Réglée',
|
|
||||||
self::waitingCheck->name => 'En attente du chèque bancaire',
|
|
||||||
self::sentCheck->name => 'Envoi du chèque bancaire',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue