-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
100 changed files
with
6,630 additions
and
114 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
DATABASE_NAME= | ||
DATABASE_PORT= | ||
DATABASE_USERNAME= | ||
DATABASE_PASSWORD= |
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,6 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn tsc | ||
yarn format | ||
yarn lint |
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,73 +1,48 @@ | ||
<p align="center"> | ||
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a> | ||
</p> | ||
|
||
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 | ||
[circleci-url]: https://circleci.com/gh/nestjs/nest | ||
|
||
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p> | ||
<p align="center"> | ||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a> | ||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a> | ||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a> | ||
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a> | ||
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a> | ||
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a> | ||
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a> | ||
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a> | ||
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a> | ||
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a> | ||
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a> | ||
</p> | ||
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer) | ||
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)--> | ||
|
||
## Description | ||
|
||
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. | ||
### Fork of legacyfighter/cabs-java to Nest.js (TypeScript / Node) | ||
____ | ||
|
||
# Rozwój kodu | ||
|
||
Kod będzie rozwijać się wraz z cotygodniową narracją szkoleniową. | ||
Zarówno pojawiać się w nim będą kolejne poprawki jak i odziedziczone po firmach partnerskich nowe moduły ;-) Jak to w prawdziwym legacy. | ||
|
||
# Przeglądanie kodu | ||
|
||
Poszczególne kroki refaktoryzacyjne najlepiej przeglądać używająć tagów. Każdy krok szkoleniowy, który opisany jest w odcinku Legacy Fighter posiada na końcu planszę z nazwą odpowiedniego taga. Porównać zmiany można robiąc diffa w stosunku do poprzedniego taga z narracji. | ||
|
||
|
||
_____________ | ||
|
||
|
||
|
||
## Installation | ||
|
||
```bash | ||
$ npm install | ||
$ yarn install | ||
``` | ||
|
||
## Running the app | ||
|
||
```bash | ||
# development | ||
$ npm run start | ||
$ yarn start | ||
|
||
# watch mode | ||
$ npm run start:dev | ||
$ yarn start:dev | ||
|
||
# production mode | ||
$ npm run start:prod | ||
$ yarn start:prod | ||
``` | ||
|
||
## Test | ||
|
||
```bash | ||
# unit tests | ||
$ npm run test | ||
$ yarn test | ||
|
||
# e2e tests | ||
$ npm run test:e2e | ||
$ yarn test:e2e | ||
|
||
# test coverage | ||
$ npm run test:cov | ||
$ yarn test:cov | ||
``` | ||
|
||
## Support | ||
|
||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). | ||
|
||
## Stay in touch | ||
|
||
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com) | ||
- Website - [https://nestjs.com](https://nestjs.com/) | ||
- Twitter - [@nestframework](https://twitter.com/nestframework) | ||
|
||
## License | ||
|
||
Nest is [MIT licensed](LICENSE). |
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 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,10 +1,118 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { AppController } from './app.controller'; | ||
import { AppService } from './app.service'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { ConfigModule } from '@nestjs/config'; | ||
import { DriverController } from './controllers/driver.controller'; | ||
import { DriverService } from './service/driver.service'; | ||
import { DriverRepository } from './repository/driver.repository'; | ||
import { AppProperties } from './config/app-properties.config'; | ||
import { CarTypeRepository } from './repository/car-type.repository'; | ||
import { CarTypeController } from './controllers/car-type.controller'; | ||
import { CarTypeService } from './service/car-type.service'; | ||
import { DistanceCalculator } from './service/distance-calculator.service'; | ||
import { InvoiceRepository } from './repository/invoice.repository'; | ||
import { InvoiceGenerator } from './service/invoice-generator.service'; | ||
import { DriverNotificationService } from './service/driver-notification.service'; | ||
import { GeocodingService } from './service/geocoding.service'; | ||
import { ClaimNumberGenerator } from './service/claim-number-generator.service'; | ||
import { ClaimRepository } from './repository/claim.repository'; | ||
import { ClientNotificationService } from './service/client-notification.service'; | ||
import { ClientService } from './service/client.service'; | ||
import { ClientRepository } from './repository/client.repository'; | ||
import { ClientController } from './controllers/client.controller'; | ||
import { DriverSessionService } from './service/driver-session.service'; | ||
import { DriverSessionRepository } from './repository/driver-session.repository'; | ||
import { DriverSessionController } from './controllers/driver-session.controller'; | ||
import { DriverFeeRepository } from './repository/driver-fee.repository'; | ||
import { TransitRepository } from './repository/transit.repository'; | ||
import { DriverFeeService } from './service/driver-fee.service'; | ||
import { DriverPositionRepository } from './repository/driver-position.repository'; | ||
import { DriverTrackingService } from './service/driver-tracking.service'; | ||
import { DriverTrackingController } from './controllers/driver-tracking.controller'; | ||
import { ClaimAttachmentRepository } from './repository/claim-attachment.repository'; | ||
import { AddressRepository } from './repository/address.repository'; | ||
import { DriverAttributeRepository } from './repository/driver-attribute.repository'; | ||
import { AwardedMilesRepository } from './repository/awarded-miles.repository'; | ||
import { AwardsAccountRepository } from './repository/awards-account.repository'; | ||
import { ContractAttachmentRepository } from './repository/contract-attachment.repository'; | ||
import { ContractRepository } from './repository/contract.repository'; | ||
import { TransitAnalyzerService } from './service/transit-analyzer.service'; | ||
import { AwardsService } from './service/awards.service'; | ||
import { ClaimService } from './service/claim.service'; | ||
import { ContractService } from './service/contract.service'; | ||
import { TransitService } from './service/transit.service'; | ||
import { TransitAnalyzerController } from './controllers/transit-analyzer.controller'; | ||
import { TransitController } from './controllers/transit.controller'; | ||
import { AwardsAccountController } from './controllers/awards-account.controller'; | ||
import { ClaimController } from './controllers/claim.controller'; | ||
import { ContractController } from './controllers/contract.controller'; | ||
import { DriverReportController } from './controllers/driver-report.controller'; | ||
|
||
@Module({ | ||
imports: [], | ||
controllers: [AppController], | ||
providers: [AppService], | ||
imports: [ | ||
ConfigModule.forRoot(), | ||
TypeOrmModule.forRoot({ | ||
type: 'postgres', | ||
host: 'localhost', | ||
port: process.env.DATABASE_PORT | ||
? parseInt(process.env.DATABASE_PORT, 10) | ||
: 3456, | ||
username: process.env.DATABASE_USERNAME, | ||
password: process.env.DATABASE_PASSWORD, | ||
database: process.env.DATABASE_NAME, | ||
autoLoadEntities: true, | ||
synchronize: true, | ||
}), | ||
TypeOrmModule.forFeature([ | ||
DriverRepository, | ||
CarTypeRepository, | ||
InvoiceRepository, | ||
ClaimRepository, | ||
ClientRepository, | ||
DriverSessionRepository, | ||
DriverFeeRepository, | ||
TransitRepository, | ||
DriverPositionRepository, | ||
ClaimAttachmentRepository, | ||
AddressRepository, | ||
DriverAttributeRepository, | ||
AwardedMilesRepository, | ||
AwardsAccountRepository, | ||
ContractAttachmentRepository, | ||
ContractRepository, | ||
]), | ||
], | ||
controllers: [ | ||
DriverController, | ||
CarTypeController, | ||
ClientController, | ||
DriverSessionController, | ||
DriverTrackingController, | ||
TransitAnalyzerController, | ||
TransitController, | ||
AwardsAccountController, | ||
ClaimController, | ||
ContractController, | ||
DriverReportController, | ||
], | ||
providers: [ | ||
AppProperties, | ||
DriverService, | ||
CarTypeService, | ||
DistanceCalculator, | ||
InvoiceGenerator, | ||
DriverNotificationService, | ||
GeocodingService, | ||
ClaimNumberGenerator, | ||
ClientNotificationService, | ||
ClientService, | ||
DriverSessionService, | ||
DriverFeeService, | ||
DriverTrackingService, | ||
TransitAnalyzerService, | ||
AwardsService, | ||
ClaimService, | ||
ContractService, | ||
TransitService, | ||
], | ||
}) | ||
export class AppModule {} |
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,10 @@ | ||
import { PrimaryGeneratedColumn } from 'typeorm'; | ||
|
||
export class BaseEntity { | ||
@PrimaryGeneratedColumn('uuid') | ||
protected id: string; | ||
|
||
public getId(): string { | ||
return this.id; | ||
} | ||
} |
Oops, something went wrong.