feat: Add company linking to personal contacts
- Add companyId column to personal_contacts table - Update personal-contact service to include companyName in list - Add getContactsByCompanyId function for company contacts endpoint - Add GET /companies/:companyId/contacts endpoint - Add companyId to contact validation schema 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -79,10 +79,11 @@ 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)
|
||||
// Personal contacts - osobné kontakty používateľa (s voliteľnou väzbou na firmu)
|
||||
export const personalContacts = pgTable('personal_contacts', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
userId: uuid('user_id').references(() => users.id, { onDelete: 'cascade' }).notNull(),
|
||||
companyId: uuid('company_id').references(() => companies.id, { onDelete: 'set null' }), // voliteľná väzba na firmu
|
||||
firstName: text('first_name').notNull(),
|
||||
lastName: text('last_name'),
|
||||
phone: text('phone').notNull(),
|
||||
|
||||
Reference in New Issue
Block a user