Compare commits

..

19 Commits

Author SHA1 Message Date
09aecc36b3 set refresh token time to 365 days 2024-03-06 16:21:19 +05:30
348c5946dd token time changed to 1m 2024-03-04 19:32:46 +05:30
5603853896 increased count for version objects 2023-12-11 14:25:24 +05:30
82b7fe7000 updated prod base url 2023-12-07 12:00:16 +05:30
92679061e2 updated frontend prod url 2023-12-06 16:17:41 +05:30
67e4e96d85 added prod link and base url 2023-12-04 17:54:56 +05:30
df32e5ed37 added prod link and base url 2023-12-04 17:05:16 +05:30
e3796f2204 auth token expiry set to 1 min 2023-11-27 12:50:02 +05:30
03f0a4c363 Merge branch 'dev' of https://github.com/KiwiTechLLC/ZODBank-Backend into dev 2023-11-27 12:46:42 +05:30
a3a4a8d091 auth token expiry set to 1 min 2023-11-27 12:43:17 +05:30
772c0c89b5 Merge pull request #369 from KiwiTechLLC/ZBKBCK-56
added optional last name in google login
2023-11-16 17:33:14 +05:30
d614d13136 added optional last name in google login 2023-11-16 17:32:34 +05:30
93ce63b1d4 Merge pull request #366 from KiwiTechLLC/ZBKBCK-56
changed message
2023-11-16 17:08:56 +05:30
4f2b42dc08 changed message 2023-11-16 17:07:46 +05:30
5c05a988a5 new line in faq_json file 2023-11-08 18:54:54 +05:30
2aff4e52f0 Merge pull request #363 from KiwiTechLLC/ZBKBCK-56
modified user notification setting, added optional value for sms notitication as false, added fixture file for faq's
2023-11-08 18:50:38 +05:30
bdc92163c3 added fixture file for faq's 2023-11-08 18:47:28 +05:30
9abf549ed4 modified user notification setting, added optional value for sms notification as false 2023-11-08 15:02:23 +05:30
057c58b709 Merge pull request #360 from KiwiTechLLC/ZBKBCK-55
added status for login and sign up from google and apple
2023-10-27 12:23:25 +05:30
6 changed files with 135 additions and 10 deletions

View File

@ -387,7 +387,7 @@ class UpdateUserNotificationSerializer(serializers.ModelSerializer):
defaults={
'push_notification': validated_data.get('push_notification'),
'email_notification': validated_data.get('email_notification'),
'sms_notification': validated_data.get('sms_notification'),
'sms_notification': validated_data.get('sms_notification', False),
})
return instance

View File

