Files
twenty/packages/twenty-server/src/workspace/workspace-sync-metadata/interfaces/reflect-relation-metadata.interface.ts
Jérémy M af6ffbcc68 feat: standard fields on custom (#4332)
* feat: add ability to sync standard fields on custom object

* fix: clean

* fix: wrong compute during object creation

* fix: missing cascade delete

* fix: remove unused injected class

* fix: naming

* fix: rename factory to paramsFactory and clean

* fix: rename ExtendCustomObjectMetadata to BaseCustomObjectMetadata

* fix: partial fix inconsistent label and description

* Fixes

* Fix

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-03-07 17:21:50 +01:00

24 lines
674 B
TypeScript

import { ObjectType } from 'typeorm';
import { GateDecoratorParams } from 'src/workspace/workspace-sync-metadata/interfaces/gate-decorator.interface';
import {
RelationOnDeleteAction,
RelationMetadataType,
} from 'src/metadata/relation-metadata/relation-metadata.entity';
export interface RelationMetadataDecoratorParams<T> {
type: RelationMetadataType;
inverseSideTarget: () => ObjectType<T>;
inverseSideFieldKey?: keyof T;
onDelete?: RelationOnDeleteAction;
}
export interface ReflectRelationMetadata
extends RelationMetadataDecoratorParams<any> {
target: object;
fieldKey: string;
gate?: GateDecoratorParams;
onDelete: RelationOnDeleteAction;
}