Skip to content

Commit

Permalink
Merge pull request #279 from slr71/main
Browse files Browse the repository at this point in the history
CORE-1983: service account support for multiyear subscriptions.
  • Loading branch information
slr71 authored Mar 6, 2024
2 parents 0a6e5fb + 24a3875 commit c19bc0a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/terrain/routes/qms.clj
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,10 @@
:middleware [[require-service-account ["cyverse-subscription-updater"]]]
:summary schema/UpdateSubscriptionSummary
:description schema/UpdateSubscriptionDescription
:query [params schema/ServiceAccountAddSubscriptionParams]
:path-params [plan-name :- schema/PlanName]
:return schema/SuccessResponse
(ok (qms/update-subscription username plan-name {:paid true}))))))
(ok (qms/update-subscription username plan-name (merge {:paid true} params)))))))

(context "/addons" []
(GET "/" []
Expand Down
7 changes: 5 additions & 2 deletions src/terrain/routes/schemas/qms.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(ns terrain.routes.schemas.qms
(:require [common-swagger-api.schema :refer [PagingParams describe]]
(:require [common-swagger-api.schema :refer [PagingParams describe ->optional-param]]
[schema.core :as s :refer [defschema Any optional-key maybe enum]])
(:import [java.util UUID]))

Expand Down Expand Up @@ -176,7 +176,10 @@
(defschema AddSubscriptionParams
{:paid (describe Boolean "True if the user paid for the subscription")
(optional-key :periods) (describe s/Int "The number of subscription periods")
(optional-key :end_date) (describe String "The end date of the subscription")})
(optional-key :end-date) (describe String "The end date of the subscription")})

(defschema ServiceAccountAddSubscriptionParams
(->optional-param AddSubscriptionParams :paid))

(defschema ListSubscriptionsParams
(merge PagingParams
Expand Down

0 comments on commit c19bc0a

Please sign in to comment.