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

[치킨] 박준수 미션 제출합니다. #2

Open
wants to merge 57 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
5360819
docs: 기능목록/에러 처리 정의
GaBaljaintheroom Sep 1, 2023
718a8c6
feat: 원하는 기능 선택
GaBaljaintheroom Sep 1, 2023
d3d1a39
refactor: Main enum타입 추출
GaBaljaintheroom Sep 1, 2023
ea8f345
feat: ErrorMessage INPUT_TABLE_NUMBER_ERROR추가
GaBaljaintheroom Sep 1, 2023
6e234a7
feat: InputView 테이블 번호 입력 추가
GaBaljaintheroom Sep 1, 2023
25e3161
feat: Table 생성
GaBaljaintheroom Sep 1, 2023
882b844
feat: TableList 생성
GaBaljaintheroom Sep 1, 2023
a991bda
feat: ProgressMessage 테이블 메시지 추가
GaBaljaintheroom Sep 1, 2023
f589f75
feat: OutputView 테이블 메시지 추가
GaBaljaintheroom Sep 1, 2023
dfbeb98
test: 테이블 숫자가 옳지 않으면 오류가 발생
GaBaljaintheroom Sep 1, 2023
27fb63f
feat: Menu 생성
GaBaljaintheroom Sep 1, 2023
2487be1
feat: MenuList 생성
GaBaljaintheroom Sep 1, 2023
e6c4356
feat: ErrorMessage 추가
GaBaljaintheroom Sep 2, 2023
22bdc96
feat: InputView readMenuNumber 추가
GaBaljaintheroom Sep 2, 2023
471214a
feat: InputView readMenuQuantity 추가
GaBaljaintheroom Sep 2, 2023
ec9c4fe
feat: Menu getMenu 추가
GaBaljaintheroom Sep 2, 2023
3b34403
feat: OutputView 출력문 추가
GaBaljaintheroom Sep 2, 2023
f8bd96d
feat: ProgressMessage 출력문 추가
GaBaljaintheroom Sep 2, 2023
e4bc0ac
feat: OrderList 생성
GaBaljaintheroom Sep 2, 2023
052e807
refactor: Table 저장 수정
GaBaljaintheroom Sep 2, 2023
17c4ca1
test: 옳지 않은 메뉴 숫자를 입력하면 오류가 발생
GaBaljaintheroom Sep 2, 2023
a698923
test: 옳지 않은 메뉴 양을 입력하면 오류가 발생
GaBaljaintheroom Sep 2, 2023
9cd8d3e
feat: printMainFunction 추가
GaBaljaintheroom Sep 2, 2023
87c902e
refactor: validateMenuQuantity 역할 이동
GaBaljaintheroom Sep 2, 2023
161777d
refactor: 출력 형식 수정
GaBaljaintheroom Sep 2, 2023
beb4f48
feat: PosController 생성
GaBaljaintheroom Sep 2, 2023
9039fbb
refactor: TableList getTable 수정
GaBaljaintheroom Sep 2, 2023
95de9dc
feat: ErrorMessage 추가
GaBaljaintheroom Sep 2, 2023
ccc783b
feat: InputView readPaymentNumber 추가
GaBaljaintheroom Sep 2, 2023
e6fbe15
feat: OrderList toString 작성
GaBaljaintheroom Sep 2, 2023
fb76451
feat: OutputView 추가
GaBaljaintheroom Sep 2, 2023
b394c80
feat: ProgressMessage 추가
GaBaljaintheroom Sep 2, 2023
3017147
feat: PaymentMethod 생성
GaBaljaintheroom Sep 2, 2023
b183279
feat: Main/Menu 로직 추가
GaBaljaintheroom Sep 2, 2023
131d9fb
test: 옳지 않는 결제 번호를 입력하면 오류가 발생
GaBaljaintheroom Sep 2, 2023
6bdadc9
refactor: saveOrder 수정
GaBaljaintheroom Sep 2, 2023
ed00a36
feat: OutputView 출력문 추가
GaBaljaintheroom Sep 2, 2023
80e1fba
feat: Payment 생성
GaBaljaintheroom Sep 2, 2023
4bf27ed
feat: ProgressMessage 메시지 추가
GaBaljaintheroom Sep 2, 2023
097a35e
feat: TableList changeTablePaymentStatus 추가
GaBaljaintheroom Sep 2, 2023
0656940
feat: PosController makePayment작성
GaBaljaintheroom Sep 2, 2023
f3fe316
feat: main 함수 작성
GaBaljaintheroom Sep 2, 2023
4bb3a5b
feat: PosService 분리
GaBaljaintheroom Sep 2, 2023
9ec4b7e
refactor: 출력문 수정
GaBaljaintheroom Sep 2, 2023
91bca7a
refactor: getTotalQuantity 중복 코드 추출
GaBaljaintheroom Sep 2, 2023
3f6796b
refactor: TableStatus 추출
GaBaljaintheroom Sep 2, 2023
683b6bd
refactor: Payment 추출
GaBaljaintheroom Sep 2, 2023
2d38081
refactor: Layout역할 수정
GaBaljaintheroom Sep 5, 2023
d6cac06
test: 초기화된 테이블들이 저장되는지 확인
GaBaljaintheroom Sep 6, 2023
e632f60
test: 테이블 번호와 일치하는 테이블을 반환
GaBaljaintheroom Sep 6, 2023
4dbbeca
test: 1번 테이블이 결제 되었을 때 세팅이 되는지 확인
GaBaljaintheroom Sep 6, 2023
3558b31
test: 1번 테이블이 주문 되었을 때 세팅이 되는지 확
GaBaljaintheroom Sep 6, 2023
b659d46
test: FunctionScreenTest
GaBaljaintheroom Sep 6, 2023
0d0b259
test: MenuTest
GaBaljaintheroom Sep 6, 2023
6dd4651
test: 치킨을 1마리 시켰을 때 주문이 등록되는지 확인
GaBaljaintheroom Sep 6, 2023
583b008
test: PaymentTest
GaBaljaintheroom Sep 6, 2023
6dfdee8
style: 패키지 구조 추가
GaBaljaintheroom Sep 6, 2023
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
Prev Previous commit
Next Next commit
feat: TableList 생성
  • Loading branch information
