package http

import (
	httpserver "git.gocasts.ir/ebhomengo/niki/delivery/http_server"
	salesreportservice "git.gocasts.ir/ebhomengo/niki/salesreportapp/service"
)

type Server struct {
	HTTPServer     *httpserver.Server
	Handler        *Handler
	SalesReportSvc salesreportservice.Service
}

func NewServer(httpserver *httpserver.Server, SalesReportSvc salesreportservice.Service) *Server {
	return &Server{
		HTTPServer:     httpserver,
		Handler:        NewHandler(),
		SalesReportSvc: SalesReportSvc,
	}
}

func (s *Server) Serve() {
	s.RegisterRoutes()
}

func (s *Server) Stop() {}

func (s *Server) RegisterRoutes() {
	s.HTTPServer.Router.GET("", s.healthCheck)
}
