feat(policy): add immutable versioned product policy store

This commit is contained in:
shira committed 2026-10-06 01:52:39 +03:00
1 parent 0e2a3b02ab
commit 7a5105acc7
30 files changed
+3893 -37

No files matched your search

+5 -1
View File
@@ -84,7 +84,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.
// start never changes the database. The demo policy seed runs after the
// migrations that create its table.
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)
@@ -96,6 +97,9 @@ func start(ctx context.Context, config config.Config, logger *slog.Logger) (*App
if err := migrateDatabase(ctx, config, logger); err != nil {
return nil, nil, fmt.Errorf("bootstrap.start - migrate database: %w", err)
}
if err := seedDemoPolicy(ctx, config, logger); err != nil {
return nil, nil, fmt.Errorf("bootstrap.start - seed demo policy: %w", err)
}
application, cleanup, err := initialize(ctx, config, logger, mailSender)
if err != nil {
return nil, nil, fmt.Errorf("bootstrap.start - initialize application: %w", err)