AI Implementation feature(861): Admin Area Challenges: List, Import/Export and Add/Edit Modal (#40)

This commit was merged in pull request #40.
This commit is contained in:
2026-07-22 20:26:30 +00:00
parent 1a40e5708a
commit 8dcbd48045
41 changed files with 4548 additions and 145 deletions
+23 -1
View File
@@ -1,4 +1,13 @@
import { Entity, PrimaryColumn, Column, Index, Unique } from 'typeorm';
import {
Entity,
PrimaryColumn,
Column,
Index,
Unique,
ManyToOne,
JoinColumn,
} from 'typeorm';
import { ChallengeEntity } from './challenge.entity';
@Entity('solve')
@Unique('uq_solve_challenge_user', ['challengeId', 'userId'])
@@ -11,6 +20,10 @@ export class SolveEntity {
@Column('text', { name: 'challenge_id' })
challengeId!: string;
@ManyToOne(() => ChallengeEntity, { onDelete: 'CASCADE' })
@JoinColumn({ name: 'challenge_id' })
challenge?: ChallengeEntity;
@Column('text', { name: 'user_id' })
userId!: string;
@@ -25,4 +38,13 @@ export class SolveEntity {
@Column('integer', { name: 'rank_bonus', default: 0 })
rankBonus!: number;
@Column('integer', { name: 'is_first', default: 0 })
isFirst!: boolean;
@Column('integer', { name: 'is_second', default: 0 })
isSecond!: boolean;
@Column('integer', { name: 'is_third', default: 0 })
isThird!: boolean;
}