feat(prices): fiyat kayıtları, birim fiyat motoru ve analizde aylık maliyet

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-06 12:27:51 +03:00
parent 78503b1787
commit e67a1d5411
16 changed files with 1212 additions and 6 deletions
+6 -1
View File
@@ -13,7 +13,7 @@ import { runMigrations } from "../migrations";
import { seedContacts } from "./contacts";
import { seedAssets } from "./assets";
import { seedBudgets } from "./budgets";
import { seedShopping } from "./shopping";
import { seedProductPrices, seedShopping } from "./shopping";
import { seedStock } from "./stock";
import { seedInKind } from "./in-kind";
import { seedInstallments } from "./installments";
@@ -60,6 +60,7 @@ export type SeedSummary = {
stock: number;
stores: number;
products: number;
prices: number;
};
accounts: SeedAccountRow[];
};
@@ -89,6 +90,7 @@ const DOMAIN_COLLECTIONS = [
"stockCounts",
"stores",
"products",
"productPrices",
];
type AuthApi = ReturnType<typeof getAuth>["api"];
@@ -147,6 +149,7 @@ export async function runSeed({
stock: 0,
stores: 0,
products: 0,
prices: 0,
},
accounts: [],
};
@@ -336,6 +339,8 @@ export async function runSeed({
summary.created.products = shopping.products;
if (shopping.stores || shopping.products)
log(`✓ Örnek mağazalar ve ürünler: ${shopping.stores} / ${shopping.products}`);
summary.created.prices = await seedProductPrices(householdIds, userIdMap);
if (summary.created.prices) log(`✓ Örnek ürün fiyatları: ${summary.created.prices}`);
// 7) Geliştirme hesapları tablosu
const all = [