-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'P2-1109-User-story-7-Tracking-Quality-Assessed-status-i…
…n-PRMS-Reporting-Tool' into dev
- Loading branch information
Showing
11 changed files
with
184 additions
and
31 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
onecgiar-pr-server/src/api/result-qaed/entities/result-qaed-log.entity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { | ||
Column, | ||
Entity, | ||
JoinColumn, | ||
ManyToOne, | ||
PrimaryGeneratedColumn, | ||
} from 'typeorm'; | ||
import { User } from '../../../auth/modules/user/entities/user.entity'; | ||
import { Result } from '../../results/entities/result.entity'; | ||
|
||
@Entity('result_qaed_log') | ||
export class ResultQaedLog { | ||
@PrimaryGeneratedColumn({ | ||
name: 'id', | ||
type: 'bigint', | ||
}) | ||
id: number; | ||
|
||
@Column({ | ||
name: 'result_id', | ||
type: 'bigint', | ||
}) | ||
result_id: number; | ||
|
||
@Column({ | ||
name: 'qaed_date', | ||
type: 'date', | ||
}) | ||
qaed_date: Date; | ||
|
||
@Column({ | ||
name: 'qaed_comments', | ||
type: 'text', | ||
nullable: true, | ||
}) | ||
qaed_comments: string; | ||
|
||
@Column({ | ||
name: 'qaed_user', | ||
type: 'bigint', | ||
}) | ||
qaed_user: number; | ||
|
||
@ManyToOne(() => Result, (r) => r.obj_result_qaed, { nullable: true }) | ||
@JoinColumn({ | ||
name: 'result_id', | ||
}) | ||
obj_result_id_qaed: Result; | ||
|
||
@ManyToOne(() => User, (u) => u.obj_qaed_user, { nullable: true }) | ||
@JoinColumn({ | ||
name: 'qaed_user', | ||
}) | ||
obj_qaed_user: User; | ||
} |
20 changes: 20 additions & 0 deletions
20
onecgiar-pr-server/src/api/result-qaed/result-qaed.controller.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { ResultQaedController } from './result-qaed.controller'; | ||
import { ResultQaedService } from './result-qaed.service'; | ||
|
||
describe('ResultQaedController', () => { | ||
let controller: ResultQaedController; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [ResultQaedController], | ||
providers: [ResultQaedService], | ||
}).compile(); | ||
|
||
controller = module.get<ResultQaedController>(ResultQaedController); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(controller).toBeDefined(); | ||
}); | ||
}); |
7 changes: 7 additions & 0 deletions
7
onecgiar-pr-server/src/api/result-qaed/result-qaed.controller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Controller } from '@nestjs/common'; | ||
import { ResultQaedService } from './result-qaed.service'; | ||
|
||
@Controller('result-qaed') | ||
export class ResultQaedController { | ||
constructor(private readonly resultQaedService: ResultQaedService) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { ResultQaedService } from './result-qaed.service'; | ||
import { ResultQaedController } from './result-qaed.controller'; | ||
|
||
@Module({ | ||
controllers: [ResultQaedController], | ||
providers: [ResultQaedService], | ||
}) | ||
export class ResultQaedModule {} |
18 changes: 18 additions & 0 deletions
18
onecgiar-pr-server/src/api/result-qaed/result-qaed.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { ResultQaedService } from './result-qaed.service'; | ||
|
||
describe('ResultQaedService', () => { | ||
let service: ResultQaedService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [ResultQaedService], | ||
}).compile(); | ||
|
||
service = module.get<ResultQaedService>(ResultQaedService); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(service).toBeDefined(); | ||
}); | ||
}); |
4 changes: 4 additions & 0 deletions
4
onecgiar-pr-server/src/api/result-qaed/result-qaed.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
|
||
@Injectable() | ||
export class ResultQaedService {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
onecgiar-pr-server/src/migrations/1731503453561-RemovedQATrackingFieldsFromResult.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class RemovedQATrackingFieldsFromResult1731503453561 | ||
implements MigrationInterface | ||
{ | ||
name = 'RemovedQATrackingFieldsFromResult1731503453561'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE \`result\` DROP FOREIGN KEY \`FK_ff2513072e955aacb72e9041790\``, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE \`result\` DROP COLUMN \`qaed_comment\``, | ||
); | ||
await queryRunner.query(`ALTER TABLE \`result\` DROP COLUMN \`qaed_date\``); | ||
await queryRunner.query(`ALTER TABLE \`result\` DROP COLUMN \`qaed_user\``); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE \`result\` ADD \`qaed_user\` int NULL`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE \`result\` ADD \`qaed_date\` timestamp NULL`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE \`result\` ADD \`qaed_comment\` text COLLATE "utf8mb3_unicode_ci" NULL`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE \`result\` ADD CONSTRAINT \`FK_ff2513072e955aacb72e9041790\` FOREIGN KEY (\`qaed_user\`) REFERENCES \`users\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`, | ||
); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
onecgiar-pr-server/src/migrations/1731504619556-AddedResultQAedLogTable.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class AddedResultQAedLogTable1731504619556 | ||
implements MigrationInterface | ||
{ | ||
name = 'AddedResultQAedLogTable1731504619556'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`CREATE TABLE \`result_qaed_log\` (\`id\` bigint NOT NULL AUTO_INCREMENT, \`result_id\` bigint NOT NULL, \`qaed_date\` date NOT NULL, \`qaed_comments\` text NULL, \`qaed_user\` int NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE \`result_qaed_log\` ADD CONSTRAINT \`FK_9935d4ce4da5bb7b26cee090987\` FOREIGN KEY (\`result_id\`) REFERENCES \`result\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE \`result_qaed_log\` ADD CONSTRAINT \`FK_bee9006e35c169af6033da52a04\` FOREIGN KEY (\`qaed_user\`) REFERENCES \`users\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`, | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE \`result_qaed_log\` DROP FOREIGN KEY \`FK_bee9006e35c169af6033da52a04\``, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE \`result_qaed_log\` DROP FOREIGN KEY \`FK_9935d4ce4da5bb7b26cee090987\``, | ||
); | ||
await queryRunner.query(`DROP TABLE \`result_qaed_log\``); | ||
} | ||
} |