[#52] 만료 예약 / 일정 스케쥴링 작업 추가 및 동시성 처리를 위한 일부 코드 수정 #53

Merged
pricelees merged 18 commits from refactor/#52 into main 2025-10-04 08:40:37 +00:00
3 changed files with 24 additions and 20 deletions
Showing only changes of commit a8ed0de625 - Show all commits

View File

@ -4,6 +4,7 @@ import com.sangdol.common.persistence.AuditingBaseEntity
import jakarta.persistence.*
import org.springframework.data.jpa.domain.support.AuditingEntityListener
import java.time.LocalDate
import java.time.LocalDateTime
import java.time.LocalTime
@Entity
@ -19,6 +20,7 @@ class ScheduleEntity(
@Enumerated(value = EnumType.STRING)
var status: ScheduleStatus,
var holdExpiredAt: LocalDateTime? = null
) : AuditingBaseEntity(id) {
fun modifyIfNotNull(
time: LocalTime?,

View File

@ -114,16 +114,17 @@ create table if not exists theme (
);
create table if not exists schedule (
id bigint primary key,
date date not null,
time time not null,
store_id bigint not null,
theme_id bigint not null,
status varchar(30) not null,
created_at timestamp not null,
created_by bigint not null,
updated_at timestamp not null,
updated_by bigint not null,
id bigint primary key,
date date not null,
time time not null,
store_id bigint not null,
theme_id bigint not null,
status varchar(30) not null,
created_at timestamp not null,
created_by bigint not null,
updated_at timestamp not null,
updated_by bigint not null,
hold_expired_at timestamp null,
constraint uk_schedule__store_id_date_time_theme_id unique (store_id, date, time, theme_id),
constraint fk_schedule__store_id foreign key (store_id) references store (id),

View File

@ -114,16 +114,17 @@ create table if not exists theme (
);
create table if not exists schedule (
id bigint primary key,
date date not null,
time time not null,
store_id bigint not null,
theme_id bigint not null,
status varchar(30) not null,
created_at datetime(6) not null,
created_by bigint not null,
updated_at datetime(6) not null,
updated_by bigint not null,
id bigint primary key,
date date not null,
time time not null,
store_id bigint not null,
theme_id bigint not null,
status varchar(30) not null,
created_at datetime(6) not null,
created_by bigint not null,
updated_at datetime(6) not null,
updated_by bigint not null,
hold_expired_at datetime(6) null,
constraint uk_schedule__store_id_date_time_theme_id unique (store_id, date, time, theme_id),
constraint fk_schedule__store_id foreign key (store_id) references store (id),