Changeset c4c43f3
- Timestamp:
- 04/20/26 19:04:21 (3 months ago)
- Branches:
- master
- Children:
- 37307aa
- Parents:
- 6fa5831
- Files:
-
- 1 added
- 6 edited
-
backend/HELP.md (modified) (1 diff)
-
backend/docs/Normalization.txt (added)
-
backend/src/main/java/com/trekr/backend/entity/discipline/CustomTrackingCategory.java (modified) (2 diffs)
-
backend/src/main/java/com/trekr/backend/entity/discipline/DisciplineUser.java (modified) (2 diffs)
-
backend/src/main/java/com/trekr/backend/entity/training/TrainingSession.java (modified) (3 diffs)
-
db-scripts/ddl.sql (modified) (3 diffs)
-
db-scripts/dml.sql (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
backend/HELP.md
r6fa5831 rc4c43f3 1 1 # Getting Started 2 3 ### Project Documentation 4 5 * [Normalization (Phase P5)](docs/Normalization.txt) 2 6 3 7 ### Reference Documentation -
backend/src/main/java/com/trekr/backend/entity/discipline/CustomTrackingCategory.java
r6fa5831 rc4c43f3 28 28 private String name; 29 29 30 @Column(name = "num_tasks")31 private Integer numTasks;32 33 @Column(name = "tasks")34 private String tasks;35 36 30 public CustomTrackingCategory() { 37 31 } … … 60 54 this.name = name; 61 55 } 62 63 public Integer getNumTasks() {64 return numTasks;65 }66 67 public void setNumTasks(Integer numTasks) {68 this.numTasks = numTasks;69 }70 71 public String getTasks() {72 return tasks;73 }74 75 public void setTasks(String tasks) {76 this.tasks = tasks;77 }78 56 } -
backend/src/main/java/com/trekr/backend/entity/discipline/DisciplineUser.java
r6fa5831 rc4c43f3 24 24 private User user; 25 25 26 @Column(name = "num_tasks")27 private Integer numTasks;28 29 @Column(name = "tasks")30 private String tasks;31 32 26 public DisciplineUser() { 33 27 } … … 48 42 this.user = user; 49 43 } 50 51 public Integer getNumTasks() {52 return numTasks;53 }54 55 public void setNumTasks(Integer numTasks) {56 this.numTasks = numTasks;57 }58 59 public String getTasks() {60 return tasks;61 }62 63 public void setTasks(String tasks) {64 this.tasks = tasks;65 }66 44 } -
backend/src/main/java/com/trekr/backend/entity/training/TrainingSession.java
r6fa5831 rc4c43f3 1 1 package com.trekr.backend.entity.training; 2 2 3 import com.trekr.backend.entity.weight.WeightUser;4 3 import jakarta.persistence.Column; 5 4 import jakarta.persistence.Entity; … … 27 26 @JoinColumn(name = "training_user_id") 28 27 private TrainingUser trainingUser; 29 30 @ManyToOne(fetch = FetchType.LAZY)31 @JoinColumn(name = "weight_user_id")32 private WeightUser weightUser;33 28 34 29 @Column(name = "duration") … … 63 58 } 64 59 65 public WeightUser getWeightUser() {66 return weightUser;67 }68 69 public void setWeightUser(WeightUser weightUser) {70 this.weightUser = weightUser;71 }72 60 73 61 public BigDecimal getDuration() { -
db-scripts/ddl.sql
r6fa5831 rc4c43f3 73 73 training_user_id BIGINT 74 74 REFERENCES TRAINING_USERS(user_id) ON DELETE CASCADE, 75 weight_user_id BIGINT76 REFERENCES WEIGHT_USERS(user_id) ON DELETE CASCADE,77 75 duration NUMERIC, 78 76 calories NUMERIC, … … 83 81 CREATE TABLE DISCIPLINE_USERS ( 84 82 user_id BIGINT PRIMARY KEY 85 REFERENCES USERS(user_id) ON DELETE CASCADE, 86 num_tasks INTEGER, 87 tasks TEXT 83 REFERENCES USERS(user_id) ON DELETE CASCADE 88 84 ); 89 85 … … 92 88 user_id BIGINT 93 89 REFERENCES USERS(user_id) ON DELETE CASCADE, 94 name TEXT NOT NULL, 95 num_tasks INTEGER, 96 tasks TEXT 90 name TEXT NOT NULL 97 91 ); 98 92 -
db-scripts/dml.sql
r6fa5831 rc4c43f3 192 192 ); 193 193 194 INSERT INTO TRAINING_SESSIONS (training_id, training_user_id, weight_user_id,duration, calories, date, type) VALUES195 (1, 1, 1,60, 500, '2026-02-01', 'Running'),196 (2, 2, 2,45, 400, '2026-02-01', 'Cycling'),197 (3, 3, 3 , 30, 300, '2026-02-01', 'Swimming'),198 (4, 4, 4,50, 420, '2026-02-02', 'HIIT'),199 (5, 5, 5,40, 350, '2026-02-02', 'Strength'),200 (6, 6, 6,35, 280, '2026-02-02', 'Yoga'),201 (7, 7, 7,55, 520, '2026-02-03', 'Running'),202 (8, 8, 8,45, 390, '2026-02-03', 'Cycling'),203 (9, 9, 9,30, 260, '2026-02-03', 'Rowing'),204 (10, 10, 10,60, 480, '2026-02-04', 'Swimming'),205 (11, 11, 11,50, 430, '2026-02-05', 'Strength'),206 (12, 12, 12,40, 310, '2026-02-05', 'Yoga'),207 (13, 13, 13,60, 540, '2026-02-06', 'Running'),208 (14, 14, 14,35, 260, '2026-02-06', 'Pilates'),209 (15, 15, 15,45, 390, '2026-02-07', 'Cycling'),210 (16, 16, 16,55, 460, '2026-02-07', 'HIIT'),211 (17, 17, 17,30, 240, '2026-02-08', 'Rowing'),212 (18, 18, 18,65, 520, '2026-02-08', 'Swimming'),213 (19, 19, 19,50, 440, '2026-02-09', 'Running'),214 (20, 20, 20,45, 370, '2026-02-09', 'Strength'),215 (21, 11, 11,35, 300, '2026-02-12', 'Cycling'),216 (22, 13, 13,30, 260, '2026-02-12', 'Core'),217 (23, 15, 15,70, 600, '2026-02-13', 'Long Run'),218 (24, 17, 17,40, 320, '2026-02-13', 'Strength');194 INSERT INTO TRAINING_SESSIONS (training_id, training_user_id, duration, calories, date, type) VALUES 195 (1, 1, 60, 500, '2026-02-01', 'Running'), 196 (2, 2, 45, 400, '2026-02-01', 'Cycling'), 197 (3, 3, 30, 300, '2026-02-01', 'Swimming'), 198 (4, 4, 50, 420, '2026-02-02', 'HIIT'), 199 (5, 5, 40, 350, '2026-02-02', 'Strength'), 200 (6, 6, 35, 280, '2026-02-02', 'Yoga'), 201 (7, 7, 55, 520, '2026-02-03', 'Running'), 202 (8, 8, 45, 390, '2026-02-03', 'Cycling'), 203 (9, 9, 30, 260, '2026-02-03', 'Rowing'), 204 (10, 10, 60, 480, '2026-02-04', 'Swimming'), 205 (11, 11, 50, 430, '2026-02-05', 'Strength'), 206 (12, 12, 40, 310, '2026-02-05', 'Yoga'), 207 (13, 13, 60, 540, '2026-02-06', 'Running'), 208 (14, 14, 35, 260, '2026-02-06', 'Pilates'), 209 (15, 15, 45, 390, '2026-02-07', 'Cycling'), 210 (16, 16, 55, 460, '2026-02-07', 'HIIT'), 211 (17, 17, 30, 240, '2026-02-08', 'Rowing'), 212 (18, 18, 65, 520, '2026-02-08', 'Swimming'), 213 (19, 19, 50, 440, '2026-02-09', 'Running'), 214 (20, 20, 45, 370, '2026-02-09', 'Strength'), 215 (21, 11, 35, 300, '2026-02-12', 'Cycling'), 216 (22, 13, 30, 260, '2026-02-12', 'Core'), 217 (23, 15, 70, 600, '2026-02-13', 'Long Run'), 218 (24, 17, 40, 320, '2026-02-13', 'Strength'); 219 219 220 220 SELECT setval( … … 223 223 ); 224 224 225 INSERT INTO DISCIPLINE_USERS (user_id , num_tasks, tasks) VALUES226 (1 , 2, '["Morning Run","Read Book"]'),227 (2 , 1, '["Meditation"]'),228 (3 , 3, '["Plan Day","No Sugar","Stretch"]'),229 (4 , 2, '["Drink Water","Walk 8k Steps"]'),230 (5 , 2, '["Journal","Gym"]'),231 (6 , 1, '["Study 1h"]'),232 (7 , 2, '["Stretch 10m","No Soda"]'),233 (8 , 2, '["Walk 30m","Sleep 7h"]'),234 (9 , 3, '["Read 20p","Meditate","No Sugar"]'),235 (10 , 1, '["Drink Water"]'),236 (11 , 3, '["Morning Run","Plan Day","Study 1h"]'),237 (12 , 2, '["Yoga","Cook Healthy"]'),238 (13 , 2, '["Gym","Protein Target"]'),239 (14 , 2, '["Journal","Early Bed"]'),240 (15 , 3, '["Duolingo","No Alcohol","Walk 8k Steps"]');241 242 INSERT INTO CUSTOM_TRACKING_CATEGORIES (custom_tracking_id, user_id, name , num_tasks, tasks) VALUES243 (1, 1, 'Project Trekr' , 2, '["Code Review","Push Updates"]'),244 (2, 2, 'Language Learning' , 2, '["Duolingo","Watch Lesson"]'),245 (3, 3, 'Side Hustle' , 3, '["Client Outreach","Build Feature","Invoice"]'),246 (4, 5, 'Fitness Plan' , 2, '["Protein Target","Sleep 8h"]'),247 (5, 6, 'Exam Prep' , 2, '["Practice Problems","Review Notes"]'),248 (6, 11, 'University' , 3, '["Attend Lecture","Solve Tasks","Review"]'),249 (7, 12, 'Health' , 2, '["Steps","Water"]'),250 (8, 13, 'Startup' , 3, '["Pitch","Build","Ship"]'),251 (9, 14, 'Cooking' , 2, '["Meal Prep","Groceries"]'),252 (10, 15, 'Reading List' , 2, '["Read Fiction","Read Nonfiction"]'),253 (11, 16, 'Work Sprint' , 3, '["Standup","Tickets","PR Review"]'),254 (12, 17, 'Finance Goals' , 2, '["Track Expenses","Invest"]'),255 (13, 18, 'Language' , 2, '["Duolingo","Podcast"]'),256 (14, 19, 'Gym Program' , 3, '["Squat","Bench","Deadlift"]'),257 (15, 20, 'Exam Prep' , 3, '["Practice","Mock","Review"]');225 INSERT INTO DISCIPLINE_USERS (user_id) VALUES 226 (1), 227 (2), 228 (3), 229 (4), 230 (5), 231 (6), 232 (7), 233 (8), 234 (9), 235 (10), 236 (11), 237 (12), 238 (13), 239 (14), 240 (15); 241 242 INSERT INTO CUSTOM_TRACKING_CATEGORIES (custom_tracking_id, user_id, name) VALUES 243 (1, 1, 'Project Trekr'), 244 (2, 2, 'Language Learning'), 245 (3, 3, 'Side Hustle'), 246 (4, 5, 'Fitness Plan'), 247 (5, 6, 'Exam Prep'), 248 (6, 11, 'University'), 249 (7, 12, 'Health'), 250 (8, 13, 'Startup'), 251 (9, 14, 'Cooking'), 252 (10, 15, 'Reading List'), 253 (11, 16, 'Work Sprint'), 254 (12, 17, 'Finance Goals'), 255 (13, 18, 'Language'), 256 (14, 19, 'Gym Program'), 257 (15, 20, 'Exam Prep'); 258 258 259 259 SELECT setval(
Note:
See TracChangeset
for help on using the changeset viewer.
