fix: warranty claim operator precedence bug + WO validation
Universal: Auto Version Bump / Version Bump (push) Successful in 10s
Universal: PR Check / Branch Policy (pull_request) Successful in 1s
Generic: Repo Health / Site Health (pull_request) Has been skipped
Universal: PR Check / Secret Scan (pull_request) Successful in 4s
Universal: PR Check / Validate PR (pull_request) Failing after 4s
Generic: Repo Health / Access control (pull_request) Successful in 2s
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 13s
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Generic: Repo Health / Scripts governance (pull_request) Has been cancelled
Generic: Repo Health / Repository health (pull_request) Has been cancelled
Generic: Repo Health / Report Issues (pull_request) Has been cancelled

This commit is contained in:
Jonathan Miller
2026-06-20 23:38:25 -05:00
parent ec1618c425
commit c8b1b32b71
@@ -54,9 +54,16 @@ class WarrantyHelper
{
$warranty = self::checkWarranty($equipmentId);
if (!$warranty->found ?? true) return (object) ['success' => false, 'error' => 'Equipment not found'];
if (empty($warranty->id)) return (object) ['success' => false, 'error' => 'Equipment not found'];
if (!$warranty->under_warranty) return (object) ['success' => false, 'error' => 'Warranty expired'];
// Verify work order exists and is linked to this equipment
$db->setQuery($db->getQuery(true)->select('id')->from('#__mokosuitefield_work_orders')
->where('id = ' . (int) $woId));
if (!(int) $db->loadResult()) {
return (object) ['success' => false, 'error' => 'Invalid work order'];
}
$db = Factory::getContainer()->get(DatabaseInterface::class);
$now = Factory::getDate()->toSql();