Skip to content

Commit 10ea629

Browse files
committed
fix(custom-currency): fix review comments
1 parent e5eabd3 commit 10ea629

8 files changed

Lines changed: 621 additions & 664 deletions

File tree

api/spec/packages/aip-client-javascript/src/models/schemas.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2781,12 +2781,6 @@ export const currencyCustom = z
27812781
id: ulid,
27822782
code: currencyCodeCustom,
27832783
created_at: dateTime,
2784-
description: z
2785-
.string()
2786-
.min(1)
2787-
.max(256)
2788-
.optional()
2789-
.describe('Description of the currency.'),
27902784
})
27912785
.describe('Describes custom currency.')
27922786

@@ -2809,12 +2803,6 @@ export const createCurrencyCustomRequest = z
28092803
'The symbol of the currency. It should be a string that represents the symbol of the currency, such as "$" for US Dollar or "€" for Euro.',
28102804
),
28112805
code: currencyCodeCustom,
2812-
description: z
2813-
.string()
2814-
.min(1)
2815-
.max(256)
2816-
.optional()
2817-
.describe('Description of the currency.'),
28182806
})
28192807
.describe('CurrencyCustom create request.')
28202808

api/spec/packages/aip-client-javascript/src/models/types.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,8 +2092,6 @@ export interface CurrencyCustom {
20922092
code: string
20932093
/** An ISO-8601 timestamp representation of the custom currency creation date. */
20942094
created_at: string
2095-
/** Description of the currency. */
2096-
description?: string
20972095
}
20982096

20992097
/** CurrencyCustom create request. */
@@ -2109,8 +2107,6 @@ export interface CreateCurrencyCustomRequest {
21092107
*/
21102108
symbol?: string
21112109
code: string
2112-
/** Description of the currency. */
2113-
description?: string
21142110
}
21152111

21162112
/** Query to evaluate feature access for a list of customers. */

api/spec/packages/aip/src/currencies/currency.tsp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import "@typespec/openapi3";
22
import "../shared/index.tsp";
3-
import "./cost-bases/cost-basis.tsp";
43

54
namespace Currencies;
65

@@ -110,12 +109,4 @@ model CurrencyCustom {
110109
*/
111110
@visibility(Lifecycle.Read)
112111
created_at: Shared.DateTime;
113-
114-
/**
115-
* Description of the currency.
116-
*/
117-
@visibility(Lifecycle.Create, Lifecycle.Read)
118-
@minLength(1)
119-
@maxLength(256)
120-
description?: string;
121112
}

api/v3/api.gen.go

Lines changed: 611 additions & 617 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v3/handlers/currencies/convert.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,12 @@ func ToAPIBillingCurrency(c currencies.Currency) (v3.BillingCurrency, error) {
3333

3434
if c.ID != "" {
3535
err := out.FromBillingCurrencyCustom(v3.BillingCurrencyCustom{
36-
Id: c.ID,
37-
Code: c.Code,
38-
Name: c.Name,
39-
Description: c.Description,
40-
Symbol: c.Symbol,
41-
Type: v3.BillingCurrencyCustomTypeCustom,
42-
CreatedAt: c.CreatedAt,
36+
Id: c.ID,
37+
Code: c.Code,
38+
Name: c.Name,
39+
Symbol: c.Symbol,
40+
Type: v3.BillingCurrencyCustomTypeCustom,
41+
CreatedAt: c.CreatedAt,
4342
})
4443
return out, err
4544
}

api/v3/openapi.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5152,11 +5152,6 @@ components:
51525152
- $ref: '#/components/schemas/DateTime'
51535153
description: An ISO-8601 timestamp representation of the custom currency creation date.
51545154
readOnly: true
5155-
description:
5156-
type: string
5157-
minLength: 1
5158-
maxLength: 256
5159-
description: Description of the currency.
51605155
additionalProperties: false
51615156
description: Describes custom currency.
51625157
BillingCurrencyFiat:
@@ -8780,11 +8775,6 @@ components:
87808775
the currency, such as "$" for US Dollar or "€" for Euro.
87818776
code:
87828777
$ref: '#/components/schemas/BillingCurrencyCodeCustom'
8783-
description:
8784-
type: string
8785-
minLength: 1
8786-
maxLength: 256
8787-
description: Description of the currency.
87888778
additionalProperties: false
87898779
description: CurrencyCustom create request.
87908780
CreateCustomerRequest:

openmeter/currencies/adapter/currencies.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"time"
77

88
"entgo.io/ent/dialect/sql"
9+
"github.com/samber/lo"
910

1011
"github.com/openmeterio/openmeter/openmeter/currencies"
1112
entdb "github.com/openmeterio/openmeter/openmeter/ent/db"
@@ -17,7 +18,6 @@ import (
1718
"github.com/openmeterio/openmeter/pkg/models"
1819
"github.com/openmeterio/openmeter/pkg/pagination"
1920
"github.com/openmeterio/openmeter/pkg/sortx"
20-
"github.com/samber/lo"
2121
)
2222

2323
var _ currencies.Adapter = (*adapter)(nil)

openmeter/currencies/models.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ import (
1616
type Currency struct {
1717
models.ManagedModel
1818
models.NamespacedID
19-
Code string `json:"code"`
20-
Name string `json:"name"`
21-
Description *string `json:"description,omitempty"`
22-
Symbol *string `json:"symbol,omitempty"`
19+
Code string `json:"code"`
20+
Name string `json:"name"`
21+
Symbol *string `json:"symbol,omitempty"`
2322
}
2423

2524
// OrderBy specifies the field to sort currencies by.

0 commit comments

Comments
 (0)