Add Customer Discovery

This commit is contained in:
aditya.siregar
2024-08-03 20:01:25 +07:00
parent aeed6fde7b
commit 600d42d529
14 changed files with 620 additions and 19 deletions
+25 -17
View File
@@ -5,6 +5,7 @@ import (
"furtuna-be/internal/common/mycontext"
"furtuna-be/internal/services/balance"
"furtuna-be/internal/services/branch"
"furtuna-be/internal/services/discovery"
service "furtuna-be/internal/services/license"
"furtuna-be/internal/services/order"
"furtuna-be/internal/services/oss"
@@ -25,19 +26,20 @@ import (
)
type ServiceManagerImpl struct {
AuthSvc Auth
EventSvc Event
UserSvc User
BranchSvc Branch
StudioSvc Studio
ProductSvc Product
OrderSvc Order
OSSSvc OSSService
PartnerSvc Partner
SiteSvc Site
LicenseSvc License
Transaction Transaction
Balance Balance
AuthSvc Auth
EventSvc Event
UserSvc User
BranchSvc Branch
StudioSvc Studio
ProductSvc Product
OrderSvc Order
OSSSvc OSSService
PartnerSvc Partner
SiteSvc Site
LicenseSvc License
Transaction Transaction
Balance Balance
DiscoverService DiscoverService
}
func NewServiceManagerImpl(cfg *config.Config, repo *repository.RepoManagerImpl) *ServiceManagerImpl {
@@ -52,10 +54,11 @@ func NewServiceManagerImpl(cfg *config.Config, repo *repository.RepoManagerImpl)
OSSSvc: oss.NewOSSService(repo.OSS),
PartnerSvc: partner.NewPartnerService(
repo.Partner, users.NewUserService(repo.User, repo.Branch), repo.Trx, repo.Wallet),
SiteSvc: site.NewSiteService(repo.Site),
LicenseSvc: service.NewLicenseService(repo.License),
Transaction: transaction.New(repo.Transaction, repo.Wallet, repo.Trx),
Balance: balance.NewBalanceService(repo.Wallet, repo.Trx, repo.Crypto, &cfg.Withdraw, repo.Transaction),
SiteSvc: site.NewSiteService(repo.Site),
LicenseSvc: service.NewLicenseService(repo.License),
Transaction: transaction.New(repo.Transaction, repo.Wallet, repo.Trx),
Balance: balance.NewBalanceService(repo.Wallet, repo.Trx, repo.Crypto, &cfg.Withdraw, repo.Transaction),
DiscoverService: discovery.NewDiscoveryService(repo.Site, cfg.Discovery),
}
}
@@ -156,3 +159,8 @@ type Balance interface {
WithdrawInquiry(ctx context.Context, req *entity.BalanceWithdrawInquiry) (*entity.BalanceWithdrawInquiryResponse, error)
WithdrawExecute(ctx mycontext.Context, req *entity.WalletWithdrawRequest) (*entity.WalletWithdrawResponse, error)
}
type DiscoverService interface {
Home(ctx context.Context, search *entity.DiscoverySearch) (*entity.DiscoverySearchResp, error)
Search(ctx context.Context, search *entity.DiscoverySearch) (*entity.DiscoverySearchResp, int64, error)
}