import { initDatabase } from '../models/index.js';
import { logger } from '../utils/logger.js';
import { XiaohongshuWorkNoteStatisticsImportService } from '../services/XiaohongshuWorkNoteStatisticsImportService.js';

async function main() {
  try {
    await initDatabase();
    logger.info('[XHS WorkStats] Manual run start...');
    await XiaohongshuWorkNoteStatisticsImportService.runDailyImport();
    logger.info('[XHS WorkStats] Manual run done.');
    process.exit(0);
  } catch (e) {
    logger.error('[XHS WorkStats] Manual run failed:', e);
    process.exit(1);
  }
}

void main();
