Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
package com.tiki.server.timeblock.service.dto.response;

import com.tiki.server.timeblock.entity.BlockType;
import com.tiki.server.timeblock.entity.TimeBlock;

import jakarta.validation.constraints.NotNull;

import java.time.LocalDate;

public record TimeBlockTagServiceResponse(
@NotNull long id,
@NotNull String name,
@NotNull String color
@NotNull String color,
@NotNull BlockType blockType,
@NotNull LocalDate startDate
) {

public static TimeBlockTagServiceResponse from(final TimeBlock timeBlock){
return new TimeBlockTagServiceResponse(timeBlock.getId(), timeBlock.getName(), timeBlock.getColor());
public static TimeBlockTagServiceResponse from(final TimeBlock timeBlock) {
return new TimeBlockTagServiceResponse(
timeBlock.getId(),
timeBlock.getName(),
timeBlock.getColor(),
timeBlock.getType(),
timeBlock.getStartDate()
);
}
}