tripstorekrabi-shared 1.10.2 → 1.10.4

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.
Files changed (2) hide show
  1. package/booking.js +19 -0
  2. package/package.json +1 -1
package/booking.js CHANGED
@@ -1,6 +1,13 @@
1
1
  import dayjs from "dayjs";
2
+ import advancedFormat from 'dayjs/plugin/advancedFormat.js';
3
+ import utc from "dayjs/plugin/utc.js";
4
+ import timezone from "dayjs/plugin/timezone.js";
2
5
  import { calculateTotalPrice } from './price.js';
3
6
 
7
+ dayjs.extend(advancedFormat);
8
+ dayjs.extend(utc);
9
+ dayjs.extend(timezone);
10
+
4
11
  export function addBookingFromInvoice(firestore, admin, invoice, paymentData, comment = "") {
5
12
  let bookingNumberDoc = firestore.collection("meta").doc("BOOKING_NUMBER");
6
13
 
@@ -148,4 +155,16 @@ export function getStartingPointMessage(booking) {
148
155
  }
149
156
 
150
157
  return text;
158
+ }
159
+
160
+ export function getOperatorSignature(agent, operatorName) {
161
+ let signature =
162
+ '<br><br>Warm regards,<br><br>' + (agent ? agent + ' - ' : "") + operatorName;
163
+ signature +=
164
+ "<br>WhatsApp chat: <a href='https://wa.me/66840679979'>+66 (0) 840 679 979</a>";
165
+ signature +=
166
+ "<br>WhatsApp call: <a href='https://wa.me/66967215940'>+66 (0) 967 215 940</a>";
167
+ signature +=
168
+ "<br>Telegram chat: <a href='https://t.me/tripstorekrabi_bot'>@tripstorekrabi_bot</a>";
169
+ return signature;
151
170
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.10.2",
3
+ "version": "1.10.4",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {