package vclaimsephist

import (
	ecore "simrs-vx/internal/domain/base-entities/core"
)

type CreateDto struct {
	RequestPayload string `json:"requestPayload"`
	ResponseBody   string `json:"responseBody"`
	Message        string `json:"message"`
}

type ReadListDto struct {
	FilterDto
	Includes   string `json:"includes"`
	Sort       string `json:"sort"`
	Pagination ecore.Pagination
}

type FilterDto struct {
	RequestPayload *string `json:"requestPayload"`
	ResponseBody   *string `json:"responseBody"`
	Message        *string `json:"message"`
}

type ReadDetailDto struct {
	Id uint `json:"id"`
}

type UpdateDto struct {
	Id uint `json:"id"`
	CreateDto
}

type DeleteDto struct {
	Id uint `json:"id"`
}

type MetaDto struct {
	PageNumber int `json:"page_number"`
	PageSize   int `json:"page_size"`
	Count      int `json:"count"`
}

type ResponseDto struct {
	ecore.Main
	RequestPayload *string `json:"requestPayload"`
	ResponseBody   *string `json:"responseBody"`
	Message        *string `json:"message"`
}

func (d VclaimSepHist) ToResponse() ResponseDto {
	resp := ResponseDto{
		RequestPayload: d.RequestPayload,
		ResponseBody:   d.ResponseBody,
		Message:        d.Message,
	}
	resp.Main = d.Main
	return resp
}

func ToResponseList(data []VclaimSepHist) []ResponseDto {
	resp := make([]ResponseDto, len(data))
	for i, u := range data {
		resp[i] = u.ToResponse()
	}
	return resp
}
