50 lines
1.5 KiB
Go
50 lines
1.5 KiB
Go
package repository
|
||
|
||
import (
|
||
"context"
|
||
|
||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/entity"
|
||
)
|
||
|
||
// KYC(Know Your Customer)
|
||
|
||
type KYCRepository 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
|
||
}
|