fix: update user plan and rearrange structur project
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
package subscribesvc
|
||||
|
||||
import (
|
||||
subscribedomain "legalgo-BE-go/internal/domain/subscribe"
|
||||
userdomain "legalgo-BE-go/internal/domain/user"
|
||||
timeutils "legalgo-BE-go/internal/utilities/time_utils"
|
||||
)
|
||||
|
||||
func (i *impl) Update(id string, spec userdomain.UserSubsUpdate) error {
|
||||
return nil
|
||||
func (i *impl) Update(spec userdomain.UserSubsUpdate) error {
|
||||
newSpec := subscribedomain.Subscribe{
|
||||
ID: spec.ID,
|
||||
AutoRenew: spec.AutoRenew,
|
||||
StartDate: timeutils.Now(),
|
||||
EndDate: spec.EndDate,
|
||||
Status: spec.Status,
|
||||
SubscribePlanID: spec.SubscribePlanID,
|
||||
UpdatedAt: timeutils.Now(),
|
||||
}
|
||||
return i.subsRepo.Update(newSpec)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user