@nomalism-com/types 1.2.1 → 1.2.3

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.
package/dist/index.js CHANGED
@@ -1176,7 +1176,6 @@ var updateBodyKeys4 = {
1176
1176
  email_delivered: joi10.boolean().optional(),
1177
1177
  email_opened: joi10.boolean().optional(),
1178
1178
  email_clicked: joi10.boolean().optional(),
1179
- whatsapp_sent: joi10.boolean().optional(),
1180
1179
  read: joi10.boolean().optional(),
1181
1180
  username: joi10.string().optional()
1182
1181
  };
@@ -1939,15 +1938,13 @@ __export(route_schema_exports19, {
1939
1938
  var createBodyKeys12 = {
1940
1939
  name: joi10.string().required(),
1941
1940
  document_set_id: joi10.number().integer().allow(null).optional(),
1942
- active_by_default: joi10.boolean().default(false).optional(),
1943
- validation_code: joi10.string().required()
1941
+ active_by_default: joi10.boolean().default(false).optional()
1944
1942
  };
1945
1943
  var createBody13 = joi10.object().keys(createBodyKeys12).messages(messages);
1946
1944
  var updateBodyKeys11 = {
1947
1945
  name: joi10.string(),
1948
1946
  document_set_id: joi10.number().integer().allow(null).optional(),
1949
- active_by_default: joi10.boolean().optional(),
1950
- validation_code: joi10.string().optional()
1947
+ active_by_default: joi10.boolean().optional()
1951
1948
  };
1952
1949
  var updateBody11 = joi10.object().keys(updateBodyKeys11).messages(messages);
1953
1950
 
@@ -4661,20 +4658,27 @@ var LowerName78 = UpperName78[0].toLowerCase() + UpperName78.substring(1);
4661
4658
  // src/modules/document/transformado/route.schema.ts
4662
4659
  var route_schema_exports85 = {};
4663
4660
  __export(route_schema_exports85, {
4664
- createTransformadosBody: () => createTransformadosBody
4661
+ destransformarBody: () => destransformarBody,
4662
+ transformarBody: () => transformarBody
4665
4663
  });
4666
- var productsCreateTransformadosKeys = {
4664
+ var productsKeys = {
4667
4665
  id: joi10.string().uuid().required().invalid(joi10.ref("/product_id")),
4668
4666
  quantity: joi10.number().positive().required()
4669
4667
  };
4670
- var createTransformadosKeys = {
4668
+ var transformarKeys = {
4671
4669
  product_id: joi10.string().uuid().required(),
4672
4670
  quantity: joi10.number().positive().required(),
4673
4671
  price_cost: joi10.number().positive().allow(0).required(),
4674
4672
  price_sale: joi10.number().positive().allow(0).required(),
4675
- products: joi10.array().items(joi10.object().keys(productsCreateTransformadosKeys)).min(1)
4673
+ out_products: joi10.array().items(joi10.object().keys(productsKeys)).min(1)
4676
4674
  };
4677
- var createTransformadosBody = joi10.object().keys(createTransformadosKeys).messages(messages);
4675
+ var transformarBody = joi10.object().keys(transformarKeys).messages(messages);
4676
+ var destransformarKeys = {
4677
+ product_id: joi10.string().uuid().required(),
4678
+ quantity: joi10.number().positive().required(),
4679
+ in_products: joi10.array().items(joi10.object().keys(productsKeys)).min(1)
4680
+ };
4681
+ var destransformarBody = joi10.object().keys(destransformarKeys).messages(messages);
4678
4682
 
4679
4683
  // src/modules/document/quebra/interfaces.ts
4680
4684
  var interfaces_exports46 = {};
@@ -5236,6 +5240,7 @@ var historyStatusDataType = Object.keys(IHistoryStatusDataTypeEnum);
5236
5240
  var route_schema_exports97 = {};
5237
5241
  __export(route_schema_exports97, {
5238
5242
  createBody: () => createBody64,
5243
+ createFromDossierBody: () => createFromDossierBody,
5239
5244
  findTaskParams: () => findTaskParams,
5240
5245
  updateBody: () => updateBody55
5241
5246
  });
@@ -5243,6 +5248,12 @@ var createBodyKeys63 = {
5243
5248
  task: joi10.string().required()
5244
5249
  };
5245
5250
  var createBody64 = joi10.object().keys(createBodyKeys63).messages(messages);
5251
+ var createFromDossierBodyKeys = {
5252
+ from: joi10.string().uuid().required(),
5253
+ to: joi10.string().uuid().allow(null).required(),
5254
+ task: joi10.string().required()
5255
+ };
5256
+ var createFromDossierBody = joi10.object().keys(createFromDossierBodyKeys).messages(messages);
5246
5257
  var updateBodyKeys55 = {
5247
5258
  from: joi10.string().uuid().optional(),
5248
5259
  to: joi10.string().uuid().allow(null).optional(),
@@ -2,18 +2,24 @@ import * as IShared from '../../../shared/interface';
2
2
  export declare const Route = "transformado";
3
3
  export declare const UpperName = "Transformado";
4
4
  export declare const LowerName: string;
5
- export interface IProductsCreateTransformado {
5
+ export interface IProducts {
6
6
  id: string;
7
7
  quantity: number;
8
8
  }
9
- export interface ICreateTransformado {
9
+ export interface ITransformar {
10
10
  product_id: string;
11
11
  quantity: number;
12
12
  price_sale: number;
13
13
  price_cost: number;
14
- products: IProductsCreateTransformado[];
14
+ out_products: IProducts[];
15
+ }
16
+ export interface IDestransformar {
17
+ product_id: string;
18
+ quantity: number;
19
+ in_products: IProducts[];
15
20
  }
16
21
  export interface IRepository {
17
- create(data: ICreateTransformado): Promise<string>;
22
+ transformar(data: ITransformar): Promise<string>;
23
+ destransformar(data: IDestransformar): Promise<string>;
18
24
  }
19
25
  export type IController = IShared.IEntityWithUserToken<IRepository>;
@@ -1,2 +1,3 @@
1
1
  import joi from 'joi';
2
- export declare const createTransformadosBody: joi.ObjectSchema<any>;
2
+ export declare const transformarBody: joi.ObjectSchema<any>;
3
+ export declare const destransformarBody: joi.ObjectSchema<any>;
@@ -26,7 +26,6 @@ export interface ICloneResponse {
26
26
  }
27
27
  export type IGetProductGroup = 'cortinado' | 'tapete' | 'estore' | 'estofo' | 'almofada' | 'outros' | 'calhas&varões' | 'papel' | 'varoes' | 'terceiros';
28
28
  export type IGetProductType = 'confecção' | 'calha' | 'tecido 1' | 'tecido 2' | 'varoes' | 'livre' | 'papel';
29
- export type IReferenceType = 'noma' | 'sheets' | undefined;
30
29
  export interface IGetProduct {
31
30
  index: number;
32
31
  group: IGetProductGroup;
@@ -37,7 +36,6 @@ export interface IGetProduct {
37
36
  discount: number;
38
37
  price_sale: number;
39
38
  price_cost: number;
40
- reference_type?: IReferenceType;
41
39
  }
42
40
  export interface IGetDataResponse {
43
41
  products: IGetProduct[];
@@ -45,7 +45,6 @@ export interface IUpdateRequest {
45
45
  email_delivered?: boolean;
46
46
  email_opened?: boolean;
47
47
  email_clicked?: boolean;
48
- whatsapp_sent?: boolean;
49
48
  read?: boolean;
50
49
  username?: string;
51
50
  }
@@ -14,6 +14,11 @@ export declare const taskStatusDataType: string[];
14
14
  export type ICreateRequest = {
15
15
  task: string;
16
16
  };
17
+ export type ICreateFromDossierRequest = {
18
+ from: string;
19
+ to: string | null;
20
+ task: string;
21
+ };
17
22
  export type IUpdateRequest = {
18
23
  from?: string;
19
24
  to?: string | null;
@@ -75,6 +80,7 @@ export interface IRepository {
75
80
  find(selector: IFindTasksRequest): Promise<IFindResponse[]>;
76
81
  findWithMessages(id: IShared.IFindByIdRequest): Promise<IFindWithMessagesResponse>;
77
82
  create(data: ICreateRequest): Promise<Entity>;
83
+ createFromDossier(data: ICreateFromDossierRequest): Promise<Entity>;
78
84
  update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
79
85
  delete(selector: IShared.IFindByIdRequest): Promise<void>;
80
86
  findByOwnerId: (selector: IShared.IFindByOwnerIdRequest) => Promise<IFindByOwnerResponse[]>;
@@ -1,4 +1,5 @@
1
1
  import joi from 'joi';
2
2
  export declare const createBody: joi.ObjectSchema<any>;
3
+ export declare const createFromDossierBody: joi.ObjectSchema<any>;
3
4
  export declare const updateBody: joi.ObjectSchema<any>;
4
5
  export declare const findTaskParams: joi.ObjectSchema<any>;
@@ -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 = DocumentHeader;
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;
@@ -334,7 +327,7 @@ export interface IMultipleRegularizations {
334
327
  payments?: IMultipleRegularizationPayments[];
335
328
  }
336
329
  export interface IRepository {
337
- findOne(selector: IShared.IFindByIdRequest): Promise<IFindOneResponse | null>;
330
+ findOne(selector: IShared.IFindByIdRequest): Promise<IFindOneBase | null>;
338
331
  findStart(selector: IShared.IFindByIdRequest): Promise<IFindOneBase | null>;
339
332
  findStartVirtual(selector: IShared.IFindByIdRequest): Promise<IStartDocumentHeaderVirtuals | null>;
340
333
  findByType(params: IFindByTypeRequest): Promise<IFindByTypeResponse[]>;
@@ -355,7 +348,6 @@ export interface IRepository {
355
348
  documentPdf(selector: IShared.IFindByIdRequest, data: IDocumentPdfRequest): Promise<string>;
356
349
  documentThermalPrint(selector: IShared.IFindByIdRequest): Promise<string>;
357
350
  documentList(selector: IShared.IFindByIdRequest, params: IDocumentListRequest): Promise<IDocumentListResponse[]>;
358
- getAllRelatedDocumentHeaderIds(params: IShared.IFindByIdRequest): Promise<string[]>;
359
351
  findStartDocumentHeaderSiblings(params: IShared.IFindByIdRequest): Promise<IFindStartDocumentHeaderSiblingsResponse>;
360
352
  findRmOpenDocuments(): Promise<IFindRmOpenDocuments[]>;
361
353
  regularizarMultiplosDocumentos(data: IMultipleRegularizations): Promise<void>;
@@ -8,13 +8,11 @@ export interface ICreateRequest {
8
8
  document_set_id: number | null;
9
9
  name: string;
10
10
  active_by_default: boolean;
11
- validation_code: string;
12
11
  }
13
12
  export interface IUpdateRequest {
14
13
  document_set_id?: number | null;
15
14
  name?: string;
16
15
  active_by_default?: boolean;
17
- validation_code?: string;
18
16
  }
19
17
  export interface IRepository {
20
18
  findById(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
@@ -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
  /**
@@ -25,7 +24,6 @@ export type Chat = {
25
24
  email_delivered: boolean;
26
25
  email_opened: boolean;
27
26
  email_clicked: boolean;
28
- whatsapp_sent: boolean;
29
27
  read: boolean;
30
28
  is_customer: boolean;
31
29
  deleted: boolean;
@@ -252,6 +250,7 @@ export type DocumentType = {
252
250
  */
253
251
  export type DocumentHeader = {
254
252
  id: string;
253
+ start_document_header_id: string;
255
254
  from_document_header_id: string | null;
256
255
  document_type_id: number;
257
256
  document_number: number;
@@ -415,9 +414,7 @@ export type Workflow = {
415
414
  export type DocumentSet = {
416
415
  id: string;
417
416
  name: string;
418
- document_set_id: number | null;
419
417
  active_by_default: boolean;
420
- validation_code: string | null;
421
418
  created_at: Date;
422
419
  updated_at: Date;
423
420
  created_by: string;
@@ -565,272 +562,6 @@ export type DocumentLinePendingConflict = {
565
562
  created_by: string;
566
563
  updated_by: string;
567
564
  };
568
- /**
569
- * Model ProductPromotionVirtuals
570
- *
571
- */
572
- export type ProductPromotionVirtuals = {
573
- product_id: string;
574
- promotion_assoc_id: string;
575
- name: string;
576
- initial_date: Date;
577
- final_date: Date;
578
- active_for_purchases_above: number;
579
- free_shipping_for_purchases_above: number | null;
580
- discount: number;
581
- promotion_price: number;
582
- exclusive_to_client_id: string | null;
583
- exclusive_to_location_id: string | null;
584
- };
585
- /**
586
- * Model ProductBaseVirtuals
587
- *
588
- */
589
- export type ProductBaseVirtuals = {
590
- product_id: string;
591
- price_cost: number;
592
- price_sale: number;
593
- last_avg_unit_cost: number;
594
- margin: number | null;
595
- };
596
- /**
597
- * Model ProductVirtuals
598
- *
599
- */
600
- export type ProductVirtuals = {
601
- product_id: string;
602
- price_cost: number;
603
- price_sale: number;
604
- margin: number | null;
605
- last_avg_unit_cost: number;
606
- reserved: number;
607
- prison: number;
608
- total: number;
609
- available: number;
610
- ordered_quantity: number;
611
- inativa: boolean;
612
- };
613
- /**
614
- * Model DocumentLineBaseVirtuals
615
- *
616
- */
617
- export type DocumentLineBaseVirtuals = {
618
- document_line_id: string;
619
- client_unit_total_without_tax: number;
620
- client_unit_total_without_discount: number;
621
- client_unit_total: number;
622
- client_unit_total_discount: number;
623
- client_unit_total_tax: number;
624
- client_total_without_tax: number;
625
- client_total_without_discount: number;
626
- client_total: number;
627
- client_total_discount: number;
628
- client_total_tax: number;
629
- provider_unit_total_without_tax: number;
630
- provider_unit_total_without_discount: number;
631
- provider_unit_total: number;
632
- provider_unit_total_discount: number;
633
- provider_unit_total_tax: number;
634
- provider_total_without_tax: number;
635
- provider_total_without_discount: number;
636
- provider_total: number;
637
- provider_total_discount: number;
638
- provider_total_tax: number;
639
- commission_percentage: number;
640
- commission_total: number;
641
- cancelled: boolean;
642
- phc_closed: boolean;
643
- provider_invoice: boolean;
644
- purchased_from_provider: boolean;
645
- pending_return_to_provider: boolean;
646
- available_for_client_order: boolean;
647
- already_client_order: boolean;
648
- already_material_entrance: boolean;
649
- to_order: boolean;
650
- inventory_loss: boolean;
651
- return_to_provider_without_credit_note: boolean;
652
- returned_to_provider: boolean;
653
- awaiting_production: boolean;
654
- ordered: boolean;
655
- group_header: boolean;
656
- waiting_for_bulk_order: boolean;
657
- waiting_for_order: boolean;
658
- closed: boolean;
659
- provider_closed: boolean;
660
- stock_in: boolean;
661
- stock_out: boolean;
662
- client_start_id: string | null;
663
- provider_start_id: string | null;
664
- invoice_id: string | null;
665
- credit_note_id: string | null;
666
- levantar_df: boolean;
667
- df_enviada: boolean;
668
- df_fechada: boolean;
669
- conferir_encomenda: string | null;
670
- documento_pago: IDataDocumentoPago | null;
671
- pagamento: IDataPagamento | null;
672
- };
673
- /**
674
- * Model DocumentLineVirtuals
675
- *
676
- */
677
- export type DocumentLineVirtuals = {
678
- document_line_id: string;
679
- client_unit_total_without_tax: number;
680
- client_unit_total_without_discount: number;
681
- client_unit_total: number;
682
- client_unit_total_discount: number;
683
- client_unit_total_tax: number;
684
- client_total_without_tax: number;
685
- client_total_without_discount: number;
686
- client_total: number;
687
- client_total_discount: number;
688
- client_total_tax: number;
689
- provider_unit_total_without_tax: number;
690
- provider_unit_total_without_discount: number;
691
- provider_unit_total: number;
692
- provider_unit_total_discount: number;
693
- provider_unit_total_tax: number;
694
- provider_total_without_tax: number;
695
- provider_total_without_discount: number;
696
- provider_total: number;
697
- provider_total_discount: number;
698
- provider_total_tax: number;
699
- commission_percentage: number;
700
- commission_total: number;
701
- cancelled: boolean;
702
- phc_closed: boolean;
703
- closed: boolean;
704
- provider_closed: boolean;
705
- group_header: boolean;
706
- waiting_for_bulk_order: boolean;
707
- waiting_for_order: boolean;
708
- stock_in: boolean;
709
- stock_out: boolean;
710
- conferir_encomenda: string | null;
711
- purchased_from_provider: boolean;
712
- pending_return_to_provider: boolean;
713
- available_for_client_order: boolean;
714
- already_client_order: boolean;
715
- to_order: boolean;
716
- already_material_entrance: boolean;
717
- rejected_return_to_provider: boolean;
718
- inventory_loss: boolean;
719
- return_to_provider_without_credit_note: boolean;
720
- returned_to_provider: boolean;
721
- awaiting_production: boolean;
722
- ordered: boolean;
723
- provider_invoice: boolean;
724
- invoice_id: string | null;
725
- credit_note_id: string | null;
726
- client_start_id: string | null;
727
- provider_start_id: string | null;
728
- state: string;
729
- provider_state: string;
730
- phc_state: string | null;
731
- awaits_client_notification: boolean;
732
- upfront_total: number;
733
- levantar_df: boolean;
734
- df_enviada: boolean;
735
- };
736
- /**
737
- * Model StartDocumentHeaderLastUpdateVirtuals
738
- *
739
- */
740
- export type StartDocumentHeaderLastUpdateVirtuals = {
741
- p_id: string;
742
- updated_at: Date;
743
- updated_by: string;
744
- };
745
- /**
746
- * Model StartDocumentHeaderVirtuals
747
- *
748
- */
749
- export type StartDocumentHeaderVirtuals = {
750
- parent_document_header_id: string;
751
- name: string;
752
- paid: number;
753
- total_without_tax: number;
754
- total: number;
755
- total_discount: number;
756
- total_tax: number;
757
- upfront_document_header_id: string | null;
758
- upfront_name: string | null;
759
- upfront_external_name: string | null;
760
- upfront_total: number;
761
- adjudicated: boolean;
762
- closed: boolean;
763
- state: string;
764
- };
765
- /**
766
- * Model DocumentHeaderClientPaymentVirtuals
767
- *
768
- */
769
- export type DocumentHeaderClientPaymentVirtuals = {
770
- id: string;
771
- client_paid: number;
772
- client_unpaid: number;
773
- };
774
- /**
775
- * Model DocumentHeaderBaseVirtuals
776
- *
777
- */
778
- export type DocumentHeaderBaseVirtuals = {
779
- id: string;
780
- p_id: string;
781
- name: string;
782
- external_name: string | null;
783
- document_number: string;
784
- };
785
- /**
786
- * Model DocumentHeaderVirtuals
787
- *
788
- */
789
- export type DocumentHeaderVirtuals = {
790
- id: string;
791
- p_id: string;
792
- name: string;
793
- external_name: string | null;
794
- document_number: string;
795
- client_total_without_tax: number;
796
- client_total: number;
797
- client_total_discount: number;
798
- client_total_tax: number;
799
- provider_total_discount: number;
800
- provider_total_tax: number;
801
- provider_total_without_tax: number;
802
- provider_total: number;
803
- };
804
- /**
805
- * Model DocumentHeaderClientVirtuals
806
- *
807
- */
808
- export type DocumentHeaderClientVirtuals = {
809
- id: string;
810
- p_id: string;
811
- name: string;
812
- external_name: string | null;
813
- document_number: string;
814
- client_total_without_tax: number;
815
- client_total: number;
816
- client_total_discount: number;
817
- client_total_tax: number;
818
- };
819
- /**
820
- * Model DocumentHeaderProviderVirtuals
821
- *
822
- */
823
- export type DocumentHeaderProviderVirtuals = {
824
- id: string;
825
- p_id: string;
826
- name: string;
827
- external_name: string | null;
828
- document_number: string;
829
- provider_total_discount: number;
830
- provider_total_tax: number;
831
- provider_total_without_tax: number;
832
- provider_total: number;
833
- };
834
565
  /**
835
566
  * Model StockMovement
836
567
  *
@@ -846,48 +577,6 @@ export type StockMovement = {
846
577
  quantity: number;
847
578
  stock_to_date: number;
848
579
  };
849
- /**
850
- * Model SettledMaterialEntrance
851
- *
852
- */
853
- export type SettledMaterialEntrance = {
854
- id: string;
855
- document_description: string;
856
- document_name: string;
857
- total: number;
858
- saldo: number;
859
- data_vencimento: Date;
860
- emission_date: Date;
861
- pdf_link: string | null;
862
- type: IPaymentOrigin;
863
- owner_id: string;
864
- };
865
- /**
866
- * Model ProviderProductView
867
- *
868
- */
869
- export type ProviderProductView = {
870
- product_id: string;
871
- type: IProductType;
872
- id_provider: number;
873
- obs: boolean;
874
- multimedia_id: string | null;
875
- ref: string;
876
- des: string;
877
- provider_ref: string | null;
878
- price_cost: number;
879
- price_sale: number;
880
- available: number;
881
- last_ef_date: Date | null;
882
- ordered_quantity: number;
883
- last_em_date: Date | null;
884
- notation: string;
885
- pfs: IFindProposals[];
886
- pcs: IFindProposals[];
887
- client_quantity: number;
888
- pre_ordered_quantity: number;
889
- last6m_consumption: number;
890
- };
891
580
  export type DocumentLineGroup = {
892
581
  id: string;
893
582
  created_at: Date;
@@ -1084,3 +773,218 @@ export type Tag = {
1084
773
  created_at: Date;
1085
774
  updated_at: Date;
1086
775
  };
776
+ /**
777
+ * Model ProductPromotionVirtuals
778
+ *
779
+ */
780
+ export type ProductPromotionVirtuals = {
781
+ product_id: string;
782
+ promotion_assoc_id: string;
783
+ name: string;
784
+ initial_date: Date;
785
+ final_date: Date;
786
+ active_for_purchases_above: number;
787
+ free_shipping_for_purchases_above: number | null;
788
+ discount: number;
789
+ promotion_price: number;
790
+ exclusive_to_client_id: string | null;
791
+ exclusive_to_location_id: string | null;
792
+ };
793
+ /**
794
+ * Model ProductBaseVirtuals
795
+ *
796
+ */
797
+ export type ProductBaseVirtuals = {
798
+ product_id: string;
799
+ price_cost: number;
800
+ price_sale: number;
801
+ last_avg_unit_cost: number;
802
+ margin: number | null;
803
+ };
804
+ /**
805
+ * Model ProductVirtuals
806
+ *
807
+ */
808
+ export type ProductVirtuals = {
809
+ product_id: string;
810
+ price_cost: number;
811
+ price_sale: number;
812
+ margin: number | null;
813
+ last_avg_unit_cost: number;
814
+ reserved: number;
815
+ prison: number;
816
+ total: number;
817
+ available: number;
818
+ ordered_quantity: number;
819
+ inativa: boolean;
820
+ };
821
+ /**
822
+ * Model DocumentLineBaseVirtuals
823
+ *
824
+ */
825
+ export type DocumentLineBaseVirtuals = {
826
+ document_line_id: string;
827
+ client_unit_total_without_tax: number;
828
+ client_unit_total_without_discount: number;
829
+ client_unit_total: number;
830
+ client_unit_total_discount: number;
831
+ client_unit_total_tax: number;
832
+ client_total_without_tax: number;
833
+ client_total_without_discount: number;
834
+ client_total: number;
835
+ client_total_discount: number;
836
+ client_total_tax: number;
837
+ provider_unit_total_without_tax: number;
838
+ provider_unit_total_without_discount: number;
839
+ provider_unit_total: number;
840
+ provider_unit_total_discount: number;
841
+ provider_unit_total_tax: number;
842
+ provider_total_without_tax: number;
843
+ provider_total_without_discount: number;
844
+ provider_total: number;
845
+ provider_total_discount: number;
846
+ provider_total_tax: number;
847
+ commission_percentage: number;
848
+ commission_total: number;
849
+ cancelled: boolean;
850
+ phc_closed: boolean;
851
+ provider_invoice: boolean;
852
+ purchased_from_provider: boolean;
853
+ pending_return_to_provider: boolean;
854
+ available_for_client_order: boolean;
855
+ already_client_order: boolean;
856
+ already_material_entrance: boolean;
857
+ to_order: boolean;
858
+ inventory_loss: boolean;
859
+ return_to_provider_without_credit_note: boolean;
860
+ returned_to_provider: boolean;
861
+ awaiting_production: boolean;
862
+ ordered: boolean;
863
+ group_header: boolean;
864
+ waiting_for_bulk_order: boolean;
865
+ waiting_for_order: boolean;
866
+ closed: boolean;
867
+ provider_closed: boolean;
868
+ stock_in: boolean;
869
+ stock_out: boolean;
870
+ client_start_id: string | null;
871
+ provider_start_id: string | null;
872
+ invoice_id: string | null;
873
+ invoice_document_header_external_id: string | null;
874
+ invoice_external_id: string | null;
875
+ credit_note_id: string | null;
876
+ levantar_df: boolean;
877
+ df_enviada: boolean;
878
+ df_fechada: boolean;
879
+ conferir_encomenda: string | null;
880
+ documento_pago: IDataDocumentoPago | null;
881
+ pagamento: IDataPagamento | null;
882
+ };
883
+ /**
884
+ * Model DocumentLineVirtuals
885
+ *
886
+ */
887
+ export type DocumentLineVirtuals = {
888
+ document_line_id: string;
889
+ client_unit_total_without_tax: number;
890
+ client_unit_total_without_discount: number;
891
+ client_unit_total: number;
892
+ client_unit_total_discount: number;
893
+ client_unit_total_tax: number;
894
+ client_total_without_tax: number;
895
+ client_total_without_discount: number;
896
+ client_total: number;
897
+ client_total_discount: number;
898
+ client_total_tax: number;
899
+ provider_unit_total_without_tax: number;
900
+ provider_unit_total_without_discount: number;
901
+ provider_unit_total: number;
902
+ provider_unit_total_discount: number;
903
+ provider_unit_total_tax: number;
904
+ provider_total_without_tax: number;
905
+ provider_total_without_discount: number;
906
+ provider_total: number;
907
+ provider_total_discount: number;
908
+ provider_total_tax: number;
909
+ commission_percentage: number;
910
+ commission_total: number;
911
+ cancelled: boolean;
912
+ phc_closed: boolean;
913
+ closed: boolean;
914
+ provider_closed: boolean;
915
+ group_header: boolean;
916
+ waiting_for_bulk_order: boolean;
917
+ waiting_for_order: boolean;
918
+ stock_in: boolean;
919
+ stock_out: boolean;
920
+ conferir_encomenda: string | null;
921
+ purchased_from_provider: boolean;
922
+ pending_return_to_provider: boolean;
923
+ available_for_client_order: boolean;
924
+ already_client_order: boolean;
925
+ to_order: boolean;
926
+ already_material_entrance: boolean;
927
+ rejected_return_to_provider: boolean;
928
+ inventory_loss: boolean;
929
+ return_to_provider_without_credit_note: boolean;
930
+ returned_to_provider: boolean;
931
+ awaiting_production: boolean;
932
+ ordered: boolean;
933
+ provider_invoice: boolean;
934
+ invoice_external_id: string | null;
935
+ invoice_document_header_external_id: string | null;
936
+ invoice_id: string | null;
937
+ credit_note_id: string | null;
938
+ client_start_id: string | null;
939
+ provider_start_id: string | null;
940
+ state: string;
941
+ provider_state: string;
942
+ phc_state: string | null;
943
+ awaits_client_notification: boolean;
944
+ upfront_total: number;
945
+ levantar_df: boolean;
946
+ df_enviada: boolean;
947
+ };
948
+ /**
949
+ * Model StartDocumentHeaderLastUpdateVirtuals
950
+ *
951
+ */
952
+ export type StartDocumentHeaderLastUpdateVirtuals = {
953
+ p_id: string;
954
+ updated_at: Date;
955
+ updated_by: string;
956
+ };
957
+ /**
958
+ * Model StartDocumentHeaderVirtuals
959
+ *
960
+ */
961
+ export type StartDocumentHeaderVirtuals = {
962
+ parent_document_header_id: string;
963
+ paid: number;
964
+ total_without_tax: number;
965
+ total: number;
966
+ total_discount: number;
967
+ total_tax: number;
968
+ upfront_document_header_id: string | null;
969
+ upfront_name: string | null;
970
+ upfront_external_name: string | null;
971
+ upfront_total: number;
972
+ adjudicated: boolean;
973
+ closed: boolean;
974
+ state: string;
975
+ };
976
+ /**
977
+ * Model DocumentHeaderVirtuals
978
+ *
979
+ */
980
+ export type DocumentHeaderVirtuals = {
981
+ id: string;
982
+ client_total_without_tax: number;
983
+ client_total: number;
984
+ client_total_discount: number;
985
+ client_total_tax: number;
986
+ provider_total_discount: number;
987
+ provider_total_tax: number;
988
+ provider_total_without_tax: number;
989
+ provider_total: number;
990
+ };
@@ -357,7 +357,6 @@ export type UserPositions = {
357
357
  */
358
358
  export type PaymentMethods = {
359
359
  id: string;
360
- payment_method_id: number | null;
361
360
  name: string;
362
361
  hidden: boolean | null;
363
362
  is_numerary: boolean;
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": "1.2.1",
4
+ "version": "1.2.3",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",