Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
786d3a1
initial commit
Marcos-SCO Oct 22, 2021
9fe53c3
sellers structure files
Marcos-SCO Oct 23, 2021
af9c141
view base
Marcos-SCO Oct 23, 2021
da1db4b
laravel mix setup
Marcos-SCO Oct 23, 2021
f245de1
url helpers
Marcos-SCO Oct 23, 2021
86c52bb
dom elements helper
Marcos-SCO Oct 23, 2021
7e456bc
sellers search with api
Marcos-SCO Oct 23, 2021
da9badb
seller resource names
Marcos-SCO Oct 23, 2021
9069207
mount query string
Marcos-SCO Oct 23, 2021
513728f
strings helper
Marcos-SCO Oct 23, 2021
e43b321
search results with api
Marcos-SCO Oct 23, 2021
25a891c
turning functions global and separate files
Marcos-SCO Oct 24, 2021
a9091e2
display sellers folder
Marcos-SCO Oct 24, 2021
046967c
sellers change page title
Marcos-SCO Oct 24, 2021
011f308
pass tittle and dataPage within routes
Marcos-SCO Oct 24, 2021
6623424
sellers folder
Marcos-SCO Oct 24, 2021
e096f46
ui select helper
Marcos-SCO Oct 24, 2021
581fc0e
api request folder
Marcos-SCO Oct 24, 2021
1667330
change in folder structure
Marcos-SCO Oct 24, 2021
7bf1627
change name to getRequests
Marcos-SCO Oct 24, 2021
b041afd
seller create init
Marcos-SCO Oct 24, 2021
7588cf5
convert obj to string
Marcos-SCO Oct 24, 2021
07fe5e0
seller create request validation
Marcos-SCO Oct 24, 2021
261c1ea
sweetalert implementation
Marcos-SCO Oct 24, 2021
54a0034
create a seller
Marcos-SCO Oct 24, 2021
1a41b57
order sellers by id
Marcos-SCO Oct 24, 2021
4820798
sellers pagination search bug fix
Marcos-SCO Oct 24, 2021
d6ac236
ignore this file
Marcos-SCO Oct 24, 2021
d37ceeb
boostrap icons
Marcos-SCO Oct 24, 2021
f3f2986
put requests
Marcos-SCO Oct 24, 2021
8c92cdb
axios only one request function
Marcos-SCO Oct 24, 2021
2385705
seller send
Marcos-SCO Oct 24, 2021
5a250dc
fetch data
Marcos-SCO Oct 24, 2021
e144fb6
bootstrap helpers
Marcos-SCO Oct 24, 2021
a58bff7
change request function
Marcos-SCO Oct 24, 2021
daec4e6
edit sellers
Marcos-SCO Oct 25, 2021
626f4c0
seller crud basic functionality complete
Marcos-SCO Oct 25, 2021
fb0ce90
url search param only if value exists
Marcos-SCO Oct 25, 2021
fb43b4c
timezone change to São Paulo
Marcos-SCO Oct 25, 2021
d385fa5
clients model controller factory migration
Marcos-SCO Oct 25, 2021
a5020f9
client_phones model controller factory migration
Marcos-SCO Oct 25, 2021
aaea97e
remove client phone controller
Marcos-SCO Oct 25, 2021
93f80d1
document_types model factory migration
Marcos-SCO Oct 25, 2021
41e23bb
client_types model factory migration
Marcos-SCO Oct 25, 2021
abb9050
client_sellers model controller factory migration
Marcos-SCO Oct 25, 2021
4191e7a
clients views
Marcos-SCO Oct 25, 2021
a3c041e
clients base crud init mimic seller files
Marcos-SCO Oct 25, 2021
0fa1e03
client edit test form
Marcos-SCO Oct 26, 2021
71a8ec0
formData obj
Marcos-SCO Oct 26, 2021
a61a191
update send img
Marcos-SCO Oct 26, 2021
ebafcf8
clients img crud complete
Marcos-SCO Oct 26, 2021
6c7dc3d
fix bugs img url
Marcos-SCO Oct 26, 2021
105cfb6
client base relationships
Marcos-SCO Oct 26, 2021
eaa1018
client types get show create delete
Marcos-SCO Oct 26, 2021
c5a69a8
clientphones create read update delete
Marcos-SCO Oct 26, 2021
7eb38fa
verify if phone exists before creating
Marcos-SCO Oct 26, 2021
d65df51
verify if client and document type before create
Marcos-SCO Oct 26, 2021
3a2ef3a
verify if client exists before create
Marcos-SCO Oct 26, 2021
2a0d07a
clientSellers create read update delete
Marcos-SCO Oct 26, 2021
16b3c94
jwt initial auth files
Marcos-SCO Oct 26, 2021
4af6955
enclose dropFiles
Marcos-SCO Oct 26, 2021
ffc0a4e
fix sellers route definations
Marcos-SCO Oct 26, 2021
8dd5955
auth messages
Marcos-SCO Oct 26, 2021
8dd0e74
user login functionality with JWT
Marcos-SCO Oct 26, 2021
a99c951
base folder separation
Marcos-SCO Oct 26, 2021
c7fdf4c
JWT implementation complete
Marcos-SCO Oct 27, 2021
dd405f5
usarAuthToken call function
Marcos-SCO Oct 27, 2021
23cd6d0
send email with google account
Marcos-SCO Oct 27, 2021
6aaab61
paginate number
Marcos-SCO Oct 27, 2021
e36d414
styling views
Marcos-SCO Oct 27, 2021
78a1552
gif
Marcos-SCO Oct 27, 2021
f532e42
readme
Marcos-SCO Oct 27, 2021
bd4ec65
readme
Marcos-SCO Oct 27, 2021
c0a1be8
postman collection
Marcos-SCO Oct 27, 2021
597f6d2
Update README.md
Marcos-SCO Oct 29, 2021
a78d45a
Update README.md
Marcos-SCO Oct 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions olivas-test/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

