@hed-hog/finance 0.0.224 → 0.0.225

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/dto/create-financial-title.dto.d.ts +19 -0
  2. package/dist/dto/create-financial-title.dto.d.ts.map +1 -0
  3. package/dist/dto/create-financial-title.dto.js +128 -0
  4. package/dist/dto/create-financial-title.dto.js.map +1 -0
  5. package/dist/finance.controller.d.ts +276 -0
  6. package/dist/finance.controller.d.ts.map +1 -0
  7. package/dist/finance.controller.js +110 -0
  8. package/dist/finance.controller.js.map +1 -0
  9. package/dist/finance.module.d.ts.map +1 -1
  10. package/dist/finance.module.js +8 -3
  11. package/dist/finance.module.js.map +1 -1
  12. package/dist/finance.service.d.ts +295 -0
  13. package/dist/finance.service.d.ts.map +1 -0
  14. package/dist/finance.service.js +416 -0
  15. package/dist/finance.service.js.map +1 -0
  16. package/dist/index.d.ts +3 -0
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +3 -0
  19. package/dist/index.js.map +1 -1
  20. package/hedhog/data/menu.yaml +72 -25
  21. package/hedhog/data/route.yaml +55 -1
  22. package/hedhog/frontend/app/accounts-payable/approvals/page.tsx.ejs +69 -44
  23. package/hedhog/frontend/app/accounts-payable/installments/[id]/page.tsx.ejs +68 -46
  24. package/hedhog/frontend/app/accounts-payable/installments/page.tsx.ejs +87 -63
  25. package/hedhog/frontend/app/accounts-receivable/collections-default/page.tsx.ejs +94 -59
  26. package/hedhog/frontend/app/accounts-receivable/installments/[id]/page.tsx.ejs +78 -52
  27. package/hedhog/frontend/app/accounts-receivable/installments/page.tsx.ejs +89 -68
  28. package/hedhog/frontend/app/cash-and-banks/bank-accounts/page.tsx.ejs +69 -47
  29. package/hedhog/frontend/app/cash-and-banks/bank-reconciliation/page.tsx.ejs +79 -53
  30. package/hedhog/frontend/app/cash-and-banks/statements/page.tsx.ejs +43 -36
  31. package/hedhog/frontend/app/cash-and-banks/transfers/page.tsx.ejs +47 -38
  32. package/hedhog/frontend/app/page.tsx.ejs +54 -31
  33. package/hedhog/frontend/app/planning/cash-flow-forecast/page.tsx.ejs +51 -38
  34. package/hedhog/frontend/app/planning/receivables-calendar/page.tsx.ejs +63 -33
  35. package/hedhog/frontend/app/planning/scenarios/page.tsx.ejs +50 -33
  36. package/hedhog/frontend/messages/en.json +776 -0
  37. package/hedhog/frontend/messages/pt.json +776 -0
  38. package/package.json +3 -3
  39. package/src/dto/create-financial-title.dto.ts +142 -0
  40. package/src/finance.controller.ts +89 -0
  41. package/src/finance.module.ts +8 -3
  42. package/src/finance.service.ts +529 -0
  43. package/src/index.ts +4 -0
@@ -1,5 +1,6 @@
1
1
  'use client';
2
2
 
3
+ import { Page, PageHeader } from '@/components/entity-list';
3
4
  import { Button } from '@/components/ui/button';
