fix: fix some changes

This commit is contained in:
2026-07-13 17:04:00 +03:30
parent 4e4731dbde
commit 4e400d79e8
8 changed files with 39 additions and 22 deletions
@@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class AnswerSubmissionV21783945681366 implements MigrationInterface {
name = 'AnswerSubmissionV21783945681366'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "test" ADD "questionsCount" integer NOT NULL DEFAULT '0'`);
await queryRunner.query(`ALTER TABLE "submission" ADD "currentQuestionOrder" integer NOT NULL DEFAULT '1'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "submission" DROP COLUMN "currentQuestionOrder"`);
await queryRunner.query(`ALTER TABLE "test" DROP COLUMN "questionsCount"`);
}
}
@@ -3,9 +3,9 @@ Authorization: Bearer {{$global.accessToken}}
Content-Type: application/json Content-Type: application/json
{ {
"question": 4, "question": 2,
"text": "Option 2", "text": "Option 3",
"value": 1, "value": 3,
"order": 2, "order": 3,
"score": 2 "score": 6
} }
@@ -3,12 +3,11 @@ Authorization: Bearer {{$global.accessToken}}
Content-Type: application/json Content-Type: application/json
{ {
"test": 4, "test": 1,
"content": "سوال پنجم", "content": "سوال سوم",
"order": 4,
"required": true, "required": true,
"type": "numeric", "type": "numeric",
"metadata": { "min": 1, "max": 100 } "metadata": { "min": 1, "max": 20 }
} }
POST {{baseUrl}}/admin/questions/range-rules POST {{baseUrl}}/admin/questions/range-rules
@@ -16,8 +15,8 @@ Authorization: Bearer {{$global.accessToken}}
Content-Type: application/json Content-Type: application/json
{ {
"question": 8, "question": 3,
"min": 1, "min": 1,
"max": 5, "max": 10,
"score": 7 "score": 10
} }
@@ -3,9 +3,8 @@ Content-Type: application/json
Authorization: Bearer {{$global.accessToken}} Authorization: Bearer {{$global.accessToken}}
{ {
"title": "Test Five", "title": "Test One",
"description": "Description Five", "description": "Description One",
"accessType": "login", "accessType": "login",
"price": "1234000",
"isActive": true "isActive": true
} }
@@ -2,8 +2,8 @@ POST {{baseUrl}}/auth/verify-otp
Content-Type: application/json Content-Type: application/json
{ {
"phone": "09365858721", "phone": "09333026363",
"otp": "40023" "otp": "87074"
} }
{{ {{
+2 -1
View File
@@ -52,8 +52,9 @@ export class LoginProvider {
return { return {
newUser: true, newUser: true,
message, message,
otpExpiresAt: otpCode.expiresAt,
// Just for development // Just for development
code: otpCode, code: otpCode.code,
}; };
} }
+4 -2
View File
@@ -32,7 +32,9 @@ export class OtpService {
/** /**
* Create new OTP record * Create new OTP record
*/ */
public async createOTP(phone: string): Promise<string> { public async createOTP(
phone: string,
): Promise<{ code: string; expiresAt: Date }> {
// OTP request Rate limit // OTP request Rate limit
const lastOTP = await this.otpRepository.findOne({ const lastOTP = await this.otpRepository.findOne({
where: { phone }, where: { phone },
@@ -54,7 +56,7 @@ export class OtpService {
await this.otpRepository.save(otp); await this.otpRepository.save(otp);
return code; return { code, expiresAt: otp.expiresAt };
} }
/** /**
@@ -4,8 +4,8 @@ Authorization: Bearer {{$global.accessToken}}
lang: fa lang: fa
{ {
"firstName": "تست", "firstName": "رادمهر",
"lastName": "تستعلی", "lastName": "ترناس",
"password": "Password1@", "password": "Password1@",
"confirmPassword": "Password1@" "confirmPassword": "Password1@"
} }