All checks were successful
Build and Deploy / deploy (push) Successful in 1m22s
补齐价格 sync-status 在途审批字段与站内信通知;充值提交走审批门面,终审入账/驳回同步记录。 Co-authored-by: Cursor <cursoragent@cursor.com>
72 lines
2.3 KiB
C#
72 lines
2.3 KiB
C#
using Oms.Domain.ApprovalAggregate.Consts;
|
|
|
|
namespace Oms.Application.Services.Approval;
|
|
|
|
/// <summary>
|
|
/// 可配置审批的操作目录(代码注册,非库表)。
|
|
/// </summary>
|
|
public static class ApprovalOperationCatalog
|
|
{
|
|
/// <summary>
|
|
/// 目录项。
|
|
/// </summary>
|
|
public sealed record Item(
|
|
string Code,
|
|
string Name,
|
|
string Module,
|
|
bool SupportsCondition,
|
|
string ConditionHint);
|
|
|
|
private static readonly IReadOnlyList<Item> Items =
|
|
[
|
|
new(
|
|
ApprovalCodes.SimOperationCode,
|
|
"审批引擎模拟提交",
|
|
"System",
|
|
SupportsCondition: false,
|
|
ConditionHint: "一期自测用,不支持条件公式"),
|
|
new(
|
|
ApprovalCodes.FinanceRechargeCredit,
|
|
"充值入账",
|
|
"Finance",
|
|
SupportsCondition: false,
|
|
ConditionHint: "已接入提交接口;未配置或未启用不拦截(直接入账),启用后提交审批"),
|
|
new(
|
|
"Marketing.Commission.Withdraw",
|
|
"佣金提现",
|
|
"Marketing",
|
|
SupportsCondition: false,
|
|
ConditionHint: "业务接入后可按金额等配置条件"),
|
|
new(
|
|
ApprovalCodes.SalesProductPublishPrice,
|
|
"销售产品价格发布",
|
|
"Channel",
|
|
SupportsCondition: false,
|
|
ConditionHint: "已接入发布接口;未配置或未启用不拦截,启用后提交审批"),
|
|
new(
|
|
"Order.Refund.Apply",
|
|
"订单退款",
|
|
"Order",
|
|
SupportsCondition: false,
|
|
ConditionHint: "业务接入后可按退款金额等配置条件")
|
|
];
|
|
|
|
/// <summary>全部目录项。</summary>
|
|
public static IReadOnlyList<Item> All => Items;
|
|
|
|
/// <summary>按编码查找。</summary>
|
|
public static Item? Find(string? operationCode)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(operationCode))
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return Items.FirstOrDefault(x =>
|
|
string.Equals(x.Code, operationCode.Trim(), StringComparison.OrdinalIgnoreCase));
|
|
}
|
|
|
|
/// <summary>是否已知操作。</summary>
|
|
public static bool IsKnown(string? operationCode) => Find(operationCode) != null;
|
|
}
|