Functional cart and balance display

This commit is contained in:
2026-01-22 18:54:51 +01:00
parent bcc5164abb
commit ed5afb1dec
16 changed files with 624 additions and 107 deletions
File diff suppressed because one or more lines are too long
-2
View File
@@ -181,7 +181,6 @@ exports.Prisma.SellableScalarFieldEnum = {
};
exports.Prisma.CartScalarFieldEnum = {
id: 'id',
userId: 'userId'
};
@@ -254,7 +253,6 @@ exports.Prisma.SellableOrderByRelevanceFieldEnum = {
};
exports.Prisma.CartOrderByRelevanceFieldEnum = {
id: 'id',
userId: 'userId'
};
+8 -44
View File
@@ -8745,34 +8745,28 @@ export namespace Prisma {
}
export type CartMinAggregateOutputType = {
id: string | null
userId: string | null
}
export type CartMaxAggregateOutputType = {
id: string | null
userId: string | null
}
export type CartCountAggregateOutputType = {
id: number
userId: number
_all: number
}
export type CartMinAggregateInputType = {
id?: true
userId?: true
}
export type CartMaxAggregateInputType = {
id?: true
userId?: true
}
export type CartCountAggregateInputType = {
id?: true
userId?: true
_all?: true
}
@@ -8850,7 +8844,6 @@ export namespace Prisma {
}
export type CartGroupByOutputType = {
id: string
userId: string
_count: CartCountAggregateOutputType | null
_min: CartMinAggregateOutputType | null
@@ -8872,7 +8865,6 @@ export namespace Prisma {
export type CartSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
id?: boolean
userId?: boolean
user?: boolean | UserDefaultArgs<ExtArgs>
cartItems?: boolean | Cart$cartItemsArgs<ExtArgs>
@@ -8882,11 +8874,10 @@ export namespace Prisma {
export type CartSelectScalar = {
id?: boolean
userId?: boolean
}
export type CartOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "userId", ExtArgs["result"]["cart"]>
export type CartOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"userId", ExtArgs["result"]["cart"]>
export type CartInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
user?: boolean | UserDefaultArgs<ExtArgs>
cartItems?: boolean | Cart$cartItemsArgs<ExtArgs>
@@ -8900,7 +8891,6 @@ export namespace Prisma {
cartItems: Prisma.$CartItemPayload<ExtArgs>[]
}
scalars: $Extensions.GetPayloadResult<{
id: string
userId: string
}, ExtArgs["result"]["cart"]>
composites: {}
@@ -8985,8 +8975,8 @@ export namespace Prisma {
* // Get first 10 Carts
* const carts = await prisma.cart.findMany({ take: 10 })
*
* // Only select the `id`
* const cartWithIdOnly = await prisma.cart.findMany({ select: { id: true } })
* // Only select the `userId`
* const cartWithUserIdOnly = await prisma.cart.findMany({ select: { userId: true } })
*
*/
findMany<T extends CartFindManyArgs>(args?: SelectSubset<T, CartFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CartPayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>
@@ -9273,7 +9263,6 @@ export namespace Prisma {
* Fields of the Cart model
*/
interface CartFieldRefs {
readonly id: FieldRef<"Cart", 'String'>
readonly userId: FieldRef<"Cart", 'String'>
}
@@ -11607,7 +11596,6 @@ export namespace Prisma {
export const CartScalarFieldEnum: {
id: 'id',
userId: 'userId'
};
@@ -11716,7 +11704,6 @@ export namespace Prisma {
export const CartOrderByRelevanceFieldEnum: {
id: 'id',
userId: 'userId'
};
@@ -12230,14 +12217,12 @@ export namespace Prisma {
AND?: CartWhereInput | CartWhereInput[]
OR?: CartWhereInput[]
NOT?: CartWhereInput | CartWhereInput[]
id?: StringFilter<"Cart"> | string
userId?: StringFilter<"Cart"> | string
user?: XOR<UserScalarRelationFilter, UserWhereInput>
cartItems?: CartItemListRelationFilter
}
export type CartOrderByWithRelationInput = {
id?: SortOrder
userId?: SortOrder
user?: UserOrderByWithRelationInput
cartItems?: CartItemOrderByRelationAggregateInput
@@ -12245,17 +12230,15 @@ export namespace Prisma {
}
export type CartWhereUniqueInput = Prisma.AtLeast<{
id?: string
userId?: string
AND?: CartWhereInput | CartWhereInput[]
OR?: CartWhereInput[]
NOT?: CartWhereInput | CartWhereInput[]
userId?: StringFilter<"Cart"> | string
user?: XOR<UserScalarRelationFilter, UserWhereInput>
cartItems?: CartItemListRelationFilter
}, "id">
}, "userId">
export type CartOrderByWithAggregationInput = {
id?: SortOrder
userId?: SortOrder
_count?: CartCountOrderByAggregateInput
_max?: CartMaxOrderByAggregateInput
@@ -12266,7 +12249,6 @@ export namespace Prisma {
AND?: CartScalarWhereWithAggregatesInput | CartScalarWhereWithAggregatesInput[]
OR?: CartScalarWhereWithAggregatesInput[]
NOT?: CartScalarWhereWithAggregatesInput | CartScalarWhereWithAggregatesInput[]
id?: StringWithAggregatesFilter<"Cart"> | string
userId?: StringWithAggregatesFilter<"Cart"> | string
}
@@ -12811,40 +12793,34 @@ export namespace Prisma {
}
export type CartCreateInput = {
id: string
user: UserCreateNestedOneWithoutCartsInput
cartItems?: CartItemCreateNestedManyWithoutCartInput
}
export type CartUncheckedCreateInput = {
id: string
userId: string
cartItems?: CartItemUncheckedCreateNestedManyWithoutCartInput
}
export type CartUpdateInput = {
id?: StringFieldUpdateOperationsInput | string
user?: UserUpdateOneRequiredWithoutCartsNestedInput
cartItems?: CartItemUpdateManyWithoutCartNestedInput
}
export type CartUncheckedUpdateInput = {
id?: StringFieldUpdateOperationsInput | string
userId?: StringFieldUpdateOperationsInput | string
cartItems?: CartItemUncheckedUpdateManyWithoutCartNestedInput
}
export type CartCreateManyInput = {
id: string
userId: string
}
export type CartUpdateManyMutationInput = {
id?: StringFieldUpdateOperationsInput | string
}
export type CartUncheckedUpdateManyInput = {
id?: StringFieldUpdateOperationsInput | string
userId?: StringFieldUpdateOperationsInput | string
}
@@ -13523,17 +13499,14 @@ export namespace Prisma {
}
export type CartCountOrderByAggregateInput = {
id?: SortOrder
userId?: SortOrder
}
export type CartMaxOrderByAggregateInput = {
id?: SortOrder
userId?: SortOrder
}
export type CartMinOrderByAggregateInput = {
id?: SortOrder
userId?: SortOrder
}
@@ -14651,12 +14624,10 @@ export namespace Prisma {
}
export type CartCreateWithoutUserInput = {
id: string
cartItems?: CartItemCreateNestedManyWithoutCartInput
}
export type CartUncheckedCreateWithoutUserInput = {
id: string
cartItems?: CartItemUncheckedCreateNestedManyWithoutCartInput
}
@@ -14796,7 +14767,6 @@ export namespace Prisma {
AND?: CartScalarWhereInput | CartScalarWhereInput[]
OR?: CartScalarWhereInput[]
NOT?: CartScalarWhereInput | CartScalarWhereInput[]
id?: StringFilter<"Cart"> | string
userId?: StringFilter<"Cart"> | string
}
@@ -15318,12 +15288,10 @@ export namespace Prisma {
}
export type CartCreateWithoutCartItemsInput = {
id: string
user: UserCreateNestedOneWithoutCartsInput
}
export type CartUncheckedCreateWithoutCartItemsInput = {
id: string
userId: string
}
@@ -15367,12 +15335,10 @@ export namespace Prisma {
}
export type CartUpdateWithoutCartItemsInput = {
id?: StringFieldUpdateOperationsInput | string
user?: UserUpdateOneRequiredWithoutCartsNestedInput
}
export type CartUncheckedUpdateWithoutCartItemsInput = {
id?: StringFieldUpdateOperationsInput | string
userId?: StringFieldUpdateOperationsInput | string
}
@@ -15500,7 +15466,7 @@ export namespace Prisma {
}
export type CartCreateManyUserInput = {
id: string
}
export type AdressCreateManyUserInput = {
@@ -15591,17 +15557,15 @@ export namespace Prisma {
}
export type CartUpdateWithoutUserInput = {
id?: StringFieldUpdateOperationsInput | string
cartItems?: CartItemUpdateManyWithoutCartNestedInput
}
export type CartUncheckedUpdateWithoutUserInput = {
id?: StringFieldUpdateOperationsInput | string
cartItems?: CartItemUncheckedUpdateManyWithoutCartNestedInput
}
export type CartUncheckedUpdateManyWithoutUserInput = {
id?: StringFieldUpdateOperationsInput | string
}
export type AdressUpdateWithoutUserInput = {
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "prisma-client-1d666464292a599bad3179d365e160013075f010f27e15f565fd192ad5ef967d",
"name": "prisma-client-a0e1bef334afa5b609bdf0c15431f28835b869da62270d0786ce071578cdedb4",
"main": "index.js",
"types": "index.d.ts",
"browser": "default.js",
+2 -3
View File
@@ -107,8 +107,7 @@ model Sellable {
//////////////////////
model Cart {
id String @id
userId String
userId String @id
user User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade)
cartItems CartItem[]
@@ -119,7 +118,7 @@ model CartItem {
quantity Int
cartId String
cart Cart @relation(fields: [cartId], references: [id], onDelete: Cascade, onUpdate: Cascade)
cart Cart @relation(fields: [cartId], references: [userId], onDelete: Cascade, onUpdate: Cascade)
sellable Sellable @relation(fields: [itemId], references: [id], onDelete: Cascade, onUpdate: Cascade)
}
File diff suppressed because one or more lines are too long