| 128 | } |
| 129 | |
| 130 | pub async fn edit(&self, input: EditUserGroupOperationInput) -> ServiceResult<UserGroup> { |
| 131 | let mut user_group = self.get(&input.user_group_id)?; |
| 132 | |
| 133 | user_group.name = input.name.to_string(); |
| 134 | user_group.last_modification_timestamp = next_time(); |
| 135 | |
| 136 | user_group.validate()?; |
| 137 | |
| 138 | self.user_group_repository |
| 139 | .insert(user_group.id, user_group.clone()); |
| 140 | |
| 141 | Ok(user_group) |
| 142 | } |
| 143 | |
| 144 | pub async fn remove(&self, id: &UUID) -> ServiceResult<()> { |
| 145 | let user_group = self.get(id)?; |