@ -74,7 +74,7 @@ class GoogleLoginMixin(object):
user_info = response.json()
email = user_info['email']
first_name = user_info['given_name']
last_name = user_info['family_name']
last_name = user_info['family_name'] if 'family_name' in user_info and user_info['family_name'] else user_info['given_name']
profile_picture = user_info['picture']
except Exception as e:
return custom_error_response(str(e), response_status=status.HTTP_400_BAD_REQUEST)
@ -760,7 +760,7 @@ class ForceUpdateViewSet(GenericViewSet, mixins.CreateModelMixin):
:param kwargs:
:return: success message
"""
if ForceUpdate.objects.all().count() >= 2:
if ForceUpdate.objects.all().count() >= 4:
return custom_error_response(ERROR_CODE['2080'], response_status=status.HTTP_400_BAD_REQUEST)
obj_data = [ForceUpdate(**item) for item in request.data]
try:

View File

@ -96,8 +96,8 @@ ERROR_CODE = {
"2067": "Action not allowed. User type missing.",
"2068": "No guardian associated with this junior",
"2069": "Invalid user type",
"2070": "You do not find as a guardian",
"2071": "You do not find as a junior",
"2070": "You are not registered as a guardian in our system. Please try again as junior.",
"2071": "You are not registered as a junior in our system. Please try again as guardian.",
"2072": "You can not approve or reject this task because junior does not exist in the system",
"2073": "You can not approve or reject this junior because junior does not exist in the system",
"2074": "You can not complete this task because you does not exist in the system",

112
fixtures/faq.json Normal file
View File

@ -0,0 +1,112 @@
[
{
"model": "junior.faq",
"pk": 1,
"fields": {
"question": "What is ZOD ?",
"description": "We are a future neobank for under 18. We aim to provide children with the ability to use debit cards under the watchfull eye of their parents.",
"status": 1,
"created_at": "2023-11-08T12:32:55.291Z",
"updated_at": "2023-11-08T12:32:55.291Z"
}
},
{
"model": "junior.faq",
"pk": 2,
"fields": {
"question": "What is financial literacy ?",
"description": "",
"status": 2,
"created_at": "2023-11-08T12:32:55.291Z",
"updated_at": "2023-11-08T12:32:55.291Z"
}
},
{
"model": "junior.faq",
"pk": 3,
"fields": {
"question": "How can we win with Zod ?",
"description": "",
"status": 2,
"created_at": "2023-11-08T12:32:55.291Z",
"updated_at": "2023-11-08T12:32:55.291Z"
}
},
{
"model": "junior.faq",
"pk": 4,
"fields": {
"question": "What is a budget ?",
"description": "",
"status": 2,
"created_at": "2023-11-08T12:32:55.291Z",
"updated_at": "2023-11-08T12:32:55.291Z"
}
},
{
"model": "junior.faq",
"pk": 5,
"fields": {
"question": "What is the difference between stocks and bonds ?",
"description": "",
"status": 2,
"created_at": "2023-11-08T12:32:55.291Z",
"updated_at": "2023-11-08T12:32:55.291Z"
}
},
{
"model": "junior.faq",
"pk": 6,
"fields": {
"question": "What is compound interest ?",
"description": "",
"status": 2,
"created_at": "2023-11-08T12:32:55.291Z",
"updated_at": "2023-11-08T12:32:55.291Z"
}
},
{
"model": "junior.faq",
"pk": 7,
"fields": {
"question": "What is diversification ?",
"description": "",
"status": 2,
"created_at": "2023-11-08T12:32:55.291Z",
"updated_at": "2023-11-08T12:32:55.291Z"
}
},
{
"model": "junior.faq",
"pk": 8,
"fields": {
"question": "What is a 401(k) ?",
"description": "",
"status": 2,
"created_at": "2023-11-08T12:32:55.291Z",
"updated_at": "2023-11-08T12:32:55.291Z"
}
},
{
"model": "junior.faq",
"pk": 9,
"fields": {
"question": "What is an emergency fund ?",
"description": "",
"status": 2,
"created_at": "2023-11-08T12:32:55.291Z",
"updated_at": "2023-11-08T12:32:55.291Z"
}
},
{
"model": "junior.faq",
"pk": 10,
"fields": {
"question": "What is a mortgage ?",
"description": "",
"status": 2,
"created_at": "2023-11-08T12:32:55.291Z",
"updated_at": "2023-11-08T12:32:55.291Z"
}
}
]

View File

@ -19,6 +19,7 @@ from base.pagination import CustomPageNumberPagination
"""Django app import"""
from drf_yasg.utils import swagger_auto_schema
from drf_yasg import openapi
from django.core.management import call_command
from drf_yasg.views import get_schema_view
# Import guardian's model,
# Import junior's model,
@ -813,7 +814,7 @@ class FAQViewSet(GenericViewSet, mixins.CreateModelMixin,
http_method_names = ['get', 'post']
def get_queryset(self):
return FAQ.objects.all()
return FAQ.objects.filter(status=1).order_by('id')
def create(self, request, *args, **kwargs):
"""
@ -823,6 +824,10 @@ class FAQViewSet(GenericViewSet, mixins.CreateModelMixin,
:param kwargs:
:return: success message
"""
load_fixture = request.query_params.get('load_fixture')
if load_fixture:
call_command('loaddata', 'fixtures/faq.json')
return custom_response(SUCCESS_CODE["3045"], response_status=status.HTTP_200_OK)
obj_data = [FAQ(**item) for item in request.data]
try:
FAQ.objects.bulk_create(obj_data)

View File

@ -56,7 +56,14 @@ if ENV in ['dev', 'qa', 'stage']:
# Add more trusted origins as needed
]
if ENV == "prod":
CORS_ALLOWED_ORIGINS = []
CORS_ALLOWED_ORIGINS = [
# backend base url
"https://prod-api.zodbank.com",
# frontend url
"https://web.zodbank.com",
# Add more trusted origins as needed
]
# allow all host
ALLOWED_HOSTS = ['*']
@ -137,10 +144,11 @@ REST_FRAMEWORK = {
}
# define jwt token
SIMPLE_JWT = {
'ACCESS_TOKEN_LIFETIME': timedelta(hours=2, minutes=59, seconds=59, microseconds=999999),
'REFRESH_TOKEN_LIFETIME': timedelta(hours=71, minutes=59, seconds=59, microseconds=999999),
'ACCESS_TOKEN_LIFETIME': timedelta(hours=3, minutes=59, seconds=59, microseconds=999999),
'REFRESH_TOKEN_LIFETIME': timedelta(days=364, hours=23, minutes=59, seconds=59, microseconds=999999),
}
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = {
@ -200,7 +208,7 @@ AUTH_PASSWORD_VALIDATORS = [
# database query logs settings
# Allows us to check db hits
# useful to optimize db query and hit
LOGGING = {
LOGGING1 = {
"version": 1,
"filters": {
"require_debug_true": {