diff --git a/packages/demo/db-seed.ts b/packages/demo/db-seed.ts index 01f8b05..afd8584 100644 --- a/packages/demo/db-seed.ts +++ b/packages/demo/db-seed.ts @@ -91,11 +91,9 @@ async function main() { new Date(a.date).valueOf() - new Date(b.date).valueOf() ) .map(note => { - const relatedContact = { - ...persistedContacts.find( - contact => contact.id === note.contact_id - ), - }; + const relatedContact = persistedContacts.find( + contact => contact.id === note.contact_id + ); return supabase.from('contacts').update({ ...relatedContact, status: note.status, diff --git a/packages/demo/src/dataGenerator/companies.ts b/packages/demo/src/dataGenerator/companies.ts index bc5b9d6..61aa404 100644 --- a/packages/demo/src/dataGenerator/companies.ts +++ b/packages/demo/src/dataGenerator/companies.ts @@ -22,7 +22,7 @@ const sizes = [1, 10, 50, 250, 500]; const regex = /\W+/; -export const generateCompanies = (db: Db): Company[] => { +export const generateCompanies = (db: Pick): Company[] => { return Array.from(Array(55).keys()).map(id => { const name = company.companyName(); return { diff --git a/packages/demo/src/dataGenerator/contactNotes.ts b/packages/demo/src/dataGenerator/contactNotes.ts index c5f4734..1143192 100644 --- a/packages/demo/src/dataGenerator/contactNotes.ts +++ b/packages/demo/src/dataGenerator/contactNotes.ts @@ -6,7 +6,9 @@ import { randomDate } from './utils'; const status = ['cold', 'cold', 'cold', 'warm', 'warm', 'hot', 'in-contract']; -export const generateContactNotes = (db: Db): ContactNote[] => { +export const generateContactNotes = ( + db: Pick +): ContactNote[] => { return Array.from(Array(1200).keys()).map(id => { const contact = random.arrayElement(db.contacts); const date = randomDate(new Date(contact.first_seen)).toISOString(); diff --git a/packages/demo/src/dataGenerator/contacts.ts b/packages/demo/src/dataGenerator/contacts.ts index 387b60d..5ad586f 100644 --- a/packages/demo/src/dataGenerator/contacts.ts +++ b/packages/demo/src/dataGenerator/contacts.ts @@ -21,7 +21,9 @@ const maxContacts = { 500: 50, }; -export const generateContacts = (db: Db): Contact[] => { +export const generateContacts = ( + db: Pick +): Contact[] => { const nbAvailblePictures = 223; let numberOfContacts = 0; diff --git a/packages/demo/src/dataGenerator/dealNotes.ts b/packages/demo/src/dataGenerator/dealNotes.ts index 3470acc..c89981d 100644 --- a/packages/demo/src/dataGenerator/dealNotes.ts +++ b/packages/demo/src/dataGenerator/dealNotes.ts @@ -5,7 +5,7 @@ import { randomDate } from './utils'; const type = ['Email', 'Call', 'Call', 'Call', 'Call', 'Meeting', 'Reminder']; -export const generateDealNotes = (db: Db) => { +export const generateDealNotes = (db: Pick) => { return Array.from(Array(300).keys()).map(id => { const deal = random.arrayElement(db.deals); const company = db.companies[deal.company_id as number]; diff --git a/packages/demo/src/dataGenerator/deals.ts b/packages/demo/src/dataGenerator/deals.ts index 31cef13..122ba13 100644 --- a/packages/demo/src/dataGenerator/deals.ts +++ b/packages/demo/src/dataGenerator/deals.ts @@ -22,7 +22,9 @@ const stages = [ ]; //const tags = ["new deal", "upsell", "SAV"]; -export const generateDeals = (db: Db): Deal[] => { +export const generateDeals = ( + db: Pick +): Deal[] => { const deals = Array.from(Array(50).keys()).map(id => { const company = random.arrayElement(db.companies); company.nb_deals++; diff --git a/packages/demo/src/dataGenerator/sales.ts b/packages/demo/src/dataGenerator/sales.ts index d0e0739..c8f38c7 100644 --- a/packages/demo/src/dataGenerator/sales.ts +++ b/packages/demo/src/dataGenerator/sales.ts @@ -1,8 +1,6 @@ import { name, internet } from 'faker/locale/en_US'; -import { Db } from './types'; - -export const generateSales = (_: Db) => { +export const generateSales = () => { const randomSales = Array.from(Array(10).keys()).map(id => { const first_name = name.firstName(); const last_name = name.lastName(); diff --git a/packages/demo/src/dataGenerator/tags.ts b/packages/demo/src/dataGenerator/tags.ts index fd275ac..57b8149 100644 --- a/packages/demo/src/dataGenerator/tags.ts +++ b/packages/demo/src/dataGenerator/tags.ts @@ -1,5 +1,3 @@ -import { Db } from './types'; - // --champagne-pink: #eddcd2ff; // --linen: #fff1e6ff; // --pale-pink: #fde2e4ff; @@ -20,6 +18,6 @@ const tags = [ { id: 5, name: 'vip', color: '#dbe7e4' }, ]; -export const generateTags = (_: Db) => { +export const generateTags = () => { return [...tags]; }; diff --git a/packages/demo/src/dataGenerator/tasks.ts b/packages/demo/src/dataGenerator/tasks.ts index a557d69..3581f0b 100644 --- a/packages/demo/src/dataGenerator/tasks.ts +++ b/packages/demo/src/dataGenerator/tasks.ts @@ -31,7 +31,7 @@ const type = [ 'None', ]; -export const generateTasks = (db: Db) => { +export const generateTasks = (db: Pick) => { return Array.from(Array(400).keys()).map(id => { const contact = random.arrayElement(db.contacts); return {