package subscribeplansvc

import (
	subscribeplandomain "legalgo-BE-go/internal/domain/subscribe_plan"
	timeutils "legalgo-BE-go/internal/utilities/time_utils"
)

func (i *impl) Update(id string, spec subscribeplandomain.SubscribePlanUpdate) error {
	newData := subscribeplandomain.SubscribePlan{
		ID:        id,
		Code:      spec.Code,
		Name:      spec.Name,
		Length:    spec.Length,
		Price:     spec.Price,
		Status:    spec.Status,
		UpdatedAt: timeutils.Now(),
	}
	return i.subsRepo.Update(newData)
}
