@fragus/sam-types 1.2.14 → 1.2.16

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.14",
2
+ "version": "1.2.16",
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",
@@ -34,6 +34,7 @@ export interface IContractProviderInfo extends IEssentialContractProviderInfo {
34
34
  isUseV4PTOnlyForSigning: boolean
35
35
  fragusInvoicing?: boolean
36
36
  isInternalUse?: boolean
37
+ hasPriceSigns?: boolean
37
38
  }
38
39
 
39
40
  export interface ICreateTestContractProvider {
@@ -37,6 +37,7 @@ export interface IContractProviderGroupUsage {
37
37
  documentCount: number
38
38
  dashboardBannerCount: number
39
39
  featureFlagCount: number
40
+ priceSignSetupCount: number
40
41
  }
41
42
 
42
43
  export interface IUpsertContractProviderGroupRequest {
@@ -11,10 +11,6 @@ export interface DashboardBannerRequest {
11
11
  */
12
12
  countryIso?: TIsoCountry | null
13
13
  contractProviderGroupId?: number | null
14
- /**
15
- * An https link (a campaign or information page) that Admin shows as a QR code under the text; null for none.
16
- */
17
- qrUrl?: string | null
18
14
  /**
19
15
  * ISO date string (YYYY-MM-DD) for the start date of the banner
20
16
  */
@@ -40,5 +36,4 @@ export interface DashboardBannerResponse extends DashboardBannerRequest {
40
36
  */
41
37
  export interface ProviderDashboardBannerResponse {
42
38
  text: string
43
- qrUrl: string | null
44
39
  }
package/types/index.d.ts CHANGED
@@ -223,3 +223,4 @@ export * from './contractProviderFlags';
223
223
  export * from './fragusInvoicing';
224
224
  export * from './providerDocument';
225
225
  export * from './contractProviderGroup';
226
+ export * from './priceSign';
package/types/index.ts CHANGED
@@ -242,3 +242,4 @@ export * from './contractProviderFlags'
242
242
  export * from './fragusInvoicing'
243
243
  export * from './providerDocument'
244
244
  export * from './contractProviderGroup'
245
+ export * from './priceSign'
@@ -0,0 +1,168 @@
1
+ import { TIsoCountry } from './country'
2
+
3
+ export type TPriceSignMonths = number
4
+
5
+ export type TPriceSignFormat = 'pdf' | 'png' | 'jpeg'
6
+
7
+ /** Limits the api enforces on templates and setups; Superadmin builds its forms from them. */
8
+ export interface IPriceSignLimits {
9
+ minMonths: number
10
+ maxMonths: number
11
+ maxHpTiers: number
12
+ minPeriods: number
13
+ maxPeriods: number
14
+ /** Max periods on a sign with `maxHpTiers` HP tiers. */
15
+ maxPeriodsWithMaxTiers: number
16
+ countries: TIsoCountry[]
17
+ /** Durations offered as one-click picks; any other whole month in range can still be added. */
18
+ quickPickMonths: TPriceSignMonths[]
19
+ }
20
+
21
+ export interface IPriceSignPeriod {
22
+ months: TPriceSignMonths
23
+ suggestedPrice: string
24
+ suggestedSupplements: string[]
25
+ excludedTiers: number[]
26
+ }
27
+
28
+ export interface IPriceSignBenefit {
29
+ title: string
30
+ body: string
31
+ }
32
+
33
+ export interface IPriceSignDealerPrice {
34
+ months: TPriceSignMonths
35
+ price: string
36
+ supplements: string[]
37
+ hidden: boolean
38
+ }
39
+
40
+ export interface IPriceSignTemplate {
41
+ templateId: number
42
+ country: TIsoCountry
43
+ templateName: string
44
+ visible: boolean
45
+ name: string
46
+ nameAccent: string
47
+ years: string
48
+ km: string
49
+ deductible: string
50
+ repairLimit: string
51
+ /** Ascending HP thresholds; each starts a supplement tier. */
52
+ tiers: number[]
53
+ periods: IPriceSignPeriod[]
54
+ intro: string
55
+ coverageIntro: string
56
+ bullets: string[]
57
+ footnote: string
58
+ updatedBy: string | null
59
+ updatedAt: string
60
+ }
61
+
62
+ export interface IPriceSignSharedContent {
63
+ country: TIsoCountry
64
+ familyName: string
65
+ repairLimitLabel: string
66
+ repairLimitNote: string
67
+ benefits: IPriceSignBenefit[]
68
+ coverageHeading: string
69
+ periodsHeading: string
70
+ vatNote: string
71
+ supplementLabel: string
72
+ tierHeading: string
73
+ tierLabel: string
74
+ }
75
+
76
+ export interface IPriceSignSetupTemplate {
77
+ templateId: number
78
+ /** null follows the template's tiers. */
79
+ tiers: number[] | null
80
+ /** Only the periods that differ from the template. */
81
+ periods: IPriceSignPeriod[]
82
+ /** Dealers of this setup with their own prices for this template; a tier change clears them. */
83
+ dealerPriceCount: number
84
+ updatedBy: string | null
85
+ updatedAt: string
86
+ }
87
+
88
+ /** A setup belongs to one provider or one group and grants its members price signs. */
89
+ export interface IPriceSignSetupSummary {
90
+ setupId: number
91
+ contractProviderId: number | null
92
+ providerName: string | null
93
+ contractProviderGroupId: number | null
94
+ groupName: string | null
95
+ groupArchived: boolean
96
+ templateCount: number
97
+ createdBy: string | null
98
+ createdAt: string
99
+ }
100
+
101
+ export interface IPriceSignSetup extends IPriceSignSetupSummary {
102
+ templates: IPriceSignSetupTemplate[]
103
+ }
104
+
105
+ export interface IPriceSignSetupTemplateRequest {
106
+ templateId: number
107
+ tiers: number[] | null
108
+ /** Full periods as edited; the api keeps only those that differ from the template. */
109
+ periods: IPriceSignPeriod[]
110
+ }
111
+
112
+ /** The owner is set on create only: exactly one of the two ids. */
113
+ export interface IPriceSignSetupRequest {
114
+ contractProviderId?: number
115
+ contractProviderGroupId?: number
116
+ templates: IPriceSignSetupTemplateRequest[]
117
+ }
118
+
119
+ export interface IPriceSignSetupCandidates {
120
+ providers: { contractProviderId: number; name: string }[]
121
+ groups: { contractProviderGroupId: number; name: string }[]
122
+ }
123
+
124
+ export interface IPriceSignTemplateUsage {
125
+ groups: number
126
+ providers: number
127
+ /** Dealers with their own prices for this template. */
128
+ dealerPrices: number
129
+ }
130
+
131
+ export interface IPriceSignDealerPrices {
132
+ templateId: number
133
+ /** Effective rows: the dealer's own values over the setup's. */
134
+ prices: IPriceSignDealerPrice[]
135
+ updatedAt: string | null
136
+ }
137
+
138
+ export interface IPriceSignDealerPricesRequest {
139
+ templateId: number
140
+ prices: IPriceSignDealerPrice[]
141
+ }
142
+
143
+ export interface IPriceSignCatalog {
144
+ shared: IPriceSignSharedContent
145
+ /** Visible templates with the dealer's setup applied. */
146
+ templates: IPriceSignTemplate[]
147
+ groupName: string | null
148
+ logoUrl: string | null
149
+ logoUsable: boolean
150
+ downloadAvailable: boolean
151
+ }
152
+
153
+ export interface IPriceSignRenderRequest {
154
+ /** One page per template, in this order. */
155
+ templateIds: number[]
156
+ logo: 'provider' | 'none' | { dataUrl: string }
157
+ /** Aligned with `templateIds`. */
158
+ prices?: IPriceSignDealerPrice[][]
159
+ }
160
+
161
+ export interface IPriceSignEditorPreviewRequest {
162
+ template: Pick<IPriceSignTemplate, Exclude<keyof IPriceSignTemplate, 'templateId' | 'updatedBy' | 'updatedAt'>> & {
163
+ templateId?: number
164
+ }
165
+ shared?: IPriceSignSharedContent
166
+ setup?: Pick<IPriceSignSetupTemplateRequest, 'tiers' | 'periods'>
167
+ prices?: IPriceSignDealerPrice[]
168
+ }
@@ -9,6 +9,7 @@ import { ImportErrors } from './importErrors'
9
9
  import { InvalidProductTypeErrors } from './invalidProductTypeErrors'
10
10
  import { InvoiceErrors } from './invoiceErrors'
11
11
  import { PasswordErrors } from './passwordResponseErrors'
12
+ import { PriceSignResponseErrors } from './priceSignResponseErrors'
12
13
  import { paymentResponseErrors } from './paymentResponseErrors'
13
14
  import { RateLimitErrors } from './rateLimitErrors'
14
15
  import { UserAndCustomerErrors } from './userAndCustomerErrors'
@@ -32,3 +33,4 @@ export type ResponseErrors =
32
33
  | VatLookupResponseErrors
33
34
  | VehcileBlacklistErrors
34
35
  | InvoiceErrors
36
+ | PriceSignResponseErrors
@@ -0,0 +1,6 @@
1
+ export type PriceSignResponseErrors =
2
+ | 'PRICE_SIGN_VALIDATION'
3
+ | 'PRICE_SIGN_IN_USE'
4
+ | 'PRICE_SIGN_FONT_MISSING'
5
+ | 'PRICE_SIGNS_DK_ONLY'
6
+ | 'PRICE_SIGN_SETUP_CONFLICT'