tango-api-schema 2.0.105 → 2.0.106
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/index.js +9 -1
- package/package.json +1 -1
- package/schema/assignAudit.model.js +51 -0
- package/schema/audit.model.js +74 -0
- package/schema/auditFilesCount.model.js +44 -0
- package/schema/auditLogs.model.js +73 -0
package/index.js
CHANGED
|
@@ -24,6 +24,10 @@ import dailyPricingModel from "./schema/dailyPricing.model.js";
|
|
|
24
24
|
import fittingModel from './schema/fitting.model.js';
|
|
25
25
|
import qualityCheckModel from './schema/quality.model.js';
|
|
26
26
|
import taggingModel from "./schema/tagging.model.js";
|
|
27
|
+
import auditModel from "./schema/audit.model.js";
|
|
28
|
+
import auditLogsModel from "./schema/auditLogs.model.js";
|
|
29
|
+
import assignAuditModel from "./schema/assignAudit.model.js";
|
|
30
|
+
import auditFilesCountModel from "./schema/auditFilesCount.model.js";
|
|
27
31
|
|
|
28
32
|
export default {
|
|
29
33
|
leadModel,
|
|
@@ -51,5 +55,9 @@ export default {
|
|
|
51
55
|
dailyPricingModel,
|
|
52
56
|
fittingModel,
|
|
53
57
|
qualityCheckModel,
|
|
54
|
-
taggingModel
|
|
58
|
+
taggingModel,
|
|
59
|
+
auditModel,
|
|
60
|
+
assignAuditModel,
|
|
61
|
+
auditLogsModel,
|
|
62
|
+
auditFilesCountModel
|
|
55
63
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name api_audit
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// NPM Modules
|
|
6
|
+
import mongoose from 'mongoose';
|
|
7
|
+
const module = await import(process.env.ENV_PATH )
|
|
8
|
+
const env = module.default
|
|
9
|
+
|
|
10
|
+
// Schema
|
|
11
|
+
const auditUserAssign = new mongoose.Schema( {
|
|
12
|
+
fileId: {
|
|
13
|
+
type: String,
|
|
14
|
+
},
|
|
15
|
+
clientId: {
|
|
16
|
+
type: String,
|
|
17
|
+
},
|
|
18
|
+
fileType: {
|
|
19
|
+
type: String,
|
|
20
|
+
},
|
|
21
|
+
fileDate: {
|
|
22
|
+
type: String,
|
|
23
|
+
},
|
|
24
|
+
fileDateISO: {
|
|
25
|
+
type: Date,
|
|
26
|
+
},
|
|
27
|
+
fileCount: {
|
|
28
|
+
type: Number,
|
|
29
|
+
},
|
|
30
|
+
userId: {
|
|
31
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
32
|
+
ref: 'users',
|
|
33
|
+
},
|
|
34
|
+
queueName: {
|
|
35
|
+
type: String,
|
|
36
|
+
},
|
|
37
|
+
isCompleted: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false,
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
timestamps: true,
|
|
44
|
+
strict: true,
|
|
45
|
+
versionKey: false,
|
|
46
|
+
expires: env.dataModel.expires.assignAudit,
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
export default mongoose.model( 'assignAudit', auditUserAssign, 'assignAudit' );
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name api_audit
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// NPM Modules
|
|
6
|
+
import mongoose from 'mongoose';
|
|
7
|
+
|
|
8
|
+
// Schema
|
|
9
|
+
const auditSchema = new mongoose.Schema( {
|
|
10
|
+
userId: {
|
|
11
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
12
|
+
},
|
|
13
|
+
storeId: {
|
|
14
|
+
type: String,
|
|
15
|
+
},
|
|
16
|
+
userCommands: {
|
|
17
|
+
type: String,
|
|
18
|
+
},
|
|
19
|
+
isDraft: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false,
|
|
22
|
+
},
|
|
23
|
+
auditType: {
|
|
24
|
+
type: String,
|
|
25
|
+
},
|
|
26
|
+
fileDate: {
|
|
27
|
+
type: String,
|
|
28
|
+
},
|
|
29
|
+
timeSpent: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 0,
|
|
32
|
+
},
|
|
33
|
+
startTime: {
|
|
34
|
+
type: Date,
|
|
35
|
+
},
|
|
36
|
+
storeStatus: {
|
|
37
|
+
type: String,
|
|
38
|
+
enum: [ 'completed', 'inprogress', 'not_assign', 'drafted', 'skipped', 'assigned' ],
|
|
39
|
+
default: 'inprogress',
|
|
40
|
+
},
|
|
41
|
+
auditStatus: {
|
|
42
|
+
type: String,
|
|
43
|
+
enum: [ 'inprogress', 'drafted', 'completed', 'skipped' ],
|
|
44
|
+
},
|
|
45
|
+
storeBC: {
|
|
46
|
+
type: Number,
|
|
47
|
+
},
|
|
48
|
+
beforeCount: {
|
|
49
|
+
type: Number,
|
|
50
|
+
},
|
|
51
|
+
afterCount: {
|
|
52
|
+
type: Number,
|
|
53
|
+
},
|
|
54
|
+
clientId: {
|
|
55
|
+
type: String,
|
|
56
|
+
},
|
|
57
|
+
queueName: {
|
|
58
|
+
type: String,
|
|
59
|
+
},
|
|
60
|
+
endTime: {
|
|
61
|
+
type: Date,
|
|
62
|
+
},
|
|
63
|
+
fileDateISO: {
|
|
64
|
+
type: Date,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
timestamps: true,
|
|
69
|
+
strict: true,
|
|
70
|
+
versionKey: false,
|
|
71
|
+
} );
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
export default mongoose.model( 'audit', auditSchema, 'audit' );
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name api_audit
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// NPM Modules
|
|
6
|
+
import mongoose from 'mongoose';
|
|
7
|
+
import mongooseUniqueValidator from 'mongoose-unique-validator';
|
|
8
|
+
|
|
9
|
+
// Schema
|
|
10
|
+
const auditFilesCount = new mongoose.Schema( {
|
|
11
|
+
|
|
12
|
+
clientId: {
|
|
13
|
+
type: String,
|
|
14
|
+
},
|
|
15
|
+
clientName: {
|
|
16
|
+
type: String,
|
|
17
|
+
trim:true
|
|
18
|
+
},
|
|
19
|
+
fileDate: {
|
|
20
|
+
type: String,
|
|
21
|
+
},
|
|
22
|
+
fileDateISO: {
|
|
23
|
+
type: Date,
|
|
24
|
+
},
|
|
25
|
+
queueName: {
|
|
26
|
+
type: String,
|
|
27
|
+
trim:true
|
|
28
|
+
},
|
|
29
|
+
installedStore: {
|
|
30
|
+
type: Number,
|
|
31
|
+
},
|
|
32
|
+
totalFilesCount: {
|
|
33
|
+
type: Number,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
timestamps: true,
|
|
38
|
+
strict: true,
|
|
39
|
+
versionKey: false,
|
|
40
|
+
} );
|
|
41
|
+
|
|
42
|
+
auditFilesCount.plugin( mongooseUniqueValidator );
|
|
43
|
+
|
|
44
|
+
export default mongoose.model( 'auditFilesCount', auditFilesCount, 'auditFilesCount' );
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name api_audit_logs
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// NPM Modules
|
|
6
|
+
import mongoose from 'mongoose';
|
|
7
|
+
|
|
8
|
+
// Schema
|
|
9
|
+
const auditLogs = new mongoose.Schema(
|
|
10
|
+
{
|
|
11
|
+
userId: {
|
|
12
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
13
|
+
},
|
|
14
|
+
storeId: {
|
|
15
|
+
type: String,
|
|
16
|
+
},
|
|
17
|
+
userMsg: {
|
|
18
|
+
type: String,
|
|
19
|
+
},
|
|
20
|
+
auditId: {
|
|
21
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
22
|
+
ref: 'audit',
|
|
23
|
+
},
|
|
24
|
+
auditType: {
|
|
25
|
+
type: String,
|
|
26
|
+
},
|
|
27
|
+
fileDate: {
|
|
28
|
+
type: String,
|
|
29
|
+
},
|
|
30
|
+
clientId: {
|
|
31
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
32
|
+
},
|
|
33
|
+
queueName: {
|
|
34
|
+
type: String,
|
|
35
|
+
},
|
|
36
|
+
totalCount: {
|
|
37
|
+
type: Number,
|
|
38
|
+
},
|
|
39
|
+
junkCount: {
|
|
40
|
+
type: Number,
|
|
41
|
+
},
|
|
42
|
+
junk: {
|
|
43
|
+
type: Array,
|
|
44
|
+
},
|
|
45
|
+
employeeCount: {
|
|
46
|
+
type: Number,
|
|
47
|
+
},
|
|
48
|
+
employee: {
|
|
49
|
+
type: Array,
|
|
50
|
+
},
|
|
51
|
+
customerCount: {
|
|
52
|
+
type: Number,
|
|
53
|
+
},
|
|
54
|
+
customer: {
|
|
55
|
+
type: Array,
|
|
56
|
+
},
|
|
57
|
+
retagImage: {
|
|
58
|
+
type: Array,
|
|
59
|
+
},
|
|
60
|
+
retagCount: {
|
|
61
|
+
type: Number,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
timestamps: true,
|
|
66
|
+
strict: true,
|
|
67
|
+
versionKey: false,
|
|
68
|
+
expires: '2d',
|
|
69
|
+
},
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
export default mongoose.model( 'auditLogs', auditLogs, 'auditLogs' );
|