73077295a4
ci-cd-vm / ci-cd (push) Successful in 2m25s
Add an AI assist button to the Edit/New Group (大項) and Subcategory (小項) dialogs: the user enters a Chinese name, and the model refines the Chinese, translates it to English, and suggests the matching IRS Form 990 Part IX line. Suggestions surface in a confirm card; Apply fills the Chinese name, English name, and 990 line fields. Backend mirrors the existing expense-classification AI family but over the Form 990 line catalog: IExpenseCategoryAiService + base (catalog load, prompt, id validation) + Claude/Gemini providers + factory that picks the provider from ChurchProfile.AiProvider. New write-gated POST api/expense-categories/ai-suggest endpoint; sub-category requests pass the parent group + its 990 line to bias the choice. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
18 lines
767 B
C#
18 lines
767 B
C#
using ROLAC.API.DTOs.Expense;
|
|
|
|
namespace ROLAC.API.Services.Ai;
|
|
|
|
/// <summary>
|
|
/// AI assistance for defining an expense category (大項/小項): refine the Chinese name, translate it
|
|
/// to English, and suggest the matching IRS Form 990 Part IX line.
|
|
/// </summary>
|
|
public interface IExpenseCategoryAiService
|
|
{
|
|
/// <summary>
|
|
/// Refine the entered name, translate it to concise accounting English, and choose the best Form 990
|
|
/// line from the live catalog (biased by the group/sub context in <paramref name="request"/>).
|
|
/// Never throws on an upstream/AI failure — returns a suggestion with null fields instead.
|
|
/// </summary>
|
|
Task<CategoryAiSuggestion> SuggestAsync(ExpenseCategoryAiRequest request, CancellationToken ct = default);
|
|
}
|