Accomodations ...

This commit is contained in:
Paolo Arena
2022-05-05 23:56:37 +02:00
parent b340d39348
commit fa9c6f1c6b
3 changed files with 32 additions and 34 deletions

View File

@@ -22,38 +22,28 @@ const MyHospSchema = new Schema({
required: true,
},
userId: {type: Schema.Types.ObjectId, ref: 'User'},
idSector: {
typeHosp: { // scambio casa / ospitalità
type: Number,
},
idSkill: {
numMaxPeopleHosp: {
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,
}],
idContribType: [
{
type: String,
}],
idCity: [
{
type: Number,
}],
dateTimeStart: {
type: Date,
},
dateTimeEnd: {
type: Date,
},
numLevel: {
type: Number,
default: 0,
},
adType: {
type: Number,
},
photos: [
{
imagefile: {
@@ -66,14 +56,21 @@ const MyHospSchema = new Schema({
type: String,
},
}],
idContribType: [
{
type: String,
}],
idCity: [
{
type: Number,
}],
descr: {
type: String,
},
note: {
type: String,
default: '',
},
descr: {
type: String,
},
//**ADDFIELD_MyHospS
website: {
type: String,
},
@@ -133,7 +130,6 @@ MyHospSchema.statics.getFieldsLastForSearch = function() {
];
};
MyHospSchema.statics.executeQueryTable = function(idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
params.fieldsearch_last = this.getFieldsLastForSearch();
@@ -492,7 +488,6 @@ MyHospSchema.statics.getCompleteRecord = function(idapp, id) {
};
const MyHosp = mongoose.model('MyHosp', MyHospSchema);
module.exports = {MyHosp};

View File

@@ -2563,6 +2563,9 @@ class Telegram {
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);
}
}
@@ -3029,7 +3032,7 @@ class Telegram {
const status = this.getstatus(rec);
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') {
linkreg = 'http://192.168.1.115:8084/signup/' + rec.aportador_solidario + '/' + msg.from.username + '/' + msg.from.id;

View File

@@ -1114,11 +1114,11 @@ module.exports = {
return '';
},
getLinkRegByIdAppAndMsgStrutt: function(idapp, msg) {
getLinkRegByIdAppAndMsgStrutt: function(idapp, msg, rec) {
let myapp = this.getHostByIdApp(idapp);
if (myapp) {
myapp += '/' + msg.from.username + '/' + msg.from.id;
myapp += '/signup/' + rec.aportador_solidario + '/' + msg.from.username + '/' + msg.from.id;
}
return myapp;