tango-api-schema 2.0.50 → 2.0.52-dev

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.
@@ -1,75 +1,71 @@
1
- import mongoose from 'mongoose';
2
- import mongooseUniqueValidator from 'mongoose-unique-validator';
3
-
4
- const lead = new mongoose.Schema(
5
- {
6
- clientName: {
7
- type: String,
8
- trim: true,
9
- required: true,
10
- unique: true,
11
- },
12
- firstName: {
13
- type: String,
14
- required: true,
15
- },
16
- lastName: {
17
- type: String,
18
- },
19
- corporateEmail: {
20
- type: String,
21
- required: true,
22
- unique: true,
23
- },
24
- countryCode: {
25
- type: String,
26
- },
27
- mobileNumber: {
28
- type: Number,
29
- required: true,
30
- },
31
- password: {
32
- type: String,
33
- required: true,
34
- },
35
- planDetails: {
36
- totalStores: {
37
- type: String,
38
- required: true,
39
- },
40
- storeSize: {
41
- type: String,
42
- required: true,
43
- },
44
- totalCamera: {
45
- type: Number,
46
- required: true,
47
- },
48
- subscriptionPeriod: {
49
- type: String,
50
- enum: [ 'monthly', 'quarterly', 'annual' ],
51
- },
52
- subscriptionType: {
53
- type: String,
54
- enum: [ 'free', 'premium', 'enterprise' ],
55
- },
56
- product: {
57
- type: Array,
58
- },
59
-
60
- },
61
- status: {
62
- type: String,
63
- enum: [ 'pending', 'rejected', 'approved' ],
64
- default: 'pending',
65
- },
66
- },
67
- {
68
- strict: true,
69
- versionKey: false,
70
- timestamps: true,
71
- },
72
- );
73
-
74
- lead.plugin( mongooseUniqueValidator );
75
- export default mongoose.model( 'lead', lead );
1
+ import mongoose from 'mongoose';
2
+ import mongooseUniqueValidator from 'mongoose-unique-validator';
3
+
4
+ const lead = new mongoose.Schema(
5
+ {
6
+ clientName: {
7
+ type: String,
8
+ trim: true,
9
+ required: true,
10
+ unique: true,
11
+ },
12
+ firstName: {
13
+ type: String,
14
+ required: true,
15
+ },
16
+ lastName: {
17
+ type: String,
18
+ },
19
+ corporateEmail: {
20
+ type: String,
21
+ required: true,
22
+ unique: true,
23
+ },
24
+ countryCode: {
25
+ type: String,
26
+ },
27
+ mobileNumber: {
28
+ type: Number,
29
+ required: true,
30
+ },
31
+ planDetails: {
32
+ totalStores: {
33
+ type: String,
34
+ required: true,
35
+ },
36
+ storeSize: {
37
+ type: String,
38
+ required: true,
39
+ },
40
+ totalCamera: {
41
+ type: Number,
42
+ required: true,
43
+ },
44
+ subscriptionPeriod: {
45
+ type: String,
46
+ enum: [ 'monthly', 'quarterly', 'annual' ],
47
+ },
48
+ subscriptionType: {
49
+ type: String,
50
+ enum: [ 'free', 'premium', 'enterprise' ],
51
+ },
52
+ product: {
53
+ type: Array,
54
+ },
55
+
56
+ },
57
+ status: {
58
+ type: String,
59
+ enum: [ 'pending', 'rejected', 'approved' ],
60
+ default: 'pending',
61
+ },
62
+ },
63
+ {
64
+ strict: true,
65
+ versionKey: false,
66
+ timestamps: true,
67
+ },
68
+ );
69
+
70
+ lead.plugin( mongooseUniqueValidator );
71
+ export default mongoose.model( 'lead', lead );
@@ -1,29 +1,29 @@
1
- import uniqueValidator from 'mongoose-unique-validator';
2
- import mongoose from 'mongoose';
3
-
4
- // schema
5
- const collection = new mongoose.Schema( {
6
- email: {
7
- type: String,
8
- trim: true,
9
- unique: true,
10
- },
11
- otp: {
12
- type: Number,
13
- },
14
- type: {
15
- type: String,
16
- enum: [ 'signup' ],
17
- },
18
- },
19
- {
20
- timestamps: true,
21
- strict: true,
22
- versionKey: false,
23
- } );
24
-
25
- collection.plugin( uniqueValidator );
26
- collection.index( { createdAt: 1 }, { expires: '1d' } );
27
- collection.index( { type: 1, email: 1 } );
28
-
1
+ import uniqueValidator from 'mongoose-unique-validator';
2
+ import mongoose from 'mongoose';
3
+
4
+ // schema
5
+ const collection = new mongoose.Schema( {
6
+ email: {
7
+ type: String,
8
+ trim: true,
9
+ unique: true,
10
+ },
11
+ otp: {
12
+ type: Number,
13
+ },
14
+ type: {
15
+ type: String,
16
+ enum: [ 'signup' ],
17
+ },
18
+ },
19
+ {
20
+ timestamps: true,
21
+ strict: true,
22
+ versionKey: false,
23
+ } );
24
+
25
+ collection.plugin( uniqueValidator );
26
+ collection.index( { createdAt: 1 }, { expires: '1d' } );
27
+ collection.index( { type: 1, email: 1 } );
28
+
29
29
  export default mongoose.model( 'otp', collection );
@@ -1,33 +1,30 @@
1
- import { Schema, model } from 'mongoose';
2
-
3
-
4
- const reportschema = new Schema( {
5
- fileName: {
6
- type: String,
7
- required: true,
8
- },
9
- fileType: {
10
- type: String,
11
- required: true,
12
- },
13
- reportName: {
14
- type: String,
15
- },
16
- email: {
17
- type: Array,
18
- required: true,
19
- },
20
- clientId: {
21
- type: String,
22
- },
23
- client: {
24
- type: Schema.Types.ObjectId,
25
- },
26
- },
27
- {
28
- strict: true,
29
- versionKey: false,
30
- timestamps: true,
31
- } );
32
-
33
- export default model( 'report', reportschema );
1
+ import { Schema, model } from 'mongoose';
2
+
3
+
4
+ const reportschema = new Schema( {
5
+ fileName: {
6
+ type: String,
7
+ required: true,
8
+ },
9
+ fileType: {
10
+ type: String,
11
+ required: true,
12
+ },
13
+ reportName: {
14
+ type: String,
15
+ },
16
+ email: {
17
+ type: Array,
18
+ required: true,
19
+ },
20
+ clientId: {
21
+ type: String,
22
+ }
23
+ },
24
+ {
25
+ strict: true,
26
+ versionKey: false,
27
+ timestamps: true,
28
+ } );
29
+
30
+ export default model( 'report', reportschema );
@@ -1,54 +1,54 @@
1
- import mongoose from 'mongoose';
2
-
3
- const roles = new mongoose.Schema(
4
- {
5
- roleName: {
6
- type: String,
7
- enum: [ 'superadmin', 'admin', 'user' ],
8
- },
9
- userType: {
10
- type: String,
11
- enum: [ 'client', 'tango' ],
12
- },
13
- isActive: {
14
- type: Boolean,
15
- default: true,
16
- },
17
- // AssignedUsers: {
18
- // type:Array
19
- // },
20
- permission: [
21
- {
22
- featureName: {
23
- type: String,
24
- },
25
- product: [
26
- {
27
- name: {
28
- type: String,
29
- },
30
- isView: {
31
- type: Boolean,
32
- },
33
- isEdit: {
34
- type: Boolean,
35
- },
36
- isDownload: {
37
- type: Boolean,
38
- },
39
- isDelete: {
40
- type: Boolean,
41
- },
42
- },
43
- ],
44
- },
45
- ],
46
- },
47
- {
48
- strict: true,
49
- versionKey: false,
50
- timestamps: true,
51
- },
52
- );
53
-
54
- export default mongoose.model( 'standaredRoles', roles ,'standaredRoles');
1
+ import mongoose from 'mongoose';
2
+
3
+ const roles = new mongoose.Schema(
4
+ {
5
+ roleName: {
6
+ type: String,
7
+ enum: [ 'superadmin', 'admin', 'user' ],
8
+ },
9
+ userType: {
10
+ type: String,
11
+ enum: [ 'client', 'tango', 'lead' ],
12
+ },
13
+ isActive: {
14
+ type: Boolean,
15
+ default: true,
16
+ },
17
+ // AssignedUsers: {
18
+ // type:Array
19
+ // },
20
+ permission: [
21
+ {
22
+ featureName: {
23
+ type: String,
24
+ },
25
+ product: [
26
+ {
27
+ name: {
28
+ type: String,
29
+ },
30
+ isView: {
31
+ type: Boolean,
32
+ },
33
+ isEdit: {
34
+ type: Boolean,
35
+ },
36
+ isDownload: {
37
+ type: Boolean,
38
+ },
39
+ isDelete: {
40
+ type: Boolean,
41
+ },
42
+ },
43
+ ],
44
+ },
45
+ ],
46
+ },
47
+ {
48
+ strict: true,
49
+ versionKey: false,
50
+ timestamps: true,
51
+ },
52
+ );
53
+
54
+ export default mongoose.model( 'standaredRoles', roles ,'standaredRoles');