Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions docs/api/api_blueprint.apib
Original file line number Diff line number Diff line change
Expand Up @@ -14495,7 +14495,7 @@ Delete a single ticket.
+ filter (optional, string, `[]`) - Filter according to the flask-rest-jsonapi filtering system. Please refer: http://flask-rest-jsonapi.readthedocs.io/en/latest/filtering.html for more.


### List Tickets [GET]
### List Tickets under an Event [GET]

+ Request

Expand Down Expand Up @@ -14583,7 +14583,7 @@ Delete a single ticket.
+ filter (optional, string, `[]`) - Filter according to the flask-rest-jsonapi filtering system. Please refer: http://flask-rest-jsonapi.readthedocs.io/en/latest/filtering.html for more.


### List Tickets [GET]
### List Tickets under a Ticket-tag [GET]

+ Request

Expand Down Expand Up @@ -14671,7 +14671,7 @@ Delete a single ticket.
+ filter (optional, string, `[]`) - Filter according to the flask-rest-jsonapi filtering system. Please refer: http://flask-rest-jsonapi.readthedocs.io/en/latest/filtering.html for more.


### List Tickets [GET]
### List Tickets for an Access Code [GET]

+ Request

Expand Down Expand Up @@ -14758,7 +14758,7 @@ Delete a single ticket.
+ filter (optional, string, `[]`) - Filter according to the flask-rest-jsonapi filtering system. Please refer: http://flask-rest-jsonapi.readthedocs.io/en/latest/filtering.html for more.


### List Tickets [GET]
### List Tickets for a Discount Code [GET]

+ Request

Expand Down Expand Up @@ -14843,7 +14843,7 @@ Delete a single ticket.
+ Parameters
+ order_identifier: 7201904e (string) - Indetifier of the order

### List Tickets [GET]
### List Tickets for an Order [GET]

+ Request

Expand Down Expand Up @@ -15141,7 +15141,7 @@ Delete a single ticket tag.
+ sort (optional, string, `name`) - Sort the resources according to the given attribute in ascending order. Append '-' to sort in descending order.
+ filter (optional, string, `[]`) - Filter according to the flask-rest-jsonapi filtering system. Please refer: http://flask-rest-jsonapi.readthedocs.io/en/latest/filtering.html for more.

### List all Ticket Tags [GET]
### List Ticket Tags under an Event [GET]

+ Request (application/vnd.api+json)

Expand Down Expand Up @@ -15200,7 +15200,7 @@ Delete a single ticket tag.
+ sort (optional, string, `name`) - Sort the resources according to the given attribute in ascending order. Append '-' to sort in descending order.
+ filter (optional, string, `[]`) - Filter according to the flask-rest-jsonapi filtering system. Please refer: http://flask-rest-jsonapi.readthedocs.io/en/latest/filtering.html for more.

### List all Ticket Tags [GET]
### List Ticket Tags for a Ticket [GET]

+ Request (application/vnd.api+json)

Expand Down
39 changes: 19 additions & 20 deletions tests/hook_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,7 @@ def ticket_delete(transaction):
db.session.commit()


@hooks.before("Tickets > List Tickets under an Event > List Tickets")
@hooks.before("Tickets > List Tickets under an Event > List Tickets under an Event")
def ticket_event(transaction):
"""
GET /events/1/tickets
Expand All @@ -1634,7 +1634,7 @@ def ticket_event(transaction):
db.session.commit()


@hooks.before("Tickets > List Tickets under a Ticket-tag > List Tickets")
@hooks.before("Tickets > List Tickets under a Ticket-tag > List Tickets under a Ticket-tag")
def tikcet_tag_ticket(transaction):
"""
GET /tikcet-tags/1/tickets
Expand All @@ -1647,7 +1647,7 @@ def tikcet_tag_ticket(transaction):
db.session.commit()


@hooks.before("Tickets > List Tickets for an Access Code > List Tickets")
@hooks.before("Tickets > List Tickets for an Access Code > List Tickets for an Access Code")
def access_code_ticket(transaction):
"""
GET /access-codes/1/tickets
Expand All @@ -1660,7 +1660,7 @@ def access_code_ticket(transaction):
db.session.commit()


@hooks.before("Tickets > List Tickets for a Discount Code > List Tickets")
@hooks.before("Tickets > List Tickets for a Discount Code > List Tickets for a Discount Code")
def discount_code_ticket(transaction):
"""
GET /discount-codes/1/tickets
Expand All @@ -1673,6 +1673,19 @@ def discount_code_ticket(transaction):
db.session.commit()


@hooks.before("Tickets > List Tickets for an Order > List Tickets for an Order")
def get_tickets_from_order(transaction):
"""
GET /v1/orders/{identifier}/tickets
:param transaction:
:return:
"""
with stash['app'].app_context():
order = OrderFactory()
order.identifier = "7201904e"
db.session.add(order)
db.session.commit()

# ------------------------- Ticket Fees -------------------------
@hooks.before("Ticket Fees > Ticket Fees Collection > List Ticket Fees")
def ticket_fees_get_list(transaction):
Expand Down Expand Up @@ -1792,7 +1805,7 @@ def ticket_tag_delete(transaction):
db.session.commit()


@hooks.before("Ticket Tags > List Ticket Tags under an Event > List all Ticket Tags")
@hooks.before("Ticket Tags > List Ticket Tags under an Event > List Ticket Tags under an Event")
def ticket_tag_event(transaction):
"""
GET /events/1/ticket-tags
Expand All @@ -1805,7 +1818,7 @@ def ticket_tag_event(transaction):
db.session.commit()


@hooks.before("Ticket Tags > List Ticket Tags for a Ticket > List all Ticket Tags")
@hooks.before("Ticket Tags > List Ticket Tags for a Ticket > List Ticket Tags for a Ticket")
def ticket_tag_ticket(transaction):
"""
GET /tickets/1/ticket-tags
Expand Down Expand Up @@ -4131,20 +4144,6 @@ def get_event_from_order(transaction):
db.session.commit()


@hooks.before("Tickets > List Tickets for an Order > List Tickets")
def get_tickets_from_order(transaction):
"""
GET /v1/orders/{identifier}/tickets
:param transaction:
:return:
"""
with stash['app'].app_context():
order = OrderFactory()
order.identifier = "7201904e"
db.session.add(order)
db.session.commit()


@hooks.before("Attendees > List Attendees under an order > List All Attendees under an order")
def get_attendees_from_order(transaction):
"""
Expand Down