This commit is contained in:
Paolo Arena
2021-01-18 00:48:17 +01:00
parent 142380e54b
commit 5493953b58
22 changed files with 9749 additions and 231 deletions

View File

@@ -32,234 +32,245 @@ mongoose.plugin(schema => {
mongoose.set('debug', process.env.DEBUG);
const UserSchema = new mongoose.Schema({
userId: {
type: String,
},
email: {
type: String,
required: true,
trim: true,
minlength: 1,
unique: false,
/*validate: {
validator: validator.isEmail,
message: '{VALUE} is not a valid email'
}*/
},
idapp: {
type: String,
required: true,
},
index: {
type: Number
},
ind_order: {
type: Number
},
old_order: {
type: Number
},
username: {
type: String,
required: true,
trim: true,
minlength: 6,
unique: false,
},
name: {
type: String,
trim: true,
},
surname: {
type: String,
trim: true,
},
password: {
type: String,
require: true,
minlength: 6,
},
lang: {
type: String,
require: true,
},
linkreg: {
type: String,
required: false
},
verified_email: {
type: Boolean,
},
made_gift: {
type: Boolean,
},
tokens: [{
access: {
userId: {
type: String,
required: true
},
browser: {
email: {
type: String,
required: true
required: true,
trim: true,
minlength: 1,
unique: false,
/*validate: {
validator: validator.isEmail,
message: '{VALUE} is not a valid email'
}*/
},
token: {
idapp: {
type: String,
required: true
required: true,
},
date_login: {
type: Date
},
}],
perm: {
type: Number
},
ipaddr: {
type: String,
},
date_reg: {
type: Date,
},
date_deleted: {
type: Date,
},
date_tokenforgot: {
type: Date
},
tokenforgot: {
type: String,
},
lasttimeonline: {
type: Date
},
news_on: {
type: Boolean
},
aportador_solidario: { // da cancellare
type: String,
},
aportador_iniziale: {
type: String,
},
aportador_solidario_nome_completo: {
type: String,
},
aportador_solidario_ind_order: {
type: Number,
},
note: {
type: String,
},
deleted: {
type: Boolean,
default: false
},
sospeso: {
type: Boolean
},
non_voglio_imbarcarmi: {
type: Boolean
},
navinonpresenti: {
type: Boolean
},
subaccount: {
type: Boolean
},
cart: {
type: Object
},
profile: {
img: {
type: String
},
nationality: {
type: String
},
intcode_cell: {
type: String
},
iso2_cell: {
type: String
},
cell: {
type: String
},
country_pay: {
type: String
},
email_paypal: {
type: String
},
payeer_id: {
type: String
},
advcash_id: {
type: String
},
revolut: {
type: String
},
link_payment: {
type: String
},
note_payment: {
type: String
},
paymenttypes: [],
username_telegram: {
type: String
},
teleg_id: {
index: {
type: Number
},
teleg_id_old: {
ind_order: {
type: Number
},
teleg_checkcode: {
old_order: {
type: Number
},
manage_telegram: {
type: Boolean
username: {
type: String,
required: true,
trim: true,
minlength: 6,
unique: false,
},
dateofbirth: {
name: {
type: String,
trim: true,
},
surname: {
type: String,
trim: true,
},
password: {
type: String,
require: true,
minlength: 6,
},
lang: {
type: String,
require: true,
},
linkreg: {
type: String,
required: false
},
verified_email: {
type: Boolean,
},
made_gift: {
type: Boolean,
},
tokens: [{
access: {
type: String,
required: true
},
browser: {
type: String,
required: true
},
token: {
type: String,
required: true
},
date_login: {
type: Date
},
}],
perm: {
type: Number
},
ipaddr: {
type: String,
},
date_reg: {
type: Date,
},
my_dream: {
date_deleted: {
type: Date,
},
date_tokenforgot: {
type: Date
},
tokenforgot: {
type: String,
},
saw_and_accepted: {
lasttimeonline: {
type: Date
},
news_on: {
type: Boolean
},
aportador_solidario: { // da cancellare
type: String,
},
aportador_iniziale: {
type: String,
},
aportador_solidario_nome_completo: {
type: String,
},
aportador_solidario_ind_order: {
type: Number,
},
saw_zoom_presentation: {
note: {
type: String,
},
deleted: {
type: Boolean,
default: false
},
sospeso: {
type: Boolean
},
ask_zoom_partecipato: {
non_voglio_imbarcarmi: {
type: Boolean
},
qualified: {
navinonpresenti: {
type: Boolean
},
qualified_2invitati: {
subaccount: {
type: Boolean
},
special_req: {
type: Boolean
cart: {
type: Object
},
sex: {
type: Number,
profile: {
img: {
type: String
},
nationality: {
type: String
},
intcode_cell: {
type: String
},
iso2_cell: {
type: String
},
cell: {
type: String
},
country_pay: {
type: String
},
email_paypal: {
type: String
},
payeer_id: {
type: String
},
advcash_id: {
type: String
},
revolut: {
type: String
},
link_payment: {
type: String
},
note_payment: {
type: String
},
paymenttypes: [],
username_telegram: {
type: String
},
teleg_id: {
type: Number
},
teleg_id_old: {
type: Number
},
teleg_checkcode: {
type: Number
},
manage_telegram: {
type: Boolean
},
dateofbirth: {
type: Date,
},
my_dream: {
type: String,
},
saw_and_accepted: {
type: Number,
},
saw_zoom_presentation: {
type: Boolean
},
ask_zoom_partecipato: {
type: Boolean
},
qualified: {
type: Boolean
},
qualified_2invitati: {
type: Boolean
},
special_req: {
type: Boolean
},
sex: {
type: Number,
},
chisei: {
type: String
},
iltuoimpegno: {
type: String
},
come_aiutare: {
type: String
},
socio: {
type: Boolean,
},
socioresidente: {
type: Boolean,
},
myshares: [{
description: { type: String },
rating: { type: Number },
}]
},
chisei: {
type: String
},
iltuoimpegno: {
type: String
},
come_aiutare: {
type: String
},
},
});
})
;
UserSchema.methods.toJSON = function () {
const user = this;
@@ -1352,7 +1363,7 @@ UserSchema.statics.getUsersListByParams = function (params) {
myclParamQuery = new queryclass.CParamsQuery(params);
const filterMatchBefore = `${ myclParamQuery.filter }`;
const filterMatchBefore = `${myclParamQuery.filter}`;
return User.find(
{ $match: filterMatchBefore },