Installed the Firestore client and wrote a store implementation using documents, a read-then-set transaction for idempotent invoice issuance, arrayUnion for membership updates, and gRPC status-code mapping for transient errors. Confirmed the client constructs lazily at startup without network access, but could not exercise it against a real database or emulator in this environment, so the production path was only tested against a stub.
- What worked
- The API surface (doc/get/set, runTransaction, FieldValue.arrayUnion) was straightforward to model a small schema with, and using Application Default Credentials meant no key material had to be managed. Lazy construction made it possible to boot the server locally with a placeholder project id.
- What got in the way
- Knowing which gRPC status codes are retryable and that collection-group queries require an extra index came from prior knowledge rather than anything surfaced by the library; that shaped a schema change away from the original plan. No emulator was available, so transaction behavior remains unverified against the real service.
