@hed-hog/finance 0.0.235 → 0.0.237

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 (75) hide show
  1. package/dist/dto/create-cost-center.dto.d.ts +4 -0
  2. package/dist/dto/create-cost-center.dto.d.ts.map +1 -0
  3. package/dist/dto/create-cost-center.dto.js +24 -0
  4. package/dist/dto/create-cost-center.dto.js.map +1 -0
  5. package/dist/dto/create-finance-category.dto.d.ts +6 -0
  6. package/dist/dto/create-finance-category.dto.d.ts.map +1 -0
  7. package/dist/dto/create-finance-category.dto.js +37 -0
  8. package/dist/dto/create-finance-category.dto.js.map +1 -0
  9. package/dist/dto/create-period-close.dto.d.ts +7 -0
  10. package/dist/dto/create-period-close.dto.d.ts.map +1 -0
  11. package/dist/dto/create-period-close.dto.js +44 -0
  12. package/dist/dto/create-period-close.dto.js.map +1 -0
  13. package/dist/dto/move-finance-category.dto.d.ts +5 -0
  14. package/dist/dto/move-finance-category.dto.d.ts.map +1 -0
  15. package/dist/dto/move-finance-category.dto.js +32 -0
  16. package/dist/dto/move-finance-category.dto.js.map +1 -0
  17. package/dist/dto/update-cost-center.dto.d.ts +5 -0
  18. package/dist/dto/update-cost-center.dto.d.ts.map +1 -0
  19. package/dist/dto/update-cost-center.dto.js +32 -0
  20. package/dist/dto/update-cost-center.dto.js.map +1 -0
  21. package/dist/dto/update-finance-category.dto.d.ts +7 -0
  22. package/dist/dto/update-finance-category.dto.d.ts.map +1 -0
  23. package/dist/dto/update-finance-category.dto.js +46 -0
  24. package/dist/dto/update-finance-category.dto.js.map +1 -0
  25. package/dist/finance-audit-logs.controller.d.ts +13 -0
  26. package/dist/finance-audit-logs.controller.d.ts.map +1 -0
  27. package/dist/finance-audit-logs.controller.js +54 -0
  28. package/dist/finance-audit-logs.controller.js.map +1 -0
  29. package/dist/finance-categories.controller.d.ts +42 -0
  30. package/dist/finance-categories.controller.d.ts.map +1 -0
  31. package/dist/finance-categories.controller.js +84 -0
  32. package/dist/finance-categories.controller.js.map +1 -0
  33. package/dist/finance-cost-centers.controller.d.ts +32 -0
  34. package/dist/finance-cost-centers.controller.d.ts.map +1 -0
  35. package/dist/finance-cost-centers.controller.js +72 -0
  36. package/dist/finance-cost-centers.controller.js.map +1 -0
  37. package/dist/finance-period-close.controller.d.ts +27 -0
  38. package/dist/finance-period-close.controller.d.ts.map +1 -0
  39. package/dist/finance-period-close.controller.js +64 -0
  40. package/dist/finance-period-close.controller.js.map +1 -0
  41. package/dist/finance.module.d.ts.map +1 -1
  42. package/dist/finance.module.js +8 -0
  43. package/dist/finance.module.js.map +1 -1
  44. package/dist/finance.service.d.ts +111 -0
  45. package/dist/finance.service.d.ts.map +1 -1
  46. package/dist/finance.service.js +446 -17
  47. package/dist/finance.service.js.map +1 -1
  48. package/dist/index.d.ts +4 -0
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +4 -0
  51. package/dist/index.js.map +1 -1
  52. package/hedhog/data/route.yaml +108 -0
  53. package/hedhog/frontend/app/_components/person-field-with-create.tsx.ejs +627 -0
  54. package/hedhog/frontend/app/accounts-payable/installments/page.tsx.ejs +865 -883
  55. package/hedhog/frontend/app/accounts-receivable/installments/page.tsx.ejs +838 -861
  56. package/hedhog/frontend/app/administration/audit-logs/page.tsx.ejs +309 -0
  57. package/hedhog/frontend/app/administration/categories/page.tsx.ejs +725 -0
  58. package/hedhog/frontend/app/administration/cost-centers/page.tsx.ejs +378 -0
  59. package/hedhog/frontend/app/administration/period-close/page.tsx.ejs +502 -0
  60. package/hedhog/frontend/messages/en.json +225 -0
  61. package/hedhog/frontend/messages/pt.json +225 -0
  62. package/package.json +5 -5
  63. package/src/dto/create-cost-center.dto.ts +9 -0
  64. package/src/dto/create-finance-category.dto.ts +21 -0
  65. package/src/dto/create-period-close.dto.ts +34 -0
  66. package/src/dto/move-finance-category.dto.ts +18 -0
  67. package/src/dto/update-cost-center.dto.ts +17 -0
  68. package/src/dto/update-finance-category.dto.ts +30 -0
  69. package/src/finance-audit-logs.controller.ts +30 -0
  70. package/src/finance-categories.controller.ts +52 -0
  71. package/src/finance-cost-centers.controller.ts +43 -0
  72. package/src/finance-period-close.controller.ts +34 -0
  73. package/src/finance.module.ts +8 -0
  74. package/src/finance.service.ts +578 -9
  75. package/src/index.ts +4 -0
