forked from cerc-io/snowballtools-base
Part of [Service provider auctions for web deployments](https://www.notion.so/Service-provider-auctions-for-web-deployments-104a6b22d47280dbad51d28aa3a91d75) - Implement funtionality to pay for deployments by connecting wallet using `WalletConnect`   Co-authored-by: IshaVenikar <ishavenikar7@gmail.com> Co-authored-by: Shreerang Kale <shreerangkale@gmail.com> Reviewed-on: cerc-io/snowballtools-base#17
100 lines
2.1 KiB
TypeScript
100 lines
2.1 KiB
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
CreateDateColumn,
|
|
UpdateDateColumn,
|
|
ManyToOne,
|
|
JoinColumn,
|
|
OneToMany,
|
|
DeleteDateColumn,
|
|
JoinTable,
|
|
ManyToMany
|
|
} from 'typeorm';
|
|
|
|
import { User } from './User';
|
|
import { Organization } from './Organization';
|
|
import { ProjectMember } from './ProjectMember';
|
|
import { Deployment } from './Deployment';
|
|
import { Deployer } from './Deployer';
|
|
|
|
@Entity()
|
|
export class Project {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id!: string;
|
|
|
|
@ManyToOne(() => User)
|
|
@JoinColumn({ name: 'ownerId' })
|
|
owner!: User;
|
|
|
|
@Column({ nullable: false })
|
|
ownerId!: string;
|
|
|
|
@ManyToOne(() => Organization, { nullable: true })
|
|
@JoinColumn({ name: 'organizationId' })
|
|
organization!: Organization | null;
|
|
|
|
@Column('varchar')
|
|
organizationId!: string;
|
|
|
|
@Column('varchar')
|
|
name!: string;
|
|
|
|
@Column('varchar')
|
|
repository!: string;
|
|
|
|
@Column('varchar', { length: 255, default: 'main' })
|
|
prodBranch!: string;
|
|
|
|
@Column('text', { default: '' })
|
|
description!: string;
|
|
|
|
@Column('varchar', { nullable: true })
|
|
auctionId!: string | null;
|
|
|
|
@ManyToMany(() => Deployer, (deployer) => (deployer.projects))
|
|
@JoinTable()
|
|
deployers!: Deployer[]
|
|
|
|
@Column('boolean', { default: false, nullable: true })
|
|
fundsReleased!: boolean;
|
|
|
|
// TODO: Compute template & framework in import repository
|
|
@Column('varchar', { nullable: true })
|
|
template!: string | null;
|
|
|
|
@Column('varchar', { nullable: true })
|
|
framework!: string | null;
|
|
|
|
@Column('varchar')
|
|
paymentAddress!: string;
|
|
|
|
@Column('varchar')
|
|
txHash!: string;
|
|
|
|
@Column({
|
|
type: 'simple-array'
|
|
})
|
|
webhooks!: string[];
|
|
|
|
@Column('varchar')
|
|
icon!: string;
|
|
|
|
@CreateDateColumn()
|
|
createdAt!: Date;
|
|
|
|
@UpdateDateColumn()
|
|
updatedAt!: Date;
|
|
|
|
@DeleteDateColumn()
|
|
deletedAt!: Date | null;
|
|
|
|
@OneToMany(() => Deployment, (deployment) => deployment.project)
|
|
deployments!: Deployment[];
|
|
|
|
@OneToMany(() => ProjectMember, (projectMember) => projectMember.project, {
|
|
cascade: ['soft-remove']
|
|
})
|
|
projectMembers!: ProjectMember[];
|
|
}
|