-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: add new routes for contract and contract-modifications
- Loading branch information
1 parent
f610544
commit e8dbf70
Showing
34 changed files
with
317 additions
and
69 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/main/java/dev/urner/volodb/converter/AddressStatusConverter.java
This file contains 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
19 changes: 19 additions & 0 deletions
19
src/main/java/dev/urner/volodb/dao/ContractModificationDAO.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package dev.urner.volodb.dao; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.data.repository.ListCrudRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import dev.urner.volodb.entity.ContractModification; | ||
|
||
@Repository | ||
public interface ContractModificationDAO extends ListCrudRepository<ContractModification, Integer> { | ||
|
||
List<ContractModification> findAll(); | ||
|
||
ContractModification findById(int id); | ||
|
||
List<ContractModification> findAllByContractId(int contractId); | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package dev.urner.volodb.dao; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.data.repository.ListCrudRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import dev.urner.volodb.entity.Salary; | ||
|
||
@Repository | ||
public interface ContractSalaryDAO extends ListCrudRepository<Salary, Integer> { | ||
|
||
List<Salary> findAll(); | ||
|
||
Salary findById(int id); | ||
|
||
} |
59 changes: 59 additions & 0 deletions
59
src/main/java/dev/urner/volodb/entity/ContractModification.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package dev.urner.volodb.entity; | ||
|
||
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
import java.util.Map; | ||
|
||
import dev.urner.volodb.converter.HashMapConverter; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Convert; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.Table; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Entity | ||
@Table(name = "ContractModification") | ||
@Getter | ||
@Setter | ||
@RequiredArgsConstructor | ||
public class ContractModification { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
private int id; | ||
|
||
@Column(name = "timestamp") | ||
private LocalDateTime timestamp; | ||
|
||
// status (ContractModificationStatus) -> FK | ||
@ManyToOne | ||
@JoinColumn(name = "status") | ||
private ContractModificationStatus status; | ||
|
||
// contract -> FK | ||
@Column(name = "contract") | ||
private int contractId; | ||
|
||
// type (contractModificationType) -> FK | ||
@ManyToOne | ||
@JoinColumn(name = "type") | ||
private ContractModificationType type; | ||
|
||
// into_force_from (Date) | ||
@Column | ||
private LocalDate intoForceFrom; | ||
|
||
// value (JSON) | ||
@Column | ||
private String value; | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/dev/urner/volodb/entity/ContractModificationStatus.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package dev.urner.volodb.entity; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.Table; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Entity | ||
@Table(name = "ContractModificationStatus") | ||
@Getter | ||
@Setter | ||
@RequiredArgsConstructor | ||
public class ContractModificationStatus { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
private int id; | ||
|
||
@Column | ||
private String name; | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/dev/urner/volodb/entity/ContractModificationType.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package dev.urner.volodb.entity; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.Table; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Entity | ||
@Table(name = "ContractModificationType") | ||
@Getter | ||
@Setter | ||
@RequiredArgsConstructor | ||
public class ContractModificationType { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
private int id; | ||
|
||
@Column | ||
private String name; | ||
} |
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
...entity/AddressInvalidFormatException.java → ...eption/AddressInvalidFormatException.java
This file contains 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
2 changes: 1 addition & 1 deletion
2
...ntity/AddressStatusNotFoundException.java → ...ption/AddressStatusNotFoundException.java
This file contains 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
2 changes: 1 addition & 1 deletion
2
.../entity/ContactTypeNotFoundException.java → ...ception/ContactTypeNotFoundException.java
This file contains 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
7 changes: 7 additions & 0 deletions
7
src/main/java/dev/urner/volodb/exception/ContractModificationNotFoundException.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package dev.urner.volodb.exception; | ||
|
||
public class ContractModificationNotFoundException extends RuntimeException { | ||
public ContractModificationNotFoundException(String message) { | ||
super(message); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/dev/urner/volodb/exception/ContractNotFoundException.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package dev.urner.volodb.exception; | ||
|
||
public class ContractNotFoundException extends RuntimeException { | ||
public ContractNotFoundException(String message) { | ||
super(message); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...lodb/entity/CountryNotFoundException.java → ...b/exception/CountryNotFoundException.java
This file contains 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
2 changes: 1 addition & 1 deletion
2
...entity/ProjectInvalidFormatException.java → ...eption/ProjectInvalidFormatException.java
This file contains 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
2 changes: 1 addition & 1 deletion
2
...lodb/entity/ProjectNotFoundException.java → ...b/exception/ProjectNotFoundException.java
This file contains 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
2 changes: 1 addition & 1 deletion
2
.../volodb/entity/UserNotFoundException.java → ...lodb/exception/UserNotFoundException.java
This file contains 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
2 changes: 1 addition & 1 deletion
2
...tity/VolunteerInvalidFormatException.java → ...tion/VolunteerInvalidFormatException.java
This file contains 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
2 changes: 1 addition & 1 deletion
2
...db/entity/VolunteerNotFoundException.java → ...exception/VolunteerNotFoundException.java
This file contains 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
2 changes: 1 addition & 1 deletion
2
.../VolunteerNoteInvalidFormatException.java → .../VolunteerNoteInvalidFormatException.java
This file contains 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
2 changes: 1 addition & 1 deletion
2
...ntity/VolunteerNoteNotFoundException.java → ...ption/VolunteerNoteNotFoundException.java
This file contains 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
This file contains 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
32 changes: 0 additions & 32 deletions
32
src/main/java/dev/urner/volodb/rest/ContractRestController.java
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.