@composable-os/pack-memberships 0.1.0-beta.10 → 0.1.0-beta.13

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.
@@ -4,12 +4,16 @@
4
4
  //
5
5
  // Nothing here decides a price, a trial, whether an intro offer may be bought, or how many classes
6
6
  // are left: the host does (`sellable`, the one-trial rule, `onePerPerson`, `allowance.get`). The
7
- // billing actions (subscribe, cancel, resume, the provider's portal, buying a pass) are the web's;
8
- // a native block reads only (the block lint).
9
- import { packHooks } from "@composable-os/client";
7
+ // billing actions (subscribe, cancel, resume, change plan, the provider's portal, buying a pass)
8
+ // are the web's; a native block reads only (the block lint). Pausing is staff's (decision 10).
9
+ // Whether a member may cool off (stage 44 step 7) is the host's: a block asks, and never works
10
+ // the window out on the device.
11
+ // Whether a change is an upgrade (now, prorated) or a downgrade (next period) is the host's.
12
+ import { formatMinor, packHooks, } from "@composable-os/client";
10
13
  export const PLAN = "memberships.plan";
11
14
  export const MEMBERSHIP = "memberships.membership";
12
15
  export const PASS = "memberships.pass";
16
+ export const PASSTYPE = "memberships.passtype";
13
17
  // --- Display only ---------------------------------------------------------------------------------
14
18
  /** A price as the host gave it, in its currency (`99.00 AUD`). Display only: never worked out. */
