@nomalism-com/types 0.16.19 → 0.16.21

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.
@@ -7,11 +7,16 @@ export declare const LowerName: string;
7
7
  export interface IEntityExtended extends Entity {
8
8
  attachments: EmailTemplateAttachment[];
9
9
  }
10
+ export interface ICreateAttachments {
11
+ multimedia_id: string;
12
+ name: string;
13
+ }
10
14
  export interface ICreateRequest {
11
15
  name: string;
12
16
  to: string;
13
17
  subject: string;
14
18
  body: string;
19
+ attachments: ICreateAttachments[];
15
20
  }
16
21
  export interface IUpdateRequest {
17
22
  name?: string;
@@ -32,7 +37,7 @@ export interface ISendRequest {
32
37
  }
33
38
  export interface IRepository {
34
39
  find(): Promise<IEntityExtended[]>;
35
- create(data: ICreateRequest): Promise<void>;
40
+ create(data: ICreateRequest): Promise<string>;
36
41
  update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
37
42
  deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
38
43
  send(data: ISendRequest): Promise<void>;
@@ -11,6 +11,13 @@ exports.createBodyKeys = {
11
11
  to: joi_1.default.string().required(),
12
12
  subject: joi_1.default.string().required(),
13
13
  body: joi_1.default.string().required(),
14
+ attachments: joi_1.default
15
+ .array()
16
+ .items(joi_1.default.object().keys({
17
+ multimedia_id: joi_1.default.string().uuid().required(),
18
+ name: joi_1.default.string().required(),
19
+ }))
20
+ .required(),
14
21
  };
15
22
  exports.createBody = joi_1.default.object().keys(exports.createBodyKeys).messages(messages_1.messages);
16
23
  exports.updateBodyKeys = {
@@ -10,7 +10,7 @@ export interface ICreateRequest {
10
10
  name: string;
11
11
  }
12
12
  export interface IRepository {
13
- create(data: ICreateRequest): Promise<void>;
13
+ create(data: ICreateRequest): Promise<string>;
14
14
  deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
15
15
  }
16
16
  export type IController = IShared.IEntityWithUserToken<IRepository>;
@@ -26,7 +26,6 @@ export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IFind
26
26
  export type ICreateMainPersona = Pick<Persona, 'nif' | 'name' | 'email' | 'telephone'>;
27
27
  export interface ICreateRequest {
28
28
  user_id: string;
29
- nif: string;
30
29
  default_percentage?: number;
31
30
  main_persona: ICreateMainPersona;
32
31
  country_id?: string | null;
@@ -37,7 +36,6 @@ export interface ICreateRequest {
37
36
  default_vehicle_id?: string | null;
38
37
  }
39
38
  export interface IUpdateRequest {
40
- nif?: string;
41
39
  default_percentage?: number;
42
40
  main_persona_id?: string;
43
41
  country_id?: string | null;
@@ -17,7 +17,6 @@ var createMainPersonaKeys = {
17
17
  };
18
18
  var createBodyKeys = {
19
19
  user_id: joi_1.default.string().uuid().required(),
20
- nif: joi_1.default.string().required(),
21
20
  default_percentage: joi_1.default.number().positive().allow(0).default(0).optional(),
22
21
  main_persona: joi_1.default.object().keys(createMainPersonaKeys).required(),
23
22
  country_id: joi_1.default.string().uuid().allow(null).optional(),
@@ -29,7 +28,6 @@ var createBodyKeys = {
29
28
  };
30
29
  exports.createBody = joi_1.default.object().keys(createBodyKeys).messages(messages_1.messages);
31
30
  var updateBodyKeys = {
32
- nif: joi_1.default.string().optional(),
33
31
  default_percentage: joi_1.default.number().positive().allow(0).optional(),
34
32
  main_persona_id: joi_1.default.string().uuid().optional(),
35
33
  country_id: joi_1.default.string().uuid().allow(null).optional(),
@@ -37,7 +37,6 @@ export interface ICreateRequest {
37
37
  user?: ICreateUser;
38
38
  manufacturer?: boolean;
39
39
  inactive?: boolean;
40
- nif: string;
41
40
  default_discount?: number;
42
41
  exemption_reason_id?: string | null;
43
42
  main_persona: ICreateMainPersona;
@@ -53,7 +52,6 @@ export interface ICreateRequest {
53
52
  export interface IUpdateRequest {
54
53
  manufacturer?: boolean;
55
54
  inactive?: boolean;
56
- nif?: string;
57
55
  default_discount?: number;
58
56
  exemption_reason_id?: string | null;
59
57
  main_persona_id?: string;
@@ -28,7 +28,6 @@ var createBodyKeys = {
28
28
  user: joi_1.default.object().keys(createUserKeys).optional(),
29
29
  manufacturer: joi_1.default.boolean().default(false).optional(),
30
30
  inactive: joi_1.default.boolean().default(false).optional(),
31
- nif: joi_1.default.string().required(),
32
31
  default_discount: joi_1.default
33
32
  .number()
34
33
  .positive()
@@ -51,7 +50,6 @@ exports.createBody = joi_1.default.object().keys(createBodyKeys).messages(messag
51
50
  var updateBodyKeys = {
52
51
  manufacturer: joi_1.default.boolean().optional(),
53
52
  inactive: joi_1.default.boolean().optional(),
54
- nif: joi_1.default.string().optional(),
55
53
  default_discount: joi_1.default.number().positive().allow(0).max(99).optional(),
56
54
  exemption_reason_id: joi_1.default.string().uuid().allow(null).optional(),
57
55
  provider_type_id: joi_1.default.string().uuid().allow(null).optional(),
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript",
10
10
  "helper"
11
11
  ],
12
- "version": "0.16.19",
12
+ "version": "0.16.21",
13
13
  "main": "./dist/index.js",
14
14
  "types": "./dist/index.d.ts",
15
15
  "files": [