@fragus/sam-types 1.2.1 → 1.2.3

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 CHANGED
@@ -1,75 +1,48 @@
1
1
  # SAM-types
2
2
 
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.
3
+ The TypeScript types shared by SAM-api and its clients: SAM-admin-v2, SAM-superadmin-frontend,
4
+ SAM-webcalc-v2 and MyPage. Requests, responses, error keys and enums live here once, so the API and
5
+ every client agree on what goes over the wire.
6
6
 
7
- ## Conventions
7
+ Published to npm as [`@fragus/sam-types`](https://www.npmjs.com/package/@fragus/sam-types).
8
8
 
9
- ### Request/Response interfaces
10
- TODO: Fill this out
9
+ ## Using it
11
10
 
12
- ### Versioning
11
+ Each consumer pins an exact version in its `package.json`:
13
12
 
14
- We use standard [semantic versioning](https://semver.org/)
13
+ ```json
14
+ "@fragus/sam-types": "1.1.9"
15
+ ```
15
16
 
16
- ## Development
17
- ### Dependencies
18
- The project only has one dependency: `Typescript`
17
+ Import from the package root:
19
18
 
20
- This is to have `tsc` available.
19
+ ```ts
20
+ import { ContractState, INoContractsAvailableErrorParams } from '@fragus/sam-types'
21
+ ```
21
22
 
22
- ### Compiling
23
+ ## Prerequisites
23
24
 
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.
25
+ - Node.js: the version in `.nvmrc`
26
+ - npm
25
27
 
26
- ### Adding new interfaces, types, and enums
28
+ ## Getting started
27
29
 
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.
30
+ ```bash
31
+ npm install
32
+ npm run tsc # npm run tsc-win on Windows without bash
33
+ ```
29
34
 
30
- ### Local development
35
+ `npm run tsc` deletes the compiled `.js` files and builds the package again. CI runs the same build on
36
+ every push.
31
37
 
32
- ### Using npm
33
- To use the types locally in an application, add the line below as a dependency in your `package.json` file:
38
+ ## Docs
34
39
 
35
- `"sam-types": "file:../SAM-types"`
40
+ - [Adding and changing types](docs/adding-types.md): where a type goes, naming, exports, and the
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
36
45
 
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/).
46
+ ## Branches
40
47
 
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.
48
+ `fix/`, `feature/` or `backmerge/` plus a kebab-case description. PRs target `develop`.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.1",
2
+ "version": "1.2.3",
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",
@@ -72,8 +72,6 @@ export interface IContractDetailsBasic {
72
72
  mileage: number
73
73
  maxEndMileage?: number
74
74
  warrantyReference?: string
75
- /** The customer is a provider's internal-use fixed customer: no PDF, no owner change. */
76
- isFixedCustomer?: boolean
77
75
  }
78
76
 
79
77
  /**
@@ -1,4 +1,3 @@
1
- import { IAdminCustomer } from '../../admin/customer/customer'
2
1
  import { IApiOtherWithContracts } from '../../admin/product'
3
2
  import { IApiVehicleWithContracts } from '../../admin/vehicle'
4
3
  import { IsoLocale } from '../../locale'
@@ -33,10 +32,6 @@ export interface IContractProviderInfo extends IEssentialContractProviderInfo {
33
32
  inactive: boolean
34
33
  isUsingV4PricingTool: boolean
35
34
  isUseV4PTOnlyForSigning: boolean
36
- fragusInvoicing?: boolean
37
- isInternalUse?: boolean
38
- /** Set only while internal use is on. */
39
- fixedCustomer?: IAdminCustomer | null
40
35
  }
41
36
 
42
37
  export interface ICreateTestContractProvider {
@@ -41,11 +41,6 @@ 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
49
44
  v4ProviderId: number | null
50
45
  /** Groups the provider joins on create; an update ignores it. */
51
46
  contractProviderGroupIds?: number[]
@@ -98,24 +93,9 @@ export interface IContractProviderResponse extends IProviderCustomizationRespons
98
93
  created: Date
99
94
  updated: Date
100
95
  hiddenNetPrice: boolean
101
- fragusInvoicing?: boolean
102
- isInternalUse?: boolean
103
- fixedCustomer?: IFixedCustomerData | null
104
96
  v4ProviderId: number | null
105
97
  }
