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

ORV2-387 Formatting and linting #145

Merged
merged 1 commit into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { ApiProperty } from '@nestjs/swagger';

export class CreatePowerUnitTypeDto {
@AutoMap()
@ApiProperty({ example: 'CONCRET', description: 'Unique identifier of the power unit type.' })
@ApiProperty({
example: 'CONCRET',
description: 'Unique identifier of the power unit type.',
})
typeCode: string;

@AutoMap()
Expand All @@ -22,6 +25,9 @@ export class CreatePowerUnitTypeDto {
description: string;

@AutoMap()
@ApiProperty({ example: '1', description: 'Order that the type should be presented in user interfaces.' })
@ApiProperty({
example: '1',
description: 'Order that the type should be presented in user interfaces.',
})
sortOrder: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export class UpdatePowerUnitTypeDto {
description: string;

@AutoMap()
@ApiProperty({ example: '1', description: 'Order that the type should be presented in user interfaces.' })
@ApiProperty({
example: '1',
description: 'Order that the type should be presented in user interfaces.',
})
sortOrder: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { ApiProperty } from '@nestjs/swagger';

export class ReadPowerUnitTypeDto {
@AutoMap()
@ApiProperty({ example: 'CONCRET', description: 'Unique identifier of the power unit type.' })
@ApiProperty({
example: 'CONCRET',
description: 'Unique identifier of the power unit type.',
})
typeCode: string;

@AutoMap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import { PowerUnit } from '../../power-units/entities/power-unit.entity';
@Entity({ name: 'ORBC_VT_POWER_UNIT_TYPE' })
export class PowerUnitType extends Base {
@AutoMap()
@ApiProperty({ example: 'CONCRET', description: 'Unique identifier of the power unit type.' })
@ApiProperty({
example: 'CONCRET',
description: 'Unique identifier of the power unit type.',
})
@PrimaryColumn({ length: 7, name: 'TYPE_CODE', nullable: false })
typeCode: string;

Expand All @@ -29,7 +32,10 @@ export class PowerUnitType extends Base {
description: string;

@AutoMap()
@ApiProperty({ example: '1', description: 'Order that the type should be presented in user interfaces.' })
@ApiProperty({
example: '1',
description: 'Order that the type should be presented in user interfaces.',
})
@Column({ type: 'integer', name: 'SORT_ORDER', nullable: true })
sortOrder: string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { ApiProperty } from '@nestjs/swagger';
export class CreatePowerUnitDto {
@AutoMap()
@ApiProperty({
description: 'Number or code that the company uses to refer to the vehicle.',
description:
'Number or code that the company uses to refer to the vehicle.',
example: 'KEN1',
})
unitNumber: string;
Expand All @@ -18,7 +19,8 @@ export class CreatePowerUnitDto {

@AutoMap()
@ApiProperty({
description: 'Canadian province or US state of registration of the vehicle.',
description:
'Canadian province or US state of registration of the vehicle.',
example: 'CA-BC',
})
provinceId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ export class ReadPowerUnitDto {
@AutoMap()
@ApiProperty({
example: '1',
description: 'Unique identifier for this vehicle record in a company inventory.',
description:
'Unique identifier for this vehicle record in a company inventory.',
})
powerUnitId: string;

@AutoMap()
@ApiProperty({
description: 'Number or code that the company uses to refer to the vehicle.',
description:
'Number or code that the company uses to refer to the vehicle.',
example: 'KEN1',
})
unitNumber: string;
Expand All @@ -25,7 +27,8 @@ export class ReadPowerUnitDto {

@AutoMap()
@ApiProperty({
description: 'Canadian province or US state of registration of the vehicle.',
description:
'Canadian province or US state of registration of the vehicle.',
example: 'CA-BC',
})
provinceId: string;
Expand Down
34 changes: 27 additions & 7 deletions backend/vehicles/src/power-units/entities/power-unit.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ export class PowerUnit extends Base {
@AutoMap()
@ApiProperty({
example: '1',
description: 'Unique identifier for this vehicle record in a company inventory.',
description:
'Unique identifier for this vehicle record in a company inventory.',
})
@PrimaryGeneratedColumn({ type: 'bigint', name: 'POWER_UNIT_ID' })
powerUnitId: string;

@AutoMap()
@ApiProperty({ example: '10', description: 'Number or code that the company uses to refer to the vehicle.' })
@ApiProperty({
example: '10',
description:
'Number or code that the company uses to refer to the vehicle.',
})
@Column({ length: 10, name: 'UNIT_NUMBER', nullable: true })
unitNumber: string;

Expand All @@ -37,22 +42,34 @@ export class PowerUnit extends Base {
province: Province;

@AutoMap()
@ApiProperty({ example: '2022', description: 'Year of manufacture of the vehicle.' })
@ApiProperty({
example: '2022',
description: 'Year of manufacture of the vehicle.',
})
@Column({ type: 'smallint', width: 4, name: 'YEAR', nullable: false })
year: number;

@AutoMap()
@ApiProperty({ example: 'Kenworth', description: 'Make (manufacturer) of the vehicle.' })
@ApiProperty({
example: 'Kenworth',
description: 'Make (manufacturer) of the vehicle.',
})
@Column({ length: 50, name: 'MAKE', nullable: false })
make: string;

@AutoMap()
@ApiProperty({ example: '1ZVFT80N475211367', description: 'Vehicle identification number for the power unit.' })
@ApiProperty({
example: '1ZVFT80N475211367',
description: 'Vehicle identification number for the power unit.',
})
@Column({ length: 17, name: 'VIN', nullable: false })
vin: string;

@AutoMap()
@ApiProperty({ example: '63500', description: 'Licensed gross vehicle weight of the power unit.' })
@ApiProperty({
example: '63500',
description: 'Licensed gross vehicle weight of the power unit.',
})
@Column({
type: 'decimal',
precision: 18,
Expand All @@ -68,7 +85,10 @@ export class PowerUnit extends Base {
powerUnitType: PowerUnitType;

@AutoMap()
@ApiProperty({ example: '12', description: 'Size of the steer axle tires (width).' })
@ApiProperty({
example: '12',
description: 'Size of the steer axle tires (width).',
})
@Column({ type: 'integer', name: 'STEER_AXLE_TIRE_SIZE', nullable: true })
steerAxleTireSize: number;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ import { ApiProperty } from '@nestjs/swagger';

export class CreateTrailerTypeDto {
@AutoMap()
@ApiProperty({ example: 'BOOSTER', description: 'Unique identifier of the trailer type.' })
@ApiProperty({
example: 'BOOSTER',
description: 'Unique identifier of the trailer type.',
})
typeCode: string;

@AutoMap()
@ApiProperty({ example: 'Boosters', description: 'Short description of the trailer type.' })
@ApiProperty({
example: 'Boosters',
description: 'Short description of the trailer type.',
})
type: string;

@AutoMap()
Expand All @@ -18,6 +24,9 @@ export class CreateTrailerTypeDto {
description: string;

@AutoMap()
@ApiProperty({ example: '1', description: 'Order that the type should be presented in user interfaces.' })
@ApiProperty({
example: '1',
description: 'Order that the type should be presented in user interfaces.',
})
sortOrder: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { ApiProperty } from '@nestjs/swagger';

export class UpdateTrailerTypeDto {
@AutoMap()
@ApiProperty({ example: 'Boosters', description: 'Short description of the trailer type.' })
@ApiProperty({
example: 'Boosters',
description: 'Short description of the trailer type.',
})
type: string;

@AutoMap()
Expand All @@ -14,6 +17,9 @@ export class UpdateTrailerTypeDto {
description: string;

@AutoMap()
@ApiProperty({ example: '1', description: 'Order that the type should be presented in user interfaces.' })
@ApiProperty({
example: '1',
description: 'Order that the type should be presented in user interfaces.',
})
sortOrder: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ import { ApiProperty } from '@nestjs/swagger';

export class ReadTrailerTypeDto {
@AutoMap()
@ApiProperty({ example: 'BOOSTER', description: 'Unique identifier of the trailer type.' })
@ApiProperty({
example: 'BOOSTER',
description: 'Unique identifier of the trailer type.',
})
typeCode: string;

@AutoMap()
@ApiProperty({ example: 'Boosters', description: 'Short description of the trailer type.' })
@ApiProperty({
example: 'Boosters',
description: 'Short description of the trailer type.',
})
type: string;

@AutoMap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ import { Trailer } from '../../trailers/entities/trailer.entity';
@Entity({ name: 'ORBC_VT_TRAILER_TYPE' })
export class TrailerType extends Base {
@AutoMap()
@ApiProperty({ example: 'BOOSTER', description: 'Unique identifier of the trailer type.' })
@ApiProperty({
example: 'BOOSTER',
description: 'Unique identifier of the trailer type.',
})
@PrimaryColumn({ length: 7, name: 'TYPE_CODE', nullable: false })
typeCode: string;

@AutoMap()
@ApiProperty({ example: 'Boosters', description: 'Short description of the trailer type.' })
@ApiProperty({
example: 'Boosters',
description: 'Short description of the trailer type.',
})
@Column({ length: 150, name: 'TYPE', nullable: false })
type: string;

Expand All @@ -25,7 +31,10 @@ export class TrailerType extends Base {
description: string;

@AutoMap()
@ApiProperty({ example: '1', description: 'Order that the type should be presented in user interfaces.' })
@ApiProperty({
example: '1',
description: 'Order that the type should be presented in user interfaces.',
})
@Column({ type: 'integer', name: 'SORT_ORDER', nullable: true })
sortOrder: string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { ApiProperty } from '@nestjs/swagger';
export class CreateTrailerDto {
@AutoMap()
@ApiProperty({
description: 'Number or code that the company uses to refer to the vehicle.',
description:
'Number or code that the company uses to refer to the vehicle.',
example: 'KEN1',
})
unitNumber: string;
Expand All @@ -18,7 +19,8 @@ export class CreateTrailerDto {

@AutoMap()
@ApiProperty({
description: 'Canadian province or US state of registration of the vehicle.',
description:
'Canadian province or US state of registration of the vehicle.',
example: 'CA-BC',
})
provinceId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ export class ReadTrailerDto {
@AutoMap()
@ApiProperty({
example: '1',
description: 'Unique identifier for this vehicle record in a company inventory.',
description:
'Unique identifier for this vehicle record in a company inventory.',
})
trailerId: string;

@AutoMap()
@ApiProperty({
description: 'Number or code that the company uses to refer to the vehicle.',
description:
'Number or code that the company uses to refer to the vehicle.',
example: 'KEN1',
})
unitNumber: string;
Expand All @@ -25,7 +27,8 @@ export class ReadTrailerDto {

@AutoMap()
@ApiProperty({
description: 'Canadian province or US state of registration of the vehicle.',
description:
'Canadian province or US state of registration of the vehicle.',
example: 'CA-BC',
})
provinceId: string;
Expand Down
Loading