Skip to content

Feedback#1

Open
github-classroom[bot] wants to merge 76 commits intofeedbackfrom
main
Open

Feedback#1
github-classroom[bot] wants to merge 76 commits intofeedbackfrom
main

Conversation

@github-classroom
Copy link
Contributor

@github-classroom github-classroom bot commented Oct 5, 2024

👋! GitHub Classroom created this pull request as a place for your teacher to leave feedback on your work. It will update automatically. Don’t close or merge this pull request, unless you’re instructed to do so by your teacher.
In this pull request, your teacher can leave comments and feedback on your code. Click the Subscribe button to be notified if that happens.
Click the Files changed or Commits tab to see all of the changes pushed to the default branch since the assignment started. Your teacher can see this too.

Notes for teachers

Use this PR to leave feedback. Here are some tips:

  • Click the Files changed tab to see all of the changes pushed to the default branch since the assignment started. To leave comments on specific lines of code, put your cursor over a line of code and click the blue + (plus sign). To learn more about comments, read “Commenting on a pull request”.
  • Click the Commits tab to see the commits pushed to the default branch. Click a commit to see specific changes.
  • If you turned on autograding, then click the Checks tab to see the results.
  • This page is an overview. It shows commits, line comments, and general comments. You can leave a general comment below.
    For more information about this pull request, read “Leaving assignment feedback in GitHub”.

Subscribed: @jeremymshull @Dlinebe8 @bennyone1

bennyone1 and others added 26 commits October 11, 2024 09:19
bennyone1 and others added 29 commits October 29, 2024 07:13
…nagement

Queueable Class added for Primary contact automation
…nagement

Update Test class and TestDataFactory to take away setting Name field…
…nagement

Queueable Class added for Primary contact automation
…ere-reverted

Jeremys changes that were reverted
changes to layouts and rec types that didnot stick
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great work on this project! I was happy to see the effective collaboration in GitHub and your ability to resolve merges across branches. Your code is very clean and easy to read, which made reviewing a much easier and enjoyable task for me! I think you did a great job accounting for various exception use cases and handling errors accordingly. I think the tests you included were well structured, although I would have preferred to see more coverage for each class. I think you did a great job separating out your logic to make your code more modular. Most of my comments are suggestions for further improvement and just a couple areas where the logic might need to be reviewed. Awesome job, team!

@@ -0,0 +1,31 @@
global class CleanUpStaleJobApplications implements Database.Batchable<SObject>, Database.Stateful {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of having this as a global class so that if you package your application as a managed package your customers can still call to schedule/execute the batch.

FROM Job_Application__c
WHERE Job_Application_Status__c != 'Closed'
AND Job_Application_Status__c != 'Accepted'
AND Follow_up_date__c <= :System.today().addDays(-30)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think filtering on the Follow Up Date is a great alternative to creation date since some Applications might take longer than 30 days to make it through all of the stages. However, it would be good to add some automation around making sure this field gets populated.

@isTest
private class CleanUpStaleJobApplicationsTest {
@isTest
static void testBatchJob() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its good practice to still explicitly declare your test methods 'private' even though they are by default.

@isTest
private class CleanUpStaleJobApplicationsTest {
@isTest
static void testBatchJob() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good positive test case, but you should also have tests for negative and exception paths.

for (Job_Application__c app : updatedApps) {
System.assertEquals('Closed', app.Job_Application_Status__c, 'The status should be updated to Closed for stale applications.');
System.assertEquals('Closed by automated process', app.Notes__c, 'Notes should indicate closure by the automated process.');
System.debug('Updated Application: ' + app.Id + ' Status: ' + app.Job_Application_Status__c);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug can be removed.

// List for salary breakdown (for first section)
get salaryBreakdown() {
return [
{ label: 'Gross Monthly Salary', value: this.monthlyGrossSalary },
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using custom labels for the hardcoded text

@track takeHomePay = 0;

federalTaxBrackets = [
{ limit: 11000, rate: 0.1 },
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider leveraging custom metadata to store tax bracket info so that you can easily update on a yearly basis without needing a code change

let tax = 0;
let remainingIncome = income;

for (let bracket of this.federalTaxBrackets) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to adjust how the limit is subtracted for each bracket here


// Calculate tax-related amounts and take-home pay
calculateTaxLiabilities() {
this.federalIncomeTax = this.calculateFederalIncomeTax(this.annualSalary).toFixed(2);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use toFixed() more sparingly and only round the final calculations

];

handleChange(event) {
this.annualSalary = Number(event.target.value);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add some validation here (i.e. make sure annualSalary is always a positive number)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants