Skip to content

Conversation

@GAlexIHU
Copy link
Contributor

@GAlexIHU GAlexIHU commented Jul 3, 2025

Overview

rename isodate package and types

Notes for reviewer

Summary by CodeRabbit

  • Refactor
    • Updated all duration and period fields across billing, entitlement, product catalog, and subscription modules to use a new ISO duration type from the datetime package, replacing the previous implementation. This includes configuration, API inputs/outputs, database schemas, and internal data handling.
  • Bug Fixes
    • Maintained consistent parsing and validation of ISO duration strings across all affected features.
  • Tests
    • Modified all related test cases to adopt the new duration type, ensuring consistent and reliable testing.

@GAlexIHU GAlexIHU self-assigned this Jul 3, 2025
@GAlexIHU GAlexIHU requested a review from a team as a code owner July 3, 2025 14:38
@GAlexIHU GAlexIHU added the release-note/ignore Ignore this change when generating release notes label Jul 3, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 3, 2025

📝 Walkthrough

Walkthrough

This change replaces all usages of the isodate package and its types/functions with the datetime package and its equivalents throughout the codebase. All fields, methods, and logic handling ISO 8601 durations or periods now use datetime.ISODuration, datetime.ISODurationString, or related types. Numerous method and struct signatures, especially in public APIs and schemas, were updated to reflect this type migration.

Changes

File(s) Change Summary
app/config/config_test.go, app/config/entitlements.go Switched from isodate to datetime for ISO duration handling; updated struct fields and method signatures accordingly.
openmeter/billing/customeroverride.go, openmeter/billing/defaults.go, openmeter/billing/httpdriver/invoice.go, openmeter/billing/httpdriver/profile.go, openmeter/billing/profile.go, openmeter/billing/worker/subscription/phaseiterator_test.go, openmeter/billing/worker/subscription/sync_test.go, openmeter/billing/workflow.go Replaced all isodate imports/types with datetime equivalents for durations/periods; updated all affected struct fields, method signatures, and test code.
openmeter/credit/adapter/grant.go, openmeter/credit/connector.go Migrated from isodate to datetime for recurrence and grace period fields.
openmeter/ent/db/addonratecard.go, .../addonratecard/where.go, .../addonratecard_create.go, .../addonratecard_update.go Updated all "billing_cadence" fields, predicates, and builder methods from isodate.String to datetime.ISODurationString.
openmeter/ent/db/billingcustomeroverride.go, .../billingcustomeroverride/where.go, .../billingcustomeroverride_create.go, .../billingcustomeroverride_update.go Changed "line_collection_period", "invoice_draft_period", "invoice_due_after" fields, predicates, and builders from isodate.String to datetime.ISODurationString.
openmeter/ent/db/billingworkflowconfig.go, .../billingworkflowconfig/where.go, .../billingworkflowconfig_create.go, .../billingworkflowconfig_update.go Updated workflow config duration fields and all related predicates and builder methods to use datetime.ISODurationString.
openmeter/ent/db/entitlement.go, .../entitlement/where.go, .../entitlement_create.go Changed "usage_period_interval" field and all related predicates and builders from isodate.String to datetime.ISODurationString.
openmeter/ent/db/grant.go, .../grant/where.go, .../grant_create.go Updated "recurrence_period" field and related predicates and builder methods to use datetime.ISODurationString.
openmeter/ent/db/mutation.go Replaced all mutation struct fields, setters, and getters for duration string fields from isodate.String to datetime.ISODurationString.
openmeter/ent/db/plan.go, .../plan/where.go, .../plan_create.go, .../plan_update.go Updated "billing_cadence" field and all related predicates and builder methods to use datetime.ISODurationString.
openmeter/ent/db/planphase.go, .../planphase/where.go, .../planphase_create.go, .../planphase_update.go Changed "duration" field and all related predicates and builder methods from isodate.String to datetime.ISODurationString.
openmeter/ent/db/planratecard.go, .../planratecard/where.go, .../planratecard_create.go, .../planratecard_update.go Updated "billing_cadence" field and all related predicates and builder methods to use datetime.ISODurationString.
openmeter/ent/db/setorclear.go Updated all SetOrClear methods for duration fields to use *datetime.ISODurationString instead of *isodate.String.
openmeter/ent/db/subscription.go, .../subscription/where.go, .../subscription_create.go, .../subscription_update.go Changed "billing_cadence" field and all related predicates and builder methods from isodate.String to datetime.ISODurationString.
openmeter/ent/db/subscriptionitem.go, .../subscriptionitem/where.go, .../subscriptionitem_create.go, .../subscriptionitem_update.go Updated "active_from_override_relative_to_phase_start", "active_to_override_relative_to_phase_start", "billing_cadence" fields and all related predicates and builder methods to use datetime.ISODurationString.
openmeter/ent/schema/billing.go, .../entitlement.go, .../grant.go, .../productcatalog.go, .../ratecard.go, .../subscription.go Changed GoType for all relevant duration string fields in schemas from isodate.String to datetime.ISODurationString.
openmeter/entitlement/adapter/entitlement.go, openmeter/entitlement/driver/parser.go Updated recurrence interval mapping to use ISODuration field instead of Period; replaced isodate with datetime parsing.
openmeter/entitlement/entitlement.go, openmeter/entitlement/usageperiod.go, openmeter/entitlement/usageperiod_test.go Updated all period/duration validation and construction logic to use datetime instead of isodate.
openmeter/entitlement/metered/lateevents_test.go, .../utils_test.go, .../service/utils_test.go Updated test code to use datetime.MustParse instead of isodate.MustParse for grace period parsing.
openmeter/productcatalog/addon/adapter/adapter_test.go, .../ratecard_test.go, .../service/service_test.go Updated test code to use datetime for period construction and parsing.
openmeter/productcatalog/alignment.go Changed function signature and logic from isodate.Period to datetime.ISODuration.
openmeter/productcatalog/entitlement.go Updated MeteredEntitlementTemplate.UsagePeriod type and validation logic to use datetime.ISODuration.
openmeter/productcatalog/entitlement_test.go Updated all test period parsing to use datetime.MustParse.
openmeter/productcatalog/errors.go Changed error variable types and formatting logic to use datetime.ISODurationString.
openmeter/productcatalog/http/mapping.go Updated all parsing and usage of billing cadence and usage period to use datetime types and parsing.
openmeter/productcatalog/phase.go Changed PhaseMeta.Duration type and validation logic to use datetime.ISODuration.
openmeter/productcatalog/plan.go, .../plan/adapter/adapter_test.go, .../plan/httpdriver/mapping.go, .../plan/ratecard_test.go, .../plan/serializer.go, .../plan/serializer_test.go, .../plan/service.go, .../plan/service/service_test.go, .../plan_test.go Updated all usage of billing cadence and period types from isodate to datetime in structs, validation, and tests.
openmeter/productcatalog/planaddon/adapter/adapter_test.go, .../service/service_test.go, .../planaddon_test.go Updated all test code to use datetime for period construction and parsing.
openmeter/productcatalog/ratecard.go, .../ratecard_test.go Changed all billing cadence fields, methods, and map key types from isodate.Period/isodate.String to datetime.ISODuration/datetime.ISODurationString.
openmeter/productcatalog/subscription/http/mapping.go, .../plan.go, .../service/service.go Updated all ISO duration parsing and usage from isodate to datetime types and functions.
openmeter/productcatalog/testutils/plan.go Changed test utility period parsing from isodate to datetime.
openmeter/subscription/addon/diff/apply.go, .../apply_test.go, .../restore.go, .../restore_test.go Updated all usages of isodate.Between to datetime.Between for date difference calculations.
openmeter/subscription/addon/extend_test.go Changed method signature for GetBillingCadence() from *isodate.Period to *datetime.ISODuration.
openmeter/subscription/item.go Updated struct fields and JSON unmarshaling for active override durations from *isodate.Period to *datetime.ISODuration.
openmeter/subscription/patch/additem.go, .../addphase.go, .../removeitem.go, .../removephase.go, .../stretchphase.go, .../stretchphase_test.go Updated all patch logic and related fields from isodate.Period to datetime.ISODuration and related types.
openmeter/subscription/repository.go Changed all relevant struct fields for durations from isodate.Period to datetime.ISODuration.
openmeter/subscription/serialize_test.go Updated test code to use datetime.NewPeriod for constructing periods.
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 for billing_cadence.

