feat(warehouses): filters, pagination and charts on container returns

Returned-containers list now uses the shared DataTable + useListControls
(search, inclusive date range, status select, pagination) instead of a
hand-rolled table. Adds two charts below the list — returns per day by
truck type and returns by status — driven by the same filtered rows.
Series colors validated for CVD separation and surface contrast.
This commit is contained in:
Hagernesh
2026-08-04 09:54:15 +00:00
parent 87b04973d8
commit 50fab52b1c
3 changed files with 287 additions and 79 deletions

View File

@@ -5,6 +5,7 @@ import { resolve } from 'path';
config({ path: resolve(__dirname, '../../.env') });
import { NestFactory } from '@nestjs/core';
import { DataSource } from 'typeorm';
import { AppModule } from '../app.module';
import { Batch14TestDataSeeder } from '../seed/batch1-4-test-data.seeder';
import { Batch5TestDataSeeder } from '../seed/batch5-test-data.seeder';
@@ -14,19 +15,33 @@ import { IndodeFacilitySeeder } from '../seed/indode-facility.seeder';
import { PricingDataSeeder } from '../seed/pricing-data.seeder';
import { WarehouseDemoSeeder } from '../seed/warehouse-demo.seeder';
/** Demo data only — refuse to run against anything but a local dev database. */
function assertLocalhost() {
const host = process.env.DB_HOST ?? 'localhost';
if (host !== 'localhost' && host !== '127.0.0.1') {
console.error(`Refusing to seed demo data: DB_HOST is "${host}", not localhost.`);
process.exit(1);
}
}
async function main() {
assertLocalhost();
const app = await NestFactory.createApplicationContext(AppModule, {
logger: ['error', 'warn', 'log'],
});
try {
await app.get(PricingDataSeeder).run();
await app.get(IndodeFacilitySeeder).run();
await app.get(Batch14TestDataSeeder).run();
await app.get(Batch5TestDataSeeder).run();
await app.get(Batch7TestDataSeeder).run();
await app.get(Batch8TestDataSeeder).run();
await app.get(WarehouseDemoSeeder).run();
// Demo seeders are intentionally not AppModule providers (they'd run on every
// boot), so construct them against the app's DataSource instead of via DI.
const dataSource = app.get(DataSource);
await new PricingDataSeeder(dataSource).run();
await new IndodeFacilitySeeder(dataSource).run();
await new Batch14TestDataSeeder(dataSource).run();
await new Batch5TestDataSeeder(dataSource).run();
await new Batch7TestDataSeeder(dataSource).run();
await new Batch8TestDataSeeder(dataSource).run();
await new WarehouseDemoSeeder(dataSource).run();
console.log('Warehouse demo data seeded.');
} finally {