Skip to content

Instantly share code, notes, and snippets.

@richartkeil
Created August 8, 2020 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richartkeil/6f6bc4ea3cddfc3f590894e2534d23bb to your computer and use it in GitHub Desktop.
Save richartkeil/6f6bc4ea3cddfc3f590894e2534d23bb to your computer and use it in GitHub Desktop.
class Account {
constructor(protected accountId: string) {}
public async addEvent(event: Event) {
return firestore()
.collection("accounts")
.doc(this.accountId)
.collection("events")
.add({
name: event.getName(),
payload: event.getPayload(),
isCritical: event.isCritical(),
createdAt: firestore.FieldValue.serverTimestamp(),
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment