Skip to content
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

1592, Customer API: specify service_type attribute for Service API resource #1608

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

Ivanov-Anton
Copy link
Collaborator

@Ivanov-Anton Ivanov-Anton commented Nov 6, 2024

Description

specify the ui_type attribute for Service API resource of Customer API

added filter for Service Customer API resource
filter[ui-type-eq]

example of response from service customer API

{
  "data": {
    "id": "fe81c806-40ad-40e9-ba33-757b43607b60",
    "type": "services",
    "links": {
      "self": "http://example.org/api/rest/customer/v1/services/fe81c806-40ad-40e9-ba33-757b43607b60"
    },
    "attributes": {
      "name": "Service_10",
      "state": "Active",
      "initial-price": "84.56",
      "renew-price": "93.26",
      "created-at": "2024-11-07T20:31:23.300Z",
      "renew-at": null,
      "renew-period": "Disabled",
      "service-type": "Service Type 16",
      "ui-type": "phone_systems"
    },
    "relationships": {
      "account": {
        "links": {
          "self": "http://example.org/api/rest/customer/v1/services/fe81c806-40ad-40e9-ba33-757b43607b60/relationships/account",
          "related": "http://example.org/api/rest/customer/v1/services/fe81c806-40ad-40e9-ba33-757b43607b60/account"
        }
      },
      "transactions": {
        "links": {
          "self": "http://example.org/api/rest/customer/v1/services/fe81c806-40ad-40e9-ba33-757b43607b60/relationships/transactions",
          "related": "http://example.org/api/rest/customer/v1/services/fe81c806-40ad-40e9-ba33-757b43607b60/transactions"
        }
      }
    }
  }
}

Additional links

related to #1592
https://github.com/yeti-switch/yeti-client/pull/178

@Ivanov-Anton Ivanov-Anton self-assigned this Nov 6, 2024
@Ivanov-Anton Ivanov-Anton changed the title 1592, specify service_type attribute for Service API resource 1592, Customer API: specify service_type attribute for Service API resource Nov 6, 2024
@Ivanov-Anton Ivanov-Anton force-pushed the specify-type-for-service-api-resource branch from 26fda9e to b75dae1 Compare November 6, 2024 22:37
@Ivanov-Anton Ivanov-Anton added the Waiting for code review It means that the owner or member of the repositor can do a code review. label Nov 7, 2024
@Ivanov-Anton Ivanov-Anton removed the request for review from dmitry-sinina November 7, 2024 21:47
@Ivanov-Anton Ivanov-Anton force-pushed the specify-type-for-service-api-resource branch from b75dae1 to 4398f17 Compare November 7, 2024 21:49
@Ivanov-Anton Ivanov-Anton removed the Waiting for code review It means that the owner or member of the repositor can do a code review. label Nov 7, 2024
@Ivanov-Anton Ivanov-Anton force-pushed the specify-type-for-service-api-resource branch from 4398f17 to 54a6902 Compare November 7, 2024 21:52
@@ -58,6 +61,7 @@
f.input :name
f.input :force_renew
f.input :provisioning_class, as: :select, collection: Billing::ServiceType.available_provisioning_classes, input_html: { class: :chosen }
f.input :ui_type, hint: 'This string will be used for Customer API of Service Resource'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hint shouldn't be hardcoded, it should be added to config/locales/en.yml

@@ -26,11 +27,16 @@ class Api::Rest::Customer::V1::ServiceResource < Api::Rest::Customer::V1::BaseRe
type: :enum,
column: :renew_period_id,
collection: Billing::Service::RENEW_PERIODS.values
ransack_filter :ui_type, type: :string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need filters there

@Ivanov-Anton Ivanov-Anton force-pushed the specify-type-for-service-api-resource branch from 54a6902 to 4444718 Compare November 9, 2024 20:39
@Ivanov-Anton Ivanov-Anton added the Waiting for code review It means that the owner or member of the repositor can do a code review. label Nov 10, 2024
@Ivanov-Anton Ivanov-Anton force-pushed the specify-type-for-service-api-resource branch from 4444718 to e7ff6c2 Compare November 10, 2024 22:05
@Ivanov-Anton Ivanov-Anton removed the Waiting for code review It means that the owner or member of the repositor can do a code review. label Nov 10, 2024
@dmitry-sinina dmitry-sinina merged commit d8f75c0 into master Nov 11, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants