snowballtools-base/packages/backend/src/entity/ProjectMember.ts
Nabarun Gogoi 6d1a48905a
Show domain connected status in overview tab (#58)
* Implement functionality to visit deployment

* Check and display domain details in overview tab for production branch

* Update fixtures to remove project name from deployment url

* Refactor and add uuid to typeorm entities

* Fix deployment url

* Display live domain details in project overview

* Use database query to fetch live production domain
2024-02-06 19:11:53 +05:30

52 lines
943 B
TypeScript

import {
Entity,
Column,
CreateDateColumn,
UpdateDateColumn,
ManyToOne,
PrimaryGeneratedColumn,
JoinColumn,
Unique,
DeleteDateColumn
} from 'typeorm';
import { Project } from './Project';
import { User } from './User';
export enum Permission {
View = 'View',
Edit = 'Edit'
}
@Entity()
@Unique(['project', 'member'])
export class ProjectMember {
@PrimaryGeneratedColumn('uuid')
id!: string;
@ManyToOne(() => User, (user) => user.projectMembers)
@JoinColumn({ name: 'userId' })
member!: User;
@ManyToOne(() => Project, (project) => project.projectMembers)
@JoinColumn({ name: 'projectId' })
project!: Project;
@Column({
type: 'simple-array'
})
permissions!: Permission[];
@Column('boolean', { default: false })
isPending!: boolean;
@CreateDateColumn()
createdAt!: Date;
@UpdateDateColumn()
updatedAt!: Date;
@DeleteDateColumn()
deletedAt!: Date | null;
}