package request

import (
	"web-qudo-be/app/database/entity"
)

type OurServiceContentImageCreateRequest struct {
	OurServiceContentID uint   `json:"our_service_content_id" validate:"required"`
	ImagePath           string `json:"image_path"`
	ImageURL            string `json:"image_url"`
	IsThumbnail         *bool  `json:"is_thumbnail"`
}

func (r *OurServiceContentImageCreateRequest) ToEntity() *entity.OurServiceContentImage {
	return &entity.OurServiceContentImage{
		OurServiceContentID: r.OurServiceContentID,
		ImagePath:           r.ImagePath,
		ImageURL:            r.ImageURL,
		IsThumbnail:         r.IsThumbnail,
	}
}

type OurServiceContentImageUpdateRequest struct {
	ImagePath   string `json:"image_path"`
	ImageURL    string `json:"image_url"`
	IsThumbnail *bool  `json:"is_thumbnail"`
}

func (r *OurServiceContentImageUpdateRequest) ToEntity() *entity.OurServiceContentImage {
	return &entity.OurServiceContentImage{
		ImagePath:   r.ImagePath,
		ImageURL:    r.ImageURL,
		IsThumbnail: r.IsThumbnail,
	}
}