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

Add price to service templates. #367

Merged
merged 1 commit into from
May 14, 2019
Merged

Conversation

lfu
Copy link
Member

@lfu lfu commented May 13, 2019

Add columns for price and currency to service templates. So a service author can specify the price when creating a service template.

Part of ManageIQ/manageiq#18754
Related to #373

https://bugzilla.redhat.com/show_bug.cgi?id=1602072

@miq-bot add_label enhancement, hammer/no, changelog/yes

@miq-bot
Copy link
Member

miq-bot commented May 13, 2019

Checked commit lfu@1b13ad2 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. ⭐

Copy link
Member

@carbonin carbonin left a comment

Choose a reason for hiding this comment

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

I have the same concerns here as I did with #350. And in fact you're referencing the same BZ ... @tinaafitz it looks like we resolved a direction to go in the previous PR I'm still pushing for that direction.

@carbonin
Copy link
Member

Also, #350 was adding this to services while this PR is adding it to service_templates. Which is the correct place?

@carbonin
Copy link
Member

Oh I see it's an add_reference now.

Copy link
Member

@carbonin carbonin left a comment

Choose a reason for hiding this comment

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

Ah, excellent. Just took a look at the core PR. Sorry for the noise.

@carbonin
Copy link
Member

I guess the question of which is the correct table is still out there though. @lfu why service_templates when @d-m-u was going to add it to services?

@lpichler
Copy link
Contributor

I guess the question of which is the correct table is still out there though. @lfu why service_templates when @d-m-u was going to add it to services?

Not sure why but usually when anybody mention in BZ "Service" he most likely means Catalog Items or Catalog Bundle. (Service Templates)

there is mentioned path Service -> Catalog in UI, - so I think that Catalog Items or Catalog Bundle. (Service Templates) are correct here. Can you confirm it @lfu ?

@@ -0,0 +1,6 @@
class AddPriceToServiceTemplates < ActiveRecord::Migration[5.0]
def change
add_reference :service_templates, :currency, :type => :bigint
Copy link
Contributor

@lpichler lpichler May 14, 2019

Choose a reason for hiding this comment

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

I think we should have chargeback_rate_detail_currency here - to see that it is related to chargeback_rate_detail_currencies table.

add_reference :service_templates, :chargeback_rate_detail_currency, :type => :bigint

you can specify foreign key in the model.

@carbonin @lfu what do you think ?

Copy link
Member

Choose a reason for hiding this comment

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

I think the idea is to make the method #currency and the column currency_id so the relationship in the model specifies the class https://github.com/ManageIQ/manageiq/pull/18754/files#diff-9257fff45a7d1258305c9a6b7d15e322R66

Copy link
Member

Choose a reason for hiding this comment

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

It's unfortunate that chargeback_rate_detail_currency isn't named just currencies because it doesn't look like the table has anything chargeback specific in it.

Copy link
Member Author

Choose a reason for hiding this comment

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

@carbonin Exactly what I am going to say.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 👍

Copy link
Member

Choose a reason for hiding this comment

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

What is the effort to rename the table :)

@lfu
Copy link
Member Author

lfu commented May 14, 2019

A service author would create a service template (that can be a catalog item or catalog bundle) that users can order to get services. The relationship of service template and service is kind of like template and VM.

@carbonin carbonin self-assigned this May 14, 2019
@carbonin carbonin merged commit 8e9f290 into ManageIQ:master May 14, 2019
@carbonin carbonin added this to the Sprint 112 Ending May 27, 2019 milestone May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants