package molders

// |@@| C

import (
	"gardening/src/dat/forms"
	"gardening/src/mdl"
)

type UpdateUserFormMolder struct {
}

func (this *UpdateUserFormMolder) ToEntity(form *forms.UpdateUserForm, entity *mdl.User) (*mdl.User, []string) {
	var changes []string
	if entity.Name != form.Name {
		entity.Name = form.Name
		changes = append(changes, "Name")
	}
	return entity, changes
}
func (this *UpdateUserFormMolder) ToForm(form *forms.UpdateUserForm, entity *mdl.User) *forms.UpdateUserForm {
	form.Id = entity.Id
	form.Name = entity.Name
	return form
}
