Matching UI with improved API
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
import { AccountRole } from "./accountRole"
|
||||
import { AddressModel } from "./addressModel"
|
||||
import { PaymentModel } from "./paymentModel"
|
||||
|
||||
export class AccountModel {
|
||||
id: number
|
||||
username: string = ""
|
||||
password: string = ""
|
||||
street: string = ""
|
||||
houseNumber: number = 0
|
||||
postalCode: number = 0
|
||||
city: string = ""
|
||||
firstName: string = ""
|
||||
lastName: string = ""
|
||||
createdAt: string = ""
|
||||
updatedAt: string = ""
|
||||
bankName: string = ""
|
||||
iban: string = ""
|
||||
addresses: Array<AddressModel> = [ new AddressModel() ]
|
||||
payments: Array<PaymentModel> = [ new PaymentModel() ]
|
||||
accountRole: AccountRole = new AccountRole()
|
||||
}
|
||||
5
software/src/data/models/accountRole.ts
Normal file
5
software/src/data/models/accountRole.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export class AccountRole {
|
||||
name: string = ""
|
||||
privilegeBuy: boolean = false
|
||||
privilegeAdminPanel: boolean = false
|
||||
}
|
||||
6
software/src/data/models/addressModel.ts
Normal file
6
software/src/data/models/addressModel.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export class AddressModel {
|
||||
street: string = ""
|
||||
houseNumber: number = 0
|
||||
postalCode: number = 0
|
||||
city: string = ""
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
import { ProductModel } from "./productModel"
|
||||
|
||||
export class BasketItemModel {
|
||||
id: number = -1
|
||||
brand: string = ""
|
||||
name: string = ""
|
||||
categoryName: string = ""
|
||||
categoryIcon: string = ""
|
||||
price: number = 0
|
||||
discount: number = 0
|
||||
quantity: number = 1
|
||||
product: ProductModel = new ProductModel()
|
||||
}
|
||||
4
software/src/data/models/brandModel.ts
Normal file
4
software/src/data/models/brandModel.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export class BrandModel {
|
||||
id: number = 0
|
||||
name: string = ""
|
||||
}
|
||||
@@ -2,6 +2,4 @@ export class CategoryModel {
|
||||
id: number = -1
|
||||
name: string
|
||||
icon: string
|
||||
createdAt: string = ""
|
||||
updatedAt: string = ""
|
||||
}
|
||||
@@ -2,8 +2,7 @@ import { OrderedItemModel } from "./orderedItemModel"
|
||||
|
||||
export class OrderModel {
|
||||
accountId: number
|
||||
totalPrice: number
|
||||
shippingProgress: number
|
||||
orderItem: Array<OrderedItemModel>
|
||||
createdAt: string
|
||||
orderItems: Array<OrderedItemModel>
|
||||
orderedAt: string
|
||||
}
|
||||
4
software/src/data/models/paymentModel.ts
Normal file
4
software/src/data/models/paymentModel.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export class PaymentModel {
|
||||
bankName: string = ""
|
||||
iban: string = ""
|
||||
}
|
||||
@@ -1,13 +1,16 @@
|
||||
import { BrandModel } from "./brandModel"
|
||||
import { CategoryModel } from "./categoryModel"
|
||||
|
||||
export class ProductModel {
|
||||
id: number = -1
|
||||
brand: string
|
||||
name: string
|
||||
id: number = 0
|
||||
category: CategoryModel = new CategoryModel()
|
||||
brand: BrandModel = new BrandModel()
|
||||
name: string = ""
|
||||
description: string = ""
|
||||
specs: Array<string> = []
|
||||
categoryId: number
|
||||
price: number = 0
|
||||
discount: number = 0
|
||||
rating: number = 1
|
||||
inStock: number
|
||||
specs: Array<string> = []
|
||||
images: Array<string> = [""]
|
||||
storedItems: number
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import { CategoryModel } from "./categoryModel"
|
||||
|
||||
export class ProductWithCategoryModel {
|
||||
id: number = -1
|
||||
brand: string
|
||||
name: string
|
||||
description: string = ""
|
||||
specs: Array<string> = []
|
||||
category: CategoryModel = new CategoryModel()
|
||||
price: number = 0
|
||||
discount: number = 0
|
||||
rating: number = 1
|
||||
images: Array<string> = [""]
|
||||
storedItems: number
|
||||
}
|
||||
Reference in New Issue
Block a user