| 212 | ) |
| 213 | |
| 214 | def synchronise_features(self, valid_feature_names: typing.Collection[str]) -> None: |
| 215 | identity_feature_names = { |
| 216 | fs.feature.name for fs in self.engine_identity_model.identity_features |
| 217 | } |
| 218 | if not identity_feature_names.issubset(valid_feature_names): |
| 219 | self.engine_identity_model.prune_features(list(valid_feature_names)) |
| 220 | sync_identity_document_features.delay(args=(str(self.identity_uuid),)) |
| 221 | |
| 222 | def to_document(self) -> dict: # type: ignore[type-arg] |
| 223 | return map_engine_identity_to_identity_document(self.engine_identity_model) |