const mongoose = require('mongoose');

const WInwardSchema = mongoose.Schema({
	 
	inv_number:{
       type: String,
	   default: null
	},
	cff_orderno:{
		type: String, 
		default: null
	},
	refund_reason :{
     type: String,
	 default :null,
	},
	order_status:{
		type: Number, 
		// initialize = 0, dispatch_from_warehouse = 1, in-transite = 2, deliever = 3, rto = 4, return = 5, qc = 6, in stock = 7, damage = 8, refund = 9, invoiced = 10, cancel before dispatch = 11, cancelled by china = 12, shipped = 13, deleiverd =14
		},
	// spId:{
	// 	type: Object, 
	// }, 
	i_orderno:{
		type: String,
		default: null
	},
	s_orderno:{
		type: String, 
		default: null
	}, 
	description:{
		type: String, 
		default: null
	},
	qty:{
		type: Number, 
		default: null
	},
	receiveQty:{
		type: Number, 
		default: null
	},
	returnDamagedQty:{
		type: Number, 
		default: 0
	},
	returnSaleableQty:{
		type: Number, 
		default: 0
	},
	returnNonSaleableQty:{
		type: Number, 
		default: 0
	},
	unitPrice:{
		type: Number, 
		default: null
	},
	totalPrice : {
		type: Number, 
		default: null
	},
	orderUnitPrice:{
		type: Number, 
		default: null
	},
	OrderTotalPrice : {
		type: Number, 
		default: null
	},
	safetyClaimAmt:{
		type: Number, 
		default: null
	},
	safetyClaimApprovedAmt : {
		type: Number, 
		default: null
	},
	rmbPrice : {
		type: Number, 
		default: null
	}, 
	sku:{
		type: String, 
		default: null
	}, 
	code:{
		type: String, 
		default: null
	},
	spID:{
		type: Object, 
		default: null
	},
	returnReason:{
		type: String, 
		default: null
	},
	remark:{
		type: String, 
		default: null
	},
	qc:{
		type: String, 
		default: null
	},
	claim:{
		type: Number, 
		default: null
	},
	type:{
		type: String, 
		default: null
	},
	account_name:{
		type: String,
		default: null
	},
	rto_awb:{
		type: String, 
		default: null
	},
	return_awb:{
		type: String,
		default: null
	},
	return_type:{
		type: String,
		default: null
	},
	orderId:{
		type: Object, 
		default: null
	},
	orderSerial:{
		type: String, 
		default: null
	},
	mkpOrderId:{
		type: String, 
		default: null
	}, 
	sfcInvoiceNo:{
		type: String, 
		default: null
	}, 
	orderDate:{
		type: Date, 
		default: null
	}, 
	shipDate:{
		type: Date, 
		default: null
	},
	invoiceDate:{
		type: Date, 
		default: null
	},
	refund_date:{
		type: Date, 
		default: null
	},
	created_date:{
		type:Date,
		default: null
	}, 
	dispatch_date:{
		type: Date, 
		default: null
	},
	cancel_date:{
		type: Date, 
		default: null
	},
	cancel_before_dispatch:{
		type: Date, 
		default: null
	},
	rto_date:{
		type: Date, 
		default: null
	},
	return_date:{
		type: Date, 
		default: null
	},
	ticketed_date:{
		type: Date, 
		default: null
	},
	deleivered_date:{
		type: Date, 
		default: null
	},
	received_scan_date:{
		type: Date, 
		default: null
	},
	safety_claim_date:{
		type: Date, 
		default: null
	},
	last_update:{
		type: Date, 
		default: Date.now
	},
	received_safety_claim_date:{
		type: Date, 
		default: null
	},
	declined_safety_claim_date:{
		type: Date, 
		default: null
	},
	cancelled_by_china:{
		type: Date, 
		default: null
	},
	ship_phone:{
		type: String,
		default: null
	},
	trackingId:{
		type: String,
		default: null
	},
	courierName:{
		type: String,
		default: null
	},
	sellerId:{
		type: String,
		default: null
	},
	processBy:{
		type: Number,
		// 0 = India, 1 = China, 3 = Bulk, 4 = China1
	},
	weight:{
		type: String,
		default: null
	},
	saleableQty:{
        type:Number,
        default: 0
    },
    nonSaleableQty:{
        type:Number,
        default: 0
    },
    damageQty:{
        type:Number,
        default: 0
    },
	packingDimension:{
		type: String,
		default: null
	},
	couriorPartnerappweight:{
		type: String,
		default: null
	},
	china1:{
		type: Number,
		default: 0
	},
	china2:{
			type: Number,
			default: 0
		},
	china3:{
			type: Number,
			default: 0
		}
});
module.exports = mongoose.model('WInward', WInwardSchema)

// cond = Condition
