- 4000 Eureka DiscoveryServer
- 4900 Subscription Service
- 5000 Routes Service
- 6000 Service Terminal
- 7100 Accounts Service
- 7200 Event Service
- 7300 Invoicing Service
- 7800 Collection Service
- 8080 NFC Reader
- 9000 Local Station Broker (Local Account Broker)
- 9100 Local EventStore Broker
Please do the following things before running:
- Create the following postgres databases on port 5432:
- AccountDB
- EventQueue
- AccountDB_Broker
- AccountDB_Service
- Subscriptions
- EventStore
- Routes
- PassengerBillsDB
- For each of the Services, add your username and password in the application.properties file in the corresponding microservice.
- Download Postman: https://www.postman.com/downloads/
- Import collection: ./TrIP.postman_collection.json
- Use the predefined requests
- np ;)
To get all accounts: GET http://localhost:7100/accounts
To get all eventstores: GET http://localhost:7200/eventstores
To get all invoices: GET http://localhost:7300/invoicing/invoices/all
To get all subscriptions: GET http://localhost:4900/subscription/all
To get all bankcards on NFC Reader: GET http://localhost:8080/nfcreader
To get all routes: GET http://localhost:4500/api/v1/route/all
For checking in and out, and calculating the price afterwards:
-
Start:
- NFC Reader
- Local EventStore Broker
- Event Service
- Invoicing Service
- Collection Service
- Route Service
- Account Service
- Subscription Service
- Eureka DiscoveryServer
-
First, POST the following two messages: POST http://localhost:8080/api/v1/nfcreader/eventstore/Apeldoorn
Content-Type: application/json
{ "uuid": 1, "expiryDate": "2025-04-05", "nfcId": 12345 }POST http://localhost:8080/api/v1/nfcreader/eventstore/Barneveld
Content-Type: application/json
{ "uuid": 1, "expiryDate": "2025-04-05", "nfcId": 12345 } -
POST the following: POST http://localhost:7300/invoicing/build_routes
-
You can now see all invoices for user 1 by : GET http://localhost:7300/invoicing/invoices/1
-
To collect the invoices for user 1: GET http://localhost:7800/collect/1
-
Start:
- Station Broker
- Account Service
- Subscription Service
- Service Terminal
- NFC Reader
- Eureka DiscoveryServer
-
POST the following: POST http://localhost:6000/serviceterminal/bankcard/add
Content-Type: application/json
{ "expiryDate": "2030-04-05", "nfcId": 11111, "iban": "NL00INGB1234567890" } -
To look at possible subscriptions GET the following: GET http://localhost:6000/serviceterminal/subscription/all
-
To add a subscription to your bank card: POST http://localhost:6000/serviceterminal/subscription/add/for_user/11111 Content-Type: application/json
{ "id": 1, "tycoonId": 3, "discountPercentage": 40, "description": "Valid for routes of Nederlandse Sportvereniging tycoon, 40% off outside of peak hours" } -
To check your current subscriptions: GET http://localhost:6000/serviceterminal/subscription/all/for_user/11111