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:
Thomas Trompette
2024-02-07 09:40:35 +01:00
committed by GitHub
parent eb54401afe
commit 9f59ddc059
10 changed files with 68 additions and 25 deletions

View File

@ -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();
};

View File

@ -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();
};

View File

@ -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()