package sresponse

import (
	"net/http"

	"github.com/tech/sendico/pkg/api/http/response"
	"github.com/tech/sendico/pkg/mlogger"
	"github.com/tech/sendico/pkg/model"
)

type dzoneResponse struct {
	authResponse `json:",inline"`
	DZone        model.DZone `json:"dzone"`
}

func DZone(logger mlogger.Logger, dzone *model.DZone, accessToken *TokenData) http.HandlerFunc {
	return response.Ok(
		logger,
		&dzoneResponse{
			DZone:        *dzone,
			authResponse: authResponse{AccessToken: *accessToken},
		},
	)
}
