@star-insure/sdk 0.3.23 → 0.4.1

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.
@@ -0,0 +1,120 @@
1
+ export interface MotorwebVehicleResponse {
2
+ id: number;
3
+ created_at: string;
4
+ updated_at: string;
5
+ check_type: 'bvi' | 'motorcheck' | 'valuation';
6
+ plate_or_vin: string;
7
+ data: MotorwebVehicle;
8
+ }
9
+ export interface MotorwebVehicle {
10
+ '@attributes': Attributes;
11
+ 'vehicle': BviCheck | MotorvehicleCheck;
12
+ }
13
+ interface Attributes {
14
+ 'version'?: string;
15
+ }
16
+ interface FirstRegistrationDateOverseas {
17
+ 'month'?: string;
18
+ 'year'?: string;
19
+ 'description'?: string;
20
+ }
21
+ interface Registration {
22
+ 'previous-country-of-registration'?: string;
23
+ 'first-registration-date-in-new-zealand'?: string;
24
+ 'registration-status'?: string;
25
+ 'cause-of-last-registration'?: string;
26
+ 'registered-overseas'?: string;
27
+ 'first-registration-date-overseas'?: FirstRegistrationDateOverseas;
28
+ 'last-registration-date'?: string;
29
+ }
30
+ interface Licence {
31
+ 'expiry-date'?: string;
32
+ 'licence-type'?: string;
33
+ 'issue-date'?: string;
34
+ 'issue-time'?: string;
35
+ 'continuous'?: string;
36
+ }
37
+ interface Wof {
38
+ 'last-inspection-date'?: string;
39
+ 'last-inspection-result'?: string;
40
+ 'expiry-date'?: string;
41
+ 'is-subject-to'?: string;
42
+ }
43
+ interface Cof {
44
+ 'is-subject-to'?: string;
45
+ }
46
+ interface Attributes2 {
47
+ 'data-retrieved'?: string;
48
+ }
49
+ interface Ruc {
50
+ '@attributes': Attributes2;
51
+ 'is-subject-to'?: string;
52
+ }
53
+ interface Attributes3 {
54
+ 'current'?: string;
55
+ 'past-plate'?: string;
56
+ }
57
+ interface Plate {
58
+ '@attributes'?: Attributes3;
59
+ 'plate-number'?: string;
60
+ 'plate-type'?: string;
61
+ 'effective-date'?: string;
62
+ }
63
+ interface Attributes4 {
64
+ 'latest'?: string;
65
+ }
66
+ interface OdometerReading {
67
+ '@attributes'?: Attributes4;
68
+ 'reading'?: string;
69
+ 'reading-date'?: string;
70
+ 'reading-unit'?: string;
71
+ 'source'?: string;
72
+ }
73
+ interface Transmission {
74
+ 'type'?: string;
75
+ }
76
+ interface Attributes5 {
77
+ 'current': string;
78
+ 'owner-number': string;
79
+ 'suppressed-reason': string;
80
+ }
81
+ interface Owner {
82
+ '@attributes': Attributes5;
83
+ 'ownership-date': string;
84
+ 'owner-status': string;
85
+ }
86
+ interface BviCheck {
87
+ 'registration'?: Registration;
88
+ 'licence'?: Licence;
89
+ 'wof'?: Wof;
90
+ 'cof'?: Cof;
91
+ 'ruc'?: Ruc;
92
+ 'year-of-manufacture'?: string;
93
+ 'make'?: string;
94
+ 'model'?: string;
95
+ 'mvr-model'?: string;
96
+ 'body-style'?: string;
97
+ 'vehicle-type'?: string;
98
+ 'vin'?: string;
99
+ 'chassis'?: string;
100
+ 'engine-number'?: string;
101
+ 'main-colour'?: string;
102
+ 'cc-rating'?: string;
103
+ 'country-of-origin'?: string;
104
+ 'assembly-type'?: string;
105
+ 'gross-vehicle-mass'?: string;
106
+ 'number-of-seats'?: string;
107
+ 'fuel-type'?: string;
108
+ 'vehicle-usage'?: string;
109
+ 'odometer-unit'?: string;
110
+ 'plate'?: Plate;
111
+ 'odometer-reading'?: OdometerReading;
112
+ 'transmission'?: Transmission;
113
+ 'model-code'?: string;
114
+ 'model-variant'?: string;
115
+ }
116
+ interface MotorvehicleCheck extends BviCheck {
117
+ 'number-of-owners'?: string;
118
+ owner?: Owner;
119
+ }
120
+ export {};
@@ -11,7 +11,7 @@ import { QuoteRequestVehicle } from "./QuoteRequestVehicle";
11
11
  import { StreetAddress } from "./StreetAddress";
