prorm API Reference
    Preparing search index...

    Class ConsentRecord

    Index
    • Initialize the ConsentRecord model and sync the table. Call once at application startup.

      Parameters

      • prorm: any

        The Prorm instance

      • tableName: string = 'consent_records'

        Override the default table name 'consent_records'

      Returns Promise<void>

    • Withdraw consent for a subject + purpose. Sets withdrawnAt on the most recent active consent record.

      Parameters

      Returns Promise<boolean>

      true if a consent record was found and updated, false if none existed.

    • Check whether an active (non-withdrawn) consent exists.

      Parameters

      • subjectId: string
      • purpose: string

      Returns Promise<boolean>

    • Get the full consent history for a subject (all purposes).

      Parameters

      • subjectId: string

      Returns Promise<any[]>

    • Get active consents for a subject grouped by purpose.

      Parameters

      • subjectId: string

      Returns Promise<any[]>

    • List all subjects who have active consent for a specific purpose. Useful for marketing campaign validation.

      Parameters

      • purpose: string

      Returns Promise<string[]>