feat: Attach QR sticker PDF to Trello card on order creation

When a new order is created and a Trello card is made, now automatically
generate the A6 QR sticker PDF and attach it to the card using Trello's
attachment API. Include error handling and logging.
This commit is contained in:
twotalesanimation
2026-01-02 21:01:17 +02:00
parent 93148ef9af
commit ed57956694
3 changed files with 62 additions and 47 deletions
+23 -36
View File
@@ -133,7 +133,7 @@ class QrStickerService
}
.container {
display: flex;
gap: 3mm;
gap: 2mm;
height: 100%;
}
.info-section {
@@ -144,7 +144,7 @@ class QrStickerService
overflow: hidden;
}
.qr-section {
width: 50mm;
width: 100mm;
display: flex;
align-items: center;
justify-content: center;
@@ -164,29 +164,15 @@ class QrStickerService
letter-spacing: 0.5pt;
}
.order-number {
font-size: 9pt;
font-size: 16pt;
font-weight: bold;
margin-top: 1mm;
color: #222;
word-break: break-all;
}
.customer-info {
font-size: 8pt;
color: #555;
line-height: 1.3;
}
.customer-info .label {
font-size: 7pt;
color: #999;
text-transform: uppercase;
letter-spacing: 0.3pt;
}
.customer-info .name {
font-weight: 500;
color: #222;
}
.details {
font-size: 7.5pt;
font-size: 10pt;
color: #666;
line-height: 1.4;
}
@@ -197,20 +183,21 @@ class QrStickerService
margin-bottom: 1mm;
}
.detail-label {
font-weight: 500;
color: #999;
text-transform: uppercase;
font-size: 6.5pt;
flex: 1;
}
.detail-value {
text-align: right;
font-weight: bold;
text-transform: uppercase;
color: #222;
flex: 0 0 auto;
}
.qr-code {
width: 50mm;
height: 50mm;
width: 95mm;
height: 95mm;
}
.qr-code img {
width: 100%;
@@ -233,14 +220,14 @@ class QrStickerService
<span class="order-type">' . htmlspecialchars($orderType) . '</span>
<div class="order-number">' . htmlspecialchars($order->order_number) . '</div>
</div>
<div class="customer-info">
<div class="label">Customer</div>
<div class="name">' . htmlspecialchars($customerSurname) . '</div>
</div>
<div class="details">
<div class="detail-row">
<span class="detail-label">Customer: </span>
<span class="detail-value">' . htmlspecialchars($customerSurname) . '</span>
</div>
<div class="detail-row">
<span class="detail-label">Design:</span>
<span class="detail-value" style="font-size: 6.5pt;">' . htmlspecialchars($this->truncate($designName, 12)) . '</span>
<span class="detail-value">' . htmlspecialchars($this->truncate($designName, 12)) . '</span>
</div>
<div class="detail-row">
<span class="detail-label">Date:</span>
@@ -250,15 +237,15 @@ class QrStickerService
<span class="detail-label">Status:</span>
<span class="detail-value">' . htmlspecialchars($this->formatStatus($order->status)) . '</span>
</div>
</div>
<div class="footer">
Gen: ' . htmlspecialchars($order->created_at->format('Y-m-d H:i')) . '
</div>
</div>
</div>
<div class="qr-section">
<div class="qr-code">
<img src="' . $qrDataUri . '" alt="QR Code" />
</div>
<div class="qr-code">
<img src="' . $qrDataUri . '" alt="QR Code" />
</div>
<div class="footer">
Gen: ' . htmlspecialchars($order->created_at->format('Y-m-d H:i')) . '
</div>
</div>
</div>