domain_service.go 1.2 KB
package factory

import (
	"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain/service"
	"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/domainService"
	"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/transaction"
)

// func CreateBusinessBonusService(options map[string]interface{}) (service.BusinessBonusService, error) {
// 	var transactionContext *transaction.TransactionContext
// 	if value, ok := options["transactionContext"]; ok {
// 		transactionContext = value.(*transaction.TransactionContext)
// 	}
// 	return domainService.NewBusinessBonusService(transactionContext), nil
// }
// 	var transactionContext *transaction.TransactionContext
// 	if value, ok := options["transactionContext"]; ok {
// 		transactionContext = value.(*transaction.TransactionContext)
// 	}
// 	return domainService.NewBusinessBonusService(transactionContext), nil
// }

func CreateOrderBonusService(options map[string]interface{}) (service.OrderBonusService, error) {
	var transactionContext *transaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*transaction.TransactionContext)
	}
	return domainService.NewOrderBonusService(transactionContext), nil
}