inspection.paid (attributePathResolver.ts, conditionsResolver.ts, builder in templatingData.ts).inspection.paid is set in syncTotalsOnInspection (syncTotalsOnInspections.ts) only when balance ≤ $0.01; pending pay_at_close payments contribute $0 to totalPaid.inspectionStream.ts calls syncTotalsOnInspection without await, then immediately flowEventTriggerer('payment_created', …) — flows can evaluate paid: false even right after PAC activity.payment_created fires when a pending PAC row is created (isnPayments.ts), not only when the job is fully paid.ServicesPayments.tsx can show PAC as Paid/Signed from payment/ISN status while inspection.paid remains false; client portal shows Pending Payment until inspection.paid is true (JobAccordion.tsx).inspection.paid is false (common when PAC is pending, or due to sync timing right after PAC create/complete).Narrower repro: Client starts PAC → pending payment created → payment_created fires immediately → Paid is false passes → unpaid SMS sent while staff see PAC on the WO.
attik-backend/src/events/streamHandlers/inspectionStream.ts — await syncTotalsOnInspection before enqueueing payment_created (or re-fetch inspection after sync in the flow worker before evaluateConditions).attik-backend/src/util/functions/forecast/syncTotalsOnInspections.ts — paid / totalPaid rules for pending vs completed PAC.attik-backend/src/routes/isnPayments.ts — PAC create (pending payment).attik-backend/src/routes/webhooks/flexfund/flexfundWebhook.ts — PAC complete (awaits sync today; stream may still race).attik-backend/src/util/functions/isn/isnPayAtCloseOrderTotal.ts — PAC amount toward totalPaid when completed.attik-backend/src/util/functions/actionFlows/handleEventTriggerdByBull.ts — condition evaluation timing vs populated inspection snapshot.payment_created on pending PAC create — use an event when PAC completes / when inspection.paid becomes true.tests/unit/payment.pac.test.ts and flow condition tests — completed PAC → inspection.paid === true → Paid is false actions filtered; pending PAC behavior matches chosen product rule.attik-frontend/src/components/conditions/templatingData.ts — Paid boolean condition labeling (clarify vs PAC row status).attik-frontend/src/app/tools/inspections/[id]/components/ServicesPayments.tsx — PAC display vs job Paid flag.attik-frontend/src/app/client/job/[slug]/components/JobAccordion.tsx — portal Pending Payment vs Paid chip.inspection.paid, remainingBalance, and which flow action (event + Paid is false) sent the "No Pay" SMS.inspection.paid is true before payment_created actions evaluate (or those actions do not run for settled PAC).attik-backend/src/events/streamHandlers/inspectionStream.tsattik-backend/src/util/functions/forecast/syncTotalsOnInspections.tsattik-backend/src/util/functions/actionFlows/attributePathResolver.tsattik-backend/src/routes/isnPayments.tsattik-backend/src/routes/webhooks/flexfund/flexfundWebhook.tsattik-frontend/src/components/conditions/templatingData.tsPlease authenticate to join the conversation.
Planned
Main App
10 days ago
Linear
Get notified by email when there are changes.
Planned
Main App
10 days ago
Linear
Get notified by email when there are changes.