ci: add Dockerfile
This commit is contained in:
parent
72ee09b064
commit
65a56f2658
15 changed files with 382 additions and 70 deletions
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"version": "2.0",
|
||||
"app_name": "secretsanta",
|
||||
"stages": {
|
||||
"dev": {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,8 +4,8 @@ from chalice import Chalice
|
|||
from secretsanta.domain import Group
|
||||
from secretsanta.repo import S3Repo
|
||||
from secretsanta.service import (
|
||||
GetGroupParticipantsService,
|
||||
CreateGroupService,
|
||||
GetGroupParticipantsService,
|
||||
GetPairService,
|
||||
)
|
||||
from secretsanta.settings import get_config
|
||||
|
|
@ -16,13 +16,6 @@ app = Chalice(app_name="secretsanta", debug=config.environment == "local")
|
|||
repo = S3Repo()
|
||||
|
||||
|
||||
def _participants2url(participants: list[str], group_uuid: str) -> list[str]:
|
||||
return [
|
||||
f"{config.server_url}/api/v1/groups/{group_uuid}/pair/{participant_name}"
|
||||
for participant_name in participants
|
||||
]
|
||||
|
||||
|
||||
@app.route("/api/v1/groups/{group_uuid}")
|
||||
def get_participants(group_uuid: str):
|
||||
service = GetGroupParticipantsService(repo)
|
||||
|
|
@ -34,8 +27,7 @@ def create_group(group_uuid: str):
|
|||
request = app.current_request
|
||||
body = request.json_body
|
||||
service = CreateGroupService(repo)
|
||||
participants = anyio.run(service.run, Group(uuid=group_uuid, **body)).participants
|
||||
return _participants2url(participants, group_uuid)
|
||||
return anyio.run(service.run, Group(uuid=group_uuid, **body))
|
||||
|
||||
|
||||
@app.route("/api/v1/groups/{group_uuid}/pair/{participant}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue