Quality-of-life enhancements: CSV import/export, opening balances, interest rates, mobile UX
- CSV import/export for Units, Projects, and Vendors with match-on-name/number upsert - Cash Flow report toggle for Cash Only vs Cash + Investments - Per-account and bulk opening balance setting with as-of date - Interest rate field on normal accounts with estimated monthly/annual interest display - Mobile sidebar auto-close on navigation - Shared CSV parsing/export utility extracted to frontend/src/utils/csv.ts DB migration needed for existing tenants: ALTER TABLE accounts ADD COLUMN IF NOT EXISTS interest_rate DECIMAL(6,4); Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Controller, Get, Post, Put, Delete, Body, Param, UseGuards } from '@nestjs/common';
|
||||
import { Controller, Get, Post, Put, Delete, Body, Param, Res, UseGuards } from '@nestjs/common';
|
||||
import { ApiTags, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import { Response } from 'express';
|
||||
import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard';
|
||||
import { UnitsService } from './units.service';
|
||||
|
||||
@@ -13,9 +14,19 @@ export class UnitsController {
|
||||
@Get()
|
||||
findAll() { return this.unitsService.findAll(); }
|
||||
|
||||
@Get('export')
|
||||
async exportCSV(@Res() res: Response) {
|
||||
const csv = await this.unitsService.exportCSV();
|
||||
res.set({ 'Content-Type': 'text/csv', 'Content-Disposition': 'attachment; filename="units.csv"' });
|
||||
res.send(csv);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) { return this.unitsService.findOne(id); }
|
||||
|
||||
@Post('import')
|
||||
importCSV(@Body() rows: any[]) { return this.unitsService.importCSV(rows); }
|
||||
|
||||
@Post()
|
||||
create(@Body() dto: any) { return this.unitsService.create(dto); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user