fix: address final review findings — lint, Node engine, remaining-work doc, create-rule validation

This commit is contained in:
belviskhoremk
2026-08-05 00:35:50 +00:00
parent 9ec17d36f9
commit 5821b630f6
5 changed files with 103 additions and 4 deletions

View File

@@ -2,7 +2,7 @@
"name": "functions",
"private": true,
"type": "module",
"engines": { "node": "20" },
"engines": { "node": "22" },
"main": "lib/index.js",
"scripts": {
"build": "tsc",

View File

@@ -16,6 +16,8 @@ export const onBookingCreated = onDocumentCreated(
async (event) => {
const booking = event.data?.data()
if (!booking) return
if (typeof booking.date !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(booking.date)) return
if (typeof booking.time !== 'string' || booking.time.length === 0) return
const db = getFirestore()
await db