@ozdao/prometheus-framework 0.2.254 → 0.2.256
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/events.server.js +1 -1
- package/dist/events.server.mjs +1 -1
- package/dist/prometheus-framework/src/components/SelectMulti/SelectMulti.vue2.cjs +450 -0
- package/dist/prometheus-framework/src/components/SelectMulti/SelectMulti.vue2.cjs.map +1 -0
- package/dist/prometheus-framework/src/components/SelectMulti/SelectMulti.vue2.js +450 -0
- package/dist/prometheus-framework/src/components/SelectMulti/SelectMulti.vue2.js.map +1 -0
- package/dist/prometheus-framework/src/modules/pages/pages.client.cjs +138 -138
- package/dist/prometheus-framework/src/modules/pages/pages.client.js +138 -138
- package/dist/tickets.controller-A_1G-2vC.js +438 -0
- package/dist/tickets.controller-C07KixAL.mjs +443 -0
- package/dist/tickets.controller-C6UL9C5M.mjs +439 -0
- package/dist/tickets.controller-DPjBlikx.js +442 -0
- package/dist/wallet.server.js +1 -1
- package/dist/wallet.server.mjs +1 -1
- package/package.json +1 -1
- package/src/modules/events/controllers/tickets.controller.js +8 -3
@@ -0,0 +1,438 @@
|
|
1
|
+
"use strict";
|
2
|
+
const require$$0$1 = require("path");
|
3
|
+
const require$$1 = require("puppeteer");
|
4
|
+
const require$$2 = require("qrcode");
|
5
|
+
const require$$0 = require("mustache");
|
6
|
+
const mailing = require("./mailing-BQKyTI-q.js");
|
7
|
+
const Mustache$1 = require$$0;
|
8
|
+
const template$1 = `
|
9
|
+
<!DOCTYPE html>
|
10
|
+
<html lang="en">
|
11
|
+
<head>
|
12
|
+
<meta charset="UTF-8">
|
13
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
14
|
+
<style>
|
15
|
+
@media print {
|
16
|
+
body {-webkit-print-color-adjust: exact;}
|
17
|
+
}
|
18
|
+
|
19
|
+
body {
|
20
|
+
padding: 10%;
|
21
|
+
font-family: Arial,Helvetica,sans-serif
|
22
|
+
}
|
23
|
+
.ticket {
|
24
|
+
display: grid;
|
25
|
+
grid-template-columns: 100% 143px;
|
26
|
+
background: #f5f5f5;
|
27
|
+
border-radius: 48px;
|
28
|
+
cursor: default;
|
29
|
+
}
|
30
|
+
.ticket__main {
|
31
|
+
display: grid;
|
32
|
+
grid-template-columns: repeat(6, 1fr) 120px;
|
33
|
+
grid-template-rows: repeat(4, min-content) auto;
|
34
|
+
padding: 20px;
|
35
|
+
}
|
36
|
+
.header {
|
37
|
+
grid-area: title;
|
38
|
+
grid-column: span 7;
|
39
|
+
grid-row: 1;
|
40
|
+
display: flex;
|
41
|
+
align-items: center;
|
42
|
+
justify-content: center;
|
43
|
+
padding: 15px 20px 15px 20px;
|
44
|
+
width: 100%;
|
45
|
+
box-sizing: border-box;
|
46
|
+
background: #111;
|
47
|
+
border-radius: 24px 24px 0 0;
|
48
|
+
}
|
49
|
+
.header svg {
|
50
|
+
width: auto;
|
51
|
+
height: 48px;
|
52
|
+
margin-right: 8px;
|
53
|
+
}
|
54
|
+
.header p {
|
55
|
+
color: white;
|
56
|
+
border-radius: 48px;
|
57
|
+
padding: 5px 10px 5px 10px;
|
58
|
+
margin-left: auto;
|
59
|
+
line-height: 1;
|
60
|
+
font-weight: 400;
|
61
|
+
font-family: 'Helvetica Neue';
|
62
|
+
font-size: 10px;
|
63
|
+
text-transform: uppercase;
|
64
|
+
}
|
65
|
+
.header div {
|
66
|
+
color: white;
|
67
|
+
border-radius: 48px;
|
68
|
+
padding: 5px 10px 5px 10px;
|
69
|
+
margin-left: 0px;
|
70
|
+
line-height: 1;
|
71
|
+
text-transform: uppercase;
|
72
|
+
background: #E31C25;
|
73
|
+
}
|
74
|
+
.header span {
|
75
|
+
display: block;
|
76
|
+
}
|
77
|
+
.info {
|
78
|
+
border: 1px solid;
|
79
|
+
border-width: 0 1px 1px 0;
|
80
|
+
border-color: rgba(0,0,0,0.1);
|
81
|
+
padding: 8px;
|
82
|
+
}
|
83
|
+
.info__item {
|
84
|
+
font-size: 9px;
|
85
|
+
margin-top: 4px;
|
86
|
+
text-transform: uppercase;
|
87
|
+
letter-spacing: 0.5px;
|
88
|
+
font-family: 'Helvetica Neue';
|
89
|
+
}
|
90
|
+
.info__detail {
|
91
|
+
font: 700 20px/1;
|
92
|
+
letter-spacing: 1px;
|
93
|
+
font-weight: 600;
|
94
|
+
text-transform: uppercase;
|
95
|
+
margin-top: 4px;
|
96
|
+
color: #e31c25;
|
97
|
+
}
|
98
|
+
.passenger {
|
99
|
+
grid-column: 1 / span 6;
|
100
|
+
}
|
101
|
+
.platform {
|
102
|
+
grid-column: 7 / span 1;
|
103
|
+
grid-row: 2 / span 3;
|
104
|
+
background: #e31c25;
|
105
|
+
color: #fff;
|
106
|
+
border-color: rgba(0,0,0,0.1);
|
107
|
+
text-align: center;
|
108
|
+
padding: 10px;
|
109
|
+
border-radius: 0 0 24px 0;
|
110
|
+
font-size: 18px;
|
111
|
+
line-height: 1;
|
112
|
+
}
|
113
|
+
.platform img {
|
114
|
+
width: 100%;
|
115
|
+
padding: 10%;
|
116
|
+
box-sizing: border-box;
|
117
|
+
}
|
118
|
+
.departure, .arrival {
|
119
|
+
grid-column-start: span 3;
|
120
|
+
}
|
121
|
+
.passenger, .departure, .date {
|
122
|
+
border-left: 1px solid;
|
123
|
+
border-color: rgba(0,0,0,0.1);
|
124
|
+
}
|
125
|
+
.date, .time {
|
126
|
+
grid-column-start: span 3;
|
127
|
+
}
|
128
|
+
.date {
|
129
|
+
border-radius: 0 0 0 24px;
|
130
|
+
}
|
131
|
+
</style>
|
132
|
+
</head>
|
133
|
+
<body>
|
134
|
+
<div class="main-content">
|
135
|
+
<div class="ticket">
|
136
|
+
<div class="ticket__main">
|
137
|
+
<div class="header">
|
138
|
+
<svg class="w-auto h-3r" width="838" height="259" viewBox="0 0 838 259" fill="none" xmlns="http://www.w3.org/2000/svg">
|
139
|
+
<path d="M118.019 23.4448C118.019 21.1861 119.85 19.355 122.109 19.355H135.784C138.043 19.355 139.874 21.1861 139.874 23.4448V129.185H118.019V23.4448Z" fill="#E31C25"/>
|
140
|
+
<path d="M90.5875 52.6748C89.338 51.9401 88.5708 50.5988 88.5708 49.1494L88.5708 36.7835C88.5708 33.6207 92.0073 31.6548 94.7338 33.2581L118.019 46.9512L118.019 68.8062L90.5875 52.6748Z" fill="#E31C25"/>
|
141
|
+
<path d="M167.306 52.6748C168.556 51.9401 169.323 50.5988 169.323 49.1494L169.323 36.7835C169.323 33.6207 165.886 31.6548 163.16 33.2581L139.874 46.9512L139.874 68.8062L167.306 52.6748Z" fill="#E31C25"/>
|
142
|
+
<path d="M139.917 234.911C139.917 237.169 138.085 239 135.827 239L122.151 239C119.893 239 118.062 237.169 118.062 234.911L118.062 129.17L139.917 129.17L139.917 234.911Z" fill="#E31C25"/>
|
143
|
+
<path d="M167.349 205.681C168.598 206.415 169.365 207.757 169.365 209.206L169.365 221.572C169.365 224.735 165.929 226.701 163.202 225.097L139.917 211.404L139.917 189.549L167.349 205.681Z" fill="#E31C25"/>
|
144
|
+
<path d="M90.6295 205.681C89.38 206.415 88.6128 207.757 88.6128 209.206L88.6128 221.572C88.6128 224.735 92.0493 226.701 94.7758 225.097L118.061 211.404L118.061 189.549L90.6295 205.681Z" fill="#E31C25"/>
|
145
|
+
<path d="M31.9262 85.7934C29.97 84.6641 29.2998 82.1628 30.4292 80.2066L37.2668 68.3635C38.3962 66.4074 40.8975 65.7371 42.8536 66.8665L134.428 119.737L123.5 138.664L31.9262 85.7934Z" fill="#E31C25"/>
|
146
|
+
<path d="M43.524 124.165C42.263 124.88 40.7178 124.874 39.4626 124.149L28.7535 117.966C26.0143 116.385 26.0301 112.426 28.7818 110.866L52.2832 97.5468L71.2102 108.474L43.524 124.165Z" fill="#E31C25"/>
|
147
|
+
<path d="M81.8838 57.7248C81.8722 56.2753 81.0943 54.9403 79.839 54.2155L69.1299 48.0326C66.3908 46.4512 62.97 48.4444 62.9953 51.6072L63.2111 78.6197L82.138 89.5472L81.8838 57.7248Z" fill="#E31C25"/>
|
148
|
+
<path d="M226.01 172.563C227.966 173.692 228.636 176.193 227.507 178.149L220.669 189.992C219.54 191.949 217.039 192.619 215.082 191.489L123.508 138.619L134.436 119.692L226.01 172.563Z" fill="#E31C25"/>
|
149
|
+
<path d="M214.412 134.191C215.673 133.476 217.218 133.482 218.473 134.207L229.182 140.39C231.921 141.971 231.905 145.93 229.154 147.49L205.652 160.809L186.725 149.882L214.412 134.191Z" fill="#E31C25"/>
|
150
|
+
<path d="M176.052 200.631C176.064 202.081 176.842 203.416 178.097 204.14L188.806 210.323C191.545 211.905 194.966 209.912 194.941 206.749L194.725 179.736L175.798 168.809L176.052 200.631Z" fill="#E31C25"/>
|
151
|
+
<path d="M42.8744 191.526C40.9183 192.656 38.417 191.986 37.2876 190.029L30.45 178.186C29.3206 176.23 29.9908 173.729 31.9469 172.599L123.521 119.729L134.448 138.656L42.8744 191.526Z" fill="#E31C25"/>
|
152
|
+
<path d="M81.9048 200.668C81.8932 202.117 81.1153 203.452 79.86 204.177L69.1509 210.36C66.4118 211.941 62.991 209.948 63.0163 206.785L63.232 179.773L82.159 168.845L81.9048 200.668Z" fill="#E31C25"/>
|
153
|
+
<path d="M43.5455 134.227C42.2845 133.513 40.7393 133.519 39.484 134.243L28.7749 140.426C26.0358 142.008 26.0516 145.967 28.8033 147.526L52.3047 160.846L71.2316 149.918L43.5455 134.227Z" fill="#E31C25"/>
|
154
|
+
<path d="M215.061 66.8296C217.017 65.7002 219.519 66.3704 220.648 68.3266L227.486 80.1697C228.615 82.1258 227.945 84.6271 225.989 85.7565L134.415 138.627L123.487 119.7L215.061 66.8296Z" fill="#E31C25"/>
|
155
|
+
<path d="M176.031 57.6877C176.042 56.2382 176.82 54.9032 178.076 54.1784L188.785 47.9955C191.524 46.4141 194.945 48.4073 194.919 51.5701L194.703 78.5826L175.777 89.5101L176.031 57.6877Z" fill="#E31C25"/>
|
156
|
+
<path d="M214.39 124.128C215.651 124.843 217.196 124.837 218.452 124.112L229.161 117.929C231.9 116.348 231.884 112.389 229.132 110.829L205.631 97.5097L186.704 108.437L214.39 124.128Z" fill="#E31C25"/>
|
157
|
+
<path d="M129 116.049L140.216 122.524V135.476L129 141.951L117.784 135.476V122.524L129 116.049Z" fill="#E31C25"/>
|
158
|
+
<path d="M820.446 72.9078V76.2201H822.534C823.443 76.2201 824.12 76.0902 824.566 75.8304C825.03 75.552 825.262 75.0974 825.262 74.4665C825.262 73.9284 825.057 73.5387 824.649 73.2975C824.26 73.0377 823.749 72.9078 823.118 72.9078H820.446ZM818.609 82.9836V71.2378H823.063C825.753 71.2378 827.099 72.3419 827.099 74.55C827.099 75.1067 827.015 75.5799 826.848 75.9695C826.7 76.3592 826.486 76.6839 826.208 76.9437C825.93 77.2035 825.605 77.4076 825.234 77.5561C824.881 77.686 824.501 77.7787 824.093 77.8344L827.46 82.9836H825.234L821.866 77.8901H820.446V82.9836H818.609ZM830.494 77.1107C830.494 75.9788 830.281 74.9119 829.854 73.9099C829.427 72.9078 828.852 72.0357 828.128 71.2935C827.405 70.5513 826.551 69.9667 825.568 69.54C824.584 69.0946 823.536 68.8719 822.423 68.8719C821.309 68.8719 820.261 69.0946 819.277 69.54C818.294 69.9667 817.44 70.5513 816.717 71.2935C815.993 72.0357 815.418 72.9078 814.991 73.9099C814.564 74.9119 814.351 75.9788 814.351 77.1107C814.351 78.2426 814.564 79.3096 814.991 80.3116C815.418 81.3136 815.993 82.1857 816.717 82.928C817.44 83.6702 818.294 84.264 819.277 84.7093C820.261 85.1361 821.309 85.3495 822.423 85.3495C823.536 85.3495 824.584 85.1361 825.568 84.7093C826.551 84.264 827.405 83.6702 828.128 82.928C828.852 82.1857 829.427 81.3136 829.854 80.3116C830.281 79.3096 830.494 78.2426 830.494 77.1107ZM812.347 77.1107C812.347 75.719 812.607 74.4109 813.126 73.1862C813.664 71.9615 814.388 70.8945 815.297 69.9853C816.206 69.0761 817.273 68.3617 818.498 67.8421C819.723 67.304 821.031 67.0349 822.423 67.0349C823.814 67.0349 825.122 67.304 826.347 67.8421C827.572 68.3617 828.639 69.0761 829.548 69.9853C830.457 70.8945 831.172 71.9615 831.691 73.1862C832.229 74.4109 832.498 75.719 832.498 77.1107C832.498 78.5024 832.229 79.8106 831.691 81.0353C831.172 82.26 830.457 83.3269 829.548 84.2362C828.639 85.1454 827.572 85.8691 826.347 86.4072C825.122 86.9268 823.814 87.1865 822.423 87.1865C821.031 87.1865 819.723 86.9268 818.498 86.4072C817.273 85.8691 816.206 85.1454 815.297 84.2362C814.388 83.3269 813.664 82.26 813.126 81.0353C812.607 79.8106 812.347 78.5024 812.347 77.1107Z" fill="#FFFFFF"/>
|
159
|
+
<path d="M282.366 171.672C281.589 171.672 281.201 171.197 281.201 170.248V88.3279C281.201 87.3788 281.589 86.9043 282.366 86.9043H297.249C297.939 86.9043 298.37 87.2494 298.543 87.9396L310.32 130.647C310.924 132.804 311.528 135.22 312.132 137.894C312.822 140.569 313.469 143.287 314.073 146.047C314.763 148.722 315.281 151.095 315.626 153.165H315.885C315.798 151.44 315.669 149.455 315.496 147.212C315.41 144.883 315.281 142.51 315.108 140.094C315.022 137.592 314.936 135.22 314.849 132.976C314.849 130.647 314.849 128.619 314.849 126.894V88.1985C314.849 87.3357 315.238 86.9043 316.014 86.9043H326.497C327.273 86.9043 327.662 87.3357 327.662 88.1985V170.248C327.662 171.197 327.273 171.672 326.497 171.672H311.743C311.139 171.672 310.708 171.37 310.449 170.766L298.672 128.965C297.551 124.91 296.559 120.898 295.696 116.929C294.833 112.874 294.056 109.121 293.366 105.67H293.107C293.28 108.172 293.409 111.105 293.496 114.47C293.668 117.835 293.798 121.2 293.884 124.564C293.97 127.843 294.013 130.733 294.013 133.235V170.248C294.013 171.197 293.668 171.672 292.978 171.672H282.366ZM354.879 172.448C347.201 172.448 341.334 170.205 337.279 165.719C333.31 161.232 331.326 154.546 331.326 145.659V113.046C331.326 104.074 333.31 97.3439 337.279 92.8575C341.334 88.371 347.201 86.1278 354.879 86.1278C362.472 86.1278 368.295 88.371 372.351 92.8575C376.406 97.3439 378.433 104.074 378.433 113.046V145.659C378.433 154.546 376.406 161.232 372.351 165.719C368.295 170.205 362.472 172.448 354.879 172.448ZM354.879 160.024C358.244 160.024 360.746 158.86 362.385 156.53C364.111 154.201 364.974 150.361 364.974 145.012V113.693C364.974 108.258 364.111 104.375 362.385 102.046C360.746 99.7165 358.244 98.5518 354.879 98.5518C351.515 98.5518 348.969 99.7165 347.244 102.046C345.605 104.375 344.785 108.258 344.785 113.693V145.012C344.785 150.361 345.605 154.201 347.244 156.53C348.969 158.86 351.515 160.024 354.879 160.024ZM391.969 171.672C391.193 171.672 390.804 171.197 390.804 170.248L391.84 88.3279C391.84 87.3788 392.271 86.9043 393.134 86.9043H407.24C408.103 86.9043 408.578 87.2494 408.664 87.9396L420.441 133.365L432.347 87.9396C432.433 87.2494 432.908 86.9043 433.771 86.9043H447.877C448.653 86.9043 449.042 87.3788 449.042 88.3279L450.206 170.248C450.206 171.197 449.818 171.672 449.042 171.672H438.041C437.265 171.672 436.877 171.197 436.877 170.248L436.488 128.317C436.402 124.521 436.402 120.941 436.488 117.576C436.661 114.125 436.833 110.976 437.006 108.129H436.877C436.273 110.803 435.582 113.521 434.806 116.282C434.029 118.956 433.21 121.631 432.347 124.306L421.994 159.766C421.821 160.456 421.39 160.801 420.7 160.801H420.182C419.578 160.801 419.19 160.456 419.017 159.766L408.534 124.306C407.672 121.631 406.852 118.956 406.076 116.282C405.385 113.521 404.738 110.803 404.134 108.129H403.875C404.134 110.976 404.307 114.125 404.393 117.576C404.566 120.941 404.609 124.521 404.523 128.317L404.134 170.248C404.134 171.197 403.746 171.672 402.97 171.672H391.969ZM476.51 172.448C468.832 172.448 462.965 170.205 458.91 165.719C454.941 161.232 452.957 154.546 452.957 145.659V113.046C452.957 104.074 454.941 97.3439 458.91 92.8575C462.965 88.371 468.832 86.1278 476.51 86.1278C484.103 86.1278 489.926 88.371 493.981 92.8575C498.036 97.3439 500.064 104.074 500.064 113.046V145.659C500.064 154.546 498.036 161.232 493.981 165.719C489.926 170.205 484.103 172.448 476.51 172.448ZM476.51 160.024C479.875 160.024 482.377 158.86 484.016 156.53C485.742 154.201 486.605 150.361 486.605 145.012V113.693C486.605 108.258 485.742 104.375 484.016 102.046C482.377 99.7165 479.875 98.5518 476.51 98.5518C473.145 98.5518 470.6 99.7165 468.875 102.046C467.235 104.375 466.416 108.258 466.416 113.693V145.012C466.416 150.361 467.235 154.201 468.875 156.53C470.6 158.86 473.145 160.024 476.51 160.024ZM504.8 171.672C504.023 171.672 503.635 171.197 503.635 170.248V88.3279C503.635 87.3788 504.023 86.9043 504.8 86.9043H522.4C530.597 86.9043 536.593 88.8887 540.389 92.8575C544.185 96.7399 546.084 102.909 546.084 111.364C546.084 117.662 545.178 122.709 543.366 126.506C541.64 130.216 539.138 132.847 535.86 134.4L535.73 134.529L549.19 169.989C549.448 171.111 549.103 171.672 548.154 171.672H535.989C535.385 171.672 534.954 171.37 534.695 170.766L523.048 137.118H517.224V170.248C517.224 171.197 516.836 171.672 516.059 171.672H504.8ZM517.224 125.6H522.53C526.067 125.6 528.612 124.478 530.165 122.235C531.718 119.992 532.495 116.584 532.495 112.011C532.495 107.525 531.675 104.289 530.036 102.305C528.397 100.234 525.808 99.1988 522.271 99.1988H517.224V125.6ZM551.539 171.672C550.676 171.672 550.245 171.197 550.245 170.248V88.3279C550.245 87.3788 550.633 86.9043 551.41 86.9043H585.835C586.611 86.9043 586.999 87.3788 586.999 88.3279V97.7753C586.999 98.7243 586.611 99.1988 585.835 99.1988H563.834V122.753H583.893C584.67 122.753 585.058 123.227 585.058 124.176V133.106C585.058 134.055 584.67 134.529 583.893 134.529H563.834V159.377H585.835C586.611 159.377 586.999 159.852 586.999 160.801V170.248C586.999 171.197 586.611 171.672 585.835 171.672H551.539ZM618.357 172.448C613.181 172.448 608.996 171.413 605.804 169.342C602.698 167.272 600.498 164.381 599.204 160.672C597.996 156.962 597.608 152.605 598.039 147.6C598.125 146.565 598.514 146.047 599.204 146.047H610.204C610.981 146.047 611.326 146.522 611.24 147.471C610.808 151.699 611.24 154.934 612.534 157.177C613.828 159.334 615.899 160.413 618.746 160.413C621.334 160.413 623.232 159.636 624.44 158.083C625.734 156.53 626.381 154.071 626.381 150.706C626.381 147.773 625.907 145.314 624.958 143.33C624.095 141.259 622.628 139.447 620.557 137.894L609.687 129.353C605.804 126.333 602.914 123.098 601.016 119.647C599.118 116.109 598.212 111.752 598.298 106.576C598.384 100.105 600.11 95.1007 603.475 91.5633C606.839 87.9396 611.757 86.1278 618.228 86.1278C625.648 86.1278 631.083 88.2416 634.534 92.4692C637.986 96.6968 639.366 102.607 638.676 110.199C638.589 111.407 638.201 112.011 637.511 112.011H626.381C625.518 112.011 625.173 111.407 625.346 110.199C625.691 106.576 625.303 103.685 624.181 101.528C623.06 99.2851 621.248 98.1635 618.746 98.1635C616.589 98.1635 614.906 98.8537 613.698 100.234C612.491 101.615 611.843 103.772 611.757 106.705C611.757 109.552 612.275 111.925 613.31 113.823C614.432 115.721 616.028 117.447 618.099 119L628.581 127.153C631.428 129.223 633.672 131.38 635.311 133.624C636.95 135.78 638.115 138.239 638.805 141C639.582 143.675 639.927 146.867 639.84 150.577C639.84 157.479 638.115 162.872 634.664 166.754C631.213 170.55 625.777 172.448 618.357 172.448ZM643.341 171.672C642.564 171.672 642.176 171.197 642.176 170.248V88.3279C642.176 87.3788 642.564 86.9043 643.341 86.9043H658.224C658.914 86.9043 659.345 87.2494 659.518 87.9396L671.295 130.647C671.899 132.804 672.503 135.22 673.106 137.894C673.797 140.569 674.444 143.287 675.048 146.047C675.738 148.722 676.256 151.095 676.601 153.165H676.86C676.773 151.44 676.644 149.455 676.471 147.212C676.385 144.883 676.256 142.51 676.083 140.094C675.997 137.592 675.911 135.22 675.824 132.976C675.824 130.647 675.824 128.619 675.824 126.894V88.1985C675.824 87.3357 676.212 86.9043 676.989 86.9043H687.472C688.248 86.9043 688.636 87.3357 688.636 88.1985V170.248C688.636 171.197 688.248 171.672 687.472 171.672H672.718C672.114 171.672 671.683 171.37 671.424 170.766L659.647 128.965C658.526 124.91 657.533 120.898 656.671 116.929C655.808 112.874 655.031 109.121 654.341 105.67H654.082C654.255 108.172 654.384 111.105 654.471 114.47C654.643 117.835 654.773 121.2 654.859 124.564C654.945 127.843 654.988 130.733 654.988 133.235V170.248C654.988 171.197 654.643 171.672 653.953 171.672H643.341ZM715.854 172.448C708.176 172.448 702.309 170.205 698.254 165.719C694.285 161.232 692.301 154.546 692.301 145.659V113.046C692.301 104.074 694.285 97.3439 698.254 92.8575C702.309 88.371 708.176 86.1278 715.854 86.1278C723.447 86.1278 729.27 88.371 733.325 92.8575C737.38 97.3439 739.408 104.074 739.408 113.046V145.659C739.408 154.546 737.38 161.232 733.325 165.719C729.27 170.205 723.447 172.448 715.854 172.448ZM715.854 160.024C719.219 160.024 721.721 158.86 723.36 156.53C725.086 154.201 725.949 150.361 725.949 145.012V113.693C725.949 108.258 725.086 104.375 723.36 102.046C721.721 99.7165 719.219 98.5518 715.854 98.5518C712.489 98.5518 709.944 99.7165 708.219 102.046C706.579 104.375 705.76 108.258 705.76 113.693V145.012C705.76 150.361 706.579 154.201 708.219 156.53C709.944 158.86 712.489 160.024 715.854 160.024ZM752.706 171.672C752.016 171.672 751.628 171.284 751.542 170.507L737.824 88.4573C737.651 87.422 737.953 86.9043 738.73 86.9043H749.989C750.765 86.9043 751.24 87.2926 751.412 88.0691L757.365 127.8C757.797 130.992 758.142 134.184 758.401 137.377C758.746 140.483 759.005 143.675 759.177 146.953C759.436 150.146 759.609 153.381 759.695 156.66H759.954C760.385 153.726 760.817 150.793 761.248 147.859C761.679 144.84 762.154 141.906 762.672 139.059L768.754 105.54L765.907 90.2691C765.648 89.1475 765.95 88.5867 766.813 88.5867H777.813C778.59 88.5867 779.021 88.975 779.107 89.7515L786.484 138.541C786.915 141.561 787.304 144.581 787.649 147.6C788.08 150.62 788.425 153.64 788.684 156.66H788.943C789.116 153.295 789.288 150.059 789.461 146.953C789.633 143.847 789.849 140.698 790.108 137.506C790.453 134.227 790.841 130.863 791.273 127.412L797.096 88.0691C797.183 87.2926 797.571 86.9043 798.261 86.9043H809.65C810.426 86.9043 810.728 87.422 810.556 88.4573L796.837 170.507C796.751 171.284 796.363 171.672 795.673 171.672H782.86C781.998 171.672 781.523 171.284 781.437 170.507L776.907 140.871C776.476 138.196 776.088 135.522 775.743 132.847C775.397 130.086 775.052 127.368 774.707 124.694H774.448C774.017 127.368 773.586 130.043 773.154 132.718C772.723 135.392 772.291 138.11 771.86 140.871L766.554 170.507C766.468 170.939 766.295 171.24 766.036 171.413C765.864 171.586 765.648 171.672 765.389 171.672H752.706Z" fill="#FFFFFF"/>
|
160
|
+
</svg>
|
161
|
+
<p>This ticket is valid for a single entry only</p>
|
162
|
+
<div>
|
163
|
+
<span style="text-wrap: nowrap;">DIGITAL TICKET</span>
|
164
|
+
</div>
|
165
|
+
</div>
|
166
|
+
<div class="info passenger">
|
167
|
+
<div class="info__item">Customer</div>
|
168
|
+
<div class="info__detail">{{clientName}}</div>
|
169
|
+
</div>
|
170
|
+
<div class="info platform">
|
171
|
+
<span>SHOW </span><span>THIS </span><span>QR CODE</span>
|
172
|
+
<img src="{{qrCode}}" alt="QR Code" />
|
173
|
+
</div>
|
174
|
+
<div class="info departure">
|
175
|
+
<div class="info__item">Location</div>
|
176
|
+
<div class="info__detail">{{eventLocation}}</div>
|
177
|
+
</div>
|
178
|
+
<div class="info arrival">
|
179
|
+
<div class="info__item">Event</div>
|
180
|
+
<div class="info__detail">{{eventName}}</div>
|
181
|
+
</div>
|
182
|
+
<div class="info date">
|
183
|
+
<div class="info__item">Date</div>
|
184
|
+
<div class="info__detail">{{eventDate}}</div>
|
185
|
+
</div>
|
186
|
+
<div class="info time">
|
187
|
+
<div class="info__item">Time</div>
|
188
|
+
<div class="info__detail">{{eventTime}}</div>
|
189
|
+
</div>
|
190
|
+
</div>
|
191
|
+
</div>
|
192
|
+
</div>
|
193
|
+
</body>
|
194
|
+
</html>
|
195
|
+
`;
|
196
|
+
function renderTemplate$1(data) {
|
197
|
+
return Mustache$1.render(template$1, data);
|
198
|
+
}
|
199
|
+
var templateTicket = { renderTemplate: renderTemplate$1 };
|
200
|
+
const Mustache = require$$0;
|
201
|
+
const template = `
|
202
|
+
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Ticket Confirmation</title></head><body style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;margin:0;padding:0;color:#333;background-color:#f9f9f9"><span style="opacity:0">{{ randomness }}</span><div class="container" style="border-radius:48px;width:100%;max-width:650px;background:#fff;margin:20px auto;overflow:hidden"><div class="header" style="background:#e31c25;color:#fff;text-align:left"><img loading="lazy" alt="NO MORE SNOW" style="max-width:150px;height:auto;padding:20px" src="https://nms.io/logo/logotype-white.png"><h1 style="box-sizing:border-box;border-top:2px solid rgba(0,0,0,.1);padding:40px;text-align:center;margin:0;text-transform:uppercase;width:100%">Confirmation of Your Ticket Purchase</h1></div><div class="content" style="padding:20px;text-align:center"><h2 style="color:#000">Thank You, {{clientName}}!</h2><p style="color:#000;opacity:.5">Your purchase has been confirmed. Please find your ticket attached to this email.</p><div class="details" style="background-color:#f5f5f5;padding:10px;margin-top:20px;margin-bottom:20px;border-radius:24px"><h3 style="color:#000;margin:0">Event Details</h3><p style="display:flex;color:#000"><strong style="display:block;width:100%;opacity:.5;text-align:right;margin-right:.5rem">Event:</strong><span style="text-align:left;width:100%">{{eventName}}</span></p><p style="display:flex;color:#000"><strong style="display:block;width:100%;opacity:.5;text-align:right;margin-right:.5rem">Date:</strong><span style="text-align:left;width:100%">{{eventDate}}</span></p><p style="display:flex;color:#000"><strong style="display:block;width:100%;opacity:.5;text-align:right;margin-right:.5rem">Time:</strong><span style="text-align:left;width:100%">{{eventTime}}</span></p></div><div class="social-links" style="text-align:center"><h3 style="color:#000">Stay Connected</h3><p style="color:#000;opacity:.5">Follow us on Instagram for the latest updates and exclusive content!</p><table border="0" cellpadding="0" cellspacing="0" style="margin: 0 auto; border-collapse:separate;mso-table-lspace:0;mso-table-rspace:0;width:auto"><tr><td style="font-family:sans-serif;font-size:14px;vertical-align:top;background-color:#e31c25;border-radius:48px;text-align:center" valign="top" bgcolor="#e31c25" align="center"><a href="https://www.instagram.com/no.more.snow/?hl=en" target="_blank" style="display:inline-block;color:#fff;background-color:#e31c25;border:solid 1px #e31c25;border-radius:48px;box-sizing:border-box;cursor:pointer;text-decoration:none;font-size:14px;font-weight:700;margin:0;padding:12px 25px;text-transform:capitalize;border-color:#e31c25">Instagram</a></td></tr></table></div><div class="footer" style="text-align:center;padding:10px 20px;border-radius:24px"><p style="color:#000">Need help? Contact us:<a href="https://t.me/thecommunebar" style="color:#e31c25">@thecommunebar</a></p></div><p class="details copyright" style="color:#000;background-color:#f5f5f5;padding:20px;margin-top:20px;margin-bottom:20px;border-radius:24px;margin:0;box-sizing:border-box;text-align:center">© 2024 NO MORE SNOW Ltd. All Rights Reserved.</p></div></div><span style="opacity:0">{{ randomness }}</span></body></html>
|
203
|
+
`;
|
204
|
+
function renderTemplate(data) {
|
205
|
+
return Mustache.render(template, data);
|
206
|
+
}
|
207
|
+
var templateEmail = { renderTemplate };
|
208
|
+
const path = require$$0$1;
|
209
|
+
const puppeteer = require$$1;
|
210
|
+
const QRCode = require$$2;
|
211
|
+
const { sendEmail } = mailing.mailing;
|
212
|
+
const { renderTemplate: renderTicketTemplate } = templateTicket;
|
213
|
+
const { renderTemplate: renderEmailTemplate } = templateEmail;
|
214
|
+
function formatDate(dateString) {
|
215
|
+
const date = new Date(dateString);
|
216
|
+
const options = { day: "numeric", month: "long" };
|
217
|
+
return date.toLocaleDateString("en-US", options);
|
218
|
+
}
|
219
|
+
function formatTime(dateString) {
|
220
|
+
const date = new Date(dateString);
|
221
|
+
const options = { hour: "2-digit", minute: "2-digit", hour12: false };
|
222
|
+
return date.toLocaleTimeString("en-US", options);
|
223
|
+
}
|
224
|
+
const controllerFactory = (db, publicPath) => {
|
225
|
+
const Ticket = db.ticket;
|
226
|
+
const Event = db.event;
|
227
|
+
async function saveAndSendTicket(ticketData) {
|
228
|
+
console.log(ticketData);
|
229
|
+
console.log("Starting saveAndSendTicket");
|
230
|
+
const quantity = ticketData.quantity || 1;
|
231
|
+
const ticketIds = [];
|
232
|
+
const pdfFiles = [];
|
233
|
+
const event = await Event.findById(ticketData.target).exec();
|
234
|
+
if (!event) {
|
235
|
+
console.error("Event not found!");
|
236
|
+
return;
|
237
|
+
}
|
238
|
+
for (let i = 0; i < quantity; i++) {
|
239
|
+
console.log(`Processing ticket ${i + 1} of ${quantity}`);
|
240
|
+
const ticket = new Ticket(ticketData);
|
241
|
+
const data = await ticket.save();
|
242
|
+
ticketIds.push(data._id.toString());
|
243
|
+
const qrData = data._id.toString();
|
244
|
+
let qrCode;
|
245
|
+
try {
|
246
|
+
qrCode = await QRCode.toDataURL(qrData, {
|
247
|
+
errorCorrectionLevel: "H",
|
248
|
+
type: "image/png"
|
249
|
+
});
|
250
|
+
} catch (error) {
|
251
|
+
console.error("Error in saveAndSendTicket:", error);
|
252
|
+
}
|
253
|
+
console.log("qr code is", qrCode);
|
254
|
+
data.status = "unused";
|
255
|
+
data.qrcode = qrCode;
|
256
|
+
data.client_refactor.name = ticketData.name;
|
257
|
+
data.client_refactor.email = ticketData.email;
|
258
|
+
const renderedHtml = renderTicketTemplate({
|
259
|
+
clientName: ticketData.name || "No name",
|
260
|
+
qrCode,
|
261
|
+
eventLocation: event.location || process.env.APP_NAME,
|
262
|
+
eventName: event.name,
|
263
|
+
eventDate: formatDate(event.date.start),
|
264
|
+
eventTime: formatTime(event.date.start)
|
265
|
+
});
|
266
|
+
const dirPath = path.join(publicPath, "tickets");
|
267
|
+
const fileName = `ticket-${data._id.toString()}.pdf`;
|
268
|
+
const filePath = path.join(dirPath, fileName);
|
269
|
+
pdfFiles.push(filePath);
|
270
|
+
let browser;
|
271
|
+
try {
|
272
|
+
browser = await puppeteer.launch({
|
273
|
+
args: [
|
274
|
+
"--no-sandbox",
|
275
|
+
"--disable-setuid-sandbox",
|
276
|
+
"--disable-dev-shm-usage",
|
277
|
+
"--disable-accelerated-2d-canvas",
|
278
|
+
"--no-first-run",
|
279
|
+
"--no-zygote",
|
280
|
+
"--disable-gpu"
|
281
|
+
],
|
282
|
+
headless: "new",
|
283
|
+
protocolTimeout: 12e4,
|
284
|
+
dumpio: true
|
285
|
+
});
|
286
|
+
} catch (error) {
|
287
|
+
console.error("Error in saveAndSendTicket:", error);
|
288
|
+
}
|
289
|
+
try {
|
290
|
+
const page = await browser.newPage();
|
291
|
+
await page.setContent(renderedHtml);
|
292
|
+
console.log("Rendering PDF to path:", filePath);
|
293
|
+
const pdfBuffer = await page.pdf({
|
294
|
+
path: filePath,
|
295
|
+
format: "A4"
|
296
|
+
});
|
297
|
+
console.log("PDF created successfully:", filePath);
|
298
|
+
await browser.close();
|
299
|
+
data.image = `/tickets/${fileName}`;
|
300
|
+
await data.save();
|
301
|
+
} catch (error) {
|
302
|
+
console.error("Error in saveAndSendTicket:", error);
|
303
|
+
}
|
304
|
+
}
|
305
|
+
console.log("All tickets processed, sending email");
|
306
|
+
if (ticketData.email) {
|
307
|
+
const renderedHtmlEmail = renderEmailTemplate({
|
308
|
+
clientName: ticketData.name || "No name",
|
309
|
+
eventLocation: event.location || process.env.APP_NAME,
|
310
|
+
eventName: event.name,
|
311
|
+
eventDate: formatDate(event.date.start),
|
312
|
+
eventTime: formatTime(event.date.start),
|
313
|
+
randomness: Date.now()
|
314
|
+
});
|
315
|
+
try {
|
316
|
+
const emailSent = await sendEmail(ticketData.email, `Your Tickets for ${event.name}`, renderedHtmlEmail, pdfFiles);
|
317
|
+
} catch (err) {
|
318
|
+
console.error("Email sending failed:", err);
|
319
|
+
}
|
320
|
+
}
|
321
|
+
return {
|
322
|
+
tickets: ticketIds
|
323
|
+
};
|
324
|
+
}
|
325
|
+
const create = async (req, res) => {
|
326
|
+
if (Array.isArray(req.body)) {
|
327
|
+
const ticketsData = req.body;
|
328
|
+
try {
|
329
|
+
const ticketsPromises = ticketsData.map(
|
330
|
+
(ticketData) => saveAndSendTicket(ticketData)
|
331
|
+
);
|
332
|
+
const tickets = await Promise.all(ticketsPromises);
|
333
|
+
res.json(tickets);
|
334
|
+
} catch (err) {
|
335
|
+
console.log(err);
|
336
|
+
res.status(500).send({
|
337
|
+
errorCode: "SERVER_ERROR"
|
338
|
+
});
|
339
|
+
}
|
340
|
+
} else {
|
341
|
+
try {
|
342
|
+
const data = await saveAndSendTicket(req.body);
|
343
|
+
res.json(data);
|
344
|
+
} catch (err) {
|
345
|
+
console.log(err);
|
346
|
+
res.status(500).send({
|
347
|
+
errorCode: "SERVER_ERROR"
|
348
|
+
});
|
349
|
+
}
|
350
|
+
}
|
351
|
+
};
|
352
|
+
const read = async (req, res) => {
|
353
|
+
let query = {};
|
354
|
+
let options = {};
|
355
|
+
if (req.query.user) {
|
356
|
+
query.user = req.query.user;
|
357
|
+
}
|
358
|
+
if (req.query.type) {
|
359
|
+
query.type = req.query.type;
|
360
|
+
}
|
361
|
+
if (req.query.target) {
|
362
|
+
query.target = req.query.target;
|
363
|
+
}
|
364
|
+
if (req.query.role) {
|
365
|
+
query.role = req.query.role;
|
366
|
+
}
|
367
|
+
options.limit = req.query.limit || 10;
|
368
|
+
options.skip = req.query.skip || 0;
|
369
|
+
const sortParam = req.query.sortParam || "createdAt";
|
370
|
+
const sortOrder = req.query.sortOrder === "asc" ? 1 : -1;
|
371
|
+
options.sort = {
|
372
|
+
[sortParam]: sortOrder,
|
373
|
+
"_id": 1
|
374
|
+
};
|
375
|
+
const search = req.query.search;
|
376
|
+
if (search) {
|
377
|
+
const parts = search.split(".");
|
378
|
+
let regexPattern = "";
|
379
|
+
if (parts.length === 2) {
|
380
|
+
regexPattern = parts.map((part) => part.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*")).join("\\.");
|
381
|
+
} else {
|
382
|
+
regexPattern = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*");
|
383
|
+
}
|
384
|
+
query["client_refactor.name"] = { $regex: new RegExp(regexPattern, "i") };
|
385
|
+
}
|
386
|
+
try {
|
387
|
+
const tickets = await Ticket.find(query, null, options).populate("user");
|
388
|
+
if (!tickets) {
|
389
|
+
return res.status(404).send({ errorCode: "TICKETS_NOT_FOUND" });
|
390
|
+
}
|
391
|
+
res.send(tickets);
|
392
|
+
} catch (err) {
|
393
|
+
res.status(500).send({ errorCode: "SERVER_ERROR" });
|
394
|
+
}
|
395
|
+
};
|
396
|
+
const update = async (req, res) => {
|
397
|
+
try {
|
398
|
+
const { _id } = req.body;
|
399
|
+
const ticket = await Ticket.findById(_id);
|
400
|
+
if (!ticket) {
|
401
|
+
return res.status(404).send({ errorCode: "TICKET_NOT_FOUND" });
|
402
|
+
}
|
403
|
+
if (ticket.status === "used" && req.body.check) {
|
404
|
+
return res.status(500).send({ errorCode: "TICKET_ALREADY_USED" });
|
405
|
+
}
|
406
|
+
if (ticket.status === "deactivated" && req.body.check) {
|
407
|
+
return res.status(500).send({ errorCode: "TICKET_DEACTIVATED" });
|
408
|
+
}
|
409
|
+
const updatedTicket = await Ticket.findOneAndUpdate({ _id }, req.body, { new: true });
|
410
|
+
res.send(updatedTicket);
|
411
|
+
} catch (err) {
|
412
|
+
res.status(500).send({ errorCode: "SERVER_ERROR" });
|
413
|
+
}
|
414
|
+
};
|
415
|
+
const deleteTicket = async (req, res) => {
|
416
|
+
const { type, target, user } = req.body;
|
417
|
+
try {
|
418
|
+
const ticket = await Ticket.findOne({ type, target, user });
|
419
|
+
if (!ticket) {
|
420
|
+
return res.status(404).send({ errorCode: "TICKET_NOT_FOUND" });
|
421
|
+
}
|
422
|
+
await Ticket.deleteOne({ _id: ticket._id });
|
423
|
+
res.status(200).send(ticket);
|
424
|
+
} catch (error) {
|
425
|
+
console.log(error);
|
426
|
+
res.status(500).send({ errorCode: "SERVER_ERROR" });
|
427
|
+
}
|
428
|
+
};
|
429
|
+
return {
|
430
|
+
read,
|
431
|
+
create,
|
432
|
+
update,
|
433
|
+
delete: deleteTicket,
|
434
|
+
saveAndSendTicket
|
435
|
+
};
|
436
|
+
};
|
437
|
+
var tickets_controller = controllerFactory;
|
438
|
+
exports.tickets_controller = tickets_controller;
|