package request

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

type ProvincesGeneric interface {
	ToEntity()
}

type ProvincesQueryRequest struct {
	ProvName  string    `json:"prov_name" validate:"required"`
	LocationId  int    `json:"location_id" validate:"required"`
	Status  int    `json:"status" validate:"required"`
	Timezone  string    `json:"timezone" validate:"required"`
	Pagination  *paginator.Pagination `json:"pagination"`
}


type ProvincesCreateRequest struct {
	ProvName  string    `json:"prov_name" validate:"required"`
	LocationId  int    `json:"location_id" validate:"required"`
	Status  int    `json:"status" validate:"required"`
	Timezone  string    `json:"timezone" validate:"required"`
}

func (req ProvincesCreateRequest) ToEntity() *entity.Provinces {
	return &entity.Provinces{
		ProvName:    req.ProvName,
		LocationId:    req.LocationId,
		Status:    req.Status,
		Timezone:    req.Timezone,
	}
}

type ProvincesUpdateRequest struct {
	ID  uint    `json:"id" validate:"required"`
	ProvName  string    `json:"prov_name" validate:"required"`
	LocationId  int    `json:"location_id" validate:"required"`
	Status  int    `json:"status" validate:"required"`
	Timezone  string    `json:"timezone" validate:"required"`
}

func (req ProvincesUpdateRequest) ToEntity() *entity.Provinces {
	return &entity.Provinces{
		ID:    req.ID,
		ProvName:    req.ProvName,
		LocationId:    req.LocationId,
		Status:    req.Status,
		Timezone:    req.Timezone,
	}
}