feat(fapp): add full integration tests for FAPP flow

New tests/fapp_flow.rs with 3 integration tests:
- full_fapp_flow_announce_query_reserve_confirm: Complete flow
  from therapist announcement through patient reservation to
  confirmation with E2E encryption
- fapp_rejection_flow: Tests the rejection case
- fapp_query_filters: Tests Fachrichtung, PLZ, and other filters

FappRouter additions:
- register_therapist_key(): public method for key registration
- store_announce(): public method for storing announcements

Total tests: 217 (198 lib + 3 fapp_flow + 16 multi_node)
This commit is contained in:
2026-04-01 16:35:57 +02:00
parent ad636b874b
commit 6ae3251ebd
2 changed files with 406 additions and 0 deletions

View File

@@ -426,6 +426,25 @@ impl FappRouter {
let out = std::mem::take(&mut *q);
Ok(out)
}
/// Register a therapist's public key for signature verification.
pub fn register_therapist_key(&self, address: [u8; 16], public_key: [u8; 32]) -> Result<()> {
let mut store = self
.store
.lock()
.map_err(|e| anyhow::anyhow!("store lock poisoned: {e}"))?;
store.register_therapist_key(address, public_key);
Ok(())
}
/// Store a slot announcement directly (for testing or local therapist).
pub fn store_announce(&self, announce: SlotAnnounce) -> Result<bool> {
let mut store = self
.store
.lock()
.map_err(|e| anyhow::anyhow!("store lock poisoned: {e}"))?;
Ok(store.store(announce))
}
}
#[cfg(test)]