irongit
117 lines3.3 KBJavaScript
1const mongoose = require('mongoose');
2
3const 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
82module.exports = mongoose.model('Quotes', Quotes, 'Quotes');
83
84
85// Title - "Textfield"
86// Description - "TextArea"
87// Assigned to - "Relationship – Users"
88// Approval Issues - "TextArea"
89// Account - "Relationship – Accounts"
90// Contact - "Relationship – Contacts"
91// Billing Street - "Textfield"
92// Billing City - "Textfield"
93// Billing State - "Textfield"
94// Billing Postal Code - "Textfield"
95// Billing Country - "Textfield"
96// Shipping Street - "Textfield"
97// Shipping City - "Textfield"
98// Shipping State - "Textfield"
99// Shipping Postal Code - "Textfield"
100// Shipping Country - "Textfield"
101// Valid Until - "Date"
102// Quote Number - "Integer"
103// Opportunity - "Relationship – Opportunities"
104// Line Items - "function"
105// Total - "Currency"
106// Subtotal - "Currency"
107// Discount - "Currency"
108// Tax - "Currency"
109// Shipping - "Currency"
110// Shipping Tax - "Drop Down List"
111// Grand Total - "Currency"
112// Currency - "Drop Down List"
113// Quote Stage - "Drop Down List"
114// Payment Terms - "Drop Down List"
115// Terms - "Text Area"
116// Approval Status - "Drop Down List"
117// Invoice Status - "Drop Down List