(self, account_id: str, request: AccountPreferencesRequest)
| 260 | records[index] = task.model_dump() |
| 261 | return records |
| 262 | records.append(task.model_dump()) |
| 263 | return records |
| 264 | |
| 265 | self.tasks_store.update(updater) |
| 266 | return task |
| 267 | |
| 268 | def clear_payment_cache(self) -> None: |
| 269 | """Discard QR/payment task cache that should not survive service restarts.""" |
| 270 | self.tasks_store.write([]) |
| 271 | for account in self.list_accounts(): |
| 272 | session = self.load_session(account.id) |
| 273 | session.last_sign = "" |
| 274 | session.last_order_id = "" |
| 275 | session.preview = None |
| 276 | self.save_session(session) |
| 277 | logger.info("payment cache cleared on startup") |
| 278 | |
| 279 | def delete_account(self, account_id: str) -> None: |
| 280 | account = self.get_account(account_id) |
| 281 | |
| 282 | def update_accounts(records: list[dict[str, Any]]) -> list[dict[str, Any]]: |
| 283 | return [item for item in records if item.get("id") != account_id] |
| 284 | |
| 285 | def update_tasks(records: list[dict[str, Any]]) -> list[dict[str, Any]]: |
| 286 | return [item for item in records if item.get("account_id") != account_id] |
| 287 | |
| 288 | self.accounts_store.update(update_accounts) |
| 289 | self.tasks_store.update(update_tasks) |
| 290 | session_path = self._session_path(account_id) |
| 291 | if session_path.exists(): |
| 292 | session_path.unlink() |
nothing calls this directly
no test coverage detected