-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(bulk-mileage): update bulk mileage (#16539)
* fix: add xlsx * fix: support xlsx * feat: parse and display errors * fix: coderabbit grilling session * chore: prettier button * chore: remove imports * chore: more rabbit grilling * chore: switch in csv-pasre * fix: parse * fix: handle 429 * chore: update message * fix: use service error * feat: fix reveiw errors * fix: standard error handling * fix: bunny comments * feat: add search --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
3c56c86
commit 0947e07
Showing
18 changed files
with
598 additions
and
249 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
libs/api/domains/vehicles/src/lib/dto/updateResponseError.dto.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,12 @@ | ||
export interface UpdateResponseError { | ||
type: string | ||
title: string | ||
status: number | ||
Errors: Array<{ | ||
lookupNo: number | ||
warnSever: string | ||
errorMess: string | ||
permno: string | ||
warningSerialNumber: string | ||
}> | ||
} |
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 |
---|---|---|
|
@@ -7,4 +7,7 @@ export class VehiclesListInputV3 { | |
|
||
@Field() | ||
page!: number | ||
|
||
@Field({ nullable: true }) | ||
query?: string | ||
} |
8 changes: 6 additions & 2 deletions
8
libs/api/domains/vehicles/src/lib/models/v3/bulkMileage/bulkMileageReadingResponse.model.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
15 changes: 15 additions & 0 deletions
15
libs/api/domains/vehicles/src/lib/models/v3/postVehicleMileageResponse.model.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,15 @@ | ||
import { createUnionType } from '@nestjs/graphql' | ||
import { VehicleMileageDetail } from '../getVehicleMileage.model' | ||
import { VehiclesMileageUpdateError } from './vehicleMileageResponseError.model' | ||
|
||
export const VehicleMileagePostResponse = createUnionType({ | ||
name: 'VehicleMileagePostResponse', | ||
types: () => [VehicleMileageDetail, VehiclesMileageUpdateError] as const, | ||
resolveType(value) { | ||
if ('permno' in value && value.permno !== undefined) { | ||
return VehicleMileageDetail | ||
} | ||
|
||
return VehiclesMileageUpdateError | ||
}, | ||
}) |
15 changes: 15 additions & 0 deletions
15
libs/api/domains/vehicles/src/lib/models/v3/putVehicleMileageResponse.model.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,15 @@ | ||
import { createUnionType } from '@nestjs/graphql' | ||
import { VehicleMileagePutModel } from '../getVehicleMileage.model' | ||
import { VehiclesMileageUpdateError } from './vehicleMileageResponseError.model' | ||
|
||
export const VehicleMileagePutResponse = createUnionType({ | ||
name: 'VehicleMileagePutResponse', | ||
types: () => [VehicleMileagePutModel, VehiclesMileageUpdateError] as const, | ||
resolveType(value) { | ||
if ('permno' in value && value.permno !== undefined) { | ||
return VehicleMileagePutModel | ||
} | ||
|
||
return VehiclesMileageUpdateError | ||
}, | ||
}) |
14 changes: 14 additions & 0 deletions
14
libs/api/domains/vehicles/src/lib/models/v3/vehicleMileageResponseError.model.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,14 @@ | ||
import { Field, Int, ObjectType } from '@nestjs/graphql' | ||
import GraphQLJSON from 'graphql-type-json' | ||
|
||
@ObjectType() | ||
export class VehiclesMileageUpdateError { | ||
@Field() | ||
message!: string | ||
|
||
@Field(() => Int, { nullable: true }) | ||
code?: number | ||
|
||
@Field(() => GraphQLJSON, { nullable: true }) | ||
error?: string | ||
} |
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
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
Oops, something went wrong.