improve response, fix integration tests
This commit is contained in:
parent
d0285e265e
commit
3bc142f4f7
|
@ -1,7 +1,7 @@
|
|||
import { StepResponseDto } from './step.response.dto';
|
||||
|
||||
export class JourneyResponseDto {
|
||||
weekday: number;
|
||||
day: number;
|
||||
firstDate: string;
|
||||
lastDate: string;
|
||||
steps: StepResponseDto[];
|
||||
|
|
|
@ -69,7 +69,7 @@ message Match {
|
|||
}
|
||||
|
||||
message Journey {
|
||||
int32 weekday = 1;
|
||||
int32 day = 1;
|
||||
string firstDate = 2;
|
||||
string lastDate = 3;
|
||||
repeated Step steps = 4;
|
||||
|
|
|
@ -29,7 +29,7 @@ export class MatchMapper {
|
|||
distanceDetourPercentage: match.getProps().distanceDetourPercentage,
|
||||
durationDetourPercentage: match.getProps().durationDetourPercentage,
|
||||
journeys: match.getProps().journeys.map((journey: Journey) => ({
|
||||
weekday: new Date(
|
||||
day: new Date(
|
||||
this.outputDatetimeTransformer.fromDate(
|
||||
{
|
||||
date: journey.firstDate.toISOString().split('T')[0],
|
||||
|
|
|
@ -89,12 +89,10 @@ describe('Ad Repository', () => {
|
|||
strict: false,
|
||||
waypoints: [
|
||||
{
|
||||
position: 0,
|
||||
lon: 43.7102,
|
||||
lat: 7.262,
|
||||
},
|
||||
{
|
||||
position: 1,
|
||||
lon: 43.2965,
|
||||
lat: 5.3698,
|
||||
},
|
||||
|
@ -126,7 +124,7 @@ describe('Ad Repository', () => {
|
|||
};
|
||||
|
||||
const adToCreate: AdEntity = AdEntity.create(createAdProps);
|
||||
await adRepository.insertWithUnsupportedFields(adToCreate, 'ad');
|
||||
await adRepository.insertExtra(adToCreate, 'ad');
|
||||
|
||||
const afterCount = await prismaService.ad.count();
|
||||
|
||||
|
@ -175,12 +173,10 @@ describe('Ad Repository', () => {
|
|||
strict: false,
|
||||
waypoints: [
|
||||
{
|
||||
position: 0,
|
||||
lon: 43.7102,
|
||||
lat: 7.262,
|
||||
},
|
||||
{
|
||||
position: 1,
|
||||
lon: 43.2965,
|
||||
lat: 5.3698,
|
||||
},
|
||||
|
@ -212,7 +208,7 @@ describe('Ad Repository', () => {
|
|||
};
|
||||
|
||||
const adToCreate: AdEntity = AdEntity.create(createAdProps);
|
||||
await adRepository.insertWithUnsupportedFields(adToCreate, 'ad');
|
||||
await adRepository.insertExtra(adToCreate, 'ad');
|
||||
|
||||
const afterCount = await prismaService.ad.count();
|
||||
|
||||
|
|
Loading…
Reference in New Issue