feat: add socker connection between client and server

This commit is contained in:
Ahmed Bouhuolia
2024-02-24 00:18:48 +02:00
parent 1fd8a53ed1
commit 2d3544fe37
16 changed files with 357 additions and 27 deletions

View File

@@ -0,0 +1,49 @@
import { Model } from 'objection';
import SystemModel from '@/system/models/SystemModel';
export default class SystemPlaidItem extends SystemModel {
tenantId: number;
plaidItemId: string;
/**
* Table name.
*/
static get tableName() {
return 'plaid_items';
}
/**
* Timestamps columns.
*/
get timestamps() {
return ['createdAt', 'updatedAt'];
}
/**
* Virtual attributes.
*/
static get virtualAttributes() {
return [];
}
/**
* Relationship mapping.
*/
static get relationMappings() {
const Tenant = require('system/models/Tenant');
return {
/**
* System user may belongs to tenant model.
*/
tenant: {
relation: Model.BelongsToOneRelation,
modelClass: Tenant.default,
join: {
from: 'users.tenantId',
to: 'tenants.id',
},
},
};
}
}

View File

@@ -3,5 +3,13 @@ import TenantMetadata from './TenantMetadata';
import SystemUser from './SystemUser';
import PasswordReset from './PasswordReset';
import Invite from './Invite';
import SystemPlaidItem from './SystemPlaidItem';
export { Tenant, TenantMetadata, SystemUser, PasswordReset, Invite };
export {
Tenant,
TenantMetadata,
SystemUser,
PasswordReset,
Invite,
SystemPlaidItem,
};