feat(warehouse): add entity types, permissions, and number sequences
This commit is contained in:
@@ -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 },
|
||||
|
||||
@@ -131,4 +131,12 @@ export type EntityType =
|
||||
| "company_settings"
|
||||
| "leave_balance"
|
||||
| "project_file"
|
||||
| "audit_logs";
|
||||
| "audit_logs"
|
||||
| "warehouse_item"
|
||||
| "warehouse_receipt"
|
||||
| "warehouse_issue"
|
||||
| "warehouse_reservation"
|
||||
| "warehouse_inventory"
|
||||
| "warehouse_supplier"
|
||||
| "warehouse_category"
|
||||
| "warehouse_location";
|
||||
|
||||
Reference in New Issue
Block a user