-
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.
- Loading branch information
1 parent
3fdd23f
commit 751ce18
Showing
28 changed files
with
635 additions
and
414 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { useNewApi } from "../hooks/use-new-api"; | ||
import { IPagarParcela, IParcela } from "../types/fatura"; | ||
|
||
export function useApiParcela() { | ||
const apiGet = useNewApi({ | ||
method: 'GET', | ||
url: 'parcela/get-by-id', | ||
notAlert: true, | ||
}) | ||
|
||
const apiPagar = useNewApi({ | ||
method: 'PUT', | ||
url: 'parcela/pagar' | ||
}) | ||
|
||
async function obterParcela(id: string): Promise<IParcela | undefined> { | ||
return await apiGet.fecth({ | ||
urlParams: `?id=${id}` | ||
}) | ||
} | ||
|
||
async function pagarParcela(pagarParcela: IPagarParcela): Promise<IParcela | undefined> { | ||
return await apiPagar.fecth({ body: pagarParcela, message: 'Parcela paga com sucesso!' }) | ||
} | ||
|
||
return { | ||
obterParcela, | ||
pagarParcela | ||
} | ||
} |
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,18 @@ | ||
import { useNewApi } from "../hooks/use-new-api"; | ||
import { IExtratoTrasacao, ITransacaoFinanceira } from "../types/transacao-financeira"; | ||
|
||
export function useApiTransacao() { | ||
const apiPeriodo = useNewApi({ | ||
method: 'POST', | ||
url: 'transacao-financeira/periodo', | ||
notAlert: true | ||
}) | ||
|
||
async function extratoPeriodo(body: IExtratoTrasacao): Promise<ITransacaoFinanceira[] | undefined> { | ||
return await apiPeriodo.fecth({ body }) | ||
} | ||
|
||
return { | ||
extratoPeriodo | ||
} | ||
} |
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 |
---|---|---|
|
@@ -189,4 +189,4 @@ export function useApi() { | |
deleteApi, | ||
getCnpj | ||
} | ||
} | ||
} |
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
Oops, something went wrong.