Change category field of publication entity to its id.
This commit is contained in:
@@ -3,9 +3,6 @@ package org.codiki.domain.publication.model;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.codiki.domain.category.model.Category;
|
||||
import org.codiki.domain.picture.model.Picture;
|
||||
|
||||
public record Publication(
|
||||
UUID id,
|
||||
String key,
|
||||
@@ -14,7 +11,7 @@ public record Publication(
|
||||
String description,
|
||||
ZonedDateTime creationDate,
|
||||
UUID illustrationId,
|
||||
Author author,
|
||||
Category category
|
||||
UUID categoryId,
|
||||
Author author
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@ public class PublicationBuilder {
|
||||
private String title;
|
||||
private String text;
|
||||
private String description;
|
||||
private UUID illustrationId;
|
||||
private ZonedDateTime creationDate;
|
||||
private UUID illustrationId;
|
||||
private UUID categoryId;
|
||||
private Author author;
|
||||
private Category category;
|
||||
|
||||
private PublicationBuilder() {}
|
||||
|
||||
@@ -31,10 +31,10 @@ public class PublicationBuilder {
|
||||
.withTitle(publication.title())
|
||||
.withText(publication.text())
|
||||
.withDescription(publication.description())
|
||||
.withIllustrationId(publication.illustrationId())
|
||||
.withCreationDate(publication.creationDate())
|
||||
.withAuthor(publication.author())
|
||||
.withCategory(publication.category());
|
||||
.withIllustrationId(publication.illustrationId())
|
||||
.withCategoryId(publication.categoryId())
|
||||
.withAuthor(publication.author());
|
||||
}
|
||||
|
||||
public PublicationBuilder withId(UUID id) {
|
||||
@@ -62,23 +62,23 @@ public class PublicationBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public PublicationBuilder withIllustrationId(UUID illustrationId) {
|
||||
this.illustrationId = illustrationId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PublicationBuilder withCreationDate(ZonedDateTime creationDate) {
|
||||
this.creationDate = creationDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PublicationBuilder withAuthor(Author author) {
|
||||
this.author = author;
|
||||
public PublicationBuilder withIllustrationId(UUID illustrationId) {
|
||||
this.illustrationId = illustrationId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PublicationBuilder withCategory(Category category) {
|
||||
this.category = category;
|
||||
public PublicationBuilder withCategoryId(UUID categoryId) {
|
||||
this.categoryId = categoryId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PublicationBuilder withAuthor(Author author) {
|
||||
this.author = author;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -91,8 +91,8 @@ public class PublicationBuilder {
|
||||
description,
|
||||
creationDate,
|
||||
illustrationId,
|
||||
author,
|
||||
category
|
||||
categoryId,
|
||||
author
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user