@nomalism-com/types 0.37.9 → 0.37.11

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.
@@ -1,5 +1,5 @@
1
1
  import * as IShared from '../../../shared/interface';
2
- import { DocumentHeader, DocumentHeaderClientVirtuals, DocumentHeaderProviderVirtuals, DocumentHeaderVirtuals, DocumentHeaderBaseVirtuals, DocumentType, StartDocumentHeaderVirtuals, DocumentHeaderClientPaymentVirtuals, DocumentLineNote, VatTax } from '../../../shared/entities/stock';
2
+ import { DocumentHeader, DocumentHeaderVirtuals, DocumentType, StartDocumentHeaderVirtuals, DocumentLineNote, VatTax } from '../../../shared/entities/stock';
3
3
  import * as IDocumentType from '../documentType/interfaces';
4
4
  import * as IPayment from '../payment/interface';
5
5
  import type { IProjectInfoType } from '../../integration/projectInfo/interfaces';
@@ -7,12 +7,8 @@ export type Entity = Omit<DocumentHeader, 'external_data'>;
7
7
  export declare const Route = "documentHeader";
8
8
  export declare const UpperName = "DocumentHeader";
9
9
  export declare const LowerName: string;
10
- export type IDocumentHeaderBaseVirtuals = DocumentHeaderBaseVirtuals;
11
10
  export type IDocumentHeaderVirtuals = DocumentHeaderVirtuals;
12
- export type IDocumentHeaderClientVirtuals = DocumentHeaderClientVirtuals;
13
- export type IDocumentHeaderProviderVirtuals = DocumentHeaderProviderVirtuals;
14
11
  export type IStartDocumentHeaderVirtuals = StartDocumentHeaderVirtuals;
