@driveflux/pdf 1.3.0 → 1.3.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"quotation.d.ts","sourceRoot":"","sources":["../../src/__mocks__/quotation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,eAAO,MAAM,SAAS,EAAE,SA4DvB,CAAA"}
1
+ {"version":3,"file":"quotation.d.ts","sourceRoot":"","sources":["../../src/__mocks__/quotation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,eAAO,MAAM,SAAS,EAAE,SAoIvB,CAAA"}
@@ -1,60 +1,124 @@
1
1
  export var quotation = {
2
- id: 'QUO_XZJLVSM8',
3
- vehicleId: 'VBEXLQR',
2
+ id: 'QCRR5ZJN3',
3
+ vehicleId: 'V5JP2VS',
4
4
  plan: 'plan36',
5
5
  mileagePackage: 'lite',
6
- cycleFluxCoefficient: 'flux25',
7
- customerName: 'Bubu Ahmad',
8
- vehicleName: 'Volkswagen Polo 1.6 Sedan 2011',
6
+ cycleFluxCoefficient: 'flux15',
7
+ customerName: 'af',
8
+ vehicleName: 'Perodua Myvi 1.5 AV 2018',
9
9
  createdById: 'U2R88JRVL',
10
- createdAt: new Date('2024-05-27T02:26:36.070Z'),
11
- updatedAt: new Date('2024-05-27T02:26:36.070Z'),
10
+ createdAt: new Date('2024-10-17T12:04:44.420Z'),
11
+ updatedAt: new Date('2024-10-17T12:04:44.700Z'),
12
12
  metadata: {},
13
13
  customer: {
14
14
  type: 'user',
15
- name: 'Bubu Ahmad',
16
- email: 'bubu@gmail.com',
17
- address: {
18
- street1: '15-2 Jalan Solaris',
19
- city: 'Kuala Lumpur',
20
- state: 'Johor',
21
- postalCode: '12323',
22
- country: 'MY'
23
- }
15
+ name: 'af',
16
+ email: '',
17
+ address: {}
24
18
  },
25
19
  fees: {
26
- subscriptionFee: 800,
27
- reservationFee: 0,
28
- startFee: 498,
29
- deposit: 1600,
20
+ subscriptionFee: 1080,
21
+ reservationFee: 45.371,
22
+ startFee: 686.4,
23
+ deposit: 2160,
30
24
  depositMonths: 2,
31
- extraCharges: [
32
- {
33
- type: 'upfront',
34
- description: 'Spare Tyre',
35
- amount: 2500.2
36
- },
37
- {
38
- type: 'upfront',
39
- description: 'Spare Tyre No 2',
40
- amount: 3000.2
41
- },
42
- {
43
- type: 'monthly',
44
- description: 'Commitment ',
45
- amount: 2
46
- }
47
- ],
48
- amountBeforeTax: 8400.4,
49
- taxAmount: 672.03,
50
- amountAfterTax: 9072.43,
51
- gfv: 0,
52
- cycle: null,
53
- couponCode: null,
54
- discountAmount: null,
55
- appliedDiscountId: null,
25
+ extraCharges: [],
26
+ discountAmount: 0,
27
+ appliedDiscountId: '',
28
+ couponCode: '',
56
29
  couponType: '',
57
- excessMileageFee: 3.8
30
+ amountBeforeTax: 3971.771,
31
+ taxAmount: 317.74,
32
+ amountAfterTax: 4289.511,
33
+ excessMileageFee: 0.65,
34
+ cycle: null,
35
+ gfv: null
58
36
  },
59
- quotationPdf: null
37
+ images: [
38
+ {
39
+ default: 'https://s3.ap-southeast-1.amazonaws.com/flux-site-files/static%2Fraw%2FV5JP2VS%2FNefMGTxvxdFmaZvy9An7T-1-edited.jpg',
40
+ blurBase64: null,
41
+ thumbnail: null,
42
+ small: null,
43
+ medium: null,
44
+ large: null,
45
+ description: null,
46
+ inspection: true,
47
+ inspectionType: 'exterior',
48
+ notActualPhoto: false
49
+ },
50
+ {
51
+ default: 'https://s3.ap-southeast-1.amazonaws.com/flux-site-files/static%2Fraw%2FV5JP2VS%2Fjeb6Okl1rXSDfeSeBY4-D-2-edited.jpg',
52
+ blurBase64: null,
53
+ thumbnail: null,
54
+ small: null,
55
+ medium: null,
56
+ large: null,
57
+ description: null,
58
+ inspection: false,
59
+ inspectionType: null,
60
+ notActualPhoto: false
61
+ },
62
+ {
63
+ default: 'https://s3.ap-southeast-1.amazonaws.com/flux-site-files/static%2Fraw%2FV5JP2VS%2F4a21uc2_H_Y3yfBGuLeR9-5.JPG',
64
+ blurBase64: null,
65
+ thumbnail: null,
66
+ small: null,
67
+ medium: null,
68
+ large: null,
69
+ description: null,
70
+ inspection: true,
71
+ inspectionType: 'frame',
72
+ notActualPhoto: false
73
+ },
74
+ {
75
+ default: 'https://s3.ap-southeast-1.amazonaws.com/flux-site-files/static%2Fraw%2FV5JP2VS%2FGAQS5MFE_wy9HURTui6vd-9.JPG',
76
+ blurBase64: null,
77
+ thumbnail: null,
78
+ small: null,
79
+ medium: null,
80
+ large: null,
81
+ description: null,
82
+ inspection: true,
83
+ inspectionType: 'interior',
84
+ notActualPhoto: false
85
+ },
86
+ {
87
+ default: 'https://s3.ap-southeast-1.amazonaws.com/flux-site-files/static%2Fraw%2FV5JP2VS%2FeRxfs0-i7CS3HzT0y5nFo-10.JPG',
88
+ blurBase64: null,
89
+ thumbnail: null,
90
+ small: null,
91
+ medium: null,
92
+ large: null,
93
+ description: null,
94
+ inspection: false,
95
+ inspectionType: null,
96
+ notActualPhoto: false
97
+ },
98
+ {
99
+ default: 'https://s3.ap-southeast-1.amazonaws.com/flux-site-files/static%2Fraw%2FV5JP2VS%2Fb6J6P0hDNuVGjDhQvf7_w-11.JPG',
100
+ blurBase64: null,
101
+ thumbnail: null,
102
+ small: null,
103
+ medium: null,
104
+ large: null,
105
+ description: null,
106
+ inspection: false,
107
+ inspectionType: null,
108
+ notActualPhoto: false
109
+ },
110
+ {
111
+ default: 'https://s3.ap-southeast-1.amazonaws.com/flux-site-files/static%2Fraw%2FV5JP2VS%2Fk9myRzc4U4JxyQ-IQfKGS-15.JPG',
112
+ blurBase64: null,
113
+ thumbnail: null,
114
+ small: null,
115
+ medium: null,
116
+ large: null,
117
+ description: null,
118
+ inspection: true,
119
+ inspectionType: 'engine',
120
+ notActualPhoto: false
121
+ }
122
+ ],
123
+ quotationPdf: 'https://dev-flux-admin.s3.ap-southeast-1.amazonaws.com/quotations/QCRR5ZJN3.pdf'
60
124
  };
@@ -1 +1 @@
1
- {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../src/__mocks__/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAE5D,eAAO,MAAM,YAAY,EAAE,wBA+zB1B,CAAA"}
1
+ {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../src/__mocks__/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAE5D,eAAO,MAAM,YAAY,EAAE,wBA40B1B,CAAA"}
@@ -65,6 +65,7 @@ export var subscription = {
65
65
  ipAddress: null
66
66
  },
67
67
  id: 'S5Y9TWWSK',
68
+ // subscriptionTag: 'new',
68
69
  object: 'subscription',
69
70
  version: 3,
70
71
  started: true,
@@ -183,6 +184,13 @@ export var subscription = {
183
184
  groups: [
184
185
  'member'
185
186
  ],
187
+ maritalStatus: null,
188
+ gender: null,
189
+ emergencyContactName: null,
190
+ emergencyPhoneNumber: null,
191
+ jobTitle: null,
192
+ industry: null,
193
+ estimatedSalary: 10000.2,
186
194
  permissions: [
187
195
  {
188
196
  action: 'read',
@@ -483,7 +491,10 @@ export var subscription = {
483
491
  signUpPaymentAdded: false,
484
492
  activeSub: true,
485
493
  expiredSub: false
486
- }
494
+ },
495
+ companyName: 'FLUX',
496
+ ethnicity: null,
497
+ geoRegion: null
487
498
  },
488
499
  vehicle: {
489
500
  id: 'VM98GEJKS',
@@ -529,6 +540,7 @@ export var subscription = {
529
540
  activeSubscriptionId: 'S5Y9TWWSK',
530
541
  createdAt: new Date('2024-04-01T08:15:04.448Z'),
531
542
  updatedAt: new Date('2024-05-21T07:17:58.621Z'),
543
+ listedAt: new Date('2024-06-21T07:17:58.621Z'),
532
544
  metadata: {},
533
545
  addresses: {
534
546
  return: {
@@ -1070,5 +1082,6 @@ export var subscription = {
1070
1082
  metadata: {},
1071
1083
  expiryNoticeSent: false,
1072
1084
  phases: []
1073
- }
1085
+ },
1086
+ subscriptionTag: 'new'
1074
1087
  };
package/dist/debug.js CHANGED
@@ -127,7 +127,7 @@ import { quotation } from './__mocks__/quotation.js';
127
127
  import { subscription } from './__mocks__/subscription.js';
128
128
  import { generateSubscriptionAgreementPdf } from './templates/SubscriptionAgreement/index.js';
129
129
  import { generateQuotationPdf } from './templates/index.js';
130
- var debugSubscriptionAgreement = function() {
130
+ var debugSubscriptionAgreement = /*#__PURE__*/ function() {
131
131
  var _ref = _async_to_generator(function() {
132
132
  return _ts_generator(this, function(_state) {
133
133
  switch(_state.label){
@@ -156,7 +156,7 @@ var debugSubscriptionAgreement = function() {
156
156
  return _ref.apply(this, arguments);
157
157
  };
158
158
  }();
159
- var debugQuotation = function() {
159
+ var debugQuotation = /*#__PURE__*/ function() {
160
160
  var _ref = _async_to_generator(function() {
161
161
  return _ts_generator(this, function(_state) {
162
162
  switch(_state.label){
@@ -190,7 +190,7 @@ var debugCases = [
190
190
  debugSubscriptionAgreement(),
191
191
  debugQuotation()
192
192
  ];
193
- var debug = function() {
193
+ var debug = /*#__PURE__*/ function() {
194
194
  var _ref = _async_to_generator(function() {
195
195
  var results;
196
196
  return _ts_generator(this, function(_state) {
@@ -1 +1 @@
1
- {"version":3,"file":"Pricing.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/Pricing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAEhE,KAAK,KAAK,GAAG;IACZ,SAAS,EAAE,SAAS,CAAA;IACpB,CAAC,CAAC,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAA;CACtC,CAAA;AAED,QAAA,MAAM,OAAO,EAAE,EAAE,CAAC,KAAK,CA2WtB,CAAA;AAED,eAAe,OAAO,CAAA"}
1
+ {"version":3,"file":"Pricing.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/Pricing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAEhE,KAAK,KAAK,GAAG;IACZ,SAAS,EAAE,SAAS,CAAA;IACpB,CAAC,CAAC,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAA;CACtC,CAAA;AAED,QAAA,MAAM,OAAO,EAAE,EAAE,CAAC,KAAK,CAyVtB,CAAA;AAED,eAAe,OAAO,CAAA"}
@@ -104,44 +104,12 @@ var Pricing = function(param) {
104
104
  ]
105
105
  }, fee.key);
106
106
  }),
107
- quotation.fees.extraCharges.length > 0 && /*#__PURE__*/ _jsx(_Fragment, {
108
- children: quotation.fees.extraCharges.filter(function(charge) {
109
- return charge.amount > 0;
110
- }).filter(function(charge) {
111
- return charge.type === 'upfront';
112
- }).map(function(charge, i) {
113
- return /*#__PURE__*/ _jsxs(View, {
114
- style: {
115
- justifyContent: 'space-between',
116
- flexDirection: 'row',
117
- rowGap: 8
118
- },
119
- children: [
120
- /*#__PURE__*/ _jsxs(Text, {
121
- style: {
122
- paddingRight: 4,
123
- letterSpacing: 1,
124
- color: colors.primary3
125
- },
126
- children: [
127
- t === null || t === void 0 ? void 0 : t.fees.extraCharge,
128
- " - ",
129
- charge.description
130
- ]
131
- }),
132
- /*#__PURE__*/ _jsx(Text, {
133
- style: {
134
- color: colors.primary3,
135
- letterSpacing: 1
136
- },
137
- children: charge.amount.toFixed(2)
138
- })
139
- ]
140
- }, i);
141
- })
142
- }),
143
- quotation.fees.couponCode !== null && quotation.fees.couponType === 'upfront' && /*#__PURE__*/ _jsx(_Fragment, {
144
- children: /*#__PURE__*/ _jsxs(View, {
107
+ quotation.fees.extraCharges.length > 0 && quotation.fees.extraCharges.filter(function(charge) {
108
+ return charge.amount > 0;
109
+ }).filter(function(charge) {
110
+ return charge.type === 'upfront';
111
+ }).map(function(charge, i) {
112
+ return /*#__PURE__*/ _jsxs(View, {
145
113
  style: {
146
114
  justifyContent: 'space-between',
147
115
  flexDirection: 'row',
@@ -155,20 +123,48 @@ var Pricing = function(param) {
155
123
  color: colors.primary3
156
124
  },
157
125
  children: [
158
- t === null || t === void 0 ? void 0 : t.fees.promo,
126
+ t === null || t === void 0 ? void 0 : t.fees.extraCharge,
159
127
  " - ",
160
- quotation.fees.couponCode
128
+ charge.description
161
129
  ]
162
130
  }),
163
131
  /*#__PURE__*/ _jsx(Text, {
164
132
  style: {
165
- color: colors.accent4,
133
+ color: colors.primary3,
166
134
  letterSpacing: 1
167
135
  },
168
- children: (_quotation_fees_discountAmount = quotation.fees.discountAmount) === null || _quotation_fees_discountAmount === void 0 ? void 0 : _quotation_fees_discountAmount.toFixed(2)
136
+ children: charge.amount.toFixed(2)
169
137
  })
170
138
  ]
171
- })
139
+ }, i);
140
+ }),
141
+ quotation.fees.couponCode !== null && quotation.fees.couponType === 'upfront' && /*#__PURE__*/ _jsxs(View, {
142
+ style: {
143
+ justifyContent: 'space-between',
144
+ flexDirection: 'row',
145
+ rowGap: 8
146
+ },
147
+ children: [
148
+ /*#__PURE__*/ _jsxs(Text, {
149
+ style: {
150
+ paddingRight: 4,
151
+ letterSpacing: 1,
152
+ color: colors.primary3
153
+ },
154
+ children: [
155
+ t === null || t === void 0 ? void 0 : t.fees.promo,
156
+ " - ",
157
+ quotation.fees.couponCode
158
+ ]
159
+ }),
160
+ /*#__PURE__*/ _jsx(Text, {
161
+ style: {
162
+ color: colors.accent4,
163
+ letterSpacing: 1
164
+ },
165
+ children: (_quotation_fees_discountAmount = quotation.fees.discountAmount) === null || _quotation_fees_discountAmount === void 0 ? void 0 : _quotation_fees_discountAmount.toFixed(2)
166
+ })
167
+ ]
172
168
  }),
173
169
  /*#__PURE__*/ _jsxs(View, {
174
170
  style: {
@@ -235,42 +231,10 @@ var Pricing = function(param) {
235
231
  ]
236
232
  }, fee.key);
237
233
  }),
238
- quotation.fees.extraCharges.length > 0 && /*#__PURE__*/ _jsx(_Fragment, {
239
- children: quotation.fees.extraCharges.filter(function(charge) {
240
- return charge.type === 'monthly';
241
- }).map(function(charge, i) {
242
- return /*#__PURE__*/ _jsxs(View, {
243
- style: {
244
- justifyContent: 'space-between',
245
- flexDirection: 'row',
246
- rowGap: 8
247
- },
248
- children: [
249
- /*#__PURE__*/ _jsxs(Text, {
250
- style: {
251
- paddingRight: 4,
252
- letterSpacing: 1,
253
- color: colors.primary3
254
- },
255
- children: [
256
- t === null || t === void 0 ? void 0 : t.fees.extraCharge,
257
- " - ",
258
- charge.description
259
- ]
260
- }),
261
- /*#__PURE__*/ _jsx(Text, {
262
- style: {
263
- color: colors.primary3,
264
- letterSpacing: 1
265
- },
266
- children: charge.amount.toFixed(2)
267
- })
268
- ]
269
- }, i);
270
- })
271
- }),
272
- quotation.fees.couponCode !== null && quotation.fees.couponType === 'monthly' && /*#__PURE__*/ _jsx(_Fragment, {
273
- children: /*#__PURE__*/ _jsxs(View, {
234
+ quotation.fees.extraCharges.length > 0 && quotation.fees.extraCharges.filter(function(charge) {
235
+ return charge.type === 'monthly';
236
+ }).map(function(charge, i) {
237
+ return /*#__PURE__*/ _jsxs(View, {
274
238
  style: {
275
239
  justifyContent: 'space-between',
276
240
  flexDirection: 'row',
@@ -284,20 +248,48 @@ var Pricing = function(param) {
284
248
  color: colors.primary3
285
249
  },
286
250
  children: [
287
- t === null || t === void 0 ? void 0 : t.fees.promo,
251
+ t === null || t === void 0 ? void 0 : t.fees.extraCharge,
288
252
  " - ",
289
- quotation.fees.couponCode
253
+ charge.description
290
254
  ]
291
255
  }),
292
256
  /*#__PURE__*/ _jsx(Text, {
293
257
  style: {
294
- color: colors.accent4,
258
+ color: colors.primary3,
295
259
  letterSpacing: 1
296
260
  },
297
- children: (_quotation_fees_discountAmount1 = quotation.fees.discountAmount) === null || _quotation_fees_discountAmount1 === void 0 ? void 0 : _quotation_fees_discountAmount1.toFixed(2)
261
+ children: charge.amount.toFixed(2)
298
262
  })
299
263
  ]
300
- })
264
+ }, i);
265
+ }),
266
+ quotation.fees.couponCode !== null && quotation.fees.couponType === 'monthly' && /*#__PURE__*/ _jsxs(View, {
267
+ style: {
268
+ justifyContent: 'space-between',
269
+ flexDirection: 'row',
270
+ rowGap: 8
271
+ },
272
+ children: [
273
+ /*#__PURE__*/ _jsxs(Text, {
274
+ style: {
275
+ paddingRight: 4,
276
+ letterSpacing: 1,
277
+ color: colors.primary3
278
+ },
279
+ children: [
280
+ t === null || t === void 0 ? void 0 : t.fees.promo,
281
+ " - ",
282
+ quotation.fees.couponCode
283
+ ]
284
+ }),
285
+ /*#__PURE__*/ _jsx(Text, {
286
+ style: {
287
+ color: colors.accent4,
288
+ letterSpacing: 1
289
+ },
290
+ children: (_quotation_fees_discountAmount1 = quotation.fees.discountAmount) === null || _quotation_fees_discountAmount1 === void 0 ? void 0 : _quotation_fees_discountAmount1.toFixed(2)
291
+ })
292
+ ]
301
293
  }),
302
294
  /*#__PURE__*/ _jsxs(View, {
303
295
  style: {
@@ -325,106 +317,104 @@ var Pricing = function(param) {
325
317
  })
326
318
  ]
327
319
  }),
328
- bottomContent: /*#__PURE__*/ _jsx(_Fragment, {
329
- children: /*#__PURE__*/ _jsxs(View, {
330
- style: {
331
- rowGap: 16
332
- },
333
- children: [
334
- /*#__PURE__*/ _jsx(Text, {
335
- style: {
336
- textTransform: 'uppercase',
337
- fontSize: 12,
338
- fontWeight: 'bold',
339
- letterSpacing: 1
340
- },
341
- children: t === null || t === void 0 ? void 0 : t.fees.dueToday.title
342
- }),
343
- /*#__PURE__*/ _jsx(Text, {
344
- style: {
345
- color: colors.primary3,
346
- letterSpacing: 1
347
- },
348
- children: t === null || t === void 0 ? void 0 : t.fees.dueToday.description
349
- }),
350
- /*#__PURE__*/ _jsxs(View, {
351
- style: {
352
- justifyContent: 'space-between',
353
- flexDirection: 'row'
354
- },
355
- children: [
356
- /*#__PURE__*/ _jsxs(Text, {
357
- style: {
358
- letterSpacing: 1,
359
- color: colors.primary3
360
- },
361
- children: [
362
- ' ',
363
- t === null || t === void 0 ? void 0 : t.fees.dueToday.subTotal
364
- ]
365
- }),
366
- /*#__PURE__*/ _jsx(Text, {
367
- style: {
368
- letterSpacing: 1,
369
- color: colors.primary3
370
- },
371
- children: quotation.fees.amountBeforeTax.toFixed(2)
372
- })
373
- ]
374
- }),
375
- /*#__PURE__*/ _jsxs(View, {
376
- style: {
377
- justifyContent: 'space-between',
378
- flexDirection: 'row'
379
- },
380
- children: [
381
- /*#__PURE__*/ _jsxs(Text, {
382
- style: {
383
- letterSpacing: 1,
384
- color: colors.primary3
385
- },
386
- children: [
387
- ' ',
388
- t === null || t === void 0 ? void 0 : t.fees.dueToday.serviceFee
389
- ]
390
- }),
391
- /*#__PURE__*/ _jsx(Text, {
392
- style: {
393
- letterSpacing: 1,
394
- color: colors.primary3
395
- },
396
- children: quotation.fees.taxAmount.toFixed(2)
397
- })
398
- ]
399
- }),
400
- /*#__PURE__*/ _jsxs(View, {
401
- style: {
402
- backgroundColor: colors.primary1,
403
- borderTop: "1px solid ".concat(colors.primary1),
404
- justifyContent: 'space-between',
405
- flexDirection: 'row',
406
- padding: 4
407
- },
408
- children: [
409
- /*#__PURE__*/ _jsx(Text, {
410
- style: {
411
- letterSpacing: 1,
412
- paddingRight: 4,
413
- fontWeight: 'bold'
414
- },
415
- children: t === null || t === void 0 ? void 0 : t.fees.dueToday.grandTotal
416
- }),
417
- /*#__PURE__*/ _jsx(Text, {
418
- style: {
419
- letterSpacing: 1,
420
- fontWeight: 'bold'
421
- },
422
- children: formatMoney(quotation.fees.amountAfterTax)
423
- })
424
- ]
425
- })
426
- ]
427
- })
320
+ bottomContent: /*#__PURE__*/ _jsxs(View, {
321
+ style: {
322
+ rowGap: 16
323
+ },
324
+ children: [
325
+ /*#__PURE__*/ _jsx(Text, {
326
+ style: {
327
+ textTransform: 'uppercase',
328
+ fontSize: 12,
329
+ fontWeight: 'bold',
330
+ letterSpacing: 1
331
+ },
332
+ children: t === null || t === void 0 ? void 0 : t.fees.dueToday.title
333
+ }),
334
+ /*#__PURE__*/ _jsx(Text, {
335
+ style: {
336
+ color: colors.primary3,
337
+ letterSpacing: 1
338
+ },
339
+ children: t === null || t === void 0 ? void 0 : t.fees.dueToday.description
340
+ }),
341
+ /*#__PURE__*/ _jsxs(View, {
342
+ style: {
343
+ justifyContent: 'space-between',
344
+ flexDirection: 'row'
345
+ },
346
+ children: [
347
+ /*#__PURE__*/ _jsxs(Text, {
348
+ style: {
349
+ letterSpacing: 1,
350
+ color: colors.primary3
351
+ },
352
+ children: [
353
+ ' ',
354
+ t === null || t === void 0 ? void 0 : t.fees.dueToday.subTotal
355
+ ]
356
+ }),
357
+ /*#__PURE__*/ _jsx(Text, {
358
+ style: {
359
+ letterSpacing: 1,
360
+ color: colors.primary3
361
+ },
362
+ children: quotation.fees.amountBeforeTax.toFixed(2)
363
+ })
364
+ ]
365
+ }),
366
+ /*#__PURE__*/ _jsxs(View, {
367
+ style: {
368
+ justifyContent: 'space-between',
369
+ flexDirection: 'row'
370
+ },
371
+ children: [
372
+ /*#__PURE__*/ _jsxs(Text, {
373
+ style: {
374
+ letterSpacing: 1,
375
+ color: colors.primary3
376
+ },
377
+ children: [
378
+ ' ',
379
+ t === null || t === void 0 ? void 0 : t.fees.dueToday.serviceFee
380
+ ]
381
+ }),
382
+ /*#__PURE__*/ _jsx(Text, {
383
+ style: {
384
+ letterSpacing: 1,
385
+ color: colors.primary3
386
+ },
387
+ children: quotation.fees.taxAmount.toFixed(2)
388
+ })
389
+ ]
390
+ }),
391
+ /*#__PURE__*/ _jsxs(View, {
392
+ style: {
393
+ backgroundColor: colors.primary1,
394
+ borderTop: "1px solid ".concat(colors.primary1),
395
+ justifyContent: 'space-between',
396
+ flexDirection: 'row',
397
+ padding: 4
398
+ },
399
+ children: [
400
+ /*#__PURE__*/ _jsx(Text, {
401
+ style: {
402
+ letterSpacing: 1,
403
+ paddingRight: 4,
404
+ fontWeight: 'bold'
405
+ },
406
+ children: t === null || t === void 0 ? void 0 : t.fees.dueToday.grandTotal
407
+ }),
408
+ /*#__PURE__*/ _jsx(Text, {
409
+ style: {
410
+ letterSpacing: 1,
411
+ fontWeight: 'bold'
412
+ },
413
+ children: formatMoney(quotation.fees.amountAfterTax)
414
+ })
415
+ ]
416
+ })
417
+ ]
428
418
  })
429
419
  })
430
420
  });
@@ -0,0 +1,10 @@
1
+ import type { Quotation } from '@driveflux/db';
2
+ import type { FC } from 'react';
3
+ import type { QuotationPdfTranslation } from './translations.js';
4
+ type Props = {
5
+ quotation: Quotation;
6
+ t?: QuotationPdfTranslation['vehiclePhotos'];
7
+ };
8
+ declare const VehiclePhotos: FC<Props>;
9
+ export default VehiclePhotos;
10
+ //# sourceMappingURL=VehiclePhotos.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VehiclePhotos.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/VehiclePhotos.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAGhE,KAAK,KAAK,GAAG;IACZ,SAAS,EAAE,SAAS,CAAA;IACpB,CAAC,CAAC,EAAE,uBAAuB,CAAC,eAAe,CAAC,CAAA;CAC5C,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,KAAK,CAgE5B,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -0,0 +1,66 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Image, Text, View } from '@react-pdf/renderer';
3
+ import { colors } from '../../theme/colors.js';
4
+ import { getInspectionTypeTranslation } from './utils.js';
5
+ var VehiclePhotos = function(param) {
6
+ var quotation = param.quotation, t = param.t;
7
+ var images = quotation.images;
8
+ return /*#__PURE__*/ _jsxs(View, {
9
+ style: {
10
+ border: "1px solid ".concat(colors.primary2),
11
+ padding: 16
12
+ },
13
+ children: [
14
+ /*#__PURE__*/ _jsx(Text, {
15
+ style: {
16
+ textTransform: 'uppercase',
17
+ fontSize: 12,
18
+ fontWeight: 'bold',
19
+ marginBottom: 16
20
+ },
21
+ children: t === null || t === void 0 ? void 0 : t.title
22
+ }),
23
+ /*#__PURE__*/ _jsx(View, {
24
+ style: {
25
+ display: 'flex',
26
+ flexDirection: 'row',
27
+ flexWrap: 'wrap',
28
+ gap: 15
29
+ },
30
+ children: images.map(function(image) {
31
+ return /*#__PURE__*/ _jsx(_Fragment, {
32
+ children: /*#__PURE__*/ _jsxs(View, {
33
+ style: {
34
+ overflow: 'hidden',
35
+ alignItems: 'center',
36
+ gap: 4
37
+ },
38
+ children: [
39
+ /*#__PURE__*/ _jsx(View, {
40
+ children: /*#__PURE__*/ _jsx(Image, {
41
+ // @ts-ignore
42
+ source: image.default,
43
+ style: {
44
+ objectFit: 'cover',
45
+ height: 90,
46
+ width: 150
47
+ }
48
+ })
49
+ }),
50
+ image.inspectionType && /*#__PURE__*/ _jsx(Text, {
51
+ style: {
52
+ color: colors.black,
53
+ fontSize: 10,
54
+ textAlign: 'center'
55
+ },
56
+ children: getInspectionTypeTranslation(image.inspectionType)
57
+ })
58
+ ]
59
+ }, image.default)
60
+ });
61
+ })
62
+ })
63
+ ]
64
+ });
65
+ };
66
+ export default VehiclePhotos;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAclE,KAAK,OAAO,GAAG;IACd,MAAM,CAAC,EAAE,4BAA4B,CAAA;IACrC,SAAS,EAAE,SAAS,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,oBAAoB,0BACF,OAAO,aAC1B,MAAM,oBAMjB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAelE,KAAK,OAAO,GAAG;IACd,MAAM,CAAC,EAAE,4BAA4B,CAAA;IACrC,SAAS,EAAE,SAAS,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,oBAAoB,0BACF,OAAO,aAC1B,MAAM,oBAMjB,CAAA"}
@@ -131,8 +131,9 @@ import GFV from './GFV.js';
131
131
  import Pricing from './Pricing.js';
132
132
  import QuotationPdfPage from './QuotationPdfPage.js';
133
133
  import TermsSection from './TermsSection.js';
134
+ import VehiclePhotos from './VehiclePhotos.js';
134
135
  import { useTranslations } from './translations.js';
135
- export var generateQuotationPdf = function() {
136
+ export var generateQuotationPdf = /*#__PURE__*/ function() {
136
137
  var _ref = _async_to_generator(function(param, fileName) {
137
138
  var _param_locale, locale, quotation;
138
139
  return _ts_generator(this, function(_state) {
@@ -188,6 +189,10 @@ var QuotationPDF = function(param) {
188
189
  quotation: quotation,
189
190
  t: t.pricing
190
191
  }),
192
+ /*#__PURE__*/ _jsx(VehiclePhotos, {
193
+ quotation: quotation,
194
+ t: t.vehiclePhotos
195
+ }),
191
196
  /*#__PURE__*/ _jsx(TermsSection, {
192
197
  t: t.terms
193
198
  })
@@ -56,6 +56,9 @@ declare const enTranslation: {
56
56
  title: string;
57
57
  content: string[];
58
58
  };
59
+ vehiclePhotos: {
60
+ title: string;
61
+ };
59
62
  };
60
63
  export type QuotationPdfTranslation = typeof enTranslation;
61
64
  export declare const useTranslations: (locale: "en") => QuotationPdfTranslation;
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/translations.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;yCA+Ba,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CrC,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,OAAO,aAAa,CAAA;AAE1D,eAAO,MAAM,eAAe,WAAY,IAAI,KAAG,uBAK9C,CAAA"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/translations.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;yCA+Ba,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDrC,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,OAAO,aAAa,CAAA;AAE1D,eAAO,MAAM,eAAe,WAAY,IAAI,KAAG,uBAK9C,CAAA"}
@@ -89,6 +89,9 @@ var enTranslation = {
89
89
  'All monthly recurring fees are billed on the same date as the delivery of the vehicle.',
90
90
  'Scheduling delivery will only commence Grand Total is fully paid, 7 - 30+ days after payment and subject to vehicle availability.'
91
91
  ]
92
+ },
93
+ vehiclePhotos: {
94
+ title: 'Vehicle Photos'
92
95
  }
93
96
  };
94
97
  export var useTranslations = function(locale) {
@@ -1,7 +1,9 @@
1
- import type { MileagePackage, PlanType } from '@driveflux/db';
1
+ import type { MileagePackage, PlanType, VehicleType } from '@driveflux/db';
2
+ import type { INSPECTION_TYPES } from '@driveflux/db/models/vehicle';
2
3
  import type { Address } from '@driveflux/db/types';
3
4
  export declare const formatAddress: (originalAddress: Address) => string;
4
5
  export declare const getSimplifiedPlanTranslation: (plan: PlanType) => "60 Months" | "36 Months" | "24 Months" | "12 Months" | "Monthly" | "Weekly" | "Unknown Plan";
5
6
  export declare const getMileagePackageTranslation: (mileagePackage?: MileagePackage) => "Lite" | "Standard" | "Plus" | "Unlimited" | "Unknown Mileage Package";
6
7
  export declare const getFullMileagePackageTranslation: (plan?: MileagePackage | null) => "Unlimited" | "Unknown Mileage Package" | "Lite - 1,250KM" | "Standard - 2,000KM" | "Plus - 2,750KM";
8
+ export declare const getInspectionTypeTranslation: (inspectionType?: (typeof INSPECTION_TYPES)[VehicleType][number]) => "Exterior" | "Interior" | "Engine" | "Frame" | "Dashboard" | undefined;
7
9
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,eAAO,MAAM,aAAa,oBAAqB,OAAO,WAMrD,CAAA;AAED,eAAO,MAAM,4BAA4B,SAAU,QAAQ,kGAiB1D,CAAA;AAED,eAAO,MAAM,4BAA4B,oBACvB,cAAc,2EAc/B,CAAA;AAED,eAAO,MAAM,gCAAgC,UACrC,cAAc,GAAG,IAAI,yGAc5B,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,eAAO,MAAM,aAAa,oBAAqB,OAAO,WAMrD,CAAA;AAED,eAAO,MAAM,4BAA4B,SAAU,QAAQ,kGAiB1D,CAAA;AAED,eAAO,MAAM,4BAA4B,oBACvB,cAAc,2EAc/B,CAAA;AAED,eAAO,MAAM,gCAAgC,UACrC,cAAc,GAAG,IAAI,yGAc5B,CAAA;AAED,eAAO,MAAM,4BAA4B,oBACvB,CAAC,OAAO,gBAAgB,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC,2EAgB/D,CAAA"}
@@ -82,3 +82,19 @@ export var getFullMileagePackageTranslation = function(plan) {
82
82
  return 'Unknown Mileage Package';
83
83
  }
84
84
  };
85
+ export var getInspectionTypeTranslation = function(inspectionType) {
86
+ switch(inspectionType){
87
+ case 'exterior':
88
+ return 'Exterior';
89
+ case 'interior':
90
+ return 'Interior';
91
+ case 'engine':
92
+ return 'Engine';
93
+ case 'frame':
94
+ return 'Frame';
95
+ case 'dashboard':
96
+ return 'Dashboard';
97
+ default:
98
+ return inspectionType;
99
+ }
100
+ };
@@ -184,7 +184,7 @@ import Details from './Details.js';
184
184
  import SubscriptionAgreementPage from './SubscriptionAgreementPage.js';
185
185
  import TermsOfUse from './TermsOfUse.js';
186
186
  import { useTranslations } from './translations.js';
187
- export var generateSubscriptionAgreementPdf = function() {
187
+ export var generateSubscriptionAgreementPdf = /*#__PURE__*/ function() {
188
188
  var _ref = _async_to_generator(function(param, fileName) {
189
189
  var _param_locale, locale, subscription;
190
190
  return _ts_generator(this, function(_state) {
package/dist/utils.js CHANGED
@@ -128,7 +128,7 @@ import ReactPDF from '@react-pdf/renderer';
128
128
  * @param document React PDF Document element
129
129
  * @param fileName DO NOT USE THIS IN NEXT.JS APP, as Vercel does not allow us to amend files. This will generate a PDF file in the given fileName
130
130
  * @returns PDF Buffer
131
- */ export var toPdf = function() {
131
+ */ export var toPdf = /*#__PURE__*/ function() {
132
132
  var _ref = _async_to_generator(function(document, fileName) {
133
133
  var stream;
134
134
  return _ts_generator(this, function(_state) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@driveflux/pdf",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -12,26 +12,26 @@
12
12
  "dist"
13
13
  ],
14
14
  "dependencies": {
15
- "@driveflux/db": "1.7.0",
15
+ "@driveflux/db": "1.8.2",
16
16
  "@driveflux/env": "1.3.0",
17
17
  "@driveflux/format-money": "5.3.0",
18
18
  "@driveflux/time": "4.3.0",
19
- "@react-pdf/renderer": "^3.4.4",
19
+ "@react-pdf/renderer": "^4.0.0",
20
20
  "date-fns": "^3.6.0",
21
- "nodemon": "^3.1.4",
21
+ "nodemon": "^3.1.7",
22
22
  "react": "^18.3.1"
23
23
  },
24
24
  "devDependencies": {
25
- "@babel/preset-env": "^7.24.8",
25
+ "@babel/preset-env": "^7.25.8",
26
26
  "@driveflux/fab": "2.3.0",
27
27
  "@driveflux/tsconfig": "1.3.0",
28
- "@swc/cli": "^0.4.0",
29
- "@swc/core": "1.7.2",
30
- "@types/node": "^20.14.12",
31
- "@types/react": "^18.3.3",
32
- "del-cli": "^5.1.0",
28
+ "@swc/cli": "0.4.1-nightly.20240914",
29
+ "@swc/core": "1.7.39",
30
+ "@types/node": "^22.7.8",
31
+ "@types/react": "^18.3.11",
32
+ "del-cli": "^6.0.0",
33
33
  "react": "^18.3.1",
34
- "typescript": "^5.5.4"
34
+ "typescript": "^5.6.3"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "react": "^18.3.1"