zgo/backend/models/owner.js

23 lines
833 B
JavaScript

const mongoose = require('mongoose');
const ownerSchema = mongoose.Schema({
address: {type: String, required:true, unique:true},
name: {type: String, required:true},
currency: {type: String, required:true, default: 'usd'},
tax: {type: Boolean, required: true, default: false},
taxValue: {type: Number },
vat: {type: Boolean, required:true, default: false},
vatValue: {type: Number },
first: {type: String, required:true},
last: {type: String, required:true},
email: {type: String, required:true},
street: {type: String, required:true},
city: {type: String, required: true},
state: {type: String, required: true},
postal: {type: String, required: true},
phone: {type: String},
website: {type: String},
paid: {type: Boolean, required: true, default: false}
});
module.exports = mongoose.model('Owner', ownerSchema);