---
# System prepended metadata

title: '<center><i class="fa fa-edit"></i> Smart Dispenser: `members_additional-card` 流程圖</center>'
tags: [Internship]

---

# <center><i class="fa fa-edit"></i> Smart Dispenser: `members_additional-card` 流程圖</center>
###### tags: `Internship`
:::info
**Goal:**
- [x] `members_additional_card` 流程圖

**Resources:**
[PyQt](https://hackmd.io/Ibk_VuuWRXOjkION4wk3tg)
[newXinXingPyQtStructure](https://drive.google.com/drive/folders/1QNJJxxug1Njb9ATe-BdzcZKZZ1PGI2Sd?usp=sharing)
[CodiMD](https://hackmd.io/c/codimd-documentation/%2F%40codimd%2Fextra-supported-syntax#Flow-Chart)
[冠辰參考的筆記](https://www.wongwonggoods.com/page/4/?s=pyqt&ct_post_type=post%3Apage&ct_product_price=1)
:::
*Figure 1: Open a new collection members_additional_card*
![](https://i.imgur.com/HIZq4rs.jpg)

*Figure 2: Flowchart*
```flow
st=>start: Start
e=>end: End
io=>inputoutput: input schoolID 
op=>operation: restrict this field to 8 numbers
cond=>condition: Is the schoolID in the collection members_additional_card?
er=>operation: Display Error Notification in pop-up: Invalid schoolID
op2=>operation: Display members_additional_card fields in PyQt (see Figure 1.) and stored schoolID as variable s
fix=>condition: Re-enter schoolID?
su=>condition: Sign up as a new member?
op3=>operation: Display sign up page
add=>condition: Add additional card?
a1=>operation: Input cardID of additional card
a1.1=>operation: Restrict this field to 10 numbers
a1.2=>condition: Is cardID in s&&primaryCard?
a2=>condition: Is cardID in s&&additionalCard?
er2=>operation: Display Error Notification in pop-up: Sorry, this is registered as your primary card. 
er3=>operation: Display Error Notification in pop-up: Sorry, you already registered this additional card.  
op4=>operation: Make new object in members_additional_card with schoolID = s, primaryCard = when primaryCard.equals(additionalCard), and additionalCard = most recent user input
op5=>operation: Display current members_additional_card in PyQt

st->io->op->cond->op2->add->a1->a1.1->a1.2->op4->op5->e
cond(yes)->op2
cond(no)->er->fix
fix(yes)->io
fix(no)->su
su(yes)->op3->e
su(no)->e
add(yes)->a1->a1.1
add(no)->e
a1.2(yes)->er2->e
a1.2(no)->a2
a2(yes)->er3->e
a2(no)->op4->op5->e
```
