@@ -48,15 +48,15 @@ struct DashboardTemplate {
4848}
4949
5050pub async fn dashboard ( State ( state) : State < AppState > ) -> Response {
51- let status_counts = match state. account_repo . count_accounts_by_status ( ) . await {
51+ let status_counts = match state. pb_account_repo . count_accounts_by_status ( ) . await {
5252 Ok ( c) => c,
5353 Err ( e) => {
5454 tracing:: error!( "Failed to count accounts: {e}" ) ;
5555 return ( StatusCode :: INTERNAL_SERVER_ERROR , "Database error" ) . into_response ( ) ;
5656 }
5757 } ;
5858
59- let purpose_counts = match state. account_repo . count_accounts_by_purpose ( ) . await {
59+ let purpose_counts = match state. pb_account_repo . count_accounts_by_purpose ( ) . await {
6060 Ok ( c) => c,
6161 Err ( e) => {
6262 tracing:: error!( "Failed to count by purpose: {e}" ) ;
@@ -114,15 +114,15 @@ async fn render_accounts_list(
114114 error : Option < String > ,
115115 success : Option < String > ,
116116) -> Response {
117- let accounts = match state. account_repo . list_accounts ( ) . await {
117+ let accounts = match state. pb_account_repo . list_accounts ( ) . await {
118118 Ok ( a) => a,
119119 Err ( e) => {
120120 tracing:: error!( "Failed to list accounts: {e}" ) ;
121121 return ( StatusCode :: INTERNAL_SERVER_ERROR , "Database error" ) . into_response ( ) ;
122122 }
123123 } ;
124124
125- let purpose_codes = match state. account_repo . list_purpose_types ( ) . await {
125+ let purpose_codes = match state. pb_account_repo . list_purpose_types ( ) . await {
126126 Ok ( pts) => pts. into_iter ( ) . map ( |p| p. purpose_code ) . collect ( ) ,
127127 Err ( _) => vec ! [ ] ,
128128 } ;
@@ -193,7 +193,7 @@ pub async fn create_account(
193193 } ;
194194
195195 match state
196- . account_service
196+ . pb_account_service
197197 . create_account (
198198 holder_id,
199199 & form. purpose_code ,
@@ -229,7 +229,7 @@ pub async fn update_account_status(
229229 } ;
230230
231231 match state
232- . account_service
232+ . pb_account_service
233233 . update_status ( account_id, status)
234234 . await
235235 {
@@ -278,7 +278,7 @@ pub async fn account_detail(
278278 State ( state) : State < AppState > ,
279279 Path ( account_id) : Path < Uuid > ,
280280) -> Response {
281- let account = match state. account_repo . get_account ( account_id) . await {
281+ let account = match state. pb_account_repo . get_account ( account_id) . await {
282282 Ok ( a) => a,
283283 Err ( e) => {
284284 tracing:: error!( "Account not found: {e}" ) ;
@@ -463,7 +463,7 @@ struct DepositTemplate {
463463}
464464
465465pub async fn deposit_form ( State ( state) : State < AppState > , Path ( account_id) : Path < Uuid > ) -> Response {
466- let account = match state. account_repo . get_account ( account_id) . await {
466+ let account = match state. pb_account_repo . get_account ( account_id) . await {
467467 Ok ( a) => a,
468468 Err ( _) => return ( StatusCode :: NOT_FOUND , "Account not found" ) . into_response ( ) ,
469469 } ;
@@ -495,7 +495,7 @@ pub async fn process_deposit(
495495 let gateway_ref = form. gateway_ref . as_deref ( ) . filter ( |s| !s. is_empty ( ) ) ;
496496 let funding_type = form. funding_type . as_deref ( ) . filter ( |s| !s. is_empty ( ) ) ;
497497 match state
498- . deposit_service
498+ . pb_deposit_service
499499 . deposit (
500500 account_id,
501501 & form. source_ifsc ,
@@ -513,7 +513,7 @@ pub async fn process_deposit(
513513 . into_response ( ) ,
514514 Err ( e) => {
515515 let purpose_code = state
516- . account_repo
516+ . pb_account_repo
517517 . get_account ( account_id)
518518 . await
519519 . map ( |a| a. purpose_code )
@@ -533,7 +533,7 @@ pub async fn post_deposit(
533533 Path ( ( account_id, deposit_id) ) : Path < ( Uuid , Uuid ) > ,
534534) -> Response {
535535 match state
536- . deposit_service
536+ . pb_deposit_service
537537 . post_deposit ( account_id, deposit_id)
538538 . await
539539 {
@@ -552,7 +552,7 @@ pub async fn void_deposit(
552552 Path ( ( account_id, deposit_id) ) : Path < ( Uuid , Uuid ) > ,
553553) -> Response {
554554 match state
555- . deposit_service
555+ . pb_deposit_service
556556 . void_deposit ( account_id, deposit_id, None )
557557 . await
558558 {
@@ -576,7 +576,7 @@ struct PaymentTemplate {
576576}
577577
578578pub async fn payment_form ( State ( state) : State < AppState > , Path ( account_id) : Path < Uuid > ) -> Response {
579- let account = match state. account_repo . get_account ( account_id) . await {
579+ let account = match state. pb_account_repo . get_account ( account_id) . await {
580580 Ok ( a) => a,
581581 Err ( _) => return ( StatusCode :: NOT_FOUND , "Account not found" ) . into_response ( ) ,
582582 } ;
@@ -604,7 +604,7 @@ pub async fn process_payment(
604604) -> Response {
605605 let gateway_ref = form. gateway_ref . as_deref ( ) . filter ( |s| !s. is_empty ( ) ) ;
606606 match state
607- . payment_service
607+ . pb_payment_service
608608 . make_payment (
609609 account_id,
610610 form. amount ,
@@ -620,7 +620,7 @@ pub async fn process_payment(
620620 . into_response ( ) ,
621621 Err ( e) => {
622622 let purpose_code = state
623- . account_repo
623+ . pb_account_repo
624624 . get_account ( account_id)
625625 . await
626626 . map ( |a| a. purpose_code )
@@ -648,7 +648,7 @@ pub async fn withdrawal_form(
648648 State ( state) : State < AppState > ,
649649 Path ( account_id) : Path < Uuid > ,
650650) -> Response {
651- let account = match state. account_repo . get_account ( account_id) . await {
651+ let account = match state. pb_account_repo . get_account ( account_id) . await {
652652 Ok ( a) => a,
653653 Err ( _) => return ( StatusCode :: NOT_FOUND , "Account not found" ) . into_response ( ) ,
654654 } ;
@@ -673,15 +673,15 @@ pub async fn process_withdrawal(
673673) -> Response {
674674 let gateway_ref = form. gateway_ref . as_deref ( ) . filter ( |s| !s. is_empty ( ) ) ;
675675 match state
676- . withdrawal_service
676+ . pb_withdrawal_service
677677 . withdraw ( account_id, form. amount , None , gateway_ref)
678678 . await
679679 {
680680 Ok ( _) => Redirect :: to ( & prefixed ( & state, & format ! ( "/admin/accounts/{account_id}" ) ) )
681681 . into_response ( ) ,
682682 Err ( e) => {
683683 let purpose_code = state
684- . account_repo
684+ . pb_account_repo
685685 . get_account ( account_id)
686686 . await
687687 . map ( |a| a. purpose_code )
@@ -929,7 +929,7 @@ struct PurposeTypesTemplate {
929929}
930930
931931pub async fn purpose_types_page ( State ( state) : State < AppState > ) -> Response {
932- let purpose_types = match state. account_repo . list_purpose_types ( ) . await {
932+ let purpose_types = match state. pb_account_repo . list_purpose_types ( ) . await {
933933 Ok ( pts) => pts,
934934 Err ( e) => {
935935 tracing:: error!( "Failed to list purpose types: {e}" ) ;
@@ -993,7 +993,7 @@ pub async fn transaction_detail(
993993
994994 let dash = "—" . to_string ( ) ;
995995
996- let ( holder_id, purpose_code) = match state. account_repo . get_account ( txn. account_id ) . await {
996+ let ( holder_id, purpose_code) = match state. pb_account_repo . get_account ( txn. account_id ) . await {
997997 Ok ( a) => ( a. holder_id , a. purpose_code ) ,
998998 Err ( e) => {
999999 tracing:: warn!( "Failed to load parent account for transaction {transaction_id}: {e}" ) ;
@@ -1101,7 +1101,7 @@ pub async fn post_transaction(
11011101 Err ( _) => return ( StatusCode :: NOT_FOUND , "Transaction not found" ) . into_response ( ) ,
11021102 } ;
11031103 if let Err ( e) = state
1104- . deposit_service
1104+ . pb_deposit_service
11051105 . post_deposit ( txn. account_id , transaction_id)
11061106 . await
11071107 {
@@ -1123,7 +1123,7 @@ pub async fn void_transaction(
11231123 Err ( _) => return ( StatusCode :: NOT_FOUND , "Transaction not found" ) . into_response ( ) ,
11241124 } ;
11251125 if let Err ( e) = state
1126- . deposit_service
1126+ . pb_deposit_service
11271127 . void_deposit ( txn. account_id , transaction_id, None )
11281128 . await
11291129 {
0 commit comments