GaBaljaintheroom committed Sep 1, 2023
commit 882b8442b17e4555bdf8a0bd756493b0372a61db
51 changes: 51 additions & 0 deletions src/main/java/TableList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import java.util.*;

public class TableList {

private final List<String> upSide = List.of("┏", "-", "┓");
private final List<Table> tables;
private final Map<Table, List<String>> downSide = new HashMap<>(6);


public TableList() {
this.tables = new ArrayList<>(6);
addTableWithNumber(1);
addTableWithNumber(2);
addTableWithNumber(3);
addTableWithNumber(5);
addTableWithNumber(6);
addTableWithNumber(8);
}

private void addTableWithNumber(int number) {
Table table = new Table(number);
tables.add(table);
downSide.put(table, List.of("┗", "-" ,"┛"));
}


public void changeTableStatus(Table table){
if (table.isOrdering()){
downSide.put(table, List.of("┗", "#" ,"┛"));
}
}

public void validateTableNumber(Integer number){
if(tables.stream().noneMatch(table -> table.getNumber() == number)){
throw new IllegalArgumentException(ErrorMessage.INPUT_TABLE_NUMBER_ERROR.toString());
}
}

@Override
public String toString() {
StringBuilder stringBuilder = new StringBuilder();
for (Table table : tables){
stringBuilder.append(upSide);
stringBuilder.append("\n");
stringBuilder.append("| ").append(table.getNumber()).append(" |");
stringBuilder.append("\n");
stringBuilder.append(downSide.get(table));
}
return stringBuilder.toString();
}
}