import { Entity, Property, OneToMany, Collection } from '@mikro-orm/core';
import { BaseEntity } from '../_BaseEntity';
import { TenantApp } from '../tenant/TenantApps';

@Entity()
export class App extends BaseEntity {
    @Property()
    name!: string;

    @Property({ nullable: true })
    method?: string;

    @Property({ nullable: true })
    path?: string;

    @Property({ nullable: true })
    description?: string;

    @Property({ nullable: true })
    publicPath?: string;

    @OneToMany(() => TenantApp, (tenantApp) => tenantApp.app)
    tenantApps = new Collection<TenantApp>(this);
}
