export class FollowupImportantsUseCase {
    deps;
    constructor(deps) {
        this.deps = deps;
    }
    async execute(input, _deps) {
        const baseUrl = `http://localhost:${this.deps.serverPort}`;
        const response = await this.deps.fetch(`${baseUrl}/api/mr-tracking/followup-importants`, {
            method: 'POST',
            headers: { 'Content-Type': 'application/json' },
            body: JSON.stringify({ projectPath: input.project }),
        });
        const data = (await response.json());
        if (!data.candidates || data.candidates.length === 0) {
            this.deps.log('No pending-approval MRs with Important issues found.');
            return;
        }
        this.deps.log(`Triggered ${data.triggered} followup(s):`);
        for (const candidate of data.candidates) {
            this.deps.log(`  - !${candidate.mrNumber}: ${candidate.title}`);
        }
        if (data.failed && data.failed.length > 0) {
            this.deps.error(`${data.failed.length} failed.`);
        }
    }
}
//# sourceMappingURL=followupImportants.usecase.js.map