package service

import (
	"context"
	"github.com/UpmeshLTD/urus-aio/mdm/config"
	"github.com/UpmeshLTD/urus-aio/mdm/domain/address"
	"github.com/UpmeshLTD/urus-aio/mdm/domain/location"
	"github.com/gin-gonic/gin"
)

//go:generate mockery --name=Service --case=snake
type Service interface {
	// GRPC
	iGRPC

	// HTTP
	iHealthCheck
	iLocation
	iAddress
}

type serviceImpl struct {
	locationDomain location.Service
	addressDomain  address.Service
	cfg            config.Config
}

func NewService(cfg config.Config, locationDomain location.Service, addressDomain address.Service) Service {
	return &serviceImpl{
		locationDomain: locationDomain,
		addressDomain:  addressDomain,
		cfg:            cfg,
	}
}

func getCtx(c *gin.Context) context.Context {
	return c.Request.Context()
}
