woowacourse-teams / 2021-zzimkkong

✅ 공간을 한 눈에, 예약은 한 번에!
https://zzimkkong.com
164 stars 20 forks source link

[BE] 시간대별 예약조건을 설정할 수 있다. #814

Closed xrabcde closed 2 years ago

xrabcde commented 2 years ago

기능 상세

image

도메인 설계 변경

# DDL

# SPACE
create table space
(
    id                            bigint auto_increment primary key,
    map_id                        bigint       not null,
    area                          varchar(255) not null,
    color                         varchar(25)  null,
    description                   varchar(255) null,
    name                          varchar(20)  not null,
    available_end_time            time         not null,
    available_start_time          time         not null,
    reservation_enable            bit          not null,
    constraint space_ibfk_1
        foreign key (map_id) references map (id)
);

create index map_id
    on space (map_id);

# SETTING 
create table setting
(
    id                            bigint auto_increment primary key,
    space_id                        bigint       not null,
    enabled_day_of_week           varchar(255) null,
    setting_start_time time not null,
    setting_end_time time not null,
    reservation_maximum_time_unit int          not null,
    reservation_minimum_time_unit int          not null,
    reservation_time_unit         int          not null,
    constraint setting_ibfk_1
        foreign key (space_id) references space (id)
);

# PRESET
create table preset
(
    id                            bigint auto_increment   primary key,
    name                          varchar(20)  not null,
    setting_start_time time not null,
    setting_end_time time not null, 
    reservation_time_unit         int          not null,
    reservation_minimum_time_unit int          not null,
    reservation_maximum_time_unit int          not null,
    enabled_day_of_week           varchar(255) null,
    member_id                     bigint       not null,
    constraint preset_ibfk_1
        foreign key (member_id) references member (id)
);

create index manager_id
    on preset (member_id);

비즈니스 로직