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

const subscribeProductsScheme = new mongoose.Schema({
	// shopifyProductId = spId
	// product_id = pId
	// shopify_upload_status =  su_status
	// shopify_price_status = sp_status
	// shopify_inventory_status = si_status
	// date_of_subscription = dos
	// date_of_modification = dom
	// merchant_id = mId
	// tags status = tg_status mf_status 0 for no chnages 1 => updated and 2 for failed
	// metafield_status = mf_status 0 for no chnages 1 => updated and 2 for failed
	// vd is representing varient details 
	// spvid is shopify verient identity
	// ssvid sellercenter varient identity
	// suv_status shopify update varient status 
	// sv_status get products varient id from shopify Status
	// am_status amazon product subscribe status
	// pt_status = product tag status
	//channel
	mId:{
		type:Object
	}, 
	pId:{
		type:Object
	}, 
	spId:{
		type:Object
	},
	vd: {
		type: Array,
	},
	su_status:{
		type:Number,
		default: 0
	},
	sp_status:{
		type:Number,
		default: 0
	}, 
	si_status:{
		type:Number,
		default: 0
	}, 
	mt_status:{
		type:Number,
		default: 0
	},  
	suv_status:{
		type:Number 
	},  
	am_status:{
		type:Number,
		default: 0
	},
	tg_status:{
		type:Number, 
	},  
	img_status:{
		type:Number, 
	}, 
	mf_status:{
		type:Number 
	},  
	error_status:{
		type:Number 
	},  
	pt_status:{
		type:Number 
	},  
	margin:{
		type: Number,  
		default: 0
	},
	dos:{
		type:Date
	},
	dom:{
		type:Date
	},
	[mongooseConstantValues.IS_VARIANT_UPDATE]: {
		type: Number,
		default: 0
	},
	[mongooseConstantValues.SUBSCRIBE_AS_DRAFT]:{
		type: Number,
		default: 0
	},
	channel:{
		type:String
	}
});
module.exports = mongoose.model('SubscribeProducts', subscribeProductsScheme)
