Untitled

 avatar
unknown
plain_text
18 days ago
2.1 kB
2
Indexable
package ordermanagementv1

import (
	//nolint:depguard // can't use go-microservices-kit until it supports for IssueImpersonatedPartnerPAT
	"github.com/kouzoh/authority-sdk/pat"
	"github.com/kouzoh/magician/workflow"
)

type Application struct {
	productInventoryClient       productInventoryClient
	proxyClient                  proxyClient
	orderClient                  orderClient
	userClient                   userClient
	paymentSolutionClient        paymentSolutionClient
	repository                   repository
	workflowManager              *workflow.Manager
	categoryValidator            categoryValidator
	offerClient                  offerClient
	couponClient                 couponClient
	tokenIssuer                  pat.TokenIssuer
	xbBuyeeCheckoutSessionConfig CheckoutSessionConfig
	translationClient            translationClient
}

func NewApplication(
	productInventoryClient productInventoryClient,
	proxyClient proxyClient,
	orderClient orderClient,
	userClient userClient,
	paymentSolutionClient paymentSolutionClient,
	repository repository,
	workflowManager *workflow.Manager,
	categoryValidator categoryValidator,
	offerClient offerClient,
	couponClient couponClient,
	tokenIssuer pat.TokenIssuer,
	xbBuyeeCheckoutSessionConfig CheckoutSessionConfig,
	translationClient translationClient,
) (*Application, error) {
	a := &Application{
		productInventoryClient:       productInventoryClient,
		proxyClient:                  proxyClient,
		orderClient:                  orderClient,
		userClient:                   userClient,
		paymentSolutionClient:        paymentSolutionClient,
		repository:                   repository,
		workflowManager:              workflowManager,
		categoryValidator:            categoryValidator,
		offerClient:                  offerClient,
		couponClient:                 couponClient,
		tokenIssuer:                  tokenIssuer,
		xbBuyeeCheckoutSessionConfig: xbBuyeeCheckoutSessionConfig,
		translationClient:            translationClient,
	}
	if err := a.registerWorkflowAndActivities(); err != nil {
		return nil, err
	}
	return a, nil
}
Editor is loading...
Leave a Comment