2025-03-31 13:24:40 +00:00
|
|
|
|
package usecase
|
2025-04-01 09:44:57 +00:00
|
|
|
|
|
2025-04-04 06:39:01 +00:00
|
|
|
|
import (
|
|
|
|
|
"context"
|
2025-04-06 02:08:46 +00:00
|
|
|
|
|
|
|
|
|
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/entity"
|
2025-04-04 06:39:01 +00:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type KYCUseCase interface {
|
|
|
|
|
// Create 建立 KYC 資料
|
|
|
|
|
Create(ctx context.Context, kyc *entity.KYC) error
|
|
|
|
|
// FindLatestByUID 根據使用者 UID 取得最新 KYC 紀錄
|
|
|
|
|
FindLatestByUID(ctx context.Context, uid string) (*entity.KYC, error)
|
|
|
|
|
// FindByID 根據 KYC ID 查詢
|
|
|
|
|
FindByID(ctx context.Context, id string) (*entity.KYC, error)
|
|
|
|
|
// List 分頁查詢(後台審核列表用)
|
|
|
|
|
List(ctx context.Context, params KYCQueryParams) ([]*entity.KYC, int64, error)
|
|
|
|
|
// UpdateStatus 更新 KYC 狀態與審核原因(審核用)
|
|
|
|
|
UpdateStatus(ctx context.Context, id string, status string, reason string) error
|
|
|
|
|
// UpdateKYCInfo 更新使用者的 KYC(限於尚未審核的)
|
|
|
|
|
UpdateKYCInfo(ctx context.Context, id string, update *KYCUpdateParams) error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type KYCQueryParams struct {
|
|
|
|
|
UID *string
|
|
|
|
|
Country *string
|
|
|
|
|
Status *string // PENDING, APPROVED, REJECTED
|
|
|
|
|
PageSize int64
|
|
|
|
|
PageIndex int64
|
|
|
|
|
SortByDate bool // 是否依申請時間倒序
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type KYCUpdateParams struct {
|
|
|
|
|
Name *string
|
|
|
|
|
Identification *string
|
|
|
|
|
IdentificationType *string
|
|
|
|
|
Address *string
|
|
|
|
|
PostalCode *string
|
|
|
|
|
IDFrontImage *string
|
|
|
|
|
IDBackImage *string
|
|
|
|
|
BankStatementImg *string
|
|
|
|
|
BankCode *string
|
|
|
|
|
BankName *string
|
|
|
|
|
BranchCode *string
|
|
|
|
|
BranchName *string
|
|
|
|
|
BankAccount *string
|
2025-04-01 09:44:57 +00:00
|
|
|
|
}
|