@composable-os/pack-ticketing 0.1.0-beta.8 → 0.1.0-beta.9

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.
@@ -7,5 +7,5 @@ export function OrderConfirmation({ ticketing, order, children, }) {
7
7
  if (error || !data)
8
8
  return _jsx("p", { role: "alert", children: "We could not find this order." });
9
9
  const status = orderStatus(data);
10
- return (_jsxs("section", { className: "grid gap-3", "aria-live": "polite", children: [_jsx("h2", { className: "text-xl font-semibold", children: status.title }), status.waiting ? (_jsx("p", { "aria-busy": "true", children: "This usually takes a few seconds. You can leave this page open." })) : null, _jsx("ul", { className: "grid gap-1", children: data.lines.map((line) => (_jsxs("li", { className: "flex justify-between gap-4", children: [_jsxs("span", { children: [line.quantity, " \u00D7 ", line.title] }), _jsx("span", { children: formatMoney(line.total, data.currency) })] }, line.id))) }), _jsxs("p", { children: ["Total ", formatMoney(data.total, data.currency), " \u00B7 paid", " ", formatMoney(data.paid, data.currency)] }), status.kind === "part_paid" ? children : null] }));
10
+ return (_jsxs("section", { className: "grid gap-3", "aria-live": "polite", children: [_jsx("h2", { className: "text-xl font-semibold", children: status.title }), status.waiting ? (_jsx("p", { "aria-busy": "true", children: "This usually takes a few seconds. You can leave this page open." })) : null, _jsx("ul", { className: "grid gap-1", children: data.lines.map((line) => (_jsxs("li", { className: "flex justify-between gap-4", children: [_jsxs("span", { children: [line.quantity, " \u00D7 ", line.title] }), _jsx("span", { children: formatMoney(line.total, data.currency) })] }, line.id))) }), _jsxs("p", { children: ["Total ", formatMoney(data.total, data.currency), " \u00B7 paid", " ", formatMoney(data.paid, data.currency)] }), (data.taxAmount ?? 0) > 0 ? (_jsxs("p", { "data-testid": "order-tax", children: ["Including tax ", formatMoney(data.taxAmount ?? 0, data.currency)] })) : null, status.kind === "part_paid" ? children : null] }));
11
11
  }
@@ -20,6 +20,11 @@ export interface BuyerOrder {
20
20
  deposit: number | null;
21
21
  balanceDueAt: string | null;
22
22
  expiresAt: string | null;
23
+ /**
24
+ * The tax inside what has been paid, as the payment provider calculated it (ADR 0479). Prices
25
+ * include it. Optional: a host from before tax at checkout does not send it.
26
+ */
27
+ taxAmount?: number;
23
28
  lines: {
24
29
  id: string;
25
30
  title: string;
package/dist/index.d.ts CHANGED
@@ -42,6 +42,27 @@ declare const _default: import("@composable-os/sdk").Extension<{
42
42
  readonly type: "text";
43
43
  readonly label: "Venue";
44
44
  };
45
+ readonly taxCountry: {
46
+ readonly type: "text";
47
+ readonly label: "Country (for tax)";
48
+ readonly description: string;
49
+ };
50
+ readonly taxRegion: {
51
+ readonly type: "text";
52
+ readonly label: "State or region (for tax)";
53
+ };
54
+ readonly taxPostcode: {
55
+ readonly type: "text";
56
+ readonly label: "Postcode (for tax)";
57
+ };
58
+ readonly taxCity: {
59
+ readonly type: "text";
60
+ readonly label: "City (for tax)";
61
+ };
62
+ readonly taxAddress: {
63
+ readonly type: "text";
64
+ readonly label: "Street address (for tax)";
65
+ };
45
66
  readonly description: {
46
67
  readonly type: "longText";
47
68
  readonly label: "Description";
@@ -199,6 +220,17 @@ declare const _default: import("@composable-os/sdk").Extension<{
199
220
  };
200
221
  readonly void: "void";
201
222
  };
223
+ readonly tax: {
224
+ readonly code: "txcd_50010001";
225
+ readonly place: {
226
+ readonly via: "event";
227
+ readonly country: "taxCountry";
228
+ readonly region: "taxRegion";
229
+ readonly postcode: "taxPostcode";
230
+ readonly city: "taxCity";
231
+ readonly line1: "taxAddress";
232
+ };
233
+ };
202
234
  };
203
235
  readonly public: {
204
236
  readonly read: readonly ["event", "name", "description", "price", "onSaleFrom", "onSaleUntil", "maxPerOrder", "depositAmount", "balanceDue"];
package/dist/index.js CHANGED
@@ -66,6 +66,18 @@ export default defineExtension({
66
66
  "shown, and its reminders sent, on this zone's days. Empty: this deployment's zone.",
67
67
  },
68
68
  venue: { type: "text", label: "Venue" },
69
+ // Where the event is, for tax at checkout (ADR 0479): admission is taxed where the event
70
+ // is held, so the payment provider is given this address, not the buyer's. Staff only.
71
+ taxCountry: {
72
+ type: "text",
73
+ label: "Country (for tax)",
74
+ description: "Two letters, e.g. AU. Needed to sell tickets while tax at checkout is on: tickets " +
75
+ "are taxed where the event is held.",
76
+ },
77
+ taxRegion: { type: "text", label: "State or region (for tax)" },
78
+ taxPostcode: { type: "text", label: "Postcode (for tax)" },
79
+ taxCity: { type: "text", label: "City (for tax)" },
80
+ taxAddress: { type: "text", label: "Street address (for tax)" },
69
81
  description: { type: "longText", label: "Description" },
70
82
  image: { type: "url", label: "Image" },
71
83
  status: {
@@ -161,6 +173,21 @@ export default defineExtension({
161
173
  },
162
174
  void: "void",
163
175
  },
176
+ // Tax at checkout (ADR 0479), only once a human admin turns it on: Stripe's "Admission to
177
+ // Amusement, Entertainment & Recreation Venues – Participant", taxed at the event's place.
178
+ // Which code fits the company's events is its accountant's call; an admin may change it
179
+ // in Settings → Orders.
180
+ tax: {
181
+ code: "txcd_50010001",
182
+ place: {
183
+ via: "event",
184
+ country: "taxCountry",
185
+ region: "taxRegion",
186
+ postcode: "taxPostcode",
187
+ city: "taxCity",
188
+ line1: "taxAddress",
189
+ },
190
+ },
164
191
  },
165
192
  // A ticket type is public while its event is on sale; its places are capacity.get's.
166
193
  public: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@composable-os/pack-ticketing",
3
- "version": "0.1.0-beta.8",
3
+ "version": "0.1.0-beta.9",
4
4
  "license": "FSL-1.1-ALv2",
5
5
  "type": "module",
6
6
  "repository": {
@@ -27,7 +27,7 @@
27
27
  "dist"
28
28
  ],
29
29
  "dependencies": {
30
- "@composable-os/client": "0.1.0-beta.8",
31
- "@composable-os/sdk": "0.1.0-beta.8"
30
+ "@composable-os/client": "0.1.0-beta.9",
31
+ "@composable-os/sdk": "0.1.0-beta.9"
32
32
  }
33
33
  }