forked from secultce/aurora
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs for image upload technical decisions
- Loading branch information
1 parent
f6c7722
commit 05ad0d6
Showing
6 changed files
with
105 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Decisões Técnicas - Backend | ||
|
||
Em alguns momentos durante o desenvolvimento precisamos | ||
## Upload de Arquivos | ||
|
||
Para upload de arquivos estamos usando endpoints especificos, seguindo o padrão abaixo | ||
|
||
``` | ||
POST /spaces/{id}/images | ||
Content-Type: multipart/form-data | ||
``` | ||
|
||
(até a tomada dessa decisão) O suporte da PHP para aceitar `multipart/form-data` só é possível via requisições do tipo `POST`. | ||
|
||
O fluxo de envio da imagem passa por um único `Service` | ||
|
||
```mermaid | ||
flowchart TD | ||
R((Request)) --POST multipart/form-data--> C[[AgentController]] | ||
C --UploadedFile--> S([AgentService]) | ||
S --ParameterBag/UploadedFile--> S2([FileService]) | ||
S2 --contents--> ST{{Storage}} | ||
``` | ||
|
||
## Enums apenas do lado do código | ||
A motivação para não usar o tipo ENUM do proprio banco de dados se deu pois encontramos dificuldades com as migrations, mas, o mais importante: | ||
|
||
**Preferimos manter as regras de negócio na camada da aplicação** ao invés de alocar isso no banco de dados. | ||
|
||
A documentação dos Enums se encontra [aqui](./ENUM.md) |