diff --git a/software/backend/data/accounts.json b/software/backend/data/accounts.json index 8c312ec..54030e0 100644 --- a/software/backend/data/accounts.json +++ b/software/backend/data/accounts.json @@ -4,6 +4,7 @@ "id": 0, "username": "hagemeister93", "password": "Xjt3qb5t", + "email": "hagemeister93@gmail.com", "firstName": "Laurin", "lastName": "Hagemeister", "addresses": [ @@ -28,6 +29,7 @@ "id": 1, "username": "katjaStoiber", "password": "target123", + "email": "k.stoiber@uni-hannover.de", "firstName": "Katja", "lastName": "Stoiber", "addresses": [ @@ -52,6 +54,7 @@ "id": 2, "username": "oetkerohnek", "password": "iloveyou", + "email": "oetker30625@gmx.com", "firstName": "Luna", "lastName": "Oeter", "addresses": [ @@ -83,6 +86,7 @@ "id": 3, "username": "duranduran", "password": "H4nn0ver", + "email": "dduran@hannover.de", "firstName": "Jürgen", "lastName": "Durand", "addresses": [ @@ -114,6 +118,7 @@ "id": 4, "username": "guitarhero", "password": "gwerty123", + "email": "guitarheroFurti@gmail.com", "firstName": "Frederik", "lastName": "Furtwängler", "addresses": [ @@ -138,6 +143,7 @@ "id": 5, "username": "herbstMareike", "password": "qhsrbpgrs", + "email": "m.herbst@uni-hannover.de", "firstName": "Mareike", "lastName": "Herbst", "addresses": [ @@ -162,6 +168,7 @@ "id": 6, "username": "seibertmitb", "password": "{jkz+WvQe", + "email": "janna-seibert@yahoo.com", "firstName": "Janna", "lastName": "Seibert", "addresses": [ diff --git a/software/backend/models/account.model.ts b/software/backend/models/account.model.ts index 4ea3991..aa5b59e 100644 --- a/software/backend/models/account.model.ts +++ b/software/backend/models/account.model.ts @@ -13,6 +13,10 @@ export class Account extends Model { @Column password: string + @Unique + @Column + email: string + @Column firstName: string = "" diff --git a/software/backend/routes/account.routes.ts b/software/backend/routes/account.routes.ts index c35466d..56dd252 100644 --- a/software/backend/routes/account.routes.ts +++ b/software/backend/routes/account.routes.ts @@ -78,11 +78,29 @@ account.post("/", (req: Request, res: Response) => { }) account.patch("/", (req: Request, res: Response) => { + console.log(req.body) + Account.update(req.body, { where: { id: req.body.id } }) - .then(account => { + .then(async account => { + for (let payment of req.body.payments) { + await Payment.update(payment, + { + where: { id: payment.id } + } + ) + } + + for (let address of req.body.addresses) { + await Address.update(address, + { + where: { id: address.id } + } + ) + } + // Status: 200 OK res.status(200).json(account) }) diff --git a/software/src/App.vue b/software/src/App.vue index 8bae8fe..28e0c1b 100644 --- a/software/src/App.vue +++ b/software/src/App.vue @@ -7,10 +7,12 @@ import navigationItems from './components/navigationItems.vue'; import { useProductStore } from './data/stores/productStore'; import { useCategoryStore } from './data/stores/categoryStore'; import { usePreferencesStore } from './data/stores/preferencesStore'; +import { useFeedbackStore } from './data/stores/feedbackStore'; const preferencesStore = usePreferencesStore() const productStore = useProductStore() const categoryStore = useCategoryStore() +const feedbackStore = useFeedbackStore() const theme = useTheme() const navRail = ref(vuetify.display.mobile) @@ -38,6 +40,26 @@ watch(() => preferencesStore.language, () => { + + + + {{ feedbackStore.title }} + + + + diff --git a/software/src/components/alertBanner.vue b/software/src/components/alertBanner.vue deleted file mode 100644 index b83d2da..0000000 --- a/software/src/components/alertBanner.vue +++ /dev/null @@ -1,22 +0,0 @@ - - - \ No newline at end of file diff --git a/software/src/data/models/accountModel.ts b/software/src/data/models/accountModel.ts index 64293b0..bd4ca63 100644 --- a/software/src/data/models/accountModel.ts +++ b/software/src/data/models/accountModel.ts @@ -6,6 +6,7 @@ export class AccountModel { id: number username: string = "" password: string = "" + email: string = "" firstName: string = "" lastName: string = "" addresses: Array = [ new AddressModel() ] diff --git a/software/src/locales/de.json b/software/src/locales/de.json index b7808d4..5c87fd5 100644 --- a/software/src/locales/de.json +++ b/software/src/locales/de.json @@ -71,7 +71,8 @@ "masterData": "Stammdaten", "noAddresses": "Keine Adressen gefunden", "noPayments": "Keine Bezahlarten gefunden", - "newPayment": "New Payment" + "newPayment": "New Payment", + "email": "E-Mail-Adresse" }, "bannerMessages": { "loginSuccessful": "Login erfolgreich!", @@ -127,5 +128,10 @@ "noOrders": "Keine Bestellungen gefunden", "noOrdersText": "Bisher wurden keine Bestellungen von diesem Account getätigt. Gehe zum Warenkorb und bestelle!", "add": "Hinzufügen", - "remove": "Entfernen" + "remove": "Entfernen", + "emailIsNotValid": "Ungültige E-Mail Addresse", + "emailRequired": "E-Mail-Adresse benötigt", + "tooMuchChars": "Zu lang", + "digitsAtStartNeeded": "Muss mit einer Zahl beginnen", + "wrongIban": "Falsches IBAN Format, nur deutsche IBAN-Nummern erlaubt!" } diff --git a/software/src/locales/en.json b/software/src/locales/en.json index 4a7910f..8bf7b3b 100644 --- a/software/src/locales/en.json +++ b/software/src/locales/en.json @@ -71,7 +71,8 @@ "masterData": "Master data", "noAddresses": "No Addresses found", "noPayments": "No payments found", - "newPayment": "New Payment" + "newPayment": "New Payment", + "email": "E-Mail address" }, "bannerMessages": { "loginSuccessful": "Login erfolgreich!", @@ -127,5 +128,10 @@ "noOrders": "No orders found", "noOrdersText": "There are no orders with this account until now. Go to the basket page and order something!", "add": "Add", - "remove": "Remove" + "remove": "Remove", + "emailIsNotValid": "E-mail must be valid", + "emailRequired": "E-Mail is required", + "tooMuchChars": "Too long", + "digitsAtStartNeeded": "Has to beginn with a number", + "wrongIban": "Wrong IBAN format, only German IBANs are allowed!" } diff --git a/software/src/pages/accountPage/accountDataCard.vue b/software/src/pages/accountPage/accountDataCard.vue index 9d899ca..f324ee8 100644 --- a/software/src/pages/accountPage/accountDataCard.vue +++ b/software/src/pages/accountPage/accountDataCard.vue @@ -1,10 +1,51 @@