4 Commits

Author SHA1 Message Date
7dc392631d Readme 2025-01-16 10:29:04 +01:00
98f8e0b79b Documentation, upgrade version 2025-01-16 10:23:17 +01:00
4c31ccd021 Backend documentation 2024-12-30 23:13:41 +01:00
57d35a01ba Bugfix search page (Band) 2024-12-21 21:05:06 +01:00
12 changed files with 1753 additions and 805 deletions

View File

@@ -1,3 +1,30 @@
# v.0.3.0 (Release Candidate 1)
## 🚀 Features
- Swagger Documentation
## 🐛 Bugfixes
- Bugfix on search page for Band datasets
# v.0.2.0 (Beta)
## 🚀 Features
- Adding "Test Environment" banner in the bottom right corner
- License handling system
- New SQL-Injection exercise 2.1
- Solution code based on Matrikelnummer and number of completed exercises
## 🌟 Enhancements
- Improve exercise solution of 2.1, 2.2, 2.3, 2.4 and 2.6
- Light mode improvements
- Global color schema
- More feedback through notifications
- More hints on text fields
- Redesign account pages, split payments and addresses, new dashboard
## 🐛 Bugfixes
- More server stability
- Bugfix file manager in Electron application
# v.0.1.0 (Alpha)
## 🚀 Features
- Frontend

423
README.md
View File

