Skip to content

Commit 1e25f45

Browse files
committed
Merge branch 'development' of https://github.com/fossasia/open-event-server into docs
2 parents 3a39a34 + bb504da commit 1e25f45

File tree

3 files changed

+243
-15
lines changed

3 files changed

+243
-15
lines changed

docs/api/blueprint/attendees.apib

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,200 @@ Get a list of attendees of an order.
261261
"self": "/v1/orders/7201904e-c695-4251-a30a-61765a37ff24/attendees"
262262
}
263263
}
264+
265+
## List Attendees under an event [/v1/events/{event_id}/attendees]
266+
+ Parameters
267+
+ event_id: 1 (integer) - Identifier of the event
268+
269+
### List All Attendees under an event [GET]
270+
Get a list of attendees of an event.
271+
272+
+ Request
273+
274+
+ Headers
275+
276+
Accept: application/vnd.api+json
277+
278+
Authorization: JWT <Auth Key>
279+
280+
+ Response 200 (application/vnd.api+json)
281+
282+
{
283+
"meta": {
284+
"count": 1
285+
},
286+
"data": [
287+
{
288+
"relationships": {
289+
"ticket": {
290+
"links": {
291+
"self": "/v1/attendees/1/relationships/ticket",
292+
"related": "/v1/attendees/1/ticket"
293+
}
294+
},
295+
"order": {
296+
"links": {
297+
"self": "/v1/attendees/1/relationships/order",
298+
"related": "/v1/attendees/1/order"
299+
}
300+
},
301+
"event": {
302+
"links": {
303+
"self": "/v1/attendees/1/relationships/event",
304+
"related": "/v1/attendees/1/event"
305+
}
306+
},
307+
"user": {
308+
"links": {
309+
"self": "/v1/attendees/1/relationships/user",
310+
"related": "/v1/attendees/1/user"
311+
}
312+
}
313+
},
314+
"attributes": {
315+
"facebook": null,
316+
"address": "address",
317+
"ticket-id": "31",
318+
"is-checked-out": null,
319+
"checkout-times": null,
320+
"job-title": null,
321+
"deleted-at": null,
322+
"work-address": null,
323+
"checkin-times": null,
324+
"state": "example",
325+
"country": "IN",
326+
"lastname": "UnDoe",
327+
"city": "example",
328+
"phone": null,
329+
"company": null,
330+
"is-checked-in": false,
331+
"gender": null,
332+
"shipping-address": null,
333+
"blog": null,
334+
"firstname": "John",
335+
"website": null,
336+
"billing-address": null,
337+
"pdf-url": null,
338+
"tax-business-info": null,
339+
"home-address": null,
340+
"work-phone": null,
341+
"birth-date": null,
342+
"github": null,
343+
"twitter": null,
344+
"email": "johndoe@example.com",
345+
"attendee-notes": null
346+
},
347+
"type": "attendee",
348+
"id": "1",
349+
"links": {
350+
"self": "/v1/attendees/1"
351+
}
352+
}
353+
],
354+
"jsonapi": {
355+
"version": "1.0"
356+
},
357+
"links": {
358+
"self": "/v1/events/1/attendees"
359+
}
360+
}
361+
362+
## List Attendees under a ticket [/v1/tickets/{ticket_id}/attendees]
363+
+ Parameters
364+
+ ticket_id: 1 (integer) - Identifier of the event
365+
366+
### List All Attendees under a ticket [GET]
367+
Get a list of attendees of a ticket.
368+
369+
+ Request
370+
371+
+ Headers
372+
373+
Accept: application/vnd.api+json
374+
375+
Authorization: JWT <Auth Key>
376+
377+
+ Response 200 (application/vnd.api+json)
378+
379+
{
380+
"meta": {
381+
"count": 1
382+
},
383+
"data": [
384+
{
385+
"relationships": {
386+
"ticket": {
387+
"links": {
388+
"self": "/v1/attendees/1/relationships/ticket",
389+
"related": "/v1/attendees/1/ticket"
390+
}
391+
},
392+
"order": {
393+
"links": {
394+
"self": "/v1/attendees/1/relationships/order",
395+
"related": "/v1/attendees/1/order"
396+
}
397+
},
398+
"event": {
399+
"links": {
400+
"self": "/v1/attendees/1/relationships/event",
401+
"related": "/v1/attendees/1/event"
402+
}
403+
},
404+
"user": {
405+
"links": {
406+
"self": "/v1/attendees/1/relationships/user",
407+
"related": "/v1/attendees/1/user"
408+
}
409+
}
410+
},
411+
"attributes": {
412+
"facebook": null,
413+
"address": "address",
414+
"ticket-id": "1",
415+
"is-checked-out": null,
416+
"checkout-times": null,
417+
"job-title": null,
418+
"deleted-at": null,
419+
"work-address": null,
420+
"checkin-times": null,
421+
"state": "example",
422+
"country": "IN",
423+
"lastname": "UnDoe",
424+
"city": "example",
425+
"phone": null,
426+
"company": null,
427+
"is-checked-in": false,
428+
"gender": null,
429+
"shipping-address": null,
430+
"blog": null,
431+
"firstname": "John",
432+
"website": null,
433+
"billing-address": null,
434+
"pdf-url": null,
435+
"tax-business-info": null,
436+
"home-address": null,
437+
"work-phone": null,
438+
"birth-date": null,
439+
"github": null,
440+
"twitter": null,
441+
"email": "johndoe@example.com",
442+
"attendee-notes": null
443+
},
444+
"type": "attendee",
445+
"id": "1",
446+
"links": {
447+
"self": "/v1/attendees/1"
448+
}
449+
}
450+
],
451+
"jsonapi": {
452+
"version": "1.0"
453+
},
454+
"links": {
455+
"self": "/v1/tickets/1/attendees"
456+
}
457+
}
264458

