File

src/auth/tenant/entitites/tenant.entity.ts

Description

Represents a tenant in the system.

Index

Properties

Properties

clients
Type : ClientEntity[]
Decorators :
@OneToMany(undefined, client => client.tenant)

The clients associated with the tenant.

Optional description
Type : string
Decorators :
@IsString()
@IsOptional()
@Column({nullable: true})

The description of the tenant.

id
Type : string
Decorators :
@IsString()
@PrimaryColumn()

The unique identifier for the tenant.

name
Type : string
Decorators :
@IsString()
@Column({default: 'EUDIPLO'})

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[];
}

results matching ""

    No results matching ""