Skip to content

Commit 646a10c

Browse files
tothandrasborosr
authored andcommitted
chore: remove compile warning and apply fallback for addon active_from
1 parent 9b8d98e commit 646a10c

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

api/spec/packages/aip/src/subscriptions/subscriptionaddon.tsp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace Subscriptions;
66
* SubscriptionAddon represents an association between a subscription and an add-on,
77
* controlling which add-ons are available for purchase within a subscription.
88
*/
9+
#suppress "@openmeter/api-spec-aip/repeated-prefix-grouping" "active_from and active_to are standard AIP temporal fields"
910
@friendlyName("SubscriptionAddon")
1011
model SubscriptionAddon {
1112
...Shared.Resource;

api/v3/handlers/subscriptions/subscriptionaddons/convert.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func ToAPISubscriptionAddon(a subscriptionaddon.SubscriptionAddon) (apiv3.Subscr
4545
Labels: labels.FromMetadata(a.Metadata),
4646
Quantity: inst.Quantity,
4747
QuantityAt: now,
48-
ActiveFrom: *union.From,
48+
ActiveFrom: lo.FromPtrOr(union.From, now),
4949
ActiveTo: union.To,
5050
}, nil
5151
}

0 commit comments

Comments
 (0)