265459
## Attendee Details [/v1/attendees/{attendee_id}]
266460
+ Parameters

docs/api/blueprint/auth/email_verification.apib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ Verifies the user email via token.
5050
+ Response 200 (application/json)
5151

5252
{
53-
"message": "your token"
53+
"message": "Email Verified"
5454
}

tests/hook_main.py

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,6 +1913,46 @@ def attendee_receipts(transaction):
19131913
db.session.commit()
19141914

19151915

1916+
@hooks.before("Attendees > List Attendees under an order > List All Attendees under an order")
1917+
def get_attendees_from_order(transaction):
1918+
"""
1919+
GET /v1/orders/{identifier}/attendees
1920+
:param transaction:
1921+
:return:
1922+
"""
1923+
with stash['app'].app_context():
1924+
order = OrderFactory()
1925+
order.identifier = "7201904e"
1926+
db.session.add(order)
1927+
db.session.commit()
1928+
1929+
1930+
@hooks.before("Attendees > List Attendees under an event > List All Attendees under an event")
1931+
def get_attendees_from_event(transaction):
1932+
"""
1933+
GET /v1/events/{event_id}/attendees
1934+
:param transaction:
1935+
:return:
1936+
"""
1937+
with stash['app'].app_context():
1938+
event = EventFactoryBasic()
1939+
db.session.add(event)
1940+
db.session.commit()
1941+
1942+
1943+
@hooks.before("Attendees > List Attendees under a ticket > List All Attendees under a ticket")
1944+
def get_attendees_from_ticket(transaction):
1945+
"""
1946+
GET /v1/tickets/{ticket_id}/attendees
1947+
:param transaction:
1948+
:return:
1949+
"""
1950+
with stash['app'].app_context():
1951+
ticket = TicketFactory()
1952+
db.session.add(ticket)
1953+
db.session.commit()
1954+
1955+
19161956
# ------------------------- Tracks -------------------------
19171957
@hooks.before("Tracks > Tracks Collection > Create Track")
19181958
def track_post(transaction):
@@ -4145,20 +4185,6 @@ def get_event_from_order(transaction):
41454185
db.session.commit()
41464186

41474187

4148-
@hooks.before("Attendees > List Attendees under an order > List All Attendees under an order")
4149-
def get_attendees_from_order(transaction):
4150-
"""
4151-
GET /v1/orders/{identifier}/attendees
4152-
:param transaction:
4153-
:return:
4154-
"""
4155-
with stash['app'].app_context():
4156-
order = OrderFactory()
4157-
order.identifier = "7201904e"
4158-
db.session.add(order)
4159-
db.session.commit()
4160-
4161-
41624188
@hooks.before("Change Password > Reset Forgotten Password > Reset Password from Token")
41634189
def reset_password_patch(transaction):
41644190
"""
@@ -4172,6 +4198,14 @@ def reset_password_patch(transaction):
41724198
db.session.add(user)
41734199
db.session.commit()
41744200

4201+
@hooks.before("Email Verification > Verify Email > Verify the email via auth token")
4202+
def verify_email_from_token(transaction):
4203+
"""
4204+
POST /v1/auth/verify-email
4205+
:param transaction:
4206+
:return:
4207+
"""
4208+
transaction['skip'] = True
41754209

41764210
# ------------------------- Custom System Role -------------------------
41774211

0 commit comments

Comments
 (0)