https://github.com/nearhuscarl/ascenda-tha
https://github.com/nearhuscarl/ascenda-tha
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nearhuscarl/ascenda-tha
- Owner: NearHuscarl
- Created: 2024-04-11T10:26:46.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-24T15:28:31.000Z (over 1 year ago)
- Last Synced: 2025-02-23T01:35:43.551Z (8 months ago)
- Language: TypeScript
- Size: 809 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Take Home Assignment
## Getting Started
```
yarn
yarn dev
```
## Testing
```
yarn test
```
## What have you done so far?
- [x] ([Code](https://github.com/NearHuscarl/ascenda-tha/blob/91f929f6c8ccb83a9220b97c2267e5c0e3b8914c/src/app/modules/hotel/api/hotels.ts#L64)|[Test](https://github.com/NearHuscarl/ascenda-tha/blob/91f929f6c8ccb83a9220b97c2267e5c0e3b8914c/src/app/modules/hotel/routes/Hotel.test.tsx#L164-L169)) When I do not have prices returned for the currency, that means the rates are unavailable for that hotel
- [x] ([Code](https://github.com/NearHuscarl/ascenda-tha/blob/91f929f6c8ccb83a9220b97c2267e5c0e3b8914c/src/app/modules/hotel/api/hotels.ts#L68)|[Test](https://github.com/NearHuscarl/ascenda-tha/blob/91f929f6c8ccb83a9220b97c2267e5c0e3b8914c/src/app/modules/hotel/routes/Hotel.test.tsx#L171-L184)) If the hotel details exist but not the prices, then show that hotel result has having "Rates unavailable" and push that result to the bottom of the list
- [x] ([Code](https://github.com/NearHuscarl/ascenda-tha/blob/91f929f6c8ccb83a9220b97c2267e5c0e3b8914c/src/app/modules/hotel/api/hotels.ts#L59-L68)|[Test](https://github.com/NearHuscarl/ascenda-tha/blob/91f929f6c8ccb83a9220b97c2267e5c0e3b8914c/src/app/modules/hotel/routes/Hotel.test.tsx#L187-L191)) If the hotel details do not exist, but prices do, do not display that hotel
- [x] ([Code](https://github.com/NearHuscarl/ascenda-tha/blob/91f929f6c8ccb83a9220b97c2267e5c0e3b8914c/src/app/modules/hotel/stores/filters.ts#L10-L18)) When I refresh the page, the results should show in the last currency selected
- [x] ([Code](https://github.com/NearHuscarl/ascenda-tha/blob/91f929f6c8ccb83a9220b97c2267e5c0e3b8914c/src/app/modules/hotel/stores/filters.ts#L12)|[Test](https://github.com/NearHuscarl/ascenda-tha/blob/91f929f6c8ccb83a9220b97c2267e5c0e3b8914c/src/app/modules/hotel/routes/Hotel.test.tsx#L194-L207)) Default the currency searched to USD if no currency was last selected
- [x] Hotel prices in the results page are typically rounded
- [x] ([Code](https://github.com/NearHuscarl/ascenda-tha/blob/91f929f6c8ccb83a9220b97c2267e5c0e3b8914c/src/app/helpers/currency.ts#L17-L24)|[Test](https://github.com/NearHuscarl/ascenda-tha/blob/91f929f6c8ccb83a9220b97c2267e5c0e3b8914c/src/app/modules/hotel/routes/Hotel.test.tsx#L209-L224)) Currencies like USD, SGD, CNY are rounded to their nearest dollar. E.g. USD 100.21 is displayed as USD 100
- [x] ([Code](https://github.com/NearHuscarl/ascenda-tha/blob/91f929f6c8ccb83a9220b97c2267e5c0e3b8914c/src/app/helpers/currency.ts#L25-L37)|[Test](https://github.com/NearHuscarl/ascenda-tha/blob/91f929f6c8ccb83a9220b97c2267e5c0e3b8914c/src/app/modules/hotel/routes/Hotel.test.tsx#L226-L233)) Currencies like KRW, JPY, IDR are rounded to their nearest 100-dollars. E.g. KRW 300123.22 is displayed as KRW 300,100
## What would you have done if you had more time?
- [ ] Responsive layout?
- [ ] Setup basic CI/CD workflow
- [ ] It's not sure whether there is a list of hardcoded currencies that should be rounded to the nearest 100-dollars or can we programmatically find out which ones need to be rounded that way? Maybe detecting the max number of decimal places (e.g. `new Intl.NumberFormat(undefined, { style: 'currency', currency: currency }).resolvedOptions().maximumFractionDigits;`). Anyway it's too late to implement this now.
## How many hours you actually spent finishing the assignment?
- ~4-5 hours