package adssvc

import (
	adsdomain "legalgo-BE-go/internal/domain/ads"
	timeutils "legalgo-BE-go/internal/utilities/time_utils"
)

func (i *impl) Update(adsID string, spec adsdomain.AdsReq) error {
	newsSpec := adsdomain.Ads{
		ID:        adsID,
		ImageUrl:  spec.Image,
		Url:       spec.URL,
		UpdatedAt: timeutils.Now(),
		StartDate: spec.StartDate,
		EndDate:   spec.EndDate,
	}

	return i.adsRepo.Update(newsSpec)
}
