* Replace SubscriberQueries with SubscriberService
* Replace OrganizationBillingQueries with OrganizationBillingService
* Replace ProviderBillingQueries with ProviderBillingService, move to Commercial
* Replace AssignSeatsToClientOrganizationCommand with ProviderBillingService, move to commercial
* Replace ScaleSeatsCommand with ProviderBillingService and move to Commercial
* Replace CancelSubscriptionCommand with SubscriberService
* Replace CreateCustomerCommand with ProviderBillingService and move to Commercial
* Replace StartSubscriptionCommand with ProviderBillingService and moved to Commercial
* Replaced RemovePaymentMethodCommand with SubscriberService
* Formatting
* Used dotnet format this time
* Changing ProviderBillingService to scoped
* Found circular dependency'
* One more time with feeling
* Formatting
* Fix error in remove org from provider
* Missed test fix in conflit
* [AC-1937] Server: Implement endpoint to retrieve provider payment information (#4107)
* Move the gettax and paymentmethod from stripepayment class
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* Add the method to retrieve the tax and payment details
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* Add unit tests for the paymentInformation method
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* Add the endpoint to retrieve paymentinformation
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* Add unit tests to the SubscriberService
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* Remove the getTaxInfoAsync update reference
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
---------
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
---------
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
Co-authored-by: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com>
* Remove FlexibleCollectionsSignUp feature flag
* Always set Organization.FlexibleCollections to true
* Remove explicit assignment of LimitCollectionCreationDeletion so it defaults to false
* fix: align policy checks for excluded types, update tests, create fixture, refs AC-240
* fix: update final policy check against other orgs (not including the current), refs AC-240
* Add unit tests for the StorageSubscriptionUpdateTests.cs
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* remove unwanted comment from the class
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* Create a class file and add unit tests for SmSeatSubscriptionUpdateTest.cs
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* Add unit test for the secrets manager seat update
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* Fix the failing test cases
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* Add unit test for service account update
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
---------
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* Add new models
* Update repositories
* Add new authz handler
* Add new query
* Add new command
* Add authz, command, and query to DI
* Add new endpoint to controller
* Add query unit tests
* Add api unit tests
* Add api integration tests
* Add the ability to get multi projects access
* Add access policy helper + tests
* Add new data/request models
* Add access policy operations to repo
* Add authz handler for new operations
* Add new controller endpoints
* add updating service account revision
* fcmv1 update
* try without nested data obj
* type must be a string
* fcmv1 migration flag
* lint fixes
* fix tests
---------
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
* [PM-3176] Extract IOrganizationService.SaveUserAsync to a command
* [PM-3176] Enabled nullable on command
* [PM-3176] Removed check that was not working
* Add new endpoint for creating client organizations in consolidated billing
* Create empty org and then assign seats for code re-use
* Fixes made from debugging client side
* few more small fixes
* Vincent's feedback
* [PM-6934] Prevent enabling two step login policy if any Org member has no master password and no 2FA set up
* [PM-6934] PR feedback
* [PM-6934] Updated policy check to only check users that will be deleted
* [PM-6934] Removed unnecessary code
* [PM-6934] Fixed unit tests and policy update logic
* [PM-6934] Updated error message
* remove the unwanted test
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* Fix the double email issue
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* Resolve the bug issue
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* change the category name
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* move private down the class
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* move the private method down the class file
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* Add the RegisterUser Test
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* modify the test
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* remove the failing test
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* revert the test
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* add the email method
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* revert changes on the UserServiceTests.cs
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
---------
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* [AC-1637] Added HtmlEncodingStringConverter to encode/decode special chars on JSON serialization/deserialization
* [AC-1637] Added unit tests for HtmlEncodingStringConverter
* [AC-1637] Moved expected values on unit tests to the arrange phase
* [AC-1637] Added HtmlEncodingStringConverter to properties that are for input/output of Org Name and Business name
* [AC-1637] Modified views in Admin project to decode values to display
* [AC-1637] Replaced Html.Raw with HttpUtility.HtmlDecode
* [AC-1637] Added JsonConverter to Provider DTOs
* [AC-1637] Modified HandlebarsMailService to decode organization name before sending emails
* Revert "[AC-1637] Added JsonConverter to Provider DTOs"
This reverts commit 94d507cf93.
* [AC-1637] Fixed Admin panel organization search
* [AC-1637] Sanitizing Organization name and business name on creation in Admin panel
* [AC-1637] Sanitizing organization name and business name on creation by a provider
* [AC-1637] Sanitizing provider name on creation and on viewing in admin panel
* [AC-1637] Added sanitization to more places where Org name is used
* [AC-1637] Swapped using HttpUtility for WebUtility since the later is part of the dotnet framework
* [AC-1637] Updated error messages
* [AC-1637] Decoding on Admin panel add existing organization
* [AC-1637] Fix HTML decoding issues
* [AC-1637] Refactor HTML decoding in View and Model classes on Admin panel
* [AC-1637] Refactor provider name and business name usages to use methods that output decoded values
* [AC-1637] Fixed typo
* [AC-1637] Renamed Provider methods to retrieve Decoded Name and BusinessName
* [AC-1637] Renamed Organization methods to retrieve Decoded Name and BusinessName
* [AC-1637] Update the display name method in the `ProviderOrganizationOrganizationDetails` class to `DisplayName()`
* [AC-2077] Set a minimum number of seats for the tested Organization
* [AC-2077] Added PlanType property to OrganizationCustomization
* [AC-2077] Set up the test secrets manager seats to be null in case the plan does not support it
* Fix assigning Manage access to default collection
The previous implementation did not work when creating an org as a
provider because the ownerId is null in OrganizationService.SignUp.
Added a null check and handled assigning access in ProviderService
instead.
* Tweaks
* [AC-2154] Logging organization data before migrating for flexible collections
* [AC-2154] Refactored logging command to perform the data migration
* [AC-2154] Moved validation inside the command
* [AC-2154] PR feedback
* [AC-2154] Changed logging level to warning
* [AC-2154] Fixed unit test
* [AC-2154] Removed logging unnecessary data
* [AC-2154] Removed primary constructor
* [AC-2154] Added comments
* Added offboarding survey response to cancellation when FF is on.
* Removed service methods to prevent unnecessary upstream registrations
* Forgot to actually remove the injected command in the services
* Rui's feedback
* Add missing summary
* Missed [FromBody]
* clean the return url of any whitespace
* ReplaceWhiteSpace helper
* tests for ReplaceWhiteSpace helper
---------
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
* SM-1012: Phase 2, removing SM Beta from the server (but not db)
* SM-1012: Add migration for RemoveSMBetaFromOrganization
* SM-1012: Dotnet format
* SM-1012: Undo RemoveSMBetaFromOrganization EF migration
* SM-1012: Redo RemoveSMBetaFromOrganization EF migration
* SM-1012: Ran dotnet format
* Upgrade to .NET 8
* Linting
* Clean up old JSON deserialization code
* More .NET 8-oriented linting
* Light feedback
* Get rid of old test we don't know the root issue for
* Fix a new test
* Remove now-unnecessary Renovate constraint
* Use Any()
* Somehow a 6.0 tooling config we don't need snuck back in
* Space out properties that always change per release
* Bump a few core packages since the last update
* Added feature flag constant
* Wrapped Automatic Tax logic behind feature flag
* Only getting customer if feature is anabled.
* Enabled feature flag in unit tests
* Made IPaymentService scoped
* Added missing StripeFacade calls
* Added appliesTo to customer discount. Added productId to subscription item
* Added IsFromSecretsManagerTrial flag to add discount for SM trials
* Fixed broken tests
---------
Co-authored-by: Alex Morask <amorask@bitwarden.com>
* Removed TaxRate logic when creating or updating a Stripe subscription and replaced it with AutomaticTax enabled flag
* Updated Stripe webhook to update subscription to automatically calculate tax
* Removed TaxRate unit tests since Stripe now handles tax
* Removed test proration logic
* Including taxInfo when updating payment method
* Adding the address to the upgrade free org flow if it doesn't exist
* Fixed failing tests and added a new test to validate that the customer is updated
* Update optionality to use org.FlexibleCollections
Also break old feature flag key to ensure it's never enabled
* Add logic to set defaults for collection management setting
* Update optionality logic to use org property
* Add comments
* Add helper method for getting individual orgAbility
* Fix validate user update permissions interface
* Fix tests
* dotnet format
* Fix more tests
* Simplify self-hosted update logic
* Fix mapping
* Use new getOrganizationAbility method
* Refactor invite and save orgUser methods
Pass in whole organization object instead of using OrganizationAbility
* fix CipherService tests
* dotnet format
* Remove manager check to simplify this set of changes
* Misc cleanup before review
* Fix undefined variable
* Refactor bulk-access endpoint to avoid early repo call
* Restore manager check
* Add tests for UpdateOrganizationLicenseCommand
* Add nullable regions
* Delete unused dependency
* dotnet format
* Fix test