Skip to content
Snippets Groups Projects
Commit e08e1147 authored by Etienne LOUPIAS's avatar Etienne LOUPIAS
Browse files

add FindOrientationDto

parent f6069f3b
No related branches found
No related tags found
1 merge request!479Draft: feat(dashboard) : create dashboard !
Pipeline #123777 passed
import { IOrientation } from '../interfaces/orientation.interface';
export class FindOrientationDto {
myOrientations: { inProgress: IOrientation[]; history: IOrientation[] };
todoOrientations: { inProgress: IOrientation[]; history: IOrientation[] };
}
......@@ -56,7 +56,7 @@ class DateSlotDto {
hours: string;
}
export class customStructureDto {
export class CustomStructureDto {
@ApiProperty()
@IsString()
@IsNotEmpty()
......@@ -132,9 +132,9 @@ export class OrientationDto {
@IsString()
orientator?: string;
@ApiPropertyOptional({ type: () => customStructureDto })
@Type(() => customStructureDto)
structureOrientator: string | customStructureDto;
@ApiPropertyOptional({ type: () => CustomStructureDto })
@Type(() => CustomStructureDto)
structureOrientator: string | CustomStructureDto;
@ApiProperty({ enum: ['pending', 'acknowledged', 'completed', 'uncompleted', 'expired'] })
@IsNotEmpty()
......
import { HttpException, HttpStatus, Injectable, Logger } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import mongoose, { Model } from 'mongoose';
import { customStructureDto, OrientationDto } from './dto/orientation.dto';
import { CustomStructureDto, OrientationDto } from './dto/orientation.dto';
import { IOrientation } from './interfaces/orientation.interface';
import { Orientation, OrientationDocument } from './orientation.schema';
import { CategoriesService } from '../categories/services/categories.service';
import { UsersService } from '../users/services/users.service';
import { FindOrientationDto } from './dto/findOrientation.dto';
@Injectable()
export class OrientationService {
......@@ -37,7 +38,7 @@ export class OrientationService {
}
}
public async find(userId: string, structureId: string = null): Promise<any> {
public async find(userId: string, structureId: string = null): Promise<FindOrientationDto> {
try {
const historyStatus = ['completed', 'uncompleted', 'expired'];
let myOrientationsFilters;
......@@ -110,7 +111,7 @@ export class OrientationService {
/**
* Helper method to populate structure by ID
*/
private async populateStructureById(structureId: string): Promise<string | customStructureDto | null> {
private async populateStructureById(structureId: string): Promise<string | CustomStructureDto | null> {
try {
const structure = await this.OrientationModel.db
.collection('structures')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment