diff --git a/.github/workflows/ci-cd-pipeline.yml b/.github/workflows/ci-cd-pipeline.yml index e0fd2bf..3005060 100644 --- a/.github/workflows/ci-cd-pipeline.yml +++ b/.github/workflows/ci-cd-pipeline.yml @@ -15,6 +15,7 @@ jobs: python-version: "3.9" - name: Test with unittest run: | + cd server python -m pip install --upgrade pip pip install -r requirements.txt pip install -r requirements-test.txt @@ -25,5 +26,5 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: eu-west-2 - - run: sam build --use-container && cd .aws-sam/build/PinfluencerFunction && rm -fr clean-build.sh tests events env.json README.md samconfig.toml template.yaml requirements.txt - - run: sam deploy --no-fail-on-empty-changeset --no-confirm-changeset --stack-name pinfluencer-api-staging --s3-bucket aws-sam-cli-managed-default-samclisourcebucket-1mycbpdtzxnbk --region eu-west-2 --capabilities CAPABILITY_IAM --parameter-overrides ${{ secrets.SAM_PARAMETER_OVERRIDES }} + - run: cd server && sam build --use-container && cd .aws-sam/build/PinfluencerFunction && rm -fr clean-build.sh tests events env.json README.md samconfig.toml template.yaml requirements.txt + - run: cd server && sam deploy --no-fail-on-empty-changeset --no-confirm-changeset --stack-name pinfluencer-api-staging --s3-bucket aws-sam-cli-managed-default-samclisourcebucket-1mycbpdtzxnbk --region eu-west-2 --capabilities CAPABILITY_IAM --parameter-overrides ${{ secrets.SAM_PARAMETER_OVERRIDES }} diff --git a/.gitignore b/.gitignore index 80b888d..15d6fae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ # Created by https://www.gitignore.io/api/osx,linux,python,windows,pycharm,visualstudiocode -/.idea +*.idea ### Linux ### *~ @@ -246,17 +246,17 @@ $RECYCLE.BIN/ # SAM packaged.yaml .aws-sam/ -samconfig.toml +server/samconfig.toml samconfig.toml.olddb env.json # End of https://www.gitignore.io/api/osx,linux,python,windows,pycharm,visualstudiocode # sandbox -sandbox.py +server/sandbox.py # aws -awssecrets.secrets +server/awssecrets.secrets # test runenr artifacts -/tests/template.yaml \ No newline at end of file +/server/tests/template.yaml \ No newline at end of file diff --git a/__init__.py b/server/__init__.py similarity index 100% rename from __init__.py rename to server/__init__.py diff --git a/clean-build-winblows.cmd b/server/clean-build-winblows.cmd similarity index 100% rename from clean-build-winblows.cmd rename to server/clean-build-winblows.cmd diff --git a/clean-build.sh b/server/clean-build.sh old mode 100755 new mode 100644 similarity index 100% rename from clean-build.sh rename to server/clean-build.sh diff --git a/local_api.py b/server/local_api.py similarity index 100% rename from local_api.py rename to server/local_api.py diff --git a/requirements-test.txt b/server/requirements-test.txt similarity index 100% rename from requirements-test.txt rename to server/requirements-test.txt diff --git a/requirements.txt b/server/requirements.txt similarity index 100% rename from requirements.txt rename to server/requirements.txt diff --git a/reset_schema.py b/server/reset_schema.py similarity index 100% rename from reset_schema.py rename to server/reset_schema.py diff --git a/schema.txt b/server/schema.txt similarity index 100% rename from schema.txt rename to server/schema.txt diff --git a/src/__init__.py b/server/src/__init__.py similarity index 100% rename from src/__init__.py rename to server/src/__init__.py diff --git a/src/_types.py b/server/src/_types.py similarity index 100% rename from src/_types.py rename to server/src/_types.py diff --git a/src/app.py b/server/src/app.py similarity index 100% rename from src/app.py rename to server/src/app.py diff --git a/src/crosscutting/__init__.py b/server/src/crosscutting/__init__.py similarity index 100% rename from src/crosscutting/__init__.py rename to server/src/crosscutting/__init__.py diff --git a/src/data/__init__.py b/server/src/data/__init__.py similarity index 100% rename from src/data/__init__.py rename to server/src/data/__init__.py diff --git a/src/data/entities.py b/server/src/data/entities.py similarity index 99% rename from src/data/entities.py rename to server/src/data/entities.py index 5348991..6745a5f 100644 --- a/src/data/entities.py +++ b/server/src/data/entities.py @@ -2,7 +2,6 @@ import sqlalchemy.orm from sqlalchemy import Column, String, DateTime, Float, Table, Integer, Boolean, Enum, orm, and_ -from sqlalchemy.orm import foreign from src import T from src.data import Base diff --git a/src/data/repositories.py b/server/src/data/repositories.py similarity index 100% rename from src/data/repositories.py rename to server/src/data/repositories.py diff --git a/src/domain/__init__.py b/server/src/domain/__init__.py similarity index 100% rename from src/domain/__init__.py rename to server/src/domain/__init__.py diff --git a/src/domain/models.py b/server/src/domain/models.py similarity index 100% rename from src/domain/models.py rename to server/src/domain/models.py diff --git a/src/domain/validation.py b/server/src/domain/validation.py similarity index 100% rename from src/domain/validation.py rename to server/src/domain/validation.py diff --git a/src/exceptions.py b/server/src/exceptions.py similarity index 100% rename from src/exceptions.py rename to server/src/exceptions.py diff --git a/src/web/__init__.py b/server/src/web/__init__.py similarity index 100% rename from src/web/__init__.py rename to server/src/web/__init__.py diff --git a/src/web/constants.py b/server/src/web/constants.py similarity index 100% rename from src/web/constants.py rename to server/src/web/constants.py diff --git a/src/web/controllers.py b/server/src/web/controllers.py similarity index 100% rename from src/web/controllers.py rename to server/src/web/controllers.py diff --git a/src/web/error_capsules.py b/server/src/web/error_capsules.py similarity index 100% rename from src/web/error_capsules.py rename to server/src/web/error_capsules.py diff --git a/src/web/hooks.py b/server/src/web/hooks.py similarity index 100% rename from src/web/hooks.py rename to server/src/web/hooks.py diff --git a/src/web/mapping.py b/server/src/web/mapping.py similarity index 100% rename from src/web/mapping.py rename to server/src/web/mapping.py diff --git a/src/web/middleware.py b/server/src/web/middleware.py similarity index 100% rename from src/web/middleware.py rename to server/src/web/middleware.py diff --git a/src/web/routing.py b/server/src/web/routing.py similarity index 100% rename from src/web/routing.py rename to server/src/web/routing.py diff --git a/src/web/sequences.py b/server/src/web/sequences.py similarity index 99% rename from src/web/sequences.py rename to server/src/web/sequences.py index a41c855..7313369 100644 --- a/src/web/sequences.py +++ b/server/src/web/sequences.py @@ -740,6 +740,17 @@ def build(self): self._add_command(command=self.__influencer_listing_controller.get_all) +class SequenceBuilder(FluentSequenceBuilder): + + def __init__(self, + influencer_listing_controller: InfluencerListingController): + super().__init__() + self.__influencer_listing_controller = influencer_listing_controller + + def build(self): + self._add_command(command=self.__influencer_listing_controller.get_all) + + class NotImplementedSequenceBuilder(FluentSequenceBuilder): def __init__(self): diff --git a/src/web/views.py b/server/src/web/views.py similarity index 100% rename from src/web/views.py rename to server/src/web/views.py diff --git a/template.yaml b/server/template.yaml similarity index 100% rename from template.yaml rename to server/template.yaml diff --git a/test_runner.py b/server/test_runner.py similarity index 100% rename from test_runner.py rename to server/test_runner.py diff --git a/tests/__init__.py b/server/tests/__init__.py similarity index 100% rename from tests/__init__.py rename to server/tests/__init__.py diff --git a/tests/test_app.py b/server/tests/test_app.py similarity index 100% rename from tests/test_app.py rename to server/tests/test_app.py diff --git a/tests/test_controllers.py b/server/tests/test_controllers.py similarity index 100% rename from tests/test_controllers.py rename to server/tests/test_controllers.py diff --git a/tests/test_crosscutting.py b/server/tests/test_crosscutting.py similarity index 100% rename from tests/test_crosscutting.py rename to server/tests/test_crosscutting.py diff --git a/tests/test_data_mapping.py b/server/tests/test_data_mapping.py similarity index 100% rename from tests/test_data_mapping.py rename to server/tests/test_data_mapping.py diff --git a/tests/test_data_schema.py b/server/tests/test_data_schema.py similarity index 100% rename from tests/test_data_schema.py rename to server/tests/test_data_schema.py diff --git a/tests/test_hooks.py b/server/tests/test_hooks.py similarity index 99% rename from tests/test_hooks.py rename to server/tests/test_hooks.py index 187a58f..d70cf31 100644 --- a/tests/test_hooks.py +++ b/server/tests/test_hooks.py @@ -15,7 +15,7 @@ from src.exceptions import NotFoundException from src.web import PinfluencerContext, PinfluencerResponse from src.web.error_capsules import AudienceDataAlreadyExistsErrorCapsule, BrandNotFoundErrorCapsule, \ - InfluencerNotFoundErrorCapsule, ListingNotFoundErrorCapsule, AudienceDataNotFoundErrorCapsule, BrandNotAuthorized + InfluencerNotFoundErrorCapsule, ListingNotFoundErrorCapsule, BrandNotAuthorized from src.web.hooks import UserAfterHooks, UserBeforeHooks, BrandAfterHooks, InfluencerAfterHooks, CommonBeforeHooks, \ InfluencerBeforeHooks, BrandBeforeHooks, ListingBeforeHooks, ListingAfterHooks, CommonAfterHooks, \ NotificationAfterHooks, NotificationBeforeHooks, AudienceAgeBeforeHooks, AudienceCommonHooks, \ diff --git a/tests/test_mapping.py b/server/tests/test_mapping.py similarity index 100% rename from tests/test_mapping.py rename to server/tests/test_mapping.py diff --git a/tests/test_repositories.py b/server/tests/test_repositories.py similarity index 100% rename from tests/test_repositories.py rename to server/tests/test_repositories.py diff --git a/tests/test_routing.py b/server/tests/test_routing.py similarity index 100% rename from tests/test_routing.py rename to server/tests/test_routing.py diff --git a/tests/test_sequences.py b/server/tests/test_sequences.py similarity index 100% rename from tests/test_sequences.py rename to server/tests/test_sequences.py diff --git a/tests/test_web.py b/server/tests/test_web.py similarity index 100% rename from tests/test_web.py rename to server/tests/test_web.py