package mapper

import (
	"go-humas-be/app/database/entity"
	res "go-humas-be/app/module/ppid_data_categories/response"
	"strconv"
)

func PpidDataCategoriesResponseMapper(ppidDataCategoriesReq *entity.PpidDataCategories) (ppidDataCategoriesRes *res.PpidDataCategoriesResponse) {
	if ppidDataCategoriesReq != nil {
		ppidDataCategoriesRes = &res.PpidDataCategoriesResponse{
			ID:           ppidDataCategoriesReq.ID,
			Title:        ppidDataCategoriesReq.Title,
			Description:  ppidDataCategoriesReq.Description,
			Slug:         ppidDataCategoriesReq.Slug,
			ThumbnailUrl: "/ppid-data-categories/viewer/" + strconv.Itoa(int(ppidDataCategoriesReq.ID)),
			IsActive:     ppidDataCategoriesReq.IsActive,
			CreatedAt:    ppidDataCategoriesReq.CreatedAt,
			UpdatedAt:    ppidDataCategoriesReq.UpdatedAt,
		}
	}
	return ppidDataCategoriesRes
}
