package factory

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

func CreateAdminUserkDao(options map[string]interface{}) (*dao.AdminUserDao, error) {
	var transactionContext *transaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*transaction.TransactionContext)
	}
	return dao.NewAdminUserDao(transactionContext)
}

func CreatePartnerInfoDao(options map[string]interface{}) (*dao.PartnerInfoDao, error) {
	var transactionContext *transaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*transaction.TransactionContext)
	}
	return dao.NewPartnerInfoDao(transactionContext)
}

func CreateOrderDao(options map[string]interface{}) (*dao.OrderDao, error) {
	var transactionContext *transaction.TransactionContext
	if value, ok := options["transactionContext"]; ok {
		transactionContext = value.(*transaction.TransactionContext)
	}
	return dao.NewOrderDao(transactionContext)
}