Skip to content

Commit

Permalink
Merge pull request #8082 from ever-co/fix/daily-plan-get-plans-by-team
Browse files Browse the repository at this point in the history
[Feature] Get daily plans by Team
  • Loading branch information
rahul-rocket authored Aug 20, 2024
2 parents 2c7007b + 1b3f72a commit 5e9cee1
Show file tree
Hide file tree
Showing 11 changed files with 395 additions and 86 deletions.
20 changes: 14 additions & 6 deletions packages/contracts/src/daily-plan.model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
import { IRelationalOrganizationTeam } from './organization-team.model';
import { IBasePerTenantAndOrganizationEntityModel, IBaseRelationsEntityModel, ID } from './base-entity.model';
import { IRelationalEmployee } from './employee.model';
import { ITask } from './task.model';

Expand All @@ -14,15 +15,22 @@ export interface IDailyPlanBase extends IBasePerTenantAndOrganizationEntityModel
status: DailyPlanStatusEnum;
}

export interface IDailyPlan extends IDailyPlanBase, IRelationalEmployee {
export interface IDailyPlan extends IDailyPlanBase, IRelationalEmployee, IRelationalOrganizationTeam {
tasks?: ITask[];
}

export interface IDailyPlanCreateInput extends IDailyPlanBase, IRelationalEmployee {
taskId?: ITask['id'];
export interface IDailyPlanCreateInput extends IDailyPlanBase, IRelationalEmployee, IRelationalOrganizationTeam {
taskId?: ID;
}

export interface IDailyPlanUpdateInput extends Partial<IDailyPlanBase>, Pick<IDailyPlanCreateInput, 'employeeId'> {}
export interface IDailyPlanUpdateInput
extends Partial<IDailyPlanBase>,
Pick<IDailyPlanCreateInput, 'employeeId'>,
Partial<Pick<IRelationalOrganizationTeam, 'organizationTeamId'>> {}

export interface IGetDailyPlansByTeamInput extends IBaseRelationsEntityModel, IBasePerTenantAndOrganizationEntityModel {
teamIds?: ID[];
}

export interface IDailyPlanTasksUpdateInput
extends Pick<IDailyPlanCreateInput, 'taskId' | 'employeeId'>,
Expand All @@ -32,5 +40,5 @@ export interface IDailyPlanTasksUpdateInput
export interface IDailyPlansTasksUpdateInput
extends Pick<IDailyPlanCreateInput, 'employeeId'>,
IBasePerTenantAndOrganizationEntityModel {
plansIds: IDailyPlan['id'][];
plansIds: ID[];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import { yellow } from 'chalk';
import { DatabaseTypeEnum } from '@gauzy/config';

export class AlterDailyPlanAddTeamRelation1724062299873 implements MigrationInterface {
name = 'AlterDailyPlanAddTeamRelation1724062299873';

/**
* Up Migration
*
* @param queryRunner
*/
public async up(queryRunner: QueryRunner): Promise<void> {
console.log(yellow(this.name + ' start running!'));

switch (queryRunner.connection.options.type) {
case DatabaseTypeEnum.sqlite:
case DatabaseTypeEnum.betterSqlite3:
await this.sqliteUpQueryRunner(queryRunner);
break;
case DatabaseTypeEnum.postgres:
await this.postgresUpQueryRunner(queryRunner);
break;
case DatabaseTypeEnum.mysql:
await this.mysqlUpQueryRunner(queryRunner);
break;
default:
throw Error(`Unsupported database: ${queryRunner.connection.options.type}`);
}
}

/**
* Down Migration
*
* @param queryRunner
*/
public async down(queryRunner: QueryRunner): Promise<void> {
switch (queryRunner.connection.options.type) {
case DatabaseTypeEnum.sqlite:
case DatabaseTypeEnum.betterSqlite3:
await this.sqliteDownQueryRunner(queryRunner);
break;
case DatabaseTypeEnum.postgres:
await this.postgresDownQueryRunner(queryRunner);
break;
case DatabaseTypeEnum.mysql:
await this.mysqlDownQueryRunner(queryRunner);
break;
default:
throw Error(`Unsupported database: ${queryRunner.connection.options.type}`);
}
}

/**
* PostgresDB Up Migration
*
* @param queryRunner
*/
public async postgresUpQueryRunner(queryRunner: QueryRunner): Promise<any> {
await queryRunner.query(`ALTER TABLE "daily_plan" ADD "organizationTeamId" uuid`);
await queryRunner.query(
`CREATE INDEX "IDX_b022c2b684c35dcc63c22850f1" ON "daily_plan" ("organizationTeamId") `
);
await queryRunner.query(
`ALTER TABLE "daily_plan" ADD CONSTRAINT "FK_b022c2b684c35dcc63c22850f13" FOREIGN KEY ("organizationTeamId") REFERENCES "organization_team"("id") ON DELETE CASCADE ON UPDATE NO ACTION`
);
}

/**
* PostgresDB Down Migration
*
* @param queryRunner
*/
public async postgresDownQueryRunner(queryRunner: QueryRunner): Promise<any> {
await queryRunner.query(`ALTER TABLE "daily_plan" DROP CONSTRAINT "FK_b022c2b684c35dcc63c22850f13"`);
await queryRunner.query(`DROP INDEX "public"."IDX_b022c2b684c35dcc63c22850f1"`);
await queryRunner.query(`ALTER TABLE "daily_plan" DROP COLUMN "organizationTeamId"`);
}

/**
* SqliteDB and BetterSQlite3DB Up Migration
*
* @param queryRunner
*/
public async sqliteUpQueryRunner(queryRunner: QueryRunner): Promise<any> {
await queryRunner.query(`DROP INDEX "IDX_f2cf366f3f08e31784b056df88"`);
await queryRunner.query(`DROP INDEX "IDX_9779a35ef1338bafb7b90714f1"`);
await queryRunner.query(`DROP INDEX "IDX_ecb357a3764a7344c633a257d7"`);
await queryRunner.query(`DROP INDEX "IDX_ce5e588780497b05cd6267e20e"`);
await queryRunner.query(`DROP INDEX "IDX_903b08cd4c8025e73316342452"`);
await queryRunner.query(
`CREATE TABLE "temporary_daily_plan" ("deletedAt" datetime, "id" varchar PRIMARY KEY NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "isActive" boolean DEFAULT (1), "isArchived" boolean DEFAULT (0), "tenantId" varchar, "organizationId" varchar, "date" datetime NOT NULL, "workTimePlanned" decimal NOT NULL, "status" varchar NOT NULL, "employeeId" varchar, "organizationTeamId" varchar, CONSTRAINT "FK_f2cf366f3f08e31784b056df880" FOREIGN KEY ("employeeId") REFERENCES "employee" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_9779a35ef1338bafb7b90714f16" FOREIGN KEY ("organizationId") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT "FK_ecb357a3764a7344c633a257d76" FOREIGN KEY ("tenantId") REFERENCES "tenant" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`
);
await queryRunner.query(
`INSERT INTO "temporary_daily_plan"("deletedAt", "id", "createdAt", "updatedAt", "isActive", "isArchived", "tenantId", "organizationId", "date", "workTimePlanned", "status", "employeeId") SELECT "deletedAt", "id", "createdAt", "updatedAt", "isActive", "isArchived", "tenantId", "organizationId", "date", "workTimePlanned", "status", "employeeId" FROM "daily_plan"`
);
await queryRunner.query(`DROP TABLE "daily_plan"`);
await queryRunner.query(`ALTER TABLE "temporary_daily_plan" RENAME TO "daily_plan"`);
await queryRunner.query(`CREATE INDEX "IDX_f2cf366f3f08e31784b056df88" ON "daily_plan" ("employeeId") `);
await queryRunner.query(`CREATE INDEX "IDX_9779a35ef1338bafb7b90714f1" ON "daily_plan" ("organizationId") `);
await queryRunner.query(`CREATE INDEX "IDX_ecb357a3764a7344c633a257d7" ON "daily_plan" ("tenantId") `);
await queryRunner.query(`CREATE INDEX "IDX_ce5e588780497b05cd6267e20e" ON "daily_plan" ("isArchived") `);
await queryRunner.query(`CREATE INDEX "IDX_903b08cd4c8025e73316342452" ON "daily_plan" ("isActive") `);
await queryRunner.query(
`CREATE INDEX "IDX_b022c2b684c35dcc63c22850f1" ON "daily_plan" ("organizationTeamId") `
);
await queryRunner.query(`DROP INDEX "IDX_f2cf366f3f08e31784b056df88"`);
await queryRunner.query(`DROP INDEX "IDX_9779a35ef1338bafb7b90714f1"`);
await queryRunner.query(`DROP INDEX "IDX_ecb357a3764a7344c633a257d7"`);
await queryRunner.query(`DROP INDEX "IDX_ce5e588780497b05cd6267e20e"`);
await queryRunner.query(`DROP INDEX "IDX_903b08cd4c8025e73316342452"`);
await queryRunner.query(`DROP INDEX "IDX_b022c2b684c35dcc63c22850f1"`);
await queryRunner.query(
`CREATE TABLE "temporary_daily_plan" ("deletedAt" datetime, "id" varchar PRIMARY KEY NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "isActive" boolean DEFAULT (1), "isArchived" boolean DEFAULT (0), "tenantId" varchar, "organizationId" varchar, "date" datetime NOT NULL, "workTimePlanned" decimal NOT NULL, "status" varchar NOT NULL, "employeeId" varchar, "organizationTeamId" varchar, CONSTRAINT "FK_f2cf366f3f08e31784b056df880" FOREIGN KEY ("employeeId") REFERENCES "employee" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_9779a35ef1338bafb7b90714f16" FOREIGN KEY ("organizationId") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT "FK_ecb357a3764a7344c633a257d76" FOREIGN KEY ("tenantId") REFERENCES "tenant" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_b022c2b684c35dcc63c22850f13" FOREIGN KEY ("organizationTeamId") REFERENCES "organization_team" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`
);
await queryRunner.query(
`INSERT INTO "temporary_daily_plan"("deletedAt", "id", "createdAt", "updatedAt", "isActive", "isArchived", "tenantId", "organizationId", "date", "workTimePlanned", "status", "employeeId", "organizationTeamId") SELECT "deletedAt", "id", "createdAt", "updatedAt", "isActive", "isArchived", "tenantId", "organizationId", "date", "workTimePlanned", "status", "employeeId", "organizationTeamId" FROM "daily_plan"`
);
await queryRunner.query(`DROP TABLE "daily_plan"`);
await queryRunner.query(`ALTER TABLE "temporary_daily_plan" RENAME TO "daily_plan"`);
await queryRunner.query(`CREATE INDEX "IDX_f2cf366f3f08e31784b056df88" ON "daily_plan" ("employeeId") `);
await queryRunner.query(`CREATE INDEX "IDX_9779a35ef1338bafb7b90714f1" ON "daily_plan" ("organizationId") `);
await queryRunner.query(`CREATE INDEX "IDX_ecb357a3764a7344c633a257d7" ON "daily_plan" ("tenantId") `);
await queryRunner.query(`CREATE INDEX "IDX_ce5e588780497b05cd6267e20e" ON "daily_plan" ("isArchived") `);
await queryRunner.query(`CREATE INDEX "IDX_903b08cd4c8025e73316342452" ON "daily_plan" ("isActive") `);
await queryRunner.query(
`CREATE INDEX "IDX_b022c2b684c35dcc63c22850f1" ON "daily_plan" ("organizationTeamId") `
);
}

/**
* SqliteDB and BetterSQlite3DB Down Migration
*
* @param queryRunner
*/
public async sqliteDownQueryRunner(queryRunner: QueryRunner): Promise<any> {
await queryRunner.query(`DROP INDEX "IDX_b022c2b684c35dcc63c22850f1"`);
await queryRunner.query(`DROP INDEX "IDX_903b08cd4c8025e73316342452"`);
await queryRunner.query(`DROP INDEX "IDX_ce5e588780497b05cd6267e20e"`);
await queryRunner.query(`DROP INDEX "IDX_ecb357a3764a7344c633a257d7"`);
await queryRunner.query(`DROP INDEX "IDX_9779a35ef1338bafb7b90714f1"`);
await queryRunner.query(`DROP INDEX "IDX_f2cf366f3f08e31784b056df88"`);
await queryRunner.query(`ALTER TABLE "daily_plan" RENAME TO "temporary_daily_plan"`);
await queryRunner.query(
`CREATE TABLE "daily_plan" ("deletedAt" datetime, "id" varchar PRIMARY KEY NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "isActive" boolean DEFAULT (1), "isArchived" boolean DEFAULT (0), "tenantId" varchar, "organizationId" varchar, "date" datetime NOT NULL, "workTimePlanned" decimal NOT NULL, "status" varchar NOT NULL, "employeeId" varchar, "organizationTeamId" varchar, CONSTRAINT "FK_f2cf366f3f08e31784b056df880" FOREIGN KEY ("employeeId") REFERENCES "employee" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_9779a35ef1338bafb7b90714f16" FOREIGN KEY ("organizationId") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT "FK_ecb357a3764a7344c633a257d76" FOREIGN KEY ("tenantId") REFERENCES "tenant" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`
);
await queryRunner.query(
`INSERT INTO "daily_plan"("deletedAt", "id", "createdAt", "updatedAt", "isActive", "isArchived", "tenantId", "organizationId", "date", "workTimePlanned", "status", "employeeId", "organizationTeamId") SELECT "deletedAt", "id", "createdAt", "updatedAt", "isActive", "isArchived", "tenantId", "organizationId", "date", "workTimePlanned", "status", "employeeId", "organizationTeamId" FROM "temporary_daily_plan"`
);
await queryRunner.query(`DROP TABLE "temporary_daily_plan"`);
await queryRunner.query(
`CREATE INDEX "IDX_b022c2b684c35dcc63c22850f1" ON "daily_plan" ("organizationTeamId") `
);
await queryRunner.query(`CREATE INDEX "IDX_903b08cd4c8025e73316342452" ON "daily_plan" ("isActive") `);
await queryRunner.query(`CREATE INDEX "IDX_ce5e588780497b05cd6267e20e" ON "daily_plan" ("isArchived") `);
await queryRunner.query(`CREATE INDEX "IDX_ecb357a3764a7344c633a257d7" ON "daily_plan" ("tenantId") `);
await queryRunner.query(`CREATE INDEX "IDX_9779a35ef1338bafb7b90714f1" ON "daily_plan" ("organizationId") `);
await queryRunner.query(`CREATE INDEX "IDX_f2cf366f3f08e31784b056df88" ON "daily_plan" ("employeeId") `);
await queryRunner.query(`DROP INDEX "IDX_b022c2b684c35dcc63c22850f1"`);
await queryRunner.query(`DROP INDEX "IDX_903b08cd4c8025e73316342452"`);
await queryRunner.query(`DROP INDEX "IDX_ce5e588780497b05cd6267e20e"`);
await queryRunner.query(`DROP INDEX "IDX_ecb357a3764a7344c633a257d7"`);
await queryRunner.query(`DROP INDEX "IDX_9779a35ef1338bafb7b90714f1"`);
await queryRunner.query(`DROP INDEX "IDX_f2cf366f3f08e31784b056df88"`);
await queryRunner.query(`ALTER TABLE "daily_plan" RENAME TO "temporary_daily_plan"`);
await queryRunner.query(
`CREATE TABLE "daily_plan" ("deletedAt" datetime, "id" varchar PRIMARY KEY NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "isActive" boolean DEFAULT (1), "isArchived" boolean DEFAULT (0), "tenantId" varchar, "organizationId" varchar, "date" datetime NOT NULL, "workTimePlanned" decimal NOT NULL, "status" varchar NOT NULL, "employeeId" varchar, CONSTRAINT "FK_f2cf366f3f08e31784b056df880" FOREIGN KEY ("employeeId") REFERENCES "employee" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_9779a35ef1338bafb7b90714f16" FOREIGN KEY ("organizationId") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT "FK_ecb357a3764a7344c633a257d76" FOREIGN KEY ("tenantId") REFERENCES "tenant" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`
);
await queryRunner.query(
`INSERT INTO "daily_plan"("deletedAt", "id", "createdAt", "updatedAt", "isActive", "isArchived", "tenantId", "organizationId", "date", "workTimePlanned", "status", "employeeId") SELECT "deletedAt", "id", "createdAt", "updatedAt", "isActive", "isArchived", "tenantId", "organizationId", "date", "workTimePlanned", "status", "employeeId" FROM "temporary_daily_plan"`
);
await queryRunner.query(`DROP TABLE "temporary_daily_plan"`);
await queryRunner.query(`CREATE INDEX "IDX_903b08cd4c8025e73316342452" ON "daily_plan" ("isActive") `);
await queryRunner.query(`CREATE INDEX "IDX_ce5e588780497b05cd6267e20e" ON "daily_plan" ("isArchived") `);
await queryRunner.query(`CREATE INDEX "IDX_ecb357a3764a7344c633a257d7" ON "daily_plan" ("tenantId") `);
await queryRunner.query(`CREATE INDEX "IDX_9779a35ef1338bafb7b90714f1" ON "daily_plan" ("organizationId") `);
await queryRunner.query(`CREATE INDEX "IDX_f2cf366f3f08e31784b056df88" ON "daily_plan" ("employeeId") `);
}

/**
* MySQL Up Migration
*
* @param queryRunner
*/
public async mysqlUpQueryRunner(queryRunner: QueryRunner): Promise<any> {
await queryRunner.query(`ALTER TABLE \`daily_plan\` ADD \`organizationTeamId\` varchar(255) NULL`);
await queryRunner.query(
`CREATE INDEX \`IDX_b022c2b684c35dcc63c22850f1\` ON \`daily_plan\` (\`organizationTeamId\`)`
);
await queryRunner.query(
`ALTER TABLE \`daily_plan\` ADD CONSTRAINT \`FK_b022c2b684c35dcc63c22850f13\` FOREIGN KEY (\`organizationTeamId\`) REFERENCES \`organization_team\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`
);
}

/**
* MySQL Down Migration
*
* @param queryRunner
*/
public async mysqlDownQueryRunner(queryRunner: QueryRunner): Promise<any> {
await queryRunner.query(`ALTER TABLE \`daily_plan\` DROP FOREIGN KEY \`FK_b022c2b684c35dcc63c22850f13\``);
await queryRunner.query(`DROP INDEX \`IDX_b022c2b684c35dcc63c22850f1\` ON \`daily_plan\``);
await queryRunner.query(`ALTER TABLE \`daily_plan\` DROP COLUMN \`organizationTeamId\``);
}
}
31 changes: 15 additions & 16 deletions packages/core/src/employee/dto/employee-feature.dto.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import { ApiPropertyOptional } from "@nestjs/swagger";
import { IsObject, IsString, ValidateIf } from "class-validator";
import { IEmployee, IRelationalEmployee } from "@gauzy/contracts";
import { Employee } from "./../employee.entity";
import { IsEmployeeBelongsToOrganization } from "./../../shared/validators";
import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsObject, IsString, ValidateIf } from 'class-validator';
import { ID, IEmployee, IRelationalEmployee } from '@gauzy/contracts';
import { Employee } from './../employee.entity';
import { IsEmployeeBelongsToOrganization } from './../../shared/validators';

export class EmployeeFeatureDTO implements IRelationalEmployee {
@ApiPropertyOptional({ type: () => Employee })
@ValidateIf((it) => !it.employeeId || it.employee)
@IsObject()
@IsEmployeeBelongsToOrganization()
readonly employee: IEmployee;

@ApiPropertyOptional({ type: () => Employee })
@ValidateIf((it) => !it.employeeId || it.employee)
@IsObject()
@IsEmployeeBelongsToOrganization()
readonly employee: IEmployee;

@ApiPropertyOptional({ type: () => String })
@ValidateIf((it) => !it.employee || it.employeeId)
@IsString()
@IsEmployeeBelongsToOrganization()
readonly employeeId: IEmployee['id'];
@ApiPropertyOptional({ type: () => String })
@ValidateIf((it) => !it.employee || it.employeeId)
@IsString()
@IsEmployeeBelongsToOrganization()
readonly employeeId: ID;
}
8 changes: 4 additions & 4 deletions packages/core/src/organization-team/dto/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

export * from "./create-organization-team.dto";
export * from "./update-organization-team.dto";
export * from "./organization-team-statistic.dto";
export * from './create-organization-team.dto';
export * from './update-organization-team.dto';
export * from './organization-team-statistic.dto';
export * from './organization-team-feature.dto';
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsObject, IsUUID, ValidateIf } from 'class-validator';
import { ID, IOrganizationTeam, IRelationalOrganizationTeam } from '@gauzy/contracts';
import { OrganizationTeam } from '../organization-team.entity';

export class OrganizationTeamFeatureDTO implements IRelationalOrganizationTeam {
@ApiPropertyOptional({ type: () => OrganizationTeam })
@ValidateIf((it) => !it.organizationTeamId || it.organizationTeam)
@IsObject()
readonly organizationTeam: IOrganizationTeam;

@ApiPropertyOptional({ type: () => String })
@ValidateIf((it) => !it.organizationTeam || it.organizationTeamId)
@IsUUID()
readonly organizationTeamId: ID;
}
15 changes: 13 additions & 2 deletions packages/core/src/organization-team/organization-team.entity.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { JoinTable, JoinColumn, RelationId } from 'typeorm';
import {
ID,
IDailyPlan,
IEquipmentSharing,
IGoal,
IImageAsset,
Expand All @@ -20,6 +22,7 @@ import {
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsBoolean, IsNotEmpty, IsOptional, IsString, IsUUID } from 'class-validator';
import {
DailyPlan,
EquipmentSharing,
Goal,
ImageAsset,
Expand Down Expand Up @@ -166,7 +169,7 @@ export class OrganizationTeam extends TenantOrganizationBaseEntity implements IO
@RelationId((it: OrganizationTeam) => it.createdBy)
@ColumnIndex()
@MultiORMColumn({ nullable: true, relationId: true })
createdById?: IUser['id'];
createdById?: ID;

/**
* ImageAsset
Expand All @@ -190,7 +193,7 @@ export class OrganizationTeam extends TenantOrganizationBaseEntity implements IO
@RelationId((it: OrganizationTeam) => it.image)
@ColumnIndex()
@MultiORMColumn({ nullable: true, relationId: true })
imageId?: IImageAsset['id'];
imageId?: ID;

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -261,6 +264,14 @@ export class OrganizationTeam extends TenantOrganizationBaseEntity implements IO
@MultiORMOneToMany(() => IssueType, (it) => it.organizationTeam)
issueTypes?: IIssueType[];

/**
* Team daily plans
*/
@MultiORMOneToMany(() => DailyPlan, (dailyPlan) => dailyPlan.organizationTeam, {
cascade: true
})
dailyPlans?: IDailyPlan[];

/*
|--------------------------------------------------------------------------
| @ManyToMany
Expand Down
Loading

0 comments on commit 5e9cee1

Please sign in to comment.