Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions backend/src/main/java/dev/flima/domain/contents/Content.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package dev.flima.domain.contents;

import java.util.UUID;

public class Content {

private UUID id;
private SectionType sectionType;
private SectionContent sectionContent;

public Content(SectionType sectionType, SectionContent sectionContent) {
this.id = UUID.randomUUID();
this.sectionType = sectionType;
this.sectionContent = sectionContent;
}

public Content(UUID id, SectionType sectionType, SectionContent sectionContent) {
this.id = id;
this.sectionType = sectionType;
this.sectionContent = sectionContent;
}

public UUID getId() {
return id;
}

public void setId(UUID id) {
this.id = id;
}

public SectionType getSectionType() {
return sectionType;
}

public void setSectionType(SectionType sectionType) {
this.sectionType = sectionType;
}

public SectionContent getSectionContent() {
return sectionContent;
}

public void setSectionContent(SectionContent sectionContent) {
this.sectionContent = sectionContent;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package dev.flima.domain.contents;

import java.util.List;
import java.util.Optional;
import java.util.UUID;

public interface ContentRepository {
void save(Content content);
void modify(Content content);
Optional<Content> getById(UUID id);
List<Content> getAll();
void remove(Content content);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package dev.flima.domain.contents;

import jakarta.validation.constraints.NotBlank;

public record SectionContent(
@NotBlank(message = "Title cannot be null or empty")
String title,
@NotBlank(message = "Subtitle cannot be null or empty")
String subtitle
) {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package dev.flima.domain.contents;

public enum SectionType {
HOME,
PROJECTS,
EXPERIENCE,
EDUCATION,
CONTACT
}
117 changes: 117 additions & 0 deletions backend/src/main/java/dev/flima/domain/educations/Education.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
package dev.flima.domain.educations;

import java.util.List;
import java.util.UUID;

public class Education {

private UUID id;
private TypeEducation typeEducation;
private String degree;
private String title;
private String institution;
private String period;
private String specialization;
private List<String> skills;
private List<String> architectures;

public Education(TypeEducation typeEducation, String degree, String title, String institution,
String period, String specialization, List<String> skills, List<String> architectures
) {
this.id = UUID.randomUUID();
this.typeEducation = typeEducation;
this.degree = degree;
this.title = title;
this.institution = institution;
this.period = period;
this.specialization = specialization;
this.skills = skills;
this.architectures = architectures;
}

public Education(UUID id, TypeEducation typeEducation, String degree, String title, String institution,
String period, String specialization, List<String> skills, List<String> architectures
) {
this.id = id;
this.typeEducation = typeEducation;
this.degree = degree;
this.title = title;
this.institution = institution;
this.period = period;
this.specialization = specialization;
this.skills = skills;
this.architectures = architectures;
}

public UUID getId() {
return id;
}

public void setId(UUID id) {
this.id = id;
}

public TypeEducation getTypeEducation() {
return typeEducation;
}

public void setTypeEducation(TypeEducation typeEducation) {
this.typeEducation = typeEducation;
}

public String getDegree() {
return degree;
}

public void setDegree(String degree) {
this.degree = degree;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getInstitution() {
return institution;
}

public void setInstitution(String institution) {
this.institution = institution;
}

public String getPeriod() {
return period;
}

public void setPeriod(String period) {
this.period = period;
}

public String getSpecialization() {
return specialization;
}

public void setSpecialization(String specialization) {
this.specialization = specialization;
}

public List<String> getSkills() {
return skills;
}

public void setSkills(List<String> skills) {
this.skills = skills;
}

public List<String> getArchitectures() {
return architectures;
}

public void setArchitectures(List<String> architectures) {
this.architectures = architectures;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package dev.flima.domain.educations;

import java.util.List;
import java.util.Optional;
import java.util.UUID;

public interface EducationRepository {
void save(Education education);
void modify(Education education);
Optional<Education> getById(UUID id);
List<Education> getAll();
void remove(Education education);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package dev.flima.domain.educations;

public enum TypeEducation {
DEGREE,
CERTIFICATION
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package dev.flima.domain.exceptions;

public class BusinessRuleException extends DomainException {
public BusinessRuleException(String message) {
super(message);
}
@Override public int getStatusCode() {
return 422;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package dev.flima.domain.exceptions;

public abstract class DomainException extends RuntimeException {
public DomainException(String message) {
super(message);
}
public abstract int getStatusCode();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package dev.flima.domain.exceptions;

public class EntityNotFoundException extends DomainException {
public EntityNotFoundException(String message) {
super(message);
}
@Override public int getStatusCode() {
return 404;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package dev.flima.domain.exceptions;

public class UnauthorizedException extends DomainException {
public UnauthorizedException(String message) {
super(message);
}
@Override public int getStatusCode() {
return 401;
}
}
91 changes: 91 additions & 0 deletions backend/src/main/java/dev/flima/domain/experience/Experience.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package dev.flima.domain.experience;

import java.util.List;
import java.util.UUID;

public class Experience {

private UUID id;
private String title;
private String company;
private String period;
private List<String> bullets;
private List<String> technologies;
private String icon;

public Experience(String title, String company, String period, List<String> bullets, List<String> technologies, String icon) {
this.id = UUID.randomUUID();
this.title = title;
this.company = company;
this.period = period;
this.bullets = bullets;
this.technologies = technologies;
this.icon = icon;
}

public Experience(UUID id, String title, String company, String period, List<String> bullets, List<String> technologies, String icon) {
this.id = id;
this.title = title;
this.company = company;
this.period = period;
this.bullets = bullets;
this.technologies = technologies;
this.icon = icon;
}

public UUID getId() {
return id;
}

public void setId(UUID id) {
this.id = id;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getCompany() {
return company;
}

public void setCompany(String company) {
this.company = company;
}

public String getPeriod() {
return period;
}

public void setPeriod(String period) {
this.period = period;
}

public List<String> getBullets() {
return bullets;
}

public void setBullets(List<String> bullets) {
this.bullets = bullets;
}

public List<String> getTechnologies() {
return technologies;
}

public void setTechnologies(List<String> technologies) {
this.technologies = technologies;
}

public String getIcon() {
return icon;
}

public void setIcon(String icon) {
this.icon = icon;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package dev.flima.domain.experience;

import java.util.List;
import java.util.Optional;
import java.util.UUID;

public interface ExperienceRepository {
void save(Experience experience);
void modify(Experience experience);
Optional<Experience> getById(UUID id);
List<Experience> getAll();
void remove(Experience experience);
}
Loading