-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AC-85] Set Max Seats Autoscale and Current Seats via Public API #3389
[AC-85] Set Max Seats Autoscale and Current Seats via Public API #3389
Conversation
No New Or Fixed Issues Found |
src/Api/Billing/Public/Models/SecretsManagerSubscriptionUpdateRequestModel.cs
Outdated
Show resolved
Hide resolved
src/Api/Billing/Public/Controllers/OrganizationSubscriptionsController.cs
Outdated
Show resolved
Hide resolved
src/Api/Billing/Public/Models/OrganizationSubscriptionUpdateRequestModel.cs
Outdated
Show resolved
Hide resolved
src/Api/Billing/Public/Models/SecretsManagerSubscriptionUpdateRequestModel.cs
Outdated
Show resolved
Hide resolved
src/Api/Billing/Public/Controllers/OrganizationSubscriptionsController.cs
Outdated
Show resolved
Hide resolved
…d-current-seats-via-public-api' into ac-85/set-max-seats-autoscale-and-current-seats-via-public-api
…d-current-seats-via-public-api' into ac-85/set-max-seats-autoscale-and-current-seats-via-public-api
…d-current-seats-via-public-api' into ac-85/set-max-seats-autoscale-and-current-seats-via-public-api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good, some feedback below.
One outstanding issue is that this doesn't look like it addresses Jordan's comment here:
On the topic of maxAutoScale, I would expect a null value to leave my value unchanged, and a -1 to disable the seat limit entirely, so that I don't have to perform a separate call to look up what my existing max is set to. In a PUT request, I think it makes sense to leave the value unchanged - I'm not PUTing a value to that object so keep what is already there.
I agree with that suggestion, that is,
- if the value is
null
, don't change it - for nullable properties like max autoscale - if the value is
-1
, set it to null. The idea here is to distinguish between an "intentional null" (clearing the value) and an unintentional null (not supplying a value, therefore leaving it unchanged). Or in Javascript terms, null vs. undefined.
(This is only an issue for properties that are nullable in our database. For non-nullable properties, the user can never update it to null
, so we can safely skip it if not provided.)
I'm sure this isn't the only way to deal with this, feel free to see what we're doing elsewhere in our public API at the moment, or what stackoverflow recommends, or what #code
thinks.
src/Api/Billing/Public/Models/OrganizationSubscriptionUpdateRequestModel.cs
Outdated
Show resolved
Hide resolved
src/Api/Billing/Public/Models/OrganizationSubscriptionUpdateRequestModel.cs
Outdated
Show resolved
Hide resolved
src/Api/Billing/Public/Models/OrganizationSubscriptionUpdateRequestModel.cs
Outdated
Show resolved
Hide resolved
src/Api/Billing/Public/Models/OrganizationSubscriptionUpdateRequestModel.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't followed the entire conversation here but would still think a shared controller is possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry that it took me some time to take this over this PR review from @eliykat! Thank you for your work on this so far. I did leave some comments, however. Feel free to reach out if you'd like to discuss them
src/Api/Billing/Public/Models/OrganizationSubscriptionUpdateRequestModel.cs
Show resolved
Hide resolved
src/Api/Billing/Public/Models/OrganizationSubscriptionUpdateRequestModel.cs
Show resolved
Hide resolved
src/Api/Billing/Public/Models/OrganizationSubscriptionUpdateRequestModel.cs
Outdated
Show resolved
Hide resolved
src/Api/Billing/Public/Models/OrganizationSubscriptionUpdateRequestModel.cs
Outdated
Show resolved
Hide resolved
src/Api/Billing/Public/Models/OrganizationSubscriptionUpdateRequestModel.cs
Outdated
Show resolved
Hide resolved
src/Api/Billing/Public/Models/OrganizationSubscriptionUpdateRequestModel.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
I removed my review given that @cturnbull-bitwarden took over for me. Thanks all! |
…seats-via-public-api
…ats-via-public-api
…ats-via-public-api
Type of change
Objective
As an organizational admin user of the public API, I want to be able to update max seat autoscaling, current seats, and storage via the Public API so that I do not have to do this manually and so that I can perform this in bulk automatically on a given date each month to combine invoice/billing changes, which will reduce overhead and load on our accounts payable team in dealing with autoscaling invoices as users provision on-demand.
Code changes
Before you submit
dotnet format --verify-no-changes
) (required)