15
19
  export function formatPrice(price, currency) {
@@ -92,7 +96,9 @@ export function subscriptionStatus(sub) {
92
96
  case "unpaid":
93
97
  return "Unpaid: update your card to keep booking";
94
98
  case "paused":
95
- return "Paused";
99
+ return sub.change?.kind === "pause" && sub.change.pauseUntil
100
+ ? `Paused until ${day(sub.change.pauseUntil)}: nothing is charged meanwhile`
101
+ : "Paused";
96
102
  case "incomplete":
97
103
  return "Waiting for its first payment";
98
104
  case "expired":
@@ -101,6 +107,163 @@ export function subscriptionStatus(sub) {
101
107
  return `Ended${sub.endedAt ? ` on ${day(sub.endedAt)}` : ""}`;
102
108
  }
103
109
  }
110
+ /**
111
+ * A plan change or a pause waiting, in words, from the host's record: `Changing to Unlimited once
112
+ * its charge is paid`, `Changes to One a week on 3 Dec 2026`, `Paused from 1 Dec to 21 Dec`.
113
+ * Display only: null when nothing waits.
114
+ */
115
+ export function changeWords(sub) {
116
+ const c = sub.change;
117
+ if (!c)
118
+ return null;
119
+ if (c.kind === "pause") {
120
+ if (c.endOutcome === "refused" || c.endOutcome === "unknown") {
121
+ return "Ending the pause did not finish: ask again";
122
+ }
123
+ if (c.state === "applied")
124
+ return null;
125
+ return `Pause asked: ${c.pauseFrom ? `from ${day(c.pauseFrom)}` : "from now"} until ${day(c.pauseUntil)}`;
126
+ }
127
+ if (c.state === "lapsed")
128
+ return `The change to ${c.toPlanTitle} was not paid, so it did not happen`;
129
+ if (c.endOutcome === "refused" || c.endOutcome === "unknown") {
130
+ return `Withdrawing the change to ${c.toPlanTitle} did not finish: staff are asking again`;
131
+ }
132
+ if (c.kind === "upgrade") {
133
+ return c.actionUrl
134
+ ? `Changing to ${c.toPlanTitle}: confirm its payment to finish`
135
+ : `Changing to ${c.toPlanTitle} once its charge is paid`;
136
+ }
137
+ return `Changes to ${c.toPlanTitle} on ${day(c.effectiveAt)}`;
138
+ }
139
+ /** Whether the payer may ask for a plan change now: active, not ending, nothing else waiting. */
140
+ export const canChangePlan = (sub) => sub.state === "active" &&
141
+ !sub.cancelAtPeriodEnd &&
142
+ sub.cancelAt === null &&
143
+ (!sub.change || sub.change.state === "lapsed" || sub.change.state === "applied");
144
+ /** What a member is told when the host refuses a plan change (its `rule`). Display only. */
145
+ export function changeRefusalWords(details) {
146
+ switch (details?.rule) {
147
+ case "change_open":
148
+ return "A change is already waiting on your membership.";
149
+ case "ending":
150
+ return "Your membership is set to end: keep it going first.";
151
+ case "state":
152
+ return "Your membership cannot be changed just now.";
153
+ case "same_plan":
154
+ return "That is the plan you are on.";
155
+ default:
156
+ return "We could not change your plan.";
157
+ }
158
+ }
159
+ /** A price in minor units as the host gave it (`1999` AUD is `$19.99`). Display only. */
160
+ export { formatMinor };
161
+ /** A `YYYY-MM-DD` day as a reader sees it (`3 Dec 2026`), never shifted by the reader's zone. */
162
+ export function localDay(date) {
163
+ if (!date || !/^\d{4}-\d{2}-\d{2}$/.test(date))
164
+ return "";
165
+ const at = new Date(`${date}T00:00:00Z`);
166
+ return Number.isNaN(at.getTime())
167
+ ? ""
168
+ : at.toLocaleDateString(undefined, {
169
+ day: "numeric",
170
+ month: "short",
171
+ year: "numeric",
172
+ timeZone: "UTC",
173
+ });
174
+ }
175
+ /**
176
+ * The words beside the cancel button while the host offers cooling off: "You can cancel for a
177
+ * full refund until 3 Dec 2026". Null when it is not offered. Display only: the window is the
178
+ * host's (`subscription.coolingOff`), never worked out here.
179
+ */
180
+ export function coolingOffWords(status) {
181
+ if (!status?.offered)
182
+ return null;
183
+ return `You can cancel for a full refund until the end of ${localDay(status.until)}.`;
184
+ }
185
+ /**
186
+ * Why a member who might have expected it cannot cool off, in words: the period has passed, or
187
+ * they cooled off before. Null otherwise (no cooling off on the plan or for them, or a free trial,
188
+ * where the ordinary cancel ends it at no charge). Display only, from the host's `why`.
189
+ */
190
+ export function coolingOffClosedWords(status) {
191
+ if (!status || status.offered || status.coolOff)
192
+ return null;
193
+ if (status.why === "window_passed") {
194
+ return `The cooling-off period ended at the end of ${localDay(status.until)}.`;
195
+ }
196
+ if (status.why === "used") {
197
+ return "Cooling off has been used for this member before: it is once per member.";
198
+ }
199
+ return null;
200
+ }
201
+ /**
202
+ * Where a cooling off asked for has got, in words, from the host's record. Null when none was
203
+ * asked.
204
+ */
205
+ export function coolOffProgressWords(status,
206
+ /** Name the amounts (the web); the app, which shows no money, leaves them out. */
207
+ { amounts = true } = {}) {
208
+ const c = status?.coolOff;
209
+ if (!c || !status)
210
+ return null;
211
+ const sum = (n) => (amounts ? ` of ${formatMinor(n, status.currency)}` : "");
212
+ const money = sum(c.state === "ended" ? c.paid - c.refunded : status.refund);
213
+ const told = c.staffTold ? " The business has been told." : "";
214
+ if (c.state === "lapsed") {
215
+ return c.lapsedBecause === "used"
216
+ ? "Cooling off has been used for this member before: this one did not count. Ask the business about any refund."
217
+ : "Your cooling off did not end the membership in time, so it lapsed: you can cancel it as usual. Ask the business about any refund.";
218
+ }
219
+ if (c.state === "asked") {
220
+ const until = ` If it has not ended by ${day(c.deadline)}, it lapses and you can cancel it as usual.`;
221
+ if (c.asked === "refused") {
222
+ return c.askAgain
223
+ ? `Ending it in the cooling-off period did not go through: ask again.${told}${until}`
224
+ : `Ending it in the cooling-off period did not go through.${told}${until}`;
225
+ }
226
+ if (c.asked === "pending") {
227
+ return `You asked to end it in the cooling-off period: it waits for the business to confirm.${until}`;
228
+ }
229
+ return c.asked === "unknown" || c.asked === null
230
+ ? `You asked to end it in the cooling-off period. We have not heard back from the payment provider yet.${told}${until}`
231
+ : "You asked to end it in the cooling-off period. It shows as ended here once the payment provider confirms.";
232
+ }
233
+ switch (c.refunds) {
234
+ case "refunded":
235
+ return `Ended in the cooling-off period: refunded${amounts ? ` (${formatMinor(c.refunded, status.currency)})` : ""}.`;
236
+ case "held":
237
+ return `Ended in the cooling-off period. A refund${money} is owed; the business will contact you about it.`;
238
+ default:
239
+ return `Ended in the cooling-off period. A full refund${money} is owed: the business approves it, then it goes back to how you paid.`;
240
+ }
241
+ }
242
+ /** What a payer is told when the host refuses cooling off (its `reason`). Display only. */
243
+ export function coolOffRefusalWords(details) {
244
+ if (details?.rule === "provider_refused") {
245
+ return "The payment provider did not end your membership, so nothing changed. Try again.";
246
+ }
247
+ switch (details?.reason) {
248
+ case "window_passed":
249
+ return "The cooling-off period has ended. You can still cancel at the end of the period.";
250
+ case "used":
251
+ return "Cooling off has been used for this member before: it is once per member.";
252
+ case "waiting":
253
+ return "Ending your membership waits for the business to confirm: there is nothing to ask again until then.";
254
+ case "nothing_paid":
255
+ return "Nothing has been paid yet: cancel instead, and it ends with the free time at no charge.";
256
+ case "continuation":
257
+ return "Cooling off is for new members: this membership was not started as a new one here.";
258
+ case "off":
259
+ case "not_covered":
260
+ return "This membership has no cooling-off period.";
261
+ case "ended":
262
+ return "This membership has ended.";
263
+ default:
264
+ return "We could not end your membership just now. Try again.";
265
+ }
266
+ }
104
267
  /** Whether a subscription is still the payer's to cancel, resume or pay (not ended). */
105
268
  export const isLive = (sub) => sub.state !== "ended" && sub.state !== "expired";
106
269
  /** What a member is told when the host refuses a pass (its `rule` and `reason`). Display only. */
@@ -132,9 +295,11 @@ export const MEMBERSHIPS_HOOKS_CALL = {
132
295
  usePassTypes: ["x.memberships.passTypes"],
133
296
  useBuyPass: ["x.memberships.buy", "order.checkout"],
134
297
  useMine: ["x.memberships.mine"],
298
+ useFamily: ["me.family"],
135
299
  useHoldings: ["x.memberships.holdings"],
136
300
  useGivePass: ["x.memberships.givePass"],
137
301
  useVoidPass: ["x.memberships.voidPass"],
302
+ useStaffPassTypes: ["record.list"],
138
303
  // A membership's billing (stage 32a's flows). Every action is the web's: a native block may
139
304
  // read the subscription only (the block lint).
140
305
  useSubscribe: ["subscription.start"],
@@ -142,6 +307,16 @@ export const MEMBERSHIPS_HOOKS_CALL = {
142
307
  useCancelSubscription: ["subscription.cancel"],
143
308
  useResumeSubscription: ["subscription.resume"],
144
309
  useBillingPortal: ["subscription.portal"],
310
+ // Stage 32b (ADRs 0530, 0531): a member's plan change (web only); staff pause and end a pause,
311
+ // and read a person's membership subscriptions.
312
+ useChangePlan: ["subscription.change"],
313
+ usePauseSubscription: ["subscription.pause"],
314
+ useUnpauseSubscription: ["subscription.unpause"],
315
+ useSubscriptionsOf: ["subscription.list"],
316
+ // Stage 44 step 7 (ADR 0647): what the host says of cooling off (read anywhere), and ending a
317
+ // membership in it (web only, like every billing action).
318
+ useCoolingOff: ["subscription.coolingOff"],
319
+ useCoolOff: ["subscription.coolOff"],
145
320
  };
146
321
  /**
147
322
  * Hooks for a React or React Native app:
@@ -162,16 +337,36 @@ function allMembershipsHooks(react, api) {
162
337
  usePassTypes() {
163
338
  return useQuery(api.query("x.memberships.passTypes", {}));
164
339
  },
340
+ /**
341
+ * Staff: every pass type, by title, for giving one by hand (stage 47). The staff client's
342
+ * record read; a customer's client cannot back it.
343
+ */
344
+ useStaffPassTypes() {
345
+ return useQuery(api.query("record.list", {
346
+ object: PASSTYPE,
347
+ sort: { field: "title", direction: "asc" },
348
+ limit: 100,
349
+ }));
350
+ },
165
351
  /** Start an order for a pass; then `checkout` it on the provider's page (web only). */
166
352
  useBuyPass() {
167
353
  return {
168
- start: useMutation(api.mutation("x.memberships.buy")),
354
+ // A visitor's agreements (a name typed, a signature, health answers) go in this call:
355
+ // not kept in the app's cache once it is over (stage 44).
356
+ start: useMutation({ ...api.mutation("x.memberships.buy"), gcTime: 0 }),
169
357
  checkout: useMutation(api.mutation("order.checkout")),
170
358
  };
171
359
  },
172
- /** The signed-in member's memberships and passes, with the host's count of what is left. */
173
- useMine() {
174
- return useQuery(api.query("x.memberships.mine", {}));
360
+ /**
361
+ * The signed-in member's memberships and passes, with the host's count of what is left; with
362
+ * a child's id (from `useFamily`), that child's, where the host shows them to a guardian.
363
+ */
364
+ useMine(personId) {
365
+ return useQuery(api.query("x.memberships.mine", personId ? { personId } : {}));
366
+ },
367
+ /** Who the member acts for: themselves and the children the gym linked to them. */
368
+ useFamily() {
369
+ return useQuery(api.query("me.family", {}));
175
370
  },
176
371
  /** Staff: one person's memberships and passes. */
177
372
  useHoldings(personId) {
@@ -187,7 +382,8 @@ function allMembershipsHooks(react, api) {
187
382
  },
188
383
  /** Start a membership: the host opens the provider's page (web only); the trial is the host's. */
189
384
  useSubscribe() {
190
- return useMutation(api.mutation("subscription.start"));
385
+ // A guest's agreements go in this call: not kept in the app's cache after it (stage 44).
386
+ return useMutation({ ...api.mutation("subscription.start"), gcTime: 0 });
191
387
  },
192
388
  /** The signed-in payer's own membership subscriptions, newest first. */
193
389
  useMySubscriptions() {
@@ -208,5 +404,45 @@ function allMembershipsHooks(react, api) {
208
404
  useBillingPortal() {
209
405
  return useMutation(api.mutation("subscription.portal"));
210
406
  },
407
+ /**
408
+ * Move their own membership to another plan (web only): the host decides an upgrade (now,
409
+ * prorated, applied once paid) or a downgrade (from the next period).
410
+ */
411
+ useChangePlan() {
412
+ return useMutation(api.mutation("subscription.change"));
413
+ },
414
+ /** Staff (a person): pause a membership from now or a date until a date, with a reason. */
415
+ usePauseSubscription() {
416
+ return useMutation(api.mutation("subscription.pause"));
417
+ },
418
+ /** Staff (a person): end a pause now, or withdraw one not yet started. */
419
+ useUnpauseSubscription() {
420
+ return useMutation(api.mutation("subscription.unpause"));
421
+ },
422
+ /**
423
+ * Whether each of these subscriptions may be ended in its cooling-off period, and how far one
424
+ * asked for has got. The host decides; a block shows the button only when `offered`.
425
+ */
426
+ useCoolingOff(ids) {
427
+ const list = [...ids].slice(0, 20);
428
+ const query = api.query("subscription.coolingOff", { ids: list });
429
+ return useQuery({ ...query, enabled: list.length > 0 });
430
+ },
431
+ /** End their own membership in its cooling-off period, for a full refund (web only). */
432
+ useCoolOff() {
433
+ return useMutation(api.mutation("subscription.coolOff"));
434
+ },
435
+ /** Staff: the membership subscriptions one person holds. */
436
+ useSubscriptionsOf(personId) {
437
+ return useQuery(api.query("subscription.list", {
438
+ filter: {
439
+ and: [
440
+ { field: "planObject", op: "eq", value: PLAN },
441
+ { field: "holderPersonId", op: "eq", value: personId },
442
+ ],
443
+ },
444
+ limit: 20,
445
+ }));
446
+ },
211
447
  };
212
448
  }
@@ -0,0 +1,5 @@
1
+ import type { DashboardDeclaration } from "@composable-os/sdk";
2
+ export declare const memberships: DashboardDeclaration;
3
+ export declare const membershipsDashboards: {
4
+ memberships: DashboardDeclaration;
5
+ };
@@ -0,0 +1,165 @@
1
+ const PLAN = "'memberships.plan'";
2
+ const IN = (column) => `${column} >= :dates_from AND ${column} < :dates_to`;
3
+ const WEEK = (column) => `date(${column}, '-' || ((strftime('%w', ${column}) + 6) % 7) || ' days')`;
4
+ const MEMBERS = (states) => `SELECT count(*) AS value FROM rec_x_memberships_membership m WHERE m.status IN (${states})`;
5
+ const statusIs = (values) => ({
6
+ object: "memberships.membership",
7
+ filter: { field: "status", op: "in", value: values },
8
+ });
9
+ export const memberships = {
10
+ title: "Memberships",
11
+ description: "Members now (active, on trial, paused, failing), trials that became paid, cancellations by " +
12
+ "month and reason, recurring revenue by month net of tax, and classes taken per week.",
13
+ filters: [{ type: "dateRange", id: "dates", label: "Dates", default: "this_quarter" }],
14
+ widgets: [
15
+ {
16
+ id: "active",
17
+ type: "kpi",
18
+ title: "Active members",
19
+ description: "Memberships active now (paid up), whatever the dates.",
20
+ sql: MEMBERS("'active'"),
21
+ mapping: { value: "value" },
22
+ options: { compare: false },
23
+ clickThrough: statusIs(["active"]),
24
+ layout: { w: 3, h: 1 },
25
+ },
26
+ {
27
+ id: "trialing",
28
+ type: "kpi",
29
+ title: "On trial",
30
+ description: "Memberships on their free trial now.",
31
+ sql: MEMBERS("'trialing'"),
32
+ mapping: { value: "value" },
33
+ options: { compare: false },
34
+ clickThrough: statusIs(["trialing"]),
35
+ layout: { w: 3, h: 1 },
36
+ },
37
+ {
38
+ id: "paused",
39
+ type: "kpi",
40
+ title: "Paused",
41
+ description: "Memberships paused by staff now: nothing charged, no classes.",
42
+ sql: MEMBERS("'paused'"),
43
+ mapping: { value: "value" },
44
+ options: { compare: false },
45
+ clickThrough: statusIs(["paused"]),
46
+ layout: { w: 3, h: 1 },
47
+ },
48
+ {
49
+ id: "failing",
50
+ type: "kpi",
51
+ title: "Payments failing",
52
+ description: "Memberships whose renewal failed: past due while the provider retries, or unpaid.",
53
+ sql: MEMBERS("'past_due', 'unpaid'"),
54
+ mapping: { value: "value" },
55
+ options: { compare: false },
56
+ clickThrough: statusIs(["past_due", "unpaid"]),
57
+ layout: { w: 3, h: 1 },
58
+ },
59
+ {
60
+ id: "trials-ended",
61
+ type: "kpi",
62
+ title: "Trials ended",
63
+ description: "Membership trials that ended in the period.",
64
+ sql: `SELECT count(*) AS value FROM rec_subscription s
65
+ WHERE s.plan_object = ${PLAN} AND s.trial_end IS NOT NULL AND s.trial_end <= :now
66
+ AND ${IN("s.trial_end")}`,
67
+ mapping: { value: "value" },
68
+ options: { compare: true },
69
+ layout: { w: 3, h: 1 },
70
+ },
71
+ {
72
+ id: "trials-paid",
73
+ type: "kpi",
74
+ title: "Trials that became paid",
75
+ description: "Of the trials that ended in the period, those with a paid period after the trial.",
76
+ sql: `SELECT count(*) AS value FROM rec_subscription s
77
+ WHERE s.plan_object = ${PLAN} AND s.trial_end IS NOT NULL AND s.trial_end <= :now
78
+ AND ${IN("s.trial_end")} AND EXISTS (
79
+ SELECT 1 FROM rec_order o WHERE o.subscription_id = s.id
80
+ AND o.state IN ('paid', 'part_paid', 'refunded') AND o.period_start >= s.trial_end)`,
81
+ mapping: { value: "value" },
82
+ options: { compare: true },
83
+ layout: { w: 3, h: 1 },
84
+ },
85
+ {
86
+ id: "revenue",
87
+ type: "kpi",
88
+ title: "Recurring revenue, net of tax",
89
+ description: "What membership periods paid in the period brought in, less refunds and the tax inside it.",
90
+ sql: `SELECT coalesce(sum(o.net), 0) / 100.0 AS value FROM rec_order o
91
+ JOIN rec_subscription s ON s.id = o.subscription_id
92
+ WHERE s.plan_object = ${PLAN} AND o.state IN ('paid', 'part_paid', 'refunded') AND ${IN("o.paid_at")}`,
93
+ mapping: { value: "value" },
94
+ options: { compare: true, format: "currency" },
95
+ layout: { w: 3, h: 1 },
96
+ },
97
+ {
98
+ id: "uses",
99
+ type: "kpi",
100
+ title: "Classes taken",
101
+ description: "Uses of memberships and passes for classes in the period, not given back.",
102
+ sql: `SELECT count(*) AS value FROM rec_allowance_use u
103
+ WHERE u.object_type IN ('memberships.membership', 'memberships.pass') AND u.returned_at IS NULL
104
+ AND ${IN("u.at")}`,
105
+ mapping: { value: "value" },
106
+ options: { compare: true },
107
+ layout: { w: 3, h: 1 },
108
+ },
109
+ {
110
+ id: "revenue-by-month",
111
+ type: "bar",
112
+ title: "Recurring revenue by month, net of tax",
113
+ description: "Membership periods paid per month, less refunds and tax.",
114
+ sql: `SELECT substr(o.paid_at, 1, 7) AS month, sum(o.net) / 100.0 AS revenue FROM rec_order o
115
+ JOIN rec_subscription s ON s.id = o.subscription_id
116
+ WHERE s.plan_object = ${PLAN} AND o.state IN ('paid', 'part_paid', 'refunded') AND ${IN("o.paid_at")}
117
+ GROUP BY month ORDER BY month`,
118
+ mapping: { x: "month", y: ["revenue"] },
119
+ layout: { w: 6, h: 2 },
120
+ },
121
+ {
122
+ id: "cancellations-by-month",
123
+ type: "bar",
124
+ title: "Cancellations by month",
125
+ description: "Memberships cancelled per month, by the provider's reason: asked for (by the member or " +
126
+ "staff) or payments failed.",
127
+ sql: `SELECT substr(s.canceled_at, 1, 7) AS month,
128
+ CASE coalesce(s.end_reason, '') WHEN 'payment_failed' THEN 'Payments failed'
129
+ WHEN 'cancellation_requested' THEN 'Asked for' ELSE 'Other' END AS reason,
130
+ count(*) AS cancelled
131
+ FROM rec_subscription s WHERE s.plan_object = ${PLAN} AND s.canceled_at IS NOT NULL
132
+ AND ${IN("s.canceled_at")} GROUP BY month, reason ORDER BY month, reason`,
133
+ mapping: { x: "month", y: ["cancelled"], series: "reason" },
134
+ layout: { w: 6, h: 2 },
135
+ },
136
+ {
137
+ id: "uses-by-week",
138
+ type: "line",
139
+ title: "Classes taken by week",
140
+ description: "Uses of memberships and passes per week of the classes, not given back.",
141
+ sql: `SELECT ${WEEK("u.at")} AS week, count(*) AS uses FROM rec_allowance_use u
142
+ WHERE u.object_type IN ('memberships.membership', 'memberships.pass') AND u.returned_at IS NULL
143
+ AND ${IN("u.at")} GROUP BY week ORDER BY week`,
144
+ mapping: { x: "week", y: ["uses"] },
145
+ layout: { w: 6, h: 2 },
146
+ },
147
+ {
148
+ id: "failing-members",
149
+ type: "table",
150
+ title: "Failing payments",
151
+ description: "Memberships past due or unpaid, the longest failing first.",
152
+ sql: `SELECT m.id AS id, p.display_name AS member, m.title AS plan, m.status AS status,
153
+ m.until AS until
154
+ FROM rec_x_memberships_membership m JOIN rec_person p ON p.id = m.person
155
+ WHERE m.status IN ('past_due', 'unpaid') ORDER BY m.until, member LIMIT 50`,
156
+ mapping: { columns: ["member", "plan", "status", "until"] },
157
+ clickThrough: {
158
+ object: "memberships.membership",
159
+ filter: { field: "id", op: "eq", value: { $row: "id" } },
160
+ },
161
+ layout: { w: 6, h: 2 },
162
+ },
163
+ ],
164
+ };
165
+ export const membershipsDashboards = { memberships };