Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Alter "OrganizationTeam" Entity Table #8795

Merged
merged 6 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 17 additions & 23 deletions packages/contracts/src/lib/organization-team.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@ import { CrudActionEnum } from './organization.model';
import { IOrganizationProject, IOrganizationProjectCreateInput } from './organization-projects.model';
import { IOrganizationProjectModule } from './organization-project-module.model';
import { IComment } from './comment.model';
import { IHasUserCreator } from './user.model';

export interface IOrganizationTeam extends IBasePerTenantAndOrganizationEntityModel, IRelationalImageAsset, ITaggable {
// Base interface for common properties
interface IBaseTeamProperties extends IBasePerTenantAndOrganizationEntityModel, IRelationalImageAsset, ITaggable {
name: string;
color?: string;
emoji?: string;
teamSize?: string;
logo?: string;
prefix?: string;
shareProfileView?: boolean; // If true, all members can view "Worked" tasks and "Daily Plan" tabs of all other employees, By default, it's true
requirePlanToTrack?: boolean; // If true, members can't be able to track time without have a "Daily Plan". By default, it's false
shareProfileView?: boolean; // Default is true
requirePlanToTrack?: boolean; // Default is false
public?: boolean;
profile_link?: string;
}

// Interface for team members and related entities
interface ITeamAssociations {
members?: IOrganizationTeamEmployee[];
managers?: IOrganizationTeamEmployee[];
projects?: IOrganizationProject[];
Expand All @@ -29,6 +35,10 @@ export interface IOrganizationTeam extends IBasePerTenantAndOrganizationEntityMo
tasks?: ITask[];
}

// Main Organization Team interface
export interface IOrganizationTeam extends IBaseTeamProperties, ITeamAssociations, IHasUserCreator {}

// Input interface for finding an organization team
export interface IOrganizationTeamFindInput extends IBasePerTenantAndOrganizationEntityModel, IEmployeeEntityInput {
name?: string;
prefix?: string;
Expand All @@ -37,29 +47,13 @@ export interface IOrganizationTeamFindInput extends IBasePerTenantAndOrganizatio
members?: IOrganizationTeamEmployee;
}

export interface IOrganizationTeamCreateInput
extends IBasePerTenantAndOrganizationEntityModel,
IRelationalImageAsset,
IMemberEntityBased,
ITaggable {
name: string;
emoji?: string;
teamSize?: string;
color?: string;
logo?: string;
prefix?: string;
shareProfileView?: boolean;
requirePlanToTrack?: boolean;
public?: boolean;
profile_link?: string;
// Input interface for creating an organization team
export interface IOrganizationTeamCreateInput extends IBaseTeamProperties, IMemberEntityBased {
projects?: IOrganizationProjectCreateInput[];
}

export interface IOrganizationTeamUpdateInput extends Partial<IOrganizationTeamCreateInput> {
shareProfileView?: boolean;
requirePlanToTrack?: boolean;
public?: boolean;
}
// Input interface for updating an organization team
export interface IOrganizationTeamUpdateInput extends Partial<IOrganizationTeamCreateInput> {}

export interface IOrganizationTeamStatisticInput extends ITimerStatusInput {
withLastWorkedTask: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class AlterActivityLogEntityTable1739602849367 implements MigrationInterf
await queryRunner.query(`ALTER TABLE "activity_log" DROP CONSTRAINT "FK_b6e9a5c3e1ee65a3bcb8a00de2b"`);

// Step 2: Drop the existing index on "creatorId".
console.log('Step 2: Dropping index "IDX_b6e9a5c3e1ee65a3bcb8a00de2" from "activity_log"...');
console.log('Step 2: Dropping index "creatorId" from "activity_log"...');
await queryRunner.query(`DROP INDEX "public"."IDX_b6e9a5c3e1ee65a3bcb8a00de2"`);

// Step 3: Add new column "employeeId" of type uuid.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { MigrationInterface, QueryRunner } from 'typeorm';
import * as chalk from 'chalk';
import { DatabaseTypeEnum } from '@gauzy/config';

export class AlterTableVideo1739958417359 implements MigrationInterface {
name = 'AlterTableVideo1739958417359';
export class AlterVideoEntityTable1739958417359 implements MigrationInterface {
name = 'AlterVideoEntityTable1739958417359';

/**
* Up Migration
Expand Down
Loading
Loading