import { DataTypes } from 'sequelize';
import { SYNC_DIRECTIONS } from '@tamanu/constants';
import { Model } from './Model';
/**
 * A multi-turn AI conversation transcript (currently used by the form builder).
 *
 * Central-only and non-syncing. Sessions are ephemeral: {@link expiresAt}
 * bounds their lifetime and FormBuilderChatCleaner purges expired rows.
 */ export class AiChatSession extends Model {
    static initModel({ primaryKey, ...options }) {
        super.init({
            id: primaryKey,
            contextName: {
                type: DataTypes.TEXT,
                allowNull: false
            },
            messages: {
                type: DataTypes.JSONB,
                allowNull: false,
                defaultValue: []
            },
            expiresAt: {
                type: DataTypes.DATE,
                allowNull: false
            }
        }, {
            ...options,
            syncDirection: SYNC_DIRECTIONS.DO_NOT_SYNC
        });
    }
}

//# sourceMappingURL=AiChatSession.js.map