Exercisegroup 0 and 1 complete implemented
This commit is contained in:
@@ -4,19 +4,29 @@
|
|||||||
"id": 0,
|
"id": 0,
|
||||||
"name": "Unregistered",
|
"name": "Unregistered",
|
||||||
"privilegeBuy": false,
|
"privilegeBuy": false,
|
||||||
"privilegeAdminPanel": false
|
"privilegeAdminPanel": false,
|
||||||
|
"privilegeFileAccess": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"name": "User",
|
"name": "User",
|
||||||
"privilegeBuy": true,
|
"privilegeBuy": true,
|
||||||
"privilegeAdminPanel": false
|
"privilegeAdminPanel": false,
|
||||||
|
"privilegeFileAccess": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"name": "Admin",
|
"name": "Admin",
|
||||||
"privilegeBuy": true,
|
"privilegeBuy": true,
|
||||||
"privilegeAdminPanel": true
|
"privilegeAdminPanel": true,
|
||||||
|
"privilegeFileAccess": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"name": "Super-Admin",
|
||||||
|
"privilegeBuy": true,
|
||||||
|
"privilegeAdminPanel": true,
|
||||||
|
"privilegeFileAccess": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -72,31 +72,31 @@
|
|||||||
"image": "concerts/unlimited-love-tour.jpg",
|
"image": "concerts/unlimited-love-tour.jpg",
|
||||||
"concerts": [
|
"concerts": [
|
||||||
{
|
{
|
||||||
"date": "2024-10-18",
|
"date": "1",
|
||||||
"price": 92,
|
|
||||||
"inStock": 0,
|
|
||||||
"location": "Swiss Life Hall"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"date": "2024-10-20",
|
|
||||||
"price": 92,
|
"price": 92,
|
||||||
"inStock": 170,
|
"inStock": 170,
|
||||||
"location": "Swiss Life Hall"
|
"location": "Swiss Life Hall"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2024-11-02",
|
"date": "4",
|
||||||
|
"price": 92,
|
||||||
|
"inStock": 170,
|
||||||
|
"location": "Swiss Life Hall"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "8",
|
||||||
"price": 119.90,
|
"price": 119.90,
|
||||||
"inStock": 8736,
|
"inStock": 8736,
|
||||||
"location": "Olympiahalle München"
|
"location": "Olympiahalle München"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2024-11-05",
|
"date": "12",
|
||||||
"price": 114.90,
|
"price": 114.90,
|
||||||
"inStock": 2793,
|
"inStock": 2793,
|
||||||
"location": "Barclays Arena"
|
"location": "Barclays Arena"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2024-11-09",
|
"date": "13",
|
||||||
"price": 124.90,
|
"price": 124.90,
|
||||||
"inStock": 3079,
|
"inStock": 3079,
|
||||||
"location": "Uber Arena Berlin"
|
"location": "Uber Arena Berlin"
|
||||||
@@ -162,19 +162,19 @@
|
|||||||
"image": "concerts/the-bends-tour.jpg",
|
"image": "concerts/the-bends-tour.jpg",
|
||||||
"concerts": [
|
"concerts": [
|
||||||
{
|
{
|
||||||
"date": "2024-11-30",
|
"date": "10",
|
||||||
"price": 108,
|
"price": 108,
|
||||||
"inStock": 1200,
|
"inStock": 1200,
|
||||||
"location": "Capitol"
|
"location": "Capitol"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2024-12-01",
|
"date": "14",
|
||||||
"price": 104,
|
"price": 104,
|
||||||
"inStock": 1800,
|
"inStock": 1800,
|
||||||
"location": "Schlachthof München"
|
"location": "Schlachthof München"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2024-12-07",
|
"date": "16",
|
||||||
"price": 99.90,
|
"price": 99.90,
|
||||||
"inStock": 2438,
|
"inStock": 2438,
|
||||||
"location": "Waldbühne Berlin"
|
"location": "Waldbühne Berlin"
|
||||||
@@ -242,20 +242,20 @@
|
|||||||
"image": "concerts/european-tour-arctic-monkeys.jpg",
|
"image": "concerts/european-tour-arctic-monkeys.jpg",
|
||||||
"concerts": [
|
"concerts": [
|
||||||
{
|
{
|
||||||
"date": "2025-01-21",
|
"date": "18",
|
||||||
"price": 67.90,
|
"price": 67.90,
|
||||||
"inStock": 994,
|
"inStock": 994,
|
||||||
"location": "Kulturzentrum Faust"
|
"location": "Kulturzentrum Faust"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2024-10-30",
|
"date": "21",
|
||||||
"price": 79.90,
|
"price": 79.90,
|
||||||
"inStock": 1073,
|
"inStock": 1073,
|
||||||
"location": "LANXESS arena",
|
"location": "LANXESS arena",
|
||||||
"offered": false
|
"offered": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2024-10-23",
|
"date": "24",
|
||||||
"price": 74.90,
|
"price": 74.90,
|
||||||
"inStock": 100,
|
"inStock": 100,
|
||||||
"location": "Columbiahalle"
|
"location": "Columbiahalle"
|
||||||
@@ -318,19 +318,19 @@
|
|||||||
"image": "concerts/music-of-the-spheres.png",
|
"image": "concerts/music-of-the-spheres.png",
|
||||||
"concerts": [
|
"concerts": [
|
||||||
{
|
{
|
||||||
"date": "2024-12-07",
|
"date": "8",
|
||||||
"price": 124.90,
|
"price": 124.90,
|
||||||
"inStock": 765,
|
"inStock": 765,
|
||||||
"location": "Astra Kulturhaus"
|
"location": "Astra Kulturhaus"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2025-01-17",
|
"date": "15",
|
||||||
"price": 129.90,
|
"price": 129.90,
|
||||||
"inStock": 989,
|
"inStock": 989,
|
||||||
"location": "Waldbühne Berlin"
|
"location": "Waldbühne Berlin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2025-02-01",
|
"date": "22",
|
||||||
"price": 134.90,
|
"price": 134.90,
|
||||||
"inStock": 827,
|
"inStock": 827,
|
||||||
"location": "Olympiahalle München"
|
"location": "Olympiahalle München"
|
||||||
@@ -393,7 +393,7 @@
|
|||||||
"image": "concerts/but-here-we-are.jpg",
|
"image": "concerts/but-here-we-are.jpg",
|
||||||
"concerts": [
|
"concerts": [
|
||||||
{
|
{
|
||||||
"date": "2024-12-05",
|
"date": "30",
|
||||||
"price": 80,
|
"price": 80,
|
||||||
"inStock": 99,
|
"inStock": 99,
|
||||||
"location": "ZAG Arena"
|
"location": "ZAG Arena"
|
||||||
@@ -462,13 +462,13 @@
|
|||||||
"image": "concerts/crisis-of-faith-tour.jpg",
|
"image": "concerts/crisis-of-faith-tour.jpg",
|
||||||
"concerts": [
|
"concerts": [
|
||||||
{
|
{
|
||||||
"date": "2025-01-12",
|
"date": "3",
|
||||||
"price": 81.90,
|
"price": 81.90,
|
||||||
"inStock": 173,
|
"inStock": 173,
|
||||||
"location": "ZAG Arena"
|
"location": "ZAG Arena"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2025-02-01",
|
"date": "6",
|
||||||
"price": 84.90,
|
"price": 84.90,
|
||||||
"inStock": 192,
|
"inStock": 192,
|
||||||
"location": "Muffatwerk"
|
"location": "Muffatwerk"
|
||||||
@@ -523,19 +523,19 @@
|
|||||||
"image": "concerts/back-to-the-water-below.jpg",
|
"image": "concerts/back-to-the-water-below.jpg",
|
||||||
"concerts": [
|
"concerts": [
|
||||||
{
|
{
|
||||||
"date": "2024-10-19",
|
"date": "10",
|
||||||
"price": 64.90,
|
"price": 64.90,
|
||||||
"inStock": 245,
|
"inStock": 245,
|
||||||
"location": "E-Werk"
|
"location": "E-Werk"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2025-02-27",
|
"date": "20",
|
||||||
"price": 67.90,
|
"price": 67.90,
|
||||||
"inStock": 847,
|
"inStock": 847,
|
||||||
"location": "Kulturzentrum Faust"
|
"location": "Kulturzentrum Faust"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2025-03-06",
|
"date": "29",
|
||||||
"price": 64.90,
|
"price": 64.90,
|
||||||
"inStock": 245,
|
"inStock": 245,
|
||||||
"location": "Waldbühne Berlin"
|
"location": "Waldbühne Berlin"
|
||||||
@@ -595,13 +595,13 @@
|
|||||||
"image": "concerts/simulation-theory.jpg",
|
"image": "concerts/simulation-theory.jpg",
|
||||||
"concerts": [
|
"concerts": [
|
||||||
{
|
{
|
||||||
"date": "2024-10-21",
|
"date": "7",
|
||||||
"price": 67.90,
|
"price": 67.90,
|
||||||
"inStock": 847,
|
"inStock": 847,
|
||||||
"location": "Volksparkstadion"
|
"location": "Volksparkstadion"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2024-10-20",
|
"date": "17",
|
||||||
"price": 67.90,
|
"price": 67.90,
|
||||||
"inStock": 847,
|
"inStock": 847,
|
||||||
"location": "LANXESS arena"
|
"location": "LANXESS arena"
|
||||||
@@ -613,31 +613,31 @@
|
|||||||
"image": "concerts/will-of-the-people-tour.jpg",
|
"image": "concerts/will-of-the-people-tour.jpg",
|
||||||
"concerts": [
|
"concerts": [
|
||||||
{
|
{
|
||||||
"date": "2025-01-15",
|
"date": "32",
|
||||||
"price": 67.90,
|
"price": 67.90,
|
||||||
"inStock": 847,
|
"inStock": 847,
|
||||||
"location": "ZAG Arena"
|
"location": "ZAG Arena"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2025-01-15",
|
"date": "39",
|
||||||
"price": 67.90,
|
"price": 67.90,
|
||||||
"inStock": 847,
|
"inStock": 847,
|
||||||
"location": "ZAG Arena"
|
"location": "ZAG Arena"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2025-01-23",
|
"date": "41",
|
||||||
"price": 64.90,
|
"price": 64.90,
|
||||||
"inStock": 245,
|
"inStock": 245,
|
||||||
"location": "Olympiastadion Berlin"
|
"location": "Olympiastadion Berlin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2025-02-02",
|
"date": "45",
|
||||||
"price": 64.90,
|
"price": 64.90,
|
||||||
"inStock": 245,
|
"inStock": 245,
|
||||||
"location": "Astra Kulturhaus"
|
"location": "Astra Kulturhaus"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2025-02-05",
|
"date": "50",
|
||||||
"price": 64.90,
|
"price": 64.90,
|
||||||
"inStock": 245,
|
"inStock": 245,
|
||||||
"location": "Astra Kulturhaus"
|
"location": "Astra Kulturhaus"
|
||||||
|
|||||||
@@ -12,10 +12,17 @@
|
|||||||
"descriptionDe": "Erstelle einen neuen Account im Online Shop",
|
"descriptionDe": "Erstelle einen neuen Account im Online Shop",
|
||||||
"descriptionEn": "Create a new account in the online shop"
|
"descriptionEn": "Create a new account in the online shop"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"nameDe": "Profil vervollständigen",
|
||||||
|
"nameEn": "Complete profile",
|
||||||
|
"exerciseNr": 2,
|
||||||
|
"descriptionDe": "Suche dir ein Event deiner Wahl und kaufe dafür ein Ticket",
|
||||||
|
"descriptionEn": "Search for an event of choice and buy a ticket for"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"nameDe": "Ein Ticket kaufen",
|
"nameDe": "Ein Ticket kaufen",
|
||||||
"nameEn": "Buy a ticket",
|
"nameEn": "Buy a ticket",
|
||||||
"exerciseNr": 2,
|
"exerciseNr": 3,
|
||||||
"descriptionDe": "Suche dir ein Event deiner Wahl und kaufe dafür ein Ticket",
|
"descriptionDe": "Suche dir ein Event deiner Wahl und kaufe dafür ein Ticket",
|
||||||
"descriptionEn": "Search for an event of choice and buy a ticket for"
|
"descriptionEn": "Search for an event of choice and buy a ticket for"
|
||||||
}
|
}
|
||||||
@@ -25,6 +32,8 @@
|
|||||||
"nameDe": "Broken Access Control",
|
"nameDe": "Broken Access Control",
|
||||||
"nameEn": "Broken Access Control",
|
"nameEn": "Broken Access Control",
|
||||||
"groupNr": 1,
|
"groupNr": 1,
|
||||||
|
"descriptionDe": "Eine Webseite beinhaltet oft öffentlich einsehbare und einige Seiten, die nur mit passenden Berechtigungen erreicht werden dürfen, z.B. ein Admin-Panel oder einen Account-Bereich. Jede Seite ist über einen Suffix (z.B. '/concerts') erreichbar. Der Zugriff wird oft über Cookies oder eine Authentifizierung an einem Backend-Server geregelt. Bei Broken Access Control ist dieser Sicherheits-Mechanismus nicht oder fehlerhaft implementiert. Somit lassen sich Seiten unberechtigterweise über die URL erreichen.",
|
||||||
|
"descriptionEn": "todo",
|
||||||
"exercises": [
|
"exercises": [
|
||||||
{
|
{
|
||||||
"nameDe": "Hilfe-Seite aufrufen",
|
"nameDe": "Hilfe-Seite aufrufen",
|
||||||
@@ -39,6 +48,13 @@
|
|||||||
"exerciseNr": 2,
|
"exerciseNr": 2,
|
||||||
"descriptionDe": "Manipuliere die URL so, dass du das ausgebuchte Konzert aufrufen kannst und buche ein Ticket dafür",
|
"descriptionDe": "Manipuliere die URL so, dass du das ausgebuchte Konzert aufrufen kannst und buche ein Ticket dafür",
|
||||||
"descriptionEn": "Manipulate the URL and access the sold out concert and buy a ticket"
|
"descriptionEn": "Manipulate the URL and access the sold out concert and buy a ticket"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nameDe": "Das Admin-Panel aufrufen",
|
||||||
|
"nameEn": "Access the Admin-Panel",
|
||||||
|
"exerciseNr": 3,
|
||||||
|
"descriptionDe": "Manipuliere die URL so, dass du das Admin-Panel erreichen kannst",
|
||||||
|
"descriptionEn": "Manipulate the URL and access the admin page"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -46,23 +62,25 @@
|
|||||||
"nameDe": "SQL Injections",
|
"nameDe": "SQL Injections",
|
||||||
"nameEn": "SQL Injections",
|
"nameEn": "SQL Injections",
|
||||||
"groupNr": 2,
|
"groupNr": 2,
|
||||||
|
"descriptionDe": "HTML und CSS sind für die Struktur und die Gestaltung einer Webseite verantwortlich. Um jedoch Programmcode für dynamische Inhalte auszuführen wird die Programmiersprache JavaScript verwendet, welche Programmcode direkt im Browser ausführen kann. Diese Scripts können nun aber auch Schaden anrichten, wenn sie im Rahmen eines Angriffs eingeschmuggelt werden.",
|
||||||
|
"descriptionEn": "todo",
|
||||||
"exercises": [
|
"exercises": [
|
||||||
{
|
{
|
||||||
"nameDe": "Accountnamen auslesen",
|
"nameDe": "Einen fremden Account übernehmen",
|
||||||
"nameEn": "Readout account names",
|
"nameEn": "Capture an account",
|
||||||
"exerciseNr": 1,
|
"exerciseNr": 1,
|
||||||
"descriptionDe": "Lasse dir alle Accountnamen über das Suchfeld ausgeben",
|
"descriptionDe": "Führe auf der Login-Seite eine SQL-Injection durch, so dass du Zugriff auf einen Account mit 'Super Admin'-Berechtigungen erlangst",
|
||||||
"descriptionEn": "Readout all account names via the search field"
|
"descriptionEn": "Execute an SQL-Injection on the Login page. Try to capture an account with 'Super Admin' privilege."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nameDe": "Passwort auslesen",
|
"nameDe": "Bestellungen abfragen",
|
||||||
"nameEn": "Readout password",
|
"nameEn": "Readout password",
|
||||||
"exerciseNr": 2,
|
"exerciseNr": 2,
|
||||||
"descriptionDe": "Versuche ein Passwort aus der Datenbank eines Accounts auszulesen",
|
"descriptionDe": "Versuche ein Passwort aus der Datenbank eines Accounts auszulesen",
|
||||||
"descriptionEn": "Get the password of an account from the database"
|
"descriptionEn": "Get the password of an account from the database"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nameDe": "Verändere deine Account Berechtigungen",
|
"nameDe": "Band-Bewertungen manipulieren",
|
||||||
"nameEn": "Change your account role",
|
"nameEn": "Change your account role",
|
||||||
"exerciseNr": 3,
|
"exerciseNr": 3,
|
||||||
"descriptionDe": "Ändere die Berechtigungen deines Accounts",
|
"descriptionDe": "Ändere die Berechtigungen deines Accounts",
|
||||||
@@ -74,6 +92,8 @@
|
|||||||
"nameDe": "Cross-Site Scripting (XSS)",
|
"nameDe": "Cross-Site Scripting (XSS)",
|
||||||
"nameEn": "Cross-Site Scripting (XSS)",
|
"nameEn": "Cross-Site Scripting (XSS)",
|
||||||
"groupNr": 3,
|
"groupNr": 3,
|
||||||
|
"descriptionDe": "todo",
|
||||||
|
"descriptionEn": "todo",
|
||||||
"exercises": [
|
"exercises": [
|
||||||
{
|
{
|
||||||
"nameDe": "Hallo Welt!",
|
"nameDe": "Hallo Welt!",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"shipped": true,
|
"shipped": true,
|
||||||
"tickets": [
|
"tickets": [
|
||||||
{
|
{
|
||||||
"date": "2024-10-18",
|
"date": "1",
|
||||||
"concertGroupName": "Unlimited Love",
|
"concertGroupName": "Unlimited Love",
|
||||||
"orderPrice": 184,
|
"orderPrice": 184,
|
||||||
"seatGroup": "A",
|
"seatGroup": "A",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
"username": "duranduran",
|
"username": "duranduran",
|
||||||
"tickets": [
|
"tickets": [
|
||||||
{
|
{
|
||||||
"date": "2024-10-18",
|
"date": "4",
|
||||||
"concertGroupName": "Unlimited Love",
|
"concertGroupName": "Unlimited Love",
|
||||||
"orderPrice": 184,
|
"orderPrice": 184,
|
||||||
"seatGroup": "A",
|
"seatGroup": "A",
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
"seat": 2
|
"seat": 2
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"date": "2024-10-18",
|
"date": "4",
|
||||||
"concertGroupName": "Unlimited Love",
|
"concertGroupName": "Unlimited Love",
|
||||||
"orderPrice": 184,
|
"orderPrice": 184,
|
||||||
"seatGroup": "A",
|
"seatGroup": "A",
|
||||||
@@ -39,8 +39,8 @@
|
|||||||
"username": "duranduran",
|
"username": "duranduran",
|
||||||
"tickets": [
|
"tickets": [
|
||||||
{
|
{
|
||||||
"date": "2024-10-18",
|
"date": "14",
|
||||||
"concertGroupName": "Unlimited Love",
|
"concertGroupName": "The Bends",
|
||||||
"orderPrice": 184,
|
"orderPrice": 184,
|
||||||
"seatGroup": "A",
|
"seatGroup": "A",
|
||||||
"seatRow": 0,
|
"seatRow": 0,
|
||||||
|
|||||||
@@ -12,6 +12,12 @@ export class ExerciseGroup extends Model {
|
|||||||
@Column
|
@Column
|
||||||
groupNr: number
|
groupNr: number
|
||||||
|
|
||||||
|
@Column
|
||||||
|
descriptionDe: string
|
||||||
|
|
||||||
|
@Column
|
||||||
|
descriptionEn: string
|
||||||
|
|
||||||
|
|
||||||
// Relations
|
// Relations
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ export class AccountRole extends Model {
|
|||||||
@Column
|
@Column
|
||||||
privilegeAdminPanel: boolean
|
privilegeAdminPanel: boolean
|
||||||
|
|
||||||
|
@Column
|
||||||
|
privilegeFileAccess: boolean
|
||||||
|
|
||||||
|
|
||||||
// Relations
|
// Relations
|
||||||
@HasMany(() => Account)
|
@HasMany(() => Account)
|
||||||
|
|||||||
@@ -30,26 +30,14 @@ account.get("/login", async (req: Request, res: Response) => {
|
|||||||
"' AND password='" + req.query.password + "')"
|
"' AND password='" + req.query.password + "')"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Mechanism to check exercise solved
|
|
||||||
if (results.length > 1) {
|
|
||||||
Exercise.update(
|
|
||||||
{ solved: true },
|
|
||||||
{
|
|
||||||
where: {
|
|
||||||
nameEn: "Register"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (results.length != 0) {
|
if (results.length != 0) {
|
||||||
// Creating session token
|
// Creating session token
|
||||||
const token = jwt.sign({ userId: results[0]["id"] }, 'sjcucjdkdf')
|
const token = jwt.sign({ userId: results[0]["id"] }, 'sjcucjdkdf')
|
||||||
|
|
||||||
// Status: 200 OK
|
// Status: 200 OK
|
||||||
res.status(200).json({
|
res.status(200).json({
|
||||||
"success": true,
|
success: true,
|
||||||
"token": token
|
token: token
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// Status: 401 Unauthorized
|
// Status: 401 Unauthorized
|
||||||
@@ -124,7 +112,7 @@ account.patch("/", verifyToken, (req: Request, res: Response) => {
|
|||||||
{
|
{
|
||||||
where: { id: req.body.id }
|
where: { id: req.body.id }
|
||||||
})
|
})
|
||||||
.then(async account => {
|
.then(async result => {
|
||||||
for (let payment of req.body.payments) {
|
for (let payment of req.body.payments) {
|
||||||
if (payment.id == undefined) {
|
if (payment.id == undefined) {
|
||||||
payment["accountId"] = req.body.id
|
payment["accountId"] = req.body.id
|
||||||
|
|||||||
@@ -296,9 +296,8 @@ export async function prepopulateDatabase() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(async location => {
|
.then(async location => {
|
||||||
console.log(concert.offered)
|
|
||||||
concerts.push({
|
concerts.push({
|
||||||
date: concert.date,
|
date: moment().add(concert.date, "days").format("YYYY-MM-DD"),
|
||||||
name: concertGroup.name,
|
name: concertGroup.name,
|
||||||
price: concert.price,
|
price: concert.price,
|
||||||
image: "http://localhost:3000/static/" + concertGroup.image,
|
image: "http://localhost:3000/static/" + concertGroup.image,
|
||||||
@@ -354,7 +353,7 @@ export async function prepopulateDatabase() {
|
|||||||
where: {
|
where: {
|
||||||
[Op.and] : [
|
[Op.and] : [
|
||||||
{ name: ticket.concertGroupName },
|
{ name: ticket.concertGroupName },
|
||||||
{ date: ticket.date }
|
{ date: moment().add(ticket.date, "days").format("YYYY-MM-DD") }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ export enum BannerStateEnum {
|
|||||||
|
|
||||||
EXERCISESOLVED02,
|
EXERCISESOLVED02,
|
||||||
|
|
||||||
|
EXERCISESOLVED03,
|
||||||
|
|
||||||
EXERCISESOLVED11,
|
EXERCISESOLVED11,
|
||||||
|
|
||||||
EXERCISESOLVED12,
|
EXERCISESOLVED12,
|
||||||
|
|||||||
@@ -3,4 +3,6 @@ export class ExerciseGroupModel {
|
|||||||
nameDe: string = ""
|
nameDe: string = ""
|
||||||
nameEn: string = ""
|
nameEn: string = ""
|
||||||
groupNr: number = 0
|
groupNr: number = 0
|
||||||
|
descriptionDe: string = ""
|
||||||
|
descriptionEn: string = ""
|
||||||
}
|
}
|
||||||
@@ -172,6 +172,7 @@
|
|||||||
"databaseResetSuccessful": "Datenbank erfolgreich zurück gesetzt!",
|
"databaseResetSuccessful": "Datenbank erfolgreich zurück gesetzt!",
|
||||||
"exerciseProgressResetSuccessful": "Aufgabenfortschritt erfolgreich zurück gesetzt!",
|
"exerciseProgressResetSuccessful": "Aufgabenfortschritt erfolgreich zurück gesetzt!",
|
||||||
"registerSuccessful": "Account erfolgreich erstellt!",
|
"registerSuccessful": "Account erfolgreich erstellt!",
|
||||||
|
"registerError": "Fehler beim Erstellen des Accounts",
|
||||||
"usernameInUse": "Der Accountname ist bereits vergeben!",
|
"usernameInUse": "Der Accountname ist bereits vergeben!",
|
||||||
"accountUpdated": "Account erfolgreich aktualisiert",
|
"accountUpdated": "Account erfolgreich aktualisiert",
|
||||||
"logoutSuccessful": "Logout erfolgreich",
|
"logoutSuccessful": "Logout erfolgreich",
|
||||||
|
|||||||
@@ -172,6 +172,7 @@
|
|||||||
"databaseResetSuccessful": "Database successfully resetted!",
|
"databaseResetSuccessful": "Database successfully resetted!",
|
||||||
"exerciseProgressResetSuccessful": "Exercise progress successfully resetted!",
|
"exerciseProgressResetSuccessful": "Exercise progress successfully resetted!",
|
||||||
"registerSuccessful": "Account successfully created!",
|
"registerSuccessful": "Account successfully created!",
|
||||||
|
"registerError": "Error on register account",
|
||||||
"usernameInUse": "The username is already in use!",
|
"usernameInUse": "The username is already in use!",
|
||||||
"accountUpdated": "Account successfully updated",
|
"accountUpdated": "Account successfully updated",
|
||||||
"logoutSuccessful": "Logout successfull",
|
"logoutSuccessful": "Logout successfull",
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { usePreferencesStore } from '@/stores/preferences.store';
|
|||||||
import dashboardCard from './dashboardCard.vue';
|
import dashboardCard from './dashboardCard.vue';
|
||||||
import { useOrderStore } from '@/stores/order.store';
|
import { useOrderStore } from '@/stores/order.store';
|
||||||
import { useFilesStore } from '@/stores/files.store';
|
import { useFilesStore } from '@/stores/files.store';
|
||||||
|
import { useExerciseStore } from '@/stores/exercise.store';
|
||||||
|
|
||||||
const concertStore = useConcertStore()
|
const concertStore = useConcertStore()
|
||||||
const bandStore = useBandStore()
|
const bandStore = useBandStore()
|
||||||
@@ -17,6 +18,9 @@ const locationStore = useLocationStore()
|
|||||||
const preferencesStore = usePreferencesStore()
|
const preferencesStore = usePreferencesStore()
|
||||||
const orderStore = useOrderStore()
|
const orderStore = useOrderStore()
|
||||||
const filesStore = useFilesStore()
|
const filesStore = useFilesStore()
|
||||||
|
const exerciseStore = useExerciseStore()
|
||||||
|
|
||||||
|
exerciseStore.solveExercise(1, 3)
|
||||||
|
|
||||||
filesStore.getStaticFolders()
|
filesStore.getStaticFolders()
|
||||||
bandStore.getBands()
|
bandStore.getBands()
|
||||||
|
|||||||
@@ -21,7 +21,14 @@ onMounted(async () => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(() => router.currentRoute.value.params.id, () => {
|
watch(() => router.currentRoute.value.params.locationUrl, () => {
|
||||||
|
concertStore.getConcert(
|
||||||
|
String(router.currentRoute.value.params.locationUrl),
|
||||||
|
String(router.currentRoute.value.params.date)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(() => router.currentRoute.value.params.date, () => {
|
||||||
concertStore.getConcert(
|
concertStore.getConcert(
|
||||||
String(router.currentRoute.value.params.locationUrl),
|
String(router.currentRoute.value.params.locationUrl),
|
||||||
String(router.currentRoute.value.params.date)
|
String(router.currentRoute.value.params.date)
|
||||||
|
|||||||
@@ -139,9 +139,20 @@ export const useAccountStore = defineStore("accountStore", {
|
|||||||
*/
|
*/
|
||||||
async updateAccount() {
|
async updateAccount() {
|
||||||
const feedbackStore = useFeedbackStore()
|
const feedbackStore = useFeedbackStore()
|
||||||
|
const exerciseStore = useExerciseStore()
|
||||||
|
|
||||||
|
// Check for exercise 0.2 completion
|
||||||
|
let accountComplete = this.userAccount.firstName != "" && this.userAccount.lastName != "" &&
|
||||||
|
this.userAccount.addresses.length != 0 && this.userAccount.payments.length != 0
|
||||||
|
|
||||||
|
if (accountComplete) {
|
||||||
|
exerciseStore.solveExercise(0, 2)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update in backend
|
||||||
await updateAccount(this.userAccount, this.userAccountToken)
|
await updateAccount(this.userAccount, this.userAccountToken)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
feedbackStore.addSnackbar(BannerStateEnum.ACCOUNTUPDATESUCCESSFUL)
|
feedbackStore.addSnackbar(BannerStateEnum.ACCOUNTUPDATESUCCESSFUL)
|
||||||
|
|
||||||
|
|||||||
@@ -109,18 +109,21 @@ export const useBasketStore = defineStore('basketStore', {
|
|||||||
if (result.status == 201) {
|
if (result.status == 201) {
|
||||||
await accountStore.refreshOrders()
|
await accountStore.refreshOrders()
|
||||||
|
|
||||||
this.itemsInBasket = []
|
|
||||||
feedbackStore.addSnackbar(BannerStateEnum.ORDERPLACESUCCESSFUL)
|
feedbackStore.addSnackbar(BannerStateEnum.ORDERPLACESUCCESSFUL)
|
||||||
|
|
||||||
// Exercise 0.2 is solved
|
// Exercise 0.3 is solved
|
||||||
exerciseStore.solveExercise(0, 2)
|
exerciseStore.solveExercise(0, 3)
|
||||||
|
|
||||||
for (let ticket of this.itemsInBasket) {
|
console.log(this.itemsInBasket)
|
||||||
if (!ticket.concert.offered) {
|
|
||||||
|
for (let item of this.itemsInBasket) {
|
||||||
|
if (!item.concert.offered) {
|
||||||
exerciseStore.solveExercise(1, 2)
|
exerciseStore.solveExercise(1, 2)
|
||||||
feedbackStore.addSnackbar(BannerStateEnum.EXERCISESOLVED12)
|
feedbackStore.addSnackbar(BannerStateEnum.EXERCISESOLVED12)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.itemsInBasket = []
|
||||||
} else {
|
} else {
|
||||||
feedbackStore.addSnackbar(BannerStateEnum.ERROR)
|
feedbackStore.addSnackbar(BannerStateEnum.ERROR)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ export const useExerciseStore = defineStore("exerciseStore", {
|
|||||||
switch(exerciseNr) {
|
switch(exerciseNr) {
|
||||||
case 1: bannerState = BannerStateEnum.EXERCISESOLVED01; break;
|
case 1: bannerState = BannerStateEnum.EXERCISESOLVED01; break;
|
||||||
case 2: bannerState = BannerStateEnum.EXERCISESOLVED02; break;
|
case 2: bannerState = BannerStateEnum.EXERCISESOLVED02; break;
|
||||||
|
case 3: bannerState = BannerStateEnum.EXERCISESOLVED03; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { Composer } from 'vue-i18n';
|
|||||||
/**
|
/**
|
||||||
* Logic of the bubble notifications
|
* Logic of the bubble notifications
|
||||||
* Includes an i18n object for translation
|
* Includes an i18n object for translation
|
||||||
|
* Includes a variable for redirecting to 404 page
|
||||||
*/
|
*/
|
||||||
export const useFeedbackStore = defineStore("feedbackStore", {
|
export const useFeedbackStore = defineStore("feedbackStore", {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
@@ -14,15 +15,6 @@ export const useFeedbackStore = defineStore("feedbackStore", {
|
|||||||
/** Show notification banner in top right corner */
|
/** Show notification banner in top right corner */
|
||||||
showSnackbar: ref(false),
|
showSnackbar: ref(false),
|
||||||
|
|
||||||
/** Text in the notification banner */
|
|
||||||
title: ref(""),
|
|
||||||
|
|
||||||
/** Color of the notification banner */
|
|
||||||
color: ref(""),
|
|
||||||
|
|
||||||
/** Prepend icon of the notification banner */
|
|
||||||
icon: ref(""),
|
|
||||||
|
|
||||||
/** Programmatically access to language translation module */
|
/** Programmatically access to language translation module */
|
||||||
$i18n: {},
|
$i18n: {},
|
||||||
|
|
||||||
@@ -70,6 +62,9 @@ export const useFeedbackStore = defineStore("feedbackStore", {
|
|||||||
case BannerStateEnum.EXERCISESOLVED02:
|
case BannerStateEnum.EXERCISESOLVED02:
|
||||||
return this.i18n.t("bannerMessages.exerciseSolvedNr", [0, 2])
|
return this.i18n.t("bannerMessages.exerciseSolvedNr", [0, 2])
|
||||||
|
|
||||||
|
case BannerStateEnum.EXERCISESOLVED03:
|
||||||
|
return this.i18n.t("bannerMessages.exerciseSolvedNr", [0, 3])
|
||||||
|
|
||||||
|
|
||||||
case BannerStateEnum.EXERCISESOLVED11:
|
case BannerStateEnum.EXERCISESOLVED11:
|
||||||
return this.i18n.t("bannerMessages.exerciseSolvedNr", [1, 1])
|
return this.i18n.t("bannerMessages.exerciseSolvedNr", [1, 1])
|
||||||
@@ -131,6 +126,9 @@ export const useFeedbackStore = defineStore("feedbackStore", {
|
|||||||
case BannerStateEnum.ACCOUNTREGISTERSUCCESSFUL:
|
case BannerStateEnum.ACCOUNTREGISTERSUCCESSFUL:
|
||||||
return this.i18n.t("bannerMessages.registerSuccessful")
|
return this.i18n.t("bannerMessages.registerSuccessful")
|
||||||
|
|
||||||
|
case BannerStateEnum.ACCOUNTREGISTERERROR:
|
||||||
|
return this.i18n.t("bannerMessages.registerSuccessful")
|
||||||
|
|
||||||
case BannerStateEnum.ACCOUNTREGISTERUSERNAMEINUSE:
|
case BannerStateEnum.ACCOUNTREGISTERUSERNAMEINUSE:
|
||||||
return this.i18n.t("bannerMessages.usernameInUse")
|
return this.i18n.t("bannerMessages.usernameInUse")
|
||||||
|
|
||||||
@@ -207,6 +205,7 @@ export const useFeedbackStore = defineStore("feedbackStore", {
|
|||||||
|
|
||||||
case BannerStateEnum.EXERCISESOLVED01:
|
case BannerStateEnum.EXERCISESOLVED01:
|
||||||
case BannerStateEnum.EXERCISESOLVED02:
|
case BannerStateEnum.EXERCISESOLVED02:
|
||||||
|
case BannerStateEnum.EXERCISESOLVED03:
|
||||||
case BannerStateEnum.EXERCISESOLVED11:
|
case BannerStateEnum.EXERCISESOLVED11:
|
||||||
case BannerStateEnum.EXERCISESOLVED12:
|
case BannerStateEnum.EXERCISESOLVED12:
|
||||||
case BannerStateEnum.EXERCISESOLVED13:
|
case BannerStateEnum.EXERCISESOLVED13:
|
||||||
@@ -237,6 +236,7 @@ export const useFeedbackStore = defineStore("feedbackStore", {
|
|||||||
|
|
||||||
case BannerStateEnum.EXERCISESOLVED01:
|
case BannerStateEnum.EXERCISESOLVED01:
|
||||||
case BannerStateEnum.EXERCISESOLVED02:
|
case BannerStateEnum.EXERCISESOLVED02:
|
||||||
|
case BannerStateEnum.EXERCISESOLVED03:
|
||||||
case BannerStateEnum.EXERCISESOLVED11:
|
case BannerStateEnum.EXERCISESOLVED11:
|
||||||
case BannerStateEnum.EXERCISESOLVED12:
|
case BannerStateEnum.EXERCISESOLVED12:
|
||||||
case BannerStateEnum.EXERCISESOLVED13:
|
case BannerStateEnum.EXERCISESOLVED13:
|
||||||
|
|||||||
Reference in New Issue
Block a user