src/auth/tenant/entitites/tenant.entity.ts
Represents a tenant in the system.
Properties |
|
clients |
Type : ClientEntity[]
|
Decorators :
@OneToMany(undefined, client => client.tenant)
|
The clients associated with the tenant. |
Optional description |
Type : string
|
Decorators :
@IsString()
|
The description of the tenant. |
id |
Type : string
|
Decorators :
@IsString()
|
The unique identifier for the tenant. |
name |
Type : string
|
Decorators :
@IsString()
|
The name of the tenant. |
status |
Type : TenantStatus
|
Decorators :
@Column('varchar', {nullable: true})
|
The current status of the tenant. |
import { IsOptional, IsString } from "class-validator";
import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm";
import { ClientEntity } from "../../client/entities/client.entity";
export type TenantStatus = "active";
/**
* Represents a tenant in the system.
*/
@Entity()
export class TenantEntity {
/**
* The unique identifier for the tenant.
*/
@IsString()
@PrimaryColumn()
id: string;
/**
* The name of the tenant.
*/
@IsString()
@Column({ default: "EUDIPLO" })
name: string;
/**
* The description of the tenant.
*/
@IsString()
@IsOptional()
@Column({ nullable: true })
description?: string;
/**
* The current status of the tenant.
*/
@Column("varchar", { nullable: true })
status: TenantStatus;
/**
* The clients associated with the tenant.
*/
@OneToMany(
() => ClientEntity,
(client) => client.tenant,
)
clients: ClientEntity[];
}