You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker-compose exec backend python manage.py test --keepdb
58
+
```
27
59
28
60
## 3. Challenge resolution
29
-
...
61
+
Before talking about code I'd like to clarify the development process that I used throughout the project.
62
+
63
+
First of all, I did the analyses, created tasks and put them on a Kanban Board: https://github.com/muriloacs/ze-backend-code-challenge/projects/1
64
+
65
+
After that I started creating dedicated branches on Git for each one of those tasks. Each one of them led to a PR: https://github.com/muriloacs/ze-backend-code-challenge/pulls?q=is%3Apr+
66
+
67
+
I set the Github project to only allow "Squash and Merge" on PRs so the Git history looks crystal clear.
68
+
69
+
This application is able to create partners and search for them through either an ID or by location.
70
+
The location search ensures to seek the nearest partner which the coverage area includes the location.
71
+
APIs are exposed through the GraphQL endpoint: http://localhost:8000/graphql.
72
+
73
+
Database table is properly indexed in order to make search faster.
74
+
75
+
I tried to keep the project clean and the code readable to humans as I always do :)
76
+
77
+
Now let's play around with the API: http://localhost:8000/graphql
30
78
31
79
### 3.1. Create a partner:
80
+
Create a partner and copy the returned id so you can use it in the next Query.
81
+
```
32
82
mutation {
33
83
partner(
34
84
input: {
@@ -56,8 +106,11 @@ mutation {
56
106
}
57
107
}
58
108
}
109
+
```
59
110
60
111
### 3.2. Load partner by id:
112
+
Use here the partner id that was returned in the Mutation.
113
+
```
61
114
query {
62
115
partner (id: "UGFydG5lclR5cGU6MQ==") {
63
116
id
@@ -74,10 +127,15 @@ query {
74
127
}
75
128
}
76
129
}
130
+
```
77
131
78
132
### 3.3. Search partner by location:
133
+
After saving some partners you can query by location (lat/long).
134
+
135
+
The search ensures to find the nearest partner which the coverage area includes the location.
0 commit comments