12
12
  export declare type QuoteRequestStatus = 'new' | 'draft' | 'in-progress' | 'with-customer' | 'sold' | 'bound' | 'customer-modified' | 'closed';
13
13
  export declare type QuoteRequestSource = 'web' | 'phone' | 'show' | 'existing-customer' | 'mighway' | 'agent' | 'entry-form' | 'bularangi';
14
- export declare type QuoteRequestAutomatch = 'QUOTE' | 'EMAIL' | 'REGISTRATION' | 'DUPLICATE' | null;
14
+ export declare type QuoteRequestAutomatch = 'QUOTE' | 'EMAIL' | 'REGISTRATION' | 'DUPLICATE';
15
15
  export interface QuoteRequestUser {
16
16
  id: number;
17
17
  name: string;
@@ -22,44 +22,45 @@ export interface QuoteRequestUserGroup {
22
22
  name: string;
23
23
  }
24
24
  export interface QuoteRequest {
25
- id: string;
26
- status: QuoteRequestStatus;
27
- source: QuoteRequestSource;
28
- reference: string;
29
- client_number: string;
30
- policy_number: string | null;
31
- first_name: string | null;
32
- last_name: string | null;
33
- phone: string | null;
34
- mobile: string | null;
35
- email: string | null;
36
- licence: string | null;
37
- licence_other: string | null;
38
- has_automatch: boolean | null;
39
- automatch_by: QuoteRequestAutomatch;
40
- automatch_client_id: string | null;
41
- promo_code: string | null;
42
- club_membership_number: string | null;
43
- broker_fee: number | null;
44
- length_of_insurance: string | null;
45
- theme: string | null;
46
- created_at: string;
47
- updated_at: string;
48
- dob: string | null;
49
- sold_at: string | null;
50
- sent_at: string | null;
51
- pricing_expires_at: string | null;
52
- follow_up_at: string | null;
53
- resubmit_id: QuoteRequest['id'] | null;
54
- referrer_id: QuoteRequestReferrer['id'] | null;
55
- referrer_category_id: QuoteRequestReferrerCategory['id'] | null;
56
- staff_member_id: QuoteRequestUser['id'] | null;
57
- agent_id: QuoteRequestUser['id'] | null;
58
- agent_firm_id: QuoteRequestUserGroup['id'] | null;
59
- broker_firm_id: QuoteRequestUserGroup['id'] | null;
60
- broker_id: QuoteRequestUser['id'] | null;
61
- club_id: Club['id'] | null;
62
- lead_id: Lead['id'] | null;
25
+ id?: string;
26
+ status?: QuoteRequestStatus;
27
+ source?: QuoteRequestSource;
28
+ reference?: string;
29
+ client_number?: string;
30
+ policy_number?: string;
31
+ first_name?: string;
32
+ last_name?: string;
33
+ phone?: string;
34
+ mobile?: string;
35
+ email?: string;
36
+ licence?: string;
37
+ licence_other?: string;
38
+ has_automatch?: boolean;
39
+ automatch_by?: QuoteRequestAutomatch;
40
+ automatch_client_id?: string;
41
+ promo_code?: string;
42
+ club_membership_number?: string;
43
+ broker_fee?: number;
44
+ length_of_insurance?: string;
45
+ theme?: string;
46
+ notes?: string;
47
+ created_at?: string;
48
+ updated_at?: string;
49
+ dob?: string;
50
+ sold_at?: string;
51
+ sent_at?: string;
52
+ pricing_expires_at?: string;
53
+ follow_up_at?: string;
54
+ resubmit_id?: QuoteRequest['id'];
55
+ referrer_id?: QuoteRequestReferrer['id'];
56
+ referrer_category_id?: QuoteRequestReferrerCategory['id'];
57
+ staff_member_id?: QuoteRequestUser['id'];
58
+ agent_id?: QuoteRequestUser['id'];
59
+ agent_firm_id?: QuoteRequestUserGroup['id'];
60
+ broker_firm_id?: QuoteRequestUserGroup['id'];
61
+ broker_id?: QuoteRequestUser['id'];
62
+ club_id?: Club['id'];
63
+ lead_id?: Lead['id'];
63
64
  declaration?: QuoteRequestDeclaration;
64
65
  street_address?: StreetAddress;
65
66
  postal_address?: PostalAddress;
@@ -22,6 +22,7 @@ export interface QuoteRequestForm {
22
22
  broker_fee?: number;
23
23
  length_of_insurance?: string;
24
24
  theme?: string;
25
+ notes?: string;
25
26
  dob?: string;
26
27
  sold_at?: string;
27
28
  sent_at?: string;
@@ -21,12 +21,35 @@ export interface RedbookVehicle {
21
21
  vin: string | null;
22
22
  weight: number | null;
23
23
  year: number | null;
24
- valuation_details: {
25
- [x: string]: any;
26
- } | null;
24
+ valuation_details: Valuation[] | null;
27
25
  chassis_number: string | null;
28
26
  fuel_type: string | null;
29
27
  previous_registered_country: string | null;
30
28
  overseas_first_registered_year: number | null;
31
29
  overseas_first_registered_month: number | null;
32
30
  }
31
+ export interface Valuation {
32
+ matchedRedbookVehicle: MatchedRedbookVehicle;
33
+ valuationDetail: ValuationDetail;
34
+ }
35
+ export interface MatchedRedbookVehicle {
36
+ make?: string;
37
+ model?: string;
38
+ year?: number;
39
+ description?: string;
40
+ redbookCode: string;
41
+ }
42
+ export interface ValuationDetail {
43
+ newRetailValue: number;
44
+ targetConditionTypeAvailable: boolean;
45
+ newValueAvailable: boolean;
46
+ pricingBandAvailable: boolean;
47
+ retailValueList: RetailValueList[];
48
+ }
49
+ export interface RetailValueList {
50
+ condition: string;
51
+ lowerPricingRange: number;
52
+ upperPricingRange: number;
53
+ value: number;
54
+ kilometers: number;
55
+ }
@@ -18,3 +18,4 @@ export * from './QuoteRequestForm';
18
18
  export * from './PolicyBenefit';
19
19
  export * from './InformationRequest';
20
20
  export * from './EmailContentOption';
21
+ export * from './MotorwebVehicle';
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@star-insure/sdk",
3
3
  "description": "The SDK for Star Insure client apps with shared helper functions and TypeScript definitions.",
4
4
  "author": "alexclark_nz",
5
- "version": "0.3.23",
5
+ "version": "0.4.1",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -0,0 +1,137 @@
1
+ export interface MotorwebVehicleResponse {
2
+ id: number;
3
+ created_at: string;
4
+ updated_at: string;
5
+ check_type: 'bvi' | 'motorcheck' | 'valuation';
6
+ plate_or_vin: string;
7
+ data: MotorwebVehicle;
8
+ }
9
+
10
+ export interface MotorwebVehicle {
11
+ '@attributes': Attributes;
12
+ 'vehicle': BviCheck | MotorvehicleCheck;
13
+ }
14
+
15
+ interface Attributes {
16
+ 'version'?: string;
17
+ }
18
+
19
+ interface FirstRegistrationDateOverseas {
20
+ 'month'?: string;
21
+ 'year'?: string;
22
+ 'description'?: string;
23
+ }
24
+
25
+ interface Registration {
26
+ 'previous-country-of-registration'?: string;
27
+ 'first-registration-date-in-new-zealand'?: string;
28
+ 'registration-status'?: string;
29
+ 'cause-of-last-registration'?: string;
30
+ 'registered-overseas'?: string;
31
+ 'first-registration-date-overseas'?: FirstRegistrationDateOverseas;
32
+ 'last-registration-date'?: string;
33
+ }
34
+
35
+ interface Licence {
36
+ 'expiry-date'?: string;
37
+ 'licence-type'?: string;
38
+ 'issue-date'?: string;
39
+ 'issue-time'?: string;
40
+ 'continuous'?: string;
41
+ }
42
+
43
+ interface Wof {
44
+ 'last-inspection-date'?: string;
45
+ 'last-inspection-result'?: string;
46
+ 'expiry-date'?: string;
47
+ 'is-subject-to'?: string;
48
+ }
49
+
50
+ interface Cof {
51
+ 'is-subject-to'?: string;
52
+ }
53
+
54
+ interface Attributes2 {
55
+ 'data-retrieved'?: string;
56
+ }
57
+
58
+ interface Ruc {
59
+ '@attributes': Attributes2;
60
+ 'is-subject-to'?: string;
61
+ }
62
+
63
+ interface Attributes3 {
64
+ 'current'?: string;
65
+ 'past-plate'?: string;
66
+ }
67
+
68
+ interface Plate {
69
+ '@attributes'?: Attributes3;
70
+ 'plate-number'?: string;
71
+ 'plate-type'?: string;
72
+ 'effective-date'?: string;
73
+ }
74
+
75
+ interface Attributes4 {
76
+ 'latest'?: string;
77
+ }
78
+
79
+ interface OdometerReading {
80
+ '@attributes'?: Attributes4;
81
+ 'reading'?: string;
82
+ 'reading-date'?: string;
83
+ 'reading-unit'?: string;
84
+ 'source'?: string;
85
+ }
86
+
87
+ interface Transmission {
88
+ 'type'?: string;
89
+ }
90
+
91
+ interface Attributes5 {
92
+ 'current': string;
93
+ 'owner-number': string;
94
+ 'suppressed-reason': string;
95
+ }
96
+
97
+ interface Owner {
98
+ '@attributes': Attributes5;
99
+ 'ownership-date': string;
100
+ 'owner-status': string;
101
+ }
102
+
103
+ interface BviCheck {
104
+ 'registration'?: Registration;
105
+ 'licence'?: Licence;
106
+ 'wof'?: Wof;
107
+ 'cof'?: Cof;
108
+ 'ruc'?: Ruc;
109
+ 'year-of-manufacture'?: string;
110
+ 'make'?: string;
111
+ 'model'?: string;
112
+ 'mvr-model'?: string;
113
+ 'body-style'?: string;
114
+ 'vehicle-type'?: string;
115
+ 'vin'?: string;
116
+ 'chassis'?: string;
117
+ 'engine-number'?: string;
118
+ 'main-colour'?: string;
119
+ 'cc-rating'?: string;
120
+ 'country-of-origin'?: string;
121
+ 'assembly-type'?: string;
122
+ 'gross-vehicle-mass'?: string;
123
+ 'number-of-seats'?: string;
124
+ 'fuel-type'?: string;
125
+ 'vehicle-usage'?: string;
126
+ 'odometer-unit'?: string;
127
+ 'plate'?: Plate;
128
+ 'odometer-reading'?: OdometerReading;
129
+ 'transmission'?: Transmission;
130
+ 'model-code'?: string;
131
+ 'model-variant'?: string;
132
+ }
133
+
134
+ interface MotorvehicleCheck extends BviCheck {
135
+ 'number-of-owners'?: string;
136
+ owner?: Owner;
137
+ }
@@ -14,7 +14,7 @@ export type QuoteRequestStatus = 'new' | 'draft' | 'in-progress' | 'with-custome
14
14
 
15
15
  export type QuoteRequestSource = 'web' | 'phone' | 'show' | 'existing-customer' | 'mighway' | 'agent' | 'entry-form' | 'bularangi';
16
16
 
17
- export type QuoteRequestAutomatch = 'QUOTE' | 'EMAIL' | 'REGISTRATION' | 'DUPLICATE' | null;
17
+ export type QuoteRequestAutomatch = 'QUOTE' | 'EMAIL' | 'REGISTRATION' | 'DUPLICATE';
18
18
 
19
19
  export interface QuoteRequestUser {
20
20
  id: number;
@@ -28,48 +28,49 @@ export interface QuoteRequestUserGroup {
28
28
  }
29
29
 
30
30
  export interface QuoteRequest {
31
- id: string;
32
- status: QuoteRequestStatus;
33
- source: QuoteRequestSource;
34
- reference: string;
35
- client_number: string;
36
- policy_number: string | null;
37
- first_name: string | null;
38
- last_name: string | null;
39
- phone: string | null;
40
- mobile: string | null;
41
- email: string | null;
42
- licence: string | null;
43
- licence_other: string | null;
44
- has_automatch: boolean | null;
45
- automatch_by: QuoteRequestAutomatch;
46
- automatch_client_id: string | null;
47
- promo_code: string | null;
48
- club_membership_number: string | null;
49
- broker_fee: number | null;
50
- length_of_insurance: string | null;
51
- theme: string | null;
31
+ id?: string;
32
+ status?: QuoteRequestStatus;
33
+ source?: QuoteRequestSource;
34
+ reference?: string;
35
+ client_number?: string;
36
+ policy_number?: string;
37
+ first_name?: string;
38
+ last_name?: string;
39
+ phone?: string;
40
+ mobile?: string;
41
+ email?: string;
42
+ licence?: string;
43
+ licence_other?: string;
44
+ has_automatch?: boolean;
45
+ automatch_by?: QuoteRequestAutomatch;
46
+ automatch_client_id?: string;
47
+ promo_code?: string;
48
+ club_membership_number?: string;
49
+ broker_fee?: number;
50
+ length_of_insurance?: string;
51
+ theme?: string;
52
+ notes?: string;
52
53
 
53
54
  // Dates
54
- created_at: string;
55
- updated_at: string;
56
- dob: string | null;
57
- sold_at: string | null;
58
- sent_at: string | null;
59
- pricing_expires_at: string | null;
60
- follow_up_at: string | null;
55
+ created_at?: string;
56
+ updated_at?: string;
57
+ dob?: string;
58
+ sold_at?: string;
59
+ sent_at?: string;
60
+ pricing_expires_at?: string;
61
+ follow_up_at?: string;
61
62
 
62
63
  // Foreign keys
63
- resubmit_id: QuoteRequest['id'] | null;
64
- referrer_id: QuoteRequestReferrer['id'] | null;
65
- referrer_category_id: QuoteRequestReferrerCategory['id'] | null;
66
- staff_member_id: QuoteRequestUser['id'] | null;
67
- agent_id: QuoteRequestUser['id'] | null;
68
- agent_firm_id: QuoteRequestUserGroup['id'] | null;
69
- broker_firm_id: QuoteRequestUserGroup['id'] | null;
70
- broker_id: QuoteRequestUser['id'] | null;
71
- club_id: Club['id'] | null;
72
- lead_id: Lead['id'] | null;
64
+ resubmit_id?: QuoteRequest['id'];
65
+ referrer_id?: QuoteRequestReferrer['id'];
66
+ referrer_category_id?: QuoteRequestReferrerCategory['id'];
67
+ staff_member_id?: QuoteRequestUser['id'];
68
+ agent_id?: QuoteRequestUser['id'];
69
+ agent_firm_id?: QuoteRequestUserGroup['id'];
70
+ broker_firm_id?: QuoteRequestUserGroup['id'];
71
+ broker_id?: QuoteRequestUser['id'];
72
+ club_id?: Club['id'];
73
+ lead_id?: Lead['id'];
73
74
 
74
75
  // Relationships
75
76
  declaration?: QuoteRequestDeclaration;
@@ -23,6 +23,7 @@ export interface QuoteRequestForm {
23
23
  broker_fee?: number;
24
24
  length_of_insurance?: string;
25
25
  theme?: string;
26
+ notes?: string;
26
27
 
27
28
  dob?: string;
28
29
  sold_at?: string;
@@ -21,10 +21,39 @@ export interface RedbookVehicle {
21
21
  vin: string | null;
22
22
  weight: number | null;
23
23
  year: number | null;
24
- valuation_details: { [x: string]: any } | null;
24
+ valuation_details: Valuation[] | null;
25
25
  chassis_number: string | null;
26
26
  fuel_type: string | null;
27
27
  previous_registered_country: string | null;
28
28
  overseas_first_registered_year: number | null;
29
29
  overseas_first_registered_month: number | null;
30
30
  }
31
+
32
+ export interface Valuation {
33
+ matchedRedbookVehicle: MatchedRedbookVehicle;
34
+ valuationDetail: ValuationDetail;
35
+ };
36
+
37
+ export interface MatchedRedbookVehicle {
38
+ make?: string;
39
+ model?: string;
40
+ year?: number;
41
+ description?: string;
42
+ redbookCode: string;
43
+ }
44
+
45
+ export interface ValuationDetail {
46
+ newRetailValue: number;
47
+ targetConditionTypeAvailable: boolean;
48
+ newValueAvailable: boolean;
49
+ pricingBandAvailable: boolean;
50
+ retailValueList: RetailValueList[];
51
+ }
52
+
53
+ export interface RetailValueList {
54
+ condition: string;
55
+ lowerPricingRange: number;
56
+ upperPricingRange: number;
57
+ value: number;
58
+ kilometers: number;
59
+ }
@@ -18,3 +18,4 @@ export * from './QuoteRequestForm';
18
18
  export * from './PolicyBenefit';
19
19
  export * from './InformationRequest';
20
20
  export * from './EmailContentOption';
21
+ export * from './MotorwebVehicle';