Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c962db6
admin class created
Andrews3002 Mar 26, 2026
55a1959
student class created
Andrews3002 Mar 26, 2026
a0a6242
groupRequest class created
Andrews3002 Mar 26, 2026
55ca91c
groupRequest class modified
Andrews3002 Mar 26, 2026
e9c6b6c
group class created
Andrews3002 Mar 26, 2026
6f96c7f
studentGroup class created
Andrews3002 Mar 26, 2026
777aaa8
lot class created
Andrews3002 Mar 26, 2026
327337c
lotGroup class created
Andrews3002 Mar 26, 2026
bd96ddd
rfpRequest class created
Andrews3002 Mar 26, 2026
d320047
rfp class created
Andrews3002 Mar 26, 2026
7a39953
bid class created
Andrews3002 Mar 26, 2026
cbda709
evaluation class created
Andrews3002 Mar 26, 2026
3380c93
models created
Andrews3002 Mar 26, 2026
784cef9
models__init__.py file updated
Andrews3002 Mar 26, 2026
152718c
classes have been unit tested
Andrews3002 Mar 26, 2026
e51f3d7
unit tests for models complete and integration tests are ready to be …
Andrews3002 Mar 27, 2026
7d9f581
ready for controllers
Andrews3002 Mar 27, 2026
7361803
workflow1 complete
Andrews3002 Mar 27, 2026
32bd4ea
workflow2 complete
Andrews3002 Mar 27, 2026
6b22b06
workflow3 complete
Andrews3002 Mar 27, 2026
dbde84f
workflow4 complete
Andrews3002 Mar 27, 2026
85f3efd
workflow5 complete
Andrews3002 Mar 27, 2026
8e7a6ae
workflow6 complete
Andrews3002 Mar 27, 2026
a50ca85
workflow7 complete
Andrews3002 Mar 27, 2026
bd2966c
workflow8 complete
Andrews3002 Mar 28, 2026
40f605f
workflow9 complete
Andrews3002 Mar 28, 2026
f7da430
workflow10 complete
Andrews3002 Mar 28, 2026
9e52001
workflow11 complete
Andrews3002 Mar 28, 2026
e389edf
workflow12 complete
Andrews3002 Mar 28, 2026
4d4cb68
controllers, integration and unit tests are all complete
Andrews3002 Mar 28, 2026
2b8440c
controllers finalization
Andrews3002 Apr 2, 2026
a059cbb
ordering tests correctly
Andrews3002 Apr 2, 2026
2f55f6d
adding pytest ordering to the requirements
Andrews3002 Apr 2, 2026
d65d51a
adding pytest ordering to the requirements
Andrews3002 Apr 2, 2026
c9d5a68
adding pytest ordering to the requirements
Andrews3002 Apr 2, 2026
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,5 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

node_modules/
node_modules/
instance_tracker.txt
9 changes: 9 additions & 0 deletions App/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
from .user import *
from .auth import *
from .initialize import *
from .lot import *
from .admin import *
from .student import *
from .group import *
from .studentGroup import *
from .lotGroup import *
from .rfp import *
from .bid import *
from .evaluation import *
20 changes: 20 additions & 0 deletions App/controllers/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from App.models import Admin
from App.database import db

def create_admin(username, password):
newadmin = Admin(username=username, password=password)
db.session.add(newadmin)
db.session.commit()

def get_admin(id):
return db.session.get(Admin, id)

def get_all_admins():
return db.session.scalars(db.select(Admin)).all()

def get_all_admins_json():
admins = get_all_admins()
if not admins:
return []
admins = [admin.get_json() for admin in admins]
return admins
29 changes: 29 additions & 0 deletions App/controllers/bid.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from App.models import Bid
from App.database import db

def create_bid(lotID, sourceGroupID, receipientGroupID, bidDocumentLink):
newbid = Bid(lotID, sourceGroupID, receipientGroupID, bidDocumentLink)
db.session.add(newbid)
db.session.commit()
return newbid

def get_bid(id):
return db.session.get(Bid, id)

def get_all_bids():
return db.session.scalars(db.select(Bid)).all()

def get_all_bids_json():
bids = get_all_bids()
if not bids:
return []
bids = [bid.get_json() for bid in bids]
return bids

def remove_bid(id):
bid = get_bid(id)
if bid:
db.session.delete(bid)
db.session.commit()
return True
return False
64 changes: 64 additions & 0 deletions App/controllers/evaluation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
from App.models import Evaluation
from App.database import db

def create_evaluation(sourceGroupID, receipientGroupID, bidID, lotID, specsMet, presentation, professionalism, budget):
neweval = Evaluation(sourceGroupID, receipientGroupID, bidID, lotID, specsMet, presentation, professionalism, budget)
db.session.add(neweval)
db.session.commit()
return neweval

def edit_evaluation(id, specsMet, presentation, professionalism, budget, deviceType=None, resolution=None, os=None, cpu=None, ram=None, drive=None, gpu=None, peripherals=None, features=None, io=None):
eva = get_evaluation(id)
if eva:
eva.overallScore = round((((specsMet + presentation + professionalism + budget)/25) * 10), 1)

if deviceType:
eva.deviceType = deviceType
if resolution:
eva.resolution = resolution
if os:
eva.os = os
if cpu:
eva.cpu = cpu
if ram:
eva.ram = ram
if drive:
eva.drive = drive
if gpu:
eva.gpu = gpu
if peripherals:
eva.peripherals = peripherals
if features:
eva.features = features
if io:
eva.io = io

db.session.commit()
return True
return False

def select_evaluation(id):
evaluation = get_evaluation(id)
evaluation.status = "selected"
db.session.commit()

def get_evaluation(id):
return db.session.get(Evaluation, id)

def get_all_evaluations():
return db.session.scalars(db.select(Evaluation)).all()

def get_all_evaluations_json():
evals = get_all_evaluations()
if not evals:
return []
evals = [eva.get_json() for eva in evals]
return evals

def remove_evaluation(id):
eva = get_evaluation(id)
if eva:
db.session.delete(eva)
db.session.commit()
return True
return False
36 changes: 36 additions & 0 deletions App/controllers/group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from App.models import Group
from App.database import db

def create_group(groupName):
group = Group(groupName)
db.session.add(group)
db.session.flush()
group.set_generated_name()
db.session.commit()
return group

def approve_group(id):
group = get_group(id)
group.status = "approved"
db.session.commit()

def get_group(id):
return db.session.get(Group, id)

def get_all_groups():
return db.session.scalars(db.select(Group)).all()

def get_all_groups_json():
groups = get_all_groups()
if not groups:
return []
groups = [group.get_json() for group in groups]
return groups

def remove_group(id):
group = get_group(id)
if group:
db.session.delete(group)
db.session.commit()
return True
return False
77 changes: 77 additions & 0 deletions App/controllers/lot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
from App.models import Lot
from App.database import db
from sqlalchemy.orm.attributes import flag_modified

def create_lot(labType, labSize, budget):
newlot = Lot(labType, labSize, budget)
db.session.add(newlot)
db.session.flush()
newlot.set_generated_name()
db.session.commit()

def get_lot(id):
return db.session.get(Lot, id)

def get_all_lots():
return db.session.scalars(db.select(Lot)).all()

def get_all_lots_json():
lots = get_all_lots()
if not lots:
return []
lots = [lot.get_json() for lot in lots]
return lots

def edit_lot(id, labType=None, labSize=None, budget=None):
lot = get_lot(id)
if lot:
if labType:
lot.labType = labType

if labSize:
lot.labSize = labSize

if budget:
lot.budget = budget

db.session.commit()

