Conversation
…thorization, and CORS, and introduce a new vehicle management API.
… Boot backend application.
… check start period
There was a problem hiding this comment.
Pull request overview
This PR adds deployment infrastructure (Dockerfile, GitHub Actions CI/CD workflow, ECS task definition) for the CrimeLink Analyzer backend, along with new weapon request management features and several configuration changes for production readiness.
Changes:
- Adds Docker multi-stage build, GitHub Actions deploy workflow (ECR → ECS Fargate), and ECS task definition template
- Introduces a new WeaponRequest feature (entity, DTO, mapper, repository, service, controller) and new weapon issue/history endpoints
- Updates configuration: removes localhost defaults for Python microservice URLs, centralizes CORS config, adds HikariCP
prepareThreshold=0fix, and removes hardcoded@CrossOriginannotations
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/deploy.yml |
New CI/CD pipeline: build Docker image, push to ECR, deploy to ECS Fargate |
Dockerfile |
Multi-stage Docker build (Maven → JRE 21 Alpine) with non-root user |
aws/ecs-task-def.json |
ECS Fargate task definition template with secrets from SSM |
.dockerignore |
Docker build context exclusions |
.env.example |
Updated with all required env vars and example values |
application.properties |
Removes localhost defaults for Python URLs, adds CORS and HikariCP config |
SecurityConfig.java |
Configurable CORS origins from env var; changes /api/weapon/** to permitAll() |
WeaponRequest.java |
New JPA entity for weapon requests |
WeaponRequestStatus.java |
New enum (PENDING, APPROVED, REJECTED) |
WeaponRequestDto.java |
New DTO for weapon requests |
WeaponRequestMapper.java |
Mapper between entity and DTO |
WeaponRequestRepository.java |
New JPA repository for weapon requests |
WeaponRequestService.java |
New service interface |
WeaponRequestServiceImpl.java |
Service implementation with CRUD + approve/reject |
WeaponRequestController.java |
New REST controller for weapon requests |
WeaponRepository.java |
New JPQL query for active weapons by officer |
WeaponIssueRepository.java |
New query methods for officer weapon history |
WeaponService.java / WeaponServiceImpl.java |
New method to get weapons issued to officer |
WeaponController.java |
New endpoint for weapons by officer |
WeaponIssueController.java |
New endpoints for issued/history, directly using repository |
VehicleController.java |
Removed hardcoded @CrossOrigin |
UserController.java |
Added missing @GetMapping annotation |
ReqquiredArgsConstructor.java |
Accidental empty annotation with misspelled name |
backend_logs.txt |
Committed log file with sensitive data |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| WHERE wi.issuedTo.userId = :userId | ||
| AND wi.returnedAt IS NULL | ||
| """) | ||
| List<Weapon> findActiveWeaponsByOfficer(@Param("officerId") Integer officerId); |
Comment on lines
+3
to
+5
| public @interface ReqquiredArgsConstructor { | ||
|
|
||
| } |
| // OIC-only routes | ||
| .requestMatchers("/api/duty-schedules/**").hasRole("OIC") | ||
| .requestMatchers("/api/weapon/**").hasRole("OIC") | ||
| .requestMatchers("/api/weapon/**").permitAll() |
Comment on lines
+89
to
+97
| @GetMapping("/issued/{officerId}") | ||
| public List<WeaponIssue> getActiveWeapons(@PathVariable Integer officerId) { | ||
| return weaponIssueRepository.findByIssuedTo_UserIdAndReturnedAtIsNullOrderByIssuedAtDesc(officerId); | ||
| } | ||
|
|
||
| @GetMapping("/history/{officerId}") | ||
| public List<WeaponIssue> getWeaponIssueHistory(@PathVariable Integer officerId) { | ||
| return weaponIssueRepository.findByIssuedTo_UserIdOrderByIssuedAtDesc(officerId); | ||
| } |
Comment on lines
+9
to
+15
|
|
||
| @Repository | ||
| public interface WeaponRequestRepository extends JpaRepository<WeaponRequest, Integer> { | ||
|
|
||
| List<WeaponRequest> findByRequestedBy_UserId(Integer userId); | ||
|
|
||
| List<WeaponRequest> findByStatus(String status); |
Comment on lines
+14
to
+16
| WeaponRequestDto approvedRequest(Integer requestId); | ||
|
|
||
| WeaponRequestDto rejectedRequest(Integer requestId); |
Comment on lines
+89
to
+97
| @GetMapping("/issued/{officerId}") | ||
| public List<WeaponIssue> getActiveWeapons(@PathVariable Integer officerId) { | ||
| return weaponIssueRepository.findByIssuedTo_UserIdAndReturnedAtIsNullOrderByIssuedAtDesc(officerId); | ||
| } | ||
|
|
||
| @GetMapping("/history/{officerId}") | ||
| public List<WeaponIssue> getWeaponIssueHistory(@PathVariable Integer officerId) { | ||
| return weaponIssueRepository.findByIssuedTo_UserIdOrderByIssuedAtDesc(officerId); | ||
| } |
Comment on lines
+92
to
+95
| @GetMapping("/officer/{officerId}") | ||
| public List<Weapon> getWeaponsIssuedToOfficer(@PathVariable Integer officerId) { | ||
| return weaponService.getWeaponsIssuedToOfficer(officerId); | ||
| } |
| return ResponseEntity.ok(requests); | ||
| } | ||
|
|
||
| @GetMapping("user/{userId}") |
iSiRaH
approved these changes
Mar 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.