Accomodations ...
This commit is contained in:
@@ -22,38 +22,28 @@ const MyHospSchema = new Schema({
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
userId: {type: Schema.Types.ObjectId, ref: 'User'},
|
userId: {type: Schema.Types.ObjectId, ref: 'User'},
|
||||||
idSector: {
|
typeHosp: { // scambio casa / ospitalità
|
||||||
type: Number,
|
type: Number,
|
||||||
},
|
},
|
||||||
idSkill: {
|
numMaxPeopleHosp: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
|
||||||
},
|
},
|
||||||
idStatusSkill: [
|
accomodation: [
|
||||||
|
{
|
||||||
|
type: { // Letto matrimoniale / letto singolo / divano-letto / almaca / a terra sul tappeto (per sacco a pelo) / culla
|
||||||
|
type: Number,
|
||||||
|
},
|
||||||
|
location: { // in camera privata / in camera condivisa / in soggiorno / in camper / in tenda / in giardino / all'aperto
|
||||||
|
type: Number,
|
||||||
|
},
|
||||||
|
num: {
|
||||||
|
type: Number,
|
||||||
|
},
|
||||||
|
}],
|
||||||
|
preferences: [ // Accetto bambini, Accetto cani, Accetto gatti, E' consentito fumare in casa, Accessibile con sedia a rotelle
|
||||||
{
|
{
|
||||||
type: Number,
|
type: Number,
|
||||||
}],
|
}],
|
||||||
idContribType: [
|
|
||||||
{
|
|
||||||
type: String,
|
|
||||||
}],
|
|
||||||
idCity: [
|
|
||||||
{
|
|
||||||
type: Number,
|
|
||||||
}],
|
|
||||||
dateTimeStart: {
|
|
||||||
type: Date,
|
|
||||||
},
|
|
||||||
dateTimeEnd: {
|
|
||||||
type: Date,
|
|
||||||
},
|
|
||||||
numLevel: {
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
adType: {
|
|
||||||
type: Number,
|
|
||||||
},
|
|
||||||
photos: [
|
photos: [
|
||||||
{
|
{
|
||||||
imagefile: {
|
imagefile: {
|
||||||
@@ -66,14 +56,21 @@ const MyHospSchema = new Schema({
|
|||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
|
idContribType: [
|
||||||
|
{
|
||||||
|
type: String,
|
||||||
|
}],
|
||||||
|
idCity: [
|
||||||
|
{
|
||||||
|
type: Number,
|
||||||
|
}],
|
||||||
|
descr: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
note: {
|
note: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
descr: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
//**ADDFIELD_MyHospS
|
|
||||||
website: {
|
website: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
@@ -133,7 +130,6 @@ MyHospSchema.statics.getFieldsLastForSearch = function() {
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
MyHospSchema.statics.executeQueryTable = function(idapp, params) {
|
MyHospSchema.statics.executeQueryTable = function(idapp, params) {
|
||||||
params.fieldsearch = this.getFieldsForSearch();
|
params.fieldsearch = this.getFieldsForSearch();
|
||||||
params.fieldsearch_last = this.getFieldsLastForSearch();
|
params.fieldsearch_last = this.getFieldsLastForSearch();
|
||||||
@@ -492,7 +488,6 @@ MyHospSchema.statics.getCompleteRecord = function(idapp, id) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const MyHosp = mongoose.model('MyHosp', MyHospSchema);
|
const MyHosp = mongoose.model('MyHosp', MyHospSchema);
|
||||||
|
|
||||||
module.exports = {MyHosp};
|
module.exports = {MyHosp};
|
||||||
|
|||||||
@@ -2563,6 +2563,9 @@ class Telegram {
|
|||||||
|
|
||||||
const str2 = '\n' + getstr(this.getlang(msg), 'MSG_ASK_USERNAME_INVITANTE', tools.getNomeAppByIdApp(this.idapp));
|
const str2 = '\n' + getstr(this.getlang(msg), 'MSG_ASK_USERNAME_INVITANTE', tools.getNomeAppByIdApp(this.idapp));
|
||||||
|
|
||||||
|
if (msg.from.username)
|
||||||
|
console.log(msg.from.username + ' ha digitato: ' + msg.text);
|
||||||
|
|
||||||
await this.sendMsg(msg.from.id, getstr(this.getlang(msg), 'MSG_ERRORE_INVITANTE_NOT_FOUND') + str2, null);
|
await this.sendMsg(msg.from.id, getstr(this.getlang(msg), 'MSG_ERRORE_INVITANTE_NOT_FOUND') + str2, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3029,7 +3032,7 @@ class Telegram {
|
|||||||
|
|
||||||
const status = this.getstatus(rec);
|
const status = this.getstatus(rec);
|
||||||
if (status === Status.SET_USERNAME_INVITANTE && rec.aportador_solidario) {
|
if (status === Status.SET_USERNAME_INVITANTE && rec.aportador_solidario) {
|
||||||
let linkreg = tools.getLinkRegByIdAppAndMsgStrutt(this.idapp, msg);
|
let linkreg = tools.getLinkRegByIdAppAndMsgStrutt(this.idapp, msg, rec);
|
||||||
|
|
||||||
if (process.env.LOCALE === '1') {
|
if (process.env.LOCALE === '1') {
|
||||||
linkreg = 'http://192.168.1.115:8084/signup/' + rec.aportador_solidario + '/' + msg.from.username + '/' + msg.from.id;
|
linkreg = 'http://192.168.1.115:8084/signup/' + rec.aportador_solidario + '/' + msg.from.username + '/' + msg.from.id;
|
||||||
|
|||||||
@@ -1114,11 +1114,11 @@ module.exports = {
|
|||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
|
|
||||||
getLinkRegByIdAppAndMsgStrutt: function(idapp, msg) {
|
getLinkRegByIdAppAndMsgStrutt: function(idapp, msg, rec) {
|
||||||
|
|
||||||
let myapp = this.getHostByIdApp(idapp);
|
let myapp = this.getHostByIdApp(idapp);
|
||||||
if (myapp) {
|
if (myapp) {
|
||||||
myapp += '/' + msg.from.username + '/' + msg.from.id;
|
myapp += '/signup/' + rec.aportador_solidario + '/' + msg.from.username + '/' + msg.from.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return myapp;
|
return myapp;
|
||||||
|
|||||||
Reference in New Issue
Block a user