Skip to content

Commit

Permalink
separated initial member data creation and modified gym data creation…
Browse files Browse the repository at this point in the history
… function
  • Loading branch information
EsatGokcen committed Dec 31, 2024
1 parent f20a8c9 commit f7fd2bf
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 48 deletions.
106 changes: 60 additions & 46 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,68 +120,32 @@ def create_workout_zone_data():
capacity=15,
list_of_equipments=list_of_equipments6)

list_of_workout_zones = [strength_zone.model, cardio_zone.model, free_weights_zone.model,
stretching_zone.model, combat_zone.model, group_fitness_zone.model]

def create_member_data():
pass


def create_gym_data():

# GYM 1 DATA ;

return list_of_workout_zones

def create_member_data():

# MEMBER CREATION
member_controller = MemberController()
trial_member1 = member_controller.create_trial_member(name="Tim",
email="[email protected]",
phone_number="7393313233",
username="timsaxaphonist",
password="Soprano35!")

#member_controller.read_member(trial_member1)

regular_member1 = member_controller.create_regular_member(name="Jack",
email="[email protected]",
phone_number="7494414244",
username="strongjack",
password="BenchPress120kg!")

#member_controller.read_member(regular_member1)

premium_member1 = member_controller.create_premium_member(name="Lucy",
email="[email protected]",
phone_number="7595515255",
username="Lucy_does_yoga",
password="India130798")

#member_controller.read_member(premium_member1)

# GYM CREATION
gym1 = GymController()
gym1.create_manager(name="Esat",username="AdminEsat", password="Admin1000!")

personal_trainer = gym1.create_staff(name="Joey", email="[email protected]", job_title="Personal Trainer")
gym1.create_staff(name="Rosa", email="[email protected]", job_title="Nutritionist")

gym1.create_member(trial_member1)
gym1.create_member(regular_member1)
gym1.create_member(premium_member1)

# CREATE A CLASS FOR GYM
bench_press_class = ClassesController()
bench_press_class.create_class("Bench Press Class", "28/12/24", 10,
teacher=personal_trainer, location= strength_zone)

bench_press_class.add_attendee(premium_member1)
bench_press_class.add_attendee(regular_member1)

#bench_press_class.read_class()
gym1.create_class(bench_press_class.model)

# GYM 2 DATA ;

# MEMBER CREATION
trial_member2 = member_controller.create_trial_member(name="Derek",
email="[email protected]",
phone_number="7949957763",
Expand All @@ -200,29 +164,79 @@ def create_gym_data():
username="DavidMalt",
password="TechCEO!")

list_of_members = [trial_member1, trial_member2, regular_member1, regular_member2, premium_member1, premium_member2]

return list_of_members

def create_gym_data():

members = create_member_data()
workout_zones = create_workout_zone_data()

# GYM 1 DATA ;

# GYM CREATION
gym1 = GymController()
gym1.create_manager(name="Esat",username="AdminEsat", password="Admin1000!")

# STAFF CREATION
personal_trainer = gym1.create_staff(name="Joey", email="[email protected]", job_title="Personal Trainer")
gym1.create_staff(name="Rosa", email="[email protected]", job_title="Nutritionist")

# MEMBER ADDITION
gym1.create_member(members[0])
gym1.create_member(members[2])
gym1.create_member(members[4])

# WORKOUT ZONE ADDITION
gym1.add_workout_zone(workout_zones[0])
gym1.add_workout_zone(workout_zones[1])
gym1.add_workout_zone(workout_zones[2])
gym1.add_workout_zone(workout_zones[4])

# CREATE A CLASS FOR GYM
bench_press_class = ClassesController()
bench_press_class.create_class("Bench Press Class", "28/12/24", 10,
teacher=personal_trainer, location= workout_zones[0])

bench_press_class.add_attendee(members[2])
bench_press_class.add_attendee(members[4])

gym1.create_class(bench_press_class.model)

# GYM 2 DATA ;

# GYM CREATION
gym2 = GymController()
gym2.model.set_gym_city("Manchester")
gym2.create_manager(name="Zak", username="ZakAfron", password="KittyCat!")

# STAFF CREATION
personal_trainer2 = gym2.create_staff(name="Jocy", email="[email protected]", job_title="Personal Trainer")
gym2.create_staff(name="Bob", email="[email protected]", job_title="Nutritionist")

gym2.create_member(trial_member2)
gym2.create_member(regular_member2)
gym2.create_member(premium_member2)
# MEMBER ADDITION
gym2.create_member(members[1])
gym2.create_member(members[3])
gym2.create_member(members[5])

# WORKOUT ZONE ADDITION
gym1.add_workout_zone(workout_zones[0])
gym1.add_workout_zone(workout_zones[1])
gym1.add_workout_zone(workout_zones[2])
gym1.add_workout_zone(workout_zones[3])
gym1.add_workout_zone(workout_zones[5])

# CLASS CREATION
cardio_class = ClassesController()
cardio_class.create_class(name="Cardio Class",
date="01/01/2025",
capacity=15,
teacher=personal_trainer2,
location=cardio_zone)
location=workout_zones[1])

cardio_class.add_attendee(regular_member2)
cardio_class.add_attendee(premium_member2)
cardio_class.add_attendee(members[3])
cardio_class.add_attendee(members[5])

gym2.create_class(cardio_class.model)

Expand Down
3 changes: 3 additions & 0 deletions src/controller/gym_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ def create_workout_zone(self, type: str, capacity: int, attendant: StaffModel, l

return workout_zone

def add_workout_zone(self, workout_zone: WorkoutZoneModel):
self.model.add_workout_zone(workout_zone)

def create_staff(self, name: str, email: str, job_title: str) -> StaffModel:
staff_controller = StaffController()
staff = staff_controller.create_staff(name, email, job_title)
Expand Down
4 changes: 2 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from src.config import create_data
from src.config import create_gym_data
from src.view.tkinter.tk_controller import TkController


def main():

# TKINTER
app = TkController(create_data())
app = TkController(create_gym_data())
app.start()

# IDEA pick gym when registering and not in log in
Expand Down

0 comments on commit f7fd2bf

Please sign in to comment.