Aligned tests with rest api
MODIFY
src/server/rest/v1/router/api/TransactionRouter.ts
src/server/rest/v1/router/api/TransactionRouter.ts
@@ -27,6 +27,7 @@ export default class TransactionRouter {
this.buildRouteTransactionsExport();
this.buildRouteSynchronizeRefundedTransactions();
this.buildRouteTransactionsRefundReports();
+ this.buildRouteTransactionsToRefundExport();
return this.router;
}
@@ -139,4 +140,10 @@ export default class TransactionRouter {
await RouterUtils.handleServerAction(TransactionService.handleGetRefundReports.bind(this), ServerAction.TRANSACTIONS_TO_REFUND_REPORTS, req, res, next);
});
}
+
+ protected buildRouteTransactionsToRefundExport(): void {
+ this.router.get(`/${ServerRoute.REST_TRANSACTIONS_REFUND_EXPORT}`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(TransactionService.handleExportTransactionsToRefund.bind(this), ServerAction.TRANSACTIONS_TO_REFUND_EXPORT, req, res, next);
+ });
+ }
}

MODIFY
src/types/Server.ts
src/types/Server.ts
@@ -494,6 +494,7 @@ export enum ServerRoute {
REST_TRANSACTION_CONSUMPTIONS_REBUILD = 'transactions/:id/consumptions/rebuild',
REST_TRANSACTION_SOFT_STOP = 'transactions/:id/stop/soft',
REST_TRANSACTIONS_REFUND = 'transactions/action/refund',
+ REST_TRANSACTIONS_REFUND_EXPORT = 'transactions/action/refund/export',
REST_TRANSACTIONS_ASSIGN_USER = 'transactions/action/assign',
REST_TRANSACTIONS_SYNCHRONIZE_REFUNDED = 'transactions/action/refund/synchronize',
REST_TRANSACTIONS_REFUND_REPORTS = 'transactions/action/refund/reports',

MODIFY
test/api/client/TransactionApi.ts
test/api/client/TransactionApi.ts
@@ -20,7 +20,7 @@ export default class TransactionApi extends CrudApi {
}
public async readAllInError(params, paging = TestConstants.DEFAULT_PAGING, ordering = TestConstants.DEFAULT_ORDERING) {
- return await super.readAll(params, paging, ordering, '/client/api/TransactionsInError');
+ return await super.readAll({ ...params, Status: 'in-error' }, paging, ordering, this.buildRestEndpointUrl(ServerRoute.REST_TRANSACTIONS));
}
public async readAllConsumption(params) {
@@ -46,15 +46,15 @@ export default class TransactionApi extends CrudApi {
}
public async readAllToRefund(params) {
- return await super.readAll(params, TestConstants.ADVANCED_PAGING, TestConstants.DEFAULT_ORDERING, '/client/api/TransactionsToRefund');
+ return await super.readAll({ ...params, Status: 'to-refund' }, TestConstants.ADVANCED_PAGING, TestConstants.DEFAULT_ORDERING, this.buildRestEndpointUrl(ServerRoute.REST_TRANSACTIONS));
}
public async readAllRefundReports(params, paging = TestConstants.DEFAULT_PAGING, ordering = TestConstants.DEFAULT_ORDERING) {
- return await super.readAll(params, paging, ordering, '/client/api/TransactionsRefundReports');
+ return await super.readAll(params, paging, ordering, this.buildRestEndpointUrl(ServerRoute.REST_TRANSACTIONS_REFUND_REPORTS));
}
public async exportTransactionsToRefund(params) {
- return await super.read(params, '/client/api/TransactionsToRefundExport');
+ return await super.read(params, this.buildRestEndpointUrl(ServerRoute.REST_TRANSACTIONS_REFUND_EXPORT));
}
}

Aligned tests with rest api