refact(billing): Use sql functions instead of views

These functions will ensure that UTC time is used for billing queries,
eliminating the need for the repository to set the timezone. This also
means the repository no longern needs a writer.
This commit is contained in:
Timothy Messier committed 2024-02-23 15:44:09 +00:00
1 parent 7c14e42897
commit e09bf09a95
5 files changed
+27 -57

No files matched your search

+1 -1
View File
@@ -451,7 +451,7 @@ func New(ctx context.Context, conf *Config) (*Controller, error) {
return server.NewRepositoryStorage(ctx, dbase, dbase, c.kms)
}
c.BillingRepoFn = func() (*billing.Repository, error) {
return billing.NewRepository(ctx, dbase, dbase)
return billing.NewRepository(ctx, dbase)
}
// Check that credentials are available at startup, to avoid some harmless