|
1 |
| -<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400"></a></p> |
| 1 | +# Laravel Rest Api simple exercise |
2 | 2 |
|
3 |
| -<p align="center"> |
4 |
| -<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a> |
5 |
| -<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/d/total.svg" alt="Total Downloads"></a> |
6 |
| -<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/v/stable.svg" alt="Latest Stable Version"></a> |
7 |
| -<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/license.svg" alt="License"></a> |
8 |
| -</p> |
| 3 | +Following we have a sequence of request the will be used to test the Api |
9 | 4 |
|
10 |
| -## About Laravel |
11 | 5 |
|
12 |
| -Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: |
13 | 6 |
|
14 |
| -- [Simple, fast routing engine](https://laravel.com/docs/routing). |
15 |
| -- [Powerful dependency injection container](https://laravel.com/docs/container). |
16 |
| -- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. |
17 |
| -- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). |
18 |
| -- Database agnostic [schema migrations](https://laravel.com/docs/migrations). |
19 |
| -- [Robust background job processing](https://laravel.com/docs/queues). |
20 |
| -- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). |
| 7 | +# Reset state before starting tests |
21 | 8 |
|
22 |
| -Laravel is accessible, powerful, and provides tools required for large, robust applications. |
| 9 | +´´´ |
| 10 | +POST /reset |
23 | 11 |
|
24 |
| -## Learning Laravel |
| 12 | +200 OK |
| 13 | +´´´ |
25 | 14 |
|
26 |
| -Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. |
| 15 | +-- |
| 16 | +# Get balance for non-existing account |
27 | 17 |
|
28 |
| -If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. |
| 18 | +GET /balance?account_id=1234 |
29 | 19 |
|
30 |
| -## Laravel Sponsors |
| 20 | +404 0 |
31 | 21 |
|
32 |
| -We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell). |
33 | 22 |
|
34 |
| -### Premium Partners |
| 23 | +-- |
| 24 | +# Create account with initial balance |
35 | 25 |
|
36 |
| -- **[Vehikl](https://vehikl.com/)** |
37 |
| -- **[Tighten Co.](https://tighten.co)** |
38 |
| -- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** |
39 |
| -- **[64 Robots](https://64robots.com)** |
40 |
| -- **[Cubet Techno Labs](https://cubettech.com)** |
41 |
| -- **[Cyber-Duck](https://cyber-duck.co.uk)** |
42 |
| -- **[Many](https://www.many.co.uk)** |
43 |
| -- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)** |
44 |
| -- **[DevSquad](https://devsquad.com)** |
45 |
| -- **[OP.GG](https://op.gg)** |
| 26 | +POST /event {"type":"deposit", "destination":"100", "amount":10} |
46 | 27 |
|
47 |
| -## Contributing |
| 28 | +201 {"destination": {"id":"100", "balance":10}} |
48 | 29 |
|
49 |
| -Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). |
50 | 30 |
|
51 |
| -## Code of Conduct |
| 31 | +-- |
| 32 | +# Deposit into existing account |
52 | 33 |
|
53 |
| -In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). |
| 34 | +POST /event {"type":"deposit", "destination":"100", "amount":10} |
54 | 35 |
|
55 |
| -## Security Vulnerabilities |
| 36 | +201 {"destination": {"id":"100", "balance":20}} |
56 | 37 |
|
57 |
| -If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. |
58 | 38 |
|
59 |
| -## License |
| 39 | +-- |
| 40 | +# Get balance for existing account |
60 | 41 |
|
61 |
| -The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). |
| 42 | +GET /balance?account_id=100 |
| 43 | + |
| 44 | +200 20 |
| 45 | + |
| 46 | +-- |
| 47 | +# Withdraw from non-existing account |
| 48 | + |
| 49 | +POST /event {"type":"withdraw", "origin":"200", "amount":10} |
| 50 | + |
| 51 | +404 0 |
| 52 | + |
| 53 | +-- |
| 54 | +# Withdraw from existing account |
| 55 | + |
| 56 | +POST /event {"type":"withdraw", "origin":"100", "amount":5} |
| 57 | + |
| 58 | +201 {"origin": {"id":"100", "balance":15}} |
| 59 | + |
| 60 | +-- |
| 61 | +# Transfer from existing account |
| 62 | + |
| 63 | +POST /event {"type":"transfer", "origin":"100", "amount":15, "destination":"300"} |
| 64 | + |
| 65 | +201 {"origin": {"id":"100", "balance":0}, "destination": {"id":"300", "balance":15}} |
| 66 | + |
| 67 | +-- |
| 68 | +# Transfer from non-existing account |
| 69 | + |
| 70 | +POST /event {"type":"transfer", "origin":"200", "amount":15, "destination":"300"} |
| 71 | + |
| 72 | +404 0 |
0 commit comments