├── app.php ├── app.js ├── app.py ├── README.md └── products.json /app.php: -------------------------------------------------------------------------------- 1 | JSON) and he wants to find products that match your food restrictions. 6 | Based on this you will need to develop: 7 | 8 | - a simple API to search products in the .json available; 9 | - it should be possible to search for products by their specifications (one or more); 10 | - it must be possible to order the result by price (asc and desc); 11 | 12 | The test should be done in PHP, Python or NodeJS. We expect at the end of the test, outside the API running, the following items: 13 | 14 | - an explanation of what is needed to make your project work; 15 | - an explanation of how to perform the tests; 16 | 17 | Remember that at the time of the evaluation we will look at: 18 | 19 | - Code organization; 20 | - Object-Oriented Principles; 21 | - Unit tests 22 | - Maintenance; 23 | 24 | To send us your code, you must: 25 | 26 | Make a fork of this repository, and send us a pull-request. 27 | -------------------------------------------------------------------------------- /products.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "name": "Sopa de castanha do par\u00e1", 5 | "price": 9.82, 6 | "specifications": [ 7 | "low-carb" 8 | ] 9 | }, 10 | { 11 | "id": 2, 12 | "name": "C\u00e1psulas de castanha do par\u00e1", 13 | "price": 27.37, 14 | "specifications": [ 15 | "lactose-free", 16 | "low-carb" 17 | ] 18 | }, 19 | { 20 | "id": 3, 21 | "name": "Chips de milho", 22 | "price": 32.24, 23 | "specifications": [ 24 | "low-carb", 25 | "vegan", 26 | "gluten-free", 27 | "vegetarian", 28 | "lactose-free" 29 | ] 30 | }, 31 | { 32 | "id": 4, 33 | "name": "C\u00e1psulas de morango", 34 | "price": 24.29, 35 | "specifications": [ 36 | "low-carb" 37 | ] 38 | }, 39 | { 40 | "id": 5, 41 | "name": "C\u00e1psulas de milho", 42 | "price": 9.16, 43 | "specifications": [ 44 | "lactose-free", 45 | "gluten-free", 46 | "sugar-free", 47 | "vegan", 48 | "vegetarian" 49 | ] 50 | }, 51 | { 52 | "id": 6, 53 | "name": "Sopa de milho", 54 | "price": 7.4, 55 | "specifications": [ 56 | "vegan", 57 | "gluten-free", 58 | "vegetarian", 59 | "low-carb", 60 | "lactose-free" 61 | ] 62 | }, 63 | { 64 | "id": 7, 65 | "name": "Chips de morango", 66 | "price": 13.83, 67 | "specifications": [ 68 | "gluten-free", 69 | "low-carb" 70 | ] 71 | }, 72 | { 73 | "id": 8, 74 | "name": "Chips de castanha do par\u00e1", 75 | "price": 11.31, 76 | "specifications": [ 77 | "lactose-free", 78 | "vegetarian" 79 | ] 80 | }, 81 | { 82 | "id": 9, 83 | "name": "C\u00e1psulas de castanha do par\u00e1", 84 | "price": 32.59, 85 | "specifications": [ 86 | "vegan", 87 | "sugar-free" 88 | ] 89 | }, 90 | { 91 | "id": 10, 92 | "name": "Barrinhas de mandioquinha", 93 | "price": 14.41, 94 | "specifications": [ 95 | "vegan", 96 | "low-carb", 97 | "sugar-free" 98 | ] 99 | }, 100 | { 101 | "id": 11, 102 | "name": "Salgadinho de morango", 103 | "price": 16.12, 104 | "specifications": [ 105 | "gluten-free", 106 | "low-carb", 107 | "lactose-free", 108 | "sugar-free" 109 | ] 110 | }, 111 | { 112 | "id": 12, 113 | "name": "C\u00e1psulas de milho", 114 | "price": 7.36, 115 | "specifications": [ 116 | "vegan", 117 | "vegetarian", 118 | "sugar-free" 119 | ] 120 | }, 121 | { 122 | "id": 13, 123 | "name": "Sopa de lim\u00e3o", 124 | "price": 20.79, 125 | "specifications": [ 126 | "low-carb", 127 | "sugar-free", 128 | "vegan", 129 | "lactose-free" 130 | ] 131 | }, 132 | { 133 | "id": 14, 134 | "name": "C\u00e1psulas de lim\u00e3o", 135 | "price": 26.98, 136 | "specifications": [ 137 | "gluten-free", 138 | "vegetarian", 139 | "sugar-free", 140 | "lactose-free" 141 | ] 142 | }, 143 | { 144 | "id": 15, 145 | "name": "C\u00e1psulas de morango", 146 | "price": 25.63, 147 | "specifications": [ 148 | "lactose-free", 149 | "gluten-free" 150 | ] 151 | }, 152 | { 153 | "id": 16, 154 | "name": "Salgadinho de milho", 155 | "price": 25.1, 156 | "specifications": [ 157 | "vegan", 158 | "lactose-free", 159 | "vegetarian", 160 | "low-carb" 161 | ] 162 | }, 163 | { 164 | "id": 17, 165 | "name": "Salgadinho de castanha do par\u00e1", 166 | "price": 27.52, 167 | "specifications": [ 168 | "gluten-free" 169 | ] 170 | }, 171 | { 172 | "id": 18, 173 | "name": "Salgadinho de lim\u00e3o", 174 | "price": 11.73, 175 | "specifications": [ 176 | "lactose-free" 177 | ] 178 | }, 179 | { 180 | "id": 19, 181 | "name": "Sopa de morango", 182 | "price": 33.34, 183 | "specifications": [ 184 | "vegan", 185 | "lactose-free", 186 | "low-carb", 187 | "gluten-free" 188 | ] 189 | }, 190 | { 191 | "id": 20, 192 | "name": "Barrinhas de mandioquinha", 193 | "price": 5.9, 194 | "specifications": [ 195 | "lactose-free", 196 | "vegan" 197 | ] 198 | } 199 | ] --------------------------------------------------------------------------------