Начинаем третью (коммит для роллбэка в случае апокалипсиса)

This commit is contained in:
Данила Мочалов 2023-10-25 01:52:49 +04:00
parent d40de4701a
commit 57d4d6b0c8
3 changed files with 14 additions and 14 deletions

View File

@ -6,17 +6,17 @@ import java.util.Date
data class OrderModel( data class OrderModel(
val id: Int, val id: Int,
val status: OrderStatus, val status: OrderStatus,
val productsId: HashMap<ProductModel, Int>, val productsId: HashMap<Int, Int>,
val userId: Int, val userId: Int,
val date: Date val date: Date
) )
fun getOrdersByUserId() : List<OrderModel> { fun getOrdersByUserId() : List<OrderModel> {
val map1 = HashMap<ProductModel, Int>() val map1 = HashMap<Int, Int>()
map1[ProductModel(1, "Классика", 150)] = 2 map1[1] = 2
val map2 = HashMap<ProductModel, Int>() val map2 = HashMap<Int, Int>()
map2[ProductModel(1, "Классика", 150)] = 2 map2[1] = 2
return listOf( return listOf(
OrderModel(1, OrderStatus.Unpaid, map1, 1, Date()), OrderModel(1, OrderStatus.Unpaid, map1, 1, Date()),
OrderModel(2, OrderStatus.Preparing, map2 , 1, Date()) OrderModel(2, OrderStatus.Preparing, map2 , 1, Date())
@ -24,11 +24,11 @@ fun getOrdersByUserId() : List<OrderModel> {
} }
fun getAllOrders() : List<OrderModel> { fun getAllOrders() : List<OrderModel> {
val map1 = HashMap<ProductModel, Int>() val map1 = HashMap<Int, Int>()
map1[ProductModel(1, "Классика", 150)] = 2 map1[1] = 2
return listOf( return listOf(
OrderModel(1, OrderStatus.Prepared, map1, 1, Date()), OrderModel(1, OrderStatus.Prepared, map1, 1, Date()),
OrderModel(2, OrderStatus.Preparing, map1 , 1, Date()), OrderModel(2, OrderStatus.Preparing, map1 , 1, Date()),
OrderModel(2, OrderStatus.Processed, map1 , 1, Date()) OrderModel(3, OrderStatus.Processed, map1 , 1, Date())
) )
} }

View File

@ -173,7 +173,7 @@ fun PaidItem(order : OrderModel) {
.padding(horizontal = 20.dp) .padding(horizontal = 20.dp)
){ ){
Text( Text(
text = order.productsId.keys.first().title, text = "Классика",
fontFamily = NunitoFamily, fontFamily = NunitoFamily,
fontSize = 20.sp, fontSize = 20.sp,
modifier = Modifier.padding(top = 15.dp), modifier = Modifier.padding(top = 15.dp),
@ -187,7 +187,7 @@ fun PaidItem(order : OrderModel) {
fontWeight = FontWeight.Bold fontWeight = FontWeight.Bold
) )
Text( Text(
text = order.productsId.keys.first().price.toString() + " руб.", text = "150 руб.",
fontFamily = NunitoFamily, fontFamily = NunitoFamily,
fontSize = 20.sp, fontSize = 20.sp,
modifier = Modifier.padding(top = 15.dp), modifier = Modifier.padding(top = 15.dp),
@ -245,7 +245,7 @@ fun CartItem(order : OrderModel) {
modifier = Modifier.fillMaxWidth() modifier = Modifier.fillMaxWidth()
){ ){
Text( Text(
text = order.productsId.keys.first().title, text = "Классика",
fontFamily = NunitoFamily, fontFamily = NunitoFamily,
fontSize = 20.sp, fontSize = 20.sp,
fontWeight = FontWeight.Bold fontWeight = FontWeight.Bold
@ -258,7 +258,7 @@ fun CartItem(order : OrderModel) {
) )
} }
Text( Text(
text = order.productsId.keys.first().price.toString() + " руб.", text = "150 руб.",
fontFamily = NunitoFamily, fontFamily = NunitoFamily,
fontSize = 20.sp, fontSize = 20.sp,
fontWeight = FontWeight.Bold fontWeight = FontWeight.Bold

View File

@ -183,7 +183,7 @@ fun PreparingItem(order : OrderModel){
modifier = Modifier.fillMaxWidth() modifier = Modifier.fillMaxWidth()
){ ){
Text( Text(
text = order.productsId.keys.first().title, text = "Классика",
fontFamily = NunitoFamily, fontFamily = NunitoFamily,
fontSize = 20.sp, fontSize = 20.sp,
fontWeight = FontWeight.Bold fontWeight = FontWeight.Bold
@ -251,7 +251,7 @@ fun PreparedItem(order : OrderModel){
modifier = Modifier.fillMaxWidth() modifier = Modifier.fillMaxWidth()
){ ){
Text( Text(
text = order.productsId.keys.first().title, text = "Классика",
fontFamily = NunitoFamily, fontFamily = NunitoFamily,
fontSize = 20.sp, fontSize = 20.sp,
fontWeight = FontWeight.Bold fontWeight = FontWeight.Bold