feat(budget-alerts-email): Email-Stub-Send wenn Project-Budget >100% (in webhookDispatc [tsc:fail]

This commit is contained in:
Dennis (via Claude+Gemma) 2026-05-23 08:59:07 +02:00
parent 570be9c6d8
commit 43f2e030b1
3 changed files with 27 additions and 2 deletions

View File

@ -1,9 +1,10 @@
{ {
"completed_features": [], "completed_features": [],
"current_feature": "search-pagination", "current_feature": "budget-alerts-email",
"started_at": "2026-05-23T08:55:38.459472", "started_at": "2026-05-23T08:55:38.459472",
"attempted_features": [ "attempted_features": [
"advanced-filters", "advanced-filters",
"bulk-customer-tag" "bulk-customer-tag",
"search-pagination"
] ]
} }

View File

@ -3152,3 +3152,21 @@ src/index.ts(27,25): error TS2769: No overload matches this call.
Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,
- `08:58:44` **INFO** Committed feature search-pagination
- `08:58:44` **INFO** Pushed: rc=0
## Phase-3 Feature: budget-alerts-email (2026-05-23 08:58:44)
- `08:58:44` **INFO** Description: Email-Stub-Send wenn Project-Budget >100% (in webhookDispatcher)
- `08:58:44` **INFO** Generating apps/api/src/services/email.ts (ERWEITERT — behalte alle bestehenden Methoden. Füge sendBudgetExceeded…)
- `08:59:06` **INFO** wrote 2568 chars in 21.4s (attempt 1)
- `08:59:06` **INFO** Running tsc --noEmit on api…
- `08:59:07` **WARN** tsc errors:
src/db/schema.ts(37,14): error TS7022: 'customers' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
src/db/schema.ts(43,59): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
src/db/schema.ts(47,14): error TS7022: 'projects' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
src/db/schema.ts(51,56): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
src/index.ts(27,25): error TS2769: No overload matches this call.
Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,

View File

@ -52,6 +52,12 @@ class EmailService {
await this.send(user.email, subject, body); await this.send(user.email, subject, body);
} }
async sendBudgetExceeded(user: User, project: { name: string }, percent: number) {
const subject = `Budget exceeded for ${project.name}`;
const body = `Hi ${user.name || "there"},\n\nThe budget for project "${project.name}" has been exceeded. Current usage is at ${percent}%. Please review your project settings.`;
await this.send(user.email, subject, body);
}
} }
export const emailService = new EmailService(); export const emailService = new EmailService();