first commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty } from 'class-validator';
|
||||
import { Team } from 'src/teams/entities/team.entity';
|
||||
import { TeamSettingType } from 'src/teams/model/team-settings-type';
|
||||
|
||||
export class CreateTeamSettingDTO {
|
||||
@ApiProperty({ example: '1. Herren' })
|
||||
@IsNotEmpty()
|
||||
key: TeamSettingType;
|
||||
|
||||
@ApiProperty({ example: '1. Herren' })
|
||||
@IsNotEmpty()
|
||||
value: string;
|
||||
|
||||
@ApiProperty({ example: '1. Herren' })
|
||||
@IsNotEmpty()
|
||||
team: Team;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Allow } from 'class-validator';
|
||||
import { EntityHelper } from 'src/utils/entity-helper';
|
||||
import { Team } from 'src/teams/entities/team.entity';
|
||||
import { TeamSettingType } from 'src/teams/model/team-settings-type';
|
||||
|
||||
@Entity()
|
||||
export class TeamSetting extends EntityHelper {
|
||||
@ApiProperty({ example: 0 })
|
||||
@PrimaryGeneratedColumn('increment')
|
||||
id: number;
|
||||
|
||||
@Allow()
|
||||
@ApiProperty({ example: 0 })
|
||||
@ManyToOne(() => Team, (team) => team.settings)
|
||||
team: Team;
|
||||
|
||||
@Column()
|
||||
key: TeamSettingType;
|
||||
|
||||
@Column()
|
||||
value: string;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([TeamSettingsModule])],
|
||||
})
|
||||
export class TeamSettingsModule {}
|
||||
Reference in New Issue
Block a user