@fragus/sam-types 1.2.17 → 1.2.18

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.17",
2
+ "version": "1.2.18",
3
3
  "name": "@fragus/sam-types",
4
4
  "description": "Typescript interfaces for all types used to communicate between SAM client(s) and the SAM API",
5
5
  "author": "Fragus",
@@ -1,7 +1,5 @@
1
1
  import { TIsoCountry } from './country'
2
2
 
3
- export type TPriceSignMonths = number
4
-
5
3
  export type TPriceSignFormat = 'pdf' | 'png' | 'jpeg'
6
4
 
7
5
  /** Limits the api enforces on templates and setups; Superadmin builds its forms from them. */
@@ -15,11 +13,11 @@ export interface IPriceSignLimits {
15
13
  maxPeriodsWithMaxTiers: number
16
14
  countries: TIsoCountry[]
17
15
  /** Durations offered as one-click picks; any other whole month in range can still be added. */
18
- quickPickMonths: TPriceSignMonths[]
16
+ quickPickMonths: number[]
19
17
  }
20
18
 
21
19
  export interface IPriceSignPeriod {
22
- months: TPriceSignMonths
20
+ months: number
23
21
  suggestedPrice: string
24
22
  suggestedSupplements: string[]
25
23
  excludedTiers: number[]
@@ -31,7 +29,7 @@ export interface IPriceSignBenefit {
31
29
  }
32
30
 
33
31
  export interface IPriceSignDealerPrice {
34
- months: TPriceSignMonths
32
+ months: number
35
33
  price: string
36
34
  supplements: string[]
37
35
  hidden: boolean
@@ -158,10 +156,20 @@ export interface IPriceSignRenderRequest {
158
156
  prices?: IPriceSignDealerPrice[][]
159
157
  }
160
158
 
159
+ /** Body of a template create or update; the api sets the id and the audit fields. */
160
+ export type TPriceSignTemplateRequest = Pick<
161
+ IPriceSignTemplate,
162
+ Exclude<keyof IPriceSignTemplate, 'templateId' | 'updatedBy' | 'updatedAt'>
163
+ >
164
+
165
+ /** Body of a shared content save; the country comes from the url. */
166
+ export type TPriceSignSharedContentRequest = Pick<
167
+ IPriceSignSharedContent,
168
+ Exclude<keyof IPriceSignSharedContent, 'country'>
169
+ >
170
+
161
171
  export interface IPriceSignEditorPreviewRequest {
162
- template: Pick<IPriceSignTemplate, Exclude<keyof IPriceSignTemplate, 'templateId' | 'updatedBy' | 'updatedAt'>> & {
163
- templateId?: number
164
- }
172
+ template: TPriceSignTemplateRequest & { templateId?: number }
165
173
  shared?: IPriceSignSharedContent
166
174
  setup?: Pick<IPriceSignSetupTemplateRequest, 'tiers' | 'periods'>
167
175
  prices?: IPriceSignDealerPrice[]
@@ -1,6 +1,5 @@
1
1
  export type PriceSignResponseErrors =
2
2
  | 'PRICE_SIGN_VALIDATION'
3
- | 'PRICE_SIGN_IN_USE'
4
3
  | 'PRICE_SIGN_FONT_MISSING'
5
4
  | 'PRICE_SIGNS_DK_ONLY'
6
5
  | 'PRICE_SIGN_SETUP_CONFLICT'