feat: add admin tests read and update endpoints

This commit is contained in:
2026-06-06 13:33:56 +03:30
parent 39e6c96113
commit 28c1a4831e
31 changed files with 330 additions and 101 deletions
+6 -6
View File
@@ -11,7 +11,7 @@ import {
@Index(['phone', 'used'])
export class OTP {
@PrimaryGeneratedColumn()
id: number;
id!: number;
@Index()
@Column({
@@ -19,23 +19,23 @@ export class OTP {
length: 11,
nullable: false,
})
phone: string;
phone!: string;
@Column({
type: 'varchar',
nullable: false,
})
code: string;
code!: string;
@CreateDateColumn()
createdAt: Date;
createdAt!: Date;
@Index()
@Column({ type: 'timestamptz' })
expiresAt: Date;
expiresAt!: Date;
@Column({ type: 'boolean', default: false })
used: boolean;
used!: boolean;
@BeforeInsert()
setExpiry() {