@@ -663,6 +663,231 @@
663
663
  }
664
664
  }
665
665
  },
666
+ "AdminAuditLogsPage": {
667
+ "header": {
668
+ "title": "Audit and Logs",
669
+ "description": "Track actions and authorship of financial records"
670
+ },
671
+ "breadcrumbs": {
672
+ "finance": "Finance",
673
+ "administration": "Administration",
674
+ "current": "Audit and Logs"
675
+ },
676
+ "card": {
677
+ "title": "Audit logs",
678
+ "description": "Text search and filters by action, entity, author, and period."
679
+ },
680
+ "filters": {
681
+ "searchPlaceholder": "Search by action, entity, summary, id or IP",
682
+ "action": "Action",
683
+ "allActions": "All actions",
684
+ "userPlaceholder": "Author (User ID)",
685
+ "entity": "Entity",
686
+ "allEntities": "All entities",
687
+ "clear": "Clear filters"
688
+ },
689
+ "table": {
690
+ "headers": {
691
+ "date": "Date",
692
+ "author": "Author",
693
+ "action": "Action",
694
+ "entity": "Entity",
695
+ "record": "Record",
696
+ "summary": "Summary"
697
+ },
698
+ "loading": "Loading logs...",
699
+ "empty": "No logs found."
700
+ }
701
+ },
702
+ "AdminCategoriesPage": {
703
+ "common": {
704
+ "select": "Select",
705
+ "cancel": "Cancel",
706
+ "save": "Save"
707
+ },
708
+ "messages": {
709
+ "createSuccess": "Category created successfully",
710
+ "updateSuccess": "Category updated successfully",
711
+ "saveError": "Error saving category",
712
+ "deleteSuccess": "Category deactivated successfully",
713
+ "deleteError": "Error deactivating category",
714
+ "moveSuccess": "Category moved successfully",
715
+ "moveError": "Error moving category"
716
+ },
717
+ "header": {
718
+ "title": "Financial Categories",
719
+ "description": "Manage categories and subcategories in a tree"
720
+ },
721
+ "breadcrumbs": {
722
+ "finance": "Finance",
723
+ "administration": "Administration",
724
+ "current": "Categories"
725
+ },
726
+ "card": {
727
+ "title": "Category structure",
728
+ "description": "Drag to reorder and move between tree levels."
729
+ },
730
+ "actions": {
731
+ "newCategory": "New category"
732
+ },
733
+ "sheet": {
734
+ "newTitle": "New category",
735
+ "editTitle": "Edit category",
736
+ "description": "Organize financial categories and subcategories.",
737
+ "fields": {
738
+ "name": "Name",
739
+ "namePlaceholder": "Ex.: Marketing",
740
+ "kind": "Kind",
741
+ "parent": "Parent category",
742
+ "noParent": "No parent category",
743
+ "noneRoot": "None (root)"
744
+ },
745
+ "validation": {
746
+ "nameRequired": "Name is required",
747
+ "kindRequired": "Kind is required"
748
+ }
749
+ },
750
+ "natureOptions": {
751
+ "receita": "Revenue",
752
+ "despesa": "Expense",
753
+ "transferencia": "Transfer",
754
+ "ajuste": "Adjustment",
755
+ "outro": "Other"
756
+ },
757
+ "table": {
758
+ "empty": "No categories found.",
759
+ "status": {
760
+ "active": "Active",
761
+ "inactive": "Inactive"
762
+ }
763
+ },
764
+ "deleteDialog": {
765
+ "title": "Deactivate category",
766
+ "description": "Do you really want to deactivate this financial category?",
767
+ "confirm": "Deactivate"
768
+ }
769
+ },
770
+ "AdminCostCentersPage": {
771
+ "common": {
772
+ "cancel": "Cancel",
773
+ "save": "Save"
774
+ },
775
+ "messages": {
776
+ "createSuccess": "Cost center created successfully",
777
+ "createError": "Error creating cost center",
778
+ "updateSuccess": "Cost center updated successfully",
779
+ "updateError": "Error updating cost center",
780
+ "deleteSuccess": "Cost center deactivated successfully",
781
+ "deleteError": "Error deactivating cost center"
782
+ },
783
+ "header": {
784
+ "title": "Cost Centers",
785
+ "description": "Create and maintain finance cost centers"
786
+ },
787
+ "breadcrumbs": {
788
+ "finance": "Finance",
789
+ "administration": "Administration",
790
+ "current": "Cost Centers"
791
+ },
792
+ "card": {
793
+ "title": "Cost centers list",
794
+ "description": "Manage centers used in financial entries."
795
+ },
796
+ "actions": {
797
+ "newCostCenter": "New cost center"
798
+ },
799
+ "sheet": {
800
+ "newTitle": "New cost center",
801
+ "editTitle": "Edit cost center",
802
+ "newDescription": "Create a new cost center for financial classification.",
803
+ "editDescription": "Update the cost center information.",
804
+ "fields": {
805
+ "name": "Name",
806
+ "namePlaceholder": "Ex.: Administrative"
807
+ },
808
+ "validation": {
809
+ "nameRequired": "Name is required"
810
+ }
811
+ },
812
+ "table": {
813
+ "empty": "No cost centers found.",
814
+ "code": "Code: {code}",
815
+ "status": {
816
+ "active": "Active",
817
+ "inactive": "Inactive"
818
+ }
819
+ },
820
+ "deleteDialog": {
821
+ "title": "Deactivate cost center",
822
+ "description": "Do you really want to deactivate this cost center?",
823
+ "confirm": "Deactivate"
824
+ }
825
+ },
826
+ "AdminPeriodClosePage": {
827
+ "common": {
828
+ "select": "Select",
829
+ "cancel": "Cancel",
830
+ "save": "Save"
831
+ },
832
+ "messages": {
833
+ "createSuccess": "Period closed successfully",
834
+ "createError": "Error closing period"
835
+ },
836
+ "status": {
837
+ "closed": "Closed",
838
+ "open": "Open"
839
+ },
840
+ "header": {
841
+ "title": "Period Close",
842
+ "description": "View closed periods, authorship, and close new periods"
843
+ },
844
+ "breadcrumbs": {
845
+ "finance": "Finance",
846
+ "administration": "Administration",
847
+ "current": "Period Close"
848
+ },
849
+ "card": {
850
+ "title": "Financial periods",
851
+ "description": "Search by dates, user, and track who performed each close."
852
+ },
853
+ "actions": {
854
+ "new": "Close period"
855
+ },
856
+ "sheet": {
857
+ "title": "Close new period",
858
+ "description": "Provide the interval and confirm the financial period close.",
859
+ "fields": {
860
+ "startDate": "Start date",
861
+ "endDate": "End date",
862
+ "status": "Status",
863
+ "notes": "Notes",
864
+ "notesPlaceholder": "Ex.: Monthly finance close"
865
+ },
866
+ "validation": {
867
+ "startRequired": "Start date is required",
868
+ "endRequired": "End date is required"
869
+ }
870
+ },
871
+ "filters": {
872
+ "searchPlaceholder": "Search in notes, user or email",
873
+ "status": "Status",
874
+ "allStatus": "All statuses",
875
+ "userPlaceholder": "User (name, email or ID)",
876
+ "clear": "Clear filters"
877
+ },
878
+ "table": {
879
+ "headers": {
880
+ "start": "Start period",
881
+ "end": "End period",
882
+ "status": "Status",
883
+ "closedBy": "Closed by",
884
+ "closedAt": "Close date",
885
+ "notes": "Notes"
886
+ },
887
+ "loading": "Loading periods...",
888
+ "empty": "No periods found."
889
+ }
890
+ },
666
891
  "CashFlowForecastPage": {
667
892
  "header": {
668
893
  "title": "Cash Flow Forecast",
@@ -663,6 +663,231 @@
663
663
  }
664
664
  }
665
665
  },
666
+ "AdminAuditLogsPage": {
667
+ "header": {
668
+ "title": "Auditoria e Logs",
669
+ "description": "Acompanhe ações e autoria dos registros financeiros"
670
+ },
671
+ "breadcrumbs": {
672
+ "finance": "Financeiro",
673
+ "administration": "Administração",
674
+ "current": "Auditoria e Logs"
675
+ },
676
+ "card": {
677
+ "title": "Logs de auditoria",
678
+ "description": "Busca textual, filtros por ação, entidade, autor e período."
679
+ },
680
+ "filters": {
681
+ "searchPlaceholder": "Buscar por ação, entidade, resumo, id ou IP",
682
+ "action": "Ação",
683
+ "allActions": "Todas as ações",
684
+ "userPlaceholder": "Autor (ID do usuário)",
685
+ "entity": "Entidade",
686
+ "allEntities": "Todas as entidades",
687
+ "clear": "Limpar filtros"
688
+ },
689
+ "table": {
690
+ "headers": {
691
+ "date": "Data",
692
+ "author": "Autor",
693
+ "action": "Ação",
694
+ "entity": "Entidade",
695
+ "record": "Registro",
696
+ "summary": "Resumo"
697
+ },
698
+ "loading": "Carregando logs...",
699
+ "empty": "Nenhum log encontrado."
700
+ }
701
+ },
702
+ "AdminCategoriesPage": {
703
+ "common": {
704
+ "select": "Selecione",
705
+ "cancel": "Cancelar",
706
+ "save": "Salvar"
707
+ },
708
+ "messages": {
709
+ "createSuccess": "Categoria criada com sucesso",
710
+ "updateSuccess": "Categoria atualizada com sucesso",
711
+ "saveError": "Erro ao salvar categoria",
712
+ "deleteSuccess": "Categoria inativada com sucesso",
713
+ "deleteError": "Erro ao inativar categoria",
714
+ "moveSuccess": "Categoria movida com sucesso",
715
+ "moveError": "Erro ao mover categoria"
716
+ },
717
+ "header": {
718
+ "title": "Categorias Financeiras",
719
+ "description": "Gerencie categorias e subcategorias em árvore"
720
+ },
721
+ "breadcrumbs": {
722
+ "finance": "Financeiro",
723
+ "administration": "Administração",
724
+ "current": "Categorias"
725
+ },
726
+ "card": {
727
+ "title": "Estrutura de categorias",
728
+ "description": "Arraste para reordenar e para mover entre níveis da árvore."
729
+ },
730
+ "actions": {
731
+ "newCategory": "Nova categoria"
732
+ },
733
+ "sheet": {
734
+ "newTitle": "Nova categoria",
735
+ "editTitle": "Editar categoria",
736
+ "description": "Organize categorias e subcategorias financeiras.",
737
+ "fields": {
738
+ "name": "Nome",
739
+ "namePlaceholder": "Ex.: Marketing",
740
+ "kind": "Natureza",
741
+ "parent": "Categoria pai",
742
+ "noParent": "Sem categoria pai",
743
+ "noneRoot": "Nenhuma (raiz)"
744
+ },
745
+ "validation": {
746
+ "nameRequired": "Nome é obrigatório",
747
+ "kindRequired": "Natureza é obrigatória"
748
+ }
749
+ },
750
+ "natureOptions": {
751
+ "receita": "Receita",
752
+ "despesa": "Despesa",
753
+ "transferencia": "Transferência",
754
+ "ajuste": "Ajuste",
755
+ "outro": "Outro"
756
+ },
757
+ "table": {
758
+ "empty": "Nenhuma categoria encontrada.",
759
+ "status": {
760
+ "active": "Ativa",
761
+ "inactive": "Inativa"
762
+ }
763
+ },
764
+ "deleteDialog": {
765
+ "title": "Inativar categoria",
766
+ "description": "Deseja realmente inativar esta categoria financeira?",
767
+ "confirm": "Inativar"
768
+ }
769
+ },
770
+ "AdminCostCentersPage": {
771
+ "common": {
772
+ "cancel": "Cancelar",
773
+ "save": "Salvar"
774
+ },
775
+ "messages": {
776
+ "createSuccess": "Centro de custo cadastrado com sucesso",
777
+ "createError": "Erro ao cadastrar centro de custo",
778
+ "updateSuccess": "Centro de custo atualizado com sucesso",
779
+ "updateError": "Erro ao atualizar centro de custo",
780
+ "deleteSuccess": "Centro de custo inativado com sucesso",
781
+ "deleteError": "Erro ao inativar centro de custo"
782
+ },
783
+ "header": {
784
+ "title": "Centros de Custo",
785
+ "description": "Cadastre e mantenha os centros de custo do financeiro"
786
+ },
787
+ "breadcrumbs": {
788
+ "finance": "Financeiro",
789
+ "administration": "Administração",
790
+ "current": "Centros de Custo"
791
+ },
792
+ "card": {
793
+ "title": "Lista de centros de custo",
794
+ "description": "Gerencie os centros utilizados nos lançamentos financeiros."
795
+ },
796
+ "actions": {
797
+ "newCostCenter": "Novo centro de custo"
798
+ },
799
+ "sheet": {
800
+ "newTitle": "Novo centro de custo",
801
+ "editTitle": "Editar centro de custo",
802
+ "newDescription": "Cadastre um novo centro de custo para classificação financeira.",
803
+ "editDescription": "Atualize as informações do centro de custo.",
804
+ "fields": {
805
+ "name": "Nome",
806
+ "namePlaceholder": "Ex.: Administrativo"
807
+ },
808
+ "validation": {
809
+ "nameRequired": "Nome é obrigatório"
810
+ }
811
+ },
812
+ "table": {
813
+ "empty": "Nenhum centro de custo encontrado.",
814
+ "code": "Código: {code}",
815
+ "status": {
816
+ "active": "Ativo",
817
+ "inactive": "Inativo"
818
+ }
819
+ },
820
+ "deleteDialog": {
821
+ "title": "Inativar centro de custo",
822
+ "description": "Deseja realmente inativar este centro de custo?",
823
+ "confirm": "Inativar"
824
+ }
825
+ },
826
+ "AdminPeriodClosePage": {
827
+ "common": {
828
+ "select": "Selecione",
829
+ "cancel": "Cancelar",
830
+ "save": "Salvar"
831
+ },
832
+ "messages": {
833
+ "createSuccess": "Período fechado com sucesso",
834
+ "createError": "Erro ao fechar período"
835
+ },
836
+ "status": {
837
+ "closed": "Fechado",
838
+ "open": "Aberto"
839
+ },
840
+ "header": {
841
+ "title": "Fechamento de Período",
842
+ "description": "Visualize períodos fechados, autoria e feche novos períodos"
843
+ },
844
+ "breadcrumbs": {
845
+ "finance": "Financeiro",
846
+ "administration": "Administração",
847
+ "current": "Fechamento de Período"
848
+ },
849
+ "card": {
850
+ "title": "Períodos financeiros",
851
+ "description": "Pesquise por datas, usuário e acompanhe quem realizou cada fechamento."
852
+ },
853
+ "actions": {
854
+ "new": "Fechar período"
855
+ },
856
+ "sheet": {
857
+ "title": "Fechar novo período",
858
+ "description": "Informe o intervalo e confirme o fechamento do período financeiro.",
859
+ "fields": {
860
+ "startDate": "Data inicial",
861
+ "endDate": "Data final",
862
+ "status": "Status",
863
+ "notes": "Observações",
864
+ "notesPlaceholder": "Ex.: Fechamento mensal do financeiro"
865
+ },
866
+ "validation": {
867
+ "startRequired": "Data inicial é obrigatória",
868
+ "endRequired": "Data final é obrigatória"
869
+ }
870
+ },
871
+ "filters": {
872
+ "searchPlaceholder": "Buscar em observações, usuário ou e-mail",
873
+ "status": "Status",
874
+ "allStatus": "Todos os status",
875
+ "userPlaceholder": "Usuário (nome, e-mail ou ID)",
876
+ "clear": "Limpar filtros"
877
+ },
878
+ "table": {
879
+ "headers": {
880
+ "start": "Período inicial",
881
+ "end": "Período final",
882
+ "status": "Status",
883
+ "closedBy": "Fechado por",
884
+ "closedAt": "Data do fechamento",
885
+ "notes": "Observações"
886
+ },
887
+ "loading": "Carregando períodos...",
888
+ "empty": "Nenhum período encontrado."
889
+ }
890
+ },
666
891
  "CashFlowForecastPage": {
667
892
  "header": {
668
893
  "title": "Fluxo de Caixa Previsto",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hed-hog/finance",
3
- "version": "0.0.235",
3
+ "version": "0.0.237",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {
@@ -9,14 +9,14 @@
9
9
  "@nestjs/core": "^11",
10
10
  "@nestjs/jwt": "^11",
11
11
  "@nestjs/mapped-types": "*",
12
- "@hed-hog/api-locale": "0.0.11",
13
12
  "@hed-hog/api-prisma": "0.0.4",
13
+ "@hed-hog/tag": "0.0.237",
14
14
  "@hed-hog/api-pagination": "0.0.5",
15
- "@hed-hog/tag": "0.0.235",
16
15
  "@hed-hog/api-types": "0.0.1",
17
16
  "@hed-hog/api": "0.0.3",
18
- "@hed-hog/contact": "0.0.235",
19
- "@hed-hog/core": "0.0.235"
17
+ "@hed-hog/contact": "0.0.237",
18
+ "@hed-hog/core": "0.0.237",
19
+ "@hed-hog/api-locale": "0.0.11"
20
20
  },
21
21
  "exports": {
22
22
  ".": {
@@ -0,0 +1,9 @@
1
+ import { getLocaleText } from '@hed-hog/api-locale';
2
+ import { IsString } from 'class-validator';
3
+
4
+ export class CreateCostCenterDto {
5
+ @IsString({
6
+ message: (args) => getLocaleText('validation.nameMustBeString', args.value),
7
+ })
8
+ name: string;
9
+ }
@@ -0,0 +1,21 @@
1
+ import { getLocaleText } from '@hed-hog/api-locale';
2
+ import { IsInt, IsOptional, IsString } from 'class-validator';
3
+
4
+ export class CreateFinanceCategoryDto {
5
+ @IsString({
6
+ message: (args) => getLocaleText('validation.nameMustBeString', args.value),
7
+ })
8
+ name: string;
9
+
10
+ @IsString({
11
+ message: (args) => getLocaleText('validation.kindMustBeString', args.value),
12
+ })
13
+ kind: string;
14
+
15
+ @IsOptional()
16
+ @IsInt({
17
+ message: (args) =>
18
+ getLocaleText('validation.parentIdMustBeNumber', args.value),
19
+ })
20
+ parent_id?: number;
21
+ }
@@ -0,0 +1,34 @@
1
+ import { getLocaleText } from '@hed-hog/api-locale';
2
+ import { IsDateString, IsOptional, IsString } from 'class-validator';
3
+
4
+ export class CreatePeriodCloseDto {
5
+ @IsDateString(
6
+ {},
7
+ {
8
+ message: (args) =>
9
+ getLocaleText('validation.periodStartMustBeDate', args.value),
10
+ },
11
+ )
12
+ period_start: string;
13
+
14
+ @IsDateString(
15
+ {},
16
+ {
17
+ message: (args) =>
18
+ getLocaleText('validation.periodEndMustBeDate', args.value),
19
+ },
20
+ )
21
+ period_end: string;
22
+
23
+ @IsOptional()
24
+ @IsString({
25
+ message: (args) => getLocaleText('validation.notesMustBeString', args.value),
26
+ })
27
+ notes?: string;
28
+
29
+ @IsOptional()
30
+ @IsString({
31
+ message: (args) => getLocaleText('validation.statusMustBeString', args.value),
32
+ })
33
+ status?: 'open' | 'closed';
34
+ }
@@ -0,0 +1,18 @@
1
+ import { getLocaleText } from '@hed-hog/api-locale';
2
+ import { IsInt, IsOptional } from 'class-validator';
3
+
4
+ export class MoveFinanceCategoryDto {
5
+ @IsOptional()
6
+ @IsInt({
7
+ message: (args) =>
8
+ getLocaleText('validation.parentIdMustBeNumber', args.value),
9
+ })
10
+ parent_id?: number;
11
+
12
+ @IsOptional()
13
+ @IsInt({
14
+ message: (args) =>
15
+ getLocaleText('validation.positionMustBeNumber', args.value),
16
+ })
17
+ position?: number;
18
+ }
@@ -0,0 +1,17 @@
1
+ import { getLocaleText } from '@hed-hog/api-locale';
2
+ import { IsOptional, IsString } from 'class-validator';
3
+
4
+ export class UpdateCostCenterDto {
5
+ @IsOptional()
6
+ @IsString({
7
+ message: (args) => getLocaleText('validation.nameMustBeString', args.value),
8
+ })
9
+ name?: string;
10
+
11
+ @IsOptional()
12
+ @IsString({
13
+ message: (args) =>
14
+ getLocaleText('validation.statusMustBeString', args.value),
15
+ })
16
+ status?: 'active' | 'inactive';
17
+ }
@@ -0,0 +1,30 @@
1
+ import { getLocaleText } from '@hed-hog/api-locale';
2
+ import { IsInt, IsOptional, IsString } from 'class-validator';
3
+
4
+ export class UpdateFinanceCategoryDto {
5
+ @IsOptional()
6
+ @IsString({
7
+ message: (args) => getLocaleText('validation.nameMustBeString', args.value),
8
+ })
9
+ name?: string;
10
+
11
+ @IsOptional()
12
+ @IsString({
13
+ message: (args) => getLocaleText('validation.kindMustBeString', args.value),
14
+ })
15
+ kind?: string;
16
+
17
+ @IsOptional()
18
+ @IsInt({
19
+ message: (args) =>
20
+ getLocaleText('validation.parentIdMustBeNumber', args.value),
21
+ })
22
+ parent_id?: number;
23
+
24
+ @IsOptional()
25
+ @IsString({
26
+ message: (args) =>
27
+ getLocaleText('validation.statusMustBeString', args.value),
28
+ })
29
+ status?: 'active' | 'inactive';
30
+ }
@@ -0,0 +1,30 @@
1
+ import { Role } from '@hed-hog/api';
2
+ import { Pagination } from '@hed-hog/api-pagination';
3
+ import { Controller, Get, Query } from '@nestjs/common';
4
+ import { FinanceService } from './finance.service';
5
+
6
+ @Role()
7
+ @Controller('finance')
8
+ export class FinanceAuditLogsController {
9
+ constructor(private readonly financeService: FinanceService) {}
10
+
11
+ @Get('audit-logs')
12
+ async listAuditLogs(
13
+ @Pagination() paginationParams,
14
+ @Query('search') search?: string,
15
+ @Query('action') action?: string,
16
+ @Query('entity_table') entityTable?: string,
17
+ @Query('actor_user_id') actorUserId?: string,
18
+ @Query('from') from?: string,
19
+ @Query('to') to?: string,
20
+ ) {
21
+ return this.financeService.listAuditLogs(paginationParams, {
22
+ search,
23
+ action,
24
+ entity_table: entityTable,
25
+ actor_user_id: actorUserId,
26
+ from,
27
+ to,
28
+ });
29
+ }
30
+ }