Merge branch 'trunk'

This commit is contained in:
Noah Lancien 2026-01-12 10:14:14 +01:00
commit 1d28cbe7cd
10 changed files with 140 additions and 22 deletions

View file

@ -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=

View file

@ -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
}

View file

@ -0,0 +1,47 @@
<?php
namespace App\Jobs;
use App\Enums\Claims\ClaimStatus;
use App\Mail\TransferredToDigitalCountMail;
use App\Models\Claim;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Mail;
class SendTransferredToDigitalCountMail implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct()
{
}
/**
* Execute the job.
*
* @return void
*/
public function handle(): void
{
$count = Claim::query()->where('status', ClaimStatus::sentDigital)->count();
if ($count <= 0) {
return;
}
Mail::to(config('mail.digital_service'))
->send(new TransferredToDigitalCountMail($count));
}
}

View file

@ -0,0 +1,33 @@
<?php
namespace App\Mail;
use Illuminate\Mail\Mailable;
class TransferredToDigitalCountMail extends Mailable
{
/**
* Create a new message instance.
*
* @param int $count
* @return void
*/
public function __construct(private int $count)
{
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this
->subject(sprintf('%s réclamations vous attendent', $this->count))
->view('mail.transferred-claim-count')
->text('mail.transferred-claim-count-plain')
->with('count', $this->count);
}
}

View file

@ -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"
},

27
composer.lock generated
View file

@ -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",

View file

@ -115,4 +115,10 @@ return [
],
],
/**
* Contact list
*/
'digital_service' => env('MAIL_DIGITAL_SERVICE', 'digital@ldc.fr'),
];

View file

@ -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:

View file

@ -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

View file

@ -0,0 +1,12 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{{ config('app.name') }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<p>Bonjour,</p>
<p>{{ $count }} réclamations vous sont actuellement attribuées.</p>
<p>Cliquez <a href="https://crm.uwil.fr/bo/claims?sort_col=created_at&sort_way=desc&status[]=2">ici</a> pour y accéder.</p>
</body>
</html>