add mirgation after checking emails
This commit is contained in:
@@ -27,9 +27,9 @@ def migre_accepted_appointment(day: str):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# migre_accepted_item_from_firebase_to_mongo("2022-07-06")
|
# migre_accepted_item_from_firebase_to_mongo("2022-08-22")
|
||||||
days = ['2022-07-04', '2022-07-05', '2022-07-06', '2022-07-07', '2022-07-08', '2022-07-09', '2022-07-11',
|
# days = ['2022-07-04', '2022-07-05', '2022-07-06', '2022-07-07', '2022-07-08', '2022-07-09', '2022-07-11',
|
||||||
'2022-07-12', '2022-07-13', '2022-07-15', '2022-07-16', '2022-07-18''2022-07-19', '2022-07-20',
|
# '2022-07-12', '2022-07-13', '2022-07-15', '2022-07-16', '2022-07-18''2022-07-19', '2022-07-20',
|
||||||
'2022-07-21']
|
# '2022-07-21']
|
||||||
for day in days:
|
# for day in days:
|
||||||
migre_accepted_appointment(day)
|
migre_accepted_appointment("2022-08-22")
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ from email.message import Message
|
|||||||
from builtins import list
|
from builtins import list
|
||||||
|
|
||||||
from src import params
|
from src import params
|
||||||
|
from src.db.mirgration.migration_tools import migre_accepted_appointment
|
||||||
from src.db.mongo_manager import MONGO_STORE_MANAGER
|
from src.db.mongo_manager import MONGO_STORE_MANAGER
|
||||||
from src.notification.AcceptedResultPojo import get_accepted_result_from, AcceptedResultPojo
|
from src.notification.AcceptedResultPojo import get_accepted_result_from, AcceptedResultPojo
|
||||||
from src.notification.mailer import Mailer
|
from src.notification.mailer import Mailer
|
||||||
@@ -137,6 +138,9 @@ def accept_appointment_found(accepted_result_list: list):
|
|||||||
mailer.send_email(get_accepted_result_from(reserve), to_all=True)
|
mailer.send_email(get_accepted_result_from(reserve), to_all=True)
|
||||||
MONGO_STORE_MANAGER.update_reserve_result(reserve.id, ResultEnum.ACCEPTED)
|
MONGO_STORE_MANAGER.update_reserve_result(reserve.id, ResultEnum.ACCEPTED)
|
||||||
|
|
||||||
|
if len(accepted_result_list) > 0:
|
||||||
|
migre_accepted_appointment(str(datetime.date.today()))
|
||||||
|
|
||||||
|
|
||||||
def read_mails_and_find_confirmation_contacts():
|
def read_mails_and_find_confirmation_contacts():
|
||||||
mail_list = MONGO_STORE_MANAGER.get_destination_emails()
|
mail_list = MONGO_STORE_MANAGER.get_destination_emails()
|
||||||
|
|||||||
Reference in New Issue
Block a user