Comment ticket status + add more parameters to WarnBeforeAutoCloseTicket job and AutoCloseOldTickets
This commit is contained in:
parent
1a8016ae13
commit
04594afae6
3 changed files with 14 additions and 2 deletions
|
|
@ -6,13 +6,21 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
|
|||
|
||||
/**
|
||||
* @method static self new()
|
||||
* Nouveau ticket
|
||||
* @method static self estimateTodo()
|
||||
* Devis à faire.
|
||||
* @method static self takenInAccount()
|
||||
* Nouveau ticket à été pris en charge
|
||||
* @method static self waiting()
|
||||
* On attend que le client réponde dans le ticket
|
||||
* @method static self waitingValidation()
|
||||
* On attend que le client valide l'estimation
|
||||
* @method static self recette()
|
||||
* Est mis en recette
|
||||
* @method static self production()
|
||||
* Est mis en production
|
||||
* @method static self archived()
|
||||
* Ticket fermé
|
||||
*/
|
||||
class TicketStatus extends BaseEnumRoutable
|
||||
{
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@ class AutoCloseOldTickets
|
|||
$limitDays = 15;
|
||||
$message = 'En l\'absence d\'activitée depuis 15 jours ce ticket est automatiquement clos et archivé.';
|
||||
$tickets = Ticket::where(function ($q) {
|
||||
$q->where('status', TicketStatus::production());
|
||||
$q->where('status', TicketStatus::production())
|
||||
->orWhere('status', TicketStatus::waitingValidation())
|
||||
->orWhere('status', TicketStatus::waiting());
|
||||
})->whereDate('updated_at', '<=', Carbon::now()->subDays($limitDays))
|
||||
->whereDoesntHave('messages', function ($q) use ($limitDays) {
|
||||
$q->whereDate('updated_at', '>', Carbon::now()->subDays($limitDays));
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ class WarnBeforeAutoCloseTicket
|
|||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
$messageToUser = 'En l\'absence d\'activitée, ou de réponse de votre part ce ticket sera automatiquement clos et archivé dans %s jours.';
|
||||
$tickets = Ticket::where(function ($q) {
|
||||
$q->where('status', TicketStatus::production());
|
||||
$q->where('status', TicketStatus::production())
|
||||
->orWhere('status', TicketStatus::waitingValidation())
|
||||
->orWhere('status', TicketStatus::waiting());
|
||||
})->whereDate('updated_at', '<=', Carbon::now()->subDays($warningDays))
|
||||
->whereDoesntHave('messages', function ($q) use ($warningDays) {
|
||||
$q->whereDate('updated_at', '>', Carbon::now()->subDays($warningDays));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue