Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions frappuccino/QUESTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,27 @@

## Advanced Features

### Full-text search is implemented effectively
### All orginal endpoints are implemented correctly
- [ ] Yes
- [ ] No

### Concurrent operations are handled properly (database transactions implemented)
### Number of ordered items endpoint is implemented and works correctly with all cases (valid/invalid/no start_date, end_date;)?
- [ ] Yes
- [ ] No

### All required endpoints are implemented correctly
### Full-text search is implemented and works correctly (filters, min and max prices are working correctly)?
- [ ] Yes
- [ ] No

### Ordered items by period is implemented and works correctly (validation of query parameters implemented)?
- [ ] Yes
- [ ] No

### Get Leftovers endpoint is implemented and works correctly (pagination works correctly, response type is correct)?
- [ ] Yes
- [ ] No

### Bulk order processing is implemented and works correctly (response type is correct and changes with different inputs)?
- [ ] Yes
- [ ] No

Expand Down
30 changes: 15 additions & 15 deletions frappuccino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ Don't worry about it, everything made up for you. Just use ready `Dockerfile` an
2. Adjust the `Dockerfile` provided to run your application - edit `CMD` command accordingly
3. This will allow the project to be started with a single command:
```bash
docker compose up
docker-compose up
```

#### Important Notes
## Important Notes

- Your API will be available at *localhost:8080*
- Use these database connection settings in your code:
Expand All @@ -145,7 +145,6 @@ docker compose up
- **User**: latte
- **Password**: latte
- **Database**: frappuccino

- The init.sql file will automatically create your tables when the container starts

### New Endpoints
Expand Down Expand Up @@ -180,6 +179,7 @@ As part of the task, the following endpoints must be rewritten to work using SQL
- `GET /reports/popular-items`: Get a list of popular menu items.

In addition to rewriting the existing endpoints, you must also develop the following new ones:

#### 1. Number of ordered items
`GET /orders/numberOfOrderedItems?startDate={startDate}&endDate={endDate}`: Returns a list of ordered items and their quantities for a specified time period. If the `startDate` and `endDate` parameters are not provided, the endpoint should return data for the entire time span.
##### **Parameters**:
Expand All @@ -188,7 +188,7 @@ In addition to rewriting the existing endpoints, you must also develop the follo

Response example:
```json
GET /numberOfOrderedItems?startDate=10.11.2024&endDate=11.11.2024
GET /orders/numberOfOrderedItems?startDate=10.11.2024&endDate=11.11.2024
HTTP/1.1 200 OK
Content-Type: application/json

Expand Down Expand Up @@ -250,22 +250,22 @@ Content-Type: application/json
```

#### 3. Ordered items by period
`GET /reports/orderedItemsByPeriod?period={day|month}&month={month}`: Returns the number of orders for the specified period, grouped by day within a month or by month within a year. The `period` parameter can take the value `day` or `month`. The `month` parameter is optional and used only when `period=day`.
`GET /reports/orderedItemsByPeriod?period={daily|monthly}&month={month}`: Returns the number of orders for the specified period, grouped by day within a month or by month within a year. The `period` parameter can take the value `daily` or `monthly`. The `month` parameter is optional and used only when `period=daily`.
##### **Parameters**:
- `period` _(required)_:
- `day`: Groups data by day within the specified month.
- `month`: Groups data by month within the specified year.
- `month` _(optional)_: Specifies the month (e.g., `october`). Used only if `period=day`.
- `year` _(optional)_: Specifies the year. Used only if `period=month`.
- `daily`: Groups data by day within the specified month.
- `monthly`: Groups data by month within the specified year.
- `month` _(optional)_: Specifies the month (e.g., `october`). Used only if `period=daily`.
- `year` _(optional)_: Specifies the year. Used only if `period=monthly`.

Response example:
```json
GET /orderedItemsByPeriod?period=day&month=october
GET /reports/orderedItemsByPeriod?period=daily&month=october
HTTP/1.1 200 OK
Content-Type: application/json

{
"period": "day",
"period": "daily",
"month": "october",
"orderedItems": [
{ "1": 109 },
Expand Down Expand Up @@ -306,12 +306,12 @@ Content-Type: application/json

Response example:
```json
GET /orderedItemsByPeriod?period=month&year=2023
GET /reports/orderedItemsByPeriod?period=monthly&year=2023
HTTP/1.1 200 OK
Content-Type: application/json

{
"period": "month",
"period": "monthly",
"year": "2023",
"orderedItems": [
{ "january": 6528 },
Expand Down Expand Up @@ -347,7 +347,7 @@ Content-Type: application/json

Response example:
```json
GET /getLeftOvers?sortBy=quantity?page=1&pageSize=4
GET /inventory/getLeftOvers?sortBy=quantity?page=1&pageSize=4
HTTP/1.1 200 OK
Content-Type: application/json

Expand Down Expand Up @@ -449,7 +449,7 @@ Response example:
}
```

### Initial Setup
## Initial Setup

You need to create an `init.sql` file that will set up the complete database structure. This file must include:

Expand Down