from authenticate.models import WrongPasswordAttempt, UserJWT, VerificationAttempt
from collaborators.models import InviteAccess
from institute.models import TransferOwnershipHistory

# For non-zappa environments modify CRONJOBS object in settings_base.py file

# Cron expressions have the following format.
# cron(Minutes Hours Day-of-month Month Day-of-week Year)


# cron(0 2 * * ? *) : 02:00 AM (UTC) every day
def verification_attempt_cleanup_scheduler():
    VerificationAttempt.cleanup_expired_verification_attempts()


# cron(0 2 * * ? *) : 02:00 AM (UTC) every day
def wrong_password_attempt_cleanup_scheduler():
    WrongPasswordAttempt.cleanup_expired_wrong_password_attempt()


# cron(0 2 1 1/3 ? *) : 02:00 AM (UTC) every 3 month from jan in first day of month every year
def jwtoken_cleanup_scheduler():
    UserJWT.cleanup_expired_userjwts()


# cron(0 2 1 1/3 ? *) : 02:00 AM (UTC) every 3 month from jan in first day of month every year
def invite_access_cleanup_scheduler():
    InviteAccess.cleanup_past_invite_access()


# cron(0 2 1 1/3 ? *) : 02:00 AM (UTC) every 3 month from jan in first day of month every year
def transfer_ownership_cleanup_scheduler():
    TransferOwnershipHistory.cleanup_expired_transfer_ownership()
