prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Propose attendees/ticketing API
  With the orga app and the implementation of API endpoints in this PR https://github.com/fossasia/open-event-orga-server/pull/2379 we have the first steps to an attendee API. In how far would that overlap with a ticketing API?
  
  What is the best way to implement this and keep it generic? Do we need two APIs - Attendees and Ticketing or would that be handled in one API?
  
  Also related to https://github.com/fossasia/open-event-orga-server/issues/904
  
  
  </issue>
  <code>
  [start of app/api/tickets.py]
  1 from flask.ext.restplus import Namespace
  2 
  3 from app.helpers.ticketing import TicketingManager
  4 
  5 from .helpers.helpers import (
  6     requires_auth,
  7     can_access)
  8 from .helpers.utils import POST_RESPONSES
  9 from .helpers.utils import Resource
  10 from .helpers import custom_fields as fields
  11 from ..helpers.data_getter import DataGetter
  12 
  13 api = Namespace('tickets', description='Tickets', path='/')
  14 
  15 ORDER = api.model('Order', {
  16     'id': fields.Integer(),
  17     'identifier': fields.String(),
  18     'amount': fields.Float(),
  19     'paid_via': fields.String(),
  20     'invoice_number': fields.String(),
  21     'payment_mode': fields.String(),
  22     'status': fields.String(),
  23     'completed_at': fields.DateTime(),
  24 })
  25 
  26 TICKET = api.model('Ticket', {
  27     'id': fields.Integer(),
  28     'name': fields.String(),
  29     'description': fields.String(),
  30     'type': fields.String(),
  31     'price': fields.Float(),
  32     'quantity': fields.Integer(),
  33 })
  34 
  35 
  36 @api.route('/events/<int:event_id>/tickets/')
  37 class TicketsList(Resource):
  38     @requires_auth
  39     @api.doc('tickets', responses=POST_RESPONSES)
  40     @api.marshal_list_with(TICKET)
  41     def get(self, event_id):
  42         """Get tickets of the event"""
  43         return DataGetter.get_sales_open_tickets(event_id=event_id).all()
  44 
  45 
  46 @api.route('/events/<int:event_id>/tickets/<int:ticket_id>')
  47 class Ticket(Resource):
  48     @requires_auth
  49     @api.doc('ticket', responses=POST_RESPONSES)
  50     @api.marshal_with(TICKET)
  51     def get(self, event_id, ticket_id):
  52         """Get information about a ticket"""
  53         return TicketingManager.get_ticket(ticket_id=ticket_id)
  54 
  55 
  56 
  57
  [end of app/api/tickets.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/app/api/tickets.py b/app/api/tickets.py
  --- a/app/api/tickets.py
  +++ b/app/api/tickets.py
  @@ -52,5 +52,13 @@
           """Get information about a ticket"""
           return TicketingManager.get_ticket(ticket_id=ticket_id)
   
  +@api.route('/events/<int:event_id>/orders/<string:identifier>')
  +class Order(Resource):
  +    @requires_auth
  +    @api.doc('order', responses=POST_RESPONSES)
  +    @api.marshal_with(ORDER)
  +    def get(self, event_id, identifier):
  +        """Get information about a ticket"""
  +        return TicketingManager.get_order_by_identifier(identifier=identifier)
  
verification_info: {"golden_diff": "diff --git a/app/api/tickets.py b/app/api/tickets.py\n--- a/app/api/tickets.py\n+++ b/app/api/tickets.py\n@@ -52,5 +52,13 @@\n         \"\"\"Get information about a ticket\"\"\"\n         return TicketingManager.get_ticket(ticket_id=ticket_id)\n \n+@api.route('/events/<int:event_id>/orders/<string:identifier>')\n+class Order(Resource):\n+    @requires_auth\n+    @api.doc('order', responses=POST_RESPONSES)\n+    @api.marshal_with(ORDER)\n+    def get(self, event_id, identifier):\n+        \"\"\"Get information about a ticket\"\"\"\n+        return TicketingManager.get_order_by_identifier(identifier=identifier)\n", "issue": "Propose attendees/ticketing API\nWith the orga app and the implementation of API endpoints in this PR https://github.com/fossasia/open-event-orga-server/pull/2379 we have the first steps to an attendee API. In how far would that overlap with a ticketing API?\n\nWhat is the best way to implement this and keep it generic? Do we need two APIs - Attendees and Ticketing or would that be handled in one API?\n\nAlso related to https://github.com/fossasia/open-event-orga-server/issues/904\n\n", "before_files": [{"content": "from flask.ext.restplus import Namespace\n\nfrom app.helpers.ticketing import TicketingManager\n\nfrom .helpers.helpers import (\n    requires_auth,\n    can_access)\nfrom .helpers.utils import POST_RESPONSES\nfrom .helpers.utils import Resource\nfrom .helpers import custom_fields as fields\nfrom ..helpers.data_getter import DataGetter\n\napi = Namespace('tickets', description='Tickets', path='/')\n\nORDER = api.model('Order', {\n    'id': fields.Integer(),\n    'identifier': fields.String(),\n    'amount': fields.Float(),\n    'paid_via': fields.String(),\n    'invoice_number': fields.String(),\n    'payment_mode': fields.String(),\n    'status': fields.String(),\n    'completed_at': fields.DateTime(),\n})\n\nTICKET = api.model('Ticket', {\n    'id': fields.Integer(),\n    'name': fields.String(),\n    'description': fields.String(),\n    'type': fields.String(),\n    'price': fields.Float(),\n    'quantity': fields.Integer(),\n})\n\n\n@api.route('/events/<int:event_id>/tickets/')\nclass TicketsList(Resource):\n    @requires_auth\n    @api.doc('tickets', responses=POST_RESPONSES)\n    @api.marshal_list_with(TICKET)\n    def get(self, event_id):\n        \"\"\"Get tickets of the event\"\"\"\n        return DataGetter.get_sales_open_tickets(event_id=event_id).all()\n\n\n@api.route('/events/<int:event_id>/tickets/<int:ticket_id>')\nclass Ticket(Resource):\n    @requires_auth\n    @api.doc('ticket', responses=POST_RESPONSES)\n    @api.marshal_with(TICKET)\n    def get(self, event_id, ticket_id):\n        \"\"\"Get information about a ticket\"\"\"\n        return TicketingManager.get_ticket(ticket_id=ticket_id)\n\n\n\n", "path": "app/api/tickets.py"}]}