Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This PR is the solution to the 'terrarium' #2 #26

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Corrected Tables in solution1.md
gitpraths committed Nov 17, 2024
commit 5379ca2869808d131189d7a9dcc3b57dd6adbae0
64 changes: 36 additions & 28 deletions 1-js-basics/1-data-types/solution1.md
Original file line number Diff line number Diff line change
@@ -5,39 +5,47 @@ The question is quite simple. We need to mention the data types that we would ne
The experience can be divided into 5 different parts:

## User Login detials
| Name (property) | Data Type | Reason |
| --- | --- |
| id | String | - Unique identifier for the user. <br> - String is used as it will be a combination of letters and numbers |
| name | String | - Name of Customer <br> - String is used to store names |
| email | String | - authentication <br> - combination of letters, numbers and special characters.|
| isLoggedIn | Boolean | - check the status of a seesion <br> - a user can be loggedin or not thus boolean |
| Name (Property) | Data Type | Reason |
|------------------|-----------|----------------------------------------------------------------------------------------|
| `id` | String | - Unique identifier for the user. <br> - String is used as it will be a combination of letters and numbers. |
| `name` | String | - Name of Customer. <br> - String is used to store names. |
| `email` | String | - Authentication. <br> - Combination of letters, numbers, and special characters. |
| `isLoggedIn` | Boolean | - Check the status of a session. <br> - A user can be logged in or not, thus Boolean. |

---

## Product Information
| Name (property) | Data Type | Reason |
| --- | --- |
| id | String | - Unique identifier for the each product. <br> - String is used as it will be a combination of letters and numbers |
| name | String | - Name of Product <br> - String is used to store names |
| price | Double | - represnts cost of the product <br> - number to perform final cost calculations.|
| quantity | Integer | - number of products available |
| isAvailable | Boolean | - checks if a product is available or not <br> - a product can be available or not, thus boolean |
| Name (Property) | Data Type | Reason |
|------------------|-----------|----------------------------------------------------------------------------------------|
| `id` | String | - Unique identifier for each product. <br> - String is used as it will be a combination of letters and numbers. |
| `name` | String | - Name of Product. <br> - String is used to store names. |
| `price` | Double | - Represents the cost of the product. <br> - Number is used to perform final cost calculations. |
| `quantity` | Integer | - Number of products available. |
| `isAvailable` | Boolean | - Checks if a product is available or not. <br> - A product can be available or not, thus Boolean. |

---

## Shopping Cart
| Name (property) | Data Type | Reason |
| --- | --- |
| items | Array | - holds all the products added to the cart |
| totalPrice | Double | - Sum of Prices will be double |
| discount | Double | - Stores discount percentage or amount |
| Name (Property) | Data Type | Reason |
|------------------|-----------|----------------------------------------------------------------------------------------|
| `items` | Array | - Holds all the products added to the cart. |
| `totalPrice` | Double | - Sum of prices will be a double. |
| `discount` | Double | - Stores discount percentage or amount. |

---

## Payment Details
| Name (property) | Data Type | Reason |
| --- | --- |
| cardNumber | String | - Allows payment processing systems to validate it <br> - It will be with numbers and dashes |
| totalPaid | Double | - Reflects the final amount after discounts |
| Name (Property) | Data Type | Reason |
|------------------|-----------|----------------------------------------------------------------------------------------|
| `cardNumber` | String | - Allows payment processing systems to validate it. <br> - It will be a combination of numbers and dashes. |
| `totalPaid` | Double | - Reflects the final amount after discounts. |

---

## Order Summary
| Name (property) | Data Type | Reason |
| --- | --- |
| orderId | String | - Unique identifier for each order |
| items | Array | - Lists purchased products |
| totalPrice | Double | - Reflects the amount charged |
| deliveryDate | String | - Displays estimated delivery date |
| Name (Property) | Data Type | Reason |
|------------------|-----------|----------------------------------------------------------------------------------------|
| `orderId` | String | - Unique identifier for each order. |
| `items` | Array | - Lists purchased products. |
| `totalPrice` | Double | - Reflects the amount charged. |
| `deliveryDate` | String | - Displays the estimated delivery date. |