@driveflux/pdf 1.6.64 → 1.6.65
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/dist/__mocks__/quotation.js +11 -10
- package/dist/__mocks__/subscription.d.ts +2 -0
- package/dist/__mocks__/subscription.d.ts.map +1 -1
- package/dist/__mocks__/subscription.js +148 -399
- package/dist/__mocks__/subscription.js.map +1 -1
- package/dist/__mocks__/tou.js +10 -9
- package/dist/components/FluxLogo.js +3 -62
- package/dist/components/StandardPage.js +8 -97
- package/dist/debug.js +30 -221
- package/dist/debug.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +27 -145
- package/dist/templates/QuotationPdf/GFV.js +12 -49
- package/dist/templates/QuotationPdf/Header.js +5 -63
- package/dist/templates/QuotationPdf/Pricing.js +201 -573
- package/dist/templates/QuotationPdf/QuotationPdfPage.js +3 -23
- package/dist/templates/QuotationPdf/SectionBoxNew.js +4 -34
- package/dist/templates/QuotationPdf/TermsSection.js +5 -42
- package/dist/templates/QuotationPdf/VehiclePhotos.js +24 -54
- package/dist/templates/QuotationPdf/index.js +11 -198
- package/dist/templates/QuotationPdf/translations.js +22 -34
- package/dist/templates/QuotationPdf/utils.js +29 -59
- package/dist/templates/SubscriptionAgreement/Confirmation.d.ts +2 -0
- package/dist/templates/SubscriptionAgreement/Confirmation.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/Confirmation.js +11 -66
- package/dist/templates/SubscriptionAgreement/Confirmation.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/CoverPage.js +10 -77
- package/dist/templates/SubscriptionAgreement/CoverPageSection.js +5 -16
- package/dist/templates/SubscriptionAgreement/Details.js +43 -69
- package/dist/templates/SubscriptionAgreement/Footer.js +6 -48
- package/dist/templates/SubscriptionAgreement/Header.js +5 -35
- package/dist/templates/SubscriptionAgreement/LabelValue.js +3 -25
- package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +3 -26
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +9 -97
- package/dist/templates/SubscriptionAgreement/index.d.ts +3 -1
- package/dist/templates/SubscriptionAgreement/index.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/index.js +4 -4
- package/dist/templates/SubscriptionAgreement/index.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/translations.js +193 -194
- package/dist/templates/SubscriptionAgreement/types.js +2 -1
- package/dist/templates/SubscriptionAgreement/utils.js +5 -3
- package/dist/templates/index.js +1 -0
- package/dist/theme/colors.js +63 -44
- package/dist/theme/index.js +1 -0
- package/dist/types.js +2 -1
- package/dist/utils.js +16 -166
- package/dist/watch.js +4 -3
- package/package.json +1 -1
|
@@ -1,44 +1,13 @@
|
|
|
1
|
-
function _object_without_properties(source, excluded) {
|
|
2
|
-
if (source == null) return {};
|
|
3
|
-
var target = _object_without_properties_loose(source, excluded);
|
|
4
|
-
var key, i;
|
|
5
|
-
if (Object.getOwnPropertySymbols) {
|
|
6
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
7
|
-
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
8
|
-
key = sourceSymbolKeys[i];
|
|
9
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
10
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
11
|
-
target[key] = source[key];
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
}
|
|
16
|
-
function _object_without_properties_loose(source, excluded) {
|
|
17
|
-
if (source == null) return {};
|
|
18
|
-
var target = {};
|
|
19
|
-
var sourceKeys = Object.keys(source);
|
|
20
|
-
var key, i;
|
|
21
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
22
|
-
key = sourceKeys[i];
|
|
23
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
24
|
-
target[key] = source[key];
|
|
25
|
-
}
|
|
26
|
-
return target;
|
|
27
|
-
}
|
|
28
1
|
import { formatMoney } from '@driveflux/format-money';
|
|
29
|
-
export
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return key !== 'name' && !!address[key];
|
|
36
|
-
}).map(function(a) {
|
|
37
|
-
return address[a];
|
|
38
|
-
}).join(', ');
|
|
2
|
+
export const formatAddress = (originalAddress) => {
|
|
3
|
+
const { coordinates, metadata, ...address } = originalAddress;
|
|
4
|
+
return Object.keys(address)
|
|
5
|
+
.filter((key) => key !== 'name' && !!address[key])
|
|
6
|
+
.map((a) => address[a])
|
|
7
|
+
.join(', ');
|
|
39
8
|
};
|
|
40
|
-
export
|
|
41
|
-
switch(plan){
|
|
9
|
+
export const getSimplifiedPlanTranslation = (plan) => {
|
|
10
|
+
switch (plan) {
|
|
42
11
|
case 'plan60':
|
|
43
12
|
return '60 Months';
|
|
44
13
|
case 'plan36':
|
|
@@ -55,8 +24,8 @@ export var getSimplifiedPlanTranslation = function(plan) {
|
|
|
55
24
|
return 'Unknown Plan';
|
|
56
25
|
}
|
|
57
26
|
};
|
|
58
|
-
export
|
|
59
|
-
switch(mileagePackage){
|
|
27
|
+
export const getMileagePackageTranslation = (mileagePackage) => {
|
|
28
|
+
switch (mileagePackage) {
|
|
60
29
|
case 'lite':
|
|
61
30
|
return 'Lite';
|
|
62
31
|
case 'standard':
|
|
@@ -69,8 +38,8 @@ export var getMileagePackageTranslation = function(mileagePackage) {
|
|
|
69
38
|
return 'Unknown Mileage Package';
|
|
70
39
|
}
|
|
71
40
|
};
|
|
72
|
-
export
|
|
73
|
-
switch(plan){
|
|
41
|
+
export const getFullMileagePackageTranslation = (plan) => {
|
|
42
|
+
switch (plan) {
|
|
74
43
|
case 'lite':
|
|
75
44
|
return 'Lite - 1,250KM';
|
|
76
45
|
case 'standard':
|
|
@@ -83,25 +52,25 @@ export var getFullMileagePackageTranslation = function(plan) {
|
|
|
83
52
|
return 'Unknown Mileage Package';
|
|
84
53
|
}
|
|
85
54
|
};
|
|
86
|
-
export
|
|
87
|
-
|
|
88
|
-
switch(discountType){
|
|
55
|
+
export const getPromoNotes = (amount, discount) => {
|
|
56
|
+
const { discountType, discountValue, maxRedemptions } = discount;
|
|
57
|
+
switch (discountType) {
|
|
89
58
|
case 'percentage':
|
|
90
|
-
return
|
|
91
|
-
case 'fixed':
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
59
|
+
return `Enjoy ${discountValue * 100}% off for ${maxRedemptions} month(s) for this vehicle.`;
|
|
60
|
+
case 'fixed': {
|
|
61
|
+
const money = formatMoney(discountValue);
|
|
62
|
+
return amount <= 0
|
|
63
|
+
? `Enjoy free for ${maxRedemptions} month(s).`
|
|
64
|
+
: `Enjoy ${money} off for the first ${maxRedemptions} month(s), then your subscription will switch to the regular price.`;
|
|
65
|
+
}
|
|
66
|
+
case 'forceAmount': {
|
|
67
|
+
const money = formatMoney(Math.min(amount, discountValue));
|
|
68
|
+
return `Enjoy only ${money} for ${maxRedemptions} month(s), then your subscription will switch to the regular price.`;
|
|
69
|
+
}
|
|
101
70
|
}
|
|
102
71
|
};
|
|
103
|
-
export
|
|
104
|
-
switch(inspectionType){
|
|
72
|
+
export const getInspectionTypeTranslation = (inspectionType) => {
|
|
73
|
+
switch (inspectionType) {
|
|
105
74
|
case 'exterior':
|
|
106
75
|
return 'Exterior';
|
|
107
76
|
case 'interior':
|
|
@@ -116,3 +85,4 @@ export var getInspectionTypeTranslation = function(inspectionType) {
|
|
|
116
85
|
return inspectionType;
|
|
117
86
|
}
|
|
118
87
|
};
|
|
88
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { SubscriptionSignature } from '@driveflux/db';
|
|
1
2
|
import type { SubscriptionWithUser, SubscriptionWithVehicle } from '@driveflux/db/types';
|
|
2
3
|
import type { FC } from 'react';
|
|
3
4
|
import type { SubscriptionAgreementTranslation } from './translations.js';
|
|
4
5
|
type Props = {
|
|
5
6
|
tConfirmation: SubscriptionAgreementTranslation['confirmation'];
|
|
6
7
|
subscription: SubscriptionWithUser & SubscriptionWithVehicle;
|
|
8
|
+
signature: SubscriptionSignature;
|
|
7
9
|
};
|
|
8
10
|
declare const Confirmation: FC<Props>;
|
|
9
11
|
export default Confirmation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Confirmation.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/Confirmation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Confirmation.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/Confirmation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAE1D,OAAO,KAAK,EACX,oBAAoB,EACpB,uBAAuB,EACvB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAA;AAEzE,KAAK,KAAK,GAAG;IACZ,aAAa,EAAE,gCAAgC,CAAC,cAAc,CAAC,CAAA;IAC/D,YAAY,EAAE,oBAAoB,GAAG,uBAAuB,CAAA;IAC5D,SAAS,EAAE,qBAAqB,CAAA;CAChC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,KAAK,CAgE3B,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -4,77 +4,22 @@ import { Image, Text, View } from '@react-pdf/renderer';
|
|
|
4
4
|
import { format } from 'date-fns';
|
|
5
5
|
import { colors } from '../../theme/index.js';
|
|
6
6
|
import LabelValue from './LabelValue.js';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _subscription_signature, _subscription_user_identification;
|
|
10
|
-
if (!((_subscription_signature = subscription.signature) === null || _subscription_signature === void 0 ? void 0 : _subscription_signature.signature)) {
|
|
7
|
+
const Confirmation = ({ tConfirmation, subscription, signature, }) => {
|
|
8
|
+
if (!signature.signature) {
|
|
11
9
|
throw new Error('Missing signature');
|
|
12
10
|
}
|
|
13
|
-
|
|
14
|
-
return
|
|
15
|
-
style: {
|
|
16
|
-
borderLeft: border,
|
|
17
|
-
borderRight: border,
|
|
18
|
-
borderBottom: border
|
|
19
|
-
},
|
|
20
|
-
children: [
|
|
21
|
-
/*#__PURE__*/ _jsx(View, {
|
|
22
|
-
style: {
|
|
11
|
+
const border = `1px solid ${colors.primary2}`;
|
|
12
|
+
return (_jsxs(View, { style: { borderLeft: border, borderRight: border, borderBottom: border }, children: [_jsx(View, { style: {
|
|
23
13
|
backgroundColor: colors.primary1,
|
|
24
14
|
borderTop: border,
|
|
25
|
-
padding: 8
|
|
26
|
-
},
|
|
27
|
-
children: /*#__PURE__*/ _jsx(Text, {
|
|
28
|
-
style: {
|
|
15
|
+
padding: 8,
|
|
16
|
+
}, children: _jsx(Text, { style: {
|
|
29
17
|
fontWeight: 'bold',
|
|
30
18
|
textTransform: 'uppercase',
|
|
31
|
-
letterSpacing: 1
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}),
|
|
36
|
-
/*#__PURE__*/ _jsxs(View, {
|
|
37
|
-
style: {
|
|
38
|
-
padding: 8,
|
|
39
|
-
paddingBottom: 16,
|
|
40
|
-
rowGap: 8,
|
|
41
|
-
borderTop: border
|
|
42
|
-
},
|
|
43
|
-
children: [
|
|
44
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
45
|
-
children: tConfirmation.agreementText(subscription.businessId ? 'business' : 'member')
|
|
46
|
-
}),
|
|
47
|
-
/*#__PURE__*/ _jsx(View, {
|
|
48
|
-
style: {
|
|
49
|
-
height: 160,
|
|
50
|
-
alignItems: 'flex-start'
|
|
51
|
-
},
|
|
52
|
-
children: /*#__PURE__*/ _jsx(Image, {
|
|
53
|
-
src: subscription.signature.signature
|
|
54
|
-
})
|
|
55
|
-
}),
|
|
56
|
-
/*#__PURE__*/ _jsxs(View, {
|
|
57
|
-
style: {
|
|
58
|
-
rowGap: 8
|
|
59
|
-
},
|
|
60
|
-
children: [
|
|
61
|
-
/*#__PURE__*/ _jsx(LabelValue, {
|
|
62
|
-
label: tConfirmation.name,
|
|
63
|
-
value: userName(subscription.user)
|
|
64
|
-
}),
|
|
65
|
-
/*#__PURE__*/ _jsx(LabelValue, {
|
|
66
|
-
label: tConfirmation.idOrPassportNo,
|
|
67
|
-
value: (_subscription_user_identification = subscription.user.identification) === null || _subscription_user_identification === void 0 ? void 0 : _subscription_user_identification.number
|
|
68
|
-
}),
|
|
69
|
-
/*#__PURE__*/ _jsx(LabelValue, {
|
|
70
|
-
label: tConfirmation.date,
|
|
71
|
-
value: subscription.signature.signedAt ? format(subscription.signature.signedAt, 'dd-MM-yyyy hh:mm a') : undefined
|
|
72
|
-
})
|
|
73
|
-
]
|
|
74
|
-
})
|
|
75
|
-
]
|
|
76
|
-
})
|
|
77
|
-
]
|
|
78
|
-
});
|
|
19
|
+
letterSpacing: 1,
|
|
20
|
+
}, children: tConfirmation.title }) }), _jsxs(View, { style: { padding: 8, paddingBottom: 16, rowGap: 8, borderTop: border }, children: [_jsx(Text, { children: tConfirmation.agreementText(subscription.businessId ? 'business' : 'member') }), _jsx(View, { style: { height: 160, alignItems: 'flex-start' }, children: _jsx(Image, { src: signature.signature || '' }) }), _jsxs(View, { style: { rowGap: 8 }, children: [_jsx(LabelValue, { label: tConfirmation.name, value: userName(subscription.user) }), _jsx(LabelValue, { label: tConfirmation.idOrPassportNo, value: subscription.user.identification?.number }), _jsx(LabelValue, { label: tConfirmation.date, value: signature.signedAt
|
|
21
|
+
? format(signature.signedAt, 'dd-MM-yyyy hh:mm a')
|
|
22
|
+
: undefined })] })] })] }));
|
|
79
23
|
};
|
|
80
24
|
export default Confirmation;
|
|
25
|
+
//# sourceMappingURL=Confirmation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Confirmation.js","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/Confirmation.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Confirmation.js","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/Confirmation.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAKpD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,UAAU,MAAM,iBAAiB,CAAA;AASxC,MAAM,YAAY,GAAc,CAAC,EAChC,aAAa,EACb,YAAY,EACZ,SAAS,GACT,EAAE,EAAE;IACJ,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;IACrC,CAAC;IAED,MAAM,MAAM,GAAG,aAAa,MAAM,CAAC,QAAQ,EAAE,CAAA;IAE7C,OAAO,CACN,MAAC,IAAI,IACJ,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,aAExE,KAAC,IAAI,IACJ,KAAK,EAAE;oBACN,eAAe,EAAE,MAAM,CAAC,QAAQ;oBAChC,SAAS,EAAE,MAAM;oBACjB,OAAO,EAAE,CAAC;iBACV,YAED,KAAC,IAAI,IACJ,KAAK,EAAE;wBACN,UAAU,EAAE,MAAM;wBAClB,aAAa,EAAE,WAAW;wBAC1B,aAAa,EAAE,CAAC;qBAChB,YAEA,aAAa,CAAC,KAAK,GACd,GACD,EACP,MAAC,IAAI,IACJ,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,aAEtE,KAAC,IAAI,cACH,aAAa,CAAC,aAAa,CAC3B,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAC/C,GACK,EACP,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,YAAY,EAAE,YACrD,KAAC,KAAK,IAAC,GAAG,EAAE,SAAS,CAAC,SAAS,IAAI,EAAE,GAAI,GACnC,EACP,MAAC,IAAI,IAAC,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,aACzB,KAAC,UAAU,IACV,KAAK,EAAE,aAAa,CAAC,IAAI,EACzB,KAAK,EAAE,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,GACjC,EACF,KAAC,UAAU,IACV,KAAK,EAAE,aAAa,CAAC,cAAc,EACnC,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,GAC9C,EACF,KAAC,UAAU,IACV,KAAK,EAAE,aAAa,CAAC,IAAI,EACzB,KAAK,EACJ,SAAS,CAAC,QAAQ;oCACjB,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,oBAAoB,CAAC;oCAClD,CAAC,CAAC,SAAS,GAEZ,IACI,IACD,IACD,CACP,CAAA;AACF,CAAC,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -5,91 +5,24 @@ import { format } from 'date-fns';
|
|
|
5
5
|
import { colors } from '../../theme/colors.js';
|
|
6
6
|
import CoverPageSection from './CoverPageSection.js';
|
|
7
7
|
import LabelValue from './LabelValue.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _user_identification;
|
|
11
|
-
return /*#__PURE__*/ _jsxs(View, {
|
|
12
|
-
style: {
|
|
13
|
-
flex: 1,
|
|
14
|
-
paddingVertical: 80,
|
|
15
|
-
justifyContent: 'space-between'
|
|
16
|
-
},
|
|
17
|
-
children: [
|
|
18
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
19
|
-
style: {
|
|
8
|
+
const CoverPage = ({ tTitle, tCover, signedAt, user }) => {
|
|
9
|
+
return (_jsxs(View, { style: { flex: 1, paddingVertical: 80, justifyContent: 'space-between' }, children: [_jsx(Text, { style: {
|
|
20
10
|
fontWeight: 'bold',
|
|
21
11
|
fontSize: 40,
|
|
22
12
|
textTransform: 'uppercase',
|
|
23
|
-
flex: 1
|
|
24
|
-
},
|
|
25
|
-
children: tTitle
|
|
26
|
-
}),
|
|
27
|
-
/*#__PURE__*/ _jsxs(View, {
|
|
28
|
-
style: {
|
|
13
|
+
flex: 1,
|
|
14
|
+
}, children: tTitle }), _jsxs(View, { style: {
|
|
29
15
|
padding: 16,
|
|
30
16
|
rowGap: 32,
|
|
31
|
-
border:
|
|
32
|
-
fontSize: 10
|
|
33
|
-
},
|
|
34
|
-
children: [
|
|
35
|
-
/*#__PURE__*/ _jsx(CoverPageSection, {
|
|
36
|
-
title: tCover.effectiveDate,
|
|
37
|
-
children: /*#__PURE__*/ _jsxs(View, {
|
|
38
|
-
style: {
|
|
39
|
-
flexDirection: 'row',
|
|
40
|
-
columnGap: 4
|
|
41
|
-
},
|
|
42
|
-
children: [
|
|
43
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
44
|
-
style: {
|
|
45
|
-
textDecoration: 'underline'
|
|
46
|
-
},
|
|
47
|
-
children: format(signedAt, 'do')
|
|
48
|
-
}),
|
|
49
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
50
|
-
children: tCover.of
|
|
51
|
-
}),
|
|
52
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
53
|
-
style: {
|
|
54
|
-
textDecoration: 'underline'
|
|
55
|
-
},
|
|
56
|
-
children: format(signedAt, 'MMM')
|
|
57
|
-
}),
|
|
58
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
59
|
-
children: format(signedAt, 'yyyy')
|
|
60
|
-
})
|
|
61
|
-
]
|
|
62
|
-
})
|
|
63
|
-
}),
|
|
64
|
-
/*#__PURE__*/ _jsxs(CoverPageSection, {
|
|
65
|
-
title: tCover.agreementBetween,
|
|
66
|
-
children: [
|
|
67
|
-
/*#__PURE__*/ _jsx(LabelValue, {
|
|
68
|
-
label: tCover.name,
|
|
69
|
-
value: userName(user)
|
|
70
|
-
}),
|
|
71
|
-
/*#__PURE__*/ _jsx(LabelValue, {
|
|
72
|
-
label: tCover.idOrPassportNo,
|
|
73
|
-
value: (_user_identification = user.identification) === null || _user_identification === void 0 ? void 0 : _user_identification.number
|
|
74
|
-
})
|
|
75
|
-
]
|
|
76
|
-
}),
|
|
77
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
78
|
-
style: {
|
|
17
|
+
border: `1px solid ${colors.primary2}`,
|
|
18
|
+
fontSize: 10,
|
|
19
|
+
}, children: [_jsx(CoverPageSection, { title: tCover.effectiveDate, children: _jsxs(View, { style: { flexDirection: 'row', columnGap: 4 }, children: [_jsx(Text, { style: { textDecoration: 'underline' }, children: format(signedAt, 'do') }), _jsx(Text, { children: tCover.of }), _jsx(Text, { style: { textDecoration: 'underline' }, children: format(signedAt, 'MMM') }), _jsx(Text, { children: format(signedAt, 'yyyy') })] }) }), _jsxs(CoverPageSection, { title: tCover.agreementBetween, children: [_jsx(LabelValue, { label: tCover.name, value: userName(user) }), _jsx(LabelValue, { label: tCover.idOrPassportNo, value: user.identification?.number })] }), _jsx(Text, { style: {
|
|
79
20
|
fontSize: 8,
|
|
80
21
|
fontWeight: 'bold',
|
|
81
22
|
color: colors.primary3,
|
|
82
23
|
textTransform: 'uppercase',
|
|
83
|
-
letterSpacing: 1
|
|
84
|
-
},
|
|
85
|
-
children: tCover.and
|
|
86
|
-
}),
|
|
87
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
88
|
-
children: "FLUX Sdn Bhd (1264766-H)"
|
|
89
|
-
})
|
|
90
|
-
]
|
|
91
|
-
})
|
|
92
|
-
]
|
|
93
|
-
});
|
|
24
|
+
letterSpacing: 1,
|
|
25
|
+
}, children: tCover.and }), _jsx(Text, { children: "FLUX Sdn Bhd (1264766-H)" })] })] }));
|
|
94
26
|
};
|
|
95
27
|
export default CoverPage;
|
|
28
|
+
//# sourceMappingURL=CoverPage.js.map
|
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Text, View } from '@react-pdf/renderer';
|
|
3
3
|
import { colors } from '../../theme/colors.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return /*#__PURE__*/ _jsxs(View, {
|
|
7
|
-
style: {
|
|
8
|
-
rowGap: 16
|
|
9
|
-
},
|
|
10
|
-
children: [
|
|
11
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
12
|
-
style: {
|
|
4
|
+
const CoverPageSection = ({ title, children, }) => {
|
|
5
|
+
return (_jsxs(View, { style: { rowGap: 16 }, children: [_jsx(Text, { style: {
|
|
13
6
|
fontSize: 8,
|
|
14
7
|
fontWeight: 'bold',
|
|
15
8
|
color: colors.primary3,
|
|
16
9
|
textTransform: 'uppercase',
|
|
17
|
-
letterSpacing: 1
|
|
18
|
-
},
|
|
19
|
-
children: "".concat(title, ":")
|
|
20
|
-
}),
|
|
21
|
-
children
|
|
22
|
-
]
|
|
23
|
-
});
|
|
10
|
+
letterSpacing: 1,
|
|
11
|
+
}, children: `${title}:` }), children] }));
|
|
24
12
|
};
|
|
25
13
|
export default CoverPageSection;
|
|
14
|
+
//# sourceMappingURL=CoverPageSection.js.map
|
|
@@ -4,113 +4,86 @@ import { format } from '@driveflux/time';
|
|
|
4
4
|
import { Text, View } from '@react-pdf/renderer';
|
|
5
5
|
import { colors } from '../../theme/index.js';
|
|
6
6
|
import LabelValue from './LabelValue.js';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _subscription_user_identification, _subscription_vehicle, _subscription_vehicle1, _subscription_vehicle2, _subscription_vehicle3, _subscription_vehicle4, _subscription_schedule, _subscription_schedule1;
|
|
10
|
-
var details = {
|
|
7
|
+
const Details = ({ tDetails, subscription }) => {
|
|
8
|
+
const details = {
|
|
11
9
|
member: [
|
|
12
10
|
{
|
|
13
11
|
key: tDetails.member.name,
|
|
14
|
-
value: userName(subscription.user)
|
|
12
|
+
value: userName(subscription.user),
|
|
15
13
|
},
|
|
16
14
|
{
|
|
17
15
|
key: tDetails.member.idOrPassportNo,
|
|
18
|
-
value:
|
|
19
|
-
}
|
|
16
|
+
value: subscription.user.identification?.number,
|
|
17
|
+
},
|
|
20
18
|
],
|
|
21
19
|
vehicle: [
|
|
22
20
|
{
|
|
23
21
|
key: tDetails.vehicle.make,
|
|
24
|
-
value:
|
|
22
|
+
value: subscription.vehicle?.make,
|
|
25
23
|
},
|
|
26
24
|
{
|
|
27
25
|
key: tDetails.vehicle.model,
|
|
28
|
-
value:
|
|
26
|
+
value: `${subscription.vehicle?.vehicleModel} ${subscription.vehicle?.variant}`,
|
|
29
27
|
},
|
|
30
28
|
{
|
|
31
29
|
key: tDetails.vehicle.year,
|
|
32
|
-
value:
|
|
30
|
+
value: subscription.vehicle?.year,
|
|
33
31
|
},
|
|
34
32
|
{
|
|
35
33
|
key: tDetails.vehicle.plateNo,
|
|
36
|
-
value:
|
|
37
|
-
}
|
|
34
|
+
value: subscription.vehicle?.registrationNumber,
|
|
35
|
+
},
|
|
38
36
|
],
|
|
39
37
|
subscription: [
|
|
40
38
|
{
|
|
41
39
|
key: tDetails.subscription.subscriptionPlan,
|
|
42
|
-
value: getPlanTranslation(subscription.plan)
|
|
40
|
+
value: getPlanTranslation(subscription.plan),
|
|
43
41
|
},
|
|
44
42
|
{
|
|
45
43
|
key: tDetails.subscription.mileagePackage,
|
|
46
|
-
value: getFullMileagePackageTranslation(subscription.mileagePackage)
|
|
44
|
+
value: getFullMileagePackageTranslation(subscription.mileagePackage),
|
|
47
45
|
},
|
|
48
46
|
{
|
|
49
47
|
key: tDetails.subscription.startDate,
|
|
50
|
-
value: subscription.startedAt
|
|
48
|
+
value: subscription.startedAt
|
|
49
|
+
? format(subscription.startedAt, 'dd-MM-yyyy')
|
|
50
|
+
: undefined,
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
key: tDetails.subscription.endDate,
|
|
54
|
-
value: subscription.endedAt
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
value: subscription.endedAt
|
|
55
|
+
? format(subscription.endedAt, 'dd-MM-yyyy')
|
|
56
|
+
: subscription.schedule?.endAt
|
|
57
|
+
? format(subscription.schedule?.endAt, 'dd-MM-yyyy')
|
|
58
|
+
: undefined,
|
|
59
|
+
},
|
|
60
|
+
],
|
|
57
61
|
};
|
|
58
|
-
|
|
59
|
-
return
|
|
60
|
-
style: {
|
|
61
|
-
borderLeft: border,
|
|
62
|
-
borderRight: border
|
|
63
|
-
},
|
|
64
|
-
children: [
|
|
65
|
-
/*#__PURE__*/ _jsx(View, {
|
|
66
|
-
style: {
|
|
62
|
+
const border = `1px solid ${colors.primary2}`;
|
|
63
|
+
return (_jsxs(View, { style: { borderLeft: border, borderRight: border }, children: [_jsx(View, { style: {
|
|
67
64
|
backgroundColor: colors.primary1,
|
|
68
65
|
borderTop: border,
|
|
69
|
-
padding: 8
|
|
70
|
-
},
|
|
71
|
-
children: /*#__PURE__*/ _jsx(Text, {
|
|
72
|
-
style: {
|
|
66
|
+
padding: 8,
|
|
67
|
+
}, children: _jsx(Text, { style: {
|
|
73
68
|
fontWeight: 'bold',
|
|
74
69
|
textTransform: 'uppercase',
|
|
75
|
-
letterSpacing: 1
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
children: [
|
|
89
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
90
|
-
style: {
|
|
91
|
-
textTransform: 'uppercase',
|
|
92
|
-
color: colors.primary2,
|
|
93
|
-
fontSize: 8,
|
|
94
|
-
letterSpacing: 1
|
|
95
|
-
},
|
|
96
|
-
children: "".concat(key, " details")
|
|
97
|
-
}),
|
|
98
|
-
details[key].map(function(line) {
|
|
99
|
-
return /*#__PURE__*/ _jsx(LabelValue, {
|
|
100
|
-
label: line.key,
|
|
101
|
-
value: line.value
|
|
102
|
-
}, line.key);
|
|
103
|
-
})
|
|
104
|
-
]
|
|
105
|
-
}, key);
|
|
106
|
-
})
|
|
107
|
-
]
|
|
108
|
-
});
|
|
70
|
+
letterSpacing: 1,
|
|
71
|
+
}, children: tDetails.agreement }) }), Object.keys(details).map((key, i) => (_jsxs(View, { style: {
|
|
72
|
+
padding: 8,
|
|
73
|
+
paddingBottom: 16,
|
|
74
|
+
rowGap: 8,
|
|
75
|
+
borderTop: border,
|
|
76
|
+
}, children: [_jsx(Text, { style: {
|
|
77
|
+
textTransform: 'uppercase',
|
|
78
|
+
color: colors.primary2,
|
|
79
|
+
fontSize: 8,
|
|
80
|
+
letterSpacing: 1,
|
|
81
|
+
}, children: `${key} details` }), details[key].map((line) => (_jsx(LabelValue, { label: line.key, value: line.value }, line.key)))] }, key)))] }));
|
|
109
82
|
};
|
|
110
83
|
export default Details;
|
|
111
84
|
// TODO: replace this with dump's once the package is ready
|
|
112
|
-
|
|
113
|
-
switch(plan){
|
|
85
|
+
const getPlanTranslation = (plan, vehicleType) => {
|
|
86
|
+
switch (plan) {
|
|
114
87
|
case 'plan60':
|
|
115
88
|
return vehicleType === 'motorcycle' ? '60 Months' : '60 Months (Basic)';
|
|
116
89
|
case 'plan36':
|
|
@@ -127,8 +100,8 @@ var getPlanTranslation = function(plan, vehicleType) {
|
|
|
127
100
|
return 'Unknown Plan';
|
|
128
101
|
}
|
|
129
102
|
};
|
|
130
|
-
|
|
131
|
-
switch(plan){
|
|
103
|
+
const getFullMileagePackageTranslation = (plan) => {
|
|
104
|
+
switch (plan) {
|
|
132
105
|
case 'lite':
|
|
133
106
|
return 'Lite - 1,250KM';
|
|
134
107
|
case 'standard':
|
|
@@ -141,3 +114,4 @@ var getFullMileagePackageTranslation = function(plan) {
|
|
|
141
114
|
return 'Unknown Mileage Package';
|
|
142
115
|
}
|
|
143
116
|
};
|
|
117
|
+
//# sourceMappingURL=Details.js.map
|
|
@@ -1,58 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Text, View } from '@react-pdf/renderer';
|
|
3
3
|
import { colors } from '../../theme/colors.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return /*#__PURE__*/ _jsxs(View, {
|
|
7
|
-
fixed: true,
|
|
8
|
-
style: {
|
|
4
|
+
const Footer = ({ tComputerGenerated, tPage, tOf }) => {
|
|
5
|
+
return (_jsxs(View, { fixed: true, style: {
|
|
9
6
|
justifyContent: 'space-between',
|
|
10
7
|
flexDirection: 'row',
|
|
11
8
|
paddingTop: 16,
|
|
12
9
|
marginTop: 16,
|
|
13
|
-
borderTop:
|
|
10
|
+
borderTop: `1px solid ${colors.links}`,
|
|
14
11
|
color: colors.primary2,
|
|
15
|
-
fontSize: 8
|
|
16
|
-
},
|
|
17
|
-
children: [
|
|
18
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
19
|
-
children: tComputerGenerated
|
|
20
|
-
}),
|
|
21
|
-
/*#__PURE__*/ _jsxs(View, {
|
|
22
|
-
style: {
|
|
23
|
-
flexDirection: 'row',
|
|
24
|
-
columnGap: 4
|
|
25
|
-
},
|
|
26
|
-
children: [
|
|
27
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
28
|
-
children: tPage
|
|
29
|
-
}),
|
|
30
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
31
|
-
style: {
|
|
32
|
-
fontWeight: 'bold',
|
|
33
|
-
color: colors.black
|
|
34
|
-
},
|
|
35
|
-
render: function(param) {
|
|
36
|
-
var pageNumber = param.pageNumber;
|
|
37
|
-
return "".concat(pageNumber);
|
|
38
|
-
}
|
|
39
|
-
}),
|
|
40
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
41
|
-
children: tOf
|
|
42
|
-
}),
|
|
43
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
44
|
-
style: {
|
|
45
|
-
fontWeight: 'bold',
|
|
46
|
-
color: colors.black
|
|
47
|
-
},
|
|
48
|
-
render: function(param) {
|
|
49
|
-
var totalPages = param.totalPages;
|
|
50
|
-
return "".concat(totalPages);
|
|
51
|
-
}
|
|
52
|
-
})
|
|
53
|
-
]
|
|
54
|
-
})
|
|
55
|
-
]
|
|
56
|
-
});
|
|
12
|
+
fontSize: 8,
|
|
13
|
+
}, children: [_jsx(Text, { children: tComputerGenerated }), _jsxs(View, { style: { flexDirection: 'row', columnGap: 4 }, children: [_jsx(Text, { children: tPage }), _jsx(Text, { style: { fontWeight: 'bold', color: colors.black }, render: ({ pageNumber }) => `${pageNumber}` }), _jsx(Text, { children: tOf }), _jsx(Text, { style: { fontWeight: 'bold', color: colors.black }, render: ({ totalPages }) => `${totalPages}` })] })] }));
|
|
57
14
|
};
|
|
58
15
|
export default Footer;
|
|
16
|
+
//# sourceMappingURL=Footer.js.map
|