att
This commit is contained in:
@@ -66,6 +66,8 @@ async def enviar(
|
||||
tipo_documento: str = Form(""),
|
||||
numero_documento: str = Form(...),
|
||||
valor: str = Form(""),
|
||||
autorizador_responsavel: str = Form(""),
|
||||
autorizadorResponsavel: str = Form(""),
|
||||
justificativa: str = Form(...),
|
||||
) -> PortalFornecedorSuccessResponse:
|
||||
file_name = arquivo.filename or "anexo"
|
||||
@@ -75,6 +77,10 @@ async def enviar(
|
||||
if not file_bytes:
|
||||
raise HTTPException(status_code=400, detail={"message": "Arquivo obrigatorio."})
|
||||
|
||||
autorizador = (autorizador_responsavel or autorizadorResponsavel or "").strip()
|
||||
if not autorizador:
|
||||
raise HTTPException(status_code=400, detail={"message": "Campo obrigatorio nao informado: autorizador_responsavel."})
|
||||
|
||||
auth = build_auth()
|
||||
upload_binary(file_name, file_bytes, auth)
|
||||
document_id = create_document(file_name, file_mime, auth)
|
||||
@@ -92,6 +98,7 @@ async def enviar(
|
||||
"tipo_documento": tipo_documento,
|
||||
"numero_documento": numero_documento,
|
||||
"valor": valor,
|
||||
"autorizador_responsavel": autorizador,
|
||||
"justificativa": justificativa,
|
||||
"anexo_documento_id": str(document_id),
|
||||
"anexo_documento_nome": file_name,
|
||||
|
||||
Reference in New Issue
Block a user