Skip to content

Commit

Permalink
SA-1 : Hostel Management (Fixed Bugs) (FusionIIIT#1422)
Browse files Browse the repository at this point in the history
* GAD-5: Fix responsiveness (FusionIIIT#1125)

Co-authored-by: A Anunaya <[email protected]>
Co-authored-by: Aksh Bansal <[email protected]>

* setup

* chore:alloted_rooms and all_staff are added

* doing

* chor:HostelAllotment

* comment in import hostelstudentattendance in views

* Chore:change in staff schedule

* chore:Hostelleave- caretaker and wardern can see all leave forms

* chore:post request delete from StaffScheduleView class

* chore:Hostelleave- student can apply for hostel leave

* adding functionality of super admin

* chore:all_stuff changed

* functionality assigned batch

* Chore:CURD API in hostel_management_hostelinventory

* added functionality of assigning caretaker

* chore:hostel_complaint_implemented

* chore:inventory_form change

* added frontend of alloted_room and linked with backend

* chore: hostel_complaint and hostel_leave implemented

* feat:hall_inventory form submmit,edit,delete

* Merging migration of database

* added assign-warden , add-hostel ,delete-hostel in frontend and backend

* akshay PR merge

* chore:hall id set

* Final merge of akshay,ankit,anuj

* uncommented functionality of hostel_complaint_list/

* fix:hall select problem fixed

* fix:dropdownlist change when hall.id change in URL

* Added frontend of all_leave_data,alloted_rooms_main,create_leave,complaint_form

* chore: login required

* chore: login required implemented

* feat:authentication added

* feat: authentication added in hostel leave and hostel complaint system and also added all operations that  caretaker and warden can perform

* Added frontend with templates of all_leave_data,alloted_rooms_main,create_leave,complaint_form

* book guestroom

* chore: run python manage.py copy_data to merge table to get all student details at one place

* chore: Added functionality - caretaker and warden can get all details of student of their hall -----used StudentDetails table

* guest room part done

* added templates for hostel_complaint,inventory_form,my_leaves

* added full student details table

* Added api endpoints for notifications

* fix:input fields of complaint and leave form

* added funtionality of hostel super admin , guest room

* feat:caretaker manage fine impose

* migration files of DB

* resolved error in sending notification for announcements

* chore:student fine show

* fix:student details

* updated html files with template

* updated alerts.html and alert1.html for implementing delete notification

* chore:fine frontend design

* fix:List name change

* updated frontend using templates

* fixed few bugs and few glitches.

* Added pylint  (FusionIIIT#1302)

* Create bandit_security_test.yml

Added Bandit security test for python

* Update bandit_security_test.yml

* Update bandit_security_test.yml

* Create pylint.yml

* Update pylint.yml

* Update pylint.yml

* Revert "Added pylint  (FusionIIIT#1302)" (FusionIIIT#1324)

This reverts commit c1359b7.

* GAD -5 Dashboard Changes (FusionIIIT#1325)

* dashboard and usercard updated (FusionIIIT#1329)

* minor changes

* removed HostelAllotment class

* chore:Student fine show

* chore:date disable feature added

* fix:notification message for room booking request is changed

* added dropdown in sidebar

* changes in programme_cuuriculam,adding version to models (FusionIIIT#1330)

* added hostelTransactions

* Seater type added and vacant seats added

* added seater,vacant,logs

* fix: calender,fine

* only vacant room show in guestroom

* added Hostel history functionality

* fix:UI of tables

* fix:UI of tables

* migration

* added remark field in leave

* fix:hostelTransaction

* fix

* fix:In leave request remark option is added

* added notification functionality

* added remark column in leave request

* migrations files

* Fixing ui bugs (FusionIIIT#1335)

* Synced with new Dashboard

Some changes made to dashboard module in terms of UI and context updated.

* .DS_Store

* commented inventory

* updated gitignore

* updated gitignore

* removed migrations

* change in migrations

* resolve bugs in guestroom functionality

* functionlity changed in student details view

* removed .DS_Store

* removed migrations

* added pay link

* feat:Fine edit

* chore:design added in fine edit

* fix:Hostel fine list's button

* student details,room allottment functionality change

* fixed: few checks

* added worker report

* fixed:phone number in student details

* added migrations file

---------

Co-authored-by: Harshvardhan Singh <[email protected]>
Co-authored-by: A Anunaya <[email protected]>
Co-authored-by: Aksh Bansal <[email protected]>
Co-authored-by: akshatnema <[email protected]>
Co-authored-by: Aniruddha <[email protected]>
Co-authored-by: Stark <[email protected]>
Co-authored-by: ANKIT <[email protected]>
Co-authored-by: KK <[email protected]>
Co-authored-by: Hardik Sharma <[email protected]>
Co-authored-by: Raman Chaudhary <[email protected]>
Co-authored-by: BlackHAWK2001 <[email protected]>
Co-authored-by: Arpit Tak <[email protected]>
Co-authored-by: Anudeep Sanapala <[email protected]>
Co-authored-by: Aniruddha Das <[email protected]>
Co-authored-by: SukulSarve <[email protected]>
Co-authored-by: Ankit kumar <[email protected]>
  • Loading branch information
17 people authored Apr 11, 2024
1 parent 0a8c0dd commit ef5fbde
Show file tree
Hide file tree
Showing 56 changed files with 1,446 additions and 345 deletions.
Binary file removed .DS_Store
Binary file not shown.
Binary file removed .github/.DS_Store
Binary file not shown.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,6 @@ node_modules/
FusionIIIT/static/
package-lock.json

**/**/migrations/*

.DS_Store

Binary file removed FusionIIIT/.DS_Store
Binary file not shown.
Binary file removed FusionIIIT/applications/.DS_Store
Binary file not shown.
Binary file not shown.
Binary file removed FusionIIIT/applications/central_mess/.DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed FusionIIIT/applications/department/.DS_Store
Binary file not shown.
Binary file removed FusionIIIT/applications/eis/.DS_Store
Binary file not shown.
Binary file removed FusionIIIT/applications/establishment/.DS_Store
Binary file not shown.
Binary file removed FusionIIIT/applications/estate_module/.DS_Store
Binary file not shown.
Binary file removed FusionIIIT/applications/feeds/.DS_Store
Binary file not shown.
Binary file removed FusionIIIT/applications/filetracking/.DS_Store
Binary file not shown.
Binary file not shown.
Binary file removed FusionIIIT/applications/globals/.DS_Store
Binary file not shown.
Binary file removed FusionIIIT/applications/gymkhana/.DS_Store
Binary file not shown.
Binary file removed FusionIIIT/applications/health_center/.DS_Store
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions FusionIIIT/applications/hostel_management/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class Meta:
model = HostelNoticeBoard
fields = ('hall', 'head_line', 'content', 'description')


class HallForm(forms.ModelForm):
class Meta:
model = Hall
Expand All @@ -29,5 +28,6 @@ class Meta:
'arrival_time',
'departure_date',
'departure_time',
'nationality'
'nationality',
'room_type'
)
238 changes: 238 additions & 0 deletions FusionIIIT/applications/hostel_management/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
# Generated by Django 3.1.5 on 2024-04-11 12:33

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.fields.related
import django.utils.timezone


class Migration(migrations.Migration):

initial = True

dependencies = [
('globals', '__first__'),
('academic_information', '__first__'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='Hall',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('hall_id', models.CharField(max_length=10)),
('hall_name', models.CharField(max_length=50)),
('max_accomodation', models.IntegerField(default=0)),
('number_students', models.PositiveIntegerField(default=0)),
('assigned_batch', models.CharField(blank=True, max_length=50, null=True)),
('type_of_seater', models.CharField(choices=[('single', 'Single Seater'), ('double', 'Double Seater'), ('triple', 'Triple Seater')], default='single', max_length=50)),
],
),
migrations.CreateModel(
name='HostelComplaint',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('hall_name', models.CharField(max_length=100)),
('student_name', models.CharField(max_length=100)),
('roll_number', models.CharField(max_length=20)),
('description', models.TextField()),
('contact_number', models.CharField(max_length=15)),
],
),
migrations.CreateModel(
name='HostelLeave',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('student_name', models.CharField(max_length=100)),
('roll_num', models.CharField(max_length=20)),
('reason', models.TextField()),
('phone_number', models.CharField(blank=True, max_length=20, null=True)),
('start_date', models.DateField(default=django.utils.timezone.now)),
('end_date', models.DateField()),
('status', models.CharField(default='pending', max_length=20)),
('remark', models.TextField(blank=True, null=True)),
('file_upload', models.FileField(blank=True, null=True, upload_to='hostel_management/')),
],
),
migrations.CreateModel(
name='StudentDetails',
fields=[
('id', models.CharField(max_length=20, primary_key=True, serialize=False)),
('first_name', models.CharField(blank=True, max_length=100, null=True)),
('last_name', models.CharField(blank=True, max_length=100, null=True)),
('programme', models.CharField(blank=True, max_length=100, null=True)),
('batch', models.CharField(blank=True, max_length=100, null=True)),
('room_num', models.CharField(blank=True, max_length=20, null=True)),
('hall_no', models.CharField(blank=True, max_length=20, null=True)),
('hall_id', models.CharField(blank=True, max_length=20, null=True)),
('specialization', models.CharField(blank=True, max_length=100, null=True)),
('parent_contact', models.CharField(blank=True, max_length=20, null=True)),
('address', models.CharField(blank=True, max_length=255, null=True)),
],
),
migrations.CreateModel(
name='WorkerReport',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('worker_id', models.CharField(max_length=10)),
('worker_name', models.CharField(max_length=50)),
('year', models.IntegerField(default=2020)),
('month', models.IntegerField(default=1)),
('absent', models.IntegerField(default=0)),
('total_day', models.IntegerField(default=31)),
('remark', models.CharField(max_length=100)),
('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')),
],
),
migrations.CreateModel(
name='StaffSchedule',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('staff_type', models.CharField(default='Caretaker', max_length=100)),
('day', models.CharField(choices=[('Monday', 'Monday'), ('Tuesday', 'Tuesday'), ('Wednesday', 'Wednesday'), ('Thursday', 'Thursday'), ('Friday', 'Friday'), ('Saturday', 'Saturday'), ('Sunday', 'Sunday')], max_length=15)),
('start_time', models.TimeField(blank=True, null=True)),
('end_time', models.TimeField(blank=True, null=True)),
('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')),
('staff_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.staff')),
],
),
migrations.CreateModel(
name='HostelTransactionHistory',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('change_type', models.CharField(max_length=100)),
('previous_value', models.CharField(max_length=255)),
('new_value', models.CharField(max_length=255)),
('timestamp', models.DateTimeField(auto_now_add=True)),
('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')),
],
),
migrations.CreateModel(
name='HostelStudentAttendence',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date', models.DateField()),
('present', models.BooleanField()),
('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')),
('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')),
],
),
migrations.CreateModel(
name='HostelNoticeBoard',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('head_line', models.CharField(max_length=100)),
('content', models.FileField(blank=True, null=True, upload_to='hostel_management/')),
('description', models.TextField(blank=True)),
('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')),
('posted_by', models.ForeignKey(on_delete=django.db.models.fields.related.ForeignKey, to='globals.extrainfo')),
],
),
migrations.CreateModel(
name='HostelInventory',
fields=[
('inventory_id', models.AutoField(primary_key=True, serialize=False)),
('inventory_name', models.CharField(max_length=100)),
('cost', models.DecimalField(decimal_places=2, max_digits=10)),
('quantity', models.PositiveIntegerField(default=0)),
('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')),
],
),
migrations.CreateModel(
name='HostelHistory',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('timestamp', models.DateTimeField(default=django.utils.timezone.now)),
('batch', models.CharField(max_length=50, null=True)),
('caretaker', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='caretaker_history', to='globals.staff')),
('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')),
('warden', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='warden_history', to='globals.faculty')),
],
),
migrations.CreateModel(
name='HostelFine',
fields=[
('fine_id', models.AutoField(primary_key=True, serialize=False)),
('student_name', models.CharField(max_length=100)),
('amount', models.DecimalField(decimal_places=2, max_digits=10)),
('status', models.CharField(choices=[('Pending', 'Pending'), ('Paid', 'Paid')], default='Pending', max_length=50)),
('reason', models.TextField()),
('hall', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')),
('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academic_information.student')),
],
),
migrations.CreateModel(
name='HostelAllotment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('assignedBatch', models.CharField(max_length=50)),
('assignedCaretaker', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='globals.staff')),
('assignedWarden', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='globals.faculty')),
('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')),
],
),
migrations.CreateModel(
name='HallWarden',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('faculty', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.faculty')),
('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')),
],
),
migrations.CreateModel(
name='HallRoom',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('room_no', models.CharField(max_length=4)),
('block_no', models.CharField(max_length=1)),
('room_cap', models.IntegerField(default=3)),
('room_occupied', models.IntegerField(default=0)),
('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')),
],
),
migrations.CreateModel(
name='HallCaretaker',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')),
('staff', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='globals.staff')),
],
),
migrations.CreateModel(
name='GuestRoomBooking',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('guest_name', models.CharField(max_length=255)),
('guest_phone', models.CharField(max_length=255)),
('guest_email', models.CharField(blank=True, max_length=255)),
('guest_address', models.TextField(blank=True)),
('rooms_required', models.IntegerField(blank=True, default=1, null=True)),
('guest_room_id', models.CharField(blank=True, max_length=255)),
('total_guest', models.IntegerField(default=1)),
('purpose', models.TextField()),
('arrival_date', models.DateField()),
('arrival_time', models.TimeField()),
('departure_date', models.DateField()),
('departure_time', models.TimeField()),
('status', models.CharField(choices=[('Confirmed', 'Confirmed'), ('Pending', 'Pending'), ('Rejected', 'Rejected'), ('Canceled', 'Canceled'), ('CancelRequested', 'Cancel Requested'), ('CheckedIn', 'Checked In'), ('Complete', 'Complete'), ('Forward', 'Forward')], default='Pending', max_length=255)),
('booking_date', models.DateField(default=django.utils.timezone.now)),
('nationality', models.CharField(blank=True, max_length=255)),
('room_type', models.CharField(choices=[('single', 'Single'), ('double', 'Double'), ('triple', 'Triple')], default='single', max_length=10)),
('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')),
('intender', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='GuestRoom',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('room', models.CharField(max_length=255)),
('occupied_till', models.DateField(blank=True, null=True)),
('vacant', models.BooleanField(default=True)),
('room_type', models.CharField(choices=[('single', 'Single'), ('double', 'Double'), ('triple', 'Triple')], default='single', max_length=10)),
('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostel_management.hall')),
],
),
]
Empty file.
24 changes: 18 additions & 6 deletions FusionIIIT/applications/hostel_management/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ def __str__(self):




class GuestRoomBooking(models.Model):
"""
Records information related to booking of guest rooms in various Hall of Residences.
Expand Down Expand Up @@ -125,6 +124,13 @@ class GuestRoomBooking(models.Model):
status = models.CharField(max_length=255, choices=HostelManagementConstants.BOOKING_STATUS ,default ="Pending")
booking_date = models.DateField(auto_now_add=False, auto_now=False, default=timezone.now)
nationality = models.CharField(max_length=255, blank=True)
ROOM_TYPES = [
('single', 'Single'),
('double', 'Double'),
('triple', 'Triple'),
# Add more room types as needed
]
room_type = models.CharField(max_length=10, choices=ROOM_TYPES ,default='single')

def __str__(self):
return '%s ----> %s - %s' % (self.id, self.guest_name, self.status)
Expand All @@ -141,7 +147,7 @@ class StaffSchedule(models.Model):
'start_time' stores the start time of a schedule.
'end_time' stores the end time of a schedule.
"""
hall = models.ForeignKey(Hall, on_delete=models.CASCADE)
hall = models.ForeignKey(Hall, on_delete=models.CASCADE)
staff_id = models.ForeignKey(Staff, on_delete=models.CASCADE)
staff_type = models.CharField(max_length=100, default='Caretaker')
day = models.CharField(max_length=15, choices=HostelManagementConstants.DAYS_OF_WEEK)
Expand Down Expand Up @@ -229,7 +235,6 @@ class WorkerReport(models.Model):
absent = models.IntegerField(default= 0)
total_day = models.IntegerField(default=31)
remark = models.CharField(max_length=100)

def str(self):
return str(self.worker_name)+'->' + str(self.month) + '-' + str(self.absent)

Expand All @@ -254,14 +259,15 @@ class HostelLeave(models.Model):
student_name = models.CharField(max_length=100)
roll_num = models.CharField(max_length=20)
reason = models.TextField()
phone_number = models.CharField(max_length=20, null=True,blank=True)
start_date = models.DateField(default=timezone.now)
end_date = models.DateField()
status = models.CharField(max_length=20, default='pending')
remark = models.TextField(blank=True, null=True)
file_upload = models.FileField(upload_to='hostel_management/', null=True, blank=True)


def __str__(self):
return f"{self.student_name}'s Leave"
def _str_(self):
return f"{self.student_name}'s Leave"

# changes

Expand Down Expand Up @@ -309,10 +315,16 @@ class GuestRoom(models.Model):
'vacant' boolean value to determine if the room is vacant
'occupied_till', date field that tells the next time the room will be vacant, null if 'vacant' == True
"""
ROOM_TYPES = [
('single', 'Single'),
('double', 'Double'),
('triple', 'Triple'),
]
hall = models.ForeignKey(Hall, on_delete=models.CASCADE)
room = models.CharField(max_length=255)
occupied_till = models.DateField(null=True, blank=True)
vacant = models.BooleanField(default=True)
room_type = models.CharField(max_length=10, choices=ROOM_TYPES ,default='single')
@property
def _vacant(self) -> bool:
if self.occupied_till and self.occupied_till > timezone.now():
Expand Down
7 changes: 7 additions & 0 deletions FusionIIIT/applications/hostel_management/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,15 @@
#guest room
path('book_guest_room/', views.request_guest_room, name="book_guest_room"),
path('update_guest_room/', views.update_guest_room, name="update_guest_room"),
path('available_guest_rooms/', views.available_guestrooms_api, name='available_guestrooms_api'),


# !!todo: Add Fine Functionality
path('fine/', views.impose_fine_view, name='fine_form_show'),
path('fine/impose/', views.HostelFineView.as_view(), name='fine_form_show'),
path('fine/impose/list/', views.hostel_fine_list, name='fine_list_show'),
path('fine/impose/edit/<int:fine_id>/', views.show_fine_edit_form, name='hostel_fine_edit'),
path('fine/impose/update/<int:fine_id>/', views.update_student_fine, name='update_student_fine'),
path('fine/impose/list/update/<int:fine_id>/', views.HostelFineUpdateView.as_view(), name='fine_update'),
path('fine/delete/<int:fine_id>/', views.HostelFineUpdateView.as_view(), name='fine_delete'),
path('fine/show/', views.student_fine_details, name='fine_show'),
Expand All @@ -107,5 +110,9 @@

path('student/<str:username>/name/', views.get_student_name, name='find_name'),


path('edit-student/<str:student_id>/', views.EditStudentView.as_view(), name='edit_student'),
path('remove-student/<str:student_id>/', views.RemoveStudentView.as_view(), name='remove-student'),


]
Loading

0 comments on commit ef5fbde

Please sign in to comment.