const mongoose = require('mongoose');
const {mongooseConstantValues} = require('../apps/common/systemConstents')

const csvUploadSchema = mongoose.Schema({
	type:{
		type: Number, 
		// 1 for upload 2 for download 3 for subscribe products , 10 for supplier order csv , 11 for csv product upload , 12 for merchant order download ,13 for merchant add order csv , 14 for merchant update order csv , 15 for merchant subscribe product csv, 101 for inward excel file
	}, 
	cond:{
		type: Array, 
	},
	status:{
		type: Number,
		default: 0 
		// 0 for Process not started 1 for process completed 3 for process failure 
	},
	date:{
		type:Date
	}, 
	spId:{
		type: Object, 
	}, 
	mId:{
		type: Object, 
	}, 
	[mongooseConstantValues.IS_AMAZON_PRODUCT_UPLOADED]:{
		type: Number, 
	}, 
	// spId = supplierId
	url:{
		type: String, 
	},
	resUrl:{
		type: String, 
	},
	page:{
		type: Number, 
	},
	limit : {
		type: Number, 
	},
	merchantId : {
		type: String, 
	},
	localFile : {
		type: String, 
	}
});
module.exports = mongoose.model('CsvUpload', csvUploadSchema)

// cond = Condition