Create record position field (#3739)
* Create record field on non syst standard objects + on custom objects * Create workspace migration * Fix naming and add seed --------- Co-authored-by: Thomas Trompette <thomast@twenty.com>
This commit is contained in:
@ -38,6 +38,7 @@ const generateOpportunities = (
|
||||
amountCurrencyCode: 'USD',
|
||||
closeDate: new Date(),
|
||||
stage: getRandomStage(),
|
||||
recordPosition: null,
|
||||
probability: getRandomProbability(),
|
||||
pipelineStepId: getRandomPipelineStepId(pipelineStepIds),
|
||||
pointOfContactId: company.personId,
|
||||
@ -73,6 +74,7 @@ export const seedDemoOpportunity = async (
|
||||
'amountCurrencyCode',
|
||||
'closeDate',
|
||||
'stage',
|
||||
'recordPosition',
|
||||
'probability',
|
||||
'pipelineStepId',
|
||||
'pointOfContactId',
|
||||
|
||||
@ -19,6 +19,7 @@ export const personPrefillData = async (
|
||||
jobTitle: person.jobTitle,
|
||||
city: person.city,
|
||||
avatarUrl: person.avatarUrl,
|
||||
recordPosition: null,
|
||||
companyId: companies[Math.floor(index / 2)].id,
|
||||
}));
|
||||
|
||||
@ -33,6 +34,7 @@ export const personPrefillData = async (
|
||||
'jobTitle',
|
||||
'city',
|
||||
'avatarUrl',
|
||||
'recordPosition',
|
||||
'companyId',
|
||||
])
|
||||
.orIgnore()
|
||||
|
||||
@ -4,6 +4,7 @@ import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.en
|
||||
import { RelationMetadataType } from 'src/metadata/relation-metadata/relation-metadata.entity';
|
||||
import { FieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/field-metadata.decorator';
|
||||
import { IsNullable } from 'src/workspace/workspace-sync-metadata/decorators/is-nullable.decorator';
|
||||
import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-system.decorator';
|
||||
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
|
||||
import { RelationMetadata } from 'src/workspace/workspace-sync-metadata/decorators/relation-metadata.decorator';
|
||||
import { ActivityTargetObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/activity-target.object-metadata';
|
||||
@ -94,6 +95,16 @@ export class CompanyObjectMetadata extends BaseObjectMetadata {
|
||||
})
|
||||
idealCustomerProfile: boolean;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.NUMBER,
|
||||
label: 'RecordPosition',
|
||||
description: 'Record Position',
|
||||
icon: 'IconHierarchy2',
|
||||
})
|
||||
@IsSystem()
|
||||
@IsNullable()
|
||||
recordPosition: number;
|
||||
|
||||
// Relations
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
|
||||
@ -3,6 +3,7 @@ import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.en
|
||||
import { RelationMetadataType } from 'src/metadata/relation-metadata/relation-metadata.entity';
|
||||
import { FieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/field-metadata.decorator';
|
||||
import { IsNullable } from 'src/workspace/workspace-sync-metadata/decorators/is-nullable.decorator';
|
||||
import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-system.decorator';
|
||||
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
|
||||
import { RelationMetadata } from 'src/workspace/workspace-sync-metadata/decorators/relation-metadata.decorator';
|
||||
import { ActivityTargetObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/activity-target.object-metadata';
|
||||
@ -76,6 +77,16 @@ export class OpportunityObjectMetadata extends BaseObjectMetadata {
|
||||
})
|
||||
stage: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.NUMBER,
|
||||
label: 'RecordPosition',
|
||||
description: 'Record Position',
|
||||
icon: 'IconHierarchy2',
|
||||
})
|
||||
@IsSystem()
|
||||
@IsNullable()
|
||||
recordPosition: number;
|
||||
|
||||
// Relations
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
|
||||
@ -92,6 +92,16 @@ export class PersonObjectMetadata extends BaseObjectMetadata {
|
||||
@IsSystem()
|
||||
avatarUrl: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.NUMBER,
|
||||
label: 'RecordPosition',
|
||||
description: 'Record Position',
|
||||
icon: 'IconHierarchy2',
|
||||
})
|
||||
@IsSystem()
|
||||
@IsNullable()
|
||||
recordPosition: number;
|
||||
|
||||
// Relations
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
|
||||
Reference in New Issue
Block a user