1008593904 — Example inspection130 Thrushwood Dr, Fayetteville, Georgia 30215RIA1639Agreement collection, client route /client/job/[slug]/agreement/[id])inspection.agreement.signed / inspection.paid used for badges and report lockagreementLockSync.ts treats only stale signed active agreements as not signed at the job level (only stale signed → not signed in unit tests). Individual rows can still show Signed / Outdated in the Agreements UI while the order chip stays unsigned.checkReportAccess.ts unlocks when paid (unless toBeInvoiced) and non-stale agreements are satisfied (DB query preferred over stale inspection.agreement sync).inspection.paid (payAtClosePaymentContributesToTotalPaid); payment should move to completed on FlexFund statuses such as SIGNATURE_RECEIVED via POST /webhooks/flexfund and totals sync.


Backend
attik-backend/src/events/streamHandlers/agreementStream.ts updates inspection.agreement.present / inspection.agreement.signed via attik-backend/src/util/functions/agreements/agreementLockSync.ts (non-stale rows must be signed; stale-only signed → job signed: false).attik-backend/src/util/functions/inspection/checkReportAccess.ts (paid + agreement rules; uses Agreement DB when query succeeds).attik-backend/src/events/bullmq/agreementStaleWorker.ts and signing hash logic under attik-backend/src/util/functions/agreements/.attik-backend/src/routes/webhooks/flexfund/flexfundWebhook.ts, status mapping in attik-backend/src/util/functions/payments/pacIsnFlexFundStatuses.ts and paymentStatusMapping.ts, transitions in paymentStatusValidator.ts.attik-backend/src/util/functions/isn/isnPayAtCloseOrderTotal.ts (payAtClosePaymentContributesToTotalPaid), attik-backend/src/util/functions/forecast/syncTotalsOnInspections.ts.inspection.agreement desync, or PAC webhook/status stuck in pending.Frontend
attik-frontend/src/components/ui/StatusBadges.tsx uses job.agreement.signed (not per-document status).attik-frontend/src/components/task-check/AgreementsNeeded.tsx (agreementSigned: 'false', !job.agreement.signed).attik-frontend/src/app/tools/inspections/[id]/components/Agreements.tsx (per-row status, stale/outdated UI).attik-frontend/src/app/client/job/[slug]/components/AttikAgreementList.tsx (row-level Signed / Outdated).attik-frontend/src/app/client/job/[slug]/components/ReportList.tsx with attik-frontend/src/util/functions/report/computeAgreementSignedForReportLock.ts (can prefer agreements array over synced fields).attik-frontend/src/app/client/job/[slug]/pay-beta/PaymentBetaClient.tsx, PendingPACAlert.tsx, helpers in attik-frontend/src/util/functions/payments/pacStatusHelpers.ts (isPACPaymentPending, Pending Signature labels).Out of scope unless expanded
inspection.agreement.signed pattern exists in attik-mobile but not reported in examples).attik-backend/src/util/functions/agreements/agreementLockSync.ts, attik-backend/tests/unit/agreementLockSync.test.tsattik-backend/src/util/functions/inspection/checkReportAccess.ts, attik-backend/tests/integration/lockReport.test.tsattik-backend/src/routes/webhooks/flexfund/flexfundWebhook.tsPlease authenticate to join the conversation.
Completed
Main App
7 days ago
Linear
Get notified by email when there are changes.
Completed
Main App
7 days ago
Linear
Get notified by email when there are changes.