Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(assets): Bulk mileage registration #15774

Merged
merged 66 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
9a54d91
Vehicle bulk mileage frontend
thordurhhh Aug 14, 2024
8197de7
feat: omg it works
thorkellmani Aug 23, 2024
4a2d39c
chore: remove logs
thorkellmani Aug 23, 2024
10a8eb7
chore: nx format:write update dirty files
andes-it Aug 23, 2024
783be7b
fix: more messsages
thorkellmani Aug 26, 2024
b4499d9
Merge branch 'main' into feat/bulk-second-try
thorkellmani Aug 26, 2024
e9fc495
feat: bad csv parser
thorkellmani Aug 26, 2024
4e05b03
fix: failure calblack
thorkellmani Aug 26, 2024
adbb46c
feat: refactor logic
thorkellmani Aug 27, 2024
ee91602
chore: nx format:write update dirty files
andes-it Aug 27, 2024
1d437a0
feat: better org
thorkellmani Aug 27, 2024
d6f46ff
Merge remote-tracking branch 'refs/remotes/origin/feat/bulk-second-tr…
thorkellmani Aug 27, 2024
5735bcb
Merge branch 'main' into feat/bulk-second-try
thorkellmani Aug 27, 2024
26dc7aa
Merge branch 'main' into feat/bulk-second-try
thorkellmani Aug 27, 2024
7f9d923
Merge branch 'main' into feat/bulk-second-try
thorkellmani Sep 4, 2024
ce31dba
chore: update config
thorkellmani Sep 4, 2024
348d96f
feat: update client
thorkellmani Sep 5, 2024
614e182
feat: update with mutation
thorkellmani Sep 5, 2024
fbb5610
feat: organize domain and add methods
thorkellmani Sep 6, 2024
027374f
Merge branch 'main' into feat/bulk-second-try
thorkellmani Sep 6, 2024
34c12b6
Merge branch 'main' into feat/bulk-second-try
thorkellmani Sep 7, 2024
adff0aa
feat: update domain
thorkellmani Sep 9, 2024
1359797
fix: better csv parsing
thorkellmani Sep 9, 2024
f870e5a
chore: label
thorkellmani Sep 9, 2024
290c070
chore: nx format:write update dirty files
andes-it Sep 9, 2024
10d5cc4
feat: some ui
thorkellmani Sep 10, 2024
831fe69
Merge remote-tracking branch 'refs/remotes/origin/feat/bulk-second-tr…
thorkellmani Sep 10, 2024
46d1648
chore: nx format:write update dirty files
andes-it Sep 10, 2024
a3b951b
feat/clearer ui
thorkellmani Sep 10, 2024
8e769c6
Merge remote-tracking branch 'refs/remotes/origin/feat/bulk-second-tr…
thorkellmani Sep 10, 2024
5fb7187
chore: empty screen
thorkellmani Sep 11, 2024
2b743fa
fix: remove buttons
thorkellmani Sep 11, 2024
fb29651
fix: expand callbacks
thorkellmani Sep 11, 2024
d39c692
fix: linting
thorkellmani Sep 11, 2024
e25bb95
Merge branch 'main' into feat/bulk-second-try
thorkellmani Sep 12, 2024
852896d
Merge branch 'main' into feat/bulk-second-try
thorkellmani Sep 13, 2024
faa878e
Merge branch 'main' into feat/bulk-second-try
thorkellmani Sep 17, 2024
6c22b73
Merge branch 'main' into feat/bulk-second-try
thorkellmani Sep 17, 2024
5df77f8
fix: expand lower
thorkellmani Sep 17, 2024
4217f49
chore: remove console
thorkellmani Sep 17, 2024
c82f5b0
chore: localize messages
thorkellmani Sep 17, 2024
86b7f63
chore: imports
thorkellmani Sep 18, 2024
00c91ea
Merge branch 'main' into feat/bulk-second-try
thorkellmani Sep 18, 2024
8eb4037
fix: add logos
thorkellmani Sep 18, 2024
71eadc7
Merge remote-tracking branch 'refs/remotes/origin/feat/bulk-second-tr…
thorkellmani Sep 18, 2024
a6174a0
Merge branch 'main' into feat/bulk-second-try
thorkellmani Sep 20, 2024
7f86505
Merge branch 'main' into feat/bulk-second-try
thorkellmani Sep 20, 2024
f5079be
Merge branch 'main' into feat/bulk-second-try
thorkellmani Sep 24, 2024
af4a065
Merge branch 'main' into feat/bulk-second-try
thorkellmani Sep 25, 2024
f92d563
fix: parsing
thorkellmani Sep 25, 2024
e32dccd
Merge branch 'main' into feat/bulk-second-try
thorkellmani Sep 25, 2024
825e271
Merge branch 'main' into feat/bulk-second-try
thorkellmani Sep 26, 2024
6b3efb8
fix: reveiw comments
thorkellmani Sep 27, 2024
ef61a0d
Merge remote-tracking branch 'refs/remotes/origin/feat/bulk-second-tr…
thorkellmani Sep 27, 2024
9e2de6b
chore: nx format:write update dirty files
andes-it Sep 27, 2024
977a7c3
Merge branch 'main' into feat/bulk-second-try
thorkellmani Sep 27, 2024
6567e2e
fix: more review fixes
thorkellmani Sep 27, 2024
45d3d51
chore: review comment v3
thorkellmani Sep 27, 2024
5dbdf67
chore: fix func name
thorkellmani Sep 27, 2024
f3e918f
chore: review2
thorkellmani Sep 27, 2024
1675f7b
chore: add error message
thorkellmani Sep 27, 2024
642ed95
fix:nullechck
thorkellmani Sep 27, 2024
8a3a792
fix:review
thorkellmani Sep 27, 2024
d00c0c2
Merge branch 'main' into feat/bulk-second-try
kodiakhq[bot] Sep 27, 2024
c106528
Merge branch 'main' into feat/bulk-second-try
thorkellmani Sep 29, 2024
44e1bc0
Merge branch 'main' into feat/bulk-second-try
kodiakhq[bot] Sep 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions libs/api/domains/vehicles/src/index.ts
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 libs/api/domains/vehicles/src/lib/api-domains-vehicles.type.ts

This file was deleted.

2 changes: 2 additions & 0 deletions libs/api/domains/vehicles/src/lib/constants.ts
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'
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
}
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
}
9 changes: 9 additions & 0 deletions libs/api/domains/vehicles/src/lib/dto/mileageReading.dto.ts
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
}>
}
thorkellmani marked this conversation as resolved.
Show resolved Hide resolved
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
}
10 changes: 10 additions & 0 deletions libs/api/domains/vehicles/src/lib/dto/vehiclesListInputV3.ts
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
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Field, ObjectType } from '@nestjs/graphql'
import { VehicleMileageDetail } from './getVehicleMileage.model'

@ObjectType()
export class NextInspection {
Expand All @@ -11,6 +12,7 @@ export class NextInspection {
})
nextinspectiondateIfPassedInspectionToday?: Date
}

@ObjectType()
export class VehiclesVehicle {
@Field({ nullable: true })
Expand Down Expand Up @@ -243,6 +245,12 @@ export class VehicleListed {

@Field({ nullable: true })
nextMainInspection?: Date

@Field(() => VehicleMileageDetail, { nullable: true })
lastMileageRegistration?: VehicleMileageDetail

@Field(() => [VehicleMileageDetail], { nullable: true })
mileageRegistrationHistory?: Array<VehicleMileageDetail>
}

@ObjectType()
Expand Down
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
}
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
}
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>
}
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>
}
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
}
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>
}
Loading
Loading