@tenancy.nz/reports 1.0.1 → 1.0.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.
- package/dist/cjs/components/OwnerBookingReport.cjs +181 -152
- package/dist/cjs/components/ReportFooter.cjs +12 -4
- package/dist/cjs/components/ReportHeader.cjs +44 -26
- package/dist/cjs/components/ViewingAnalyticsReport.cjs +87 -79
- package/dist/esm/components/OwnerBookingReport.js +181 -152
- package/dist/esm/components/ReportFooter.js +12 -4
- package/dist/esm/components/ReportHeader.js +44 -26
- package/dist/esm/components/ViewingAnalyticsReport.js +87 -79
- package/package.json +5 -5
|
@@ -3,163 +3,192 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('react');
|
|
6
|
+
var React = require('react');
|
|
8
7
|
var reactUid = require('react-uid');
|
|
9
8
|
var ui = require('@tenancy.nz/ui');
|
|
10
9
|
var featureUi = require('@tenancy.nz/feature-ui');
|
|
11
10
|
|
|
12
|
-
function OwnerBookingReport({
|
|
13
|
-
agent =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
11
|
+
function OwnerBookingReport(_ref) {
|
|
12
|
+
var _ref$agent = _ref.agent,
|
|
13
|
+
agent = _ref$agent === void 0 ? {} : _ref$agent,
|
|
14
|
+
_ref$bookings = _ref.bookings,
|
|
15
|
+
bookings = _ref$bookings === void 0 ? [] : _ref$bookings,
|
|
16
|
+
_ref$chart = _ref.chart,
|
|
17
|
+
chart = _ref$chart === void 0 ? {} : _ref$chart,
|
|
18
|
+
_ref$footer = _ref.footer,
|
|
19
|
+
footer = _ref$footer === void 0 ? void 0 : _ref$footer,
|
|
20
|
+
_ref$header = _ref.header,
|
|
21
|
+
header = _ref$header === void 0 ? void 0 : _ref$header,
|
|
22
|
+
_ref$loading = _ref.loading,
|
|
23
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
24
|
+
notes = _ref.notes,
|
|
25
|
+
_ref$property = _ref.property,
|
|
26
|
+
property = _ref$property === void 0 ? {} : _ref$property,
|
|
27
|
+
stats = _ref.stats;
|
|
28
|
+
return /* @__PURE__ */React.createElement(ui.Box, {
|
|
29
|
+
width: "100%"
|
|
30
|
+
}, header, /* @__PURE__ */React.createElement(ui.Grid, {
|
|
31
|
+
container: true,
|
|
32
|
+
spacing: 6
|
|
33
|
+
}, /* @__PURE__ */React.createElement(ui.Grid, {
|
|
34
|
+
item: true,
|
|
35
|
+
xs: 8
|
|
36
|
+
}, /* @__PURE__ */React.createElement(featureUi.PropertyCard, {
|
|
37
|
+
address: property.address,
|
|
38
|
+
imgSrc: property.imgSrc,
|
|
39
|
+
noOfBedrooms: property.noOfBedrooms,
|
|
40
|
+
noOfBathrooms: property.noOfBathrooms,
|
|
41
|
+
noOfCarparks: property.noOfCarparks,
|
|
42
|
+
rent: property.rent,
|
|
43
|
+
loading: loading,
|
|
44
|
+
compact: true,
|
|
45
|
+
outlined: true
|
|
46
|
+
})), /* @__PURE__ */React.createElement(ui.Grid, {
|
|
47
|
+
item: true,
|
|
48
|
+
xs: 4
|
|
49
|
+
}, /* @__PURE__ */React.createElement(ui.Paper, {
|
|
50
|
+
inset: "medium",
|
|
51
|
+
outlined: true,
|
|
52
|
+
sx: {
|
|
53
|
+
height: "100%"
|
|
54
|
+
}
|
|
55
|
+
}, /* @__PURE__ */React.createElement(featureUi.AgentDetailsCard, {
|
|
56
|
+
email: agent.email,
|
|
57
|
+
logo: agent.logo,
|
|
58
|
+
loading: loading,
|
|
59
|
+
name: agent.name,
|
|
60
|
+
phone: agent.phone
|
|
61
|
+
}))), stats && /* @__PURE__ */React.createElement(ui.Grid, {
|
|
62
|
+
item: true,
|
|
63
|
+
xs: 12,
|
|
64
|
+
sx: {
|
|
65
|
+
display: "flex",
|
|
66
|
+
gap: "36px",
|
|
67
|
+
justifyContent: "space-between"
|
|
68
|
+
}
|
|
69
|
+
}, /* @__PURE__ */React.createElement(featureUi.AnalyticsBox, {
|
|
70
|
+
outlined: true,
|
|
71
|
+
width: "100%",
|
|
72
|
+
height: "125px",
|
|
73
|
+
label: "Viewings",
|
|
74
|
+
amount: stats.viewingsCount || 0
|
|
75
|
+
}), /* @__PURE__ */React.createElement(featureUi.AnalyticsBox, {
|
|
76
|
+
outlined: true,
|
|
77
|
+
width: "100%",
|
|
78
|
+
height: "125px",
|
|
79
|
+
label: "Bookings",
|
|
80
|
+
amount: stats.bookingsCount || 0
|
|
81
|
+
}), /* @__PURE__ */React.createElement(featureUi.AnalyticsBox, {
|
|
82
|
+
outlined: true,
|
|
83
|
+
width: "100%",
|
|
84
|
+
height: "125px",
|
|
85
|
+
label: "Attended",
|
|
86
|
+
amount: stats.attendedBookingsCount || 0
|
|
87
|
+
}), /* @__PURE__ */React.createElement(featureUi.AnalyticsBox, {
|
|
88
|
+
outlined: true,
|
|
89
|
+
width: "100%",
|
|
90
|
+
height: "125px",
|
|
91
|
+
label: "Cancelled",
|
|
92
|
+
amount: stats.cancelledBookingsCount || 0
|
|
93
|
+
}), /* @__PURE__ */React.createElement(featureUi.AnalyticsBox, {
|
|
94
|
+
outlined: true,
|
|
95
|
+
width: "100%",
|
|
96
|
+
height: "125px",
|
|
97
|
+
label: "No-shows",
|
|
98
|
+
amount: stats.noShowBookingsCount || 0
|
|
99
|
+
}), /* @__PURE__ */React.createElement(featureUi.AnalyticsBox, {
|
|
100
|
+
outlined: true,
|
|
101
|
+
width: "100%",
|
|
102
|
+
height: "125px",
|
|
103
|
+
label: "Enquiries",
|
|
104
|
+
amount: stats.enquiriesCount || 0
|
|
105
|
+
}), /* @__PURE__ */React.createElement(featureUi.AnalyticsBox, {
|
|
106
|
+
outlined: true,
|
|
107
|
+
width: "100%",
|
|
108
|
+
height: "125px",
|
|
109
|
+
label: "Application numbers",
|
|
110
|
+
amount: stats.applicationsCount || 0
|
|
111
|
+
})), /* @__PURE__ */React.createElement(ui.Grid, {
|
|
112
|
+
item: true,
|
|
113
|
+
xs: 12
|
|
114
|
+
}, /* @__PURE__ */React.createElement(ui.Paper, {
|
|
115
|
+
inset: "medium",
|
|
116
|
+
sx: {
|
|
117
|
+
height: "100%"
|
|
118
|
+
},
|
|
119
|
+
outlined: true
|
|
120
|
+
}, /* @__PURE__ */React.createElement(featureUi.BookingChart, {
|
|
121
|
+
data: chart.data || [],
|
|
122
|
+
labels: chart.labels || []
|
|
123
|
+
}))), /* @__PURE__ */React.createElement(ui.Grid, {
|
|
124
|
+
item: true,
|
|
125
|
+
xs: 12
|
|
126
|
+
}, /* @__PURE__ */React.createElement(ui.Heading, {
|
|
127
|
+
as: "h4",
|
|
128
|
+
weight: "700",
|
|
129
|
+
sx: {
|
|
130
|
+
mb: "20px"
|
|
131
|
+
}
|
|
132
|
+
}, "Bookings"), /* @__PURE__ */React.createElement(featureUi.BookingTable, {
|
|
133
|
+
data: bookings,
|
|
134
|
+
loading: loading
|
|
135
|
+
})), /* @__PURE__ */React.createElement(ui.Grid, {
|
|
136
|
+
item: true,
|
|
137
|
+
xs: 12
|
|
138
|
+
}, /* @__PURE__ */React.createElement(ui.Heading, {
|
|
139
|
+
as: "h4",
|
|
140
|
+
weight: "700"
|
|
141
|
+
}, "Viewing notes")), loading && /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(ui.Grid, {
|
|
142
|
+
item: true,
|
|
143
|
+
xs: 6
|
|
144
|
+
}, /* @__PURE__ */React.createElement(featureUi.NotesCard, {
|
|
145
|
+
loading: true,
|
|
146
|
+
text: ""
|
|
147
|
+
})), /* @__PURE__ */React.createElement(ui.Grid, {
|
|
148
|
+
item: true,
|
|
149
|
+
xs: 6
|
|
150
|
+
}, /* @__PURE__ */React.createElement(featureUi.NotesCard, {
|
|
151
|
+
loading: true,
|
|
152
|
+
text: ""
|
|
153
|
+
})))), !loading && notes && notes.length && notes.map(function (_ref2, i) {
|
|
154
|
+
var label = _ref2.label,
|
|
155
|
+
data = _ref2.data;
|
|
156
|
+
return /* @__PURE__ */React.createElement(ui.Box, {
|
|
157
|
+
key: reactUid.uid({
|
|
158
|
+
label: label,
|
|
159
|
+
data: data
|
|
160
|
+
}, i),
|
|
161
|
+
mt: "15px"
|
|
162
|
+
}, /* @__PURE__ */React.createElement(ui.Grid, {
|
|
163
|
+
container: true,
|
|
164
|
+
xs: 12,
|
|
165
|
+
spacing: 4
|
|
166
|
+
}, /* @__PURE__ */React.createElement(ui.Grid, {
|
|
167
|
+
item: true,
|
|
168
|
+
xs: 12
|
|
169
|
+
}, /* @__PURE__ */React.createElement(ui.Text, {
|
|
170
|
+
variant: "body2",
|
|
171
|
+
weight: "600"
|
|
172
|
+
}, "Date Recorded: ", label)), data.map(function (_ref3, j) {
|
|
173
|
+
var tag = _ref3.tag,
|
|
174
|
+
text = _ref3.text;
|
|
175
|
+
return /* @__PURE__ */React.createElement(ui.Grid, {
|
|
176
|
+
item: true,
|
|
177
|
+
xs: 6,
|
|
178
|
+
key: reactUid.uid({
|
|
179
|
+
tag: tag,
|
|
180
|
+
text: text
|
|
181
|
+
}, j),
|
|
182
|
+
sx: {
|
|
183
|
+
breakInside: "avoid"
|
|
38
184
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
name: agent.name,
|
|
47
|
-
phone: agent.phone
|
|
48
|
-
}
|
|
49
|
-
) }) }),
|
|
50
|
-
stats && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
51
|
-
ui.Grid,
|
|
52
|
-
{
|
|
53
|
-
item: true,
|
|
54
|
-
xs: 12,
|
|
55
|
-
sx: {
|
|
56
|
-
display: "flex",
|
|
57
|
-
gap: "36px",
|
|
58
|
-
justifyContent: "space-between"
|
|
59
|
-
},
|
|
60
|
-
children: [
|
|
61
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
62
|
-
featureUi.AnalyticsBox,
|
|
63
|
-
{
|
|
64
|
-
outlined: true,
|
|
65
|
-
width: "100%",
|
|
66
|
-
height: "125px",
|
|
67
|
-
label: "Viewings",
|
|
68
|
-
amount: stats.viewingsCount || 0
|
|
69
|
-
}
|
|
70
|
-
),
|
|
71
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
72
|
-
featureUi.AnalyticsBox,
|
|
73
|
-
{
|
|
74
|
-
outlined: true,
|
|
75
|
-
width: "100%",
|
|
76
|
-
height: "125px",
|
|
77
|
-
label: "Bookings",
|
|
78
|
-
amount: stats.bookingsCount || 0
|
|
79
|
-
}
|
|
80
|
-
),
|
|
81
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
82
|
-
featureUi.AnalyticsBox,
|
|
83
|
-
{
|
|
84
|
-
outlined: true,
|
|
85
|
-
width: "100%",
|
|
86
|
-
height: "125px",
|
|
87
|
-
label: "Attended",
|
|
88
|
-
amount: stats.attendedBookingsCount || 0
|
|
89
|
-
}
|
|
90
|
-
),
|
|
91
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
92
|
-
featureUi.AnalyticsBox,
|
|
93
|
-
{
|
|
94
|
-
outlined: true,
|
|
95
|
-
width: "100%",
|
|
96
|
-
height: "125px",
|
|
97
|
-
label: "Cancelled",
|
|
98
|
-
amount: stats.cancelledBookingsCount || 0
|
|
99
|
-
}
|
|
100
|
-
),
|
|
101
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
102
|
-
featureUi.AnalyticsBox,
|
|
103
|
-
{
|
|
104
|
-
outlined: true,
|
|
105
|
-
width: "100%",
|
|
106
|
-
height: "125px",
|
|
107
|
-
label: "No-shows",
|
|
108
|
-
amount: stats.noShowBookingsCount || 0
|
|
109
|
-
}
|
|
110
|
-
),
|
|
111
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
112
|
-
featureUi.AnalyticsBox,
|
|
113
|
-
{
|
|
114
|
-
outlined: true,
|
|
115
|
-
width: "100%",
|
|
116
|
-
height: "125px",
|
|
117
|
-
label: "Enquiries",
|
|
118
|
-
amount: stats.enquiriesCount || 0
|
|
119
|
-
}
|
|
120
|
-
),
|
|
121
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
122
|
-
featureUi.AnalyticsBox,
|
|
123
|
-
{
|
|
124
|
-
outlined: true,
|
|
125
|
-
width: "100%",
|
|
126
|
-
height: "125px",
|
|
127
|
-
label: "Application numbers",
|
|
128
|
-
amount: stats.applicationsCount || 0
|
|
129
|
-
}
|
|
130
|
-
)
|
|
131
|
-
]
|
|
132
|
-
}
|
|
133
|
-
),
|
|
134
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Paper, { inset: "medium", sx: { height: "100%" }, outlined: true, children: /* @__PURE__ */ jsxRuntime.jsx(featureUi.BookingChart, { data: chart.data || [], labels: chart.labels || [] }) }) }),
|
|
135
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ui.Grid, { item: true, xs: 12, children: [
|
|
136
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { as: "h4", weight: "700", sx: { mb: "20px" }, children: "Bookings" }),
|
|
137
|
-
/* @__PURE__ */ jsxRuntime.jsx(featureUi.BookingTable, { data: bookings, loading })
|
|
138
|
-
] }),
|
|
139
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { as: "h4", weight: "700", children: "Viewing notes" }) }),
|
|
140
|
-
loading && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
141
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsxRuntime.jsx(featureUi.NotesCard, { loading: true, text: "" }) }),
|
|
142
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsxRuntime.jsx(featureUi.NotesCard, { loading: true, text: "" }) })
|
|
143
|
-
] })
|
|
144
|
-
] }),
|
|
145
|
-
!loading && notes && notes.length && notes.map(({ label, data }, i) => /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { mt: "15px", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Grid, { container: true, xs: 12, spacing: 4, children: [
|
|
146
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Text, { variant: "body2", weight: "600", children: [
|
|
147
|
-
"Date Recorded: ",
|
|
148
|
-
label
|
|
149
|
-
] }) }),
|
|
150
|
-
data.map(({ tag, text }, j) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
151
|
-
ui.Grid,
|
|
152
|
-
{
|
|
153
|
-
item: true,
|
|
154
|
-
xs: 6,
|
|
155
|
-
sx: { breakInside: "avoid" },
|
|
156
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(featureUi.NotesCard, { tag, text, outlined: true })
|
|
157
|
-
},
|
|
158
|
-
reactUid.uid({ tag, text }, j)
|
|
159
|
-
))
|
|
160
|
-
] }) }, reactUid.uid({ label, data }, i))),
|
|
161
|
-
footer
|
|
162
|
-
] });
|
|
185
|
+
}, /* @__PURE__ */React.createElement(featureUi.NotesCard, {
|
|
186
|
+
tag: tag,
|
|
187
|
+
text: text,
|
|
188
|
+
outlined: true
|
|
189
|
+
}));
|
|
190
|
+
})));
|
|
191
|
+
}), footer);
|
|
163
192
|
}
|
|
164
193
|
|
|
165
194
|
exports.default = OwnerBookingReport;
|
|
@@ -3,12 +3,20 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('react');
|
|
6
|
+
var React = require('react');
|
|
8
7
|
var ui = require('@tenancy.nz/ui');
|
|
9
8
|
|
|
10
|
-
function ReportFooter(
|
|
11
|
-
|
|
9
|
+
function ReportFooter(_ref) {
|
|
10
|
+
var text = _ref.text;
|
|
11
|
+
return /* @__PURE__ */React.createElement(ui.Box, {
|
|
12
|
+
mt: "24px",
|
|
13
|
+
color: "#595959"
|
|
14
|
+
}, /* @__PURE__ */React.createElement(ui.Text, {
|
|
15
|
+
as: "div",
|
|
16
|
+
variant: "body2",
|
|
17
|
+
weight: "300",
|
|
18
|
+
italic: true
|
|
19
|
+
}, text || "This PDF is for - purposes."));
|
|
12
20
|
}
|
|
13
21
|
|
|
14
22
|
exports.default = ReportFooter;
|
|
@@ -3,35 +3,53 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('react');
|
|
6
|
+
var React = require('react');
|
|
8
7
|
var ui = require('@tenancy.nz/ui');
|
|
9
8
|
|
|
10
|
-
function ReportHeader({
|
|
11
|
-
heading,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
9
|
+
function ReportHeader(_ref) {
|
|
10
|
+
var heading = _ref.heading,
|
|
11
|
+
_ref$subheading = _ref.subheading,
|
|
12
|
+
subheading = _ref$subheading === void 0 ? void 0 : _ref$subheading,
|
|
13
|
+
logo = _ref.logo;
|
|
14
|
+
return /* @__PURE__ */React.createElement(ui.Box, {
|
|
15
|
+
mb: "24px",
|
|
16
|
+
borderBottom: "1px solid #E0E0E0",
|
|
17
|
+
paddingBottom: "8px"
|
|
18
|
+
}, /* @__PURE__ */React.createElement(ui.Grid, {
|
|
19
|
+
container: true,
|
|
20
|
+
spacing: 6
|
|
21
|
+
}, /* @__PURE__ */React.createElement(ui.Grid, {
|
|
22
|
+
item: true,
|
|
23
|
+
xs: 8
|
|
24
|
+
}, /* @__PURE__ */React.createElement(ui.Heading, {
|
|
25
|
+
as: "h1",
|
|
26
|
+
weight: "700",
|
|
27
|
+
sx: {
|
|
28
|
+
mb: "8px"
|
|
29
|
+
}
|
|
30
|
+
}, heading), subheading && /* @__PURE__ */React.createElement(ui.Heading, {
|
|
31
|
+
as: "h5",
|
|
32
|
+
weight: "500"
|
|
33
|
+
}, subheading)), /* @__PURE__ */React.createElement(ui.Grid, {
|
|
34
|
+
item: true,
|
|
35
|
+
xs: 4,
|
|
36
|
+
sx: {
|
|
37
|
+
display: "flex",
|
|
38
|
+
justifyContent: "flex-end"
|
|
39
|
+
}
|
|
40
|
+
}, logo && /* @__PURE__ */React.createElement(ui.Box, {
|
|
41
|
+
sx: {
|
|
42
|
+
width: "150px",
|
|
43
|
+
height: "35px",
|
|
44
|
+
"> img": {
|
|
45
|
+
maxWidth: "100%",
|
|
46
|
+
maxHeight: "100%"
|
|
32
47
|
}
|
|
33
|
-
|
|
34
|
-
|
|
48
|
+
}
|
|
49
|
+
}, /* @__PURE__ */React.createElement("img", {
|
|
50
|
+
src: logo,
|
|
51
|
+
alt: "Tenancy"
|
|
52
|
+
})))));
|
|
35
53
|
}
|
|
36
54
|
|
|
37
55
|
exports.default = ReportHeader;
|
|
@@ -3,88 +3,96 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
7
6
|
var ui = require('@tenancy.nz/ui');
|
|
8
7
|
var featureUi = require('@tenancy.nz/feature-ui');
|
|
9
8
|
|
|
10
|
-
function ViewingAnalyticsReport(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
9
|
+
function ViewingAnalyticsReport(_ref) {
|
|
10
|
+
var eventData = _ref.eventData;
|
|
11
|
+
var stats = eventData.stats || {};
|
|
12
|
+
var properties = eventData.properties || [];
|
|
13
|
+
return /* @__PURE__ */React.createElement(ui.ThemeProvider, null, /* @__PURE__ */React.createElement(ui.Box, {
|
|
14
|
+
padding: "20px"
|
|
15
|
+
}, /* @__PURE__ */React.createElement(ui.Box, {
|
|
16
|
+
mb: 6,
|
|
17
|
+
display: "flex",
|
|
18
|
+
justify: "space-between",
|
|
19
|
+
align: "start"
|
|
20
|
+
}, /* @__PURE__ */React.createElement(ui.Box, null, /* @__PURE__ */React.createElement(ui.Heading, {
|
|
21
|
+
variant: "h1",
|
|
22
|
+
as: "h1",
|
|
23
|
+
gutterBottom: false
|
|
24
|
+
}, "Analytics Report")), /* @__PURE__ */React.createElement(ui.Box, {
|
|
25
|
+
display: "flex",
|
|
26
|
+
align: "flex-end",
|
|
27
|
+
direction: "column"
|
|
28
|
+
}, /* @__PURE__ */React.createElement(ui.Text, {
|
|
29
|
+
mt: 2
|
|
30
|
+
}, eventData.fromDate && /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(ui.Text, {
|
|
31
|
+
weight: "700",
|
|
32
|
+
as: "span",
|
|
33
|
+
display: "inline"
|
|
34
|
+
}, "Report Range From"), " ", eventData.fromDate, " "), eventData.toDate && /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(ui.Text, {
|
|
35
|
+
weight: "700",
|
|
36
|
+
as: "span",
|
|
37
|
+
display: "inline"
|
|
38
|
+
}, "To"), " ", eventData.toDate)), eventData.viewingAgent && /* @__PURE__ */React.createElement(ui.Text, {
|
|
39
|
+
color: "textPrimary",
|
|
40
|
+
weight: "700",
|
|
41
|
+
fontSize: 12
|
|
42
|
+
}, "Viewing agent:", " ", /* @__PURE__ */React.createElement(ui.Text, {
|
|
43
|
+
weight: "400",
|
|
44
|
+
as: "span",
|
|
45
|
+
display: "inline"
|
|
46
|
+
}, eventData.viewingAgent)), eventData.propertyAgent && /* @__PURE__ */React.createElement(ui.Text, {
|
|
47
|
+
color: "textPrimary",
|
|
48
|
+
weight: "700",
|
|
49
|
+
fontSize: 12
|
|
50
|
+
}, "Property agent:", " ", /* @__PURE__ */React.createElement(ui.Text, {
|
|
51
|
+
weight: "400",
|
|
52
|
+
as: "span",
|
|
53
|
+
display: "inline"
|
|
54
|
+
}, eventData.propertyAgent)))), /* @__PURE__ */React.createElement(featureUi.AnalyticsSection, {
|
|
55
|
+
viewingsCount: stats.viewings_count,
|
|
56
|
+
bookingsCount: stats.bookings_count,
|
|
57
|
+
attendeesCount: stats.viewing_attendees_count,
|
|
58
|
+
cancellationsCount: stats.bookings_cancelled_count,
|
|
59
|
+
applicationsCount: stats.applications_count,
|
|
60
|
+
averageRent: stats.avg_rent,
|
|
61
|
+
textUsage: stats.sent_sms_count,
|
|
62
|
+
tradeMeEnquiriesCount: stats.trademe_enquiries_count,
|
|
63
|
+
bookMeEnquiriesCount: stats.bookme_enquiries_count,
|
|
64
|
+
manualEnquiryCount: stats.enquiries_count,
|
|
65
|
+
agreementsCount: stats.agreements_count,
|
|
66
|
+
agreementsFinalisedCount: stats.agreements_finalised_count,
|
|
67
|
+
filterDaysCount: eventData.filterDaysCount
|
|
68
|
+
}), /* @__PURE__ */React.createElement(ui.Box, null, /* @__PURE__ */React.createElement(ui.Heading, {
|
|
69
|
+
variant: "h4",
|
|
70
|
+
as: "h4",
|
|
71
|
+
mt: "20px",
|
|
72
|
+
gutterBottom: false
|
|
73
|
+
}, "Top 5 properties"), /* @__PURE__ */React.createElement(featureUi.GridList, {
|
|
74
|
+
mt: "20px",
|
|
75
|
+
items: properties,
|
|
76
|
+
spacing: 5,
|
|
77
|
+
emptyComponent: /* @__PURE__ */React.createElement(ui.Text, null, "No results to show"),
|
|
78
|
+
renderItem: function renderItem(property) {
|
|
79
|
+
return /* @__PURE__ */React.createElement(ui.Grid, {
|
|
80
|
+
item: true,
|
|
81
|
+
xs: 12
|
|
82
|
+
}, /* @__PURE__ */React.createElement(featureUi.PropertyCard, {
|
|
83
|
+
propertyAddress: property.short_address,
|
|
84
|
+
listingDate: "",
|
|
85
|
+
daysOnMarket: "",
|
|
86
|
+
weeklyRent: property.rent_amount,
|
|
87
|
+
viewingsCount: property.viewings_count,
|
|
88
|
+
enquiriesCount: property.enquiries_count,
|
|
89
|
+
propertyImage: property.thumb_url,
|
|
90
|
+
beds: property.num_bedrooms,
|
|
91
|
+
baths: property.num_bathrooms,
|
|
92
|
+
carports: property.num_cars
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
95
|
+
}))));
|
|
88
96
|
}
|
|
89
97
|
|
|
90
98
|
exports.default = ViewingAnalyticsReport;
|
|
@@ -1,161 +1,190 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import
|
|
3
|
-
import 'react';
|
|
2
|
+
import React from 'react';
|
|
4
3
|
import { uid } from 'react-uid';
|
|
5
4
|
import { Box, Grid, Paper, Heading, Text } from '@tenancy.nz/ui';
|
|
6
5
|
import { PropertyCard, AgentDetailsCard, AnalyticsBox, BookingChart, BookingTable, NotesCard } from '@tenancy.nz/feature-ui';
|
|
7
6
|
|
|
8
|
-
function OwnerBookingReport({
|
|
9
|
-
agent =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
7
|
+
function OwnerBookingReport(_ref) {
|
|
8
|
+
var _ref$agent = _ref.agent,
|
|
9
|
+
agent = _ref$agent === void 0 ? {} : _ref$agent,
|
|
10
|
+
_ref$bookings = _ref.bookings,
|
|
11
|
+
bookings = _ref$bookings === void 0 ? [] : _ref$bookings,
|
|
12
|
+
_ref$chart = _ref.chart,
|
|
13
|
+
chart = _ref$chart === void 0 ? {} : _ref$chart,
|
|
14
|
+
_ref$footer = _ref.footer,
|
|
15
|
+
footer = _ref$footer === void 0 ? void 0 : _ref$footer,
|
|
16
|
+
_ref$header = _ref.header,
|
|
17
|
+
header = _ref$header === void 0 ? void 0 : _ref$header,
|
|
18
|
+
_ref$loading = _ref.loading,
|
|
19
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
20
|
+
notes = _ref.notes,
|
|
21
|
+
_ref$property = _ref.property,
|
|
22
|
+
property = _ref$property === void 0 ? {} : _ref$property,
|
|
23
|
+
stats = _ref.stats;
|
|
24
|
+
return /* @__PURE__ */React.createElement(Box, {
|
|
25
|
+
width: "100%"
|
|
26
|
+
}, header, /* @__PURE__ */React.createElement(Grid, {
|
|
27
|
+
container: true,
|
|
28
|
+
spacing: 6
|
|
29
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
30
|
+
item: true,
|
|
31
|
+
xs: 8
|
|
32
|
+
}, /* @__PURE__ */React.createElement(PropertyCard, {
|
|
33
|
+
address: property.address,
|
|
34
|
+
imgSrc: property.imgSrc,
|
|
35
|
+
noOfBedrooms: property.noOfBedrooms,
|
|
36
|
+
noOfBathrooms: property.noOfBathrooms,
|
|
37
|
+
noOfCarparks: property.noOfCarparks,
|
|
38
|
+
rent: property.rent,
|
|
39
|
+
loading: loading,
|
|
40
|
+
compact: true,
|
|
41
|
+
outlined: true
|
|
42
|
+
})), /* @__PURE__ */React.createElement(Grid, {
|
|
43
|
+
item: true,
|
|
44
|
+
xs: 4
|
|
45
|
+
}, /* @__PURE__ */React.createElement(Paper, {
|
|
46
|
+
inset: "medium",
|
|
47
|
+
outlined: true,
|
|
48
|
+
sx: {
|
|
49
|
+
height: "100%"
|
|
50
|
+
}
|
|
51
|
+
}, /* @__PURE__ */React.createElement(AgentDetailsCard, {
|
|
52
|
+
email: agent.email,
|
|
53
|
+
logo: agent.logo,
|
|
54
|
+
loading: loading,
|
|
55
|
+
name: agent.name,
|
|
56
|
+
phone: agent.phone
|
|
57
|
+
}))), stats && /* @__PURE__ */React.createElement(Grid, {
|
|
58
|
+
item: true,
|
|
59
|
+
xs: 12,
|
|
60
|
+
sx: {
|
|
61
|
+
display: "flex",
|
|
62
|
+
gap: "36px",
|
|
63
|
+
justifyContent: "space-between"
|
|
64
|
+
}
|
|
65
|
+
}, /* @__PURE__ */React.createElement(AnalyticsBox, {
|
|
66
|
+
outlined: true,
|
|
67
|
+
width: "100%",
|
|
68
|
+
height: "125px",
|
|
69
|
+
label: "Viewings",
|
|
70
|
+
amount: stats.viewingsCount || 0
|
|
71
|
+
}), /* @__PURE__ */React.createElement(AnalyticsBox, {
|
|
72
|
+
outlined: true,
|
|
73
|
+
width: "100%",
|
|
74
|
+
height: "125px",
|
|
75
|
+
label: "Bookings",
|
|
76
|
+
amount: stats.bookingsCount || 0
|
|
77
|
+
}), /* @__PURE__ */React.createElement(AnalyticsBox, {
|
|
78
|
+
outlined: true,
|
|
79
|
+
width: "100%",
|
|
80
|
+
height: "125px",
|
|
81
|
+
label: "Attended",
|
|
82
|
+
amount: stats.attendedBookingsCount || 0
|
|
83
|
+
}), /* @__PURE__ */React.createElement(AnalyticsBox, {
|
|
84
|
+
outlined: true,
|
|
85
|
+
width: "100%",
|
|
86
|
+
height: "125px",
|
|
87
|
+
label: "Cancelled",
|
|
88
|
+
amount: stats.cancelledBookingsCount || 0
|
|
89
|
+
}), /* @__PURE__ */React.createElement(AnalyticsBox, {
|
|
90
|
+
outlined: true,
|
|
91
|
+
width: "100%",
|
|
92
|
+
height: "125px",
|
|
93
|
+
label: "No-shows",
|
|
94
|
+
amount: stats.noShowBookingsCount || 0
|
|
95
|
+
}), /* @__PURE__ */React.createElement(AnalyticsBox, {
|
|
96
|
+
outlined: true,
|
|
97
|
+
width: "100%",
|
|
98
|
+
height: "125px",
|
|
99
|
+
label: "Enquiries",
|
|
100
|
+
amount: stats.enquiriesCount || 0
|
|
101
|
+
}), /* @__PURE__ */React.createElement(AnalyticsBox, {
|
|
102
|
+
outlined: true,
|
|
103
|
+
width: "100%",
|
|
104
|
+
height: "125px",
|
|
105
|
+
label: "Application numbers",
|
|
106
|
+
amount: stats.applicationsCount || 0
|
|
107
|
+
})), /* @__PURE__ */React.createElement(Grid, {
|
|
108
|
+
item: true,
|
|
109
|
+
xs: 12
|
|
110
|
+
}, /* @__PURE__ */React.createElement(Paper, {
|
|
111
|
+
inset: "medium",
|
|
112
|
+
sx: {
|
|
113
|
+
height: "100%"
|
|
114
|
+
},
|
|
115
|
+
outlined: true
|
|
116
|
+
}, /* @__PURE__ */React.createElement(BookingChart, {
|
|
117
|
+
data: chart.data || [],
|
|
118
|
+
labels: chart.labels || []
|
|
119
|
+
}))), /* @__PURE__ */React.createElement(Grid, {
|
|
120
|
+
item: true,
|
|
121
|
+
xs: 12
|
|
122
|
+
}, /* @__PURE__ */React.createElement(Heading, {
|
|
123
|
+
as: "h4",
|
|
124
|
+
weight: "700",
|
|
125
|
+
sx: {
|
|
126
|
+
mb: "20px"
|
|
127
|
+
}
|
|
128
|
+
}, "Bookings"), /* @__PURE__ */React.createElement(BookingTable, {
|
|
129
|
+
data: bookings,
|
|
130
|
+
loading: loading
|
|
131
|
+
})), /* @__PURE__ */React.createElement(Grid, {
|
|
132
|
+
item: true,
|
|
133
|
+
xs: 12
|
|
134
|
+
}, /* @__PURE__ */React.createElement(Heading, {
|
|
135
|
+
as: "h4",
|
|
136
|
+
weight: "700"
|
|
137
|
+
}, "Viewing notes")), loading && /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(Grid, {
|
|
138
|
+
item: true,
|
|
139
|
+
xs: 6
|
|
140
|
+
}, /* @__PURE__ */React.createElement(NotesCard, {
|
|
141
|
+
loading: true,
|
|
142
|
+
text: ""
|
|
143
|
+
})), /* @__PURE__ */React.createElement(Grid, {
|
|
144
|
+
item: true,
|
|
145
|
+
xs: 6
|
|
146
|
+
}, /* @__PURE__ */React.createElement(NotesCard, {
|
|
147
|
+
loading: true,
|
|
148
|
+
text: ""
|
|
149
|
+
})))), !loading && notes && notes.length && notes.map(function (_ref2, i) {
|
|
150
|
+
var label = _ref2.label,
|
|
151
|
+
data = _ref2.data;
|
|
152
|
+
return /* @__PURE__ */React.createElement(Box, {
|
|
153
|
+
key: uid({
|
|
154
|
+
label: label,
|
|
155
|
+
data: data
|
|
156
|
+
}, i),
|
|
157
|
+
mt: "15px"
|
|
158
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
159
|
+
container: true,
|
|
160
|
+
xs: 12,
|
|
161
|
+
spacing: 4
|
|
162
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
163
|
+
item: true,
|
|
164
|
+
xs: 12
|
|
165
|
+
}, /* @__PURE__ */React.createElement(Text, {
|
|
166
|
+
variant: "body2",
|
|
167
|
+
weight: "600"
|
|
168
|
+
}, "Date Recorded: ", label)), data.map(function (_ref3, j) {
|
|
169
|
+
var tag = _ref3.tag,
|
|
170
|
+
text = _ref3.text;
|
|
171
|
+
return /* @__PURE__ */React.createElement(Grid, {
|
|
172
|
+
item: true,
|
|
173
|
+
xs: 6,
|
|
174
|
+
key: uid({
|
|
175
|
+
tag: tag,
|
|
176
|
+
text: text
|
|
177
|
+
}, j),
|
|
178
|
+
sx: {
|
|
179
|
+
breakInside: "avoid"
|
|
34
180
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
name: agent.name,
|
|
43
|
-
phone: agent.phone
|
|
44
|
-
}
|
|
45
|
-
) }) }),
|
|
46
|
-
stats && /* @__PURE__ */ jsxs(
|
|
47
|
-
Grid,
|
|
48
|
-
{
|
|
49
|
-
item: true,
|
|
50
|
-
xs: 12,
|
|
51
|
-
sx: {
|
|
52
|
-
display: "flex",
|
|
53
|
-
gap: "36px",
|
|
54
|
-
justifyContent: "space-between"
|
|
55
|
-
},
|
|
56
|
-
children: [
|
|
57
|
-
/* @__PURE__ */ jsx(
|
|
58
|
-
AnalyticsBox,
|
|
59
|
-
{
|
|
60
|
-
outlined: true,
|
|
61
|
-
width: "100%",
|
|
62
|
-
height: "125px",
|
|
63
|
-
label: "Viewings",
|
|
64
|
-
amount: stats.viewingsCount || 0
|
|
65
|
-
}
|
|
66
|
-
),
|
|
67
|
-
/* @__PURE__ */ jsx(
|
|
68
|
-
AnalyticsBox,
|
|
69
|
-
{
|
|
70
|
-
outlined: true,
|
|
71
|
-
width: "100%",
|
|
72
|
-
height: "125px",
|
|
73
|
-
label: "Bookings",
|
|
74
|
-
amount: stats.bookingsCount || 0
|
|
75
|
-
}
|
|
76
|
-
),
|
|
77
|
-
/* @__PURE__ */ jsx(
|
|
78
|
-
AnalyticsBox,
|
|
79
|
-
{
|
|
80
|
-
outlined: true,
|
|
81
|
-
width: "100%",
|
|
82
|
-
height: "125px",
|
|
83
|
-
label: "Attended",
|
|
84
|
-
amount: stats.attendedBookingsCount || 0
|
|
85
|
-
}
|
|
86
|
-
),
|
|
87
|
-
/* @__PURE__ */ jsx(
|
|
88
|
-
AnalyticsBox,
|
|
89
|
-
{
|
|
90
|
-
outlined: true,
|
|
91
|
-
width: "100%",
|
|
92
|
-
height: "125px",
|
|
93
|
-
label: "Cancelled",
|
|
94
|
-
amount: stats.cancelledBookingsCount || 0
|
|
95
|
-
}
|
|
96
|
-
),
|
|
97
|
-
/* @__PURE__ */ jsx(
|
|
98
|
-
AnalyticsBox,
|
|
99
|
-
{
|
|
100
|
-
outlined: true,
|
|
101
|
-
width: "100%",
|
|
102
|
-
height: "125px",
|
|
103
|
-
label: "No-shows",
|
|
104
|
-
amount: stats.noShowBookingsCount || 0
|
|
105
|
-
}
|
|
106
|
-
),
|
|
107
|
-
/* @__PURE__ */ jsx(
|
|
108
|
-
AnalyticsBox,
|
|
109
|
-
{
|
|
110
|
-
outlined: true,
|
|
111
|
-
width: "100%",
|
|
112
|
-
height: "125px",
|
|
113
|
-
label: "Enquiries",
|
|
114
|
-
amount: stats.enquiriesCount || 0
|
|
115
|
-
}
|
|
116
|
-
),
|
|
117
|
-
/* @__PURE__ */ jsx(
|
|
118
|
-
AnalyticsBox,
|
|
119
|
-
{
|
|
120
|
-
outlined: true,
|
|
121
|
-
width: "100%",
|
|
122
|
-
height: "125px",
|
|
123
|
-
label: "Application numbers",
|
|
124
|
-
amount: stats.applicationsCount || 0
|
|
125
|
-
}
|
|
126
|
-
)
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
),
|
|
130
|
-
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(Paper, { inset: "medium", sx: { height: "100%" }, outlined: true, children: /* @__PURE__ */ jsx(BookingChart, { data: chart.data || [], labels: chart.labels || [] }) }) }),
|
|
131
|
-
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
132
|
-
/* @__PURE__ */ jsx(Heading, { as: "h4", weight: "700", sx: { mb: "20px" }, children: "Bookings" }),
|
|
133
|
-
/* @__PURE__ */ jsx(BookingTable, { data: bookings, loading })
|
|
134
|
-
] }),
|
|
135
|
-
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(Heading, { as: "h4", weight: "700", children: "Viewing notes" }) }),
|
|
136
|
-
loading && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
137
|
-
/* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(NotesCard, { loading: true, text: "" }) }),
|
|
138
|
-
/* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(NotesCard, { loading: true, text: "" }) })
|
|
139
|
-
] })
|
|
140
|
-
] }),
|
|
141
|
-
!loading && notes && notes.length && notes.map(({ label, data }, i) => /* @__PURE__ */ jsx(Box, { mt: "15px", children: /* @__PURE__ */ jsxs(Grid, { container: true, xs: 12, spacing: 4, children: [
|
|
142
|
-
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsxs(Text, { variant: "body2", weight: "600", children: [
|
|
143
|
-
"Date Recorded: ",
|
|
144
|
-
label
|
|
145
|
-
] }) }),
|
|
146
|
-
data.map(({ tag, text }, j) => /* @__PURE__ */ jsx(
|
|
147
|
-
Grid,
|
|
148
|
-
{
|
|
149
|
-
item: true,
|
|
150
|
-
xs: 6,
|
|
151
|
-
sx: { breakInside: "avoid" },
|
|
152
|
-
children: /* @__PURE__ */ jsx(NotesCard, { tag, text, outlined: true })
|
|
153
|
-
},
|
|
154
|
-
uid({ tag, text }, j)
|
|
155
|
-
))
|
|
156
|
-
] }) }, uid({ label, data }, i))),
|
|
157
|
-
footer
|
|
158
|
-
] });
|
|
181
|
+
}, /* @__PURE__ */React.createElement(NotesCard, {
|
|
182
|
+
tag: tag,
|
|
183
|
+
text: text,
|
|
184
|
+
outlined: true
|
|
185
|
+
}));
|
|
186
|
+
})));
|
|
187
|
+
}), footer);
|
|
159
188
|
}
|
|
160
189
|
|
|
161
190
|
export { OwnerBookingReport as default };
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import
|
|
3
|
-
import 'react';
|
|
2
|
+
import React from 'react';
|
|
4
3
|
import { Box, Text } from '@tenancy.nz/ui';
|
|
5
4
|
|
|
6
|
-
function ReportFooter(
|
|
7
|
-
|
|
5
|
+
function ReportFooter(_ref) {
|
|
6
|
+
var text = _ref.text;
|
|
7
|
+
return /* @__PURE__ */React.createElement(Box, {
|
|
8
|
+
mt: "24px",
|
|
9
|
+
color: "#595959"
|
|
10
|
+
}, /* @__PURE__ */React.createElement(Text, {
|
|
11
|
+
as: "div",
|
|
12
|
+
variant: "body2",
|
|
13
|
+
weight: "300",
|
|
14
|
+
italic: true
|
|
15
|
+
}, text || "This PDF is for - purposes."));
|
|
8
16
|
}
|
|
9
17
|
|
|
10
18
|
export { ReportFooter as default };
|
|
@@ -1,33 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import
|
|
3
|
-
import 'react';
|
|
2
|
+
import React from 'react';
|
|
4
3
|
import { Box, Grid, Heading } from '@tenancy.nz/ui';
|
|
5
4
|
|
|
6
|
-
function ReportHeader({
|
|
7
|
-
heading,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
5
|
+
function ReportHeader(_ref) {
|
|
6
|
+
var heading = _ref.heading,
|
|
7
|
+
_ref$subheading = _ref.subheading,
|
|
8
|
+
subheading = _ref$subheading === void 0 ? void 0 : _ref$subheading,
|
|
9
|
+
logo = _ref.logo;
|
|
10
|
+
return /* @__PURE__ */React.createElement(Box, {
|
|
11
|
+
mb: "24px",
|
|
12
|
+
borderBottom: "1px solid #E0E0E0",
|
|
13
|
+
paddingBottom: "8px"
|
|
14
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
15
|
+
container: true,
|
|
16
|
+
spacing: 6
|
|
17
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
18
|
+
item: true,
|
|
19
|
+
xs: 8
|
|
20
|
+
}, /* @__PURE__ */React.createElement(Heading, {
|
|
21
|
+
as: "h1",
|
|
22
|
+
weight: "700",
|
|
23
|
+
sx: {
|
|
24
|
+
mb: "8px"
|
|
25
|
+
}
|
|
26
|
+
}, heading), subheading && /* @__PURE__ */React.createElement(Heading, {
|
|
27
|
+
as: "h5",
|
|
28
|
+
weight: "500"
|
|
29
|
+
}, subheading)), /* @__PURE__ */React.createElement(Grid, {
|
|
30
|
+
item: true,
|
|
31
|
+
xs: 4,
|
|
32
|
+
sx: {
|
|
33
|
+
display: "flex",
|
|
34
|
+
justifyContent: "flex-end"
|
|
35
|
+
}
|
|
36
|
+
}, logo && /* @__PURE__ */React.createElement(Box, {
|
|
37
|
+
sx: {
|
|
38
|
+
width: "150px",
|
|
39
|
+
height: "35px",
|
|
40
|
+
"> img": {
|
|
41
|
+
maxWidth: "100%",
|
|
42
|
+
maxHeight: "100%"
|
|
28
43
|
}
|
|
29
|
-
|
|
30
|
-
|
|
44
|
+
}
|
|
45
|
+
}, /* @__PURE__ */React.createElement("img", {
|
|
46
|
+
src: logo,
|
|
47
|
+
alt: "Tenancy"
|
|
48
|
+
})))));
|
|
31
49
|
}
|
|
32
50
|
|
|
33
51
|
export { ReportHeader as default };
|
|
@@ -1,86 +1,94 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
2
|
import { ThemeProvider, Box, Heading, Text, Grid } from '@tenancy.nz/ui';
|
|
4
3
|
import { AnalyticsSection, GridList, PropertyCard } from '@tenancy.nz/feature-ui';
|
|
5
4
|
|
|
6
|
-
function ViewingAnalyticsReport(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
5
|
+
function ViewingAnalyticsReport(_ref) {
|
|
6
|
+
var eventData = _ref.eventData;
|
|
7
|
+
var stats = eventData.stats || {};
|
|
8
|
+
var properties = eventData.properties || [];
|
|
9
|
+
return /* @__PURE__ */React.createElement(ThemeProvider, null, /* @__PURE__ */React.createElement(Box, {
|
|
10
|
+
padding: "20px"
|
|
11
|
+
}, /* @__PURE__ */React.createElement(Box, {
|
|
12
|
+
mb: 6,
|
|
13
|
+
display: "flex",
|
|
14
|
+
justify: "space-between",
|
|
15
|
+
align: "start"
|
|
16
|
+
}, /* @__PURE__ */React.createElement(Box, null, /* @__PURE__ */React.createElement(Heading, {
|
|
17
|
+
variant: "h1",
|
|
18
|
+
as: "h1",
|
|
19
|
+
gutterBottom: false
|
|
20
|
+
}, "Analytics Report")), /* @__PURE__ */React.createElement(Box, {
|
|
21
|
+
display: "flex",
|
|
22
|
+
align: "flex-end",
|
|
23
|
+
direction: "column"
|
|
24
|
+
}, /* @__PURE__ */React.createElement(Text, {
|
|
25
|
+
mt: 2
|
|
26
|
+
}, eventData.fromDate && /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(Text, {
|
|
27
|
+
weight: "700",
|
|
28
|
+
as: "span",
|
|
29
|
+
display: "inline"
|
|
30
|
+
}, "Report Range From"), " ", eventData.fromDate, " "), eventData.toDate && /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(Text, {
|
|
31
|
+
weight: "700",
|
|
32
|
+
as: "span",
|
|
33
|
+
display: "inline"
|
|
34
|
+
}, "To"), " ", eventData.toDate)), eventData.viewingAgent && /* @__PURE__ */React.createElement(Text, {
|
|
35
|
+
color: "textPrimary",
|
|
36
|
+
weight: "700",
|
|
37
|
+
fontSize: 12
|
|
38
|
+
}, "Viewing agent:", " ", /* @__PURE__ */React.createElement(Text, {
|
|
39
|
+
weight: "400",
|
|
40
|
+
as: "span",
|
|
41
|
+
display: "inline"
|
|
42
|
+
}, eventData.viewingAgent)), eventData.propertyAgent && /* @__PURE__ */React.createElement(Text, {
|
|
43
|
+
color: "textPrimary",
|
|
44
|
+
weight: "700",
|
|
45
|
+
fontSize: 12
|
|
46
|
+
}, "Property agent:", " ", /* @__PURE__ */React.createElement(Text, {
|
|
47
|
+
weight: "400",
|
|
48
|
+
as: "span",
|
|
49
|
+
display: "inline"
|
|
50
|
+
}, eventData.propertyAgent)))), /* @__PURE__ */React.createElement(AnalyticsSection, {
|
|
51
|
+
viewingsCount: stats.viewings_count,
|
|
52
|
+
bookingsCount: stats.bookings_count,
|
|
53
|
+
attendeesCount: stats.viewing_attendees_count,
|
|
54
|
+
cancellationsCount: stats.bookings_cancelled_count,
|
|
55
|
+
applicationsCount: stats.applications_count,
|
|
56
|
+
averageRent: stats.avg_rent,
|
|
57
|
+
textUsage: stats.sent_sms_count,
|
|
58
|
+
tradeMeEnquiriesCount: stats.trademe_enquiries_count,
|
|
59
|
+
bookMeEnquiriesCount: stats.bookme_enquiries_count,
|
|
60
|
+
manualEnquiryCount: stats.enquiries_count,
|
|
61
|
+
agreementsCount: stats.agreements_count,
|
|
62
|
+
agreementsFinalisedCount: stats.agreements_finalised_count,
|
|
63
|
+
filterDaysCount: eventData.filterDaysCount
|
|
64
|
+
}), /* @__PURE__ */React.createElement(Box, null, /* @__PURE__ */React.createElement(Heading, {
|
|
65
|
+
variant: "h4",
|
|
66
|
+
as: "h4",
|
|
67
|
+
mt: "20px",
|
|
68
|
+
gutterBottom: false
|
|
69
|
+
}, "Top 5 properties"), /* @__PURE__ */React.createElement(GridList, {
|
|
70
|
+
mt: "20px",
|
|
71
|
+
items: properties,
|
|
72
|
+
spacing: 5,
|
|
73
|
+
emptyComponent: /* @__PURE__ */React.createElement(Text, null, "No results to show"),
|
|
74
|
+
renderItem: function renderItem(property) {
|
|
75
|
+
return /* @__PURE__ */React.createElement(Grid, {
|
|
76
|
+
item: true,
|
|
77
|
+
xs: 12
|
|
78
|
+
}, /* @__PURE__ */React.createElement(PropertyCard, {
|
|
79
|
+
propertyAddress: property.short_address,
|
|
80
|
+
listingDate: "",
|
|
81
|
+
daysOnMarket: "",
|
|
82
|
+
weeklyRent: property.rent_amount,
|
|
83
|
+
viewingsCount: property.viewings_count,
|
|
84
|
+
enquiriesCount: property.enquiries_count,
|
|
85
|
+
propertyImage: property.thumb_url,
|
|
86
|
+
beds: property.num_bedrooms,
|
|
87
|
+
baths: property.num_bathrooms,
|
|
88
|
+
carports: property.num_cars
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
}))));
|
|
84
92
|
}
|
|
85
93
|
|
|
86
94
|
export { ViewingAnalyticsReport as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenancy.nz/reports",
|
|
3
3
|
"description": "React UI reporting components.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"author": "TPS <https://www.tenancy.co.nz>",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"type": "module",
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"react": ">= 16.0.0 <= 18.3.1",
|
|
16
16
|
"react-dom": ">= 16.0.0 <= 18.3.1",
|
|
17
|
-
"@tenancy.nz/ui": "1.0.
|
|
18
|
-
"@tenancy.nz/
|
|
17
|
+
"@tenancy.nz/feature-ui": "1.0.2",
|
|
18
|
+
"@tenancy.nz/ui": "1.0.5"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"react": "^19.1.0",
|
|
22
22
|
"react-dom": "^19.1.0",
|
|
23
|
-
"@tenancy.nz/
|
|
24
|
-
"@tenancy.nz/ui": "1.0.
|
|
23
|
+
"@tenancy.nz/ui": "1.0.5",
|
|
24
|
+
"@tenancy.nz/feature-ui": "1.0.2"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"react-uid": "^2.4.0"
|