Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch v1.0.2 to develop #38

Open
wants to merge 428 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
428 commits
Select commit Hold shift + click to select a range
cd70cc6
Fix get villa API by villa ID to return document file urls, not docum…
danibazi9 Apr 25, 2021
f085130
Change get villa API by villa ID to hide/unhide villa
danibazi9 Apr 25, 2021
8647639
add admin of calendar
Apr 26, 2021
89b5a54
Merge branch 'feature/villa' of https://github.com/danibazi9/Software…
Apr 26, 2021
0c844ed
Add names to the urls of Villa apis to use in tests
danibazi9 Apr 26, 2021
e4d2ef8
Add name to the urls of account apis to use in tests
danibazi9 Apr 26, 2021
af7d631
Write unit tests for get all villas API
danibazi9 Apr 26, 2021
6d1c183
Write unit tests for upload image for villa API
danibazi9 Apr 26, 2021
39ba223
Write unit tests for upload document for villa API
danibazi9 Apr 26, 2021
eda59d0
Write unit tests for add villa API
danibazi9 Apr 26, 2021
e9050f6
Write unit tests for account document model
danibazi9 Apr 26, 2021
f1b2762
Nothing
danibazi9 Apr 26, 2021
4cbd230
Add visible to Villa model & Django Admin for hide/unhide villa
danibazi9 Apr 26, 2021
2520334
Merge branch 'deploy' into feature/villa
danibazi9 Apr 26, 2021
94e75ea
Merge pull request #13 from danibazi9/feature/villa
danibazi9 Apr 26, 2021
c6a9f8d
update databse
Apr 26, 2021
bd10bdc
Make chat app
Apr 29, 2021
43e2d73
Add calendar_id field to Calendar table
danibazi9 May 1, 2021
be3fc10
Merge pull request #15 from danibazi9/feature/calendar
danibazi9 May 1, 2021
af23de9
Delete db.sqlite3
sadeghjafari5528 May 1, 2021
4972414
Merge pull request #16 from danibazi9/feature/search-villa
danibazi9 May 1, 2021
ac4eda3
Merge branch 'v1.0.0' into feature/villa
sadeghjafari5528 May 1, 2021
0ebfd16
Merge pull request #14 from danibazi9/feature/villa
sadeghjafari5528 May 1, 2021
30629d0
add staticfiles
May 3, 2021
a80e863
delete db and procfile
May 3, 2021
e8e57cc
fix bug of villa-search
May 3, 2021
d056753
Set 'me' in query parameters of get all villas API to show villas of …
danibazi9 May 3, 2021
df1843c
Update .gitignore
danibazi9 May 3, 2021
d28000d
add image field to result of villa-search
May 3, 2021
e0a98ab
Fix VillaSearchSerializer image field
May 4, 2021
3644f6e
Fix some bugs of chat app and write some tests for chat_models
May 4, 2021
bf295ae
change db
May 4, 2021
67d87ed
add media urls
May 4, 2021
1ab98f5
clear data and images
May 4, 2021
b62b379
Add first_name, last_name & image of villa's owner to get villa info API
danibazi9 May 4, 2021
6a59ddb
Delete request_document.txt
danibazi9 May 5, 2021
290548e
Update .gitignore
danibazi9 May 5, 2021
ce795c7
Create API to get fixed rules for villas
danibazi9 May 5, 2021
d1bf597
Create new model for Rule
danibazi9 May 5, 2021
66c4367
Create API to get special rules for villas to select
danibazi9 May 5, 2021
4bd4b4f
Add first_name, last_name & image of villa's owner to get villa info API
danibazi9 May 5, 2021
9e6b669
Modify add villa API to store special rules for villa too!
danibazi9 May 5, 2021
852f088
Change some special & fixed rules
danibazi9 May 5, 2021
0c37c8e
Update .gitignore
danibazi9 May 5, 2021
bea52b4
Set the first image default in add villa API
danibazi9 May 5, 2021
e368127
Start write test for consumer of chatroom
May 5, 2021
810cf17
Add villa_id to SearchVillaSerializer
May 5, 2021
3626c92
Client run successfully but still have some bugs
May 5, 2021
ca54e0f
Customize Django Administration for Calendar
danibazi9 May 6, 2021
5efd36e
Some enhancement in source code
danibazi9 May 6, 2021
b222db6
Remove null=True for customer in Calendar table
danibazi9 May 6, 2021
6946620
Create API to register a villa for a period of time by customer
danibazi9 May 6, 2021
953f902
Merge remote-tracking branch 'origin/deploy' into deploy
danibazi9 May 7, 2021
2764381
Update urls.py
danibazi9 May 7, 2021
8ef2dfd
Update views.py
danibazi9 May 7, 2021
4f65885
Update test_models.py
danibazi9 May 7, 2021
935fee9
Delete 2.jpeg
danibazi9 May 7, 2021
9896e0d
Delete 2.txt
danibazi9 May 7, 2021
c98320e
Delete 2_8GybHOn.jpeg
danibazi9 May 7, 2021
06aada1
Delete Screenshot_from_2021-04-11_15-22-15.png
danibazi9 May 7, 2021
e516f48
Delete Screenshot_from_2021-04-11_15-22-15_flq8bTp.png
danibazi9 May 7, 2021
9a461a9
Delete request_document.txt
danibazi9 May 7, 2021
47528b6
Delete db.sqlite3
danibazi9 May 7, 2021
15ead47
Delete live-static/media-root/users/images directory
danibazi9 May 7, 2021
f51843c
Delete live-static/media-root/villas/images directory
danibazi9 May 7, 2021
5d0dbf7
Delete chat/migrations directory
danibazi9 May 7, 2021
4388b4a
Delete 0002_villa_visible.py
danibazi9 May 7, 2021
11c2a90
Fix conflict
danibazi9 May 7, 2021
54e24f7
test chatroom
May 7, 2021
d65b2ed
fix client test
May 7, 2021
9dd7245
Merge branch 'feature/chatroom' into v1.0.1
danibazi9 May 7, 2021
df22bfc
Customize Django Administration for Chat & Message tables
danibazi9 May 7, 2021
c4677b5
Set blank=True for parentMessage in Message model
danibazi9 May 7, 2021
44d91de
Resolve conflicts
danibazi9 May 7, 2021
d4a582b
Merge branch 'v1.0.1' into deploy
danibazi9 May 7, 2021
2c7650a
Nothing
danibazi9 May 7, 2021
ed679a3
Comment Cronjob background task
danibazi9 May 7, 2021
a961fee
Update .gitignore
danibazi9 May 7, 2021
618a69f
Write unit test for the Rule model
danibazi9 May 7, 2021
d954b9d
Write unit test for get fixed rules API
danibazi9 May 7, 2021
1bc9ce4
Write unit test for get special rules API
danibazi9 May 7, 2021
382a88a
Nothing
danibazi9 May 7, 2021
f1485f9
Write unit tests for register villa by the user
danibazi9 May 8, 2021
3d8d4c2
Merge branch 'v1.0.1' into feature/villa
danibazi9 May 8, 2021
0c55af0
Merge pull request #22 from danibazi9/feature/villa
danibazi9 May 8, 2021
8c28b77
Merge pull request #23 from danibazi9/v1.0.1
danibazi9 May 8, 2021
dd7a8b9
Merge branch 'v1.0.1' into feature/register-villa
danibazi9 May 8, 2021
76e0afe
Merge pull request #24 from danibazi9/feature/register-villa
danibazi9 May 8, 2021
c81aa90
Merge pull request #25 from danibazi9/v1.0.1
danibazi9 May 8, 2021
bd69848
Merge branch 'v1.0.1' of https://github.com/danibazi9/SoftwareCheetah…
danibazi9 May 8, 2021
9033106
Nothing
danibazi9 May 8, 2021
e2ec9f4
Remove Procfile & dp.sqlite
danibazi9 May 8, 2021
fa5480c
final testing
May 8, 2021
a963867
Merge branch 'deploy' of https://github.com/danibazi9/SoftwareCheetah…
May 8, 2021
98c74ee
final testign
May 8, 2021
168cea3
final test for chat
May 8, 2021
6651fc0
Comment tasks.py
danibazi9 May 8, 2021
d1bf4ce
fix conflict
May 8, 2021
599c236
Fix a little bug
danibazi9 May 8, 2021
4c1e89a
Customize Django Administration for Rule model
danibazi9 May 8, 2021
5bd3ccc
Add rule in get villa info by villa id
danibazi9 May 8, 2021
5238e4f
Add rule in get villa info by villa id
danibazi9 May 8, 2021
e517de3
Customize Django Administration for Rule model
danibazi9 May 8, 2021
96fe2d6
Fix a little bug
danibazi9 May 8, 2021
9666397
Fix a little bug
danibazi9 May 8, 2021
da7223e
solve conflicts
May 8, 2021
ecf7763
remove db from gitignore
May 8, 2021
f6f63e2
Return 400 request if 'start_date' & 'end_date' isn't be in the reque…
danibazi9 May 8, 2021
02b581a
fix tests
May 20, 2021
0fea396
fix delete villas
May 20, 2021
1ad8989
Delete django_crontab from settings.py apps
May 20, 2021
8a891f3
add a villa to database
May 20, 2021
8999df5
add some data to database
May 22, 2021
8c93706
change search functionality
May 22, 2021
2aa10bd
Add some fields to Calendar table + return more fields in detail page…
danibazi9 May 23, 2021
238e34f
Merge pull request #26 from danibazi9/feature/register-villa
danibazi9 May 23, 2021
8cdf369
Update .gitignore
danibazi9 May 23, 2021
f307cde
Delete db.sqlite3
danibazi9 May 23, 2021
379d1e0
Delete db.sqlite3
danibazi9 May 23, 2021
a210518
Delete .gitignore
danibazi9 May 23, 2021
faef39e
Delete .gitignore
danibazi9 May 23, 2021
d720f44
Delete __init__.py
danibazi9 May 23, 2021
b2a5031
Merge pull request #28 from danibazi9/deploy
danibazi9 May 23, 2021
8043eb3
Add .gitignore
danibazi9 May 23, 2021
c38c389
Update requirements.txt
danibazi9 May 23, 2021
9be74f1
delete prints from search villa view
May 25, 2021
b82c313
fix bug of check-email-existence
May 25, 2021
c92bf80
fix check-email-existence bug
May 25, 2021
f2584a5
Add some fixed & special rules for villa.
danibazi9 May 25, 2021
3e26e73
complete most reserved villas
May 25, 2021
39c1f8b
complete most rated villas
May 25, 2021
2bf422b
make view of most reserved city
May 26, 2021
31d2b29
write some test for most popular city
May 27, 2021
eafc2e0
add / end of some urls
May 27, 2021
94305d7
fix some bug of most popular city
May 27, 2021
3f73baf
complete most popular city
May 27, 2021
e58bb05
Deploy into IUST server
danibazi9 May 27, 2021
135958c
change branch
May 27, 2021
267f0ad
Update .gitignore
danibazi9 May 27, 2021
6f3ecc1
merge with feature
May 27, 2021
a5226bd
edit gitignore file
May 27, 2021
fe227df
edit database
May 27, 2021
38abb89
improve most popular city
May 27, 2021
cfaf365
complete calendar
May 27, 2021
58eb600
Create API to send push notification by FCM (Firebase Cloud Messaging)
danibazi9 May 28, 2021
d124248
Nothing
danibazi9 May 28, 2021
6cb9e85
Merge pull request #29 from danibazi9/feature/push_notification
sadeghjafari5528 May 28, 2021
c43d417
Add response 400 when 'number_of_villa' not in request data
danibazi9 May 28, 2021
a85b38a
Merge pull request #30 from danibazi9/feature/most_registered_or_rate…
danibazi9 May 28, 2021
e219604
Update .gitignore
danibazi9 May 28, 2021
2f6b810
Update urls.py
danibazi9 May 28, 2021
d4fe849
Delete db.sqlite3
danibazi9 May 28, 2021
d970271
Merge branch 'v1.0.2' into feature/search-villa
danibazi9 May 28, 2021
5dc7f34
Merge pull request #32 from danibazi9/feature/search-villa
danibazi9 May 28, 2021
7dd9e09
Update urls.py
danibazi9 May 28, 2021
108b436
Delete db.sqlite3
danibazi9 May 28, 2021
015a4d9
Delete 0001_initial.py
danibazi9 May 28, 2021
955ac4d
Merge branch 'v1.0.2' into feature/calendar
danibazi9 May 28, 2021
dd6d309
Merge pull request #31 from danibazi9/feature/calendar
danibazi9 May 28, 2021
614e30a
Fix a little syntax error
danibazi9 May 28, 2021
1655951
Delete 0001_initial.py
danibazi9 May 28, 2021
da9d967
Delete 0001_initial.py
danibazi9 May 28, 2021
7b73d05
Delete db.sqlite3
danibazi9 May 28, 2021
84b62d5
Merge conflicts
danibazi9 May 28, 2021
b0f83c6
Delete db.sqlite3~deploy
danibazi9 May 28, 2021
3f73d94
Delete db.sqlite3
danibazi9 May 28, 2021
f09f40c
Delete 0001_initial.py
danibazi9 May 28, 2021
a49304f
Delete 0001_initial.py
danibazi9 May 28, 2021
14f8029
Merge pull request #33 from danibazi9/v1.0.2
danibazi9 May 28, 2021
ccd00a1
improve tests
May 28, 2021
2c9960e
Fix a little bug that caused by merge conflicts in reserve villa
danibazi9 May 28, 2021
0d80d97
improve testcases
May 28, 2021
5b3675f
Merge pull request #34 from danibazi9/feature/most_registered_or_rate…
danibazi9 May 28, 2021
6d4552e
Merge pull request #35 from danibazi9/feature/search-villa
danibazi9 May 28, 2021
8f832a3
Write unit tests for push notification
danibazi9 May 29, 2021
1677b0b
Remove username field from Account model
danibazi9 May 29, 2021
20a149b
Merge branch 'v1.0.2' into feature/push_notification
danibazi9 May 29, 2021
6881f08
Merge pull request #36 from danibazi9/feature/push_notification
danibazi9 May 29, 2021
cd8a564
Fix some bugs in unit tests
danibazi9 May 29, 2021
7b483a5
Add list of rules in get all villas info API response
danibazi9 May 30, 2021
510b6f7
fix some bugs
Jun 1, 2021
708b9e9
fix migrations confilict
Jun 1, 2021
a2851ae
solve conflict
Jun 1, 2021
736f765
try to make create_message function for chat
Jun 1, 2021
38bb8bd
complete chat authentication
Jun 7, 2021
5932137
almost complete functionality of chat
Jun 7, 2021
3e348a0
complete chat list
Jun 10, 2021
6f43ab0
Add user_id to response of get villa details.
danibazi9 Jun 10, 2021
5546735
Merge branch 'deploy' into v1.0.2
danibazi9 Jun 10, 2021
4f88ba8
Merge pull request #39 from danibazi9/feature/login-signup
danibazi9 Jun 10, 2021
b5fd2db
Merge pull request #40 from danibazi9/feature/chatroom
danibazi9 Jun 10, 2021
ea1e39d
complete add and show chat with test
Jun 12, 2021
e2a21d6
start villa rate
Jun 12, 2021
8d27e9c
complete add villa_rate and show villa_rate
Jun 13, 2021
b427a15
fix some bug of chatroom
Jun 13, 2021
79037e1
fix client_test2.py
Jun 13, 2021
1d37c8e
Check for 400 response if there aren't "message" & "title" in request…
danibazi9 Jun 13, 2021
970377f
Merge pull request #42 from danibazi9/feature/chatroom
danibazi9 Jun 16, 2021
78fcae1
Add newline at the end of file :D
danibazi9 Jun 16, 2021
1ef0272
Merge pull request #43 from danibazi9/feature/vill_rate
danibazi9 Jun 16, 2021
d4e1b9d
complete upload file
Jun 16, 2021
4155e03
fix bugs
Jun 16, 2021
77254fe
fix tests
Jun 17, 2021
ce9e33a
Update settings.py
danibazi9 Jun 17, 2021
d336ad7
Modify the Villa model & add likes as m-m relationship with Account m…
danibazi9 Jun 17, 2021
4fdaabc
Create API for like/dislike villa + Modify get villa info API to retu…
danibazi9 Jun 17, 2021
1ef79bc
Write unit tests for like/dislike villa API & test successfully.
danibazi9 Jun 17, 2021
84f5987
Comment username field in Account model for running tests better
danibazi9 Jun 17, 2021
5485d86
Create an API to return all villas liked by each user
danibazi9 Jul 1, 2021
574f318
Create an API for get reserved villas & combine with get hosted villa…
danibazi9 Jul 2, 2021
921290e
Comment username in Account model
danibazi9 Jul 2, 2021
90ca094
Fix a conflict
danibazi9 Jul 2, 2021
7c71a9f
Nothing
danibazi9 Jul 2, 2021
9c979be
Merge branch 'v1.0.2' into feature/register-villa
danibazi9 Jul 2, 2021
3f4298b
Merge pull request #50 from danibazi9/feature/register-villa
danibazi9 Jul 2, 2021
0428594
Merge pull request #51 from danibazi9/feature/vill_rate
danibazi9 Jul 2, 2021
186313d
Merge branch 'v1.0.2' into feature/chatroom
danibazi9 Jul 2, 2021
7b59b0a
Merge pull request #52 from danibazi9/feature/chatroom
danibazi9 Jul 2, 2021
c0085b8
Add 'rate' field to VillaSearchSerializer
danibazi9 Jul 9, 2021
3c3373c
Add {"data": } for the APIs body of listed results
danibazi9 Jul 9, 2021
87ca270
Write unit tests for get favorite villa of each user API
danibazi9 Jul 9, 2021
0d4f4e5
Change villa info API to return 'reserved' boolean field in villa det…
danibazi9 Jul 9, 2021
aea108a
Nothing
danibazi9 Jul 10, 2021
5db8f47
Return 400 response for push notif API when 'message' & 'title' don't…
danibazi9 Jul 10, 2021
81af038
Create an API to check postal code (postal code of villas must be uni…
danibazi9 Jul 10, 2021
22bdcca
Write unit tests for check postal code API
danibazi9 Jul 10, 2021
3720570
Create API to create/modify GSM device info
danibazi9 Jul 10, 2021
f133c11
Add url for create/modify FCM device
danibazi9 Jul 10, 2021
daae8a9
Merge pull request #54 from danibazi9/feature/push_notification
danibazi9 Jul 10, 2021
916d63a
Fix a bug in modify device info
danibazi9 Jul 10, 2021
53c059c
Send push notification when add new villa
danibazi9 Jul 10, 2021
03b4038
Fix a bug
danibazi9 Jul 10, 2021
2b59ad9
Send push notification to all users when a new villa is added
danibazi9 Jul 10, 2021
8e68e17
Send push notification to guest & host when reserving a new villa
danibazi9 Jul 10, 2021
22de802
complete payment
Jul 10, 2021
a5d7a01
add currency to serializers
Jul 10, 2021
08f88c1
complete cancel reserve
Jul 10, 2021
b832c4a
Fix some bugs
danibazi9 Jul 10, 2021
062b733
Setup Cronjob for scheduling push notification for reserve
danibazi9 Jul 11, 2021
55b7bef
Setup Cronjob for scheduling push notification for cancel reservation
danibazi9 Jul 11, 2021
de4adb2
Add calendar_id to response of get reserved villa for each user API
danibazi9 Jul 11, 2021
310ef43
Merge branch 'feature/vill_rate' of https://github.com/danibazi9/Soft…
Jul 11, 2021
ef291c7
Merge branch 'payment' of https://github.com/danibazi9/SoftwareCheeta…
Jul 11, 2021
c421400
merge payment with v1.0.2
Jul 11, 2021
ed67c25
fix bugs
Jul 11, 2021
f367a9f
Change representation of show reserved/hosted info API
danibazi9 Jul 11, 2021
cf1e076
Fix a bug in show villa detail
danibazi9 Jul 11, 2021
da70daf
Fix a bug in show hosted villas info
danibazi9 Jul 11, 2021
a0d3ea7
Fix a bug
danibazi9 Jul 11, 2021
a381c2c
Send push notification to reciever message in chat
danibazi9 Jul 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Create an API to check postal code (postal code of villas must be uni…
…que)
  • Loading branch information
danibazi9 committed Jul 10, 2021
commit 81af038ef8ebb3b98f4f29d86d7ed69a7864f866
3 changes: 2 additions & 1 deletion villa/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
path('most-registered/show/', views.show_most_registered_villas, name='show_most_registered_villas'),
path('most-rated/show/', views.show_most_rated_villas, name='show_most_rated_villas'),
path('rate/add/', views.add_rate, name='add_rate'),
path('like/', views.like_villa, name='like_villa')
path('like/', views.like_villa, name='like_villa'),
path('check-postal-code/', views.check_postal_code, name='check_postal_code'),
]
15 changes: 15 additions & 0 deletions villa/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,3 +590,18 @@ def get_favourite_villas(request):
data = json.loads(json.dumps(serializer.data))

return Response({'data': add_additional_info(data, request.user.user_id)}, status=status.HTTP_200_OK)


@api_view(['POST', ])
@permission_classes((IsAuthenticated,))
def check_postal_code(request):
if 'postal_code' not in request.data:
return Response("Postal_code: None, BAD REQUEST!", status=status.HTTP_400_BAD_REQUEST)

postal_code = request.data['postal_code']

try:
Villa.objects.get(postal_code=postal_code)
return Response("There exist a villa with this postal code!", status=status.HTTP_406_NOT_ACCEPTABLE)
except Villa.DoesNotExist:
return Response("There isn't any villa with this postal code!", status=status.HTTP_200_OK)