Skip to content

Conversation

@Mikearaya
Copy link
Contributor

No description provided.

@Mikearaya
Copy link
Contributor Author

Mikearaya commented Nov 14, 2025

@pozylon what do you think?
Default order pdf svg template
Importable order PDF that uses react-pdf

and importable google wallet pass

All imprts are with optional dependencies

@Mikearaya Mikearaya requested a review from pozylon November 17, 2025 07:53
@Mikearaya Mikearaya force-pushed the default-pdf-templates branch from ea3fb7b to ac07016 Compare November 17, 2025 08:27
@Mikearaya Mikearaya linked an issue Nov 17, 2025 that may be closed by this pull request
3 tasks
@Mikearaya Mikearaya marked this pull request as ready for review November 17, 2025 09:35
Copy link
Member

@pozylon pozylon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check my comments, there is various topics that needs a bit polishing. After that's done we need to check again how we can make the createPDFTicketRenderer actually useful to create customized tickets.

@Mikearaya Mikearaya force-pushed the default-pdf-templates branch from 459d3fb to 860030e Compare November 19, 2025 12:14
Copy link
Member

@pozylon pozylon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comes together nicely, now we need a factory patter for the pdf ticket renderer so someone can easily set logo, image, colors and such stuff to actually generate tickets that resemble a custom brand.

@Mikearaya Mikearaya force-pushed the default-pdf-templates branch 2 times, most recently from 42b25ec to 820fd08 Compare December 4, 2025 11:01
@Mikearaya Mikearaya requested a review from pozylon December 4, 2025 20:48
@Mikearaya
Copy link
Contributor Author

I haven't tested the apple wallet pass, please do on your end if you can

@Mikearaya Mikearaya force-pushed the default-pdf-templates branch 6 times, most recently from 288bab5 to 517fda9 Compare December 15, 2025 08:56
@pozylon
Copy link
Member

pozylon commented Dec 18, 2025

It's hard to test this functionality as the ticketing example does currently not use the new functions, i'd expect something like this in the ticketing example:

setupTicketing(platform.unchainedAPI as TicketingAPI, {
    renderOrderPDF: createPDFTicketRenderer((orderId: string, context): DefaultTicketProperties => {
      const order = context.modules.orders.getOrderById(orderId);
      const tokens = await modules.warehousing.findTokens({
        "meta.orderId": orderId,
      });
      return {
        title: "Event XY",
        logoUrl: "https://example.com/logo.png",
        orderNumber: orde.orderNumber
        tickets: tokens.map(token => ({
          title: `VIP Ticket: ${token.serialNumber}`,
          qrCode: token.id,
          stripText: `Place: blabla, come early or get the fuck out of here`,
        })),
      }
    }),
  });

renderOrderPDF should be typed to something like this:

createPDFTicketRenderer: (orderId, context) => { contentType: string; blob: ArrayBuffer }

Goal is to give users of the ticketing module a sane default to at least generate usable tickets. If the document generated is unusable it doesn't make sense to give helpers. It should actually print general tickets like in the theater or gastro projects but with a much more generalized design.

User can do:

  1. use the default pdf ticket renderer (no pdf but generateOrderSVG renderer, this should generate svg tickets that are completely unbranded but look like tickets and could be used in a mvp)
  2. configure the ticketing renderer like above to create at least "logo" branded customized tickets
  3. completely re-implement the renderer and take over binary creation

Copy link
Member

@pozylon pozylon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my other comment, although the way you structured it comes together well, the actual "value" for the developer is not leveraged

@Mikearaya Mikearaya force-pushed the default-pdf-templates branch 2 times, most recently from 3cfe981 to edf309b Compare December 29, 2025 14:42
@pozylon pozylon force-pushed the default-pdf-templates branch 2 times, most recently from 15788ec to db21131 Compare January 5, 2026 09:01
@pozylon
Copy link
Member

pozylon commented Jan 5, 2026

@Mikearaya i have rebased this branch on master and did some code cleanups and added default initialization logic to the ticketing example with claude so make sure to hard reset before continuing your work. When done, we should be able to cleanup the Theater im Hof Repository substantially leveraging the factory functions to implement the simple ticket case.

Please make sure the tests pass in the ticketing example and use that to test ticketing stuff. Somehow we need to be able to easily test the processes there so it should seed a product that is a ticket and do some checkout and everything.

@Mikearaya Mikearaya force-pushed the default-pdf-templates branch from 979ebb1 to d291269 Compare January 8, 2026 19:29
@Mikearaya Mikearaya requested a review from pozylon January 12, 2026 11:51
@Mikearaya
Copy link
Contributor Author

Added few more tests and fixed existing ones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add default PDF templates

2 participants