@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 +1 -1
- package/types/admin/contractProvider/index.d.ts +1 -0
- package/types/contractProviderGroup.d.ts +1 -0
- package/types/dashboardBanner.d.ts +0 -5
- package/types/index.d.ts +1 -0
- package/types/index.ts +1 -0
- package/types/priceSign.d.ts +168 -0
- package/types/responseErrors/index.d.ts +2 -0
- package/types/responseErrors/priceSignResponseErrors.d.ts +6 -0
package/package.json
CHANGED
|
@@ -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
package/types/index.ts
CHANGED
|
@@ -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
|