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

Product API #20

Open
lbirkert opened this issue Feb 1, 2023 · 8 comments
Open

Product API #20

lbirkert opened this issue Feb 1, 2023 · 8 comments
Assignees
Milestone

Comments

@lbirkert
Copy link
Member

lbirkert commented Feb 1, 2023

An API that helps fetching product configurations and prices.

Product Object

{
  key: "servers_mc",
  ram: {
// The config key, also used for generating the Cart payload (key=value)
    type: "enum",
    values: {
// name: price
      1:  100,
      2:  200,
      3:  300
  },
  currency: "EUR"
}

We'd add currency headers to all these Requests, including the Cart API. (As we do not want bring our site between a paywall just for the users to see the prices)

GET /product/{key:string}
Product
GET /product
[ Product ]

When configuring these values will be shown to the user as + price and - price values dynamically.

The config payload (in Cart API terms data payload) will look like this:

ram=1&key=value

Note that not the prices are used in the payload as these might change while the website is running.

@lbirkert lbirkert added this to the 1.0.0 milestone Feb 1, 2023
@lbirkert lbirkert self-assigned this Feb 1, 2023
@lbirkert
Copy link
Member Author

lbirkert commented Feb 1, 2023

We should also consider adding VAT fields (Steuern)

@lbirkert
Copy link
Member Author

lbirkert commented Feb 1, 2023

GET /product/{key:string}?ram=1&key=value

->

{
  currency: "EUR",
  total: 1027.3,
  vat: 0.19,
  total_vat: 1027.3 * 1.19
}

@lbirkert
Copy link
Member Author

lbirkert commented Feb 1, 2023

Currently planned is following:

GET /product?currency=EUR
[ Product ]
GET /product/{key:string}?currency=EUR&ram=1&key=value

->

{
  currency: "EUR",
  total: 1027.3,
  vat: 0.19,
  total_vat: 1027.3 * 1.19
}

This however needs further thinking as i don't know if i am happy with the ?currency yet, also needs aproval from @CraftingDragon007

@CraftingDragon007
Copy link
Contributor

For now Im ok with this, maybe we'll change this in the future

@CraftingDragon007
Copy link
Contributor

I think the vat fields should only contain the multiplier/percentage, that is used and not the full calculation

@lbirkert
Copy link
Member Author

lbirkert commented Feb 8, 2023

I think the vat fields should only contain the multiplier/percentage, that is used and not the full calculation

I understand where you are comming from but you need to consider that this is critical information, you know how javascript sometimes tends to be, it would be safer.

@CraftingDragon007
Copy link
Contributor

Then I would create a seperate field for this information instead of packing it into an arbitary string

@lbirkert
Copy link
Member Author

lbirkert commented Feb 8, 2023

Then I would create a seperate field for this information instead of packing it into an arbitary string

What do you mean? total_vat is an extra field

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

No branches or pull requests

2 participants