Skip to content

Feature: Add Note to Budget Command#175

Open
TMUCHIRI wants to merge 1 commit intoitalanta:mainfrom
TMUCHIRI:feat/add-budget-note-command
Open

Feature: Add Note to Budget Command#175
TMUCHIRI wants to merge 1 commit intoitalanta:mainfrom
TMUCHIRI:feat/add-budget-note-command

Conversation

@TMUCHIRI
Copy link

Backend development process
Implemented the write-side of a new feature using the existing CQRS pattern with @iote/cqrs. Commands are immutable payloads, handlers contain business logic and have access to repositories via the injected toolkit.

Design choices

  • AddNoteToBudgetCommand includes validation and all required fields (budgetId, content, author)
  • Handler extends FunctionHandler<Command, Result> – exact pattern used across the codebase
  • Uses getRepository() from the CQRS toolkit (standard in all existing handlers)
  • Simple demo ID generation (real Firestore would auto-generate)

Deployment
This handler will be automatically discovered and deployed as a Firebase Cloud Function (serverless) when the functions project is built and deployed – no extra configuration needed.

Serverless deployment & scaling

  • Zero server management
  • Automatic horizontal scaling to thousands of concurrent executions
  • Pay-per-use pricing → extremely cost-effective for write-heavy or bursty workloads
  • Cold starts are negligible for this size of function
  • Stateless design fits perfectly with Cloud Functions / Cloud Run

Library created at: libs/features/budgetting/budget-notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant