feat(warehouse): add entity types, permissions, and number sequences

This commit is contained in:
BOHA
2026-05-29 14:08:35 +02:00
parent 5500cdb118
commit 2b1de583fd
2 changed files with 43 additions and 2 deletions

View File

@@ -280,6 +280,32 @@ const PERMISSIONS: {
module: "settings",
description: "Prohlížet auditní logy",
},
// Sklad
{
name: "warehouse.view",
display_name: "Zobrazit sklad",
module: "warehouse",
description: "Prohlížet stav skladu, položky, reporty a historii pohybů",
},
{
name: "warehouse.operate",
display_name: "Příjem a výdej",
module: "warehouse",
description: "Vytvářet a potvrzovat příjmy, výdeje a rezervace",
},
{
name: "warehouse.manage",
display_name: "Správa skladu",
module: "warehouse",
description: "Spravovat katalog materiálů, dodavatele, lokace a kategorie",
},
{
name: "warehouse.inventory",
display_name: "Inventura",
module: "warehouse",
description: "Vytvářet a potvrzovat inventurní sčítkání",
},
];
async function main() {
@@ -407,7 +433,14 @@ async function main() {
// 6. Initialize number_sequences for current year
const year = new Date().getFullYear();
const types = ["quotation", "order", "invoice"];
const types = [
"quotation",
"order",
"invoice",
"warehouse_receipt",
"warehouse_issue",
"warehouse_inventory",
];
for (const type of types) {
const existing = await prisma.number_sequences.findFirst({
where: { type, year },