-
Notifications
You must be signed in to change notification settings - Fork 0
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 #89 from whyphi/dev/v1.0
merge: `v2.0`
- Loading branch information
Showing
32 changed files
with
1,714 additions
and
1,029 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
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 was deleted.
Oops, something went wrong.
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,69 @@ | ||
from chalice import Blueprint | ||
from chalicelib.decorators import auth | ||
from chalicelib.services.EventsMemberService import events_member_service | ||
from chalicelib.models.roles import Roles | ||
|
||
events_member_api = Blueprint(__name__) | ||
|
||
|
||
@events_member_api.route("/timeframes", methods=["POST"], cors=True) | ||
@auth(events_member_api, roles=[Roles.ADMIN]) | ||
def create_timeframe(): | ||
data = events_member_api.current_request.json_body | ||
return events_member_service.create_timeframe(data) | ||
|
||
|
||
@events_member_api.route("/timeframes", methods=["GET"], cors=True) | ||
@auth(events_member_api, roles=[Roles.ADMIN, Roles.MEMBER]) | ||
def get_all_timeframes(): | ||
return events_member_service.get_all_timeframes() | ||
|
||
|
||
@events_member_api.route("/timeframes/{timeframe_id}", methods=["GET"], cors=True) | ||
@auth(events_member_api, roles=[Roles.ADMIN, Roles.MEMBER]) | ||
def get_timeframe(timeframe_id: str): | ||
return events_member_service.get_timeframe(timeframe_id) | ||
|
||
|
||
@events_member_api.route("/timeframes/{timeframe_id}", methods=["DELETE"], cors=True) | ||
@auth(events_member_api, roles=[Roles.ADMIN]) | ||
def delete_timeframe(timeframe_id: str): | ||
return events_member_service.delete_timeframe(timeframe_id) | ||
|
||
|
||
@events_member_api.route("/timeframes/{timeframe_id}/events", methods=["POST"], cors=True) | ||
@auth(events_member_api, roles=[Roles.ADMIN]) | ||
def create_event(timeframe_id: str): | ||
data = events_member_api.current_request.json_body | ||
return events_member_service.create_event(timeframe_id, data) | ||
|
||
|
||
@events_member_api.route("/events/{event_id}", methods=["GET"], cors=True) | ||
@auth(events_member_api, roles=[Roles.ADMIN, Roles.MEMBER]) | ||
def get_event(event_id: str): | ||
return events_member_service.get_event(event_id) | ||
|
||
|
||
@events_member_api.route("/timeframes/{timeframe_id}/sheets", methods=["GET"], cors=True) | ||
@auth(events_member_api, roles=[Roles.ADMIN, Roles.MEMBER]) | ||
def get_timeframe_sheets(timeframe_id: str): | ||
return events_member_service.get_timeframe_sheets(timeframe_id) | ||
|
||
|
||
@events_member_api.route("/events/{event_id}/checkin", methods=["POST"], cors=True) | ||
@auth(events_member_api, roles=[Roles.ADMIN, Roles.MEMBER]) | ||
def checkin(event_id: str): | ||
data = events_member_api.current_request.json_body | ||
return events_member_service.checkin(event_id, data) | ||
|
||
|
||
@events_member_api.route("/events/{event_id}", methods=["PATCH"], cors=True) | ||
@auth(events_member_api, roles=[Roles.ADMIN]) | ||
def update_event(event_id: str): | ||
pass | ||
|
||
|
||
@events_member_api.route("/events/{event_id}", methods=["DELETE"], cors=True) | ||
@auth(events_member_api, roles=[Roles.ADMIN]) | ||
def delete_event(event_id: str): | ||
return events_member_service.delete(event_id) |
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,70 @@ | ||
from chalice import Blueprint | ||
from chalicelib.decorators import auth | ||
from chalicelib.services.EventsRushService import events_rush_service | ||
from chalicelib.models.roles import Roles | ||
|
||
|
||
events_rush_api = Blueprint(__name__) | ||
|
||
|
||
@events_rush_api.route("/events/rush", methods=["GET"], cors=True) | ||
@auth(events_rush_api, roles=[Roles.ADMIN, Roles.MEMBER]) | ||
def get_rush_events(): | ||
return events_rush_service.get_rush_categories_and_events() | ||
|
||
|
||
@events_rush_api.route("/events/rush/{event_id}", methods=["POST"], cors=True) | ||
def get_rush_event(event_id): | ||
data = events_rush_api.current_request.json_body | ||
return events_rush_service.get_rush_event(event_id=event_id, data=data) | ||
|
||
|
||
@events_rush_api.route("/events/rush/category", methods=["POST"], cors=True) | ||
@auth(events_rush_api, roles=[Roles.ADMIN]) | ||
def create_rush_category(): | ||
data = events_rush_api.current_request.json_body | ||
return events_rush_service.create_rush_category(data) | ||
|
||
|
||
@events_rush_api.route("/events/rush", methods=["POST"], cors=True) | ||
@auth(events_rush_api, roles=[Roles.ADMIN]) | ||
def create_rush_event(): | ||
data = events_rush_api.current_request.json_body | ||
return events_rush_service.create_rush_event(data) | ||
|
||
|
||
@events_rush_api.route("/events/rush", methods=["PATCH"], cors=True) | ||
@auth(events_rush_api, roles=[Roles.ADMIN]) | ||
def modify_rush_event(): | ||
data = events_rush_api.current_request.json_body | ||
return events_rush_service.modify_rush_event(data) | ||
|
||
@events_rush_api.route("/events/rush/settings", methods=["PATCH"], cors=True) | ||
@auth(events_rush_api, roles=[Roles.ADMIN]) | ||
def modify_rush_settings(): | ||
data = events_rush_api.current_request.json_body | ||
return events_rush_service.modify_rush_settings(data) | ||
|
||
|
||
@events_rush_api.route("/events/rush/checkin/{event_id}", methods=["POST"], cors=True) | ||
def checkin_rush(event_id): | ||
data = events_rush_api.current_request.json_body | ||
return events_rush_service.checkin_rush(event_id, data) | ||
|
||
|
||
@events_rush_api.route("/events/rush/default", methods=["POST"], cors=True) | ||
def get_rush_events_default_category(): | ||
data = events_rush_api.current_request.json_body | ||
return events_rush_service.get_rush_events_default_category(data) | ||
|
||
|
||
@events_rush_api.route("/events/rush/{event_id}", methods=["DELETE"], cors=True) | ||
@auth(events_rush_api, roles=[Roles.ADMIN]) | ||
def delete_rush_event(event_id): | ||
return events_rush_service.delete_rush_event(event_id) | ||
|
||
|
||
@events_rush_api.route("/events/rush/{category_id}/analytics", methods=["GET"], cors=True) | ||
@auth(events_rush_api, roles=[Roles.ADMIN]) | ||
def get_rush_category_analytics(category_id): | ||
return events_rush_service.get_rush_category_analytics(category_id=category_id) |
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
Oops, something went wrong.