Frontend completo (Etapas 11-18) e extensões de backend (Etapas 13 e 18)
Adiciona o frontend Next.js em frontend/ (setup, design system, autenticação/tema, layout/navegação, área master, área tenant completa: clientes, produtos, vendas, recebimentos, whatsapp, e-mail, alertas, equipe e perfil). Estende o backend de forma aditiva e autorizada: cookie httpOnly para refresh token (Etapa 13) e CRUD de equipe + edição de perfil do tenant (Etapa 18, módulo src/modules/equipe/ novo e PUT /tenant/perfil). Detalhes completos em Etapas/V2/*. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { apiClient } from '@/lib/api/client';
|
||||
import { buildQuery, type PaginatedResult } from '@/lib/api/types';
|
||||
import type { FormaPagamento, ParcelaStatus, SalePayment } from '@/lib/api/sales';
|
||||
|
||||
export type { FormaPagamento } from '@/lib/api/sales';
|
||||
|
||||
/** `GET /tenant/recebimentos` inclui um resumo da venda/cliente em cada parcela. */
|
||||
export interface Recebimento extends SalePayment {
|
||||
sale: { id: string; numero_venda: number; customer_id: string; customer: { razao_social: string } };
|
||||
}
|
||||
|
||||
export interface ListRecebimentosParams {
|
||||
status?: ParcelaStatus;
|
||||
customer_id?: string;
|
||||
vencimento_inicio?: string;
|
||||
vencimento_fim?: string;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export function listRecebimentos(params: ListRecebimentosParams) {
|
||||
return apiClient.get<PaginatedResult<Recebimento>>(`/tenant/recebimentos${buildQuery(params)}`);
|
||||
}
|
||||
|
||||
export function marcarRecebimentoPago(id: string, forma_pagamento: FormaPagamento) {
|
||||
return apiClient.patch<SalePayment>(`/tenant/recebimentos/${id}/marcar-pago`, { forma_pagamento });
|
||||
}
|
||||
|
||||
export interface AtualizarAtrasadasResult {
|
||||
atualizadas: number;
|
||||
}
|
||||
|
||||
export function atualizarRecebimentosAtrasados() {
|
||||
return apiClient.post<AtualizarAtrasadasResult>('/tenant/recebimentos/atualizar-atrasadas');
|
||||
}
|
||||
Reference in New Issue
Block a user