-
Notifications
You must be signed in to change notification settings - Fork 152
refactor: change package names #3065
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
Conversation
📝 WalkthroughWalkthroughThis change replaces all usages of the Changes
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
🔭 Outside diff range comments (3)
openmeter/ent/db/planratecard_create.go (1)
142-154: Add explicit ISO-8601 validation forbilling_cadence.These setters blindly accept any
datetime.ISODurationString(an alias ofstring).
A malformed duration will silently pass through and reach persistence, where downstream services may choke or mis-bill.Consider invoking the canonical parser (e.g.
datetime.ParseISODuration) inside the setter and returning an error early.
Example diff forSetBillingCadence(similar apply to upsert helpers):func (_c *PlanRateCardCreate) SetBillingCadence(v datetime.ISODurationString) *PlanRateCardCreate { - _c.mutation.SetBillingCadence(v) + if _, err := datetime.ParseISODuration(string(v)); err != nil { + _c.err = fmt.Errorf("invalid billing cadence: %w", err) + return _c + } + _c.mutation.SetBillingCadence(v) return _c }Fail-fast validation keeps bad data out of the DB and surfaces problems at call-site.
Also applies to: 674-689, 972-991, 1454-1473
openmeter/billing/worker/subscription/sync_test.go (1)
4356-4372: Nil-dereference possible inAsPatchrc = &productcatalog.UsageBasedRateCard{ RateCardMeta: meta, BillingCadence: *i.BillingCadence, }
*i.BillingCadencewill panic whenBillingCadence == nil(several tests omit it).
Guard the dereference:- BillingCadence: *i.BillingCadence, + BillingCadence: lo.FromPtrOr(*i.BillingCadence, datetime.ISODuration{}),or early-return an error so the test fails cleanly instead of panicking.
openmeter/ent/db/setorclear.go (1)
5-14: Action Required: Remove residualisodatereferences from the Python clientWe ran a global grep for
isodate\.and, while the Go import swap is clean, there are still lingeringisodate.*calls in the generated Python serialization code. These must be replaced (e.g., with built-indatetimeor your newdatetimeutilities) and the client regenerated.Locations to fix in
api/client/python/src/openmeter/_serialization.py:
- Line 1087:
isodate.parse_date(attr)- Line 1099:
isodate.parse_time(attr)- Line 1113:
isodate.parse_duration(attr)- Line 1114:
isodate.duration_isoformat(attr)- Line 1150:
isodate.parse_datetime(attr)- Line 1383:
("duration": (isodate.Duration, datetime.timedelta))- Line 1884:
isodate.parse_duration(attr)- Line 1904:
isodate.parse_date(attr, defaultmonth=0, defaultday=0)- Line 1918:
isodate.parse_time(attr)- Line 1970:
isodate.parse_datetime(attr)Please update these calls, remove the
isodateimport, and regenerate the Python client to complete the migration.
♻️ Duplicate comments (2)
openmeter/ent/db/billingworkflowconfig_create.go (1)
548-552: Same observation as the previous comment – duplicated across the upsert
builders.Also applies to: 573-576, 585-588, 767-770, 794-797, 808-812, 1170-1173, 1197-1200, 1211-1214
openmeter/ent/db/subscriptionitem_create.go (1)
811-846: The remarks about nil-handling and validation apply equally to the upsert
builders – implementation is mechanically correct.Also applies to: 829-833, 931-934, 1200-1203, 1221-1223, 1340-1343, 1786-1789, 1808-1810, 1926-1929
🧹 Nitpick comments (21)
openmeter/productcatalog/testutils/plan.go (1)
29-30: Consider caching the parsed period instead of re-parsing each time
datetime.MustParse(t, "P1M")executes a full ISO-8601 parse on every invocation ofNewTestPlan. Parsing is cheap here, but this helper is called dozens of times across the test-suite, so the cumulative cost is measurable and unnecessary.-var MonthCadence = "P1M" // package-level constant - -... - BillingCadence: datetime.MustParse(t, "P1M"), +var monthCadence = datetime.MustParse(nil, "P1M") // parse once at init; nil ok outside tests + +... + BillingCadence: monthCadence,Caching also removes the dependency on a
*testing.Twhere it is not otherwise needed.openmeter/productcatalog/plan/adapter/adapter_test.go (1)
22-23: Nit: export guard for global test data
MonthPeriodis exported (Muppercase) but only used inside this test file. Unexporting keeps the symbol out of other packages’ autocomplete lists.-var MonthPeriod = datetime.NewPeriod(0, 1, 0, 0, 0, 0, 0) +var monthPeriod = datetime.NewPeriod(0, 1, 0, 0, 0, 0, 0)Adjust subsequent references (
&monthPeriod,monthPeriod) accordingly.openmeter/productcatalog/planaddon/adapter/adapter_test.go (1)
25-26: Same visibility nit as in plan adapter testRename
MonthPeriod→monthPeriodto avoid exporting internal test helpers.openmeter/productcatalog/addon/service/service_test.go (1)
24-24: 30-day literal may not equal a calendar-month – confirm allowed values
datetime.FromDuration(30 * 24 * time.Hour)serialises toP30Dwhereas the validator only whitelistsP1M.
IfErrPlanBillingCadenceAllowedValueskeeps the old literals (P1M,P2M, …) any plan/add-on created in this test will now failValidatePlanBillingCadenceLiteral.-var MonthPeriod = datetime.FromDuration(30 * 24 * time.Hour) +// One calendar month – stays compatible with validator & ISO literals. +var MonthPeriod = datetime.NewPeriod(0, 1, 0, 0, 0, 0, 0)Please double-check the allowed values list or update it accordingly.
openmeter/productcatalog/plan/service/service_test.go (1)
28-30: Parse constants once inside each sub-test or declare package-level vars
datetime.MustParse(t, "P1M")is executed during test-initialisation (beforet.Run).
If it panics the failure is reported against the parent test, not the specific sub-case, making debugging harder.
Consider:MonthPeriod := datetime.MustParse(nil, "P1M") // at package scope TwoMonthPeriod := datetime.MustParse(nil, "P2M") SixMonthPeriod := datetime.MustParse(nil, "P6M")or parse inside each sub-test where the
*testing.Tcontext is local.openmeter/productcatalog/entitlement_test.go (1)
30-134: Duplicate literal parsing – consider a shared helper
datetime.MustParse(t, "P1M")is repeated six times. A small helper or a file-scopevar month = datetime.MustParse(nil, "P1M")would DRY the tests and avoid accidental value drift.openmeter/subscription/addon/diff/restore_test.go (1)
347-353: Nit: avoid parsing literal strings repeatedly
datetime.MustParse(t, "P1M")is executed every time the test runs.
If you only need a constant 1-month duration, cache it at file scope to avoid redundant parsing and keep the test body cleaner:+var isoMonth = datetime.MustParse(nil /* test not needed */, "P1M") ... - BillingCadence: datetime.MustParse(t, "P1M"), + BillingCadence: isoMonth,(This is purely a readability micro-optimisation.)
openmeter/productcatalog/planaddon/service/service_test.go (1)
20-26: Document thatMonthPeriodis shared and MUST remain immutable
MonthPeriodis a package-level variable passed by pointer to some rate-cards and by value to others.
Any accidental mutation would leak across test cases running in parallel. Add a brief comment or make the variable unexported to signal it is read-only.-var MonthPeriod = datetime.NewPeriod(0, 1, 0, 0, 0, 0, 0) +// monthPeriod is a constant-like value; NEVER mutate it. +var monthPeriod = datetime.NewPeriod(0, 1, 0, 0, 0, 0, 0)Then replace usages accordingly.
openmeter/billing/workflow.go (1)
38-49: Error text contradicts validation logic
Interval.IsPositive()fails for zero, yet the message says “greater or equal to 0”.- return fmt.Errorf("item collection period must be greater or equal to 0") + return fmt.Errorf("item collection period must be greater than 0")Keeping the message aligned avoids confusion when users debug configuration errors.
openmeter/productcatalog/plan/serializer_test.go (1)
20-21: Optional: drop the localdurationpointer jugglingUsing
&durationlater creates pointer identity mismatches on re-marshal but you work around it by not asserting pointer equality.
Consider defining two separate variables for value vs pointer to make intent explicit:oneMonth := datetime.NewPeriod(0, 1, 0, 0, 0, 0, 0) // value oneMonthPtr := &oneMonth // pointerThis avoids taking the address of a variable that is itself reused as a value elsewhere.
openmeter/productcatalog/plan/ratecard_test.go (1)
66-67: Consider helper to avoid repetitivedatetime.MustParsecalls.The same literals are parsed dozens of times per test run, adding noise and minor overhead. Create a small helper or const map.
var ( oneMonth = datetime.MustParse(t, "P1M") zeroMonth = datetime.MustParse(t, "P0M") )and reuse.
Also applies to: 105-105, 128-129, 199-200, 247-248, 310-310, 325-326, 365-365, 380-381
openmeter/productcatalog/subscription/service/service.go (1)
50-51: No-duration sentinel is clearer with a constant.
time.Duration(0)is fine but a named const (e.g.,zeroDuration) improves readability and avoids the conversion.- phase.Duration = lo.ToPtr(datetime.FromDuration(time.Duration(0))) + const zeroDuration time.Duration = 0 + phase.Duration = lo.ToPtr(datetime.FromDuration(zeroDuration))openmeter/subscription/patch/stretchphase_test.go (1)
58-60: Swap expected/actual inrequire.Equalfor clarity
require.Equal(t, expected, actual)reads better and keeps failure msgs intuitive. Consider:-require.Equal(t, p2.StartAfter, datetime.NewPeriod(0, 1, 0, 0, 0, 0, 0)) +require.Equal(t, datetime.NewPeriod(0, 1, 0, 0, 0, 0, 0), p2.StartAfter)Same for the second occurrence below.
Also applies to: 100-102
openmeter/billing/httpdriver/invoice.go (1)
752-773: Nit: avoid shadowing “period” identifierThe local variable
periodshadows the importedperiodpackage used insidepkg/datetime; this may confuse future readers.- period, err := datetime.ISODurationString(*updatedWorkflow.Workflow.Invoicing.DraftPeriod).Parse() + dur, err := datetime.ISODurationString(*updatedWorkflow.Workflow.Invoicing.DraftPeriod).Parse() ... - existing.Config.Invoicing.DraftPeriod = period + existing.Config.Invoicing.DraftPeriod = durReplicate for the
DueAfterblock.openmeter/subscription/patch/removeitem.go (1)
72-75: Minor: rename localdiffto avoid repetition
diffis used elsewhere in this file; renaming improves readability:- diff := datetime.Between(phaseStartTime, actx.CurrentTime) + relDur := datetime.Between(phaseStartTime, actx.CurrentTime) ... - phase.ItemsByKey[r.ItemKey][len(phase.ItemsByKey[r.ItemKey])-1].ActiveToOverrideRelativeToPhaseStart = &diff + phase.ItemsByKey[r.ItemKey][len(phase.ItemsByKey[r.ItemKey])-1].ActiveToOverrideRelativeToPhaseStart = &relDuropenmeter/subscription/addon/diff/apply.go (1)
205-210: Use distinct variable names for calculated durationsTo keep code self-descriptive and avoid clashes with earlier
diffslices, preferoffset(or similar) overdiff:- diff := datetime.Between(phaseCadence.ActiveFrom, *target.From) + offset := datetime.Between(phaseCadence.ActiveFrom, *target.From) ... - item.ActiveFromOverrideRelativeToPhaseStart = &diff + item.ActiveFromOverrideRelativeToPhaseStart = &offsetRepeat for the
target.Toblock.Also applies to: 213-218
openmeter/ent/db/planphase.go (1)
184-186: Micro-allocation nitpick_m.Duration = new(datetime.ISODurationString) *_m.Duration = datetime.ISODurationString(value.String)Avoiding the second heap allocation is trivial:
- _m.Duration = new(datetime.ISODurationString) - *_m.Duration = datetime.ISODurationString(value.String) + d := datetime.ISODurationString(value.String) + _m.Duration = &dNot critical, but it keeps the hot path a bit tighter.
openmeter/ent/schema/entitlement.go (1)
56-57: Missing validation for ISO-8601 interval stringNow that
usage_period_intervalis a naked string alias, Ent won’t auto-validate its format.
Consider adding a.Validate()call or wrappingdatetime.ISODurationStringwith a customValueScannerto reject invalid values at the DB boundary.openmeter/billing/worker/subscription/sync_test.go (1)
4389-4406: Discarded error fromAddTohides parsing problems
cadence.AddTo(start)returns(time.Time, error)but the error is ignored:start, _ = cadence.AddTo(start)If
cadenceis invalid (e.g., unsupported ISO parts after the refactor) the loop will proceed with wrong timestamps and no signal. Capture the error and fail the test loudly:- start, _ = cadence.AddTo(start) - end, _ = cadence.AddTo(end) + if start, err = cadence.AddTo(start); err != nil { + s.T().Fatalf("invalid cadence: %v", err) + } + if end, err = cadence.AddTo(end); err != nil { + s.T().Fatalf("invalid cadence: %v", err) + }openmeter/ent/db/subscriptionitem_create.go (1)
152-178: Pointer semantics preserved, but beware nil-safety
SetActiveFromOverrideRelativeToPhaseStartnow takes a value, while the
field on the entity remains a*ISODurationString.
This is fine, yet note that theNillable…helper dereferences the pointer,
so a caller doing:var d *datetime.ISODurationString // nil item.SetNillableActiveFromOverrideRelativeToPhaseStart(d)results in no mutation – identical to old behaviour.
If the expectation is to clear the field whennilis passed, an explicit
Clear…setter is needed (similar to theClear*methods generated for
other fields).openmeter/ent/db/subscriptionitem/where.go (1)
119-123: Type change relies ontype ISODurationString stringbeing an aliasAll newly-typed parameters are immediately cast to
string.
This is fine as long as:type ISODurationString string(or an identical alias) still exists in
pkg/datetime.
If the new type ever evolves into a struct to add validation helpers, these casts will silently drop that information. Worth keeping in mind when designing the new package.Also applies to: 126-130, 146-150
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (107)
app/config/config_test.go(2 hunks)app/config/entitlements.go(2 hunks)openmeter/billing/customeroverride.go(3 hunks)openmeter/billing/defaults.go(2 hunks)openmeter/billing/httpdriver/invoice.go(3 hunks)openmeter/billing/httpdriver/profile.go(2 hunks)openmeter/billing/profile.go(2 hunks)openmeter/billing/worker/subscription/phaseiterator_test.go(21 hunks)openmeter/billing/worker/subscription/sync_test.go(63 hunks)openmeter/billing/workflow.go(2 hunks)openmeter/credit/adapter/grant.go(1 hunks)openmeter/credit/connector.go(2 hunks)openmeter/ent/db/addonratecard.go(3 hunks)openmeter/ent/db/addonratecard/where.go(6 hunks)openmeter/ent/db/addonratecard_create.go(5 hunks)openmeter/ent/db/addonratecard_update.go(3 hunks)openmeter/ent/db/billingcustomeroverride.go(4 hunks)openmeter/ent/db/billingcustomeroverride/where.go(14 hunks)openmeter/ent/db/billingcustomeroverride_create.go(12 hunks)openmeter/ent/db/billingcustomeroverride_update.go(7 hunks)openmeter/ent/db/billingworkflowconfig.go(4 hunks)openmeter/ent/db/billingworkflowconfig/where.go(11 hunks)openmeter/ent/db/billingworkflowconfig_create.go(12 hunks)openmeter/ent/db/billingworkflowconfig_update.go(5 hunks)openmeter/ent/db/entitlement.go(3 hunks)openmeter/ent/db/entitlement/where.go(6 hunks)openmeter/ent/db/entitlement_create.go(2 hunks)openmeter/ent/db/grant.go(3 hunks)openmeter/ent/db/grant/where.go(6 hunks)openmeter/ent/db/grant_create.go(2 hunks)openmeter/ent/db/mutation.go(56 hunks)openmeter/ent/db/plan.go(3 hunks)openmeter/ent/db/plan/where.go(5 hunks)openmeter/ent/db/plan_create.go(5 hunks)openmeter/ent/db/plan_update.go(3 hunks)openmeter/ent/db/planphase.go(3 hunks)openmeter/ent/db/planphase/where.go(6 hunks)openmeter/ent/db/planphase_create.go(5 hunks)openmeter/ent/db/planphase_update.go(3 hunks)openmeter/ent/db/planratecard.go(3 hunks)openmeter/ent/db/planratecard/where.go(6 hunks)openmeter/ent/db/planratecard_create.go(5 hunks)openmeter/ent/db/planratecard_update.go(3 hunks)openmeter/ent/db/setorclear.go(8 hunks)openmeter/ent/db/subscription.go(3 hunks)openmeter/ent/db/subscription/where.go(5 hunks)openmeter/ent/db/subscription_create.go(5 hunks)openmeter/ent/db/subscription_update.go(3 hunks)openmeter/ent/db/subscriptionitem.go(5 hunks)openmeter/ent/db/subscriptionitem/where.go(14 hunks)openmeter/ent/db/subscriptionitem_create.go(12 hunks)openmeter/ent/db/subscriptionitem_update.go(7 hunks)openmeter/ent/schema/billing.go(4 hunks)openmeter/ent/schema/entitlement.go(2 hunks)openmeter/ent/schema/grant.go(2 hunks)openmeter/ent/schema/productcatalog.go(3 hunks)openmeter/ent/schema/ratecard.go(2 hunks)openmeter/ent/schema/subscription.go(4 hunks)openmeter/entitlement/adapter/entitlement.go(2 hunks)openmeter/entitlement/driver/parser.go(3 hunks)openmeter/entitlement/entitlement.go(2 hunks)openmeter/entitlement/metered/lateevents_test.go(2 hunks)openmeter/entitlement/metered/utils_test.go(2 hunks)openmeter/entitlement/service/utils_test.go(2 hunks)openmeter/entitlement/usageperiod.go(3 hunks)openmeter/entitlement/usageperiod_test.go(5 hunks)openmeter/productcatalog/addon/adapter/adapter_test.go(1 hunks)openmeter/productcatalog/addon/ratecard_test.go(10 hunks)openmeter/productcatalog/addon/service/service_test.go(1 hunks)openmeter/productcatalog/alignment.go(1 hunks)openmeter/productcatalog/entitlement.go(3 hunks)openmeter/productcatalog/entitlement_test.go(7 hunks)openmeter/productcatalog/errors.go(3 hunks)openmeter/productcatalog/http/mapping.go(5 hunks)openmeter/productcatalog/phase.go(3 hunks)openmeter/productcatalog/plan.go(2 hunks)openmeter/productcatalog/plan/adapter/adapter_test.go(1 hunks)openmeter/productcatalog/plan/httpdriver/mapping.go(4 hunks)openmeter/productcatalog/plan/ratecard_test.go(10 hunks)openmeter/productcatalog/plan/serializer.go(3 hunks)openmeter/productcatalog/plan/serializer_test.go(2 hunks)openmeter/productcatalog/plan/service.go(2 hunks)openmeter/productcatalog/plan/service/service_test.go(1 hunks)openmeter/productcatalog/plan_test.go(13 hunks)openmeter/productcatalog/planaddon/adapter/adapter_test.go(1 hunks)openmeter/productcatalog/planaddon/service/service_test.go(1 hunks)openmeter/productcatalog/planaddon_test.go(4 hunks)openmeter/productcatalog/ratecard.go(11 hunks)openmeter/productcatalog/ratecard_test.go(36 hunks)openmeter/productcatalog/subscription/http/mapping.go(4 hunks)openmeter/productcatalog/subscription/plan.go(3 hunks)openmeter/productcatalog/subscription/service/service.go(2 hunks)openmeter/productcatalog/testutils/plan.go(2 hunks)openmeter/subscription/addon/diff/apply.go(2 hunks)openmeter/subscription/addon/diff/apply_test.go(3 hunks)openmeter/subscription/addon/diff/restore.go(2 hunks)openmeter/subscription/addon/diff/restore_test.go(2 hunks)openmeter/subscription/addon/extend_test.go(2 hunks)openmeter/subscription/item.go(3 hunks)openmeter/subscription/patch/additem.go(2 hunks)openmeter/subscription/patch/addphase.go(2 hunks)openmeter/subscription/patch/removeitem.go(2 hunks)openmeter/subscription/patch/removephase.go(2 hunks)openmeter/subscription/patch/stretchphase.go(3 hunks)openmeter/subscription/patch/stretchphase_test.go(3 hunks)openmeter/subscription/repository.go(4 hunks)openmeter/subscription/serialize_test.go(3 hunks)
⛔ Files not processed due to max files limit (35)
- openmeter/subscription/subscription.go
- openmeter/subscription/subscriptionspec.go
- openmeter/subscription/subscriptionview.go
- openmeter/subscription/testutils/compare.go
- openmeter/subscription/testutils/customer.go
- openmeter/subscription/testutils/global.go
- openmeter/subscription/testutils/plan.go
- openmeter/subscription/testutils/ratecard.go
- openmeter/subscription/testutils/service.go
- openmeter/subscription/workflow/service/addon_test.go
- openmeter/subscription/workflow/service/subscription_test.go
- openmeter/testutils/time.go
- pkg/datetime/date.go
- pkg/datetime/date_test.go
- pkg/timeutil/recurrence.go
- test/app/custominvoicing/invocing_test.go
- test/app/stripe/appstripe.go
- test/app/stripe/testenv.go
- test/app/testenv.go
- test/billing/collection_test.go
- test/billing/customeroverride_test.go
- test/billing/invoice_test.go
- test/billing/profile.go
- test/billing/profile_test.go
- test/billing/subscription_suite.go
- test/billing/subscription_test.go
- test/billing/suite.go
- test/customer/customer.go
- test/customer/testenv.go
- test/entitlement/regression/framework_test.go
- test/subscription/framework_test.go
- test/subscription/scenario_editaligned_test.go
- test/subscription/scenario_editcancel_test.go
- test/subscription/scenario_entinnextphase_test.go
- test/subscription/scenario_firstofmonth_test.go
🧰 Additional context used
🧠 Learnings (108)
📓 Common learnings
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
app/config/config_test.go (2)
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/productcatalog/testutils/plan.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/productcatalog/addon/service/service_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/entitlement/metered/utils_test.go (2)
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/productcatalog/subscription/service/service.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/billing/defaults.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/productcatalog/addon/adapter/adapter_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/entitlement/service/utils_test.go (2)
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/subscription/addon/diff/restore.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/credit/adapter/grant.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/billing/workflow.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/entitlement/adapter/entitlement.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/productcatalog/entitlement_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/subscription/patch/removephase.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/billing/httpdriver/invoice.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/entitlement/metered/lateevents_test.go (2)
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/productcatalog/plan/service/service_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/productcatalog/plan/httpdriver/mapping.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/subscription/addon/diff/apply_test.go (3)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2626
File: openmeter/subscription/addon/service/change_test.go:23-92
Timestamp: 2025-04-08T11:02:14.464Z
Learning: The ChangeQuantity method in the subscription addon service allows setting ActiveFrom to a time in the past. No validation is needed to check if ActiveFrom is in the past.
openmeter/productcatalog/plan/serializer_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/subscription/patch/stretchphase_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/subscription/patch/additem.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/schema/ratecard.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/subscription/patch/removeitem.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/productcatalog/planaddon/service/service_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/productcatalog/planaddon/adapter/adapter_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/productcatalog/planaddon_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/productcatalog/plan.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/db/planphase.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/credit/connector.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/productcatalog/plan_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/db/planratecard.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/productcatalog/alignment.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/subscription/addon/extend_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/subscription/addon/diff/apply.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/subscription/addon/diff/restore_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/db/entitlement.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/productcatalog/plan/serializer.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/productcatalog/subscription/plan.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/subscription/patch/addphase.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/productcatalog/subscription/http/mapping.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/productcatalog/plan/ratecard_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/productcatalog/addon/ratecard_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/entitlement/usageperiod_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/entitlement/usageperiod.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/schema/entitlement.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/subscription/patch/stretchphase.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/billing/profile.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/entitlement/entitlement.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/productcatalog/plan/service.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/db/entitlement_create.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/db/grant.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/addonratecard.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/plan.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/schema/productcatalog.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/entitlement/driver/parser.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/productcatalog/errors.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/productcatalog/ratecard_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/db/grant_create.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/schema/grant.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/subscription/serialize_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/db/billingworkflowconfig.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/billing/httpdriver/profile.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/subscription/repository.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/productcatalog/entitlement.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/db/billingcustomeroverride.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/subscription_create.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/subscriptionitem.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/productcatalog/http/mapping.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/productcatalog/plan/adapter/adapter_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/subscription/item.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/schema/subscription.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/schema/billing.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/db/subscription.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/billing/customeroverride.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/productcatalog/ratecard.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/db/planphase_update.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/planratecard_update.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/productcatalog/phase.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/billing/worker/subscription/phaseiterator_test.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/db/subscription_update.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
app/config/entitlements.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/addonratecard_create.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/plan_create.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/addonratecard_update.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/planphase_create.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/billing/worker/subscription/sync_test.go (2)
undefined
<retrieved_learning>
Learnt from: chrisgacsal
PR: #2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In productcatalog.UsageBasedRateCard, the BillingCadence field is a non-pointer isodate.Period, while in productcatalog.FlatFeeRateCard, BillingCadence is a pointer type (*isodate.Period). This means MonthPeriod should be used directly for UsageBasedRateCard (not &MonthPeriod).
</retrieved_learning>
<retrieved_learning>
Learnt from: GAlexIHU
PR: #2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like openmeter/entitlement/metered/lateevents_test.go may use variables like meterSlug and namespace without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
</retrieved_learning>
openmeter/ent/db/plan/where.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/db/planratecard_create.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/plan_update.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/subscription/where.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/db/billingcustomeroverride_update.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/billingworkflowconfig_update.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/entitlement/where.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/db/planratecard/where.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/db/grant/where.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/planphase/where.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/billingcustomeroverride_create.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/subscriptionitem_update.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2626
File: openmeter/subscription/addon/service/change_test.go:23-92
Timestamp: 2025-04-08T11:02:14.464Z
Learning: The ChangeQuantity method in the subscription addon service allows setting ActiveFrom to a time in the past. No validation is needed to check if ActiveFrom is in the past.
openmeter/ent/db/addonratecard/where.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/subscriptionitem_create.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2626
File: openmeter/subscription/addon/service/change_test.go:23-92
Timestamp: 2025-04-08T11:02:14.464Z
Learning: The ChangeQuantity method in the subscription addon service allows setting ActiveFrom to a time in the past. No validation is needed to check if ActiveFrom is in the past.
openmeter/ent/db/billingworkflowconfig_create.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/setorclear.go (2)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
Learnt from: GAlexIHU
PR: openmeterio/openmeter#2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like `openmeter/entitlement/metered/lateevents_test.go` may use variables like `meterSlug` and `namespace` without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
openmeter/ent/db/billingcustomeroverride/where.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/billingworkflowconfig/where.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
openmeter/ent/db/mutation.go (3)
undefined
<retrieved_learning>
Learnt from: chrisgacsal
PR: #2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In productcatalog.UsageBasedRateCard, the BillingCadence field is a non-pointer isodate.Period, while in productcatalog.FlatFeeRateCard, BillingCadence is a pointer type (*isodate.Period). This means MonthPeriod should be used directly for UsageBasedRateCard (not &MonthPeriod).
</retrieved_learning>
<retrieved_learning>
Learnt from: GAlexIHU
PR: #2383
File: openmeter/entitlement/metered/lateevents_test.go:37-45
Timestamp: 2025-03-07T12:17:43.129Z
Learning: In the OpenMeter codebase, test files like openmeter/entitlement/metered/lateevents_test.go may use variables like meterSlug and namespace without explicit declarations visible in the same file. This appears to be an accepted pattern in their test structure.
</retrieved_learning>
<retrieved_learning>
Learnt from: GAlexIHU
PR: #2626
File: openmeter/subscription/addon/service/change_test.go:23-92
Timestamp: 2025-04-08T11:02:14.464Z
Learning: The ChangeQuantity method in the subscription addon service allows setting ActiveFrom to a time in the past. No validation is needed to check if ActiveFrom is in the past.
</retrieved_learning>
openmeter/ent/db/subscriptionitem/where.go (1)
Learnt from: chrisgacsal
PR: openmeterio/openmeter#2699
File: openmeter/productcatalog/planaddon/service/service_test.go:210-211
Timestamp: 2025-04-21T08:32:31.689Z
Learning: In `productcatalog.UsageBasedRateCard`, the `BillingCadence` field is a non-pointer `isodate.Period`, while in `productcatalog.FlatFeeRateCard`, `BillingCadence` is a pointer type (`*isodate.Period`). This means `MonthPeriod` should be used directly for `UsageBasedRateCard` (not `&MonthPeriod`).
🧬 Code Graph Analysis (83)
app/config/config_test.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/productcatalog/testutils/plan.go (1)
pkg/datetime/date.go (1)
MustParse(206-213)
openmeter/productcatalog/addon/service/service_test.go (1)
pkg/datetime/date.go (1)
FromDuration(175-177)
openmeter/entitlement/metered/utils_test.go (1)
pkg/datetime/date.go (1)
MustParse(206-213)
openmeter/productcatalog/subscription/service/service.go (1)
pkg/datetime/date.go (1)
FromDuration(175-177)
openmeter/billing/defaults.go (2)
pkg/datetime/date.go (1)
ISODurationString(16-16)openmeter/billing/profile.go (1)
InvoicingConfig(37-43)
openmeter/productcatalog/addon/adapter/adapter_test.go (1)
pkg/datetime/date.go (1)
FromDuration(175-177)
openmeter/subscription/addon/diff/restore.go (2)
openmeter/ent/db/subscriptionitem/where.go (2)
ActiveFromOverrideRelativeToPhaseStart(120-123)ActiveToOverrideRelativeToPhaseStart(126-129)pkg/datetime/date.go (1)
Between(169-172)
openmeter/credit/adapter/grant.go (2)
pkg/timeutil/recurrence.go (1)
RecurrenceInterval(171-173)pkg/datetime/date.go (1)
ISODuration(48-50)
openmeter/entitlement/adapter/entitlement.go (2)
pkg/timeutil/recurrence.go (1)
RecurrenceInterval(171-173)pkg/datetime/date.go (1)
ISODuration(48-50)
openmeter/productcatalog/entitlement_test.go (2)
openmeter/entitlement/usageperiod.go (1)
UsagePeriod(56-58)pkg/datetime/date.go (1)
MustParse(206-213)
openmeter/subscription/patch/removephase.go (1)
pkg/datetime/date.go (1)
ISODuration(48-50)
openmeter/billing/httpdriver/invoice.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/entitlement/metered/lateevents_test.go (1)
pkg/datetime/date.go (1)
MustParse(206-213)
openmeter/productcatalog/plan/service/service_test.go (5)
openmeter/productcatalog/addon/adapter/adapter_test.go (1)
MonthPeriod(25-25)openmeter/productcatalog/plan/adapter/adapter_test.go (1)
MonthPeriod(22-22)openmeter/productcatalog/planaddon/adapter/adapter_test.go (1)
MonthPeriod(25-25)openmeter/productcatalog/planaddon/service/service_test.go (1)
MonthPeriod(25-25)pkg/datetime/date.go (1)
MustParse(206-213)
openmeter/subscription/patch/stretchphase_test.go (1)
pkg/datetime/date.go (1)
NewPeriod(23-27)
openmeter/subscription/patch/additem.go (1)
pkg/datetime/date.go (1)
Between(169-172)
openmeter/ent/schema/ratecard.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/subscription/patch/removeitem.go (1)
pkg/datetime/date.go (1)
Between(169-172)
openmeter/productcatalog/planaddon/service/service_test.go (1)
pkg/datetime/date.go (1)
NewPeriod(23-27)
openmeter/productcatalog/planaddon/adapter/adapter_test.go (1)
pkg/datetime/date.go (1)
NewPeriod(23-27)
openmeter/productcatalog/planaddon_test.go (3)
pkg/datetime/date.go (1)
MustParse(206-213)openmeter/ent/db/plan/where.go (1)
BillingCadence(115-118)openmeter/ent/db/subscription/where.go (1)
BillingCadence(132-135)
openmeter/productcatalog/plan.go (5)
openmeter/ent/db/plan/where.go (1)
BillingCadence(115-118)openmeter/ent/db/planratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/subscription/where.go (1)
BillingCadence(132-135)openmeter/ent/db/subscriptionitem/where.go (1)
BillingCadence(147-150)pkg/datetime/date.go (1)
ISODuration(48-50)
openmeter/ent/db/planphase.go (2)
openmeter/ent/db/planphase/where.go (1)
Duration(115-118)pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/credit/connector.go (1)
pkg/datetime/date.go (1)
ISODuration(48-50)
openmeter/productcatalog/plan_test.go (4)
openmeter/ent/db/plan/where.go (1)
BillingCadence(115-118)openmeter/ent/db/planratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/subscription/where.go (1)
BillingCadence(132-135)pkg/datetime/date.go (1)
MustParse(206-213)
openmeter/ent/db/planratecard.go (6)
openmeter/ent/db/addonratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/plan/where.go (1)
BillingCadence(115-118)openmeter/ent/db/planratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/subscription/where.go (1)
BillingCadence(132-135)openmeter/ent/db/subscriptionitem/where.go (1)
BillingCadence(147-150)pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/productcatalog/alignment.go (1)
pkg/datetime/date.go (1)
ISODuration(48-50)
openmeter/subscription/addon/extend_test.go (1)
pkg/datetime/date.go (1)
ISODuration(48-50)
openmeter/subscription/addon/diff/apply.go (2)
pkg/datetime/date.go (1)
Between(169-172)openmeter/ent/db/subscriptionitem/where.go (2)
ActiveFrom(90-92)ActiveFromOverrideRelativeToPhaseStart(120-123)
openmeter/subscription/addon/diff/restore_test.go (3)
openmeter/ent/db/plan/where.go (1)
BillingCadence(115-118)openmeter/ent/db/subscription/where.go (1)
BillingCadence(132-135)pkg/datetime/date.go (1)
MustParse(206-213)
openmeter/ent/db/entitlement.go (1)
openmeter/ent/db/entitlement/where.go (1)
UsagePeriodInterval(140-143)
openmeter/productcatalog/subscription/plan.go (1)
pkg/datetime/date.go (1)
ISODuration(48-50)
openmeter/subscription/patch/addphase.go (1)
pkg/datetime/date.go (1)
ISODuration(48-50)
openmeter/productcatalog/subscription/http/mapping.go (5)
pkg/datetime/date.go (2)
ISODuration(48-50)ISODurationString(16-16)openmeter/productcatalog/subscription/plan.go (1)
Phase(100-104)openmeter/ent/db/planphase/where.go (1)
Duration(115-118)openmeter/productcatalog/plan.go (1)
PlanMeta(181-207)openmeter/ent/db/plan/where.go (1)
BillingCadence(115-118)
openmeter/productcatalog/plan/ratecard_test.go (5)
openmeter/ent/db/plan/where.go (1)
BillingCadence(115-118)openmeter/ent/db/planratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/subscription/where.go (1)
BillingCadence(132-135)openmeter/ent/db/subscriptionitem/where.go (1)
BillingCadence(147-150)pkg/datetime/date.go (1)
MustParse(206-213)
openmeter/entitlement/usageperiod_test.go (2)
pkg/timeutil/recurrence.go (1)
RecurrenceInterval(171-173)pkg/datetime/date.go (2)
ISODuration(48-50)NewPeriod(23-27)
openmeter/entitlement/usageperiod.go (1)
pkg/datetime/date.go (2)
NewPeriod(23-27)ISODuration(48-50)
openmeter/ent/schema/entitlement.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/subscription/patch/stretchphase.go (2)
pkg/datetime/date.go (1)
ISODuration(48-50)openmeter/subscription/patch.go (1)
ValuePatch(60-64)
openmeter/billing/profile.go (1)
pkg/datetime/date.go (1)
ISODuration(48-50)
openmeter/entitlement/entitlement.go (1)
pkg/datetime/date.go (2)
ISODuration(48-50)NewPeriod(23-27)
openmeter/productcatalog/plan/service.go (4)
openmeter/ent/db/plan/where.go (1)
BillingCadence(115-118)openmeter/ent/db/planratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/subscription/where.go (1)
BillingCadence(132-135)pkg/datetime/date.go (1)
ISODuration(48-50)
openmeter/ent/db/entitlement_create.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/grant.go (2)
openmeter/ent/db/grant/where.go (1)
RecurrencePeriod(130-133)pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/addonratecard.go (5)
openmeter/ent/db/addonratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/planratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/subscription/where.go (1)
BillingCadence(132-135)openmeter/ent/db/subscriptionitem/where.go (1)
BillingCadence(147-150)pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/plan.go (4)
openmeter/ent/db/plan/where.go (1)
BillingCadence(115-118)openmeter/ent/db/planratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/subscription/where.go (1)
BillingCadence(132-135)pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/schema/productcatalog.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/entitlement/driver/parser.go (3)
pkg/datetime/date.go (2)
ISODurationString(16-16)ISODuration(48-50)pkg/timeutil/recurrence.go (5)
RecurrenceInterval(171-173)RecurrencePeriodDaily(176-176)RecurrencePeriodWeek(177-177)RecurrencePeriodMonth(178-178)RecurrencePeriodYear(179-179)api/api.gen.go (3)
RecurringPeriodIntervalEnumDAY(706-706)RecurringPeriodIntervalEnumWEEK(708-708)RecurringPeriodIntervalEnumMONTH(707-707)
openmeter/productcatalog/errors.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/grant_create.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/schema/grant.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/subscription/serialize_test.go (2)
openmeter/ent/db/subscriptionitem/where.go (2)
ActiveFromOverrideRelativeToPhaseStart(120-123)ActiveToOverrideRelativeToPhaseStart(126-129)pkg/datetime/date.go (1)
NewPeriod(23-27)
openmeter/billing/httpdriver/profile.go (1)
pkg/datetime/date.go (2)
ISODuration(48-50)ISODurationString(16-16)
openmeter/subscription/repository.go (5)
openmeter/ent/db/plan/where.go (1)
BillingCadence(115-118)openmeter/ent/db/planratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/subscription/where.go (1)
BillingCadence(132-135)openmeter/ent/db/subscriptionitem/where.go (3)
BillingCadence(147-150)ActiveFromOverrideRelativeToPhaseStart(120-123)ActiveToOverrideRelativeToPhaseStart(126-129)pkg/datetime/date.go (1)
ISODuration(48-50)
openmeter/productcatalog/entitlement.go (1)
pkg/datetime/date.go (2)
ISODuration(48-50)NewPeriod(23-27)
openmeter/ent/db/billingcustomeroverride.go (4)
openmeter/ent/db/billingcustomeroverride/where.go (4)
LineCollectionPeriod(101-104)InvoiceAutoAdvance(107-109)InvoiceDraftPeriod(112-115)InvoiceDueAfter(118-121)openmeter/ent/db/billingworkflowconfig/where.go (4)
LineCollectionPeriod(91-94)InvoiceAutoAdvance(97-99)InvoiceDraftPeriod(102-105)InvoiceDueAfter(108-111)pkg/datetime/date.go (1)
ISODurationString(16-16)openmeter/ent/db/billingcustomeroverride/billingcustomeroverride.go (1)
FieldInvoiceDueAfter(40-40)
openmeter/ent/db/subscriptionitem.go (6)
openmeter/ent/db/subscriptionitem/where.go (3)
ActiveFromOverrideRelativeToPhaseStart(120-123)ActiveToOverrideRelativeToPhaseStart(126-129)BillingCadence(147-150)pkg/datetime/date.go (1)
ISODurationString(16-16)openmeter/ent/db/addonratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/planratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/subscription/where.go (1)
BillingCadence(132-135)openmeter/ent/db/subscriptionitem/subscriptionitem.go (1)
FieldActiveToOverrideRelativeToPhaseStart(46-46)
openmeter/productcatalog/plan/adapter/adapter_test.go (1)
pkg/datetime/date.go (1)
NewPeriod(23-27)
openmeter/subscription/item.go (2)
openmeter/ent/db/subscriptionitem/where.go (2)
ActiveFromOverrideRelativeToPhaseStart(120-123)ActiveToOverrideRelativeToPhaseStart(126-129)pkg/datetime/date.go (1)
ISODuration(48-50)
openmeter/ent/schema/subscription.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/schema/billing.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/subscription.go (6)
openmeter/ent/db/addonratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/plan/where.go (1)
BillingCadence(115-118)openmeter/ent/db/planratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/subscription/where.go (1)
BillingCadence(132-135)openmeter/ent/db/subscriptionitem/where.go (1)
BillingCadence(147-150)pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/billing/customeroverride.go (2)
openmeter/billing/profile.go (1)
AlignmentKind(20-20)pkg/datetime/date.go (1)
ISODuration(48-50)
openmeter/productcatalog/ratecard.go (6)
pkg/datetime/date.go (3)
ISODuration(48-50)NewPeriod(23-27)ISODurationString(16-16)openmeter/ent/db/addonratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/plan/where.go (1)
BillingCadence(115-118)openmeter/ent/db/planratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/subscription/where.go (1)
BillingCadence(132-135)openmeter/ent/db/subscriptionitem/where.go (1)
BillingCadence(147-150)
openmeter/ent/db/planphase_update.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/planratecard_update.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
app/config/entitlements.go (1)
pkg/datetime/date.go (3)
ISODurationString(16-16)ISODuration(48-50)NewPeriod(23-27)
openmeter/ent/db/addonratecard_create.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/plan_create.go (2)
api/api.gen.go (1)
PlanCreate(5400-5430)pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/addonratecard_update.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/planphase_create.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/planratecard_create.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/plan_update.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/billingcustomeroverride_update.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/billingworkflowconfig_update.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/entitlement/where.go (4)
pkg/datetime/date.go (1)
ISODurationString(16-16)openmeter/ent/db/entitlement.go (2)
Entitlement(19-71)Entitlement(138-161)openmeter/ent/schema/entitlement.go (5)
Entitlement(20-22)Entitlement(24-31)Entitlement(33-69)Entitlement(71-82)Entitlement(84-111)openmeter/ent/db/predicate/predicate.go (1)
Entitlement(159-159)
openmeter/ent/db/grant/where.go (4)
pkg/datetime/date.go (1)
ISODurationString(16-16)openmeter/ent/db/grant.go (2)
Grant(20-60)Grant(83-102)openmeter/ent/schema/grant.go (5)
Grant(15-17)Grant(19-26)Grant(28-52)Grant(54-59)Grant(61-70)openmeter/ent/db/grant/grant.go (1)
FieldRecurrencePeriod(46-46)
openmeter/ent/db/billingcustomeroverride_create.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/subscriptionitem_update.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/subscriptionitem_create.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/billingworkflowconfig_create.go (1)
pkg/datetime/date.go (1)
ISODurationString(16-16)
openmeter/ent/db/mutation.go (14)
pkg/datetime/date.go (1)
ISODurationString(16-16)openmeter/ent/db/addonratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/plan/where.go (1)
BillingCadence(115-118)openmeter/ent/db/planratecard/where.go (1)
BillingCadence(111-114)openmeter/ent/db/subscription/where.go (1)
BillingCadence(132-135)openmeter/ent/db/subscriptionitem/where.go (3)
BillingCadence(147-150)ActiveFromOverrideRelativeToPhaseStart(120-123)ActiveToOverrideRelativeToPhaseStart(126-129)openmeter/ent/db/billingcustomeroverride/where.go (3)
LineCollectionPeriod(101-104)InvoiceDraftPeriod(112-115)InvoiceDueAfter(118-121)openmeter/ent/db/billingworkflowconfig/where.go (3)
LineCollectionPeriod(91-94)InvoiceDraftPeriod(102-105)InvoiceDueAfter(108-111)openmeter/ent/db/billingworkflowconfig/billingworkflowconfig.go (1)
FieldInvoiceDueAfter(36-36)openmeter/ent/db/billingcustomeroverride/billingcustomeroverride.go (1)
FieldInvoiceDueAfter(40-40)openmeter/ent/db/entitlement/where.go (1)
UsagePeriodInterval(140-143)openmeter/ent/db/grant/where.go (1)
RecurrencePeriod(130-133)openmeter/ent/db/planphase/where.go (1)
Duration(115-118)openmeter/ent/db/subscriptionitem/subscriptionitem.go (1)
FieldActiveToOverrideRelativeToPhaseStart(46-46)
⏰ Context from checks skipped due to timeout of 90000ms (11)
- GitHub Check: Artifacts / Container image
- GitHub Check: CI
- GitHub Check: Commit hooks
- GitHub Check: E2E
- GitHub Check: Quickstart
- GitHub Check: Migration Checks
- GitHub Check: Lint
- GitHub Check: Developer environment
- GitHub Check: Test
- GitHub Check: Build
- GitHub Check: Analyze (go)
🔇 Additional comments (198)
openmeter/entitlement/metered/lateevents_test.go (1)
170-172: Double-check field type after the migration
SnapshotGracePeriodis now set to adatetime.ISODurationvalue. Ensure theCreditConnectorConfigstruct was updated accordingly (it previously accepted anisodate.Periodor a pointer). A stray pointer/value mismatch will compile, but will cause JSON (un)marshalling drift later.openmeter/productcatalog/addon/service/service_test.go (1)
19-19:datetimeimport is correctThe import switch to
pkg/datetimeis expected and aligns with the global refactor. No further action needed.openmeter/productcatalog/plan/service/service_test.go (1)
23-23:datetimeimport change looks good
No issues with the package switch.openmeter/entitlement/metered/utils_test.go (2)
30-30: Import migration acknowledgedSwitching to
pkg/datetimekeeps the tests consistent with the refactor.
142-142: Type match sanity-check
SnapshotGracePeriodnow receivesdatetime.ISODuration; ensure the struct field was updated to that type (it used to beisodate.Period).
No code change required if the field already compiles, but worth a quick confirm.openmeter/productcatalog/entitlement_test.go (1)
11-11: Import swap LGTMopenmeter/productcatalog/plan.go (1)
12-12: Import change acknowledgedopenmeter/subscription/addon/diff/restore_test.go (1)
23-24: No remaining pkg/isodate imports detected
I’ve searched the entire codebase for"github.com/openmeterio/openmeter/pkg/isodate"and found no references. The switch topkg/datetimeis complete—no further changes are needed.app/config/config_test.go (1)
140-143: LGTM – config test updated correctlyThe switch to
datetime.ISODurationStringkeeps the test in sync with the new type.openmeter/subscription/patch/additem.go (1)
7-7: Import switch is safe.
isodate→datetimeis a mechanical rename; no functional impact here.openmeter/subscription/addon/diff/restore.go (2)
11-11: Import rename looks good.No behaviour change; compile-time only.
128-137: No nil‐dereference risk here;ActiveFromis a value, not a pointerThe suggested guard around
pCad.ActiveFromisn’t needed:
pCad.ActiveFromis atime.Time, nevernil, so callingBetween(pCad.ActiveFrom, …)cannot panic.- The code already checks
combinedPer.From != nilandcombinedPer.To != nilbefore dereferencing.Please ignore the nil‐anchor concern.
Likely an incorrect or invalid review comment.
openmeter/productcatalog/plan/ratecard_test.go (1)
14-15: Test suite correctly migrated todatetime; no functional change.openmeter/entitlement/adapter/entitlement.go (1)
468-469: Field name matches the embedded type—compile-time OK.The composite literal uses
ISODuration:which matches the embedded field produced by type embedding. Looks correct; no action required.Also applies to: 485-486
openmeter/subscription/patch/stretchphase_test.go (1)
12-13: Package switch looks correctImport path migrated cleanly to
pkg/datetime; compile-time impact limited to this file.openmeter/productcatalog/planaddon_test.go (1)
13-14: Consistent migration todatetime– looks goodAll duration helpers now reference
pkg/datetime; no behavioural change introduced.Also applies to: 19-22, 47-48, 212-213, 405-406
openmeter/subscription/patch/removeitem.go (1)
7-8: Import path update OKDependency swap compiles cleanly.
openmeter/subscription/addon/diff/apply.go (1)
9-10: Import replacement verifiedSwapping
isodatefordatetimealigns with repository-wide refactor.openmeter/subscription/patch/removephase.go (2)
7-7: LGTM: Consistent package migration.The import change from
isodatetodatetimealigns with the PR's objective to refactor package names.
65-65: LGTM: Type migration maintains compatibility.The change from
isodate.Periodtodatetime.ISODurationis correct. Sincedatetime.ISODurationembedsperiod.Period, all existing method calls like.IsZero()and.Subtract()will continue to work as expected.openmeter/entitlement/service/utils_test.go (2)
24-24: LGTM: Import updated consistently.The import change from
isodatetodatetimeis part of the systematic package migration.
134-134: LGTM: Function call updated correctly.The change from
isodate.String("P1D")todatetime.ISODurationString("P1D")maintains the same ISO 8601 duration format while using the new package's type.openmeter/productcatalog/addon/ratecard_test.go (2)
14-14: LGTM: Import migration executed consistently.The import change from
isodatetodatetimefollows the systematic package refactor pattern.
66-66: LGTM: Duration parsing calls updated correctly.All
isodate.MustParsecalls have been consistently updated todatetime.MustParse. The ISO duration strings ("P1M", "P0M") remain unchanged, ensuring test behavior is preserved while using the new package.Also applies to: 104-104, 128-128, 199-199, 247-247, 309-309, 325-325, 364-364, 380-380
openmeter/credit/adapter/grant.go (1)
238-238: RecurrenceInterval usage is fully migrated—no remainingPeriodreferencesAll instances of
timeutil.RecurrenceIntervalacross the codebase now use the newISODurationfield, and there are no lingeringPeriod:initializations. The change ingrant.gois consistent with the coordinated struct update.openmeter/productcatalog/plan/service.go (2)
13-13: LGTM: Package import updated systematically.The import change from
isodatetodatetimeis consistent with the broader package refactor.
156-156: LGTM: Field type migration maintains interface compatibility.The change from
*isodate.Periodto*datetime.ISODurationcorrectly updates theBillingCadencefield type. Sincedatetime.ISODurationembedsperiod.Period, existing method calls like.String()in theEqualmethod (line 192) will continue to work.openmeter/ent/schema/ratecard.go (1)
10-10: LGTM: Clean package migration in schema definition.The import and type changes consistently migrate from
isodate.Stringtodatetime.ISODurationStringfor the billing_cadence field. The underlying database field remains a string, ensuring no schema migration is required.Also applies to: 46-46
openmeter/entitlement/usageperiod_test.go (2)
13-13: LGTM: Consistent package import migration.The import change from
isodatetodatetimealigns with the broader package migration.
23-23: LGTM: Correct adaptation to new RecurrenceInterval structure.The changes properly adapt to the new
timeutil.RecurrenceIntervalstructure that now embedsdatetime.ISODurationinstead ofisodate.Period. The use ofdatetime.NewPeriodand theISODurationfield access is consistent with the new type definition.Also applies to: 40-40, 51-51, 70-70
openmeter/productcatalog/plan_test.go (2)
13-13: LGTM: Package import updated consistently.The import change from
isodatetodatetimeis consistent with the broader migration.
33-33: LGTM: MustParse calls correctly migrated.All
isodate.MustParse(t, "P1M")calls have been consistently updated todatetime.MustParse(t, "P1M"). The function signature and behavior remain identical, ensuring test functionality is preserved.Also applies to: 50-50, 67-67, 84-84, 101-101, 118-118, 135-135, 152-152, 169-169, 196-196, 248-248, 301-301
openmeter/productcatalog/plan/httpdriver/mapping.go (2)
13-13: LGTM: Import updated for package migration.The import change from
isodatetodatetimeis consistent with the migration.
113-113: LGTM: Duration parsing calls correctly migrated.The parsing calls have been consistently updated:
isodate.String→datetime.ISODurationString- Method signatures for
.Parse()and.ParsePtrOrNil()remain identical- Error handling and assignment logic preserved
The migration maintains the same functionality while using the new duration types.
Also applies to: 170-170, 196-196
openmeter/productcatalog/plan/serializer.go (2)
8-8: LGTM: Package import migration.The import change from
isodatetodatetimeis consistent with the broader migration.
192-196: LGTM: Billing cadence parsing correctly migrated with proper pointer semantics.The duration parsing has been properly updated:
isodate.String→datetime.ISODurationStringwith identical.Parse()method- Correctly preserves pointer vs non-pointer semantics:
FlatFeeRateCard.BillingCadence = &period(pointer type)UsageBasedRateCard.BillingCadence = period(non-pointer type)This aligns with the retrieved learning about the different field types between rate card variants.
Also applies to: 203-207
openmeter/subscription/addon/diff/apply_test.go (2)
21-21: LGTM: Import statement correctly updated.The import has been properly updated from
isodatetodatetimepackage.
660-660: LGTM: Method calls consistently updated.The
isodate.Betweencalls have been correctly updated todatetime.Betweenmaintaining the same functionality for setting phase start overrides.Also applies to: 674-674
openmeter/billing/profile.go (2)
13-13: LGTM: Import statement correctly updated.The import has been properly updated from
isodatetodatetimepackage.
39-40: LGTM: Field types consistently updated.The
DraftPeriodandDueAfterfields have been correctly updated fromisodate.Periodtodatetime.ISODuration, maintaining the same functionality for invoice configuration settings.openmeter/subscription/serialize_test.go (2)
15-15: LGTM: Import statement correctly updated.The import has been properly updated from
isodatetodatetimepackage.
82-83: LGTM: Method calls consistently updated.The
isodate.NewPeriodcalls have been correctly updated todatetime.NewPeriodin the test cases for subscription item serialization, maintaining the same period creation functionality.Also applies to: 108-108
openmeter/billing/defaults.go (2)
8-8: LGTM: Import statement correctly updated.The import has been properly updated from
isodatetodatetimepackage.
18-18: LGTM: Duration string parsing consistently updated.The
isodate.String(...).Parse()calls have been correctly updated todatetime.ISODurationString(...).Parse()for parsing default workflow configuration durations, maintaining the same parsing functionality.Also applies to: 22-23
openmeter/subscription/addon/extend_test.go (2)
18-18: LGTM: Import statement correctly updated.The import has been properly updated from
isodatetodatetimepackage.
908-910: LGTM: Method signature consistently updated.The return type of
GetBillingCadence()has been correctly updated from*isodate.Periodto*datetime.ISODurationin the test helper, maintaining interface compatibility while using the new package types.openmeter/credit/connector.go (1)
38-52: Confirmdatetime.ISODurationstill exposesNegate()andAddTo()
getSnapshotBeforerelies onSnapshotGracePeriod.Negate().AddTo(at).
If either of those methods is not implemented (or their signatures changed) in the newdatetime.ISODurationwrapper, this will be a compilation failure that CI will only catch late.t, _ := c.SnapshotGracePeriod.Negate().AddTo(at)Please double-check the
pkg/datetimeimplementation (or rungo vet ./...) to ensure the fluent API is still intact.
If it was dropped, you can achieve the same with:t, _ := datetime.AddDuration(at, -c.SnapshotGracePeriod) // hypotheticalopenmeter/productcatalog/ratecard_test.go (1)
12-15: Good migration ‑ value vs pointer semantics kept intactFlat-fee tests now pass
*ISODuration(lo.ToPtr(datetime.MustParse(...))) while usage-based tests pass the value (datetime.MustParse(...)).
This aligns with the production structs (*PeriodvsPeriod). Nicely done.Also applies to: 52-55, 98-101, 218-222
openmeter/productcatalog/subscription/plan.go (3)
12-12: LGTM: Import updated correctlyThe import has been properly updated from
isodatetodatetimepackage.
82-82: LGTM: Type initialization updated correctlyThe initialization of
startAfternow usesdatetime.ISODuration{}which is the correct replacement for the previousisodate.Periodtype.
102-102: LGTM: Field type updated correctlyThe
StartAfterfield type has been properly changed fromisodate.Periodtodatetime.ISODuration.openmeter/productcatalog/phase.go (3)
8-8: LGTM: Import updated correctlyThe import has been properly updated to use the
datetimepackage.
31-31: LGTM: Field type updated correctlyThe
Durationfield type has been properly changed from*isodate.Periodto*datetime.ISODuration.
77-77: LGTM: Method call updated correctlyThe method call has been properly updated from
isodate.NewPeriodtodatetime.NewPeriodwith the same parameters.openmeter/ent/db/subscription.go (3)
18-18: LGTM: Import updated correctlyThe import has been properly updated to use the
datetimepackage.
53-53: LGTM: Field type updated correctlyThe
BillingCadencefield type has been properly changed fromisodate.Stringtodatetime.ISODurationString.
261-261: LGTM: Assignment logic updated correctlyThe assignment correctly converts the string value to
datetime.ISODurationStringtype, maintaining the same functionality as the previous implementation.openmeter/ent/db/grant.go (3)
16-16: LGTM: Import updated correctlyThe import has been properly updated to use the
datetimepackage.
53-53: LGTM: Field type updated correctlyThe
RecurrencePeriodfield type has been properly changed from*isodate.Stringto*datetime.ISODurationString.
212-213: LGTM: Assignment logic updated correctlyThe assignment logic correctly allocates a new pointer and converts the string value to
datetime.ISODurationStringtype, maintaining proper pointer handling.openmeter/ent/db/planratecard.go (3)
17-17: LGTM: Import updated correctlyThe import has been properly updated to use the
datetimepackage.
50-50: LGTM: Field type updated correctlyThe
BillingCadencefield type has been properly changed from*isodate.Stringto*datetime.ISODurationString.
219-220: LGTM: Assignment logic updated correctlyThe assignment logic correctly allocates a new pointer and converts the string value to
datetime.ISODurationStringtype, maintaining proper pointer handling consistent with other entity files.openmeter/ent/db/addonratecard.go (1)
17-17: LGTM: Consistent package migration in generated code.The migration from
isodatetodatetimepackage is correctly implemented. The type change from*isodate.Stringto*datetime.ISODurationStringmaintains the same semantics and theassignValuesmethod is appropriately updated.Also applies to: 50-50, 219-220
openmeter/ent/db/entitlement.go (1)
15-15: LGTM: Consistent type migration for UsagePeriodInterval field.The migration from
isodate.Stringtodatetime.ISODurationStringis correctly implemented for theUsagePeriodIntervalfield, maintaining pointer semantics and updating the value assignment logic appropriately.Also applies to: 58-58, 295-296
openmeter/subscription/patch/addphase.go (1)
7-7: LGTM: Type migration preserves existing logic.The change from
isodate.Periodtodatetime.ISODurationfor thediffvariable is correct and maintains the existing phase adjustment logic. The new type provides the same interface for duration calculations.Also applies to: 75-75
openmeter/entitlement/usageperiod.go (1)
11-11: LGTM: Function call and property access updated for new package.The migration correctly updates:
- Function call from
isodate.NewPeriodtodatetime.NewPeriod- Property access from
rec.Interval.Period.Subtracttorec.Interval.ISODuration.SubtractThe validation logic ensuring recurrence intervals are at least 1 hour remains unchanged and correct.
Also applies to: 106-106, 116-116
openmeter/ent/schema/productcatalog.go (2)
12-12: LGTM: Schema type migration drives consistent codebase changes.The schema-level migration from
isodate.Stringtodatetime.ISODurationStringfor thebilling_cadenceanddurationfields is correctly implemented. This change drives the corresponding updates in the generated entity code and ensures type consistency across the codebase.Also applies to: 35-35, 101-101
35-35: Compatibility Verified fordatetime.ISODurationStringMigration–
pkg/datetime/date.godefines
type ISODurationString period.ISOString
preserving the original string-based serialization.
– No remaining imports ofgithub.com/openmeterio/openmeter/pkg/isodate.
– No references toisodate.Stringorisodate.Periodfound across the codebase.All existing data formats and client‐facing APIs remain unchanged.
openmeter/ent/schema/grant.go (2)
11-11: Import successfully updated for package refactoring.The import change from
isodatetodatetimealigns with the codebase-wide refactoring.
49-49: Field type correctly updated for the new duration package.The change from
isodate.String("")todatetime.ISODurationString("")maintains the same field characteristics while using the new type system.openmeter/entitlement/entitlement.go (2)
10-10: Import successfully updated for package refactoring.The import change from
isodatetodatetimealigns with the codebase-wide refactoring.
209-209: Validation logic correctly updated for the new duration package.The change from
isodate.NewPeriod(...)todatetime.NewPeriod(...)and fromInterval.Period.SubtracttoInterval.ISODuration.Subtractmaintains the same validation logic (ensuring usage period is at least 1 hour) while using the new type system.openmeter/productcatalog/alignment.go (2)
4-4: Import successfully updated for package refactoring.The import change from
isodatetodatetimealigns with the codebase-wide refactoring.
12-12: Function signature correctly updated for the new duration package.The parameter types changed from
isodate.Periodtodatetime.ISODurationwhile preserving the same billing cadence alignment validation logic.openmeter/billing/customeroverride.go (2)
12-12: Import successfully updated for package refactoring.The import change from
isodatetodatetimealigns with the codebase-wide refactoring.
69-69: Struct field types correctly updated for the new duration package.The field types changed from
*isodate.Periodto*datetime.ISODurationforInterval,DraftPeriod, andDueAfterfields while maintaining the same validation logic and pointer characteristics.Also applies to: 86-87
openmeter/productcatalog/subscription/http/mapping.go (5)
21-21: Import successfully updated for package refactoring.The import change from
isodatetodatetimealigns with the codebase-wide refactoring.
81-88: Duration parsing correctly updated forStartAfterfield.The variable type changed from
isodate.Periodtodatetime.ISODurationand parsing updated fromisodate.Stringtodatetime.ISODurationStringwhile maintaining the same error handling pattern.
90-100: Duration parsing correctly updated for phaseDurationfield.The variable type changed from
*isodate.Periodto*datetime.ISODurationand parsing updated fromisodate.Stringtodatetime.ISODurationStringwhile preserving the same optional field handling.
148-152: Duration parsing correctly updated forExtendByfield.The parsing changed from
isodate.Stringtodatetime.ISODurationStringwhile maintaining the same error handling pattern for phase stretching operations.
472-475: Duration parsing correctly updated forBillingCadencefield.The parsing changed from
isodate.Stringtodatetime.ISODurationStringwhile maintaining the same error handling pattern for custom plan creation.openmeter/subscription/patch/stretchphase.go (1)
7-7: LGTM: Consistent package migrationThe changes consistently migrate from
isodatetodatetimepackage throughout the file. The type changes (isodate.Period→datetime.ISODuration) and interface assertion update are properly aligned.Also applies to: 13-13, 24-24, 48-48
openmeter/ent/db/grant_create.go (1)
18-18: LGTM: Auto-generated code with consistent type migrationThe migration from
isodate.Stringtodatetime.ISODurationStringis consistent across the method signatures. Since this is auto-generated code, the changes ensure the generated methods align with the updated schema definitions.Also applies to: 154-160
openmeter/ent/db/billingworkflowconfig.go (1)
18-18: LGTM: Consistent field type migration with proper value assignmentThe changes consistently update field types from
isodate.Stringtodatetime.ISODurationStringand properly update theassignValuesmethod to cast string values to the new type. The pattern is correctly applied to all three duration fields.Also applies to: 37-43, 162-162, 174-174, 180-180
openmeter/productcatalog/errors.go (1)
9-9: LGTM: Consistent error handling migrationThe changes properly update the slice type from
[]isodate.Stringto[]datetime.ISODurationStringand maintain the error message formatting by calling.String()on the new type. The migration preserves the existing validation logic.Also applies to: 419-428, 434-434
openmeter/billing/httpdriver/profile.go (2)
17-17: LGTM: Consistent parsing function migrationThe
parseDurationPtrfunction is properly updated to usedatetime.ISODurationanddatetime.ISODurationStringtypes. The parsing logic maintains the same pattern with the.Parse()method call, preserving functionality while migrating to the new package.Also applies to: 412-417
1-1: Allisodatereferences removed; migration verifiedA project-wide search found no remaining imports or type usages of the old
isodatepackage. The migration todatetimeis complete—ready to merge.openmeter/ent/db/entitlement_create.go (2)
21-21: LGTM: Clean package import update.The import change from
isodatetodatetimeis consistent with the codebase-wide package rename.
215-226: LGTM: Method parameter types updated consistently.The type changes from
isodate.Stringtodatetime.ISODurationStringfor bothSetUsagePeriodIntervalandSetNillableUsagePeriodIntervalare consistent and maintain the same functionality for setting usage period intervals.openmeter/productcatalog/entitlement.go (3)
11-11: LGTM: Package import updated consistently.The import change from
isodatetodatetimealigns with the codebase-wide package migration.
272-272: LGTM: Field type updated appropriately.The
UsagePeriodfield type change fromisodate.Periodtodatetime.ISODurationmaintains the same functionality for representing ISO8601 duration intervals.
341-341: LGTM: Method call updated consistently.The change from
isodate.NewPeriodtodatetime.NewPeriodmaintains the same functionality for creating a one-hour period in the validation logic.openmeter/ent/db/billingcustomeroverride.go (3)
18-18: LGTM: Package import updated.The import change from
isodatetodatetimeis consistent with the package migration.
41-47: LGTM: Struct field types updated consistently.The duration-related fields (
LineCollectionPeriod,InvoiceDraftPeriod,InvoiceDueAfter) are consistently updated from*isodate.Stringto*datetime.ISODurationString, maintaining the same nullable duration string semantics.
176-199: LGTM: Value assignment logic updated consistently.The
assignValuesmethod correctly updates the type instantiation fromisodate.Stringtodatetime.ISODurationStringfor all three duration fields while maintaining the same SQL-to-Go type conversion logic.app/config/entitlements.go (3)
10-10: LGTM: Package import updated.The import change from
isodatetodatetimeis consistent with the codebase migration.
14-14: LGTM: Configuration field type updated.The
GracePeriodfield type change fromisodate.Stringtodatetime.ISODurationStringmaintains the same ISO duration string configuration semantics.
32-39: LGTM: Method return type and implementation updated consistently.The
GetGracePeriodmethod is properly updated:
- Return type changed from
isodate.Periodtodatetime.ISODuration- Default fallback period creation updated to use
datetime.NewPeriod- Maintains the same 1-day default behavior and error handling logic
openmeter/productcatalog/http/mapping.go (3)
14-14: LGTM: Clean package import change.The import correctly changes from the
isodatepackage to thedatetimepackage as part of the package migration.
409-409: LGTM: Consistent type substitution for ISO duration parsing.The changes correctly replace
isodate.Stringwithdatetime.ISODurationStringwhile maintaining identical parsing logic and error handling.Also applies to: 481-481
801-801: LGTM: Function signature and variable types updated consistently.The function signature and variable declarations correctly use
datetime.ISODurationinstead ofisodate.Period, maintaining the same parsing and validation logic.Also applies to: 816-819
openmeter/entitlement/driver/parser.go (3)
18-18: LGTM: Import updated for package migration.The import correctly changes to the
datetimepackage as part of the comprehensive package refactor.
356-358: LGTM: Duration parsing updated with correct return structure.The parsing logic correctly updates to use
datetime.ISODurationStringand returns the parsed duration in theISODurationfield instead of the deprecatedPeriodfield.
373-379: LGTM: Predefined recurrence interval comparisons updated.The field access correctly changes from
.Periodto.ISODurationto match the updated structure of the predefined recurrence intervals.openmeter/ent/db/subscriptionitem.go (3)
17-17: LGTM: Generated code import correctly updated.The import statement in this generated ent code correctly references the
datetimepackage as part of the migration.
50-52: LGTM: Struct field types updated consistently.The generated struct fields correctly use
*datetime.ISODurationStringinstead of the previousisodatetypes, maintaining consistency with the package migration.Also applies to: 64-64
256-257: LGTM: Type casting in assignValues method correctly updated.The generated
assignValuesmethod properly handles the type conversion fromsql.NullStringtodatetime.ISODurationString, ensuring correct data mapping from the database.Also applies to: 263-264, 302-303
openmeter/subscription/repository.go (3)
11-11: LGTM: Package import updated for the migration.The import correctly changes to the
datetimepackage as part of the comprehensive package refactor.
29-29: LGTM: Non-pointer duration fields updated correctly.The
BillingCadenceandStartAfterfields correctly usedatetime.ISODuration(non-pointer) instead ofisodate.Period, maintaining the original field characteristics.Also applies to: 79-79
106-107: LGTM: Pointer duration fields updated consistently.The relative override fields correctly use
*datetime.ISODuration(pointer types) instead of*isodate.Period, preserving the optional nature of these fields.openmeter/subscription/item.go (2)
8-8: LGTM: Package import updated for migration.The import correctly changes to the
datetimepackage as part of the package refactor.
21-22: LGTM: Duration field types updated consistently.The
ActiveFromOverrideRelativeToPhaseStartandActiveToOverrideRelativeToPhaseStartfields correctly use*datetime.ISODurationinstead of*isodate.Periodin both the main struct and the JSON unmarshaling helper struct, maintaining pointer semantics for optional fields.Also applies to: 62-63
openmeter/ent/schema/billing.go (1)
17-17: LGTM! Consistent package migration for ISO duration fields.The systematic replacement of
isodate.Stringwithdatetime.ISODurationStringfor all duration-related fields (line_collection_period,invoice_draft_period,invoice_due_after) is consistent and maintains the same field characteristics (optionality, nullability, etc.). The underlying functionality should remain equivalent based on the type definition inpkg/datetime/date.go.Also applies to: 126-126, 130-130, 132-132, 204-204, 213-213, 218-218
openmeter/ent/schema/subscription.go (1)
13-13: LGTM! Consistent package migration for subscription duration fields.The migration from
isodate.Stringtodatetime.ISODurationStringfor subscription-related duration fields (billing_cadence,active_from_override_relative_to_phase_start,active_to_override_relative_to_phase_start) follows the same pattern as other schema changes and maintains field attributes correctly.Also applies to: 41-41, 157-157, 159-159, 181-181
openmeter/ent/db/addonratecard_update.go (1)
19-19: LGTM! Auto-generated code reflects schema changes correctly.The parameter type changes from
isodate.String/*isodate.Stringtodatetime.ISODurationString/*datetime.ISODurationStringin theSetBillingCadenceandSetNillableBillingCadencemethods are consistent with the schema migrations in other files. Since this is auto-generated code, these changes should be automatically produced when the Ent code generation runs after schema updates.Also applies to: 152-152, 158-158, 622-622, 628-628
openmeter/ent/db/plan_create.go (1)
20-20: LGTM: Import statement updated for package migration.The import change from
isodatetodatetimepackage aligns with the PR objective to refactor package names.openmeter/ent/db/planphase_update.go (2)
18-18: LGTM: Import statement updated for package migration.The import change from
isodatetodatetimepackage is consistent with the broader refactor.
142-142: Consistent type migration for duration handling.All duration-related method signatures have been systematically updated:
SetDurationmethods:isodate.String→datetime.ISODurationStringSetNillableDurationmethods:*isodate.String→*datetime.ISODurationStringThe changes maintain consistency between value and pointer types across both
PlanPhaseUpdateandPlanPhaseUpdateOnebuilders.Also applies to: 148-148, 512-512, 518-518
openmeter/ent/db/planratecard_update.go (2)
19-19: LGTM: Import statement updated for package migration.The import change from
isodatetodatetimepackage follows the established pattern.
152-152: Comprehensive type migration for billing cadence handling.All billing cadence-related method signatures have been consistently updated:
SetBillingCadencemethods:isodate.String→datetime.ISODurationStringSetNillableBillingCadencemethods:*isodate.String→*datetime.ISODurationStringThe migration is complete across both
PlanRateCardUpdateandPlanRateCardUpdateOnebuilders, maintaining type consistency between value and pointer variants.Also applies to: 158-158, 622-622, 628-628
openmeter/ent/db/subscription_update.go (1)
22-22: Confirm complete replacement of isodate with datetimeI ran a global search and found no remaining
github.com/openmeterio/openmeter/pkg/isodateimports orisodate.String/isodate.Periodusages. All generated update methods, including openmeter/ent/db/subscription_update.go:22, now consistently usedatetime.ISODurationString. LGTM.openmeter/ent/db/subscription_create.go (1)
24-24: Confirmed consistency across subscription creation and related operationsAll
isodate.Stringreferences have been replaced withdatetime.ISODurationStringinopenmeter/ent/db/subscription_create.go(and corresponding upsert, bulk, update, and item-create files). A full scan shows no remainingisodate.Stringusages, and tests have been updated to use the new type.
Approving these changes.openmeter/productcatalog/ratecard.go (7)
11-11: LGTM: Import updated correctly for package migration.The import change from
isodatetodatetimeis consistent with the PR objectives.
40-40: LGTM: Interface method return type updated correctly.The
GetBillingCadence()method return type correctly migrates from*isodate.Periodto*datetime.ISODuration.
242-242: LGTM: FlatFeeRateCard billing cadence field and getter correctly updated.The field type change from
*isodate.Periodto*datetime.ISODurationcorrectly maintains the pointer semantics forFlatFeeRateCard, which is consistent with the retrieved learnings about the difference between rate card types.Also applies to: 252-253
332-332: LGTM: Validation logic updated correctly for new package.The calls to
datetime.NewPeriod()correctly replaceisodate.NewPeriod()with the same parameter signature.Also applies to: 485-485
387-387: LGTM: UsageBasedRateCard billing cadence correctly updated.The field type change from
isodate.Periodtodatetime.ISODurationcorrectly maintains the non-pointer semantics forUsageBasedRateCard.BillingCadence, while the getter method appropriately returns a pointer to satisfy the interface contract.Also applies to: 397-398
365-365: LGTM: JSON marshaling structs updated correctly.The marshaling struct field types are correctly updated to use
*datetime.ISODurationanddatetime.ISODurationrespectively, preserving the appropriate pointer semantics.Also applies to: 500-500
545-545: LGTM: Collection method map key type updated correctly.The map key type change from
isodate.Stringtodatetime.ISODurationStringis consistent with the package migration.openmeter/billing/worker/subscription/phaseiterator_test.go (4)
18-18: LGTM: Test file import updated correctly.The import change from
isodatetodatetimeis consistent with the package migration.
48-49: LGTM: Test mock struct fields updated correctly.The field types are correctly changed from
*isodate.Periodto*datetime.ISODurationto align with the new package types.
69-70: LGTM: Test case variables and function calls updated systematically.All test case variables are correctly changed from
isodate.Periodtodatetime.ISODuration, and function calls are updated fromisodate.MustParsetodatetime.MustParse. The changes are systematic and maintain test coverage for the updated types.Also applies to: 81-81, 94-94, 141-141, 184-184, 232-232, 313-313, 362-362, 442-442, 503-503, 562-562, 608-608, 714-714, 745-745, 781-781, 935-935, 942-942, 991-992
1096-1100: LGTM: Test mock creation updated correctly.The variable declaration and rate card creation logic correctly uses the new
*datetime.ISODurationtype while preserving the appropriate pointer semantics for different rate card types.openmeter/ent/db/plan_update.go (2)
20-20: LGTM: Generated code import updated correctly.The import change from
isodatetodatetimeis correctly applied to the generated code.
130-130: LGTM: Generated setter methods updated correctly.The parameter types for
SetBillingCadenceandSetNillableBillingCadencemethods are correctly changed fromisodate.Stringtodatetime.ISODurationStringin both the bulk update (PlanUpdate) and single update (PlanUpdateOne) builders.Also applies to: 136-136, 674-674, 680-680
openmeter/ent/db/planphase_create.go (5)
18-18: LGTM: Import statement updated correctly.The import has been properly updated from the
isodatepackage to thedatetimepackage, aligning with the refactoring objectives.
122-133: LGTM: Duration field methods updated consistently.Both
SetDurationandSetNillableDurationmethods have been correctly updated to usedatetime.ISODurationStringinstead ofisodate.String. The pointer semantics are maintained appropriately.
529-532: LGTM: Upsert method signature updated correctly.The
SetDurationmethod inPlanPhaseUpserthas been properly updated to use the newdatetime.ISODurationStringtype.
730-734: LGTM: UpsertOne method signature updated correctly.The
SetDurationmethod inPlanPhaseUpsertOnehas been properly updated to use the newdatetime.ISODurationStringtype.
1101-1105: LGTM: UpsertBulk method signature updated correctly.The
SetDurationmethod inPlanPhaseUpsertBulkhas been properly updated to use the newdatetime.ISODurationStringtype, completing the consistent migration across all builder types.openmeter/ent/db/addonratecard_create.go (5)
19-19: LGTM: Import statement updated correctly.The import has been properly updated from the
isodatepackage to thedatetimepackage, consistent with the refactoring across the codebase.
143-154: LGTM: BillingCadence field methods updated consistently.Both
SetBillingCadenceandSetNillableBillingCadencemethods have been correctly updated to usedatetime.ISODurationStringinstead ofisodate.String. The pointer semantics are maintained appropriately for the nullable field.
675-678: LGTM: Upsert method signature updated correctly.The
SetBillingCadencemethod inAddonRateCardUpserthas been properly updated to use the newdatetime.ISODurationStringtype.
973-977: LGTM: UpsertOne method signature updated correctly.The
SetBillingCadencemethod inAddonRateCardUpsertOnehas been properly updated to use the newdatetime.ISODurationStringtype.
1455-1459: LGTM: UpsertBulk method signature updated correctly.The
SetBillingCadencemethod inAddonRateCardUpsertBulkhas been properly updated to use the newdatetime.ISODurationStringtype, completing the consistent migration across all builder types.openmeter/ent/db/planratecard_create.go (1)
19-20: No residual Gopkg/isodateimports detected
- Ran
rg "\"github.com/openmeterio/openmeter/pkg/isodate\"": no matches- All occurrences of “isodate” are in the Python client and refer to the external PyPI package, not the Go
openmeter/pkg/isodatemoduleNo further action required.
openmeter/billing/worker/subscription/sync_test.go (1)
4336-4343: HelperGetISODurationReturns a ValueVerified in
openmeter/testutils/time.go(line 19) that:func GetISODuration(t *testing.T, durationString string) datetime.ISODurationIt still returns a value, so using
lo.ToPtr(testutils.GetISODuration(...))produces a*datetime.ISODuration(not**datetime.ISODuration). No further changes needed.openmeter/ent/db/subscription/where.go (2)
12-12: LGTM: Import updated correctly for package refactorThe import change from
isodatetodatetimepackage is consistent with the broader refactor objective.
132-132: LGTM: Predicate functions consistently updatedAll BillingCadence-related predicate functions have been correctly updated to use
datetime.ISODurationStringinstead ofisodate.String. The underlying logic remains unchanged since both types convert to string using the samestring(v)conversion.Also applies to: 837-918
openmeter/ent/db/billingcustomeroverride_update.go (3)
19-19: LGTM: Import updated correctly for package refactorThe import change from
isodatetodatetimepackage aligns with the refactor objective.
102-102: LGTM: Update builder methods consistently updatedAll setter methods for duration fields (
line_collection_period,invoice_draft_period,invoice_due_after) have been correctly updated to usedatetime.ISODurationStringinstead ofisodate.String. Both the direct setters and nullable setters maintain the same patterns and functionality.Also applies to: 108-108, 142-142, 148-148, 162-162, 168-168
501-501: LGTM: UpdateOne builder methods consistently updatedThe single entity update builder methods mirror the bulk update changes correctly, maintaining consistency across the API surface.
Also applies to: 507-507, 541-541, 547-547, 561-561, 567-567
openmeter/ent/db/plan/where.go (2)
11-11: LGTM: Import updated correctly for package refactorThe import change from
isodatetodatetimepackage is consistent with the refactor objective.
115-115: LGTM: Plan billing cadence predicates consistently updatedAll BillingCadence-related predicate functions have been correctly updated to use
datetime.ISODurationString. The changes follow the same pattern as the subscription entity predicates, maintaining consistency across the codebase.Also applies to: 646-727
openmeter/ent/db/grant/where.go (1)
11-11: LGTM! Clean refactor from isodate to datetime package.The import and all RecurrencePeriod predicate functions have been consistently updated to use
datetime.ISODurationString. The internal string conversion logic is preserved, maintaining the same functionality while migrating to the new package.Also applies to: 130-133, 701-792
openmeter/ent/db/planratecard/where.go (1)
12-12: LGTM! Consistent type migration for BillingCadence predicates.The import and all BillingCadence predicate functions have been properly updated to use
datetime.ISODurationString. The string conversion logic remains intact, ensuring backward compatibility while adopting the new type system.Also applies to: 111-114, 662-753
openmeter/ent/db/billingworkflowconfig_update.go (1)
20-20: LGTM! Builder methods properly updated for duration fields.All setter methods for duration-related fields (
line_collection_period,invoice_draft_period,invoice_due_after) have been consistently updated to usedatetime.ISODurationString. Both regular and nillable variants are properly handled, maintaining the same builder pattern functionality.Also applies to: 77-88, 105-116, 119-130, 492-503, 520-531, 534-545
openmeter/ent/db/entitlement/where.go (2)
11-11: LGTM: Package import updated consistently.The import change from
isodatetodatetimealigns with the PR objective of refactoring package names.
140-143: LGTM: Predicate function parameter types updated consistently.All
UsagePeriodIntervalpredicate functions have been updated to usedatetime.ISODurationStringinstead ofisodate.String. The conversion logic (string(v)) remains unchanged, ensuring functional equivalence.Also applies to: 881-884, 887-890, 893-899, 902-908, 911-914, 917-920, 923-926, 929-932, 935-938, 941-944, 947-950, 963-966, 969-972
openmeter/ent/db/subscriptionitem_update.go (3)
20-20: LGTM: Package import updated consistently.The import change from
isodatetodatetimealigns with the package refactoring effort.
161-164: LGTM: SubscriptionItemUpdate setter methods updated consistently.All setter methods for duration-related fields have been updated to use
datetime.ISODurationStringparameters. Both direct setters and nillable setters are consistently updated.Also applies to: 167-172, 181-184, 187-192, 279-282, 285-290
868-871: LGTM: SubscriptionItemUpdateOne setter methods updated consistently.The UpdateOne builder methods mirror the changes in the main update builder, maintaining consistency across both builders for the same duration-related fields.
Also applies to: 874-879, 888-891, 894-899, 986-989, 992-997
openmeter/ent/db/planphase/where.go (2)
11-11: Import updated correctly for the package refactor.The import statement has been properly updated from
isodatetodatetimepackage as part of the refactoring effort.
115-118: Duration function signatures updated consistently.All duration-related predicate functions have been properly updated to use
datetime.ISODurationStringtype. The internal string conversion logic is preserved correctly, ensuring compatibility with the SQL predicate system.Also applies to: 636-639, 642-645, 648-654, 657-663, 666-669, 672-675, 678-681, 684-687, 690-693, 696-699, 702-705, 718-721, 724-727
openmeter/ent/db/addonratecard/where.go (2)
12-12: Import updated consistently with the package refactor.The import statement has been updated correctly to use the
datetimepackage, maintaining consistency with the broader refactoring effort.
111-114: Billing cadence function signatures updated consistently.All billing_cadence-related predicate functions have been properly updated to use
datetime.ISODurationStringtype. The string conversion logic and SQL predicate application remain correct and consistent with the refactoring objectives.Also applies to: 662-665, 668-671, 674-680, 683-689, 692-695, 698-701, 704-707, 710-713, 716-719, 722-725, 728-731, 744-747, 750-753
openmeter/ent/db/billingworkflowconfig_create.go (2)
20-21: Migration compiles, but double-check JSON/Text marshaling support
datetime.ISODurationStringis now an alias ofperiod.ISOString(i.e. a barestring).
If the oldisodate.Stringtype used customMarshalJSON/UnmarshalJSONor
TextMarshalerimplementations, that behaviour will silently disappear here,
which can break API contracts and GraphQL schema expectations.Please confirm that either
a) the alias type inpkg/datetimere-implements those interfaces, or
b) nothing in the public surface relied on that serialisation logic.
If needed, re-add the methods on the new alias before cutting a release.
85-107: Setter signatures updated – validate downstream call-sites & validatorsThe three setters currently accept a plain
datetime.ISODurationString, but the underlying field is stored as a
pointer (&value) increateSpec().
That mirrors the previous behaviour, so the change is OK.Two follow-ups to avoid regressions:
- Run
go vet ./...andgrepfor oldSet…Period(isodate.String)usages.- Consider adding a light validator (length > 0, RFC 3339 duration parse,
etc.) to detect obviously invalid strings at the boundary.No code changes required here.
openmeter/ent/db/subscriptionitem_create.go (2)
21-22: Import swapped topkg/datetime– confirm transitive dependency removalLooks good, but ensure all
go.mod/go.sumreferences to the old
pkg/isodate(or the upstreamisodatemodule) are removed to prevent
“unused replace” lints in CI.
226-238: Billing cadence change – make sure business rules still validate
BillingCadenceswitched to a raw string alias. Previously, service-level
validation often ensured the cadence matched allowed durations
(e.g.P1M,P1Y).
Ensure that higher-level services (subscription reconciliation, billing
worker) still parse & validate the field, otherwise malformed data can now
enter the DB unchecked.openmeter/ent/db/billingcustomeroverride_create.go (4)
114-167: Setter signatures updated todatetime.ISODurationString– LGTMAll create-builder setters now accept the new alias and still persist with
field.TypeString; nothing else to flag.
558-627: Upsert setters mirror the type change – LGTMThe one-shot and builder-style upsert helpers were updated consistently. No functional or validation logic altered.
Also applies to: 818-899
1266-1347: Bulk-upsert setters updated consistently – LGTMBulk helpers follow the same pattern; no behavioural change beyond the type alias.
20-21: Import switch confirmed—no remainingisodatereferencesRan a repository-wide search for
isodate.Stringandisodate.Periodand found zero occurrences. The migration todatetimeis complete.openmeter/ent/db/setorclear.go (3)
184-196:BillingCadencetype migration looks correctThe new signature cleanly wraps the
nil-vs-valuelogic and forwards the dereferenced
datetime.ISODurationStringto the generated setter. No other concerns here.
2942-2954: Subscription-item cadence refactor LGTMThe cadence parameter was successfully migrated to
datetime.ISODurationString; semantics of nil-to-clear vs value-to-set remain intact.
2466-2478: ✅ Confirmed:plan_phase.durationis Optional and Nillable
- The
durationfield is declared with.Optional().Nillable()in
openmeter/ent/schema/productcatalog.go(lines 100–103), soClearDuration()will correctly clear the value.No changes required.
openmeter/ent/db/billingcustomeroverride/where.go (3)
12-12: Package import correctly updated as part of the migration.The import statement has been properly updated from the
isodatepackage to thedatetimepackage, aligning with the broader codebase refactoring.
101-121: Function signatures consistently updated for duration fields.All predicate functions for duration-related fields (
LineCollectionPeriod,InvoiceDraftPeriod,InvoiceDueAfter) have been properly updated to usedatetime.ISODurationStringinstead ofisodate.String. The internal string conversion logic remains unchanged, which is correct since both types are string-based.
504-803: All predicate variations correctly updated with new type.The comprehensive set of predicate functions (EQ, NEQ, In, NotIn, GT, GTE, LT, LTE, Contains, HasPrefix, HasSuffix, EqualFold, ContainsFold) for all three duration fields have been consistently updated to use
datetime.ISODurationString. This ensures complete API compatibility with the new type system.openmeter/ent/db/billingworkflowconfig/where.go (3)
12-12: Import statement properly migrated to datetime package.Consistent with the codebase-wide refactoring, the import has been correctly updated from
isodatetodatetime.
91-111: Duration field predicates updated with correct new types.The basic predicate functions for
LineCollectionPeriod,InvoiceDraftPeriod, andInvoiceDueAfterhave been properly updated to usedatetime.ISODurationString. The string conversion approach remains appropriate for the new type.
354-613: Complete predicate function coverage maintained with new types.All predicate variations for the three duration fields have been systematically updated to use
datetime.ISODurationString. This maintains full backward compatibility at the API level while using the new type system. The generated code correctly preserves the existing string conversion logic.openmeter/ent/db/subscriptionitem/where.go (2)
11-12: Import path update looks correct – remembergo mod tidySwapping
isodatefordatetimeis mechanically fine here, but don’t forget to rungo mod tidy(orgo mod download) so that the new dependency is reflected ingo.mod/go.sumand stale imports are removed.
682-734: Generated duplication – no action requiredLarge blocks were regenerated only to replace the parameter type.
The duplication/no-op casts are an artefact ofentcode-gen and not meant for manual editing. Looks good.Also applies to: 776-868, 1106-1197
openmeter/ent/db/mutation.go (12)
67-67: Import change looks correct.The import has been properly updated from
isodatetodatetimeto support the type migration.
1589-1589: AddonRateCardMutation type changes are consistent.All related methods and fields have been properly updated to use
datetime.ISODurationString:
- Struct field type
- Setter method parameter
- Getter method return type
- Old value retriever return type
- Type assertion in SetField method
Also applies to: 2217-2217, 2222-2222, 2233-2233, 2780-2780
10022-10025: BillingCustomerOverrideMutation type changes are consistent.All duration-related fields have been properly updated to use
datetime.ISODurationStringwith consistent pointer usage for nullable fields.Also applies to: 10435-10435, 10440-10440, 10451-10451, 10533-10533, 10538-10538, 10549-10549, 10582-10582, 10587-10587, 10598-10598, 11040-11040, 11054-11054, 11061-11061
27480-27483: BillingWorkflowConfigMutation type changes are consistent.All setters, getters, and type assertions have been properly updated to use
datetime.ISODurationString.Also applies to: 27797-27797, 27802-27802, 27869-27869, 27874-27874, 27905-27905, 27910-27910, 28406-28406, 28420-28420, 28427-28427
31160-31160: EntitlementMutation type changes are consistent.The usage_period_interval field and related methods have been properly updated to use
datetime.ISODurationString.Also applies to: 32090-32090, 32095-32095, 32106-32106, 32912-32912
34563-34563: GrantMutation type changes are consistent.The recurrence_period field and related methods have been properly updated to use
datetime.ISODurationString.Also applies to: 35301-35301, 35306-35306, 35317-35317, 35710-35710
40414-40414: PlanMutation type changes are consistent.The billing_cadence field and related methods have been properly updated to use
datetime.ISODurationString.Also applies to: 40957-40957, 40962-40962, 40973-40973, 41518-41518
42874-42874: PlanPhaseMutation type changes are consistent.The duration field and related methods have been properly updated to use
datetime.ISODurationString.Also applies to: 43410-43410, 43415-43415, 43426-43426, 43748-43748
44002-44002: PlanRateCardMutation type changes are consistent.The billing_cadence field and related methods have been properly updated to use
datetime.ISODurationString.Also applies to: 44630-44630, 44635-44635, 44646-44646, 45193-45193
46219-46219: SubscriptionMutation type changes are consistent.The billing_cadence field and related methods have been properly updated to use
datetime.ISODurationString.Also applies to: 46881-46881, 46886-46886, 46897-46897, 47480-47480
49488-49489: SubscriptionItemMutation type changes are consistent.All duration-related fields have been properly updated to use
datetime.ISODurationString:
- active_from_override_relative_to_phase_start
- active_to_override_relative_to_phase_start
- billing_cadence
Also applies to: 49495-49495, 50129-50129, 50134-50134, 50145-50145, 50178-50178, 50183-50183, 50194-50194, 50459-50459, 50464-50464, 50475-50475, 51067-51067, 51074-51074, 51116-51116
27813-27813: Verify return type alignment with schema nullabilityPlease confirm that the
Old*methods inBillingWorkflowConfigMutationmatch the nullability of their corresponding schema fields, and that the pointer vs non-pointer return types are intentional:• Mutation locations:
- openmeter/ent/db/mutation.go: lines 27813, 27885, 27921
• Schema definitions:- openmeter/ent/schema/billing.go (
BillingWorkflowConfig)- openmeter/ent/schema/customer.go (
BillingCustomerOverride)Ensure that in
BillingWorkflowConfigthe fieldsline_collection_period,invoice_draft_periodandinvoice_due_afterare defined as non-nullable (soOld*returns a non-pointerdatetime.ISODurationString), and that inBillingCustomerOverridethose fields are nullable (soOld*returns*datetime.ISODurationString). Adjust the mutation method signatures if the schema’s nullability differs.
Overview
rename isodate package and types
Notes for reviewer
Summary by CodeRabbit
datetimepackage, replacing the previous implementation. This includes configuration, API inputs/outputs, database schemas, and internal data handling.