const mongoose = require('mongoose');

const EInvoiceSchema = new mongoose.Schema({
    voucher_type: { type: String },
    invoice_no: { type: String },
    voucher_date: { type: Date },
    party_name: { type: String },
    state_of_supply: { type: String },
    sales_ledger: { type: String },
    item_name: { type: String },
    description_1: { type: String },
    description_2: { type: String, default: '' },
    description_3: { type: String, default: '' },
    description_4: { type: String, default: '' },
    description_5: { type: String, default: '' },
    godown: { type: String },
    quantity: { type: Number },
    rate: { type: Number },
    amount: { type: Number },
    shipping_charge: { type: Number, default: 0 },
    output_igst: { type: Number, default: 0 },
    output_cgst: { type: Number, default: 0 },
    output_sgst: { type: Number, default: 0 },
    packing_charges: { type: Number, default: 0 },
    round_off: { type: Number, default: 0 },
    invoice_total: { type: Number },
    narration: { type: String, default: '' },
    reason_for_issue_note: { type: String, default: '' },
    buyer_debit_note_no: { type: String, default: '' },
    batch_month: { type: String },
    batch_year: { type: String },
    billing_company_name: { type: String },
    date: { type: Date, default: null },
    bill_to_place: { type: String },
    ship_to_place: { type: String },
    invoicenum: { type: Number }
});

module.exports = mongoose.model('EInvoice', EInvoiceSchema);
