commit de compras

This commit is contained in:
2026-11-04 09:37:20 +02:00
parent fcf31e8d48
commit 0b05a1192c
741 changed files with 114127 additions and 116 deletions
+18
View File
@@ -0,0 +1,18 @@
<?php
namespace App\Modules\Purchasing;
use Tempo\Purchasing\Embedded\Models\AuditLog;
/** A stage's history must not become a back door into downstream financial payloads. */
final class ProcessHistory
{
public function query(int $request,string $stage)
{
$patterns=match($stage){
'requests'=>['requisition.%','sgf.request.command'],
'sourcing'=>['requisition.%','sgf.request.command','quotation.%','award.%','sgf.sourcing.command'],
default=>throw new \InvalidArgumentException('Unknown history stage'),
};
return AuditLog::where('requisition_id',$request)->where(function($q)use($patterns){foreach($patterns as$pattern)$q->orWhere('action','like',$pattern);});
}
}