Skip to content

Commit 66afabf

Browse files
committed
docs: 클래스 다이어그램 작성
1 parent ecb0548 commit 66afabf

1 file changed

Lines changed: 115 additions & 0 deletions

File tree

docs/design/03-class-diagram.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# 클래스 다이어그램
2+
3+
```mermaid
4+
classDiagram
5+
class Users {
6+
- Long id
7+
- String loginId
8+
- String email
9+
- Gender gender
10+
- String password
11+
12+
+ void changePassword(String password)
13+
+ void changeEmail(String email)
14+
}
15+
16+
class Point {
17+
- Long id
18+
- Long refUserId
19+
- int balance
20+
21+
+ void chargePoint(int amount)
22+
+ void usePoint(int amount)
23+
}
24+
25+
class Brand {
26+
- Long id
27+
- String name
28+
29+
}
30+
31+
class Product {
32+
- Long id
33+
- Long refBrandId
34+
- String name
35+
- BigDecimal price
36+
- int stock
37+
38+
+ void changePrice(BigDecimal newPrice)
39+
+ void discountPrice(BigDecimal rate)
40+
+ void increaseStock(int amount)
41+
+ void decreaseStock(int amount)
42+
+ boolean availableStock(int amount)
43+
44+
}
45+
46+
class Like {
47+
- Long id
48+
- Long refUserId
49+
- Long refProductId
50+
51+
+ static void createLike(Long userId, Long productId)
52+
53+
}
54+
55+
class Cart {
56+
- Long id
57+
- Long refUserId
58+
59+
+ void addItemToCart(Long productId, int amount)
60+
+ void deleteItemFromCart(Long productId, int amount)
61+
}
62+
63+
class CartItem {
64+
- Long id
65+
- String name
66+
- Long refCartId
67+
- Long refProductId
68+
- int quantity
69+
70+
+ void changeQuantity(int amount)
71+
}
72+
73+
class Order {
74+
- Long id
75+
- Long refUserId
76+
- OrderStatus status
77+
78+
+ void addItemToOrder(Product product, int quantity)
79+
+ BigDecimal calculateTotalPrice()
80+
+ void complete()
81+
+ void cancel()
82+
83+
}
84+
85+
class OrderItem {
86+
- Long id
87+
- Long refOrderId
88+
- Long refProductId
89+
- Integer quantity
90+
- BigDecimal orderPrice
91+
}
92+
93+
class Payment {
94+
- Long id
95+
- Long refOrderId
96+
- BigDecimal totalPrice
97+
- PaymentStatus status
98+
- PaymentMethod method
99+
100+
+ void requestPayment(Order order)
101+
+ void completePayment()
102+
+ void cancelPayment()
103+
+ boolean isCompleted()
104+
+ boolean isRefundable()
105+
}
106+
107+
Order "1" *-- "0..*" OrderItem
108+
Cart "1" *-- "0..*" CartItem
109+
Product "0..*" --> "1" Brand
110+
Like "0..*" --> "1" Users
111+
Like "0..*" --> "1" Product
112+
Order "0..*" --> "1" Users
113+
Point "1" --> "1" Users
114+
Payment "1" --> "1" Order
115+
```

0 commit comments

Comments
 (0)