Modular logistics and supply chain operating system (LSOS)
JavaScript driver-appfleet-managementfreight-managementinfrastructureinventory-managementlast-mile-deliverylogisticsondemandopen-sourceorder-managementroute-optimizationsupply-chain-managementtracking-and-monitoringtransport-management-systemtransportationwarehouse-management
ci: seed the driver password-reset code the contract run needs
Ronald A. Richardson56a2e5399d40
diff --git a/.github/actions/postman-contract/action.yml b/.github/actions/postman-contract/action.ymlindex 25047c84..32e9a0c9 100644--- a/.github/actions/postman-contract/action.yml+++ b/.github/actions/postman-contract/action.yml@@ -343,6 +343,11 @@ runs:# Update Authenticated Customer is a no-op rename rather than a surprise.# verification_code must equal what mint-api-key.php seeded — both read the same# action input, so they cannot drift.+ # driver_password_reset_code is the same seeded value, but it is a SEPARATE+ # variable because it stands for a different row: DriverController::resetPassword+ # matches `for=driver_password_reset`, which a driver login code does not satisfy.+ # Collapsing it into verification_code would work only for as long as both rows+ # are seeded with the same code.# base64_file_data / from_datetime / to_datetime were referenced by requests but# set by nothing — see scripts/ci/find-unsourced-variables.py. An unresolved# variable is sent literally, so those requests were exercising the API with the@@ -377,6 +382,7 @@ runs:' --env-var "driver_identity=${DRIVER_IDENTITY}" \' \' --env-var "driver_password=${DRIVER_PASSWORD}" \' \' --env-var "driver_phone=${DRIVER_PHONE}" \' \+ ' --env-var "driver_password_reset_code=${VERIFICATION_CODE}" \' \' --env-var "device_token=ci-contract-device-token" \' \' --env-var "base64_file_data=iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAbElEQVR42hXNQRUAUQhCUaMYhShGeVGIQhSizB+XXA7ODDtouIHBQ4YOM8suWm5h8ZKl+0CskDiBsIioHhx76LiDw0eO3oN/4FVf+J8h0PduzBqZ8x/bxNQPwgaFy192SGgelC0q13/CJaXlA8Z7WAFXOTbyAAAAAElFTkSuQmCC" \' \' --env-var "from_datetime=2026-01-01T00:00:00Z" \' \diff --git a/scripts/ci/mint-api-key.php b/scripts/ci/mint-api-key.phpindex 4a6a025b..39b6cf30 100644--- a/scripts/ci/mint-api-key.php+++ b/scripts/ci/mint-api-key.php@@ -274,6 +274,19 @@ try {$driverCode->code = $customerCode;$driverCode->save();+ // DriverController::resetPassword matches subject_uuid + code + for, and its+ // `for` is driver_password_reset — a login code will not satisfy it, so the+ // reset flow needs a row of its own exactly as the customer reset does.+ \Fleetbase\Models\VerificationCode::withoutGlobalScopes()+ ->where(['subject_uuid' => $driverUser->uuid, 'for' => 'driver_password_reset'])+ ->delete();+ $driverResetCode = \Fleetbase\Models\VerificationCode::generateFor($driverUser, 'driver_password_reset', false);+ $driverResetCode->expires_at = \Illuminate\Support\Carbon::now()->addDay();+ $driverResetCode->status = 'active';+ $driverResetCode->save();+ $driverResetCode->code = $customerCode;+ $driverResetCode->save();+/* ============================================================| SECOND ORGANIZATION (Switch Driver Organization)* ============================================================ */