@iveri/contracts 0.100.0 → 0.101.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/README.md CHANGED
@@ -267,6 +267,7 @@ Conduit's outbox.
267
267
  `localization:message:manage`, `localization:translate`, `localization:publish` and
268
268
  `localization:render` permissions.
269
269
  - Version `0.100.0` adds `notification:send-any`, the password-reset bodies and Conduit's usage metrics.
270
+ - Version `0.101.0` adds `UsageHistory`, a company's closed months of a product by metric.
270
271
  - Widening a type is minor; narrowing it is major.
271
272
  - Under `api/`, the contract follows the service: add the field to the service's DTO and to the
272
273
  interface in the same release, and let `implements` prove they agree.
@@ -44,6 +44,29 @@ export interface UsageSummary {
44
44
  plan: Nullable<UsagePlan>;
45
45
  metrics: UsageMetricSummary[];
46
46
  }
47
+ /** How much of one metric a company used in one month. */
48
+ export interface UsageMonthMetric {
49
+ metric: string;
50
+ quantity: number;
51
+ }
52
+ /** One closed calendar month in UTC, its end exclusive, with every metric of the product used in it. */
53
+ export interface UsageMonth {
54
+ periodStart: IsoDateTime;
55
+ periodEnd: IsoDateTime;
56
+ /** By metric name. Empty for a month with no usage, which is still listed. */
57
+ metrics: UsageMonthMetric[];
58
+ }
59
+ /**
60
+ * `GET /billing/usage/months?product=&months=` (a company's own) or `?tenantId=&product=&months=` (behind
61
+ * `billing:usage:read-any`): the months before the current one, newest first, `months` of them. **No plan and no
62
+ * limits**: the plan a company was on in a past month is not recorded, and today's would be read as that month's. What
63
+ * it was billed against is on that month's invoice.
64
+ */
65
+ export interface UsageHistory {
66
+ tenantId: UUID;
67
+ product: IveriProduct;
68
+ months: UsageMonth[];
69
+ }
47
70
  /** One line of an invoice, as it was when the invoice was issued. */
48
71
  export interface UsageInvoiceLine {
49
72
  description: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iveri/contracts",
3
- "version": "0.100.0",
3
+ "version": "0.101.0",
4
4
  "description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "repository": {