Skip to content

Commit 478d7a6

Browse files
committed
貸出管理の ER 図を追加。
1 parent 0ac06c0 commit 478d7a6

File tree

2 files changed

+101
-27
lines changed

2 files changed

+101
-27
lines changed

doc/diagram/ER.puml

+100-26
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,110 @@
11
@startuml
2-
entity NdcCategory {
3-
* id
4-
--
5-
* name
6-
* number
7-
}
82

9-
entity Book {
10-
* id
11-
--
12-
* ISBN
13-
* title
14-
* publication_date
15-
* category(FK: NdcCategory(id))
16-
}
3+
package "貸出管理" {
4+
5+
entity BookStock {
6+
* id
7+
--
8+
* book_id (FK: Book(id))
9+
* status (FK: BookStatus(id))
10+
memo
11+
}
12+
13+
entity BookStockStatus {
14+
* id
15+
--
16+
* name
17+
}
18+
19+
note bottom: 貸出可能, 貸出不可, 破棄\n図書館の実務的には「貸出不可」を細分化すべきかもしれない?
20+
21+
entity Customer {
22+
* id
23+
--
24+
* name
25+
* email_address
26+
}
27+
28+
entity Lending {
29+
* id
30+
--
31+
* lending_set_id (FK: LendingSet(id))
32+
* customer_id (FK: Customer(id))
33+
* book_stock_id (FK: BookStock(id))
34+
}
35+
36+
entity LendingSet {
37+
* id
38+
--
39+
* LendingSetStatus (FK: LendingStatus(id))
40+
* lend_start_date
41+
* return_deadline_date
42+
return_date
43+
}
44+
45+
entity LendingStatus {
46+
* id
47+
--
48+
* name
49+
}
50+
51+
note bottom: 貸出中, 貸出期限超過, 返却済み
1752

18-
entity Author {
19-
* id
20-
--
21-
* firstname
22-
* lastname
2353
}
2454

25-
entity BookAuthorRelationship {
26-
* id
27-
--
28-
* book_id (FK:Book(id))
29-
* author_id (FK:Author(id))
55+
package "書籍管理" {
56+
57+
entity NdcCategory {
58+
* id
59+
--
60+
* name
61+
* number
62+
}
63+
64+
entity BookMaster {
65+
* id
66+
--
67+
* ISBN (UNIQUE)
68+
* title
69+
* publication_date
70+
* category(FK: NdcCategory(id))
71+
}
72+
73+
entity Author {
74+
* id
75+
--
76+
* firstname
77+
* lastname
78+
}
79+
80+
entity BookAuthorRelationship {
81+
* id
82+
--
83+
* book_id (FK:Book(id))
84+
* author_id (FK:Author(id))
85+
}
86+
3087
}
3188

32-
Book ||-{ BookAuthorRelationship
33-
Book }o--|| NdcCategory
89+
BookMaster ||-{ BookAuthorRelationship
90+
BookMaster }o--|| NdcCategory
3491
BookAuthorRelationship }-|| Author
3592

93+
BookStock }o-|| BookMaster
94+
Lending }o-|{ BookStock
95+
LendingSet }o-- Customer
96+
97+
BookStock }o--|| BookStockStatus
98+
Lending }|--|| LendingSet
99+
LendingStatus - LendingSet
100+
101+
"貸出管理" -[hidden]- "書籍管理"
102+
103+
entity "<テーブル名>" {
104+
* 主キー
105+
--
106+
カラム
107+
* 必須カラム
108+
}
109+
36110
@enduml

0 commit comments

Comments
 (0)