package factory

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

func CreateCooperationModeDao(options map[string]interface{}) (*dao.CooperationModeDao, error) {
	var transactionContext *pg.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pg.TransactionContext)
	}
	return dao.NewCooperationModeDao(transactionContext)
}

func CreateCooperationProjectDao(options map[string]interface{}) (*dao.CooperationProjectDao, error) {
	var transactionContext *pg.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pg.TransactionContext)
	}
	return dao.NewCooperationProjectDao(transactionContext)
}

func CreateCooperationContractDao(options map[string]interface{}) (*dao.CooperationContractDao, error) {
	var transactionContext *pg.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pg.TransactionContext)
	}
	return dao.NewCooperationContractDao(transactionContext)
}

func CreateDividendsOrderDao(options map[string]interface{}) (*dao.DividendsOrderDao, error) {
	var transactionContext *pg.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pg.TransactionContext)
	}
	return dao.NewDividendsOrderDao(transactionContext)
}

func CreateDividendsReturnedOrderDao(options map[string]interface{}) (*dao.DividendsReturnedOrderDao, error) {
	var transactionContext *pg.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pg.TransactionContext)
	}
	return dao.NewDividendsReturnedOrderDao(transactionContext)
}

func CreateCreditAccountDao(options map[string]interface{}) (*dao.CreditAccountDao, error) {
	var transactionContext *pg.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pg.TransactionContext)
	}
	return dao.NewCreditAccountDao(transactionContext)
}

func CreateDividendsEstimateDao(options map[string]interface{}) (*dao.DividendsEstimateDao, error) {
	var transactionContext *pg.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*pg.TransactionContext)
	}
	return dao.NewDividendsEstimateDao(transactionContext)
}