added tag relation to project and product

This commit is contained in:
hannathkadher
2025-02-10 11:36:57 +04:00
parent 4c566fd6c3
commit f381820049
2 changed files with 8 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import { CommunityEntity } from '../../community/entities';
import { SpaceModelEntity } from '../../space-model';
import { UserEntity } from '../../user/entities';
import { InviteUserEntity } from '../../Invite-user/entities';
import { NewTagEntity } from '../../tag/entities';
@Entity({ name: 'project' })
@Unique(['name'])
@ -36,6 +37,9 @@ export class ProjectEntity extends AbstractEntity<ProjectDto> {
@OneToMany(() => InviteUserEntity, (inviteUser) => inviteUser.project)
public invitedUsers: InviteUserEntity[];
@OneToMany(() => NewTagEntity, (tag) => tag.project, { cascade: true })
public tags: NewTagEntity[];
constructor(partial: Partial<ProjectEntity>) {
super();
Object.assign(this, partial);