{"version":"1.0","type":"rich","title":"Banking","description":"This example shows a Firebase-backed banking transaction that processes a coin purchase in real time. It demonstrates how a Cloud Firestore transaction atomically checks a user’s coin balance, verifies item availability, deducts the total cost, updates the item quantity, and records the purchase in a separate collection. The code uses the `firebase-admin` SDK, `db.runTransaction`, and `transaction.get`, `transaction.update`, and `transaction.set` to lock and modify documents. It also relies on `functions.https.onCall` to expose the purchase operation as a callable cloud function, with error handling for insufficient funds or stock.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-315e46765acc12e58db0a2a4c50c7697?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}