@nomalism-com/types 0.34.16 → 0.34.18

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
@@ -3204,10 +3204,10 @@ var createBodyKeys35 = {
3204
3204
  };
3205
3205
  var createBody36 = joi49.object().keys(createBodyKeys35).messages(messages);
3206
3206
  var updateStoreOperatorQueryKeys = {
3207
- name: joi49.string().allow(null, "").optional(),
3208
- account: joi49.string().allow(null, "").optional(),
3209
- email: joi49.string().email({ tlds: { allow: false } }).allow(null, "").optional(),
3210
- internal_email: joi49.string().email({ tlds: { allow: false } }).allow(null, "").optional(),
3207
+ main_persona_name: joi49.string().allow(null, "").optional(),
3208
+ main_persona_email: joi49.string().email({ tlds: { allow: false } }).allow(null, "").optional(),
3209
+ user_account: joi49.string().allow(null, "").optional(),
3210
+ password: joi49.string().allow(null, "").optional(),
3211
3211
  inactive: joi49.boolean().optional()
3212
3212
  };
3213
3213
  var updateStoreOperatorQuery = joi49.object().keys(updateStoreOperatorQueryKeys).messages(messages);
package/dist/index.js CHANGED
@@ -3204,10 +3204,10 @@ var createBodyKeys35 = {
3204
3204
  };
3205
3205
  var createBody36 = joi49.object().keys(createBodyKeys35).messages(messages);
3206
3206
  var updateStoreOperatorQueryKeys = {
3207
- name: joi49.string().allow(null, "").optional(),
3208
- account: joi49.string().allow(null, "").optional(),
3209
- email: joi49.string().email({ tlds: { allow: false } }).allow(null, "").optional(),
3210
- internal_email: joi49.string().email({ tlds: { allow: false } }).allow(null, "").optional(),
3207
+ main_persona_name: joi49.string().allow(null, "").optional(),
3208
+ main_persona_email: joi49.string().email({ tlds: { allow: false } }).allow(null, "").optional(),
3209
+ user_account: joi49.string().allow(null, "").optional(),
3210
+ password: joi49.string().allow(null, "").optional(),
3211
3211
  inactive: joi49.boolean().optional()
3212
3212
  };
3213
3213
  var updateStoreOperatorQuery = joi49.object().keys(updateStoreOperatorQueryKeys).messages(messages);
@@ -4,9 +4,10 @@ export type Entity = StoreOperator;
4
4
  export declare const Route = "store_operator";
5
5
  export declare const UpperName = "StoreOperator";
6
6
  export declare const LowerName: string;
7
+ export type IFindPaginatedRequest = IShared.IPaginationRequest & Pick<Entity, 'inactive'>;
7
8
  export interface IFindResponse extends Pick<Entity, 'id'> {
8
9
  user: Pick<Users, 'id' | 'account'>;
9
- main_persona: Pick<Persona, 'name' | 'email'>;
10
+ main_persona: Pick<Persona, 'id' | 'name' | 'email'>;
10
11
  }
11
12
  export type ICreateMainPersona = Pick<Persona, 'nif' | 'name' | 'email' | 'telephone'>;
12
13
  export interface ICreateRequest {
@@ -14,16 +15,16 @@ export interface ICreateRequest {
14
15
  main_persona: ICreateMainPersona;
15
16
  }
16
17
  export interface IUpdateRequest {
17
- name: string | null;
18
- account: string | null;
19
- email: string | null;
20
- internal_email: string | null;
18
+ main_persona_name: string | null;
19
+ main_persona_email: string | null;
20
+ user_account: string | null;
21
+ password: string | null;
21
22
  inactive: boolean;
22
23
  }
23
24
  export interface IRepository {
24
25
  findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
25
26
  find(): Promise<IFindResponse[]>;
26
- findPaginated(selector: IShared.IPaginationRequest): Promise<IShared.IPaginationResponse<IFindResponse>>;
27
+ findPaginated(selector: IFindPaginatedRequest): Promise<IShared.IPaginationResponse<IFindResponse>>;
27
28
  create(data: ICreateRequest): Promise<string>;
28
29
  update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
29
30
  deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript",
10
10
  "helper"
11
11
  ],
12
- "version": "0.34.16",
12
+ "version": "0.34.18",
13
13
  "type": "module",
14
14
  "module": "./dist/index.js",
15
15
  "main": "./dist/index.cjs",
@@ -6,9 +6,11 @@ export const Route = 'store_operator';
6
6
  export const UpperName = 'StoreOperator';
7
7
  export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
8
8
 
9
+ export type IFindPaginatedRequest = IShared.IPaginationRequest & Pick<Entity, 'inactive'>;
10
+
9
11
  export interface IFindResponse extends Pick<Entity, 'id'> {
10
12
  user: Pick<Users, 'id' | 'account'>;
11
- main_persona: Pick<Persona, 'name' | 'email'>;
13
+ main_persona: Pick<Persona, 'id' | 'name' | 'email'>;
12
14
  }
13
15
 
14
16
  export type ICreateMainPersona = Pick<Persona, 'nif' | 'name' | 'email' | 'telephone'>;
@@ -19,17 +21,18 @@ export interface ICreateRequest {
19
21
  }
20
22
 
21
23
  export interface IUpdateRequest {
22
- name: string | null;
23
- account: string | null;
24
- email: string | null;
25
- internal_email: string | null;
24
+ main_persona_name: string | null;
25
+ main_persona_email: string | null;
26
+ user_account: string | null;
27
+ password: string | null;
26
28
  inactive: boolean;
27
29
  }
30
+
28
31
  export interface IRepository {
29
32
  findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
30
33
  find(): Promise<IFindResponse[]>;
31
34
  findPaginated(
32
- selector: IShared.IPaginationRequest,
35
+ selector: IFindPaginatedRequest,
33
36
  ): Promise<IShared.IPaginationResponse<IFindResponse>>;
34
37
  create(data: ICreateRequest): Promise<string>;
35
38
  update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
@@ -23,18 +23,14 @@ export const createBody = joi.object().keys(createBodyKeys).messages(messages);
23
23
 
24
24
  // update store operator query validation
25
25
  const updateStoreOperatorQueryKeys: IShared.IRouteRequest<IUpdateRequest> = {
26
- name: joi.string().allow(null, '').optional(),
27
- account: joi.string().allow(null, '').optional(),
28
- email: joi
29
- .string()
30
- .email({ tlds: { allow: false } })
31
- .allow(null, '')
32
- .optional(),
33
- internal_email: joi
26
+ main_persona_name: joi.string().allow(null, '').optional(),
27
+ main_persona_email: joi
34
28
  .string()
35
29
  .email({ tlds: { allow: false } })
36
30
  .allow(null, '')
37
31
  .optional(),
32
+ user_account: joi.string().allow(null, '').optional(),
33
+ password: joi.string().allow(null, '').optional(),
38
34
  inactive: joi.boolean().optional(),
39
35
  };
40
36
  export const updateStoreOperatorQuery = joi