@fragus/sam-types 1.1.10 → 1.2.0
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/README.md +58 -31
- package/package.json +1 -1
- package/types/admin/contract/contractDetails.d.ts +2 -0
- package/types/admin/contractProvider/index.d.ts +5 -0
- package/types/contractProvider.d.ts +23 -0
- package/types/index.d.ts +1 -0
- package/types/index.js.map +1 -1
- package/types/index.ts +1 -0
- package/types/outage.d.ts +0 -66
- package/types/payment.d.ts +1 -1
- package/types/providerInvoice.d.ts +35 -0
- package/types/responseErrors/contractResponseErrors.d.ts +17 -0
- package/types/v4PricingTool/productsAndContracts/index.d.ts +1 -1
- package/types/v4PricingTool/productsAndContracts/index.js.map +1 -1
- package/types/v4PricingTool/productsAndContracts/index.ts +2 -0
package/README.md
CHANGED
|
@@ -1,48 +1,75 @@
|
|
|
1
1
|
# SAM-types
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
SAM types is used to collect and share all interfaces (types) that one or more repositories have in
|
|
4
|
+
common. To facilitate and ensure that repositories use the same types when communicating with each other.
|
|
5
|
+
In most cases, if not all, this is between SAM-api and one or more of the frontend clients like the SAM-admin.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Conventions
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### Request/Response interfaces
|
|
10
|
+
TODO: Fill this out
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
### Versioning
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
"@fragus/sam-types": "1.1.9"
|
|
15
|
-
```
|
|
14
|
+
We use standard [semantic versioning](https://semver.org/)
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
## Development
|
|
17
|
+
### Dependencies
|
|
18
|
+
The project only has one dependency: `Typescript`
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
import { ContractState, INoContractsAvailableErrorParams } from '@fragus/sam-types'
|
|
21
|
-
```
|
|
20
|
+
This is to have `tsc` available.
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
### Compiling
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
- npm
|
|
24
|
+
To compile the `index.d.ts` file and the `index.js` file, run `npm run tsc` (or `yarn tsc`). This cleans all existing `.js` files and updates the `index.d.ts` file and the `index.js` file.
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
### Adding new interfaces, types, and enums
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
npm install
|
|
32
|
-
npm run tsc # npm run tsc-win on Windows without bash
|
|
33
|
-
```
|
|
28
|
+
Write your interface or type like you normally would. In order to export it, you need to add it to the `index.ts` file which holds all exported interfaces, types, and enums. The enums (for now) need to be put directly in the `index.ts` file. To fix this we need to setup some Webpack configuration etc.
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
every push.
|
|
30
|
+
### Local development
|
|
37
31
|
|
|
38
|
-
|
|
32
|
+
### Using npm
|
|
33
|
+
To use the types locally in an application, add the line below as a dependency in your `package.json` file:
|
|
39
34
|
|
|
40
|
-
-
|
|
41
|
-
TypeScript 3.3 limit
|
|
42
|
-
- [Testing in a consumer before release](docs/local-development.md): `file:../SAM-types` and how to undo it
|
|
43
|
-
- [Releasing](docs/releasing.md): versioning, the GitHub release that publishes to npm, and bumping the
|
|
44
|
-
consumers
|
|
35
|
+
`"sam-types": "file:../SAM-types"`
|
|
45
36
|
|
|
46
|
-
|
|
37
|
+
The path is the relative path to the SAM-types project.
|
|
38
|
+
### Using yarn
|
|
39
|
+
To use the types locally you can use `yarn link`. See docs [here](https://yarnpkg.com/lang/en/docs/cli/link/).
|
|
47
40
|
|
|
48
|
-
`
|
|
41
|
+
`cd` to the SAM-types folder and type: `yarn link`
|
|
42
|
+
|
|
43
|
+
Then `cd` to your application and type `yarn link "sam-types"`. Now your application uses your local SAM-types project (using a symlink). To unlink, type `yarn unlink "sam-types"`
|
|
44
|
+
|
|
45
|
+
This means that you do not have to change anything in your `package.json` file.
|
|
46
|
+
|
|
47
|
+
### Regular dependency
|
|
48
|
+
To use SAM-types in a project, add the line below as a dependency in your `package.json` file:
|
|
49
|
+
|
|
50
|
+
`"sam-types": "OmniCar/SAM-types#0.0.1"`
|
|
51
|
+
|
|
52
|
+
If you need to target something other than a specific release, consider targeting a branch or a commit as shown below:
|
|
53
|
+
|
|
54
|
+
* `"sam-types": "OmniCar/SAM-types#4727d357ea"`
|
|
55
|
+
* `"sam-types": "OmniCar/SAM-types#feature\/branch"`
|
|
56
|
+
|
|
57
|
+
## Releasing
|
|
58
|
+
|
|
59
|
+
### Using GitHub
|
|
60
|
+
|
|
61
|
+
* Go to [releases](https://github.com/OmniCar/SAM-types/releases) on GitHub
|
|
62
|
+
* Press "Create a new release"
|
|
63
|
+
* Set the "Tag version" to the appropriate version number (see versioning above)
|
|
64
|
+
* Set the "Release title" to "Version <version_number>"
|
|
65
|
+
* Describe the changes. What's new? are there any breaking changes? etc.
|
|
66
|
+
* If you want you can see the changes on `master` compared to a release (for example version `0.0.1`) by typing: `git diff tags/0.0.1 master`
|
|
67
|
+
* Press "Publish release"
|
|
68
|
+
|
|
69
|
+
### Using [hub cli](https://github.com/github/hub)
|
|
70
|
+
|
|
71
|
+
If you have installed the hub cli (see link above), you can create a new release with the below command. Please note that it defaults to targeting the main (`master`) branch unless you use the `-t` option (more options [here](https://github.com/github/hub/blob/master/commands/release.go))
|
|
72
|
+
|
|
73
|
+
`git release create -o -m "Release 0.0.2" "0.0.2"`
|
|
74
|
+
|
|
75
|
+
If you did not set up the alias for `git = hub` you should write `hub` instead of `git` in the command above.
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IAdminCustomer } from '../../admin/customer/customer'
|
|
1
2
|
import { IApiOtherWithContracts } from '../../admin/product'
|
|
2
3
|
import { IApiVehicleWithContracts } from '../../admin/vehicle'
|
|
3
4
|
import { IsoLocale } from '../../locale'
|
|
@@ -32,6 +33,10 @@ export interface IContractProviderInfo extends IEssentialContractProviderInfo {
|
|
|
32
33
|
inactive: boolean
|
|
33
34
|
isUsingV4PricingTool: boolean
|
|
34
35
|
isUseV4PTOnlyForSigning: boolean
|
|
36
|
+
fragusInvoicing?: boolean
|
|
37
|
+
isInternalUse?: boolean
|
|
38
|
+
/** Set only while internal use is on. */
|
|
39
|
+
fixedCustomer?: IAdminCustomer | null
|
|
35
40
|
}
|
|
36
41
|
|
|
37
42
|
export interface ICreateTestContractProvider {
|
|
@@ -41,6 +41,11 @@ export interface IContractProviderRequest extends IProviderCustomizationResponse
|
|
|
41
41
|
optionsConditions?: string
|
|
42
42
|
fetchWarrantiesFromV4: boolean
|
|
43
43
|
hiddenNetPrice: boolean
|
|
44
|
+
/** Restricts the provider to the Fragus gateways while on. */
|
|
45
|
+
fragusInvoicing?: boolean
|
|
46
|
+
/** New contracts use the provider's one fixed customer while on. */
|
|
47
|
+
isInternalUse?: boolean
|
|
48
|
+
fixedCustomer?: IFixedCustomerData
|
|
44
49
|
v4ProviderId: number | null
|
|
45
50
|
/** Groups the provider joins on create; an update ignores it. */
|
|
46
51
|
contractProviderGroupIds?: number[]
|
|
@@ -93,9 +98,23 @@ export interface IContractProviderResponse extends IProviderCustomizationRespons
|
|
|
93
98
|
created: Date
|
|
94
99
|
updated: Date
|
|
95
100
|
hiddenNetPrice: boolean
|
|
101
|
+
fragusInvoicing?: boolean
|
|
102
|
+
isInternalUse?: boolean
|
|
103
|
+
fixedCustomer?: IFixedCustomerData | null
|
|
96
104
|
v4ProviderId: number | null
|
|
97
105
|
}
|
|
98
106
|
|
|
107
|
+
/** The fixed customer of an internal-use provider; its country is the provider's. */
|
|
108
|
+
export interface IFixedCustomerData {
|
|
109
|
+
name: string
|
|
110
|
+
companyName: string
|
|
111
|
+
cvr: string
|
|
112
|
+
phone: string
|
|
113
|
+
address1: string
|
|
114
|
+
postalCode: string
|
|
115
|
+
city: string
|
|
116
|
+
}
|
|
117
|
+
|
|
99
118
|
export interface IContractProviderListItemResponse {
|
|
100
119
|
administrativeName: string
|
|
101
120
|
contractProviderId: number
|
|
@@ -122,6 +141,7 @@ export type TContractProviderSettingsSection =
|
|
|
122
141
|
| 'conditions'
|
|
123
142
|
| 'customization'
|
|
124
143
|
| 'cvrCode'
|
|
144
|
+
| 'fixedCustomer'
|
|
125
145
|
|
|
126
146
|
export interface IContractProviderSettingsResponse {
|
|
127
147
|
administrativeName: string
|
|
@@ -151,6 +171,8 @@ export interface IContractProviderSettingsResponse {
|
|
|
151
171
|
webLogoBannerUrl: string | null
|
|
152
172
|
}
|
|
153
173
|
hasParent: boolean
|
|
174
|
+
/** Null while the provider is not in internal use. */
|
|
175
|
+
fixedCustomer?: IFixedCustomerData | null
|
|
154
176
|
}
|
|
155
177
|
|
|
156
178
|
export type TContractProviderSettingsSectionValue =
|
|
@@ -160,6 +182,7 @@ export type TContractProviderSettingsSectionValue =
|
|
|
160
182
|
| TProviderConditionsValue
|
|
161
183
|
| TProviderCustomizationValue
|
|
162
184
|
| TProviderCvrCodeValue
|
|
185
|
+
| IFixedCustomerData
|
|
163
186
|
|
|
164
187
|
export type TProviderGeneralInfoValue = Pick<
|
|
165
188
|
IContractProviderSettingsResponse,
|
package/types/index.d.ts
CHANGED
|
@@ -182,6 +182,7 @@ export * from './priceCalculation';
|
|
|
182
182
|
export * from './priceSpecification';
|
|
183
183
|
export * from './product';
|
|
184
184
|
export * from './providerBranding';
|
|
185
|
+
export * from './providerInvoice';
|
|
185
186
|
export * from './queryParams';
|
|
186
187
|
export * from './reports/reports';
|
|
187
188
|
export * from './resetPassword';
|
package/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;AAAA,IAAY,aAgBX;AAhBD,WAAY,aAAa;IACvB,mDAAS,CAAA;IACT,qDAAW,CAAA;IACX,mEAAkB,CAAA;IAClB,mEAAkB,CAAA;IAClB,qEAAmB,CAAA;IACnB,uDAAY,CAAA;IACZ,qEAAmB,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AnB,2BAAmB,QAI9B;AAED,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,iFAAqB,CAAA;IACrB,2DAAM,CAAA;AACR,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B;AAuED,qCAA+B"}
|
package/types/index.ts
CHANGED
|
@@ -201,6 +201,7 @@ export * from './priceCalculation'
|
|
|
201
201
|
export * from './priceSpecification'
|
|
202
202
|
export * from './product'
|
|
203
203
|
export * from './providerBranding'
|
|
204
|
+
export * from './providerInvoice'
|
|
204
205
|
export * from './queryParams'
|
|
205
206
|
export * from './reports/reports'
|
|
206
207
|
export * from './resetPassword'
|
package/types/outage.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TIsoCountry } from './country'
|
|
2
1
|
import { OutageSeverityLevel } from './index'
|
|
3
2
|
|
|
4
3
|
export interface IOutageResponse {
|
|
@@ -8,68 +7,3 @@ export interface IOutageResponse {
|
|
|
8
7
|
disabledPaths: string[] | null
|
|
9
8
|
severityLevel: OutageSeverityLevel | null
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Request body for creating or updating an outage (Superadmin). A null text or severity falls back to the
|
|
14
|
-
* template's default. Leave both iso_countries and provider_ids null for an outage that applies to everyone.
|
|
15
|
-
*/
|
|
16
|
-
export interface IOutageAdminRequest {
|
|
17
|
-
outageTemplateId: number | null
|
|
18
|
-
headerText: string | null
|
|
19
|
-
message: string | null
|
|
20
|
-
severityLevel: OutageSeverityLevel | null
|
|
21
|
-
/**
|
|
22
|
-
* Paths whose requests are refused while the outage is active. A path matches anywhere in the URL, in every app,
|
|
23
|
-
* so start it with its app: /admin/contracts, /my-page/invoices. '*' refuses every request.
|
|
24
|
-
*/
|
|
25
|
-
disabledPaths: string[] | null
|
|
26
|
-
isoCountries: TIsoCountry[] | null
|
|
27
|
-
providerIds: number[] | null
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* An outage as Superadmin lists and edits it.
|
|
32
|
-
*/
|
|
33
|
-
export interface IOutageAdminResponse extends IOutageAdminRequest {
|
|
34
|
-
outageId: number
|
|
35
|
-
/**
|
|
36
|
-
* ISO date string (YYYY-MM-DD) of when the outage was created
|
|
37
|
-
*/
|
|
38
|
-
date: string
|
|
39
|
-
/**
|
|
40
|
-
* ISO date string (YYYY-MM-DD) of when the outage was archived; null while it is active
|
|
41
|
-
*/
|
|
42
|
-
archived: string | null
|
|
43
|
-
/**
|
|
44
|
-
* What users see: the outage's own text and severity, or the template's when those are null
|
|
45
|
-
*/
|
|
46
|
-
effectiveHeaderText: string
|
|
47
|
-
effectiveMessage: string
|
|
48
|
-
effectiveSeverityLevel: OutageSeverityLevel
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Request body for creating or updating an outage template (Superadmin). Updating changes what users see for every
|
|
53
|
-
* active outage that leaves these values empty.
|
|
54
|
-
*/
|
|
55
|
-
export interface IOutageTemplateRequest {
|
|
56
|
-
name: string
|
|
57
|
-
defaultHeaderText: string
|
|
58
|
-
defaultMessage: string
|
|
59
|
-
defaultSeverityLevel: OutageSeverityLevel
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* An outage template: the texts and severity a new outage can start from (Superadmin).
|
|
64
|
-
*/
|
|
65
|
-
export interface IOutageTemplateResponse extends IOutageTemplateRequest {
|
|
66
|
-
outageTemplateId: number
|
|
67
|
-
/**
|
|
68
|
-
* Outages using the template, archived ones included; a template can only be deleted while this is 0
|
|
69
|
-
*/
|
|
70
|
-
outageCount: number
|
|
71
|
-
/**
|
|
72
|
-
* Active outages using the template, whose text changes when the template is edited
|
|
73
|
-
*/
|
|
74
|
-
activeOutageCount: number
|
|
75
|
-
}
|
package/types/payment.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { SettlementPaymentType } from './index'
|
|
|
2
2
|
import { PriceSpecification } from './priceSpecification'
|
|
3
3
|
|
|
4
4
|
/** Supported payment gateways. */
|
|
5
|
-
export type PaymentGateway = 'Stripe' | 'B2B' | 'V4' | 'NONE' | 'Mock'
|
|
5
|
+
export type PaymentGateway = 'Stripe' | 'B2B' | 'V4' | 'NONE' | 'Mock' | 'FragusSubscription' | 'FragusPrePaid'
|
|
6
6
|
|
|
7
7
|
/** Supported payment types. */
|
|
8
8
|
export type PaymentType = 'automatic' | 'manual'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TCurrency } from './currency'
|
|
2
|
+
|
|
3
|
+
export type ProviderInvoiceState = 'Pending' | 'Paid' | 'Canceled'
|
|
4
|
+
|
|
5
|
+
export type BillingEntrySource = 'Stripe' | 'Fragus'
|
|
6
|
+
|
|
7
|
+
export type BillingEntryKind = 'Subscription' | 'PrePaid'
|
|
8
|
+
|
|
9
|
+
// Amounts are in cents, excl. VAT.
|
|
10
|
+
export interface IProviderInvoiceListRecord {
|
|
11
|
+
id: number
|
|
12
|
+
period: string // YYYY-MM
|
|
13
|
+
state: ProviderInvoiceState
|
|
14
|
+
amount: number
|
|
15
|
+
vat: number
|
|
16
|
+
currency: TCurrency
|
|
17
|
+
contractCount: number
|
|
18
|
+
created: string // ISO
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface IContractBillingEntry {
|
|
22
|
+
id: number
|
|
23
|
+
contractPrettyId: string
|
|
24
|
+
source: BillingEntrySource
|
|
25
|
+
kind: BillingEntryKind
|
|
26
|
+
coverageStart: string // ISO
|
|
27
|
+
coverageEnd: string // ISO, exclusive
|
|
28
|
+
amount: number
|
|
29
|
+
vat: number
|
|
30
|
+
currency: TCurrency
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface IProviderInvoiceDetails extends IProviderInvoiceListRecord {
|
|
34
|
+
entries: IContractBillingEntry[]
|
|
35
|
+
}
|
|
@@ -3,6 +3,8 @@ export type ContractResponseErrors =
|
|
|
3
3
|
| PostContractResponseErrors
|
|
4
4
|
| ContractActivationPreventedBySystemForThisVehicle
|
|
5
5
|
| WarrantyCheckErrors
|
|
6
|
+
| FragusInvoicingErrors
|
|
7
|
+
| InternalUseErrors
|
|
6
8
|
|
|
7
9
|
type ContractUpdateErrors = 'CONTRACT_TRANSITION_INVALID_OR_ILLEGAL'
|
|
8
10
|
type PostContractResponseErrors = 'CONTRACT_MISSING_OR_INVALID_INFORMATION' | 'ITEM_SERIALNO_ACTIVE_CONTRACT_EXISTS'
|
|
@@ -21,3 +23,18 @@ type WarrantyCheckErrors =
|
|
|
21
23
|
| 'WARRANTY_MODEL_NOT_FOUND'
|
|
22
24
|
| 'WARRANTY_NOT_AVAILABLE_FOR_VEHICLE'
|
|
23
25
|
|
|
26
|
+
type FragusInvoicingErrors =
|
|
27
|
+
| 'FRAGUS_INVOICING_WEBCALC_NOT_AVAILABLE'
|
|
28
|
+
| 'FRAGUS_INVOICING_HAS_FRAGUS_CONTRACTS'
|
|
29
|
+
| 'FRAGUS_INVOICING_DEALER_PAID_NOT_AVAILABLE'
|
|
30
|
+
|
|
31
|
+
type InternalUseErrors =
|
|
32
|
+
| 'INTERNAL_USE_REQUIRES_NON_CARD_GATEWAY'
|
|
33
|
+
| 'INTERNAL_USE_NOT_ENABLED'
|
|
34
|
+
| 'INTERNAL_USE_OFFER_NOT_AVAILABLE'
|
|
35
|
+
| 'INTERNAL_USE_STRIPE_NOT_AVAILABLE'
|
|
36
|
+
| 'INTERNAL_USE_WEBCALC_NOT_AVAILABLE'
|
|
37
|
+
| 'INTERNAL_USE_FIXED_CUSTOMER_NO_LOGIN'
|
|
38
|
+
| 'INTERNAL_USE_OWNER_CHANGE_NOT_AVAILABLE'
|
|
39
|
+
| 'INTERNAL_USE_FIXED_CUSTOMER_READ_ONLY'
|
|
40
|
+
| 'INTERNAL_USE_FIXED_CUSTOMER_NOT_ALLOWED'
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare type TV4PTProductType = 'ServiceAgreement' | 'Warranty' | 'WarrantyAndServiceAgreement';
|
|
2
|
-
export declare type TV4PTPaymentType = 'DealerPaid' | 'CustomerSubscription';
|
|
2
|
+
export declare type TV4PTPaymentType = 'DealerPaid' | 'CustomerSubscription' | 'FragusSubscription' | 'FragusPrePaid';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAQA,yFAAyF;AACzF,kFAAkF;AAClF,6EAA6E;AAC7E,gFAAgF"}
|
|
@@ -4,6 +4,8 @@ export type TV4PTProductType = 'ServiceAgreement' | 'Warranty' | 'WarrantyAndSer
|
|
|
4
4
|
export type TV4PTPaymentType =
|
|
5
5
|
| 'DealerPaid' // One-time dealer payment via V4.
|
|
6
6
|
| 'CustomerSubscription' // Customer monthly subscription.
|
|
7
|
+
| 'FragusSubscription' // Fragus Invoicing, sent to V4 as 'CustomerSubscription'.
|
|
8
|
+
| 'FragusPrePaid' // Fragus Invoicing, sent to V4 as 'DealerPaid'.
|
|
7
9
|
// | 'CustomerPaymentCard' // Deprecated, use 'CustomerSubscription' instead. /2023-01-01
|
|
8
10
|
// | 'Subscription' // Deprecated, use 'CustomerSubscription' instead. /2023-01-01
|
|
9
11
|
// | 'DealerPaidMonthly' // Deprecated, use 'DealerPaid' instead. /2023-01-01
|