feat(stock): stok kategorileri, ürün tipleri, hareketler ve FIFO SKT

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-06 08:10:10 +03:00
parent abf2ea6dd7
commit d9de29c18d
18 changed files with 2544 additions and 1 deletions
+8
View File
@@ -13,6 +13,7 @@ import { runMigrations } from "../migrations";
import { seedContacts } from "./contacts";
import { seedAssets } from "./assets";
import { seedBudgets } from "./budgets";
import { seedStock } from "./stock";
import { seedInKind } from "./in-kind";
import { seedInstallments } from "./installments";
import { seedRecurring } from "./recurring";
@@ -55,6 +56,7 @@ export type SeedSummary = {
inKind: number;
assets: number;
budgets: number;
stock: number;
};
accounts: SeedAccountRow[];
};
@@ -78,6 +80,9 @@ const DOMAIN_COLLECTIONS = [
"assets",
"assetMovements",
"budgets",
"stockCategories",
"productTypes",
"stockMovements",
];
type AuthApi = ReturnType<typeof getAuth>["api"];
@@ -133,6 +138,7 @@ export async function runSeed({
inKind: 0,
assets: 0,
budgets: 0,
stock: 0,
},
accounts: [],
};
@@ -315,6 +321,8 @@ export async function runSeed({
if (summary.created.assets) log(`✓ Örnek varlıklar: ${summary.created.assets}`);
summary.created.budgets = await seedBudgets(householdIds, userIdMap);
if (summary.created.budgets) log(`✓ Örnek bütçeler: ${summary.created.budgets}`);
summary.created.stock = await seedStock(householdIds, userIdMap);
if (summary.created.stock) log(`✓ Örnek stok ürün tipleri: ${summary.created.stock}`);
// 7) Geliştirme hesapları tablosu
const all = [