package mapper

import (
	"web-qudo-be/app/database/entity"
	schedulesResponse "web-qudo-be/app/module/schedules/response"
)

func ToSchedulesResponse(schedule *entity.Schedules) *schedulesResponse.SchedulesResponse {
	return &schedulesResponse.SchedulesResponse{
		ID:               schedule.ID,
		Title:            schedule.Title,
		Description:      schedule.Description,
		Location:         schedule.Location,
		IsLiveStreaming:  schedule.IsLiveStreaming,
		LiveStreamingUrl: schedule.LiveStreamingUrl,
		TypeId:           schedule.TypeId,
		StartDate:        schedule.StartDate,
		EndDate:          schedule.EndDate,
		StartTime:        schedule.StartTime,
		EndTime:          schedule.EndTime,
		Speakers:         schedule.Speakers,
		PosterImagePath:  schedule.PosterImagePath,
		CreatedById:      schedule.CreatedById,
		StatusId:         schedule.StatusId,
		IsActive:         schedule.IsActive,
		CreatedAt:        schedule.CreatedAt,
		UpdatedAt:        schedule.UpdatedAt,
	}
}

func ToSchedulesResponseList(schedules []*entity.Schedules) []*schedulesResponse.SchedulesResponse {
	var responses []*schedulesResponse.SchedulesResponse
	for _, schedule := range schedules {
		responses = append(responses, ToSchedulesResponse(schedule))
	}
	return responses
}
