@bash-app/bash-common 8.1.0 → 8.2.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash-app/bash-common",
3
- "version": "8.1.0",
3
+ "version": "8.2.0",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,8 +1,19 @@
1
1
  import QRCode from "qrcode";
2
2
  import { TICKET_DETAILS } from "../definitions";
3
3
 
4
- export function bashEventTicketQrCodeUrl(bashEventId: string | undefined, prismaCheckoutId: string | undefined, ticketId?: string): string {
5
- return `${TICKET_DETAILS}/${bashEventId}/${prismaCheckoutId}/${ticketId}`;
4
+ export function bashEventPrismaCheckoutQrCodeUrl(bashEventId: string | undefined, prismaCheckoutId: string | undefined): string {
5
+ return `${TICKET_DETAILS}/${bashEventId}/${prismaCheckoutId}`;
6
+ }
7
+
8
+ export function bashEventQrCodeUrl(bashEventId: string | undefined, ticketTierId?: string | undefined, ticketId?: string | undefined): string {
9
+ const baseUrl = `${TICKET_DETAILS}/${bashEventId}`;
10
+ if (ticketId) {
11
+ return `${baseUrl}/ticket/${ticketId}`;
12
+ }
13
+ else if (ticketTierId) {
14
+ return `${baseUrl}/ticket-tier/${ticketTierId}`;
15
+ }
16
+ return baseUrl;
6
17
  }
7
18
 
8
19
  export async function createQrCodeImage(qrData: string): Promise<string> {