tango-api-schema 2.0.18 → 2.0.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-api-schema",
3
- "version": "2.0.18",
3
+ "version": "2.0.20",
4
4
  "description": "tangoEye model schema",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,11 +1,9 @@
1
1
  import mongoose from 'mongoose';
2
- import mongooseUniqueValidator from 'mongoose-unique-validator';
3
2
 
4
3
  const roles = new mongoose.Schema(
5
4
  {
6
5
  roleName: {
7
6
  type: String,
8
- unique: true,
9
7
  enum: [ 'superadmin', 'admin', 'user' ],
10
8
  },
11
9
  userType: {
@@ -14,7 +12,7 @@ const roles = new mongoose.Schema(
14
12
  },
15
13
  isActive: {
16
14
  type: Boolean,
17
- default: false,
15
+ default: true,
18
16
  },
19
17
  // AssignedUsers: {
20
18
  // type:Array
@@ -53,5 +51,4 @@ const roles = new mongoose.Schema(
53
51
  },
54
52
  );
55
53
 
56
- roles.plugin( mongooseUniqueValidator );
57
54
  export default mongoose.model( 'standaredRoles', roles ,'standaredRoles');
@@ -40,32 +40,7 @@ const user = new mongoose.Schema(
40
40
  type: String,
41
41
  enum:['tango','client']
42
42
  },
43
- permission: [
44
- {
45
- featureName: {
46
- type: String,
47
- },
48
- product: [
49
- {
50
- name: {
51
- type: String,
52
- },
53
- isView: {
54
- type: Boolean,
55
- },
56
- isEdit: {
57
- type: Boolean,
58
- },
59
- isDownload: {
60
- type: Boolean,
61
- },
62
- isDelete: {
63
- type: Boolean,
64
- },
65
- },
66
- ],
67
- },
68
- ],
43
+
69
44
  },
70
45
  {
71
46
  strict: true,
@@ -0,0 +1,71 @@
1
+ import mongoose from 'mongoose';
2
+ import mongooseUniqueValidator from 'mongoose-unique-validator';
3
+
4
+ const userPermission = new mongoose.Schema(
5
+ {
6
+ userName: {
7
+ type: String,
8
+ },
9
+ email: {
10
+ type: String,
11
+ required: true,
12
+ unique: true,
13
+ },
14
+ clientId:{
15
+ type: String
16
+ },
17
+ role: {
18
+ type: String,
19
+ enum: [ 'superadmin', 'admin', 'user' ],
20
+ default: 'user',
21
+ },
22
+ // Assigned: {
23
+ // type: {
24
+ // type: String,
25
+ // enum: [ 'store', 'group' ],
26
+ // },
27
+ // list: {
28
+ // type: Array,
29
+ // },
30
+ // },
31
+ userType:{
32
+ type: String,
33
+ enum:['tango','client']
34
+ },
35
+ permission: [
36
+ {
37
+ featureName: {
38
+ type: String,
39
+ },
40
+ product: [
41
+ {
42
+ name: {
43
+ type: String,
44
+ },
45
+ isView: {
46
+ type: Boolean,
47
+ },
48
+ isEdit: {
49
+ type: Boolean,
50
+ },
51
+ isDownload: {
52
+ type: Boolean,
53
+ },
54
+ isDelete: {
55
+ type: Boolean,
56
+ },
57
+ },
58
+ ],
59
+ },
60
+ ],
61
+
62
+ },
63
+ {
64
+ strict: true,
65
+ versionKey: false,
66
+ timestamps: true,
67
+ },
68
+ );
69
+
70
+ userPermission.plugin( mongooseUniqueValidator );
71
+ export default mongoose.model( 'userPermission', userPermission );