added server action
MODIFY
src/server/rest/v1/router/api/TransactionRouter.ts
src/server/rest/v1/router/api/TransactionRouter.ts
@@ -14,22 +14,14 @@ export default class TransactionRouter {
public buildRoutes(): express.Router {
this.buildRouteTransactions();
- this.buildRouteCompletedTransactions();
this.buildRouteTransaction();
this.buildRouteTransactionConsumption();
- this.buildRouteTransactionsInProgress();
return this.router;
}
protected buildRouteTransactions(): void {
this.router.get(`/${ServerRoute.REST_TRANSACTIONS}`, async (req: Request, res: Response, next: NextFunction) => {
- await RouterUtils.handleServerAction(TransactionService.handleGetTransactions.bind(this), ServerAction.TRANSACTION, req, res, next);
- });
- }
-
- protected buildRouteCompletedTransactions(): void {
- this.router.get(`/${ServerRoute.REST_TRANSACTIONS_HISTORY}`, async (req: Request, res: Response, next: NextFunction) => {
- await RouterUtils.handleServerAction(TransactionService.handleGetTransactionsCompleted.bind(this), ServerAction.TRANSACTIONS_COMPLETED, req, res, next);
+ await RouterUtils.handleServerAction(TransactionService.handleGetTransactions.bind(this), ServerAction.TRANSACTIONS, req, res, next);
});
}
@@ -40,12 +32,6 @@ export default class TransactionRouter {
});
}
- protected buildRouteTransactionsInProgress(): void {
- this.router.get(`/${ServerRoute.REST_TRANSACTIONS_IN_PROGRESS}`, async (req: Request, res: Response, next: NextFunction) => {
- await RouterUtils.handleServerAction(TransactionService.handleGetTransactionsActive.bind(this), ServerAction.TRANSACTIONS_ACTIVE, req, res, next);
- });
- }
-
protected buildRouteTransactionConsumption(): void {
this.router.get(`/${ServerRoute.REST_TRANSACTIONS_CONSUMPTION}`, async (req: Request, res: Response, next: NextFunction) => {
req.query.TransactionId = req.params.id;

MODIFY
src/types/Server.ts
src/types/Server.ts
@@ -283,6 +283,7 @@ export enum ServerAction {
TRANSACTION_YEARS = 'TransactionYears',
UNASSIGNED_TRANSACTIONS_COUNT = 'UnassignedTransactionsCount',
TRANSACTION = 'Transaction',
+ TRANSACTIONS = 'Transactions',
TRANSACTION_CONSUMPTION = 'TransactionConsumption',
TRANSACTION_OCPI_CDR_EXPORT = 'TransactionOcpiCdrExport',
@@ -472,9 +473,7 @@ export enum ServerRoute {
REST_CHARGING_PROFILE = 'chargingprofiles/:id',
REST_TRANSACTIONS = 'transactions',
- REST_TRANSACTIONS_HISTORY = 'transactions/history',
REST_TRANSACTION = 'transactions/:id',
- REST_TRANSACTIONS_IN_PROGRESS = 'transactions/status/inprogress',
REST_TRANSACTIONS_CONSUMPTION = 'transactions/:id/consumptions',
REST_USERS = 'users',

added server action