106
98
 
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
- email: string
114
- address1: string
115
- postalCode: string
116
- city: string
117
- }
118
-
119
99
  export interface IContractProviderListItemResponse {
120
100
  administrativeName: string
121
101
  contractProviderId: number
@@ -142,7 +122,6 @@ export type TContractProviderSettingsSection =
142
122
  | 'conditions'
143
123
  | 'customization'
144
124
  | 'cvrCode'
145
- | 'fixedCustomer'
146
125
 
147
126
  export interface IContractProviderSettingsResponse {
148
127
  administrativeName: string
@@ -172,8 +151,6 @@ export interface IContractProviderSettingsResponse {
172
151
  webLogoBannerUrl: string | null
173
152
  }
174
153
  hasParent: boolean
175
- /** Null while the provider is not in internal use. */
176
- fixedCustomer?: IFixedCustomerData | null
177
154
  }
178
155
 
179
156
  export type TContractProviderSettingsSectionValue =
@@ -183,7 +160,6 @@ export type TContractProviderSettingsSectionValue =
183
160
  | TProviderConditionsValue
184
161
  | TProviderCustomizationValue
185
162
  | TProviderCvrCodeValue
186
- | IFixedCustomerData
187
163
 
188
164
  export type TProviderGeneralInfoValue = Pick<
189
165
  IContractProviderSettingsResponse,
package/types/index.d.ts CHANGED
@@ -182,7 +182,6 @@ export * from './priceCalculation';
182
182
  export * from './priceSpecification';
183
183
  export * from './product';
184
184
  export * from './providerBranding';
185
- export * from './providerInvoice';
186
185
  export * from './queryParams';
187
186
  export * from './reports/reports';
188
187
  export * from './resetPassword';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources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Q,CAAA;AACV,CAAC,EAPW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAOrB;AAED,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,6DAAQ,CAAA;IACR,+DAAK,CAAA;IACL,uEAAS,CAAA;AACX,CAAC,EAJW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAI9B;AAED,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,iFAAqB,CAAA;IACrB,2DAAM,CAAA;AACR,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B;AAsED,qCAA+B"}
package/types/index.ts CHANGED
@@ -201,7 +201,6 @@ export * from './priceCalculation'
201
201
  export * from './priceSpecification'
202
202
  export * from './product'
203
203
  export * from './providerBranding'
204
- export * from './providerInvoice'
205
204
  export * from './queryParams'
206
205
  export * from './reports/reports'
207
206
  export * from './resetPassword'
package/types/outage.d.ts CHANGED
@@ -1,9 +1,69 @@
1
+ import { TIsoCountry } from './country'
1
2
  import { OutageSeverityLevel } from './index'
2
3
 
3
4
  export interface IOutageResponse {
4
5
  headerText: string | null
5
6
  message: string | null
6
7
  date: Date
7
- disabledPaths: string[] | null
8
8
  severityLevel: OutageSeverityLevel | null
9
9
  }
10
+
11
+ /**
12
+ * Request body for creating or updating an outage (Superadmin). A null text or severity falls back to the
13
+ * template's default. Leave both iso_countries and provider_ids null for an outage that applies to everyone.
14
+ */
15
+ export interface IOutageAdminRequest {
16
+ outageTemplateId: number | null
17
+ headerText: string | null
18
+ message: string | null
19
+ severityLevel: OutageSeverityLevel | null
20
+ isoCountries: TIsoCountry[] | null
21
+ providerIds: number[] | null
22
+ }
23
+
24
+ /**
25
+ * An outage as Superadmin lists and edits it.
26
+ */
27
+ export interface IOutageAdminResponse extends IOutageAdminRequest {
28
+ outageId: number
29
+ /**
30
+ * ISO date string (YYYY-MM-DD) of when the outage was created
31
+ */
32
+ date: string
33
+ /**
34
+ * ISO date string (YYYY-MM-DD) of when the outage was archived; null while it is active
35
+ */
36
+ archived: string | null
37
+ /**
38
+ * What users see: the outage's own text and severity, or the template's when those are null
39
+ */
40
+ effectiveHeaderText: string
41
+ effectiveMessage: string
42
+ effectiveSeverityLevel: OutageSeverityLevel
43
+ }
44
+
45
+ /**
46
+ * Request body for creating or updating an outage template (Superadmin). Updating changes what users see for every
47
+ * active outage that leaves these values empty.
48
+ */
49
+ export interface IOutageTemplateRequest {
50
+ name: string
51
+ defaultHeaderText: string
52
+ defaultMessage: string
53
+ defaultSeverityLevel: OutageSeverityLevel
54
+ }
55
+
56
+ /**
57
+ * An outage template: the texts and severity a new outage can start from (Superadmin).
58
+ */
59
+ export interface IOutageTemplateResponse extends IOutageTemplateRequest {
60
+ outageTemplateId: number
61
+ /**
62
+ * Outages using the template, archived ones included; a template can only be deleted while this is 0
63
+ */
64
+ outageCount: number
65
+ /**
66
+ * Active outages using the template, whose text changes when the template is edited
67
+ */
68
+ activeOutageCount: number
69
+ }
@@ -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' | 'FragusSubscription' | 'FragusPrePaid'
5
+ export type PaymentGateway = 'Stripe' | 'B2B' | 'V4' | 'NONE' | 'Mock'
6
6
 
7
7
  /** Supported payment types. */
8
8
  export type PaymentType = 'automatic' | 'manual'
@@ -3,8 +3,6 @@ export type ContractResponseErrors =
3
3
  | PostContractResponseErrors
4
4
  | ContractActivationPreventedBySystemForThisVehicle
5
5
  | WarrantyCheckErrors
6
- | FragusInvoicingErrors
7
- | InternalUseErrors
8
6
 
9
7
  type ContractUpdateErrors = 'CONTRACT_TRANSITION_INVALID_OR_ILLEGAL'
10
8
  type PostContractResponseErrors = 'CONTRACT_MISSING_OR_INVALID_INFORMATION' | 'ITEM_SERIALNO_ACTIVE_CONTRACT_EXISTS'
@@ -23,18 +21,3 @@ type WarrantyCheckErrors =
23
21
  | 'WARRANTY_MODEL_NOT_FOUND'
24
22
  | 'WARRANTY_NOT_AVAILABLE_FOR_VEHICLE'
25
23
 
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' | 'FragusSubscription' | 'FragusPrePaid';
2
+ export declare type TV4PTPaymentType = 'DealerPaid' | 'CustomerSubscription';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAQA,yFAAyF;AACzF,kFAAkF;AAClF,6EAA6E;AAC7E,gFAAgF"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAMA,yFAAyF;AACzF,kFAAkF;AAClF,6EAA6E;AAC7E,gFAAgF"}
@@ -4,8 +4,6 @@ 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'.
9
7
  // | 'CustomerPaymentCard' // Deprecated, use 'CustomerSubscription' instead. /2023-01-01
