5019b5febc
This PR is dropping the column `targetColumnMap` of fieldMetadata entities. The goal of this column was to properly map field to their respecting column in the table. We decide to drop it and instead compute the column name on the fly when we need it, as it's more easier to support. Some parts of the code has been refactored to try making implementation of composite type more easier to understand and maintain. Fix #3760 --------- Co-authored-by: Charles Bochet <charles@twenty.com>
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
|
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
|
|
|
export const fieldNumberMock = {
|
|
name: 'fieldNumber',
|
|
type: FieldMetadataType.NUMBER,
|
|
isNullable: false,
|
|
defaultValue: null,
|
|
};
|
|
|
|
export const fieldStringMock = {
|
|
name: 'fieldString',
|
|
type: FieldMetadataType.TEXT,
|
|
isNullable: true,
|
|
defaultValue: null,
|
|
};
|
|
|
|
export const fieldLinkMock = {
|
|
name: 'fieldLink',
|
|
type: FieldMetadataType.LINK,
|
|
isNullable: false,
|
|
defaultValue: { label: '', url: '' },
|
|
};
|
|
|
|
export const fieldCurrencyMock = {
|
|
name: 'fieldCurrency',
|
|
type: FieldMetadataType.CURRENCY,
|
|
isNullable: true,
|
|
defaultValue: { amountMicros: null, currencyCode: "''" },
|
|
};
|
|
|
|
export const objectMetadataItemMock = {
|
|
targetTableName: 'testingObject',
|
|
nameSingular: 'objectName',
|
|
namePlural: 'objectsName',
|
|
fields: [fieldNumberMock, fieldStringMock, fieldLinkMock, fieldCurrencyMock],
|
|
} as ObjectMetadataEntity;
|