Skip to content

Conversation

@CasperJensen19
Copy link

Vi har gjort typ allting för att det ska funka, det som återstår är några små felhanteringsproblem. Det är rätt stor skillnad på denna PR och den innan så ni vet hehe.

@github-project-automation github-project-automation bot moved this to 🆕 New in CPU Dec 15, 2025
@Isak-Kallini Isak-Kallini changed the title Pr919 Lagersystem för sexet Dec 15, 2025
Copy link
Member

@Isak-Kallini Isak-Kallini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ser bra ut överlag! Har mest några frågor och småfixar.
Enda stora är att all text behöver översättas.
Ni behöver även fixa lint och format så CI blir glad

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ni borde squasha era migrations. Det kan ni göra genom att ta bort alla migrations ni har skapat och sedan köra pnpm migrate, så kommer en enda stor migration skapas

Comment on lines +566 to +567
quantityIn Int?
quantityOut Int?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Är det meningen att dessa ska vara nullable? Defaulta till 0 istället?

date DateTime
value Int

@@allow("read", true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

För alla databas-models ni har skapat: är det meningen att vem som helst ska kunna se allt?

Comment on lines +17 to +19
(existing.quantityIn ?? 0) + (batch.quantityIn ?? 0);
existing.quantityOut =
(existing.quantityOut ?? 0) + (batch.quantityOut ?? 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Om vi sätter quantityin och ut till att inte vara nullable och defaulta till 0 i databasen så slipper vi ?? överallt

use:deleteFormEnhance
>
<input type="hidden" name="id" value={item.id} />
<button class="btn btn-error btn-sm text-white">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lägg till aria-label

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bara en tanke: det kanske kan vara nice med lite logik som kollar att man fyllt i det rätt för sprit när man har både antal flaskor och vikt, exempelvis så den inte godkänner att man man tar två flaskor och säger att de väger 10 kg. Det är upp till er som ska använda det om ni vill implementera det


<Input type="hidden" name="inOut" bind:value={$form.inOut} />
<Input
label="Vikt"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kan vara nice att specifiera enhet på vikt? (kg vs g)

export const actions: Actions = {
createDrinkItem: async (event) => {
const { user, prisma } = event.locals;
authorize(apiNames.DRINKITEM.CREATE, user);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

authorize skadar inte, men behövs inte egentligen. Access control specifieras i schema.zmodel.

}}
/>

<StocklistNav totalInventoryValue={data.totalInventoryValue} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding the stocklistnav component to every page you could create a +layout.svelte file in the stocklist folder and put it there.

import SEO from "$lib/seo/SEO.svelte";
import { DrinkQuantityType } from "@prisma/client";
import StocklistNav from "./StocklistNav.svelte";
export let data: PageData;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export let data: PageData is svelte 4 syntax, update to svelte 5 with $props like on the other pages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

3 participants