@nomalism-com/types 0.46.13 → 0.46.15

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.
@@ -4,10 +4,46 @@ export type IEntity = DocumentHeaderSurvey;
4
4
  export declare const Route = "document_header_survey";
5
5
  export type ICreateRequest = Pick<IEntity, 'owner_id' | 'document_header_id' | 'persona_id'>;
6
6
  export type IResponse = IEntity;
7
+ export interface IFindRequest {
8
+ date_start: Date;
9
+ date_end: Date;
10
+ }
11
+ export interface IFindResponseItem {
12
+ document_header_id: string;
13
+ document_number: number;
14
+ rm_date: Date | null;
15
+ survey_id: string | null;
16
+ persona_name: string | null;
17
+ persona_email: string | null;
18
+ sent: Date | null;
19
+ responded_at: Date | null;
20
+ response_url: string | null;
21
+ }
22
+ export type IFindResponse = IFindResponseItem[];
23
+ export interface IMtWithoutDateCountResponse {
24
+ count: number;
25
+ }
7
26
  export type IUpdateSentRequest = Pick<IEntity, 'document_header_id' | 'persona_id'>;
8
27
  export type IUpdateSurveyRequest = Pick<IEntity, 'document_header_id' | 'persona_id' | 'data'>;
28
+ export interface ISurveyStatsSummary {
29
+ total: number;
30
+ sent: number;
31
+ pending: number;
32
+ responded: number;
33
+ response_rate: number;
34
+ }
35
+ export interface ISurveyStatsDailyPoint {
36
+ day: string;
37
+ created: number;
38
+ sent: number;
39
+ responded: number;
40
+ }
41
+ export interface ISurveyStatsResponse {
42
+ summary: ISurveyStatsSummary;
43
+ daily: ISurveyStatsDailyPoint[];
44
+ }
9
45
  export interface IRepository {
10
- find(): Promise<IResponse[]>;
46
+ find(params: IFindRequest): Promise<IFindResponse>;
11
47
  updateSent(data: IUpdateSentRequest): Promise<void>;
12
48
  updateSurvey(data: IUpdateSurveyRequest): Promise<void>;
13
49
  }
@@ -376,6 +376,7 @@ export type IBrokerTopicPayload = {
376
376
  };
377
377
  [IBrokerTopic.send_email_client_survey]: {
378
378
  persona_id: string;
379
+ owner_id: string;
379
380
  document_header_id: string;
380
381
  document_number: number;
381
382
  persona_name: string;
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.46.13",
4
+ "version": "0.46.15",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "prepack": "npm run lint && npm run build"
27
27
  },
28
28
  "dependencies": {
29
- "joi": "^18.2.2"
29
+ "joi": "^18.2.3"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@swc/core": "^1.15.41",