-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(assets): Bulk mileage registration (#15774)
* Vehicle bulk mileage frontend * feat: omg it works * chore: remove logs * chore: nx format:write update dirty files * fix: more messsages * feat: bad csv parser * fix: failure calblack * feat: refactor logic * chore: nx format:write update dirty files * feat: better org * chore: update config * feat: update client * feat: update with mutation * feat: organize domain and add methods * feat: update domain * fix: better csv parsing * chore: label * chore: nx format:write update dirty files * feat: some ui * chore: nx format:write update dirty files * feat/clearer ui * chore: empty screen * fix: remove buttons * fix: expand callbacks * fix: linting * fix: expand lower * chore: remove console * chore: localize messages * chore: imports * fix: add logos * fix: parsing * fix: reveiw comments * chore: nx format:write update dirty files * fix: more review fixes * chore: review comment v3 * chore: fix func name * chore: review2 gp * chore: add error message * fix:nullechck * fix:review --------- Co-authored-by: Þórður Hafliðason <tolleinn@gmail.com> Co-authored-by: andes-it <builders@andes.is> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
5e1f11c
commit a0aecdf
Showing
76 changed files
with
3,209 additions
and
230 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
export * from './lib/api-domains-vehicles.module' | ||
export * from './lib/api-domains-vehicles.service' | ||
export * from './lib/vehicles.module' |
183 changes: 0 additions & 183 deletions
183
libs/api/domains/vehicles/src/lib/api-domains-vehicles.type.ts
This file was deleted.
Oops, something went wrong.
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,2 @@ | ||
export const ISLAND_IS_ORIGIN_CODE = 'ISLAND.IS' | ||
export const LOG_CATEGORY = 'api-domains-vehicles' |
7 changes: 7 additions & 0 deletions
7
libs/api/domains/vehicles/src/lib/dto/getBulkVehicleMileageRequestOverview.input.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 { Field, ID, InputType } from '@nestjs/graphql' | ||
|
||
@InputType() | ||
export class BulkVehicleMileageRequestOverviewInput { | ||
@Field(() => ID) | ||
guid!: string | ||
} |
7 changes: 7 additions & 0 deletions
7
libs/api/domains/vehicles/src/lib/dto/getBulkVehicleMileageRequestStatus.input.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 { Field, ID, InputType } from '@nestjs/graphql' | ||
|
||
@InputType() | ||
export class BulkVehicleMileageRequestStatusInput { | ||
@Field(() => ID) | ||
requestId!: string | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ | ||
export interface MileageReadingDto { | ||
isEditing: boolean | ||
canUserRegisterVehicleMileage?: boolean | ||
readings: Array<{ | ||
date?: Date | ||
origin?: string | ||
mileage?: number | ||
}> | ||
} |
22 changes: 22 additions & 0 deletions
22
libs/api/domains/vehicles/src/lib/dto/postBulkVehicleMileage.input.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,22 @@ | ||
import { Field, InputType } from '@nestjs/graphql' | ||
import { IsInt, IsString } from 'class-validator' | ||
|
||
@InputType() | ||
export class PostVehicleBulkMileageInput { | ||
@Field({ description: 'Example: "ISLAND.IS"' }) | ||
originCode!: string | ||
|
||
@Field(() => [PostVehicleBulkMileageSingleInput]) | ||
mileageData!: Array<PostVehicleBulkMileageSingleInput> | ||
} | ||
|
||
@InputType() | ||
export class PostVehicleBulkMileageSingleInput { | ||
@Field() | ||
@IsString() | ||
vehicleId!: string | ||
|
||
@Field() | ||
@IsInt() | ||
mileageNumber!: number | ||
} |
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
libs/api/domains/vehicles/src/lib/dto/vehiclesListInputV3.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,10 @@ | ||
import { Field, InputType } from '@nestjs/graphql' | ||
|
||
@InputType() | ||
export class VehiclesListInputV3 { | ||
@Field() | ||
pageSize!: number | ||
|
||
@Field() | ||
page!: number | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
13 changes: 13 additions & 0 deletions
13
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Field, ObjectType, ID } from '@nestjs/graphql' | ||
|
||
@ObjectType() | ||
export class VehiclesBulkMileageReadingResponse { | ||
@Field(() => ID, { | ||
description: | ||
'The GUID of the mileage registration post request. Used to fetch job status', | ||
}) | ||
requestId!: string | ||
|
||
@Field({ nullable: true }) | ||
errorMessage?: string | ||
} |
37 changes: 37 additions & 0 deletions
37
libs/api/domains/vehicles/src/lib/models/v3/bulkMileage/bulkMileageRegistrationJob.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,37 @@ | ||
import { Field, ObjectType, ID, GraphQLISODateTime } from '@nestjs/graphql' | ||
|
||
@ObjectType() | ||
export class VehiclesBulkMileageRegistrationJob { | ||
@Field(() => ID) | ||
guid!: string | ||
|
||
@Field({ nullable: true }) | ||
reportingPersonNationalId?: string | ||
|
||
@Field({ nullable: true }) | ||
reportingPersonName?: string | ||
|
||
@Field({ nullable: true }) | ||
originCode?: string | ||
|
||
@Field({ nullable: true }) | ||
originName?: string | ||
|
||
@Field(() => GraphQLISODateTime, { | ||
nullable: true, | ||
description: 'When was the bulk request requested?', | ||
}) | ||
dateRequested?: Date | ||
|
||
@Field(() => GraphQLISODateTime, { | ||
nullable: true, | ||
description: 'When did the bulk request start executing?', | ||
}) | ||
dateStarted?: Date | ||
|
||
@Field(() => GraphQLISODateTime, { | ||
nullable: true, | ||
description: 'When did the bulk request execution finish', | ||
}) | ||
dateFinished?: Date | ||
} |
8 changes: 8 additions & 0 deletions
8
...domains/vehicles/src/lib/models/v3/bulkMileage/bulkMileageRegistrationJobHistory.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,8 @@ | ||
import { Field, ObjectType } from '@nestjs/graphql' | ||
import { VehiclesBulkMileageRegistrationJob } from './bulkMileageRegistrationJob.model' | ||
|
||
@ObjectType() | ||
export class VehiclesBulkMileageRegistrationJobHistory { | ||
@Field(() => [VehiclesBulkMileageRegistrationJob]) | ||
history!: Array<VehiclesBulkMileageRegistrationJob> | ||
} |
22 changes: 22 additions & 0 deletions
22
...ains/vehicles/src/lib/models/v3/bulkMileage/bulkMileageRegistrationRequestDetail.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,22 @@ | ||
import { Field, ObjectType, ID, Int } from '@nestjs/graphql' | ||
import { VehiclesBulkMileageRegistrationRequestError } from './bulkMileageRegistrationRequestError.model' | ||
|
||
@ObjectType() | ||
export class VehiclesBulkMileageRegistrationRequestDetail { | ||
@Field(() => ID) | ||
guid!: string | ||
|
||
@Field() | ||
vehicleId!: string | ||
|
||
@Field(() => Int, { nullable: true }) | ||
mileage?: number | ||
|
||
@Field({ nullable: true }) | ||
returnCode?: string | ||
|
||
@Field(() => [VehiclesBulkMileageRegistrationRequestError], { | ||
nullable: true, | ||
}) | ||
errors?: Array<VehiclesBulkMileageRegistrationRequestError> | ||
} |
10 changes: 10 additions & 0 deletions
10
...mains/vehicles/src/lib/models/v3/bulkMileage/bulkMileageRegistrationRequestError.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,10 @@ | ||
import { Field, ObjectType } from '@nestjs/graphql' | ||
|
||
@ObjectType() | ||
export class VehiclesBulkMileageRegistrationRequestError { | ||
@Field({ nullable: true }) | ||
code?: string | ||
|
||
@Field({ nullable: true }) | ||
message?: string | ||
} |
8 changes: 8 additions & 0 deletions
8
...ns/vehicles/src/lib/models/v3/bulkMileage/bulkMileageRegistrationRequestOverview.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,8 @@ | ||
import { Field, ObjectType } from '@nestjs/graphql' | ||
import { VehiclesBulkMileageRegistrationRequestDetail } from './bulkMileageRegistrationRequestDetail.model' | ||
|
||
@ObjectType() | ||
export class VehiclesBulkMileageRegistrationRequestOverview { | ||
@Field(() => [VehiclesBulkMileageRegistrationRequestDetail]) | ||
requests!: Array<VehiclesBulkMileageRegistrationRequestDetail> | ||
} |
Oops, something went wrong.