domain_service.go 2.6 KB
package factory

import (
	pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
	"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain/service"
	domainService "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/domain_service"
)

func CreateReleaseTaskService(options map[string]interface{}) (service.ReleaseTaskService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domainService.NewReleaseTaskService(transactionContext)
}

func CreateOffTaskService(options map[string]interface{}) (service.OffTaskService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domainService.NewOffTaskService(transactionContext)
}

func CreateRobTaskService(options map[string]interface{}) (service.RobTaskService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domainService.NewRobTaskService(transactionContext)
}

func CreateBidTaskService(options map[string]interface{}) (service.BidTaskService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domainService.NewBidTaskService(transactionContext)
}

func CreateChooseSuccessfulBidderService(options map[string]interface{}) (service.ChooseSuccessfulBidderService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domainService.NewChooseSuccessfulBidderService(transactionContext)
}

func CreateApplyCompleteTaskService(options map[string]interface{}) (service.ApplyCompleteTaskService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domainService.NewApplyCompleteTaskService(transactionContext)
}

func CreateAcceptanceTaskService(options map[string]interface{}) (service.AcceptanceTaskService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domainService.NewAcceptanceTaskService(transactionContext)
}