Files
tehran_tala/apps/api/src/modules/customers/customers.controller.ts
T

30 lines
737 B
TypeScript
Raw Normal View History

2026-09-09 06:46:27 +03:30
import { Controller, Get, Param } from '@nestjs/common';
import { CustomersService } from './customers.service';
import { Public } from '../auth/guards';
2026-09-09 06:46:27 +03:30
@Public() // pre-existing unauthenticated endpoint; see Phase 1 notes
2026-09-09 06:46:27 +03:30
@Controller('customers')
export class CustomersController {
constructor(private readonly customers: CustomersService) {}
@Get()
list() {
return this.customers.list();
}
@Get(':id')
get(@Param('id') id: string) {
return this.customers.getOrThrow(id);
}
@Get(':id/orders')
getOrders(@Param('id') id: string) {
return this.customers.getOrders(id);
}
@Get(':id/ledger-entries')
getLedgerEntries(@Param('id') id: string) {
return this.customers.getLedgerEntries(id);
}
}