@vindentech/api-client 2.0.0-next.3 → 2.0.0-next.5

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.
@@ -17,7 +17,7 @@ export type analyticsControllerOverviewV1ResponseSuccess = (analyticsControllerO
17
17
  export type analyticsControllerOverviewV1Response = (analyticsControllerOverviewV1ResponseSuccess);
18
18
  export declare const getAnalyticsControllerOverviewV1Url: (params?: AnalyticsControllerOverviewV1Params) => string;
19
19
  /**
20
- * Point-in-time figures (`pointInTime`) are read at `asOf`, at the end of the month before, and on the same day a month earlier (clamped: 31 Oct → 30 Sep). Figures that add up over a period (`periods`) are read month-to-date, over the same days of last month, over the last full month and over the month before. Every month is a calendar month in the tenant's billing calendar, and money is per currency, never summed across currencies. Measured volume reads low until a provider-run warehouse reports its measurements, which is why estimated volume is given beside it. Figures for a past night are as known now: the nightly build fills in nights it missed. `averagePricePerM3Trend` prices each of the twelve service months before asOf's once it is fully invoiced and flags the rest, never estimating them. `estimatedInvoicesThisMonth` is an estimate from live billing rows. 400 as_of_not_built for an asOf after the latest night built; 400 invalid_date for a day that does not exist or falls outside 2000–2999. 503 analytics_busy when this replica is already serving its share of analytics requests, and 503 analytics_timeout when a figure takes too long to compute; both are retryable. 🔒 Requires permission: analytics:read. Gate UI with hasRequiredPermissions() from @vindentech/api-client.
20
+ * Point-in-time figures (`pointInTime`) are read at `asOf`, at the end of the month before, and on the same day a month earlier (clamped: 31 Oct → 30 Sep). Figures that add up over a period (`periods`) are read month-to-date, over the same days of last month, over the last full month and over the month before. Every month is a calendar month in the tenant's billing calendar, and money is per currency, never summed across currencies. Measured volume reads low until a provider-run warehouse reports its measurements, which is why estimated volume is given beside it. Figures for a past night are as known now: the nightly build fills in nights it missed. `averagePricePerM3Trend` prices each of the twelve service months before asOf's once it is fully invoiced and flags the rest, never estimating them. `estimatedInvoicesThisMonth` is an estimate from live billing rows. Article names are in `locale` where the article has a name in it, else its default name; categories are codes for the client to label. 400 as_of_not_built for an asOf after the latest night built; 400 invalid_date for a day that does not exist or falls outside 2000–2999; 400 for an unsupported `locale`. 503 analytics_busy when this replica is already serving its share of analytics requests, and 503 analytics_timeout when a figure takes too long to compute; both are retryable. 🔒 Requires permission: analytics:read. Gate UI with hasRequiredPermissions() from @vindentech/api-client.
21
21
  * @summary Every dashboard figure, each with its two comparisons
22
22
  */
23
23
  export declare const analyticsControllerOverviewV1: (params?: AnalyticsControllerOverviewV1Params, options?: Parameters<typeof customFetch>[1]) => Promise<analyticsControllerOverviewV1Response>;
@@ -11,7 +11,7 @@ export const getAnalyticsControllerOverviewV1Url = (params) => {
11
11
  return stringifiedParams.length > 0 ? `/v1/analytics/overview?${stringifiedParams}` : `/v1/analytics/overview`;
12
12
  };
13
13
  /**
14
- * Point-in-time figures (`pointInTime`) are read at `asOf`, at the end of the month before, and on the same day a month earlier (clamped: 31 Oct → 30 Sep). Figures that add up over a period (`periods`) are read month-to-date, over the same days of last month, over the last full month and over the month before. Every month is a calendar month in the tenant's billing calendar, and money is per currency, never summed across currencies. Measured volume reads low until a provider-run warehouse reports its measurements, which is why estimated volume is given beside it. Figures for a past night are as known now: the nightly build fills in nights it missed. `averagePricePerM3Trend` prices each of the twelve service months before asOf's once it is fully invoiced and flags the rest, never estimating them. `estimatedInvoicesThisMonth` is an estimate from live billing rows. 400 as_of_not_built for an asOf after the latest night built; 400 invalid_date for a day that does not exist or falls outside 2000–2999. 503 analytics_busy when this replica is already serving its share of analytics requests, and 503 analytics_timeout when a figure takes too long to compute; both are retryable. 🔒 Requires permission: analytics:read. Gate UI with hasRequiredPermissions() from @vindentech/api-client.
14
+ * Point-in-time figures (`pointInTime`) are read at `asOf`, at the end of the month before, and on the same day a month earlier (clamped: 31 Oct → 30 Sep). Figures that add up over a period (`periods`) are read month-to-date, over the same days of last month, over the last full month and over the month before. Every month is a calendar month in the tenant's billing calendar, and money is per currency, never summed across currencies. Measured volume reads low until a provider-run warehouse reports its measurements, which is why estimated volume is given beside it. Figures for a past night are as known now: the nightly build fills in nights it missed. `averagePricePerM3Trend` prices each of the twelve service months before asOf's once it is fully invoiced and flags the rest, never estimating them. `estimatedInvoicesThisMonth` is an estimate from live billing rows. Article names are in `locale` where the article has a name in it, else its default name; categories are codes for the client to label. 400 as_of_not_built for an asOf after the latest night built; 400 invalid_date for a day that does not exist or falls outside 2000–2999; 400 for an unsupported `locale`. 503 analytics_busy when this replica is already serving its share of analytics requests, and 503 analytics_timeout when a figure takes too long to compute; both are retryable. 🔒 Requires permission: analytics:read. Gate UI with hasRequiredPermissions() from @vindentech/api-client.
15
15
  * @summary Every dashboard figure, each with its two comparisons
16
16
  */
17
17
  export const analyticsControllerOverviewV1 = async (params, options) => {
@@ -8630,6 +8630,8 @@ export interface InvoiceRowDto {
8630
8630
  descriptionOverride: string | null;
8631
8631
  /** The line the customer sees for this row on the invoice: descriptionOverride when set, otherwise the article name followed by freeText, in the invoice's language. Show this rather than rebuilding it. */
8632
8632
  description: string;
8633
+ /** Whether the copy of the invoice the customer receives (the Stripe or the Fortnox invoice) carries this row. False only for a row priced at nothing on an article with hideOnInvoiceWhenZero on, and never for every row of an invoice. Read from the article now, so it says what a push now would send: an invoice already pushed keeps the lines it was sent with. Every row stays on the invoice and counts towards its totals; a client showing the customer's invoice leaves out rows where this is false. */
8634
+ shownToCustomer: boolean;
8633
8635
  /** Coupon benefits that reduced this row. Empty when none did. */
8634
8636
  appliedCoupons: AppliedCouponSummaryDto[];
8635
8637
  /** What kind of row this is: charge = an ordinary charge; carried = a correction of an earlier month; clawback = a campaign benefit charged back; manual = a row staff added by hand, billed as entered. A credit note row has the kind of the row it credits. */
@@ -8879,6 +8881,8 @@ export interface ArticleDto {
8879
8881
  vatInclusiveDefault: boolean;
8880
8882
  rutEligible: boolean;
8881
8883
  isActive: boolean;
8884
+ /** Leave this article's rows off the customer's copy of an invoice (the Stripe or the Fortnox invoice) when they were priced at nothing: zero in both amounts, not reduced by a campaign, a code or a discount rule, not added or reworded by staff, carrying no labour hours, and with another line of the invoice still printed. The invoice itself keeps every row, so totals do not change, and its rows say which ones the customer gets (`shownToCustomer`). Read when an invoice is pushed: a change reaches every invoice not yet pushed, and one already pushed keeps its lines. */
8885
+ hideOnInvoiceWhenZero: boolean;
8882
8886
  createdAt: string;
8883
8887
  updatedAt: string;
8884
8888
  }
@@ -8913,6 +8917,8 @@ export interface CreateArticleDto {
8913
8917
  vatInclusiveDefault?: boolean;
8914
8918
  rutEligible?: boolean;
8915
8919
  isActive?: boolean;
8920
+ /** Leave this article's rows off the customer's copy of an invoice (the Stripe or the Fortnox invoice) when they were priced at nothing: zero in both amounts, not reduced by a campaign, a code or a discount rule, not added or reworded by staff, carrying no labour hours, and with another line of the invoice still printed. The invoice itself keeps every row, so totals do not change, and its rows say which ones the customer gets (`shownToCustomer`). Read when an invoice is pushed: a change reaches every invoice not yet pushed, and one already pushed keeps its lines. Omitted stores false. */
8921
+ hideOnInvoiceWhenZero?: boolean;
8916
8922
  /** Default VAT rate, a percentage (numeric column → string): 25.0000 for 25 %, 25.5000 for 25.5 %. Invoice rows priced on this article take their VAT from it. */
8917
8923
  vatRateDefault: string;
8918
8924
  }
@@ -8932,6 +8938,8 @@ export interface UpdateArticleDto {
8932
8938
  vatInclusiveDefault?: boolean;
8933
8939
  rutEligible?: boolean;
8934
8940
  isActive?: boolean;
8941
+ /** Leave this article's rows off the customer's copy of an invoice (the Stripe or the Fortnox invoice) when they were priced at nothing: zero in both amounts, not reduced by a campaign, a code or a discount rule, not added or reworded by staff, carrying no labour hours, and with another line of the invoice still printed. The invoice itself keeps every row, so totals do not change, and its rows say which ones the customer gets (`shownToCustomer`). Read when an invoice is pushed: a change reaches every invoice not yet pushed, and one already pushed keeps its lines. Omitted leaves it as it is. */
8942
+ hideOnInvoiceWhenZero?: boolean;
8935
8943
  /** Default VAT rate (numeric column → string, e.g. 25.0000). */
8936
8944
  vatRateDefault?: string;
8937
8945
  }
@@ -13717,6 +13725,28 @@ export interface AnalyticsVolumePerCustomerDto {
13717
13725
  /** @nullable */
13718
13726
  estimatedM3: number | null;
13719
13727
  }
13728
+ export interface AnalyticsVolumeBucketDto {
13729
+ /** Customers in the bucket. */
13730
+ count: number;
13731
+ /**
13732
+ * Average over the bucket's customers of the measured m³ each held over their stored nights. Null for an empty bucket.
13733
+ * @nullable
13734
+ */
13735
+ measuredM3: number | null;
13736
+ /**
13737
+ * The same, estimated. A stay's estimate is its average over the nights that carry one, as the stays dataset reports it; a stay with none counts at its measured average. Null for an empty bucket, or when no stay of its customers carries an estimate.
13738
+ * @nullable
13739
+ */
13740
+ estimatedM3: number | null;
13741
+ }
13742
+ export interface AnalyticsVolumeByStatusDto {
13743
+ /** Latest stay stored on the night. */
13744
+ active: AnalyticsVolumeBucketDto;
13745
+ /** Latest stay ended: empty for `stayGapNights` consecutive nights. */
13746
+ ended: AnalyticsVolumeBucketDto;
13747
+ /** Every customer who has stored, including those between stays, who are in neither bucket above. */
13748
+ all: AnalyticsVolumeBucketDto;
13749
+ }
13720
13750
  export interface AnalyticsNightsBucketDto {
13721
13751
  /** Stays, or customers, in the bucket. */
13722
13752
  count: number;
@@ -13758,12 +13788,17 @@ export interface AnalyticsLifetimeValueDto {
13758
13788
  */
13759
13789
  currencyCode: string | null;
13760
13790
  /**
13761
- * Average invoiced revenue ex VAT, minor units, of the customers whose latest stay has ended.
13791
+ * Average invoiced revenue ex VAT, minor units, of the customers whose latest stay is stored on the night.
13792
+ * @nullable
13793
+ */
13794
+ activeCustomersMinor: number | null;
13795
+ /**
13796
+ * The same over the customers whose latest stay has ended.
13762
13797
  * @nullable
13763
13798
  */
13764
13799
  endedCustomersMinor: number | null;
13765
13800
  /**
13766
- * The same over every customer who has stored.
13801
+ * The same over every customer who has stored, including those between stays.
13767
13802
  * @nullable
13768
13803
  */
13769
13804
  storingCustomersMinor: number | null;
@@ -13775,6 +13810,8 @@ export interface AnalyticsPointInTimeDto {
13775
13810
  activeCustomers: number;
13776
13811
  storedVolume: AnalyticsStoredVolumeDto;
13777
13812
  averageVolumePerActiveCustomer: AnalyticsVolumePerCustomerDto;
13813
+ /** Per customer, the average m³ they held over their stored nights across every stay, by the status of their latest stay. An active customer's is their average so far, not the night's volume, which averageVolumePerActiveCustomer gives. */
13814
+ averageVolumeWhileStoring: AnalyticsVolumeByStatusDto;
13778
13815
  /** Customers registered on or before the night, cumulative. */
13779
13816
  registeredCustomers: number;
13780
13817
  /** Customers who had stored by the night, cumulative. */
@@ -13807,7 +13844,10 @@ export interface AnalyticsRevenueArticleDto {
13807
13844
  articleId: string | null;
13808
13845
  /** @nullable */
13809
13846
  code: string | null;
13810
- /** @nullable */
13847
+ /**
13848
+ * The article's name in the requested `locale`, else its default name. Null for a row with no article.
13849
+ * @nullable
13850
+ */
13811
13851
  name: string | null;
13812
13852
  /** @nullable */
13813
13853
  category: string | null;
@@ -15960,6 +16000,16 @@ export type AnalyticsControllerOverviewV1Params = {
15960
16000
  * The night the figures describe (YYYY-MM-DD), in the tenant's billing calendar. Defaults to the latest night the nightly analytics build covers, normally last night. A later night is 400 as_of_not_built.
15961
16001
  */
15962
16002
  asOf?: string;
16003
+ /**
16004
+ * Language of the article names in `byArticle`: the page's language. Each name is the article's name in this locale, or its default name when it has none. Omit it to get every article's default name.
16005
+ */
16006
+ locale?: AnalyticsControllerOverviewV1Locale;
16007
+ };
16008
+ export type AnalyticsControllerOverviewV1Locale = typeof AnalyticsControllerOverviewV1Locale[keyof typeof AnalyticsControllerOverviewV1Locale];
16009
+ export declare const AnalyticsControllerOverviewV1Locale: {
16010
+ readonly 'sv-SE': "sv-SE";
16011
+ readonly 'en-GB': "en-GB";
16012
+ readonly 'fi-FI': "fi-FI";
15963
16013
  };
15964
16014
  export type AnalyticsControllerDailyV1Params = {
15965
16015
  /**