giseldo/neodataset huggingface dataset:
Refactor Salesforce object creation logic to remove references of Subscribe and Amend API

The following discussion from !6635 should be addressed:

- [ ] @qzhaogitlab started a [discussion](https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/6635#note_1298549447):  (+2 comments)

    > **sorry another question**: this [code](https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/7c69ad620b411f58fe3d1370fba65f6826c15439/app/services/salesforce/create_quote_objects_service.rb#L58-65) might be able to clean up. 
    > 
    > Am I right that, it should not go to this condition `elsif amendments.empty?` any more?  After removed `Zuora::Actions::Subscribe`, the logic here looks still safe, though. 
    > 
    > But, maybe we could keep it here, and we will clean up this code after we removed `Zuora::Actions::Amend` in the future? Is this the plan? 
    > 
    > ```
    >       if order_number.present?
    >         handle_with_zuora_order(quote_result)
    >       # fallback to existing Subscribe/Amend API implementation
    >       elsif amendments.empty?
    >         handle_new_subscription(quote_result)
    >       else
    >         handle_existing_subscription(quote_result)
    >       end
    > 
    > ``

As noted in the thread above, there are a couple of refactoring improvements that can be done in the SalesForce object / opportunity creation workflow:

- [x] Pass `order_number` when creating SalesForce objects in the new subscription workflow. This will result in the [`handle_with_zuora_order` method](https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/7c69ad620b411f58fe3d1370fba65f6826c15439/app/services/salesforce/create_quote_objects_service.rb#L59) to be invoked. As it already invokes the `handle_new_subscription` method if `CreateSubscription` order action is present, the objects should be created as expected. MR: https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/6696
- [x] remove method #handle_existing_subscription and #create_objects_for_existing_subscription in favor of #handle_with_zuora_order in Salesforce::CreateQuoteObjectsService (MR: https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/6721) 

**Parameter changes**:

- [x] `amendments` parameter can be dropped as well as Orders API does not pass `amendments`.  (MR: https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/6721) 
- [ ] ~~`order_number` is currently an optional parameter. We can make it mandatory param similar to `subscription_name`, `invoice_id` by moving it up in the param list. The default value of `nil` could be misleading. This should help in contributing towards https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/4994 to a slight extent :slight_smile:~~ See https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/5862#note_1302778650

Story points: 3.0
Remove references of Subscribe and Amend API from documentation

The following discussion from !6635 should be addressed:

- [x] @qzhaogitlab started a [discussion](https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/6635#note_1298514821):  (+1 comment)

    > **question**: while `Zuora::Actions::Subscribe` is removed, there are still some reference in some documentation. WDYT of create some followup issue for documentation cleanup?  Or, maybe we already have issue for this purpose? 
    > 
    > For example, some documents refer to `Subscribe`, such as 
    > - doc/flows/purchase_flow.md: 
    >    - C->>Z: Request to create Subscription (POST /v1/orders OR POST /v1/action/subscribe)
    >    - Z->>C: Callout to /zuora_callback/order_processed (Orders API) OR /zuora_callback/subscription_update (Subscribe API)
    > - ... ...

Story points: 1.0
Add word wrapping to namespace selector

### Problem

The namespace selector label is wider tat the form itself (screenshot is from Change linked namespace page)

![Screenshot_2023-03-02_at_10.28.41_AM](/uploads/8e6c1e070a8a3cce1addb7553c44230d/Screenshot_2023-03-02_at_10.28.41_AM.png)

### Proposal

Add word wrapping to the namespace selector

### Result

### Next steps (if any)

### How will we measure success?

Story points: 1.0
Upgrade flipper and related gems

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

Update `flipper` and all related gems to support Rails 7.

## Breaking changes

None.

Story points: 2.0
[Code cleanup] Deprecate Subscribe API related services

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

### Problem

Now that we have transitioned to Orders API to create subscription, services used in the Subscribe API can be removed.

### Proposal

<!-- Consult with `@gitlab-com/business-technology/enterprise-apps/zuora-architects` on the ~"Enterprise Applications" team if Zuora business logic is involved. -->

With the migration to Orders API to create subscription, this MR removes a few outdates classes:

* `SubscribeService` used to create subscription using Subscribe API
* job to invoke Subscribe API (`Zuora::Actions::Subscribe`)
* stubbing of Zuora Subscribe API in `StubZuoraCalls`

### Result

### Next steps (if any)

### How will we measure success?

Story points: 1.0
Use Orders API in PostZuoraRefreshTask

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

### Problem

`PostZuoraRefreshTask` currently uses [`SubscribeService`](https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/89d7d77cb32369f6e061cdefd667db637672e2dd/lib/tasks/quality/post_zuora_refresh.rake#L27) to create subscription for E2E pipeline after Zuora Central Box is refreshed.

### Proposal

<!-- Consult with `@gitlab-com/business-technology/enterprise-apps/zuora-architects` on the ~"Enterprise Applications" team if Zuora business logic is involved. -->

Update the task to use Orders API instead.

### Result

### Next steps (if any)

### How will we measure success?

Story points: 1.0
Investigate renewal auto-discount "should_show_promo_message"

### Problem
The field we use to [control promo messaging during a manual renewal, "should_show_promo_message"](https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/main/app/views/subscriptions/renew.html.haml#L11) is not behaving consistently.

For subscription `A-S00198548` in `staging`, the field is `false` when viewing https://customers.staging.gitlab.com/subscriptions/A-S00198548/renew, but checking it in a console returns true.

- This could be because of the memoization we do here https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/main/app/models/subscription.rb#L681
- Since this is used in the context of a manual renewal, we should check if we are changing products, similar to https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/main/app/services/self_service/subscriptions/update_service.rb#L87

Story points: 1.0
Ramp subscription with storage add-on in different intervals syncs all add-ons directly

### Problem

When a ramp subscription has a storage add-on in interval 1 and another one in interval 2, both storage add-ons will be synced directly to GitLab.com.

### Proposal

The storage amount is calculated in [Gitlab::HostedPlans::PurchasedAddOns](https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/67d97edcc5db3acfb89d89045911556380a49e94/app/services/gitlab/hosted_plans/purchased_add_ons/storage_service.rb). To sync the right amount, the storage add-ons need to be checked for the term start date.

### Result

Syncing correct amount of storage add-ons for ramp subscriptions.

### Next steps (if any)

### How will we measure success?

Story points: 2.0
Skip notification check for Online Cloud ramp subscription raises error

### Problem

While testing ramp scenarios for https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/5468+, I encountered an exception `undefined method 'attributes' for nil:NilClass` when renewing a Online Cloud ramp subscription that was previously activated on an instance. This happens because when the `LicenseNotificationService` is called for an Online Cloud subscription the `license` method [returns `nil`](https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/a034215fb51579f24072cdaa45b6975cecf7c4bc/app/services/license_notification_service.rb#L34) which will then fail when checking if the notification should be skipped [here](https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/a034215fb51579f24072cdaa45b6975cecf7c4bc/app/services/license_notification_service.rb#L92). More specifically, it fails when the most recent license is compared to the license which return `nil`.

While an error is raised, the service is still sending out the emails to the customer. But if a reseller email has to be sent it would fail.

### Proposal

Return early in the skip notification check when the subscription is for an Online Cloud subscription.

### Result

Fix the exception and allow reseller emails to be sent.

Story points: 1.0
Work with tracking locally without manually updating code to point to port

### Problem

Currently to debug local tracking we need to manually update [tracking.rb#L93](https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/main/lib/gitlab/tracking.rb#L93) to point it to port `9090`. This is the port for [snowplow-micro](https://gitlab.com/gitlab-org/snowplow-micro-configuration) that we use for local test configuration.

### Proposal

Introduce a condition that would check `Rails.env.development?` and set `SnowplowTracker::AsyncEmitter.new('localhost:9090', protocol: 'http')` if it's a dev environment.

Update existing docs -> remove the manual step from it.

### Result

Better dev workflow for manual tracking testing :star:

Story points: 1.0
Upgrade Rails gem to 7.0

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

Official migration guide from Rails 6.1 to Rails 7 - https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-6-1-to-rails-7-0

This issue covers the gem update and resolving any test failure we might encounter after updating it.

- [x] Update `rails` gem to 7
- [x] Run https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#the-update-task
 
# Things to verify

- [x] tests!
- [x] https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#key-generator-digest-class-changing-to-use-sha256 Possible drop of sessions if we not include cookie rotator. We use Devise and it uses SHA256 already so, in theory, we should not be affected.

Story points: 2.0
Update health_check gem

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

Officially this gem does not support Rails 7 yet but maintainers say it should work - https://github.com/Purple-Devs/health_check/issues/123

# Breaking changes

See the issue above for the note about SMTP settings.

Story points: 2.0
Update ActiveSupport cache format to version 7

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

Once the #5794 is deployed and all Puma workers are booted we can switch the serialization format to version 7. https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#new-activesupport-cache-serialization-format

Story points: 1.0
Pin ActiveSupport cache format to version 6.1

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

Rails 7 introduced new serialization format for ActiveSupport but before enabling it we must ensure all existing Puma workers still use the old format as new format can't be decoded by Rails 7 workers. 

https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#new-activesupport-cache-serialization-format

Story points: 1.0
Remove active_record_data_types

We have a special mapping configured for time zone aware `DateTime`s in `ActiveRecord`. This file was copied from GitLab but not it blocks our upgrade to Rails 7:

1. https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/main/config/initializers/active_record_data_types.rb
2. https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/main/config/initializers/active_record_table_definition.rb

Current mappings between ActiveRecord and PostgreSQL data types:

```ruby
[[:binary, {:name=>"bytea"}],
 [:bit, {:name=>"bit"}],
 [:bit_varying, {:name=>"bit varying"}],
 [:boolean, {:name=>"boolean"}],
 [:box, {:name=>"box"}],
 [:cidr, {:name=>"cidr"}],
 [:circle, {:name=>"circle"}],
 [:citext, {:name=>"citext"}],
 [:date, {:name=>"date"}],
 [:daterange, {:name=>"daterange"}],
 [:datetime, {:name=>"timestamp"}],
 [:datetime_with_timezone, {:name=>"timestamptz"}],
 [:decimal, {:name=>"decimal"}],
 [:float, {:name=>"float"}],
 [:hstore, {:name=>"hstore"}],
 [:inet, {:name=>"inet"}],
 [:int4range, {:name=>"int4range"}],
 [:int8range, {:name=>"int8range"}],
 [:integer, {:name=>"integer", :limit=>4}],
 [:interval, {:name=>"interval"}],
 [:json, {:name=>"json"}],
 [:jsonb, {:name=>"jsonb"}],
 [:line, {:name=>"line"}],
 [:lseg, {:name=>"lseg"}],
 [:ltree, {:name=>"ltree"}],
 [:macaddr, {:name=>"macaddr"}],
 [:money, {:name=>"money"}],
 [:numrange, {:name=>"numrange"}],
 [:oid, {:name=>"oid"}],
 [:path, {:name=>"path"}],
 [:point, {:name=>"point"}],
 [:polygon, {:name=>"polygon"}],
 [:primary_key, "bigserial primary key"],
 [:string, {:name=>"character varying"}],
 [:text, {:name=>"text"}],
 [:time, {:name=>"time"}],
 [:tsrange, {:name=>"tsrange"}],
 [:tstzrange, {:name=>"tstzrange"}],
 [:tsvector, {:name=>"tsvector"}],
 [:uuid, {:name=>"uuid"}],
 [:xml, {:name=>"xml"}]]
```

Story points: 1.0
Update paper_trail gem to 12.3.0

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

`paper_trail` added support for Rails 7 in [12.2.0](https://github.com/paper-trail-gem/paper_trail/blob/master/CHANGELOG.md#1220-2022-01-21). We need to update this gem to version 13 at least.

# Breaking changes

~~Despite version 12 has [some breaking changes](https://github.com/paper-trail-gem/paper_trail/blob/master/CHANGELOG.md#1200-2021-03-29) and [version 13 too](https://github.com/paper-trail-gem/paper_trail/blob/master/CHANGELOG.md#1300-2022-08-15) I don't think we are affected by them.~~

Story points: 2.0
Update spring to version 4

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

`spring` gem doesn't support Rails 7 out of the box so we have to update it to version 3 at least.

# Breaking changes

None.

Story points: 1.0
Update simple_token_authentication gem

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

`simple_token_authentication` gem depends on `actionmailer` and `actionpack` gems:

```
actionmailer (>= 3.2.6, < 7)
actionpack (>= 3.2.6, < 7)
```

These gems will be updated to version 7 so `simple_token_authentication` blocks the Rails 7 upgrade. 
Just upgrade this gem.

# Breaking changes

None.

Story points: 1.0
Remove seat check validation for cloud licenses


### Problem
There is currently a seat check in place for activating a cloud license when true-ups are present: https://gitlab.com/gitlab-org/gitlab/-/blob/9d97c3c6dea8569b4a05ed510811a6dc0a699357/ee/app/models/license.rb#L511

This can result in customers being blocked from accessing their purchased self-managed subscriptions.

### Proposal

Remove the seat check validation for cloud licenses (whether true-ups are present or not).

### Result
A customer can access a self-managed subscription with cloud licensing without any current user check occurring.

Story points: 2.0
Add cancel/resume subscription specific tracking

### Problem

Currently we are tracking clicks on subscription card buttons. This shows a general interest on features but doesn't reflect that user wants to actually do this action.

### Proposal

Update the existing tracking for subscription card buttons and add tracking to the actual pages.

Attention: some tracking is already implemented, we would just need to update the event labels & actions.

#### Cancel subscription

For all the tracking events set `event_label` as `cancel_subscription_sm` / `cancel_subscription_saas`

**Attention:** The modal only exists for SaaS users

| FE/BE | Page | Description | Event category | Event action |
| ------ | ------ | ------ |  ------ | ------ |
|FE| `/subscriptions/` | ![Screenshot_2022-11-15_at_21.55.26](/uploads/b997c4aa43267f33dabffdf69e9b801d/Screenshot_2022-11-15_at_21.55.26.png) <br> User clicks `Cancel subscription` button <br>  | Webstore | `click_card` |
|FE| `subscriptions/` | ![Screenshot_2022-11-15_at_21.56.18](/uploads/92463230fe641805f0c917d65862cf1c/Screenshot_2022-11-15_at_21.56.18.png) <br> In the modal that appears user clicks `Cancel subscription` button <br>  | Webstore | `click_modal` |
|BE| - | Transaction is successful  | SubscriptionsController | `transaction_successful` |
|BE| - | Transaction has failed **Note:** we don't have a try/catch around this action, we might need to add it to catch this failure | SubscriptionsController | `transaction_failed` |

#### Resume subscription

For all the tracking events set `event_label` as `resume_subscription_sm` / `resume_subscription_saas`

**Attention:** There is extra confirmation, the click on the button on the card is the only FE event

| FE/BE | Page | Description | Event category | Event action |
| ------ | ------ | ------ |  ------ | ------ |
|FE| `/subscriptions/` | ![Screenshot_2022-11-15_at_22.02.20](/uploads/cd9d2f1c24951046bdad9015dcbb6827/Screenshot_2022-11-15_at_22.02.20.png) <br> User clicks `Resume subscription` button <br>  | Webstore | `click_card` |
|BE| - | Transaction is successful  | SubscriptionsController | `transaction_successful` |
|BE| - | Transaction has failed  | SubscriptionsController | `transaction_failed` |

### Next steps (if any)

After the issue is done please let `@nraisinghani` know because we need to update the values in the related dashboard.

Story points: 2.0
Slightly broken style for editing ACH payment method

<!---
Please read this!

Before opening a new issue, make sure to search for keywords in the issues
filtered by the "bug" label in relevant trackers:

- https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=bug
- https://gitlab.com/gitlab-org/customers-gitlab-com/issues?label_name%5B%5D=bug

and verify the issue you're about to submit isn't a duplicate.

Do not include confidential information! 
--->

### Summary

Editing an ACH account is broken, I believe it like that for too long.

### Steps to reproduce

1. Login with an account that has ACH payment method
1. Go to payment methods page
1. Edit an ACH payment method account
1. Notice the broken style

### What is the current *bug* behavior?

Slightly broken style

### What is the expected *correct* behavior?

Correct centered style without borders touching other borders.

### Relevant logs and/or screenshots

![Screen_Shot_2019-12-16_at_17.10.56](/uploads/128044f42fbcc5ac70fdfc5c992fce0a/Screen_Shot_2019-12-16_at_17.10.56.png)


<!---
Please add both severity and priority level according to: https://docs.gitlab.com/ee/development/contributing/issue_workflow.html#severity-labels
--->

Story points: 3.0
Wrong text color for .alert-info

### Summary

Wrong text color for `.alert-info`, it's showing white text instead of `#0c5460`. I believe it's related to scss imports orders.


### Steps to reproduce

1. Login to the customers portal with an account that doesn't have any invoice.
2. Go to the invoices page.
3. Notice the alert that says "You do not currently have any invoices."

### What is the current *bug* behavior?

White text on a light background, barely readable.

### What is the expected *correct* behavior?

Dark text (`#0c5460`) on a light background.

### Relevant logs and/or screenshots

![Screen_Shot_2019-12-17_at_13.04.59](/uploads/cf75312848608352b1f44e819ddaa43f/Screen_Shot_2019-12-17_at_13.04.59.png)

Story points: 3.0