243 Commits

Author SHA1 Message Date
Sven Efftinge
2fd43d6307 [usage] update stripe usage on finalization
update stripe with current usage immediately, so that
invoices created between now and the next reconcile
are correct.
2023-02-10 14:33:15 +01:00
Milan Pavlik
41dabf9619 [usage] Reduce log level for Fetching usage data log 2023-02-08 14:55:46 +01:00
Sven Efftinge
03a5fb6ac7 [billing] provide human readable price info 2023-01-23 11:55:30 +01:00
Sven Efftinge
6868ce095c [dashboard] access invoices after cancellation 2023-01-06 08:27:45 +01:00
Milan Pavlik
0309d14721 [gitpod-db] Helper to construct db connection params from env 2022-12-21 10:07:30 -03:00
Sven Efftinge
aaa0653d54 [ubp] reset usage on chargebee cancellation 2022-12-15 12:32:25 -03:00
Gero Posmyk-Leinemann
8a03b3a156 [installer, gitpod-db] Introduce database.ssl.ca 2022-12-15 12:29:24 -03:00
Sven Efftinge
a6170cad92 [dashboard] display credit usage 2022-12-12 11:09:22 -03:00
Christian Weichel
478a75e744 Switch license to AGPL 2022-12-08 13:05:19 -03:00
Jan Keromnes
337beaf7d1 [usage] Ensure Gitpod can detect customers' automatic tax status when creating new subsriptions 2022-12-08 07:49:18 -03:00
Sven Efftinge
aa4a5cafb6 [usage] make increment billing cycle more robust 2022-12-07 05:54:17 -03:00
Sven Efftinge
fcc42fe1a4 [usage] handle no stopping but stopped time 2022-12-06 12:38:17 -03:00
Sven Efftinge
57593bfedd [usage] increment cycle on finalize invoice 2022-12-06 05:24:16 -03:00
Sven Efftinge
797c1b7421 [usage] support multiple entries on invoices 2022-12-05 08:44:15 -03:00
Sven Efftinge
a5d67448b2 Revert "[usage] handle reset usage for chargebee" 2022-12-02 11:47:01 -03:00
Sven Efftinge
6c41fa5e17 [usage] remove dependency on workspace class name 2022-12-02 05:59:01 -03:00
Sven Efftinge
2eead4a625 [usage] handle reset usage for chargebee
chargebee subscriptions that are cancelled get a dedicatd cost center
2022-11-30 09:08:00 -03:00
Sven Efftinge
7252b10b78 [usage] reduce possibility for races in ResetUsage 2022-11-28 11:02:57 -03:00
Sven Efftinge
e044c1d49f [admin] allow usage adjustments 2022-11-22 06:31:51 -03:00
Laurie T. Malau
ee08e7863c [db] Move db models to gitpod-db/go module 2022-11-21 08:37:50 -03:00
Alex Tugarev
35599d8bbd [stripe] store currency for a stripe customer 2022-11-21 06:56:50 -03:00
Alex Tugarev
3de193e3fb [stripe] guard resubscribing with another currency
because it currently not supported.
2022-11-21 06:56:50 -03:00
Sven Efftinge
89d0b7df3f [admin] add admin endpoints for usage 2022-11-18 12:57:47 +02:00
Jan Keromnes
0c383311f6 [usage] Always set a CostCenter.nextBillingTime, even when we don't manage the billing 2022-11-16 13:29:45 +02:00
Jan Keromnes
b1161a5094 [stripe] When creating a Subscription, don't specify a custom billing cycle anchor date - let it go from date to date instead 2022-11-16 13:29:45 +02:00
Jan Keromnes
e97e8e91b4 [usage] Address nits from https://github.com/gitpod-io/gitpod/pull/14485 2022-11-16 13:29:45 +02:00
Milan Pavlik
e4daab98a4 [common-go] Move base database connection & types to common-go 2022-11-16 10:59:45 +02:00
Milan Pavlik
a7523ba7d2 [usage] Decrease Usage record create batch size 2022-11-11 14:56:41 +02:00
Jan Keromnes
77bb23fc5e [usage] Don't pass '0001-01-01T00:15:00Z' timestamps through the CostCenter API when it should be undefined 🙃 2022-11-11 13:32:41 +02:00
Jan Keromnes
56a4fe2895 [usage] Introduce an explicit CostCenter.BillingCycleStart time 2022-11-11 13:32:41 +02:00
Milan Pavlik
3c553500f0 [usage]Actually reset usage during ResetUsage RPC 2022-11-02 09:16:07 +01:00
Laurie T. Malau
ee8354aa79 [usage] Implement CreateStripeSubscription 2022-11-01 16:15:06 +01:00
Milan Pavlik
4d1f29895c [usage] Start trigerring ResetUsage RPC 2022-10-31 14:13:05 +01:00
Milan Pavlik
2ec4546105 [usage] List cost centers with expired billing time 2022-10-27 16:56:42 +02:00
Milan Pavlik
7532f3c15f [usage] Setup usage reset job 2022-10-26 14:46:41 +02:00
Milan Pavlik
7a5f156f5a [usage] Configure Stripe Price IDs through installer 2022-10-25 21:53:40 +02:00
Milan Pavlik
8735238f00 [stripe] Populate Stripe Customers from searches, use as lookup 2022-10-20 13:50:35 +02:00
Milan Pavlik
0d566be29a [stripe] Store Stripe Customer in the db on creation 2022-10-20 09:37:35 +02:00
Milan Pavlik
7cbd71a27a [usage] Add StripeCustomer db model 2022-10-19 13:48:34 +02:00
Milan Pavlik
224c961883 [billing] Implement CreateStripeCustomer 2022-10-19 10:38:34 +02:00
Milan Pavlik
f626371eaf [usage] Validate spending limits in UpdateCostCenter 2022-10-13 14:00:29 +02:00
Milan Pavlik
849170fedd [usage] Return CostCenter from SetCostCenter udpates - implementation 2022-10-12 11:41:27 +02:00
Milan Pavlik
72a01c02f1 [stripe] Check for err when reporting stripe requests completed metric 2022-10-11 16:45:26 +02:00
Milan Pavlik
c8a7667c0d [usage] Report Stripe metrics without full request path 2022-10-11 13:50:26 +02:00
Milan Pavlik
c428154475 [stripe] Implement BillingService.GetStripeCustomer 2022-10-07 16:55:23 +02:00
Milan Pavlik
93fa97a5be [stripe] Add test for filtering out balances for Stripe Cost Centers 2022-10-05 17:59:21 +02:00
Milan Pavlik
269af7cd96 [stripe] Report metrics from client calls in Go 2022-10-05 14:06:20 +02:00
Milan Pavlik
ec9523701d [stripe] Fix inverted comparison 2022-10-05 13:13:20 +02:00
Andrew Farries
83cb1c7a74 Make function output stable
Ensure that the `queriesForCustomersWithAttributionIDs` is stable by
sorting the the attributionIDs before mapping them to queries.

Iteration of map keys is not stable in Go.
2022-10-04 09:31:20 +02:00
Milan Pavlik
c031a86064 [usage] Handle Stripe customers with zero subscriptions 2022-10-04 09:30:20 +02:00