-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from anasabbal/develop
Develop
- Loading branch information
Showing
39 changed files
with
1,053 additions
and
360 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
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,6 +1,9 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { UserCreateCommand } from '@app/shared/commands/auth/user.create.cmd'; | ||
import { IResponse } from '@app/shared/interfaces/response.interface'; | ||
import { validateCommand } from '@app/shared/utils/validate'; | ||
import { BadRequestException, Injectable } from '@nestjs/common'; | ||
|
||
@Injectable() | ||
export class AuthService { | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Entity, PrimaryGeneratedColumn, Column, BeforeInsert } from 'typeorm'; | ||
import { v4 as uuidv4 } from 'uuid'; | ||
import { DriverStatus } from '../enums/driver.status'; | ||
|
||
@Entity() | ||
export class Driver { | ||
|
||
@BeforeInsert() | ||
generateId() { | ||
this.id = uuidv4(); | ||
} | ||
|
||
@PrimaryGeneratedColumn('uuid') | ||
id: string; | ||
|
||
@Column({ type: 'integer' }) | ||
user_id: string; | ||
|
||
@Column({ type: 'varchar', length: 50 }) | ||
license_number: string; | ||
|
||
@Column({ type: 'integer', nullable: true }) | ||
vehicle_id: number; | ||
|
||
@Column({ type: 'float', nullable: true }) | ||
rating: number; | ||
|
||
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }) | ||
created_at: Date; | ||
|
||
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP', onUpdate: 'CURRENT_TIMESTAMP' }) | ||
updated_at: Date; | ||
|
||
@Column({ | ||
type: 'enum', | ||
enum: DriverStatus, | ||
default: DriverStatus.EMPTY | ||
}) | ||
driverStatus: DriverStatus; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,20 +1,4 @@ | ||
import { DriverDto } from "@app/shared/events/driver/driver.dto"; | ||
import { Driver } from "../models/driver.schema"; | ||
import { Driver } from "typeorm"; | ||
|
||
|
||
|
||
export function mapDriverToDto(driver: Driver): DriverDto { | ||
const driverDto = new DriverDto(); | ||
|
||
driverDto.firstName = driver.firstName; | ||
driverDto.lastName = driver.lastName; | ||
driverDto.email = driver.email; | ||
driverDto.password = driver.password; | ||
driverDto.driverStatus = driver.driverStatus; | ||
|
||
return driverDto; | ||
} | ||
|
||
export function mapDriversToDtos(drivers: Driver[]): DriverDto[] { | ||
return drivers.map(driver => mapDriverToDto(driver)); | ||
} |
Oops, something went wrong.