{"size": 1055, "ext": "js", "max_stars_repo_path": "models/BankSetting.js", "max_stars_repo_name": "Lekens/e-wallet-sytsem", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "models/BankSetting.js", "max_issues_repo_name": "Lekens/e-wallet-sytsem", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "models/BankSetting.js", "max_forks_repo_name": "Lekens/e-wallet-sytsem", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.9791666667, "max_line_length": 105, "alphanum_fraction": 0.6056872038}
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const mongoose_delete = require('mongoose-delete');

const bankSettingSchema = new Schema({
    bank_name: {
        type: String
    },
    bank_code: {
        type: String
    },
    account_number: {
        type: String,
        required: true
    },
    account_name: {
        type: String
    },
    transfer_recipient: {
        type: String
    },
    verified_account_name: {
        type: String
    },
    bvn: {
        type: String,
        // required: true
    },
    verified: {
        type: Boolean,
        default: false
    },
    userId: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'User'
    }
}, {
    timestamps: true
});


bankSettingSchema.plugin(mongoose_delete, { deletedAt : true, deletedBy : true, overrideMethods: true });
bankSettingSchema.index({ userId: 1 }, { unique: true });

const BankSetting = mongoose.model('BankInformation', bankSettingSchema);
// make this available to our Node applications
module.exports = BankSetting;
