feat(finance): 增加线下结算实际操作人

This commit is contained in:
yml
2026-11-15 17:14:23 +08:00
parent 79b8bc3ac1
commit b1a898ad92
35 changed files with 543 additions and 129 deletions
@@ -238,7 +238,7 @@ func (r *Repository) ListOptions(ctx context.Context, optionType string) ([]Opti
return items, nil
}
// ListAllOptions 返回平台与操作人两组可选项,供录单表单直接使用。
// ListAllOptions 返回平台、操作人与出款实际操作人三组可选项。
func (r *Repository) ListAllOptions(ctx context.Context) (*OptionListDTO, error) {
platforms, err := r.ListOptions(ctx, OptionTypePlatform)
if err != nil {
@@ -248,10 +248,18 @@ func (r *Repository) ListAllOptions(ctx context.Context) (*OptionListDTO, error)
if err != nil {
return nil, err
}
return &OptionListDTO{Platforms: platforms, Operators: operators}, nil
disbursementOperators, err := r.ListOptions(ctx, OptionTypeDisbursementOperator)
if err != nil {
return nil, err
}
return &OptionListDTO{
Platforms: platforms,
Operators: operators,
DisbursementOperators: disbursementOperators,
}, nil
}
// CreateOption 新增一个平台 / 操作人选项,重名返回 ErrOptionExists。
// CreateOption 新增一个可选项,重名返回 ErrOptionExists。
// 操作人选项可通过 groupTag 标记所属组别(collect/sell,空表示未分组)。
func (r *Repository) CreateOption(ctx context.Context, optionType, name, groupTag string) (*OptionDTO, error) {
if !IsValidOptionType(optionType) {
@@ -309,7 +317,9 @@ func (r *Repository) DeleteOption(ctx context.Context, id uint64) error {
// IsValidOptionType 判断选项类型是否合法。
func IsValidOptionType(optionType string) bool {
return optionType == OptionTypePlatform || optionType == OptionTypeOperator
return optionType == OptionTypePlatform ||
optionType == OptionTypeOperator ||
optionType == OptionTypeDisbursementOperator
}
func parseDay(value string, loc *time.Location) (time.Time, error) {