@thejob/schema 2.1.9 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CLAUDE.md CHANGED
@@ -76,6 +76,23 @@ keys, its `.default()`, and that union.
76
76
 
77
77
  Full picture: `thejob-notification-service/NOTIFICATIONS.md`.
78
78
 
79
+ ## Billing money is in MINOR units
80
+
81
+ `src/billing/` is the one module where an amount is **not** what the rest of this
82
+ package means by an amount. Salary fields (`salaryRange.min`, `minSalary`) are
83
+ bare integers in the currency's **major** unit. Paddle works in **minor** units,
84
+ so `MoneySchema.amountMinor` is cents: `999` is $9.99.
85
+
86
+ The field is named `amountMinor` rather than `amount` precisely so it cannot be
87
+ copied next to a `currency` field and read like the salary pair. Do not "tidy" it
88
+ to `amount`, and do not convert on ingest — we store what Paddle sent.
89
+
90
+ Two other things in that module are deliberate: Paddle status enums keep their
91
+ underscores (`past_due`) because those are wire values compared as literals, and
92
+ `FeatureKey` is informational only. Never constrain a stored field with
93
+ `.oneOf(SupportedFeatureKeys)` — feature keys are data owned by billing-service,
94
+ and validating them here would make every new paywall a release of this package.
95
+
79
96
  ## Conventions
80
97
 
81
98
  - One module per domain (`user/`, `job/`, `group/`, …), each exporting its schema and