WIP - add owner to contact

This commit is contained in:
Francisco Gaona
2026-01-08 23:56:48 +01:00
parent 4de9203fd5
commit 43cae4289b
2 changed files with 71 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ export class Contact extends BaseModel {
firstName!: string;
lastName!: string;
accountId!: string;
ownerId?: string;
static relationMappings = {
account: {
@@ -17,5 +18,13 @@ export class Contact extends BaseModel {
to: 'accounts.id',
},
},
owner: {
relation: BaseModel.BelongsToOneRelation,
modelClass: 'user.model',
join: {
from: 'contacts.ownerId',
to: 'users.id',
},
},
};
}