guide changes
This commit is contained in:
@@ -21,8 +21,11 @@ type TenantService interface {
|
||||
UpdateLocation(input models.Tenantlocations) error
|
||||
CreateLocation(data models.Tenantlocations) error
|
||||
DeleteLocation(locationid int, tenantid int) error
|
||||
UpdateTenantProfile(tenantID int, fields map[string]any) error
|
||||
UpdateOwnProfile(userID, tenantID int, fields map[string]any) error
|
||||
GetStaffs(tid int) ([]models.StaffInfo, error)
|
||||
CreateStaff(user models.User) error
|
||||
AssignStaffToBranch(tenantID, userID, locationID int) error
|
||||
UpdateStaff(user models.User) error
|
||||
CreateTenantLocation(data models.Tenantlocations) map[string]interface{}
|
||||
UpdateTenantLocation(data models.Tenantlocations) map[string]interface{}
|
||||
@@ -229,3 +232,27 @@ func sameAddress(data models.Tenants) bool {
|
||||
strings.EqualFold(strings.TrimSpace(outlet.City), strings.TrimSpace(data.City)) &&
|
||||
strings.EqualFold(strings.TrimSpace(outlet.Postcode), strings.TrimSpace(data.Postcode))
|
||||
}
|
||||
|
||||
func (s *tenantService) AssignStaffToBranch(tenantID, userID, locationID int) error {
|
||||
return s.repo.AssignStaffToBranch(tenantID, userID, locationID)
|
||||
}
|
||||
|
||||
// UpdateTenantProfile filters the request down to what a merchant owns, then
|
||||
// writes it. The allowlist lives in tenantProfile.go with the reasoning.
|
||||
func (s *tenantService) UpdateTenantProfile(tenantID int, fields map[string]any) error {
|
||||
clean, err := TenantProfileUpdate(fields)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return s.repo.UpdateTenantProfile(tenantID, clean)
|
||||
}
|
||||
|
||||
// UpdateOwnProfile filters a self-service edit down to identity fields, then
|
||||
// writes it scoped to the person's own business. See ownProfile.go.
|
||||
func (s *tenantService) UpdateOwnProfile(userID, tenantID int, fields map[string]any) error {
|
||||
clean, err := OwnProfileUpdate(fields)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return s.repo.UpdateOwnProfile(userID, tenantID, clean)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user