func New(s service.IInventoryService, mdw map[string][]endpoint.Middleware) Endpoints {
	eps := Endpoints{
		CreateMerchantEndpoint: makeCreateMerchantEndpoint(s),
		ListMerchantEndpoint:   makeListMerchantEndpoint(s),
		CreateProductEndpoint:  makeCreateProductEndpoint(s),
		ListProductEndpoint:    makeListProductEndpoint(s),
	}

	// apply transport middlewares
	for _, m := range mdw["CreateMerchant"] {
		eps.CreateMerchantEndpoint = m(eps.CreateMerchantEndpoint)
	}

	for _, m := range mdw["ListMerchant"] {
		eps.ListMerchantEndpoint = m(eps.ListMerchantEndpoint)
	}

	for _, m := range mdw["CreateProduct"] {
		eps.CreateProductEndpoint = m(eps.CreateProductEndpoint)
	}

	for _, m := range mdw["ListProduct"] {
		eps.ListProductEndpoint = m(eps.ListProductEndpoint)
	}

	return eps
}
// New returns a Endpoints struct that wraps the provided service, and wires in all of the
// expected endpoint middlewares
New returns a Endpoints struct that wraps the provided service, and wires in all of the
expected endpoint middlewares
// New returns a Endpoints struct that wraps the provided service and wires in all of the // expected endpoint middlewares
func New(s service.IInventoryService, mdw map[string][]endpoint.Middleware) Endpoints {
	eps := Endpoints{
		CreateMerchantEndpoint: makeCreateMerchantEndpoint(s),
		ListMerchantEndpoint:   makeListMerchantEndpoint(s),
		CreateProductEndpoint:  makeCreateProductEndpoint(s),
		ListProductEndpoint:    makeListProductEndpoint(s),
	}
	for _, m := range mdw["CreateMerchant"] {
		eps.CreateMerchantEndpoint = m(eps.CreateMerchantEndpoint)
	}
	for _, m := range mdw["ListMerchant"] {
		eps.ListMerchantEndpoint = m(eps.ListMerchantEndpoint)
	}
	for _, m := range mdw["CreateProduct"] {
		eps.CreateProductEndpoint = m(eps.CreateProductEndpoint)
	}
	for _, m := range mdw["ListProduct"] {
		eps.ListProductEndpoint = m(eps.ListProductEndpoint)
	}
	return eps
}
func New ( s service . IInventoryService , mdw map [ string ] [ ] endpoint . Middleware ) Endpoints { eps := Endpoints { CreateMerchantEndpoint : makeCreateMerchantEndpoint ( s ) , ListMerchantEndpoint : makeListMerchantEndpoint ( s ) , CreateProductEndpoint : makeCreateProductEndpoint ( s ) , ListProductEndpoint : makeListProductEndpoint ( s ) , } for _ , m := range mdw [ " " ] { eps . CreateMerchantEndpoint = m ( eps . CreateMerchantEndpoint ) } for _ , m := range mdw [ " " ] { eps . ListMerchantEndpoint = m ( eps . ListMerchantEndpoint ) } for _ , m := range mdw [ " " ] { eps . CreateProductEndpoint = m ( eps . CreateProductEndpoint ) } for _ , m := range mdw [ " " ] { eps . ListProductEndpoint = m ( eps . ListProductEndpoint ) } return eps }
New returns a Endpoints struct that wraps the provided service, and wires in all of the
expected endpoint middlewares
New returns a Endpoints struct that wraps the provided service and wires in all of the expected endpoint middlewares
// apply transport middlewares