Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3c7318e
added project base
MohammmedAhmed8 May 2, 2025
b0734f8
added .github file
MohammmedAhmed8 May 2, 2025
280a921
fixed linter issue
MohammmedAhmed8 May 2, 2025
c059be8
fixed linter issue
MohammmedAhmed8 May 2, 2025
d27f2e1
added order model, repository, service and controller
MohammmedAhmed8 May 3, 2025
05f9c90
fixed linter issues
MohammmedAhmed8 May 3, 2025
c26372d
Add endpoints to get orders by user ID, cancel orders, and update ord…
oaly2 May 4, 2025
da784fc
Fix linter issue
oaly2 May 4, 2025
5d20343
Resolve Comments
oaly2 May 4, 2025
8cc4b16
Adjusted lint checks
oaly2 May 4, 2025
7191cb3
added swagger and logger in the controller
MohammmedAhmed8 May 6, 2025
3542af2
Merge branch 'dev' into Crud-Operations
MohammmedAhmed8 May 6, 2025
fd5c1e5
fixed linter issues
MohammmedAhmed8 May 6, 2025
a5423a9
Added Global Exception Handler and Endpoint to Check out an order
oaly2 May 8, 2025
71d8612
Create docker-compose.yml
oaly2 May 10, 2025
ae077b0
Add DockerFile
oaly2 May 11, 2025
5e4bb96
Removed Checkout endpoint and Adjusted OrderStatus enum
oaly2 May 12, 2025
94a14a8
added order address
MohammmedAhmed8 May 12, 2025
afcea40
fixed linter issues
MohammmedAhmed8 May 12, 2025
7a36737
Merge branch 'dev' into Omar/3-endpoints
oaly2 May 12, 2025
306e5a9
Merge branch 'Crud-Operations' into Omar/3-endpoints
oaly2 May 12, 2025
d8dd9ff
Merge pull request #3 from Podzilla/Omar/3-endpoints
oaly2 May 12, 2025
e881d83
fixed errors
MohammmedAhmed8 May 12, 2025
c911c79
Chnage long -> UUID in OrderService
oaly2 May 12, 2025
3bf3427
Merge branch 'Crud-Operations' of https://github.com/Podzilla/order i…
oaly2 May 12, 2025
667adea
long -> UUID in OrderController
oaly2 May 12, 2025
5950a26
Add stock reservation and order placed messaging via RabbitMQ
oaly2 May 13, 2025
7d6888d
modified order consumer and order producer
MohammmedAhmed8 May 17, 2025
61eb999
removed unused classes
MohammmedAhmed8 May 17, 2025
b7c78d0
fixed linter issues
MohammmedAhmed8 May 17, 2025
d5ac88e
added track order
MohammmedAhmed8 May 17, 2025
db27a0b
modified get location url
MohammmedAhmed8 May 17, 2025
de6f836
Merge branch 'dev' into Crud-Operations
MohammmedAhmed8 May 17, 2025
784d7d4
fixed linter issue
MohammmedAhmed8 May 17, 2025
76687d4
added confirmation type, fixed linter issue
MohammmedAhmed8 May 17, 2025
4ffb195
added order long - lat
MohammmedAhmed8 May 17, 2025
bbeff45
fixed linter issue
MohammmedAhmed8 May 17, 2025
b5740a3
fixed run errors
MohammmedAhmed8 May 17, 2025
cbebb5b
Merge branch 'dev' into Crud-Operations
MohammmedAhmed8 May 17, 2025
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
25 changes: 4 additions & 21 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ services:
- order_db
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://order_db:5432/orderDB
- SPRING_DATASOURCE_USERNAME=postgres
- SPRING_DATASOURCE_PASSWORD=1234
volumes:
- ./target:/app
- ./logs:/logs
Expand All @@ -30,25 +32,6 @@ services:
- "15672:15672"
- "5672:5672"
environment:
RABBITMQ_DEFAULT_USER: user
RABBITMQ_DEFAULT_PASS: password
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest

loki:
image: grafana/loki:3.5.0
container_name: loki
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml

grafana:
image: grafana/grafana:10.4.1
container_name: grafana
ports:
- "3000:3000"
depends_on:
- loki
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana_data:/var/lib/grafana
17 changes: 6 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,15 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>

<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-security</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.core.AuthenticationException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
Expand All @@ -12,22 +10,6 @@
public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {


@ExceptionHandler(AccessDeniedException.class)
public ResponseEntity<ErrorResponse> handleAccessDeniedException(
final AccessDeniedException exception) {
return ResponseEntity.status(HttpStatus.FORBIDDEN)
.body(new ErrorResponse(exception.getMessage(),
HttpStatus.FORBIDDEN));
}

@ExceptionHandler(AuthenticationException.class)
public ResponseEntity<ErrorResponse> handleAuthenticationException(
final AuthenticationException exception) {
return ResponseEntity.status(HttpStatus.UNAUTHORIZED)
.body(new ErrorResponse(exception.getMessage(),
HttpStatus.UNAUTHORIZED));
}

@ExceptionHandler(NotFoundException.class)
public ResponseEntity<ErrorResponse> handleNotFoundException(
final NotFoundException exception) {
Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
spring.application.name=order
api.gateway.url=http://localhost:8080
api.gateway.url=http://localhost:8080
spring.rabbitmq.host=rabbitmq
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
4 changes: 2 additions & 2 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ spring:
rabbitmq:
host: rabbitmq # container name
port: 5672
username: user
password: password
username: guest
password: guest