package request

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

type MasterStatusesGeneric interface {
	ToEntity()
}

type MasterStatusesQueryRequest struct {
	Name  string    `json:"name" validate:"required"`
	IsActive  bool    `json:"is_active" validate:"required"`
	Pagination  *paginator.Pagination `json:"pagination"`
}


type MasterStatusesCreateRequest struct {
	Name  string    `json:"name" validate:"required"`
	IsActive  bool    `json:"is_active" validate:"required"`
}

func (req MasterStatusesCreateRequest) ToEntity() *entity.MasterStatuses {
	return &entity.MasterStatuses{
		Name:    req.Name,
		IsActive:    req.IsActive,
	}
}

type MasterStatusesUpdateRequest struct {
	ID  uint    `json:"id" validate:"required"`
	Name  string    `json:"name" validate:"required"`
	IsActive  bool    `json:"is_active" validate:"required"`
}

func (req MasterStatusesUpdateRequest) ToEntity() *entity.MasterStatuses {
	return &entity.MasterStatuses{
		ID:    req.ID,
		Name:    req.Name,
		IsActive:    req.IsActive,
	}
}