---
# System prepended metadata

title: 網路程式設計-final trem
tags: [111-1學校上課]

---

###### tags: `111-1學校上課`
# 網路程式設計-final trem
## 目標功能
1. 新增欠錢紀錄
功能:使用者可以新增自己的欠錢紀錄(誰欠自己錢)
2. 更改紀錄
    - 新增欠錢紀錄、金額(如 小明 12/3 早餐 $50)
        - 表示小明在12/3 因為早餐欠了使用者50元
    - 修改欠錢紀錄、金額
    - 移除欠錢紀錄、金額(=還錢)
3. 查看紀錄
功能:查看消費紀錄
    - 查看截至目前(本月)所有欠錢紀錄
    - 每月底自動輸出一次當月總欠錢紀錄

4. 刪除欠錢紀錄
功能:刪除使用者自己的所有欠錢紀錄


# 基本紀錄結構
### Note
#### Method 
1. Basic Getter/Setter
2. Append_Item(Product)
3. Change_Note()
#### Variable
1. Date: (str)Create This Note Date
2. Item: (Product)List of Product
3. Last_Modify:Last Modify This Note Time
4. Author:(Str)Who Create This Note User 

### Product
#### Method 
1. Basic Getter/Setter
#### Variable
1. Name: (str)Product Name
2. Status: (str)Product Status
3. Price: (str) Product Price

## Usage

### Discord User Command

command_prefix: `$`

* `add <record-id> <amount> <info> [detail]`

    Adds a new record into the database.

* `remove <record-id>`

    Removes a record from the database by querying the record ID.

* `modify <record-id> <name|amount|info> <value>`

    Modify the specified value in the database.

* `clear <record-id>`

    Clear the record but not delete it from the database



### backend function call

```python
class Record:
    def __init__(self, creditor_id: int, debtor_id: int,
                 amount: int, title: str, detail: str = "",
                 due_date: datetime = datetime()):

    def update_debtor(debtor_id: int) -> None:

    def update_amount(amount: int) -> None:

    def update_title(title: str) -> None:

    def update_detail(detail: str) -> None:
        
    def update_due_date(due_date: datetime) -> None:

    def clear() -> None:


def add_record(record: Record) -> None:

def delete_record(record_id: int) -> None:

def find_record(record_id: int) -> Record:

def creditor_records(creditor_id: int) -> List[Record]:

def debtor_records(debtor_id: int) -> List[Record]:
```


## Environment and Tools

### Language

* Python
    * Frontend: discord.py
    * DB: Supabase
    * DB Con: mysql-connector-
    * Formatter: autopep8

### Version Control

* Git/GitHub

### Database

* MySQL/MariaDB

### Container

* Docker/Docker Compose