@resolveio/server-lib 1.1.5 → 1.1.6-newrole

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.
@@ -123,7 +123,27 @@ var schema = {
123
123
  },
124
124
  'client_user.email': {
125
125
  type: String
126
- }
126
+ },
127
+ id_user_assigned: {
128
+ type: String
129
+ },
130
+ user_assigned: {
131
+ type: String
132
+ },
133
+ resolveio_status: {
134
+ type: String
135
+ },
136
+ estimated_billable_hours: {
137
+ type: Number,
138
+ optional: true
139
+ },
140
+ billable_hours: {
141
+ type: Number,
142
+ optional: true
143
+ },
144
+ bill_description: {
145
+ type: String
146
+ },
127
147
  };
128
148
  var DefaultSchema = new mongoose_1.Schema(schema, {
129
149
  skipVersioning: true,
@@ -21,13 +21,6 @@ var schema = {
21
21
  type: Date,
22
22
  optional: true
23
23
  },
24
- readonly: {
25
- type: Boolean,
26
- optional: true
27
- },
28
- active: {
29
- type: Boolean
30
- },
31
24
  attempts: {
32
25
  type: Number,
33
26
  optional: true
@@ -64,60 +57,73 @@ var schema = {
64
57
  type: String
65
58
  },
66
59
  roles: {
60
+ type: Object
61
+ },
62
+ 'roles.super_admin': {
63
+ type: Boolean
64
+ },
65
+ 'roles.approvals': {
67
66
  type: Array
68
67
  },
69
- 'roles.$': {
68
+ 'roles.approvals.$': {
69
+ type: Object
70
+ },
71
+ 'roles.approvals.$.name': {
70
72
  type: String
71
73
  },
72
- phonenumber: {
73
- type: String,
74
- optional: true
74
+ 'roles.approvals.$.type': {
75
+ type: String
75
76
  },
76
- other: {
77
- type: Object,
78
- blackbox: true,
79
- optional: true
77
+ 'roles.approvals.$.accounting_code': {
78
+ type: String
80
79
  },
81
- assets: {
82
- type: Array,
83
- optional: true
80
+ 'roles.groups': {
81
+ type: Array
84
82
  },
85
- 'assets.$': {
83
+ 'roles.groups.$': {
86
84
  type: Object
87
85
  },
88
- 'assets.$.type': {
86
+ 'roles.groups.$.name': {
89
87
  type: String
90
88
  },
91
- 'assets.$.id_asset': {
92
- type: String
89
+ 'roles.groups.$.views': {
90
+ type: Array
93
91
  },
94
- 'assets.$.asset_number': {
92
+ 'roles.groups.$.views.$': {
95
93
  type: String
96
94
  },
97
- 'assets.$.ownership': {
98
- type: String
95
+ 'roles.groups.$.yard': {
96
+ type: String,
97
+ optional: true
99
98
  },
100
- 'assets.$.ownership_driver': {
99
+ 'roles.notifications': {
100
+ type: Array
101
+ },
102
+ 'roles.notifications.$': {
101
103
  type: String
102
104
  },
103
- 'assets.$.date_start': {
104
- type: Date
105
+ 'roles.miscs': {
106
+ type: Array
105
107
  },
106
- 'assets.$.date_end': {
107
- type: Date,
108
- optional: true
108
+ 'roles.miscs.$': {
109
+ type: String
109
110
  },
110
- id_function: {
111
+ active: Boolean,
112
+ id_customer: {
111
113
  type: String,
112
114
  optional: true
113
115
  },
114
116
  customer: {
115
117
  type: String,
116
- optional: true,
118
+ optional: true
117
119
  },
118
- id_customer: {
120
+ customer_type: {
119
121
  type: String,
120
- optional: true,
122
+ optional: true
123
+ },
124
+ phonenumber: {
125
+ type: String,
126
+ optional: true
121
127
  }
122
128
  };
123
129
  var DefaultSchema = new mongoose_1.Schema(schema, {
@@ -360,6 +360,9 @@ var SubscriptionManager = /** @class */ (function () {
360
360
  else if (collection === 'queue-responses') {
361
361
  _this._mainServer.getQueueManager().runMethodResponse();
362
362
  }
363
+ else if (collection === 'support-tickets') {
364
+ _this._mainServer.getMethodManager().callMethodInternal('sendSupportTicketEmail', doc.o._id);
365
+ }
363
366
  });
364
367
  oplog.on('update', function (doc) {
365
368
  var nsArray = doc.ns.split('.');
@@ -20,6 +20,12 @@ export interface SupportTicketModel extends CollectionDocument {
20
20
  files: string[];
21
21
  current_watchers: SupportTicketWatchersModel[];
22
22
  client_user: SupportTicketClientUserModel;
23
+ id_user_assigned: string;
24
+ user_assigned: string;
25
+ resolveio_status: string;
26
+ estimated_billable_hours?: number;
27
+ billable_hours?: number;
28
+ bill_description: string;
23
29
  }
24
30
  export interface SupportTicketClientUserModel {
25
31
  id_user: string;
@@ -27,7 +33,8 @@ export interface SupportTicketClientUserModel {
27
33
  email: string;
28
34
  }
29
35
  declare type SupportTicketStatus = 'Opened' | 'Resolved';
30
- export declare type SupportTicketSubstatus = 'New' | 'Work-In-Progress' | 'Idle' | 'Awaiting Customer Interaction';
36
+ export declare type SupportTicketSubstatus = 'New' | 'Work In Progress' | 'Idle' | 'Awaiting Customer Interaction';
37
+ export declare type SupportTicketResolveIOStatus = 'Opened' | 'Review' | 'Closed';
31
38
  export interface SupportTicketMessageModel {
32
39
  message: string;
33
40
  id_user: string;
@@ -1,14 +1,30 @@
1
1
  import { CollectionDocument } from './collection-document.model';
2
2
  export interface UserModel extends CollectionDocument {
3
- attempts: number;
4
- last: Date;
5
- services?: any;
6
3
  fullname: string;
4
+ roles: UserRoleModel;
7
5
  username?: string;
8
6
  email?: string;
9
- roles?: string[];
10
7
  active?: boolean;
11
- readonly?: boolean;
8
+ services?: any;
9
+ id_customer?: string;
10
+ customer?: string;
11
+ customer_type?: string;
12
12
  phonenumber?: string;
13
- other?: object;
13
+ }
14
+ export interface UserRoleModel {
15
+ super_admin: boolean;
16
+ approvals: UserRoleApprovalModel[];
17
+ groups: UserRoleGroupModel[];
18
+ notifications: string[];
19
+ miscs: string[];
20
+ }
21
+ export interface UserRoleApprovalModel {
22
+ accounting_code: string;
23
+ type: string;
24
+ name: string;
25
+ }
26
+ export interface UserRoleGroupModel {
27
+ name: string;
28
+ views: string[];
29
+ yard?: string;
14
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "1.1.5",
3
+ "version": "1.1.6-newrole",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "scripts": {