Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
01519fb
Setup (#1)
abdulrhman500 May 2, 2025
1dc8e10
chore: create base structure for models, services, repositories, and …
Mohamed-Khaled308 May 2, 2025
d6917cf
Courier analytics endpoints (#7)
Mohamed-Khaled308 May 3, 2025
86450cd
Fix docker and docker compose files (#3)
Mohamed-Khaled308 May 3, 2025
4631181
chore: add workflow setup (#12)
Mohamed-Khaled308 May 3, 2025
ed3f725
chore: add swagger api docs (#14)
Mohamed-Khaled308 May 3, 2025
49c7bc2
chore: add global exception handler (#13)
Mohamed-Khaled308 May 3, 2025
3f91d64
feat: add DateRangeRequest DTO with cross-field validation (#11)
Mohamed-Khaled308 May 3, 2025
b0823f6
chore: fix code style issues (#17)
Mohamed-Khaled308 May 8, 2025
d41dad0
feat: added order reports (#15)
AhmadHoseiny May 8, 2025
9c6fff3
feat: add customer and inventory services (#9)
malekelkssas May 9, 2025
c37e85b
Feature/fulfillment reports (#18)
mohamedhassans May 10, 2025
26fb344
chore: rename dockerfile to Dockerfile for case consistency (#21)
Mohamed-Khaled308 May 12, 2025
bfc8a50
feat: add integration with the shared library and rabbit mq (#19)
Mohamed-Khaled308 May 12, 2025
4f7d0a2
chore: rename API endpoints (#22)
Mohamed-Khaled308 May 13, 2025
14704be
Group1 (#10)
abdulrhman500 May 15, 2025
342c739
test: add unit and integration tests for courier analytics (#20)
Mohamed-Khaled308 May 16, 2025
5b6f9f4
feat: Implement profit by category report endpoint (#8)
mohamedhassans May 17, 2025
44bf8ac
Communication design patterns (#23)
AhmadHoseiny May 18, 2025
1497717
fix: fix rabbit issue (#25)
AhmadHoseiny May 18, 2025
ca60768
Fix revenue (#26)
Mohamed-Khaled308 May 18, 2025
ae6cb5a
Fix fix (#27)
Mohamed-Khaled308 May 19, 2025
fb7d2f3
chore: update podzilla-utils-lib version to v1.1.13 (#28)
NourAlPha May 19, 2025
9faf710
Inventory customers tests (#29)
malekelkssas May 19, 2025
501be19
Feat cron jobs (#30)
malekelkssas May 19, 2025
cc4b649
fix: hot fix
Mohamed-Khaled308 May 19, 2025
cef4f34
dummmy commit
Mohamed-Khaled308 May 21, 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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/mvnw text eol=lf
*.cmd text eol=crlf
14 changes: 14 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Use Template Java CI/CD

on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "**" ]

jobs:
call-ci:
uses: Podzilla/templates/.github/workflows/ci.yml@main
with:
branch: 'refs/heads/main' # <<< Passes the branch name dynamically
secrets: inherit
12 changes: 12 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Use Template Linter

on:
pull_request:
branches: [ "**" ]

jobs:
call-linter:
uses: Podzilla/templates/.github/workflows/super-linter.yml@main
with:
branch: 'dev'
secrets: inherit
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
19 changes: 19 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM openjdk:25-ea-4-jdk-oraclelinux9

WORKDIR /app

COPY ./target/*.jar analytics_app.jar

EXPOSE 8080

ENTRYPOINT ["java", "-jar", "analytics_app.jar"]
3 changes: 3 additions & 0 deletions build_and_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mvn clean package -DskipTests
docker compose down
docker compose up -d --build
194 changes: 194 additions & 0 deletions config/checkstyle/sun_checks.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">

<!--

Checkstyle configuration that checks the sun coding conventions from:

- the Java Language Specification at
https://docs.oracle.com/javase/specs/jls/se11/html/index.html

- the Sun Code Conventions at https://www.oracle.com/java/technologies/javase/codeconventions-contents.html

- the Javadoc guidelines at
https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html

- the JDK Api documentation https://docs.oracle.com/en/java/javase/11/

- some best practices

Checkstyle is very configurable. Be sure to read the documentation at
https://checkstyle.org (or in your downloaded distribution).

Most Checks are configurable, be sure to consult the documentation.

To completely disable a check, just comment it out or delete it from the file.
To suppress certain violations please review suppression filters.

Finally, it is worth reading the documentation.

-->

<module name="Checker">
<!--
If you set the basedir property below, then all reported file
names will be relative to the specified directory. See
https://checkstyle.org/config.html#Checker

<property name="basedir" value="${basedir}"/>
-->


<property name="severity" value="error"/>

<property name="fileExtensions" value="java, properties, xml"/>

<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/filefilters/index.html -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>

<!-- Excludes all test files (e.g., in src/test or ending with Test.java) -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="[/\\]src[/\\]test[/\\].*|.*Test\.java"/>
</module>


<!-- https://checkstyle.org/filters/suppressionfilter.html -->
<module name="SuppressionFilter">
<property name="file" value="${org.checkstyle.sun.suppressionfilter.config}"
default="checkstyle-suppressions.xml" />
<property name="optional" value="true"/>
</module>

<!-- Checks whether files end with a new line. -->
<!-- See https://checkstyle.org/checks/misc/newlineatendoffile.html -->
<module name="NewlineAtEndOfFile"/>

<!-- Checks that property files contain the same keys. -->
<!-- See https://checkstyle.org/checks/misc/translation.html -->
<module name="Translation"/>

<!-- Checks for Size Violations. -->
<!-- See https://checkstyle.org/checks/sizes/index.html -->
<module name="FileLength"/>
<module name="LineLength">
<property name="fileExtensions" value="java"/>
</module>

<!-- Checks for whitespace -->
<!-- See https://checkstyle.org/checks/whitespace/index.html -->
<module name="FileTabCharacter"/>

<!-- Miscellaneous other checks. -->
<!-- See https://checkstyle.org/checks/misc/index.html -->
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Line has trailing spaces."/>
</module>

<!-- Checks for Headers -->
<!-- See https://checkstyle.org/checks/header/index.html -->
<!-- <module name="Header"> -->
<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
<!-- <property name="fileExtensions" value="java"/> -->
<!-- </module> -->

<module name="SuppressWarningsFilter" />

<module name="TreeWalker">

<!-- Checks for Naming Conventions. -->
<!-- See https://checkstyle.org/checks/naming/index.html -->
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName">
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
</module>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>

<!-- Checks for imports -->
<!-- See https://checkstyle.org/checks/imports/index.html -->
<module name="AvoidStarImport"/>
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
<module name="RedundantImport"/>
<module name="UnusedImports"/>

<!-- Checks for Size Violations. -->
<!-- See https://checkstyle.org/checks/sizes/index.html -->
<module name="MethodLength"/>
<module name="ParameterNumber"/>

<!-- Checks for whitespace -->
<!-- See https://checkstyle.org/checks/whitespace/index.html -->
<module name="EmptyForIteratorPad"/>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>

<!-- Modifier Checks -->
<!-- See https://checkstyle.org/checks/modifier/index.html -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>

<!-- Checks for blocks. You know, those {}'s -->
<!-- See https://checkstyle.org/checks/blocks/index.html -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>

<!-- Checks for common coding problems -->
<!-- See https://checkstyle.org/checks/coding/index.html -->
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<module name="MagicNumber"/>
<module name="MissingSwitchDefault"/>
<module name="MultipleVariableDeclarations"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>

<!-- Checks for class design -->
<!-- See https://checkstyle.org/checks/design/index.html -->
<module name="FinalClass"/>
<module name="InterfaceIsType"/>
<module name="VisibilityModifier"/>

<!-- Miscellaneous other checks. -->
<!-- See https://checkstyle.org/checks/misc/index.html -->
<module name="ArrayTypeStyle"/>
<module name="FinalParameters"/>
<module name="TodoComment"/>
<module name="UpperEll"/>

<!-- https://checkstyle.org/filters/suppressionxpathfilter.html -->
<module name="SuppressionXpathFilter">
<property name="file" value="${org.checkstyle.sun.suppressionxpathfilter.config}"
default="checkstyle-xpath-suppressions.xml" />
<property name="optional" value="true"/>
</module>

<module name="SuppressWarningsHolder" />

</module>

</module>
52 changes: 52 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

services:
analytics-app:
build: .
container_name: analytics-app
ports:
- "8083:8080"
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/analytics_db_dev
SPRING_DATASOURCE_USERNAME: postgres
SPRING_DATASOURCE_PASSWORD: 123
SPRING_RABBITMQ_HOST: host.docker.internal
SPRING_RABBITMQ_PORT: 5672
SPRING_RABBITMQ_USERNAME: guest
SPRING_RABBITMQ_PASSWORD: guest
depends_on:
- db
extra_hosts:
- "host.docker.internal:host-gateway"


db:
image: postgres
container_name: analytics-db
ports:
- "5435:5432"
environment:
POSTGRES_DB: analytics_db_dev
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 123
volumes:
- db_data:/var/lib/postgresql/data


# rabbitmq:
# image: rabbitmq:3.12-management-alpine # Use RabbitMQ with the management plugin
# container_name: analytics-rabbitmq
# ports:
# - "5672:5672" # Default AMQP port
# - "15672:15672" # Management UI port (access at http://localhost:15672)
# environment:
# RABBITMQ_DEFAULT_USER: analytics_mq_user # RabbitMQ user
# RABBITMQ_DEFAULT_PASS: analytics_mq_password # RabbitMQ password
# healthcheck: # Basic health check for RabbitMQ
# test: ["CMD", "rabbitmq-diagnostics", "check_system_status"]
# interval: 10s
# timeout: 5s
# retries: 5


volumes:
db_data:
Loading