Skip to content

Commit 6c08875

Browse files
committed
Seed enough demo resources for paging and scroll testing
1 parent b6a7c6c commit 6c08875

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

backend/src/main/java/com/thughari/jobtrackerpro/service/CareerResourceService.java

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
public class CareerResourceService {
2929

3030
private static final int MAX_PAGE_SIZE = 50;
31+
private static final int DEMO_MIN_RESOURCE_COUNT = 60;
3132

3233
private final CareerResourceRepository resourceRepository;
3334
private final UserRepository userRepository;
@@ -192,15 +193,43 @@ public void deleteResource(String email, java.util.UUID resourceId) {
192193

193194
@PostConstruct
194195
public void seedStarterResources() {
195-
if (resourceRepository.count() > 0) {
196-
return;
197-
}
198-
199196
addSeedResource("Career Preparation Notes", "https://docs.google.com/document/d/1-25JrPUai6P7pjKk1g7mELpI0YUINS_NpjUk7lsMfyg/edit?tab=t.0#heading=h.kf8l3f8jftc2", "Guides & Study Docs");
200197
addSeedResource("Main Career Resources Folder", "https://drive.google.com/drive/folders/1ISp9GBv7ih1blEQOPYplD_idG1j0ibGq?usp=sharing", "Drive Folders & File Packs");
201198
addSeedResource("DSA Folder", "https://drive.google.com/drive/folders/1ei52Zc_cQe0rJK404M56BmEisUjnF6kN?usp=drive_link", "Drive Folders & File Packs");
202199
addSeedResource("21 Days React Study Plan", "https://thecodedose.notion.site/21-Days-React-Study-Plan-1988ff023cae48459bae8cb20cb75a67", "Structured Learning");
203200
addSeedResource("Opportunity Tracker Sheet", "https://docs.google.com/spreadsheets/d/1KBFiqJTaFY1164XtglKvn2vAofScCfGlkY-n54D2d14/edit?gid=584790886#gid=584790886", "Trackers & Opportunity Sheets");
201+
202+
seedDemoVolumeResources();
203+
}
204+
205+
private void seedDemoVolumeResources() {
206+
long currentCount = resourceRepository.count();
207+
if (currentCount >= DEMO_MIN_RESOURCE_COUNT) {
208+
return;
209+
}
210+
211+
String[][] templates = {
212+
{"React Interview Drill", "https://example.com/resources/react-interview-drill", "Interview Prep"},
213+
{"DSA Patterns Workbook", "https://example.com/resources/dsa-patterns-workbook", "DSA"},
214+
{"System Design Primer", "https://example.com/resources/system-design-primer", "System Design"},
215+
{"Resume Bullet Bank", "https://example.com/resources/resume-bullet-bank", "Resume"},
216+
{"Backend Fundamentals Roadmap", "https://example.com/resources/backend-fundamentals-roadmap", "Roadmaps"},
217+
{"Frontend Fundamentals Roadmap", "https://example.com/resources/frontend-fundamentals-roadmap", "Roadmaps"},
218+
{"Mock Interview Checklist", "https://example.com/resources/mock-interview-checklist", "Mock Interviews"},
219+
{"Job Board Tracker", "https://example.com/resources/job-board-tracker", "Job Boards"},
220+
{"Behavioral Question Matrix", "https://example.com/resources/behavioral-question-matrix", "Interview Prep"},
221+
{"Portfolio Project Ideas", "https://example.com/resources/portfolio-project-ideas", "Portfolio"}
222+
};
223+
224+
long resourcesToAdd = DEMO_MIN_RESOURCE_COUNT - currentCount;
225+
for (int i = 0; i < resourcesToAdd; i++) {
226+
String[] template = templates[i % templates.length];
227+
String title = template[0] + " #" + (i + 1);
228+
String url = template[1] + "?v=" + (i + 1);
229+
String category = template[2];
230+
231+
addSeedResource(title, url, category);
232+
}
204233
}
205234

206235
private void addSeedResource(String title, String url, String category) {

0 commit comments

Comments
 (0)