add contacts to crm & display on dashboard
This commit is contained in:
@@ -79,6 +79,21 @@ export const contacts = pgTable('contacts', {
|
||||
accountEmailUnique: unique('account_email_unique').on(table.emailAccountId, table.email),
|
||||
}));
|
||||
|
||||
// Personal contacts - osobné kontakty používateľa (bez väzby na firmu alebo email account)
|
||||
export const personalContacts = pgTable('personal_contacts', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
userId: uuid('user_id').references(() => users.id, { onDelete: 'cascade' }).notNull(),
|
||||
firstName: text('first_name').notNull(),
|
||||
lastName: text('last_name'),
|
||||
phone: text('phone').notNull(),
|
||||
email: text('email').notNull(),
|
||||
secondaryEmail: text('secondary_email'),
|
||||
createdAt: timestamp('created_at').defaultNow().notNull(),
|
||||
updatedAt: timestamp('updated_at').defaultNow().notNull(),
|
||||
}, (table) => ({
|
||||
personalContactUniqueEmail: unique('personal_contact_user_email').on(table.userId, table.email),
|
||||
}));
|
||||
|
||||
// Emails table - uložené emaily z JMAP
|
||||
// Emaily patria k email accountu a sú zdieľané medzi všetkými používateľmi s prístupom
|
||||
export const emails = pgTable('emails', {
|
||||
|
||||
Reference in New Issue
Block a user