package adminkindboxhandler

import (
	"time"

	adminaddresshandler "git.gocasts.ir/ebhomengo/niki/delivery/http_server/admin/address"
	"git.gocasts.ir/ebhomengo/niki/entity"
	"git.gocasts.ir/ebhomengo/niki/param"
	adminbenefactorparam "git.gocasts.ir/ebhomengo/niki/param/admin/benefactor"
	adminrefertimeparam "git.gocasts.ir/ebhomengo/niki/param/admin/refer_time"
)

type KindBoxAggregatedResponse struct {
	ID                 uint                        `json:"id"`
	KindBoxReqID       uint                        `json:"kind_box_req_id"`
	BenefactorID       uint                        `json:"benefactor_id"`
	KindBoxType        entity.KindBoxType          `json:"kind_box_type"`
	Amount             uint                        `json:"amount"`
	SerialNumber       string                      `json:"serial_number"`
	Status             entity.KindBoxStatus        `json:"status"`
	DeliverReferTimeID uint                        `json:"deliver_refer_time_id"`
	DeliverReferDate   time.Time                   `json:"deliver_refer_date"`
	DeliverAddressID   uint                        `json:"deliver_address_id"`
	SenderAgentID      uint                        `json:"sender_agent_id"`
	DeliveredAt        time.Time                   `json:"delivered_at"`
	ReturnReferTimeID  uint                        `json:"return_refer_time_id"`
	ReturnReferDate    *time.Time                  `json:"return_refer_date"`
	ReturnAddressID    uint                        `json:"return_address_id"`
	ReceiverAgentID    uint                        `json:"receiver_agent_id"`
	ReturnedAt         *time.Time                  `json:"returned_at"`
	Benefactor         adminbenefactorparam.Data   `json:"benefactor"`
	DeliverAddress     adminaddresshandler.Address `json:"deliver_address"`
	DeliverReferTime   adminrefertimeparam.Data    `json:"deliver_refer_time"`
	ReturnAddress      adminaddresshandler.Address `json:"return_address"`
	ReturnReferTime    adminrefertimeparam.Data    `json:"return_refer_time"`
}

type KindBoxAggregatedListResponse struct {
	ID                 uint                      `json:"id"`
	KindBoxReqID       uint                      `json:"kind_box_req_id"`
	BenefactorID       uint                      `json:"benefactor_id"`
	KindBoxType        entity.KindBoxType        `json:"kind_box_type"`
	Amount             uint                      `json:"amount"`
	SerialNumber       string                    `json:"serial_number"`
	Status             entity.KindBoxStatus      `json:"status"`
	DeliverReferTimeID uint                      `json:"deliver_refer_time_id"`
	DeliverReferDate   time.Time                 `json:"deliver_refer_date"`
	DeliverAddressID   uint                      `json:"deliver_address_id"`
	SenderAgentID      uint                      `json:"sender_agent_id"`
	DeliveredAt        time.Time                 `json:"delivered_at"`
	ReturnReferTimeID  uint                      `json:"return_refer_time_id"`
	ReturnReferDate    *time.Time                `json:"return_refer_date"`
	ReturnAddressID    uint                      `json:"return_address_id"`
	ReceiverAgentID    uint                      `json:"receiver_agent_id"`
	ReturnedAt         *time.Time                `json:"returned_at"`
	Benefactor         adminbenefactorparam.Data `json:"benefactor"`
	DeliverReferTime   adminrefertimeparam.Data  `json:"deliver_refer_time"`
	ReturnReferTime    adminrefertimeparam.Data  `json:"return_refer_time"`
}

type KindBoxesAggregatedResponse struct {
	Data        []KindBoxAggregatedListResponse `json:"data"`
	Pagination  param.PaginationResponse        `json:"pagination"`
	FieldErrors map[string]string               `json:"field_errors,omitempty"`
}