4
5
  import {
5
6
  DropdownMenu,
@@ -12,7 +13,6 @@ import { FilterBar } from '@/components/ui/filter-bar';
12
13
  import { Input } from '@/components/ui/input';
13
14
  import { Label } from '@/components/ui/label';
14
15
  import { Money } from '@/components/ui/money';
15
- import { PageHeader } from '@/components/ui/page-header';
16
16
  import {
17
17
  Select,
18
18
  SelectContent,
@@ -49,6 +49,7 @@ import {
49
49
  Undo,
50
50
  XCircle,
51
51
  } from 'lucide-react';
52
+ import { useTranslations } from 'next-intl';
52
53
  import Link from 'next/link';
53
54
  import { useState } from 'react';
54
55
  import { formatarData } from '../../_lib/formatters';
@@ -58,37 +59,37 @@ function NovoTituloSheet({
58
59
  pessoas,
59
60
  categorias,
60
61
  centrosCusto,
62
+ t,
61
63
  }: {
62
64
  pessoas: any[];
63
65
  categorias: any[];
64
66
  centrosCusto: any[];
67
+ t: ReturnType<typeof useTranslations>;
65
68
  }) {
66
69
  return (
67
70
  <Sheet>
68
71
  <SheetTrigger asChild>
69
72
  <Button>
70
73
  <Plus className="mr-2 h-4 w-4" />
71
- Novo Título
74
+ {t('newTitle.action')}
72
75
  </Button>
73
76
  </SheetTrigger>
74
77
  <SheetContent className="w-full sm:max-w-lg overflow-y-auto">
75
78
  <SheetHeader>
76
- <SheetTitle>Novo Título a Pagar</SheetTitle>
77
- <SheetDescription>
78
- Preencha os dados para criar um novo título a pagar.
79
- </SheetDescription>
79
+ <SheetTitle>{t('newTitle.title')}</SheetTitle>
80
+ <SheetDescription>{t('newTitle.description')}</SheetDescription>
80
81
  </SheetHeader>
81
82
  <form className="mt-6 space-y-4">
82
83
  <div className="grid gap-4">
83
84
  <div className="space-y-2">
84
- <Label htmlFor="documento">Documento</Label>
85
+ <Label htmlFor="documento">{t('fields.document')}</Label>
85
86
  <Input id="documento" placeholder="NF-00000" />
86
87
  </div>
87
88
  <div className="space-y-2">
88
- <Label htmlFor="fornecedor">Fornecedor</Label>
89
+ <Label htmlFor="fornecedor">{t('fields.supplier')}</Label>
89
90
  <Select>
90
91
  <SelectTrigger>
91
- <SelectValue placeholder="Selecione..." />
92
+ <SelectValue placeholder={t('common.select')} />
92
93
  </SelectTrigger>
93
94
  <SelectContent>
94
95
  {pessoas
@@ -105,23 +106,23 @@ function NovoTituloSheet({
105
106
  </div>
106
107
  <div className="grid grid-cols-2 gap-4">
107
108
  <div className="space-y-2">
108
- <Label htmlFor="competencia">Competência</Label>
109
+ <Label htmlFor="competencia">{t('fields.competency')}</Label>
109
110
  <Input id="competencia" type="month" />
110
111
  </div>
111
112
  <div className="space-y-2">
112
- <Label htmlFor="vencimento">Vencimento</Label>
113
+ <Label htmlFor="vencimento">{t('fields.dueDate')}</Label>
113
114
  <Input id="vencimento" type="date" />
114
115
  </div>
115
116
  </div>
116
117
  <div className="space-y-2">
117
- <Label htmlFor="valor">Valor Total</Label>
118
+ <Label htmlFor="valor">{t('fields.totalValue')}</Label>
118
119
  <Input id="valor" type="number" placeholder="0,00" step="0.01" />
119
120
  </div>
120
121
  <div className="space-y-2">
121
- <Label htmlFor="categoria">Categoria</Label>
122
+ <Label htmlFor="categoria">{t('fields.category')}</Label>
122
123
  <Select>
123
124
  <SelectTrigger>
124
- <SelectValue placeholder="Selecione..." />
125
+ <SelectValue placeholder={t('common.select')} />
125
126
  </SelectTrigger>
126
127
  <SelectContent>
127
128
  {categorias
@@ -135,10 +136,10 @@ function NovoTituloSheet({
135
136
  </Select>
136
137
  </div>
137
138
  <div className="space-y-2">
138
- <Label htmlFor="centroCusto">Centro de Custo</Label>
139
+ <Label htmlFor="centroCusto">{t('fields.costCenter')}</Label>
139
140
  <Select>
140
141
  <SelectTrigger>
141
- <SelectValue placeholder="Selecione..." />
142
+ <SelectValue placeholder={t('common.select')} />
142
143
  </SelectTrigger>
143
144
  <SelectContent>
144
145
  {centrosCusto.map((c) => (
@@ -150,31 +151,44 @@ function NovoTituloSheet({
150
151
  </Select>
151
152
  </div>
152
153
  <div className="space-y-2">
153
- <Label htmlFor="metodo">Forma de Pagamento</Label>
154
+ <Label htmlFor="metodo">{t('fields.paymentMethod')}</Label>
154
155
  <Select>
155
156
  <SelectTrigger>
156
- <SelectValue placeholder="Selecione..." />
157
+ <SelectValue placeholder={t('common.select')} />
157
158
  </SelectTrigger>
158
159
  <SelectContent>
159
- <SelectItem value="boleto">Boleto</SelectItem>
160
+ <SelectItem value="boleto">
161
+ {t('paymentMethods.boleto')}
162
+ </SelectItem>
160
163
  <SelectItem value="pix">PIX</SelectItem>
161
- <SelectItem value="transferencia">Transferência</SelectItem>
162
- <SelectItem value="cartao">Cartão</SelectItem>
163
- <SelectItem value="dinheiro">Dinheiro</SelectItem>
164
- <SelectItem value="cheque">Cheque</SelectItem>
164
+ <SelectItem value="transferencia">
165
+ {t('paymentMethods.transfer')}
166
+ </SelectItem>
167
+ <SelectItem value="cartao">
168
+ {t('paymentMethods.card')}
169
+ </SelectItem>
170
+ <SelectItem value="dinheiro">
171
+ {t('paymentMethods.cash')}
172
+ </SelectItem>
173
+ <SelectItem value="cheque">
174
+ {t('paymentMethods.check')}
175
+ </SelectItem>
165
176
  </SelectContent>
166
177
  </Select>
167
178
  </div>
168
179
  <div className="space-y-2">
169
- <Label htmlFor="descricao">Descrição</Label>
170
- <Textarea id="descricao" placeholder="Descrição do título..." />
180
+ <Label htmlFor="descricao">{t('fields.description')}</Label>
181
+ <Textarea
182
+ id="descricao"
183
+ placeholder={t('newTitle.descriptionPlaceholder')}
184
+ />
171
185
  </div>
172
186
  </div>
173
187
  <div className="flex justify-end gap-2 pt-4">
174
188
  <Button type="button" variant="outline">
175
- Cancelar
189
+ {t('common.cancel')}
176
190
  </Button>
177
- <Button type="submit">Salvar</Button>
191
+ <Button type="submit">{t('common.save')}</Button>
178
192
  </div>
179
193
  </form>
180
194
  </SheetContent>
@@ -183,6 +197,7 @@ function NovoTituloSheet({
183
197
  }
184
198
 
185
199
  export default function TitulosPagarPage() {
200
+ const t = useTranslations('finance.PayableInstallmentsPage');
186
201
  const { data } = useFinanceData();
187
202
  const { titulosPagar, pessoas, categorias, centrosCusto } = data;
188
203
 
@@ -205,42 +220,44 @@ export default function TitulosPagarPage() {
205
220
  });
206
221
 
207
222
  return (
208
- <div className="space-y-6">
223
+ <Page>
209
224
  <PageHeader
210
- title="Títulos a Pagar"
211
- description="Gerencie suas contas a pagar"
225
+ title={t('header.title')}
226
+ description={t('header.description')}
212
227
  breadcrumbs={[
213
- { label: 'Contas a Pagar', href: '/finance/accounts-payable/installments' },
214
- { label: 'Títulos e Parcelas' },
228
+ { label: t('breadcrumbs.home'), href: '/' },
229
+ { label: t('breadcrumbs.finance'), href: '/finance' },
230
+ { label: t('breadcrumbs.current') },
215
231
  ]}
216
232
  actions={
217
233
  <NovoTituloSheet
218
234
  pessoas={pessoas}
219
235
  categorias={categorias}
220
236
  centrosCusto={centrosCusto}
237
+ t={t}
221
238
  />
222
239
  }
223
240
  />
224
241
 
225
242
  <FilterBar
226
- searchPlaceholder="Buscar por documento ou fornecedor..."
243
+ searchPlaceholder={t('filters.searchPlaceholder')}
227
244
  searchValue={search}
228
245
  onSearchChange={setSearch}
229
246
  filters={[
230
247
  {
231
248
  id: 'status',
232
- label: 'Status',
249
+ label: t('filters.status'),
233
250
  value: statusFilter,
234
251
  onChange: setStatusFilter,
235
252
  options: [
236
- { value: 'all', label: 'Todos' },
237
- { value: 'rascunho', label: 'Rascunho' },
238
- { value: 'aprovado', label: 'Aprovado' },
239
- { value: 'aberto', label: 'Aberto' },
240
- { value: 'parcial', label: 'Parcial' },
241
- { value: 'liquidado', label: 'Liquidado' },
242
- { value: 'vencido', label: 'Vencido' },
243
- { value: 'cancelado', label: 'Cancelado' },
253
+ { value: 'all', label: t('statuses.all') },
254
+ { value: 'rascunho', label: t('statuses.rascunho') },
255
+ { value: 'aprovado', label: t('statuses.aprovado') },
256
+ { value: 'aberto', label: t('statuses.aberto') },
257
+ { value: 'parcial', label: t('statuses.parcial') },
258
+ { value: 'liquidado', label: t('statuses.liquidado') },
259
+ { value: 'vencido', label: t('statuses.vencido') },
260
+ { value: 'cancelado', label: t('statuses.cancelado') },
244
261
  ],
245
262
  },
246
263
  ]}
@@ -252,13 +269,15 @@ export default function TitulosPagarPage() {
252
269
  <Table>
253
270
  <TableHeader>
254
271
  <TableRow>
255
- <TableHead>Documento</TableHead>
256
- <TableHead>Fornecedor</TableHead>
257
- <TableHead>Competência</TableHead>
258
- <TableHead>Vencimento</TableHead>
259
- <TableHead className="text-right">Valor</TableHead>
260
- <TableHead>Categoria</TableHead>
261
- <TableHead>Status</TableHead>
272
+ <TableHead>{t('table.headers.document')}</TableHead>
273
+ <TableHead>{t('table.headers.supplier')}</TableHead>
274
+ <TableHead>{t('table.headers.competency')}</TableHead>
275
+ <TableHead>{t('table.headers.dueDate')}</TableHead>
276
+ <TableHead className="text-right">
277
+ {t('table.headers.value')}
278
+ </TableHead>
279
+ <TableHead>{t('table.headers.category')}</TableHead>
280
+ <TableHead>{t('table.headers.status')}</TableHead>
262
281
  <TableHead className="w-[50px]" />
263
282
  </TableRow>
264
283
  </TableHeader>
@@ -302,37 +321,41 @@ export default function TitulosPagarPage() {
302
321
  <DropdownMenuTrigger asChild>
303
322
  <Button variant="ghost" size="icon">
304
323
  <MoreHorizontal className="h-4 w-4" />
305
- <span className="sr-only">Ações</span>
324
+ <span className="sr-only">
325
+ {t('table.actions.srActions')}
326
+ </span>
306
327
  </Button>
307
328
  </DropdownMenuTrigger>
308
329
  <DropdownMenuContent align="end">
309
330
  <DropdownMenuItem asChild>
310
- <Link href={`/finance/accounts-payable/installments/${titulo.id}`}>
331
+ <Link
332
+ href={`/finance/accounts-payable/installments/${titulo.id}`}
333
+ >
311
334
  <Eye className="mr-2 h-4 w-4" />
312
- Ver Detalhes
335
+ {t('table.actions.viewDetails')}
313
336
  </Link>
314
337
  </DropdownMenuItem>
315
338
  <DropdownMenuItem>
316
339
  <Edit className="mr-2 h-4 w-4" />
317
- Editar
340
+ {t('table.actions.edit')}
318
341
  </DropdownMenuItem>
319
342
  <DropdownMenuSeparator />
320
343
  <DropdownMenuItem>
321
344
  <CheckCircle className="mr-2 h-4 w-4" />
322
- Aprovar
345
+ {t('table.actions.approve')}
323
346
  </DropdownMenuItem>
324
347
  <DropdownMenuItem>
325
348
  <Download className="mr-2 h-4 w-4" />
326
- Baixar
349
+ {t('table.actions.settle')}
327
350
  </DropdownMenuItem>
328
351
  <DropdownMenuItem>
329
352
  <Undo className="mr-2 h-4 w-4" />
330
- Estornar
353
+ {t('table.actions.reverse')}
331
354
  </DropdownMenuItem>
332
355
  <DropdownMenuSeparator />
333
356
  <DropdownMenuItem className="text-destructive">
334
357
  <XCircle className="mr-2 h-4 w-4" />
335
- Cancelar
358
+ {t('table.actions.cancel')}
336
359
  </DropdownMenuItem>
337
360
  </DropdownMenuContent>
338
361
  </DropdownMenu>
@@ -346,19 +369,20 @@ export default function TitulosPagarPage() {
346
369
 
347
370
  <div className="flex items-center justify-between">
348
371
  <p className="text-sm text-muted-foreground">
349
- Mostrando {filteredTitulos.length} de {titulosPagar.length} registros
372
+ {t('footer.showing', {
373
+ filtered: filteredTitulos.length,
374
+ total: titulosPagar.length,
375
+ })}
350
376
  </p>
351
377
  <div className="flex items-center gap-2">
352
378
  <Button variant="outline" size="sm" disabled>
353
- Anterior
379
+ {t('footer.previous')}
354
380
  </Button>
355
381
  <Button variant="outline" size="sm" disabled>
356
- Próximo
382
+ {t('footer.next')}
357
383
  </Button>
358
384
  </div>
359
385
  </div>
360
- </div>
386
+ </Page>
361
387
  );
362
388
  }
363
-
364
-