completed migration from user to workspace
This commit is contained in:
@@ -10,6 +10,7 @@ import zw.qantra.tm.domain.models.Workspace;
|
||||
import zw.qantra.tm.domain.services.VelocityAccountService;
|
||||
import zw.qantra.tm.domain.services.WorkspaceService;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@RestController
|
||||
@@ -21,7 +22,7 @@ public class AccountController {
|
||||
private final WorkspaceService workspaceService;
|
||||
|
||||
@GetMapping("/{workspaceId}/balance/{currency}")
|
||||
public ResponseEntity<VelocityAccountDto> getAccount(
|
||||
public ResponseEntity getAccount(
|
||||
@PathVariable UUID workspaceId,
|
||||
@PathVariable String currency
|
||||
) {
|
||||
@@ -32,12 +33,12 @@ public class AccountController {
|
||||
VelocityAccountDto account = velocityAccountService.getAccountByPhone(currencyPhoneConcat);
|
||||
return ResponseEntity.ok(account);
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.badRequest().build();
|
||||
return ResponseEntity.badRequest().body(Map.of("error", e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/{workspaceId}/statement/{currency}")
|
||||
public ResponseEntity<VelocityStatementDto> getStatement(
|
||||
public ResponseEntity getStatement(
|
||||
@PathVariable UUID workspaceId,
|
||||
@PathVariable String currency,
|
||||
@RequestParam String startDate,
|
||||
@@ -50,7 +51,7 @@ public class AccountController {
|
||||
currencyPhoneConcat, startDate, endDate);
|
||||
return ResponseEntity.ok(statement);
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.badRequest().build();
|
||||
return ResponseEntity.badRequest().body(Map.of("error", e.getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user