| 1 | const mongoose = require('mongoose'); |
| 2 | |
| 3 | const Quotes = new mongoose.Schema({ |
| 4 | title: String, |
| 5 | description: String, |
| 6 | approvalIssues: String, |
| 7 | billingStreet: String, |
| 8 | billingCity: String, |
| 9 | billingState: String, |
| 10 | billingPostalCode: String, |
| 11 | billingCountry: String, |
| 12 | shippingStreet: String, |
| 13 | shippingCity: String, |
| 14 | shippingState: String, |
| 15 | shippingPostalCode: String, |
| 16 | shippingCountry: String, |
| 17 | validUntil: String, |
| 18 | quoteNumber: String, |
| 19 | lineItems: String, |
| 20 | total: String, |
| 21 | subtotal: String, |
| 22 | discount: String, |
| 23 | tax: String, |
| 24 | ptax: String, |
| 25 | shipping: String, |
| 26 | shippingTax: String, |
| 27 | grandTotal: String, |
| 28 | currency: String, |
| 29 | quoteStage: String, |
| 30 | paymentTerms: String, |
| 31 | terms: String, |
| 32 | description: String, |
| 33 | approvalStatus: String, |
| 34 | invoiceStatus: String, |
| 35 | discountType: String, |
| 36 | items: [], |
| 37 | oppotunity: { |
| 38 | type: mongoose.Schema.Types.ObjectId, |
| 39 | ref: "Opportunities", |
| 40 | }, |
| 41 | account: { |
| 42 | type: mongoose.Schema.Types.ObjectId, |
| 43 | ref: "Accounts", |
| 44 | }, |
| 45 | contact: { |
| 46 | type: mongoose.Schema.Types.ObjectId, |
| 47 | ref: "Contacts", |
| 48 | }, |
| 49 | |
| 50 | assignedTo: { |
| 51 | type: mongoose.Schema.Types.ObjectId, |
| 52 | ref: "User", |
| 53 | }, |
| 54 | createBy: { |
| 55 | type: mongoose.Schema.Types.ObjectId, |
| 56 | ref: 'User', |
| 57 | required: true |
| 58 | }, |
| 59 | modifiedBy: { |
| 60 | type: mongoose.Schema.Types.ObjectId, |
| 61 | ref: 'User', |
| 62 | required: true |
| 63 | }, |
| 64 | isCheck: { |
| 65 | type: Boolean, |
| 66 | default: false, |
| 67 | }, |
| 68 | deleted: { |
| 69 | type: Boolean, |
| 70 | default: false, |
| 71 | }, |
| 72 | updatedDate: { |
| 73 | type: Date, |
| 74 | default: Date.now |
| 75 | }, |
| 76 | createdDate: { |
| 77 | type: Date, |
| 78 | default: Date.now |
| 79 | }, |
| 80 | }) |
| 81 | |
| 82 | module.exports = mongoose.model('Quotes', Quotes, 'Quotes'); |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |