Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 2.29 KB

README.md

File metadata and controls

26 lines (20 loc) · 2.29 KB

Solution

  1. decided to separate User and Job Offer

These two modules definitely have different reasons for change, one domain (user) is heavily generic (replaceable with an off-the-shelf solution); the other domain looks like a core.

  1. decided to extract Listing from JobOffer
    @Entity
    public class JobOffer {
    @Id
    @GeneratedValue
    private long id;
    @Enumerated(EnumType.STRING)
    private Category category;
    private Instant startDate;
    private Instant endDate;
    @OneToOne
    @JoinColumn(name = "employee_id",
    referencedColumnName = "id")
    private Employer employer;

@Entity
public class JobListing {
@Id
private long offerId;
private Category category;
private String employer;

It simplifies read model (less fields - no need for startDate, endDate or employerId), prepares domain to be rewritten with better tools at the expense of data synchronization.

Missing parts / Improve area