diff --git a/pom.xml b/pom.xml
index d2546d4..106a3a0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,20 +12,7 @@
DMS
0.0.1-SNAPSHOT
DMS
- Demo project for Spring Boot
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Dealer management system for an independent auto repair shop
21
@@ -34,11 +21,6 @@
org.springframework.boot
spring-boot-starter-data-jpa
-
- org.postgresql
- postgresql
- runtime
-
org.springframework.boot
spring-boot-starter-thymeleaf
@@ -73,11 +55,6 @@
spring-security-test
test
-
-
-
-
-
org.springframework.boot
spring-boot-starter-validation
@@ -93,23 +70,11 @@
thymeleaf-extras-springsecurity6
-
- com.github.javafaker
- javafaker
- 0.15
-
-
com.microsoft.sqlserver
mssql-jdbc
runtime
-
-
- org.postgresql
- postgresql
- runtime
-
diff --git a/src/main/java/com/heftyb/dms/account/services/PayPeriodServiceImp.java b/src/main/java/com/heftyb/dms/account/services/PayPeriodServiceImp.java
index 0c0f68f..ad1d500 100644
--- a/src/main/java/com/heftyb/dms/account/services/PayPeriodServiceImp.java
+++ b/src/main/java/com/heftyb/dms/account/services/PayPeriodServiceImp.java
@@ -71,14 +71,6 @@ private Date addDays(Date date, int amount) {
d.setTime(date);
d.add(Calendar.DAY_OF_MONTH, amount);
return d.getTime();
-
-// return Date.from(
-// date
-// .toInstant()
-// .atZone(ZoneId.systemDefault())
-// .plus(period)
-// .toInstant()
-// );
}
private Date subtractDays(Date date, int amount) {
@@ -88,14 +80,6 @@ private Date subtractDays(Date date, int amount) {
d.add(Calendar.DAY_OF_MONTH, amount * -1);
return d.getTime();
-
-// return Date.from(
-// date
-// .toInstant()
-// .atZone(ZoneId.systemDefault())
-// .minus(period)
-// .toInstant()
-// );
}
@Override
@@ -106,11 +90,6 @@ public PayPeriod getCurrentPayPeriod() {
.filter(p -> isPayPeriodCurrent(p))
.collect(Collectors.toList());
-// System.out.println(String.format("periods before: %s", periods));
-
-// periods = periods.stream().filter(p -> isPayPeriodCurrent(p)).collect(Collectors.toList());
-
-// System.out.println(String.format("periods after: %s", periods));
if (periods.size() < 1) {
throw new ResourceFoundException("Error: Could not get current PayPeriod!");
}
diff --git a/src/main/java/com/heftyb/dms/account/statement/StatementItem.java b/src/main/java/com/heftyb/dms/account/statement/StatementItem.java
index 95d0f4c..8d42b4a 100644
--- a/src/main/java/com/heftyb/dms/account/statement/StatementItem.java
+++ b/src/main/java/com/heftyb/dms/account/statement/StatementItem.java
@@ -109,28 +109,6 @@ public void setStatus(StatementStatus status) {
this.status = status;
}
-// private int numberOfDaysInvoiceIsPastDue() {
-// return (int) Duration.between(Date, ZonedDateTime.now()).toDaysPart();
-// }
-
-// private double calculateFinanceFee() {
-//
-// int pastDue = numberOfDaysInvoiceIsPastDue();
-//
-// StatementStatusRate statusRate = pastDue < 180 ? invoice.getTerms().getStatusRates().stream().filter(r -> r.getStatus() == StatementRateType.MONTHLY).collect(Collectors.toList()).getFirst() :
-// invoice.getTerms().getStatusRates().stream().filter(r -> r.getStatus() == StatementRateType.ANNUAL).collect(Collectors.toList()).getFirst();
-//
-// if ( statusRate.getStatus() == StatementRateType.MONTHLY ) {
-// int months due
-// } else {
-//
-// }
-
- /**
- *
- *
- * TODO: calculate finance charge per interval
- */
-// return null;
-// }
+ // TODO: calculate the finance charge per interval, from the days the invoice is past due and
+ // the invoice terms' status rates: the monthly rate under 180 days, the annual rate after.
}
diff --git a/src/main/java/com/heftyb/dms/config/WebSecurityConfig.java b/src/main/java/com/heftyb/dms/config/WebSecurityConfig.java
index fa5b296..61e5b86 100644
--- a/src/main/java/com/heftyb/dms/config/WebSecurityConfig.java
+++ b/src/main/java/com/heftyb/dms/config/WebSecurityConfig.java
@@ -17,10 +17,6 @@
@EnableMethodSecurity
public class WebSecurityConfig {
-// private final UserDetailsService userDetailsService;
-//
-// public WebSecurityConfig(final UserDetailsService userDetailsService) {this.userDetailsService = userDetailsService;}
-
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http
diff --git a/src/main/java/com/heftyb/dms/crm/services/VendorServiceImp.java b/src/main/java/com/heftyb/dms/crm/services/VendorServiceImp.java
index 13f7290..a51b1b7 100644
--- a/src/main/java/com/heftyb/dms/crm/services/VendorServiceImp.java
+++ b/src/main/java/com/heftyb/dms/crm/services/VendorServiceImp.java
@@ -66,12 +66,6 @@ public Vendor update(Vendor vendor) {
if (vendor.getTaxId() != null) v.setTaxId(vendor.getTaxId());
if (vendor.getPaymentMethod() != null) v.setPaymentMethod(vendor.getPaymentMethod());
-// if (vendor.getSentPurchaseOrders() != null
-// || vendor.getReceivedPurchaseOrders() != null
-// || vendor.getInvoices() != null) {
-// throw new ResourceFoundException("Error: Could not update vendor!");
-// }
-
return vendorRepository.save(v);
}
diff --git a/src/main/java/com/heftyb/dms/repairorder/services/WorkOrderJobServiceImp.java b/src/main/java/com/heftyb/dms/repairorder/services/WorkOrderJobServiceImp.java
index c22c0db..50b8386 100644
--- a/src/main/java/com/heftyb/dms/repairorder/services/WorkOrderJobServiceImp.java
+++ b/src/main/java/com/heftyb/dms/repairorder/services/WorkOrderJobServiceImp.java
@@ -19,16 +19,13 @@ public class WorkOrderJobServiceImp implements WorkOrderJobService {
private final WorkOrderJobRepository jobRepo;
private final RepairOrderService roService;
-// private final TimeClockService timeClockService;
private final TechnicianFlatRateHourService technicianFlatRateHourService;
public WorkOrderJobServiceImp(final WorkOrderJobRepository workOrderJobRepository,
final RepairOrderService repairOrderService,
-// final TimeClockService timeClockService,
final TechnicianFlatRateHourService technicianFlatRateHourService) {
jobRepo = workOrderJobRepository;
roService = repairOrderService;
-// this.timeClockService = timeClockService;
this.technicianFlatRateHourService = technicianFlatRateHourService;
}
@@ -80,26 +77,7 @@ public WorkOrderJob update(WorkOrderJob job) {
j.setStatus(job.getStatus());
- // updated through parts service
-// for (WorkOrderJobPart part : job.getParts()) {
-// part.setJob(j);
-// j.getParts().add(part);
-// }
-
- // updated through timeservice
-// for (JobTimePunchSet punchSet : job.getTimeClockPunchSets()) {
-// JobTimePunchSet ps = timeClockService.findJobTimePunchSetById(punchSet.getId());
-// ps.setJob(j);
-// j.getTimeClockPunchSets().add(ps);
-// }
-
- // updated through pay service
-// for (TechnicianFlatRateHour flatRateHour : job.getLabor()) {
-// TechnicianFlatRateHour frh = technicianFlatRateHourService.findById(flatRateHour.getId());
-// frh.setJob(j);
-// j.getLabor().add(frh);
-// }
-
+ // parts, job time punches and labor hours are updated through their own services
j.setMiscItems(job.getMiscItems());
return jobRepo.save(j);
diff --git a/src/main/java/com/heftyb/dms/timekeeping/controllers/TimeClockController.java b/src/main/java/com/heftyb/dms/timekeeping/controllers/TimeClockController.java
index d36e557..c6e24fe 100644
--- a/src/main/java/com/heftyb/dms/timekeeping/controllers/TimeClockController.java
+++ b/src/main/java/com/heftyb/dms/timekeeping/controllers/TimeClockController.java
@@ -17,7 +17,6 @@
import java.security.Principal;
import java.text.ParseException;
-import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
@@ -92,7 +91,6 @@ public String clockOut(@RequestParam TimePunchCode code, Principal principal) {
@GetMapping({"/punches", "/punches/"})
public String getDatesPunches(@RequestParam String date, Principal principal, ModelMap model) throws ParseException {
User u = userService.findUserByUsername(principal.getName());
-// SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd");
List punchSets = timeClockService
.findCurrentUsersTimeClockPunchSetsByDate(principal.getName(), LocalDate.parse(date));
diff --git a/src/main/java/com/heftyb/dms/validation/PasswordConstraintValidator.java b/src/main/java/com/heftyb/dms/validation/PasswordConstraintValidator.java
index 4c585ee..d8f2e60 100644
--- a/src/main/java/com/heftyb/dms/validation/PasswordConstraintValidator.java
+++ b/src/main/java/com/heftyb/dms/validation/PasswordConstraintValidator.java
@@ -23,12 +23,6 @@ public boolean isValid(final String password, final ConstraintValidatorContext c
// @formatter:off
final PasswordValidator validator = new PasswordValidator(Arrays.asList(
new LengthRule(8, 30),
-// new UppercaseCharacterRule(1),
-// new DigitCharacterRule(1),
-// new SpecialCharacterRule(1),
-// new NumericalSequenceRule(3,false),
-// new AlphabeticalSequenceRule(3,false),
-// new QwertySequenceRule(3,false),
new WhitespaceRule()));
final RuleResult result = validator.validate(new PasswordData(password));
if (result.isValid()) {
diff --git a/src/main/resources/static/oil.jpg b/src/main/resources/static/oil.jpg
index 6b4c062..bb60fa5 100644
Binary files a/src/main/resources/static/oil.jpg and b/src/main/resources/static/oil.jpg differ
diff --git a/src/main/resources/templates/appointments.html b/src/main/resources/templates/appointments.html
index 2c6b928..dd641fa 100644
--- a/src/main/resources/templates/appointments.html
+++ b/src/main/resources/templates/appointments.html
@@ -3,7 +3,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -646,6 +632,5 @@
[[${role.role}]]
-