-
Notifications
You must be signed in to change notification settings - Fork 70
/
tenant-config.model.ts
46 lines (41 loc) · 1019 Bytes
/
tenant-config.model.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) 2023 Sourcefuse Technologies
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
import {belongsTo, model, property} from '@loopback/repository';
import {ConfigKey, UserModifiableEntity} from '@sourceloop/core';
import {Tenant, TenantWithRelations} from './index';
@model({
name: 'tenant_configs',
})
export class TenantConfig extends UserModifiableEntity<TenantConfig> {
@property({
type: 'string',
id: true,
})
id?: string;
@property({
type: 'string',
required: true,
name: 'config_key',
})
configKey: ConfigKey;
@property({
type: 'object',
name: 'config_value',
})
configValue?: object;
@belongsTo(
() => Tenant,
{keyFrom: 'tenant_id', name: 'tenant'},
{
name: 'tenant_id',
required: true,
},
)
tenantId: string;
}
export interface TenantConfigRelations {
tenant: TenantWithRelations;
}
export type TenantConfigWithRelations = TenantConfig & TenantConfigRelations;