-
Notifications
You must be signed in to change notification settings - Fork 40
Lagersystem för sexet #1032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Lagersystem för sexet #1032
Conversation
There was a problem hiding this 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
There was a problem hiding this comment.
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
| quantityIn Int? | ||
| quantityOut Int? |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
| (existing.quantityIn ?? 0) + (batch.quantityIn ?? 0); | ||
| existing.quantityOut = | ||
| (existing.quantityOut ?? 0) + (batch.quantityOut ?? 0); |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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} /> |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
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.