diff --git a/.env.example b/.env.example index 15236da..963fddd 100644 --- a/.env.example +++ b/.env.example @@ -32,17 +32,16 @@ MAIL_PASSWORD=null MAIL_ENCRYPTION=null MAIL_FROM_ADDRESS=null MAIL_FROM_NAME="${APP_NAME}" +MAIL_DIGITAL_SERVICE="" # Sentry SENTRY_LARAVEL_DSN= -# ADMIN SECURE -# - API ENDPOINT (Optional) -LDC_WEB_API_ENDPOINT="https://ldc-web.ldc.fr/api/ldc-networks" -# - API KEY -LDC_WEB_API_KEY="" +# UWIL ADMIN SECURE +# - LIST SEPARATED WITH ',' (Required) +UWIL_ADMIN_SECURE_CIDR_LIST="" # - LIST SEPARATED WITH ',' (Optional) -LDC_WEB_CIDR_MANUAL_ALLOWED_LIST="" +UWIL_ADMIN_SECURE_CIDR_PROJECT_ALLOWED_LIST="" # SAML SAML2_DEFAULT_TENANT_UUID= diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 9f6cd18..6ae34af 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -3,6 +3,7 @@ namespace App\Console; use App\Console\Commands\DeleteUnconfirmedCustomers; +use App\Jobs\SendTransferredToDigitalCountMail; use App\Jobs\StartStatJobs; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; @@ -26,6 +27,7 @@ class Kernel extends ConsoleKernel { // @codeCoverageIgnoreStart $schedule->job(StartStatJobs::class)->dailyAt('03:30'); + $schedule->job(SendTransferredToDigitalCountMail::class)->dailyAt('07:00'); $schedule->command(DeleteUnconfirmedCustomers::class)->dailyAt('05:30'); // @codeCoverageIgnoreEnd } diff --git a/app/Jobs/SendTransferredToDigitalCountMail.php b/app/Jobs/SendTransferredToDigitalCountMail.php new file mode 100644 index 0000000..9eebfe2 --- /dev/null +++ b/app/Jobs/SendTransferredToDigitalCountMail.php @@ -0,0 +1,47 @@ +where('status', ClaimStatus::sentDigital)->count(); + + if ($count <= 0) { + return; + } + + Mail::to(config('mail.digital_service')) + ->send(new TransferredToDigitalCountMail($count)); + } +} diff --git a/app/Mail/TransferredToDigitalCountMail.php b/app/Mail/TransferredToDigitalCountMail.php new file mode 100644 index 0000000..b2a12ec --- /dev/null +++ b/app/Mail/TransferredToDigitalCountMail.php @@ -0,0 +1,33 @@ +subject(sprintf('%s réclamations vous attendent', $this->count)) + ->view('mail.transferred-claim-count') + ->text('mail.transferred-claim-count-plain') + ->with('count', $this->count); + } +} + diff --git a/composer.json b/composer.json index 96e5378..f0ee68c 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "mews/purifier": "^3.4", "propaganistas/laravel-phone": "^5.0", "sentry/sentry-laravel": "^4.10", - "uwil/admin-secure-laravel": "^3.0", + "uwil/admin-secure-laravel": "^5.0", "uwil/k8s-laravel": "^1.4", "uwil/laravel-common": "^4.1" }, diff --git a/composer.lock b/composer.lock index b1e042f..16c22e5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f04361d9a00c60112340a92b68293a68", + "content-hash": "1417f675b37867e72bdd34d5b0fcf629", "packages": [ { "name": "24slides/laravel-saml2", @@ -8093,22 +8093,22 @@ }, { "name": "uwil/admin-secure-laravel", - "version": "3.0.0", + "version": "5.0.0", "source": { "type": "git", "url": "git@lab.s-web.fr:ldc-web/projets/ldc-web-admin-secure-laravel.git", - "reference": "6bf17bd7a45b2bdc3a86cef381a86e77bc339469" + "reference": "7d9c052db4318752a312dc9763bc8c31ea053aa2" }, "dist": { "type": "zip", - "url": "https://lab.s-web.fr/api/v4/projects/20/packages/composer/archives/uwil/admin-secure-laravel.zip?sha=6bf17bd7a45b2bdc3a86cef381a86e77bc339469", - "reference": "6bf17bd7a45b2bdc3a86cef381a86e77bc339469", + "url": "https://lab.s-web.fr/api/v4/projects/20/packages/composer/archives/uwil/admin-secure-laravel.zip?sha=7d9c052db4318752a312dc9763bc8c31ea053aa2", + "reference": "7d9c052db4318752a312dc9763bc8c31ea053aa2", "shasum": "" }, "require": { "dxw/cidr": "^3.2", - "illuminate/support": "~11", - "laravel/framework": "~11", + "illuminate/support": "~11|~12", + "laravel/framework": "~11|~12", "php": "^8.3", "symfony/options-resolver": "^7.0" }, @@ -8149,14 +8149,11 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Equipe Web", - "email": "equipe.web@ldc.fr", - "homepage": "https://www.ldc.fr" - } - ], - "description": "Restrict access to LDC Network" + "description": "Restrict access to LDC Network", + "support": { + "email": "digital@ldc.fr", + "issues": "https://lab.s-web.fr/ldc-web/projets/ldc-web-admin-secure-laravel/-/issues" + } }, { "name": "uwil/k8s-laravel", diff --git a/config/mail.php b/config/mail.php index e22ad1f..65be5b4 100644 --- a/config/mail.php +++ b/config/mail.php @@ -115,4 +115,10 @@ return [ ], ], + /** + * Contact list + */ + + 'digital_service' => env('MAIL_DIGITAL_SERVICE', 'digital@ldc.fr'), + ]; diff --git a/manifest.yaml b/manifest.yaml index 8fea819..c9c156a 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -23,6 +23,7 @@ data: MAIL_ENCRYPTION: "${APP_MAIL_ENCRYPTION}" MAIL_FROM_ADDRESS: "${APP_MAIL_FROM_ADDRESS}" MAIL_FROM_NAME: "${APP_APP_NAME}" + MAIL_DIGITAL_SERVICE: "${APP_MAIL_DIGITAL_SERVICE}" SENTRY_LARAVEL_DSN: "${APP_SENTRY_LARAVEL_DSN}" LDC_WEB_API_KEY: "${APP_LDC_WEB_API_KEY}" SAML2_DEFAULT_TENANT_UUID: "${APP_SAML2_DEFAULT_TENANT_UUID}" @@ -30,6 +31,8 @@ data: SAML2_SP_CERT_PRIVATEKEY: "${APP_SAML2_SP_CERT_PRIVATEKEY}" SAML2_CONTACT_TECHNICAL_EMAIL: "${APP_SAML2_CONTACT_TECHNICAL_EMAIL}" SAML2_CONTACT_SUPPORT_EMAIL: "${APP_SAML2_CONTACT_SUPPORT_EMAIL}" + UWIL_ADMIN_SECURE_CIDR_LIST: "${APP_GLOBAL_UWIL_ADMIN_SECURE_CIDR_LIST}" + --- apiVersion: v1 kind: PersistentVolumeClaim @@ -64,6 +67,13 @@ spec: envFrom: - configMapRef: name: ${CI_PROJECT_PATH_SLUG}-config-map + resources: + limits: + cpu: "${APP_CI_CPU_LIMIT}" + memory: "${APP_CI_MEMORY_LIMIT}" + requests: + cpu: "${APP_CI_CPU_REQUEST}" + memory: "${APP_CI_MEMORY_REQUEST}" volumeMounts: - name: storage mountPath: /app/srcs/storage @@ -73,6 +83,13 @@ spec: preStop: exec: command: ["/bin/sh","-c","kill -s TERM 1; while test $(ps ax | grep -v grep | grep bash | wc -l) -gt 0; do sleep 2s; done"] + resources: + limits: + cpu: "${APP_CI_CPU_LIMIT}" + memory: "${APP_CI_MEMORY_LIMIT}" + requests: + cpu: "${APP_CI_CPU_REQUEST}" + memory: "${APP_CI_MEMORY_REQUEST}" command: - "bash" args: diff --git a/resources/views/mail/transferred-claim-count-plain.blade.php b/resources/views/mail/transferred-claim-count-plain.blade.php new file mode 100644 index 0000000..e4f6dc5 --- /dev/null +++ b/resources/views/mail/transferred-claim-count-plain.blade.php @@ -0,0 +1,5 @@ +Bonjour, + +{{ $count }} réclamations vous sont actuellement attribuées. + +Accédez à ces réclamations via ce lien : https://crm.uwil.fr/bo/claims?sort_col=created_at&sort_way=desc&status[]=2 diff --git a/resources/views/mail/transferred-claim-count.blade.php b/resources/views/mail/transferred-claim-count.blade.php new file mode 100644 index 0000000..238e779 --- /dev/null +++ b/resources/views/mail/transferred-claim-count.blade.php @@ -0,0 +1,12 @@ + + + + {{ config('app.name') }} + + + +

Bonjour,

+

{{ $count }} réclamations vous sont actuellement attribuées.

+

Cliquez ici pour y accéder.

+ +