add WorkspaceDuplicateCriteria decorator + update duplicate resolver logic (#10128)
## Context All objects have '...duplicates' resolver but only companies and people have duplicate criteria (hard coded constant). Gql schema and resolver should be created only if duplicate criteria exist. ## Solution - Add a new @WorkspaceDuplicateCriteria decorator at object level, defining duplicate criteria for given object. - Add a new duplicate criteria field in ObjectMetadata table - Update schema and resolver building logic - Update front requests for duplicate check (only for object with criteria defined) closes https://github.com/twentyhq/twenty/issues/9828
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import { Gate } from 'src/engine/twenty-orm/interfaces/gate.interface';
|
||||
|
||||
import { WorkspaceEntityDuplicateCriteria } from 'src/engine/api/graphql/workspace-query-builder/types/workspace-entity-duplicate-criteria.type';
|
||||
|
||||
export interface WorkspaceEntityMetadataArgs {
|
||||
/**
|
||||
* Standard id.
|
||||
@ -65,4 +67,9 @@ export interface WorkspaceEntityMetadataArgs {
|
||||
* Image identifier.
|
||||
*/
|
||||
readonly imageIdentifierStandardId: string | null;
|
||||
|
||||
/**
|
||||
* Duplicate criteria.
|
||||
*/
|
||||
readonly duplicateCriteria?: WorkspaceEntityDuplicateCriteria[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user