Refactor builder to embed Object validation create/delete/update (#13934)
# Introduction Moving validation directly in the builder that has the perfect granularity to do it. When importing we won't have to infer and dispatch on the operation nature ( update delete create ) and validate accordingly ## Objects Only migrated object validation for the moment even though create object involves a validate flat field metadata creation call too ## TODO - improve `otherFlatObjectMetadataMapsToValidate` naming too vague ## Next - handle fields validation within fields actions build - Unit test coverage validation issue on builder and validate - integration test plugging with new feature flag ## Manual tested - Update - Delete - Create TODO
This commit is contained in:
+13
@@ -266,6 +266,19 @@ export class FlatFieldMetadataValidatorService {
|
||||
),
|
||||
);
|
||||
} else {
|
||||
if (
|
||||
isDefined(
|
||||
parentFlatObjectMetadata.fieldsById[flatFieldMetadataToValidate.id],
|
||||
)
|
||||
) {
|
||||
errors.push(
|
||||
new ObjectMetadataException(
|
||||
'Field with same id already exists in object',
|
||||
ObjectMetadataExceptionCode.OBJECT_MUTATION_NOT_ALLOWED,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (parentFlatObjectMetadata.isRemote === true) {
|
||||
errors.push(
|
||||
new ObjectMetadataException(
|
||||
|
||||
Reference in New Issue
Block a user