package mapper

import (
	"campaign-pool-be/app/database/entity"
	res "campaign-pool-be/app/module/campaign_files/response"
)

func CampaignFilesResponseMapper(campaignFilesReq *entity.CampaignFiles) (campaignFilesRes *res.CampaignFilesResponse) {
	if campaignFilesReq != nil {
		campaignFilesRes = &res.CampaignFilesResponse{
			ID:          campaignFilesReq.ID,
			CampaignID:  campaignFilesReq.CampaignID,
			Type:        campaignFilesReq.Type,
			FileURL:     campaignFilesReq.FileURL,
			ExternalURL: campaignFilesReq.ExternalURL,
			IsDraft:     campaignFilesReq.IsDraft,
			IsPublish:   campaignFilesReq.IsPublish,
			CreatedAt:   campaignFilesReq.CreatedAt,
			UpdatedAt:   campaignFilesReq.UpdatedAt,
		}
	}
	return campaignFilesRes
}

