Add configurable Terms & Conditions at financial product level

Changes

This update introduces the ability to configure Terms & Conditions (T&Cs) documents at the financial product level, allowing different T&Cs per product within a single tenant.

Updated endpoints

  • GET /onboarding/{onboarding_id}/terms-and-conditions?lang={locale}: The endpoint now first checks if any linked financial product has T&Cs documents configured. It uses a matching and fallback logic (matching language and country, then country only, then language only, then default) to return the appropriate T&C document URL. If no financial product level T&Cs are found, it falls back to the existing tenant-level T&Cs.

Other Changes

  • Added tcs_documents property (array of T&C document objects) to the FinancialProduct configuration JSON schema.
  • Defined new FinancialProductTcsDocument object schema with fields:
    • document_url (string, required)
    • language (string, nullable)
    • country (string, nullable, enum of country codes)
    • is_default (boolean, default false)

No database migration is required as tcs_documents is added as an optional field within an existing JSONB configuration column.