Skip to content

Commit

Permalink
Features/add erd (#4)
Browse files Browse the repository at this point in the history
* Add simple wallet api question.

* Translate database part to english.

* Move THAI DB to translate folder.

* Remove confuse task.

* Add emphasize text.

* Add ERD detail.

Co-authored-by: ChomCHOB <[email protected]>
  • Loading branch information
pongib and ChomCHOB authored Oct 8, 2020
1 parent 9cee671 commit b35dda9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ this provide for customer who want to buy code for using in game.

- item may sale in bundle type for example sale two difference character skin set in special price or sale five gachapon box (for random item) in special price.

**Hint**
**Objective**

- Create database in form of model from [sequelize](https://github.com/sequelize/sequelize)
- Create database in form of model from [sequelize.](https://github.com/sequelize/sequelize)
- Create Entity Relationship Diagram (ERD) and provide us with picture or pdf format. You can create ERD with any tool you want even handwriting is fine.

**Example Model**
**Example Sequelize Model**

```js
// Store User
Expand All @@ -90,17 +91,21 @@ this provide for customer who want to buy code for using in game.

// Store User credit card
const UserCard = sequelize.define('UserCard', {
id: Sequelize.STRING,
user_id: Sequelize.STRING,
id: Sequelize.INTEGER,
user_id: Sequelize.INTEGER,
mask_pan: Sequelize.STRING,
})

UserCard.associate = (models) => {
UserCard.belongsTo(User, { foreignKey: 'user_id' })
}
```

**Example Entity Relationship Diagram**

![ERD](image/ERD.png)


**Hint2**
**Hint**

- You can see database part in [thai language](translate/THAI_DB.md) for better understanding.

Binary file added image/ERD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 10 additions & 8 deletions translate/THAI_DB.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

# Database

สมมติสถานการณ์ว่า
Expand All @@ -16,12 +14,12 @@

- item อาจถูกขายแบบ Bundle เช่น ขาย สกินตัวละครพร้อมกันสองตัวในราคาพิเศษ หรือขาย กล่องสุ่มไอเท็ม 5 กล่อง ในราคาถูกกว่าปกติ

**Hint**

- สร้าง database ในรูปแบบของ model จาก [sequelize](https://github.com/sequelize/sequelize)
**Objective**

- สร้าง database ในรูปแบบของ model จาก [sequelize.](https://github.com/sequelize/sequelize)
- วาด Entity Relationship Diagram (ERD) ออกมาแล้วส่งมาเป็นภาพหรือ pdf จะใช้ tool อะไรก็ได้ หรือจะเขียนมือส่งมาก็ไม่เป็นไร

**Example Model**
**ตัวอย่าง Sequelize Model**

```js
// Store User
Expand All @@ -37,12 +35,16 @@

// Store User credit card
const UserCard = sequelize.define('UserCard', {
id: Sequelize.STRING,
user_id: Sequelize.STRING,
id: Sequelize.INTEGER,
user_id: Sequelize.INTEGER,
mask_pan: Sequelize.STRING,
})

UserCard.associate = (models) => {
UserCard.belongsTo(User, { foreignKey: 'user_id' })
}
```

**ตัวอย่าง Entity Relationship Diagram**

![ERD](../image/ERD.png)

0 comments on commit b35dda9

Please sign in to comment.