10
8
  // | 'Subscription' // Deprecated, use 'CustomerSubscription' instead. /2023-01-01
11
9
  // | 'DealerPaidMonthly' // Deprecated, use 'DealerPaid' instead. /2023-01-01
@@ -1,30 +0,0 @@
1
- import { PriceSpecification } from './priceSpecification'
2
-
3
- export type ProviderInvoiceState = 'Pending' | 'Paid' | 'Canceled'
4
-
5
- export type BillingEntrySource = 'Stripe' | 'Fragus'
6
-
7
- export type BillingEntryKind = 'Subscription' | 'PrePaid'
8
-
9
- export interface IProviderInvoiceListRecord {
10
- id: number
11
- period: string // YYYY-MM
12
- state: ProviderInvoiceState
13
- amount: PriceSpecification
14
- contractCount: number
15
- created: string // ISO
16
- }
17
-
18
- export interface IContractBillingEntry {
19
- id: number
20
- contractPrettyId: string
21
- source: BillingEntrySource
22
- kind: BillingEntryKind
23
- coverageStart: string // ISO
24
- coverageEnd: string // ISO, exclusive
25
- amount: PriceSpecification
26
- }
27
-
28
- export interface IProviderInvoiceDetails extends IProviderInvoiceListRecord {
29
- entries: IContractBillingEntry[]
30
- }