Skip to main content

Auto-response

Overview

This domain has a single table, auto_response, which stores each LINE OA's auto-reply rules by matching keywords typed by a user against the rich_message to send back.

Table auto_response

ColumnTypeNullableDefaultDescription
idSERIAL (INTEGER)NOnextval(...)Primary key of the auto-response rule
nameTEXTNO-Rule name
keywordsJSONBNO-Keywords matched against incoming user messages
rich_message_idINTEGERNO-Message replied with on a keyword match (FK to rich_message.id)
organization_idINTEGERNO-Owning organization
line_oa_idINTEGERNO-LINE OA the rule runs on
status"CommonStatus"NOactiveRule status (active, inactive, ...)
created_dateTIMESTAMPTZ(3)NOnow()Creation timestamp
created_byINTEGERNO0User who created the record
updated_dateTIMESTAMPTZ(3)YES-Last update timestamp (maintained automatically)
updated_byINTEGERYES0User who last updated the record
deleted_dateTIMESTAMPTZ(3)YES-Soft-delete timestamp

Notes

  • auto_response.rich_message_id is an FK to rich_message.id.
  • The table is logically referenced by tracking_log.auto_response_id for read/click statistics on auto-replied messages (tracking_log.content_type = auto_response).
  • Indexes: line_oa_id, deleted_date.
  • line_oa_id and organization_id are not declared as FK constraints on this model but serve as the tenant scope, as in the other tables of this domain.