import { Request, Response } from 'express';
import { asyncHandler } from '../../utils/asyncHandler';
import { UniResponse } from '../../lib/UniResponse';
import { StatusCode } from '../../lib/StatusCode';
import { updateNotificationScanIds } from '../../utils/seeders/updateNotificationScanIds';

export class SeederController {
    /**
     * Run notification scan_id update seeder
     */
    public static updateNotificationScanIds = asyncHandler(
        async (req: Request, res: Response) => {
            console.log('🚀 Starting notification scan_id seeder via API...');

            const result = await updateNotificationScanIds();

            return res
                .status(StatusCode.OK)
                .json(
                    UniResponse.Success(
                        'Notification scan_id update completed',
                        result,
                        StatusCode.OK
                    )
                );
        }
    );
}
