Re_Backend/src/scripts/run-form16-archive.ts

22 lines
649 B
TypeScript

/**
* Run Form 16 archive once (records older than 5 FY get archived_at set).
* Use this for manual runs; the scheduler runs daily at 02:00.
*
* Usage: npx ts-node -r tsconfig-paths/register src/scripts/run-form16-archive.ts
*/
import dotenv from 'dotenv';
import path from 'path';
dotenv.config({ path: path.resolve(__dirname, '../../.env') });
async function main() {
const { runForm16ArchiveOldRecords } = await import('../services/form16Archive.service');
const results = await runForm16ArchiveOldRecords();
console.log('Form 16 archive run completed:', results);
}
main().catch((e) => {
console.error(e);
process.exit(1);
});