namespace MiaoJiZhang.Domain.Enums; public enum AiQuotaPeriod { Day = 0, Week = 1, Month = 2, } /// App 模式(决策:双模式) public enum AppMode { /// 普通记账模式 Normal = 0, /// 全 AI 模式 AiFirst = 1, } /// 账单类型 public enum TransactionType { Expense = 0, Income = 1, Transfer = 2, } public enum TransferDirection { In = 0, Out = 1, } public static class TransactionTypeRules { public static bool IsExpense(this TransactionType type, TransferDirection? direction = null) => type == TransactionType.Expense || type == TransactionType.Transfer && direction == TransferDirection.Out; public static bool IsIncome(this TransactionType type, TransferDirection? direction = null) => type == TransactionType.Income || type == TransactionType.Transfer && direction == TransferDirection.In; public static TransactionType CategoryType( this TransactionType type, TransferDirection? direction = null) => type == TransactionType.Transfer ? direction == TransferDirection.In ? TransactionType.Income : TransactionType.Expense : type; public static string ToWire(this TransactionType type) => type switch { TransactionType.Income => "income", TransactionType.Transfer => "transfer", _ => "expense", }; public static string? ToWire(this TransferDirection? direction) => direction switch { TransferDirection.In => "in", TransferDirection.Out => "out", _ => null, }; } /// 账单来源(决策:AI 记账可追溯) public enum TransactionSource { Manual = 0, AiChat = 1, Voice = 2, ReceiptOcr = 3, Screenshot = 4, Accessibility = 5, Notification = 6, RecognitionAi = 7, LocalOcr = 8, } public static class TransactionSourceRules { public static readonly TransactionSource[] AiAssisted = [ TransactionSource.AiChat, TransactionSource.Voice, TransactionSource.ReceiptOcr, TransactionSource.Screenshot, TransactionSource.RecognitionAi, ]; public static bool IsAiAssisted(this TransactionSource source) => source is TransactionSource.AiChat or TransactionSource.Voice or TransactionSource.ReceiptOcr or TransactionSource.Screenshot or TransactionSource.RecognitionAi; } /// 聊天消息角色 public enum ChatRole { User = 0, Assistant = 1, System = 2, } /// 聊天消息类型 public enum ChatMessageType { Text = 0, Sticker = 1, BillCard = 2, ReportCard = 3, ContextBoundary = 4, }