Initial commit: HOA Financial Intelligence Platform MVP
Multi-tenant financial management platform for homeowner associations featuring: - NestJS backend with 16 modules (auth, accounts, transactions, budgets, units, invoices, payments, vendors, reserves, investments, capital projects, reports) - React + Mantine frontend with dashboard, CRUD pages, and financial reports - Schema-per-tenant PostgreSQL isolation with JWT-based tenant resolution - Docker Compose infrastructure (nginx, backend, frontend, postgres, redis) - Comprehensive seed data for Sunrise Valley HOA demo - 39 API endpoints with Swagger documentation - Double-entry bookkeeping with journal entries - Budget vs actual reporting and Sankey cash flow visualization Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
import {
|
||||
Controller, Get, Post, Body, Param, Query, UseGuards, Request,
|
||||
} from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard';
|
||||
import { JournalEntriesService } from './journal-entries.service';
|
||||
import { CreateJournalEntryDto } from './dto/create-journal-entry.dto';
|
||||
import { VoidJournalEntryDto } from './dto/void-journal-entry.dto';
|
||||
|
||||
@ApiTags('journal-entries')
|
||||
@Controller('journal-entries')
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
export class JournalEntriesController {
|
||||
constructor(private jeService: JournalEntriesService) {}
|
||||
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'List journal entries' })
|
||||
findAll(
|
||||
@Query('from') from?: string,
|
||||
@Query('to') to?: string,
|
||||
@Query('accountId') accountId?: string,
|
||||
@Query('type') type?: string,
|
||||
) {
|
||||
return this.jeService.findAll({ from, to, accountId, type });
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
@ApiOperation({ summary: 'Get journal entry by ID' })
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.jeService.findOne(id);
|
||||
}
|
||||
|
||||
@Post()
|
||||
@ApiOperation({ summary: 'Create a journal entry' })
|
||||
create(@Body() dto: CreateJournalEntryDto, @Request() req: any) {
|
||||
return this.jeService.create(dto, req.user.sub);
|
||||
}
|
||||
|
||||
@Post(':id/post')
|
||||
@ApiOperation({ summary: 'Post (finalize) a journal entry' })
|
||||
post(@Param('id') id: string, @Request() req: any) {
|
||||
return this.jeService.post(id, req.user.sub);
|
||||
}
|
||||
|
||||
@Post(':id/void')
|
||||
@ApiOperation({ summary: 'Void a journal entry' })
|
||||
void(@Param('id') id: string, @Body() dto: VoidJournalEntryDto, @Request() req: any) {
|
||||
return this.jeService.void(id, req.user.sub, dto.reason);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user