<?xml version="1.0" encoding="UTF-8"?><database name="assistantrhythm" schema="public" type="PostgreSQL - 18.4 (Ubuntu 18.4-1.pgdg24.04+1)">
   <sequences>
      <sequence increment="1" name="replies_id_seq" startValue="1"/>
      <sequence increment="1" name="webhook_events_id_seq" startValue="1"/>
   </sequences>
   <tables>
      <table name="handled_messages" remarks="{&quot;what&quot;:&quot;Records of messages that have been handled, including their conversation and receipt time.&quot;,&quot;why&quot;:&quot;Without it, there is no record of which messages were processed, risking duplicate handling and loss of audit trail.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:32.508592089+00:00&quot;}" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="message_id" nullable="false" remarks="{&quot;what&quot;:&quot;Unique identifier of the handled message; primary key.&quot;,&quot;why&quot;:&quot;Without it, messages cannot be uniquely referenced, making deduplication and updates impossible.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:32.534617343+00:00&quot;}" size="2147483647" type="text" typeCode="12">
            <child column="chatwoot_message_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="public" table="replies"/>
            <child column="visitor_message_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="public" table="replies"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="conversation_id" nullable="false" remarks="{&quot;what&quot;:&quot;Identifier of the conversation that the message belongs to.&quot;,&quot;why&quot;:&quot;Without it, messages cannot be grouped per conversation, breaking per-conversation workflows.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:32.552524319+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="2" name="received_at" nullable="false" remarks="{&quot;what&quot;:&quot;Timestamp with time zone when the message was received; defaults to now.&quot;,&quot;why&quot;:&quot;Without it, there is no timing information for ordering, latency analysis, or retention policies.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:32.564850925+00:00&quot;}" size="35" type="timestamptz" typeCode="93"/>
         <primaryKey column="message_id" sequenceNumberInPK="1"/>
         <index name="handled_messages_pkey" unique="true">
            <column ascending="true" name="message_id"/>
         </index>
      </table>
      <table name="poller_state" remarks="{&quot;what&quot;:&quot;Persistent checkpoint for a poller's position in a data source.&quot;,&quot;why&quot;:&quot;Without it, a poller cannot resume after restart and would reprocess or miss events.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:31.805101270+00:00&quot;}" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="{&quot;what&quot;:&quot;Unique integer key for this poller state row.&quot;,&quot;why&quot;:&quot;Enables separate checkpoints for multiple pollers or shards.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:31.829645580+00:00&quot;}" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="cursor" nullable="false" remarks="{&quot;what&quot;:&quot;Numeric offset or sequence number of the last processed record.&quot;,&quot;why&quot;:&quot;Without it, the poller cannot know where to resume and may skip or duplicate data.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:31.845045360+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="2" name="updated_at" nullable="false" remarks="{&quot;what&quot;:&quot;Timestamp when this state row was last modified.&quot;,&quot;why&quot;:&quot;Allows detecting stale checkpoints or monitoring poller liveness.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:31.859461359+00:00&quot;}" size="35" type="timestamptz" typeCode="93"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="poller_state_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
      </table>
      <table name="replies" remarks="{&quot;what&quot;:&quot;One row per AI-generated reply to a visitor message.&quot;,&quot;why&quot;:&quot;Without it, no history of AI replies exists, so failures and content cannot be reviewed.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:41.549894683+00:00&quot;}" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('replies_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="{&quot;what&quot;:&quot;Unique numeric identifier for each reply row.&quot;,&quot;why&quot;:&quot;Without it, rows cannot be uniquely referenced for updates or joins.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:41.599142220+00:00&quot;}" size="19" type="bigserial" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="visitor_message_id" nullable="false" remarks="{&quot;what&quot;:&quot;Identifier of the visitor message that triggered this reply.&quot;,&quot;why&quot;:&quot;Without it, cannot link a reply to its source message, so matching fails.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:41.629755414+00:00&quot;}" size="2147483647" type="text" typeCode="12">
            <parent column="message_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="public" table="handled_messages"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="conversation_id" nullable="false" remarks="{&quot;what&quot;:&quot;Identifier of the conversation containing the visitor message.&quot;,&quot;why&quot;:&quot;Without it, replies cannot be grouped per conversation for context.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:41.640718556+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="room_slug" nullable="true" remarks="{&quot;what&quot;:&quot;Slug of the room where the conversation occurred.&quot;,&quot;why&quot;:&quot;Without it, room-specific routing or filtering is impossible.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:41.687039236+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="chatwoot_message_id" nullable="true" remarks="{&quot;what&quot;:&quot;Identifier of the message in Chatwoot after sending.&quot;,&quot;why&quot;:&quot;Without it, cannot correlate with Chatwoot's message records for sync.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:41.716204443+00:00&quot;}" size="2147483647" type="text" typeCode="12">
            <parent column="message_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="public" table="handled_messages"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="content" nullable="true" remarks="{&quot;what&quot;:&quot;Text content of the generated reply.&quot;,&quot;why&quot;:&quot;Without it, the reply text is unknown, so cannot review or resend.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:41.811468372+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="model" nullable="true" remarks="{&quot;what&quot;:&quot;Name of the AI model that generated the reply.&quot;,&quot;why&quot;:&quot;Without it, cannot attribute replies to model versions for performance tracking.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:41.944739789+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="outcome" nullable="false" remarks="{&quot;what&quot;:&quot;Result of sending the reply, e.g., 'sent' or 'failed'.&quot;,&quot;why&quot;:&quot;Without it, cannot know if the reply reached the visitor, so error handling is blind.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:42.013832366+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="detail" nullable="true" remarks="{&quot;what&quot;:&quot;Additional error or context details for the outcome.&quot;,&quot;why&quot;:&quot;Without it, failure reasons are unknown, making debugging difficult.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:42.072093142+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="9" name="created_at" nullable="false" remarks="{&quot;what&quot;:&quot;Timestamp when the reply was created.&quot;,&quot;why&quot;:&quot;Without it, cannot order replies or enforce time-based policies.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-22T23:54:42.844779775+00:00&quot;}" size="35" type="timestamptz" typeCode="93"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="replies_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_replies_conversation" unique="false">
            <column ascending="true" name="conversation_id"/>
            <column ascending="false" name="created_at"/>
         </index>
      </table>
      <table name="webhook_events" remarks="{&quot;what&quot;:&quot;Log of webhook calls with event type, payload, and arrival time.&quot;,&quot;why&quot;:&quot;Without it, there is no audit trail for external events, making debugging and replay impossible.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T00:00:03.009964223+00:00&quot;}" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('webhook_events_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="{&quot;what&quot;:&quot;Unique numeric identifier for each webhook event.&quot;,&quot;why&quot;:&quot;Without it, events cannot be uniquely identified, breaking deduplication and retry logic.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T00:00:03.037730101+00:00&quot;}" size="19" type="bigserial" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="event" nullable="true" remarks="{&quot;what&quot;:&quot;Event type string sent by the webhook provider.&quot;,&quot;why&quot;:&quot;Without it, the purpose of the payload is ambiguous, preventing correct routing to handlers.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T00:00:03.058470171+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="payload" nullable="true" remarks="{&quot;what&quot;:&quot;Full JSON body of the webhook request, preserving all fields.&quot;,&quot;why&quot;:&quot;Without it, the event details are lost, making it impossible to process or replay the event.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T00:00:03.077623526+00:00&quot;}" size="2147483647" type="jsonb" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="3" name="received_at" nullable="false" remarks="{&quot;what&quot;:&quot;Arrival time of the webhook request, with time zone.&quot;,&quot;why&quot;:&quot;Without it, the order and timing of events is unknown, breaking time-based analysis and rate limiting.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T00:00:03.101772650+00:00&quot;}" size="35" type="timestamptz" typeCode="93"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="webhook_events_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
      </table>
   </tables>
</database>
