@fragus/sam-types 1.2.15 → 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
|
@@ -3,7 +3,6 @@ export type TContractProviderFlagKey =
|
|
|
3
3
|
| 'ALPINE_EXTENDED_PDF_TITLE'
|
|
4
4
|
| 'FRAGUS_INVOICING'
|
|
5
5
|
| 'INTERNAL_USE'
|
|
6
|
-
| 'PRICE_SIGNS'
|
|
7
6
|
|
|
8
7
|
/** Exactly one of the two ids is sent: a flag row is owned by a provider or by a group. */
|
|
9
8
|
export interface ContractProviderFlagRequest {
|
package/types/priceSign.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ export type TPriceSignMonths = number
|
|
|
4
4
|
|
|
5
5
|
export type TPriceSignFormat = 'pdf' | 'png' | 'jpeg'
|
|
6
6
|
|
|
7
|
-
/** Limits the api enforces on templates and
|
|
7
|
+
/** Limits the api enforces on templates and setups; Superadmin builds its forms from them. */
|
|
8
8
|
export interface IPriceSignLimits {
|
|
9
9
|
minMonths: number
|
|
10
10
|
maxMonths: number
|
|
11
11
|
maxHpTiers: number
|
|
12
12
|
minPeriods: number
|
|
13
13
|
maxPeriods: number
|
|
14
|
-
/** Max periods on a sign
|
|
14
|
+
/** Max periods on a sign with `maxHpTiers` HP tiers. */
|
|
15
15
|
maxPeriodsWithMaxTiers: number
|
|
16
16
|
countries: TIsoCountry[]
|
|
17
17
|
/** Durations offered as one-click picks; any other whole month in range can still be added. */
|
|
@@ -37,14 +37,6 @@ export interface IPriceSignDealerPrice {
|
|
|
37
37
|
hidden: boolean
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
export interface IPriceSignHpIndex {
|
|
41
|
-
hpIndexId: number
|
|
42
|
-
country: TIsoCountry
|
|
43
|
-
name: string
|
|
44
|
-
tiers: number[]
|
|
45
|
-
usedBy?: string[]
|
|
46
|
-
}
|
|
47
|
-
|
|
48
40
|
export interface IPriceSignTemplate {
|
|
49
41
|
templateId: number
|
|
50
42
|
country: TIsoCountry
|
|
@@ -56,7 +48,8 @@ export interface IPriceSignTemplate {
|
|
|
56
48
|
km: string
|
|
57
49
|
deductible: string
|
|
58
50
|
repairLimit: string
|
|
59
|
-
|
|
51
|
+
/** Ascending HP thresholds; each starts a supplement tier. */
|
|
52
|
+
tiers: number[]
|
|
60
53
|
periods: IPriceSignPeriod[]
|
|
61
54
|
intro: string
|
|
62
55
|
coverageIntro: string
|
|
@@ -66,16 +59,6 @@ export interface IPriceSignTemplate {
|
|
|
66
59
|
updatedAt: string
|
|
67
60
|
}
|
|
68
61
|
|
|
69
|
-
export interface IPriceSignCombo {
|
|
70
|
-
comboId: number
|
|
71
|
-
country: TIsoCountry
|
|
72
|
-
templateName: string
|
|
73
|
-
visible: boolean
|
|
74
|
-
pages: [number, number]
|
|
75
|
-
updatedBy: string | null
|
|
76
|
-
updatedAt: string
|
|
77
|
-
}
|
|
78
|
-
|
|
79
62
|
export interface IPriceSignSharedContent {
|
|
80
63
|
country: TIsoCountry
|
|
81
64
|
familyName: string
|
|
@@ -90,38 +73,77 @@ export interface IPriceSignSharedContent {
|
|
|
90
73
|
tierLabel: string
|
|
91
74
|
}
|
|
92
75
|
|
|
93
|
-
export interface
|
|
76
|
+
export interface IPriceSignSetupTemplate {
|
|
94
77
|
templateId: number
|
|
95
|
-
|
|
78
|
+
/** null follows the template's tiers. */
|
|
79
|
+
tiers: number[] | null
|
|
80
|
+
/** Only the periods that differ from the template. */
|
|
96
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
|
|
97
86
|
}
|
|
98
87
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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 {
|
|
102
106
|
templateId: number
|
|
103
|
-
|
|
107
|
+
tiers: number[] | null
|
|
108
|
+
/** Full periods as edited; the api keeps only those that differ from the template. */
|
|
109
|
+
periods: IPriceSignPeriod[]
|
|
104
110
|
}
|
|
105
111
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
|
111
129
|
}
|
|
112
130
|
|
|
113
131
|
export interface IPriceSignDealerPrices {
|
|
114
132
|
templateId: number
|
|
115
|
-
|
|
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
|
|
116
140
|
prices: IPriceSignDealerPrice[]
|
|
117
|
-
updatedAt: string
|
|
118
141
|
}
|
|
119
142
|
|
|
120
143
|
export interface IPriceSignCatalog {
|
|
121
144
|
shared: IPriceSignSharedContent
|
|
122
|
-
|
|
145
|
+
/** Visible templates with the dealer's setup applied. */
|
|
123
146
|
templates: IPriceSignTemplate[]
|
|
124
|
-
combos: IPriceSignCombo[]
|
|
125
147
|
groupName: string | null
|
|
126
148
|
logoUrl: string | null
|
|
127
149
|
logoUsable: boolean
|
|
@@ -129,10 +151,10 @@ export interface IPriceSignCatalog {
|
|
|
129
151
|
}
|
|
130
152
|
|
|
131
153
|
export interface IPriceSignRenderRequest {
|
|
132
|
-
/**
|
|
133
|
-
|
|
134
|
-
comboId?: number
|
|
154
|
+
/** One page per template, in this order. */
|
|
155
|
+
templateIds: number[]
|
|
135
156
|
logo: 'provider' | 'none' | { dataUrl: string }
|
|
157
|
+
/** Aligned with `templateIds`. */
|
|
136
158
|
prices?: IPriceSignDealerPrice[][]
|
|
137
159
|
}
|
|
138
160
|
|
|
@@ -141,6 +163,6 @@ export interface IPriceSignEditorPreviewRequest {
|
|
|
141
163
|
templateId?: number
|
|
142
164
|
}
|
|
143
165
|
shared?: IPriceSignSharedContent
|
|
144
|
-
|
|
166
|
+
setup?: Pick<IPriceSignSetupTemplateRequest, 'tiers' | 'periods'>
|
|
145
167
|
prices?: IPriceSignDealerPrice[]
|
|
146
168
|
}
|