def edit_lotRFP_details(id, deviceType=None, resolution=None, os=None, cpu=None, ram=None, drive=None, gpu=None, peripherals=None, features=None, io=None):
lot = get_lot(id)
if lot:
if deviceType:
lot.deviceType = deviceType
if resolution:
lot.resolution = resolution
if os:
lot.os = os
if cpu:
lot.cpu = cpu
if ram:
lot.ram = ram
if drive:
lot.drive = drive
if gpu:
lot.gpu = gpu
if peripherals:
lot.peripherals = peripherals
if features:
lot.features = features
if io:
lot.io = io

db.session.commit()
return lot
return None

def get_lotRFP_details_json(id):
lot = get_lot(id)
if lot:
return lot.specs
return None

def remove_lot(id):
lot = get_lot(id)
if lot:
db.session.delete(lot)
db.session.commit()
28 changes: 28 additions & 0 deletions App/controllers/lotGroup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from App.models import LotGroup
from App.database import db

def add_lotGroup(lotID, groupID):
newentry = LotGroup(lotID, groupID)
db.session.add(newentry)
db.session.commit()

def get_lotGroup(lotID, groupID):
return db.session.get(LotGroup, (lotID, groupID))

def get_all_lotGroups():
return db.session.scalars(db.select(LotGroup)).all()

def get_all_lotGroups_json():
entries = get_all_lotGroups()
if not entries:
return []
entries = [entry.get_json() for entry in entries]
return entries

def remove_lotGroup(lotID, groupID):
entry = get_lotGroup(lotID, groupID)
if entry:
db.session.delete(entry)
db.session.commit()
return True
return False
48 changes: 48 additions & 0 deletions App/controllers/rfp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from App.models import RFP
from App.database import db
from .lot import get_lot

def create_rfp(groupID, lotID):
rfp = RFP(groupID, lotID)
lot = get_lot(lotID)

rfp.deviceType = lot.deviceType
rfp.resolution = lot.resolution
rfp.os = lot.os
rfp.cpu = lot.cpu
rfp.ram = lot.ram
rfp.drive = lot.drive
rfp.gpu = lot.gpu
rfp.peripherals = lot.peripherals
rfp.features = lot.features
rfp.io = lot.io

db.session.add(rfp)
db.session.commit()
return rfp

def approve_rfp(groupID, lotID):
rfp = get_rfp(groupID, lotID)
rfp.status = "approved"
db.session.commit()

def get_rfp(groupID, lotID):
return db.session.get(RFP, (groupID, lotID))

def get_all_rfps():
return db.session.scalars(db.select(RFP)).all()

def get_all_rfps_json():
rfps = get_all_rfps()
if not rfps:
return []
rfps = [rfp.get_json() for rfp in rfps]
return rfps

def remove_rfp(groupID, lotID):
rfp = get_rfp(groupID, lotID)
if rfp:
db.session.delete(rfp)
db.session.commit()
return True
return False
20 changes: 20 additions & 0 deletions App/controllers/student.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from App.models import Student
from App.database import db

def create_student(username, password):
newstudent = Student(username=username, password=password)
db.session.add(newstudent)
db.session.commit()

def get_student(id):
return db.session.get(Student, id)

def get_all_students():
return db.session.scalars(db.select(Student)).all()

def get_all_students_json():
students = get_all_students()
if not students:
return []
students = [student.get_json() for student in students]
return students
28 changes: 28 additions & 0 deletions App/controllers/studentGroup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from App.models import StudentGroup
from App.database import db

def add_studentGroup(studentID, groupID):
newentry = StudentGroup(studentID, groupID)
db.session.add(newentry)
db.session.commit()

def get_studentGroup(studentID, groupID):
return db.session.get(StudentGroup, (studentID, groupID))

def get_all_studentGroups():
return db.session.scalars(db.select(StudentGroup)).all()

def get_all_studentGroups_json():
entries = get_all_studentGroups()
if not entries:
return []
entries = [entry.get_json() for entry in entries]
return entries

def remove_studentGroup(studentID, groupID):
entry = get_studentGroup(studentID, groupID)
if entry:
db.session.delete(entry)
db.session.commit()
return True
return False
Loading
Loading