Make billing catalog dynamic for all runtimes and bill optional service resources.
Derive admin tabs and addon rows from enums, and add Redis/RabbitMQ/ES CPU/RAM/disk to deploy cost using the app runtime unit rates. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
-- Ensure pricing_rates rows exist for every AppRuntime enum value
|
||||
|
||||
INSERT INTO pricing_rates (runtime, resource_type, hourly_price, monthly_price, yearly_price)
|
||||
SELECT r.runtime, t.resource_type, 0, 0, 0
|
||||
FROM (
|
||||
VALUES
|
||||
('nodejs'),
|
||||
('laravel'),
|
||||
('wordpress'),
|
||||
('go'),
|
||||
('php'),
|
||||
('python'),
|
||||
('django'),
|
||||
('dotnet')
|
||||
) AS r(runtime)
|
||||
CROSS JOIN (
|
||||
VALUES
|
||||
('base_fee'),
|
||||
('cpu_per_core'),
|
||||
('memory_per_gb'),
|
||||
('storage_per_gb'),
|
||||
('database_addon')
|
||||
) AS t(resource_type)
|
||||
ON CONFLICT (runtime, resource_type) DO NOTHING;
|
||||
Reference in New Issue
Block a user