@driveflux/pdf 2.0.13 → 3.0.0-next.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.
- package/dist/__mocks__/subscription.js +24 -44
- package/dist/debug.js +1 -1
- package/dist/templates/QuotationPdf/CustomerSubscriptionSection.d.ts.map +1 -1
- package/dist/templates/QuotationPdf/Pricing.d.ts.map +1 -1
- package/dist/templates/QuotationPdf/TermsSection.js +1 -1
- package/dist/templates/QuotationPdf/VehiclePhotos.js +1 -1
- package/dist/templates/QuotationPdf/index.js +1 -1
- package/dist/templates/QuotationPdf/utils.js +2 -3
- package/dist/templates/SubscriptionAgreement/Details.js +3 -3
- package/package.json +10 -10
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { generateId } from '@driveflux/db/id';
|
|
2
2
|
export var subscription = {
|
|
3
|
+
customerId: 'U2DCCUKVW',
|
|
3
4
|
invoicing: {
|
|
4
5
|
payerId: 'U2DCCUKVW',
|
|
5
6
|
name: 'Zishan Kalim',
|
|
@@ -15,7 +16,19 @@ export var subscription = {
|
|
|
15
16
|
metadata: {}
|
|
16
17
|
}
|
|
17
18
|
},
|
|
19
|
+
scheduledEndAt: new Date('2024-05-25T16:00:00.000Z'),
|
|
20
|
+
scheduledStartAt: new Date('2024-04-25T16:00:00.000Z'),
|
|
21
|
+
lastBillingDate: new Date('2024-04-25T16:00:00.000Z'),
|
|
22
|
+
prepaidCycles: 0,
|
|
23
|
+
prepaidUntil: null,
|
|
24
|
+
currency: 'MYR',
|
|
25
|
+
currentCycleNumber: 1,
|
|
26
|
+
lastPaymentErrorMessage: null,
|
|
18
27
|
leadId: null,
|
|
28
|
+
gracePeriodEndsAt: null,
|
|
29
|
+
failedPaymentAttempts: 0,
|
|
30
|
+
lastFailedPaymentAt: null,
|
|
31
|
+
unpaidAt: null,
|
|
19
32
|
primaryPaymentMethod: {
|
|
20
33
|
paymentMethodId: 'PM_CKDDMJME',
|
|
21
34
|
card: {
|
|
@@ -53,29 +66,20 @@ export var subscription = {
|
|
|
53
66
|
started: true,
|
|
54
67
|
startedAt: new Date('2024-04-26T01:39:46.563Z'),
|
|
55
68
|
cycleAnchor: new Date('2024-04-25T16:00:00.000Z'),
|
|
56
|
-
|
|
57
|
-
successfulPaymentLeeway: 86400,
|
|
58
|
-
endSubscriptionAfterFailedPaymentIn: 1296000,
|
|
59
|
-
cyclePaymentBehaviour: 'prepay',
|
|
60
|
-
customPaymentForCycleAfterStartDate: null,
|
|
61
|
-
paymentInterval: 86400,
|
|
62
|
-
lastPaymentAttemptAt: null,
|
|
63
|
-
nextPaymentAttemptAt: null,
|
|
64
|
-
lastPaymentError: null,
|
|
69
|
+
nextBillingDate: new Date('2024-05-25T16:00:00.000Z'),
|
|
65
70
|
ended: false,
|
|
66
71
|
endedAt: null,
|
|
67
72
|
completionReason: null,
|
|
68
73
|
timezone: 'Asia/Kuala_Lumpur',
|
|
69
74
|
active: true,
|
|
70
75
|
price: 3960,
|
|
71
|
-
|
|
76
|
+
billingCycle: 'monthly',
|
|
72
77
|
chargingMethod: 'automatic',
|
|
73
78
|
currentInvoiceId: 'IQVTSHDC9',
|
|
74
79
|
currentCycleId: 'CY-S5Y9TWWSK-BR2WRKTU',
|
|
75
80
|
discountIds: [
|
|
76
81
|
'discount_5bOaD3WHUAPKuYd1PblpH'
|
|
77
82
|
],
|
|
78
|
-
subscriptionRunnerId: null,
|
|
79
83
|
status: 'active',
|
|
80
84
|
error: null,
|
|
81
85
|
agreedTermsOfUsePdf: null,
|
|
@@ -120,7 +124,6 @@ export var subscription = {
|
|
|
120
124
|
nextHostPayoutId: 'XZB4HLGEP',
|
|
121
125
|
payoutIds: [],
|
|
122
126
|
prepared: true,
|
|
123
|
-
criticalMissions: null,
|
|
124
127
|
depositInvoiceIds: [
|
|
125
128
|
'IQVTSHDC9'
|
|
126
129
|
],
|
|
@@ -416,18 +419,18 @@ export var subscription = {
|
|
|
416
419
|
paymentMethods: [
|
|
417
420
|
{
|
|
418
421
|
id: 'PM_7J8HD3RZ',
|
|
422
|
+
ownerId: 'U2DCCUKVW',
|
|
419
423
|
object: 'paymentMethod',
|
|
420
424
|
provider: 'stripe',
|
|
421
425
|
chargingMethod: 'instant',
|
|
426
|
+
statusText: 'Active',
|
|
422
427
|
type: 'card',
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
curlec: null,
|
|
430
|
-
payex: null,
|
|
428
|
+
isDefault: true,
|
|
429
|
+
stripeCustomerId: 'cus_PioidrQGcxLkbQ',
|
|
430
|
+
providerPaymentMethodId: 'pm_1PGL4QGmjNrRwDjL0HpLF2OS',
|
|
431
|
+
stripeSetupIntentId: null,
|
|
432
|
+
payexDetails: null,
|
|
433
|
+
payexMandateId: null,
|
|
431
434
|
card: {
|
|
432
435
|
brand: 'mastercard',
|
|
433
436
|
last4: '5896',
|
|
@@ -451,7 +454,6 @@ export var subscription = {
|
|
|
451
454
|
state: 'Dubai',
|
|
452
455
|
country: 'AE',
|
|
453
456
|
postalCode: '00000',
|
|
454
|
-
metadata: {},
|
|
455
457
|
coordinates: null
|
|
456
458
|
},
|
|
457
459
|
billing: {
|
|
@@ -461,8 +463,7 @@ export var subscription = {
|
|
|
461
463
|
city: 'Dubai',
|
|
462
464
|
state: 'Dubai',
|
|
463
465
|
country: 'AE',
|
|
464
|
-
postalCode: '00000'
|
|
465
|
-
metadata: {}
|
|
466
|
+
postalCode: '00000'
|
|
466
467
|
}
|
|
467
468
|
},
|
|
468
469
|
verifications: null,
|
|
@@ -536,7 +537,6 @@ export var subscription = {
|
|
|
536
537
|
state: 'Kuala Lumpur',
|
|
537
538
|
country: 'MY',
|
|
538
539
|
postalCode: '50480',
|
|
539
|
-
metadata: {},
|
|
540
540
|
coordinates: null
|
|
541
541
|
},
|
|
542
542
|
pickup: {
|
|
@@ -547,7 +547,6 @@ export var subscription = {
|
|
|
547
547
|
state: 'Kuala Lumpur',
|
|
548
548
|
country: 'MY',
|
|
549
549
|
postalCode: '50480',
|
|
550
|
-
metadata: {},
|
|
551
550
|
coordinates: null
|
|
552
551
|
}
|
|
553
552
|
},
|
|
@@ -1052,25 +1051,6 @@ export var subscription = {
|
|
|
1052
1051
|
displayVehicleId: null,
|
|
1053
1052
|
isHostConfirmed: null
|
|
1054
1053
|
},
|
|
1055
|
-
schedule: {
|
|
1056
|
-
id: 'SC_6FLUKBFH',
|
|
1057
|
-
object: 'subscriptionSchedule',
|
|
1058
|
-
startAt: null,
|
|
1059
|
-
endAt: new Date('2025-04-25T15:59:59.999Z'),
|
|
1060
|
-
cancelSubscriptionAt: null,
|
|
1061
|
-
subscriptionCancellationReason: null,
|
|
1062
|
-
subscriptionId: 'S5Y9TWWSK',
|
|
1063
|
-
currentPhaseId: null,
|
|
1064
|
-
completed: false,
|
|
1065
|
-
canceled: false,
|
|
1066
|
-
cancelReason: null,
|
|
1067
|
-
onComplete: 'release',
|
|
1068
|
-
createdAt: new Date('2024-04-30T09:39:11.522Z'),
|
|
1069
|
-
updatedAt: new Date('2024-04-30T09:39:11.564Z'),
|
|
1070
|
-
metadata: {},
|
|
1071
|
-
expiryNoticeSent: false,
|
|
1072
|
-
phases: []
|
|
1073
|
-
},
|
|
1074
1054
|
subscriptionTag: 'new'
|
|
1075
1055
|
};
|
|
1076
1056
|
export var signature = {
|
package/dist/debug.js
CHANGED
|
@@ -122,8 +122,8 @@ import { loadAllEnv } from '@driveflux/env';
|
|
|
122
122
|
import { quotation } from './__mocks__/quotation.js';
|
|
123
123
|
import { signature, subscription } from './__mocks__/subscription.js';
|
|
124
124
|
import { mockTermsOfUse } from './__mocks__/tou.js';
|
|
125
|
-
import { generateSubscriptionAgreementPdf } from './templates/SubscriptionAgreement/index.js';
|
|
126
125
|
import { generateQuotationPdf } from './templates/index.js';
|
|
126
|
+
import { generateSubscriptionAgreementPdf } from './templates/SubscriptionAgreement/index.js';
|
|
127
127
|
var debugSubscriptionAgreement = function() {
|
|
128
128
|
return _async_to_generator(function() {
|
|
129
129
|
return _ts_generator(this, function(_state) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomerSubscriptionSection.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/CustomerSubscriptionSection.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"CustomerSubscriptionSection.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/CustomerSubscriptionSection.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAOhE,KAAK,KAAK,GAAG;IACZ,SAAS,EAAE,mBAAmB,CAAA;IAC9B,CAAC,EAAE,uBAAuB,CAAA;CAC1B,CAAA;AAED,QAAA,MAAM,2BAA2B,EAAE,EAAE,CAAC,KAAK,CA4I1C,CAAA;AAED,eAAe,2BAA2B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pricing.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/Pricing.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Pricing.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/Pricing.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAEhE,KAAK,KAAK,GAAG;IACZ,SAAS,EAAE,mBAAmB,CAAA;IAC9B,CAAC,CAAC,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAA;CACtC,CAAA;AAED,QAAA,MAAM,OAAO,EAAE,EAAE,CAAC,KAAK,CA6tBtB,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -18,7 +18,7 @@ var TermsSection = function(param) {
|
|
|
18
18
|
children: t === null || t === void 0 ? void 0 : t.title
|
|
19
19
|
}),
|
|
20
20
|
/*#__PURE__*/ _jsx(View, {
|
|
21
|
-
children: t.content.map(function(line,
|
|
21
|
+
children: t.content.map(function(line, _i) {
|
|
22
22
|
return /*#__PURE__*/ _jsxs(View, {
|
|
23
23
|
style: {
|
|
24
24
|
flexDirection: 'row',
|
|
@@ -128,8 +128,8 @@ import GFV from './GFV.js';
|
|
|
128
128
|
import Pricing from './Pricing.js';
|
|
129
129
|
import QuotationPdfPage from './QuotationPdfPage.js';
|
|
130
130
|
import TermsSection from './TermsSection.js';
|
|
131
|
-
import VehiclePhotos from './VehiclePhotos.js';
|
|
132
131
|
import { useTranslations } from './translations.js';
|
|
132
|
+
import VehiclePhotos from './VehiclePhotos.js';
|
|
133
133
|
export var generateQuotationPdf = function(param, fileName) {
|
|
134
134
|
var _param_locale = param.locale, locale = _param_locale === void 0 ? 'en' : _param_locale, quotation = param.quotation;
|
|
135
135
|
return _async_to_generator(function() {
|
|
@@ -27,9 +27,8 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
27
27
|
}
|
|
28
28
|
import { formatMoney } from '@driveflux/format-money';
|
|
29
29
|
export var formatAddress = function(originalAddress) {
|
|
30
|
-
var coordinates = originalAddress.coordinates,
|
|
31
|
-
"coordinates"
|
|
32
|
-
"metadata"
|
|
30
|
+
var coordinates = originalAddress.coordinates, address = _object_without_properties(originalAddress, [
|
|
31
|
+
"coordinates"
|
|
33
32
|
]);
|
|
34
33
|
return Object.keys(address).filter(function(key) {
|
|
35
34
|
return key !== 'name' && !!address[key];
|
|
@@ -58,7 +58,7 @@ import { colors } from '../../theme/index.js';
|
|
|
58
58
|
import LabelValue from './LabelValue.js';
|
|
59
59
|
var Details = function(param) {
|
|
60
60
|
var tDetails = param.tDetails, subscription = param.subscription;
|
|
61
|
-
var _subscription_vehicle, _subscription_vehicle1, _subscription_vehicle2, _subscription_vehicle3, _subscription_vehicle4
|
|
61
|
+
var _subscription_vehicle, _subscription_vehicle1, _subscription_vehicle2, _subscription_vehicle3, _subscription_vehicle4;
|
|
62
62
|
var details = {};
|
|
63
63
|
if (subscription.payerType === 'business') {
|
|
64
64
|
var _subscription_business;
|
|
@@ -119,7 +119,7 @@ var Details = function(param) {
|
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
key: tDetails.subscription.endDate,
|
|
122
|
-
value: subscription.endedAt ? format(subscription.endedAt, 'dd-MM-yyyy') :
|
|
122
|
+
value: subscription.endedAt ? format(subscription.endedAt, 'dd-MM-yyyy') : subscription.scheduledEndAt ? format(subscription.scheduledEndAt, 'dd-MM-yyyy') : undefined
|
|
123
123
|
}
|
|
124
124
|
]
|
|
125
125
|
});
|
|
@@ -145,7 +145,7 @@ var Details = function(param) {
|
|
|
145
145
|
children: tDetails.agreement
|
|
146
146
|
})
|
|
147
147
|
}),
|
|
148
|
-
Object.keys(details).map(function(key,
|
|
148
|
+
Object.keys(details).map(function(key, _i) {
|
|
149
149
|
return /*#__PURE__*/ _jsxs(View, {
|
|
150
150
|
style: {
|
|
151
151
|
padding: 8,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@driveflux/pdf",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-next.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -12,29 +12,29 @@
|
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@driveflux/db": "3.0.
|
|
15
|
+
"@driveflux/db": "3.0.0-develop.50",
|
|
16
16
|
"@driveflux/env": "2.0.2",
|
|
17
17
|
"@driveflux/format-money": "6.0.2",
|
|
18
18
|
"@driveflux/time": "5.0.2",
|
|
19
19
|
"@react-pdf/renderer": "^4.3.0",
|
|
20
20
|
"date-fns": "^4.1.0",
|
|
21
21
|
"nodemon": "^3.1.10",
|
|
22
|
-
"react": "
|
|
22
|
+
"react": "*"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@babel/preset-env": "^7.27.2",
|
|
26
26
|
"@driveflux/fab": "3.0.2",
|
|
27
27
|
"@driveflux/tsconfig": "2.0.2",
|
|
28
|
-
"@swc/cli": "0.7.
|
|
29
|
-
"@swc/core": "1.
|
|
30
|
-
"@types/node": "^
|
|
31
|
-
"@types/react": "^19.1.
|
|
28
|
+
"@swc/cli": "^0.7.8",
|
|
29
|
+
"@swc/core": "^1.13.5",
|
|
30
|
+
"@types/node": "^24.3.0",
|
|
31
|
+
"@types/react": "^19.1.12",
|
|
32
32
|
"del-cli": "^6.0.0",
|
|
33
|
-
"react": "
|
|
34
|
-
"typescript": "^5.
|
|
33
|
+
"react": "*",
|
|
34
|
+
"typescript": "^5.9.2"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"react": "
|
|
37
|
+
"react": "*"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "fab",
|