@nomalism-com/types 0.37.10 → 0.37.12

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[]>;
@@ -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
  /**
@@ -622,6 +621,218 @@ export type DocumentLinePendingConflict = {
622
621
  created_by: string;
623
622
  updated_by: string;
624
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
+ };
625
836
  /**
626
837
  * Model ProductPromotionVirtuals
627
838
  *
@@ -809,7 +1020,6 @@ export type StartDocumentHeaderLastUpdateVirtuals = {
809
1020
  */
810
1021
  export type StartDocumentHeaderVirtuals = {
811
1022
  parent_document_header_id: string;
812
- name: string;
813
1023
  paid: number;
814
1024
  total_without_tax: number;
815
1025
  total: number;
@@ -823,36 +1033,12 @@ export type StartDocumentHeaderVirtuals = {
823
1033
  closed: boolean;
824
1034
  state: string;
825
1035
  };
826
- /**
827
- * Model DocumentHeaderClientPaymentVirtuals
828
- *
829
- */
830
- export type DocumentHeaderClientPaymentVirtuals = {
831
- id: string;
832
- client_paid: number;
833
- client_unpaid: number;
834
- };
835
- /**
836
- * Model DocumentHeaderBaseVirtuals
837
- *
838
- */
839
- export type DocumentHeaderBaseVirtuals = {
840
- id: string;
841
- p_id: string;
842
- name: string;
843
- external_name: string | null;
844
- document_number: string;
845
- };
846
1036
  /**
847
1037
  * Model DocumentHeaderVirtuals
848
1038
  *
849
1039
  */
850
1040
  export type DocumentHeaderVirtuals = {
851
1041
  id: string;
852
- p_id: string;
853
- name: string;
854
- external_name: string | null;
855
- document_number: string;
856
1042
  client_total_without_tax: number;
857
1043
  client_total: number;
858
1044
  client_total_discount: number;
@@ -862,287 +1048,3 @@ export type DocumentHeaderVirtuals = {
862
1048
  provider_total_without_tax: number;
863
1049
  provider_total: number;
864
1050
  };
865
- /**
866
- * Model DocumentHeaderClientVirtuals
867
- *
868
- */
869
- export type DocumentHeaderClientVirtuals = {
870
- id: string;
871
- p_id: string;
872
- name: string;
873
- external_name: string | null;
874
- document_number: string;
875
- client_total_without_tax: number;
876
- client_total: number;
877
- client_total_discount: number;
878
- client_total_tax: number;
879
- };
880
- /**
881
- * Model DocumentHeaderProviderVirtuals
882
- *
883
- */
884
- export type DocumentHeaderProviderVirtuals = {
885
- id: string;
886
- p_id: string;
887
- name: string;
888
- external_name: string | null;
889
- document_number: string;
890
- provider_total_discount: number;
891
- provider_total_tax: number;
892
- provider_total_without_tax: number;
893
- provider_total: number;
894
- };
895
- /**
896
- * Model StockMovement
897
- *
898
- */
899
- export type StockMovement = {
900
- document_line_id: string;
901
- product_id: string;
902
- emission_date: string;
903
- name: string;
904
- pdf_link: string | null;
905
- parent_document_header_id: string | null;
906
- created_by: string;
907
- quantity: number;
908
- stock_to_date: number;
909
- };
910
- /**
911
- * Model SettledMaterialEntrance
912
- *
913
- */
914
- export type SettledMaterialEntrance = {
915
- id: string;
916
- document_description: string;
917
- document_name: string;
918
- total: number;
919
- saldo: number;
920
- data_vencimento: Date;
921
- emission_date: Date;
922
- pdf_link: string | null;
923
- type: IPaymentOrigin;
924
- owner_id: string;
925
- };
926
- /**
927
- * Model ProviderProductView
928
- *
929
- */
930
- export type ProviderProductView = {
931
- product_id: string;
932
- type: IProductType;
933
- id_provider: number;
934
- obs: boolean;
935
- multimedia_id: string | null;
936
- ref: string;
937
- des: string;
938
- provider_ref: string | null;
939
- price_cost: number;
940
- price_sale: number;
941
- available: number;
942
- last_ef_date: Date | null;
943
- ordered_quantity: number;
944
- last_em_date: Date | null;
945
- notation: string;
946
- pfs: IFindProposals[];
947
- pcs: IFindProposals[];
948
- client_quantity: number;
949
- pre_ordered_quantity: number;
950
- last6m_consumption: number;
951
- };
952
- export type DocumentLineGroup = {
953
- id: string;
954
- created_at: Date;
955
- updated_at: Date;
956
- created_by: string;
957
- updated_by: string;
958
- };
959
- export type SavedEmPicking = {
960
- id: string;
961
- provider_id: string;
962
- document_header_id: string;
963
- document_line_group_id: string;
964
- data: ISavedEmPickingData;
965
- created_at: Date;
966
- updated_at: Date;
967
- created_by: string;
968
- updated_by: string;
969
- };
970
- export type GoogleSheetImports = {
971
- id: string;
972
- google_sheet_id: string;
973
- done: boolean;
974
- data: unknown | null;
975
- error: unknown | null;
976
- created_at: Date;
977
- created_by: string;
978
- updated_at: Date;
979
- };
980
- export type DocumentLineNote = {
981
- id: string;
982
- note: string;
983
- type: IDocumentLineNoteType;
984
- document_line_id: string;
985
- created_by: string;
986
- created_at: Date;
987
- updated_by: string;
988
- updated_at: Date;
989
- };
990
- export type SavedProviderProposal = {
991
- id: string;
992
- provider_id: string;
993
- product_id: string;
994
- quantity: number;
995
- created_at: Date;
996
- updated_at: Date;
997
- created_by: string;
998
- updated_by: string;
999
- };
1000
- export type ProductSheet = {
1001
- id: string;
1002
- reference: string;
1003
- type: IProductType;
1004
- state: IProductSheetState;
1005
- values: unknown;
1006
- imported_from_sheets: boolean;
1007
- vat_tax_id: string;
1008
- unit_of_measure_quantity_id: string;
1009
- cabide_product_color: string | null;
1010
- weight: number | null;
1011
- width: number | null;
1012
- height: number | null;
1013
- length: number | null;
1014
- diameter: number | null;
1015
- provider_ref: string | null;
1016
- id_provider: number;
1017
- name: string | null;
1018
- designation: string;
1019
- origin_id: string | null;
1020
- type_of_inventory: string;
1021
- external_id: string | null;
1022
- max_discount: number;
1023
- maintenances: string;
1024
- compositions: string;
1025
- attributes: string;
1026
- location: string | null;
1027
- created_at: Date;
1028
- updated_at: Date;
1029
- created_by: string;
1030
- updated_by: string;
1031
- };
1032
- export interface Task {
1033
- id: string;
1034
- from: string;
1035
- to: string | null;
1036
- task: string;
1037
- finished: boolean;
1038
- archived: boolean;
1039
- history: unknown | null;
1040
- status: ITaskStatusDataType;
1041
- future_date: Date | null;
1042
- number: number;
1043
- created_at: Date;
1044
- updated_at: Date;
1045
- created_by: string;
1046
- updated_by: string;
1047
- }
1048
- export interface TaskMessage {
1049
- id: string;
1050
- message: string;
1051
- task_id: string;
1052
- created_at: Date;
1053
- updated_at: Date;
1054
- created_by: string;
1055
- updated_by: string;
1056
- }
1057
- export interface TaskRead {
1058
- id: string;
1059
- task_id: string;
1060
- user_id: string;
1061
- created_at: Date;
1062
- }
1063
- /**
1064
- * Model ChatRapidMessage
1065
- *
1066
- */
1067
- export type ChatRapidMessage = {
1068
- id: string;
1069
- title: string;
1070
- message: string;
1071
- created_at: Date;
1072
- updated_at: Date;
1073
- created_by: string;
1074
- updated_by: string;
1075
- };
1076
- /**
1077
- * Model File
1078
- *
1079
- */
1080
- export type File = {
1081
- id: string;
1082
- title: string;
1083
- owner_id: string;
1084
- document_header_id: string | null;
1085
- multimedia_id: string;
1086
- filename: string;
1087
- is_customer: boolean;
1088
- is_private: boolean;
1089
- tags: string;
1090
- created_by: string;
1091
- updated_by: string;
1092
- created_at: Date;
1093
- updated_at: Date;
1094
- };
1095
- /**
1096
- * Model DocumentLineRM
1097
- *
1098
- */
1099
- export type DocumentLineRM = {
1100
- document_line_id: string;
1101
- rm_order_by: string | null;
1102
- rm_order_date: Date | null;
1103
- rm_execution_by: string | null;
1104
- rm_execution_date: Date | null;
1105
- rm_execution_when: Date | null;
1106
- rm_sent_by: string | null;
1107
- rm_sent_date: Date | null;
1108
- rm_done_by: string | null;
1109
- rm_done_date: Date | null;
1110
- rm_checked_by: string | null;
1111
- rm_checked_date: Date | null;
1112
- created_by: string;
1113
- updated_by: string;
1114
- created_at: Date;
1115
- updated_at: Date;
1116
- };
1117
- /**
1118
- * Model DocumentLineMT
1119
- *
1120
- */
1121
- export type DocumentLineMT = {
1122
- document_line_id: string;
1123
- mt_order_by: string | null;
1124
- mt_order_date: Date | null;
1125
- mt_execution_by: string | null;
1126
- mt_execution_date: Date | null;
1127
- mt_execution_when: Date | null;
1128
- mt_order_with_notification: boolean;
1129
- created_by: string;
1130
- updated_by: string;
1131
- created_at: Date;
1132
- updated_at: Date;
1133
- };
1134
- /**
1135
- * Model Tag
1136
- *
1137
- */
1138
- export type Tag = {
1139
- id: string;
1140
- text: string;
1141
- index: number;
1142
- type: ITagType;
1143
- document_header_id: string;
1144
- created_by: string;
1145
- updated_by: string;
1146
- created_at: Date;
1147
- updated_at: Date;
1148
- };
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.10",
4
+ "version": "0.37.12",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",