Allow re-adding same agreement template after hiding a signed agreement on a work order

Objective

  • Provide a supported path to hide a signed agreement (archive or equivalent) and still add a new instance of the same agreement template on the same work order for the client to sign—without unsafe workarounds.

Background

  • Archiving hides an agreement from the client portal and default lists but does not remove its template from Add Agreement dedupe: existingTemplateIds in attik-frontend/src/app/tools/inspections/[id]/components/Agreements.tsx and AddAgreementModal.tsx still treats archived agreements as blocking the template.
  • The primary “new version” path today is Recreate Outdated when an agreement is stale—there is no general product flow for “same template, new signature” after hiding a non-stale signed agreement.
  • Regenerate in the UI is not aimed at replacing signed agreements in place. Manual API duplication (POST paths under attik-backend/src/routes/agreements.ts) can create multiple rows; the gap is consistent product rules (dedupe, portal visibility, locks, activity).

Scope

Frontend (attik-frontend)

  • src/app/tools/inspections/[id]/components/Agreements.tsx and AddAgreementModal.tsx — template dedupe and add flows.

Backend (attik-backend)

  • src/routes/agreements.ts, src/models/agreementSchema.js / agreement templates — archive visibility, portal queries, and creation endpoints.

References

  • attik-frontend/src/app/tools/inspections/[id]/components/Agreements.tsx
  • attik-frontend/src/app/tools/inspections/[id]/components/AddAgreementModal.tsx
  • attik-backend/src/routes/agreements.ts

Please authenticate to join the conversation.

Upvoters
Status

Completed

Board
🏠

Main App

Date

30 days ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.