feat: data import module and payment fixes
- Add import module with CSV/Excel template download and bulk import endpoints - Support client+subscription and outstanding invoice imports with per-row error handling - Templates include Field Guide sheet with valid plan/area names - Add manager role to unremitted payments endpoint - Add createdAt field to remittance history response
This commit is contained in:
@@ -41,9 +41,10 @@ export class PaymentController {
|
||||
}
|
||||
|
||||
@Get('unremitted')
|
||||
@Roles('technician', 'collector')
|
||||
@Roles('technician', 'collector', 'manager')
|
||||
async getUnremitted(@CurrentUser() user: CurrentUserPayload) {
|
||||
return this.paymentService.getUnremittedPayments(user.tenantId, user.sub);
|
||||
const isManager = user.roles?.some((r: string) => ['manager', 'tenant_admin', 'super_admin'].includes(r));
|
||||
return this.paymentService.getUnremittedPayments(user.tenantId, isManager ? null : user.sub);
|
||||
}
|
||||
|
||||
@Get('remittances')
|
||||
|
||||
@@ -151,6 +151,7 @@ export class PaymentService {
|
||||
// Attach full payment details to each remittance's join records
|
||||
return remittances.map((r) => ({
|
||||
...r,
|
||||
createdAt: r.submittedAt.toISOString(),
|
||||
payments: r.payments.map((rp) => ({
|
||||
...rp,
|
||||
payment: paymentMap.get(rp.paymentId) ?? null,
|
||||
|
||||
Reference in New Issue
Block a user