mermaid: update
This commit is contained in:
64
banque.md
64
banque.md
@@ -89,8 +89,8 @@ erDiagram
|
||||
|
||||
%% Relations
|
||||
|
||||
person ||--o{ holder : "is held by"
|
||||
company ||--o{ holder : "is held by"
|
||||
person ||--|| holder
|
||||
company ||--|| holder
|
||||
```
|
||||
|
||||
## 2. Les comptes
|
||||
@@ -122,6 +122,66 @@ begin;
|
||||
commit;
|
||||
```
|
||||
|
||||
```mermaid
|
||||
erDiagram
|
||||
person {
|
||||
bigint id PK
|
||||
text firstname
|
||||
text lastname
|
||||
date birthdate
|
||||
}
|
||||
|
||||
company {
|
||||
bigint id PK
|
||||
text registration_numer
|
||||
date creation_date
|
||||
}
|
||||
|
||||
bank {
|
||||
bigint id PK
|
||||
}
|
||||
|
||||
holder {
|
||||
bigint id PK
|
||||
date creation_date
|
||||
}
|
||||
|
||||
account {
|
||||
bigint id PK
|
||||
date creation_date
|
||||
decimal balance >0
|
||||
text currency_code FK
|
||||
}
|
||||
|
||||
account_holder {
|
||||
bigint account_id FK
|
||||
bigint holder_id FK
|
||||
}
|
||||
|
||||
transaction {
|
||||
bigint id PK
|
||||
date transaction_date
|
||||
decimal amount
|
||||
}
|
||||
|
||||
currency {
|
||||
text code PK
|
||||
}
|
||||
|
||||
currency {
|
||||
text code PK
|
||||
}
|
||||
|
||||
%% Relations
|
||||
|
||||
person ||--|| holder
|
||||
company ||--|| holder
|
||||
bank ||--|| holder
|
||||
holder }|--|{ account_holder
|
||||
account_holder }|--|{ account
|
||||
|
||||
```
|
||||
|
||||
## 4. Procédure stockée
|
||||
|
||||
Pour fiabiliser le process et être sûr que l'execution s'effectue toujours dans une transaction,
|
||||
|
||||
@@ -98,7 +98,6 @@ create table account (
|
||||
id bigint primary key generated always as identity,
|
||||
number text unique not null,
|
||||
opened_at date not null default current_date,
|
||||
closed_at date,
|
||||
balance numeric(18,6) not null default 0 check (balance >= 0)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user