refactor
This commit is contained in:
parent
dd957763a3
commit
a30b19e2f3
|
@ -1,6 +1,6 @@
|
|||
import { Injectable } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { IDefaultParams } from '../../domain/interfaces/default-params.type';
|
||||
import { IDefaultParams } from '../../domain/types/default-params.type';
|
||||
|
||||
@Injectable()
|
||||
export class DefaultParamsProvider {
|
||||
|
|
|
@ -10,10 +10,10 @@ import {
|
|||
Min,
|
||||
} from 'class-validator';
|
||||
import { AutoMap } from '@automapper/classes';
|
||||
import { Point } from '../entities/point.type';
|
||||
import { Schedule } from '../entities/schedule.type';
|
||||
import { MarginDurations } from '../entities/margin-durations.type';
|
||||
import { Algorithm } from './algorithm.enum';
|
||||
import { Point } from '../types/point.type';
|
||||
import { Schedule } from '../types/schedule.type';
|
||||
import { MarginDurations } from '../types/margin-durations.type';
|
||||
import { Algorithm } from '../types/algorithm.enum';
|
||||
import { IRequestTime } from '../interfaces/time-request.interface';
|
||||
import { IRequestPerson } from '../interfaces/person-request.interface';
|
||||
import { IRequestGeography } from '../interfaces/geography-request.interface';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Algorithm } from '../dtos/algorithm.enum';
|
||||
import { IRequestAlgorithmSettings } from '../interfaces/algorithm-settings-request.interface';
|
||||
import { DefaultAlgorithmSettings } from '../interfaces/default-algorithm-settings.type';
|
||||
import { TimingFrequency } from './timing';
|
||||
import { DefaultAlgorithmSettings } from '../types/default-algorithm-settings.type';
|
||||
import { Algorithm } from '../types/algorithm.enum';
|
||||
import { TimingFrequency } from '../types/timing';
|
||||
|
||||
export class AlgorithmSettings {
|
||||
_algorithmSettingsRequest: IRequestAlgorithmSettings;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { MatcherException } from '../../exceptions/matcher.exception';
|
||||
import { IRequestGeography } from '../interfaces/geography-request.interface';
|
||||
import { PointType } from './geography.enum';
|
||||
import { Point } from './point.type';
|
||||
import { PointType } from '../types/geography.enum';
|
||||
import { Point } from '../types/point.type';
|
||||
import { Route } from './route';
|
||||
import { find } from 'geo-tz';
|
||||
import { Waypoint } from './waypoint';
|
||||
import { Waypoint } from '../types/waypoint';
|
||||
|
||||
export class Geography {
|
||||
_geographyRequest: IRequestGeography;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { MatcherException } from '../../exceptions/matcher.exception';
|
||||
import { MarginDurations } from './margin-durations.type';
|
||||
import { MarginDurations } from '../types/margin-durations.type';
|
||||
import { IRequestTime } from '../interfaces/time-request.interface';
|
||||
import { TimingDays, TimingFrequency, Days } from './timing';
|
||||
import { Schedule } from './schedule.type';
|
||||
import { TimingDays, TimingFrequency, Days } from '../types/timing';
|
||||
import { Schedule } from '../types/schedule.type';
|
||||
|
||||
export class Time {
|
||||
_timeRequest: IRequestTime;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Algorithm } from '../dtos/algorithm.enum';
|
||||
import { Algorithm } from '../types/algorithm.enum';
|
||||
|
||||
export interface IRequestAlgorithmSettings {
|
||||
algorithm: Algorithm;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Point } from '../entities/point.type';
|
||||
import { Point } from '../types/point.type';
|
||||
|
||||
export interface IRequestGeography {
|
||||
waypoints: Array<Point>;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { MarginDurations } from '../entities/margin-durations.type';
|
||||
import { Schedule } from '../entities/schedule.type';
|
||||
import { MarginDurations } from '../types/margin-durations.type';
|
||||
import { Schedule } from '../types/schedule.type';
|
||||
|
||||
export interface IRequestTime {
|
||||
departure?: string;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Person } from './person';
|
||||
import { Person } from '../entities/person';
|
||||
import { Role } from './role.enum';
|
||||
import { Step } from './step.enum';
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { Algorithm } from '../dtos/algorithm.enum';
|
||||
import { Algorithm } from './algorithm.enum';
|
||||
|
||||
export type DefaultAlgorithmSettings = {
|
||||
algorithm: Algorithm;
|
|
@ -1,4 +1,4 @@
|
|||
import { Actor } from './actor';
|
||||
import { Actor } from './actor.type.';
|
||||
import { Point } from './point.type';
|
||||
|
||||
export type Waypoint = {
|
|
@ -2,10 +2,10 @@ import { MatchRequest } from '../domain/dtos/match.request';
|
|||
import { Geography } from '../domain/entities/geography';
|
||||
import { Person } from '../domain/entities/person';
|
||||
import { Requirement } from '../domain/entities/requirement';
|
||||
import { Role } from '../domain/entities/role.enum';
|
||||
import { Role } from '../domain/types/role.enum';
|
||||
import { AlgorithmSettings } from '../domain/entities/algorithm-settings';
|
||||
import { Time } from '../domain/entities/time';
|
||||
import { IDefaultParams } from '../domain/interfaces/default-params.type';
|
||||
import { IDefaultParams } from '../domain/types/default-params.type';
|
||||
|
||||
export class MatchQuery {
|
||||
private readonly _matchRequest: MatchRequest;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { ConfigService } from '@nestjs/config';
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { DefaultParamsProvider } from '../../adapters/secondaries/default-params.provider';
|
||||
import { IDefaultParams } from '../../domain/interfaces/default-params.type';
|
||||
import { IDefaultParams } from '../../domain/types/default-params.type';
|
||||
|
||||
const mockConfigService = {
|
||||
get: jest.fn().mockImplementationOnce(() => 99),
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Algorithm } from '../../domain/dtos/algorithm.enum';
|
||||
import { MatchRequest } from '../../domain/dtos/match.request';
|
||||
import { Role } from '../../domain/entities/role.enum';
|
||||
import { TimingFrequency } from '../../domain/entities/timing';
|
||||
import { IDefaultParams } from '../../domain/interfaces/default-params.type';
|
||||
import { Role } from '../../domain/types/role.enum';
|
||||
import { TimingFrequency } from '../../domain/types/timing';
|
||||
import { IDefaultParams } from '../../domain/types/default-params.type';
|
||||
import { MatchQuery } from '../../queries/match.query';
|
||||
import { Algorithm } from '../../domain/types/algorithm.enum';
|
||||
|
||||
const defaultParams: IDefaultParams = {
|
||||
DEFAULT_IDENTIFIER: 0,
|
||||
|
|
|
@ -6,8 +6,8 @@ import { MatchQuery } from '../../queries/match.query';
|
|||
import { AdRepository } from '../../adapters/secondaries/ad.repository';
|
||||
import { AutomapperModule } from '@automapper/nestjs';
|
||||
import { classes } from '@automapper/classes';
|
||||
import { IDefaultParams } from '../../domain/interfaces/default-params.type';
|
||||
import { Algorithm } from '../../domain/dtos/algorithm.enum';
|
||||
import { IDefaultParams } from '../../domain/types/default-params.type';
|
||||
import { Algorithm } from '../../domain/types/algorithm.enum';
|
||||
|
||||
const mockAdRepository = {};
|
||||
|
||||
|
|
Loading…
Reference in New Issue