fix: add collector role to API endpoints for mobile dashboard access
Collector users were blocked from ticket, payment, invoice, and client endpoints requiring 'technician' role. Added 'collector' to @Roles decorators and the COLLECTOR role to the shared role hierarchy.
This commit is contained in:
@@ -23,7 +23,7 @@ export class PaymentController {
|
||||
constructor(private readonly paymentService: PaymentService) {}
|
||||
|
||||
@Get()
|
||||
@Roles('technician')
|
||||
@Roles('technician', 'collector')
|
||||
async findAll(
|
||||
@CurrentUser() user: CurrentUserPayload,
|
||||
@Query('clientId') clientId?: string,
|
||||
@@ -32,7 +32,7 @@ export class PaymentController {
|
||||
}
|
||||
|
||||
@Post()
|
||||
@Roles('technician')
|
||||
@Roles('technician', 'collector')
|
||||
async record(
|
||||
@CurrentUser() user: CurrentUserPayload,
|
||||
@Body() dto: RecordPaymentDto,
|
||||
@@ -41,19 +41,19 @@ export class PaymentController {
|
||||
}
|
||||
|
||||
@Get('unremitted')
|
||||
@Roles('technician')
|
||||
@Roles('technician', 'collector')
|
||||
async getUnremitted(@CurrentUser() user: CurrentUserPayload, @Query('collectorId') collectorId?: string) {
|
||||
return this.paymentService.getUnremittedPayments(user.tenantId, collectorId || user.sub);
|
||||
}
|
||||
|
||||
@Get('remittances')
|
||||
@Roles('technician')
|
||||
@Roles('technician', 'collector')
|
||||
async findRemittances(@CurrentUser() user: CurrentUserPayload) {
|
||||
return this.paymentService.findRemittances(user.tenantId);
|
||||
}
|
||||
|
||||
@Post('remittances')
|
||||
@Roles('technician')
|
||||
@Roles('technician', 'collector')
|
||||
async submitRemittance(
|
||||
@CurrentUser() user: CurrentUserPayload,
|
||||
@Body() dto: CreateRemittanceDto,
|
||||
|
||||
Reference in New Issue
Block a user