package request

import (
	"go-humas-be/app/database/entity"
	"go-humas-be/utils/paginator"
)

type CitiesGeneric interface {
	ToEntity()
}

type CitiesQueryRequest struct {
	CityName  string    `json:"city_name" validate:"required"`
	ProvId  int    `json:"prov_id" validate:"required"`
	Pagination  *paginator.Pagination `json:"pagination"`
}


type CitiesCreateRequest struct {
	CityName  string    `json:"city_name" validate:"required"`
	ProvId  int    `json:"prov_id" validate:"required"`
}

func (req CitiesCreateRequest) ToEntity() *entity.Cities {
	return &entity.Cities{
		CityName:    req.CityName,
		ProvId:    req.ProvId,
	}
}

type CitiesUpdateRequest struct {
	ID  uint    `json:"id" validate:"required"`
	CityName  string    `json:"city_name" validate:"required"`
	ProvId  int    `json:"prov_id" validate:"required"`
}

func (req CitiesUpdateRequest) ToEntity() *entity.Cities {
	return &entity.Cities{
		ID:    req.ID,
		CityName:    req.CityName,
		ProvId:    req.ProvId,
	}
}