Skip to content

Commit

Permalink
Merge pull request #50 from januschung/job-note
Browse files Browse the repository at this point in the history
add note field to job application
  • Loading branch information
januschung authored Feb 21, 2025
2 parents 06dc587 + afdc6b5 commit 32cd238
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class JobApplication {
@Column("applied_date")
private LocalDate appliedDate;
private String description;
private String note;
private String status;

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ public class JobApplicationInput {
private LocalDate appliedDate;
private String jobUrl;
private String description;
private String note;
private String status;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class JobApplicationService {
jobApplication.setJobUrl(aji.getJobUrl());
jobApplication.setAppliedDate(aji.getAppliedDate());
jobApplication.setDescription(aji.getDescription());
jobApplication.setNote(aji.getNote());
jobApplication.setStatus(aji.getStatus());
return jobApplication;
};
Expand All @@ -51,6 +52,7 @@ public Mono<JobApplication> updateJobApplication(JobApplication jobApplication)
j.setJobUrl(jobApplication.getJobUrl());
j.setAppliedDate(jobApplication.getAppliedDate());
j.setDescription(jobApplication.getDescription());
j.setNote(jobApplication.getNote());
j.setStatus(jobApplication.getStatus());
return jobApplicationRepository.save(jobApplication).log();
});
Expand Down
25 changes: 13 additions & 12 deletions src/main/resources/demo-data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,22 @@ INSERT INTO job_application (
job_url,
applied_date,
description,
note,
status
)
VALUES
('Acme Corp', 'Software Engineer', '100k-120k', 'https://www.acme.com/jobs/software-engineer', CURRENT_DATE + 10, 'Develop software solutions', 'open'),
('BetaTech', 'Data Scientist', '90k-110k', 'https://www.betatech.com/jobs/data-scientist', CURRENT_DATE + 11, 'Analyze data and provide insights', 'open'),
('Gamma Solutions', 'Product Manager', '120k-140k', 'https://www.gammasolutions.com/jobs/product-manager', CURRENT_DATE + 12, 'Lead product development', 'active'),
('Delta Inc.', 'Web Developer', '80k-100k', 'https://www.deltainc.com/jobs/web-developer', CURRENT_DATE + 13, 'Build responsive websites', 'active'),
('Epsilon LLC', 'HR Specialist', '60k-80k', 'https://www.epsilonllc.com/jobs/hr-specialist', CURRENT_DATE + 14, 'Manage employee relations', 'open'),
('Zeta Group', 'Software Engineer', '95k-115k', 'https://www.zetagroup.com/jobs/software-engineer', CURRENT_DATE + 15, 'Write clean, maintainable code', 'active'),
('Omega Technologies', 'DevOps Engineer', '105k-125k', 'https://www.omegatech.com/jobs/devops-engineer', CURRENT_DATE + 10, 'Automate infrastructure deployment', 'active'),
('Lambda Solutions', 'Business Analyst', '85k-105k', 'https://www.lambdasolutions.com/jobs/business-analyst', CURRENT_DATE + 11, 'Gather and analyze business requirements', 'active'),
('NuTech', 'Data Analyst', '70k-90k', 'https://www.nutech.com/jobs/data-analyst', CURRENT_DATE + 12, 'Create reports and dashboards', 'open'),
('Sigma Enterprises', 'Sales Manager', '100k-120k', 'https://www.sigmaenterprises.com/jobs/sales-manager', CURRENT_DATE + 13, 'Manage sales teams and strategy', 'open'),
('OmegaTech', 'Front-end Developer', '90k-110k', 'https://www.omegatech.com/jobs/front-end-developer', CURRENT_DATE + 14, 'Develop front-end features', 'open'),
('XenoTech', 'Back-end Developer', '100k-120k', 'https://www.xenotech.com/jobs/back-end-developer', CURRENT_DATE + 15, 'Work on back-end server systems', 'rejected');
('Acme Corp', 'Software Engineer', '100k-120k', 'https://www.acme.com/jobs/software-engineer', CURRENT_DATE + 10, 'Develop software solutions', 'Researched company, submitted application, awaiting response', 'open'),
('BetaTech', 'Data Scientist', '90k-110k', 'https://www.betatech.com/jobs/data-scientist', CURRENT_DATE + 11, 'Analyze data and provide insights', 'Had a phone screen, waiting for next steps', 'open'),
('Gamma Solutions', 'Product Manager', '120k-140k', 'https://www.gammasolutions.com/jobs/product-manager', CURRENT_DATE + 12, 'Lead product development', 'Completed first-round interview, preparing for case study', 'active'),
('Delta Inc.', 'Web Developer', '80k-100k', 'https://www.deltainc.com/jobs/web-developer', CURRENT_DATE + 13, 'Build responsive websites', 'Received take-home assignment, in progress', 'active'),
('Epsilon LLC', 'HR Specialist', '60k-80k', 'https://www.epsilonllc.com/jobs/hr-specialist', CURRENT_DATE + 14, 'Manage employee relations', 'Application submitted, no response yet', 'open'),
('Zeta Group', 'Software Engineer', '95k-115k', 'https://www.zetagroup.com/jobs/software-engineer', CURRENT_DATE + 15, 'Write clean, maintainable code', 'Interview scheduled for next week', 'active'),
('Omega Technologies', 'DevOps Engineer', '105k-125k', 'https://www.omegatech.com/jobs/devops-engineer', CURRENT_DATE + 10, 'Automate infrastructure deployment', 'Awaiting feedback from final interview', 'active'),
('Lambda Solutions', 'Business Analyst', '85k-105k', 'https://www.lambdasolutions.com/jobs/business-analyst', CURRENT_DATE + 11, 'Gather and analyze business requirements', 'Networking with employees for referral', 'active'),
('NuTech', 'Data Analyst', '70k-90k', 'https://www.nutech.com/jobs/data-analyst', CURRENT_DATE + 12, 'Create reports and dashboards', 'Submitted application, considering follow-up', 'open'),
('Sigma Enterprises', 'Sales Manager', '100k-120k', 'https://www.sigmaenterprises.com/jobs/sales-manager', CURRENT_DATE + 13, 'Manage sales teams and strategy', 'Contacted recruiter, waiting for response', 'open'),
('OmegaTech', 'Front-end Developer', '90k-110k', 'https://www.omegatech.com/jobs/front-end-developer', CURRENT_DATE + 14, 'Develop front-end features', 'Passed initial screening, interview pending', 'open'),
('XenoTech', 'Back-end Developer', '100k-120k', 'https://www.xenotech.com/jobs/back-end-developer', CURRENT_DATE + 15, 'Work on back-end server systems', 'Rejected after final round, received feedback', 'rejected');

-- Sample interviews data (linked to job applications)
INSERT INTO interview (
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/graphql/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type JobApplication {
jobUrl: String
appliedDate: String
description: String
note: String
status: String
}

Expand Down Expand Up @@ -96,6 +97,7 @@ input JobApplicationInput {
jobUrl: String
appliedDate: String
description: String
note: String
status: String
}

Expand All @@ -107,6 +109,7 @@ input UpdateJobApplicationInput {
jobUrl: String
appliedDate: String
description: String
note: String
status: String
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ create table if not exists job_application(
job_url varchar(200),
applied_date date,
description varchar(500),
note varchar(500),
status varchar(20)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class InterviewControllerTest {

@BeforeEach
void setUp(){
jobApplication = new JobApplication(1, "Company A", "QA", "", "", LocalDate.now(), "", "abc");
jobApplication = new JobApplication(1, "Company A", "QA", "", "", LocalDate.now(), "", "", "abc");
interview1 = new Interview(1, 1, LocalDate.now(), "John Doe", "HR Interview", "scheduled", jobApplication);
interview2 = new Interview(2, 1, LocalDate.now(), "Jane Doe", "Technical Interview", "scheduled", jobApplication);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public class InterviewGraphQlTest {

@BeforeEach
void setUp() {
jobApplication1 = new JobApplication(1, "Company A", "QA", "", "", LocalDate.now(), "", "abc");
jobApplication2 = new JobApplication(2, "Company B", "QA", "", "", LocalDate.now(), "", "open");
jobApplication1 = new JobApplication(1, "Company A", "QA", "", "", LocalDate.now(), "", "", "abc");
jobApplication2 = new JobApplication(2, "Company B", "QA", "", "", LocalDate.now(), "", "", "open");
interview1 = new Interview(1, 1, LocalDate.of(2024, 9, 2), "John Doe", "Technical interview", "scheduled", jobApplication1);
interview2 = new Interview(2, 1, LocalDate.now(), "Jane Doe", "HR interview", "closed", jobApplication1);
interview3 = new Interview(3, 2, LocalDate.now(), "Jane Doe", "HR interview", "scheduled", jobApplication2);
Expand Down Expand Up @@ -116,6 +116,7 @@ void testFindById() {
jobUrl
appliedDate
description
note
status
}
}
Expand Down Expand Up @@ -154,6 +155,7 @@ void testAllInterviewByJobApplicationId() {
jobUrl
appliedDate
description
note
status
}
}
Expand Down Expand Up @@ -192,6 +194,7 @@ void testAllInterviewByJobApplicationIdWhenOnlyOneMatches() {
jobUrl
appliedDate
description
note
status
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ void setUp() {
jobApplication1.setDescription("Description A");
jobApplication1.setSalaryRange("1000-2000");
jobApplication1.setJobUrl("http://companyA.com");
jobApplication1.setNote("whatever");
jobApplication1.setStatus("Applied");

jobApplication2 = new JobApplication();
Expand All @@ -68,6 +69,7 @@ void setUp() {
jobApplication2.setDescription("Description B");
jobApplication2.setSalaryRange("2000-3000");
jobApplication2.setJobUrl("http://companyB.com");
jobApplication2.setNote("whatsoever");
jobApplication2.setStatus("Interview");

jobApplication3 = new JobApplication();
Expand All @@ -78,6 +80,7 @@ void setUp() {
jobApplication3.setDescription("Description C");
jobApplication3.setSalaryRange("1500-2500");
jobApplication3.setJobUrl("http://companyC.com");
jobApplication3.setNote("NA");
jobApplication3.setStatus("Offer");

jobApplicationList = Arrays.asList(jobApplication1, jobApplication2, jobApplication3);
Expand All @@ -90,6 +93,7 @@ void setUp() {
jobApplication4.setDescription("whatever");
jobApplication4.setSalaryRange("100-200");
jobApplication4.setJobUrl("some url");
jobApplication4.setNote("None");
jobApplication4.setStatus("whatever");

jobApplication1_updated = new JobApplication();
Expand All @@ -100,6 +104,7 @@ void setUp() {
jobApplication1_updated.setDescription("whatever");
jobApplication1_updated.setSalaryRange("100-200");
jobApplication1_updated.setJobUrl("some url");
jobApplication1_updated.setNote("some note");
jobApplication1_updated.setStatus("whatever");
}

Expand All @@ -111,7 +116,7 @@ void testAllJobApplication() {
String document = """
query {
allJobApplication {
id, description, jobTitle, jobUrl, status, appliedDate
id, description, jobTitle, jobUrl, status, appliedDate, note
}
}
""";
Expand All @@ -137,7 +142,8 @@ void testAddJobApplication() {
appliedDate:"2023-01-01",
status:"whatever",
jobUrl: "some url",
description: "whatever"
description: "whatever",
note: "some note"
}) {
id, jobTitle, description
}
Expand Down Expand Up @@ -168,7 +174,8 @@ void testUpdateJobApplication() {
appliedDate:"2023-01-01",
status:"whatever",
jobUrl: "some url",
description: "whatever"
description: "whatever",
note: "some note"
}) {
id
companyName
Expand All @@ -178,6 +185,7 @@ void testUpdateJobApplication() {
status
jobUrl
description
note
}
}
""";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class OfferControllerTest {

@BeforeEach
void setUp() {
jobApplication = new JobApplication(1, "Company A", "QA", "", "", LocalDate.now(), "", "abc");
jobApplication = new JobApplication(1, "Company A", "QA", "", "", LocalDate.now(), "", "", "abc");

offer1 = new Offer(1, 1, LocalDate.of(2024, 9, 2), "1", "whatever1", jobApplication);
offer2 = new Offer(2, 1, LocalDate.of(2024, 9, 2), "2", "whatever2", jobApplication);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public class OfferGraphQlTest {

@BeforeEach
void setUp() {
jobApplication1 = new JobApplication(1, "Company A", "QA", "", "", LocalDate.now(), "", "abc");
jobApplication2 = new JobApplication(2, "Company B", "QA", "", "", LocalDate.now(), "", "open");
jobApplication3 = new JobApplication(3, "Company C", "QA", "", "", LocalDate.now(), "", "open");
jobApplication1 = new JobApplication(1, "Company A", "QA", "", "", LocalDate.now(), "", "", "abc");
jobApplication2 = new JobApplication(2, "Company B", "QA", "", "", LocalDate.now(), "", "", "open");
jobApplication3 = new JobApplication(3, "Company C", "QA", "", "", LocalDate.now(), "", "", "open");

offer1 = new Offer(1, 1, LocalDate.of(2024, 9, 2), "1", "whatever1", jobApplication1);
offer2 = new Offer(2, 2, LocalDate.of(2024, 9, 2), "2", "whatever2", jobApplication2);
Expand Down Expand Up @@ -121,6 +121,7 @@ void testOfferByJobApplicationId() {
jobUrl
appliedDate
description
note
status
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class InterviewServiceTest {

@BeforeEach
void setUp() {
jobApplication = new JobApplication(1, "Company A", "QA", "", "", LocalDate.now(), "", "abc");
jobApplication = new JobApplication(1, "Company A", "QA", "", "", LocalDate.now(), "", "", "abc");
interview1 = new Interview(1, 1, LocalDate.now(), "John Doe", "Technical Interview", "scheduled", jobApplication);
interview2 = new Interview(2, 1, LocalDate.now(), "Jane Doe", "HR Interview", "closed", jobApplication);
interviewInput = new InterviewInput(1, LocalDate.now(), "John Doe", "Technical Interview", "scheduled");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ void testMapping() {
input.setJobUrl("https://example.com");
input.setAppliedDate(LocalDate.now());
input.setDescription("whatever");
input.setNote("foo");
input.setStatus("Open");

JobApplication result = jobApplicationService.mapping.apply(input);
Expand All @@ -77,6 +78,7 @@ void testMapping() {
assertEquals(input.getJobUrl(), result.getJobUrl());
assertEquals(input.getAppliedDate(), result.getAppliedDate());
assertEquals(input.getDescription(), result.getDescription());
assertEquals(input.getNote(), result.getNote());
assertEquals(input.getStatus(), result.getStatus());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class OfferServiceTest {

@BeforeEach
void setUp() {
jobApplication1 = new JobApplication(1, "Company A", "QA", "", "", LocalDate.now(), "", "open");
jobApplication2 = new JobApplication(2, "Company A", "QA", "", "", LocalDate.now(), "", "open");
jobApplication1 = new JobApplication(1, "Company A", "QA", "", "", LocalDate.now(), "", "", "open");
jobApplication2 = new JobApplication(2, "Company A", "QA", "", "", LocalDate.now(), "", "", "open");
offer1 = new Offer(1, 1, LocalDate.now(), "1", "whatever1", jobApplication1);
offer2 = new Offer(2, 2, LocalDate.now(), "2", "whatever2", jobApplication2);
offerInput = new OfferInput(1, LocalDate.now(), "1", "whatever1");
Expand Down

0 comments on commit 32cd238

Please sign in to comment.