Files
zod-backend/base/constants.py
2023-07-13 12:28:35 +05:30

126 lines
2.4 KiB
Python

"""
This module contains constants used throughout the project
"""
import os
# GOOGLE_URL used for interact with google server to verify user existence.
#GOOGLE_URL = "https://www.googleapis.com/plus/v1/"
NUMBER = {
'point_zero': 0.0,
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9,
'ten': 10,
'eleven': 11,
'twelve': 12,
'thirteen': 13,
'fourteen': 14,
'fifteen': 15,
'sixteen': 16,
'seventeen': 17,
'eighteen': 18,
'nineteen': 19,
'twenty_four': 24,
'twenty_one': 21,
'twenty_two': 22,
'twenty_five': 25,
'thirty': 30,
'thirty_five': 35,
'thirty_six': 36,
'forty': 40,
'fifty': 50,
'fifty_nine': 59,
'sixty': 60,
'seventy_five': 75,
'eighty': 80,
'ninty_five': 95,
'ninty_six': 96,
'ninety_nine': 99,
'hundred': 100,
'one_one_nine': 119,
'one_twenty': 120,
'four_zero_four': 404,
'five_hundred': 500,
'minus_one': -1,
'point_three': 0.3,
'point_seven': 0.7
}
# Super Admin string constant for 'role'
SUPER_ADMIN = "Super Admin"
# Define jwt_token_expiration time in minutes for now token will expire after 3 days
JWT_TOKEN_EXPIRATION = 3 * 24 * 60
# Define common file extention
FILE_EXTENSION = ("gif", "jpeg", "jpg", "png", "svg")
# Define file size in bytes(5MB = 5 * 1024 * 1024)
FILE_SIZE = 5 * 1024 * 1024
# String constant for configurable date for allocation lock period
ALLOCATION_LOCK_DATE = 1
sort_dict = {
'1': 'name',
'2': '-name'
}
"""user type"""
USER_TYPE = (
('1', 'junior'),
('2', 'guardian'),
('3', 'superuser')
)
"""gender"""
GENDERS = (
('1', 'Male'),
('2', 'Female')
)
"""Task status"""
TASK_STATUS = (
('1', 'pending'),
('2', 'in-progress'),
('3', 'rejected'),
('4', 'requested'),
('5', 'completed')
)
"""sign up method"""
SIGNUP_METHODS = (
('1', 'manual'),
('2', 'google'),
('3', 'apple')
)
"""relationship"""
RELATIONSHIP = (
('1', 'parent'),
('2', 'legal_guardian')
)
PENDING = 1
IN_PROGRESS = 2
REJECTED = 3
REQUESTED = 4
COMPLETED = 5
TASK_POINTS = 5
# duplicate name used defined in constant PROJECT_NAME
PROJECT_NAME = 'Zod Bank'
GUARDIAN = 'guardian'
JUNIOR = 'junior'
SUPERUSER = 'superuser'
# numbers used as a constant
# Define the byte into kb
BYTE_IMAGE_SIZE = 1024
# validate file size
MAX_FILE_SIZE = 1024 * 1024 * 5