import db, { dbNamespace } from '@nangohq/database';
const TABLE = `${dbNamespace}onboarding_demo_progress`;
export async function completeOnboarding(userId) {
    await db.knex
        .from(TABLE)
        .insert({
        user_id: userId,
        progress: 0,
        complete: true
    })
        .onConflict(['user_id'])
        .merge({ complete: true, updated_at: new Date() });
}
export async function getOnboarding(userId) {
    const res = await db.knex.from(TABLE).select('*').where({ user_id: userId }).first();
    return res || null;
}
//# sourceMappingURL=onboarding.service.js.map