[docker-compose.yml]
indent_size = 4
54 changes: 54 additions & 0 deletions olivas-test/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
APP_NAME=TesteOlivas
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
JWT_SECRET=O0FIKItkXHUNdWZf9OcswEN5JEGmluId8HflAQyaC44Rl3L4oMIxgSoHurAU5o2x

CLIENT_EMAIL=Your_email_here_to_simulate_client_receive
MAIL_MAILER=smtp
MAIL_HOST=smtp.googlemail.com
MAIL_PORT=465
MAIL_USERNAME=Your_Google_email
MAIL_PASSWORD=Your_password
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS=Your_Google_email
MAIL_FROM_NAME=OlivasTest

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
5 changes: 5 additions & 0 deletions olivas-test/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
15 changes: 15 additions & 0 deletions olivas-test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/.idea
/.vscode
14 changes: 14 additions & 0 deletions olivas-test/.styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
php:
preset: laravel
version: 8
disabled:
- no_unused_imports
finder:
not-name:
- index.php
- server.php
js:
finder:
not-name:
- webpack.mix.js
css: true
126 changes: 126 additions & 0 deletions olivas-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<br>

# Olivas Digital - test

<br>
<p align="left">
<img src="https://raw.githubusercontent.com/Marcos-SCO/Vaga-Desenvolvedor-PHP/main/olivas-test/public/images/api/default/showGif.gif" width="700" title="Show Gif">
</p>
<br>

## <p id='dependencies'>📋 Dependências</p>

<ul>
<li>"bootstrap-icons": "^1.6.1"</li>
<li>"sweetalert": "^2.1.2"</li>
<li>"tymon/jwt-auth": "^1.0"</li>
</ul>

<br>

## <p id='install'>🔥 Como instalar</p>

- Copie ".env.example" e coloque suas variáveis de ambiente.


## Crie um banco de dados no MySql

- CREATE DATABASE db_test_olivas CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;


## Instale as dependências do composer.

```shell
$ composer install
```

## Rode os comandos do Laravel.

```shell
$ PHP artisan key: generate

$ php artisan jwt:secret

$ php artisan migrate --seed
```

<br/>

## Para fazer o teste das endpoints, utilize um api client como o Postman.
## As collections estão disponiveis na raiz do projeto.

<br/>

## Exemplo de Login:
url: {{BASE_API}}/auth/login/
Método: POST
```json
{
"email": "email",
"password": "password"
}
```

<br>

### Authorization token precisa ser inserido na requisição para rotas de clientes.
#### Nos vendedores é precisao estar autenticado para editar ou deletar.

<br>

## Exibir informações de um cliente com id:

url: {{BASE_API}}/clientes/{$id}
Método: GET

<br>

## Atualizar informação de cliente:
url: {{BASE_API}}/clientes/{$id}
Método: PUT

### A imagem do cliente pode ser um arquivo enviado por formulário da aplicação ou uma inserção de link na api
```json
{
"name" : "Jho",
"email" : "[email protected]",
"image": "imagem"
}
```
<br>

## Pegar todos os registros de clientes:
url: {{BASE_API}}/clientes
Método: GET

<br>

## Deletar Cliente
url: {{BASE_API}}/clientes/22
Método: DELETE

<br>

## As tabelas que possuem elo com clientes precisam ser inseridas atraves da api.

### Ex de tipos de cliente
```json
{
"client_id": 7,
"client_type": 1
}
```
- Caso seja enviado um id que não exista a api retornará uma mensagem com erro

```json
{
"client_id": 7,
"client_type": 100000000
}
```

```json
{
"message": "O tipo de documento para clientes com id: 100000000, não existe!"
}
```
Loading