How Inspection Approval and Refusal Works
Source: autosoft-workshop/app/controllers/inspections_controller.rb
- When a customer approves work, they must enter a verification code — staff members approving work internally do not need a verification code
- Each approved item is individually stamped with approved_by (who approved) and approved_on (when they approved)
- Approval sets the linked invoice's job status based on whether the inspection is finalized: different statuses apply depending on finalization state
- Approval notifications only fire for customer approvals AND only when the company has the notification setting enabled — staff approvals never trigger notifications
- Work refusal is blocked if the item has already been approved — there is no undo mechanism for customers once work is approved
- Refusal notifications fire regardless of who refused (customer or staff) — unlike approval notifications, there is no setting to suppress refusal notifications
- BUG: The refuse_work action references inspection_status without the inspection. prefix — this may cause a runtime crash when the method cannot find the variable
Support scenarios
- "The customer says they can't approve without a code" → customers are required to enter a verification code; staff should provide it or approve internally on their behalf
- "We didn't get a notification when the customer approved" → check that the approval notification setting is enabled for the company
- "We got a notification for a staff approval" → staff approvals never send notifications; if they received one, it was a customer approval
- "The customer wants to undo their approval" → not possible; once approved, refusal is blocked for that item
- "Refuse work is crashing" → known bug with missing inspection. prefix on inspection_status — may need a code fix