function formatIsoDate(today) {
    return today.toISOString().slice(0, 10);
}
export function retrieveReviewReport(input, deps) {
    const primary = {
        localPath: input.session.localPath,
        isoDate: formatIsoDate(input.today),
        mergeRequestNumber: input.mergeRequestNumber,
        jobType: input.session.jobType,
    };
    const primaryHit = deps.reportGateway.read(primary);
    if (primaryHit) {
        return { status: 'found', content: primaryHit.content, path: primaryHit.path };
    }
    if (input.fallbackLocalPath !== undefined &&
        input.fallbackLocalPath !== input.session.localPath) {
        const fallback = { ...primary, localPath: input.fallbackLocalPath };
        const fallbackHit = deps.reportGateway.read(fallback);
        if (fallbackHit) {
            return { status: 'found', content: fallbackHit.content, path: fallbackHit.path };
        }
    }
    return { status: 'missing', expectedPath: deps.reportGateway.buildPath(primary) };
}
//# sourceMappingURL=retrieveReviewReport.usecase.js.map