Add contact and contact detail system objects

This commit is contained in:
phyroslam
2026-01-08 07:41:09 -08:00
parent 51c82d3d95
commit a75b41fd0b
4 changed files with 262 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
import { BaseModel } from './base.model';
export class ContactDetail extends BaseModel {
static tableName = 'contact_details';
id!: string;
relatedObjectType!: string;
relatedObjectId!: string;
detailType!: string;
label?: string;
value!: string;
isPrimary!: boolean;
}

View File

@@ -0,0 +1,21 @@
import { BaseModel } from './base.model';
export class Contact extends BaseModel {
static tableName = 'contacts';
id!: string;
firstName!: string;
lastName!: string;
accountId!: string;
static relationMappings = {
account: {
relation: BaseModel.BelongsToOneRelation,
modelClass: 'account.model',
join: {
from: 'contacts.accountId',
to: 'accounts.id',
},
},
};
}