const TITLE_MAX_CHARS = 60;
export function mapIssueToSpecTitle(issue) {
    const truncated = issue.title.length > TITLE_MAX_CHARS
        ? `${issue.title.slice(0, TITLE_MAX_CHARS)}...`
        : issue.title;
    return `Fix: ${truncated}`;
}
export function mapIssueToDescription(issue, stacktrace) {
    const lines = [
        '## Error Summary',
        '',
        `**Title**: ${issue.title}`,
        `**Culprit**: ${issue.culprit}`,
        `**Level**: ${issue.level}`,
        `**Sentry link**: ${issue.permalink}`,
        `**First seen**: ${issue.firstSeen}`,
        `**Last seen**: ${issue.lastSeen}`,
        '',
        '## Impact',
        '',
        `- **Events**: ${issue.count}`,
        `- **Affected users**: ${issue.userCount}`,
        `- **Resolved**: ${issue.isResolved ? 'Yes' : 'No'}`,
        '',
        '## Stacktrace',
        '',
        '```',
        stacktrace,
        '```',
    ];
    return lines.join('\n');
}
export function mapIssueToAcceptanceCriteria(issue) {
    return [
        `Error "${issue.title.slice(0, 60)}" no ocurre en producción tras el fix`,
        'Tests unitarios cubren el caso edge que causó el error',
        'Error rate en Sentry ≤0 tras deploy',
        `Issue ${issue.id} marcado como resolved en Sentry`,
    ];
}
export function mapIssuePriority(issue, overridePriority) {
    if (overridePriority !== undefined && overridePriority !== '') {
        return overridePriority;
    }
    switch (issue.level) {
        case 'fatal':
            return 'critical';
        case 'error':
            return 'high';
        case 'warning':
            return 'medium';
        case 'info':
        case 'debug':
            return 'low';
    }
}
//# sourceMappingURL=sentry-spec-mapper.js.map