feat(notification): add Resend quota gate and waiting-for-reset state

This commit is contained in:
shira committed 2026-10-06 11:50:38 +03:00
1 parent 3b917befa9
commit b856d4ff54
40 files changed
+4116 -48

No files matched your search

+3 -2
View File
@@ -102,8 +102,8 @@ func run(ctx context.Context, config config.Config, logger *slog.Logger) error {
// start prepares the application without opening listeners. The mail
// transport is selected before migrations, so a configuration that cannot
// start never changes the database. The demo policy seed runs after the
// migrations that create its table.
// start never changes the database. The demo policy seed and the mail quota
// report run after the migrations that create their tables.
func start(ctx context.Context, config config.Config, logger *slog.Logger) (*Application, func(), error) {
if err := config.Validate(); err != nil {
return nil, nil, fmt.Errorf("bootstrap.start - validate configuration: %w", err)
@@ -118,6 +118,7 @@ func start(ctx context.Context, config config.Config, logger *slog.Logger) (*App
if err := seedDemoPolicy(ctx, config, logger); err != nil {
return nil, nil, fmt.Errorf("bootstrap.start - seed demo policy: %w", err)
}
reportMailQuota(ctx, config, logger)
application, cleanup, err := initialize(ctx, config, logger, mailSender)
if err != nil {
return nil, nil, fmt.Errorf("bootstrap.start - initialize application: %w", err)