15
- export type IDocumentHeaderClientPaymentVirtuals = DocumentHeaderClientPaymentVirtuals;
16
12
  export interface ITaxEntry extends Pick<VatTax, 'name' | 'saft_code'> {
17
13
  percentage: number;
18
14
  totalTaxableBase: number;
@@ -41,9 +37,6 @@ export interface IProjectInfo {
41
37
  export interface IFindOneBase extends Entity {
42
38
  document_type: IDocumentType.IEntityExtended;
43
39
  }
44
- export interface IFindOneResponse extends IFindOneBase {
45
- base_virtual: IDocumentHeaderBaseVirtuals | null;
46
- }
47
40
  export interface IBasicSearchRequest extends IShared.IPaginationRequest {
48
41
  search_value: string | null;
49
42
  inactive?: boolean;
@@ -338,7 +331,7 @@ export interface IMultipleRegularizations {
338
331
  payments?: IMultipleRegularizationPayments[];
339
332
  }
340
333
  export interface IRepository {
341
- findOne(selector: IShared.IFindByIdRequest): Promise<IFindOneResponse | null>;
334
+ findOne(selector: IShared.IFindByIdRequest): Promise<IFindOneBase | null>;
342
335
  findStart(selector: IShared.IFindByIdRequest): Promise<IFindOneBase | null>;
343
336
  findStartVirtual(selector: IShared.IFindByIdRequest): Promise<IStartDocumentHeaderVirtuals | null>;
344
337
  findByType(params: IFindByTypeRequest): Promise<IFindByTypeResponse[]>;
@@ -359,7 +352,6 @@ export interface IRepository {
359
352
  documentPdf(selector: IShared.IFindByIdRequest, data: IDocumentPdfRequest): Promise<string>;
360
353
  documentThermalPrint(selector: IShared.IFindByIdRequest): Promise<string>;
361
354
  documentList(selector: IShared.IFindByIdRequest, params: IDocumentListRequest): Promise<IDocumentListResponse[]>;
362
- getAllRelatedDocumentHeaderIds(params: IShared.IFindByIdRequest): Promise<string[]>;
363
355
  findStartDocumentHeaderSiblings(params: IShared.IFindByIdRequest): Promise<IFindStartDocumentHeaderSiblingsResponse>;
364
356
  findRmOpenDocuments(): Promise<IFindRmOpenDocuments[]>;
365
357
  regularizarMultiplosDocumentos(data: IMultipleRegularizations): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { IConflict } from '../../modules/document/propostaSheets/interface';
2
2
  import { IDocumentTypeUserType, IDocumentTypeCodeType } from '../../modules/supply/documentType/interfaces';
3
- import { IBatchType, IPaymentOrigin } from '../../modules/supply/payment/interface';
3
+ import { IBatchType } from '../../modules/supply/payment/interface';
4
4
  import { IProductType } from '../../modules/stock/productGoogleSheets/interface';
5
5
  import { IImageType } from '../../modules/stock/productImage/interface';
6
6
  import { ITagType } from '../../modules/stock/tag/interface';
@@ -9,7 +9,6 @@ import { IData, IDataDocumentoPago, IDataPagamento, IPromotions, type IImportedF
9
9
  import { ISavedEmPickingData } from '../../modules/stock/savedEmPicking/interfaces';
10
10
  import { IDocumentLineNoteType } from '../../modules/supply/documentLineNote/interfaces';
11
11
  import { IProductSheetState } from '../../modules/stock/productGoogleSheets/interface';
12
- import type { IFindProposals } from '../../modules/supply/orderManagement/interface';
13
12
  import { ITaskStatusDataType } from '../../modules/stock/task/interface';
14
13
  import type { IProjectInfo, IRsaHashData, ITaxEntry } from '../../modules/supply/documentHeader/interfaces';
15
14
  /**
@@ -254,6 +253,7 @@ export type DocumentType = {
254
253
  */
255
254
  export type DocumentHeader = {
256
255
  id: string;
256
+ start_document_header_id: string;
257
257
  from_document_header_id: string | null;
258
258
  document_type_id: number;
259
259
  document_number: number;
@@ -621,6 +621,218 @@ export type DocumentLinePendingConflict = {
621
621
  created_by: string;
622
622
  updated_by: string;
623
623
  };
624
+ /**
625
+ * Model StockMovement
626
+ *
627
+ */
628
+ export type StockMovement = {
629
+ document_line_id: string;
630
+ product_id: string;
631
+ emission_date: string;
632
+ name: string;
633
+ pdf_link: string | null;
634
+ parent_document_header_id: string | null;
635
+ created_by: string;
636
+ quantity: number;
637
+ stock_to_date: number;
638
+ };
639
+ export type DocumentLineGroup = {
640
+ id: string;
641
+ created_at: Date;
642
+ updated_at: Date;
643
+ created_by: string;
644
+ updated_by: string;
645
+ };
646
+ export type SavedEmPicking = {
647
+ id: string;
648
+ provider_id: string;
649
+ document_header_id: string;
650
+ document_line_group_id: string;
651
+ data: ISavedEmPickingData;
652
+ created_at: Date;
653
+ updated_at: Date;
654
+ created_by: string;
655
+ updated_by: string;
656
+ };
657
+ export type GoogleSheetImports = {
658
+ id: string;
659
+ google_sheet_id: string;
660
+ done: boolean;
661
+ data: unknown | null;
662
+ error: unknown | null;
663
+ created_at: Date;
664
+ created_by: string;
665
+ updated_at: Date;
666
+ };
667
+ export type DocumentLineNote = {
668
+ id: string;
669
+ note: string;
670
+ type: IDocumentLineNoteType;
671
+ document_line_id: string;
672
+ created_by: string;
673
+ created_at: Date;
674
+ updated_by: string;
675
+ updated_at: Date;
676
+ };
677
+ export type SavedProviderProposal = {
678
+ id: string;
679
+ provider_id: string;
680
+ product_id: string;
681
+ quantity: number;
682
+ created_at: Date;
683
+ updated_at: Date;
684
+ created_by: string;
685
+ updated_by: string;
686
+ };
687
+ export type ProductSheet = {
688
+ id: string;
689
+ reference: string;
690
+ type: IProductType;
691
+ state: IProductSheetState;
692
+ values: unknown;
693
+ imported_from_sheets: boolean;
694
+ vat_tax_id: string;
695
+ unit_of_measure_quantity_id: string;
696
+ cabide_product_color: string | null;
697
+ weight: number | null;
698
+ width: number | null;
699
+ height: number | null;
700
+ length: number | null;
701
+ diameter: number | null;
702
+ provider_ref: string | null;
703
+ id_provider: number;
704
+ name: string | null;
705
+ designation: string;
706
+ origin_id: string | null;
707
+ type_of_inventory: string;
708
+ external_id: string | null;
709
+ max_discount: number;
710
+ maintenances: string;
711
+ compositions: string;
712
+ attributes: string;
713
+ location: string | null;
714
+ created_at: Date;
715
+ updated_at: Date;
716
+ created_by: string;
717
+ updated_by: string;
718
+ };
719
+ export interface Task {
720
+ id: string;
721
+ from: string;
722
+ to: string | null;
723
+ task: string;
724
+ finished: boolean;
725
+ archived: boolean;
726
+ history: unknown | null;
727
+ status: ITaskStatusDataType;
728
+ future_date: Date | null;
729
+ number: number;
730
+ created_at: Date;
731
+ updated_at: Date;
732
+ created_by: string;
733
+ updated_by: string;
734
+ }
735
+ export interface TaskMessage {
736
+ id: string;
737
+ message: string;
738
+ task_id: string;
739
+ created_at: Date;
740
+ updated_at: Date;
741
+ created_by: string;
742
+ updated_by: string;
743
+ }
744
+ export interface TaskRead {
745
+ id: string;
746
+ task_id: string;
747
+ user_id: string;
748
+ created_at: Date;
749
+ }
750
+ /**
751
+ * Model ChatRapidMessage
752
+ *
753
+ */
754
+ export type ChatRapidMessage = {
755
+ id: string;
756
+ title: string;
757
+ message: string;
758
+ created_at: Date;
759
+ updated_at: Date;
760
+ created_by: string;
761
+ updated_by: string;
762
+ };
763
+ /**
764
+ * Model File
765
+ *
766
+ */
767
+ export type File = {
768
+ id: string;
769
+ title: string;
770
+ owner_id: string;
771
+ document_header_id: string | null;
772
+ multimedia_id: string;
773
+ filename: string;
774
+ is_customer: boolean;
775
+ is_private: boolean;
776
+ tags: string;
777
+ created_by: string;
778
+ updated_by: string;
779
+ created_at: Date;
780
+ updated_at: Date;
781
+ };
782
+ /**
783
+ * Model DocumentLineRM
784
+ *
785
+ */
786
+ export type DocumentLineRM = {
787
+ document_line_id: string;
788
+ rm_order_by: string | null;
789
+ rm_order_date: Date | null;
790
+ rm_execution_by: string | null;
791
+ rm_execution_date: Date | null;
792
+ rm_execution_when: Date | null;
793
+ rm_sent_by: string | null;
794
+ rm_sent_date: Date | null;
795
+ rm_done_by: string | null;
796
+ rm_done_date: Date | null;
797
+ rm_checked_by: string | null;
798
+ rm_checked_date: Date | null;
799
+ created_by: string;
800
+ updated_by: string;
801
+ created_at: Date;
802
+ updated_at: Date;
803
+ };
804
+ /**
805
+ * Model DocumentLineMT
806
+ *
807
+ */
808
+ export type DocumentLineMT = {
809
+ document_line_id: string;
810
+ mt_order_by: string | null;
811
+ mt_order_date: Date | null;
812
+ mt_execution_by: string | null;
813
+ mt_execution_date: Date | null;
814
+ mt_execution_when: Date | null;
815
+ mt_order_with_notification: boolean;
816
+ created_by: string;
817
+ updated_by: string;
818
+ created_at: Date;
819
+ updated_at: Date;
820
+ };
821
+ /**
822
+ * Model Tag
823
+ *
824
+ */
825
+ export type Tag = {
826
+ id: string;
827
+ text: string;
828
+ index: number;
829
+ type: ITagType;
830
+ document_header_id: string;
831
+ created_by: string;
832
+ updated_by: string;
833
+ created_at: Date;
834
+ updated_at: Date;
835
+ };
624
836
  /**
625
837
  * Model ProductPromotionVirtuals
626
838
  *
@@ -822,26 +1034,6 @@ export type StartDocumentHeaderVirtuals = {
822
1034
  closed: boolean;
823
1035
  state: string;
824
1036
  };
825
- /**
826
- * Model DocumentHeaderClientPaymentVirtuals
827
- *
828
- */
829
- export type DocumentHeaderClientPaymentVirtuals = {
830
- id: string;
831
- client_paid: number;
832
- client_unpaid: number;
833
- };
834
- /**
835
- * Model DocumentHeaderBaseVirtuals
836
- *
837
- */
838
- export type DocumentHeaderBaseVirtuals = {
839
- id: string;
840
- p_id: string;
841
- name: string;
842
- external_name: string | null;
843
- document_number: string;
844
- };
845
1037
  /**
846
1038
  * Model DocumentHeaderVirtuals
847
1039
  *
@@ -861,287 +1053,3 @@ export type DocumentHeaderVirtuals = {
861
1053
  provider_total_without_tax: number;
862
1054
  provider_total: number;
863
1055
  };
864
- /**
865
- * Model DocumentHeaderClientVirtuals
866
- *
867
- */
868
- export type DocumentHeaderClientVirtuals = {
869
- id: string;
870
- p_id: string;
871
- name: string;
872
- external_name: string | null;
873
- document_number: string;
874
- client_total_without_tax: number;
875
- client_total: number;
876
- client_total_discount: number;
877
- client_total_tax: number;
878
- };
879
- /**
880
- * Model DocumentHeaderProviderVirtuals
881
- *
882
- */
883
- export type DocumentHeaderProviderVirtuals = {
884
- id: string;
885
- p_id: string;
886
- name: string;
887
- external_name: string | null;
888
- document_number: string;
889
- provider_total_discount: number;
890
- provider_total_tax: number;
891
- provider_total_without_tax: number;
892
- provider_total: number;
893
- };
894
- /**
895
- * Model StockMovement
896
- *
897
- */
898
- export type StockMovement = {
899
- document_line_id: string;
900
- product_id: string;
901
- emission_date: string;
902
- name: string;
903
- pdf_link: string | null;
904
- parent_document_header_id: string | null;
905
- created_by: string;
906
- quantity: number;
907
- stock_to_date: number;
908
- };
909
- /**
910
- * Model SettledMaterialEntrance
911
- *
912
- */
913
- export type SettledMaterialEntrance = {
914
- id: string;
915
- document_description: string;
916
- document_name: string;
917
- total: number;
918
- saldo: number;
919
- data_vencimento: Date;
920
- emission_date: Date;
921
- pdf_link: string | null;
922
- type: IPaymentOrigin;
923
- owner_id: string;
924
- };
925
- /**
926
- * Model ProviderProductView
927
- *
928
- */
929
- export type ProviderProductView = {
930
- product_id: string;
931
- type: IProductType;
932
- id_provider: number;
933
- obs: boolean;
934
- multimedia_id: string | null;
935
- ref: string;
936
- des: string;
937
- provider_ref: string | null;
938
- price_cost: number;
939
- price_sale: number;
940
- available: number;
941
- last_ef_date: Date | null;
942
- ordered_quantity: number;
943
- last_em_date: Date | null;
944
- notation: string;
945
- pfs: IFindProposals[];
946
- pcs: IFindProposals[];
947
- client_quantity: number;
948
- pre_ordered_quantity: number;
949
- last6m_consumption: number;
950
- };
951
- export type DocumentLineGroup = {
952
- id: string;
953
- created_at: Date;
954
- updated_at: Date;
955
- created_by: string;
956
- updated_by: string;
957
- };
958
- export type SavedEmPicking = {
959
- id: string;
960
- provider_id: string;
961
- document_header_id: string;
962
- document_line_group_id: string;
963
- data: ISavedEmPickingData;
964
- created_at: Date;
965
- updated_at: Date;
966
- created_by: string;
967
- updated_by: string;
968
- };
969
- export type GoogleSheetImports = {
970
- id: string;
971
- google_sheet_id: string;
972
- done: boolean;
973
- data: unknown | null;
974
- error: unknown | null;
975
- created_at: Date;
976
- created_by: string;
977
- updated_at: Date;
978
- };
979
- export type DocumentLineNote = {
980
- id: string;
981
- note: string;
982
- type: IDocumentLineNoteType;
983
- document_line_id: string;
984
- created_by: string;
985
- created_at: Date;
986
- updated_by: string;
987
- updated_at: Date;
988
- };
989
- export type SavedProviderProposal = {
990
- id: string;
991
- provider_id: string;
992
- product_id: string;
993
- quantity: number;
994
- created_at: Date;
995
- updated_at: Date;
996
- created_by: string;
997
- updated_by: string;
998
- };
999
- export type ProductSheet = {
1000
- id: string;
1001
- reference: string;
1002
- type: IProductType;
1003
- state: IProductSheetState;
1004
- values: unknown;
1005
- imported_from_sheets: boolean;
1006
- vat_tax_id: string;
1007
- unit_of_measure_quantity_id: string;
1008
- cabide_product_color: string | null;
1009
- weight: number | null;
1010
- width: number | null;
1011
- height: number | null;
1012
- length: number | null;
1013
- diameter: number | null;
1014
- provider_ref: string | null;
1015
- id_provider: number;
1016
- name: string | null;
1017
- designation: string;
1018
- origin_id: string | null;
1019
- type_of_inventory: string;
1020
- external_id: string | null;
1021
- max_discount: number;
1022
- maintenances: string;
1023
- compositions: string;
1024
- attributes: string;
1025
- location: string | null;
1026
- created_at: Date;
1027
- updated_at: Date;
1028
- created_by: string;
1029
- updated_by: string;
1030
- };
1031
- export interface Task {
1032
- id: string;
1033
- from: string;
1034
- to: string | null;
1035
- task: string;
1036
- finished: boolean;
1037
- archived: boolean;
1038
- history: unknown | null;
1039
- status: ITaskStatusDataType;
1040
- future_date: Date | null;
1041
- number: number;
1042
- created_at: Date;
1043
- updated_at: Date;
1044
- created_by: string;
1045
- updated_by: string;
1046
- }
1047
- export interface TaskMessage {
1048
- id: string;
1049
- message: string;
1050
- task_id: string;
1051
- created_at: Date;
1052
- updated_at: Date;
1053
- created_by: string;
1054
- updated_by: string;
1055
- }
1056
- export interface TaskRead {
1057
- id: string;
1058
- task_id: string;
1059
- user_id: string;
1060
- created_at: Date;
1061
- }
1062
- /**
1063
- * Model ChatRapidMessage
1064
- *
1065
- */
1066
- export type ChatRapidMessage = {
1067
- id: string;
1068
- title: string;
1069
- message: string;
1070
- created_at: Date;
1071
- updated_at: Date;
1072
- created_by: string;
1073
- updated_by: string;
1074
- };
1075
- /**
1076
- * Model File
1077
- *
1078
- */
1079
- export type File = {
1080
- id: string;
1081
- title: string;
1082
- owner_id: string;
1083
- document_header_id: string | null;
1084
- multimedia_id: string;
1085
- filename: string;
1086
- is_customer: boolean;
1087
- is_private: boolean;
1088
- tags: string;
1089
- created_by: string;
1090
- updated_by: string;
1091
- created_at: Date;
1092
- updated_at: Date;
1093
- };
1094
- /**
1095
- * Model DocumentLineRM
1096
- *
1097
- */
1098
- export type DocumentLineRM = {
1099
- document_line_id: string;
1100
- rm_order_by: string | null;
1101
- rm_order_date: Date | null;
1102
- rm_execution_by: string | null;
1103
- rm_execution_date: Date | null;
1104
- rm_execution_when: Date | null;
1105
- rm_sent_by: string | null;
1106
- rm_sent_date: Date | null;
1107
- rm_done_by: string | null;
1108
- rm_done_date: Date | null;
1109
- rm_checked_by: string | null;
1110
- rm_checked_date: Date | null;
1111
- created_by: string;
1112
- updated_by: string;
1113
- created_at: Date;
1114
- updated_at: Date;
1115
- };
1116
- /**
1117
- * Model DocumentLineMT
1118
- *
1119
- */
1120
- export type DocumentLineMT = {
1121
- document_line_id: string;
1122
- mt_order_by: string | null;
1123
- mt_order_date: Date | null;
1124
- mt_execution_by: string | null;
1125
- mt_execution_date: Date | null;
1126
- mt_execution_when: Date | null;
1127
- mt_order_with_notification: boolean;
1128
- created_by: string;
1129
- updated_by: string;
1130
- created_at: Date;
1131
- updated_at: Date;
1132
- };
1133
- /**
1134
- * Model Tag
1135
- *
1136
- */
1137
- export type Tag = {
1138
- id: string;
1139
- text: string;
1140
- index: number;
1141
- type: ITagType;
1142
- document_header_id: string;
1143
- created_by: string;
1144
- updated_by: string;
1145
- created_at: Date;
1146
- updated_at: Date;
1147
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nomalism-com/types",
3
3
  "description": "A nomalism package with all necessary types and validations for developing APIs",
4
- "version": "0.37.9",
4
+ "version": "0.37.11",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",