Skip to content

Commit

Permalink
api: add is_popular field to products (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybrush authored May 21, 2024
1 parent 2d12478 commit e4beb95
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,8 @@ node-jobs-processor:
signatures:
CGO_CFLAGS=${CGO_CFLAGS} CGO_CFLAGS_ALLOW=${CGO_CFLAGS_ALLOW} go build --ldflags=${LDFLAGS} -o bin/signatures cmd/signatures/main.go
frontend-types:
go run cmd/typescript_converter/main.go --out ../frontend/types/api
addhooks:
git config core.hooksPath hooks
1 change: 1 addition & 0 deletions backend/pkg/api/data_access/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ func (d *DataAccessService) GetProductSummary() (*t.ProductSummary, error) {
},
PricePerMonthEur: 49.99,
PricePerYearEur: 49.99 * 12 * 0.9,
IsPopular: true,
},
},
ExtraDashboardValidatorsPremiumAddon: []t.ExtraDashboardValidatorsPremiumAddon{
Expand Down
2 changes: 2 additions & 0 deletions backend/pkg/api/types/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type ApiProduct struct {
ApiPerks ApiPerks `json:"api_perks"`
PricePerYearEur float64 `json:"price_per_year_eur"`
PricePerMonthEur float64 `json:"price_per_month_eur"`
IsPopular bool `json:"is_popular"`
}

type ApiPerks struct {
Expand All @@ -58,6 +59,7 @@ type PremiumProduct struct {
PremiumPerks PremiumPerks `json:"premium_perks"`
PricePerYearEur float64 `json:"price_per_year_eur"`
PricePerMonthEur float64 `json:"price_per_month_eur"`
IsPopular bool `json:"is_popular"`
}

type ExtraDashboardValidatorsPremiumAddon struct {
Expand Down
2 changes: 2 additions & 0 deletions frontend/types/api/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export interface ApiProduct {
api_perks: ApiPerks;
price_per_year_eur: number /* float64 */;
price_per_month_eur: number /* float64 */;
is_popular: boolean;
}
export interface ApiPerks {
units_per_second: number /* uint64 */;
Expand All @@ -54,6 +55,7 @@ export interface PremiumProduct {
premium_perks: PremiumPerks;
price_per_year_eur: number /* float64 */;
price_per_month_eur: number /* float64 */;
is_popular: boolean;
}
export interface ExtraDashboardValidatorsPremiumAddon {
product_id: string;
Expand Down

0 comments on commit e4beb95

Please sign in to comment.