@@ -1,6 +1,6 @@
# EventMaster
The most hackable Web Shop!
The most hackable Ticket-Shop!
## How to use
@@ -47,424 +47,3 @@ The frontend runs on `http://localhost:5173/` and the backend on `http://localho
### Database
![database-erm](misc/images/database.png)
### Backend API endpoints
The application host it's data in a SQLite database. The access is managed by an [ExpressJs](https://expressjs.com/) server which offers many REST-API endpoints for the frontend. The REST-API server runs on port 3000.
---
#### Listing existing
<details open>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/accounts/</b></code> <code> (Get all Accounts)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<Account + AccountRole>` |
##### Example Response
```json
[
{
"id": 421,
"username": "hagemeister93",
"password": "Xjt3qb5t",
"email": "hagemeister93@gmail.com",
"firstName": "Laurin",
"lastName": "Hagemeister",
"accountRoleId": 2,
"accountRole": {
"id": 2,
"name": "Admin",
"privilegeBuy": true,
"privilegeAdminPanel": true
}
}
]
```
</details>
<details open>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/api/files</b></code> <code> (Get all public files)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<{folder: String, files: Array<{name: String, size: Number, url: String}> }>` |
##### Example Response
```json
[
{
"folder": "artists",
"files": [
{
"name": "alex-turner.jpg",
"size": 56473,
"url": "http://localhost:3000/static/artists/alex-turner.jpg"
},
{
"name": "andy-nicholson.jpg",
"size": 68983,
"url": "http://localhost:3000/static/artists/andy-nicholson.jpg"
}
]
}
]
```
</details>
<details open>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/bands/</b></code> <code> (Get all bands)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | `sort` | optional | string | Sort by number of concerts ascending (asc) or descending (desc) |
> | `count` | optional | number | Number of items to responde |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<>` |
##### Example Response
```json
[
{
"folder": "artists",
"files": [
{
"name": "alex-turner.jpg",
"size": 56473,
"url": "http://localhost:3000/static/artists/alex-turner.jpg"
},
{
"name": "andy-nicholson.jpg",
"size": 68983,
"url": "http://localhost:3000/static/artists/andy-nicholson.jpg"
}
]
}
]
```
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/events?city=cityName&genre=genreName&count=nrOfItems&sort=sortDirection</b></code> <code> (Get all events, filtered by city and genre)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | `cityName` | optional | string | Name of the city to filter for |
> | `genreName` | optional | string | Name of the genre to filter for |
> | `nrOfItems` | optional | number | Limits number of results |
> | `sortDirection` | optional | string | Sort by number of concerts, 'asc' or 'desc' |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<Event + Array<Concert + Location + City> + Band & Genre>` |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/locations?count=nrOfItems&sort=sortDirection</b></code> <code> (Get all locations)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | `nrOfItems` | optional | number | Limits number of results |
> | `sortDirection` | optional | string | Sort by number of concerts, 'asc' or 'desc' |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<Location + City + Array<Concert + Event>>` |
</details>
Down here: todo!
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/bands</b></code> <code> (Get all bands)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<Band>` |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/bands/:id</b></code> <code> (Get all information about one band)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | `id` | required | string | ID of product in the database |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Band` + `Array<Rating>` + `Array<Member>` |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/shows/:id</b></code> <code> (Get all information about one show)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | `id` | required | string | ID of product in the database |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Show` + `Tour` + `Location` + `City` |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/tours</b></code> <code> (Get all tours)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<Tours>` + `Band` + `Show` + `Location` + `City` |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/genres</b></code> <code> (Get all genres)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<Genre>` |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/orders/:id</b></code> <code> (Get all orders of an user)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | --- | --- | --- | --- |
> | `id` | required | string | ID of userAccount in the database |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `ProductModel` + `Order`, `OrderItem`, `Product` |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/categories/</b></code> <code> (Get all Categories)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<Categories>` |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/brands</b></code> <code> (Get all Brands)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `Array<Brand>` |
</details>
---
#### Creating new
<details>
<summary><code><span style="color:#69CA92"><b>POST</b></span></code> <code><b>/accounts/</b></code> <code> (Create a new account)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | None | required | object (JSON) | Model of an Account |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `201` | `application/json` | `AccountModel` |
> | `400` | `application/json` | `{code: 400, message: "Username too short!"}` |
> | `400` | `application/json` | `{code: 400, message: "Password too short!"}` |
> | `409` | `application/json` | `{code: 409, message: "Username already in use"}` |
</details>
<details>
<summary><code><span style="color:#69CA92"><b>POST</b></span></code> <code><b>/orders/</b></code> <code> (Create a new order)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | None | required | object (JSON) | Model of an Order |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `201` | `application/json` | `OrderModel` |
</details>
---
#### Updating existing
<details>
<summary><code><span style="color:#F3A63D"><b>PATCH</b></span></code> <code><b>/accounts/</b></code> <code> (Update data of an existing account)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | None | required | object (JSON) | Model of an Account |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | AccountModel |
> | `400` | `application/json` | `{code: 400, message: "..."}` |
</details>
---
#### Delete existing
<!-- <details>
<summary><code><span style="color:#EB5246"><b>DELETE</b></span></code> <code><b>/product/:id</b></code> <code> (Delete a product)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | `id` | required | string | ID of product in the database |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `ProductModel` |
> | `400` | `application/json` | `{code: 400, message: "..."}` |
</details> -->
---
#### Miscs
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/api/</b></code> <code> (Check if server runs)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | None | None |
</details>
<details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/resetDatabase/</b></code> <code> (Reset the database to it's default values)</code>
</summary>
##### Parameters
> None
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | None | None |
</details>
#### Validate
<details>
<summary><code><span style="color:#69CA92"><b>POST</b></span></code> <code><b>/accounts/login</b></code> <code> (Login for user)</code></summary>
##### Parameters
> | name | type | data type | description |
> | --- | --- | --- | --- |
> | username | required | string | Username of the account |
> | password | required | string | Password of the account |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `AccountObject` + `Addresses`, `Payments`, `AccountRole` |
> | `400` | `application/json` | `{code: 400, message: "Bad Request"}` |
> | `401` | `application/json` | `{code: 401, message: "Unauthorized"}` |
</details>
---

View File

@@ -12,9 +12,6 @@ export class AccountRole extends Model {
@Column
privilegeAdminPanel: boolean
@Column
privilegeFileAccess: boolean
// Relations
@HasMany(() => Account)

View File

@@ -103,7 +103,7 @@ band.get("/", (req: Request, res: Response) => {
/**
* Get all information about one band
*/
band.get("/:name", (req: Request, res: Response) => {
band.get("/band/:name", (req: Request, res: Response) => {
Band.findOne({
where: {
name: { [Op.like]: req.params.name }

View File

@@ -17,42 +17,9 @@ import { Op } from "sequelize";
export const concert = Router()
concert.get("/", (req: Request, res: Response) => {
let count = req.query.count
Concert.findAll({
include: [
const concertStructure = [
{
model: Location,
include: [ City ]
},
Band
],
order: [
[ 'date', 'ASC' ]
]
})
.then(concerts => {
// Limit number of items
if (count != undefined) {
concerts.splice(Number(count))
}
res.status(200).json(concerts)
})
.catch(error => {
res.status(500).send()
})
})
// Get all available data about a band by it's ID
concert.get("/concert/:id", (req: Request, res: Response) => {
Concert.findByPk(req.params.id, {
include: [
{
model: Band,
model: Band
},
{
model: Location,
@@ -83,11 +50,78 @@ concert.get("/concert/:id", (req: Request, res: Response) => {
exclude: [ "cityId" ]
}
}
],
attributes: {
exclude: [ "locationId", "tourId" ]
}
]
/**
* @swagger
* /concerts:
* get:
* summary: Get all available concerts
* tags: [Concerts]
* parameters:
* - in: query
* name: count
* schema:
* type: number
* required: false
* description: Limit number of results
* responses:
* 200:
* description: OK
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/concert'
*/
concert.get("/", (req: Request, res: Response) => {
let count = req.query.count
Concert.findAll({
include: concertStructure,
order: [
[ 'date', 'ASC' ]
]
})
.then(concerts => {
// Limit number of items
if (count != undefined) {
concerts.splice(Number(count))
}
res.status(200).json(concerts)
})
.catch(error => {
res.status(500).send()
})
})
/**
* @swagger
* /concerts/concert/{id}:
* get:
* summary: Download all available informations about a specific concert
* tags: [Concerts]
* parameters:
* - in: path
* name: id
* schema:
* type: number
* required: true
* description: ID of concert in database
* responses:
* 200:
* description: Single concert object
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/concert'
* 404:
* description: Not found
*/
concert.get("/concert/:id", (req: Request, res: Response) => {
Concert.findByPk(req.params.id, { include: concertStructure })
.then(concert => {
concert.dataValues["capacity"] = 0
@@ -125,7 +159,29 @@ concert.get("/concert/:id", (req: Request, res: Response) => {
})
// Concert search
/**
* @swagger
* /concerts/search:
* get:
* summary: Search for concerts
* tags: [Concerts]
* parameters:
* - in: query
* name: value
* schema:
* type: string
* required: true
* description: Search term
* responses:
* 200:
* description: List of concert objects
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/concert'
* 500:
* description: Internal server error
*/
concert.get("/search", (req: Request, res: Response) => {
Concert.findAll({
where: {

View File

@@ -113,7 +113,7 @@ location.get("/", (req: Request, res: Response) => {
* description: Url name of the location to request for
* responses:
* 200:
* description: List of band objects
* description: Single of location objects
* content:
* application/json:
* schema:

View File

@@ -129,8 +129,6 @@ order.get("/", verifyToken, (req: Request, res: Response) => {
order.post("/", verifyToken, (req: Request, res: Response) => {
req.body["accountId"] = req["id"]
console.log(req.body)
Order.create(req.body)
.then(async order => {
for (let ticket of req.body.tickets) {
@@ -158,6 +156,30 @@ order.post("/", verifyToken, (req: Request, res: Response) => {
})
})
/**
* @swagger
* /orders:
* patch:
* summary: Update an order
* tags: [Orders]
* parameters:
* - in: body
* name: order
* schema:
* type: object
* required: true
* description: Updated order object
* responses:
* 200:
* description: OK
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/order'
* 500:
* description: Internal server error
*/
order.patch("/", (req: Request, res: Response) => {
Order.update(req.body, {
where: {

View File

@@ -162,291 +162,60 @@
"description": "Bands with this genre object"
}
},
"example": {
"id": 849,
"urlName": "palladium",
"name": "Palladium",
"address": "Schanzenstraße 40",
"imageIndoor": "http://localhost:3000/static/locations/palladium-indoor.jpg",
"imageOutdoor": "http://localhost:3000/static/locations/palladium-outdoor.jpg",
"layout": 1,
"capacity": 50,
"city": {
"id": 250,
"name": "Köln",
"country": "Germany"
},
"seatGroups": [
"example": [
{
"id": 3949,
"name": "A",
"surcharge": 30,
"capacity": 50,
"standingArea": true,
"locationId": 849,
"seatRows": [
"id": 562,
"name": "Funk Rock",
"bands": [
{
"id": 14999,
"row": 0,
"seatGroupId": 3949,
"seats": [
{
"id": 108411,
"seatNr": 1,
"seatRowId": 14999
},
{
"id": 108412,
"seatNr": 2,
"seatRowId": 14999
},
{
"id": 108413,
"seatNr": 3,
"seatRowId": 14999
},
{
"id": 108414,
"seatNr": 4,
"seatRowId": 14999
},
{
"id": 108415,
"seatNr": 5,
"seatRowId": 14999
},
{
"id": 108416,
"seatNr": 6,
"seatRowId": 14999
},
{
"id": 108417,
"seatNr": 7,
"seatRowId": 14999
},
{
"id": 108418,
"seatNr": 8,
"seatRowId": 14999
},
{
"id": 108419,
"seatNr": 9,
"seatRowId": 14999
},
{
"id": 108420,
"seatNr": 10,
"seatRowId": 14999
},
{
"id": 108421,
"seatNr": 11,
"seatRowId": 14999
},
{
"id": 108422,
"seatNr": 12,
"seatRowId": 14999
},
{
"id": 108423,
"seatNr": 13,
"seatRowId": 14999
},
{
"id": 108424,
"seatNr": 14,
"seatRowId": 14999
},
{
"id": 108425,
"seatNr": 15,
"seatRowId": 14999
},
{
"id": 108426,
"seatNr": 16,
"seatRowId": 14999
},
{
"id": 108427,
"seatNr": 17,
"seatRowId": 14999
},
{
"id": 108428,
"seatNr": 18,
"seatRowId": 14999
},
{
"id": 108429,
"seatNr": 19,
"seatRowId": 14999
},
{
"id": 108430,
"seatNr": 20,
"seatRowId": 14999
},
{
"id": 108431,
"seatNr": 21,
"seatRowId": 14999
},
{
"id": 108432,
"seatNr": 22,
"seatRowId": 14999
},
{
"id": 108433,
"seatNr": 23,
"seatRowId": 14999
},
{
"id": 108434,
"seatNr": 24,
"seatRowId": 14999
},
{
"id": 108435,
"seatNr": 25,
"seatRowId": 14999
},
{
"id": 108436,
"seatNr": 26,
"seatRowId": 14999
},
{
"id": 108437,
"seatNr": 27,
"seatRowId": 14999
},
{
"id": 108438,
"seatNr": 28,
"seatRowId": 14999
},
{
"id": 108439,
"seatNr": 29,
"seatRowId": 14999
},
{
"id": 108440,
"seatNr": 30,
"seatRowId": 14999
},
{
"id": 108441,
"seatNr": 31,
"seatRowId": 14999
},
{
"id": 108442,
"seatNr": 32,
"seatRowId": 14999
},
{
"id": 108443,
"seatNr": 33,
"seatRowId": 14999
},
{
"id": 108444,
"seatNr": 34,
"seatRowId": 14999
},
{
"id": 108445,
"seatNr": 35,
"seatRowId": 14999
},
{
"id": 108446,
"seatNr": 36,
"seatRowId": 14999
},
{
"id": 108447,
"seatNr": 37,
"seatRowId": 14999
},
{
"id": 108448,
"seatNr": 38,
"seatRowId": 14999
},
{
"id": 108449,
"seatNr": 39,
"seatRowId": 14999
},
{
"id": 108450,
"seatNr": 40,
"seatRowId": 14999
},
{
"id": 108451,
"seatNr": 41,
"seatRowId": 14999
},
{
"id": 108452,
"seatNr": 42,
"seatRowId": 14999
},
{
"id": 108453,
"seatNr": 43,
"seatRowId": 14999
},
{
"id": 108454,
"seatNr": 44,
"seatRowId": 14999
},
{
"id": 108455,
"seatNr": 45,
"seatRowId": 14999
},
{
"id": 108456,
"seatNr": 46,
"seatRowId": 14999
},
{
"id": 108457,
"seatNr": 47,
"seatRowId": 14999
},
{
"id": 108458,
"seatNr": 48,
"seatRowId": 14999
},
{
"id": 108459,
"seatNr": 49,
"seatRowId": 14999
},
{
"id": 108460,
"seatNr": 50,
"seatRowId": 14999
}
]
}
]
}
"images": [
"http://localhost:3000/static/bands/red-hot-chili-peppers-1.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-2.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-3.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-4.jpg"
],
"nrOfConcerts": 0
"id": 265,
"name": "Red Hot Chili Peppers",
"foundingYear": 1983,
"descriptionEn": "The Red Hot Chili Peppers are an American rock band formed in Los Angeles in 1983, comprising vocalist Anthony Kiedis, bassist Flea, drummer Chad Smith, and guitarist John Frusciante. Their music incorporates elements of alternative rock, funk, punk rock, hard rock, hip hop, and psychedelic rock. Their eclectic range has influenced genres such as funk metal, rap metal, rap rock, and nu metal. With over 120 million records sold worldwide, the Red Hot Chili Peppers are one of the top-selling bands of all time.",
"descriptionDe": "Red Hot Chili Peppers (Abkürzung: RHCP) ist eine 1983 gegründete US-amerikanische Funk- und Alternative-Rockband. Sie zählt zu den kommerziell erfolgreichsten Vertretern des Crossover. Ihr Album Blood Sugar Sex Magik gilt als eines der bedeutendsten dieses Genres.",
"imageMembers": "http://localhost:3000/static/bands/red-hot-chili-peppers-members.jpg",
"logo": "http://localhost:3000/static/bands/red-hot-chili-peppers-logo.png",
"BandGenre": {
"id": 793,
"genreId": 562,
"bandId": 265
}
}
]
},
{
"id": 563,
"name": "Alternative Rock",
"bands": [
{
"images": [
"http://localhost:3000/static/bands/red-hot-chili-peppers-1.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-2.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-3.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-4.jpg"
],
"id": 265,
"name": "Red Hot Chili Peppers",
"foundingYear": 1983,
"descriptionEn": "The Red Hot Chili Peppers are an American rock band formed in Los Angeles in 1983, comprising vocalist Anthony Kiedis, bassist Flea, drummer Chad Smith, and guitarist John Frusciante. Their music incorporates elements of alternative rock, funk, punk rock, hard rock, hip hop, and psychedelic rock. Their eclectic range has influenced genres such as funk metal, rap metal, rap rock, and nu metal. With over 120 million records sold worldwide, the Red Hot Chili Peppers are one of the top-selling bands of all time.",
"descriptionDe": "Red Hot Chili Peppers (Abkürzung: RHCP) ist eine 1983 gegründete US-amerikanische Funk- und Alternative-Rockband. Sie zählt zu den kommerziell erfolgreichsten Vertretern des Crossover. Ihr Album Blood Sugar Sex Magik gilt als eines der bedeutendsten dieses Genres.",
"imageMembers": "http://localhost:3000/static/bands/red-hot-chili-peppers-members.jpg",
"logo": "http://localhost:3000/static/bands/red-hot-chili-peppers-logo.png",
"BandGenre": {
"id": 794,
"genreId": 563,
"bandId": 265
}
}
]
}
]
},
"location": {
"type": "object",
@@ -679,8 +448,7 @@
"id": 1,
"name": "User",
"privilegeBuy": true,
"privilegeAdminPanel": false,
"privilegeFileAccess": null
"privilegeAdminPanel": false
},
"payments": [
{
@@ -759,8 +527,8 @@
}
},
"example": {
"username": "artists",
"password": 41
"name": "artists",
"description": 41
}
},
"file": {
@@ -800,6 +568,91 @@
}
}
},
"concert": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "The auto-generated id"
},
"date": {
"type": "string",
"description": "Date of the concert"
},
"name": {
"type": "string",
"description": "Name of concert"
},
"price": {
"type": "string",
"description": "Lowest price of concert"
},
"image": {
"type": "number",
"description": "Concert image"
},
"inStock": {
"type": "string",
"description": "Amount of available tickets"
},
"offered": {
"type": "string",
"description": "Display concert in UI"
},
"band": {
"type": "object",
"description": "Band object"
},
"location": {
"type": "object",
"description": "Location object"
}
},
"example": [
{
"id": 892,
"date": "2024-11-30",
"name": "Unlimited Love",
"price": 92,
"image": "http://localhost:3000/static/concerts/unlimited-love-tour.jpg",
"inStock": 169,
"offered": true,
"bandId": 265,
"locationId": 834,
"band": {
"images": [
"http://localhost:3000/static/bands/red-hot-chili-peppers-1.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-2.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-3.jpg",
"http://localhost:3000/static/bands/red-hot-chili-peppers-4.jpg"
],
"id": 265,
"name": "Red Hot Chili Peppers",
"foundingYear": 1983,
"descriptionEn": "The Red Hot Chili Peppers are an American rock band formed in Los Angeles in 1983, comprising vocalist Anthony Kiedis, bassist Flea, drummer Chad Smith, and guitarist John Frusciante. Their music incorporates elements of alternative rock, funk, punk rock, hard rock, hip hop, and psychedelic rock. Their eclectic range has influenced genres such as funk metal, rap metal, rap rock, and nu metal. With over 120 million records sold worldwide, the Red Hot Chili Peppers are one of the top-selling bands of all time.",
"descriptionDe": "Red Hot Chili Peppers (Abkürzung: RHCP) ist eine 1983 gegründete US-amerikanische Funk- und Alternative-Rockband. Sie zählt zu den kommerziell erfolgreichsten Vertretern des Crossover. Ihr Album Blood Sugar Sex Magik gilt als eines der bedeutendsten dieses Genres.",
"imageMembers": "http://localhost:3000/static/bands/red-hot-chili-peppers-members.jpg",
"logo": "http://localhost:3000/static/bands/red-hot-chili-peppers-logo.png"
},
"location": {
"id": 834,
"urlName": "swiss-life-hall",
"name": "Swiss Life Hall",
"address": "Ferdinand-Wilhelm-Fricke-Weg 8",
"imageIndoor": "http://localhost:3000/static/locations/swiss-life-hall-indoor.jpg",
"imageOutdoor": "http://localhost:3000/static/locations/swiss-life-hall-outdoor.jpg",
"layout": 2,
"capacity": 180,
"city": {
"id": 246,
"name": "Hannover",
"country": "Germany"
},
"seatGroups": []
}
}
]
},
"band": {
"type": "object",
"properties": {

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "eventmaster",
"version": "0.2.0",
"version": "0.3.0",
"author": "Tobias Zoghaib",
"description": "Hackable ticket store for educational purposes",
"license": "MIT",

View File

@@ -95,13 +95,5 @@ export const useConcertStore = defineStore("concertStore", {
this.concert = new ConcertDetailsApiModel()
this.showEditDialog = true
},
editConcert(concert: ConcertModel) {
// todo
},
async deleteConcert(item: ConcertModel) {
// todo
}
}
})

View File

@@ -49,7 +49,7 @@ export const useSearchStore = defineStore("searchStore", {
// Check for exercise solution
if (result.data.length != 0) {
if (this.searchTerm.toUpperCase().includes("SELECT")) {
// Exercise 2.1
if (result.data[0].type != undefined && result.data[0].type == "table") {
exerciseStore.solveExercise(2, 1)
@@ -92,6 +92,7 @@ export const useSearchStore = defineStore("searchStore", {
}
else {
// Normal behaviour
this.bands = result.data
}
})