domain_service.go 5.1 KB
package factory

import (
	pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain/service"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/domain_service"
)

func CreateUserService(options map[string]interface{}) (service.UserService, error) {
	return domain_service.NewUserService()
}

func CreateCompanyService(options map[string]interface{}) (service.CompanyService, error) {
	return domain_service.NewCompanyService()
}

func CreateDepartmentService(options map[string]interface{}) (service.DepartmentService, error) {
	return domain_service.NewDepartmentService()
}

func CreateOrganizationService(options map[string]interface{}) (service.OrgService, error) {
	return domain_service.NewOrganizationService()
}

func CreateCooperationStatisticsService(options map[string]interface{}) (*domain_service.CooperationStatisticsService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domain_service.NewCooperationStatisticsService(transactionContext)
}

func CreateConfirmDividendsIncentivesEstimateService(options map[string]interface{}) (*domain_service.ConfirmDividendsIncentivesEstimateService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domain_service.NewConfirmDividendsIncentivesEstimateService(transactionContext)
}

func CreateConfirmMoneyIncentivesEstimateService(options map[string]interface{}) (*domain_service.ConfirmMoneyIncentivesEstimateService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domain_service.NewConfirmMoneyIncentivesEstimateService(transactionContext)
}

func CreateCancelDividendsEstimateService(options map[string]interface{}) (*domain_service.CancelDividendsEstimateService, error) {
	var transactionContext *pgTransaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pgTransaction.TransactionContext)
	}
	return domain_service.NewCancelDividendsEstimateService(transactionContext)
}

func CreateAgreeContractApplicationService(options map[string]interface{}) (*domain_service.AgreeContractApplicationService, error) {
	//var transactionContext *pgTransaction.TransactionContext
	//if value, ok := options["transactionContext"]; ok {
	//	transactionContext = value.(*pgTransaction.TransactionContext)
	//}
	//return domain_service.NewAgreeContractApplicationService(transactionContext)
	return domain_service.NewAgreeContractApplicationService(nil)
}

func CreateRejectContractApplicationService(options map[string]interface{}) (*domain_service.RejectContractApplicationService, error) {
	//var transactionContext *pgTransaction.TransactionContext
	//if value, ok := options["transactionContext"]; ok {
	//	transactionContext = value.(*pgTransaction.TransactionContext)
	//}
	//return domain_service.NewRejectContractApplicationService(transactionContext)
	return domain_service.NewRejectContractApplicationService(nil)
}

func CreateInformJoinCreationContractService(options map[string]interface{}) (*domain_service.InformJoinCreationContractService, error) {
	//var transactionContext *pgTransaction.TransactionContext
	//if value, ok := options["transactionContext"]; ok {
	//	transactionContext = value.(*pgTransaction.TransactionContext)
	//}
	//return domain_service.NewInformJoinCreationContractService(transactionContext)
	return domain_service.NewInformJoinCreationContractService(nil)
}

func CreateEstimateDividendsService(options map[string]interface{}) (*domain_service.EstimateDividendsService, error) {
	//var transactionContext *pgTransaction.TransactionContext
	//if value, ok := options["transactionContext"]; ok {
	//	transactionContext = value.(*pgTransaction.TransactionContext)
	//}
	//return domain_service.NewEstimateDividendsService(transactionContext)
	return domain_service.NewEstimateDividendsService(nil)
}

func CreateInformDividendsExpectedService(options map[string]interface{}) (*domain_service.InformDividendsExpectedService, error) {
	//var transactionContext *pgTransaction.TransactionContext
	//if value, ok := options["transactionContext"]; ok {
	//	transactionContext = value.(*pgTransaction.TransactionContext)
	//}
	//return domain_service.NewInformDividendsExpectedService(transactionContext)
	return domain_service.NewInformDividendsExpectedService(nil)
}

func CreatePayCreditAccountService(options map[string]interface{}) (*domain_service.PayCreditAccountService, error) {
	//var transactionContext *pgTransaction.TransactionContext
	//if value, ok := options["transactionContext"]; ok {
	//	transactionContext = value.(*pgTransaction.TransactionContext)
	//}
	//return domain_service.NewPayCreditAccountService(transactionContext)
	return domain_service.NewPayCreditAccountService(nil)
}