47eb4f62c1
Implements the injector diagnostic protocol module per spec:
- Migration: injector_protocols + injector_protocol_rows with company_id
(multi-tenant), vehicle_id (not car_id — this CRM uses Vehicle),
master_id FK to users, snapshot fields (car_model/plate/vin/mileage/year/
injector_brand) captured at protocol time.
- Models with BelongsToTenant; auto-generate protocol_number as
PS-{tenantId}-{year}-{seq6}; auto-seed 8 empty rows on create.
- Permissions: injector_protocols.view + injector_protocols.conclude.
Default roles: owner/admin (both), manager (both), receptionist (view
only), mechanic (both). Test permission count updated 52→54.
- InjectorProtocolResource under Service nav group with 4 sections:
data auto+client (with client_id/vehicle_id lookups auto-filling
snapshot fields), reason checkboxes, 8-row repeater for measurements
(Repeater with position hidden; fixed 8, non-addable/deletable),
conclusion + comment + master signature.
- Table with columns, badge filters, PDF action.
- Blade PDF template: pixel-close to reference (graphite/gold/blue
brand tokens, striped rows, rotated 'ФОРСУНКИ' header).
- Route /app/injector-protocols/{id}/pdf with permission gate,
streams PDF via new InjectorProtocolPdfService (Browsershot).
- Dockerfile: install nodejs 22 + chromium + noto fonts + puppeteer-core
in /opt/browsershot; env vars for Browsershot binary paths.
- +71 RU/EN translations covering resource + PDF template.
All 306 tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Tenant;
|
|
|
|
use App\Models\Concerns\BelongsToTenant;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class InjectorProtocolRow extends Model
|
|
{
|
|
use BelongsToTenant;
|
|
|
|
protected $fillable = [
|
|
'company_id', 'injector_protocol_id', 'position',
|
|
'resistance_before', 'resistance_after',
|
|
'open_time_before', 'open_time_after',
|
|
'close_time_before', 'close_time_after',
|
|
'close_time_kz_before', 'close_time_kz_after',
|
|
'flow_before', 'flow_after',
|
|
'tightness_before', 'tightness_after',
|
|
];
|
|
|
|
protected $casts = [
|
|
'position' => 'integer',
|
|
'resistance_before' => 'decimal:2',
|
|
'resistance_after' => 'decimal:2',
|
|
'open_time_before' => 'decimal:2',
|
|
'open_time_after' => 'decimal:2',
|
|
'close_time_before' => 'decimal:2',
|
|
'close_time_after' => 'decimal:2',
|
|
'close_time_kz_before' => 'decimal:2',
|
|
'close_time_kz_after' => 'decimal:2',
|
|
'flow_before' => 'decimal:2',
|
|
'flow_after' => 'decimal:2',
|
|
];
|
|
|
|
public function protocol(): BelongsTo
|
|
{
|
|
return $this->belongsTo(InjectorProtocol::class, 'injector_protocol_id');
|
|
}
|
|
}
|