-
-
Save richartkeil/6f6bc4ea3cddfc3f590894e2534d23bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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