@nomalism-com/types 0.36.5 → 0.36.10

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.cjs CHANGED
@@ -190,6 +190,8 @@ __export(main_exports, {
190
190
  StoreOperatorRoutes: () => route_schema_exports48,
191
191
  Swift: () => interface_exports29,
192
192
  SwiftRoutes: () => route_schema_exports49,
193
+ Tag: () => interface_exports59,
194
+ TagRoutes: () => route_schema_exports111,
193
195
  Task: () => interface_exports50,
194
196
  TaskMessage: () => interface_exports51,
195
197
  TaskMessageRoutes: () => route_schema_exports101,
@@ -1654,7 +1656,6 @@ var updateBodyKeys9 = {
1654
1656
  is_archived: joi11.boolean().optional(),
1655
1657
  is_void: joi11.boolean().optional(),
1656
1658
  who_handles: joi11.string().allow(null).optional(),
1657
- tags: joi11.string().allow(null, "").optional(),
1658
1659
  warning: joi11.string().optional().valid(...Object.values(IWarningType)),
1659
1660
  created_by: joi11.string().uuid().allow(null).optional()
1660
1661
  };
@@ -4517,7 +4518,7 @@ __export(route_schema_exports81, {
4517
4518
  updateBody: () => updateBody51
4518
4519
  });
4519
4520
  import joi82 from "joi";
4520
- var emailSchema = joi82.string().trim(true).lowercase().email({ tlds: { allow: false } });
4521
+ var emailSchema = joi82.string().trim(true).lowercase().email({ tlds: { allow: false } }).allow(null, "");
4521
4522
  var createBodyKeys56 = {
4522
4523
  name: joi82.string().allow(null, "").optional(),
4523
4524
  nif: joi82.string().allow(null, "").optional(),
@@ -5013,7 +5014,7 @@ var entradaDeMaterialClientOrderBody = joi92.object().keys(entradaDeMaterialClie
5013
5014
  var entradaDeMaterialStockBodyKeys = {
5014
5015
  ef_dla_id: joi92.string().uuid().allow(null).required(),
5015
5016
  ordered_quantity: joi92.number().positive().allow(0).required(),
5016
- document_line_id: joi92.string().uuid().allow(null).required(),
5017
+ document_line_id: joi92.string().uuid().required(),
5017
5018
  quantity: joi92.number().positive().allow(0).required(),
5018
5019
  option: joi92.string().valid(...createMaterialEntranceStockOptions, ...createMaterialEntranceStockWithoutOrderOptions).allow(null).required(),
5019
5020
  note: joi92.string().allow(null),
@@ -5031,8 +5032,8 @@ var entradaDeMaterialNCBodyKeys = {
5031
5032
  };
5032
5033
  var entradaDeMaterialNCBody = joi92.object().keys(entradaDeMaterialNCBodyKeys).messages(messages);
5033
5034
  var entradaDeMaterialDocumentHeaderBodyKeys = {
5034
- clientOrders: joi92.array().items(entradaDeMaterialClientOrderBody).required(),
5035
- stock: joi92.array().items(entradaDeMaterialStockBody).required(),
5035
+ clientOrders: joi92.array().items(entradaDeMaterialClientOrderBody),
5036
+ stock: entradaDeMaterialStockBody,
5036
5037
  not_ok: entradaDeMaterialNCBody
5037
5038
  };
5038
5039
  var entradaDeMaterialDocumentHeaderBody = joi92.object().keys(entradaDeMaterialDocumentHeaderBodyKeys).messages(messages);
@@ -5817,6 +5818,45 @@ var createOrUpdateBodyKeys2 = {
5817
5818
  };
5818
5819
  var createOrUpdateBody2 = joi111.object().keys(createOrUpdateBodyKeys2).messages(messages);
5819
5820
 
5821
+ // src/modules/stock/tag/interface.ts
5822
+ var interface_exports59 = {};
5823
+ __export(interface_exports59, {
5824
+ ITagType: () => ITagType,
5825
+ ITagTypeEnum: () => ITagTypeEnum,
5826
+ LowerName: () => LowerName104,
5827
+ Route: () => Route105,
5828
+ UpperName: () => UpperName104
5829
+ });
5830
+ var Route105 = "tag";
5831
+ var UpperName104 = "Tag";
5832
+ var LowerName104 = UpperName104[0].toLowerCase() + UpperName104.substring(1);
5833
+ var ITagTypeEnum = {
5834
+ private: "private",
5835
+ public: "public"
5836
+ };
5837
+ var ITagType = Object.keys(ITagTypeEnum);
5838
+
5839
+ // src/modules/stock/tag/route.schema.ts
5840
+ var route_schema_exports111 = {};
5841
+ __export(route_schema_exports111, {
5842
+ createBody: () => createBody70,
5843
+ updateManyBody: () => updateManyBody3
5844
+ });
5845
+ import joi112 from "joi";
5846
+ var createBodyKeys69 = {
5847
+ document_header_id: joi112.string().uuid().required(),
5848
+ index: joi112.number().allow(0).required(),
5849
+ text: joi112.string().required(),
5850
+ type: joi112.string().valid(...ITagType).required()
5851
+ };
5852
+ var createBody70 = joi112.object().keys(createBodyKeys69).messages(messages);
5853
+ var updateManyBodyKeys2 = {
5854
+ id: joi112.string().uuid().required(),
5855
+ index: joi112.number().allow(0).optional(),
5856
+ type: joi112.string().valid(...ITagType).optional()
5857
+ };
5858
+ var updateManyBody3 = joi112.array().items(joi112.object().keys(updateManyBodyKeys2)).messages(messages);
5859
+
5820
5860
  // src/index.ts
5821
5861
  var index_default = main_exports;
5822
5862
  export {
package/dist/index.js CHANGED
@@ -190,6 +190,8 @@ __export(main_exports, {
190
190
  StoreOperatorRoutes: () => route_schema_exports48,
191
191
  Swift: () => interface_exports29,
192
192
  SwiftRoutes: () => route_schema_exports49,
193
+ Tag: () => interface_exports59,
194
+ TagRoutes: () => route_schema_exports111,
193
195
  Task: () => interface_exports50,
194
196
  TaskMessage: () => interface_exports51,
195
197
  TaskMessageRoutes: () => route_schema_exports101,
@@ -1654,7 +1656,6 @@ var updateBodyKeys9 = {
1654
1656
  is_archived: joi11.boolean().optional(),
1655
1657
  is_void: joi11.boolean().optional(),
1656
1658
  who_handles: joi11.string().allow(null).optional(),
1657
- tags: joi11.string().allow(null, "").optional(),
1658
1659
  warning: joi11.string().optional().valid(...Object.values(IWarningType)),
1659
1660
  created_by: joi11.string().uuid().allow(null).optional()
1660
1661
  };
@@ -4517,7 +4518,7 @@ __export(route_schema_exports81, {
4517
4518
  updateBody: () => updateBody51
4518
4519
  });
4519
4520
  import joi82 from "joi";
4520
- var emailSchema = joi82.string().trim(true).lowercase().email({ tlds: { allow: false } });
4521
+ var emailSchema = joi82.string().trim(true).lowercase().email({ tlds: { allow: false } }).allow(null, "");
4521
4522
  var createBodyKeys56 = {
4522
4523
  name: joi82.string().allow(null, "").optional(),
4523
4524
  nif: joi82.string().allow(null, "").optional(),
@@ -5013,7 +5014,7 @@ var entradaDeMaterialClientOrderBody = joi92.object().keys(entradaDeMaterialClie
5013
5014
  var entradaDeMaterialStockBodyKeys = {
5014
5015
  ef_dla_id: joi92.string().uuid().allow(null).required(),
5015
5016
  ordered_quantity: joi92.number().positive().allow(0).required(),
5016
- document_line_id: joi92.string().uuid().allow(null).required(),
5017
+ document_line_id: joi92.string().uuid().required(),
5017
5018
  quantity: joi92.number().positive().allow(0).required(),
5018
5019
  option: joi92.string().valid(...createMaterialEntranceStockOptions, ...createMaterialEntranceStockWithoutOrderOptions).allow(null).required(),
5019
5020
  note: joi92.string().allow(null),
@@ -5031,8 +5032,8 @@ var entradaDeMaterialNCBodyKeys = {
5031
5032
  };
5032
5033
  var entradaDeMaterialNCBody = joi92.object().keys(entradaDeMaterialNCBodyKeys).messages(messages);
5033
5034
  var entradaDeMaterialDocumentHeaderBodyKeys = {
5034
- clientOrders: joi92.array().items(entradaDeMaterialClientOrderBody).required(),
5035
- stock: joi92.array().items(entradaDeMaterialStockBody).required(),
5035
+ clientOrders: joi92.array().items(entradaDeMaterialClientOrderBody),
5036
+ stock: entradaDeMaterialStockBody,
5036
5037
  not_ok: entradaDeMaterialNCBody
5037
5038
  };
5038
5039
  var entradaDeMaterialDocumentHeaderBody = joi92.object().keys(entradaDeMaterialDocumentHeaderBodyKeys).messages(messages);
@@ -5817,6 +5818,45 @@ var createOrUpdateBodyKeys2 = {
5817
5818
  };
5818
5819
  var createOrUpdateBody2 = joi111.object().keys(createOrUpdateBodyKeys2).messages(messages);
5819
5820
 
5821
+ // src/modules/stock/tag/interface.ts
5822
+ var interface_exports59 = {};
5823
+ __export(interface_exports59, {
5824
+ ITagType: () => ITagType,
5825
+ ITagTypeEnum: () => ITagTypeEnum,
5826
+ LowerName: () => LowerName104,
5827
+ Route: () => Route105,
5828
+ UpperName: () => UpperName104
5829
+ });
5830
+ var Route105 = "tag";
5831
+ var UpperName104 = "Tag";
5832
+ var LowerName104 = UpperName104[0].toLowerCase() + UpperName104.substring(1);
5833
+ var ITagTypeEnum = {
5834
+ private: "private",
5835
+ public: "public"
5836
+ };
5837
+ var ITagType = Object.keys(ITagTypeEnum);
5838
+
5839
+ // src/modules/stock/tag/route.schema.ts
5840
+ var route_schema_exports111 = {};
5841
+ __export(route_schema_exports111, {
5842
+ createBody: () => createBody70,
5843
+ updateManyBody: () => updateManyBody3
5844
+ });
5845
+ import joi112 from "joi";
5846
+ var createBodyKeys69 = {
5847
+ document_header_id: joi112.string().uuid().required(),
5848
+ index: joi112.number().allow(0).required(),
5849
+ text: joi112.string().required(),
5850
+ type: joi112.string().valid(...ITagType).required()
5851
+ };
5852
+ var createBody70 = joi112.object().keys(createBodyKeys69).messages(messages);
5853
+ var updateManyBodyKeys2 = {
5854
+ id: joi112.string().uuid().required(),
5855
+ index: joi112.number().allow(0).optional(),
5856
+ type: joi112.string().valid(...ITagType).optional()
5857
+ };
5858
+ var updateManyBody3 = joi112.array().items(joi112.object().keys(updateManyBodyKeys2)).messages(messages);
5859
+
5820
5860
  // src/index.ts
5821
5861
  var index_default = main_exports;
5822
5862
  export {
package/dist/main.d.ts CHANGED
@@ -229,4 +229,6 @@ import * as DocumentLineMt from './modules/supply/documentLineMT/interface';
229
229
  import * as DocumentLineMtRoutes from './modules/supply/documentLineMT/route.schema';
230
230
  import * as ChatSubscriber from './modules/user/chatSubscribers/interfaces';
231
231
  import * as ChatSubscriberRoutes from './modules/user/chatSubscribers/route.schema';
232
- export { shared, viewErrors, stockErrors, userErrors, documentManagementErrors, integrationErrors, ZipCode, ZipCodeRoutes, BankData, BankDataRoutes, Client, ClientRoutes, ClientType, ClientTypeRoutes, ClientCurrentAccount, ClientCurrentAccountRoutes, Chat, ChatRoutes, Commissioner, CommissionerRoutes, Counter, CounterRoutes, Country, CountryRoutes, DeliveryMethods, DeliveryMethodsRoutes, DocumentHeader, DocumentHeaderRoutes, BillOfLading, BillOfLadingRoutes, ProductionOrder, ProductionOrderRoutes, Proforma, ProformaRoutes, PropostaFornecedor, PropostaFornecedorRoutes, ProviderCreditNoteFromReturn, ProviderCreditNoteFromReturnRoutes, ProviderFinancialCreditNote, ProviderFinancialCreditNoteRoutes, ProviderServiceInvoice, ProviderServiceInvoiceRoutes, DocumentLine, DocumentLineRoutes, DocumentLineAssoc, DocumentLineAssocRoutes, DocumentSet, DocumentSetRoutes, DocumentType, DocumentTypeRoutes, ExternalDocumentType, ExternalDocumentHeader, ExternalDocumentHeaderRoutes, Favorites, FavoritesRoutes, File, FileRoutes, GroupPermissions, GroupPermissionsRoutes, GoogleSheets, GoogleSheetsRoutes, Language, LanguageRoutes, Location, LocationRoutes, MaturityDates, MaturityDatesRoutes, Multimedia, MultimediaRoutes, OrderManagement, Observation, ObservationRoutes, ObservationType, ObservationTypeRoutes, Password, PasswordRoutes, Payment, PaymentRoutes, PaymentMethods, PaymentMethodsRoutes, Permissions, PermissionsRoutes, ProductImage, ProductImageRoutes, Promotion, PromotionRoutes, PromotionAssoc, PromotionAssocRoutes, Providers, ProvidersRoutes, ProviderType, ProviderTypeRoutes, ProviderCurrentAccount, ProviderCurrentAccountRoutes, PurchaseConditions, PurchaseConditionsRoutes, ReasonForExemption, ReasonForExemptionRoutes, RefreshToken, RefreshTokenRoutes, SegmentsArea, SegmentsAreaRoutes, Sessions, SessionsRoutes, Shippings, ShippingsRoutes, StoreOperator, StoreOperatorRoutes, Swift, SwiftRoutes, TypeOfLocation, TypeOfLocationRoutes, UnitOfMeasure, UnitOfMeasureRoutes, UserPermissions, UserPermissionsRoutes, UserPositions, UserPositionsRoutes, Users, UsersRoutes, UserTokens, UserTokensRoutes, VatValidation, VatValidationRoutes, VatTax, VatTaxRoutes, VatTaxZone, VatTaxZoneRoutes, Vehicles, VehiclesRoutes, Workflow, WorkflowRoutes, StockMovement, StockMovementRoutes, Tenant, TenantRoutes, PreSale, PreSaleRoutes, PreSaleProduct, PreSaleProductRoutes, Npc, NpcRoutes, Printer, PrinterRoutes, SchedulePrintJob, SchedulePrintJobRoutes, QueryList, QueryListRoutes, QueryParameter, QueryParameterRoutes, ReturnReason, ReturnReasonRoutes, PropostaSheets, PropostaSheetsRoutes, Schedule, ScheduleRoutes, GoogleFilePermission, GoogleFilePermissionRoutes, Settings, SettingsRoutes, Tickets, TicketsRoutes, Channel, ChannelRoutes, TicketsLanguage, TicketsLanguageRoutes, CLT, CLTRoutes, StartDocumentHeaderLastUpdate, Persona, PersonaRoutes, ProjectInfo, ProjectInfoRoutes, EmailVerification, EmailVerificationRoutes, EmailLog, EmailLogRoutes, Purchase, PurchaseRoutes, Order, OrderRoutes, MaterialEntrance, MaterialEntranceRoutes, Transformado, TransformadoRoutes, Quebra, QuebraRoutes, UpfrontReturn, UpfrontReturnRoutes, SavedEmPicking, SavedEmPickingRoutes, EmailTemplate, EmailTemplateRoutes, EmailTemplateAttachment, EmailTemplateAttachmentRoutes, Inventario, InventarioRoutes, ReturnToProvider, ReturnToProviderRoutes, Prison, PrisonRoutes, DocumentLineNote, DocumentLineNoteRoutes, SavedProviderProposal, SavedProviderProposalRoutes, ProductGoogleSheets, ProductGoogleSheetsRoutes, Task, TaskRoutes, TaskMessage, TaskMessageRoutes, RecurrentTasks, TaskRead, TaskReadRoutes, Theme, ThemeRoutes, Dashboard, DashboardRoutes, ChatRapidMessage, ChatRapidMessageRoutes, SideMenu, SideMenuRoutes, AdminPanel, ErrorLog, ErrorLogRoutes, DocumentLineRm, DocumentLineRmRoutes, DocumentLineMt, DocumentLineMtRoutes, ChatSubscriber, ChatSubscriberRoutes, };
232
+ import * as Tag from './modules/stock/tag/interface';
233
+ import * as TagRoutes from './modules/stock/tag/route.schema';
234
+ export { shared, viewErrors, stockErrors, userErrors, documentManagementErrors, integrationErrors, ZipCode, ZipCodeRoutes, BankData, BankDataRoutes, Client, ClientRoutes, ClientType, ClientTypeRoutes, ClientCurrentAccount, ClientCurrentAccountRoutes, Chat, ChatRoutes, Commissioner, CommissionerRoutes, Counter, CounterRoutes, Country, CountryRoutes, DeliveryMethods, DeliveryMethodsRoutes, DocumentHeader, DocumentHeaderRoutes, BillOfLading, BillOfLadingRoutes, ProductionOrder, ProductionOrderRoutes, Proforma, ProformaRoutes, PropostaFornecedor, PropostaFornecedorRoutes, ProviderCreditNoteFromReturn, ProviderCreditNoteFromReturnRoutes, ProviderFinancialCreditNote, ProviderFinancialCreditNoteRoutes, ProviderServiceInvoice, ProviderServiceInvoiceRoutes, DocumentLine, DocumentLineRoutes, DocumentLineAssoc, DocumentLineAssocRoutes, DocumentSet, DocumentSetRoutes, DocumentType, DocumentTypeRoutes, ExternalDocumentType, ExternalDocumentHeader, ExternalDocumentHeaderRoutes, Favorites, FavoritesRoutes, File, FileRoutes, GroupPermissions, GroupPermissionsRoutes, GoogleSheets, GoogleSheetsRoutes, Language, LanguageRoutes, Location, LocationRoutes, MaturityDates, MaturityDatesRoutes, Multimedia, MultimediaRoutes, OrderManagement, Observation, ObservationRoutes, ObservationType, ObservationTypeRoutes, Password, PasswordRoutes, Payment, PaymentRoutes, PaymentMethods, PaymentMethodsRoutes, Permissions, PermissionsRoutes, ProductImage, ProductImageRoutes, Promotion, PromotionRoutes, PromotionAssoc, PromotionAssocRoutes, Providers, ProvidersRoutes, ProviderType, ProviderTypeRoutes, ProviderCurrentAccount, ProviderCurrentAccountRoutes, PurchaseConditions, PurchaseConditionsRoutes, ReasonForExemption, ReasonForExemptionRoutes, RefreshToken, RefreshTokenRoutes, SegmentsArea, SegmentsAreaRoutes, Sessions, SessionsRoutes, Shippings, ShippingsRoutes, StoreOperator, StoreOperatorRoutes, Swift, SwiftRoutes, TypeOfLocation, TypeOfLocationRoutes, UnitOfMeasure, UnitOfMeasureRoutes, UserPermissions, UserPermissionsRoutes, UserPositions, UserPositionsRoutes, Users, UsersRoutes, UserTokens, UserTokensRoutes, VatValidation, VatValidationRoutes, VatTax, VatTaxRoutes, VatTaxZone, VatTaxZoneRoutes, Vehicles, VehiclesRoutes, Workflow, WorkflowRoutes, StockMovement, StockMovementRoutes, Tenant, TenantRoutes, PreSale, PreSaleRoutes, PreSaleProduct, PreSaleProductRoutes, Npc, NpcRoutes, Printer, PrinterRoutes, SchedulePrintJob, SchedulePrintJobRoutes, QueryList, QueryListRoutes, QueryParameter, QueryParameterRoutes, ReturnReason, ReturnReasonRoutes, PropostaSheets, PropostaSheetsRoutes, Schedule, ScheduleRoutes, GoogleFilePermission, GoogleFilePermissionRoutes, Settings, SettingsRoutes, Tickets, TicketsRoutes, Channel, ChannelRoutes, TicketsLanguage, TicketsLanguageRoutes, CLT, CLTRoutes, StartDocumentHeaderLastUpdate, Persona, PersonaRoutes, ProjectInfo, ProjectInfoRoutes, EmailVerification, EmailVerificationRoutes, EmailLog, EmailLogRoutes, Purchase, PurchaseRoutes, Order, OrderRoutes, MaterialEntrance, MaterialEntranceRoutes, Transformado, TransformadoRoutes, Quebra, QuebraRoutes, UpfrontReturn, UpfrontReturnRoutes, SavedEmPicking, SavedEmPickingRoutes, EmailTemplate, EmailTemplateRoutes, EmailTemplateAttachment, EmailTemplateAttachmentRoutes, Inventario, InventarioRoutes, ReturnToProvider, ReturnToProviderRoutes, Prison, PrisonRoutes, DocumentLineNote, DocumentLineNoteRoutes, SavedProviderProposal, SavedProviderProposalRoutes, ProductGoogleSheets, ProductGoogleSheetsRoutes, Task, TaskRoutes, TaskMessage, TaskMessageRoutes, RecurrentTasks, TaskRead, TaskReadRoutes, Theme, ThemeRoutes, Dashboard, DashboardRoutes, ChatRapidMessage, ChatRapidMessageRoutes, SideMenu, SideMenuRoutes, AdminPanel, ErrorLog, ErrorLogRoutes, DocumentLineRm, DocumentLineRmRoutes, DocumentLineMt, DocumentLineMtRoutes, ChatSubscriber, ChatSubscriberRoutes, Tag, TagRoutes, };
@@ -49,7 +49,7 @@ export interface IGetMaterialEntranceInfoStock {
49
49
  ordered_quantity: number;
50
50
  }
51
51
  export interface IEntradaDeMaterialStock extends IGetMaterialEntranceInfoStock {
52
- document_line_id: string | null;
52
+ document_line_id: string;
53
53
  quantity: number;
54
54
  option: ICreateMaterialEntranceStockOption | ICreateMaterialEntranceStockWithoutOrderOption | null;
55
55
  note: string | null;
@@ -66,7 +66,7 @@ export interface IEntradaDeMaterialNC {
66
66
  }
67
67
  export interface IGetMaterialEntranceInfoResponse {
68
68
  clientOrders: IEntradaDeMaterialClientOrder[];
69
- stock: IEntradaDeMaterialStock[];
69
+ stock: IEntradaDeMaterialStock;
70
70
  not_ok: IEntradaDeMaterialNC;
71
71
  saved_id: string | null;
72
72
  }
@@ -10,7 +10,7 @@ export interface IFindByDocumentLineStateResponse {
10
10
  created_at: Date;
11
11
  created_by: string;
12
12
  who_handles: string | null;
13
- tags: string | null;
13
+ tags: string;
14
14
  upfront_total: number;
15
15
  unread: boolean;
16
16
  }
@@ -0,0 +1,22 @@
1
+ import * as IShared from '../../../shared/interface';
2
+ import { Tag } from '../../../shared/entities/stock';
3
+ export type Entity = Tag;
4
+ export declare const Route = "tag";
5
+ export declare const UpperName = "Tag";
6
+ export declare const LowerName: string;
7
+ export declare const ITagTypeEnum: {
8
+ private: 'private';
9
+ public: 'public';
10
+ };
11
+ export type ITagType = (typeof ITagTypeEnum)[keyof typeof ITagTypeEnum];
12
+ export declare const ITagType: string[];
13
+ export type ICreateRequest = Omit<Entity, 'id' | 'created_at' | 'updated_at' | 'created_by' | 'updated_by'>;
14
+ export type IUpdateManyRequest = Pick<Entity, 'id' | 'index' | 'type'>;
15
+ export type IFindResponse = Omit<Entity, 'created_at' | 'updated_at'>;
16
+ export interface IRepository {
17
+ create(data: ICreateRequest): Promise<void>;
18
+ findByDocumentHeaderId(selector: IShared.IFindByIdRequest): Promise<IFindResponse[]>;
19
+ updateMany(data: IUpdateManyRequest[]): Promise<void>;
20
+ delete(selector: IShared.IFindByIdRequest): Promise<void>;
21
+ }
22
+ export type IController = IShared.IEntityWithUserToken<IRepository>;
@@ -0,0 +1,3 @@
1
+ import joi from 'joi';
2
+ export declare const createBody: joi.ObjectSchema<any>;
3
+ export declare const updateManyBody: joi.ArraySchema<any[]>;
@@ -170,7 +170,6 @@ export interface IUpdateRequest {
170
170
  is_archived?: boolean;
171
171
  is_void?: boolean;
172
172
  who_handles?: string | null;
173
- tags?: string | null;
174
173
  warning?: IWarningType;
175
174
  created_by?: string;
176
175
  }
@@ -203,7 +202,6 @@ export interface IFindResponse {
203
202
  total: number;
204
203
  emission_date: string;
205
204
  line_count: number;
206
- tags: string;
207
205
  is_void: boolean;
208
206
  is_archived: boolean;
209
207
  adjudicado: boolean;
@@ -287,7 +285,6 @@ export interface IFindRmOpenDocuments {
287
285
  document_header_id: string;
288
286
  document_number: string;
289
287
  identifier: string;
290
- tags: string | null;
291
288
  upfront_total: number | null;
292
289
  who_handles: string | null;
293
290
  document_lines: {
@@ -3,6 +3,7 @@ import { IDocumentTypeUserType, IDocumentTypeCodeType } from '../../modules/supp
3
3
  import { IBatchType, IPaymentOrigin } from '../../modules/supply/payment/interface';
4
4
  import { IProductType } from '../../modules/stock/productGoogleSheets/interface';
5
5
  import { IImageType } from '../../modules/stock/productImage/interface';
6
+ import { ITagType } from '../../modules/stock/tag/interface';
6
7
  import { IQueryParameterDatatype } from '../../modules/stock/queryParameter/interfaces';
7
8
  import { IData, IDataDocumentoPago, IDataPagamento, IPromotions, type IImportedFromSheets } from '../../modules/supply/documentLine/interfaces';
8
9
  import { IPhcDocumentType } from '../../modules/supply/clientCurrentAccount/interfaces';
@@ -318,7 +319,6 @@ export type DocumentHeader = {
318
319
  is_void: boolean;
319
320
  origin_id: string | null;
320
321
  who_handles: string | null;
321
- tags: string | null;
322
322
  warning: string | null;
323
323
  created_at: Date;
324
324
  updated_at: Date;
@@ -1206,3 +1206,18 @@ export type DocumentLineMT = {
1206
1206
  created_at: Date;
1207
1207
  updated_at: Date;
1208
1208
  };
1209
+ /**
1210
+ * Model Tag
1211
+ *
1212
+ */
1213
+ export type Tag = {
1214
+ id: string;
1215
+ text: string;
1216
+ index: number;
1217
+ type: ITagType;
1218
+ document_header_id: string;
1219
+ created_by: string;
1220
+ updated_by: string;
1221
+ created_at: Date;
1222
+ updated_at: Date;
1223
+ };
package/package-lock.json CHANGED
@@ -1472,17 +1472,17 @@
1472
1472
  }
1473
1473
  },
1474
1474
  "node_modules/@typescript-eslint/eslint-plugin": {
1475
- "version": "8.34.0",
1476
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.34.0.tgz",
1477
- "integrity": "sha512-QXwAlHlbcAwNlEEMKQS2RCgJsgXrTJdjXT08xEgbPFa2yYQgVjBymxP5DrfrE7X7iodSzd9qBUHUycdyVJTW1w==",
1475
+ "version": "8.34.1",
1476
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.34.1.tgz",
1477
+ "integrity": "sha512-STXcN6ebF6li4PxwNeFnqF8/2BNDvBupf2OPx2yWNzr6mKNGF7q49VM00Pz5FaomJyqvbXpY6PhO+T9w139YEQ==",
1478
1478
  "dev": true,
1479
1479
  "license": "MIT",
1480
1480
  "dependencies": {
1481
1481
  "@eslint-community/regexpp": "^4.10.0",
1482
- "@typescript-eslint/scope-manager": "8.34.0",
1483
- "@typescript-eslint/type-utils": "8.34.0",
1484
- "@typescript-eslint/utils": "8.34.0",
1485
- "@typescript-eslint/visitor-keys": "8.34.0",
1482
+ "@typescript-eslint/scope-manager": "8.34.1",
1483
+ "@typescript-eslint/type-utils": "8.34.1",
1484
+ "@typescript-eslint/utils": "8.34.1",
1485
+ "@typescript-eslint/visitor-keys": "8.34.1",
1486
1486
  "graphemer": "^1.4.0",
1487
1487
  "ignore": "^7.0.0",
1488
1488
  "natural-compare": "^1.4.0",
@@ -1496,22 +1496,22 @@
1496
1496
  "url": "https://opencollective.com/typescript-eslint"
1497
1497
  },
1498
1498
  "peerDependencies": {
1499
- "@typescript-eslint/parser": "^8.34.0",
1499
+ "@typescript-eslint/parser": "^8.34.1",
1500
1500
  "eslint": "^8.57.0 || ^9.0.0",
1501
1501
  "typescript": ">=4.8.4 <5.9.0"
1502
1502
  }
1503
1503
  },
1504
1504
  "node_modules/@typescript-eslint/parser": {
1505
- "version": "8.34.0",
1506
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.34.0.tgz",
1507
- "integrity": "sha512-vxXJV1hVFx3IXz/oy2sICsJukaBrtDEQSBiV48/YIV5KWjX1dO+bcIr/kCPrW6weKXvsaGKFNlwH0v2eYdRRbA==",
1505
+ "version": "8.34.1",
1506
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.34.1.tgz",
1507
+ "integrity": "sha512-4O3idHxhyzjClSMJ0a29AcoK0+YwnEqzI6oz3vlRf3xw0zbzt15MzXwItOlnr5nIth6zlY2RENLsOPvhyrKAQA==",
1508
1508
  "dev": true,
1509
1509
  "license": "MIT",
1510
1510
  "dependencies": {
1511
- "@typescript-eslint/scope-manager": "8.34.0",
1512
- "@typescript-eslint/types": "8.34.0",
1513
- "@typescript-eslint/typescript-estree": "8.34.0",
1514
- "@typescript-eslint/visitor-keys": "8.34.0",
1511
+ "@typescript-eslint/scope-manager": "8.34.1",
1512
+ "@typescript-eslint/types": "8.34.1",
1513
+ "@typescript-eslint/typescript-estree": "8.34.1",
1514
+ "@typescript-eslint/visitor-keys": "8.34.1",
1515
1515
  "debug": "^4.3.4"
1516
1516
  },
1517
1517
  "engines": {
@@ -1527,14 +1527,14 @@
1527
1527
  }
1528
1528
  },
1529
1529
  "node_modules/@typescript-eslint/project-service": {
1530
- "version": "8.34.0",
1531
- "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.34.0.tgz",
1532
- "integrity": "sha512-iEgDALRf970/B2YExmtPMPF54NenZUf4xpL3wsCRx/lgjz6ul/l13R81ozP/ZNuXfnLCS+oPmG7JIxfdNYKELw==",
1530
+ "version": "8.34.1",
1531
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.34.1.tgz",
1532
+ "integrity": "sha512-nuHlOmFZfuRwLJKDGQOVc0xnQrAmuq1Mj/ISou5044y1ajGNp2BNliIqp7F2LPQ5sForz8lempMFCovfeS1XoA==",
1533
1533
  "dev": true,
1534
1534
  "license": "MIT",
1535
1535
  "dependencies": {
1536
- "@typescript-eslint/tsconfig-utils": "^8.34.0",
1537
- "@typescript-eslint/types": "^8.34.0",
1536
+ "@typescript-eslint/tsconfig-utils": "^8.34.1",
1537
+ "@typescript-eslint/types": "^8.34.1",
1538
1538
  "debug": "^4.3.4"
1539
1539
  },
1540
1540
  "engines": {
@@ -1549,14 +1549,14 @@
1549
1549
  }
1550
1550
  },
1551
1551
  "node_modules/@typescript-eslint/scope-manager": {
1552
- "version": "8.34.0",
1553
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.34.0.tgz",
1554
- "integrity": "sha512-9Ac0X8WiLykl0aj1oYQNcLZjHgBojT6cW68yAgZ19letYu+Hxd0rE0veI1XznSSst1X5lwnxhPbVdwjDRIomRw==",
1552
+ "version": "8.34.1",
1553
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.34.1.tgz",
1554
+ "integrity": "sha512-beu6o6QY4hJAgL1E8RaXNC071G4Kso2MGmJskCFQhRhg8VOH/FDbC8soP8NHN7e/Hdphwp8G8cE6OBzC8o41ZA==",
1555
1555
  "dev": true,
1556
1556
  "license": "MIT",
1557
1557
  "dependencies": {
1558
- "@typescript-eslint/types": "8.34.0",
1559
- "@typescript-eslint/visitor-keys": "8.34.0"
1558
+ "@typescript-eslint/types": "8.34.1",
1559
+ "@typescript-eslint/visitor-keys": "8.34.1"
1560
1560
  },
1561
1561
  "engines": {
1562
1562
  "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1567,9 +1567,9 @@
1567
1567
  }
1568
1568
  },
1569
1569
  "node_modules/@typescript-eslint/tsconfig-utils": {
1570
- "version": "8.34.0",
1571
- "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.34.0.tgz",
1572
- "integrity": "sha512-+W9VYHKFIzA5cBeooqQxqNriAP0QeQ7xTiDuIOr71hzgffm3EL2hxwWBIIj4GuofIbKxGNarpKqIq6Q6YrShOA==",
1570
+ "version": "8.34.1",
1571
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.34.1.tgz",
1572
+ "integrity": "sha512-K4Sjdo4/xF9NEeA2khOb7Y5nY6NSXBnod87uniVYW9kHP+hNlDV8trUSFeynA2uxWam4gIWgWoygPrv9VMWrYg==",
1573
1573
  "dev": true,
1574
1574
  "license": "MIT",
1575
1575
  "engines": {
@@ -1584,14 +1584,14 @@
1584
1584
  }
1585
1585
  },
1586
1586
  "node_modules/@typescript-eslint/type-utils": {
1587
- "version": "8.34.0",
1588
- "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.34.0.tgz",
1589
- "integrity": "sha512-n7zSmOcUVhcRYC75W2pnPpbO1iwhJY3NLoHEtbJwJSNlVAZuwqu05zY3f3s2SDWWDSo9FdN5szqc73DCtDObAg==",
1587
+ "version": "8.34.1",
1588
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.34.1.tgz",
1589
+ "integrity": "sha512-Tv7tCCr6e5m8hP4+xFugcrwTOucB8lshffJ6zf1mF1TbU67R+ntCc6DzLNKM+s/uzDyv8gLq7tufaAhIBYeV8g==",
1590
1590
  "dev": true,
1591
1591
  "license": "MIT",
1592
1592
  "dependencies": {
1593
- "@typescript-eslint/typescript-estree": "8.34.0",
1594
- "@typescript-eslint/utils": "8.34.0",
1593
+ "@typescript-eslint/typescript-estree": "8.34.1",
1594
+ "@typescript-eslint/utils": "8.34.1",
1595
1595
  "debug": "^4.3.4",
1596
1596
  "ts-api-utils": "^2.1.0"
1597
1597
  },
@@ -1608,9 +1608,9 @@
1608
1608
  }
1609
1609
  },
1610
1610
  "node_modules/@typescript-eslint/types": {
1611
- "version": "8.34.0",
1612
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.34.0.tgz",
1613
- "integrity": "sha512-9V24k/paICYPniajHfJ4cuAWETnt7Ssy+R0Rbcqo5sSFr3QEZ/8TSoUi9XeXVBGXCaLtwTOKSLGcInCAvyZeMA==",
1611
+ "version": "8.34.1",
1612
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.34.1.tgz",
1613
+ "integrity": "sha512-rjLVbmE7HR18kDsjNIZQHxmv9RZwlgzavryL5Lnj2ujIRTeXlKtILHgRNmQ3j4daw7zd+mQgy+uyt6Zo6I0IGA==",
1614
1614
  "dev": true,
1615
1615
  "license": "MIT",
1616
1616
  "engines": {
@@ -1622,16 +1622,16 @@
1622
1622
  }
1623
1623
  },
1624
1624
  "node_modules/@typescript-eslint/typescript-estree": {
1625
- "version": "8.34.0",
1626
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.34.0.tgz",
1627
- "integrity": "sha512-rOi4KZxI7E0+BMqG7emPSK1bB4RICCpF7QD3KCLXn9ZvWoESsOMlHyZPAHyG04ujVplPaHbmEvs34m+wjgtVtg==",
1625
+ "version": "8.34.1",
1626
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.34.1.tgz",
1627
+ "integrity": "sha512-rjCNqqYPuMUF5ODD+hWBNmOitjBWghkGKJg6hiCHzUvXRy6rK22Jd3rwbP2Xi+R7oYVvIKhokHVhH41BxPV5mA==",
1628
1628
  "dev": true,
1629
1629
  "license": "MIT",
1630
1630
  "dependencies": {
1631
- "@typescript-eslint/project-service": "8.34.0",
1632
- "@typescript-eslint/tsconfig-utils": "8.34.0",
1633
- "@typescript-eslint/types": "8.34.0",
1634
- "@typescript-eslint/visitor-keys": "8.34.0",
1631
+ "@typescript-eslint/project-service": "8.34.1",
1632
+ "@typescript-eslint/tsconfig-utils": "8.34.1",
1633
+ "@typescript-eslint/types": "8.34.1",
1634
+ "@typescript-eslint/visitor-keys": "8.34.1",
1635
1635
  "debug": "^4.3.4",
1636
1636
  "fast-glob": "^3.3.2",
1637
1637
  "is-glob": "^4.0.3",
@@ -1651,16 +1651,16 @@
1651
1651
  }
1652
1652
  },
1653
1653
  "node_modules/@typescript-eslint/utils": {
1654
- "version": "8.34.0",
1655
- "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.34.0.tgz",
1656
- "integrity": "sha512-8L4tWatGchV9A1cKbjaavS6mwYwp39jql8xUmIIKJdm+qiaeHy5KMKlBrf30akXAWBzn2SqKsNOtSENWUwg7XQ==",
1654
+ "version": "8.34.1",
1655
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.34.1.tgz",
1656
+ "integrity": "sha512-mqOwUdZ3KjtGk7xJJnLbHxTuWVn3GO2WZZuM+Slhkun4+qthLdXx32C8xIXbO1kfCECb3jIs3eoxK3eryk7aoQ==",
1657
1657
  "dev": true,
1658
1658
  "license": "MIT",
1659
1659
  "dependencies": {
1660
1660
  "@eslint-community/eslint-utils": "^4.7.0",
1661
- "@typescript-eslint/scope-manager": "8.34.0",
1662
- "@typescript-eslint/types": "8.34.0",
1663
- "@typescript-eslint/typescript-estree": "8.34.0"
1661
+ "@typescript-eslint/scope-manager": "8.34.1",
1662
+ "@typescript-eslint/types": "8.34.1",
1663
+ "@typescript-eslint/typescript-estree": "8.34.1"
1664
1664
  },
1665
1665
  "engines": {
1666
1666
  "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1675,14 +1675,14 @@
1675
1675
  }
1676
1676
  },
1677
1677
  "node_modules/@typescript-eslint/visitor-keys": {
1678
- "version": "8.34.0",
1679
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.34.0.tgz",
1680
- "integrity": "sha512-qHV7pW7E85A0x6qyrFn+O+q1k1p3tQCsqIZ1KZ5ESLXY57aTvUd3/a4rdPTeXisvhXn2VQG0VSKUqs8KHF2zcA==",
1678
+ "version": "8.34.1",
1679
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.34.1.tgz",
1680
+ "integrity": "sha512-xoh5rJ+tgsRKoXnkBPFRLZ7rjKM0AfVbC68UZ/ECXoDbfggb9RbEySN359acY1vS3qZ0jVTVWzbtfapwm5ztxw==",
1681
1681
  "dev": true,
1682
1682
  "license": "MIT",
1683
1683
  "dependencies": {
1684
- "@typescript-eslint/types": "8.34.0",
1685
- "eslint-visitor-keys": "^4.2.0"
1684
+ "@typescript-eslint/types": "8.34.1",
1685
+ "eslint-visitor-keys": "^4.2.1"
1686
1686
  },
1687
1687
  "engines": {
1688
1688
  "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -2456,9 +2456,9 @@
2456
2456
  }
2457
2457
  },
2458
2458
  "node_modules/eslint-plugin-prettier": {
2459
- "version": "5.4.1",
2460
- "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.4.1.tgz",
2461
- "integrity": "sha512-9dF+KuU/Ilkq27A8idRP7N2DH8iUR6qXcjF3FR2wETY21PZdBrIjwCau8oboyGj9b7etWmTGEeM8e7oOed6ZWg==",
2459
+ "version": "5.5.0",
2460
+ "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.0.tgz",
2461
+ "integrity": "sha512-8qsOYwkkGrahrgoUv76NZi23koqXOGiiEzXMrT8Q7VcYaUISR+5MorIUxfWqYXN0fN/31WbSrxCxFkVQ43wwrA==",
2462
2462
  "dev": true,
2463
2463
  "license": "MIT",
2464
2464
  "dependencies": {
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript",
10
10
  "helper"
11
11
  ],
12
- "version": "0.36.5",
12
+ "version": "0.36.10",
13
13
  "type": "module",
14
14
  "module": "./dist/index.js",
15
15
  "main": "./dist/index.cjs",
package/src/main.ts CHANGED
@@ -356,6 +356,9 @@ import * as DocumentLineMtRoutes from './modules/supply/documentLineMT/route.sch
356
356
  import * as ChatSubscriber from './modules/user/chatSubscribers/interfaces';
357
357
  import * as ChatSubscriberRoutes from './modules/user/chatSubscribers/route.schema';
358
358
 
359
+ import * as Tag from './modules/stock/tag/interface';
360
+ import * as TagRoutes from './modules/stock/tag/route.schema';
361
+
359
362
  export {
360
363
  shared,
361
364
  // Errors,
@@ -677,4 +680,8 @@ export {
677
680
  //chat_subscriber
678
681
  ChatSubscriber,
679
682
  ChatSubscriberRoutes,
683
+
684
+ //tag
685
+ Tag,
686
+ TagRoutes,
680
687
  };
@@ -92,7 +92,7 @@ export interface IGetMaterialEntranceInfoStock {
92
92
  }
93
93
 
94
94
  export interface IEntradaDeMaterialStock extends IGetMaterialEntranceInfoStock {
95
- document_line_id: string | null;
95
+ document_line_id: string;
96
96
  quantity: number;
97
97
  option:
98
98
  | ICreateMaterialEntranceStockOption
@@ -115,7 +115,7 @@ export interface IEntradaDeMaterialNC {
115
115
 
116
116
  export interface IGetMaterialEntranceInfoResponse {
117
117
  clientOrders: IEntradaDeMaterialClientOrder[];
118
- stock: IEntradaDeMaterialStock[];
118
+ stock: IEntradaDeMaterialStock;
119
119
  not_ok: IEntradaDeMaterialNC;
120
120
  saved_id: string | null;
121
121
  }
@@ -47,7 +47,7 @@ const entradaDeMaterialStockBodyKeys: IShared.IRouteRequest<IEntradaDeMaterialSt
47
47
  ef_dla_id: joi.string().uuid().allow(null).required(),
48
48
  ordered_quantity: joi.number().positive().allow(0).required(),
49
49
 
50
- document_line_id: joi.string().uuid().allow(null).required(),
50
+ document_line_id: joi.string().uuid().required(),
51
51
  quantity: joi.number().positive().allow(0).required(),
52
52
  option: joi
53
53
  .string()
@@ -79,8 +79,8 @@ const entradaDeMaterialNCBodyKeys: IShared.IRouteRequest<IEntradaDeMaterialNC> =
79
79
  const entradaDeMaterialNCBody = joi.object().keys(entradaDeMaterialNCBodyKeys).messages(messages);
80
80
 
81
81
  const entradaDeMaterialDocumentHeaderBodyKeys: IShared.IRouteRequest<ISavedEmPickingData> = {
82
- clientOrders: joi.array().items(entradaDeMaterialClientOrderBody).required(),
83
- stock: joi.array().items(entradaDeMaterialStockBody).required(),
82
+ clientOrders: joi.array().items(entradaDeMaterialClientOrderBody),
83
+ stock: entradaDeMaterialStockBody,
84
84
  not_ok: entradaDeMaterialNCBody,
85
85
  };
86
86
 
@@ -12,7 +12,7 @@ export interface IFindByDocumentLineStateResponse {
12
12
  created_at: Date;
13
13
  created_by: string;
14
14
  who_handles: string | null;
15
- tags: string | null;
15
+ tags: string;
16
16
  upfront_total: number;
17
17
  unread: boolean;
18
18
  }
@@ -0,0 +1,36 @@
1
+ import * as IShared from '../../../shared/interface';
2
+
3
+ import { Tag } from '../../../shared/entities/stock';
4
+
5
+ export type Entity = Tag;
6
+ export const Route = 'tag';
7
+ export const UpperName = 'Tag';
8
+ export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
9
+
10
+ export const ITagTypeEnum: {
11
+ private: 'private';
12
+ public: 'public';
13
+ } = {
14
+ private: 'private',
15
+ public: 'public',
16
+ };
17
+
18
+ export type ITagType = (typeof ITagTypeEnum)[keyof typeof ITagTypeEnum];
19
+
20
+ export const ITagType = Object.keys(ITagTypeEnum);
21
+
22
+ export type ICreateRequest = Omit<
23
+ Entity,
24
+ 'id' | 'created_at' | 'updated_at' | 'created_by' | 'updated_by'
25
+ >;
26
+ export type IUpdateManyRequest = Pick<Entity, 'id' | 'index' | 'type'>;
27
+ export type IFindResponse = Omit<Entity, 'created_at' | 'updated_at'>;
28
+
29
+ export interface IRepository {
30
+ create(data: ICreateRequest): Promise<void>;
31
+ findByDocumentHeaderId(selector: IShared.IFindByIdRequest): Promise<IFindResponse[]>;
32
+ updateMany(data: IUpdateManyRequest[]): Promise<void>;
33
+ delete(selector: IShared.IFindByIdRequest): Promise<void>;
34
+ }
35
+
36
+ export type IController = IShared.IEntityWithUserToken<IRepository>;
@@ -0,0 +1,30 @@
1
+ import joi from 'joi';
2
+ import { messages } from '../../../shared/messages';
3
+ import * as IShared from '../../../shared/interface';
4
+ import { ICreateRequest, IUpdateManyRequest, ITagType } from './interface';
5
+
6
+ // create body validation
7
+ const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
8
+ document_header_id: joi.string().uuid().required(),
9
+ index: joi.number().allow(0).required(),
10
+ text: joi.string().required(),
11
+ type: joi
12
+ .string()
13
+ .valid(...ITagType)
14
+ .required(),
15
+ };
16
+ export const createBody = joi.object().keys(createBodyKeys).messages(messages);
17
+
18
+ // update body validation
19
+ const updateManyBodyKeys: IShared.IRouteRequest<IUpdateManyRequest> = {
20
+ id: joi.string().uuid().required(),
21
+ index: joi.number().allow(0).optional(),
22
+ type: joi
23
+ .string()
24
+ .valid(...ITagType)
25
+ .optional(),
26
+ };
27
+ export const updateManyBody = joi
28
+ .array()
29
+ .items(joi.object().keys(updateManyBodyKeys))
30
+ .messages(messages);
@@ -217,7 +217,6 @@ export interface IUpdateRequest {
217
217
  is_archived?: boolean;
218
218
  is_void?: boolean;
219
219
  who_handles?: string | null;
220
- tags?: string | null;
221
220
  warning?: IWarningType;
222
221
  created_by?: string;
223
222
  }
@@ -267,7 +266,6 @@ export interface IFindResponse {
267
266
  total: number;
268
267
  emission_date: string;
269
268
  line_count: number;
270
- tags: string;
271
269
  is_void: boolean;
272
270
  is_archived: boolean;
273
271
  adjudicado: boolean;
@@ -370,7 +368,6 @@ export interface IFindRmOpenDocuments {
370
368
  document_header_id: string;
371
369
  document_number: string;
372
370
  identifier: string;
373
- tags: string | null;
374
371
  upfront_total: number | null;
375
372
  who_handles: string | null;
376
373
  document_lines: {
@@ -244,7 +244,6 @@ const updateBodyKeys: IShared.IRouteRequestWithStamps<IUpdateRequest> = {
244
244
  is_archived: joi.boolean().optional(),
245
245
  is_void: joi.boolean().optional(),
246
246
  who_handles: joi.string().allow(null).optional(),
247
- tags: joi.string().allow(null, '').optional(),
248
247
  warning: joi
249
248
  .string()
250
249
  .optional()
@@ -15,7 +15,9 @@ const emailSchema = joi
15
15
  .string()
16
16
  .trim(true)
17
17
  .lowercase()
18
- .email({ tlds: { allow: false } });
18
+ .email({ tlds: { allow: false } })
19
+ .allow(null, '');
20
+
19
21
  // create body validation
20
22
  const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
21
23
  name: joi.string().allow(null, '').optional(),
@@ -6,6 +6,7 @@ import {
6
6
  import { IBatchType, IPaymentOrigin } from '../../modules/supply/payment/interface';
7
7
  import { IProductType } from '../../modules/stock/productGoogleSheets/interface';
8
8
  import { IImageType } from '../../modules/stock/productImage/interface';
9
+ import { ITagType } from '../../modules/stock/tag/interface';
9
10
  import { IQueryParameterDatatype } from '../../modules/stock/queryParameter/interfaces';
10
11
  import {
11
12
  IData,
@@ -342,7 +343,6 @@ export type DocumentHeader = {
342
343
  is_void: boolean;
343
344
  origin_id: string | null;
344
345
  who_handles: string | null;
345
- tags: string | null;
346
346
  warning: string | null;
347
347
  created_at: Date;
348
348
  updated_at: Date;
@@ -1304,3 +1304,19 @@ export type DocumentLineMT = {
1304
1304
  created_at: Date;
1305
1305
  updated_at: Date;
1306
1306
  };
1307
+
1308
+ /**
1309
+ * Model Tag
1310
+ *
1311
+ */
1312
+ export type Tag = {
1313
+ id: string;
1314
+ text: string;
1315
+ index: number;
1316
+ type: ITagType;
1317
+ document_header_id: string;
1318
+ created_by: string;
1319
+ updated_by: string;
1320
+ created_at: Date;
1321
+ updated_at: Date;
1322
+ };