-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathapi.http
125 lines (98 loc) · 2.47 KB
/
api.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
###
# @name loginPartner1
POST http://localhost:3000/auth/login
Content-Type: application/json
{
"email": "partner1@user.com",
"password": "secret"
}
###
@tokenPartner1 = {{ loginPartner1.response.body.token }}
###
# @name loginPartner2
POST http://localhost:3000/auth/login
Content-Type: application/json
{
"email": "partner2@user.com",
"password": "secret"
}
###
@tokenPartner2 = {{ loginPartner2.response.body.token }}
###
# @name loginCustomer1
POST http://localhost:3000/auth/login
Content-Type: application/json
{
"email": "customer1@user.com",
"password": "secret"
}
###
@tokenCustomer1 = {{ loginCustomer1.response.body.token }}
### Criação do partner 1
POST http://localhost:3000/partners/register
Content-Type: application/json
{
"name": "Partner 1",
"email": "partner1@user.com",
"password": "secret",
"company_name": "Company Name 1"
}
### Criação do partner 2
POST http://localhost:3000/partners/register
Content-Type: application/json
{
"name": "Partner 2",
"email": "partner2@user.com",
"password": "secret",
"company_name": "Company Name 2"
}
###
POST http://localhost:3000/customers/register
Content-Type: application/json
{
"name": "Customer 1",
"email": "customer1@user.com",
"password": "secret",
"address": "address test",
"phone": "333333333"
}
### Criação do evento pelo parceiro
POST http://localhost:3000/partners/events
Content-Type: application/json
Authorization: Bearer {{ tokenPartner1 }}
{
"name": "Evento test 1",
"description": "descrição do evento",
"date": "2025-01-01T00:00:00",
"location": "Rua x, bairro etc"
}
### Listagem de eventos do parceiro
GET http://localhost:3000/partners/events
Authorization: Bearer {{ tokenPartner1 }}
### ### Listagem de um evento do parceiro
GET http://localhost:3000/partners/events/1
Authorization: Bearer {{ tokenPartner1 }}
### Criação de tickets
POST http://localhost:3000/events/1/tickets
Content-Type: application/json
Authorization: Bearer {{ tokenPartner1 }}
{
"num_tickets": 10,
"price": 100
}
### (poderia trabalhar com paginação)
GET http://localhost:3000/events/1/tickets
###
GET http://localhost:3000/events/1/tickets/1
### Listagem de eventos
GET http://localhost:3000/events
### Listagem de um evento
GET http://localhost:3000/events/1
###
POST http://localhost:3000/purchases
Content-Type: application/json
Authorization: Bearer {{ tokenCustomer1 }}
{
"ticket_ids": [1],
"card_token": "tok_visa"
}