114 lines
2.8 KiB
C#
114 lines
2.8 KiB
C#
namespace MiaoJiZhang.Domain.Enums;
|
|
|
|
public enum AiQuotaPeriod
|
|
{
|
|
Day = 0,
|
|
Week = 1,
|
|
Month = 2,
|
|
}
|
|
|
|
/// <summary>App 模式(决策:双模式)</summary>
|
|
public enum AppMode
|
|
{
|
|
/// <summary>普通记账模式</summary>
|
|
Normal = 0,
|
|
/// <summary>全 AI 模式</summary>
|
|
AiFirst = 1,
|
|
}
|
|
|
|
/// <summary>账单类型</summary>
|
|
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,
|
|
};
|
|
}
|
|
|
|
/// <summary>账单来源(决策:AI 记账可追溯)</summary>
|
|
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;
|
|
}
|
|
|
|
/// <summary>聊天消息角色</summary>
|
|
public enum ChatRole
|
|
{
|
|
User = 0,
|
|
Assistant = 1,
|
|
System = 2,
|
|
}
|
|
|
|
/// <summary>聊天消息类型</summary>
|
|
public enum ChatMessageType
|
|
{
|
|
Text = 0,
|
|
Sticker = 1,
|
|
BillCard = 2,
|
|
ReportCard = 3,
|
|
ContextBoundary = 4,
|
|
}
|