These setters blindly accept any datetime.ISODurationString (an alias of string).
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 for SetBillingCadence (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 in AsPatch

rc = &productcatalog.UsageBasedRateCard{
    RateCardMeta:   meta,
    BillingCadence: *i.BillingCadence,
}

*i.BillingCadence will panic when BillingCadence == 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 residual isodate references from the Python client

We ran a global grep for isodate\. and, while the Go import swap is clean, there are still lingering isodate.* calls in the generated Python serialization code. These must be replaced (e.g., with built-in datetime or your new datetime utilities) 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 isodate import, 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 of NewTestPlan. 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.T where it is not otherwise needed.

openmeter/productcatalog/plan/adapter/adapter_test.go (1)

22-23: Nit: export guard for global test data

MonthPeriod is exported (M uppercase) 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 test

Rename MonthPeriodmonthPeriod to 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 to P30D whereas the validator only whitelists P1M.
If ErrPlanBillingCadenceAllowedValues keeps the old literals (P1M, P2M, …) any plan/add-on created in this test will now fail ValidatePlanBillingCadenceLiteral.

-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 (before t.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.T context 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-scope var 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 that MonthPeriod is shared and MUST remain immutable

MonthPeriod is 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 local duration pointer juggling

Using &duration later 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                       // pointer

This 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 repetitive datetime.MustParse calls.

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 in require.Equal for 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” identifier

The local variable period shadows the imported period package used inside pkg/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 = dur

Replicate for the DueAfter block.

openmeter/subscription/patch/removeitem.go (1)

72-75: Minor: rename local diff to avoid repetition

diff is 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 = &relDur
openmeter/subscription/addon/diff/apply.go (1)

205-210: Use distinct variable names for calculated durations

To keep code self-descriptive and avoid clashes with earlier diff slices, prefer offset (or similar) over diff:

-    diff := datetime.Between(phaseCadence.ActiveFrom, *target.From)
+    offset := datetime.Between(phaseCadence.ActiveFrom, *target.From)
...
-        item.ActiveFromOverrideRelativeToPhaseStart = &diff
+        item.ActiveFromOverrideRelativeToPhaseStart = &offset

Repeat for the target.To block.

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 = &d

Not critical, but it keeps the hot path a bit tighter.

openmeter/ent/schema/entitlement.go (1)

56-57: Missing validation for ISO-8601 interval string

Now that usage_period_interval is a naked string alias, Ent won’t auto-validate its format.
Consider adding a .Validate() call or wrapping datetime.ISODurationString with a custom ValueScanner to reject invalid values at the DB boundary.

openmeter/billing/worker/subscription/sync_test.go (1)

4389-4406: Discarded error from AddTo hides parsing problems

cadence.AddTo(start) returns (time.Time, error) but the error is ignored:

start, _ = cadence.AddTo(start)

If cadence is 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

SetActiveFromOverrideRelativeToPhaseStart now takes a value, while the
field on the entity remains a *ISODurationString.
This is fine, yet note that the Nillable… 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 when nil is passed, an explicit
Clear… setter is needed (similar to the Clear* methods generated for
other fields).

openmeter/ent/db/subscriptionitem/where.go (1)

119-123: Type change relies on type ISODurationString string being an alias

All 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

📥 Commits

Reviewing files that changed from the base of the PR and between f19ee8e and 6894b62.

📒 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

SnapshotGracePeriod is now set to a datetime.ISODuration value. Ensure the CreditConnectorConfig struct was updated accordingly (it previously accepted an isodate.Period or 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: datetime import is correct

The import switch to pkg/datetime is expected and aligns with the global refactor. No further action needed.

openmeter/productcatalog/plan/service/service_test.go (1)

23-23: datetime import change looks good
No issues with the package switch.

openmeter/entitlement/metered/utils_test.go (2)

30-30: Import migration acknowledged

Switching to pkg/datetime keeps the tests consistent with the refactor.


142-142: Type match sanity-check

SnapshotGracePeriod now receives datetime.ISODuration; ensure the struct field was updated to that type (it used to be isodate.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 LGTM

openmeter/productcatalog/plan.go (1)

12-12: Import change acknowledged

openmeter/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 to pkg/datetime is complete—no further changes are needed.

app/config/config_test.go (1)

140-143: LGTM – config test updated correctly

The switch to datetime.ISODurationString keeps the test in sync with the new type.

openmeter/subscription/patch/additem.go (1)

7-7: Import switch is safe.

isodatedatetime is 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; ActiveFrom is a value, not a pointer

The suggested guard around pCad.ActiveFrom isn’t needed:

  • pCad.ActiveFrom is a time.Time, never nil, so calling Between(pCad.ActiveFrom, …) cannot panic.
  • The code already checks combinedPer.From != nil and combinedPer.To != nil before 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 to datetime; 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 correct

Import path migrated cleanly to pkg/datetime; compile-time impact limited to this file.

openmeter/productcatalog/planaddon_test.go (1)

13-14: Consistent migration to datetime – looks good

All 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 OK

Dependency swap compiles cleanly.

openmeter/subscription/addon/diff/apply.go (1)

9-10: Import replacement verified

Swapping isodate for datetime aligns with repository-wide refactor.

openmeter/subscription/patch/removephase.go (2)

7-7: LGTM: Consistent package migration.

The import change from isodate to datetime aligns with the PR's objective to refactor package names.


65-65: LGTM: Type migration maintains compatibility.

The change from isodate.Period to datetime.ISODuration is correct. Since datetime.ISODuration embeds period.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 isodate to datetime is part of the systematic package migration.


134-134: LGTM: Function call updated correctly.

The change from isodate.String("P1D") to datetime.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 isodate to datetime follows the systematic package refactor pattern.


66-66: LGTM: Duration parsing calls updated correctly.

All isodate.MustParse calls have been consistently updated to datetime.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 remaining Period references

All instances of timeutil.RecurrenceInterval across the codebase now use the new ISODuration field, and there are no lingering Period: initializations. The change in grant.go is consistent with the coordinated struct update.

openmeter/productcatalog/plan/service.go (2)

13-13: LGTM: Package import updated systematically.

The import change from isodate to datetime is consistent with the broader package refactor.


156-156: LGTM: Field type migration maintains interface compatibility.

The change from *isodate.Period to *datetime.ISODuration correctly updates the BillingCadence field type. Since datetime.ISODuration embeds period.Period, existing method calls like .String() in the Equal method (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.String to datetime.ISODurationString for 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 isodate to datetime aligns with the broader package migration.


23-23: LGTM: Correct adaptation to new RecurrenceInterval structure.

The changes properly adapt to the new timeutil.RecurrenceInterval structure that now embeds datetime.ISODuration instead of isodate.Period. The use of datetime.NewPeriod and the ISODuration field 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 isodate to datetime is consistent with the broader migration.


33-33: LGTM: MustParse calls correctly migrated.

All isodate.MustParse(t, "P1M") calls have been consistently updated to datetime.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 isodate to datetime is consistent with the migration.


113-113: LGTM: Duration parsing calls correctly migrated.

The parsing calls have been consistently updated:

  • isodate.Stringdatetime.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 isodate to datetime is 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.Stringdatetime.ISODurationString with 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 isodate to datetime package.


660-660: LGTM: Method calls consistently updated.

The isodate.Between calls have been correctly updated to datetime.Between maintaining 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 isodate to datetime package.


39-40: LGTM: Field types consistently updated.

The DraftPeriod and DueAfter fields have been correctly updated from isodate.Period to datetime.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 isodate to datetime package.


82-83: LGTM: Method calls consistently updated.

The isodate.NewPeriod calls have been correctly updated to datetime.NewPeriod in 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 isodate to datetime package.


18-18: LGTM: Duration string parsing consistently updated.

The isodate.String(...).Parse() calls have been correctly updated to datetime.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 isodate to datetime package.


908-910: LGTM: Method signature consistently updated.

The return type of GetBillingCadence() has been correctly updated from *isodate.Period to *datetime.ISODuration in the test helper, maintaining interface compatibility while using the new package types.

openmeter/credit/connector.go (1)

38-52: Confirm datetime.ISODuration still exposes Negate() and AddTo()

getSnapshotBefore relies on SnapshotGracePeriod.Negate().AddTo(at).
If either of those methods is not implemented (or their signatures changed) in the new datetime.ISODuration wrapper, this will be a compilation failure that CI will only catch late.

t, _ := c.SnapshotGracePeriod.Negate().AddTo(at)

Please double-check the pkg/datetime implementation (or run go 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) // hypothetical
openmeter/productcatalog/ratecard_test.go (1)

12-15: Good migration ‑ value vs pointer semantics kept intact

Flat-fee tests now pass *ISODuration (lo.ToPtr(datetime.MustParse(...))) while usage-based tests pass the value (datetime.MustParse(...)).
This aligns with the production structs (*Period vs Period). Nicely done.

Also applies to: 52-55, 98-101, 218-222

openmeter/productcatalog/subscription/plan.go (3)

12-12: LGTM: Import updated correctly

The import has been properly updated from isodate to datetime package.


82-82: LGTM: Type initialization updated correctly

The initialization of startAfter now uses datetime.ISODuration{} which is the correct replacement for the previous isodate.Period type.


102-102: LGTM: Field type updated correctly

The StartAfter field type has been properly changed from isodate.Period to datetime.ISODuration.

openmeter/productcatalog/phase.go (3)

8-8: LGTM: Import updated correctly

The import has been properly updated to use the datetime package.


31-31: LGTM: Field type updated correctly

The Duration field type has been properly changed from *isodate.Period to *datetime.ISODuration.


77-77: LGTM: Method call updated correctly

The method call has been properly updated from isodate.NewPeriod to datetime.NewPeriod with the same parameters.

openmeter/ent/db/subscription.go (3)

18-18: LGTM: Import updated correctly

The import has been properly updated to use the datetime package.


53-53: LGTM: Field type updated correctly

The BillingCadence field type has been properly changed from isodate.String to datetime.ISODurationString.


261-261: LGTM: Assignment logic updated correctly

The assignment correctly converts the string value to datetime.ISODurationString type, maintaining the same functionality as the previous implementation.

openmeter/ent/db/grant.go (3)

16-16: LGTM: Import updated correctly

The import has been properly updated to use the datetime package.


53-53: LGTM: Field type updated correctly

The RecurrencePeriod field type has been properly changed from *isodate.String to *datetime.ISODurationString.


212-213: LGTM: Assignment logic updated correctly

The assignment logic correctly allocates a new pointer and converts the string value to datetime.ISODurationString type, maintaining proper pointer handling.

openmeter/ent/db/planratecard.go (3)

17-17: LGTM: Import updated correctly

The import has been properly updated to use the datetime package.


50-50: LGTM: Field type updated correctly

The BillingCadence field type has been properly changed from *isodate.String to *datetime.ISODurationString.


219-220: LGTM: Assignment logic updated correctly

The assignment logic correctly allocates a new pointer and converts the string value to datetime.ISODurationString type, 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 isodate to datetime package is correctly implemented. The type change from *isodate.String to *datetime.ISODurationString maintains the same semantics and the assignValues method 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.String to datetime.ISODurationString is correctly implemented for the UsagePeriodInterval field, 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.Period to datetime.ISODuration for the diff variable 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.NewPeriod to datetime.NewPeriod
  • Property access from rec.Interval.Period.Subtract to rec.Interval.ISODuration.Subtract

The 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.String to datetime.ISODurationString for the billing_cadence and duration fields 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 for datetime.ISODurationString Migration

pkg/datetime/date.go defines
type ISODurationString period.ISOString
preserving the original string-based serialization.
– No remaining imports of github.com/openmeterio/openmeter/pkg/isodate.
– No references to isodate.String or isodate.Period found 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 isodate to datetime aligns with the codebase-wide refactoring.


49-49: Field type correctly updated for the new duration package.

The change from isodate.String("") to datetime.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 isodate to datetime aligns with the codebase-wide refactoring.


209-209: Validation logic correctly updated for the new duration package.

The change from isodate.NewPeriod(...) to datetime.NewPeriod(...) and from Interval.Period.Subtract to Interval.ISODuration.Subtract maintains 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 isodate to datetime aligns with the codebase-wide refactoring.


12-12: Function signature correctly updated for the new duration package.

The parameter types changed from isodate.Period to datetime.ISODuration while 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 isodate to datetime aligns with the codebase-wide refactoring.


69-69: Struct field types correctly updated for the new duration package.

The field types changed from *isodate.Period to *datetime.ISODuration for Interval, DraftPeriod, and DueAfter fields 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 isodate to datetime aligns with the codebase-wide refactoring.


81-88: Duration parsing correctly updated for StartAfter field.

The variable type changed from isodate.Period to datetime.ISODuration and parsing updated from isodate.String to datetime.ISODurationString while maintaining the same error handling pattern.


90-100: Duration parsing correctly updated for phase Duration field.

The variable type changed from *isodate.Period to *datetime.ISODuration and parsing updated from isodate.String to datetime.ISODurationString while preserving the same optional field handling.


148-152: Duration parsing correctly updated for ExtendBy field.

The parsing changed from isodate.String to datetime.ISODurationString while maintaining the same error handling pattern for phase stretching operations.


472-475: Duration parsing correctly updated for BillingCadence field.

The parsing changed from isodate.String to datetime.ISODurationString while maintaining the same error handling pattern for custom plan creation.

openmeter/subscription/patch/stretchphase.go (1)

7-7: LGTM: Consistent package migration

The changes consistently migrate from isodate to datetime package throughout the file. The type changes (isodate.Perioddatetime.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 migration

The migration from isodate.String to datetime.ISODurationString is 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 assignment

The changes consistently update field types from isodate.String to datetime.ISODurationString and properly update the assignValues method 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 migration

The changes properly update the slice type from []isodate.String to []datetime.ISODurationString and 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 migration

The parseDurationPtr function is properly updated to use datetime.ISODuration and datetime.ISODurationString types. 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: All isodate references removed; migration verified

A project-wide search found no remaining imports or type usages of the old isodate package. The migration to datetime is complete—ready to merge.

openmeter/ent/db/entitlement_create.go (2)

21-21: LGTM: Clean package import update.

The import change from isodate to datetime is consistent with the codebase-wide package rename.


215-226: LGTM: Method parameter types updated consistently.

The type changes from isodate.String to datetime.ISODurationString for both SetUsagePeriodInterval and SetNillableUsagePeriodInterval are 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 isodate to datetime aligns with the codebase-wide package migration.


272-272: LGTM: Field type updated appropriately.

The UsagePeriod field type change from isodate.Period to datetime.ISODuration maintains the same functionality for representing ISO8601 duration intervals.


341-341: LGTM: Method call updated consistently.

The change from isodate.NewPeriod to datetime.NewPeriod maintains 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 isodate to datetime is 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.String to *datetime.ISODurationString, maintaining the same nullable duration string semantics.


176-199: LGTM: Value assignment logic updated consistently.

The assignValues method correctly updates the type instantiation from isodate.String to datetime.ISODurationString for 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 isodate to datetime is consistent with the codebase migration.


14-14: LGTM: Configuration field type updated.

The GracePeriod field type change from isodate.String to datetime.ISODurationString maintains the same ISO duration string configuration semantics.


32-39: LGTM: Method return type and implementation updated consistently.

The GetGracePeriod method is properly updated:

  • Return type changed from isodate.Period to datetime.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 isodate package to the datetime package as part of the package migration.


409-409: LGTM: Consistent type substitution for ISO duration parsing.

The changes correctly replace isodate.String with datetime.ISODurationString while 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.ISODuration instead of isodate.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 datetime package 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.ISODurationString and returns the parsed duration in the ISODuration field instead of the deprecated Period field.


373-379: LGTM: Predefined recurrence interval comparisons updated.

The field access correctly changes from .Period to .ISODuration to 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 datetime package as part of the migration.


50-52: LGTM: Struct field types updated consistently.

The generated struct fields correctly use *datetime.ISODurationString instead of the previous isodate types, maintaining consistency with the package migration.

Also applies to: 64-64


256-257: LGTM: Type casting in assignValues method correctly updated.

The generated assignValues method properly handles the type conversion from sql.NullString to datetime.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 datetime package as part of the comprehensive package refactor.


29-29: LGTM: Non-pointer duration fields updated correctly.

The BillingCadence and StartAfter fields correctly use datetime.ISODuration (non-pointer) instead of isodate.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 datetime package as part of the package refactor.


21-22: LGTM: Duration field types updated consistently.

The ActiveFromOverrideRelativeToPhaseStart and ActiveToOverrideRelativeToPhaseStart fields correctly use *datetime.ISODuration instead of *isodate.Period in 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.String with datetime.ISODurationString for 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 in pkg/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.String to datetime.ISODurationString for 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.String to datetime.ISODurationString/*datetime.ISODurationString in the SetBillingCadence and SetNillableBillingCadence methods 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 isodate to datetime package 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 isodate to datetime package is consistent with the broader refactor.


142-142: Consistent type migration for duration handling.

All duration-related method signatures have been systematically updated:

  • SetDuration methods: isodate.Stringdatetime.ISODurationString
  • SetNillableDuration methods: *isodate.String*datetime.ISODurationString

The changes maintain consistency between value and pointer types across both PlanPhaseUpdate and PlanPhaseUpdateOne builders.

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 isodate to datetime package follows the established pattern.


152-152: Comprehensive type migration for billing cadence handling.

All billing cadence-related method signatures have been consistently updated:

  • SetBillingCadence methods: isodate.Stringdatetime.ISODurationString
  • SetNillableBillingCadence methods: *isodate.String*datetime.ISODurationString

The migration is complete across both PlanRateCardUpdate and PlanRateCardUpdateOne builders, 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 datetime

I ran a global search and found no remaining github.com/openmeterio/openmeter/pkg/isodate imports or isodate.String/isodate.Period usages. All generated update methods, including openmeter/ent/db/subscription_update.go:22, now consistently use datetime.ISODurationString. LGTM.

openmeter/ent/db/subscription_create.go (1)

24-24: Confirmed consistency across subscription creation and related operations

All isodate.String references have been replaced with datetime.ISODurationString in openmeter/ent/db/subscription_create.go (and corresponding upsert, bulk, update, and item-create files). A full scan shows no remaining isodate.String usages, 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 isodate to datetime is consistent with the PR objectives.


40-40: LGTM: Interface method return type updated correctly.

The GetBillingCadence() method return type correctly migrates from *isodate.Period to *datetime.ISODuration.


242-242: LGTM: FlatFeeRateCard billing cadence field and getter correctly updated.

The field type change from *isodate.Period to *datetime.ISODuration correctly maintains the pointer semantics for FlatFeeRateCard, 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 replace isodate.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.Period to datetime.ISODuration correctly maintains the non-pointer semantics for UsageBasedRateCard.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.ISODuration and datetime.ISODuration respectively, 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.String to datetime.ISODurationString is 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 isodate to datetime is consistent with the package migration.


48-49: LGTM: Test mock struct fields updated correctly.

The field types are correctly changed from *isodate.Period to *datetime.ISODuration to 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.Period to datetime.ISODuration, and function calls are updated from isodate.MustParse to datetime.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.ISODuration type 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 isodate to datetime is correctly applied to the generated code.


130-130: LGTM: Generated setter methods updated correctly.

The parameter types for SetBillingCadence and SetNillableBillingCadence methods are correctly changed from isodate.String to datetime.ISODurationString in 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 isodate package to the datetime package, aligning with the refactoring objectives.


122-133: LGTM: Duration field methods updated consistently.

Both SetDuration and SetNillableDuration methods have been correctly updated to use datetime.ISODurationString instead of isodate.String. The pointer semantics are maintained appropriately.


529-532: LGTM: Upsert method signature updated correctly.

The SetDuration method in PlanPhaseUpsert has been properly updated to use the new datetime.ISODurationString type.


730-734: LGTM: UpsertOne method signature updated correctly.

The SetDuration method in PlanPhaseUpsertOne has been properly updated to use the new datetime.ISODurationString type.


1101-1105: LGTM: UpsertBulk method signature updated correctly.

The SetDuration method in PlanPhaseUpsertBulk has been properly updated to use the new datetime.ISODurationString type, 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 isodate package to the datetime package, consistent with the refactoring across the codebase.


143-154: LGTM: BillingCadence field methods updated consistently.

Both SetBillingCadence and SetNillableBillingCadence methods have been correctly updated to use datetime.ISODurationString instead of isodate.String. The pointer semantics are maintained appropriately for the nullable field.


675-678: LGTM: Upsert method signature updated correctly.

The SetBillingCadence method in AddonRateCardUpsert has been properly updated to use the new datetime.ISODurationString type.


973-977: LGTM: UpsertOne method signature updated correctly.

The SetBillingCadence method in AddonRateCardUpsertOne has been properly updated to use the new datetime.ISODurationString type.


1455-1459: LGTM: UpsertBulk method signature updated correctly.

The SetBillingCadence method in AddonRateCardUpsertBulk has been properly updated to use the new datetime.ISODurationString type, completing the consistent migration across all builder types.

openmeter/ent/db/planratecard_create.go (1)

19-20: No residual Go pkg/isodate imports 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/isodate module

No further action required.

openmeter/billing/worker/subscription/sync_test.go (1)

4336-4343: Helper GetISODuration Returns a Value

Verified in openmeter/testutils/time.go (line 19) that:

func GetISODuration(t *testing.T, durationString string) datetime.ISODuration

It 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 refactor

The import change from isodate to datetime package is consistent with the broader refactor objective.


132-132: LGTM: Predicate functions consistently updated

All BillingCadence-related predicate functions have been correctly updated to use datetime.ISODurationString instead of isodate.String. The underlying logic remains unchanged since both types convert to string using the same string(v) conversion.

Also applies to: 837-918

openmeter/ent/db/billingcustomeroverride_update.go (3)

19-19: LGTM: Import updated correctly for package refactor

The import change from isodate to datetime package aligns with the refactor objective.


102-102: LGTM: Update builder methods consistently updated

All setter methods for duration fields (line_collection_period, invoice_draft_period, invoice_due_after) have been correctly updated to use datetime.ISODurationString instead of isodate.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 updated

The 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 refactor

The import change from isodate to datetime package is consistent with the refactor objective.


115-115: LGTM: Plan billing cadence predicates consistently updated

All 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 use datetime.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 isodate to datetime aligns with the PR objective of refactoring package names.


140-143: LGTM: Predicate function parameter types updated consistently.

All UsagePeriodInterval predicate functions have been updated to use datetime.ISODurationString instead of isodate.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 isodate to datetime aligns 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.ISODurationString parameters. 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 isodate to datetime package 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.ISODurationString type. 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 datetime package, 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.ISODurationString type. 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.ISODurationString is now an alias of period.ISOString (i.e. a bare string).
If the old isodate.String type used custom MarshalJSON/UnmarshalJSON or
TextMarshaler implementations, that behaviour will silently disappear here,
which can break API contracts and GraphQL schema expectations.

Please confirm that either
a) the alias type in pkg/datetime re-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 & validators

The three setters currently accept a plain
datetime.ISODurationString, but the underlying field is stored as a
pointer (&value) in createSpec().
That mirrors the previous behaviour, so the change is OK.

Two follow-ups to avoid regressions:

  1. Run go vet ./... and grep for old Set…Period(isodate.String) usages.
  2. 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 to pkg/datetime – confirm transitive dependency removal

Looks good, but ensure all go.mod/go.sum references to the old
pkg/isodate (or the upstream isodate module) are removed to prevent
“unused replace” lints in CI.


226-238: Billing cadence change – make sure business rules still validate

BillingCadence switched 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 to datetime.ISODurationString – LGTM

All 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 – LGTM

The 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 – LGTM

Bulk helpers follow the same pattern; no behavioural change beyond the type alias.


20-21: Import switch confirmed—no remaining isodate references

Ran a repository-wide search for isodate.String and isodate.Period and found zero occurrences. The migration to datetime is complete.

openmeter/ent/db/setorclear.go (3)

184-196: BillingCadence type migration looks correct

The new signature cleanly wraps the nil-vs-value logic and forwards the dereferenced
datetime.ISODurationString to the generated setter. No other concerns here.


2942-2954: Subscription-item cadence refactor LGTM

The cadence parameter was successfully migrated to datetime.ISODurationString; semantics of nil-to-clear vs value-to-set remain intact.


2466-2478: ✅ Confirmed: plan_phase.duration is Optional and Nillable

  • The duration field is declared with .Optional().Nillable() in
    openmeter/ent/schema/productcatalog.go (lines 100–103), so ClearDuration() 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 isodate package to the datetime package, 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 use datetime.ISODurationString instead of isodate.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 isodate to datetime.


91-111: Duration field predicates updated with correct new types.

The basic predicate functions for LineCollectionPeriod, InvoiceDraftPeriod, and InvoiceDueAfter have been properly updated to use datetime.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 – remember go mod tidy

Swapping isodate for datetime is mechanically fine here, but don’t forget to run go mod tidy (or go mod download) so that the new dependency is reflected in go.mod/go.sum and stale imports are removed.


682-734: Generated duplication – no action required

Large blocks were regenerated only to replace the parameter type.
The duplication/no-op casts are an artefact of ent code-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 isodate to datetime to 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.ISODurationString with 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 nullability

Please confirm that the Old* methods in BillingWorkflowConfigMutation match 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 BillingWorkflowConfig the fields line_collection_period, invoice_draft_period and invoice_due_after are defined as non-nullable (so Old* returns a non-pointer datetime.ISODurationString), and that in BillingCustomerOverride those fields are nullable (so Old* returns *datetime.ISODurationString). Adjust the mutation method signatures if the schema’s nullability differs.

@GAlexIHU GAlexIHU merged commit 9e4f39b into main Jul 7, 2025
34 of 35 checks passed
@GAlexIHU GAlexIHU deleted the galexi/datetime-pkg branch July 7, 2025 13:18
@coderabbitai coderabbitai bot mentioned this pull request Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/ignore Ignore this change when generating release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants