Rename recordPosition into position (#3864)
* Rename recordPosition into position * Fix according to review --------- Co-authored-by: Thomas Trompette <thomast@twenty.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -15,9 +15,12 @@ export const companyPrefillData = async (
|
||||
'address',
|
||||
'employees',
|
||||
'linkedinLinkUrl',
|
||||
'position',
|
||||
])
|
||||
.orIgnore()
|
||||
.values(companiesDemo)
|
||||
.values(
|
||||
companiesDemo.map((company, index) => ({ ...company, position: index })),
|
||||
)
|
||||
.returning('*')
|
||||
.execute();
|
||||
};
|
||||
|
||||
@ -38,7 +38,7 @@ const generateOpportunities = (
|
||||
amountCurrencyCode: 'USD',
|
||||
closeDate: new Date(),
|
||||
stage: getRandomStage(),
|
||||
recordPosition: null,
|
||||
position: null,
|
||||
probability: getRandomProbability(),
|
||||
pipelineStepId: getRandomPipelineStepId(pipelineStepIds),
|
||||
pointOfContactId: company.personId,
|
||||
@ -74,13 +74,18 @@ export const seedDemoOpportunity = async (
|
||||
'amountCurrencyCode',
|
||||
'closeDate',
|
||||
'stage',
|
||||
'recordPosition',
|
||||
'probability',
|
||||
'pipelineStepId',
|
||||
'pointOfContactId',
|
||||
'companyId',
|
||||
'position',
|
||||
])
|
||||
.orIgnore()
|
||||
.values(opportunities)
|
||||
.values(
|
||||
opportunities.map((opportunity, index) => ({
|
||||
...opportunity,
|
||||
position: index,
|
||||
})),
|
||||
)
|
||||
.execute();
|
||||
};
|
||||
|
||||
@ -19,7 +19,7 @@ export const personPrefillData = async (
|
||||
jobTitle: person.jobTitle,
|
||||
city: person.city,
|
||||
avatarUrl: person.avatarUrl,
|
||||
recordPosition: null,
|
||||
position: index,
|
||||
companyId: companies[Math.floor(index / 2)].id,
|
||||
}));
|
||||
|
||||
@ -34,7 +34,7 @@ export const personPrefillData = async (
|
||||
'jobTitle',
|
||||
'city',
|
||||
'avatarUrl',
|
||||
'recordPosition',
|
||||
'position',
|
||||
'companyId',
|
||||
])
|
||||
.orIgnore()
|
||||
|
||||
@ -97,13 +97,13 @@ export class CompanyObjectMetadata extends BaseObjectMetadata {
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.NUMBER,
|
||||
label: 'RecordPosition',
|
||||
description: 'Record Position',
|
||||
label: 'Position',
|
||||
description: 'Position',
|
||||
icon: 'IconHierarchy2',
|
||||
})
|
||||
@IsSystem()
|
||||
@IsNullable()
|
||||
recordPosition: number;
|
||||
position: number;
|
||||
|
||||
// Relations
|
||||
@FieldMetadata({
|
||||
|
||||
@ -79,13 +79,13 @@ export class OpportunityObjectMetadata extends BaseObjectMetadata {
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.NUMBER,
|
||||
label: 'RecordPosition',
|
||||
description: 'Record Position',
|
||||
label: 'Position',
|
||||
description: 'Position',
|
||||
icon: 'IconHierarchy2',
|
||||
})
|
||||
@IsSystem()
|
||||
@IsNullable()
|
||||
recordPosition: number;
|
||||
position: number;
|
||||
|
||||
// Relations
|
||||
@FieldMetadata({
|
||||
|
||||
@ -94,13 +94,13 @@ export class PersonObjectMetadata extends BaseObjectMetadata {
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.NUMBER,
|
||||
label: 'RecordPosition',
|
||||
label: 'Position',
|
||||
description: 'Record Position',
|
||||
icon: 'IconHierarchy2',
|
||||
})
|
||||
@IsSystem()
|
||||
@IsNullable()
|
||||
recordPosition: number;
|
||||
position: number;
|
||||
|
||||
// Relations
|
||||
@FieldMetadata({
|
||||
|
||||
Reference in New Issue
Block a user