@nomalism-com/types 0.43.58 → 0.43.60

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,11 +1,12 @@
1
1
  import * as IShared from '../../../shared/interface';
2
2
  import type { IChatBalloon } from '../../stock/chat/interfaces';
3
+ import type { IDocumentTypeUserType } from '../../supply/documentType/interfaces';
3
4
  import type * as ChatSubscriber from '../../user/chatSubscribers/interfaces';
4
5
  export interface IPcTags {
5
6
  id: string;
6
7
  text: string;
7
8
  }
8
- export interface IPublicDocument {
9
+ interface IPublicOtherDocument {
9
10
  chat_subscriber_id: string;
10
11
  chat_document_header_id: string;
11
12
  label: string;
@@ -16,16 +17,20 @@ export interface IPublicDocument {
16
17
  pc_created_by: string;
17
18
  closed: boolean;
18
19
  }
19
- export interface IPublicFindBySubscriberId {
20
- user_type: 'client' | 'provider';
21
- owner_id: string;
22
- persona: ChatSubscriber.IFindByOwnerResponse;
20
+ interface IPublicDocument {
23
21
  chat_document_header_id: string;
22
+ document_name: string;
24
23
  store_operator_name: string;
25
- document_total: number;
24
+ user_type: IDocumentTypeUserType;
25
+ document_total: number | null;
26
+ other_personas: ChatSubscriber.IPersona[];
27
+ }
28
+ export interface IPublicFindBySubscriberId {
29
+ owner_id: string;
30
+ document?: IPublicDocument;
31
+ persona?: ChatSubscriber.IPersona;
26
32
  chat: IChatBalloon[];
27
- other_personas: ChatSubscriber.IFindByOwnerResponse[];
28
- documents: IPublicDocument[];
33
+ documents: IPublicOtherDocument[];
29
34
  }
30
35
  export declare enum IPublicDocumentHeaderNoteType {
31
36
  Provider = "Provider",
@@ -54,3 +59,4 @@ export interface IRepository {
54
59
  publicUpdateDocumentHeaderNote: (selector: IShared.IFindByIdRequest, data: PublicDocumentHeaderNoteUpdateRequest[]) => Promise<PublicDocumentHeaderNote[]>;
55
60
  }
56
61
  export type IController = IShared.IEntityWithUserToken<IRepository>;
62
+ export {};
@@ -15,18 +15,16 @@ export interface IFindDocumentHeaderSubscribersRequest {
15
15
  export interface IFindSubscribedDocumentHeadersRequest {
16
16
  owner_id: string;
17
17
  }
18
- export type IFindByOwnerResponse = Pick<Persona, 'external' | 'name' | 'email' | 'telephone'> & Pick<ChatSubscriber, 'id' | 'persona_id' | 'chat_document_header_id'>;
19
- export interface IFindByIdResponse extends IFindByOwnerResponse {
20
- subscriptions: {
21
- id: string;
22
- chat_document_header_id: string;
23
- }[];
18
+ export type IPersona = Pick<Persona, 'external' | 'name' | 'email' | 'telephone'>;
19
+ export type IEntityWithPersona = Pick<ChatSubscriber, 'id' | 'persona_id' | 'chat_document_header_id'> & IPersona;
20
+ export interface IEntityWithPersonaAndSubscriptions extends IPersona {
21
+ subscriptions: Pick<Entity, 'id' | 'chat_document_header_id'>[];
24
22
  }
25
23
  export interface IRepository {
24
+ findDocumentHeaderSubscribers(selector: IFindDocumentHeaderSubscribersRequest): Promise<IEntityWithPersona[]>;
25
+ findSubscribedDocumentHeaders(selector: IFindSubscribedDocumentHeadersRequest): Promise<IEntityWithPersonaAndSubscriptions>;
26
+ findById(selector: IShared.IFindByIdRequest): Promise<IEntityWithPersonaAndSubscriptions>;
26
27
  createOrUpdate(data: ICreateOrUpdateRequest): Promise<string>;
27
- findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse>;
28
- findDocumentHeaderSubscribers(selector: IFindDocumentHeaderSubscribersRequest): Promise<IFindByOwnerResponse[]>;
29
- findSubscribedDocumentHeaders(selector: IFindSubscribedDocumentHeadersRequest): Promise<IFindByOwnerResponse[]>;
30
28
  deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
31
29
  }
32
30
  export type IController = IShared.IEntityWithUserToken<IRepository>;
@@ -7,10 +7,10 @@ import type { IScheduleType } from '../modules/supply/schedule/interface';
7
7
  import type { IWarningType } from '../modules/supply/documentHeader/interfaces';
8
8
  import type { IChat, IEmail, IEncomenda, IMultimedia, IMultimediaSummary, IPostgresBackup, IPrint, IProjectInfo, IProposta, IServiceLogs, IServiceStatus, IStock, ITask } from '../modules/view/adminPanel/interfaces';
9
9
  import type * as ErrorLog from '../modules/view/errorLog/interfaces';
10
- import type * as ChatSubscriber from '../modules/user/chatSubscribers/interfaces';
11
10
  import type { File } from './entities/stock';
12
11
  import type { ProjectInfo } from './entities/integration';
13
12
  import type { IAttachment } from '../modules/supply/externalDocumentHeader/interface';
13
+ import type { Persona } from './entities/user';
14
14
  export { messages };
15
15
  type CreatedAt = 'created_at';
16
16
  type UpdatedAt = 'updated_at';
@@ -285,7 +285,7 @@ export type IBrokerTopicPayload = {
285
285
  warningErrors: string[];
286
286
  };
287
287
  [IBrokerTopic.dispatch_chat_message]: {
288
- to: [Pick<ChatSubscriber.IFindByOwnerResponse, 'email' | 'name' | 'telephone'>];
288
+ to: [Pick<Persona, 'email' | 'name' | 'telephone'>];
289
289
  reply_url: string;
290
290
  owner_id: string;
291
291
  document_header_id: string | null;
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.43.58",
4
+ "version": "0.43.60",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",