Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
8 tasks
xrabcde opened this issue May 5, 2022 · 0 comments · Fixed by #833
Closed
8 tasks

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

xrabcde opened this issue May 5, 2022 · 0 comments · Fixed by #833
Assignees
Labels
🕋 backend 🌟 feature New feature or request

Comments

@xrabcde
Copy link
Collaborator

xrabcde commented May 5, 2022

기능 상세

image

도메인 설계 변경

  • setting 테이블 추가 (i.e. Space 테이블 찢기)

    • space - 1:N - setting
  • 변경 대상 테이블

    • Space, Setting, Preset
# 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);

비즈니스 로직

  • Space, Setting, Preset Entity들 DDL 맞춰서 변경
    • setting, preset 공통 칼럼들 빼서 embedded 클래스 생성 가능할 듯!
    • e.g. SettingCondition, SettingState, SettingItem, ... (네이밍은 논의 필요)
  • space 생성, 업데이트 관련 �작업
    • setting들 끼리 적용될 시간대 겹치는지 검증 (reservationService 쪽 로직 참고)
    • 이제 setting 여러 개 인것 고려해서 create, update 하도록 수정
  • API request/response (DTO) 변경 (프론트와 comm 필요)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕋 backend 🌟 feature New feature or request
Projects
None yet
2 participants