-
Notifications
You must be signed in to change notification settings - Fork 3
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 #64 from ElemarJR/average_ticket
Major backend files structure change.
- Loading branch information
Showing
104 changed files
with
382 additions
and
222 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 |
---|---|---|
@@ -1,20 +1,39 @@ | ||
FROM python:3.12-slim | ||
FROM python:3.11-slim | ||
|
||
WORKDIR /code | ||
WORKDIR /app | ||
|
||
COPY ./requirements.txt /code/requirements.txt | ||
RUN apt-get update && apt-get install -y \ | ||
gcc \ | ||
python3-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip install --no-cache-dir --upgrade -r ./requirements.txt | ||
COPY api/requirements.txt ./api/ | ||
COPY shared/requirements.txt ./shared/ | ||
COPY utils/requirements.txt ./utils/ | ||
COPY models/requirements.txt ./models/ | ||
|
||
COPY . . | ||
COPY ./src/api/schema.graphql ./api/schema.graphql | ||
COPY ./src/api/schema/common.graphql ./api/schema/common.graphql | ||
COPY ./src/api/domain/schema.graphql ./api/domain/schema.graphql | ||
COPY ./src/api/datasets/schema.graphql ./api/datasets/schema.graphql | ||
COPY ./src/api/analytics/schema.graphql ./api/analytics/schema.graphql | ||
COPY api ./api | ||
COPY shared ./shared | ||
COPY utils ./utils | ||
COPY models ./models | ||
|
||
RUN pip install --no-cache-dir -r api/requirements.txt \ | ||
&& pip install --no-cache-dir -r shared/requirements.txt \ | ||
&& pip install --no-cache-dir -r utils/requirements.txt \ | ||
&& pip install --no-cache-dir -r models/requirements.txt | ||
|
||
RUN pip install -e ./shared \ | ||
&& pip install -e ./utils \ | ||
&& pip install -e ./models \ | ||
&& pip install -e ./api | ||
|
||
ENV PYTHONPATH=/app | ||
ENV FLASK_APP=/app/api/src/app.py | ||
|
||
EXPOSE 5001 | ||
|
||
CMD ["python", "src/app.py"] | ||
WORKDIR /app/api/src | ||
|
||
CMD ["python", "app.py"] | ||
|
||
RUN mkdir /.cache && chmod 777 /.cache |
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,20 @@ | ||
requests | ||
Flask | ||
Flask-CORS | ||
flask_httpauth | ||
ariadne | ||
elasticsearch | ||
|
||
google-auth | ||
pytest | ||
pytest-cov | ||
pytest-mock | ||
pytest-parametrize | ||
|
||
pydantic | ||
pytz | ||
bokeh | ||
python-dotenv | ||
validators | ||
pandas | ||
jwt |
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,13 @@ | ||
from setuptools import setup, find_namespace_packages | ||
|
||
setup( | ||
name="omni-api", | ||
version="0.1", | ||
packages=find_namespace_packages(where="src"), | ||
package_dir={"": "src"}, | ||
install_requires=[ | ||
"omni-shared", | ||
"omni-utils", | ||
"omni-models" | ||
], | ||
) |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...d/src/api/analytics/approved_vs_actual.py → ...d/api/src/analytics/approved_vs_actual.py
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,4 +1,4 @@ | ||
from models.analytics import compute_approved_vs_actual | ||
from omni_models.analytics import compute_approved_vs_actual | ||
|
||
def resolve_approved_vs_actual(_, info, start, end): | ||
return compute_approved_vs_actual(start, end) |
2 changes: 1 addition & 1 deletion
2
backend/src/api/analytics/forecast.py → backend/api/src/analytics/forecast.py
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,4 +1,4 @@ | ||
from models.analytics.forecast import compute_forecast | ||
from omni_models.analytics.forecast import compute_forecast | ||
|
||
def resolve_forecast(_, info, date_of_interest = None, filters = None): | ||
return compute_forecast(date_of_interest, filters) |
6 changes: 3 additions & 3 deletions
6
...src/api/analytics/performance_analysis.py → ...api/src/analytics/performance_analysis.py
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
2 changes: 1 addition & 1 deletion
2
...end/src/api/analytics/revenue_tracking.py → ...end/api/src/analytics/revenue_tracking.py
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...nd/src/api/analytics/timeliness_review.py → ...nd/api/src/analytics/timeliness_review.py
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,4 +1,4 @@ | ||
from models.analytics import compute_timeliness_review | ||
from omni_models.analytics import compute_timeliness_review | ||
|
||
def resolve_timeliness_review(_, info, date_of_interest, filters=None): | ||
return compute_timeliness_review(date_of_interest, filters) |
2 changes: 1 addition & 1 deletion
2
backend/src/api/analytics/week_review.py → backend/api/src/analytics/week_review.py
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
2 changes: 1 addition & 1 deletion
2
backend/src/api/datasets/datasets.py → backend/api/src/datasets/datasets.py
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,4 +1,4 @@ | ||
import globals | ||
from omni_shared import globals | ||
|
||
|
||
def resolve_datasets(_, info, kind: str = None): | ||
|
2 changes: 1 addition & 1 deletion
2
backend/src/api/datasets/datasets_set.py → backend/api/src/datasets/datasets_set.py
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
4 changes: 2 additions & 2 deletions
4
backend/src/api/datasets/insights.py → backend/api/src/datasets/insights.py
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
4 changes: 2 additions & 2 deletions
4
backend/src/api/datasets/ontology.py → backend/api/src/datasets/ontology.py
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
File renamed without changes.
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
File renamed without changes.
14 changes: 7 additions & 7 deletions
14
backend/src/api/domain/account_managers.py → backend/api/src/domain/account_managers.py
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
2 changes: 1 addition & 1 deletion
2
backend/src/api/domain/active_deals.py → backend/api/src/domain/active_deals.py
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
8 changes: 4 additions & 4 deletions
8
backend/src/api/domain/cases.py → backend/api/src/domain/cases.py
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
8 changes: 4 additions & 4 deletions
8
backend/src/api/domain/clients.py → backend/api/src/domain/clients.py
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
12 changes: 6 additions & 6 deletions
12
...d/src/api/domain/consultants_engineers.py → ...d/api/src/domain/consultants_engineers.py
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
2 changes: 1 addition & 1 deletion
2
backend/src/api/domain/offers.py → backend/api/src/domain/offers.py
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,4 +1,4 @@ | ||
import globals | ||
from omni_shared import globals | ||
|
||
|
||
def resolve_offers(_, info): | ||
|
2 changes: 1 addition & 1 deletion
2
backend/src/api/domain/projects.py → backend/api/src/domain/projects.py
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,4 +1,4 @@ | ||
import globals | ||
from omni_shared import globals | ||
|
||
|
||
def resolve_projects(_, info): | ||
|
File renamed without changes.
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
4 changes: 2 additions & 2 deletions
4
backend/src/api/domain/user.py → backend/api/src/domain/user.py
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
backend/src/api/inconsistencies.py → backend/api/src/inconsistencies.py
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,5 +1,5 @@ | ||
from datetime import datetime | ||
import globals | ||
from omni_shared import globals | ||
|
||
|
||
class Inconsistency: | ||
|
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,5 +1,5 @@ | ||
from ariadne import MutationType | ||
import globals | ||
from omni_shared import globals | ||
|
||
mutation = MutationType() | ||
|
||
|
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.