Created
January 11, 2023 14:37
-
-
Save jhaashutosh/7ba29a4933a23a194570a17c674dbe5b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require("mongoose"); | |
const billSchema = mongoose.Schema( | |
{ | |
unitId: { | |
type: String, | |
required: true, | |
}, | |
instituteId: { | |
type: String, | |
required: true, | |
}, | |
invoiceNumber: { | |
type: Number, | |
required: true, | |
unique: [true, "Invoice number already exists"], | |
}, | |
placeOfSupply: { | |
type: String, | |
required: true, | |
}, | |
instituteCode: { | |
type: String, | |
required: true, | |
}, | |
dateOfBillGeneration: { | |
type: Date, | |
required: true, | |
}, | |
dateOfSupply: { | |
type: Date, | |
required: true, | |
}, | |
timeOfSupply: { | |
type: String, | |
required: true, | |
}, | |
quantity: { | |
type: Number, | |
required: true, | |
}, | |
rate: { | |
type: Number, | |
required: true, | |
}, | |
taxableAmount: { | |
type: Number, | |
required: true, | |
}, | |
totalAmount: { | |
type: Number, | |
required: true, | |
}, | |
}, | |
{ | |
timestamps: true, | |
} | |
); | |
module.exports = mongoose.model("Bill", billSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment