Skip to content

Instantly share code, notes, and snippets.

@jhaashutosh
Created January 11, 2023 14:37
Show Gist options
  • Save jhaashutosh/7ba29a4933a23a194570a17c674dbe5b to your computer and use it in GitHub Desktop.
Save jhaashutosh/7ba29a4933a23a194570a17c674dbe5b to your computer and use it in GitHub Desktop.
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