Update seeds to take currency and link type into account

This commit is contained in:
Charles Bochet 2023-11-17 12:01:56 +01:00
parent 454f893eea
commit e19e7a816f
8 changed files with 51 additions and 23 deletions

View File

@ -230,11 +230,12 @@ export const seedCompanyFieldMetadata = async (
isCustom: false,
workspaceId: SeedWorkspaceId,
isActive: true,
type: FieldMetadataType.NUMBER,
type: FieldMetadataType.CURRENCY,
name: 'annualRecurringRevenue',
label: 'ARR',
targetColumnMap: {
value: 'annualRecurringRevenue',
amountMicros: 'annualRecurringRevenueAmountMicros',
currencyCode: 'annualRecurringRevenueCurrencyCode',
},
description:
'Annual Recurring Revenue: The actual or estimated annual revenue of the company',

View File

@ -112,11 +112,12 @@ export const seedOpportunityFieldMetadata = async (
isCustom: false,
workspaceId: SeedWorkspaceId,
isActive: true,
type: FieldMetadataType.NUMBER,
type: FieldMetadataType.CURRENCY,
name: 'amount',
label: 'Amount',
targetColumnMap: {
value: 'amount',
amountMicros: 'amountAmountMicros',
currencyCode: 'amountCurrencyCode',
},
description: 'Opportunity amount',
icon: 'IconCurrencyDollar',

View File

@ -174,11 +174,12 @@ export const seedPersonFieldMetadata = async (
isCustom: false,
workspaceId: SeedWorkspaceId,
isActive: true,
type: FieldMetadataType.TEXT,
name: 'linkedinUrl',
type: FieldMetadataType.LINK,
name: 'linkedinLink',
label: 'Linkedin',
targetColumnMap: {
value: 'linkedinUrl',
label: 'linkedinLinkLabel',
url: 'linkedinLinkUrl',
},
description: 'Contacts Linkedin account',
icon: 'IconBrandLinkedin',
@ -192,11 +193,12 @@ export const seedPersonFieldMetadata = async (
isCustom: false,
workspaceId: SeedWorkspaceId,
isActive: true,
type: FieldMetadataType.TEXT,
name: 'xUrl',
type: FieldMetadataType.LINK,
name: 'xLink',
label: 'X',
targetColumnMap: {
value: 'xUrl',
label: 'xLinkLabel',
url: 'xLinkUrl',
},
description: 'Contacts X/Twitter account',
icon: 'IconUser',

View File

@ -33,7 +33,7 @@ export const addCompanyTable: WorkspaceMigrationTableAction[] = [
action: WorkspaceMigrationColumnActionType.CREATE,
},
{
columnName: 'linkedinLinklUrl',
columnName: 'linkedinLinkUrl',
columnType: 'varchar',
action: WorkspaceMigrationColumnActionType.CREATE,
},
@ -53,8 +53,13 @@ export const addCompanyTable: WorkspaceMigrationTableAction[] = [
action: WorkspaceMigrationColumnActionType.CREATE,
},
{
columnName: 'annualRecurringRevenue',
columnType: 'float',
columnName: 'annualRecurringRevenueAmountMicros',
columnType: 'integer',
action: WorkspaceMigrationColumnActionType.CREATE,
},
{
columnName: 'annualRecurringRevenueCurrencyCode',
columnType: 'varchar',
action: WorkspaceMigrationColumnActionType.CREATE,
},
{

View File

@ -13,8 +13,13 @@ export const addOpportunityTable: WorkspaceMigrationTableAction[] = [
action: 'alter',
columns: [
{
columnName: 'amount',
columnType: 'float',
columnName: 'amountAmountMicros',
columnType: 'integer',
action: WorkspaceMigrationColumnActionType.CREATE,
},
{
columnName: 'amountCurrencyCode',
columnType: 'varchar',
action: WorkspaceMigrationColumnActionType.CREATE,
},
{

View File

@ -28,12 +28,22 @@ export const addPersonTable: WorkspaceMigrationTableAction[] = [
action: WorkspaceMigrationColumnActionType.CREATE,
},
{
columnName: 'linkedinUrl',
columnName: 'linkedinLinkUrl',
columnType: 'varchar',
action: WorkspaceMigrationColumnActionType.CREATE,
},
{
columnName: 'xUrl',
columnName: 'linkedinLinkLabel',
columnType: 'varchar',
action: WorkspaceMigrationColumnActionType.CREATE,
},
{
columnName: 'xLinkUrl',
columnType: 'varchar',
action: WorkspaceMigrationColumnActionType.CREATE,
},
{
columnName: 'xLinkLabel',
columnType: 'varchar',
action: WorkspaceMigrationColumnActionType.CREATE,
},

View File

@ -71,7 +71,8 @@ const companyMetadata = {
name: 'linkedinLink',
label: 'Linkedin',
targetColumnMap: {
value: 'linkedinLink',
label: 'linkedinLinkLabel',
url: 'linkedinLinkUrl',
},
description: 'The company Linkedin account',
icon: 'IconBrandLinkedin',
@ -84,7 +85,8 @@ const companyMetadata = {
name: 'xLink',
label: 'X',
targetColumnMap: {
value: 'xLink',
label: 'xLinkLabel',
url: 'xLinkUrl',
},
description: 'The company Twitter/X account',
icon: 'IconBrandX',
@ -93,11 +95,12 @@ const companyMetadata = {
{
isCustom: false,
isActive: true,
type: FieldMetadataType.NUMBER,
type: FieldMetadataType.CURRENCY,
name: 'annualRecurringRevenue',
label: 'ARR',
targetColumnMap: {
value: 'annualRecurringRevenue',
amountMicros: 'annualRecurringRevenueAmountMicros',
currencyCode: 'annualRecurringRevenueCurrencyCode',
},
description:
'Annual Recurring Revenue: The actual or estimated annual revenue of the company',

View File

@ -14,11 +14,12 @@ const opportunityMetadata = {
{
isCustom: false,
isActive: true,
type: FieldMetadataType.NUMBER,
type: FieldMetadataType.CURRENCY,
name: 'amount',
label: 'Amount',
targetColumnMap: {
value: 'amount',
amountMicros: 'amountAmountMicros',
currencyCode: 'amountCurrencyCode',
},
description: 'Opportunity amount',
icon: 'IconCurrencyDollar',