Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
TblZeusInboundLog
n/a
0 / 0
n/a
0 / 0
0
n/a
0 / 0
1<?php
2
3namespace App\Models;
4
5use Illuminate\Database\Eloquent\Model;
6
7/**
8 * One row per Zeus → Titan sync request.
9 *
10 * Companion to TblZeusBridgeLog (the outbound audit): the two directions are
11 * kept in separate tables because they answer different questions
12 * ("what did we send Zeus?" vs "what did Zeus send us?"). Payload bodies live
13 * in tbl_api_consumer_endpoints via AuthenticateWithToken; only the fingerprint
14 * is stored here.
15 */
16class TblZeusInboundLog extends Model
17{
18    // Endpoint: which controller method received it.
19    public const ENDPOINT_UPSERT = 'upsertQuotation';
20
21    public const ENDPOINT_DELETE = 'deleteQuotation';
22
23    // FIRE-1733 comment 27842: multipart file upload for quotation attachments.
24    public const ENDPOINT_UPLOAD_FILE = 'uploadQuotationFile';
25
26    // Action taken on the Titan side.
27    public const ACTION_CREATED = 'created';
28
29    public const ACTION_UPDATED = 'updated';
30
31    public const ACTION_DELETED = 'deleted';
32
33    public const ACTION_FILES_UPLOADED = 'files_uploaded';
34
35    // Idempotent no-ops that are still logged so we can trace out-of-order
36    // deliveries and "delete on a row we never had" gracefully.
37    public const ACTION_SKIPPED_STALE = 'skipped_stale';
38
39    public const ACTION_SKIPPED_NOT_FOUND = 'skipped_not_found';
40
41    // Validation failure or auth-layer rejection.
42    public const ACTION_REJECTED = 'rejected';
43
44    protected $table = 'tbl_zeus_inbound_log';
45
46    public $timestamps = false;
47
48    protected $fillable = [
49        'auth_user_id',
50        'endpoint',
51        'zeus_id',
52        'quotation_id',
53        'action',
54        'http_status',
55        'payload_hash',
56        'zeus_updated_at',
57        'error',
58        'duration_ms',
59        'created_at',
60    ];
61
62    protected $casts = [
63        'auth_user_id' => 'integer',
64        'zeus_id' => 'integer',
65        'quotation_id' => 'integer',
66        'http_status' => 'integer',
67        'duration_ms' => 'integer',
68    ];
69}