Skip to content

Commit 01d3679

Browse files
authored
Merge pull request #25 from OmentaElvis/dev
B2C and balance inquiry
2 parents 231dc97 + 2225da8 commit 01d3679

20 files changed

Lines changed: 1840 additions & 36 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ Core M-Pesa API coverage roadmap for **Pesa Playground**.
164164
#### Business to Customer (B2C)
165165
This is a unified api that is used by Business To Pochi and Business To Customer (B2C)
166166
167-
- [ ] B2C Payment Request - simulate disbursements to mobile numbers
167+
- B2C Payment Request - simulate disbursements to mobile numbers
168168
- [ ] Transaction Status query
169-
- [ ] Balance query
169+
- Balance query
170170
171171
#### Business to Business (B2B)
172172
This is a unified api that is used by Tax remitance, Business Paybill, Business Buy Goods and B2C Account Top Up

crates/pesa-core/src/accounts/till_accounts/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::str::FromStr;
22

3-
use anyhow::{anyhow, Context, Result};
3+
use anyhow::{Context, Result, anyhow};
44
use chrono::Utc;
55
use sea_orm::{
66
ActiveModelTrait, ColumnTrait, ConnectionTrait, DbErr, EntityTrait, QueryFilter, Set,

crates/pesa-core/src/accounts/user_profiles/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,9 @@ impl User {
276276
db::Entity::delete_by_id(user_id).exec(conn).await?;
277277

278278
// Then delete the account
279-
accounts::db::Entity::delete_by_id(user_id).exec(conn).await?;
279+
accounts::db::Entity::delete_by_id(user_id)
280+
.exec(conn)
281+
.await?;
280282

281283
Ok(())
282284
}

crates/pesa-core/src/business_operators/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ use sea_orm::{
22
ActiveModelTrait, ActiveValue::Set, ColumnTrait, ConnectionTrait, EntityTrait, FromQueryResult,
33
QueryFilter,
44
};
5-
use serde::Serialize;
5+
use serde::{Deserialize, Serialize};
66

77
pub mod db;
88
pub mod ui;
99

10-
#[derive(FromQueryResult, Debug, Serialize)]
10+
#[derive(FromQueryResult, Debug, Serialize, Deserialize, Clone)]
1111
pub struct BusinessOperator {
1212
pub id: u32,
1313
pub username: String,

crates/pesa-core/src/self_test/emitter.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ use crate::AppEventManager;
66
use super::context::TestMode;
77

88
// Re-export this so it's in one place
9-
pub use super::runner::{
10-
SELF_TEST_FINISH, SELF_TEST_PLAN, SELF_TEST_START, SELF_TEST_STEP_UPDATE,
11-
};
129
pub use super::context::SELF_TEST_PROGRESS_LOG;
10+
pub use super::runner::{SELF_TEST_FINISH, SELF_TEST_PLAN, SELF_TEST_START, SELF_TEST_STEP_UPDATE};
1311

1412
#[derive(Serialize, Clone, Debug)]
1513
#[serde(rename_all = "snake_case")]
@@ -71,8 +69,7 @@ impl MainUiEmitter {
7169
}
7270

7371
fn emit(&self, event: &str, payload: impl Serialize) -> anyhow::Result<()> {
74-
self.emitter
75-
.emit_all(event, serde_json::to_value(payload)?)
72+
self.emitter.emit_all(event, serde_json::to_value(payload)?)
7673
}
7774

7875
pub fn emit_start(&self, payload: &TestStartPayload) -> anyhow::Result<()> {

0 commit comments

Comments
 (0)