Compare commits
237 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8872d69f8 | ||
|
|
aad7822cfd | ||
|
|
fea61fda7d | ||
|
|
b1ff0ee3b7 | ||
|
|
87808caadf | ||
|
|
1d5002ea0f | ||
|
|
3b1b2b9c83 | ||
|
|
54443e784e | ||
|
|
6834dd1d55 | ||
|
|
3fcff43af0 | ||
|
|
07973fbf0a | ||
|
|
e1f2e799d6 | ||
|
|
2cdb83cddf | ||
|
|
7773c2a87b | ||
|
|
c79f6e8cc6 | ||
|
|
49ecb3edea | ||
|
|
68b4403138 | ||
|
|
11955b3242 | ||
|
|
e6009f66b9 | ||
|
|
e8cd676eef | ||
|
|
3e8be18473 | ||
|
|
c2d76ff10a | ||
|
|
07c210c59e | ||
|
|
3221cf8d25 | ||
|
|
fef8d0fbc7 | ||
|
|
970428a359 | ||
|
|
de13c42f8b | ||
|
|
39687265c8 | ||
|
|
bf1e9b83ba | ||
|
|
22771c1ea7 | ||
|
|
bd95e4457f | ||
|
|
3e0d0bf018 | ||
|
|
44b25fdf33 | ||
|
|
c94d5dc844 | ||
|
|
b5dbaafa91 | ||
|
|
789e3fde41 | ||
|
|
1017a3dfe2 | ||
|
|
b60f0f9e34 | ||
|
|
e809195f60 | ||
|
|
da9d5f25ea | ||
|
|
4a980aaad2 | ||
|
|
6ff9922a29 | ||
|
|
3191312372 | ||
|
|
204a625e06 | ||
|
|
9a83efaa3c | ||
|
|
6d8a5ae137 | ||
|
|
1268c961cf | ||
|
|
8c471c0e81 | ||
|
|
e6fd8e1fed | ||
|
|
1c31543af8 | ||
|
|
5a6c08e908 | ||
|
|
6e61138fde | ||
|
|
24f2b46cc8 | ||
|
|
26ab024514 | ||
|
|
9ca9ea6eaa | ||
|
|
e7b0fd1d95 | ||
|
|
acbc23e92d | ||
|
|
dacfc5a844 | ||
|
|
2151502d30 | ||
|
|
64bd3cebb3 | ||
|
|
9fe81713e5 | ||
|
|
0c2a8ecef5 | ||
|
|
aeabf96efe | ||
|
|
e4504bcf9e | ||
|
|
dbcdbd689b | ||
|
|
f6a0876178 | ||
|
|
1ef3103a9d | ||
|
|
d7122af70e | ||
|
|
3d1a330fa2 | ||
|
|
a2c9dcb38c | ||
|
|
d22e808626 | ||
|
|
9265e9bfb3 | ||
|
|
504e9fd88c | ||
|
|
4b9fe4d267 | ||
|
|
d81f533ecb | ||
|
|
65d75cb2c5 | ||
|
|
212f895650 | ||
|
|
3183825137 | ||
|
|
79ca364e84 | ||
|
|
7bf549569d | ||
|
|
c63e345285 | ||
|
|
9b4a9dbf28 | ||
|
|
a71c487697 | ||
|
|
3dfb990620 | ||
|
|
4cdc4f7de1 | ||
|
|
7ea6c2a76b | ||
|
|
db81980046 | ||
|
|
fb16a1729e | ||
|
|
d7ae8baec4 | ||
|
|
b754492b41 | ||
|
|
0aaa331b3f | ||
|
|
66e4c577c7 | ||
|
|
75ef581635 | ||
|
|
4e0c18f47c | ||
|
|
3fb78ff39a | ||
|
|
6313476d54 | ||
|
|
b6204c7612 | ||
|
|
ade9c149c5 | ||
|
|
633b9a2d8c | ||
|
|
3d1dddba39 | ||
|
|
db7724cca4 | ||
|
|
5afe9dd1e2 | ||
|
|
c001587702 | ||
|
|
ca6d29414a | ||
|
|
f23047bcd5 | ||
|
|
15d831eecc | ||
|
|
f0495d93b3 | ||
|
|
0eb287db06 | ||
|
|
322bfb9738 | ||
|
|
428a5ca0e9 | ||
|
|
000e900f48 | ||
|
|
2ab4bd4e2a | ||
|
|
7af909d2be | ||
|
|
0e1fc359a0 | ||
|
|
d00c7eccc8 | ||
|
|
7e7d7ca6b4 | ||
|
|
a3913a4575 | ||
|
|
7628fb97fc | ||
|
|
56b5bac5f0 | ||
|
|
e7021e1f14 | ||
|
|
139d7ea33c | ||
|
|
50d610b1b1 | ||
|
|
c71f4af370 | ||
|
|
4290895a97 | ||
|
|
ab3a31d4fb | ||
|
|
1ca72118f1 | ||
|
|
4d9eccd1ae | ||
|
|
05ec283882 | ||
|
|
ea2b7095c9 | ||
|
|
d0bf7e1b6a | ||
|
|
fcdd826c54 | ||
|
|
a2bd4f6e97 | ||
|
|
5f3c8a65ea | ||
|
|
caadbaae5f | ||
|
|
296b7b4fb8 | ||
|
|
ff81ab7be3 | ||
|
|
8ce4f66c55 | ||
|
|
daacde7455 | ||
|
|
023ba26003 | ||
|
|
502ed32c42 | ||
|
|
74c4a829b0 | ||
|
|
f7bcb0c361 | ||
|
|
72a7e3fa37 | ||
|
|
4871c2d868 | ||
|
|
d5bc76335f | ||
|
|
6edba03eff | ||
|
|
8e42baf79e | ||
|
|
e3ed2934ee | ||
|
|
e895e7dae2 | ||
|
|
4a408b4ebd | ||
|
|
0e3ba5ff87 | ||
|
|
a66cd610dd | ||
|
|
d61808d1dd | ||
|
|
5aa6accfc5 | ||
|
|
35178684af | ||
|
|
bba0df4302 | ||
|
|
f1954d98d6 | ||
|
|
34b00bdf98 | ||
|
|
0cfabed233 | ||
|
|
c92dc8f216 | ||
|
|
7b14c09fd5 | ||
|
|
2258e8e7e1 | ||
|
|
e8c961f500 | ||
|
|
b395d1a30a | ||
|
|
341af6a3b2 | ||
|
|
3d876687b6 | ||
|
|
560a532a85 | ||
|
|
aac8ce0a4c | ||
|
|
d434374ed9 | ||
|
|
045057082c | ||
|
|
18c5630a45 | ||
|
|
7f1bd15bcf | ||
|
|
c1a9a9a555 | ||
|
|
536fbd1752 | ||
|
|
d6303f5880 | ||
|
|
b6579832b6 | ||
|
|
04c8e929ee | ||
|
|
142dcadca9 | ||
|
|
ad6b4c2bfa | ||
|
|
ba81a33c88 | ||
|
|
baf56b59d0 | ||
|
|
3393af36aa | ||
|
|
95a812f002 | ||
|
|
aff50b03d4 | ||
|
|
e28cd5f043 | ||
|
|
9e499b8f43 | ||
|
|
84328e7bcd | ||
|
|
a79e79a85e | ||
|
|
0945f1af08 | ||
|
|
eea6e63c58 | ||
|
|
cda0bff21f | ||
|
|
cada7aa0b6 | ||
|
|
f13786fca1 | ||
|
|
5bb6611384 | ||
|
|
0d5bff5849 | ||
|
|
198b5914bc | ||
|
|
94ef2c4c85 | ||
|
|
8a77dabc22 | ||
|
|
6d1ad4132f | ||
|
|
e92edcbe78 | ||
|
|
561bab57a8 | ||
|
|
00e9aafd4c | ||
|
|
5993112a8e | ||
|
|
7482b65743 | ||
|
|
e705594294 | ||
|
|
6a4c270c91 | ||
|
|
39cc9b66d6 | ||
|
|
4effda98ec | ||
|
|
84ceed500d | ||
|
|
0076adac76 | ||
|
|
874114942a | ||
|
|
a81300e13d | ||
|
|
81d7d32b85 | ||
|
|
402a9c373e | ||
|
|
6e7eb31d38 | ||
|
|
022ad11747 | ||
|
|
7bf6f91a97 | ||
|
|
2d213b7020 | ||
|
|
aa9d27c8fd | ||
|
|
9a0f0a0cc6 | ||
|
|
5f3ce44a68 | ||
|
|
73aa780733 | ||
|
|
b9e4dbbaec | ||
|
|
8e7b9fb5bd | ||
|
|
f7d05eb856 | ||
|
|
e13fe84709 | ||
|
|
dd51982795 | ||
|
|
a4b42a1fc3 | ||
|
|
331c2e6780 | ||
|
|
399153f477 | ||
|
|
d1135f1151 | ||
|
|
d183a07bad | ||
|
|
f42a39d231 | ||
|
|
dd1c9d573f | ||
|
|
18b827f5f4 | ||
|
|
7a41e6a1d4 | ||
|
|
7e1407cbb1 |
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@@ -0,0 +1,4 @@
|
||||
./node_modules
|
||||
Dockerfile
|
||||
.dockerignore
|
||||
docker-compose.yml
|
||||
41
.env.dev.pcb
Normal file
41
.env.dev.pcb
Normal file
@@ -0,0 +1,41 @@
|
||||
DATABASE=test_PiuCheBuono
|
||||
UDB=paofreeplanet
|
||||
PDB=mypassword@1A
|
||||
SEND_EMAIL=0
|
||||
SEND_EMAIL_ORDERS=1
|
||||
PORT=3000
|
||||
appTelegram_TEST=["1","17","18"]
|
||||
appTelegram=["1","17","18"]
|
||||
DOMAIN=mongodb://localhost:27017/
|
||||
AUTH_MONGODB=1
|
||||
MONGODB_USER=admin
|
||||
MONGODB_PWD=mypwadmin@1A
|
||||
ENABLE_PUSHNOTIFICATION=1
|
||||
URLBASE_APP1=https://localhost
|
||||
PORT_APP1=8080
|
||||
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
|
||||
HTTPS_LOCALHOST=true
|
||||
DEBUG=0
|
||||
DEBUG=0
|
||||
TESTING_ON=1
|
||||
LOCALE=1
|
||||
DELAY_SENDEMAIL=2000
|
||||
VAPI_KEY_SUBJECT=mailto:paolo@freeplanet.app
|
||||
PUBLIC_VAPI_KEY=BDncvMiUZmjaCG2Kr1V9N0_33hOG-AuNSbHSvL24y2dzBiUjAxKm02emx5SeJvz2IGmtRf6YqCgopeQwCwUmZw8
|
||||
PRIVATE_VAPI_KEY=uB2-jQkrbysyDtqN3ziMBDsVn0wdEaDsksX81zoOGQo
|
||||
PATH_CERT_KEY=localhost.key
|
||||
PATH_SERVER_CRT=localhost.crt
|
||||
PATH_SSL_ROOT_PEM=root.pem
|
||||
PATH_SSL_CHAIN_PEM=chain.pem
|
||||
GCM_API_KEY=""
|
||||
PROD=0
|
||||
PROJECT_DESCR_MAIN='__PROJECTS'
|
||||
SECRK=Askb38v23jjDFaoskBOWj92axXCQ
|
||||
SECRTK=prova123prova567ASDADASDAS
|
||||
TOKEN_LIFE=2h
|
||||
REFRESH_TOKEN_LIFE=14d
|
||||
FTPSERVER_HOST=139.162.166.31
|
||||
FTPSERVER_PORT=21
|
||||
FTPSERVER_USER=ftpusrsrv_
|
||||
FTPSERVER_PWD=ftpmypwd@1A_
|
||||
AUTH_NEW_SITES=123123123
|
||||
41
.env.dev.riso
Normal file
41
.env.dev.riso
Normal file
@@ -0,0 +1,41 @@
|
||||
DATABASE=test_FreePlanet
|
||||
UDB=paofreeplanet
|
||||
PDB=mypassword@1A
|
||||
SEND_EMAIL=0
|
||||
SEND_EMAIL_ORDERS=1
|
||||
PORT=3000
|
||||
appTelegram_TEST=["1","13"]
|
||||
appTelegram=["1","13"]
|
||||
DOMAIN=mongodb://localhost:27017/
|
||||
AUTH_MONGODB=1
|
||||
MONGODB_USER=admin
|
||||
MONGODB_PWD=mypwadmin@1A
|
||||
ENABLE_PUSHNOTIFICATION=1
|
||||
URLBASE_APP1=https://localhost
|
||||
PORT_APP1=8080
|
||||
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
|
||||
HTTPS_LOCALHOST=true
|
||||
DEBUG=0
|
||||
DEBUG=0
|
||||
TESTING_ON=1
|
||||
LOCALE=1
|
||||
DELAY_SENDEMAIL=2000
|
||||
VAPI_KEY_SUBJECT=mailto:paolo@freeplanet.app
|
||||
PUBLIC_VAPI_KEY=BDncvMiUZmjaCG2Kr1V9N0_33hOG-AuNSbHSvL24y2dzBiUjAxKm02emx5SeJvz2IGmtRf6YqCgopeQwCwUmZw8
|
||||
PRIVATE_VAPI_KEY=uB2-jQkrbysyDtqN3ziMBDsVn0wdEaDsksX81zoOGQo
|
||||
PATH_CERT_KEY=localhost.key
|
||||
PATH_SERVER_CRT=localhost.crt
|
||||
PATH_SSL_ROOT_PEM=root.pem
|
||||
PATH_SSL_CHAIN_PEM=chain.pem
|
||||
GCM_API_KEY=""
|
||||
PROD=0
|
||||
PROJECT_DESCR_MAIN='__PROJECTS'
|
||||
SECRK=Askb38v23jjDFaoskBOWj92axXCQ
|
||||
SECRTK=prova123prova567ASDADASDAS
|
||||
TOKEN_LIFE=2h
|
||||
REFRESH_TOKEN_LIFE=14d
|
||||
FTPSERVER_HOST=139.162.166.31
|
||||
FTPSERVER_PORT=21
|
||||
FTPSERVER_USER=ftpusrsrv_
|
||||
FTPSERVER_PWD=ftpmypwd@1A_
|
||||
AUTH_NEW_SITES=123123123
|
||||
41
.env.development
Normal file
41
.env.development
Normal file
@@ -0,0 +1,41 @@
|
||||
DATABASE=test_FreePlanet
|
||||
UDB=paofreeplanet
|
||||
PDB=mypassword@1A
|
||||
SEND_EMAIL=0
|
||||
SEND_EMAIL_ORDERS=1
|
||||
PORT=3000
|
||||
appTelegram_TEST=["1","13"]
|
||||
appTelegram=["1","13"]
|
||||
DOMAIN=mongodb://localhost:27017/
|
||||
AUTH_MONGODB=1
|
||||
MONGODB_USER=admin
|
||||
MONGODB_PWD=mypwadmin@1A
|
||||
ENABLE_PUSHNOTIFICATION=1
|
||||
URLBASE_APP1=https://localhost
|
||||
PORT_APP1=8080
|
||||
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
|
||||
HTTPS_LOCALHOST=true
|
||||
DEBUG=0
|
||||
DEBUG=0
|
||||
TESTING_ON=1
|
||||
LOCALE=1
|
||||
DELAY_SENDEMAIL=2000
|
||||
VAPI_KEY_SUBJECT=mailto:paolo@freeplanet.app
|
||||
PUBLIC_VAPI_KEY=BDncvMiUZmjaCG2Kr1V9N0_33hOG-AuNSbHSvL24y2dzBiUjAxKm02emx5SeJvz2IGmtRf6YqCgopeQwCwUmZw8
|
||||
PRIVATE_VAPI_KEY=uB2-jQkrbysyDtqN3ziMBDsVn0wdEaDsksX81zoOGQo
|
||||
PATH_CERT_KEY=localhost.key
|
||||
PATH_SERVER_CRT=localhost.crt
|
||||
PATH_SSL_ROOT_PEM=root.pem
|
||||
PATH_SSL_CHAIN_PEM=chain.pem
|
||||
GCM_API_KEY=""
|
||||
PROD=0
|
||||
PROJECT_DESCR_MAIN='__PROJECTS'
|
||||
SECRK=Askb38v23jjDFaoskBOWj92axXCQ
|
||||
SECRTK=prova123prova567ASDADASDAS
|
||||
TOKEN_LIFE=2h
|
||||
REFRESH_TOKEN_LIFE=14d
|
||||
FTPSERVER_HOST=139.162.166.31
|
||||
FTPSERVER_PORT=21
|
||||
FTPSERVER_USER=ftpusrsrv_
|
||||
FTPSERVER_PWD=ftpmypwd@1A_
|
||||
AUTH_NEW_SITES=123123123
|
||||
35
.env.prod.pcb
Normal file
35
.env.prod.pcb
Normal file
@@ -0,0 +1,35 @@
|
||||
DATABASE=PiuCheBuono
|
||||
UDB=paofreeplanet
|
||||
PDB=suerteFreePlanet@1A
|
||||
SEND_EMAIL=1
|
||||
SEND_EMAIL_ORDERS=1
|
||||
PORT=3000
|
||||
appTelegram_TEST=["17","18"]
|
||||
appTelegram=["17","18"]
|
||||
ENABLE_PUSHNOTIFICATION=1
|
||||
DIRECTORY_SERVER=freeplanet_serverside
|
||||
SERVERDIR_WEBSITE=www.freeplanet_server
|
||||
PORT_APP1="0"
|
||||
DOMAIN=mongodb://localhost:32001/
|
||||
AUTH_MONGODB=1
|
||||
MONGODB_USER=admin
|
||||
MONGODB_PWD=mypwadminREAL@1A
|
||||
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
|
||||
DEBUG=0
|
||||
LOCALE=0
|
||||
DELAY_SENDEMAIL=1000
|
||||
VAPI_KEY_SUBJECT="mailto:surya@riso.app"
|
||||
PUBLIC_VAPI_KEY="BJgo8XR_upbnbMLWgCAUELo6DK7dRXffYAnFOxbaMMz5favBgcQBKT-eISqouO-jRad4Sw8l5nd2wCF6KorGiTc"
|
||||
PRIVATE_VAPI_KEY="LVpFDJuKscdHuQr5pe20dFuYuWX1-ZRb6x72PP-Pp4I"
|
||||
GCM_API_KEY="AIzaSyD7w1jztfVV05mX1iyxoI-r1pZWxuxdUK8"
|
||||
PATH_CERT_KEY=key.pem
|
||||
PATH_SERVER_CRT=cert.pem
|
||||
PATH_SSL_ROOT_PEM=root.pem
|
||||
PATH_SSL_CHAIN_PEM=chain.pem
|
||||
PROD=0
|
||||
PROJECT_DESCR_MAIN='__PROJECTS'
|
||||
SECRK=iUUb38v23jjDFaosWj92axkBOXCQ
|
||||
SECRTK=jAxKm02emx5SeJvz2IGmtRf6YqCgope
|
||||
TOKEN_LIFE=2h
|
||||
REFRESH_TOKEN_LIFE=14d
|
||||
AUTH_NEW_SITES=B234HDSAOJ734ndcsdKWNVZZ
|
||||
34
.env.test.pcb
Normal file
34
.env.test.pcb
Normal file
@@ -0,0 +1,34 @@
|
||||
DATABASE=test_PiuCheBuono
|
||||
UDB=paofreeplanet
|
||||
PDB=suerteFreePlanet@1A
|
||||
SEND_EMAIL=1
|
||||
SEND_EMAIL_ORDERS=1
|
||||
PORT=3001
|
||||
appTelegram_TEST=["17","18"]
|
||||
appTelegram=["17","18"]
|
||||
ENABLE_PUSHNOTIFICATION=1
|
||||
DIRECTORY_SERVER=freeplanet_serverside
|
||||
SERVERDIR_WEBSITE=test.freeplanet_server
|
||||
PORT_APP1="0"
|
||||
DOMAIN=mongodb://localhost:32002/
|
||||
AUTH_MONGODB=1
|
||||
MONGODB_USER=admin
|
||||
MONGODB_PWD=mypwadmin@1A
|
||||
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
|
||||
DEBUG=0
|
||||
LOCALE=0
|
||||
DELAY_SENDEMAIL=1000
|
||||
VAPI_KEY_SUBJECT="mailto:surya@riso.app"
|
||||
PUBLIC_VAPI_KEY="BJgo8XR_upbnbMLWgCAUELo6DK7dRXffYAnFOxbaMMz5favBgcQBKT-eISqouO-jRad4Sw8l5nd2wCF6KorGiTc"
|
||||
PRIVATE_VAPI_KEY="LVpFDJuKscdHuQr5pe20dFuYuWX1-ZRb6x72PP-Pp4I"
|
||||
GCM_API_KEY="AIzaSyD7w1jztfVV05mX1iyxoI-r1pZWxuxdUK8"
|
||||
PATH_CERT_KEY=key.pem
|
||||
PATH_SERVER_CRT=cert.pem
|
||||
PATH_SSL_ROOT_PEM=root.pem
|
||||
PATH_SSL_CHAIN_PEM=chain.pem
|
||||
PROD=0
|
||||
PROJECT_DESCR_MAIN='__PROJECTS'
|
||||
SECRK=iUUb38v23jjDFaosWj92axkBOXCQ
|
||||
TOKEN_LIFE=2h
|
||||
REFRESH_TOKEN_LIFE=14d
|
||||
AUTH_NEW_SITES=B234HDSAOJ734ndcsdKWNV
|
||||
31
.env.test.risosrv
Normal file
31
.env.test.risosrv
Normal file
@@ -0,0 +1,31 @@
|
||||
DATABASE=test_FreePlanet
|
||||
UDB=paofreeplanet
|
||||
PDB=suerteFreePlanet@1A
|
||||
SEND_EMAIL=1
|
||||
PORT=3001
|
||||
ENABLE_PUSHNOTIFICATION=1
|
||||
DIRECTORY_SERVER=/var/www/testriso.freeplanet_serverside
|
||||
SERVERDIR_WEBSITE=testriso.piuchebuono.app
|
||||
PORT_APP1="0"
|
||||
DOMAIN=mongodb://localhost:32002/
|
||||
AUTH_MONGODB=1
|
||||
MONGODB_USER=admin
|
||||
MONGODB_PWD=mypwadmin@1A
|
||||
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
|
||||
DEBUG=0
|
||||
LOCALE=0
|
||||
DELAY_SENDEMAIL=1000
|
||||
VAPI_KEY_SUBJECT="mailto:surya@riso.app"
|
||||
PUBLIC_VAPI_KEY="BGXRf1TgcqocqD6J7qnRgCG7AvM2lxAoW7peb7UEzB4SxBb6DxGRdJ0UvD9ewnrB9KrSrh0-aDCODXBm7sZ1DDs"
|
||||
PRIVATE_VAPI_KEY="St9UMzcS76Q9yKG6RInAuYydYjFRliqwHTJY3A5wjO0"
|
||||
GCM_API_KEY="AIzaSyD7w1jztfVV05mX1iyxoI-r1pZWxuxdUK8"
|
||||
PATH_CERT_KEY=key.pem
|
||||
PATH_SERVER_CRT=cert.pem
|
||||
PATH_SSL_ROOT_PEM=root.pem
|
||||
PATH_SSL_CHAIN_PEM=chain.pem
|
||||
PROD=0
|
||||
PROJECT_DESCR_MAIN='__PROJECTS'
|
||||
SECRK=iUUb38v23jjDFaosWj92axkBOXCQ
|
||||
TOKEN_LIFE=2h
|
||||
REFRESH_TOKEN_LIFE=14d
|
||||
AUTH_NEW_SITES=B234HDSAOJ734ndcsdKWNV
|
||||
32
.env.test2
Normal file
32
.env.test2
Normal file
@@ -0,0 +1,32 @@
|
||||
DATABASE=test_FreePlanet
|
||||
UDB=paofreeplanet
|
||||
PDB=suerteFreePlanet@1A
|
||||
SEND_EMAIL=1
|
||||
PORT=3001
|
||||
ENABLE_PUSHNOTIFICATION=1
|
||||
DIRECTORY_SERVER=freeplanet_serverside
|
||||
SERVERDIR_WEBSITE=test2.freeplanet_server
|
||||
URLBASE_APP1=https://test2.riso.app
|
||||
PORT_APP1="0"
|
||||
DOMAIN=mongodb://localhost:27018/
|
||||
AUTH_MONGODB=1
|
||||
MONGODB_USER=admin
|
||||
MONGODB_PWD=mypwadmin@1A
|
||||
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
|
||||
DEBUG=0
|
||||
LOCALE=0
|
||||
DELAY_SENDEMAIL=1000
|
||||
VAPI_KEY_SUBJECT="mailto:paolo@freeplanet.app"
|
||||
PUBLIC_VAPI_KEY="BGXRf1TgcqocqD6J7qnRgCG7AvM2lxAoW7peb7UEzB4SxBb6DxGRdJ0UvD9ewnrB9KrSrh0-aDCODXBm7sZ1DDs"
|
||||
PRIVATE_VAPI_KEY="St9UMzcS76Q9yKG6RInAuYydYjFRliqwHTJY3A5wjO0"
|
||||
GCM_API_KEY="AIzaSyD7w1jztfVV05mX1iyxoI-r1pZWxuxdUK8"
|
||||
PATH_CERT_KEY=key.pem
|
||||
PATH_SERVER_CRT=cert.pem
|
||||
PATH_SSL_ROOT_PEM=root.pem
|
||||
PATH_SSL_CHAIN_PEM=chain.pem
|
||||
PROD=0
|
||||
PROJECT_DESCR_MAIN='__PROJECTS'
|
||||
SECRK=iUUb38v23jjDFaosWj92axkBOXCQ
|
||||
TOKEN_LIFE=2h
|
||||
REFRESH_TOKEN_LIFE=14d
|
||||
AUTH_NEW_SITES=B234HDSAOJ734ndcsdKWNV
|
||||
8
.gitignore
vendored
8
.gitignore
vendored
@@ -1,6 +1,5 @@
|
||||
node_modules/
|
||||
.env.test
|
||||
.env.development
|
||||
.env.production
|
||||
.env.production.bak
|
||||
ESEMPI/
|
||||
@@ -25,3 +24,10 @@ src/.DS_Store
|
||||
.gitignore
|
||||
src/server/router/.DS_Store
|
||||
src/server/.DS_Store
|
||||
emails/.DS_Store
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
logtrans.txt
|
||||
yarn.lock
|
||||
logtrans.txt
|
||||
|
||||
51
.vscode/launch.json
vendored
51
.vscode/launch.json
vendored
@@ -2,17 +2,50 @@
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Server Debug",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Launch via Nodemon",
|
||||
"program": "${workspaceFolder}/node_modules/nodemon/bin/nodemon.js",
|
||||
"restart": true,
|
||||
"runtimeExecutable": "node",
|
||||
"runtimeArgs": [
|
||||
"run-script",
|
||||
"start"
|
||||
"--inspect=9229" // Use "--inspect=0.0.0.0:9229" for remote debugging
|
||||
],
|
||||
"runtimeExecutable": "npm",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
"args": [
|
||||
"${workspaceFolder}/src/server/server.js"
|
||||
], // Replace with your entry file
|
||||
"cwd": "${workspaceFolder}",
|
||||
"autoAttachChildProcesses": true,
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen",
|
||||
"sourceMaps": true,
|
||||
"env": {
|
||||
"NODE_ENV": "development",
|
||||
"TESTING_ON": "1"
|
||||
},
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Launch Trace Warning",
|
||||
"program": "${workspaceFolder}/node_modules/nodemon/bin/nodemon.js",
|
||||
"restart": true,
|
||||
"runtimeExecutable": "node",
|
||||
"runtimeArgs": [
|
||||
"--trace-warnings" // Use "--inspect=0.0.0.0:9229" for remote debugging
|
||||
],
|
||||
"type": "node"
|
||||
"args": [
|
||||
"${workspaceFolder}/src/server/server.js"
|
||||
], // Replace with your entry file
|
||||
"cwd": "${workspaceFolder}",
|
||||
"autoAttachChildProcesses": true,
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen",
|
||||
"sourceMaps": true,
|
||||
"env": {
|
||||
"NODE_ENV": "development",
|
||||
"TESTING_ON": "1"
|
||||
},
|
||||
},
|
||||
{
|
||||
"name": "ServerSide",
|
||||
@@ -23,8 +56,8 @@
|
||||
],
|
||||
"type": "node",
|
||||
"env": {
|
||||
"NODE_ENV":"development",
|
||||
"TESTING_ON":"1"
|
||||
"NODE_ENV": "development",
|
||||
"TESTING_ON": "1"
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
8
.vscode/settings.json
vendored
Normal file
8
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"search.useIgnoreFiles": false,
|
||||
"files.watcherExclude": {
|
||||
"**/.git/objects/**": true,
|
||||
"**/node_modules/**": true,
|
||||
"**/src/server/router/upload/**": true
|
||||
},
|
||||
}
|
||||
7
Dockerfile
Normal file
7
Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
||||
FROM node:alpine
|
||||
WORKDIR /Users/suryapaolo/myproject/freeplanet_serverside
|
||||
COPY package*.json .
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
#CMD ["npm", "start"]
|
||||
CMD ["npm", "run", "dev"]
|
||||
4
check_permessi_server_test2.sh
Executable file
4
check_permessi_server_test2.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
ssh -p 8855 suryapaolo@servereng "ls -ld /var/www/test2.freeplanet_server"
|
||||
|
||||
3592316
comuni_italia.geojson
Normal file
3592316
comuni_italia.geojson
Normal file
File diff suppressed because it is too large
Load Diff
18
deploy_solo1.sh
Executable file
18
deploy_solo1.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
source ./.env.production
|
||||
|
||||
msg="*** SERVER DI PRODUZIONE **** SEI SICURO DI INVIARE IL SINGOLO FILE GENERAL.JS - SUL SERVER DI PRODUZIONE ?? $SERVERDIR_WEBSITE (Y/N) ? "
|
||||
|
||||
if [ "$1" = "" ]; then
|
||||
read -p "$msg" risposta
|
||||
else
|
||||
echo $msg
|
||||
risposta=$1
|
||||
fi
|
||||
|
||||
if [[ $risposta == "Y" || $risposta == "y" ]]; then
|
||||
echo "Sincronizzazione di 1 FILE in corso..."
|
||||
rsync -avz -e 'ssh -p 8855' src/server/tools/general.js suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/src/server/tools/general.js
|
||||
echo "Sincronizzazione TERMINATA - SERVER PRODUZIONE!"
|
||||
fi
|
||||
18
deploynode_on_prod_pcb.sh
Executable file
18
deploynode_on_prod_pcb.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
source ./.env.prod.pcb
|
||||
|
||||
echo "Sincronizzazione in corso PCB PRODUZIONE ... /var/www/$SERVERDIR_WEBSITE/"
|
||||
echo ""
|
||||
|
||||
rsync -avz -e 'ssh -p 8822' css pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8822' docs pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8822' emails pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8822' images pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8822' plugins pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8822' sass pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8822' src pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8822' .env.prod.pcb pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/.env.production
|
||||
rsync -avz -e 'ssh -p 8822' package.json pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/package.json
|
||||
|
||||
echo "Sincronizzazione TERMINATA! - SERVER PCB!"
|
||||
19
deploynode_on_test_pcb.sh
Executable file
19
deploynode_on_test_pcb.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
source ./.env.test.pcb
|
||||
|
||||
echo "Sincronizzazione in corso PCB TEST ... /var/www/$SERVERDIR_WEBSITE/"
|
||||
echo ""
|
||||
|
||||
rsync -avz -e 'ssh -p 8822' css pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8822' docs pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8822' emails pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8822' images pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8822' plugins pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8822' sass pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8822' src pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8822' .env.test.pcb pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/.env.test
|
||||
rsync -avz -e 'ssh -p 8822' .env.test.pcb pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8822' package.json pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/package.json
|
||||
|
||||
echo "Sincronizzazione TERMINATA! - SERVER PCB!"
|
||||
21
deploynodejs_on_risosrv_test.sh
Executable file
21
deploynodejs_on_risosrv_test.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
source ./.env.test.risosrv
|
||||
|
||||
echo "Sincronizzazione in corso... $DIRECTORY_SERVER"
|
||||
rsync -avz -e 'scp -p 8822' .env.test.risosrv pcbuser@pcb:$DIRECTORY_SERVER/.env.test
|
||||
rsync -avz -e 'ssh -p 8822' ecosystem.config.testriso.js pcbuser@pcb:$DIRECTORY_SERVER/ecosystem.config.js
|
||||
rsync -avz -e 'ssh -p 8822' css pcbuser@pcb:$DIRECTORY_SERVER/
|
||||
rsync -avz -e 'ssh -p 8822' docs pcbuser@pcb:$DIRECTORY_SERVER/
|
||||
rsync -avz -e 'ssh -p 8822' emails pcbuser@pcb:$DIRECTORY_SERVER/
|
||||
rsync -avz -e 'ssh -p 8822' images pcbuser@pcb:$DIRECTORY_SERVER/
|
||||
rsync -avz -e 'ssh -p 8822' plugins pcbuser@pcb:$DIRECTORY_SERVER/
|
||||
rsync -avz -e 'ssh -p 8822' sass pcbuser@pcb:$DIRECTORY_SERVER/
|
||||
rsync -avz -e 'ssh -p 8822' src --exclude 'server/router/upload' pcbuser@pcb:$DIRECTORY_SERVER/
|
||||
rsync -avz -e 'ssh -p 8822' ecosystem.config.testriso.js pcbuser@pcb:$DIRECTORY_SERVER/ecosystem.config.js
|
||||
rsync -avz -e 'ssh -p 8822' package.json pcbuser@pcb:$DIRECTORY_SERVER/package.json
|
||||
|
||||
echo "**************************"
|
||||
echo "Sincronizzazione TERMINATA! - TESTSRISO.FREEPLANET_SERVER!"
|
||||
echo "https://testriso.piuchebuono.app"
|
||||
echo "**************************"
|
||||
34
deploynodejs_on_test2.sh
Executable file
34
deploynodejs_on_test2.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
source ./.env.test2
|
||||
|
||||
echo "Directory attuale: $PWD"
|
||||
|
||||
msg="*** SERVER DI TEST2 **** SEI SICURO DI INVIARE GLI AGGIORNAMENTI SERVERSIDE (NODE JS) - SUL SERVER $SERVERDIR_WEBSITE (Y/N) ? "
|
||||
|
||||
if [ "$1" = "" ]; then
|
||||
read -p "$msg" risposta
|
||||
else
|
||||
echo $msg
|
||||
risposta=$1
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [[ $risposta == "Y" || $risposta == "y" ]]; then
|
||||
|
||||
echo "Sincronizzazione in corso... $SERVERDIR_WEBSITE"
|
||||
echo "Copiando .env.test2..."
|
||||
rsync -avz -e 'ssh -p 8855' .env.test2 suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/.env.test
|
||||
echo "Sincronizzazione in corso... src"
|
||||
rsync -avz -e 'ssh -p 8855' -a --exclude 'src/router/upload' src suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8855' package.json suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/package.json
|
||||
rsync -avz -e 'ssh -p 8855' css suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8855' docs suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8855' emails suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8855' images suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8855' plugins suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/
|
||||
rsync -avz -e 'ssh -p 8855' sass suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/
|
||||
|
||||
echo "Sincronizzazione TERMINATA! - SERVER TEST2!"
|
||||
fi
|
||||
30
docker-compose.yml
Normal file
30
docker-compose.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
version: '3.9'
|
||||
|
||||
services:
|
||||
# mongoDB service
|
||||
mongo_db:
|
||||
container_name: db_container
|
||||
image: mongo:4.4
|
||||
restart: always
|
||||
ports:
|
||||
- 2717:27017
|
||||
volumes:
|
||||
- mongo_db:/data/db
|
||||
|
||||
# Node API service
|
||||
api:
|
||||
build: .
|
||||
ports:
|
||||
- 4000:3000
|
||||
volumes:
|
||||
- .:/Users/suryapaolo/myproject/freeplanet_serverside
|
||||
environment:
|
||||
PORT: 3000
|
||||
DOMAIN: mongodb://mongo_db:27017/
|
||||
DATABASE: test_FreePlanet
|
||||
UDB: paofreeplanet
|
||||
depends_on:
|
||||
- mongo_db
|
||||
|
||||
volumes:
|
||||
mongo_db: {}
|
||||
0
docs/prova.txt
Normal file
0
docs/prova.txt
Normal file
@@ -4,7 +4,10 @@ module.exports = {
|
||||
name: "FreePlanetServerSide",
|
||||
script: "./src/server/server.js",
|
||||
ignore_watch : ["node_modules"],
|
||||
interpreter: "/root/.nvm/versions/node/v16.19.0/bin/node",
|
||||
watch: false,
|
||||
//autorestart: true,
|
||||
instances: 1,
|
||||
env: {
|
||||
"PORT": 3000,
|
||||
"NODE_ENV": "development",
|
||||
@@ -17,9 +20,9 @@ module.exports = {
|
||||
"PORT": 3000,
|
||||
"NODE_ENV": "production",
|
||||
},
|
||||
log_file: "combined.outerr.log",
|
||||
error_file: "err.log",
|
||||
out_file: "out.log",
|
||||
log_file: "logs/combined.outerr.log",
|
||||
error_file: "logs/err.log",
|
||||
out_file: "logs/out.log",
|
||||
merge_logs: true,
|
||||
log_date_format: "YYYY-MM-DD HH:mm:ss.SSSS Z"
|
||||
}
|
||||
|
||||
22
ecosystem.config.testriso.js
Executable file
22
ecosystem.config.testriso.js
Executable file
@@ -0,0 +1,22 @@
|
||||
module.exports = {
|
||||
apps : [
|
||||
{
|
||||
name: "TESTRISO2 FreePlanetServerSide",
|
||||
script: "./src/server/server.js",
|
||||
ignore_watch : ["node_modules"],
|
||||
interpreter: "/root/.nvm/versions/node/v16.19.0/bin/node",
|
||||
watch: false,
|
||||
//autorestart: true,
|
||||
instances: 1,
|
||||
env_test: {
|
||||
"PORT": 3001,
|
||||
"NODE_ENV": "test",
|
||||
},
|
||||
log_file: "logs/combined.outerr.log",
|
||||
error_file: "logs/err.log",
|
||||
out_file: "logs/out.log",
|
||||
merge_logs: true,
|
||||
log_date_format: "YYYY-MM-DD HH:mm:ss.SSSS Z"
|
||||
}
|
||||
]
|
||||
};
|
||||
BIN
emails/.DS_Store
vendored
Normal file
BIN
emails/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -1,5 +1,6 @@
|
||||
p Ciao,
|
||||
p Ti avvisiamo che #{username} (#{name} #{surname}) ha appena cancellato la prenotazione per l'evento #{event}:
|
||||
span #{msgbooking}
|
||||
span #{participants}
|
||||
span #{participantsLunch}
|
||||
span #{participantsDinner}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
p Ciao,
|
||||
p Ti confermiamo che #{username} (#{name} #{surname}) ha appena inviato una richiesta di prenotazione per l'evento #{event}
|
||||
p #{msgbooking}
|
||||
p #{participants}
|
||||
p #{participantsLunch}
|
||||
p #{participantsDinner}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
p Ciao,
|
||||
p Ti confermiamo che #{username} (#{name} #{surname}) ha appena Modificato la sua prenotazione per l'evento #{event}
|
||||
p #{msgbooking}
|
||||
p #{participants}
|
||||
p #{participantsLunch}
|
||||
p #{participantsDinner}
|
||||
|
||||
BIN
emails/admin/registration/.DS_Store
vendored
Normal file
BIN
emails/admin/registration/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -1,5 +1,6 @@
|
||||
p Ciao #{name},
|
||||
p Ti confermiamo che la prenotazione per l'evento "#{event}" è stata cancellata.
|
||||
p #{msgbooking}
|
||||
p #{participants}
|
||||
p #{participantsLunch}
|
||||
p #{participantsDinner}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
p Ciao #{name},
|
||||
p Ti confermiamo che hai appena inviato una richiesta di prenotazione per l'evento #{event}
|
||||
p #{msgbooking}
|
||||
p #{participants}
|
||||
p #{participantsLunch}
|
||||
p #{participantsDinner}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
p Ciao #{name},
|
||||
p Ti confermiamo che hai modificato la prenotazione per l'evento #{event}
|
||||
p #{msgbooking}
|
||||
p #{participants}
|
||||
p #{participantsLunch}
|
||||
p #{participantsDinner}
|
||||
|
||||
@@ -19,66 +19,118 @@ html
|
||||
}
|
||||
|
||||
body(yahoofix, style="background: #ffffff")
|
||||
- var baseimg = baseurl + '/statics/'
|
||||
- var baseimg = baseurl + '/'
|
||||
span(id='body_style', style='display:block')
|
||||
table(cellpadding="10", cellspacing="0", width="600", align="center")
|
||||
tr
|
||||
td(class="whitespace", height="10")
|
||||
p
|
||||
if (orders.items && orders.items.length > 0)
|
||||
- var mystorehouse = orders.items[0].order.storehouse
|
||||
else
|
||||
- var mystorehouse = null
|
||||
|
||||
tr
|
||||
td(class="emailContainer", valign="top")
|
||||
- var mioheader = mystorehouse.email_html_header
|
||||
if (mioheader)
|
||||
p!= mioheader
|
||||
|
||||
p Ciao #{username},
|
||||
p Ti confermiamo che hai appena inviato un'ordine di prenotazione dei seguenti prodotti:
|
||||
- var mioname = name
|
||||
if (!mioname)
|
||||
- var mioname = user.username
|
||||
|
||||
p Ciao #{mioname},
|
||||
|
||||
tr
|
||||
td(class="whitespace", height="10")
|
||||
p
|
||||
if (orders.items[0].order.quantitypreordered > 0)
|
||||
- var miomakeorder = mystorehouse.email_html_GAS_makeorder
|
||||
else
|
||||
- var miomakeorder = mystorehouse.email_html_makeorder
|
||||
|
||||
- var totalPrice = orders.totalPrice
|
||||
- var note = orders.note
|
||||
- var index = 0
|
||||
if (miomakeorder)
|
||||
p!= miomakeorder
|
||||
else
|
||||
p Ti arriverà una email quando i prodotti saranno disponibili per poterli venire a ritirare.
|
||||
p Il pagamento, se non diversamente comunicato, potrai farlo direttamente in sede.
|
||||
|
||||
each product in orders.items
|
||||
- var descr = product.order.product.name
|
||||
- var img = product.order.product.img
|
||||
- var price = product.order.price
|
||||
- var after_price = product.order.after_price
|
||||
- var qty = product.order.quantity
|
||||
- index = index + 1
|
||||
|
||||
table(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
||||
tr
|
||||
td(class="column", valign="center" width="40")
|
||||
p.boldhigh #{index}.
|
||||
tr
|
||||
td(class="whitespace", height="10")
|
||||
p
|
||||
|
||||
td(class="column sectionArticleImage", valign="top" width="150")
|
||||
table(cellpadding="0", cellspacing="0", summary="", border="0")
|
||||
tr
|
||||
td
|
||||
img(src=baseimg + img, alt="", width="150" height="150")
|
||||
td(class="column", valign="top")
|
||||
- var totalPrice = orders.totalPrice
|
||||
- var note = orders.note
|
||||
- var index = 0
|
||||
|
||||
table(cellpadding="0", cellspacing="0", summary="", border="0")
|
||||
tr
|
||||
td(class="sectionContentTitle boldhigh", valign="top")
|
||||
p #{descr}
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Prezzo: #{price} € #{after_price}
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Quantità: #{qty}
|
||||
each rec in orders.items
|
||||
- var descr = rec.order.product.productInfo.name
|
||||
- var img = rec.order.product.productInfo.img
|
||||
- var price = rec.order.price
|
||||
- var after_price = rec.order.after_price
|
||||
- var TotalPriceProduct = rec.order.TotalPriceProductstr
|
||||
if (rec.order.gasordine)
|
||||
- var gasordine = rec.order.gasordine.name
|
||||
else
|
||||
- var gasordine = ''
|
||||
|
||||
- var qty = rec.order.quantity
|
||||
- var qtypreordered = rec.order.quantitypreordered
|
||||
if (rec.order.product.productInfo.sfuso && rec.order.product.productInfo.weight)
|
||||
- qtypreordered = qtypreordered * rec.order.product.productInfo.weight
|
||||
else if (rec.order.product.productInfo.weight)
|
||||
- qtypreordered = qtypreordered + ' x ' + rec.order.product.productInfo.weight
|
||||
|
||||
p Note Aggiuntive: #{note}
|
||||
- var unit = rec.order.product.productInfo.unitstr
|
||||
- index = index + 1
|
||||
|
||||
p.sectionContentTitle.boldhigh.sectionTotal Totale Ordine: #{totalPrice} €
|
||||
table(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
||||
tr
|
||||
td(class="column", valign="center" width="40")
|
||||
p.boldhigh #{index}.
|
||||
|
||||
td(class="column sectionArticleImage", valign="top" width="150")
|
||||
table(cellpadding="0", cellspacing="0", summary="", border="0")
|
||||
tr
|
||||
td
|
||||
img(src=baseimg + img, alt="", width="150")
|
||||
td(class="column", valign="top")
|
||||
|
||||
table(cellpadding="0", cellspacing="0", summary="", border="0")
|
||||
if (qtypreordered > 0)
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Gas Ordine: #{gasordine}
|
||||
p
|
||||
tr
|
||||
td(class="sectionContentTitle boldhigh", valign="top")
|
||||
p #{descr}
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Prezzo: #{price} € #{after_price}
|
||||
if (qty > 0)
|
||||
td(class="sectionContent", valign="top")
|
||||
p Quantità: #{qty} #{unit}
|
||||
if (qtypreordered > 0)
|
||||
td(class="sectionContent", valign="top")
|
||||
p Quantità Prenotata: #{qtypreordered} #{unit}
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Totale: #{TotalPriceProduct} €
|
||||
|
||||
if (note)
|
||||
p Note Aggiuntive: #{note}
|
||||
|
||||
p.sectionContentTitle.boldhigh.sectionTotal Totale Ordine: #{totalPrice} €
|
||||
tr
|
||||
td(class="whitespace", height="10")
|
||||
|
||||
p Ti arriverà una email quando i prodotti saranno disponibili per poterli venire a ritirare.
|
||||
p Il pagamento potrai farlo direttamente in sede.
|
||||
p Grazie Mille
|
||||
tr
|
||||
td
|
||||
- var miofooter = mystorehouse.email_html_footer
|
||||
if (miofooter)
|
||||
p!= miofooter
|
||||
else
|
||||
p Grazie Mille
|
||||
|
||||
table.footer(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
||||
tr
|
||||
|
||||
@@ -28,7 +28,12 @@ html
|
||||
tr
|
||||
td(class="emailContainer", valign="top")
|
||||
|
||||
p Ciao #{name},
|
||||
- var mioname = name
|
||||
if (!mioname)
|
||||
- var mioname = user.username
|
||||
|
||||
p Ciao #{mioname},
|
||||
|
||||
p L'ordine è stato Cancellato.
|
||||
p Se è stato un errore, procedi a ripetere l'Ordine, ripartendo dalla lista prodotti.
|
||||
p Grazie Mille
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
title Ordine Completato
|
||||
|
||||
//- import css/scss stylesheets
|
||||
//- these file names will be replace by gulp with proper css file paths
|
||||
link(rel="stylesheet", href="../sass/basic.scss")
|
||||
link(rel="stylesheet", href="../sass/one/styles.scss")
|
||||
|
||||
//- embdedded css allowed, but not sass
|
||||
style.
|
||||
.red {
|
||||
background-color: #E84C50;
|
||||
}
|
||||
|
||||
.full-width {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
body(yahoofix, style="background: #ffffff")
|
||||
- var baseimg = baseurl + '/statics/'
|
||||
span(id='body_style', style='display:block')
|
||||
table(cellpadding="10", cellspacing="0", width="600", align="center")
|
||||
tr
|
||||
td(class="whitespace", height="10")
|
||||
p
|
||||
tr
|
||||
td(class="emailContainer", valign="top")
|
||||
|
||||
p Ciao #{name},
|
||||
p L'ordine n. #{ordernumber} è stato Completato correttamente !
|
||||
p Grazie Mille per aver contribuito a far crescere la Comunità
|
||||
|
||||
table.footer(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
||||
tr
|
||||
td(class="whitespace", height="10")
|
||||
p
|
||||
tr
|
||||
td.firma
|
||||
p!= dataemail.firma
|
||||
|
||||
tr
|
||||
td.disclaimer
|
||||
p!= dataemail.disclaimer_out
|
||||
|
||||
tr
|
||||
td.bottom
|
||||
p!= dataemail.disc_bottom_out
|
||||
|
||||
tr
|
||||
td(class="whitespace", height="10")
|
||||
p
|
||||
|
||||
style(type="text/css").
|
||||
html, body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.divbtn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.btn-lg {
|
||||
padding: 5px;
|
||||
margin: 5px;
|
||||
font-size: 26px;
|
||||
cursor: pointer;
|
||||
color: white;
|
||||
background: #027be3 !important;
|
||||
border-radius: 28px;
|
||||
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
=`Ordine n. ${ordernumber} Completato`
|
||||
@@ -1,7 +1,7 @@
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
title Ordine Confermato
|
||||
title Ordine n. #{ordernumber} Confermato
|
||||
|
||||
//- import css/scss stylesheets
|
||||
//- these file names will be replace by gulp with proper css file paths
|
||||
@@ -19,32 +19,65 @@ html
|
||||
}
|
||||
|
||||
body(yahoofix, style="background: #ffffff")
|
||||
- var baseimg = baseurl + '/statics/'
|
||||
- var baseimg = baseurl + '/';
|
||||
span(id='body_style', style='display:block')
|
||||
table(cellpadding="10", cellspacing="0", width="600", align="center")
|
||||
tr
|
||||
td(class="whitespace", height="10")
|
||||
p
|
||||
|
||||
if (orders.items && orders.items.length > 0)
|
||||
- var mystorehouse = orders.items[0].order.storehouse
|
||||
else
|
||||
- var mystorehouse = null
|
||||
|
||||
tr
|
||||
td(class="emailContainer", valign="top")
|
||||
|
||||
p Ciao #{name},
|
||||
p L'ordine dei seguenti prodotti è stato Confermato:
|
||||
- var mioheader = mystorehouse.email_html_header
|
||||
if (mioheader)
|
||||
p!= mioheader
|
||||
|
||||
- var mioname = name
|
||||
if (!mioname)
|
||||
- var mioname = user.username
|
||||
|
||||
p Ciao #{mioname},
|
||||
|
||||
if (orders.items[0].order.quantitypreordered > 0)
|
||||
- var miordconfirmed = mystorehouse.email_html_GAS_order_confirmed
|
||||
else
|
||||
- var miordconfirmed = mystorehouse.email_html_order_confirmed
|
||||
|
||||
if (miordconfirmed)
|
||||
p!= miordconfirmed
|
||||
else
|
||||
p Puoi pertanto venire a ritirarli direttamente in sede, negli orari che ti sono stati indicati.
|
||||
|
||||
tr
|
||||
td(class="whitespace", height="10")
|
||||
p
|
||||
|
||||
- var totalPrice = orders.totalPrice
|
||||
- var note = orders.note
|
||||
- var index = 0
|
||||
|
||||
each product in orders.items
|
||||
- var descr = product.order.product.name
|
||||
- var img = product.order.product.img
|
||||
- var price = product.order.price
|
||||
- var after_price = product.order.after_price
|
||||
- var qty = product.order.quantity
|
||||
each rec in orders.items
|
||||
- var descr = rec.order.product.productInfo.name
|
||||
- var img = rec.order.product.productInfo.img
|
||||
- var price = rec.order.product.price
|
||||
- var after_price = rec.order.product.after_price
|
||||
if (rec.order.gasordine)
|
||||
- var gasordine = rec.order.gasordine.name
|
||||
else
|
||||
- var gasordine = ''
|
||||
- var qty = rec.order.product.quantity
|
||||
- var qtypreordered = rec.order.quantitypreordered
|
||||
if (rec.order.product.productInfo.sfuso && rec.order.product.productInfo.weight)
|
||||
- qtypreordered = qtypreordered * rec.order.product.productInfo.weight
|
||||
else if (rec.order.product.productInfo.weight)
|
||||
- qtypreordered = qtypreordered + ' x ' + rec.order.product.productInfo.weight
|
||||
|
||||
- var unit = rec.order.product.productInfo.unitstr
|
||||
- var TotalPriceProduct = rec.order.TotalPriceProductstr
|
||||
- index = index + 1
|
||||
|
||||
table(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
||||
@@ -56,29 +89,48 @@ html
|
||||
table(cellpadding="0", cellspacing="0", summary="", border="0")
|
||||
tr
|
||||
td
|
||||
img(src=baseimg + img, alt="", width="150" height="150")
|
||||
img(src=baseimg + img, alt="", width="150")
|
||||
td(class="column", valign="top")
|
||||
|
||||
table(cellpadding="0", cellspacing="0", summary="", border="0")
|
||||
if (qtypreordered > 0)
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Gas Ordine: #{gasordine}
|
||||
p
|
||||
tr
|
||||
td(class="sectionContentTitle boldhigh", valign="top")
|
||||
p #{descr}
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Prezzo: #{price} € #{after_price}
|
||||
if (qty > 0)
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Quantità: #{qty} #{unit}
|
||||
if (qtypreordered > 0)
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Quantità Prenotata: #{qtypreordered} #{unit}
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Quantità: #{qty}
|
||||
p Totale: #{TotalPriceProduct} €
|
||||
|
||||
p Note Aggiuntive: #{note}
|
||||
if (note)
|
||||
p Note Aggiuntive: #{note}
|
||||
|
||||
p.sectionContentTitle.boldhigh.sectionTotal Totale Ordine: #{totalPrice} €
|
||||
tr
|
||||
td(class="whitespace", height="10")
|
||||
|
||||
p Puoi pertanto venire a ritirarli direttamente in sede.
|
||||
p Grazie Mille
|
||||
|
||||
tr
|
||||
td
|
||||
- var miofooter = mystorehouse.email_html_footer
|
||||
if (miofooter)
|
||||
p!= miofooter
|
||||
else
|
||||
p Grazie Mille
|
||||
|
||||
table.footer(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
||||
tr
|
||||
td(class="whitespace", height="10")
|
||||
|
||||
179
emails/ecommerce/order_consegnato/it/html.pug
Executable file
179
emails/ecommerce/order_consegnato/it/html.pug
Executable file
@@ -0,0 +1,179 @@
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
title Ordine n. #{ordernumber} Consegnato
|
||||
|
||||
//- import css/scss stylesheets
|
||||
//- these file names will be replace by gulp with proper css file paths
|
||||
link(rel="stylesheet", href="../sass/basic.scss")
|
||||
link(rel="stylesheet", href="../sass/one/styles.scss")
|
||||
|
||||
//- embdedded css allowed, but not sass
|
||||
style.
|
||||
.red {
|
||||
background-color: #E84C50;
|
||||
}
|
||||
|
||||
.full-width {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
body(yahoofix, style="background: #ffffff")
|
||||
- var baseimg = baseurl + '/';
|
||||
span(id='body_style', style='display:block')
|
||||
table(cellpadding="10", cellspacing="0", width="600", align="center")
|
||||
tr
|
||||
td(class="whitespace", height="10")
|
||||
p
|
||||
|
||||
if (orders.items && orders.items.length > 0)
|
||||
- var mystorehouse = orders.items[0].order.storehouse
|
||||
else
|
||||
- var mystorehouse = null
|
||||
|
||||
tr
|
||||
td(class="emailContainer", valign="top")
|
||||
|
||||
- var mioheader = mystorehouse.email_html_header
|
||||
if (mioheader)
|
||||
p!= mioheader
|
||||
|
||||
- var mioname = name
|
||||
if (!mioname)
|
||||
- var mioname = user.username
|
||||
|
||||
p Ciao #{mioname},
|
||||
p L'ordine n. #{ordernumber} è stato Consegnato correttamente 📦 !
|
||||
p Grazie per averci scelto 🙏🏻 e alla prossima !
|
||||
p
|
||||
|
||||
if (orders.items[0].order.quantitypreordered > 0)
|
||||
- var miomakeorder = mystorehouse.email_html_GAS_order_consegnato
|
||||
else
|
||||
- var miomakeorder = mystorehouse.email_html_order_consegnato
|
||||
|
||||
if (miomakeorder)
|
||||
p!= miomakeorder
|
||||
|
||||
- var totalPrice = orders.totalPrice
|
||||
- var note = orders.note
|
||||
- var index = 0
|
||||
|
||||
each rec in orders.items
|
||||
- var descr = rec.order.product.productInfo.name
|
||||
- var img = rec.order.product.productInfo.img
|
||||
- var price = rec.order.product.price
|
||||
- var after_price = rec.order.product.after_price
|
||||
if (rec.order.gasordine)
|
||||
- var gasordine = rec.order.gasordine.name
|
||||
else
|
||||
- var gasordine = ''
|
||||
- var qty = rec.order.product.quantity
|
||||
- var qtypreordered = rec.order.quantitypreordered
|
||||
if (rec.order.product.productInfo.sfuso && rec.order.product.productInfo.weight)
|
||||
- qtypreordered = qtypreordered * rec.order.product.productInfo.weight
|
||||
else if (rec.order.product.productInfo.weight)
|
||||
- qtypreordered = qtypreordered + ' x ' + rec.order.product.productInfo.weight
|
||||
|
||||
- var unit = rec.order.product.productInfo.unitstr
|
||||
- var TotalPriceProduct = rec.order.TotalPriceProductstr
|
||||
- index = index + 1
|
||||
|
||||
table(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
||||
tr
|
||||
td(class="column", valign="center" width="40")
|
||||
p.boldhigh #{index}.
|
||||
|
||||
td(class="column sectionArticleImage", valign="top" width="150")
|
||||
table(cellpadding="0", cellspacing="0", summary="", border="0")
|
||||
tr
|
||||
td
|
||||
img(src=baseimg + img, alt="", width="150")
|
||||
td(class="column", valign="top")
|
||||
|
||||
table(cellpadding="0", cellspacing="0", summary="", border="0")
|
||||
if (qtypreordered > 0)
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Gas Ordine: #{gasordine}
|
||||
p
|
||||
tr
|
||||
td(class="sectionContentTitle boldhigh", valign="top")
|
||||
p #{descr}
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Prezzo: #{price} € #{after_price}
|
||||
if (qty > 0)
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Quantità: #{qty} #{unit}
|
||||
if (qtypreordered > 0)
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Quantità Prenotata: #{qtypreordered} #{unit}
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Totale: #{TotalPriceProduct} €
|
||||
|
||||
if (note)
|
||||
p Note Aggiuntive: #{note}
|
||||
|
||||
p.sectionContentTitle.boldhigh.sectionTotal Totale Ordine: #{totalPrice} €
|
||||
tr
|
||||
td(class="whitespace", height="10")
|
||||
|
||||
tr
|
||||
td
|
||||
- var miofooter = mystorehouse.email_html_footer
|
||||
if (miofooter)
|
||||
p!= miofooter
|
||||
else
|
||||
p Grazie Mille
|
||||
|
||||
table.footer(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
||||
tr
|
||||
td(class="whitespace", height="10")
|
||||
p
|
||||
tr
|
||||
td.firma
|
||||
p!= dataemail.firma
|
||||
|
||||
tr
|
||||
td.disclaimer
|
||||
p!= dataemail.disclaimer_out
|
||||
|
||||
tr
|
||||
td.bottom
|
||||
p!= dataemail.disc_bottom_out
|
||||
|
||||
tr
|
||||
td(class="whitespace", height="10")
|
||||
p
|
||||
|
||||
style(type="text/css").
|
||||
html, body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
|
||||
.divbtn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.btn-lg {
|
||||
padding: 5px;
|
||||
margin: 5px;
|
||||
font-size: 26px;
|
||||
cursor: pointer;
|
||||
color: white;
|
||||
background: #027be3 !important;
|
||||
border-radius: 28px;
|
||||
|
||||
}
|
||||
1
emails/ecommerce/order_consegnato/it/subject.pug
Executable file
1
emails/ecommerce/order_consegnato/it/subject.pug
Executable file
@@ -0,0 +1 @@
|
||||
=`Ordine n. ${ordernumber} Consegnato`
|
||||
@@ -11,46 +11,42 @@
|
||||
-}
|
||||
|
||||
- var urlcal = baseurl + '/calendario-eventi/'
|
||||
- var imginstagram = baseurl + '/statics/images/images/footer-instagram-icon.png'
|
||||
- var imgtwitter = baseurl + '/statics/images/images/footer-twitter-icon.png'
|
||||
- var imgyoutube = baseurl + '/statics/images/images/footer-youtube-icon.png'
|
||||
- var imgfb = baseurl + '/statics/images/images/footer-facebook-icon.png'
|
||||
- var baseimg = baseurl + '/statics/'
|
||||
- var imginstagram = baseurl + '/images/images/footer-instagram-icon.png'
|
||||
- var imgtwitter = baseurl + '/images/images/footer-twitter-icon.png'
|
||||
- var imgyoutube = baseurl + '/images/images/footer-youtube-icon.png'
|
||||
- var imgfb = baseurl + '/images/images/footer-facebook-icon.png'
|
||||
- var baseimg = baseurl + '/'
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
title Calendario Eventi
|
||||
- if (dataemail.title)
|
||||
head
|
||||
title dataemail.subject
|
||||
|
||||
//- import css/scss stylesheets
|
||||
//- these file names will be replace by gulp with proper css file paths
|
||||
link(rel="stylesheet", href="../sass/basic.scss")
|
||||
link(rel="stylesheet", href="../sass/one/styles.scss")
|
||||
//- import css/scss stylesheets
|
||||
//- these file names will be replace by gulp with proper css file paths
|
||||
link(rel="stylesheet", href="../sass/basic.scss")
|
||||
link(rel="stylesheet", href="../sass/one/styles.scss")
|
||||
|
||||
//- embdedded css allowed, but not sass
|
||||
style.
|
||||
.red {
|
||||
background-color: #E84C50;
|
||||
}
|
||||
//- embdedded css allowed, but not sass
|
||||
style.
|
||||
.red {
|
||||
background-color: #E84C50;
|
||||
}
|
||||
|
||||
.full-width {
|
||||
width: 100%;
|
||||
}
|
||||
.full-width {
|
||||
width: 100%;
|
||||
}
|
||||
body(yahoofix)
|
||||
span(id='body_style', style='display:block')
|
||||
table(class="preheader", cellpadding="0", cellspacing="0", width="100%")
|
||||
tr
|
||||
td.webversion
|
||||
p non vedi le immagini?
|
||||
a(href=urlcal) Apri il Calendario
|
||||
|
||||
table(class="topHeader", cellpadding="0", cellspacing="0", width="100%")
|
||||
tr
|
||||
td
|
||||
table(cellpadding="0", cellspacing="0", align="center", summary="")
|
||||
tr
|
||||
td.logoContainer
|
||||
a(href=baseurl, title='logo')
|
||||
img.logo(src=baseurl+"/statics/images/logo.png", height=dataemail.height_logo)
|
||||
- if (dataemail.height_logo)
|
||||
tr
|
||||
td
|
||||
table(cellpadding="0", cellspacing="0", align="center", summary="")
|
||||
tr
|
||||
td.logoContainer
|
||||
a(href=baseurl, title='logo')
|
||||
img.logo(src=baseurl+"/images/logo.png", height=dataemail.height_logo)
|
||||
|
||||
tr
|
||||
td.testomail
|
||||
@@ -61,17 +57,17 @@ html
|
||||
td.clpromo
|
||||
p!= dataemail.textpromo
|
||||
|
||||
- if (dataemail.templ.content)
|
||||
table(cellpadding="0", cellspacing="0", width="95%", align="center")
|
||||
tr
|
||||
td(class="textIniContainer", valign="top")
|
||||
p!=dataemail.templ.content
|
||||
- if (dataemail.templ.img)
|
||||
img(src=baseimg + dataemail.templ.img, alt="", class="myimg")
|
||||
- if (dataemail.templ.content2)
|
||||
p!=dataemail.templ.content2
|
||||
- if (dataemail.templ.img2)
|
||||
img(src=baseimg + dataemail.templ.img2, alt="", class="myimg")
|
||||
- if (dataemail.templ.content)
|
||||
table(cellpadding="0", cellspacing="0", width="95%", align="center")
|
||||
tr
|
||||
td(class="textIniContainer", valign="top")
|
||||
p!=dataemail.templ.content
|
||||
- if (dataemail.templ.img)
|
||||
img(src=baseimg + dataemail.templ.img, alt="", class="myimg")
|
||||
- if (dataemail.templ.content2)
|
||||
p!=dataemail.templ.content2
|
||||
- if (dataemail.templ.img2)
|
||||
img(src=baseimg + dataemail.templ.img2, alt="", class="myimg")
|
||||
|
||||
table(cellpadding="0", cellspacing="0", width="640", align="center")
|
||||
- if (dataemail.templ.options.includes('SHOW_EVENTS'))
|
||||
@@ -201,10 +197,6 @@ html
|
||||
td(class="whitespace", height="20")
|
||||
p
|
||||
|
||||
tr
|
||||
td(class="whitespace", height="20")
|
||||
p
|
||||
|
||||
// Social Media
|
||||
table.socialMedia(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
||||
tr
|
||||
|
||||
147
filelog.txt
147
filelog.txt
@@ -19,3 +19,150 @@ entrando sul bot riso premi su avvia (o start) e segui le istruzioni
|
||||
|
||||
3️⃣ condividi il progetto ai tuoi amici ed aiuta così a far crescere questa rete e crescere insieme 💚 partecipa al cambiamento. riso sei anche tu.
|
||||
se hai bisogno di aiuto chiedi in questa chat: 👉🏻 chat riso help
|
||||
|
||||
Gio 05/01 ORE 19:28: USER [paoloar77]: vai al sito
|
||||
|
||||
Gio 05/01 ORE 19:28: USER [paoloar77]: link da condividere
|
||||
|
||||
Gio 16/02 ORE 18:14: USER [paoloar77]: vai al sito
|
||||
|
||||
Mar 06/06 ORE 19:39: USER [paoloar77]: ciaooooooooooooooooo
|
||||
|
||||
Mar 06/06 ORE 19:54: USER [paoloar77]: dasjdalksjdasdklasjkldasjlkdjasl
|
||||
|
||||
Sab 17/06 ORE 20:03: USER [paoloar77]: pro v adsasdasdaksdas
|
||||
|
||||
Dom 18/06 ORE 19:22: USER [paoloar77]: /start inv
|
||||
|
||||
Dom 18/06 ORE 19:42: USER [paoloar77]: /start inv
|
||||
|
||||
Dom 18/06 ORE 19:58: USER [paoloar77]: /start inv
|
||||
|
||||
Dom 18/06 ORE 19:59: USER [paoloar77]: /start inv
|
||||
|
||||
Dom 18/06 ORE 19:59: USER [paoloar77]: /start inv
|
||||
|
||||
Ven 23/06 ORE 14:08: USER [paoloar77]: link da condividere
|
||||
|
||||
Sab 30/09 ORE 00:21: USER [SuryaArena]: vai al sito
|
||||
|
||||
Sab 30/09 ORE 00:32: USER [SuryaArena]: vai al sito
|
||||
|
||||
Gio 12/10 ORE 11:11: USER [paoloar77]: prova
|
||||
|
||||
Gio 12/10 ORE 11:48: USER [paoloar77]: prova
|
||||
|
||||
Gio 12/10 ORE 12:07: USER [SuryaArena]: prova
|
||||
|
||||
Gio 12/10 ORE 12:07: USER [SuryaArena]: prova
|
||||
|
||||
Gio 12/10 ORE 12:09: USER [SuryaArena]: prova
|
||||
|
||||
Gio 12/10 ORE 12:10: USER [SuryaArena]: prova
|
||||
|
||||
Gio 12/10 ORE 12:10: USER [SuryaArena]: prova
|
||||
|
||||
Gio 12/10 ORE 12:13: USER [SuryaArena]: prova
|
||||
|
||||
Gio 12/10 ORE 12:14: USER [SuryaArena]: prova
|
||||
|
||||
Gio 12/10 ORE 12:16: USER [SuryaArena]: prova
|
||||
|
||||
Gio 12/10 ORE 12:21: USER [SuryaArena]: prova
|
||||
|
||||
Gio 12/10 ORE 12:33: USER [paoloar77]: prova
|
||||
|
||||
Gio 12/10 ORE 12:33: USER [SuryaArena]: ciao
|
||||
|
||||
Gio 12/10 ORE 12:33: USER [SuryaArena]: prova
|
||||
|
||||
Gio 12/10 ORE 12:45: USER [SuryaArena]: bottone
|
||||
|
||||
Gio 12/10 ORE 14:49: USER [paoloar77]: bottone
|
||||
|
||||
Gio 12/10 ORE 14:49: USER [paoloar77]: bottone
|
||||
|
||||
Gio 12/10 ORE 14:49: USER [paoloar77]: bottone
|
||||
|
||||
Gio 12/10 ORE 14:52: USER [paoloar77]: bottone
|
||||
|
||||
Gio 12/10 ORE 14:57: USER [paoloar77]: bottone
|
||||
|
||||
Gio 12/10 ORE 15:06: USER [paoloar77]: bottone
|
||||
|
||||
Ven 13/10 ORE 11:05: USER [SuryaArena]: bottone
|
||||
|
||||
Ven 13/10 ORE 11:40: USER [SuryaArena]: bottone
|
||||
|
||||
Dom 17/12 ORE 15:38: USER [admin]: prova
|
||||
|
||||
Dom 17/12 ORE 16:18: USER [admin]: vai al sito
|
||||
|
||||
Dom 17/12 ORE 16:19: USER [admin]: vai al sito
|
||||
|
||||
Dom 17/12 ORE 16:19: USER [admin]: il mio profilo
|
||||
|
||||
Dom 17/12 ORE 16:19: USER [admin]: prova
|
||||
|
||||
Dom 17/12 ORE 16:19: USER [admin]: link da condividere
|
||||
|
||||
Sab 30/12 ORE 20:06: USER [admin]: gruppo di acquisto per le arance:
|
||||
|
||||
produttore:
|
||||
🍊sicilia frutta express (catania)
|
||||
|
||||
la piccola azienda a conduzione familiare di giovanni si trova in provincia di catania (sicilia), i frutti vengono prodotti rispettando i principi della biodinamica infatti non viene utilizzato nulla di chimico (niente irrorazioni) e la concimazione avviene tramite concimi naturali (letame).
|
||||
|
||||
⚠️ offerta sconto valida solo fino al 3 gennaio 2024, raggiungendo 100 kg totali di ordini di arance:
|
||||
i prezzi sono compresi di spese di spedizione e di gestione.
|
||||
|
||||
🍊 arance tarocco spremuta: 1,20 € / kg
|
||||
|
||||
🥑 avocado: 7,80 € / kg
|
||||
|
||||
🍋 limoni: 2,40 € / kg
|
||||
|
||||
👉🏻 entra sul gruppo telegram piu che buono
|
||||
|
||||
per le prenotazioni potete registratevi sul nuovo sito:
|
||||
👉🏻 piu che buono - gas e bottega (piuchebuono.app)
|
||||
|
||||
come funziona:
|
||||
- registratevi su piuchebuono.app, verificate la email.
|
||||
- accedete e poi cliccate su "gruppo di acquisto".
|
||||
- cliccate sul carrello verde 🛒 per aggiungere i kg che desiderate.
|
||||
- per finire: cliccare su "procedi all'ordine" e confermate.
|
||||
|
||||
Dom 21/01 ORE 19:00: USER [paoloar77]: 👉🏻 indietro
|
||||
|
||||
Mar 23/04 ORE 22:31: USER [paoloar77]: ciao
|
||||
|
||||
Mer 24/04 ORE 20:45: USER [paoloar77]: invia a paolo
|
||||
|
||||
Mer 24/04 ORE 20:45: USER [paoloar77]: 📨 invia a paolo
|
||||
|
||||
Mer 24/04 ORE 20:58: USER [paoloar77]: grass e prova italic
|
||||
|
||||
Mer 24/04 ORE 21:19: USER [paoloar77]: 👍 si
|
||||
|
||||
Mer 24/04 ORE 22:02: USER [paoloar77]: ✅ la regolarizzazione può avv
|
||||
|
||||
Mer 24/04 ORE 22:15: USER [paoloar77]: ❗️importante❗️
|
||||
|
||||
💚🍚 cari membri dei circuiti ris,
|
||||
quando siete entrati nel vostro circuito territoriale, avete dichiarato di avere letto e approvato il regolamento di funzionamento dei circuiti ris.
|
||||
|
||||
📖 leggi qui il regolamento (https://riso.app/regolamento)
|
||||
|
||||
il gruppo dei facilitatori territoriali di riso ha individuato un punto che necessita di chiarimenti, per rendere più esplicito un meccanismo già presente nel testo stesso. propone dunque di aggiungere una nota esplicativa (vedi asterisco *) alla seguente frase del regolamento (indicata in corsivo):
|
||||
|
||||
➡️ "… ciascun detentore di un saldo negativo concorda che la sua esposizione funge da garanzia della quantità di ris equivalenti circolanti nel circuito e che può essere chiamato a regolarizzare con equivalente pagamento in euro * , entro un lasso di tempo ragionevolmente adeguato, nel caso in cui: la comunità, in accordo con il gruppo tecnico, deliberi il rientro di alcune posizioni con decisione motivata; l’utente decida di uscire per motivi personali; il circuito chiuda, per decisione deliberata o per motivi di forza maggiore.”
|
||||
|
||||
✅ * la regolarizzazione può avvenire con equivalente valore in beni e servizi, oppure, in ultima istanza, con pagamento in euro.
|
||||
|
||||
📣 invitiamo tutti a prendere visione della proposta, e ad esprimere eventuali osservazioni nel gruppo territoriale, oppure come commento a questo stesso post, pubblicato sul canale progetto riso, entro il giorno 5 maggio
|
||||
|
||||
https://t.me/riso_canale/739
|
||||
|
||||
in attesa di riscontri, salutiamo! 🍚💚
|
||||
il gruppo dei facilitatori territoriali riso
|
||||
|
||||
838
logevents.txt
Normal file
838
logevents.txt
Normal file
@@ -0,0 +1,838 @@
|
||||
|
||||
Mar 06/06 ORE 19:06: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
|
||||
✅ SuryaArena2 è stato Abilitato correttamente (da paoloar77)!
|
||||
Mar 06/06 ORE 19:07: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
|
||||
✅ SuryaArena2 è stato Abilitato correttamente (da paoloar77)!
|
||||
Mar 06/06 ORE 19:38: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
|
||||
✅ SuryaArena2 è stato Abilitato correttamente (da paoloar77)!
|
||||
Mar 06/06 ORE 19:39: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
|
||||
ciaooooooooooooooooo
|
||||
Mar 06/06 ORE 19:49: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
|
||||
✅ SuryaArena2 è stato Abilitato correttamente (da paoloar77)!
|
||||
Mar 06/06 ORE 19:54: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
|
||||
dasjdalksjdasdklasjkldasjlkdjasl
|
||||
Sab 17/06 ORE 20:03: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
|
||||
pro v adsasdasdaksdas
|
||||
Dom 18/06 ORE 19:22: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
|
||||
/start inv
|
||||
Ven 23/06 ORE 14:13: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
|
||||
✅ SuryaArena è stato Abilitato correttamente (da paoloar77)!
|
||||
Dom 25/06 ORE 16:11: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
|
||||
✅ SuryaArena è stato Abilitato correttamente (da paoloar77)!
|
||||
Ven 29/09 ORE 23:18: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
|
||||
✅ SuryaArena è stato Abilitato correttamente (da paoloar77)!
|
||||
Mar 03/10 ORE 22:49: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
|
||||
✅ SuryaArena è stato Abilitato correttamente (da paoloar77)!
|
||||
Sab 04/11 ORE 15:17: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
|
||||
✅ SuryaArena è stato Abilitato correttamente (da paoloar77)!
|
||||
Sab 02/12 ORE 14:15: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
|
||||
✅ SuryaArena è stato Abilitato correttamente (da paoloar77)!
|
||||
Dom 21/01 ORE 19:00: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
|
||||
👉🏻 indietro
|
||||
Gio 28/03 ORE 18:10: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
|
||||
✅ prova123 è stato Abilitato correttamente (da paoloar77)!
|
||||
Mar 23/04 ORE 22:33: APPARTIENE_CIRCUITO_RIS:
|
||||
contasolo
|
||||
Mar 23/04 ORE 22:33: 0 ✉️ Messaggi da Inviare
|
||||
Mar 23/04 ORE 22:33: APPARTIENE_CIRCUITO_RIS:
|
||||
contasolo
|
||||
Mar 23/04 ORE 22:38: APPARTIENE_CIRCUITO_RIS:
|
||||
contasolo
|
||||
Mar 23/04 ORE 22:41: APPARTIENE_CIRCUITO_RIS:
|
||||
contasolo
|
||||
Mar 23/04 ORE 22:41: APPARTIENE_CIRCUITO_RIS:
|
||||
contasolo
|
||||
Mar 23/04 ORE 22:42: APPARTIENE_CIRCUITO_RIS:
|
||||
contasolo
|
||||
Mar 23/04 ORE 22:42: 703 ✉️ Messaggi da Inviare
|
||||
Mar 23/04 ORE 22:44: APPARTIENE_CIRCUITO_RIS:
|
||||
nomecognome
|
||||
Mar 23/04 ORE 22:44: Paolo Surya(paoloar77)
|
||||
Sergio Mazzanti(sergiomazzanti)
|
||||
Alberto Sensoli(Alberto)
|
||||
Fabri (FabriNunzia)
|
||||
Sabrina Siri(SabrinaCucovaz)
|
||||
Lorenzo Essente(LorenzoVT)
|
||||
Gianni Recca(Gianni)
|
||||
Giovanni (Surfman)
|
||||
Lucia (Lucente)
|
||||
(Angerita)
|
||||
(giancarloscarva)
|
||||
Fabrizio Erani(fabris64)
|
||||
(Dena1703)
|
||||
(Aja)
|
||||
Max Feraco(Joymax68)
|
||||
(marcela)
|
||||
Vittorio Falegname(Falegname.Vittorio)
|
||||
(Fanny22)
|
||||
(ostecippa)
|
||||
Maria Pecoraro(pecorablu)
|
||||
Talia Felin(Eaglefly)
|
||||
Barby (Bbarbi)
|
||||
Vincenzo Demaio(vincidemi)
|
||||
Loretta (lunaloretta)
|
||||
Isabella (SognoAltea)
|
||||
Tempo di Vivere(tempodivivere.it)
|
||||
(Agotrip)
|
||||
Camillo Granchelli(Kami66)
|
||||
Antonio Graziano(Tonygraziano)
|
||||
(Ambessa)
|
||||
MarinaA (MarinaA)
|
||||
Carmine Cozzolino(Cicciomu)
|
||||
Angela (Angelare)
|
||||
Valentina Portelli(Nonnapapera)
|
||||
Andrea Bozzetto(abozzetto)
|
||||
BCMassimo (BCMassimo)
|
||||
Denis Vignocchi(Denis1970)
|
||||
(Ladycocca)
|
||||
Erica Brunello(Ericabru)
|
||||
Marina S.(Marina22)
|
||||
(Serena.Tre.Stelle)
|
||||
(antonioscioscia)
|
||||
Irene (IreneVit)
|
||||
Shakuntala Tiziana Riva(Shakuntala)
|
||||
(Rosablu)
|
||||
silvia (silvia7)
|
||||
(Rosanna)
|
||||
(Lamary)
|
||||
Luca Sartini(Sarto1978)
|
||||
(Fabiozero)
|
||||
(stefanci87)
|
||||
Raffaella Bonino(Spirale)
|
||||
(Paola_Cr)
|
||||
Elena Turilli(ballerina2909)
|
||||
Luisa Recchia(LuisaRecchia)
|
||||
Enrico Cantamessa(Enrico_Cantamessa)
|
||||
(MariaMasterReiki)
|
||||
Bianca Prugna(BiancaPrugna)
|
||||
Silvia Ruggieri(Liberalux)
|
||||
Erica (erica57)
|
||||
laura nocera(laura.nocera)
|
||||
Federico (eremita222)
|
||||
(Versolaluce)
|
||||
Alejandro (alecanque)
|
||||
(Mauro_EL)
|
||||
Gaetano (GaetanoSant)
|
||||
Natalia (Natalia)
|
||||
Stefania (StefaniaSantag)
|
||||
Giuliana Car(Guglielmina)
|
||||
Georgia Matteini Palmerini(GeorgiaMP)
|
||||
(saraprinc)
|
||||
(iosonoio58)
|
||||
(Ennepi)
|
||||
Silvia lorenza (Silvia88)
|
||||
(Messaggero6)
|
||||
(Carlos)
|
||||
Federico Palla(FedePallaLUMEN)
|
||||
Laura Salvetti(Laura5)
|
||||
Ciro (Riccardo)
|
||||
Sabrina (Sabrinap)
|
||||
Samuele Mastelloni(SamuelMast)
|
||||
Francesca Puppo(Open.curious)
|
||||
Simona Teresa Maria(SimonaPt)
|
||||
(Mila-Roberto)
|
||||
Antonella Scrittrice ecologia quantica(Antoquantica)
|
||||
Samuele Canestri(Evoluzionari)
|
||||
Arcangelo Casavola(arca33)
|
||||
Roberta Annecchino(Roberlina)
|
||||
Antonio Daniele(Antonio_N)
|
||||
(AlessioColombo)
|
||||
(Varia9)
|
||||
(MagiaMirtilla)
|
||||
Emilie Vandecandelaere(Emilie)
|
||||
(Natasha)
|
||||
(marino222)
|
||||
(Moscadri)
|
||||
Rosanna Fantucci(Roxanne)
|
||||
(Andrea_Tiziana)
|
||||
(Ritacam)
|
||||
Michela (michelaC)
|
||||
(DomSap)
|
||||
(L4il4-F)
|
||||
(Luisaaa)
|
||||
(Fly89it)
|
||||
(Annarosa)
|
||||
Nino (Ninosella)
|
||||
(Rosedane)
|
||||
(Marafox)
|
||||
RitaLuisa (RitaLuisa)
|
||||
(Frimel)
|
||||
Sergio (Precisin)
|
||||
(torneremoaballare)
|
||||
(pier_luigi_c)
|
||||
Stella (stella)
|
||||
Silvia (LaBrighid)
|
||||
(marcelloaloe)
|
||||
(Angisan21)
|
||||
Elena (RosEle70)
|
||||
(tilliutaio)
|
||||
Tera (tera0861)
|
||||
(gradar83)
|
||||
Alberto Soverchia(ThinkererSan)
|
||||
Viviana (Viviamarespira)
|
||||
Fulvio Faro(Fulvio_F)
|
||||
Valeria Pastorino(Valeriapastorino)
|
||||
(Robynora)
|
||||
(FrancyVeg72)
|
||||
inTuiziana (TiziaKaja)
|
||||
(rit_ale)
|
||||
(Cyberobe)
|
||||
(MaxCerba)
|
||||
(zelda23)
|
||||
Flavia (flaviaoak)
|
||||
Mario Romeo(zacc50)
|
||||
Samuela (Fioridisole)
|
||||
(cristianodisotto)
|
||||
Zeo (ZeoPleiadi)
|
||||
Ina (lafenjce)
|
||||
(Almaelena)
|
||||
(Robertocnm)
|
||||
(Grazia_22)
|
||||
(Ebiker2000)
|
||||
(JulienQ)
|
||||
Stefania (Metanoeite1973)
|
||||
(texdb70)
|
||||
(LauraRosaMarina)
|
||||
(Francyjones)
|
||||
(raffaele_costi)
|
||||
(RobertoCutillo)
|
||||
(Nicmestre)
|
||||
(Ellis92)
|
||||
(RobertoDCC)
|
||||
(armoniaserena)
|
||||
(Tris2_0)
|
||||
Davide (Metonimia)
|
||||
Elena Esposito(ElenaEspx)
|
||||
Roberto Nicolè(Bobobasss)
|
||||
Maria Rosa Favaro(Cheggioya)
|
||||
(Atmapriya64)
|
||||
Manuela (calendola)
|
||||
(santonimarco)
|
||||
Andrea Roncolini(barbaronx)
|
||||
(Elisagranello)
|
||||
Daniela (dania63)
|
||||
(EtruscanStateless)
|
||||
(Barbara_Nrd)
|
||||
(ClaudiaMariaRosaria)
|
||||
Vivien Russo(vivienru)
|
||||
(Borgomaestro)
|
||||
(letiziaferro)
|
||||
Donatella Parrini(siena1)
|
||||
Patripadova (patripadova)
|
||||
(pomps61)
|
||||
(COFEINA)
|
||||
Monica (Monicainviaggio)
|
||||
(Marititti)
|
||||
(IreneRocca37)
|
||||
(JwalaRegina)
|
||||
(An_el_a)
|
||||
Antonio Ciurlia(joliker)
|
||||
virna (donnacustodedelfuoco)
|
||||
Alessandra (ale_21giugno)
|
||||
(Sante2015)
|
||||
(Alestrale)
|
||||
Michele Padula(Michele_pm)
|
||||
(ritarevathy)
|
||||
Barbara Bonora(BarbaraBonora)
|
||||
Claudio Galassi(Jalsha2)
|
||||
(sganapigi)
|
||||
(gassuper3)
|
||||
(Cibuk176)
|
||||
(Naliber)
|
||||
Cinzia (cavaioni)
|
||||
(Riflessivo33)
|
||||
Erica Rosselli(Erica_Grace)
|
||||
(Nun988)
|
||||
(SimonettaSecchi)
|
||||
(mauribeni)
|
||||
(Ambrig)
|
||||
Fritz Baehler(Fritz_Baehler)
|
||||
(AndreaLemon)
|
||||
(simonetta63)
|
||||
(Laura_C61)
|
||||
Alicia Atzori(aliciaedu)
|
||||
Fede Faith (FedeFaith)
|
||||
(ElisV73)
|
||||
(VentoDiCambiamento)
|
||||
Concetta (Concyrau)
|
||||
Claudio (KenHunter)
|
||||
(danielaw63)
|
||||
(Antonio_Ferrandes)
|
||||
Giacomo (Unicorno_Giacomo)
|
||||
Federica Rizzi(FedericaFezz)
|
||||
JESSICA SHANTA DEVI (JessicaShantaDevi)
|
||||
(Alessia17love)
|
||||
Valeria (Rondinell)
|
||||
(Sidereo1)
|
||||
(Maia_73)
|
||||
Michele (M.Cicl8)
|
||||
Giusi Uc (ARGOGU)
|
||||
Giuseppe (iceborg500)
|
||||
Adriano Lai(AL72MB)
|
||||
Bodhitara (primotintorosso)
|
||||
Daniela Enrico(dan7se)
|
||||
Carmela (carvas5)
|
||||
Ines (Ineswild)
|
||||
Mariana (Mepar68)
|
||||
Fulvio Maresca(Fulvi00)
|
||||
Barbara M(Mnbo_7198)
|
||||
(Valentinabiodanzamindfulness)
|
||||
Luca Moretti(lucamop)
|
||||
Thor (ThorHammering)
|
||||
Laura Sc(LadyLauraSC)
|
||||
(AuryEdy)
|
||||
Tiziana Rimondi(pioggia8)
|
||||
Lara (trotttola)
|
||||
Alessandra Scotti(SulleAliDelCambiamento)
|
||||
Barbarastefania Ruta(matucnv)
|
||||
Stefano (step1608)
|
||||
(avvdona)
|
||||
Fabioa (fabioa_a)
|
||||
(MauMac95)
|
||||
(Millyfor)
|
||||
(edda47)
|
||||
Renzo (Renzosan7)
|
||||
Monia Camillini(monia69)
|
||||
(ottofeel)
|
||||
Loretta Rocchi(Blu_ris)
|
||||
Manuela69 (arcobalen8)
|
||||
Elizabeth (Elizabeth884)
|
||||
Silvia M(silvia418)
|
||||
Patrizia Zucchini(reiki1959)
|
||||
Francesco Rosa(franz12090)
|
||||
Susanna L(Susann1na)
|
||||
(Stonelpluriverso)
|
||||
Silvia Tog(silviatog)
|
||||
Loretta Z(Nove_mbre)
|
||||
Manuel Venturi(Manuel84d)
|
||||
Massimo Longati(Tranquillio)
|
||||
Emanuela (mondobiblio)
|
||||
(salute_yoga)
|
||||
Angela M.(Quanyin08)
|
||||
Sokol (LokoSaK)
|
||||
Nicole (NikkiZilli)
|
||||
Alberto Mengoni(Alberto_Mengoni)
|
||||
Jen B(Jenny_B)
|
||||
Laura Latticini(Lauralatt)
|
||||
Davide Mazzavillani(MazzavillaniDavide)
|
||||
Valerio D'alessio(Valerix64)
|
||||
Anna Bellet(Naanbe)
|
||||
Laura (lauraghini)
|
||||
Fabio Panciera(FabioPnc)
|
||||
Antonio (Napoleone2)
|
||||
Pianta (Didonemma)
|
||||
Annarita (TortellinaZen16)
|
||||
Maria Garofalo(marygary71)
|
||||
Girolamo (teacarfu)
|
||||
Erica (ericaalberonido)
|
||||
Eleonora Mora(EleVegan)
|
||||
Ciro Famiglietti(cirofamigliettivegan)
|
||||
Andrea (carpis77)
|
||||
Sandra Zamboni(alessandramondo)
|
||||
Federico (FedeSo72)
|
||||
(Dilu_69)
|
||||
Sonia Boni(Sonia28358)
|
||||
Su Fiu(SusanFiu)
|
||||
(Debbiesole)
|
||||
(Sole_4gatti)
|
||||
Ugo Maccaferri(Cavallo1011)
|
||||
Gabriella (gabriella_bologna)
|
||||
(Natural_68)
|
||||
Daniela De Simone(DanielaDeSimone)
|
||||
Katia (Katia_g83)
|
||||
David Martinī(Davidcasaviva)
|
||||
Milvia (Mil2227)
|
||||
Susi (frida71)
|
||||
Romina Martini(rominamartini)
|
||||
Deborah (ilventoeilbambu)
|
||||
Daniela Rogue5(Rogue571)
|
||||
Federico Paci(spadroneggio)
|
||||
Giusy ❤️ (giusylove)
|
||||
Giovanbattista Romano(Gianni_Romano_Coach)
|
||||
Ferdy (fernandoaloise)
|
||||
Laura Galli(Laurastella8)
|
||||
Leonardo (marconeuno)
|
||||
Arianna (AriannaTurchi)
|
||||
(Teresabmt)
|
||||
Matteo (Gandalf_il_verde)
|
||||
Alberto (AlbertG11)
|
||||
(EnryZord)
|
||||
Genoveffa Chiummo(louis_thelbri)
|
||||
Vanda (Vandanatalina)
|
||||
Dino Stella(Dinostella)
|
||||
Paola (Ubuntu75)
|
||||
Simone (DottorMaxillo)
|
||||
Lina Giardina(linagia)
|
||||
Rosaria (RosariaM23)
|
||||
Maurizio (mauriziola)
|
||||
Zacerchiataf (ZacerchiataF)
|
||||
Tiziana (tiziada)
|
||||
Nino (Cascant17)
|
||||
Tom (Tom21me)
|
||||
Franco Ciccio(Cicciofranco1964)
|
||||
Elena (Lanatama)
|
||||
Rossella (Animalibera62)
|
||||
Caterina (lcaterina)
|
||||
Adelina (Adelinafo)
|
||||
Cat (CatCat969)
|
||||
Lor (Lori_2)
|
||||
Giancarlo (giancalopresti)
|
||||
Maria Angela (masavoca)
|
||||
Francesco Musumeci(francescomusumeci7)
|
||||
Stefania (cucunci)
|
||||
Giusy Iam(giusyfashion)
|
||||
Maria Antonietta (noirginger)
|
||||
Angelo Spitale(AngeloSPIT)
|
||||
Sergio (sergiookarte)
|
||||
Daniele (DanieleSantinoA)
|
||||
Ermete Trismegisto(Ermete)
|
||||
Angela Raffaele(Angela_rfl)
|
||||
Vincenzo Torrisi(V1nce22)
|
||||
Mimmo Aloisio(Mimmutsu)
|
||||
Clelia Acireale (Cleocost)
|
||||
Margherita Fassari(MargheritadiCanalicchioterramore)
|
||||
Orazio (Orazio369)
|
||||
Consuelo (Consuelo_Messina)
|
||||
Daniela (Maemouna)
|
||||
Max Are(Edificium)
|
||||
Sebastiano (Vera1169)
|
||||
Merope (Merope)
|
||||
Giuli (giuliperilla)
|
||||
Valentina Pica(AttivacreaVale)
|
||||
Silvia Grilli(silviagrilli)
|
||||
Giuseppe (Gilgamesh72)
|
||||
(irenect)
|
||||
Alice_zen 🌺 (alice_zen)
|
||||
totò Grilletto(totogrilletto)
|
||||
Emilia (Emilia6613)
|
||||
Lorella (Corivitto)
|
||||
Giusy (Giuppass)
|
||||
Pamela (Q709fok)
|
||||
Salvatore Lo Giudice(Haku_tato)
|
||||
Giuseppina (Giuscrescim)
|
||||
Gaetano (Gaetano)
|
||||
Luigi (IAM09111967)
|
||||
Roberto (RobertoAudio)
|
||||
(Michele_Libero)
|
||||
Monica Sapio(monicasapio)
|
||||
Armando Lembo(harlem8)
|
||||
Simona (SimonaTrinart)
|
||||
Gianpiero (GianpieroC)
|
||||
Maria (MariaCal14)
|
||||
Antonio (antonio338)
|
||||
(RaffaellaBeauty)
|
||||
Antonino Castronovo(AntonAC)
|
||||
Andrea (Ubanjix)
|
||||
Marit (Scineve)
|
||||
Stefania Castagnozzi(Blue_Lagoon_111)
|
||||
lorenzo cambria(lorsindi)
|
||||
Rossella Cazzaniga(canoneinversotappeti)
|
||||
Antonella Ciucci(lantoanto)
|
||||
Stefano Viola(stef1269)
|
||||
Cla (Sesamo)
|
||||
Dario (Liune64)
|
||||
Leonardo (leonardoloscalzo)
|
||||
Giovanni Gorgone(giovannigorgone)
|
||||
Serena Giudici(mammamago)
|
||||
m.irene (irene13angeli)
|
||||
(moretta369)
|
||||
Damiano Lupezza(Damiano)
|
||||
Daniele (SistemaCorrotto)
|
||||
Sara Eligio(sarakey73)
|
||||
Stefilibera (Stefilibera)
|
||||
Francesca (es_pery15)
|
||||
Edel (Passinelsole)
|
||||
Marco (tyrchyus)
|
||||
Silvia (sillabasibilla)
|
||||
Simona Curatolo(Simona_CreaIdeando)
|
||||
(MarySaraJane)
|
||||
Monica (Merylav)
|
||||
Daniela (Jessiremi)
|
||||
Michela (Cive_13)
|
||||
Monique (Quattropeli)
|
||||
Leonardo (ldproma)
|
||||
Lauram (Laura7117)
|
||||
Armando Dolcini(adolcini)
|
||||
Giorgia Rita Zanellato(Giory73)
|
||||
Stefania (Stefyzann)
|
||||
Riccardo (RikyBalboa)
|
||||
Simona Meazzini(SimonAyurveda)
|
||||
Leda (altre_vie)
|
||||
Oreste (Forrest81)
|
||||
Roberta Carluccio(Famcarluccio)
|
||||
Inge369 (Inge369)
|
||||
Marzel M(zecastighetor)
|
||||
(Vetromile1975)
|
||||
Cinzia (Red_Naomi8)
|
||||
(natalina_candelo)
|
||||
Roberta (Ro_by7)
|
||||
Giovanna Moretti(Giom.VT)
|
||||
Cristina Marinelli(criss71)
|
||||
Sabrina (SabrinaStrozzi)
|
||||
Stefano Francesco Piva(Steve31958)
|
||||
Giacomo Bortoluzzi(JackBorto)
|
||||
Ileana Ziani(Ileana63)
|
||||
Marco (Marketto)
|
||||
Raffaella (roverella19)
|
||||
(ptommaso90)
|
||||
Grace (acia75)
|
||||
Giuliana B(GiulianaB88)
|
||||
Mariella (Mariella_Pichi)
|
||||
Marina Fiori(fiorimarina)
|
||||
(AngelaEnzingara)
|
||||
Cucu (Peterin0)
|
||||
(Eledibe)
|
||||
David Fogazza(DavFog)
|
||||
Giulia (julybi)
|
||||
Federica (Federicas04)
|
||||
Spyke Jones(SpykeJones)
|
||||
(ElenaLc)
|
||||
Ines Carlu(ineesee)
|
||||
Vivy x BORGO cohousing (vivy_BORGO_cohousing)
|
||||
(Nocciolo)
|
||||
Stefano (Stefano_93)
|
||||
Emilio Costantino Belmonte(iTecnologici)
|
||||
(ClaudProv)
|
||||
(CarFlora)
|
||||
Angelo (cavallo62)
|
||||
Marco (Marlet)
|
||||
Donata Guerci(Dona_1971)
|
||||
(stefanoTS)
|
||||
Lucie (Lu_Ma_03)
|
||||
Lorenza Beltrami(Lorenz_Lo)
|
||||
Claudia Barontini(CB1972)
|
||||
Paola Medeot(Paolamedeot)
|
||||
(LiberaValente)
|
||||
Roberto Sorato(Roby81)
|
||||
Carla (ribeka786)
|
||||
Nunzio (Nunzio1980)
|
||||
Alessandro Cavalli(Alecava496)
|
||||
Daniela Lazzarotto(daniela1511)
|
||||
Silvia Santagata(Silvia121Artist)
|
||||
(Tzilli_0)
|
||||
Alessandra (alessandrapiani)
|
||||
Antonia Bianco(biancainot)
|
||||
Nadia (Speranza10)
|
||||
Mimmo (MimmoUstica)
|
||||
Claudio Panicali(ClaudioDellaCoscienza)
|
||||
Raga (Ragaliliana)
|
||||
Anna D'acunio(annadac61)
|
||||
Ippolito (Ippolito)
|
||||
Sabrina Aguiari(sabracadabrax)
|
||||
Milena (milly4always)
|
||||
Damiano Furlan(FurioShin)
|
||||
Angela Rebeschini(dunia_iride)
|
||||
Fabio (Fabiobrent)
|
||||
Anna (AllaLuce)
|
||||
Chiara (chiara821)
|
||||
(Silvielli)
|
||||
Sandra (Ildega)
|
||||
Marco Campisano(Marcoscimmia)
|
||||
(Maicolnait)
|
||||
Nadia T.(Nadia_348)
|
||||
Alessandro Grasso(tutarancio)
|
||||
Riccardo Menolotto(riccardomenolotto)
|
||||
Luisa (luisageromet)
|
||||
(lollo22k)
|
||||
Fulvio Tango(AirblueFulvio)
|
||||
Mattia Bondi(MattiaBondi)
|
||||
Enza Restuccia(Vinrest22)
|
||||
(visvital)
|
||||
Piero Mazza(piterpm)
|
||||
Valentina Benedetti(ValeCipcip)
|
||||
Angelo Benedetto (Hamayl)
|
||||
Laura (PSailormoon)
|
||||
Gianluca Pavan(loziodm)
|
||||
Stefania Meda(Stefanya66)
|
||||
(LiberoEnri)
|
||||
Patrizia Chiara (TempoYoga)
|
||||
Miro (shining)
|
||||
Umberto (Umberto)
|
||||
Cinzia Cassandro(dollybonbon)
|
||||
Luciana (travaluci)
|
||||
Giulio Sassetti(giulsass)
|
||||
Valeria Civardi(Vallicivardi57)
|
||||
(Erica80)
|
||||
Lorena (LoBa82)
|
||||
Marco Ronzitti(Marco71CB)
|
||||
Terry (Terry00025)
|
||||
GiuliaAdele (Ilpontediluce)
|
||||
Barbara (Gelsomina25)
|
||||
(Monoinique)
|
||||
Harry Tallarita(HarryTallarita)
|
||||
L’aurariel (parolainterna)
|
||||
Marcos Cé(RaccoglitoriEclettici)
|
||||
(Rosangela)
|
||||
Robi (robertopigazzi)
|
||||
Giovanni (Giovanni_1066)
|
||||
Simona (sichilab)
|
||||
(gianca1210)
|
||||
Gloria (Smalll13)
|
||||
Manuela (Magdaleine76)
|
||||
(Arc_en_ciel_6)
|
||||
Barbara (Stelle74)
|
||||
Jessica BlackMagic(JesBMagic)
|
||||
Claudio Taroppi(CriptoSophia)
|
||||
Frank (Frankkk22F)
|
||||
(Anette)
|
||||
Emanuele (gemanuele)
|
||||
Lara Canevese(LaraCanevese)
|
||||
(Xeniasanvito)
|
||||
Giuseppe (lupobranco)
|
||||
Fabiana (fabiale69)
|
||||
(NickyvanderLaan)
|
||||
Diana (Diana_ddag)
|
||||
(Denna4)
|
||||
Atena (cascinaboccida)
|
||||
(Diegopinna)
|
||||
Paolo 8pax(Paolo8PAX)
|
||||
Gianni (iugola72)
|
||||
Letizia Gozzini(LetiziaFooFigthers64)
|
||||
Giacomo Di Fabio(Giacomo_1979)
|
||||
Franco (francomario)
|
||||
Lisa Franceschini(Lisa83)
|
||||
Carola (Carola)
|
||||
(Fatinaalc)
|
||||
(SuryaArena)
|
||||
Ale (Florealefiore)
|
||||
Alessandra (ale_5679)
|
||||
Sonia (SoniaCri)
|
||||
Federico (frixxx)
|
||||
Anna (biapanna)
|
||||
Mik (MikelaPi)
|
||||
(Giovannifruttadisicilia)
|
||||
Barbara Matteucci(BarbaraMatt)
|
||||
Ariette (ArietteMorano)
|
||||
Roberta Civirani (Robynlorien)
|
||||
Marina (Norminiax)
|
||||
Elisa Carbonetti(Nonnanena)
|
||||
Marinella Galletti(marinella964)
|
||||
Graziana Ungarelli(nonsiemaisoli)
|
||||
Agnese Ferrari(Agny11)
|
||||
Giovanna Simoni(Gio8marzo)
|
||||
Marta (Martasel)
|
||||
Luca Fraulini(FrauliniLuca)
|
||||
Maria Valentina Bresciani(Valesolovale)
|
||||
Onorio (Onorio69)
|
||||
Cristina (tictac1972)
|
||||
Cla (Clayoga77)
|
||||
Massimo Cognome(mcomparin)
|
||||
Marcola (Marcyfi)
|
||||
(BarbaraMiz)
|
||||
(TGuga)
|
||||
MARCO COPPOLA(MarcoTullioAntonio)
|
||||
Alessandra Barresi(Alessandra_Barresi)
|
||||
Paola Tierri(Paola0503)
|
||||
Gianluca Vannini(Cucca60)
|
||||
Lorena Benigna(lorenabenigna)
|
||||
(MF81B)
|
||||
(maema67)
|
||||
Miriam Notarangelo(LisandraFatina)
|
||||
Giulietta Gnutti(Giu_733)
|
||||
(SismaLux)
|
||||
Francesca (francescalivorno)
|
||||
(MarisaConti)
|
||||
Ale Mare(AlesMare)
|
||||
Anna Maria (accoglienzaa)
|
||||
Sebastiano (pielento)
|
||||
Stefano Giordano(Sankari9)
|
||||
Leon (Umanolistico)
|
||||
(Andrea_di_STATO_Calautti)
|
||||
Calliope (Calliopesca)
|
||||
Simona Turiano(simoNaturopata)
|
||||
Paola (alaya562)
|
||||
Andrea Sturniolo(yosoyvoz)
|
||||
(albertinamarinelli)
|
||||
Graziella (mammalella960)
|
||||
(memorelax)
|
||||
Francesca Marinelli(FrancescaM68)
|
||||
Patrizia (PattyChiarissimi)
|
||||
Marco Rastelli(marcorastelli)
|
||||
Gianni Bianco(ireteditore)
|
||||
(ClaudiaCalabria)
|
||||
Filo (i7specchi)
|
||||
(Charms64)
|
||||
(Lore12345670)
|
||||
Letizia 🌞 (Rissho_Ankoku_Ron)
|
||||
(AnnitaSpinelli)
|
||||
Franca Marin(FrancaM33)
|
||||
(Micbo77)
|
||||
(danieleduboin)
|
||||
(IvanoBo81)
|
||||
Patrizia Alvisi(Paciccia65)
|
||||
Stefano Baratti(StefanoB)
|
||||
(Sabrina_Monticelli)
|
||||
Natascia (Natty_Natty71)
|
||||
Riccardo Tonelli(crescerelaluce)
|
||||
(ClaudioFa)
|
||||
Grazia (GraziaGa)
|
||||
Giorgio (giorgio_p75)
|
||||
Massimo Trustee De Vita(Mcgiverbis)
|
||||
Adriana (AfeWellmade)
|
||||
(Ceramichedeby)
|
||||
(Erby66)
|
||||
Elena Trustee Marino(ALLEANZAdelDONO)
|
||||
Luca (Lucavernicolo)
|
||||
(LaraDea)
|
||||
Marie V(massaiarurale)
|
||||
Giuseppe Mercone(Enomerc82)
|
||||
Giovanni Canu(gheo3)
|
||||
Davide (Pippillino)
|
||||
(Kia_10)
|
||||
Leonardo (Leonardo2823)
|
||||
Fabio (Cecefabene)
|
||||
Paolo (PaUD70)
|
||||
(Gnampolo)
|
||||
franz (franz)
|
||||
araceli de la parra(liladivineplay)
|
||||
Mamo Bel(mamo_bel)
|
||||
Rossella (MazzuRoss)
|
||||
(Lellagab)
|
||||
Enzo Fazzino(enzofazzino)
|
||||
(Joska69)
|
||||
Pamela (Pami74Veronza)
|
||||
Iglis (Ziglis)
|
||||
(Mirella64)
|
||||
(carmen_bologna)
|
||||
Emi (EmiEllis)
|
||||
David Lendaro(dlend80)
|
||||
(FeelGM)
|
||||
Daniele Spina(Vincente7)
|
||||
Gloria Camporesi(picipaci)
|
||||
(Bibessa)
|
||||
Ruben Antonio Vladilo(Ruben369)
|
||||
Stefano Succi(Abbastanza_asociale)
|
||||
Andrea (Falko2222)
|
||||
Barbara (bosco2017)
|
||||
(AntonyHopi)
|
||||
(elsamoretto)
|
||||
Michele Ceccarelli(michelececca)
|
||||
Fabiana Nicoletti(Fabiananico)
|
||||
(Canacaya)
|
||||
(marziamoon)
|
||||
Sara (SaraRiflePla)
|
||||
Letizia Bergamini(Laetitia73)
|
||||
Lucia Mistrali(LuciaMistrali)
|
||||
(Rita_Lila)
|
||||
Lidia (bjoyautenticipernatura)
|
||||
Andrea (apasquali)
|
||||
Laura (Lauratabs)
|
||||
Noemi (NoemiJosephine)
|
||||
Ombretta Cecchetti(OmbrettaCecchetti)
|
||||
(MyGrace)
|
||||
Sebastiano Parmegiani(ZSeba)
|
||||
Simona (GiulioLunaLuce)
|
||||
Sara (sarabaraldi23)
|
||||
Mirca Forcellini(donnainevoluzione)
|
||||
(ciccibicci3)
|
||||
(Donpersival)
|
||||
Alessia (CentrOlisticoShanti)
|
||||
Robi G.(robig67)
|
||||
Cristina (cristina_espo)
|
||||
(Buc14)
|
||||
(Paperlella)
|
||||
Sergio Salutati(Sesarinos)
|
||||
Arianna (Tricric)
|
||||
(nikydeva)
|
||||
(SoloMario)
|
||||
Anna (Oona79)
|
||||
Barbara (Barbie)
|
||||
(ElisabettaTraficante)
|
||||
Gabriele Daprai(Gabry75)
|
||||
Massimo Costacurta(ilcosta54)
|
||||
(Katia)
|
||||
(isabellina1)
|
||||
Riccardo (riccaudace)
|
||||
(Gherarda24)
|
||||
Antonio Sorbello(antoniosorbello)
|
||||
Eric Souqi(GAMBERON3)
|
||||
Fabio Ricci(Fabioricci74)
|
||||
Daniela Stranieri(isolachenonce)
|
||||
Roberto (turo951)
|
||||
Laura (NOGIPPI)
|
||||
|
||||
Mer 24/04 ORE 20:44: APPARTIENE_CIRCUITO_RIS:
|
||||
contasolo
|
||||
Mer 24/04 ORE 20:44: 703 ✉️ Messaggi da Inviare
|
||||
Mer 24/04 ORE 20:45: 🤖: Da Sùrya (Paolo) (paoloar77):
|
||||
invia a paolo
|
||||
Mer 24/04 ORE 20:45: 🤖: Da Sùrya (Paolo) (paoloar77):
|
||||
📨 invia a paolo
|
||||
Mer 24/04 ORE 20:46: PAOLO:
|
||||
💚🍚 Cari membri dei Circuiti Ris,
|
||||
quando siete entrati nel vostro circuito territoriale, avete dichiarato di avere letto e approvato il Regolamento di funzionamento dei Circuiti Ris.
|
||||
|
||||
📖 Leggi qui il Regolamento
|
||||
|
||||
Il gruppo dei Facilitatori Territoriali di RISO ha individuato un punto che necessita di chiarimenti, per rendere più esplicito un meccanismo già presente nel testo stesso. Propone dunque di aggiungere una nota esplicativa (vedi asterisco *) alla seguente frase del Regolamento (indicata in corsivo):
|
||||
|
||||
➡️ "… Ciascun detentore di un saldo negativo concorda che la sua esposizione funge da garanzia della quantità di Ris equivalenti circolanti nel circuito e che può essere chiamato a regolarizzare con equivalente pagamento in euro *, entro un lasso di tempo ragionevolmente adeguato, nel caso in cui: la Comunità, in accordo con il Gruppo Tecnico, deliberi il rientro di alcune posizioni con decisione motivata; l’utente decida di uscire per motivi personali; il circuito chiuda, per decisione deliberata o per motivi di forza maggiore.”
|
||||
|
||||
✅ * La regolarizzazione può avvenire con equivalente valore in beni e servizi, oppure, in ultima istanza, con pagamento in euro.
|
||||
|
||||
📣 Invitiamo tutti a prendere visione della proposta, e ad esprimere eventuali osservazioni nel Gruppo Territoriale, oppure come commento a questo stesso post, pubblicato sul canale Progetto RISO, entro il giorno 5 maggio!
|
||||
|
||||
https://t.me/riso_canale/739
|
||||
|
||||
In attesa di riscontri, salutiamo! 🍚💚
|
||||
Il gruppo dei Facilitatori Territoriali RISO
|
||||
Mer 24/04 ORE 20:46: 1 ✉️ Messaggi Inviati !
|
||||
Mer 24/04 ORE 20:48: PAOLO:
|
||||
PROVA GRASSETTO
|
||||
Mer 24/04 ORE 20:48: 1 ✉️ Messaggi Inviati !
|
||||
Mer 24/04 ORE 20:58: 🤖: Da Sùrya (Paolo) (paoloar77):
|
||||
grass e prova italic
|
||||
Mer 24/04 ORE 21:11: PAOLO:
|
||||
grass e prova italic
|
||||
Mer 24/04 ORE 21:11: 1 ✉️ Messaggi Inviati !
|
||||
Mer 24/04 ORE 21:19: PAOLO:
|
||||
grass e prova italic
|
||||
Mer 24/04 ORE 21:19: 1 ✉️ Messaggi Inviati !
|
||||
Mer 24/04 ORE 21:32: PAOLO:
|
||||
❗️IMPORTANTE❗️
|
||||
|
||||
💚🍚 Cari membri dei Circuiti Ris,
|
||||
quando siete entrati nel vostro circuito territoriale, avete dichiarato di avere letto e approvato il Regolamento di funzionamento dei Circuiti Ris.
|
||||
|
||||
📖 Leggi qui il Regolamento
|
||||
|
||||
Il gruppo dei Facilitatori Territoriali di RISO ha individuato un punto che necessita di chiarimenti, per rendere più esplicito un meccanismo già presente nel testo stesso. Propone dunque di aggiungere una nota esplicativa (vedi asterisco *) alla seguente frase del Regolamento (indicata in corsivo):
|
||||
|
||||
➡️ "… Ciascun detentore di un saldo negativo concorda che la sua esposizione funge da garanzia della quantità di Ris equivalenti circolanti nel circuito e che può essere chiamato a regolarizzare con equivalente pagamento in euro *, entro un lasso di tempo ragionevolmente adeguato, nel caso in cui: la Comunità, in accordo con il Gruppo Tecnico, deliberi il rientro di alcune posizioni con decisione motivata; l’utente decida di uscire per motivi personali; il circuito chiuda, per decisione deliberata o per motivi di forza maggiore.”
|
||||
|
||||
✅ * La regolarizzazione può avvenire con equivalente valore in beni e servizi, oppure, in ultima istanza, con pagamento in euro.
|
||||
|
||||
📣 Invitiamo tutti a prendere visione della proposta, e ad esprimere eventuali osservazioni nel Gruppo Territoriale, oppure come commento a questo stesso post, pubblicato sul canale Progetto RISO, entro il giorno 5 maggio!
|
||||
|
||||
https://t.me/riso_canale/739
|
||||
|
||||
In attesa di riscontri, salutiamo! 🍚💚
|
||||
Il gruppo dei Facilitatori Territoriali RISO
|
||||
Mer 24/04 ORE 21:32: 1 ✉️ Messaggi Inviati !
|
||||
Mer 24/04 ORE 21:35: PAOLO:
|
||||
prova
|
||||
Mer 24/04 ORE 21:35: 1 ✉️ Messaggi Inviati !
|
||||
Mer 24/04 ORE 21:58: APPARTIENE_CIRCUITO_RIS:
|
||||
SDADA
|
||||
Mer 24/04 ORE 22:01: APPARTIENE_CIRCUITO_RIS:
|
||||
❗️IMPORTANTE❗️
|
||||
|
||||
💚🍚 Cari membri dei Circuiti Ris,
|
||||
quando siete entrati nel vostro circuito territoriale, avete dichiarato di avere letto e approvato il Regolamento di funzionamento dei Circuiti Ris.
|
||||
|
||||
📖 Leggi qui il Regolamento
|
||||
|
||||
Il gruppo dei Facilitatori Territoriali di RISO ha individuato un punto che necessita di chiarimenti, per rendere più esplicito un meccanismo già presente nel testo stesso. Propone dunque di aggiungere una nota esplicativa (vedi asterisco *) alla seguente frase del Regolamento (indicata in corsivo):
|
||||
|
||||
➡️ "… Ciascun detentore di un saldo negativo concorda che la sua esposizione funge da garanzia della quantità di Ris equivalenti circolanti nel circuito e che può essere chiamato a regolarizzare con equivalente pagamento in euro *, entro un lasso di tempo ragionevolmente adeguato, nel caso in cui: la Comunità, in accordo con il Gruppo Tecnico, deliberi il rientro di alcune posizioni con decisione motivata; l’utente decida di uscire per motivi personali; il circuito chiuda, per decisione deliberata o per motivi di forza maggiore.”
|
||||
|
||||
✅ * La regolarizzazione può avvenire con equivalente valore in beni e servizi, oppure, in ultima istanza, con pagamento in euro.
|
||||
|
||||
📣 Invitiamo tutti a prendere visione della proposta, e ad esprimere eventuali osservazioni nel Gruppo Territoriale, oppure come commento a questo stesso post, pubblicato sul canale Progetto RISO, entro il giorno 5 maggio!
|
||||
|
||||
https://t.me/riso_canale/739
|
||||
|
||||
In attesa di riscontri, salutiamo! 🍚💚
|
||||
Il gruppo dei Facilitatori Territoriali RISO
|
||||
Mer 24/04 ORE 22:02: 🤖: Da Sùrya (Paolo) (paoloar77):
|
||||
✅ la regolarizzazione può avv
|
||||
199
logtrans.txt
Normal file
199
logtrans.txt
Normal file
@@ -0,0 +1,199 @@
|
||||
|
||||
Lun 06/02 ORE 23:13: Inviate Monete da paoloar77 a surya1977 1 RISTEST [] [Saldo 1: -50] [Saldo 2: 5]
|
||||
Lun 06/02 ORE 23:15: Inviate Monete da paoloar77 a surya1977 1 RISTEST [causale: ] [Saldo 1: -51 RISTEST] [Saldo 2: 6 RISTEST ]
|
||||
Lun 06/02 ORE 23:17: Inviate Monete da paoloar77 a surya1977 1 RISTEST [causale: ] [Saldo paoloar77: -52 RISTEST] [Saldo surya1977: 7 RISTEST]
|
||||
Dom 12/03 ORE 13:35: Inviate Monete da paoloar77 a 1 RIS [causale: ] [Saldo paoloar77: 3 RIS] [Saldo : 2 RIS]
|
||||
Mer 15/03 ORE 22:15: Inviate Monete da pontiUmani (paoloar77) a paoloar77 1 RIS [causale: ] [Saldo pontiUmani (paoloar77): 1 RIS] [Saldo paoloar77: 4 RIS]
|
||||
Mer 15/03 ORE 22:37: Inviate Monete da pontiUmani (paoloar77) a surya1977 1 RIS [causale: ] [Saldo pontiUmani (paoloar77): 0 RIS] [Saldo surya1977: 1 RIS]
|
||||
Ven 28/04 ORE 01:33: Inviate Monete da surya1977 a risotest 1 RISTEST [causale: ] [Saldo surya1977: 0 RISTEST] [Saldo risotest: 9.5 RISTEST]
|
||||
Gio 01/06 ORE 12:22: Inviate Monete da paoloar77 a surya1977 1 RIS [causale: ] [Saldo paoloar77: -2 RIS] [Saldo surya1977: 1 RIS]
|
||||
Gio 01/06 ORE 12:25: Inviate Monete da paoloar77 a surya1977 2 RIS [causale: ] [Saldo paoloar77: -4 RIS] [Saldo surya1977: 3 RIS]
|
||||
Gio 01/06 ORE 12:31: Inviate Monete da paoloar77 a surya1977 4 RIS [causale: ] [Saldo paoloar77: -8 RIS] [Saldo surya1977: 7 RIS]
|
||||
Gio 01/06 ORE 17:26: Inviate Monete da paoloar77 a surya1977 1 RIS [causale: ] [Saldo paoloar77: -9 RIS] [Saldo surya1977: 8 RIS]
|
||||
Gio 01/06 ORE 17:41: Inviate Monete da paoloar77 a surya1977 1 RIS [causale: ] [Saldo paoloar77: -10 RIS] [Saldo surya1977: 9 RIS]
|
||||
Ven 02/06 ORE 19:29: Inviate Monete da paoloar77 a 2 RIS [causale: ] [Saldo paoloar77: 8 RIS] [Saldo : -261 RIS]
|
||||
Ven 02/06 ORE 19:31: Inviate Monete da paoloar77 a pontiUmani 4 RIS [causale: ] [Saldo paoloar77: 0 RIS] [Saldo pontiUmani: -253 RIS]
|
||||
Lun 26/06 ORE 23:23: [<b>Circuito RIS Ragusa</b>]: Inviate Monete da risragusa (paoloar77) a paogruppo2 300 RIS [causale: aaa]
|
||||
Saldi:
|
||||
risragusa (paoloar77): -300 RIS]
|
||||
paogruppo2: 300 RIS]
|
||||
Lun 26/06 ORE 23:27: [<b>Circuito RIS Ragusa</b>]: Inviate Monete da paoloar77 a paogruppo2 20 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -20 RIS]
|
||||
paogruppo2: 320 RIS]
|
||||
Sab 30/09 ORE 13:32: [<b>Circuito RIS Bologna</b>]: Inviate Monete da SuryaArena a paoloar77 1 RIS [causale: aaa]
|
||||
Saldi:
|
||||
SuryaArena: -1 RIS]
|
||||
paoloar77: 11 RIS]
|
||||
Lun 09/10 ORE 09:04: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a SuryaArena2 1 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -2 RIS]
|
||||
SuryaArena2: 1 RIS]
|
||||
Lun 09/10 ORE 09:21: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a SuryaArena2 1 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -3 RIS]
|
||||
SuryaArena2: 2 RIS]
|
||||
Lun 09/10 ORE 10:25: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a SuryaArena2 1 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -4 RIS]
|
||||
SuryaArena2: 3 RIS]
|
||||
Lun 09/10 ORE 10:26: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a SuryaArena2 1 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -5 RIS]
|
||||
SuryaArena2: 4 RIS]
|
||||
Lun 09/10 ORE 23:26: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a SuryaArena2 1 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -2 RIS]
|
||||
SuryaArena2: 1 RIS]
|
||||
Lun 09/10 ORE 23:36: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a SuryaArena2 1 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -3 RIS]
|
||||
SuryaArena2: 2 RIS]
|
||||
Lun 09/10 ORE 23:36: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a SuryaArena2 1 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -4 RIS]
|
||||
SuryaArena2: 3 RIS]
|
||||
Mar 10/10 ORE 00:04: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a SuryaArena2 1 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -5 RIS]
|
||||
SuryaArena2: 4 RIS]
|
||||
Mar 10/10 ORE 00:21: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a SuryaArena2 1 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -6 RIS]
|
||||
SuryaArena2: 5 RIS]
|
||||
Mar 10/10 ORE 00:34: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a SuryaArena2 1 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -7 RIS]
|
||||
SuryaArena2: 6 RIS]
|
||||
Mar 10/10 ORE 22:47: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a PaoTEST1 1 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -8 RIS]
|
||||
PaoTEST1: 1 RIS]
|
||||
Mar 10/10 ORE 22:49: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a PaoTEST1 1 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -9 RIS]
|
||||
PaoTEST1: 2 RIS]
|
||||
Mar 10/10 ORE 23:08: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a PaoTEST1 2 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -11 RIS]
|
||||
PaoTEST1: 4 RIS]
|
||||
Mar 10/10 ORE 23:13: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a PaoTEST1 3 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -14 RIS]
|
||||
PaoTEST1: 7 RIS]
|
||||
Mar 10/10 ORE 23:22: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a PaoTEST1 1 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -15 RIS]
|
||||
PaoTEST1: 8 RIS]
|
||||
Mer 11/10 ORE 22:33: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a PaoTEST1 1 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -16 RIS]
|
||||
PaoTEST1: 9 RIS]
|
||||
Gio 12/10 ORE 08:05: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a PaoTEST1 1 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -17 RIS]
|
||||
PaoTEST1: 10 RIS]
|
||||
Gio 12/10 ORE 08:06: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a SuryaArena2 1 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: -18 RIS]
|
||||
SuryaArena2: 7 RIS]
|
||||
Mer 29/11 ORE 16:35: [<b>Circuito RIS Italia</b>]: Inviate Monete da SuryaArena a paoloar77 5 RIS [causale: Seconda]
|
||||
Saldi:
|
||||
SuryaArena: -5 RIS]
|
||||
paoloar77: 5 RIS]
|
||||
Mer 29/11 ORE 16:44: [<b>Circuito RIS Italia</b>]: Inviate Monete da SuryaArena a paoloar77 3 RIS [causale: Eccolo]
|
||||
Saldi:
|
||||
SuryaArena: -8 RIS]
|
||||
paoloar77: 8 RIS]
|
||||
Mer 29/11 ORE 16:50: [<b>Circuito RIS Italia</b>]: Inviate Monete da SuryaArena a paoloar77 3 RIS [causale: Ricevuto un bel massaggio]
|
||||
Saldi:
|
||||
SuryaArena: -11 RIS]
|
||||
paoloar77: 11 RIS]
|
||||
Mer 29/11 ORE 16:52: [<b>Circuito RIS Bologna</b>]: Inviate Monete da SuryaArena a paoloar77 4 RIS [causale: Un bel massaggio con olio caldo]
|
||||
Saldi:
|
||||
SuryaArena: -4 RIS]
|
||||
paoloar77: 14 RIS]
|
||||
Mer 29/11 ORE 17:14: [<b>Circuito RIS Italia</b>]: Inviate Monete da SuryaArena a paoloar77 2 RIS [causale: Massaggio !]
|
||||
Saldi:
|
||||
SuryaArena: -13 RIS]
|
||||
paoloar77: 13 RIS]
|
||||
Gio 04/01 ORE 14:00: [<b>Euro</b>]: Inviate Monete da PaoloRiso a piuchebuono 44.4 € [causale: Pagato Ordine n.101]
|
||||
Saldi:
|
||||
PaoloRiso: -44.4 €]
|
||||
piuchebuono: 44.4 €]
|
||||
Dom 07/01 ORE 16:22: [<b>Euro</b>]: Inviate Monete da PaoloRiso a 44.4 € [causale: Pagato Ordine n.101]
|
||||
Saldi:
|
||||
PaoloRiso: -44.4 €]
|
||||
: 44.4 €]
|
||||
Dom 07/01 ORE 16:24: [<b>Euro</b>]: Inviate Monete da PaoloRiso a 44.4 € [causale: Pagato Ordine n.101]
|
||||
Saldi:
|
||||
PaoloRiso: -88.8 €]
|
||||
: 88.8 €]
|
||||
Ven 16/02 ORE 13:51: [<b>Euro</b>]: Inviate Monete da PaoloRiso a piuchebuono 9.6 € [causale: Pagato Ordine n.169]
|
||||
Saldi:
|
||||
PaoloRiso: -98 €]
|
||||
piuchebuono: 1109.1799999999998 €]
|
||||
Ven 16/02 ORE 13:57: [<b>Euro</b>]: Inviate Monete da Barbara a piuchebuono 15.6 € [causale: Pagato Ordine n.171]
|
||||
Saldi:
|
||||
Barbara: -61.2 €]
|
||||
piuchebuono: 1124.7799999999997 €]
|
||||
Ven 16/02 ORE 14:05: [<b>Euro</b>]: Inviate Monete da Loabati a piuchebuono 6 € [causale: Pagato Ordine n.174]
|
||||
Saldi:
|
||||
Loabati: -24.6 €]
|
||||
piuchebuono: 1130.7799999999997 €]
|
||||
Sab 17/02 ORE 14:04: [<b>Circuito RIS Bologna</b>]: Inviate Monete da paoloar77 a SuryaArena 5 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: 31 RIS]
|
||||
SuryaArena: 5 RIS]
|
||||
Sab 17/02 ORE 14:10: [<b>Circuito RIS Bologna</b>]: Inviate Monete da SuryaArena a paoloar77 4 RIS [causale: Per Paolo]
|
||||
Saldi:
|
||||
SuryaArena: 1 RIS]
|
||||
paoloar77: 35 RIS]
|
||||
Sab 17/02 ORE 14:11: [<b>Circuito RIS Bologna</b>]: Inviate Monete da paoloar77 a SuryaArena 6 RIS [causale: Per Surya]
|
||||
Saldi:
|
||||
paoloar77: 29 RIS]
|
||||
SuryaArena: 7 RIS]
|
||||
Sab 17/02 ORE 14:50: [<b>Circuito RIS Bologna</b>]: Inviate Monete da paoloar77 a SuryaArena 3 RIS [causale: BBBBAAA]
|
||||
Saldi:
|
||||
paoloar77: 26 RIS]
|
||||
SuryaArena: 10 RIS]
|
||||
Sab 17/02 ORE 14:53: [<b>Circuito RIS Bologna</b>]: Inviate Monete da paoloar77 a SuryaArena 4 RIS [causale: GGGG]
|
||||
Saldi:
|
||||
paoloar77: 22 RIS]
|
||||
SuryaArena: 14 RIS]
|
||||
Sab 17/02 ORE 15:03: [<b>Circuito RIS Bologna</b>]: Inviate Monete da paoloar77 a SuryaArena 2 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: 20 RIS]
|
||||
SuryaArena: 16 RIS]
|
||||
Gio 11/04 ORE 16:54: [<b>Euro</b>]: Inviate Monete da paoloar77 a piuchebuono 110 € [causale: Pagato Ordine n.236]
|
||||
Saldi:
|
||||
paoloar77: -246.8 €]
|
||||
piuchebuono: 2181.0999999999985 €]
|
||||
Gio 11/04 ORE 16:55: [<b>Euro</b>]: Inviate Monete da paoloar77 a piuchebuono 110 € [causale: Pagato Ordine n.235]
|
||||
Saldi:
|
||||
paoloar77: -356.8 €]
|
||||
piuchebuono: 2291.0999999999985 €]
|
||||
Gio 11/04 ORE 16:57: [<b>Euro</b>]: Inviate Monete da paoloar77 a piuchebuono 110 € [causale: Pagato Ordine n.234]
|
||||
Saldi:
|
||||
paoloar77: -466.8 €]
|
||||
piuchebuono: 2401.0999999999985 €]
|
||||
Gio 25/04 ORE 11:43: [<b>Circuito RIS Bologna</b>]: Inviate Monete da SuryaArena a paoloar77 1 RIS [causale: ]
|
||||
Saldi:
|
||||
SuryaArena: -1 RIS]
|
||||
paoloar77: 38 RIS]
|
||||
Gio 25/04 ORE 14:37: [<b>Circuito RIS Bologna</b>]: Inviate Monete da paoloar77 a SuryaArena 38 RIS [causale: ]
|
||||
Saldi:
|
||||
paoloar77: 0 RIS]
|
||||
SuryaArena: 37 RIS]
|
||||
Gio 09/05 ORE 17:27: [<b>Circuito RIS Catania</b>]: Inviate Monete da paoloar77 a Giovannifruttadisicilia 1.5 RIS [causale: prova]
|
||||
Saldi:
|
||||
paoloar77: -1.50 RIS]
|
||||
Giovannifruttadisicilia: 1.50 RIS]
|
||||
Mar 28/05 ORE 16:51: [<b>Circuito RIS Italia</b>]: Inviate Monete da ElenaEspx a Giovannifruttadisicilia 14 RIS [causale: Acquisto arance 30genn24 RisoBologna 2]
|
||||
Saldi:
|
||||
ElenaEspx: -32.10 RIS]
|
||||
Giovannifruttadisicilia: 222.50 RIS]
|
||||
Mar 28/05 ORE 16:51: [<b>Circuito RIS Italia</b>]: Inviate Monete da ElenaEspx a Giovannifruttadisicilia 28 RIS [causale: Acquisto arance 30genn24 RisoBologna 1]
|
||||
Saldi:
|
||||
ElenaEspx: -60.10 RIS]
|
||||
Giovannifruttadisicilia: 250.50 RIS]
|
||||
@@ -10,91 +10,345 @@ let aggregation = [
|
||||
{
|
||||
$match: {
|
||||
idapp: "13",
|
||||
},
|
||||
},
|
||||
{
|
||||
$sort: {
|
||||
date_updated: -1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$addFields: {
|
||||
myId1: {
|
||||
$toObjectId: "$userId",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "users",
|
||||
localField: "myId1",
|
||||
foreignField: "_id",
|
||||
as: "user",
|
||||
},
|
||||
},
|
||||
{
|
||||
$replaceRoot: {
|
||||
newRoot: {
|
||||
$mergeObjects: [
|
||||
{
|
||||
$arrayElemAt: [
|
||||
"$user",
|
||||
0,
|
||||
],
|
||||
},
|
||||
"$$ROOT",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
recGood: 1,
|
||||
sectorGood: 1,
|
||||
idSectorGood: 1,
|
||||
idGood: 1,
|
||||
mygood: 1,
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
"profile.username_telegram": 1,
|
||||
"profile.favorite": 1,
|
||||
"profile.bookmark": 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
adType: 1,
|
||||
photos: 1,
|
||||
note: 1,
|
||||
website: 1,
|
||||
descr: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
userId: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
lasttimeonline: 1,
|
||||
comune: 1,
|
||||
mycities: 1,
|
||||
"profile.img": 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1,
|
||||
"profile.resid_province": 1,
|
||||
"profile.resid_card": 1,
|
||||
reported: 1,
|
||||
date_report: 1,
|
||||
username_who_report: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "goods",
|
||||
localField: "idGood",
|
||||
foreignField: "_id",
|
||||
as: "recGood",
|
||||
},
|
||||
},
|
||||
{
|
||||
$replaceRoot: {
|
||||
newRoot: {
|
||||
$mergeObjects: [
|
||||
{
|
||||
$arrayElemAt: [
|
||||
"$recGood",
|
||||
0,
|
||||
],
|
||||
},
|
||||
"$$ROOT",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
recGood: 1,
|
||||
sectorGood: 1,
|
||||
idSectorGood: 1,
|
||||
idGood: 1,
|
||||
mygood: 1,
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
"profile.username_telegram": 1,
|
||||
"profile.favorite": 1,
|
||||
"profile.bookmark": 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
adType: 1,
|
||||
photos: 1,
|
||||
note: 1,
|
||||
website: 1,
|
||||
descr: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
userId: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
lasttimeonline: 1,
|
||||
comune: 1,
|
||||
mycities: 1,
|
||||
"profile.img": 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1,
|
||||
"profile.resid_province": 1,
|
||||
"profile.resid_card": 1,
|
||||
reported: 1,
|
||||
date_report: 1,
|
||||
username_who_report: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "sectorgoods",
|
||||
localField: "idSectorGood",
|
||||
foreignField: "_id",
|
||||
as: "sectorGood",
|
||||
},
|
||||
},
|
||||
{
|
||||
$replaceRoot: {
|
||||
newRoot: {
|
||||
$mergeObjects: [
|
||||
{
|
||||
$arrayElemAt: [
|
||||
"$sectorGood",
|
||||
0,
|
||||
],
|
||||
},
|
||||
"$$ROOT",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
recGood: 1,
|
||||
sectorGood: 1,
|
||||
idSectorGood: 1,
|
||||
idGood: 1,
|
||||
mygood: 1,
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
"profile.username_telegram": 1,
|
||||
"profile.favorite": 1,
|
||||
"profile.bookmark": 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
adType: 1,
|
||||
photos: 1,
|
||||
note: 1,
|
||||
website: 1,
|
||||
descr: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
userId: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
lasttimeonline: 1,
|
||||
comune: 1,
|
||||
mycities: 1,
|
||||
"profile.img": 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1,
|
||||
"profile.resid_province": 1,
|
||||
reported: 1,
|
||||
date_report: 1,
|
||||
username_who_report: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "cities",
|
||||
localField: "idCity",
|
||||
foreignField: "_id",
|
||||
as: "mycities",
|
||||
},
|
||||
},
|
||||
{
|
||||
$replaceRoot: {
|
||||
newRoot: {
|
||||
$mergeObjects: [
|
||||
{
|
||||
$arrayElemAt: [
|
||||
"$mycities",
|
||||
0,
|
||||
],
|
||||
},
|
||||
"$$ROOT",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
recGood: 1,
|
||||
sectorGood: 1,
|
||||
idSectorGood: 1,
|
||||
idGood: 1,
|
||||
mygood: 1,
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
"profile.username_telegram": 1,
|
||||
"profile.favorite": 1,
|
||||
"profile.bookmark": 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
adType: 1,
|
||||
photos: 1,
|
||||
note: 1,
|
||||
website: 1,
|
||||
descr: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
userId: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
lasttimeonline: 1,
|
||||
comune: 1,
|
||||
mycities: 1,
|
||||
"profile.img": 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1,
|
||||
"profile.resid_province": 1,
|
||||
reported: 1,
|
||||
date_report: 1,
|
||||
username_who_report: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
$or: [
|
||||
{
|
||||
deleted: {
|
||||
$exists: false,
|
||||
},
|
||||
$and: [
|
||||
{
|
||||
"profile.mygroups": {
|
||||
$elemMatch: {
|
||||
groupname: {
|
||||
$in: [
|
||||
"000017",
|
||||
"risoprova",
|
||||
"VillaggiamoItalia",
|
||||
"Terraw",
|
||||
"RisoBenevento",
|
||||
"111",
|
||||
"gruppodefaultriso",
|
||||
"pontiUmani",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
pub_to_share: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
deleted: {
|
||||
$exists: true,
|
||||
$eq: false,
|
||||
},
|
||||
$or: [
|
||||
{
|
||||
pub_to_share: {
|
||||
$exists: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
pub_to_share: {
|
||||
$exists: true,
|
||||
$eq: 0,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
$and: [
|
||||
{
|
||||
"mycities.reg": "EMR",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
$group: {
|
||||
_id: "$aportador_solidario",
|
||||
_id: null,
|
||||
count: {
|
||||
$sum: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$match: { "count": { $gte: 2 } }
|
||||
},
|
||||
{
|
||||
$sort: {
|
||||
count: -1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "users",
|
||||
let: {
|
||||
username: "$_id",
|
||||
idapp: "13",
|
||||
},
|
||||
pipeline: [
|
||||
{
|
||||
$match: {
|
||||
$expr: {
|
||||
$and: [
|
||||
{
|
||||
$eq: [
|
||||
"$$username",
|
||||
"$username",
|
||||
],
|
||||
},
|
||||
{
|
||||
$eq: [
|
||||
"$$idapp",
|
||||
"$idapp",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
as: "user",
|
||||
},
|
||||
},
|
||||
{ $unwind: "$user" },
|
||||
{
|
||||
$replaceRoot: {
|
||||
newRoot: {
|
||||
$mergeObjects: [ "$user", "$$ROOT" ],
|
||||
results: {
|
||||
$push: "$$ROOT",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
_id: 0,
|
||||
count: 1,
|
||||
aportador_solidario: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
lasttimeonline: 1,
|
||||
idapp: 1,
|
||||
"profile.img": 1,
|
||||
rows: {
|
||||
$slice: [
|
||||
"$results",
|
||||
0,
|
||||
10,
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
db.users.aggregate(aggregation);
|
||||
db.myskills.aggregate(aggregation);
|
||||
|
||||
|
||||
432
mongodb/Favorite.mongodb
Normal file
432
mongodb/Favorite.mongodb
Normal file
@@ -0,0 +1,432 @@
|
||||
use('test_FreePlanet');
|
||||
|
||||
let aggregation = [
|
||||
{
|
||||
$match: {
|
||||
idapp: "13",
|
||||
},
|
||||
},
|
||||
{
|
||||
$sort: {
|
||||
date_updated: -1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "users",
|
||||
let: {
|
||||
tab: 1,
|
||||
id: "$_id",
|
||||
},
|
||||
pipeline: [
|
||||
{
|
||||
$unwind: "$profile.favorite",
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
$expr: {
|
||||
$and: [
|
||||
{
|
||||
$eq: [
|
||||
"$profile.favorite.id",
|
||||
"$$id",
|
||||
],
|
||||
},
|
||||
{
|
||||
$eq: [
|
||||
"$profile.favorite.tab",
|
||||
"$$tab",
|
||||
],
|
||||
},
|
||||
{
|
||||
$eq: [
|
||||
"$idapp",
|
||||
"13",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{ $project: { username: 1, _id: 0 } },
|
||||
],
|
||||
as: "myfav",
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "users",
|
||||
let: {
|
||||
tab: 1,
|
||||
id: "$_id",
|
||||
},
|
||||
pipeline: [
|
||||
{
|
||||
$unwind: "$profile.bookmark",
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
$expr: {
|
||||
$and: [
|
||||
{
|
||||
$eq: [
|
||||
"$profile.bookmark.id",
|
||||
"$$id",
|
||||
],
|
||||
},
|
||||
{
|
||||
$eq: [
|
||||
"$profile.bookmark.tab",
|
||||
"$$tab",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
as: "mybook",
|
||||
},
|
||||
},
|
||||
{
|
||||
$addFields: {
|
||||
myId1: {
|
||||
$toObjectId: "$userId",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "users",
|
||||
localField: "myId1",
|
||||
foreignField: "_id",
|
||||
as: "user",
|
||||
},
|
||||
},
|
||||
{
|
||||
$replaceRoot: {
|
||||
newRoot: {
|
||||
$mergeObjects: [
|
||||
{
|
||||
$arrayElemAt: [
|
||||
"$user",
|
||||
0,
|
||||
],
|
||||
},
|
||||
"$$ROOT",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
recSkill: 1,
|
||||
sector: 1,
|
||||
idSector: 1,
|
||||
idSkill: 1,
|
||||
myskill: 1,
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
"profile.username_telegram": 1,
|
||||
"profile.favorite": 1,
|
||||
"profile.bookmark": 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
adType: 1,
|
||||
photos: 1,
|
||||
note: 1,
|
||||
website: 1,
|
||||
descr: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
userId: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
lasttimeonline: 1,
|
||||
comune: 1,
|
||||
mycities: 1,
|
||||
"profile.img": 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1,
|
||||
"profile.resid_province": 1,
|
||||
reported: 1,
|
||||
date_report: 1,
|
||||
username_who_report: 1,
|
||||
myfav: 1,
|
||||
mybook: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "skills",
|
||||
localField: "idSkill",
|
||||
foreignField: "_id",
|
||||
as: "recSkill",
|
||||
},
|
||||
},
|
||||
{
|
||||
$replaceRoot: {
|
||||
newRoot: {
|
||||
$mergeObjects: [
|
||||
{
|
||||
$arrayElemAt: [
|
||||
"$recSkill",
|
||||
0,
|
||||
],
|
||||
},
|
||||
"$$ROOT",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
recSkill: 1,
|
||||
sector: 1,
|
||||
idSector: 1,
|
||||
idSkill: 1,
|
||||
myskill: 1,
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
"profile.username_telegram": 1,
|
||||
"profile.favorite": 1,
|
||||
"profile.bookmark": 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
adType: 1,
|
||||
photos: 1,
|
||||
note: 1,
|
||||
website: 1,
|
||||
descr: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
userId: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
lasttimeonline: 1,
|
||||
comune: 1,
|
||||
mycities: 1,
|
||||
"profile.img": 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1,
|
||||
"profile.resid_province": 1,
|
||||
reported: 1,
|
||||
date_report: 1,
|
||||
username_who_report: 1,
|
||||
myfav: 1,
|
||||
mybook: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "sectors",
|
||||
localField: "idSector",
|
||||
foreignField: "_id",
|
||||
as: "sector",
|
||||
},
|
||||
},
|
||||
{
|
||||
$replaceRoot: {
|
||||
newRoot: {
|
||||
$mergeObjects: [
|
||||
{
|
||||
$arrayElemAt: [
|
||||
"$sector",
|
||||
0,
|
||||
],
|
||||
},
|
||||
"$$ROOT",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
recSkill: 1,
|
||||
sector: 1,
|
||||
idSector: 1,
|
||||
idSkill: 1,
|
||||
myskill: 1,
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
"profile.username_telegram": 1,
|
||||
"profile.favorite": 1,
|
||||
"profile.bookmark": 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
adType: 1,
|
||||
photos: 1,
|
||||
note: 1,
|
||||
website: 1,
|
||||
descr: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
userId: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
lasttimeonline: 1,
|
||||
comune: 1,
|
||||
mycities: 1,
|
||||
"profile.img": 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1,
|
||||
"profile.resid_province": 1,
|
||||
reported: 1,
|
||||
date_report: 1,
|
||||
username_who_report: 1,
|
||||
myfav: 1,
|
||||
mybook: 1,
|
||||
myseen: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "cities",
|
||||
localField: "idCity",
|
||||
foreignField: "_id",
|
||||
as: "mycities",
|
||||
},
|
||||
},
|
||||
{
|
||||
$replaceRoot: {
|
||||
newRoot: {
|
||||
$mergeObjects: [
|
||||
{
|
||||
$arrayElemAt: [
|
||||
"$mycities",
|
||||
0,
|
||||
],
|
||||
},
|
||||
"$$ROOT",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
recSkill: 1,
|
||||
sector: 1,
|
||||
idSector: 1,
|
||||
idSkill: 1,
|
||||
myskill: 1,
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
"profile.username_telegram": 1,
|
||||
"profile.favorite": 1,
|
||||
"profile.bookmark": 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
adType: 1,
|
||||
photos: 1,
|
||||
note: 1,
|
||||
website: 1,
|
||||
descr: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
userId: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
lasttimeonline: 1,
|
||||
comune: 1,
|
||||
mycities: 1,
|
||||
"profile.img": 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1,
|
||||
"profile.resid_province": 1,
|
||||
reported: 1,
|
||||
date_report: 1,
|
||||
username_who_report: 1,
|
||||
myfav: 1,
|
||||
mybook: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
$or: [
|
||||
{
|
||||
$and: [
|
||||
{
|
||||
"profile.mygroups": {
|
||||
$elemMatch: {
|
||||
groupname: {
|
||||
$in: [
|
||||
"000017",
|
||||
"risoprova",
|
||||
"VillaggiamoItalia",
|
||||
"Terraw",
|
||||
"RisoBenevento",
|
||||
"111",
|
||||
"gruppodefaultriso",
|
||||
"pontiUmani",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
pub_to_share: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
$or: [
|
||||
{
|
||||
pub_to_share: {
|
||||
$exists: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
pub_to_share: {
|
||||
$exists: true,
|
||||
$eq: 0,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
$and: [
|
||||
{
|
||||
"mycities.reg": "EMR",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
$group: {
|
||||
_id: null,
|
||||
count: {
|
||||
$sum: 1,
|
||||
},
|
||||
results: {
|
||||
$push: "$$ROOT",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
count: 1,
|
||||
rows: {
|
||||
$slice: [
|
||||
"$results",
|
||||
0,
|
||||
10,
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
db.myskills.aggregate(aggregation);
|
||||
|
||||
203
mongodb/Members.mongodb
Normal file
203
mongodb/Members.mongodb
Normal file
@@ -0,0 +1,203 @@
|
||||
use('test_FreePlanet');
|
||||
|
||||
let aggregation = [
|
||||
{
|
||||
$match: {
|
||||
idapp: "13",
|
||||
"profile.mycircuits": {
|
||||
$elemMatch: {
|
||||
circuitname: {
|
||||
$eq: "Circuito RIS Bologna",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "circuits",
|
||||
as: "circuit",
|
||||
let: {
|
||||
circuitname: "Circuito RIS Bologna",
|
||||
idapp: "$idapp",
|
||||
},
|
||||
pipeline: [
|
||||
{
|
||||
$match: {
|
||||
$expr: {
|
||||
$and: [
|
||||
{
|
||||
$eq: [
|
||||
"$name",
|
||||
"$$circuitname",
|
||||
],
|
||||
},
|
||||
{
|
||||
$eq: [
|
||||
"$idapp",
|
||||
"$$idapp",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: "$circuit",
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
date_reg: 1,
|
||||
profile: 1,
|
||||
idapp: 1,
|
||||
"circuit.name": 1,
|
||||
"circuit._id": 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "accounts",
|
||||
as: "account",
|
||||
let: {
|
||||
username: "$username",
|
||||
idapp: "$idapp",
|
||||
circuitId: "$circuit._id",
|
||||
},
|
||||
pipeline: [
|
||||
{
|
||||
$match: {
|
||||
$expr: {
|
||||
$and: [
|
||||
{
|
||||
$eq: [
|
||||
"$$username",
|
||||
"$username",
|
||||
],
|
||||
},
|
||||
{
|
||||
$eq: [
|
||||
"$$idapp",
|
||||
"$idapp",
|
||||
],
|
||||
},
|
||||
{
|
||||
$eq: [
|
||||
"$$circuitId",
|
||||
"$circuitId",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: "$account",
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
idapp: "13",
|
||||
},
|
||||
},
|
||||
{
|
||||
$addFields: {
|
||||
myId1: {
|
||||
$toObjectId: "$userId",
|
||||
},
|
||||
namecomplete: {
|
||||
$concat: [
|
||||
{
|
||||
$toLower: "$name",
|
||||
},
|
||||
{
|
||||
$toLower: "$surname",
|
||||
},
|
||||
{ $toLower: "$username" },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "users",
|
||||
localField: "myId1",
|
||||
foreignField: "_id",
|
||||
as: "user",
|
||||
},
|
||||
},
|
||||
{
|
||||
$replaceRoot: {
|
||||
newRoot: {
|
||||
$mergeObjects: [
|
||||
{
|
||||
$arrayElemAt: [
|
||||
"$user",
|
||||
0,
|
||||
],
|
||||
},
|
||||
"$$ROOT",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
"profile.img": 1,
|
||||
"profile.mycircuits": 1,
|
||||
"profile.qualifica": 1,
|
||||
"profile.resid_province": 1,
|
||||
"account._id": 1,
|
||||
"account.saldo": 1,
|
||||
"account.fidoConcesso": 1,
|
||||
"account.qta_maxConcessa": 1,
|
||||
"account.totTransato": 1,
|
||||
reported: 1,
|
||||
date_report: 1,
|
||||
username_who_report: 1,
|
||||
namecomplete: 1,
|
||||
date_reg: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$sort: {
|
||||
date_reg: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$group: {
|
||||
_id: null,
|
||||
count: {
|
||||
$sum: 1,
|
||||
},
|
||||
results: {
|
||||
$push: "$$ROOT",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
count: 1,
|
||||
rows: {
|
||||
$slice: [
|
||||
"$results",
|
||||
1,
|
||||
15,
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
db.users.aggregate(aggregation);
|
||||
|
||||
352
mongodb/MySkills.mongodb
Normal file
352
mongodb/MySkills.mongodb
Normal file
@@ -0,0 +1,352 @@
|
||||
// MongoDB Playground
|
||||
// To disable this template go to Settings | MongoDB | Use Default Template For Playground.
|
||||
// Make sure you are connected to enable completions and to be able to run a playground.
|
||||
// Use Ctrl+Space inside a snippet or a string literal to trigger completions.
|
||||
|
||||
// Select the database to use.
|
||||
use('test_FreePlanet');
|
||||
|
||||
let aggregation = [
|
||||
{
|
||||
$match: {
|
||||
idapp: "13",
|
||||
},
|
||||
},
|
||||
{
|
||||
$sort: {
|
||||
date_updated: -1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$addFields: {
|
||||
myId1: {
|
||||
$toObjectId: "$userId",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "users",
|
||||
localField: "myId1",
|
||||
foreignField: "_id",
|
||||
as: "user",
|
||||
},
|
||||
},
|
||||
{
|
||||
$replaceRoot: {
|
||||
newRoot: {
|
||||
$mergeObjects: [
|
||||
{
|
||||
$arrayElemAt: [
|
||||
"$user",
|
||||
0,
|
||||
],
|
||||
},
|
||||
"$$ROOT",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
recGood: 1,
|
||||
sectorGood: 1,
|
||||
idSectorGood: 1,
|
||||
idGood: 1,
|
||||
mygood: 1,
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
"profile.username_telegram": 1,
|
||||
"profile.favorite": 1,
|
||||
"profile.bookmark": 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
adType: 1,
|
||||
photos: 1,
|
||||
note: 1,
|
||||
website: 1,
|
||||
descr: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
userId: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
lasttimeonline: 1,
|
||||
comune: 1,
|
||||
mycities: 1,
|
||||
"profile.img": 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1,
|
||||
"profile.resid_province": 1,
|
||||
reported: 1,
|
||||
date_report: 1,
|
||||
username_who_report: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "goods",
|
||||
localField: "idGood",
|
||||
foreignField: "_id",
|
||||
as: "recGood",
|
||||
},
|
||||
},
|
||||
{
|
||||
$replaceRoot: {
|
||||
newRoot: {
|
||||
$mergeObjects: [
|
||||
{
|
||||
$arrayElemAt: [
|
||||
"$recGood",
|
||||
0,
|
||||
],
|
||||
},
|
||||
"$$ROOT",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
recGood: 1,
|
||||
sectorGood: 1,
|
||||
idSectorGood: 1,
|
||||
idGood: 1,
|
||||
mygood: 1,
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
"profile.username_telegram": 1,
|
||||
"profile.favorite": 1,
|
||||
"profile.bookmark": 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
adType: 1,
|
||||
photos: 1,
|
||||
note: 1,
|
||||
website: 1,
|
||||
descr: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
userId: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
lasttimeonline: 1,
|
||||
comune: 1,
|
||||
mycities: 1,
|
||||
"profile.img": 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1,
|
||||
"profile.resid_province": 1,
|
||||
reported: 1,
|
||||
date_report: 1,
|
||||
username_who_report: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "sectorgoods",
|
||||
localField: "idSectorGood",
|
||||
foreignField: "_id",
|
||||
as: "sectorGood",
|
||||
},
|
||||
},
|
||||
{
|
||||
$replaceRoot: {
|
||||
newRoot: {
|
||||
$mergeObjects: [
|
||||
{
|
||||
$arrayElemAt: [
|
||||
"$sectorGood",
|
||||
0,
|
||||
],
|
||||
},
|
||||
"$$ROOT",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
recGood: 1,
|
||||
sectorGood: 1,
|
||||
idSectorGood: 1,
|
||||
idGood: 1,
|
||||
mygood: 1,
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
"profile.username_telegram": 1,
|
||||
"profile.favorite": 1,
|
||||
"profile.bookmark": 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
adType: 1,
|
||||
photos: 1,
|
||||
note: 1,
|
||||
website: 1,
|
||||
descr: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
userId: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
lasttimeonline: 1,
|
||||
comune: 1,
|
||||
mycities: 1,
|
||||
"profile.img": 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1,
|
||||
"profile.resid_province": 1,
|
||||
reported: 1,
|
||||
date_report: 1,
|
||||
username_who_report: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "cities",
|
||||
localField: "idCity",
|
||||
foreignField: "_id",
|
||||
as: "mycities",
|
||||
},
|
||||
},
|
||||
{
|
||||
$replaceRoot: {
|
||||
newRoot: {
|
||||
$mergeObjects: [
|
||||
{
|
||||
$arrayElemAt: [
|
||||
"$mycities",
|
||||
0,
|
||||
],
|
||||
},
|
||||
"$$ROOT",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
recGood: 1,
|
||||
sectorGood: 1,
|
||||
idSectorGood: 1,
|
||||
idGood: 1,
|
||||
mygood: 1,
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
"profile.username_telegram": 1,
|
||||
"profile.favorite": 1,
|
||||
"profile.bookmark": 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
adType: 1,
|
||||
photos: 1,
|
||||
note: 1,
|
||||
website: 1,
|
||||
descr: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
userId: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
lasttimeonline: 1,
|
||||
comune: 1,
|
||||
mycities: 1,
|
||||
"profile.img": 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1,
|
||||
"profile.resid_province": 1,
|
||||
reported: 1,
|
||||
date_report: 1,
|
||||
username_who_report: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
$or: [
|
||||
{
|
||||
$and: [
|
||||
{
|
||||
"profile.mygroups": {
|
||||
$elemMatch: {
|
||||
groupname: {
|
||||
$in: [
|
||||
"000017",
|
||||
"risoprova",
|
||||
"VillaggiamoItalia",
|
||||
"Terraw",
|
||||
"RisoBenevento",
|
||||
"111",
|
||||
"gruppodefaultriso",
|
||||
"pontiUmani",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
pub_to_share: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
$or: [
|
||||
{
|
||||
pub_to_share: {
|
||||
$exists: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
pub_to_share: {
|
||||
$exists: true,
|
||||
$eq: 0,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
$and: [
|
||||
{
|
||||
"mycities.reg": "EMR",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
$group: {
|
||||
_id: null,
|
||||
count: {
|
||||
$sum: 1,
|
||||
},
|
||||
results: {
|
||||
$push: "$$ROOT",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
count: 1,
|
||||
rows: {
|
||||
$slice: [
|
||||
"$results",
|
||||
0,
|
||||
10,
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
db.myskills.aggregate(aggregation);
|
||||
|
||||
@@ -278,3 +278,11 @@ if (test) {
|
||||
// Use toArray() to exhaust the cursor to return the whole result set.
|
||||
// You can use hasNext()/next() to iterate through the cursor page by page.
|
||||
db.users.aggregate(aggregation);
|
||||
|
||||
|
||||
|
||||
db.getCollection('myskills').deleteMany({ '_id': { $lte: 10000 }})
|
||||
db.getCollection('mygoods').deleteMany({ '_id': { $lte: 10000 }})
|
||||
db.getCollection('mybachecas').deleteMany({ '_id': { $lte: 10000 }})
|
||||
db.getCollection('myhosps').deleteMany({ '_id': { $lte: 10000 }})
|
||||
db.getCollection('mygroups').deleteMany({ '_id': { $lte: 10000 }})
|
||||
23
mongodb/favorite.mongodb.js
Normal file
23
mongodb/favorite.mongodb.js
Normal file
@@ -0,0 +1,23 @@
|
||||
use('test_FreePlanet');
|
||||
|
||||
let aggregation = [
|
||||
{
|
||||
$match: {
|
||||
idapp: "13",
|
||||
"profile.favorite": {
|
||||
$elemMatch:
|
||||
{ id: '10256', tab: 4 }
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
$group:
|
||||
{
|
||||
_id: null,
|
||||
count: { $sum: 1 },
|
||||
}
|
||||
},
|
||||
{ $project: { _id: 0 } }
|
||||
];
|
||||
|
||||
db.users.aggregate(aggregation);
|
||||
47
outout.csv
Normal file
47
outout.csv
Normal file
@@ -0,0 +1,47 @@
|
||||
Num|Nome|Peso|Prezzo|Quantita|Totale|Ordini
|
||||
0|"Acqua distillata di rose di Damasco"|100|8|2|16|1
|
||||
0|"Artemisia in foglie"|20|1,5|7|10,5|3
|
||||
0|"Cannella"|100|3|4|12|3
|
||||
0|"Carruba macinata"|250|3|2|6|2
|
||||
0|"Cous cous 5 stelle (grano duro, mais, orzo, lenticchie ed avena)"|500|3,5|1|3,5|1
|
||||
0|"Cous cous d'avena"|500|3|3|9|2
|
||||
0|"Cous cous d'orzo"|500|3|1|3|1
|
||||
0|"Cous cous di grano duro (Akka)"|500|3,25|1|3,25|1
|
||||
0|"Cous cous di lenticchie"|500|3,5|4|14|3
|
||||
0|"Cous cous di miglio"|500|3|4|12|4
|
||||
0|"Couscous 5 cereali 1kg"|1|5,5|1|5,5|1
|
||||
0|"Couscous di grano duro 500g"|500|2,5|1|2,5|1
|
||||
0|"Curcuma"|100|3|5|15|4
|
||||
0|"Datteri boufeggous extra 1kg"|1|11|1|11|1
|
||||
0|"Datteri boufeggous extra 500g"|500|6,5|3|19,5|3
|
||||
0|"Datteri boustahammi 1kg"|1|5|11|55|6
|
||||
0|"Datteri boustahammi 500g"|500|3|3|9|3
|
||||
0|"Datteri bouzagagh 1kg"|1|5,5|2|11|2
|
||||
0|"Datteri bouzagagh 500g"|500|3,5|7|24,5|6
|
||||
0|"Farina di segale grigliata 1kg"|1|3,5|1|3,5|1
|
||||
0|"Fichi secchi bianchi 250g"|250|5|1|5|1
|
||||
0|"Fichi secchi bianchi 500g"|500|9|1|9|1
|
||||
0|"Fieno greco"|500|3,5|2|7|1
|
||||
0|"Ghassoul (pezzetti di argilla saponifera) per capelli"|100|4|2|8|2
|
||||
0|"Henné"|250|3|2|6|2
|
||||
0|"Henné (per tatuaggi e capelli)"|200|3,5|1|3,5|1
|
||||
0|"Henné (per tatuaggi e capelli)"|150|2,5|1|2,5|1
|
||||
0|"Menta Maachi (autoctona) in foglie"|20|1,5|1|1,5|1
|
||||
0|"Olio alle rose di Damasco"|60|9|2|18|2
|
||||
0|"Olio di argan cosmetico 30ml"|30|8|3|24|2
|
||||
0|"Olio di mandorle dolci"|30|5,5|1|5,5|1
|
||||
0|"Olio di nigella (cumino nero)"|30|5,5|1|5,5|1
|
||||
0|"Olio di sesamo"|30|5,5|1|5,5|1
|
||||
0|"Olive nere"|125|2|1|2|1
|
||||
0|"Olive nere alle piante aromatiche 1kg"|1|9|1|9|1
|
||||
0|"Olive nere alle piante aromatiche 500g"|500|5|1|5|1
|
||||
0|"Olive verdi alle piante aromatiche 1kg"|1|9|1|9|1
|
||||
0|"Olive verdi alle spezie 500g"|500|5|1|5|1
|
||||
0|"Paprika dolce senza olio"|100|3|2|6|2
|
||||
0|"Prugne secche"|250|3|2|6|2
|
||||
0|"Rose secche di Damasco"|50|2,5|2|5|2
|
||||
0|"Sapone a base di olio di argan"|80|4|3|12|3
|
||||
0|"Scrub Naama (rosa, in polvere)"|100|5|2|10|2
|
||||
0|"Sottopentola medio"|296|2,5|1|2,5|1
|
||||
0|"Verbena citronella in foglie"|20|1,5|1|1,5|1
|
||||
0|"Zenzero"|100|3|2|6|2
|
||||
|
28
package.json
28
package.json
@@ -4,15 +4,17 @@
|
||||
"description": "freeplanet serverside",
|
||||
"main": "server/server.js",
|
||||
"scripts": {
|
||||
"start": "NODE_ENV=development nodemon src/server/server.js",
|
||||
"start": "node src/server/server.js",
|
||||
"dev": "NODE_ENV=development nodemon src/server/server.js",
|
||||
"build": "gulp build",
|
||||
"watch": "gulp watch",
|
||||
"test": "export NODE_ENV=development || SET NODE_ENV=development && mocha src/server/**/*.test.js",
|
||||
"start:prod": "NODE_ENV=production node src/server/server.js",
|
||||
"starttest": "NODE_ENV=test node src/server/server.js",
|
||||
"test-watch": "nodemon --exec 'npm test'"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.14.0"
|
||||
"node": "^18.19.0"
|
||||
},
|
||||
"author": "Paolo Arena",
|
||||
"license": "MIT",
|
||||
@@ -34,8 +36,9 @@
|
||||
"i18n": "^0.15.0",
|
||||
"image-downloader": "^4.3.0",
|
||||
"internet-available": "^1.0.0",
|
||||
"jade": "^1.11.0",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"jade": "^1.9.2",
|
||||
"jsdom": "^24.0.0",
|
||||
"jsonwebtoken": "^9.0.1",
|
||||
"lodash": "^4.17.21",
|
||||
"mongodb": "^4.4.1",
|
||||
"mongoose": "^5.13.15",
|
||||
@@ -44,32 +47,35 @@
|
||||
"node-emoji": "^1.11.0",
|
||||
"node-image-resizer": "^1.0.0",
|
||||
"node-pre-gyp": "^0.14.0",
|
||||
"node-telegram-bot-api": "^0.59.0",
|
||||
"node-telegram-bot-api": "^0.65.1",
|
||||
"nodemailer": "^6.7.8",
|
||||
"npm-check-updates": "^16.1.0",
|
||||
"npm-check-updates": "^16.14.18",
|
||||
"pem": "^1.14.6",
|
||||
"preview-email": "^3.0.7",
|
||||
"pug": "^3.0.2",
|
||||
"rate-limiter-flexible": "^2.3.9",
|
||||
"request": "^2.34",
|
||||
"sanitize-html": "^2.13.0",
|
||||
"save": "^2.5.0",
|
||||
"sharp": "0.30.0",
|
||||
"sharp": "^0.30.7",
|
||||
"superagent": "^8.0.0",
|
||||
"url-parse": "^1.5.10",
|
||||
"validator": "^13.7.0",
|
||||
"web-push": "^3.5.0",
|
||||
"web-push": "^3.6.7",
|
||||
"xoauth2": "^1.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browser-sync": "^2.27.10",
|
||||
"expect": "^29.0.2",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-inline-css": "^4.0.0",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-inline-css": "^2.0.0",
|
||||
"gulp-pug": "^5.0.0",
|
||||
"gulp-rename": "^2.0.0",
|
||||
"gulp-replace": "^1.1.3",
|
||||
"gulp-sass": "^5.1.0",
|
||||
"jest": "^29.0.2",
|
||||
"mocha": "^10.0.0",
|
||||
"nodemon": "^2.0.19",
|
||||
"nodemon": "^3.0.1",
|
||||
"supertest": "^6.2.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
body, #body_style {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: #E9F2F9;
|
||||
background: #E9F2F9 !important;
|
||||
color: #5b656e;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,16 @@
|
||||
},
|
||||
{
|
||||
"path": "../../../newfreeplanet"
|
||||
},
|
||||
{
|
||||
"path": "../../../cnm"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"search.useIgnoreFiles": true,
|
||||
"search.useParentIgnoreFiles": true
|
||||
"search.useIgnoreFiles": false,
|
||||
"search.useParentIgnoreFiles": false,
|
||||
"files.exclude": {
|
||||
"": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,23 +2,29 @@ const tools = require('../tools/general');
|
||||
|
||||
// still in app.js
|
||||
const node_env = process.env.NODE_ENV || 'production';
|
||||
console.log('node_env=', node_env);
|
||||
|
||||
var file = `.env.${node_env}`;
|
||||
|
||||
|
||||
// GLOBALI (Uguali per TUTTI)
|
||||
process.env.LINKVERIF_REG = '/vreg';
|
||||
process.env.LINK_REQUEST_NEWPASSWORD = '/requestnewpwd';
|
||||
process.env.ADD_NEW_SITE = '/addNewSite';
|
||||
process.env.LINK_UPDATE_PASSWORD = '/updatepassword';
|
||||
process.env.LINK_UPDATE_PWD = '/updatepwd';
|
||||
process.env.LINK_CHECK_UPDATES = '/checkupdates';
|
||||
process.env.KEY_APP_ID = 'KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF';
|
||||
|
||||
// console.log("Starting Node with : " + file);
|
||||
console.log("Starting Node with: " + file);
|
||||
require('dotenv').config({ path: file });
|
||||
|
||||
process.env.DATABASE = process.env.DATABASE || 'FreePlanet';
|
||||
|
||||
console.log('process.env.DOMAIN:', process.env.DOMAIN);
|
||||
process.env.MONGODB_URI = process.env.DOMAIN + process.env.DATABASE;
|
||||
console.log('process.env.MONGODB_URI:', process.env.MONGODB_URI);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -11,7 +11,7 @@ mongoose.plugin(schema => {
|
||||
|
||||
mongoose.set('debug', false);
|
||||
|
||||
const options = {
|
||||
let options = {
|
||||
// user: process.env.UDB,
|
||||
// pass: process.env.PDB,
|
||||
// useMongoClient: true,
|
||||
@@ -38,19 +38,38 @@ const options = {
|
||||
// keepAliveInitialDelay: 300000 // keepAliveInitialDelay is the number of milliseconds to wait before initiating keepAlive on the socket.
|
||||
};
|
||||
|
||||
console.log('process.env.AUTH_MONGODB', process.env.AUTH_MONGODB);
|
||||
|
||||
if (process.env.AUTH_MONGODB === '1') {
|
||||
options.auth = {
|
||||
authSource: "admin",
|
||||
poolSize: 10,
|
||||
user: process.env.MONGODB_USER,
|
||||
password: process.env.MONGODB_PWD,
|
||||
};
|
||||
}
|
||||
|
||||
if (options.auth && options.auth.user) {
|
||||
console.log('MongoDb con Authenticazione:', options.auth.user, '******');
|
||||
} else {
|
||||
console.log('### MongoDb SENZA Authenticazione !!! ');
|
||||
}
|
||||
|
||||
const db = mongoose.connection;
|
||||
|
||||
console.log('Node Version ' + process.version);
|
||||
console.log('Mongoose Version ' + mongoose.version);
|
||||
|
||||
// mongoose.connect(process.env.MONGODB_URI + '?authSource=admin', { options })
|
||||
// console.log(' -> PASSAGGIO PARAMETRI MONGOOSE')
|
||||
mongoose.connect(process.env.MONGODB_URI, options);
|
||||
connectionUrl = process.env.MONGODB_URI;
|
||||
|
||||
console.log('Connessione a ' + connectionUrl + ' in corso...');
|
||||
mongoose.connect(connectionUrl, options);
|
||||
|
||||
db.on('error', console.error.bind(console, 'connection error:'));
|
||||
db.once('open', function() {
|
||||
db.once('open', function () {
|
||||
// we're connected!
|
||||
console.log('*** CONNESSIONE EFFETTUATA ! ' + process.env.MONGODB_URI + ' db: ' + process.env.DATABASE)
|
||||
console.log('*** CONNESSIONE EFFETTUATA ! ' + connectionUrl + ' db: ' + process.env.DATABASE)
|
||||
|
||||
});
|
||||
|
||||
module.exports = {mongoose};
|
||||
module.exports = { mongoose };
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"L'Email è già stata Verificata": "L'Email è già stata Verificata"
|
||||
"L'Email è già stata Verificata": "L'Email è già stata Verificata",
|
||||
"Email Verificata!": "Email Verificada! Cierre esta ventana y regrese a la otra.",
|
||||
"Nuova Registrazione": "Nuevo Registro",
|
||||
"Effettuata una Nuova Registrazione": "Se ha realizado un nuevo registro",
|
||||
|
||||
@@ -1,17 +1,33 @@
|
||||
{
|
||||
"Hello": "Ciao",
|
||||
"Hello %s": "Ciao %s",
|
||||
"Good": "Bene",
|
||||
"Service": "Servizio",
|
||||
"Hosp": "Ospitalità",
|
||||
"Good: %s": "Bene: %s",
|
||||
"Service: %s": "Servizio: %s",
|
||||
"<strong>%s</strong> new Good: %s": "<strong>%s</strong> nuovo Bene: %s",
|
||||
"<strong>%s</strong> new Service: %s": "<strong>%s</strong> nuovo Servizio: %s",
|
||||
"NEW_GOOD": "❇️ <strong>%s</strong> ha aggiunto un nuovo Bene: \n<strong>%s</strong>",
|
||||
"NEW_SERVICE": "❇️ <strong>%s</strong> ha aggiunto un nuovo Servizio: \n<strong>%s</strong>",
|
||||
"NEW_HOSP": "❇️ <strong>%s</strong> ha aggiunto una nuova Ospitalità: \n<strong>%s</strong>",
|
||||
"NEW_EVENT": "❇️ <strong>%s</strong> ha aggiunto un nuovo Evento: \n%s\n<strong>%s</strong>\n%s",
|
||||
"NEW_EVENT_TELEGRAM": "%s\n\n❇️ <strong>%s</strong>\n\n%s\n\n%s",
|
||||
"NEW_ANNUNCIO_TELEGRAM": "❇️ <strong>%s</strong>\n\n%s\n\n%s",
|
||||
"EVENT_ADDED_FROM": "\n\n<i>(Evento aggiunto da <strong>%s</strong>)</i>",
|
||||
"ADDED_FROM": "\n\n<i>(Aggiunto da <strong>%s</strong>)</i>",
|
||||
"CONTRIB": "\n💠 Contributo richiesto: %s",
|
||||
"ORGANIZED_BY": "\n<i>Organizzato da <strong>%s</strong></i>",
|
||||
"SHOW_POST": "👉🏻 vedi post su RISO",
|
||||
"OPEN PAGE": "<em>APRI la APP RISO oppure visita riso.app</em>",
|
||||
"<strong>%s</strong> asked you for Friendship": "<strong>%s</strong> ti ha chiesto l'Amicizia",
|
||||
"<strong>%s</strong> accepted your Friendship": "<strong>%s</strong> ha accettato l'Amicizia",
|
||||
"<strong>%s</strong> refused your Friendship": "<strong>%s</strong> ha rifiutato l'Amicizia",
|
||||
"✅ %s accepted your Friendship request !": "✅ %s ha accettato la tua richiesta di Amicizia !",
|
||||
"✅ You have accepted %s' Friendship request!": "✅ Hai accettato la richiesta di Amicizia di %s !",
|
||||
"GROUPS_ACCEPTED": "✅ Sei stato accettato da %s a far parte del Gruppo %s (da parte di %s)",
|
||||
"HANDSHAKE_SET": "<strong>%s</strong> ha comunicato che ti conosce personalmente e ha Fiducia in te (Stretta di mano).",
|
||||
"HANDSHAKE_SENT_FROM_YOU": "🤝 hai inviato una Stretta di Mano a <strong>%s</strong>, perché la conosci personalmente !",
|
||||
"HANDSHAKE_CONFIRMED": "🤝 Hai contraccambiato la stretta di mano di <strong>%s</strong>!",
|
||||
"HANDSHAKE_ACCEPTED": "🤝 <strong>%s</strong> ha contraccambiato la tua stretta di mano !",
|
||||
"GROUPS_ACCEPTED": "✅ Sei stato accettato a far parte del Gruppo %s (da parte di %s)",
|
||||
"GROUPS_REFUSED": "❌ Ti è stato rifiutato l'accesso da %s a far parte del Gruppo %s. Se pensi sia un'errore, contatta l'amministratore del Gruppo.",
|
||||
"GROUPS_REMOVED": "❌ l'utente %s è stato rimosso del Gruppo %s (da parte di %s)",
|
||||
"GROUPS_EXIT_USER": "❌ l'utente %s è uscito dal Gruppo %s",
|
||||
@@ -33,36 +49,75 @@
|
||||
"FRIEND_UNBLOCKED_TO_ME": "Sei stato riattivato da %s",
|
||||
"FRIEND_UNBLOCKED": "E' stato riattivato %s da %s.",
|
||||
"FRIEND_UNBLOCKED_YOU": "Hai riattivato %s.",
|
||||
"CIRCUIT_ACCEPT_NEWENTRY": "❇️👥 🧍♂️ Accetta Ingresso nel Circuito %s:",
|
||||
"CIRCUIT_REQUEST_TO_ENTER": "%s ha chiesto di entrare nel circuito %s",
|
||||
"CIRCUIT_ACCEPT_NEWENTRY": "❇️👥 🧍♂️ Abilita Fiducia a %s nel '%s':",
|
||||
"CIRCUIT_ACCEPT_NEWENTRY_BYGROUP": "❇️👥 🧍♂️ Abilita Fiducia nel Circuito al gruppo %s:",
|
||||
"CIRCUIT_OPEN_RISITALIA": "Apri il Circuito RIS Italia e chiedi di entrare",
|
||||
"CIRCUIT_REQUEST_TO_ENTER": "%s è entrato nel %s (con %s iscritti) ed è in attesa di essere abilitato alla Fiducia\n🙎🏻♂️ Invitato da %s",
|
||||
"CIRCUIT_ADMINS": "Gli amministratori del circuito sono %s:\n%s",
|
||||
"CIRCUIT_WHERE_IS_PRESENT": "\nAttualmente è presente in: %s",
|
||||
"CIRCUIT_REQUEST_TO_ENTER_WITH_GROUP": "il gruppo %s ha chiesto di entrare nel %s (con %s iscritti)",
|
||||
"CIRCUIT_CREATED": "✅ %s ha creato un nuovo Circuito chiamato %s",
|
||||
"CIRCUIT_REQUEST": "Richiesta di entrare nel Circuito %s da parte di %s",
|
||||
"CIRCUIT_ADDED_ADMIN": "E' stato aggiunto %s come Amministratore del circuito %s da parte di %s",
|
||||
"CIRCUIT_ADDED_ADMIN_YOU": "Sei stato aggiunto come Amministratore del circuito %s da parte di %s",
|
||||
"CIRCUIT_REMOVED_ADMIN": "E' stato rimosso l'incarico di Amministratore a %s del circuito %s da parte di %s",
|
||||
"CIRCUIT_REMOVED_ADMIN_YOU": "Ti è stato rimosso l'incarico di Amministratore del circuito %s da parte di %s",
|
||||
"RICHIESTA_BLOCCO_CIRCUIT": "Richiesta di bloccare il Circuito %s da parte di %s",
|
||||
"CIRCUIT_ELIMINATO": "Il circuito %s è stato eliminato da parte di %s",
|
||||
"ACCETTATO_NOTIFICA_ADMINS_CIRCUIT": "✅ l'utente %s è stato accettato a far parte del Circuito %s (da parte di %s)",
|
||||
"CIRCUIT_ACCEPTED": "✅ Sei stato accettato da %s a far parte del Circuito %s.\nApri la APP e clicca in alto a destra sull'icona delle monete, oppure clicca qui: %s",
|
||||
"CIRCUIT_ACCEPTED_YOU": "✅ Hai accettato %s a far parte del Circuito %s",
|
||||
"CIRCUIT_REFUSED": "❌ Ti è stato rifiutato l'accesso da %s a far parte del Circuito %s. Se pensi sia un'errore, contatta l'amministratore del Circuito.",
|
||||
"CIRCUIT_REMOVED": "❌ l'utente %s è stato rimosso del Circuito %s (da parte di %s)",
|
||||
"CIRCUIT_REFUSED_TO_ME": "All'utente %s gli è stato rifiutato l'accesso a far parte del Circuito %s (da parte di %s).",
|
||||
"CIRCUIT_EXIT_USER": "❌ l'utente %s è uscito dal Circuito %s",
|
||||
"CIRCUIT_EXIT_USER_TO_ME": "❌ Sei uscito dal Circuito %s",
|
||||
"CIRCUIT_REMOVED_TO_ME": "❌ Sei stato rimosso dal Circuito %s (da parte di %s)",
|
||||
"CIRCUIT_SENDCOINSREQ": "%s ti sta inviando <strong>%s %s</strong>.",
|
||||
"CIRCUIT_SENDCOINSREQ_TO_ME": "Stai inviando <strong>%s %s</strong> a %s. \nIl destinatario deve accettare la transazione.",
|
||||
"ID_CIRCUIT_COINS_ACCEPTED": "<strong>%s %s</strong> accettati da %s.",
|
||||
"SALDO_UPDATE": "[Saldo <strong>%s %s</strong>]",
|
||||
"ID_CIRCUIT_COINS_ACCEPTED_TO_ME": "<strong>%s %s</strong> sono stati accettati da %s.",
|
||||
"ID_CIRCUIT_COINS_REFUSED": "%s %s rifiutati da %s.",
|
||||
"ID_CIRCUIT_COINS_REFUSED_TO_ME": "%s %s rifiutati da %s.",
|
||||
"CIRCUIT_REQUEST": "Richiesta di entrare nel %s da parte di %s",
|
||||
"CIRCUIT_ADDED_ADMIN": "E' stato aggiunto %s come Amministratore del %s da parte di %s",
|
||||
"CIRCUIT_ADDED_ADMIN_YOU": "%s sei stato aggiunto come Amministratore del %s da parte di %s",
|
||||
"CIRCUIT_REMOVED_ADMIN": "E' stato rimosso l'incarico di Amministratore a %s del %s da parte di %s",
|
||||
"CIRCUIT_REMOVED_ADMIN_YOU": "%s ti è stato rimosso l'incarico di Amministratore del %s da parte di %s",
|
||||
"RICHIESTA_BLOCCO_CIRCUIT": "Richiesta di bloccare il %s da parte di %s",
|
||||
"CIRCUIT_ELIMINATO": "Il %s è stato eliminato da parte di %s",
|
||||
"FIDO_IMPOSTATO_ADMINS_CIRCUIT": "✅ l'utente %s è stato abilitato alla Fiducia (%s RIS) sul '%s' (da parte di %s)",
|
||||
"FIDO_IMPOSTATO_ADMINS_CIRCUIT_MYGROUP": "✅ il Conto di Gruppo %s è stato abilitato alla Fiducia fino a -%s sul '%s' (da parte di %s)",
|
||||
"ACCETTATO_NOTIFICA_ADMINS_CIRCUIT": "✅ l'utente %s è stato accettato a far parte del '%s' (da parte di %s)",
|
||||
"ACCETTATO_NOTIFICA_ADMINS_CIRCUIT_MYGROUP": "✅ il Conto di Gruppo %s è stato accettato a far parte del '%s' (da parte di %s)",
|
||||
"CIRCUIT_ACCEPTED": "✅ Sei stato accettato da %s a far parte del %s.\nApri la APP e clicca in alto a destra sull'icona delle monete, oppure clicca qui: %s",
|
||||
"FIDO_IMPOSTATO": "✅ Ti è stata attivata la possibilità di utilizzare la Fiducia Concessa fino a %s RIS da %s sul '%s'.",
|
||||
"CIRCUIT_ACCEPTED_YOU": "✅ Hai accettato %s a far parte del '%s'",
|
||||
"CIRCUIT_REFUSED": "❌ Ti è stato rifiutato l'accesso da %s a far parte del '%s'. Se pensi sia un'errore, contatta l'amministratore del Circuito.",
|
||||
"CIRCUIT_REMOVED": "❌ l'utente %s è stato rimosso del %s (da parte di %s)",
|
||||
"CIRCUIT_REFUSED_TO_ME": "All'utente %s gli è stato rifiutato l'accesso a far parte del '%s' (da parte di %s).",
|
||||
"CIRCUIT_REFUSED_TO_MYGROUP": "Al Conto Collettivo %s gli è stato rifiutato l'accesso a far parte del '%s' (da parte di %s).",
|
||||
"CIRCUIT_EXIT_USER": "❌ l'utente %s è uscito dal '%s'",
|
||||
"CIRCUIT_EXIT_USER_TO_ME": "❌ Sei uscito dal '%s'",
|
||||
"CIRCUIT_REMOVED_TO_ME": "❌ Sei stato rimosso dal '%s' (da parte di %s)",
|
||||
"CIRCUIT_SENDCOINSREQ": "%s ti sta inviando <strong>%s %s</strong> sul <strong>'%s'</strong>",
|
||||
"COMUNITARIO": "Comunitario",
|
||||
"COLLETTIVO": "Gruppo",
|
||||
"CIRCUIT_SENDCOINSREQ_GROUP": "%s sta inviando <strong>%s %s</strong> al Conto %s '%s' sul '%s'.",
|
||||
"CIRCUIT_SENDCOINSREQ_FROM_GROUP_TO_USER": "il conto %s '%s' (%s) sta inviando <strong>%s %s</strong> a %s sul '%s'.",
|
||||
"CIRCUIT_SENDCOINSREQ_FROM_GROUP_TO_YOU": "il conto %s '%s' (%s) ti sta inviando <strong>%s %s</strong> sul '%s'",
|
||||
"CIRCUIT_SENDCOINSREQ_FROM_GROUP_TO_GROUP": "il conto %s '%s' (%s) sta inviando <strong>%s %s</strong> al conto %s '%s' sul '%s'.",
|
||||
"CIRCUIT_SENDCOINSREQ_TO_ME": "Stai inviando <strong>%s %s</strong> a %s sul '%s'. \nIl destinatario deve accettare la transazione.",
|
||||
"CIRCUIT_SENDCOINSREQ_TO_GROUP": "Stai inviando <strong>%s %s</strong> al Conto %s '%s' sul '%s'. \nIl destinatario deve accettare la transazione.",
|
||||
"ID_CIRCUIT_COINS_ACCEPTED_FROM_GROUP_TO_YOU": "<strong>%s %s</strong> accettati dal Conto %s '%s' sul '%s' (%s) .",
|
||||
"ID_CIRCUIT_COINS_ACCEPTED_FROM_GROUP_TO_GROUP": "il conto %s '%s' (%s) ha accettato <strong>%s %s</strong> dal conto %s '%s' sul '%s' (%s).",
|
||||
"ID_CIRCUIT_COINS_ACCEPTED_FROM_ME_TO_GROUP": "il conto %s '%s' (%s) ha accettato <strong>%s %s</strong> da %s sul '%s'.",
|
||||
"ID_CIRCUIT_COINS_ACCEPTED_FROM_ME_TO_YOU": "<strong>%s %s</strong> accettati da %s sul '%s'.",
|
||||
"ID_CIRCUIT_COINS_ACCEPTED": "<strong>%s %s</strong> accettati da %s sul '%s'.",
|
||||
"SALDO_UPDATE": "[Saldo <strong>%s %s</strong> sul '%s']",
|
||||
"SALDO_UPDATE_WHO": "[Saldo %s <strong>%s %s</strong> sul '%s']",
|
||||
"ID_CIRCUIT_COINS_ACCEPTED_TO_ME": "<strong>%s %s</strong> sono stati accettati da %s sul '%s'.",
|
||||
"ID_CIRCUIT_COINS_REFUSED": "%s %s rifiutati da %s sul '%s'.",
|
||||
"ID_CIRCUIT_COINS_REFUSED_TO_ME": "%s %s rifiutati da %s sul '%s'.",
|
||||
"CIRCUIT_AMOUNT_EXCEED_FIDO": "L'importo supera la quantità massima concessa per %s",
|
||||
"CIRCUIT_AMOUNT_EXCEED_QTAMAX": "L'importo supera la quantità massima che il destinatario (%s) può accumulare",
|
||||
"CIRCUIT_COINS_ALREADY_PROCESSED": "La richiesta è stata già processata. Stato %s",
|
||||
"STATUS_SENT": "Inviato",
|
||||
"STATUS_REFUSED": "Rifiutato",
|
||||
"CLICCA_QUI": "CLICCA QUI"
|
||||
"SALDO_VARIATO": "[%s] l'utente %s ha variato il Saldo di %s da %s a %s %s",
|
||||
"FIDOCONCESSO_VARIATO": "[%s] l'utente %s ha variato la Fiducia Concessa di %s da %s a %s %s",
|
||||
"QTAMAX_VARIATO": "[%s] l'utente %s ha variato la quantità massima concessa di %s da %s a %s %s",
|
||||
"SET_FAVORITE": "%s ha messo 'Mi Piace' al tuo post: %s",
|
||||
"SET_FAVORITE_OTHERS": "%s e altre %s persone hanno messo 'Mi Piace' al tuo post: %s",
|
||||
"EVENT_SEND_MSG": "%s ha mandato un messaggio sull'evento %s: \n%s",
|
||||
"SET_ATTEND": "%s ha detto che Parteciperà all'evento: %s",
|
||||
"SET_ATTEND_OTHERS": "%s e altre %s persone hanno detto che Parteciperanno all'evento: %s",
|
||||
"DATEDAYONLY": "%s dalle %s alle %s",
|
||||
"DATE_2DAYS": "%s dalle %s fino a %s alle %s",
|
||||
"SENDMSG_ENTRA_IN_RISO_ITALIA": "Ciao %s!<br>%s che appartiene al <em>%s</em> vuole inviarti dei RIS. Per poterli ricevere dovete entrambi utilizzare il <strong>Circuito RIS Italia</strong>.",
|
||||
"CLICCA_QUI": "CLICCA QUI",
|
||||
"✅ %s è stato Abilitato correttamente (da %s)!": "✅ %s è stato Abilitato correttamente (da %s)!",
|
||||
"✅ Sei stato Abilitato correttamente da %s!": "✅ Sei stato Abilitato correttamente da %s!",
|
||||
"🚫 Hai rifiutato l'accesso alla App di RISO da parte di %s!": "🚫 Hai rifiutato l'accesso alla App di RISO da parte di %s!",
|
||||
"🚫 Ti è stato rifiutato l'accesso. Probabilmente l'username con cui ti sei registrato non ti conosce. (%s) !<br>Contatta l'Assistenza Tecnica.": "🚫 Ti è stato rifiutato l'accesso. Probabilmente l'username con cui ti sei registrato non ti conosce. (%s) !<br>Contatta l'Assistenza Tecnica.",
|
||||
"🚫 %s ha rifiutato l'accesso alla App a %s !": "🚫 %s ha rifiutato l'accesso alla App a %s !",
|
||||
"✅ Hai Abilitato l'accesso alla App a %s !": "✅ Hai Abilitato l'accesso alla App a %s !"
|
||||
}
|
||||
|
||||
@@ -13,70 +13,97 @@ const auth_default = (req, res, next) => {
|
||||
|
||||
const authenticate = (req, res, next) => {
|
||||
const token = req.header('x-auth');
|
||||
//const refreshToken = req.header('x-refrtok');
|
||||
|
||||
// console.log('authenticate... ');
|
||||
|
||||
let noaut = false;
|
||||
|
||||
if (req.body.hasOwnProperty('noaut')) {
|
||||
noaut = req.body.noaut;
|
||||
}
|
||||
|
||||
if (noaut) {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
|
||||
const access = 'auth';
|
||||
|
||||
User.findByToken(token, access).then((user) => {
|
||||
return User.findByToken(token, access, true).then((ris) => {
|
||||
|
||||
if (!user) {
|
||||
// tools.mylog("TOKEN " + token);
|
||||
// tools.mylog(" NOT FOUND! (Maybe Connected to other Page) ACCESS: '" + access + "'");
|
||||
return Promise.reject(server_constants.RIS_CODE_HTTP_INVALID_TOKEN);
|
||||
// res.status().send();
|
||||
if (ris && ris.user && !!ris.user.deleted) {
|
||||
if (ris.user.deleted)
|
||||
ris.user = null;
|
||||
}
|
||||
|
||||
if (!!user.deleted) {
|
||||
if (user.deleted)
|
||||
user = null;
|
||||
if (ris.code === server_constants.RIS_CODE_HTTP_FORBIDDEN_TOKEN_EXPIRED) {
|
||||
return Promise.reject(server_constants.RIS_CODE_HTTP_FORBIDDEN_TOKEN_EXPIRED);
|
||||
}
|
||||
|
||||
if (!user) {
|
||||
if (!ris.user) {
|
||||
return Promise.reject(server_constants.RIS_CODE_HTTP_INVALID_TOKEN);
|
||||
}
|
||||
|
||||
if (!!user) {
|
||||
if (!!ris.user) {
|
||||
// Save last time online
|
||||
user.lasttimeonline = new Date();
|
||||
user.useragent = req.get('User-Agent');
|
||||
ris.user.lasttimeonline = new Date();
|
||||
ris.user.retry_pwd = 0
|
||||
ris.user.useragent = req.get('User-Agent');
|
||||
|
||||
return user.save().then(() => {
|
||||
req.user = user;
|
||||
return ris.user.save().then(() => {
|
||||
req.user = ris.user;
|
||||
req.token = token;
|
||||
// req.refreshToken = refreshToken;
|
||||
req.access = access;
|
||||
next();
|
||||
next(); // Esegui il codice successivo
|
||||
});
|
||||
}
|
||||
// tools.mylog('userid', user._id);
|
||||
|
||||
}).catch((e) => {
|
||||
if (e === server_constants.RIS_CODE_HTTP_FORBIDDEN_TOKEN_EXPIRED) {
|
||||
return res.status(server_constants.RIS_CODE_HTTP_FORBIDDEN_TOKEN_EXPIRED).send();
|
||||
}
|
||||
tools.mylog("ERR authenticate invalid Token =", e);
|
||||
res.status(server_constants.RIS_CODE_HTTP_INVALID_TOKEN).send();
|
||||
});
|
||||
};
|
||||
|
||||
const authenticate_noerror = (req, res, next) => {
|
||||
const token = req.header('x-auth');
|
||||
try {
|
||||
const token = req.header('x-auth');
|
||||
const refreshToken = req.header('x-refrtok');
|
||||
|
||||
const access = 'auth';
|
||||
const access = 'auth';
|
||||
|
||||
User.findByToken(token, access).then((user) => {
|
||||
if (!user) {
|
||||
return User.findByToken(token, access, false).then((ris) => {
|
||||
if (ris.code !== server_constants.RIS_CODE_OK) {
|
||||
req.user = null;
|
||||
req.token = null;
|
||||
req.access = null;
|
||||
req.code = ris.code;
|
||||
} else {
|
||||
req.user = ris.user;
|
||||
req.token = token;
|
||||
req.refreshToken = refreshToken;
|
||||
req.access = access;
|
||||
req.code = ris.code;
|
||||
}
|
||||
// Vai avanti ad eseguire il codice, in ogni modo !
|
||||
next();
|
||||
}).catch((e) => {
|
||||
req.user = null;
|
||||
req.token = null;
|
||||
req.access = null;
|
||||
} else {
|
||||
req.user = user;
|
||||
req.token = token;
|
||||
req.access = access;
|
||||
}
|
||||
next();
|
||||
}).catch((e) => {
|
||||
req.user = null;
|
||||
req.token = null;
|
||||
req.access = null;
|
||||
});
|
||||
req.code = 0;
|
||||
|
||||
// Continua comunque !
|
||||
next();
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('Err', e);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = { authenticate, authenticate_noerror, auth_default };
|
||||
|
||||
@@ -30,9 +30,18 @@ const AccountSchema = new Schema({
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
numtransactions: {
|
||||
type: Number,
|
||||
},
|
||||
username: {
|
||||
type: String,
|
||||
},
|
||||
groupname: { // For the Groups
|
||||
type: String,
|
||||
},
|
||||
contocom: { // For the Conto Comunitario dei Circuiti
|
||||
type: String,
|
||||
},
|
||||
circuitId: { // ----- REF TO Circuit
|
||||
type: String,
|
||||
},
|
||||
@@ -50,12 +59,23 @@ const AccountSchema = new Schema({
|
||||
},
|
||||
importo_iniziale: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
saldo: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
totTransato: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
saldo_pend: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
totTransato_pend: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
regulation_ok: {
|
||||
type: Boolean,
|
||||
@@ -94,6 +114,9 @@ AccountSchema.pre('save', async function (next) {
|
||||
AccountSchema.statics.getFieldsForSearch = function () {
|
||||
return [
|
||||
{ field: 'name', type: tools.FieldType.string },
|
||||
{ field: 'username', type: tools.FieldType.string },
|
||||
{ field: 'groupname', type: tools.FieldType.string },
|
||||
{ field: 'contocom', type: tools.FieldType.string },
|
||||
];
|
||||
|
||||
};
|
||||
@@ -129,7 +152,7 @@ AccountSchema.statics.calcTotCircolante = async function (idapp, circuitId) {
|
||||
{ $group: { _id: null, count: { $sum: '$saldo' } } }
|
||||
];
|
||||
|
||||
ris = await Account.aggregate(aggr1);
|
||||
const ris = await Account.aggregate(aggr1);
|
||||
|
||||
return ris ? ris[0].count : 0;
|
||||
|
||||
@@ -138,23 +161,69 @@ AccountSchema.statics.calcTotCircolante = async function (idapp, circuitId) {
|
||||
}
|
||||
|
||||
};
|
||||
AccountSchema.methods.addtoSaldoSave = async function (amount) {
|
||||
const account = this;
|
||||
AccountSchema.methods.calcPending = async function (mittente) {
|
||||
try {
|
||||
const account = this;
|
||||
|
||||
if (account) {
|
||||
account.saldo = account.saldo + amount;
|
||||
if (!account.totTransato) {
|
||||
account.totTransato = 0;
|
||||
const { SendNotif } = require('../models/sendnotif');
|
||||
const { Circuit } = require('../models/circuit');
|
||||
|
||||
// *** Calc Pending Transactions ***
|
||||
|
||||
const circuit = await Circuit.getCircuitById(account.circuitId);
|
||||
if (circuit) {
|
||||
let prec_saldo_pend = account.saldo_pend;
|
||||
let prec_totTransato_pend = account.totTransato_pend;
|
||||
let transatopending = 0;
|
||||
|
||||
if (mittente) {
|
||||
let pendingtransactionsMittente = await SendNotif.getSumPendingTransactionsMittente(account.idapp, account.username, circuit.name, account.groupname);
|
||||
let saldopendingMitt = pendingtransactionsMittente.reduce((sum, rec) => sum + rec.extrarec.qty, 0);
|
||||
transatopending = pendingtransactionsMittente.reduce((sum, rec) => sum + Math.abs(rec.extrarec.qty), 0);
|
||||
|
||||
account.saldo_pend = account.saldo - saldopendingMitt;
|
||||
} else {
|
||||
// let pendingtransactionsDest = await SendNotif.getSumPendingTransactionsMittente(account.idapp, account.username, circuit.name, account.groupname);
|
||||
|
||||
// let saldopendingDest = pendingtransactionsDest.reduce((sum, rec) => sum + rec.extrarec.qty, 0);
|
||||
// transatopending = pendingtransactionsDest.reduce((sum, rec) => sum + Math.abs(rec.extrarec.qty), 0);
|
||||
|
||||
// account.saldo_pend = account.saldo + saldopendingDest;
|
||||
account.saldo_pend = account.saldo;
|
||||
}
|
||||
account.totTransato_pend = account.totTransato + transatopending;
|
||||
|
||||
if (prec_saldo_pend !== account.saldo_pend || prec_totTransato_pend !== account.totTransato_pend) {
|
||||
|
||||
const myaccountupdate = {
|
||||
saldo_pend: account.saldo_pend,
|
||||
totTransato_pend: account.totTransato_pend,
|
||||
};
|
||||
|
||||
// Update Record
|
||||
return await Account.findByIdAndUpdate(account.id,
|
||||
{
|
||||
$set: myaccountupdate
|
||||
}).then((ris) => {
|
||||
console.log('calcPending', ris);
|
||||
}).catch((err) => {
|
||||
console.error('calcPending', err);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
account.totTransato += Math.abs(amount);
|
||||
account.date_updated = new Date();
|
||||
return await account.save();
|
||||
|
||||
|
||||
// -----
|
||||
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
||||
AccountSchema.statics.addtoSaldo = async function (myaccount, amount) {
|
||||
AccountSchema.statics.addtoSaldo = async function (myaccount, amount, mitt) {
|
||||
const Account = this;
|
||||
|
||||
try {
|
||||
@@ -166,16 +235,28 @@ AccountSchema.statics.addtoSaldo = async function (myaccount, amount) {
|
||||
myaccount.totTransato = 0;
|
||||
}
|
||||
myaccount.totTransato += Math.abs(amount);
|
||||
|
||||
if (!myaccount.numtransactions)
|
||||
myaccount.numtransactions = 0;
|
||||
myaccount.numtransactions++;
|
||||
|
||||
myaccount.date_updated = new Date();
|
||||
|
||||
myaccountupdate.saldo = myaccount.saldo;
|
||||
myaccountupdate.totTransato = myaccount.totTransato;
|
||||
myaccountupdate.numtransactions = myaccount.numtransactions;
|
||||
myaccountupdate.date_updated = myaccount.date_updated;
|
||||
|
||||
return await Account.updateOne({ _id: myaccount.id },
|
||||
const ris = await Account.updateOne({ _id: myaccount.id },
|
||||
{
|
||||
$set: myaccountupdate
|
||||
});
|
||||
|
||||
// Calcola Saldo Pendente !
|
||||
await myaccount.calcPending(true);
|
||||
|
||||
return ris;
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('error', e);
|
||||
@@ -186,28 +267,36 @@ AccountSchema.statics.addtoSaldo = async function (myaccount, amount) {
|
||||
|
||||
AccountSchema.pre('save', async function (next) {
|
||||
if (this.isNew) {
|
||||
this.date_created = new Date();
|
||||
if (!this.date_created)
|
||||
this.date_created = new Date();
|
||||
}
|
||||
|
||||
next();
|
||||
});
|
||||
|
||||
AccountSchema.statics.getAccountByUsernameAndCircuitId = async function (idapp, username, circuitId, createifnotexist) {
|
||||
AccountSchema.statics.getAccountByUsernameAndCircuitId = async function (idapp, username, circuitId, createifnotexist, confido, groupname = '', contocom = "") {
|
||||
const Account = this;
|
||||
|
||||
try {
|
||||
|
||||
const { Circuit } = require('../models/circuit');
|
||||
|
||||
if (username === undefined)
|
||||
return false;
|
||||
// if (username === undefined)
|
||||
// return false;
|
||||
|
||||
let myquery = {
|
||||
'idapp': idapp,
|
||||
'username': username,
|
||||
idapp,
|
||||
circuitId,
|
||||
};
|
||||
|
||||
if (groupname) {
|
||||
myquery.groupname = groupname;
|
||||
} else if (contocom) {
|
||||
myquery.contocom = contocom;
|
||||
} else {
|
||||
myquery.username = username;
|
||||
}
|
||||
|
||||
let mycircuit = await Circuit.getCircuitById(circuitId);
|
||||
|
||||
if (mycircuit) {
|
||||
@@ -217,15 +306,43 @@ AccountSchema.statics.getAccountByUsernameAndCircuitId = async function (idapp,
|
||||
myaccount = new Account({
|
||||
_id: new ObjectID().toString(),
|
||||
idapp,
|
||||
username,
|
||||
username: (!groupname && !contocom) ? username : '',
|
||||
groupname,
|
||||
contocom,
|
||||
circuitId: mycircuit._id,
|
||||
deperibile: false,
|
||||
fidoConcesso: mycircuit.fido_scoperto_default,
|
||||
qta_maxConcessa: mycircuit.qta_max_default,
|
||||
importo_iniziale: 0,
|
||||
saldo: 0,
|
||||
saldo_pend: 0,
|
||||
fidoConcesso: 0,
|
||||
qta_maxConcessa: 0,
|
||||
totTransato: 0,
|
||||
numtransactions: 0,
|
||||
totTransato_pend: 0,
|
||||
});
|
||||
|
||||
if (contocom) {
|
||||
myaccount.fidoConcesso = shared_consts.CIRCUIT_PARAMS.SCOPERTO_MIN_CONTO_COMUNITARIO;
|
||||
myaccount.qta_maxConcessa = shared_consts.CIRCUIT_PARAMS.SCOPERTO_MAX_CONTO_COMUNITARIO;
|
||||
} else {
|
||||
if (!mycircuit.fido_scoperto_default_grp)
|
||||
mycircuit.fido_scoperto_default_grp = shared_consts.CIRCUIT_PARAMS.SCOPERTO_MIN_GRP;
|
||||
if (!mycircuit.qta_max_default_grp)
|
||||
mycircuit.qta_max_default_grp = shared_consts.CIRCUIT_PARAMS.SCOPERTO_MAX_GRP;
|
||||
|
||||
if (groupname) {
|
||||
myaccount.fidoConcesso = mycircuit.fido_scoperto_default_grp;
|
||||
myaccount.qta_maxConcessa = mycircuit.qta_max_default_grp;
|
||||
} else {
|
||||
myaccount.fidoConcesso = mycircuit.fido_scoperto_default;
|
||||
myaccount.qta_maxConcessa = mycircuit.qta_max_default;
|
||||
}
|
||||
}
|
||||
|
||||
if (!confido) {
|
||||
myaccount.fidoConcesso = 0;
|
||||
}
|
||||
|
||||
return await myaccount.save();
|
||||
}
|
||||
|
||||
@@ -239,14 +356,52 @@ AccountSchema.statics.getAccountByUsernameAndCircuitId = async function (idapp,
|
||||
|
||||
};
|
||||
|
||||
AccountSchema.statics.createAccount = async function (idapp, username, circuitName) {
|
||||
AccountSchema.statics.isExistAccountByUsernameAndCircuitId = async function (idapp, username, circuitId, groupname = '', contocom = "") {
|
||||
const Account = this;
|
||||
|
||||
try {
|
||||
|
||||
const { Circuit } = require('../models/circuit');
|
||||
|
||||
if (username === undefined)
|
||||
return false;
|
||||
|
||||
let myquery = {
|
||||
idapp,
|
||||
circuitId,
|
||||
};
|
||||
|
||||
if (groupname) {
|
||||
myquery.groupname = groupname;
|
||||
} else if (contocom) {
|
||||
myquery.contocom = contocom;
|
||||
} else {
|
||||
myquery.username = username;
|
||||
}
|
||||
|
||||
let mycircuit = await Circuit.getCircuitById(circuitId);
|
||||
|
||||
if (mycircuit) {
|
||||
let myaccount = await Account.findOne(myquery);
|
||||
return !!myaccount
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
} catch (e) {
|
||||
console.error('error', e);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
AccountSchema.statics.createAccount = async function (idapp, username, circuitName, confido, groupname = '', contocom = '') {
|
||||
|
||||
const { Circuit } = require('../models/circuit');
|
||||
|
||||
try {
|
||||
mycircuit = await Circuit.findOne({ name: circuitName }, {_id: 1});
|
||||
mycircuit = await Circuit.findOne({ name: circuitName }, { _id: 1 });
|
||||
if (mycircuit) {
|
||||
return await Account.getAccountByUsernameAndCircuitId(idapp, username, mycircuit._id, true);
|
||||
return await Account.getAccountByUsernameAndCircuitId(idapp, username, mycircuit._id, true, confido, groupname, contocom);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@@ -258,6 +413,7 @@ AccountSchema.statics.createAccount = async function (idapp, username, circuitNa
|
||||
};
|
||||
|
||||
AccountSchema.statics.getUserAccounts = async function (idapp, username) {
|
||||
const { SendNotif } = require('../models/sendnotif');
|
||||
|
||||
try {
|
||||
let aggr1 = [
|
||||
@@ -289,32 +445,114 @@ AccountSchema.statics.getUserAccounts = async function (idapp, username) {
|
||||
$match: {
|
||||
$expr: {
|
||||
$and: [
|
||||
{ $eq: ['$idapp', '$$idapp'] },
|
||||
{ $eq: ['$typedir', '$$typedir'] },
|
||||
{ $eq: ['$typeid', '$$typeid'] },
|
||||
{ $eq: ['$status', 0] },
|
||||
{ $eq: ['$sender', '$$username'] },
|
||||
{ $eq: ['$extrarec.circuitname', '$$circuitname'] },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$group:
|
||||
{ _id: "$extrarec.notifIdToUpdate", result: { $first: "$$ROOT" } }
|
||||
},
|
||||
|
||||
],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const ris = await this.aggregate(aggr1);
|
||||
|
||||
// console.log('1 - INIZIA getUserAccounts ')
|
||||
// console.log(aggr1);
|
||||
|
||||
/* if (ris) {
|
||||
for (const account of ris) {
|
||||
try {
|
||||
//++OTTIMIZZARE QUESTA PARTE ! (CON UNA QUERY...)
|
||||
// console.log(' 1B - PENDIND... ')
|
||||
|
||||
let pendingtransactions = await SendNotif.getSumPendingTransactions(idapp, username, account.circuit.name);
|
||||
let saldopending = pendingtransactions.reduce((sum, rec) => sum + rec.extrarec.qty, 0);
|
||||
if (saldopending !== 0) {
|
||||
account.saldo -= saldopending;
|
||||
account.totTransato = account.totTransato || 0;
|
||||
}
|
||||
|
||||
|
||||
} catch (e) {
|
||||
console.error('getUserAccounts 1) ', e);
|
||||
}
|
||||
|
||||
}
|
||||
} */
|
||||
|
||||
return ris;
|
||||
} catch (e) {
|
||||
console.error('getUserAccounts', e);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
AccountSchema.statics.getGroupAccounts = async function (idapp, groupname) {
|
||||
|
||||
if (!groupname) {
|
||||
return [];
|
||||
}
|
||||
try {
|
||||
let aggr1 = [
|
||||
{
|
||||
$match: { idapp, groupname },
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'circuits',
|
||||
localField: 'circuitId',
|
||||
foreignField: '_id',
|
||||
as: 'circuit',
|
||||
},
|
||||
},
|
||||
{ $unwind: '$circuit' },
|
||||
{
|
||||
$lookup: {
|
||||
from: 'sendnotifs',
|
||||
as: 'notifspending',
|
||||
let: {
|
||||
circuitname: '$circuit.name',
|
||||
groupname: '$groupname',
|
||||
idapp: '$idapp',
|
||||
typedir: shared_consts.TypeNotifs.TYPEDIR_CIRCUITS,
|
||||
typeid: shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ,
|
||||
},
|
||||
pipeline: [
|
||||
{
|
||||
$match: {
|
||||
$expr: {
|
||||
$and: [
|
||||
{ $eq: ['$typedir', '$$typedir'] },
|
||||
{ $eq: ['$typeid', '$$typeid'] },
|
||||
{ $eq: ['$status', 0] },
|
||||
{ $eq: ['$sendergroup', '$$groupname'] },
|
||||
{ $eq: ['$idapp', '$$idapp'] },
|
||||
{ $eq: ['$extrarec.circuitname', '$$circuitname'] },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$group:
|
||||
{ _id: "$extrarec.notifIdToUpdate", result: { $first: "$$ROOT" } }
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
ris = await this.aggregate(aggr1);
|
||||
|
||||
const { SendNotif } = require('../models/sendnotif');
|
||||
|
||||
if (ris) {
|
||||
for (const account of ris) {
|
||||
const pendingtransactions = await SendNotif.getSumPendingTransactions(idapp, username, account.circuit.name);
|
||||
const saldopending = pendingtransactions.reduce((sum, rec) => sum + rec.extrarec.qty, 0);
|
||||
account.saldo -= saldopending;
|
||||
}
|
||||
}
|
||||
const ris = await this.aggregate(aggr1);
|
||||
|
||||
return ris;
|
||||
} catch (e) {
|
||||
@@ -323,6 +561,198 @@ AccountSchema.statics.getUserAccounts = async function (idapp, username) {
|
||||
|
||||
};
|
||||
|
||||
// Imposta a tutti i Conti Collettivi, i seguenti minimi e massimi
|
||||
AccountSchema.statics.SetMinMaxCollettivi = async function (idapp, valmin, valmax) {
|
||||
const Account = this;
|
||||
|
||||
const ris = await Account.updateMany({ idapp, groupname: { "$nin": [null, ""] } },
|
||||
{
|
||||
$set:
|
||||
{
|
||||
fidoConcesso: valmin,
|
||||
qta_maxConcessa: valmax,
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// Imposta a tutti i Conti Comunitari, i seguenti minimi e massimi
|
||||
AccountSchema.statics.SetMinMaxComunitari = async function (idapp, valmin, valmax) {
|
||||
const Account = this;
|
||||
|
||||
const ris = await Account.updateMany({ idapp, contocom: { "$nin": [null, ""] } },
|
||||
{
|
||||
$set:
|
||||
{
|
||||
fidoConcesso: valmin,
|
||||
qta_maxConcessa: valmax,
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// Imposta a tutti i Conti Personali, i seguenti minimi e massimi
|
||||
AccountSchema.statics.SetMinMaxPersonali = async function (idapp, fidoConcesso, qta_maxConcessa, circuitId) {
|
||||
const Account = this;
|
||||
|
||||
if (circuitId) {
|
||||
const ris = await Account.updateMany({ idapp, circuitId, fidoConcesso: { $gt: 0 }, username: { "$nin": [null, ""] } },
|
||||
{
|
||||
$set:
|
||||
{
|
||||
fidoConcesso,
|
||||
qta_maxConcessa,
|
||||
}
|
||||
});
|
||||
|
||||
// Se aggiorno questi dati, allora devo aggiornare anche gli account del RIS Nazionale
|
||||
await Account.updateAccountCircuitoNazionaleByLimiti(idapp, circuitId, fidoConcesso, qta_maxConcessa);
|
||||
|
||||
} else {
|
||||
const ris = await Account.updateMany({ idapp, fidoConcesso: { $gt: 0 }, username: { "$nin": [null, ""] } },
|
||||
{
|
||||
$set:
|
||||
{
|
||||
fidoConcesso,
|
||||
qta_maxConcessa,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
AccountSchema.statics.updateFido = async function (idapp, username, groupname, circuitId, fido) {
|
||||
|
||||
let paramstoupdate = {
|
||||
fidoConcesso: fido,
|
||||
};
|
||||
let risult = null;
|
||||
if (groupname)
|
||||
risult = await Account.updateOne({ idapp, circuitId, groupname }, { $set: paramstoupdate });
|
||||
else
|
||||
risult = await Account.updateOne({ idapp, username, circuitId }, { $set: paramstoupdate });
|
||||
|
||||
return risult;
|
||||
};
|
||||
|
||||
AccountSchema.statics.updateQtaMax = async function (idapp, username, groupname, circuitId, qtamax) {
|
||||
|
||||
let paramstoupdate = {
|
||||
qta_maxConcessa: qtamax,
|
||||
};
|
||||
let risult = null;
|
||||
if (groupname)
|
||||
risult = await Account.updateOne({ idapp, circuitId, groupname }, { $set: paramstoupdate });
|
||||
else
|
||||
risult = await Account.updateOne({ idapp, username, circuitId }, { $set: paramstoupdate });
|
||||
|
||||
return risult && risult.nModified > 0;
|
||||
};
|
||||
|
||||
AccountSchema.statics.getAccountsCircuitiNazionali = async function (idapp) {
|
||||
const { Circuit } = require('../models/circuit');
|
||||
|
||||
const circuit = await Circuit.find({ idapp, showAlways: true });
|
||||
|
||||
return Account.find({ idapp, circuitId: circuit.id });
|
||||
};
|
||||
|
||||
AccountSchema.statics.updateAccountCircuitoNazionaleByLimiti = async function (idapp, circuitId, fidoConcesso, qta_maxConcessa) {
|
||||
const { Circuit } = require('../models/circuit');
|
||||
|
||||
try {
|
||||
const accounts = await this.getAccountsCircuitiNazionali(idapp);
|
||||
|
||||
for (const account of accounts) {
|
||||
const circuitId = account.circuitId;
|
||||
const circuit = await Circuit.findOne({ _id: circuitId });
|
||||
if (circuit) {
|
||||
let fido = 0;
|
||||
let qtamax = 0;
|
||||
|
||||
if (account.groupname) {
|
||||
fido = circuit.fido_scoperto_default_grp * shared_consts.CIRCUIT_CFG.MULT_FIDO_GROUP;
|
||||
qtamax = circuit.qta_max_default_grp * shared_consts.CIRCUIT_CFG.MULT_FIDO_GROUP;
|
||||
} else {
|
||||
fido = circuit.fido_scoperto_default * shared_consts.CIRCUIT_CFG.MULT_FIDO_USER;
|
||||
qtamax = circuit.qta_max_default * shared_consts.CIRCUIT_CFG.MULT_FIDO_USER;
|
||||
}
|
||||
|
||||
let paramstoupdate = {
|
||||
fidoConcesso: fido,
|
||||
qta_maxConcessa: qtamax,
|
||||
};
|
||||
|
||||
risult = await Account.updateOne({ _id: account.id }, { $set: paramstoupdate });
|
||||
}
|
||||
}
|
||||
return risult;
|
||||
} catch (e) {
|
||||
console.error('updateAccountCircuitoNazionaleByLimiti', e);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
};
|
||||
|
||||
AccountSchema.statics.canEditAccountAdmins = async function (username, id) {
|
||||
const account = await Account.findOne({ _id: id }).lean();
|
||||
|
||||
const { Circuit } = require('../models/circuit');
|
||||
|
||||
if (account) {
|
||||
const circuit = await Circuit.findOne({ _id: account.circuitId }).lean();
|
||||
if (circuit) {
|
||||
return circuit.admins.findIndex((admin) => admin.username === username) >= 0;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
AccountSchema.statics.addToPeopleOfMyAccount = async function (idapp, username, circuitId, person_username, perm) {
|
||||
|
||||
return await Account.updateOne({ idapp, username, circuitId },
|
||||
{
|
||||
$push:
|
||||
{
|
||||
people: {
|
||||
username: person_username,
|
||||
perm,
|
||||
date: new Date(),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// Rimuovi dagli Admin del Account
|
||||
AccountSchema.statics.removeAdminOfAccount = async function (idapp, username, circuitId, person_username, perm) {
|
||||
const { Circuit } = require('../models/circuit');
|
||||
|
||||
return await Circuit.updateOne({ idapp, username, circuitId },
|
||||
{ $pull: { people: { username: { $in: [person_username] } } } });
|
||||
};
|
||||
|
||||
// Rimuovi l'account
|
||||
AccountSchema.statics.removeAccount = async function (accountId) {
|
||||
|
||||
return await Account.deleteOne({ _id: accountId});
|
||||
};
|
||||
|
||||
AccountSchema.statics.updateSaldoAndTransato_AllAccounts = async function (idapp) {
|
||||
|
||||
const recaccounts = await Account.find({ idapp });
|
||||
|
||||
for (const account of recaccounts) {
|
||||
await account.calcPending();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const Account = mongoose.model('Account', AccountSchema);
|
||||
|
||||
Account.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Account };
|
||||
|
||||
@@ -64,4 +64,8 @@ AdTypeSchema.statics.executeQueryTable = function(idapp, params) {
|
||||
|
||||
const AdType = mongoose.model('AdType', AdTypeSchema);
|
||||
|
||||
AdType.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = {AdType};
|
||||
|
||||
@@ -64,4 +64,8 @@ AdTypeGoodSchema.statics.executeQueryTable = function(idapp, params) {
|
||||
|
||||
const AdTypeGood = mongoose.model('AdTypeGood', AdTypeGoodSchema);
|
||||
|
||||
AdTypeGood.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = {AdTypeGood};
|
||||
|
||||
54
src/server/models/author.js
Executable file
54
src/server/models/author.js
Executable file
@@ -0,0 +1,54 @@
|
||||
mongoose = require('mongoose').set('debug', false)
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.level = "F";
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => {
|
||||
schema.options.usePushEach = true
|
||||
});
|
||||
|
||||
const AuthorSchema = new Schema({
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
},
|
||||
surname: {
|
||||
type: String,
|
||||
},
|
||||
bio: {
|
||||
type: String,
|
||||
},
|
||||
img: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
var Author = module.exports = mongoose.model('Author', AuthorSchema);
|
||||
|
||||
module.exports.getFieldsForSearch = function () {
|
||||
return [
|
||||
{ field: 'name', type: tools.FieldType.string },
|
||||
{ field: 'surname', type: tools.FieldType.string },
|
||||
]
|
||||
};
|
||||
|
||||
module.exports.executeQueryTable = function (idapp, params) {
|
||||
params.fieldsearch = this.getFieldsForSearch();
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
};
|
||||
|
||||
module.exports.findAllIdApp = async function (idapp) {
|
||||
const myfind = { idapp };
|
||||
|
||||
return await Author.find(myfind).sort({name: 1, surname: 1});
|
||||
};
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
@@ -20,6 +20,12 @@ const bookingSchema = new Schema({
|
||||
userId: {
|
||||
type: String,
|
||||
},
|
||||
username: {
|
||||
type: String,
|
||||
},
|
||||
tableType: {
|
||||
type: Number,
|
||||
},
|
||||
id_bookedevent: {
|
||||
type: String,
|
||||
},
|
||||
@@ -116,4 +122,8 @@ bookingSchema.statics.findAllDistinctByBooking = function (idapp) {
|
||||
|
||||
const Booking = mongoose.model('Booking', bookingSchema);
|
||||
|
||||
Booking.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Booking };
|
||||
|
||||
@@ -50,11 +50,11 @@ const BotSchema = new Schema({
|
||||
},
|
||||
});
|
||||
|
||||
BotSchema.statics.getFieldsForSearch = function() {
|
||||
BotSchema.statics.getFieldsForSearch = function () {
|
||||
return [{ field: 'label', type: tools.FieldType.string }]
|
||||
};
|
||||
|
||||
BotSchema.statics.executeQueryTable = function(idapp, params) {
|
||||
BotSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
params.fieldsearch = this.getFieldsForSearch();
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
};
|
||||
@@ -66,14 +66,147 @@ BotSchema.statics.DuplicateAllRecords = async function (idapporig, idappdest) {
|
||||
};
|
||||
|
||||
|
||||
BotSchema.statics.findAllIdApp = async function(idapp) {
|
||||
BotSchema.statics.generateBotMenuRecords = async function (idapp) {
|
||||
|
||||
try {
|
||||
let arrrec = [
|
||||
{
|
||||
"page": 1,
|
||||
"index": 1,
|
||||
"riga": 1,
|
||||
"active": true,
|
||||
"label": "Vai al Sito",
|
||||
"type": 3,
|
||||
"value": "{host}",
|
||||
"visibility": 0,
|
||||
idapp,
|
||||
"lang": "it",
|
||||
"main": true
|
||||
},
|
||||
{
|
||||
"page": 1,
|
||||
"index": 1,
|
||||
"riga": 2,
|
||||
"active": true,
|
||||
"label": "Il mio Profilo",
|
||||
"type": 3,
|
||||
"value": "{host}/my/{username}",
|
||||
"visibility": 1,
|
||||
idapp,
|
||||
"lang": "it",
|
||||
"main": true
|
||||
},
|
||||
{
|
||||
"page": 1,
|
||||
"index": 1,
|
||||
"riga": 3,
|
||||
"active": true,
|
||||
"label": "Link da Condividere",
|
||||
"type": 2,
|
||||
"value": "{host}/registrati/{username}",
|
||||
"visibility": 1,
|
||||
idapp,
|
||||
"lang": "it",
|
||||
"main": true,
|
||||
},
|
||||
{
|
||||
"page": 1,
|
||||
"index": 2,
|
||||
"riga": 1,
|
||||
"active": true,
|
||||
"label": "🔮 Help",
|
||||
"type": 4,
|
||||
"value": "",
|
||||
"visibility": 0,
|
||||
idapp,
|
||||
"lang": "it",
|
||||
"main": true,
|
||||
},
|
||||
{
|
||||
"page": 1,
|
||||
"index": 1,
|
||||
"riga": 3,
|
||||
"active": true,
|
||||
"label": "💁♀️ Admin",
|
||||
"type": 4,
|
||||
"value": "",
|
||||
"visibility": 5,
|
||||
idapp,
|
||||
"lang": "it",
|
||||
"main": true
|
||||
},
|
||||
{
|
||||
"page": 1,
|
||||
"index": 2,
|
||||
"riga": 2,
|
||||
"active": true,
|
||||
"label": "Imposta Foto Profilo",
|
||||
"type": 4,
|
||||
"value": "🖼 SetPicProfile",
|
||||
"visibility": 1,
|
||||
idapp,
|
||||
"lang": "it",
|
||||
"main": true
|
||||
},
|
||||
{
|
||||
"page": 1,
|
||||
"index": 2,
|
||||
"riga": 3,
|
||||
"active": true,
|
||||
"label": "🛠 Strumenti",
|
||||
"type": 1,
|
||||
"value": "2",
|
||||
"visibility": 1,
|
||||
idapp,
|
||||
"lang": "it",
|
||||
"main": true,
|
||||
},
|
||||
{
|
||||
"page": 2,
|
||||
"index": 1,
|
||||
"riga": 1,
|
||||
"active": true,
|
||||
"label": "🔑 Cambio Password",
|
||||
"type": 4,
|
||||
"value": "🔑 SetResetPwd",
|
||||
"visibility": 1,
|
||||
idapp,
|
||||
"lang": "it",
|
||||
},
|
||||
{
|
||||
"page": 2,
|
||||
"index": 1,
|
||||
"riga": 2,
|
||||
"active": true,
|
||||
"label": "👉🏻 Indietro",
|
||||
"type": 1,
|
||||
"value": "1",
|
||||
"visibility": 1,
|
||||
idapp,
|
||||
"lang": "it",
|
||||
}];
|
||||
|
||||
const ris = await MyBot.insertMany(arrrec);
|
||||
|
||||
return ris;
|
||||
|
||||
} catch (e) {
|
||||
console.error('Err:', e);
|
||||
}
|
||||
|
||||
}
|
||||
BotSchema.statics.findAllIdApp = async function (idapp) {
|
||||
const Bot = this;
|
||||
|
||||
const myfind = {idapp};
|
||||
const myfind = { idapp };
|
||||
|
||||
return await Bot.find(myfind).sort({page: 1, lang: 1, riga: 1, index: 1}).lean();
|
||||
return await Bot.find(myfind).sort({ page: 1, lang: 1, riga: 1, index: 1 }).lean();
|
||||
};
|
||||
|
||||
const MyBot = mongoose.model('Bot', BotSchema);
|
||||
|
||||
module.exports = {MyBot};
|
||||
MyBot.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MyBot };
|
||||
|
||||
@@ -76,4 +76,8 @@ CalZoomSchema.statics.getNextZoom = async function (idapp) {
|
||||
|
||||
const CalZoom = mongoose.model('CalZoom', CalZoomSchema);
|
||||
|
||||
CalZoom.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { CalZoom };
|
||||
|
||||
@@ -1,29 +1,38 @@
|
||||
const mongoose = require('mongoose').set('debug', false);
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const shared_consts = require('../tools/shared_nodejs');
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.level = "F";
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => {
|
||||
schema.options.usePushEach = true
|
||||
});
|
||||
|
||||
const Order = require('../models/order');
|
||||
|
||||
const CartSchema = new Schema({
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
userId: {type: Schema.Types.ObjectId, ref: 'User'},
|
||||
totalQty: {type: Number, default: 0},
|
||||
totalPrice: {type: Number, default: 0},
|
||||
userId: { type: Schema.Types.ObjectId, ref: 'User' },
|
||||
totalQty: { type: Number, default: 0 },
|
||||
totalPrice: { type: Number, default: 0 },
|
||||
totalPriceCalc: { type: Number, default: 0 },
|
||||
department: {
|
||||
type: String, ref: 'Department',
|
||||
},
|
||||
items: [
|
||||
{
|
||||
order:
|
||||
{type: Schema.Types.ObjectId, ref: 'Order'},
|
||||
{ type: Schema.Types.ObjectId, ref: 'Order' },
|
||||
},
|
||||
],
|
||||
note: {
|
||||
type: String,
|
||||
},
|
||||
note_ordine_gas: {
|
||||
type: String,
|
||||
},
|
||||
modify_at: {
|
||||
type: Date,
|
||||
},
|
||||
@@ -31,57 +40,75 @@ const CartSchema = new Schema({
|
||||
|
||||
var Cart = module.exports = mongoose.model('Cart', CartSchema);
|
||||
|
||||
module.exports.findAllIdApp = async function(idapp, userId) {
|
||||
const myfind = {idapp, userId};
|
||||
module.exports.findAllIdApp = async function (idapp, userId) {
|
||||
const myfind = { idapp, userId };
|
||||
|
||||
return await Cart.findOne(myfind).lean();
|
||||
};
|
||||
|
||||
module.exports.getCartByUserId = async function(uid, idapp) {
|
||||
let query = {userId: uid, idapp};
|
||||
const mycart = await Cart.findOne(query).lean();
|
||||
module.exports.getCartByUserId = async function (uid, idapp) {
|
||||
try {
|
||||
const Order = require('../models/order');
|
||||
|
||||
if (!!mycart) {
|
||||
for (const idkey in mycart.items) {
|
||||
try {
|
||||
idorder = mycart.items[idkey]._id.toString();
|
||||
const myorder = mycart.items[idkey].order;
|
||||
if (!!myorder) {
|
||||
idorder = mycart.items[idkey].order._id.toString();
|
||||
let query = { userId: uid, idapp };
|
||||
const mycart = await Cart.findOne(query).lean();
|
||||
|
||||
if (!!mycart) {
|
||||
for (const idkey in mycart.items) {
|
||||
try {
|
||||
let idorder = mycart.items[idkey]._id.toString();
|
||||
let myorder = mycart.items[idkey].order;
|
||||
if (!!myorder) {
|
||||
idorder = mycart.items[idkey].order._id.toString();
|
||||
}
|
||||
if (idorder) {
|
||||
let myord = await Order.getTotalOrderById(idorder);
|
||||
if (myord.length > 0) {
|
||||
mycart.items[idkey].order = myord[0];
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('err', e);
|
||||
}
|
||||
const myord = await Order.getTotalOrderById(idorder);
|
||||
if (myord.length > 0) {
|
||||
mycart.items[idkey].order = myord[0];
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('err', e);
|
||||
}
|
||||
|
||||
mycart.newitems = []
|
||||
for (let item of mycart.items) {
|
||||
if (item.order && item.order.hasOwnProperty('idapp') && (item.order.quantity > 0 || item.order.quantitypreordered > 0))
|
||||
mycart.newitems.push(item)
|
||||
}
|
||||
mycart.items = [...mycart.newitems]
|
||||
mycart.newitems = []
|
||||
|
||||
return mycart;
|
||||
}
|
||||
return mycart;
|
||||
return null;
|
||||
} catch (e) {
|
||||
console.log('getCartByUserId err', e);
|
||||
}
|
||||
return null;
|
||||
|
||||
};
|
||||
|
||||
module.exports.updateCartByUserId = function(userId, newCart, callback) {
|
||||
let query = {userId: userId};
|
||||
Cart.find(query, function(err, c) {
|
||||
module.exports.updateCartByUserId = function (userId, newCart, callback) {
|
||||
let query = { userId: userId };
|
||||
Cart.find(query, function (err, c) {
|
||||
if (err) throw err;
|
||||
|
||||
//exist cart in databse
|
||||
if (c.length > 0) {
|
||||
Cart.findOneAndUpdate(
|
||||
{userId: userId},
|
||||
{
|
||||
$set: {
|
||||
items: newCart.items,
|
||||
totalQty: newCart.totalQty,
|
||||
totalPrice: newCart.totalPrice,
|
||||
userId: userId,
|
||||
},
|
||||
{ userId: userId },
|
||||
{
|
||||
$set: {
|
||||
items: newCart.items,
|
||||
totalQty: newCart.totalQty,
|
||||
totalPrice: newCart.totalPrice,
|
||||
totalPriceCalc: newCart.totalPriceCalc,
|
||||
userId: userId,
|
||||
},
|
||||
{new: true},
|
||||
callback,
|
||||
},
|
||||
{ new: true },
|
||||
callback,
|
||||
);
|
||||
} else {
|
||||
//no cart in database
|
||||
@@ -90,22 +117,28 @@ module.exports.updateCartByUserId = function(userId, newCart, callback) {
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.updateCartByCartId = async function(cartId, newCart) {
|
||||
module.exports.updateCartByCartId = async function (cartId, newCart) {
|
||||
// delete newCart._doc._id;
|
||||
const items = newCart.items;
|
||||
const totalQty = newCart.totalQty;
|
||||
const totalPrice = newCart.totalPrice;
|
||||
const totalPriceCalc = newCart.totalPriceCalc;
|
||||
const note = newCart.note;
|
||||
const note_ordine_gas = newCart.note_ordine_gas;
|
||||
|
||||
const modify_at = new Date();
|
||||
|
||||
return await Cart.findOneAndUpdate({_id: cartId}, {
|
||||
return await Cart.findOneAndUpdate({ _id: cartId }, {
|
||||
$set: {
|
||||
items,
|
||||
totalPrice,
|
||||
totalPriceCalc,
|
||||
totalQty,
|
||||
modify_at,
|
||||
note,
|
||||
note_ordine_gas,
|
||||
modify_at: new Date(),
|
||||
},
|
||||
}, {new: false}).lean().then((ris) => {
|
||||
}, { new: false }).lean().then((ris) => {
|
||||
return ris;
|
||||
}).catch(err => {
|
||||
console.log('err', err);
|
||||
@@ -114,11 +147,15 @@ module.exports.updateCartByCartId = async function(cartId, newCart) {
|
||||
|
||||
};
|
||||
|
||||
module.exports.deleteCartByCartId = async function(cartId) {
|
||||
return await Cart.remove({_id: cartId});
|
||||
module.exports.deleteCartByCartId = async function (cartId) {
|
||||
return await Cart.remove({ _id: cartId });
|
||||
};
|
||||
|
||||
module.exports.createCart = async function(newCart) {
|
||||
module.exports.createCart = async function (newCart) {
|
||||
return await newCart.save();
|
||||
};
|
||||
|
||||
|
||||
Cart.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -1,127 +0,0 @@
|
||||
const mongoose = require('mongoose').set('debug', false)
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
const { ObjectID } = require('mongodb');
|
||||
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.level = "F";
|
||||
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => {
|
||||
schema.options.usePushEach = true
|
||||
});
|
||||
|
||||
const CashSchema = new Schema({
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
creatorUserId: {
|
||||
type: String,
|
||||
},
|
||||
idCashCategory: {
|
||||
type: String
|
||||
},
|
||||
idSubCashCategory: {
|
||||
type: String
|
||||
},
|
||||
type: { // CashType: TYPE_IN, TYPE_OUT
|
||||
type: Number
|
||||
},
|
||||
date_created: {
|
||||
type: Date
|
||||
},
|
||||
date_payment: {
|
||||
type: Date
|
||||
},
|
||||
descr: {
|
||||
type: String,
|
||||
},
|
||||
price: {
|
||||
type: Number
|
||||
},
|
||||
quantity: {
|
||||
type: Number
|
||||
},
|
||||
total: {
|
||||
type: Number
|
||||
},
|
||||
fromWalletUserId: { // walletCommonCash or any Member
|
||||
type: String,
|
||||
},
|
||||
toWalletUserId: { // walletCommonCash or any Member
|
||||
type: String,
|
||||
},
|
||||
walletStatus: { // WalletFinalStatusType: None: 0, InCommonCash: 1, InMyWallet : 2
|
||||
type: Number,
|
||||
},
|
||||
walletTemporaryToUserId: { // WalletCommonCash
|
||||
type: String,
|
||||
},
|
||||
walletCashId: {
|
||||
type: String,
|
||||
},
|
||||
internal: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
extra: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
notes: {
|
||||
type: String
|
||||
},
|
||||
confirmed: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
var Cash = module.exports = mongoose.model('Cash', CashSchema);
|
||||
|
||||
module.exports.getFieldsForSearch = function () {
|
||||
return []
|
||||
};
|
||||
|
||||
module.exports.executeQueryTable = function (idapp, params) {
|
||||
params.fieldsearch = this.getFieldsForSearch();
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
};
|
||||
|
||||
module.exports.findAllIdApp = async function (idapp) {
|
||||
const myfind = { idapp };
|
||||
|
||||
return await Cash.find(myfind);
|
||||
};
|
||||
|
||||
module.exports.getAllCash = function (query, sort, callback) {
|
||||
Cash.find(query, null, sort, callback)
|
||||
}
|
||||
|
||||
module.exports.getCashByUserId = function (userId, sort, callback) {
|
||||
Cash.find({ userId }, null, sort, callback)
|
||||
}
|
||||
|
||||
|
||||
module.exports.getCashByID = function (id, callback) {
|
||||
Cash.findById(id, callback);
|
||||
}
|
||||
|
||||
module.exports.createCash = async function (Cash) {
|
||||
const CashModel = new Cash(Cash);
|
||||
|
||||
return await CashModel.save(Cash)
|
||||
.then((ris) => {
|
||||
if (!!ris)
|
||||
return ris._id;
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// const Cash = mongoose.model('Cash', CashSchema);
|
||||
|
||||
// module.exports = { Cash };
|
||||
@@ -28,6 +28,10 @@ const CashCategorySchema = new Schema({
|
||||
|
||||
var CashCategory = module.exports = mongoose.model('CashCategory', CashCategorySchema);
|
||||
|
||||
CashCategory.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports.getFieldsForSearch = function () {
|
||||
return []
|
||||
};
|
||||
@@ -66,3 +70,4 @@ module.exports.createCashCategory = async function (CashCategory) {
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -69,3 +69,7 @@ module.exports.createCashSubCategory = async function (CashSubCategory) {
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
61
src/server/models/catai.js
Executable file
61
src/server/models/catai.js
Executable file
@@ -0,0 +1,61 @@
|
||||
|
||||
const mongoose = require('mongoose').set('debug', false)
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.level = "F";
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => {
|
||||
schema.options.usePushEach = true
|
||||
});
|
||||
|
||||
const CatAISchema = new Schema({
|
||||
_id: {
|
||||
type: Number,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
},
|
||||
img: {
|
||||
type: String,
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
CatAISchema.statics.getAllCategories = function (callback) {
|
||||
CatAI.find(callback)
|
||||
}
|
||||
|
||||
CatAISchema.statics.getCatAIById = function (id, callback) {
|
||||
CatAI.findById(id, callback);
|
||||
}
|
||||
|
||||
CatAISchema.statics.getFieldsForSearch = function () {
|
||||
return [{ field: 'name', type: tools.FieldType.string }]
|
||||
};
|
||||
|
||||
CatAISchema.statics.executeQueryTable = function (idapp, params) {
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
};
|
||||
|
||||
CatAISchema.statics.findAllIdApp = async function (idapp) {
|
||||
const myfind = {};
|
||||
|
||||
return await CatAI.find(myfind).sort({ name: 1 });
|
||||
};
|
||||
|
||||
const CatAI = mongoose.model('CatAI', CatAISchema);
|
||||
|
||||
CatAI.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = CatAI;
|
||||
@@ -1,9 +1,11 @@
|
||||
|
||||
const mongoose = require('mongoose').set('debug', false)
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.level = "F";
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => {
|
||||
@@ -11,20 +13,46 @@ mongoose.plugin(schema => {
|
||||
});
|
||||
|
||||
const CategorySchema = new Schema({
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
unique: true,
|
||||
index: true,
|
||||
lowercase: true
|
||||
}
|
||||
},
|
||||
img: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
module.exports.getAllCategories = function (callback) {
|
||||
CategorySchema.statics.getAllCategories = function (callback) {
|
||||
Category.find(callback)
|
||||
}
|
||||
|
||||
module.exports.getCategoryById = function (id, callback) {
|
||||
CategorySchema.statics.getCategoryById = function (id, callback) {
|
||||
Category.findById(id, callback);
|
||||
}
|
||||
|
||||
module.exports = mongoose.model('Category', CategorySchema);
|
||||
CategorySchema.statics.getFieldsForSearch = function () {
|
||||
return [{ field: 'name', type: tools.FieldType.string }]
|
||||
};
|
||||
|
||||
CategorySchema.statics.executeQueryTable = function (idapp, params) {
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
};
|
||||
|
||||
CategorySchema.statics.findAllIdApp = async function (idapp) {
|
||||
const myfind = { idapp };
|
||||
|
||||
return await Category.find(myfind);
|
||||
};
|
||||
|
||||
const Category = mongoose.model('Category', CategorySchema);
|
||||
|
||||
Category.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
|
||||
module.exports = { Category };
|
||||
|
||||
@@ -80,4 +80,8 @@ CatGrpSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
|
||||
const CatGrp = mongoose.model('CatGrp', CatGrpSchema);
|
||||
|
||||
CatGrp.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { CatGrp };
|
||||
|
||||
62
src/server/models/catprod.js
Executable file
62
src/server/models/catprod.js
Executable file
@@ -0,0 +1,62 @@
|
||||
|
||||
const mongoose = require('mongoose').set('debug', false)
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.level = "F";
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => {
|
||||
schema.options.usePushEach = true
|
||||
});
|
||||
|
||||
const CatProdSchema = new Schema({
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
},
|
||||
img: {
|
||||
type: String,
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
CatProdSchema.statics.getAllCategories = function (callback) {
|
||||
CatProd.find(callback)
|
||||
}
|
||||
|
||||
CatProdSchema.statics.getCatProdById = function (id, callback) {
|
||||
CatProd.findById(id, callback);
|
||||
}
|
||||
|
||||
CatProdSchema.statics.getFieldsForSearch = function () {
|
||||
return [{ field: 'name', type: tools.FieldType.string }]
|
||||
};
|
||||
|
||||
CatProdSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
};
|
||||
|
||||
CatProdSchema.statics.findAllIdApp = async function (idapp) {
|
||||
const myfind = { idapp };
|
||||
|
||||
return await CatProd.find(myfind).sort({ name: 1 });
|
||||
};
|
||||
|
||||
const CatProd = mongoose.model('CatProd', CatProdSchema);
|
||||
|
||||
CatProd.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
|
||||
module.exports = CatProd;
|
||||
@@ -43,5 +43,9 @@ CfgServerSchema.statics.findAllIdApp = async function(idapp) {
|
||||
|
||||
const CfgServer = mongoose.model('CfgServer', CfgServerSchema);
|
||||
|
||||
CfgServer.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = {CfgServer};
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,9 @@ mongoose.level = 'F';
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
const {ObjectID} = require('mongodb');
|
||||
const { ObjectID } = require('mongodb');
|
||||
|
||||
const fs = require('fs-extra');
|
||||
|
||||
const shared_consts = require('../tools/shared_nodejs');
|
||||
|
||||
@@ -49,11 +51,14 @@ const CitySchema = new Schema({
|
||||
type: String,
|
||||
maxlength: 3,
|
||||
},
|
||||
geojson: {
|
||||
type: Object, // Tipo che può contenere le features GeoJSON
|
||||
},
|
||||
});
|
||||
|
||||
CitySchema.pre('save', async function(next) {
|
||||
CitySchema.pre('save', async function (next) {
|
||||
if (this.isNew) {
|
||||
const myrec = await City.findOne().limit(1).sort({_id: -1});
|
||||
const myrec = await City.findOne().limit(1).sort({ _id: -1 });
|
||||
if (!!myrec) {
|
||||
if (myrec._doc._id === 0)
|
||||
this._id = 1;
|
||||
@@ -68,8 +73,8 @@ CitySchema.pre('save', async function(next) {
|
||||
next();
|
||||
});
|
||||
|
||||
CitySchema.statics.getProvinceByIdCity = async function(idcity) {
|
||||
const myrec = await City.findOne({_id: idcity}).lean();
|
||||
CitySchema.statics.getProvinceByIdCity = async function (idcity) {
|
||||
const myrec = await City.findOne({ _id: idcity }).lean();
|
||||
if (myrec) {
|
||||
return myrec.prov;
|
||||
}
|
||||
@@ -77,8 +82,19 @@ CitySchema.statics.getProvinceByIdCity = async function(idcity) {
|
||||
return '';
|
||||
}
|
||||
|
||||
CitySchema.statics.getRegionByIdCity = async function(idcity) {
|
||||
const myrec = await City.findOne({_id: idcity}).lean();
|
||||
CitySchema.statics.getCircuitNameBystrProv = async function (strProv) {
|
||||
const { Circuit } = require('../models/circuit');
|
||||
|
||||
const myrec = await Circuit.findOne({ strProv }).lean();
|
||||
if (myrec) {
|
||||
return myrec.name;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
CitySchema.statics.getRegionByIdCity = async function (idcity) {
|
||||
const myrec = await City.findOne({ _id: idcity }).lean();
|
||||
if (myrec) {
|
||||
return myrec.reg;
|
||||
}
|
||||
@@ -86,13 +102,13 @@ CitySchema.statics.getRegionByIdCity = async function(idcity) {
|
||||
return '';
|
||||
}
|
||||
|
||||
CitySchema.statics.findByCity = function(mycity) {
|
||||
CitySchema.statics.findByCity = function (mycity) {
|
||||
|
||||
let myregexp = new RegExp(mycity.trim().replace(' ', '|'), 'ig');
|
||||
|
||||
const query = [
|
||||
{$match: {comune: {$regex: myregexp}}},
|
||||
{$sort: {descr: 1}},
|
||||
{ $match: { comune: { $regex: myregexp } } },
|
||||
{ $sort: { descr: 1 } },
|
||||
];
|
||||
|
||||
return City.aggregate(query).then((arrrec) => {
|
||||
@@ -101,17 +117,17 @@ CitySchema.statics.findByCity = function(mycity) {
|
||||
|
||||
};
|
||||
|
||||
CitySchema.statics.getFieldsForSearch = function() {
|
||||
CitySchema.statics.getFieldsForSearch = function () {
|
||||
return [
|
||||
{field: 'comune', type: tools.FieldType.string},
|
||||
{field: 'prov', type: tools.FieldType.string},
|
||||
{field: 'reg', type: tools.FieldType.string},
|
||||
{field: 'pref', type: tools.FieldType.number},
|
||||
{field: 'cap', type: tools.FieldType.number},
|
||||
{ field: 'comune', type: tools.FieldType.string },
|
||||
{ field: 'prov', type: tools.FieldType.string },
|
||||
{ field: 'reg', type: tools.FieldType.string },
|
||||
{ field: 'pref', type: tools.FieldType.number },
|
||||
{ field: 'cap', type: tools.FieldType.number },
|
||||
];
|
||||
};
|
||||
|
||||
CitySchema.statics.executeQueryTable = function(idapp, params) {
|
||||
CitySchema.statics.executeQueryTable = function (idapp, params) {
|
||||
params.fieldsearch = this.getFieldsForSearch();
|
||||
|
||||
const strfind = params.search;
|
||||
@@ -123,7 +139,7 @@ CitySchema.statics.executeQueryTable = function(idapp, params) {
|
||||
return tools.executeQueryTable(this, 0, params);
|
||||
};
|
||||
|
||||
CitySchema.statics.executeQueryPickup = async function(idapp, params) {
|
||||
CitySchema.statics.executeQueryPickup = async function (idapp, params) {
|
||||
|
||||
const strfind = params.search;
|
||||
|
||||
@@ -133,19 +149,19 @@ CitySchema.statics.executeQueryPickup = async function(idapp, params) {
|
||||
|
||||
let filterfindexact = {};
|
||||
if (strfind) {
|
||||
filterfindexact = {comune: strfind};
|
||||
filterfindexact = { comune: strfind };
|
||||
}
|
||||
|
||||
let limit = 10;
|
||||
let risexact = [];
|
||||
|
||||
let filterfind = {comune: {$regex: '^' + strfind, $options: 'i'}};
|
||||
let filterfind = { comune: { $regex: '^' + strfind, $options: 'i' } };
|
||||
|
||||
let aggr1 = [
|
||||
{
|
||||
$match: {comune: strfind},
|
||||
$match: { comune: strfind },
|
||||
},
|
||||
{ $limit : 1 },
|
||||
{ $limit: 1 },
|
||||
{
|
||||
$project: {
|
||||
comune: { $concat: ["$comune", " (", "$prov", ")"] },
|
||||
@@ -154,7 +170,7 @@ CitySchema.statics.executeQueryPickup = async function(idapp, params) {
|
||||
];
|
||||
|
||||
if (params.filter) {
|
||||
filterfind = {...params.filter, ...filterfind};
|
||||
filterfind = { ...params.filter, ...filterfind };
|
||||
limit = 200;
|
||||
} else {
|
||||
// risexact = await City.find(filterfindexact, {comune: 1, prov: 1, reg: 1}).lean();
|
||||
@@ -165,7 +181,7 @@ CitySchema.statics.executeQueryPickup = async function(idapp, params) {
|
||||
{
|
||||
$match: filterfind,
|
||||
},
|
||||
{ $limit : limit },
|
||||
{ $limit: limit },
|
||||
{
|
||||
$project: {
|
||||
comune: { $concat: ["$comune", " (", "$prov", ")"] },
|
||||
@@ -181,13 +197,85 @@ CitySchema.statics.executeQueryPickup = async function(idapp, params) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
CitySchema.statics.findAllIdApp = async function(idapp) {
|
||||
CitySchema.statics.findAllIdApp = async function (idapp) {
|
||||
const myfind = {};
|
||||
|
||||
return await City.find(myfind);
|
||||
};
|
||||
|
||||
CitySchema.statics.getGeoJsonByProvince = async function (prov) {
|
||||
let ris = null;
|
||||
if (prov)
|
||||
ris = await City.find({ prov }).lean();
|
||||
else
|
||||
ris = await City.find({}).lean();
|
||||
|
||||
try {
|
||||
if (ris) {
|
||||
const arrjson = ris
|
||||
.filter(record => record.geojson && typeof record.geojson === 'object' && record.geojson.geometry) // Prima filtra per mantenere solo gli oggetti con "geometry"
|
||||
.map((record, index) => {
|
||||
// Crea un nuovo oggetto con gli attributi desiderati da ogni record
|
||||
const newRecord = {
|
||||
...record.geojson, // Spread dell'oggetto geojson per prendere tutte le sue proprietà
|
||||
id: (index + 1).toString(), // Aggiunge un valore "id" incrementale in base all'indice
|
||||
};
|
||||
|
||||
// Aggiungi o aggiorna la proprietà "prov" in "properties" dentro l'oggetto geojson
|
||||
if (newRecord.properties) {
|
||||
newRecord.properties.prov = record.prov; // Se "properties" esiste già
|
||||
} else {
|
||||
newRecord.properties = { prov: record.prov }; // Crea "properties" se non esiste
|
||||
}
|
||||
|
||||
return newRecord;
|
||||
});
|
||||
|
||||
return arrjson;
|
||||
}
|
||||
return [];
|
||||
} catch (e) {
|
||||
console.error('Err', e);
|
||||
}
|
||||
|
||||
return null
|
||||
};
|
||||
|
||||
|
||||
CitySchema.statics.insertGeojsonToMongoDB = async function (nomefilejson) {
|
||||
try {
|
||||
// Lettura del file GeoJSON
|
||||
const geojson = await fs.readJson(nomefilejson); // Sostituisci con il percorso del tuo file GeoJSON
|
||||
|
||||
let inseriti = 0;
|
||||
const numcomuni = geojson.features.length;
|
||||
for (const citta of geojson.features) {
|
||||
|
||||
// Identifica il documento esistente in cui vuoi aggiungere le features
|
||||
const reccity = await City.findOne({ istat: String(citta.properties.ISTAT).padStart(6, '0') });
|
||||
|
||||
if (reccity) {
|
||||
const ris = await City.updateOne({ _id: reccity._id }, { $set: { geojson: citta } });
|
||||
if (ris.ok === 1) {
|
||||
inseriti++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
console.log(`${inseriti} su ${numcomuni} comuni inseriti.`);
|
||||
} catch (e) {
|
||||
console.error('Err', e);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
const City = mongoose.model('City', CitySchema);
|
||||
|
||||
module.exports = {City};
|
||||
City.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { City };
|
||||
|
||||
@@ -25,10 +25,12 @@ const ContribtypeSchema = new Schema({
|
||||
});
|
||||
|
||||
ContribtypeSchema.statics.getFieldsForSearch = function () {
|
||||
|
||||
return [{field: 'label', type: tools.FieldType.string}]
|
||||
};
|
||||
|
||||
ContribtypeSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
|
||||
params.fieldsearch = this.getFieldsForSearch();
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
};
|
||||
@@ -47,9 +49,13 @@ ContribtypeSchema.statics.findAllIdApp = async function (idapp) {
|
||||
|
||||
return await Contribtype.find(myfind, (err, arrrec) => {
|
||||
return arrrec
|
||||
});
|
||||
}).lean();
|
||||
};
|
||||
|
||||
const Contribtype = mongoose.model('Contribtype', ContribtypeSchema);
|
||||
|
||||
Contribtype.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Contribtype };
|
||||
|
||||
@@ -26,6 +26,10 @@ const departmentSchema = new Schema({
|
||||
|
||||
var Department = module.exports = mongoose.model('Department', departmentSchema);
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports.getFieldsForSearch = function () {
|
||||
return [{ field: 'name', type: tools.FieldType.string },
|
||||
{ field: 'username', type: tools.FieldType.string }
|
||||
|
||||
@@ -106,4 +106,8 @@ DisciplineSchema.statics.DuplicateAllRecords = async function (idapporig, idappd
|
||||
|
||||
const Discipline = mongoose.model('Discipline', DisciplineSchema);
|
||||
|
||||
Discipline.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Discipline };
|
||||
|
||||
@@ -114,7 +114,7 @@ ExtraListSchema.statics.getTotInLista = async function (idapp) {
|
||||
|
||||
const myfind = { idapp };
|
||||
|
||||
return await ExtraList.count(myfind);
|
||||
return await ExtraList.countDocuments(myfind);
|
||||
};
|
||||
|
||||
ExtraListSchema.statics.getRegDellaLista = async function (idapp) {
|
||||
@@ -122,7 +122,7 @@ ExtraListSchema.statics.getRegDellaLista = async function (idapp) {
|
||||
|
||||
const myfind = { idapp, registered: true };
|
||||
|
||||
return await ExtraList.count(myfind);
|
||||
return await ExtraList.countDocuments(myfind);
|
||||
};
|
||||
|
||||
ExtraListSchema.statics.getLastUser = function (idapp) {
|
||||
@@ -332,6 +332,9 @@ ExtraListSchema.statics.ImportData = async function (locale, idapp, strdata) {
|
||||
|
||||
const ExtraList = mongoose.model('ExtraList', ExtraListSchema);
|
||||
|
||||
ExtraList.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { ExtraList };
|
||||
|
||||
|
||||
@@ -64,4 +64,8 @@ GallerySchema.statics.findAllIdApp = async function (idapp) {
|
||||
|
||||
const Gallery = mongoose.model('Gallery', GallerySchema);
|
||||
|
||||
Gallery.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Gallery };
|
||||
|
||||
83
src/server/models/gasordine.js
Executable file
83
src/server/models/gasordine.js
Executable file
@@ -0,0 +1,83 @@
|
||||
mongoose = require('mongoose').set('debug', false)
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.level = "F";
|
||||
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => {
|
||||
schema.options.usePushEach = true
|
||||
});
|
||||
|
||||
const gasordineSchema = new Schema({
|
||||
active: {
|
||||
type: Boolean,
|
||||
},
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
},
|
||||
referente: {
|
||||
type: String,
|
||||
},
|
||||
city: {
|
||||
type: String,
|
||||
},
|
||||
img: {
|
||||
type: String,
|
||||
},
|
||||
note_ordine_gas: {
|
||||
type: String,
|
||||
},
|
||||
|
||||
dataora_chiusura_ordini: {
|
||||
type: Date,
|
||||
},
|
||||
data_arrivo_merce: {
|
||||
type: Date,
|
||||
},
|
||||
dataora_ritiro: {
|
||||
type: Date,
|
||||
},
|
||||
dataora_termine_pagamento: {
|
||||
type: Date,
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
var Gasordine = module.exports = mongoose.model('Gasordine', gasordineSchema);
|
||||
|
||||
module.exports.getFieldsForSearch = function () {
|
||||
return [
|
||||
{field: 'name', type: tools.FieldType.string},
|
||||
{field: 'description', type: tools.FieldType.string},
|
||||
]
|
||||
};
|
||||
|
||||
module.exports.executeQueryTable = function (idapp, params) {
|
||||
params.fieldsearch = this.getFieldsForSearch();
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
};
|
||||
|
||||
module.exports.findAllIdApp = async function (idapp) {
|
||||
const myfind = { idapp };
|
||||
|
||||
return await Gasordine.find(myfind);
|
||||
};
|
||||
|
||||
|
||||
module.exports.getGasordineByID = function (id, callback) {
|
||||
Gasordine.findById(id, callback);
|
||||
}
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
@@ -80,4 +80,8 @@ GoodSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
|
||||
const Good = mongoose.model('Good', GoodSchema);
|
||||
|
||||
Good.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Good };
|
||||
|
||||
@@ -138,7 +138,7 @@ GraduatoriaSchema.statics.findByAllRecByUsername = function (idapp, username) {
|
||||
GraduatoriaSchema.statics.getNumDaImbarcare = async function (idapp) {
|
||||
const Graduatoria = this;
|
||||
|
||||
return await Graduatoria.count({ idapp })
|
||||
return await Graduatoria. countDocuments({ idapp })
|
||||
|
||||
};
|
||||
|
||||
@@ -415,4 +415,8 @@ GraduatoriaSchema.statics.getPosizioneInGraduatoria = async function (idapp, ind
|
||||
|
||||
const Graduatoria = mongoose.model('Graduatoria', GraduatoriaSchema);
|
||||
|
||||
Graduatoria.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Graduatoria };
|
||||
|
||||
@@ -47,3 +47,6 @@ module.exports.findAllIdApp = async function (idapp) {
|
||||
return await Group.find(myfind);
|
||||
};
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -228,3 +228,6 @@ module.exports.calculateHoursTodo = async function (idtodo) {
|
||||
|
||||
};
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
63
src/server/models/importamacro.js
Executable file
63
src/server/models/importamacro.js
Executable file
@@ -0,0 +1,63 @@
|
||||
mongoose = require('mongoose').set('debug', false)
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
const shared_consts = require('../tools/shared_nodejs');
|
||||
|
||||
const { ObjectID } = require('mongodb');
|
||||
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.level = "F";
|
||||
|
||||
// A1P
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => {
|
||||
schema.options.usePushEach = true
|
||||
});
|
||||
|
||||
const ImportaMacroSchema = new Schema({
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
_id: {
|
||||
type: String,
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
var ImportaMacro = module.exports = mongoose.model('ImportaMacro', ImportaMacroSchema);
|
||||
|
||||
ImportaMacroSchema.index({ idapp: 1 });
|
||||
|
||||
module.exports.getFieldsForSearch = function () {
|
||||
return [
|
||||
{ field: 'name', type: tools.FieldType.string },
|
||||
{ field: 'description', type: tools.FieldType.string },
|
||||
]
|
||||
};
|
||||
|
||||
module.exports.executeQueryTable = function (idapp, params) {
|
||||
params.fieldsearch = this.getFieldsForSearch();
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
};
|
||||
|
||||
module.exports.getImportaMacroByCode = function (idapp, code) {
|
||||
return ImportaMacro.findAllIdApp(idapp, code);
|
||||
}
|
||||
|
||||
module.exports.getImportaMacroById = async function (id) {
|
||||
const arrris = await ImportaMacro.findAllIdApp('', '', id);
|
||||
return arrris && arrris.length > 0 ? arrris[0] : null
|
||||
}
|
||||
|
||||
module.exports.findAllIdApp = async function (idapp) {
|
||||
const ImportaMacro = this;
|
||||
|
||||
const myfind = { idapp, deleted: false };
|
||||
|
||||
return await ImportaMacro.find(myfind, (err, arrrec) => {
|
||||
return arrrec;
|
||||
});
|
||||
};
|
||||
59
src/server/models/inventariogm.js
Executable file
59
src/server/models/inventariogm.js
Executable file
@@ -0,0 +1,59 @@
|
||||
mongoose = require('mongoose').set('debug', false)
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
const shared_consts = require('../tools/shared_nodejs');
|
||||
|
||||
const { ObjectID } = require('mongodb');
|
||||
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.level = "F";
|
||||
|
||||
// A1P
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => {
|
||||
schema.options.usePushEach = true
|
||||
});
|
||||
|
||||
const inventariogmSchema = new Schema({
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
var Inventariogm = module.exports = mongoose.model('Inventariogm', inventariogmSchema);
|
||||
|
||||
inventariogmSchema.index({ idapp: 1 });
|
||||
|
||||
module.exports.getFieldsForSearch = function () {
|
||||
return [
|
||||
{ field: 'name', type: tools.FieldType.string },
|
||||
{ field: 'description', type: tools.FieldType.string },
|
||||
]
|
||||
};
|
||||
|
||||
module.exports.executeQueryTable = function (idapp, params) {
|
||||
params.fieldsearch = this.getFieldsForSearch();
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
};
|
||||
|
||||
module.exports.getInventariogmByCode = function (idapp, code) {
|
||||
return Inventariogm.findAllIdApp(idapp, code);
|
||||
}
|
||||
|
||||
module.exports.getInventariogmById = async function (id) {
|
||||
const arrris = await Inventariogm.findAllIdApp('', '', id);
|
||||
return arrris && arrris.length > 0 ? arrris[0] : null
|
||||
}
|
||||
|
||||
module.exports.findAllIdApp = async function (idapp) {
|
||||
const Inventariogm = this;
|
||||
|
||||
const myfind = { idapp, deleted: false };
|
||||
|
||||
return await Inventariogm.find(myfind, (err, arrrec) => {
|
||||
return arrrec;
|
||||
});
|
||||
};
|
||||
@@ -196,3 +196,7 @@ module.exports.findAllIdApp = async function(idapp) {
|
||||
return arrrec;
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -196,3 +196,7 @@ module.exports.findAllIdApp = async function (idapp) {
|
||||
return arrrec
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -73,4 +73,8 @@ LevelSchema.statics.executeQueryTable = function(idapp, params) {
|
||||
|
||||
const Level = mongoose.model('Level', LevelSchema);
|
||||
|
||||
Level.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = {Level};
|
||||
|
||||
@@ -6,6 +6,7 @@ const tools = require('../tools/general');
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.level = "F";
|
||||
|
||||
const { User } = require('./user');
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => {
|
||||
@@ -13,112 +14,85 @@ mongoose.plugin(schema => {
|
||||
});
|
||||
|
||||
const MailingListSchema = new Schema({
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
email: {
|
||||
type: String,
|
||||
trim: true,
|
||||
},
|
||||
hash: {
|
||||
type: String,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
trim: true,
|
||||
},
|
||||
surname: {
|
||||
type: String,
|
||||
trim: true,
|
||||
},
|
||||
statesub: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
wrongerr: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
lastid_newstosent: {
|
||||
type: String
|
||||
}
|
||||
});
|
||||
|
||||
MailingListSchema.statics.getFieldsForSearch = function () {
|
||||
return [{ field: 'name', type: tools.FieldType.string },
|
||||
{ field: 'surname', type: tools.FieldType.string },
|
||||
{ field: 'email', type: tools.FieldType.string }]
|
||||
};
|
||||
|
||||
MailingListSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
params.fieldsearch = this.getFieldsForSearch();
|
||||
params.fieldsearch = User.getFieldsForSearch();
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
};
|
||||
|
||||
MailingListSchema.statics.findAllIdAppSubscribed = function (idapp) {
|
||||
const MailingList = this;
|
||||
|
||||
const myfind = { idapp, statesub: true, wrongerr: { $ne: true } };
|
||||
const myfind = {
|
||||
idapp,
|
||||
news_on: true,
|
||||
$or: [
|
||||
{ deleted: { $exists: false } },
|
||||
{ deleted: { $exists: true, $eq: false } }],
|
||||
$or: [
|
||||
{ email_errata: { $exists: false } },
|
||||
{ email_errata: { $exists: true, $ne: true } }],
|
||||
};
|
||||
|
||||
// Extract only the Teacher where in the users table the field permissions is set 'Teacher' bit.
|
||||
|
||||
return MailingList.find(myfind, (err, arrrec) => {
|
||||
return User.find(myfind, (err, arrrec) => {
|
||||
return arrrec
|
||||
});
|
||||
};
|
||||
|
||||
MailingListSchema.statics.getnumSent = async function (idapp, idmailinglist) {
|
||||
const MailingList = this;
|
||||
MailingListSchema.statics.getnumSent = async function (idapp, idUser) {
|
||||
|
||||
const myfind = { idapp, statesub: true, lastid_newstosent: idmailinglist };
|
||||
const myfind = { idapp, news_on: true, lastid_newstosent: idUser };
|
||||
|
||||
// Extract only the Teacher where in the users table the field permissions is set 'Teacher' bit.
|
||||
|
||||
return await MailingList.count(myfind);
|
||||
return await User.countDocuments(myfind);
|
||||
};
|
||||
|
||||
MailingListSchema.statics.isOk = async function (idapp, iduser, idmailinglist) {
|
||||
const MailingList = this;
|
||||
MailingListSchema.statics.isOk = async function (idapp, iduser, idUser) {
|
||||
|
||||
const myfind = { idapp, _id: iduser, statesub: true, lastid_newstosent: { $ne: idmailinglist } };
|
||||
|
||||
const myfind = { idapp, _id: iduser, news_on: true, lastid_newstosent: { $ne: idUser } };
|
||||
|
||||
// Extract only the Teacher where in the users table the field permissions is set 'Teacher' bit.
|
||||
|
||||
return await MailingList.count(myfind) > 0;
|
||||
return await User.countDocuments(myfind) > 0;
|
||||
};
|
||||
|
||||
MailingListSchema.statics.findAllIdApp = async function (idapp) {
|
||||
const MailingList = this;
|
||||
|
||||
|
||||
const myfind = { idapp };
|
||||
|
||||
return await MailingList.find(myfind, (err, arrrec) => {
|
||||
return await User.find(myfind, (err, arrrec) => {
|
||||
return arrrec
|
||||
});
|
||||
};
|
||||
|
||||
MailingListSchema.statics.isUnsubscribed = async function (idapp, hash) {
|
||||
const MailingList = this;
|
||||
|
||||
let myperson = await MailingList.findOne({ idapp, hash });
|
||||
console.log('myperson', myperson);
|
||||
let myperson = await User.findOne({ idapp, hash });
|
||||
if (!!myperson) {
|
||||
return (!myperson.statesub)
|
||||
return (!myperson.news_on)
|
||||
}
|
||||
};
|
||||
|
||||
MailingListSchema.statics.findByHash = function (idapp, hash) {
|
||||
const MailingList = this;
|
||||
|
||||
const myfind = { idapp, hash };
|
||||
|
||||
// Extract only the Teacher where in the users table the field permissions is set 'Teacher' bit.
|
||||
|
||||
return MailingList.findOne(myfind, (err, rec) => {
|
||||
return User.findOne(myfind, (err, rec) => {
|
||||
return rec
|
||||
});
|
||||
};
|
||||
|
||||
const MailingList = mongoose.model('MailingList', MailingListSchema);
|
||||
|
||||
User.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MailingList };
|
||||
|
||||
@@ -6,8 +6,8 @@ mongoose.level = 'F';
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
const {ObjectID} = require('mongodb');
|
||||
const {Account} = require('../models/account');
|
||||
const { ObjectID } = require('mongodb');
|
||||
const { Account } = require('../models/account');
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => {
|
||||
@@ -17,7 +17,7 @@ mongoose.plugin(schema => {
|
||||
const MovementSchema = new Schema({
|
||||
_id: {
|
||||
type: String,
|
||||
default: function() {
|
||||
default: function () {
|
||||
return new ObjectID().toString();
|
||||
},
|
||||
},
|
||||
@@ -36,6 +36,7 @@ const MovementSchema = new Schema({
|
||||
accountToId: {
|
||||
type: String,
|
||||
},
|
||||
idOrdersCart: { type: Schema.Types.ObjectId, ref: 'OrdersCart' },
|
||||
causal_table: {
|
||||
type: String,
|
||||
},
|
||||
@@ -47,26 +48,32 @@ const MovementSchema = new Schema({
|
||||
},
|
||||
causal: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
residual: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
expiringDate: {
|
||||
type: Date,
|
||||
},
|
||||
confirmed: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
MovementSchema.statics.findAllIdApp = async function(idapp) {
|
||||
MovementSchema.statics.findAllIdApp = async function (idapp) {
|
||||
const MyMovement = this;
|
||||
|
||||
const myfind = {idapp};
|
||||
const myfind = { idapp };
|
||||
|
||||
return await MyMovement.find(myfind, (err, arrrec) => {
|
||||
return arrrec;
|
||||
});
|
||||
};
|
||||
|
||||
MovementSchema.pre('save', async function(next) {
|
||||
MovementSchema.pre('save', async function (next) {
|
||||
if (this.isNew) {
|
||||
|
||||
this.transactionDate = new Date();
|
||||
@@ -75,45 +82,45 @@ MovementSchema.pre('save', async function(next) {
|
||||
next();
|
||||
});
|
||||
|
||||
MovementSchema.statics.getFieldsForSearch = function() {
|
||||
MovementSchema.statics.getFieldsForSearch = function () {
|
||||
return [
|
||||
{field: 'causal', type: tools.FieldType.string},
|
||||
{field: 'amount', type: tools.FieldType.number},
|
||||
{ field: 'causal', type: tools.FieldType.string },
|
||||
{ field: 'amount', type: tools.FieldType.number },
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
MovementSchema.statics.executeQueryTable = function(idapp, params) {
|
||||
MovementSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
params.fieldsearch = this.getFieldsForSearch();
|
||||
return tools.executeQueryTable(this, 0, params);
|
||||
};
|
||||
|
||||
MovementSchema.statics.addMov = async function(idapp, accountFromIdTable, accountToIdTable, amount, causal, notifId) {
|
||||
MovementSchema.statics.addMov = async function (idapp, accountFromIdTable, accountToIdTable, amount, causal, notifId, idOrdersCart) {
|
||||
|
||||
try {
|
||||
// Only positive values
|
||||
amount = Math.abs(amount);
|
||||
|
||||
let mymov = await Movement.create(
|
||||
{
|
||||
_id: new ObjectID().toString(),
|
||||
idapp,
|
||||
transactionDate: new Date(),
|
||||
accountFromId: accountFromIdTable._id,
|
||||
accountToId: accountToIdTable._id,
|
||||
amount,
|
||||
causal,
|
||||
residual: 0,
|
||||
notifId,
|
||||
// expiringDate:
|
||||
},
|
||||
{
|
||||
idapp,
|
||||
transactionDate: new Date(),
|
||||
accountFromId: accountFromIdTable._id,
|
||||
accountToId: accountToIdTable._id,
|
||||
idOrdersCart,
|
||||
amount,
|
||||
causal,
|
||||
residual: 0,
|
||||
notifId,
|
||||
// expiringDate:
|
||||
},
|
||||
);
|
||||
|
||||
if (mymov) {
|
||||
// Update saldo dell'Account
|
||||
await Account.addtoSaldo(accountToIdTable, amount);
|
||||
await Account.addtoSaldo(accountToIdTable, amount, true);
|
||||
|
||||
await Account.addtoSaldo(accountFromIdTable, -amount);
|
||||
await Account.addtoSaldo(accountFromIdTable, -amount, false);
|
||||
|
||||
return mymov;
|
||||
}
|
||||
@@ -122,13 +129,13 @@ MovementSchema.statics.addMov = async function(idapp, accountFromIdTable, accoun
|
||||
}
|
||||
};
|
||||
|
||||
MovementSchema.statics.getQueryMovsByCircuitId = async function(idapp, username, circuitId) {
|
||||
MovementSchema.statics.getQueryMovsByCircuitId = async function (idapp, username, groupname, contocom, circuitId) {
|
||||
|
||||
try {
|
||||
if (!circuitId) {
|
||||
return [];
|
||||
}
|
||||
const myaccount = await Account.getAccountByUsernameAndCircuitId(idapp, username, circuitId, false);
|
||||
const myaccount = await Account.getAccountByUsernameAndCircuitId(idapp, username, circuitId, false, true, groupname, contocom);
|
||||
|
||||
if (myaccount) {
|
||||
|
||||
@@ -137,8 +144,8 @@ MovementSchema.statics.getQueryMovsByCircuitId = async function(idapp, username,
|
||||
$match: {
|
||||
idapp,
|
||||
$or: [
|
||||
{accountFromId: myaccount._id},
|
||||
{accountToId: myaccount._id}],
|
||||
{ accountFromId: myaccount._id },
|
||||
{ accountToId: myaccount._id }],
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -149,30 +156,92 @@ MovementSchema.statics.getQueryMovsByCircuitId = async function(idapp, username,
|
||||
as: 'accfrom',
|
||||
},
|
||||
},
|
||||
{$unwind: '$accfrom'},
|
||||
{ $unwind: '$accfrom' },
|
||||
{
|
||||
$lookup: {
|
||||
from: 'users',
|
||||
let: {username: '$accfrom.username', idapp: '$accfrom.idapp'},
|
||||
let: { username: '$accfrom.username', idapp: '$accfrom.idapp' },
|
||||
pipeline: [
|
||||
{
|
||||
$match:
|
||||
{
|
||||
$expr:
|
||||
{
|
||||
$and:
|
||||
[
|
||||
{$eq: ['$$username', '$username']},
|
||||
{$eq: ['$$idapp', '$idapp']},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
$expr:
|
||||
{
|
||||
$and:
|
||||
[
|
||||
{ $eq: ['$$username', '$username'] },
|
||||
{ $eq: ['$$idapp', '$idapp'] },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
as: 'userfrom',
|
||||
},
|
||||
},
|
||||
{$unwind: '$userfrom'},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$userfrom',
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'mygroups',
|
||||
let: { groupname: '$accfrom.groupname', idapp: '$accfrom.idapp' },
|
||||
pipeline: [
|
||||
{
|
||||
$match:
|
||||
{
|
||||
$expr:
|
||||
{
|
||||
$and:
|
||||
[
|
||||
{ $eq: ['$$groupname', '$groupname'] },
|
||||
{ $eq: ['$$idapp', '$idapp'] },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
as: 'groupfrom',
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$groupfrom',
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
$lookup: {
|
||||
from: 'circuits',
|
||||
let: { contocom: '$accfrom.contocom', idapp: '$accfrom.idapp' },
|
||||
pipeline: [
|
||||
{
|
||||
$match:
|
||||
{
|
||||
$expr:
|
||||
{
|
||||
$and:
|
||||
[
|
||||
{ $eq: ['$$contocom', '$path'] },
|
||||
{ $eq: ['$$idapp', '$idapp'] },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
as: 'contocomfrom',
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$contocomfrom',
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'accounts',
|
||||
@@ -181,66 +250,141 @@ MovementSchema.statics.getQueryMovsByCircuitId = async function(idapp, username,
|
||||
as: 'accto',
|
||||
},
|
||||
},
|
||||
{$unwind: '$accto'},
|
||||
{ $unwind: '$accto' },
|
||||
{
|
||||
'$lookup': {
|
||||
'from': 'circuits',
|
||||
'localField': 'accfrom.circuitId',
|
||||
'foreignField': '_id',
|
||||
'as': 'circuitfrom',
|
||||
$lookup: {
|
||||
from: 'circuits',
|
||||
localField: 'accfrom.circuitId',
|
||||
foreignField: '_id',
|
||||
as: 'circuitfrom',
|
||||
},
|
||||
},
|
||||
{
|
||||
'$unwind': '$circuitfrom',
|
||||
$unwind: '$circuitfrom',
|
||||
},
|
||||
{
|
||||
'$lookup': {
|
||||
'from': 'circuits',
|
||||
'localField': 'accto.circuitId',
|
||||
'foreignField': '_id',
|
||||
'as': 'circuitto',
|
||||
$lookup: {
|
||||
from: 'circuits',
|
||||
localField: 'accto.circuitId',
|
||||
foreignField: '_id',
|
||||
as: 'circuitto',
|
||||
},
|
||||
},
|
||||
{
|
||||
'$unwind': '$circuitto',
|
||||
$unwind: '$circuitto',
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'users',
|
||||
let: {username: '$accto.username', idapp: '$accto.idapp'},
|
||||
let: { username: '$accto.username', idapp: '$accto.idapp' },
|
||||
pipeline: [
|
||||
{
|
||||
$match:
|
||||
{
|
||||
$expr:
|
||||
{
|
||||
$and:
|
||||
[
|
||||
{$eq: ['$$username', '$username']},
|
||||
{$eq: ['$$idapp', '$idapp']},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
$expr:
|
||||
{
|
||||
$and:
|
||||
[
|
||||
{ $eq: ['$$username', '$username'] },
|
||||
{ $eq: ['$$idapp', '$idapp'] },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
as: 'userto',
|
||||
},
|
||||
},
|
||||
{$unwind: '$userto'},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$userto',
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'mygroups',
|
||||
let: { groupname: '$accto.groupname', idapp: '$accto.idapp' },
|
||||
pipeline: [
|
||||
{
|
||||
$match:
|
||||
{
|
||||
$expr:
|
||||
{
|
||||
$and:
|
||||
[
|
||||
{ $eq: ['$$groupname', '$groupname'] },
|
||||
{ $eq: ['$$idapp', '$idapp'] },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
as: 'groupto',
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$groupto',
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'circuits',
|
||||
let: { contocom: '$accto.contocom', idapp: '$accto.idapp' },
|
||||
pipeline: [
|
||||
{
|
||||
$match:
|
||||
{
|
||||
$expr:
|
||||
{
|
||||
$and:
|
||||
[
|
||||
{ $eq: ['$$contocom', '$path'] },
|
||||
{ $eq: ['$$idapp', '$idapp'] },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
as: 'contocomto',
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$contocomto',
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$project:
|
||||
{
|
||||
transactionDate: 1,
|
||||
amount: 1,
|
||||
causal: 1,
|
||||
notifId: 1,
|
||||
'circuitfrom.symbol': 1,
|
||||
'circuitto.symbol': 1,
|
||||
'userfrom.username': 1,
|
||||
'userfrom.profile.img': 1,
|
||||
'userto.username': 1,
|
||||
'userto.profile.img': 1,
|
||||
},
|
||||
{
|
||||
transactionDate: 1,
|
||||
amount: 1,
|
||||
causal: 1,
|
||||
notifId: 1,
|
||||
'circuitfrom.symbol': 1,
|
||||
'circuitto.symbol': 1,
|
||||
'userfrom.verified_by_aportador': 1,
|
||||
'userfrom.username': 1,
|
||||
'userfrom.profile.img': 1,
|
||||
'userto.username': 1,
|
||||
'userto.profile.img': 1,
|
||||
'userto.verified_by_aportador': 1,
|
||||
'groupfrom.groupname': 1,
|
||||
'groupfrom.verified_by_aportador': 1,
|
||||
'groupfrom.title': 1,
|
||||
'groupfrom.photos': 1,
|
||||
'groupto.groupname': 1,
|
||||
'groupto.title': 1,
|
||||
'groupto.photos': 1,
|
||||
'groupto.verified_by_aportador': 1,
|
||||
'contocomfrom.path': 1,
|
||||
'contocomfrom.name': 1,
|
||||
'contocomto.path': 1,
|
||||
'contocomto.name': 1,
|
||||
},
|
||||
},
|
||||
|
||||
];
|
||||
@@ -255,7 +399,8 @@ MovementSchema.statics.getQueryMovsByCircuitId = async function(idapp, username,
|
||||
return [];
|
||||
};
|
||||
|
||||
MovementSchema.statics.getQueryAllUsersMovsByCircuitId = async function(idapp, circuitId) {
|
||||
|
||||
MovementSchema.statics.getQueryAllUsersMovsByCircuitId = async function (idapp, circuitId) {
|
||||
|
||||
try {
|
||||
if (!circuitId) {
|
||||
@@ -275,24 +420,24 @@ MovementSchema.statics.getQueryAllUsersMovsByCircuitId = async function(idapp, c
|
||||
as: 'accfrom',
|
||||
},
|
||||
},
|
||||
{$unwind: '$accfrom'},
|
||||
{ $unwind: '$accfrom' },
|
||||
{
|
||||
$lookup: {
|
||||
from: 'users',
|
||||
let: {username: '$accfrom.username', idapp: '$accfrom.idapp'},
|
||||
let: { username: '$accfrom.username', idapp: '$accfrom.idapp' },
|
||||
pipeline: [
|
||||
{
|
||||
$match:
|
||||
{
|
||||
$expr:
|
||||
{
|
||||
$and:
|
||||
[
|
||||
{$eq: ['$$username', '$username']},
|
||||
{$eq: ['$$idapp', '$idapp']},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
$expr:
|
||||
{
|
||||
$and:
|
||||
[
|
||||
{ $eq: ['$$username', '$username'] },
|
||||
{ $eq: ['$$idapp', '$idapp'] },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
as: 'userfrom',
|
||||
@@ -304,6 +449,62 @@ MovementSchema.statics.getQueryAllUsersMovsByCircuitId = async function(idapp, c
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'mygroups',
|
||||
let: { groupname: '$accfrom.groupname', idapp: '$accfrom.idapp' },
|
||||
pipeline: [
|
||||
{
|
||||
$match:
|
||||
{
|
||||
$expr:
|
||||
{
|
||||
$and:
|
||||
[
|
||||
{ $eq: ['$$groupname', '$groupname'] },
|
||||
{ $eq: ['$$idapp', '$idapp'] },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
as: 'groupfrom',
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$groupfrom',
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'circuits',
|
||||
let: { contocom: '$accfrom.contocom', idapp: '$accfrom.idapp' },
|
||||
pipeline: [
|
||||
{
|
||||
$match:
|
||||
{
|
||||
$expr:
|
||||
{
|
||||
$and:
|
||||
[
|
||||
{ $eq: ['$$contocom', '$path'] },
|
||||
{ $eq: ['$$idapp', '$idapp'] },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
as: 'contocomfrom',
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$contocomfrom',
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'accounts',
|
||||
@@ -319,7 +520,7 @@ MovementSchema.statics.getQueryAllUsersMovsByCircuitId = async function(idapp, c
|
||||
},
|
||||
},
|
||||
{
|
||||
$match: {'accto.circuitId': circuitId},
|
||||
$match: { 'accto.circuitId': circuitId },
|
||||
},
|
||||
{
|
||||
'$lookup': {
|
||||
@@ -352,20 +553,20 @@ MovementSchema.statics.getQueryAllUsersMovsByCircuitId = async function(idapp, c
|
||||
{
|
||||
$lookup: {
|
||||
from: 'users',
|
||||
let: {username: '$accto.username', idapp: '$accto.idapp'},
|
||||
let: { username: '$accto.username', idapp: '$accto.idapp' },
|
||||
pipeline: [
|
||||
{
|
||||
$match:
|
||||
{
|
||||
$expr:
|
||||
{
|
||||
$and:
|
||||
[
|
||||
{$eq: ['$$username', '$username']},
|
||||
{$eq: ['$$idapp', '$idapp']},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
$expr:
|
||||
{
|
||||
$and:
|
||||
[
|
||||
{ $eq: ['$$username', '$username'] },
|
||||
{ $eq: ['$$idapp', '$idapp'] },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
as: 'userto',
|
||||
@@ -378,19 +579,85 @@ MovementSchema.statics.getQueryAllUsersMovsByCircuitId = async function(idapp, c
|
||||
},
|
||||
},
|
||||
{
|
||||
$project:
|
||||
$lookup: {
|
||||
from: 'mygroups',
|
||||
let: { groupname: '$accto.groupname', idapp: '$accto.idapp' },
|
||||
pipeline: [
|
||||
{
|
||||
transactionDate: 1,
|
||||
amount: 1,
|
||||
causal: 1,
|
||||
notifId: 1,
|
||||
'circuitfrom.symbol': 1,
|
||||
'circuitto.symbol': 1,
|
||||
'userfrom.username': 1,
|
||||
'userfrom.profile.img': 1,
|
||||
'userto.username': 1,
|
||||
'userto.profile.img': 1,
|
||||
$match:
|
||||
{
|
||||
$expr:
|
||||
{
|
||||
$and:
|
||||
[
|
||||
{ $eq: ['$$groupname', '$groupname'] },
|
||||
{ $eq: ['$$idapp', '$idapp'] },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
as: 'groupto',
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$groupto',
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'circuits',
|
||||
let: { contocom: '$accto.contocom', idapp: '$accto.idapp' },
|
||||
pipeline: [
|
||||
{
|
||||
$match:
|
||||
{
|
||||
$expr:
|
||||
{
|
||||
$and:
|
||||
[
|
||||
{ $eq: ['$$contocom', '$path'] },
|
||||
{ $eq: ['$$idapp', '$idapp'] },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
as: 'contocomto',
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$contocomto',
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$project:
|
||||
{
|
||||
transactionDate: 1,
|
||||
amount: 1,
|
||||
causal: 1,
|
||||
notifId: 1,
|
||||
'circuitfrom.symbol': 1,
|
||||
'circuitto.symbol': 1,
|
||||
'userfrom.username': 1,
|
||||
'userfrom.profile.img': 1,
|
||||
'userto.username': 1,
|
||||
'userto.profile.img': 1,
|
||||
'groupfrom.groupname': 1,
|
||||
'groupfrom.title': 1,
|
||||
'groupto.groupname': 1,
|
||||
'groupto.title': 1,
|
||||
'contocomfrom.path': 1,
|
||||
'contocomfrom.name': 1,
|
||||
'contocomfrom.title': 1,
|
||||
'contocomto.path': 1,
|
||||
'contocomto.name': 1,
|
||||
'contocomto.title': 1,
|
||||
},
|
||||
},
|
||||
|
||||
];
|
||||
@@ -404,10 +671,10 @@ MovementSchema.statics.getQueryAllUsersMovsByCircuitId = async function(idapp, c
|
||||
return [];
|
||||
};
|
||||
|
||||
MovementSchema.statics.getMovsByCircuitId = async function(idapp, username, circuitId) {
|
||||
MovementSchema.statics.getMovsByCircuitId = async function (idapp, username, circuitId) {
|
||||
const MyMovement = this;
|
||||
|
||||
const myquery = await MyMovement.getQueryMovsByCircuitId(idapp, username, circuitId);
|
||||
const myquery = await MyMovement.getQueryMovsByCircuitId(idapp, username, '', '', circuitId);
|
||||
|
||||
if (myquery && myquery.length > 0) {
|
||||
ris = await MyMovement.aggregate(myquery);
|
||||
@@ -418,12 +685,11 @@ MovementSchema.statics.getMovsByCircuitId = async function(idapp, username, circ
|
||||
return [];
|
||||
};
|
||||
|
||||
MovementSchema.statics.checkIfCoinsAlreadySent = async function(notifId) {
|
||||
MovementSchema.statics.checkIfCoinsAlreadySent = async function (notifId) {
|
||||
const MyMovement = this;
|
||||
|
||||
try {
|
||||
const rec = await MyMovement.findOne({notifId}, {_id: 1});
|
||||
|
||||
const rec = await MyMovement.findOne({ notifId }, { _id: 1 });
|
||||
return !!rec;
|
||||
|
||||
} catch (e) {
|
||||
@@ -436,4 +702,8 @@ MovementSchema.statics.checkIfCoinsAlreadySent = async function(notifId) {
|
||||
|
||||
const Movement = mongoose.model('Movement', MovementSchema);
|
||||
|
||||
module.exports = {Movement};
|
||||
Movement.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Movement };
|
||||
|
||||
@@ -125,4 +125,8 @@ MsgTemplateSchema.statics.findAllIdApp = async function (idapp) {
|
||||
|
||||
const MsgTemplate = mongoose.model('MsgTemplate', MsgTemplateSchema);
|
||||
|
||||
MsgTemplate.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MsgTemplate };
|
||||
|
||||
@@ -7,6 +7,11 @@ mongoose.level = 'F';
|
||||
const tools = require('../tools/general');
|
||||
|
||||
const { ObjectID } = require('mongodb');
|
||||
const shared_consts = require('../tools/shared_nodejs');
|
||||
|
||||
const { Reaction } = require('./reaction');
|
||||
|
||||
const tableModel = shared_consts.TABLES_MYBACHECAS;
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => {
|
||||
@@ -14,92 +19,112 @@ mongoose.plugin(schema => {
|
||||
});
|
||||
|
||||
const MyBachecaSchema = new Schema({
|
||||
_id: {
|
||||
type: Number,
|
||||
},
|
||||
idapp: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
userId: { type: Schema.Types.ObjectId, ref: 'User' },
|
||||
idSector: {
|
||||
type: Number,
|
||||
},
|
||||
idSkill: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
idStatusSkill: [
|
||||
{
|
||||
type: Number,
|
||||
}],
|
||||
idContribType: [
|
||||
{
|
||||
...{
|
||||
_id: {
|
||||
type: String,
|
||||
}],
|
||||
idCity: [
|
||||
{
|
||||
default: function () {
|
||||
return new ObjectID().toString();
|
||||
},
|
||||
},
|
||||
idapp: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
userId: { type: Schema.Types.ObjectId, ref: 'User' },
|
||||
groupname: { type: String },
|
||||
idSector: {
|
||||
type: Number,
|
||||
}],
|
||||
dateTimeStart: {
|
||||
type: Date,
|
||||
},
|
||||
dateTimeEnd: {
|
||||
type: Date,
|
||||
},
|
||||
numLevel: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
adType: {
|
||||
type: Number,
|
||||
},
|
||||
photos: [
|
||||
{
|
||||
imagefile: {
|
||||
},
|
||||
idSkill: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
idStatusSkill: [
|
||||
{
|
||||
type: Number,
|
||||
}],
|
||||
idContribType: [
|
||||
{
|
||||
type: String,
|
||||
},
|
||||
alt: {
|
||||
type: String,
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
},
|
||||
}],
|
||||
note: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
descr: {
|
||||
type: String,
|
||||
},
|
||||
//**ADDFIELD_MYBACHECAS
|
||||
website: {
|
||||
type: String,
|
||||
},
|
||||
date_created: {
|
||||
type: Date,
|
||||
default: Date.now,
|
||||
},
|
||||
date_updated: {
|
||||
type: Date,
|
||||
}],
|
||||
idCity: [
|
||||
{
|
||||
type: Number,
|
||||
}],
|
||||
dateTimeStart: {
|
||||
type: Date,
|
||||
},
|
||||
dateTimeEnd: {
|
||||
type: Date,
|
||||
},
|
||||
organisedBy: {
|
||||
type: String
|
||||
},
|
||||
contact_phone: {
|
||||
type: String
|
||||
},
|
||||
contact_telegram: {
|
||||
type: String
|
||||
},
|
||||
address: {
|
||||
type: String,
|
||||
},
|
||||
min_partecip: {
|
||||
type: Number,
|
||||
},
|
||||
max_partecip: {
|
||||
type: Number,
|
||||
},
|
||||
link_maplocation: {
|
||||
type: String,
|
||||
},
|
||||
contribstr: {
|
||||
type: String,
|
||||
},
|
||||
numLevel: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
adType: {
|
||||
type: Number,
|
||||
},
|
||||
photos: [
|
||||
{
|
||||
imagefile: {
|
||||
type: String,
|
||||
},
|
||||
alt: {
|
||||
type: String,
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
},
|
||||
}],
|
||||
note: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
descr: {
|
||||
type: String,
|
||||
},
|
||||
//**ADDFIELD_MYBACHECAS
|
||||
website: {
|
||||
type: String,
|
||||
},
|
||||
date_created: {
|
||||
type: Date,
|
||||
},
|
||||
date_updated: {
|
||||
type: Date,
|
||||
},
|
||||
},
|
||||
...Reaction.getFieldsForReactions()
|
||||
});
|
||||
|
||||
MyBachecaSchema.pre('save', async function (next) {
|
||||
if (this.isNew) {
|
||||
const myrec = await MyBacheca.findOne().limit(1).sort({ _id: -1 });
|
||||
if (!!myrec) {
|
||||
if (myrec._doc._id === 0)
|
||||
this._id = 1;
|
||||
else
|
||||
this._id = myrec._doc._id + 1;
|
||||
|
||||
} else {
|
||||
this._id = 1;
|
||||
}
|
||||
|
||||
this.date_created = new Date();
|
||||
if (!this.date_created)
|
||||
this.date_created = new Date();
|
||||
}
|
||||
|
||||
next();
|
||||
@@ -144,37 +169,7 @@ MyBachecaSchema.statics.executeQueryTable = function (idapp, params, user) {
|
||||
lk_FF: '_id',
|
||||
lk_as: 'user',
|
||||
af_objId_tab: 'myId',
|
||||
lk_proj: {
|
||||
idSkill: 1,
|
||||
idSubSkill: 1,
|
||||
MyBacheca: 1,
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
dateTimeStart: 1,
|
||||
dateTimeEnd: 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
adType: 1,
|
||||
photos: 1,
|
||||
note: 1,
|
||||
//**ADDFIELD_MYBACHECAS
|
||||
website: 1,
|
||||
descr: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
userId: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
lasttimeonline: 1,
|
||||
'profile.img': 1,
|
||||
"profile.mygroups": 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
date_report: 1,
|
||||
username_who_report: 1,
|
||||
},
|
||||
lk_proj: shared_consts.getProjectForAll({}, tableModel),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -186,28 +181,24 @@ MyBachecaSchema.statics.executeQueryTable = function (idapp, params, user) {
|
||||
MyBachecaSchema.statics.getMyRecById = function (idapp, id) {
|
||||
const MyBacheca = this;
|
||||
|
||||
const query = [
|
||||
|
||||
let myparsid = {
|
||||
'_id': id,
|
||||
idapp,
|
||||
};
|
||||
|
||||
let query = [
|
||||
{
|
||||
'$match': {
|
||||
'$and': [
|
||||
{
|
||||
'_id': parseInt(id),
|
||||
},
|
||||
],
|
||||
$match:
|
||||
myparsid,
|
||||
},
|
||||
{
|
||||
$sort: {
|
||||
desc: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
'$match': {
|
||||
'idapp': idapp,
|
||||
},
|
||||
},
|
||||
{
|
||||
'$sort': {
|
||||
'desc': 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
'$addFields': {
|
||||
$addFields: {
|
||||
'myId1': {
|
||||
'$toObjectId': '$userId',
|
||||
},
|
||||
@@ -237,39 +228,7 @@ MyBachecaSchema.statics.getMyRecById = function (idapp, id) {
|
||||
},
|
||||
},
|
||||
{
|
||||
'$project': {
|
||||
'recSkill': 1,
|
||||
'sector': 1,
|
||||
'idSector': 1,
|
||||
'idSkill': 1,
|
||||
'idSubSkill': 1,
|
||||
'idStatusSkill': 1,
|
||||
'idContribType': 1,
|
||||
dateTimeStart: 1,
|
||||
dateTimeEnd: 1,
|
||||
'idCity': 1,
|
||||
pub_to_share: 1,
|
||||
'numLevel': 1,
|
||||
adType: 1,
|
||||
'photos': 1,
|
||||
'note': 1,
|
||||
website: 1,
|
||||
//**ADDFIELD_MYBACHECAS
|
||||
'descr': 1,
|
||||
'date_created': 1,
|
||||
'date_updated': 1,
|
||||
'userId': 1,
|
||||
'username': 1,
|
||||
'name': 1,
|
||||
'surname': 1,
|
||||
'comune': 1,
|
||||
'mycities': 1,
|
||||
'profile.img': 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.mycircuits": 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
},
|
||||
'$project': shared_consts.getProjectForAll({}, tableModel),
|
||||
},
|
||||
{
|
||||
'$lookup': {
|
||||
@@ -295,39 +254,7 @@ MyBachecaSchema.statics.getMyRecById = function (idapp, id) {
|
||||
},
|
||||
},
|
||||
{
|
||||
'$project': {
|
||||
'recSkill': 1,
|
||||
'sector': 1,
|
||||
'idSector': 1,
|
||||
'idSkill': 1,
|
||||
'idSubSkill': 1,
|
||||
'idStatusSkill': 1,
|
||||
'idContribType': 1,
|
||||
dateTimeStart: 1,
|
||||
dateTimeEnd: 1,
|
||||
'idCity': 1,
|
||||
pub_to_share: 1,
|
||||
'numLevel': 1,
|
||||
adType: 1,
|
||||
'photos': 1,
|
||||
'note': 1,
|
||||
website: 1,
|
||||
//**ADDFIELD_MYBACHECAS
|
||||
'descr': 1,
|
||||
'date_created': 1,
|
||||
'date_updated': 1,
|
||||
'userId': 1,
|
||||
'username': 1,
|
||||
'name': 1,
|
||||
'surname': 1,
|
||||
'comune': 1,
|
||||
'mycities': 1,
|
||||
'profile.img': 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.mycircuits": 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
},
|
||||
'$project': shared_consts.getProjectForAll({}, tableModel),
|
||||
},
|
||||
{
|
||||
'$lookup': {
|
||||
@@ -353,40 +280,22 @@ MyBachecaSchema.statics.getMyRecById = function (idapp, id) {
|
||||
},
|
||||
},
|
||||
{
|
||||
'$project': {
|
||||
'recSkill': 1,
|
||||
'sector': 1,
|
||||
'idSector': 1,
|
||||
'idSkill': 1,
|
||||
'idSubSkill': 1,
|
||||
'idStatusSkill': 1,
|
||||
'idContribType': 1,
|
||||
dateTimeStart: 1,
|
||||
dateTimeEnd: 1,
|
||||
'idCity': 1,
|
||||
pub_to_share: 1,
|
||||
'numLevel': 1,
|
||||
adType: 1,
|
||||
'photos': 1,
|
||||
'note': 1,
|
||||
website: 1,
|
||||
//**ADDFIELD_MYBACHECAS
|
||||
'descr': 1,
|
||||
'date_created': 1,
|
||||
'date_updated': 1,
|
||||
'userId': 1,
|
||||
'username': 1,
|
||||
'name': 1,
|
||||
'surname': 1,
|
||||
'comune': 1,
|
||||
'mycities': 1,
|
||||
'profile.img': 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.mycircuits": 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
$lookup: {
|
||||
'from': 'mygroups',
|
||||
'localField': 'groupname',
|
||||
'foreignField': 'groupname',
|
||||
'as': 'mygrp',
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$mygrp',
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
'$project': shared_consts.getProjectForAll({}, tableModel),
|
||||
},
|
||||
/*{
|
||||
'$lookup': {
|
||||
'from': 'subskills',
|
||||
@@ -411,39 +320,7 @@ MyBachecaSchema.statics.getMyRecById = function (idapp, id) {
|
||||
},
|
||||
},
|
||||
{
|
||||
'$project': {
|
||||
'recSkill': 1,
|
||||
'sector': 1,
|
||||
'idSector': 1,
|
||||
'idSkill': 1,
|
||||
// 'idSubSkill': 1,
|
||||
'idStatusSkill': 1,
|
||||
'idContribType': 1,
|
||||
dateTimeStart: 1,
|
||||
dateTimeEnd: 1,
|
||||
'idCity': 1,
|
||||
pub_to_share: 1,
|
||||
'numLevel': 1,
|
||||
adType: 1,
|
||||
'photos': 1,
|
||||
'note': 1,
|
||||
website: 1,
|
||||
//**ADDFIELD_MYBACHECAS
|
||||
'descr': 1,
|
||||
'date_created': 1,
|
||||
'date_updated': 1,
|
||||
'userId': 1,
|
||||
'username': 1,
|
||||
'name': 1,
|
||||
'surname': 1,
|
||||
'comune': 1,
|
||||
'mycities': 1,
|
||||
'profile.img': 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.mycircuits": 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
},
|
||||
'$project': shared_consts.getProjectForAll({}, tableModel),
|
||||
},
|
||||
{
|
||||
'$lookup': {
|
||||
@@ -468,48 +345,29 @@ MyBachecaSchema.statics.getMyRecById = function (idapp, id) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
'$project': {
|
||||
'recSkill': 1,
|
||||
'sector': 1,
|
||||
'idSector': 1,
|
||||
'idSkill': 1,
|
||||
// 'idSubSkill': 1,
|
||||
'idStatusSkill': 1,
|
||||
'idContribType': 1,
|
||||
dateTimeStart: 1,
|
||||
dateTimeEnd: 1,
|
||||
'idCity': 1,
|
||||
pub_to_share: 1,
|
||||
'numLevel': 1,
|
||||
adType: 1,
|
||||
'photos': 1,
|
||||
'note': 1,
|
||||
website: 1,
|
||||
//**ADDFIELD_MYBACHECAS
|
||||
'descr': 1,
|
||||
'date_created': 1,
|
||||
'date_updated': 1,
|
||||
'userId': 1,
|
||||
'username': 1,
|
||||
'name': 1,
|
||||
'surname': 1,
|
||||
'comune': 1,
|
||||
'mycities': 1,
|
||||
'profile.img': 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.mycircuits": 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
try {
|
||||
let numtab = tools.getNumTabByTable(shared_consts.TABLES_MYBACHECAS);
|
||||
|
||||
let objadd = tools.addNumFavoriteAndBookmarkToQuery(idapp, numtab);
|
||||
query = [...query, ...objadd.query];
|
||||
|
||||
const toadd = {
|
||||
$project: shared_consts.getProjectForAll(objadd.proj, tableModel),
|
||||
};
|
||||
|
||||
query = [...query, { ...toadd }];
|
||||
} catch (e) {
|
||||
console.error('e', e);
|
||||
}
|
||||
|
||||
return MyBacheca.aggregate(query).then((rec) => {
|
||||
return rec ? rec[0] : null;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
MyBachecaSchema.statics.getCompleteRecord = function (idapp, id) {
|
||||
const MyBacheca = this;
|
||||
|
||||
@@ -520,4 +378,8 @@ MyBachecaSchema.statics.getCompleteRecord = function (idapp, id) {
|
||||
|
||||
const MyBacheca = mongoose.model('MyBacheca', MyBachecaSchema);
|
||||
|
||||
MyBacheca.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MyBacheca };
|
||||
|
||||
@@ -143,6 +143,7 @@ const MyElemSchema = new Schema({
|
||||
anim: animation,
|
||||
active: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
class: {
|
||||
type: String,
|
||||
@@ -209,4 +210,8 @@ MyElemSchema.statics.findAllIdApp = async function (idapp) {
|
||||
|
||||
const MyElem = mongoose.model('MyElem', MyElemSchema);
|
||||
|
||||
MyElem.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MyElem };
|
||||
|
||||
@@ -276,4 +276,8 @@ if (tools.INITDB_FIRSTIME) {
|
||||
|
||||
const MyEvent = mongoose.model('MyEvent', MyEventSchema);
|
||||
|
||||
MyEvent.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = {MyEvent};
|
||||
|
||||
@@ -6,7 +6,11 @@ mongoose.level = 'F';
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
const {ObjectID} = require('mongodb');
|
||||
const { Reaction } = require('./reaction');
|
||||
|
||||
const shared_consts = require('../tools/shared_nodejs');
|
||||
|
||||
const { ObjectID } = require('mongodb');
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => {
|
||||
@@ -14,104 +18,96 @@ mongoose.plugin(schema => {
|
||||
});
|
||||
|
||||
const MyGoodSchema = new Schema({
|
||||
_id: {
|
||||
type: Number,
|
||||
},
|
||||
idapp: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
userId: {type: Schema.Types.ObjectId, ref: 'User'},
|
||||
idSectorGood: {
|
||||
type: Number,
|
||||
},
|
||||
idGood: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
idShipping: [
|
||||
{
|
||||
type: Number,
|
||||
}],
|
||||
|
||||
idContribType: [
|
||||
{
|
||||
...{
|
||||
_id: {
|
||||
type: String,
|
||||
}],
|
||||
idCity: [
|
||||
{
|
||||
},
|
||||
idapp: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
userId: { type: Schema.Types.ObjectId, ref: 'User' },
|
||||
idSectorGood: {
|
||||
type: Number,
|
||||
},
|
||||
idGood: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
idShipping: [
|
||||
{
|
||||
type: Number,
|
||||
}],
|
||||
|
||||
idContribType: [
|
||||
{
|
||||
type: String,
|
||||
}],
|
||||
idCity: [
|
||||
{
|
||||
type: Number,
|
||||
}],
|
||||
pub_to_share: {
|
||||
type: Number, // PUB_TO_SHARE_ALL, PUB_TO_SHARE_ONLY_TABLE_FOLLOW
|
||||
},
|
||||
numLevel: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
adType: {
|
||||
type: Number,
|
||||
},
|
||||
otherfilters: [{
|
||||
type: Number,
|
||||
}],
|
||||
pub_to_share: {
|
||||
type: Number, // PUB_TO_SHARE_ALL, PUB_TO_SHARE_ONLY_TABLE_FOLLOW
|
||||
},
|
||||
numLevel: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
adType: {
|
||||
type: Number,
|
||||
},
|
||||
otherfilters: [{
|
||||
type: Number,
|
||||
}],
|
||||
photos: [
|
||||
{
|
||||
imagefile: {
|
||||
type: String,
|
||||
},
|
||||
alt: {
|
||||
type: String,
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
},
|
||||
}],
|
||||
note: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
descr: {
|
||||
type: String,
|
||||
},
|
||||
//**ADDFIELD_MyGood
|
||||
website: {
|
||||
type: String,
|
||||
},
|
||||
date_created: {
|
||||
type: Date,
|
||||
default: Date.now,
|
||||
},
|
||||
date_updated: {
|
||||
type: Date,
|
||||
},
|
||||
photos: [
|
||||
{
|
||||
imagefile: {
|
||||
type: String,
|
||||
},
|
||||
alt: {
|
||||
type: String,
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
},
|
||||
}],
|
||||
note: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
descr: {
|
||||
type: String,
|
||||
},
|
||||
//**ADDFIELD_MyGood
|
||||
website: {
|
||||
type: String,
|
||||
},
|
||||
date_created: {
|
||||
type: Date,
|
||||
},
|
||||
date_updated: {
|
||||
type: Date,
|
||||
},
|
||||
},
|
||||
...Reaction.getFieldsForReactions()
|
||||
});
|
||||
|
||||
MyGoodSchema.pre('save', async function(next) {
|
||||
MyGoodSchema.pre('save', async function (next) {
|
||||
if (this.isNew) {
|
||||
const myrec = await MyGood.findOne().limit(1).sort({_id: -1});
|
||||
if (!!myrec) {
|
||||
if (myrec._doc._id === 0)
|
||||
this._id = 1;
|
||||
else
|
||||
this._id = myrec._doc._id + 1;
|
||||
|
||||
} else {
|
||||
this._id = 1;
|
||||
}
|
||||
|
||||
this.date_created = new Date();
|
||||
if (!this.date_created)
|
||||
this.date_created = new Date();
|
||||
}
|
||||
|
||||
next();
|
||||
});
|
||||
|
||||
MyGoodSchema.statics.findAllIdApp = async function(idapp) {
|
||||
MyGoodSchema.statics.findAllIdApp = async function (idapp) {
|
||||
const MyGood = this;
|
||||
|
||||
const query = [
|
||||
{$match: {idapp}},
|
||||
{$sort: {descr: 1}},
|
||||
{ $match: { idapp } },
|
||||
{ $sort: { descr: 1 } },
|
||||
];
|
||||
|
||||
return await MyGood.aggregate(query).then((arrrec) => {
|
||||
@@ -120,21 +116,21 @@ MyGoodSchema.statics.findAllIdApp = async function(idapp) {
|
||||
|
||||
};
|
||||
|
||||
MyGoodSchema.statics.getFieldsForSearch = function() {
|
||||
MyGoodSchema.statics.getFieldsForSearch = function () {
|
||||
return [];
|
||||
};
|
||||
|
||||
MyGoodSchema.statics.getFieldsLastForSearch = function() {
|
||||
MyGoodSchema.statics.getFieldsLastForSearch = function () {
|
||||
return [
|
||||
{field: 'note', type: tools.FieldType.string},
|
||||
{field: 'descr', type: tools.FieldType.string},
|
||||
{field: 'recGood.descr', type: tools.FieldType.string},
|
||||
{field: 'MyGood.descr', type: tools.FieldType.string},
|
||||
{ field: 'note', type: tools.FieldType.string },
|
||||
{ field: 'descr', type: tools.FieldType.string },
|
||||
{ field: 'recGood.descr', type: tools.FieldType.string },
|
||||
{ field: 'MyGood.descr', type: tools.FieldType.string },
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
MyGoodSchema.statics.executeQueryTable = function(idapp, params, user) {
|
||||
MyGoodSchema.statics.executeQueryTable = function (idapp, params, user) {
|
||||
params.fieldsearch = this.getFieldsForSearch();
|
||||
params.fieldsearch_last = this.getFieldsLastForSearch();
|
||||
|
||||
@@ -145,60 +141,27 @@ MyGoodSchema.statics.executeQueryTable = function(idapp, params, user) {
|
||||
lk_FF: '_id',
|
||||
lk_as: 'user',
|
||||
af_objId_tab: 'myId',
|
||||
lk_proj: {
|
||||
idGood: 1,
|
||||
idShipping: 1,
|
||||
MyGood: 1,
|
||||
idStatusGood: 1,
|
||||
idContribType: 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
adType: 1,
|
||||
otherfilters: 1,
|
||||
photos: 1,
|
||||
note: 1,
|
||||
website: 1,
|
||||
//**ADDFIELD_MyGood
|
||||
descr: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
userId: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
lasttimeonline: 1,
|
||||
'profile.img': 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.mycircuits": 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
},
|
||||
lk_proj: this.getProject(),
|
||||
},
|
||||
};
|
||||
|
||||
params = {...params, ...otherparams};
|
||||
params = { ...params, ...otherparams };
|
||||
|
||||
return tools.executeQueryTable(this, idapp, params, user);
|
||||
};
|
||||
|
||||
MyGoodSchema.statics.getMyRecById = function(idapp, idGood) {
|
||||
MyGoodSchema.statics.getMyRecById = function (idapp, idGood) {
|
||||
const MyGood = this;
|
||||
|
||||
const query = [
|
||||
let myparsid = {
|
||||
'_id': idGood,
|
||||
idapp,
|
||||
};
|
||||
|
||||
let query = [
|
||||
{
|
||||
'$match': {
|
||||
'$and': [
|
||||
{
|
||||
'_id': parseInt(idGood),
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
'$match': {
|
||||
'idapp': idapp,
|
||||
},
|
||||
'$match':
|
||||
myparsid,
|
||||
},
|
||||
{
|
||||
'$sort': {
|
||||
@@ -236,38 +199,7 @@ MyGoodSchema.statics.getMyRecById = function(idapp, idGood) {
|
||||
},
|
||||
},
|
||||
{
|
||||
'$project': {
|
||||
'recGood': 1,
|
||||
'sectorGood': 1,
|
||||
'idSectorGood': 1,
|
||||
'idGood': 1,
|
||||
'idShipping': 1,
|
||||
'idStatusGood': 1,
|
||||
'idContribType': 1,
|
||||
'idCity': 1,
|
||||
pub_to_share: 1,
|
||||
'numLevel': 1,
|
||||
adType: 1,
|
||||
otherfilters: 1,
|
||||
'photos': 1,
|
||||
note: 1,
|
||||
website: 1,
|
||||
//**ADDFIELD_MyGood
|
||||
'descr': 1,
|
||||
'date_created': 1,
|
||||
'date_updated': 1,
|
||||
'userId': 1,
|
||||
'username': 1,
|
||||
'name': 1,
|
||||
'surname': 1,
|
||||
'comune': 1,
|
||||
'mycities': 1,
|
||||
'profile.img': 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.mycircuits": 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
},
|
||||
$project: this.getProject(),
|
||||
},
|
||||
{
|
||||
'$lookup': {
|
||||
@@ -293,38 +225,7 @@ MyGoodSchema.statics.getMyRecById = function(idapp, idGood) {
|
||||
},
|
||||
},
|
||||
{
|
||||
'$project': {
|
||||
'recGood': 1,
|
||||
'sectorGood': 1,
|
||||
'idSectorGood': 1,
|
||||
'idGood': 1,
|
||||
'idShipping': 1,
|
||||
'idStatusGood': 1,
|
||||
'idContribType': 1,
|
||||
'idCity': 1,
|
||||
pub_to_share: 1,
|
||||
'numLevel': 1,
|
||||
adType: 1,
|
||||
otherfilters: 1,
|
||||
'photos': 1,
|
||||
'note': 1,
|
||||
website: 1,
|
||||
//**ADDFIELD_MyGood
|
||||
'descr': 1,
|
||||
'date_created': 1,
|
||||
'date_updated': 1,
|
||||
'userId': 1,
|
||||
'username': 1,
|
||||
'name': 1,
|
||||
'surname': 1,
|
||||
'comune': 1,
|
||||
'mycities': 1,
|
||||
'profile.img': 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.mycircuits": 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
},
|
||||
$project: this.getProject(),
|
||||
},
|
||||
{
|
||||
'$lookup': {
|
||||
@@ -351,38 +252,7 @@ MyGoodSchema.statics.getMyRecById = function(idapp, idGood) {
|
||||
},
|
||||
},
|
||||
{
|
||||
'$project': {
|
||||
'recGood': 1,
|
||||
'sectorGood': 1,
|
||||
'idSectorGood': 1,
|
||||
'idGood': 1,
|
||||
'idShipping': 1,
|
||||
'idStatusGood': 1,
|
||||
'idContribType': 1,
|
||||
'idCity': 1,
|
||||
pub_to_share: 1,
|
||||
'numLevel': 1,
|
||||
adType: 1,
|
||||
otherfilters: 1,
|
||||
'photos': 1,
|
||||
'note': 1,
|
||||
website: 1,
|
||||
//**ADDFIELD_MyGood
|
||||
'descr': 1,
|
||||
'date_created': 1,
|
||||
'date_updated': 1,
|
||||
'userId': 1,
|
||||
'username': 1,
|
||||
'name': 1,
|
||||
'surname': 1,
|
||||
'comune': 1,
|
||||
'mycities': 1,
|
||||
'profile.img': 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.mycircuits": 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
},
|
||||
$project: this.getProject(),
|
||||
},
|
||||
{
|
||||
'$lookup': {
|
||||
@@ -408,38 +278,7 @@ MyGoodSchema.statics.getMyRecById = function(idapp, idGood) {
|
||||
},
|
||||
},
|
||||
{
|
||||
'$project': {
|
||||
'recGood': 1,
|
||||
'sectorGood': 1,
|
||||
'idSectorGood': 1,
|
||||
'idGood': 1,
|
||||
'idShipping': 1,
|
||||
'idStatusGood': 1,
|
||||
'idContribType': 1,
|
||||
'idCity': 1,
|
||||
pub_to_share: 1,
|
||||
'numLevel': 1,
|
||||
adType: 1,
|
||||
otherfilters: 1,
|
||||
'photos': 1,
|
||||
'note': 1,
|
||||
website: 1,
|
||||
//**ADDFIELD_MyGood
|
||||
'descr': 1,
|
||||
'date_created': 1,
|
||||
'date_updated': 1,
|
||||
'userId': 1,
|
||||
'username': 1,
|
||||
'name': 1,
|
||||
'surname': 1,
|
||||
'comune': 1,
|
||||
'mycities': 1,
|
||||
'profile.img': 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.mycircuits": 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
},
|
||||
$project: this.getProject(),
|
||||
},
|
||||
{
|
||||
'$lookup': {
|
||||
@@ -464,55 +303,53 @@ MyGoodSchema.statics.getMyRecById = function(idapp, idGood) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
'$project': {
|
||||
'recGood': 1,
|
||||
'sectorGood': 1,
|
||||
'idSectorGood': 1,
|
||||
'idGood': 1,
|
||||
'idShipping': 1,
|
||||
'idStatusGood': 1,
|
||||
'idContribType': 1,
|
||||
'idCity': 1,
|
||||
pub_to_share: 1,
|
||||
'numLevel': 1,
|
||||
adType: 1,
|
||||
otherfilters: 1,
|
||||
'photos': 1,
|
||||
'note': 1,
|
||||
website: 1,
|
||||
//**ADDFIELD_MyGood
|
||||
'descr': 1,
|
||||
'date_created': 1,
|
||||
'date_updated': 1,
|
||||
'userId': 1,
|
||||
'username': 1,
|
||||
'name': 1,
|
||||
'surname': 1,
|
||||
'comune': 1,
|
||||
'mycities': 1,
|
||||
'profile.img': 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.mycircuits": 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
let numtab = tools.getNumTabByTable(shared_consts.TABLES_MYGOODS);
|
||||
|
||||
const objadd = tools.addNumFavoriteAndBookmarkToQuery(idapp, numtab);
|
||||
query = [...query, ...objadd.query];
|
||||
|
||||
const toadd = {
|
||||
$project: this.getProject(objadd.proj),
|
||||
};
|
||||
|
||||
query = [...query, { ...toadd }];
|
||||
|
||||
return MyGood.aggregate(query).then((rec) => {
|
||||
return rec ? rec[0] : null;
|
||||
});
|
||||
};
|
||||
|
||||
MyGoodSchema.statics.getCompleteRecord = function(idapp, id) {
|
||||
MyGoodSchema.statics.getCompleteRecord = function (idapp, id) {
|
||||
const MyGood = this;
|
||||
|
||||
return MyGood.getMyRecById(idapp, id);
|
||||
|
||||
};
|
||||
|
||||
MyGoodSchema.statics.getProject = function () {
|
||||
let proj = {
|
||||
'recGood': 1,
|
||||
'sectorGood': 1,
|
||||
'idSectorGood': 1,
|
||||
'idGood': 1,
|
||||
'idShipping': 1,
|
||||
'idStatusGood': 1,
|
||||
//**ADDFIELD_MYGOOD
|
||||
|
||||
};
|
||||
|
||||
const proj_add = shared_consts.getProjectForAll()
|
||||
|
||||
return Object.assign({}, proj, proj_add);
|
||||
|
||||
}
|
||||
|
||||
const MyGood = mongoose.model('MyGood', MyGoodSchema);
|
||||
|
||||
module.exports = {MyGood};
|
||||
MyGood.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MyGood };
|
||||
|
||||
@@ -15,7 +15,10 @@ mongoose.plugin(schema => {
|
||||
|
||||
const MyGroupSchema = new Schema({
|
||||
_id: {
|
||||
type: Number,
|
||||
type: String,
|
||||
default: function () {
|
||||
return new ObjectID().toString();
|
||||
},
|
||||
},
|
||||
idapp: {
|
||||
type: String,
|
||||
@@ -75,8 +78,9 @@ const MyGroupSchema = new Schema({
|
||||
},
|
||||
admins: [
|
||||
{
|
||||
username: {type: String},
|
||||
date: {type: Date},
|
||||
username: { type: String },
|
||||
perm: { type: Number },
|
||||
date: { type: Date },
|
||||
},
|
||||
],
|
||||
blocked: {
|
||||
@@ -97,34 +101,38 @@ const MyGroupSchema = new Schema({
|
||||
req_users: [
|
||||
{
|
||||
_id: false,
|
||||
username: {type: String},
|
||||
date: {type: Date},
|
||||
username: { type: String },
|
||||
date: { type: Date },
|
||||
}], // username
|
||||
refused_users: [
|
||||
{
|
||||
_id: false,
|
||||
username: {type: String},
|
||||
date: {type: Date},
|
||||
username: { type: String },
|
||||
date: { type: Date },
|
||||
}], // username
|
||||
deleted: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
circuits_list: [
|
||||
mycircuits: [
|
||||
{
|
||||
Num: { type: Number },
|
||||
inscription_date: {type: Date},
|
||||
_id: false,
|
||||
circuitname: { type: String },
|
||||
date: { type: Date },
|
||||
}],
|
||||
lastdate_reqRisGroup: {
|
||||
type: Date,
|
||||
},
|
||||
});
|
||||
|
||||
MyGroupSchema.statics.getFieldsForSearch = function() {
|
||||
return [{field: 'descr', type: tools.FieldType.string}];
|
||||
MyGroupSchema.statics.getFieldsForSearch = function () {
|
||||
return [{ field: 'descr', type: tools.FieldType.string }];
|
||||
};
|
||||
|
||||
MyGroupSchema.statics.executeQueryTable = function(idapp, params, user) {
|
||||
MyGroupSchema.statics.executeQueryTable = function (idapp, params, user) {
|
||||
params.fieldsearch = this.getFieldsForSearch();
|
||||
|
||||
const {User} = require('./user');
|
||||
const { User } = require('./user');
|
||||
|
||||
if (params.options) {
|
||||
if (tools.isBitActive(params.options, shared_consts.OPTIONS_SEARCH_USER_ONLY_FULL_WORDS)) {
|
||||
@@ -137,90 +145,94 @@ MyGroupSchema.statics.executeQueryTable = function(idapp, params, user) {
|
||||
return tools.executeQueryTable(this, idapp, params, user);
|
||||
};
|
||||
|
||||
MyGroupSchema.pre('save', async function(next) {
|
||||
MyGroupSchema.pre('save', async function (next) {
|
||||
if (this.isNew) {
|
||||
const myrec = await MyGroup.findOne().limit(1).sort({_id: -1});
|
||||
if (!!myrec) {
|
||||
if (myrec._doc._id === 0)
|
||||
this._id = 1;
|
||||
else
|
||||
this._id = myrec._doc._id + 1;
|
||||
|
||||
} else {
|
||||
this._id = 1;
|
||||
}
|
||||
|
||||
this.date_created = new Date();
|
||||
if (!this.date_created)
|
||||
this.date_created = new Date();
|
||||
}
|
||||
|
||||
next();
|
||||
});
|
||||
|
||||
MyGroupSchema.statics.findAllIdApp = async function(idapp) {
|
||||
const myfind = {idapp};
|
||||
MyGroupSchema.statics.findAllIdApp = async function (idapp) {
|
||||
const myfind = { idapp };
|
||||
|
||||
return await MyGroup.find(myfind);
|
||||
};
|
||||
|
||||
MyGroupSchema.statics.findAllGroups = async function(idapp) {
|
||||
MyGroupSchema.statics.findAllGroups = async function (idapp) {
|
||||
|
||||
const whatToShow = this.getWhatToShow(idapp, '');
|
||||
|
||||
return await MyGroup.find({
|
||||
idapp,
|
||||
$or: [
|
||||
{deleted: {$exists: false}},
|
||||
{deleted: {$exists: true, $eq: false}}],
|
||||
{ deleted: { $exists: false } },
|
||||
{ deleted: { $exists: true, $eq: false } }],
|
||||
}, whatToShow);
|
||||
};
|
||||
|
||||
// Rimuovo la Richiesta del Gruppo
|
||||
MyGroupSchema.statics.removeReqGroup = async function(idapp, username, groupnameDest) {
|
||||
MyGroupSchema.statics.removeReqGroup = async function (idapp, username, groupnameDest) {
|
||||
|
||||
return await MyGroup.updateOne({idapp, groupname: groupnameDest},
|
||||
{$pull: {req_users: {username: {$in: [username]}}}});
|
||||
return await MyGroup.updateOne({ idapp, groupname: groupnameDest },
|
||||
{ $pull: { req_users: { username: { $in: [username] } } } });
|
||||
};
|
||||
|
||||
// Aggiungi agli utenti Rifiutati del Gruppo
|
||||
MyGroupSchema.statics.refuseReqGroup = async function(idapp, username, groupnameDest) {
|
||||
MyGroupSchema.statics.refuseReqGroup = async function (idapp, username, groupnameDest) {
|
||||
|
||||
return await MyGroup.updateOne({idapp, groupname: groupnameDest},
|
||||
return await MyGroup.updateOne({ idapp, groupname: groupnameDest },
|
||||
{
|
||||
$push:
|
||||
{
|
||||
$push:
|
||||
{
|
||||
refused_users: {
|
||||
username,
|
||||
date: new Date(),
|
||||
},
|
||||
},
|
||||
});
|
||||
refused_users: {
|
||||
username,
|
||||
date: new Date(),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// Aggiungi agli Admin del Gruppo
|
||||
MyGroupSchema.statics.addToAdminOfMyGroup = async function(idapp, username, groupnameDest) {
|
||||
MyGroupSchema.statics.addToAdminOfMyGroup = async function (idapp, username, groupnameDest) {
|
||||
|
||||
return await MyGroup.updateOne({idapp, groupname: groupnameDest},
|
||||
return await MyGroup.updateOne({ idapp, groupname: groupnameDest },
|
||||
{
|
||||
$push:
|
||||
{
|
||||
$push:
|
||||
{
|
||||
admins: {
|
||||
username,
|
||||
date: new Date(),
|
||||
},
|
||||
},
|
||||
});
|
||||
admins: {
|
||||
username,
|
||||
date: new Date(),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// Rimuovi dagli Admin del Gruppo
|
||||
MyGroupSchema.statics.removeAdminOfMyGroup = async function(idapp, username, groupnameDest) {
|
||||
MyGroupSchema.statics.removeAdminOfMyGroup = async function (idapp, username, groupnameDest) {
|
||||
|
||||
return await MyGroup.updateOne({idapp, groupname: groupnameDest},
|
||||
{$pull: {admins: {username: {$in: [username]}}}});
|
||||
return await MyGroup.updateOne({ idapp, groupname: groupnameDest },
|
||||
{ $pull: { admins: { username: { $in: [username] } } } });
|
||||
};
|
||||
|
||||
MyGroupSchema.statics.getWhatToShow = function(idapp, username) {
|
||||
MyGroupSchema.statics.getListAdminsByGroupName = async function (idapp, groupname) {
|
||||
|
||||
let arr = await MyGroup.findOne({
|
||||
idapp,
|
||||
groupname,
|
||||
$or: [
|
||||
{ deleted: { $exists: false } },
|
||||
{ deleted: { $exists: true, $eq: false } }],
|
||||
}, { admins: 1 }).lean();
|
||||
|
||||
return arr && arr.admins ? arr.admins : [];
|
||||
|
||||
};
|
||||
|
||||
MyGroupSchema.statics.getWhatToShow = function (idapp, username) {
|
||||
// FOR ME, PERMIT ALL
|
||||
return {
|
||||
groupname: 1,
|
||||
@@ -242,12 +254,13 @@ MyGroupSchema.statics.getWhatToShow = function(idapp, username) {
|
||||
createdBy: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
circuits_list: 1,
|
||||
mycircuits: 1,
|
||||
lastdate_reqRisGroup: 1,
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
MyGroupSchema.statics.getWhatToShow_Unknown = function(idapp, username) {
|
||||
MyGroupSchema.statics.getWhatToShow_Unknown = function (idapp, username) {
|
||||
return {
|
||||
groupname: 1,
|
||||
title: 1,
|
||||
@@ -259,14 +272,15 @@ MyGroupSchema.statics.getWhatToShow_Unknown = function(idapp, username) {
|
||||
note: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
circuits_list: 1,
|
||||
mycircuits: 1,
|
||||
lastdate_reqRisGroup: 1,
|
||||
};
|
||||
};
|
||||
|
||||
MyGroupSchema.statics.getArrUsernameFromFieldByGroupname = async function(
|
||||
idapp, groupname, field) {
|
||||
MyGroupSchema.statics.getArrUsernameFromFieldByGroupname = async function (
|
||||
idapp, groupname, field) {
|
||||
|
||||
const {User} = require('../models/user');
|
||||
const { User } = require('../models/user');
|
||||
|
||||
const myobj = {};
|
||||
myobj[field + '.' + subfield] = 1;
|
||||
@@ -274,7 +288,7 @@ MyGroupSchema.statics.getArrUsernameFromFieldByGroupname = async function(
|
||||
let arrrec = await User.findOne({
|
||||
idapp,
|
||||
groupname,
|
||||
$or: [{deleted: {$exists: false}}, {deleted: {$exists: true, $eq: false}}],
|
||||
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||
}, myobj).then((ris) => ris ? ris._doc[field] : []);
|
||||
|
||||
if (arrrec.length > 0) {
|
||||
@@ -284,7 +298,7 @@ MyGroupSchema.statics.getArrUsernameFromFieldByGroupname = async function(
|
||||
|
||||
};
|
||||
|
||||
MyGroupSchema.statics.getInfoGroupByGroupname = async function(idapp, groupname) {
|
||||
MyGroupSchema.statics.getInfoGroupByGroupname = async function (idapp, groupname) {
|
||||
|
||||
const whatToShow = this.getWhatToShow(idapp, groupname);
|
||||
|
||||
@@ -294,13 +308,12 @@ MyGroupSchema.statics.getInfoGroupByGroupname = async function(idapp, groupname)
|
||||
};
|
||||
|
||||
const query = [
|
||||
{$match: myfind},
|
||||
{ $unwind: '$circuits_list' },
|
||||
{ $match: myfind },
|
||||
{
|
||||
$lookup: {
|
||||
from: 'circuits',
|
||||
localField: 'circuits_list.Num',
|
||||
foreignField: 'Num',
|
||||
localField: 'mycircuits.circuitname',
|
||||
foreignField: 'name',
|
||||
as: 'mycircuits',
|
||||
},
|
||||
},
|
||||
@@ -319,10 +332,11 @@ MyGroupSchema.statics.getInfoGroupByGroupname = async function(idapp, groupname)
|
||||
},
|
||||
},
|
||||
},
|
||||
{$project: whatToShow},
|
||||
{ $project: whatToShow },
|
||||
|
||||
];
|
||||
|
||||
|
||||
try {
|
||||
const ris = await MyGroup.aggregate(query);
|
||||
|
||||
@@ -332,19 +346,19 @@ MyGroupSchema.statics.getInfoGroupByGroupname = async function(idapp, groupname)
|
||||
return null;
|
||||
}
|
||||
|
||||
return ris;
|
||||
return null;
|
||||
|
||||
};
|
||||
|
||||
MyGroupSchema.statics.deleteGroup = async function(idapp, usernameOrig, groupname) {
|
||||
MyGroupSchema.statics.deleteGroup = async function (idapp, usernameOrig, groupname) {
|
||||
console.log('Gruppo ' + groupname + ' rimosso da ' + usernameOrig);
|
||||
return await MyGroup.findOneAndRemove({idapp, groupname});
|
||||
return await MyGroup.findOneAndRemove({ idapp, groupname });
|
||||
};
|
||||
|
||||
MyGroupSchema.statics.getGroupsByUsername = async function(idapp, username, req) {
|
||||
MyGroupSchema.statics.getGroupsByUsername = async function (idapp, username, req) {
|
||||
|
||||
try {
|
||||
const {User} = require('../models/user');
|
||||
const { User } = require('../models/user');
|
||||
|
||||
const whatToShow = this.getWhatToShow(idapp, username);
|
||||
const whatToShow_Unknown = this.getWhatToShow_Unknown(idapp, username);
|
||||
@@ -353,17 +367,17 @@ MyGroupSchema.statics.getGroupsByUsername = async function(idapp, username, req)
|
||||
|
||||
let listUsersGroup = await User.find({
|
||||
idapp,
|
||||
username: {$in: arrUsernameGroups},
|
||||
username: { $in: arrUsernameGroups },
|
||||
$or: [
|
||||
{deleted: {$exists: false}},
|
||||
{deleted: {$exists: true, $eq: false}}],
|
||||
{ deleted: { $exists: false } },
|
||||
{ deleted: { $exists: true, $eq: false } }],
|
||||
}, whatToShow);
|
||||
|
||||
let listgroups = await MyGroup.find({
|
||||
idapp,
|
||||
$or: [
|
||||
{deleted: {$exists: false}},
|
||||
{deleted: {$exists: true, $eq: false}}],
|
||||
{ deleted: { $exists: false } },
|
||||
{ deleted: { $exists: true, $eq: false } }],
|
||||
}, whatToShow_Unknown);
|
||||
|
||||
/*let listRequestUsersGroup = await User.find({
|
||||
@@ -379,21 +393,21 @@ MyGroupSchema.statics.getGroupsByUsername = async function(idapp, username, req)
|
||||
let listSentRequestGroups = await MyGroup.find({
|
||||
idapp,
|
||||
'req_users': {
|
||||
$elemMatch: {username: {$eq: username}},
|
||||
$elemMatch: { username: { $eq: username } },
|
||||
},
|
||||
$or: [
|
||||
{deleted: {$exists: false}},
|
||||
{deleted: {$exists: true, $eq: false}}],
|
||||
{ deleted: { $exists: false } },
|
||||
{ deleted: { $exists: true, $eq: false } }],
|
||||
}, whatToShow_Unknown);
|
||||
|
||||
let listRefusedGroups = await MyGroup.find({
|
||||
idapp,
|
||||
'refused_users': {
|
||||
$elemMatch: {username: {$eq: username}},
|
||||
$elemMatch: { username: { $eq: username } },
|
||||
},
|
||||
$or: [
|
||||
{deleted: {$exists: false}},
|
||||
{deleted: {$exists: true, $eq: false}}],
|
||||
{ deleted: { $exists: false } },
|
||||
{ deleted: { $exists: true, $eq: false } }],
|
||||
}, whatToShow_Unknown);
|
||||
|
||||
return {
|
||||
@@ -418,12 +432,12 @@ MyGroupSchema.statics.getGroupsByUsername = async function(idapp, username, req)
|
||||
};
|
||||
};
|
||||
|
||||
MyGroupSchema.statics.extractCitiesName = async function(idapp, id) {
|
||||
MyGroupSchema.statics.extractCitiesName = async function (idapp, id) {
|
||||
|
||||
try {
|
||||
let aggr1 = [
|
||||
{
|
||||
$match: {idapp, _id: id},
|
||||
$match: { idapp, _id: id },
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
@@ -459,13 +473,185 @@ MyGroupSchema.statics.extractCitiesName = async function(idapp, id) {
|
||||
ris = await this.aggregate(aggr1);
|
||||
|
||||
return ris;
|
||||
}catch (e) {
|
||||
} catch (e) {
|
||||
console.error('e', e);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
MyGroupSchema.statics.ifCircuitAlreadyInGroup = async function (idapp, groupname, circuitname) {
|
||||
|
||||
// Controllo se è stato già inserito il circuito sul gruppo
|
||||
return await this.findOne({
|
||||
idapp,
|
||||
groupname,
|
||||
'mycircuits': {
|
||||
$elemMatch: { circuitname: { $eq: circuitname } },
|
||||
},
|
||||
}).lean();
|
||||
};
|
||||
|
||||
// aggiungo il Circuito all'interno del Gruppo
|
||||
MyGroupSchema.statics.addCircuitFromGroup = async function (idapp, groupname, circuitname) {
|
||||
return await this.updateOne({ idapp, groupname },
|
||||
{
|
||||
$push: {
|
||||
'mycircuits': {
|
||||
circuitname,
|
||||
date: new Date(),
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// Rimuovo il Circuito all'interno del Gruppo
|
||||
MyGroupSchema.statics.removeCircuitFromGroup = async function (idapp, groupname, circuitname) {
|
||||
|
||||
|
||||
const ris = await this.updateOne({ idapp, groupname },
|
||||
{ $pull: { 'mycircuits': { circuitname: { $in: [circuitname] } } } });
|
||||
|
||||
const circuitId = await Circuit.getCircuitIdByName(idapp, circuitname);
|
||||
let remove = false;
|
||||
|
||||
// Se il mio account non è stato utilizzato, allora lo cancello anche questo
|
||||
const myaccount = await Account.getAccountByUsernameAndCircuitId(idapp, username, circuitId, false, false, groupname, '');
|
||||
if (myaccount && myaccount.totTransato === 0) {
|
||||
remove = true;
|
||||
} else {
|
||||
remove = true;
|
||||
}
|
||||
|
||||
if (remove) {
|
||||
await Account.removeAccount(myaccount._id);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
MyGroupSchema.statics.getQueryReceiveRISGroups = function (idapp, hours) {
|
||||
|
||||
const query = [
|
||||
{
|
||||
$match: {
|
||||
idapp,
|
||||
'lastdate_reqRisGroup': { $gte: tools.IncDateNow(-(1000 * 60 * 60 * hours)) },
|
||||
$or: [
|
||||
{ deleted: { $exists: false } },
|
||||
{ deleted: { $exists: true, $eq: false } }],
|
||||
},
|
||||
},
|
||||
{
|
||||
$group:
|
||||
{
|
||||
_id: "$groupname",
|
||||
count: {
|
||||
$sum: 1,
|
||||
},
|
||||
}
|
||||
},
|
||||
{ $sort: { 'lastdate_reqRisGroup': -1 } },
|
||||
{ $limit: 30 },
|
||||
{
|
||||
$lookup: {
|
||||
from: "mygroups",
|
||||
let: {
|
||||
groupname: "$_id",
|
||||
idapp,
|
||||
},
|
||||
pipeline: [
|
||||
{
|
||||
$match: {
|
||||
$expr: {
|
||||
$and: [
|
||||
{
|
||||
$eq: [
|
||||
"$$groupname",
|
||||
"$groupname",
|
||||
],
|
||||
},
|
||||
{
|
||||
$eq: [
|
||||
"$$idapp",
|
||||
"$idapp",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
as: "mygroup",
|
||||
},
|
||||
},
|
||||
{ $unwind: "$mygroup" },
|
||||
{
|
||||
$replaceRoot: {
|
||||
newRoot: {
|
||||
$mergeObjects: ["$mygroup", "$$ROOT"],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
_id: 0,
|
||||
groupname: 1,
|
||||
title: 1,
|
||||
descr: 1,
|
||||
visibility: 1,
|
||||
idCatGrp: 1,
|
||||
userId: 1,
|
||||
photos: 1,
|
||||
idCity: 1,
|
||||
website: 1,
|
||||
link_telegram: 1,
|
||||
note: 1,
|
||||
admins: 1,
|
||||
blocked: 1,
|
||||
req_users: 1,
|
||||
createdBy: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
lastdate_reqRisGroup: 1,
|
||||
},
|
||||
},
|
||||
];
|
||||
return query;
|
||||
};
|
||||
|
||||
|
||||
MyGroupSchema.statics.getReceiveRISGroups = async function (idapp) {
|
||||
|
||||
return await this.aggregate(this.getQueryReceiveRISGroups(idapp, 8)).then(ris => {
|
||||
return ris;
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
MyGroupSchema.statics.renameCircuitName = async function (idapp, oldcircuitname, newcircuitname) {
|
||||
|
||||
return await this.updateMany({ idapp, 'mycircuits.circuitname': oldcircuitname }, { $set: { 'profile.mycircuits.$.circuitname': newcircuitname } });
|
||||
};
|
||||
|
||||
|
||||
MyGroupSchema.statics.setReceiveRisGroup = async function (idapp, groupname) {
|
||||
|
||||
return await this.findOneAndUpdate({
|
||||
idapp, groupname,
|
||||
},
|
||||
{ $set: { 'lastdate_reqRisGroup': new Date() } }, { new: false }).lean().then((record) => {
|
||||
return !!record;
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
const MyGroup = mongoose.model('MyGroup', MyGroupSchema);
|
||||
|
||||
module.exports = {MyGroup};
|
||||
MyGroup.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MyGroup };
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user