Skip to content

Commit

Permalink
updated versions
Browse files Browse the repository at this point in the history
  • Loading branch information
koldyr committed Sep 28, 2024
1 parent 3a78c49 commit 8930e56
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 14 deletions.
92 changes: 92 additions & 0 deletions model/lineage-domain.plantuml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
@startuml

'top to bottom direction
'skinparam linetype ortho
hide methods

class Lineage {
id: Long
name: String
families: List<Family>
note: String
}

class Family {
id: Long
wife: Person
husband: Person
children: List<Person>
events: List<FamilyEvent>
note: String
}

class Person {
id: Long
gender: Gender
occupation: String
place: String
photo: byte[]
events: List<PersonEvent>
note: String
}
class PersonNames {
first: String
last: String
maiden: String
middle: String
}

class LifeEvent {
id: Long
date: LocalDate
place: String
prefix: EventPrefix
type: EventType
note: String
}
class FamilyEvent
class PersonEvent

enum EventType {
Birth
Death
Engagement
Marriage
Divorce
Adoption
Christening
Relocation
Education
Emigration
GetJob
Graduation
Retirement
Immigration
}

class User {
id: Long
email: String
name: String
password: String
surName: String
roles: List<Role>
}
class Role {
id: Integer
name: String
}

Lineage::families "0..1" ---> "0..*" Family
Lineage "0..*" --> "0..1" User
Family::events "1" <---> "0..*" FamilyEvent
Family "0..1" --> "0..*" Person
Family "0..*" --> "0..1" User
FamilyEvent --^ LifeEvent
Person "0..*" --> "0..1" User
PersonNames -* Person
PersonEvent --^ LifeEvent
Person::events "1" <--> "0..*" PersonEvent
Role "0..*" -> "1" User::roles
LifeEvent::type -> EventType
@enduml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ enum class EventPrefix(
companion object {
fun parse(value: String?): EventPrefix? {
if (value == null) return null
for (prefix in values()) {
for (prefix in entries) {
if (value.contains(prefix.code)) {
return prefix
}
Expand Down
4 changes: 2 additions & 2 deletions model/src/main/kotlin/com/koldyr/genealogy/model/EventType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ enum class EventType(

companion object {
fun isEvent(value: String): Boolean {
for (type in values()) {
for (type in entries) {
if (value.endsWith(type.code) || (value.endsWith(type.name))) return true
}
return false
}

fun parse(value: String): EventType {
for (type in values()) {
for (type in entries) {
if (value.endsWith(type.code) || (value.endsWith(type.name))) return type
}
return Birth
Expand Down
3 changes: 1 addition & 2 deletions model/src/main/kotlin/com/koldyr/genealogy/model/Person.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ class Person() : Cloneable {
@ManyToOne @JoinColumn(name = "USER_ID", nullable = false) @JsonIgnore
var user: User? = null

@Column(name = "LINEAGE_ID")
@JsonIgnore
@Column(name = "LINEAGE_ID") @JsonIgnore
var lineageId: Long? = null

constructor(id: Long) : this() {
Expand Down
4 changes: 4 additions & 0 deletions model/src/main/resources/sql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,17 @@ create sequence SEQ_USER start with 1;
alter table T_LINEAGE
add constraint FK_LINEAGE_USER FOREIGN KEY (USER_ID) REFERENCES T_USER (USER_ID);

alter table T_PERSON
add constraint FK_PERSON_LINEAGE FOREIGN KEY (LINEAGE_ID) REFERENCES T_LINEAGE (LINEAGE_ID);
alter table T_PERSON
add constraint FK_PERSON_PARENT_FAMILY FOREIGN KEY (PARENT_FAMILY_ID) REFERENCES T_FAMILY (FAMILY_ID);
alter table T_PERSON
add constraint FK_PERSON_FAMILY FOREIGN KEY (FAMILY_ID) REFERENCES T_FAMILY (FAMILY_ID);
alter table T_PERSON
add constraint FK_PERSON_USER FOREIGN KEY (USER_ID) REFERENCES T_USER (USER_ID);

alter table T_FAMILY
add constraint FK_FAMILY_LINEAGE FOREIGN KEY (LINEAGE_ID) REFERENCES T_LINEAGE (LINEAGE_ID);
alter table T_FAMILY
add constraint FK_FAMILY_HUSBAND FOREIGN KEY (HUSBAND_ID) REFERENCES T_PERSON (PERSON_ID);
alter table T_FAMILY
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
<maven.compiler.target>21</maven.compiler.target>
<kotlin.version>2.0.0</kotlin.version>

<spring.boot.version>3.3.0</spring.boot.version>
<spring.version>6.1.8</spring.version>
<spring.security.version>6.3.0</spring.security.version>
<jackson.version>2.17.1</jackson.version>
<spring.boot.version>3.3.4</spring.boot.version>
<spring.version>6.1.13</spring.version>
<spring.security.version>6.3.3</spring.security.version>
<jackson.version>2.18.0</jackson.version>
<java-jwt.version>4.1.0</java-jwt.version>
<springdoc-openapi.version>2.3.0</springdoc-openapi.version>
<springdoc-openapi.version>2.6.0</springdoc-openapi.version>
</properties>

<modules>
Expand Down Expand Up @@ -73,13 +73,13 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.12</version>
<version>2.0.16</version>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.10.2</version>
<version>5.11.1</version>
<scope>test</scope>
</dependency>

Expand Down
4 changes: 2 additions & 2 deletions webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.0.0</version>
<version>6.1.0</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -94,7 +94,7 @@
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.10.2</version>
<version>5.11.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down

0 comments on commit 8930e56

Please sign in to comment.