NobGit
public imalexnord read

Slot

Calendar-first scheduling powered by Cloudflare Workers and Google Calendar.

Languages

Repository composition by tracked source files.

TypeScript
TypeScript 79% CSS 19% SQL 2% HTML 0%
Create file Wiki Documentation
Clone
https://nobgit.com/user/imalexnord/slot.git
ssh://[email protected]:2222/user/imalexnord/slot.git

Trace

worker/index.ts

Trace helps you understand code history line by line. See who changed each line, when it changed, and which commit introduced it.

index.ts on main
Author Date Commit Line Code
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1
import {
Open commit View diff
1 import {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2
  clearSessionCookie,
Open commit View diff
2 clearSessionCookie,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
3
  getCookie,
Open commit View diff
3 getCookie,
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
4
  randomUrlToken,
Open commit View diff
4 randomUrlToken,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
5
  sessionCookie,
Open commit View diff
5 sessionCookie,
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
6
  sha256Base64Url,
Open commit View diff
6 sha256Base64Url,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
7
  signSession,
Open commit View diff
7 signSession,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
8
  verifySession,
Open commit View diff
8 verifySession,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
9
} from './crypto';
Open commit View diff
9 } from './crypto';
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
10
import {
Open commit View diff
10 import {
Alex Nord 3 days ago 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
11
  GoogleCalendarError,
Open commit View diff
11 GoogleCalendarError,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
12
  completeGoogleOAuth,
Open commit View diff
12 completeGoogleOAuth,
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
13
  confirmCalendarHold,
Open commit View diff
13 confirmCalendarHold,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
14
  createCalendarEvent,
Open commit View diff
14 createCalendarEvent,
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
15
  createCalendarHold,
Open commit View diff
15 createCalendarHold,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
16
  createGoogleAuthUrl,
Open commit View diff
16 createGoogleAuthUrl,
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
17
  deleteCalendarEvent,
Open commit View diff
17 deleteCalendarEvent,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
18
  disconnectGoogle,
Open commit View diff
18 disconnectGoogle,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
19
  hasGoogleConnection,
Open commit View diff
19 hasGoogleConnection,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
20
  queryBusy,
Open commit View diff
20 queryBusy,
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
21
  rescheduleCalendarEvent,
Open commit View diff
21 rescheduleCalendarEvent,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
22
  sendRescheduleSuggestion,
Open commit View diff
22 sendRescheduleSuggestion,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
23
} from './google';
Open commit View diff
23 } from './google';
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
24
import { bookingAmountMinor } from './money';
Open commit View diff
24 import { bookingAmountMinor } from './money';
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
25
import { DEFAULT_SETTINGS, getSettings, saveSettings } from './settings';
Open commit View diff
25 import { DEFAULT_SETTINGS, getSettings, saveSettings } from './settings';
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
26
import {
Open commit View diff
26 import {
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
27
  createStripeCheckoutSession,
Open commit View diff
27 createStripeCheckoutSession,
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
28
  createStripeRefund,
Open commit View diff
28 createStripeRefund,
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
29
  expireStripeCheckoutSession,
Open commit View diff
29 expireStripeCheckoutSession,
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
30
  retrieveStripeCheckoutSession,
Open commit View diff
30 retrieveStripeCheckoutSession,
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
31
  stripeCheckoutSessionMode,
Open commit View diff
31 stripeCheckoutSessionMode,
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
32
  stripeConfigured,
Open commit View diff
32 stripeConfigured,
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
33
  stripeMode,
Open commit View diff
33 stripeMode,
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
34
  stripePaymentIntentId,
Open commit View diff
34 stripePaymentIntentId,
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
35
  stripeReceiptUrl,
Open commit View diff
35 stripeReceiptUrl,
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
36
  StripeError,
Open commit View diff
36 StripeError,
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
37
  verifyStripeWebhook,
Open commit View diff
37 verifyStripeWebhook,
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
38
} from './stripe';
Open commit View diff
38 } from './stripe';
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
39
import type { StripeCheckoutSession, StripeRefund } from './stripe';
Open commit View diff
39 import type { StripeCheckoutSession, StripeRefund } from './stripe';
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
40
import {
Open commit View diff
40 import {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
41
  addDaysToDateKey,
Open commit View diff
41 addDaysToDateKey,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
42
  addMinutes,
Open commit View diff
42 addMinutes,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
43
  dateKeyInZone,
Open commit View diff
43 dateKeyInZone,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
44
  overlaps,
Open commit View diff
44 overlaps,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
45
  slotKeys,
Open commit View diff
45 slotKeys,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
46
  timeToMinutes,
Open commit View diff
46 timeToMinutes,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
47
  weekdayForDate,
Open commit View diff
47 weekdayForDate,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
48
  zonedDateTimeToUtc,
Open commit View diff
48 zonedDateTimeToUtc,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
49
} from './time';
Open commit View diff
49 } from './time';
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
50
import type {
Open commit View diff
50 import type {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
51
  AppSettings,
Open commit View diff
51 AppSettings,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
52
  AvailabilityBlock,
Open commit View diff
52 AvailabilityBlock,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
53
  BookingRequest,
Open commit View diff
53 BookingRequest,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
54
  BusyRange,
Open commit View diff
54 BusyRange,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
55
  Env,
Open commit View diff
55 Env,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
56
  MeetingMode,
Open commit View diff
56 MeetingMode,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
57
  RecurringUnavailablePeriod,
Open commit View diff
57 RecurringUnavailablePeriod,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
58
} from './types';
Open commit View diff
58 } from './types';
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
59
Open commit View diff
59
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
60
const JSON_HEADERS = {
Open commit View diff
60 const JSON_HEADERS = {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
61
  'Content-Type': 'application/json; charset=utf-8',
Open commit View diff
61 'Content-Type': 'application/json; charset=utf-8',
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
62
  'Cache-Control': 'no-store',
Open commit View diff
62 'Cache-Control': 'no-store',
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
63
};
Open commit View diff
63 };
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
64
Open commit View diff
64
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
65
function json(data: unknown, status = 200, headers: HeadersInit = {}): Response {
Open commit View diff
65 function json(data: unknown, status = 200, headers: HeadersInit = {}): Response {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
66
  return new Response(JSON.stringify(data), {
Open commit View diff
66 return new Response(JSON.stringify(data), {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
67
    status,
Open commit View diff
67 status,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
68
    headers: { ...JSON_HEADERS, ...headers },
Open commit View diff
68 headers: { ...JSON_HEADERS, ...headers },
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
69
  });
Open commit View diff
69 });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
70
}
Open commit View diff
70 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
71
Open commit View diff
71
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
72
function redirect(location: string, headers: HeadersInit = {}): Response {
Open commit View diff
72 function redirect(location: string, headers: HeadersInit = {}): Response {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
73
  return new Response(null, { status: 302, headers: { Location: location, ...headers } });
Open commit View diff
73 return new Response(null, { status: 302, headers: { Location: location, ...headers } });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
74
}
Open commit View diff
74 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
75
Open commit View diff
75
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
76
function errorMessage(error: unknown): string {
Open commit View diff
76 function errorMessage(error: unknown): string {
Alex Nord 3 days ago 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
77
  if (error instanceof GoogleCalendarError) return error.publicMessage;
Open commit View diff
77 if (error instanceof GoogleCalendarError) return error.publicMessage;
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
78
  return error instanceof Error ? error.message : 'Unexpected error';
Open commit View diff
78 return error instanceof Error ? error.message : 'Unexpected error';
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
79
}
Open commit View diff
79 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
80
Open commit View diff
80
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
81
function isEmail(value: string): boolean {
Open commit View diff
81 function isEmail(value: string): boolean {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
82
  return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
Open commit View diff
82 return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
83
}
Open commit View diff
83 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
84
Open commit View diff
84
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
85
function isTime(value: string): boolean {
Open commit View diff
85 function isTime(value: string): boolean {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
86
  return /^\d{2}:\d{2}$/.test(value) && timeToMinutes(value) >= 0 && timeToMinutes(value) <= 24 * 60;
Open commit View diff
86 return /^\d{2}:\d{2}$/.test(value) && timeToMinutes(value) >= 0 && timeToMinutes(value) <= 24 * 60;
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
87
}
Open commit View diff
87 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
88
Open commit View diff
88
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
89
function privateCalendarError(error: unknown): string {
Open commit View diff
89 function privateCalendarError(error: unknown): string {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
90
  if (error instanceof GoogleCalendarError) return error.publicMessage;
Open commit View diff
90 if (error instanceof GoogleCalendarError) return error.publicMessage;
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
91
  return 'Calendar sync failed. Check the calendar connection and try again.';
Open commit View diff
91 return 'Calendar sync failed. Check the calendar connection and try again.';
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
92
}
Open commit View diff
92 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
93
Open commit View diff
93
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
94
async function enforceBookingRateLimit(request: Request, env: Env): Promise<boolean> {
Open commit View diff
94 async function enforceBookingRateLimit(request: Request, env: Env): Promise<boolean> {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
95
  const ip = request.headers.get('CF-Connecting-IP');
Open commit View diff
95 const ip = request.headers.get('CF-Connecting-IP');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
96
  if (!ip) return true; // Local development.
Open commit View diff
96 if (!ip) return true; // Local development.
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
97
Open commit View diff
97
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
98
  const hourBucket = Math.floor(Date.now() / 3_600_000);
Open commit View diff
98 const hourBucket = Math.floor(Date.now() / 3_600_000);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
99
  const material = new TextEncoder().encode(`${ip}:${hourBucket}:${env.SESSION_SECRET}`);
Open commit View diff
99 const material = new TextEncoder().encode(`${ip}:${hourBucket}:${env.SESSION_SECRET}`);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
100
  const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', material));
Open commit View diff
100 const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', material));
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
101
  const key = Array.from(digest, (byte) => byte.toString(16).padStart(2, '0')).join('');
Open commit View diff
101 const key = Array.from(digest, (byte) => byte.toString(16).padStart(2, '0')).join('');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
102
  const resetAt = (hourBucket + 1) * 3_600_000;
Open commit View diff
102 const resetAt = (hourBucket + 1) * 3_600_000;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
103
Open commit View diff
103
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
104
  await env.DB.prepare('DELETE FROM rate_limits WHERE reset_at < ?1').bind(Date.now()).run();
Open commit View diff
104 await env.DB.prepare('DELETE FROM rate_limits WHERE reset_at < ?1').bind(Date.now()).run();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
105
  await env.DB.prepare(`
Open commit View diff
105 await env.DB.prepare(`
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
106
    INSERT INTO rate_limits (key, count, reset_at)
Open commit View diff
106 INSERT INTO rate_limits (key, count, reset_at)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
107
    VALUES (?1, 1, ?2)
Open commit View diff
107 VALUES (?1, 1, ?2)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
108
    ON CONFLICT(key) DO UPDATE SET count = count + 1
Open commit View diff
108 ON CONFLICT(key) DO UPDATE SET count = count + 1
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
109
  `).bind(key, resetAt).run();
Open commit View diff
109 `).bind(key, resetAt).run();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
110
  const row = await env.DB.prepare('SELECT count FROM rate_limits WHERE key = ?1')
Open commit View diff
110 const row = await env.DB.prepare('SELECT count FROM rate_limits WHERE key = ?1')
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
111
    .bind(key)
Open commit View diff
111 .bind(key)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
112
    .first<{ count: number }>();
Open commit View diff
112 .first<{ count: number }>();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
113
  return (row?.count ?? 1) <= 12;
Open commit View diff
113 return (row?.count ?? 1) <= 12;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
114
}
Open commit View diff
114 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
115
Open commit View diff
115
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
116
async function enforceCancellationRateLimit(request: Request, env: Env): Promise<boolean> {
Open commit View diff
116 async function enforceCancellationRateLimit(request: Request, env: Env): Promise<boolean> {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
117
  const ip = request.headers.get('CF-Connecting-IP');
Open commit View diff
117 const ip = request.headers.get('CF-Connecting-IP');
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
118
  if (!ip) return true;
Open commit View diff
118 if (!ip) return true;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
119
Open commit View diff
119
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
120
  const hourBucket = Math.floor(Date.now() / 3_600_000);
Open commit View diff
120 const hourBucket = Math.floor(Date.now() / 3_600_000);
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
121
  const material = new TextEncoder().encode(`cancel:${ip}:${hourBucket}:${env.SESSION_SECRET}`);
Open commit View diff
121 const material = new TextEncoder().encode(`cancel:${ip}:${hourBucket}:${env.SESSION_SECRET}`);
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
122
  const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', material));
Open commit View diff
122 const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', material));
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
123
  const key = Array.from(digest, (byte) => byte.toString(16).padStart(2, '0')).join('');
Open commit View diff
123 const key = Array.from(digest, (byte) => byte.toString(16).padStart(2, '0')).join('');
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
124
  const resetAt = (hourBucket + 1) * 3_600_000;
Open commit View diff
124 const resetAt = (hourBucket + 1) * 3_600_000;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
125
Open commit View diff
125
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
126
  await env.DB.prepare('DELETE FROM rate_limits WHERE reset_at < ?1').bind(Date.now()).run();
Open commit View diff
126 await env.DB.prepare('DELETE FROM rate_limits WHERE reset_at < ?1').bind(Date.now()).run();
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
127
  await env.DB.prepare(`
Open commit View diff
127 await env.DB.prepare(`
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
128
    INSERT INTO rate_limits (key, count, reset_at)
Open commit View diff
128 INSERT INTO rate_limits (key, count, reset_at)
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
129
    VALUES (?1, 1, ?2)
Open commit View diff
129 VALUES (?1, 1, ?2)
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
130
    ON CONFLICT(key) DO UPDATE SET count = count + 1
Open commit View diff
130 ON CONFLICT(key) DO UPDATE SET count = count + 1
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
131
  `).bind(key, resetAt).run();
Open commit View diff
131 `).bind(key, resetAt).run();
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
132
  const row = await env.DB.prepare('SELECT count FROM rate_limits WHERE key = ?1')
Open commit View diff
132 const row = await env.DB.prepare('SELECT count FROM rate_limits WHERE key = ?1')
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
133
    .bind(key)
Open commit View diff
133 .bind(key)
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
134
    .first<{ count: number }>();
Open commit View diff
134 .first<{ count: number }>();
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
135
  return (row?.count ?? 1) <= 10;
Open commit View diff
135 return (row?.count ?? 1) <= 10;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
136
}
Open commit View diff
136 }
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
137
Open commit View diff
137
Alex Nord about 16 hours ago 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
138
Open commit View diff
138
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
139
async function enforceManageRateLimit(request: Request, env: Env): Promise<boolean> {
Open commit View diff
139 async function enforceManageRateLimit(request: Request, env: Env): Promise<boolean> {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
140
  const ip = request.headers.get('CF-Connecting-IP');
Open commit View diff
140 const ip = request.headers.get('CF-Connecting-IP');
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
141
  if (!ip) return true;
Open commit View diff
141 if (!ip) return true;
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
142
Open commit View diff
142
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
143
  const hourBucket = Math.floor(Date.now() / 3_600_000);
Open commit View diff
143 const hourBucket = Math.floor(Date.now() / 3_600_000);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
144
  const material = new TextEncoder().encode(`manage:${ip}:${hourBucket}:${env.SESSION_SECRET}`);
Open commit View diff
144 const material = new TextEncoder().encode(`manage:${ip}:${hourBucket}:${env.SESSION_SECRET}`);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
145
  const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', material));
Open commit View diff
145 const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', material));
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
146
  const key = Array.from(digest, (byte) => byte.toString(16).padStart(2, '0')).join('');
Open commit View diff
146 const key = Array.from(digest, (byte) => byte.toString(16).padStart(2, '0')).join('');
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
147
  const resetAt = (hourBucket + 1) * 3_600_000;
Open commit View diff
147 const resetAt = (hourBucket + 1) * 3_600_000;
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
148
Open commit View diff
148
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
149
  await env.DB.prepare('DELETE FROM rate_limits WHERE reset_at < ?1').bind(Date.now()).run();
Open commit View diff
149 await env.DB.prepare('DELETE FROM rate_limits WHERE reset_at < ?1').bind(Date.now()).run();
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
150
  await env.DB.prepare(`
Open commit View diff
150 await env.DB.prepare(`
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
151
    INSERT INTO rate_limits (key, count, reset_at)
Open commit View diff
151 INSERT INTO rate_limits (key, count, reset_at)
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
152
    VALUES (?1, 1, ?2)
Open commit View diff
152 VALUES (?1, 1, ?2)
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
153
    ON CONFLICT(key) DO UPDATE SET count = count + 1
Open commit View diff
153 ON CONFLICT(key) DO UPDATE SET count = count + 1
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
154
  `).bind(key, resetAt).run();
Open commit View diff
154 `).bind(key, resetAt).run();
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
155
  const row = await env.DB.prepare('SELECT count FROM rate_limits WHERE key = ?1')
Open commit View diff
155 const row = await env.DB.prepare('SELECT count FROM rate_limits WHERE key = ?1')
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
156
    .bind(key)
Open commit View diff
156 .bind(key)
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
157
    .first<{ count: number }>();
Open commit View diff
157 .first<{ count: number }>();
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
158
  return (row?.count ?? 1) <= 30;
Open commit View diff
158 return (row?.count ?? 1) <= 30;
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
159
}
Open commit View diff
159 }
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
160
Open commit View diff
160
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
161
function newPublicBookingId(): string {
Open commit View diff
161 function newPublicBookingId(): string {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
162
  const alphabet = '23456789ABCDEFGHJKLMNPQRSTUVWXYZ';
Open commit View diff
162 const alphabet = '23456789ABCDEFGHJKLMNPQRSTUVWXYZ';
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
163
  const bytes = crypto.getRandomValues(new Uint8Array(20));
Open commit View diff
163 const bytes = crypto.getRandomValues(new Uint8Array(20));
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
164
  const chars = Array.from(bytes, (byte) => alphabet[byte % alphabet.length]).join('');
Open commit View diff
164 const chars = Array.from(bytes, (byte) => alphabet[byte % alphabet.length]).join('');
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
165
  return `SLT-${chars.slice(0, 4)}-${chars.slice(4, 8)}-${chars.slice(8, 12)}-${chars.slice(12, 16)}-${chars.slice(16, 20)}`;
Open commit View diff
165 return `SLT-${chars.slice(0, 4)}-${chars.slice(4, 8)}-${chars.slice(8, 12)}-${chars.slice(12, 16)}-${chars.slice(16, 20)}`;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
166
}
Open commit View diff
166 }
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
167
Open commit View diff
167
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
168
function normalizePublicBookingId(value: unknown): string | null {
Open commit View diff
168 function normalizePublicBookingId(value: unknown): string | null {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
169
  const compact = String(value ?? '').trim().toUpperCase().replace(/[^A-Z0-9]/g, '');
Open commit View diff
169 const compact = String(value ?? '').trim().toUpperCase().replace(/[^A-Z0-9]/g, '');
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
170
  if (!compact.startsWith('SLT') || compact.length !== 23) return null;
Open commit View diff
170 if (!compact.startsWith('SLT') || compact.length !== 23) return null;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
171
  const chars = compact.slice(3);
Open commit View diff
171 const chars = compact.slice(3);
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
172
  if (!/^[A-Z0-9]{20}$/.test(chars)) return null;
Open commit View diff
172 if (!/^[A-Z0-9]{20}$/.test(chars)) return null;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
173
  return `SLT-${chars.slice(0, 4)}-${chars.slice(4, 8)}-${chars.slice(8, 12)}-${chars.slice(12, 16)}-${chars.slice(16, 20)}`;
Open commit View diff
173 return `SLT-${chars.slice(0, 4)}-${chars.slice(4, 8)}-${chars.slice(8, 12)}-${chars.slice(12, 16)}-${chars.slice(16, 20)}`;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
174
}
Open commit View diff
174 }
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
175
Open commit View diff
175
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
176
async function requireAdmin(request: Request, env: Env): Promise<string | null> {
Open commit View diff
176 async function requireAdmin(request: Request, env: Env): Promise<string | null> {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
177
  const email = await verifySession(env, getCookie(request, 'meet_session'));
Open commit View diff
177 const email = await verifySession(env, getCookie(request, 'meet_session'));
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
178
  if (!email || email.toLowerCase() !== env.ADMIN_EMAIL.toLowerCase()) return null;
Open commit View diff
178 if (!email || email.toLowerCase() !== env.ADMIN_EMAIL.toLowerCase()) return null;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
179
  return email;
Open commit View diff
179 return email;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
180
}
Open commit View diff
180 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
181
Open commit View diff
181
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
182
function validateAppSettings(input: unknown): AppSettings {
Open commit View diff
182 function validateAppSettings(input: unknown): AppSettings {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
183
  if (!input || typeof input !== 'object') throw new Error('Invalid settings payload');
Open commit View diff
183 if (!input || typeof input !== 'object') throw new Error('Invalid settings payload');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
184
  const raw = input as Partial<AppSettings>;
Open commit View diff
184 const raw = input as Partial<AppSettings>;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
185
  const allowedModes: MeetingMode[] = ['google_meet', 'phone', 'in_person', 'decide_later'];
Open commit View diff
185 const allowedModes: MeetingMode[] = ['google_meet', 'phone', 'in_person', 'decide_later'];
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
186
Open commit View diff
186
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
187
  const durations = Array.isArray(raw.durations)
Open commit View diff
187 const durations = Array.isArray(raw.durations)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
188
    ? [...new Set(raw.durations.map(Number).filter((value) => value >= 10 && value <= 240))].sort((a, b) => a - b)
Open commit View diff
188 ? [...new Set(raw.durations.map(Number).filter((value) => value >= 10 && value <= 240))].sort((a, b) => a - b)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
189
    : DEFAULT_SETTINGS.durations;
Open commit View diff
189 : DEFAULT_SETTINGS.durations;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
190
  if (!durations.length) throw new Error('At least one duration is required');
Open commit View diff
190 if (!durations.length) throw new Error('At least one duration is required');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
191
Open commit View diff
191
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
192
  const availability: AppSettings['availability'] = {};
Open commit View diff
192 const availability: AppSettings['availability'] = {};
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
193
  for (let day = 0; day <= 6; day += 1) {
Open commit View diff
193 for (let day = 0; day <= 6; day += 1) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
194
    const intervals = raw.availability?.[String(day)] ?? [];
Open commit View diff
194 const intervals = raw.availability?.[String(day)] ?? [];
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
195
    availability[String(day)] = intervals
Open commit View diff
195 availability[String(day)] = intervals
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
196
      .filter((interval) => /^\d{2}:\d{2}$/.test(interval.start) && /^\d{2}:\d{2}$/.test(interval.end))
Open commit View diff
196 .filter((interval) => /^\d{2}:\d{2}$/.test(interval.start) && /^\d{2}:\d{2}$/.test(interval.end))
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
197
      .filter((interval) => timeToMinutes(interval.end) > timeToMinutes(interval.start))
Open commit View diff
197 .filter((interval) => timeToMinutes(interval.end) > timeToMinutes(interval.start))
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
198
      .sort((a, b) => timeToMinutes(a.start) - timeToMinutes(b.start))
Open commit View diff
198 .sort((a, b) => timeToMinutes(a.start) - timeToMinutes(b.start))
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
199
      .slice(0, 3);
Open commit View diff
199 .slice(0, 3);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
200
  }
Open commit View diff
200 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
201
Open commit View diff
201
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
202
  const allowMeetingModes = Array.isArray(raw.allowMeetingModes)
Open commit View diff
202 const allowMeetingModes = Array.isArray(raw.allowMeetingModes)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
203
    ? raw.allowMeetingModes.filter((mode): mode is MeetingMode => allowedModes.includes(mode as MeetingMode))
Open commit View diff
203 ? raw.allowMeetingModes.filter((mode): mode is MeetingMode => allowedModes.includes(mode as MeetingMode))
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
204
    : DEFAULT_SETTINGS.allowMeetingModes;
Open commit View diff
204 : DEFAULT_SETTINGS.allowMeetingModes;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
205
  const normalizedModes = allowMeetingModes.length ? allowMeetingModes : ['google_meet'] as MeetingMode[];
Open commit View diff
205 const normalizedModes = allowMeetingModes.length ? allowMeetingModes : ['google_meet'] as MeetingMode[];
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
206
  const defaultMeetingMode = normalizedModes.includes(raw.defaultMeetingMode as MeetingMode)
Open commit View diff
206 const defaultMeetingMode = normalizedModes.includes(raw.defaultMeetingMode as MeetingMode)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
207
    ? (raw.defaultMeetingMode as MeetingMode)
Open commit View diff
207 ? (raw.defaultMeetingMode as MeetingMode)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
208
    : normalizedModes[0];
Open commit View diff
208 : normalizedModes[0];
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
209
  const paymentEnabled = Boolean(raw.paymentEnabled);
Open commit View diff
209 const paymentEnabled = Boolean(raw.paymentEnabled);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
210
  const paymentRatePerMinute = Math.min(
Open commit View diff
210 const paymentRatePerMinute = Math.min(
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
211
    1_000_000,
Open commit View diff
211 1_000_000,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
212
    Math.max(0, Math.round(Number(raw.paymentRatePerMinute ?? DEFAULT_SETTINGS.paymentRatePerMinute) * 10000) / 10000),
Open commit View diff
212 Math.max(0, Math.round(Number(raw.paymentRatePerMinute ?? DEFAULT_SETTINGS.paymentRatePerMinute) * 10000) / 10000),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
213
  );
Open commit View diff
213 );
Alex Nord about 16 hours ago 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
214
  const paymentFreeDurations = Array.isArray(raw.paymentFreeDurations)
Open commit View diff
214 const paymentFreeDurations = Array.isArray(raw.paymentFreeDurations)
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
215
    ? [...new Set(raw.paymentFreeDurations.map(Number).filter((value) => durations.includes(value)))].sort((a, b) => a - b)
Open commit View diff
215 ? [...new Set(raw.paymentFreeDurations.map(Number).filter((value) => durations.includes(value)))].sort((a, b) => a - b)
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
216
    : DEFAULT_SETTINGS.paymentFreeDurations;
Open commit View diff
216 : DEFAULT_SETTINGS.paymentFreeDurations;
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
217
  const hasPaidDuration = durations.some((duration) => !paymentFreeDurations.includes(duration));
Open commit View diff
217 const hasPaidDuration = durations.some((duration) => !paymentFreeDurations.includes(duration));
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
218
  if (paymentEnabled && hasPaidDuration && paymentRatePerMinute <= 0) {
Open commit View diff
218 if (paymentEnabled && hasPaidDuration && paymentRatePerMinute <= 0) {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
219
    throw new Error('Set a price per minute greater than zero for paid meeting lengths.');
Open commit View diff
219 throw new Error('Set a price per minute greater than zero for paid meeting lengths.');
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
220
  }
Open commit View diff
220 }
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
221
Open commit View diff
221
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
222
  return {
Open commit View diff
222 return {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
223
    title: String(raw.title ?? DEFAULT_SETTINGS.title).trim().slice(0, 100) || DEFAULT_SETTINGS.title,
Open commit View diff
223 title: String(raw.title ?? DEFAULT_SETTINGS.title).trim().slice(0, 100) || DEFAULT_SETTINGS.title,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
224
    subtitle: String(raw.subtitle ?? DEFAULT_SETTINGS.subtitle).trim().slice(0, 240),
Open commit View diff
224 subtitle: String(raw.subtitle ?? DEFAULT_SETTINGS.subtitle).trim().slice(0, 240),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
225
    timezone: String(raw.timezone ?? DEFAULT_SETTINGS.timezone).trim() || DEFAULT_SETTINGS.timezone,
Open commit View diff
225 timezone: String(raw.timezone ?? DEFAULT_SETTINGS.timezone).trim() || DEFAULT_SETTINGS.timezone,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
226
    bookingWindowDays: Math.min(365, Math.max(1, Number(raw.bookingWindowDays ?? DEFAULT_SETTINGS.bookingWindowDays))),
Open commit View diff
226 bookingWindowDays: Math.min(365, Math.max(1, Number(raw.bookingWindowDays ?? DEFAULT_SETTINGS.bookingWindowDays))),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
227
    minimumNoticeMinutes: Math.min(10080, Math.max(0, Number(raw.minimumNoticeMinutes ?? 120))),
Open commit View diff
227 minimumNoticeMinutes: Math.min(10080, Math.max(0, Number(raw.minimumNoticeMinutes ?? 120))),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
228
    bufferBeforeMinutes: Math.min(180, Math.max(0, Number(raw.bufferBeforeMinutes ?? 0))),
Open commit View diff
228 bufferBeforeMinutes: Math.min(180, Math.max(0, Number(raw.bufferBeforeMinutes ?? 0))),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
229
    bufferAfterMinutes: Math.min(180, Math.max(0, Number(raw.bufferAfterMinutes ?? 15))),
Open commit View diff
229 bufferAfterMinutes: Math.min(180, Math.max(0, Number(raw.bufferAfterMinutes ?? 15))),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
230
    slotIncrementMinutes: [5, 10, 15, 20, 30, 60].includes(Number(raw.slotIncrementMinutes))
Open commit View diff
230 slotIncrementMinutes: [5, 10, 15, 20, 30, 60].includes(Number(raw.slotIncrementMinutes))
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
231
      ? Number(raw.slotIncrementMinutes)
Open commit View diff
231 ? Number(raw.slotIncrementMinutes)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
232
      : 15,
Open commit View diff
232 : 15,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
233
    durations,
Open commit View diff
233 durations,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
234
    calendarId: String(raw.calendarId ?? 'primary').trim() || 'primary',
Open commit View diff
234 calendarId: String(raw.calendarId ?? 'primary').trim() || 'primary',
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
235
    busyCalendarIds: Array.isArray(raw.busyCalendarIds)
Open commit View diff
235 busyCalendarIds: Array.isArray(raw.busyCalendarIds)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
236
      ? raw.busyCalendarIds.map(String).map((value) => value.trim()).filter(Boolean).slice(0, 20)
Open commit View diff
236 ? raw.busyCalendarIds.map(String).map((value) => value.trim()).filter(Boolean).slice(0, 20)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
237
      : ['primary'],
Open commit View diff
237 : ['primary'],
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
238
    defaultMeetingMode,
Open commit View diff
238 defaultMeetingMode,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
239
    allowMeetingModes: normalizedModes,
Open commit View diff
239 allowMeetingModes: normalizedModes,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
240
    inPersonLocation: String(raw.inPersonLocation ?? '').trim().slice(0, 240),
Open commit View diff
240 inPersonLocation: String(raw.inPersonLocation ?? '').trim().slice(0, 240),
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
241
    paymentEnabled,
Open commit View diff
241 paymentEnabled,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
242
    paymentRatePerMinute,
Open commit View diff
242 paymentRatePerMinute,
Alex Nord about 16 hours ago 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
243
    paymentFreeDurations,
Open commit View diff
243 paymentFreeDurations,
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
244
    paymentCurrency: /^[a-zA-Z]{3}$/.test(String(raw.paymentCurrency ?? ''))
Open commit View diff
244 paymentCurrency: /^[a-zA-Z]{3}$/.test(String(raw.paymentCurrency ?? ''))
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
245
      ? String(raw.paymentCurrency).toLowerCase()
Open commit View diff
245 ? String(raw.paymentCurrency).toLowerCase()
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
246
      : DEFAULT_SETTINGS.paymentCurrency,
Open commit View diff
246 : DEFAULT_SETTINGS.paymentCurrency,
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
247
    paymentLabel: String(raw.paymentLabel ?? DEFAULT_SETTINGS.paymentLabel).trim().slice(0, 120)
Open commit View diff
247 paymentLabel: String(raw.paymentLabel ?? DEFAULT_SETTINGS.paymentLabel).trim().slice(0, 120)
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
248
      || DEFAULT_SETTINGS.paymentLabel,
Open commit View diff
248 || DEFAULT_SETTINGS.paymentLabel,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
249
    availability,
Open commit View diff
249 availability,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
250
  };
Open commit View diff
250 };
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
251
}
Open commit View diff
251 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
252
Open commit View diff
252
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
253
async function d1BusyRanges(env: Env, start: number, end: number): Promise<BusyRange[]> {
Open commit View diff
253 async function d1BusyRanges(env: Env, start: number, end: number): Promise<BusyRange[]> {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
254
  await env.DB.prepare("DELETE FROM slot_locks WHERE expires_at < ?1").bind(Date.now()).run();
Open commit View diff
254 await env.DB.prepare("DELETE FROM slot_locks WHERE expires_at < ?1").bind(Date.now()).run();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
255
  const result = await env.DB.prepare(`
Open commit View diff
255 const result = await env.DB.prepare(`
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
256
    SELECT start_time, end_time
Open commit View diff
256 SELECT start_time, end_time
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
257
    FROM bookings
Open commit View diff
257 FROM bookings
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
258
    WHERE (
Open commit View diff
258 WHERE (
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
259
        status = 'pending'
Open commit View diff
259 status = 'pending'
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
260
        OR status = 'confirmed'
Open commit View diff
260 OR status = 'confirmed'
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
261
      )
Open commit View diff
261 )
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
262
      AND start_time < ?1
Open commit View diff
262 AND start_time < ?1
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
263
      AND end_time > ?2
Open commit View diff
263 AND end_time > ?2
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
264
  `).bind(new Date(end).toISOString(), new Date(start).toISOString()).all<{
Open commit View diff
264 `).bind(new Date(end).toISOString(), new Date(start).toISOString()).all<{
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
265
    start_time: string;
Open commit View diff
265 start_time: string;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
266
    end_time: string;
Open commit View diff
266 end_time: string;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
267
  }>();
Open commit View diff
267 }>();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
268
Open commit View diff
268
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
269
  return (result.results ?? []).map((row) => ({
Open commit View diff
269 return (result.results ?? []).map((row) => ({
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
270
    start: Date.parse(row.start_time),
Open commit View diff
270 start: Date.parse(row.start_time),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
271
    end: Date.parse(row.end_time),
Open commit View diff
271 end: Date.parse(row.end_time),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
272
  }));
Open commit View diff
272 }));
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
273
}
Open commit View diff
273 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
274
Open commit View diff
274
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
275
async function recurringUnavailableForDay(env: Env, weekday: number): Promise<RecurringUnavailablePeriod[]> {
Open commit View diff
275 async function recurringUnavailableForDay(env: Env, weekday: number): Promise<RecurringUnavailablePeriod[]> {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
276
  const result = await env.DB.prepare(`
Open commit View diff
276 const result = await env.DB.prepare(`
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
277
    SELECT id, weekdays, start_time, end_time, label
Open commit View diff
277 SELECT id, weekdays, start_time, end_time, label
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
278
    FROM recurring_unavailable_periods
Open commit View diff
278 FROM recurring_unavailable_periods
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
279
    ORDER BY start_time
Open commit View diff
279 ORDER BY start_time
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
280
  `).all<{ id: string; weekdays: string; start_time: string; end_time: string; label: string | null }>();
Open commit View diff
280 `).all<{ id: string; weekdays: string; start_time: string; end_time: string; label: string | null }>();
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
281
Open commit View diff
281
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
282
  return (result.results ?? [])
Open commit View diff
282 return (result.results ?? [])
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
283
    .map((row) => ({
Open commit View diff
283 .map((row) => ({
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
284
      id: row.id,
Open commit View diff
284 id: row.id,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
285
      weekdays: row.weekdays.split(',').map(Number).filter((day) => day >= 0 && day <= 6),
Open commit View diff
285 weekdays: row.weekdays.split(',').map(Number).filter((day) => day >= 0 && day <= 6),
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
286
      start: row.start_time,
Open commit View diff
286 start: row.start_time,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
287
      end: row.end_time,
Open commit View diff
287 end: row.end_time,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
288
      label: row.label ?? undefined,
Open commit View diff
288 label: row.label ?? undefined,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
289
    }))
Open commit View diff
289 }))
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
290
    .filter((period) => period.weekdays.includes(weekday));
Open commit View diff
290 .filter((period) => period.weekdays.includes(weekday));
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
291
}
Open commit View diff
291 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
292
Open commit View diff
292
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
293
async function oneOffBlocksForDate(env: Env, dateKey: string): Promise<AvailabilityBlock[]> {
Open commit View diff
293 async function oneOffBlocksForDate(env: Env, dateKey: string): Promise<AvailabilityBlock[]> {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
294
  const result = await env.DB.prepare(`
Open commit View diff
294 const result = await env.DB.prepare(`
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
295
    SELECT id, date, start_time, end_time, all_day, label
Open commit View diff
295 SELECT id, date, start_time, end_time, all_day, label
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
296
    FROM availability_blocks
Open commit View diff
296 FROM availability_blocks
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
297
    WHERE date = ?1
Open commit View diff
297 WHERE date = ?1
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
298
    ORDER BY all_day DESC, start_time
Open commit View diff
298 ORDER BY all_day DESC, start_time
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
299
  `).bind(dateKey).all<{
Open commit View diff
299 `).bind(dateKey).all<{
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
300
    id: string;
Open commit View diff
300 id: string;
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
301
    date: string;
Open commit View diff
301 date: string;
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
302
    start_time: string | null;
Open commit View diff
302 start_time: string | null;
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
303
    end_time: string | null;
Open commit View diff
303 end_time: string | null;
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
304
    all_day: number;
Open commit View diff
304 all_day: number;
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
305
    label: string | null;
Open commit View diff
305 label: string | null;
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
306
  }>();
Open commit View diff
306 }>();
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
307
Open commit View diff
307
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
308
  return (result.results ?? []).map((row) => ({
Open commit View diff
308 return (result.results ?? []).map((row) => ({
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
309
    id: row.id,
Open commit View diff
309 id: row.id,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
310
    date: row.date,
Open commit View diff
310 date: row.date,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
311
    start: row.start_time ?? undefined,
Open commit View diff
311 start: row.start_time ?? undefined,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
312
    end: row.end_time ?? undefined,
Open commit View diff
312 end: row.end_time ?? undefined,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
313
    allDay: row.all_day === 1,
Open commit View diff
313 allDay: row.all_day === 1,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
314
    label: row.label ?? undefined,
Open commit View diff
314 label: row.label ?? undefined,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
315
  }));
Open commit View diff
315 }));
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
316
}
Open commit View diff
316 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
317
Open commit View diff
317
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
318
async function slotUnavailableRanges(env: Env, dateKey: string, timezone: string): Promise<BusyRange[]> {
Open commit View diff
318 async function slotUnavailableRanges(env: Env, dateKey: string, timezone: string): Promise<BusyRange[]> {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
319
  const weekday = weekdayForDate(dateKey, timezone);
Open commit View diff
319 const weekday = weekdayForDate(dateKey, timezone);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
320
  const [recurring, oneOff] = await Promise.all([
Open commit View diff
320 const [recurring, oneOff] = await Promise.all([
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
321
    recurringUnavailableForDay(env, weekday),
Open commit View diff
321 recurringUnavailableForDay(env, weekday),
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
322
    oneOffBlocksForDate(env, dateKey),
Open commit View diff
322 oneOffBlocksForDate(env, dateKey),
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
323
  ]);
Open commit View diff
323 ]);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
324
Open commit View diff
324
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
325
  const ranges: BusyRange[] = [];
Open commit View diff
325 const ranges: BusyRange[] = [];
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
326
  for (const period of recurring) {
Open commit View diff
326 for (const period of recurring) {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
327
    ranges.push({
Open commit View diff
327 ranges.push({
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
328
      start: zonedDateTimeToUtc(dateKey, period.start, timezone).getTime(),
Open commit View diff
328 start: zonedDateTimeToUtc(dateKey, period.start, timezone).getTime(),
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
329
      end: zonedDateTimeToUtc(dateKey, period.end, timezone).getTime(),
Open commit View diff
329 end: zonedDateTimeToUtc(dateKey, period.end, timezone).getTime(),
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
330
    });
Open commit View diff
330 });
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
331
  }
Open commit View diff
331 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
332
  for (const block of oneOff) {
Open commit View diff
332 for (const block of oneOff) {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
333
    if (block.allDay) {
Open commit View diff
333 if (block.allDay) {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
334
      ranges.push({
Open commit View diff
334 ranges.push({
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
335
        start: zonedDateTimeToUtc(dateKey, '00:00', timezone).getTime(),
Open commit View diff
335 start: zonedDateTimeToUtc(dateKey, '00:00', timezone).getTime(),
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
336
        end: zonedDateTimeToUtc(addDaysToDateKey(dateKey, 1), '00:00', timezone).getTime(),
Open commit View diff
336 end: zonedDateTimeToUtc(addDaysToDateKey(dateKey, 1), '00:00', timezone).getTime(),
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
337
      });
Open commit View diff
337 });
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
338
    } else if (block.start && block.end) {
Open commit View diff
338 } else if (block.start && block.end) {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
339
      ranges.push({
Open commit View diff
339 ranges.push({
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
340
        start: zonedDateTimeToUtc(dateKey, block.start, timezone).getTime(),
Open commit View diff
340 start: zonedDateTimeToUtc(dateKey, block.start, timezone).getTime(),
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
341
        end: zonedDateTimeToUtc(dateKey, block.end, timezone).getTime(),
Open commit View diff
341 end: zonedDateTimeToUtc(dateKey, block.end, timezone).getTime(),
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
342
      });
Open commit View diff
342 });
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
343
    }
Open commit View diff
343 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
344
  }
Open commit View diff
344 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
345
  return ranges;
Open commit View diff
345 return ranges;
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
346
}
Open commit View diff
346 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
347
Open commit View diff
347
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
348
type DurationBlockReason = 'outside_hours' | 'unavailable';
Open commit View diff
348 type DurationBlockReason = 'outside_hours' | 'unavailable';
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
349
type AvailabilitySlot = {
Open commit View diff
349 type AvailabilitySlot = {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
350
  start: string;
Open commit View diff
350 start: string;
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
351
  time: string;
Open commit View diff
351 time: string;
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
352
  durations: number[];
Open commit View diff
352 durations: number[];
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
353
  blockedDurations: Record<string, DurationBlockReason>;
Open commit View diff
353 blockedDurations: Record<string, DurationBlockReason>;
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
354
};
Open commit View diff
354 };
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
355
Open commit View diff
355
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
356
async function computeAvailability(env: Env, dateKey: string) {
Open commit View diff
356 async function computeAvailability(env: Env, dateKey: string) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
357
  const settings = await getSettings(env);
Open commit View diff
357 const settings = await getSettings(env);
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
358
  await cleanupStalePendingBookings(env, settings);
Open commit View diff
358 await cleanupStalePendingBookings(env, settings);
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
359
  const connected = await hasGoogleConnection(env);
Open commit View diff
359 const connected = await hasGoogleConnection(env);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
360
  if (!connected) {
Open commit View diff
360 if (!connected) {
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
361
    return { settings, connected, date: dateKey, slots: [] as AvailabilitySlot[] };
Open commit View diff
361 return { settings, connected, date: dateKey, slots: [] as AvailabilitySlot[] };
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
362
  }
Open commit View diff
362 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
363
Open commit View diff
363
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
364
  if (!/^\d{4}-\d{2}-\d{2}$/.test(dateKey)) throw new Error('Invalid date');
Open commit View diff
364 if (!/^\d{4}-\d{2}-\d{2}$/.test(dateKey)) throw new Error('Invalid date');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
365
  const today = dateKeyInZone(new Date(), settings.timezone);
Open commit View diff
365 const today = dateKeyInZone(new Date(), settings.timezone);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
366
  const maxDate = addDaysToDateKey(today, settings.bookingWindowDays);
Open commit View diff
366 const maxDate = addDaysToDateKey(today, settings.bookingWindowDays);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
367
  if (dateKey < today || dateKey > maxDate) {
Open commit View diff
367 if (dateKey < today || dateKey > maxDate) {
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
368
    return { settings, connected, date: dateKey, slots: [] as AvailabilitySlot[] };
Open commit View diff
368 return { settings, connected, date: dateKey, slots: [] as AvailabilitySlot[] };
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
369
  }
Open commit View diff
369 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
370
Open commit View diff
370
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
371
  const day = weekdayForDate(dateKey, settings.timezone);
Open commit View diff
371 const day = weekdayForDate(dateKey, settings.timezone);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
372
  const intervals = settings.availability[String(day)] ?? [];
Open commit View diff
372 const intervals = settings.availability[String(day)] ?? [];
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
373
  if (!intervals.length) {
Open commit View diff
373 if (!intervals.length) {
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
374
    return { settings, connected, date: dateKey, slots: [] as AvailabilitySlot[] };
Open commit View diff
374 return { settings, connected, date: dateKey, slots: [] as AvailabilitySlot[] };
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
375
  }
Open commit View diff
375 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
376
Open commit View diff
376
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
377
  const queryStart = zonedDateTimeToUtc(dateKey, intervals[0].start, settings.timezone).getTime() - 6 * 3600_000;
Open commit View diff
377 const queryStart = zonedDateTimeToUtc(dateKey, intervals[0].start, settings.timezone).getTime() - 6 * 3600_000;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
378
  const queryEnd = zonedDateTimeToUtc(dateKey, intervals[intervals.length - 1].end, settings.timezone).getTime() + 6 * 3600_000;
Open commit View diff
378 const queryEnd = zonedDateTimeToUtc(dateKey, intervals[intervals.length - 1].end, settings.timezone).getTime() + 6 * 3600_000;
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
379
  const [googleBusy, storedBusy, slotBusy] = await Promise.all([
Open commit View diff
379 const [googleBusy, storedBusy, slotBusy] = await Promise.all([
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
380
    queryBusy(env, settings, new Date(queryStart).toISOString(), new Date(queryEnd).toISOString()),
Open commit View diff
380 queryBusy(env, settings, new Date(queryStart).toISOString(), new Date(queryEnd).toISOString()),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
381
    d1BusyRanges(env, queryStart, queryEnd),
Open commit View diff
381 d1BusyRanges(env, queryStart, queryEnd),
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
382
    slotUnavailableRanges(env, dateKey, settings.timezone),
Open commit View diff
382 slotUnavailableRanges(env, dateKey, settings.timezone),
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
383
  ]);
Open commit View diff
383 ]);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
384
Open commit View diff
384
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
385
  const busy: BusyRange[] = [
Open commit View diff
385 const busy: BusyRange[] = [
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
386
    ...googleBusy.map((range) => ({ start: Date.parse(range.start), end: Date.parse(range.end) })),
Open commit View diff
386 ...googleBusy.map((range) => ({ start: Date.parse(range.start), end: Date.parse(range.end) })),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
387
    ...storedBusy,
Open commit View diff
387 ...storedBusy,
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
388
    ...slotBusy,
Open commit View diff
388 ...slotBusy,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
389
  ];
Open commit View diff
389 ];
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
390
  const earliestAllowed = Date.now() + settings.minimumNoticeMinutes * 60_000;
Open commit View diff
390 const earliestAllowed = Date.now() + settings.minimumNoticeMinutes * 60_000;
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
391
  const slots: AvailabilitySlot[] = [];
Open commit View diff
391 const slots: AvailabilitySlot[] = [];
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
392
Open commit View diff
392
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
393
  for (const interval of intervals) {
Open commit View diff
393 for (const interval of intervals) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
394
    const intervalStartMinutes = timeToMinutes(interval.start);
Open commit View diff
394 const intervalStartMinutes = timeToMinutes(interval.start);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
395
    const intervalEndMinutes = timeToMinutes(interval.end);
Open commit View diff
395 const intervalEndMinutes = timeToMinutes(interval.end);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
396
Open commit View diff
396
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
397
    for (
Open commit View diff
397 for (
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
398
      let minute = intervalStartMinutes;
Open commit View diff
398 let minute = intervalStartMinutes;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
399
      minute < intervalEndMinutes;
Open commit View diff
399 minute < intervalEndMinutes;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
400
      minute += settings.slotIncrementMinutes
Open commit View diff
400 minute += settings.slotIncrementMinutes
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
401
    ) {
Open commit View diff
401 ) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
402
      const hh = String(Math.floor(minute / 60)).padStart(2, '0');
Open commit View diff
402 const hh = String(Math.floor(minute / 60)).padStart(2, '0');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
403
      const mm = String(minute % 60).padStart(2, '0');
Open commit View diff
403 const mm = String(minute % 60).padStart(2, '0');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
404
      const time = `${hh}:${mm}`;
Open commit View diff
404 const time = `${hh}:${mm}`;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
405
      const start = zonedDateTimeToUtc(dateKey, time, settings.timezone).getTime();
Open commit View diff
405 const start = zonedDateTimeToUtc(dateKey, time, settings.timezone).getTime();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
406
      if (start < earliestAllowed) continue;
Open commit View diff
406 if (start < earliestAllowed) continue;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
407
Open commit View diff
407
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
408
      const blockedDurations: Record<string, DurationBlockReason> = {};
Open commit View diff
408 const blockedDurations: Record<string, DurationBlockReason> = {};
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
409
      const availableDurations = settings.durations.filter((duration) => {
Open commit View diff
409 const availableDurations = settings.durations.filter((duration) => {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
410
        const endMinute = minute + duration;
Open commit View diff
410 const endMinute = minute + duration;
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
411
        if (endMinute > intervalEndMinutes) {
Open commit View diff
411 if (endMinute > intervalEndMinutes) {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
412
          blockedDurations[String(duration)] = 'outside_hours';
Open commit View diff
412 blockedDurations[String(duration)] = 'outside_hours';
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
413
          return false;
Open commit View diff
413 return false;
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
414
        }
Open commit View diff
414 }
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
415
        const bufferedStart = addMinutes(start, -settings.bufferBeforeMinutes);
Open commit View diff
415 const bufferedStart = addMinutes(start, -settings.bufferBeforeMinutes);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
416
        const bufferedEnd = addMinutes(start, duration + settings.bufferAfterMinutes);
Open commit View diff
416 const bufferedEnd = addMinutes(start, duration + settings.bufferAfterMinutes);
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
417
        if (overlaps(bufferedStart, bufferedEnd, busy)) {
Open commit View diff
417 if (overlaps(bufferedStart, bufferedEnd, busy)) {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
418
          blockedDurations[String(duration)] = 'unavailable';
Open commit View diff
418 blockedDurations[String(duration)] = 'unavailable';
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
419
          return false;
Open commit View diff
419 return false;
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
420
        }
Open commit View diff
420 }
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
421
        return true;
Open commit View diff
421 return true;
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
422
      });
Open commit View diff
422 });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
423
Open commit View diff
423
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
424
      if (availableDurations.length) {
Open commit View diff
424 if (availableDurations.length) {
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
425
        slots.push({
Open commit View diff
425 slots.push({
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
426
          start: new Date(start).toISOString(),
Open commit View diff
426 start: new Date(start).toISOString(),
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
427
          time,
Open commit View diff
427 time,
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
428
          durations: availableDurations,
Open commit View diff
428 durations: availableDurations,
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
429
          blockedDurations,
Open commit View diff
429 blockedDurations,
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
430
        });
Open commit View diff
430 });
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
431
      }
Open commit View diff
431 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
432
    }
Open commit View diff
432 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
433
  }
Open commit View diff
433 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
434
Open commit View diff
434
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
435
  return { settings, connected, date: dateKey, slots };
Open commit View diff
435 return { settings, connected, date: dateKey, slots };
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
436
}
Open commit View diff
436 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
437
Open commit View diff
437
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
438
type PaymentBookingRow = {
Open commit View diff
438 type PaymentBookingRow = {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
439
  id: string;
Open commit View diff
439 id: string;
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
440
  public_booking_id: string | null;
Open commit View diff
440 public_booking_id: string | null;
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
441
  name: string;
Open commit View diff
441 name: string;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
442
  email: string;
Open commit View diff
442 email: string;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
443
  phone: string | null;
Open commit View diff
443 phone: string | null;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
444
  message: string | null;
Open commit View diff
444 message: string | null;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
445
  start_time: string;
Open commit View diff
445 start_time: string;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
446
  end_time: string;
Open commit View diff
446 end_time: string;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
447
  duration_minutes: number;
Open commit View diff
447 duration_minutes: number;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
448
  timezone: string;
Open commit View diff
448 timezone: string;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
449
  meeting_mode: MeetingMode;
Open commit View diff
449 meeting_mode: MeetingMode;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
450
  status: string;
Open commit View diff
450 status: string;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
451
  google_event_id: string | null;
Open commit View diff
451 google_event_id: string | null;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
452
  meet_url: string | null;
Open commit View diff
452 meet_url: string | null;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
453
  payment_status: string;
Open commit View diff
453 payment_status: string;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
454
  payment_amount: number | null;
Open commit View diff
454 payment_amount: number | null;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
455
  payment_currency: string | null;
Open commit View diff
455 payment_currency: string | null;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
456
  stripe_checkout_session_id: string | null;
Open commit View diff
456 stripe_checkout_session_id: string | null;
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
457
  stripe_payment_intent_id: string | null;
Open commit View diff
457 stripe_payment_intent_id: string | null;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
458
  paid_at: string | null;
Open commit View diff
458 paid_at: string | null;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
459
  rescheduled_at: string | null;
Open commit View diff
459 rescheduled_at: string | null;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
460
  reschedule_count: number;
Open commit View diff
460 reschedule_count: number;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
461
  proposed_start_time: string | null;
Open commit View diff
461 proposed_start_time: string | null;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
462
  proposed_end_time: string | null;
Open commit View diff
462 proposed_end_time: string | null;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
463
  proposed_at: string | null;
Open commit View diff
463 proposed_at: string | null;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
464
  proposal_status: string | null;
Open commit View diff
464 proposal_status: string | null;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
465
  proposal_token_hash: string | null;
Open commit View diff
465 proposal_token_hash: string | null;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
466
  refund_status: string;
Open commit View diff
466 refund_status: string;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
467
  stripe_refund_id: string | null;
Open commit View diff
467 stripe_refund_id: string | null;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
468
  refunded_amount: number | null;
Open commit View diff
468 refunded_amount: number | null;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
469
  refunded_at: string | null;
Open commit View diff
469 refunded_at: string | null;
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
470
  updated_at: string | null;
Open commit View diff
470 updated_at: string | null;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
471
};
Open commit View diff
471 };
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
472
Open commit View diff
472
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
473
function publicConfirmation(booking: PaymentBookingRow, receiptUrl: string | null = null) {
Open commit View diff
473 function publicConfirmation(booking: PaymentBookingRow, receiptUrl: string | null = null) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
474
  return {
Open commit View diff
474 return {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
475
    id: booking.id,
Open commit View diff
475 id: booking.id,
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
476
    bookingId: booking.public_booking_id,
Open commit View diff
476 bookingId: booking.public_booking_id,
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
477
    start: booking.start_time,
Open commit View diff
477 start: booking.start_time,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
478
    end: booking.end_time,
Open commit View diff
478 end: booking.end_time,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
479
    duration: booking.duration_minutes,
Open commit View diff
479 duration: booking.duration_minutes,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
480
    timezone: booking.timezone,
Open commit View diff
480 timezone: booking.timezone,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
481
    meetingMode: booking.meeting_mode,
Open commit View diff
481 meetingMode: booking.meeting_mode,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
482
    meetUrl: booking.meet_url,
Open commit View diff
482 meetUrl: booking.meet_url,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
483
    receiptUrl,
Open commit View diff
483 receiptUrl,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
484
  };
Open commit View diff
484 };
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
485
}
Open commit View diff
485 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
486
Open commit View diff
486
Alex Nord about 16 hours ago 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
487
Open commit View diff
487
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
488
function publicManagePayload(booking: PaymentBookingRow) {
Open commit View diff
488 function publicManagePayload(booking: PaymentBookingRow) {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
489
  const future = Date.parse(booking.end_time) > Date.now();
Open commit View diff
489 const future = Date.parse(booking.end_time) > Date.now();
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
490
  const confirmed = booking.status === 'confirmed';
Open commit View diff
490 const confirmed = booking.status === 'confirmed';
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
491
  return {
Open commit View diff
491 return {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
492
    bookingId: booking.public_booking_id,
Open commit View diff
492 bookingId: booking.public_booking_id,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
493
    name: booking.name,
Open commit View diff
493 name: booking.name,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
494
    start: booking.start_time,
Open commit View diff
494 start: booking.start_time,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
495
    end: booking.end_time,
Open commit View diff
495 end: booking.end_time,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
496
    duration: booking.duration_minutes,
Open commit View diff
496 duration: booking.duration_minutes,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
497
    timezone: booking.timezone,
Open commit View diff
497 timezone: booking.timezone,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
498
    meetingMode: booking.meeting_mode,
Open commit View diff
498 meetingMode: booking.meeting_mode,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
499
    status: booking.status,
Open commit View diff
499 status: booking.status,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
500
    paymentStatus: booking.payment_status,
Open commit View diff
500 paymentStatus: booking.payment_status,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
501
    refundStatus: booking.refund_status,
Open commit View diff
501 refundStatus: booking.refund_status,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
502
    canCancel: confirmed && future,
Open commit View diff
502 canCancel: confirmed && future,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
503
    canReschedule: confirmed && future,
Open commit View diff
503 canReschedule: confirmed && future,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
504
  };
Open commit View diff
504 };
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
505
}
Open commit View diff
505 }
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
506
Open commit View diff
506
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
507
async function bookingByPublicId(env: Env, value: unknown): Promise<PaymentBookingRow | null> {
Open commit View diff
507 async function bookingByPublicId(env: Env, value: unknown): Promise<PaymentBookingRow | null> {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
508
  const publicBookingId = normalizePublicBookingId(value);
Open commit View diff
508 const publicBookingId = normalizePublicBookingId(value);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
509
  if (!publicBookingId) return null;
Open commit View diff
509 if (!publicBookingId) return null;
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
510
  const row = await env.DB.prepare('SELECT id FROM bookings WHERE public_booking_id = ?1')
Open commit View diff
510 const row = await env.DB.prepare('SELECT id FROM bookings WHERE public_booking_id = ?1')
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
511
    .bind(publicBookingId)
Open commit View diff
511 .bind(publicBookingId)
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
512
    .first<{ id: string }>();
Open commit View diff
512 .first<{ id: string }>();
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
513
  return row ? paymentBookingById(env, row.id) : null;
Open commit View diff
513 return row ? paymentBookingById(env, row.id) : null;
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
514
}
Open commit View diff
514 }
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
515
Open commit View diff
515
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
516
type ActivityMetadata = Record<string, string | number | boolean | null | undefined>;
Open commit View diff
516 type ActivityMetadata = Record<string, string | number | boolean | null | undefined>;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
517
Open commit View diff
517
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
518
async function logActivity(
Open commit View diff
518 async function logActivity(
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
519
  env: Env,
Open commit View diff
519 env: Env,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
520
  bookingId: string | null,
Open commit View diff
520 bookingId: string | null,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
521
  type: string,
Open commit View diff
521 type: string,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
522
  metadata: ActivityMetadata = {},
Open commit View diff
522 metadata: ActivityMetadata = {},
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
523
  idempotencyKey: string | null = null,
Open commit View diff
523 idempotencyKey: string | null = null,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
524
): Promise<void> {
Open commit View diff
524 ): Promise<void> {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
525
  try {
Open commit View diff
525 try {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
526
    const cleanMetadata = Object.fromEntries(
Open commit View diff
526 const cleanMetadata = Object.fromEntries(
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
527
      Object.entries(metadata).filter(([, value]) => value !== undefined),
Open commit View diff
527 Object.entries(metadata).filter(([, value]) => value !== undefined),
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
528
    );
Open commit View diff
528 );
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
529
    await env.DB.prepare(`
Open commit View diff
529 await env.DB.prepare(`
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
530
      INSERT OR IGNORE INTO activity_events (id, booking_id, type, metadata, idempotency_key)
Open commit View diff
530 INSERT OR IGNORE INTO activity_events (id, booking_id, type, metadata, idempotency_key)
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
531
      VALUES (?1, ?2, ?3, ?4, ?5)
Open commit View diff
531 VALUES (?1, ?2, ?3, ?4, ?5)
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
532
    `).bind(
Open commit View diff
532 `).bind(
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
533
      crypto.randomUUID(),
Open commit View diff
533 crypto.randomUUID(),
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
534
      bookingId,
Open commit View diff
534 bookingId,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
535
      type,
Open commit View diff
535 type,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
536
      Object.keys(cleanMetadata).length ? JSON.stringify(cleanMetadata) : null,
Open commit View diff
536 Object.keys(cleanMetadata).length ? JSON.stringify(cleanMetadata) : null,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
537
      idempotencyKey,
Open commit View diff
537 idempotencyKey,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
538
    ).run();
Open commit View diff
538 ).run();
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
539
  } catch {
Open commit View diff
539 } catch {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
540
    // Activity is observational. A missing/new migration or a feed write must
Open commit View diff
540 // Activity is observational. A missing/new migration or a feed write must
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
541
    // never be allowed to break booking, payment, refund, or calendar flows.
Open commit View diff
541 // never be allowed to break booking, payment, refund, or calendar flows.
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
542
  }
Open commit View diff
542 }
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
543
}
Open commit View diff
543 }
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
544
Open commit View diff
544
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
545
async function adminActivity(env: Env): Promise<Response> {
Open commit View diff
545 async function adminActivity(env: Env): Promise<Response> {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
546
  const settings = await getSettings(env);
Open commit View diff
546 const settings = await getSettings(env);
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
547
  await cleanupStalePendingBookings(env, settings);
Open commit View diff
547 await cleanupStalePendingBookings(env, settings);
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
548
Open commit View diff
548
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
549
  const stats = await env.DB.prepare(`
Open commit View diff
549 const stats = await env.DB.prepare(`
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
550
    WITH facts AS (
Open commit View diff
550 WITH facts AS (
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
551
      SELECT
Open commit View diff
551 SELECT
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
552
        *,
Open commit View diff
552 *,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
553
        CASE
Open commit View diff
553 CASE
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
554
          WHEN status = 'confirmed' THEN 1
Open commit View diff
554 WHEN status = 'confirmed' THEN 1
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
555
          WHEN status = 'cancelled' AND (payment_status <> 'cancelled' OR paid_at IS NOT NULL) THEN 1
Open commit View diff
555 WHEN status = 'cancelled' AND (payment_status <> 'cancelled' OR paid_at IS NOT NULL) THEN 1
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
556
          ELSE 0
Open commit View diff
556 ELSE 0
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
557
        END AS is_booking
Open commit View diff
557 END AS is_booking
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
558
      FROM bookings
Open commit View diff
558 FROM bookings
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
559
    )
Open commit View diff
559 )
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
560
    SELECT
Open commit View diff
560 SELECT
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
561
      COALESCE(SUM(is_booking), 0) AS total_bookings,
Open commit View diff
561 COALESCE(SUM(is_booking), 0) AS total_bookings,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
562
      COALESCE(SUM(CASE WHEN status = 'confirmed' AND julianday(end_time) >= julianday('now') THEN 1 ELSE 0 END), 0) AS upcoming,
Open commit View diff
562 COALESCE(SUM(CASE WHEN status = 'confirmed' AND julianday(end_time) >= julianday('now') THEN 1 ELSE 0 END), 0) AS upcoming,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
563
      COALESCE(SUM(CASE WHEN status = 'confirmed' AND julianday(end_time) < julianday('now') THEN 1 ELSE 0 END), 0) AS completed,
Open commit View diff
563 COALESCE(SUM(CASE WHEN status = 'confirmed' AND julianday(end_time) < julianday('now') THEN 1 ELSE 0 END), 0) AS completed,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
564
      COALESCE(SUM(CASE WHEN status = 'cancelled' AND is_booking = 1 THEN 1 ELSE 0 END), 0) AS cancelled,
Open commit View diff
564 COALESCE(SUM(CASE WHEN status = 'cancelled' AND is_booking = 1 THEN 1 ELSE 0 END), 0) AS cancelled,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
565
      COALESCE(SUM(CASE WHEN is_booking = 1 THEN reschedule_count ELSE 0 END), 0) AS reschedules,
Open commit View diff
565 COALESCE(SUM(CASE WHEN is_booking = 1 THEN reschedule_count ELSE 0 END), 0) AS reschedules,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
566
      COALESCE(SUM(CASE WHEN paid_at IS NOT NULL THEN 1 ELSE 0 END), 0) AS paid_bookings,
Open commit View diff
566 COALESCE(SUM(CASE WHEN paid_at IS NOT NULL THEN 1 ELSE 0 END), 0) AS paid_bookings,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
567
      COALESCE(ROUND(AVG(CASE WHEN status = 'confirmed' THEN duration_minutes END), 1), 0) AS average_minutes,
Open commit View diff
567 COALESCE(ROUND(AVG(CASE WHEN status = 'confirmed' THEN duration_minutes END), 1), 0) AS average_minutes,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
568
      COALESCE(SUM(CASE WHEN status = 'pending' THEN 1 ELSE 0 END), 0) AS open_payment_holds
Open commit View diff
568 COALESCE(SUM(CASE WHEN status = 'pending' THEN 1 ELSE 0 END), 0) AS open_payment_holds
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
569
    FROM facts
Open commit View diff
569 FROM facts
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
570
  `).first<{
Open commit View diff
570 `).first<{
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
571
    total_bookings: number;
Open commit View diff
571 total_bookings: number;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
572
    upcoming: number;
Open commit View diff
572 upcoming: number;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
573
    completed: number;
Open commit View diff
573 completed: number;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
574
    cancelled: number;
Open commit View diff
574 cancelled: number;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
575
    reschedules: number;
Open commit View diff
575 reschedules: number;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
576
    paid_bookings: number;
Open commit View diff
576 paid_bookings: number;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
577
    average_minutes: number;
Open commit View diff
577 average_minutes: number;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
578
    open_payment_holds: number;
Open commit View diff
578 open_payment_holds: number;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
579
  }>();
Open commit View diff
579 }>();
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
580
Open commit View diff
580
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
581
  const money = await env.DB.prepare(`
Open commit View diff
581 const money = await env.DB.prepare(`
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
582
    SELECT
Open commit View diff
582 SELECT
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
583
      lower(payment_currency) AS currency,
Open commit View diff
583 lower(payment_currency) AS currency,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
584
      COALESCE(SUM(CASE WHEN paid_at IS NOT NULL THEN payment_amount ELSE 0 END), 0) AS revenue,
Open commit View diff
584 COALESCE(SUM(CASE WHEN paid_at IS NOT NULL THEN payment_amount ELSE 0 END), 0) AS revenue,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
585
      COALESCE(SUM(CASE WHEN refund_status IN ('succeeded', 'pending') THEN refunded_amount ELSE 0 END), 0) AS refunds
Open commit View diff
585 COALESCE(SUM(CASE WHEN refund_status IN ('succeeded', 'pending') THEN refunded_amount ELSE 0 END), 0) AS refunds
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
586
    FROM bookings
Open commit View diff
586 FROM bookings
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
587
    WHERE payment_currency IS NOT NULL
Open commit View diff
587 WHERE payment_currency IS NOT NULL
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
588
    GROUP BY lower(payment_currency)
Open commit View diff
588 GROUP BY lower(payment_currency)
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
589
    ORDER BY lower(payment_currency)
Open commit View diff
589 ORDER BY lower(payment_currency)
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
590
  `).all<{ currency: string; revenue: number; refunds: number }>();
Open commit View diff
590 `).all<{ currency: string; revenue: number; refunds: number }>();
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
591
Open commit View diff
591
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
592
  const feed = await env.DB.prepare(`
Open commit View diff
592 const feed = await env.DB.prepare(`
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
593
    SELECT
Open commit View diff
593 SELECT
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
594
      a.id,
Open commit View diff
594 a.id,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
595
      a.booking_id,
Open commit View diff
595 a.booking_id,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
596
      a.type,
Open commit View diff
596 a.type,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
597
      a.occurred_at,
Open commit View diff
597 a.occurred_at,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
598
      a.metadata,
Open commit View diff
598 a.metadata,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
599
      b.name,
Open commit View diff
599 b.name,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
600
      b.email,
Open commit View diff
600 b.email,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
601
      b.start_time,
Open commit View diff
601 b.start_time,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
602
      b.end_time,
Open commit View diff
602 b.end_time,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
603
      b.duration_minutes,
Open commit View diff
603 b.duration_minutes,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
604
      b.payment_amount,
Open commit View diff
604 b.payment_amount,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
605
      b.payment_currency
Open commit View diff
605 b.payment_currency
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
606
    FROM activity_events a
Open commit View diff
606 FROM activity_events a
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
607
    LEFT JOIN bookings b ON b.id = a.booking_id
Open commit View diff
607 LEFT JOIN bookings b ON b.id = a.booking_id
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
608
    ORDER BY datetime(a.occurred_at) DESC, a.rowid DESC
Open commit View diff
608 ORDER BY datetime(a.occurred_at) DESC, a.rowid DESC
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
609
    LIMIT 100
Open commit View diff
609 LIMIT 100
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
610
  `).all<{
Open commit View diff
610 `).all<{
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
611
    id: string;
Open commit View diff
611 id: string;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
612
    booking_id: string | null;
Open commit View diff
612 booking_id: string | null;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
613
    type: string;
Open commit View diff
613 type: string;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
614
    occurred_at: string;
Open commit View diff
614 occurred_at: string;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
615
    metadata: string | null;
Open commit View diff
615 metadata: string | null;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
616
    name: string | null;
Open commit View diff
616 name: string | null;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
617
    email: string | null;
Open commit View diff
617 email: string | null;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
618
    start_time: string | null;
Open commit View diff
618 start_time: string | null;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
619
    end_time: string | null;
Open commit View diff
619 end_time: string | null;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
620
    duration_minutes: number | null;
Open commit View diff
620 duration_minutes: number | null;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
621
    payment_amount: number | null;
Open commit View diff
621 payment_amount: number | null;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
622
    payment_currency: string | null;
Open commit View diff
622 payment_currency: string | null;
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
623
  }>();
Open commit View diff
623 }>();
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
624
Open commit View diff
624
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
625
  return json({
Open commit View diff
625 return json({
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
626
    paymentsEnabled: settings.paymentEnabled,
Open commit View diff
626 paymentsEnabled: settings.paymentEnabled,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
627
    stats: stats ?? {
Open commit View diff
627 stats: stats ?? {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
628
      total_bookings: 0,
Open commit View diff
628 total_bookings: 0,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
629
      upcoming: 0,
Open commit View diff
629 upcoming: 0,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
630
      completed: 0,
Open commit View diff
630 completed: 0,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
631
      cancelled: 0,
Open commit View diff
631 cancelled: 0,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
632
      reschedules: 0,
Open commit View diff
632 reschedules: 0,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
633
      paid_bookings: 0,
Open commit View diff
633 paid_bookings: 0,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
634
      average_minutes: 0,
Open commit View diff
634 average_minutes: 0,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
635
      open_payment_holds: 0,
Open commit View diff
635 open_payment_holds: 0,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
636
    },
Open commit View diff
636 },
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
637
    money: settings.paymentEnabled ? (money.results ?? []).map((row) => ({
Open commit View diff
637 money: settings.paymentEnabled ? (money.results ?? []).map((row) => ({
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
638
      currency: row.currency,
Open commit View diff
638 currency: row.currency,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
639
      revenue: Number(row.revenue ?? 0),
Open commit View diff
639 revenue: Number(row.revenue ?? 0),
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
640
      refunds: Number(row.refunds ?? 0),
Open commit View diff
640 refunds: Number(row.refunds ?? 0),
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
641
      net: Number(row.revenue ?? 0) - Number(row.refunds ?? 0),
Open commit View diff
641 net: Number(row.revenue ?? 0) - Number(row.refunds ?? 0),
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
642
    })) : [],
Open commit View diff
642 })) : [],
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
643
    events: (feed.results ?? []).map((row) => {
Open commit View diff
643 events: (feed.results ?? []).map((row) => {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
644
      let metadata: Record<string, unknown> = {};
Open commit View diff
644 let metadata: Record<string, unknown> = {};
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
645
      if (row.metadata) {
Open commit View diff
645 if (row.metadata) {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
646
        try { metadata = JSON.parse(row.metadata) as Record<string, unknown>; } catch { metadata = {}; }
Open commit View diff
646 try { metadata = JSON.parse(row.metadata) as Record<string, unknown>; } catch { metadata = {}; }
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
647
      }
Open commit View diff
647 }
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
648
      return { ...row, metadata };
Open commit View diff
648 return { ...row, metadata };
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
649
    }),
Open commit View diff
649 }),
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
650
  });
Open commit View diff
650 });
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
651
}
Open commit View diff
651 }
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
652
Open commit View diff
652
Alex Nord about 23 hours ago 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
653
async function adminAttendees(env: Env): Promise<Response> {
Open commit View diff
653 async function adminAttendees(env: Env): Promise<Response> {
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
654
  const settings = await getSettings(env);
Open commit View diff
654 const settings = await getSettings(env);
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
655
  await cleanupStalePendingBookings(env, settings);
Open commit View diff
655 await cleanupStalePendingBookings(env, settings);
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
656
Open commit View diff
656
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
657
  const result = await env.DB.prepare(`
Open commit View diff
657 const result = await env.DB.prepare(`
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
658
    WITH facts AS (
Open commit View diff
658 WITH facts AS (
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
659
      SELECT
Open commit View diff
659 SELECT
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
660
        lower(trim(email)) AS email_key,
Open commit View diff
660 lower(trim(email)) AS email_key,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
661
        status,
Open commit View diff
661 status,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
662
        start_time,
Open commit View diff
662 start_time,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
663
        end_time,
Open commit View diff
663 end_time,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
664
        duration_minutes,
Open commit View diff
664 duration_minutes,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
665
        payment_status,
Open commit View diff
665 payment_status,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
666
        paid_at,
Open commit View diff
666 paid_at,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
667
        refund_status,
Open commit View diff
667 refund_status,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
668
        refunded_at,
Open commit View diff
668 refunded_at,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
669
        reschedule_count,
Open commit View diff
669 reschedule_count,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
670
        created_at,
Open commit View diff
670 created_at,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
671
        CASE
Open commit View diff
671 CASE
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
672
          WHEN status = 'confirmed' THEN 1
Open commit View diff
672 WHEN status = 'confirmed' THEN 1
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
673
          WHEN status = 'cancelled' AND (payment_status <> 'cancelled' OR paid_at IS NOT NULL) THEN 1
Open commit View diff
673 WHEN status = 'cancelled' AND (payment_status <> 'cancelled' OR paid_at IS NOT NULL) THEN 1
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
674
          ELSE 0
Open commit View diff
674 ELSE 0
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
675
        END AS is_booking
Open commit View diff
675 END AS is_booking
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
676
      FROM bookings
Open commit View diff
676 FROM bookings
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
677
      WHERE trim(email) <> ''
Open commit View diff
677 WHERE trim(email) <> ''
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
678
    )
Open commit View diff
678 )
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
679
    SELECT
Open commit View diff
679 SELECT
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
680
      f.email_key,
Open commit View diff
680 f.email_key,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
681
      (
Open commit View diff
681 (
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
682
        SELECT b2.email FROM bookings b2
Open commit View diff
682 SELECT b2.email FROM bookings b2
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
683
        WHERE lower(trim(b2.email)) = f.email_key
Open commit View diff
683 WHERE lower(trim(b2.email)) = f.email_key
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
684
          AND (b2.status = 'confirmed' OR (b2.status = 'cancelled' AND (b2.payment_status <> 'cancelled' OR b2.paid_at IS NOT NULL)))
Open commit View diff
684 AND (b2.status = 'confirmed' OR (b2.status = 'cancelled' AND (b2.payment_status <> 'cancelled' OR b2.paid_at IS NOT NULL)))
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
685
        ORDER BY datetime(b2.created_at) DESC, b2.rowid DESC
Open commit View diff
685 ORDER BY datetime(b2.created_at) DESC, b2.rowid DESC
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
686
        LIMIT 1
Open commit View diff
686 LIMIT 1
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
687
      ) AS email,
Open commit View diff
687 ) AS email,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
688
      (
Open commit View diff
688 (
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
689
        SELECT b2.name FROM bookings b2
Open commit View diff
689 SELECT b2.name FROM bookings b2
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
690
        WHERE lower(trim(b2.email)) = f.email_key
Open commit View diff
690 WHERE lower(trim(b2.email)) = f.email_key
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
691
          AND (b2.status = 'confirmed' OR (b2.status = 'cancelled' AND (b2.payment_status <> 'cancelled' OR b2.paid_at IS NOT NULL)))
Open commit View diff
691 AND (b2.status = 'confirmed' OR (b2.status = 'cancelled' AND (b2.payment_status <> 'cancelled' OR b2.paid_at IS NOT NULL)))
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
692
        ORDER BY datetime(b2.created_at) DESC, b2.rowid DESC
Open commit View diff
692 ORDER BY datetime(b2.created_at) DESC, b2.rowid DESC
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
693
        LIMIT 1
Open commit View diff
693 LIMIT 1
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
694
      ) AS name,
Open commit View diff
694 ) AS name,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
695
      COALESCE(SUM(f.is_booking), 0) AS total_bookings,
Open commit View diff
695 COALESCE(SUM(f.is_booking), 0) AS total_bookings,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
696
      COALESCE(SUM(CASE WHEN f.status = 'confirmed' AND julianday(f.end_time) >= julianday('now') THEN 1 ELSE 0 END), 0) AS upcoming,
Open commit View diff
696 COALESCE(SUM(CASE WHEN f.status = 'confirmed' AND julianday(f.end_time) >= julianday('now') THEN 1 ELSE 0 END), 0) AS upcoming,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
697
      COALESCE(SUM(CASE WHEN f.status = 'confirmed' AND julianday(f.end_time) < julianday('now') THEN 1 ELSE 0 END), 0) AS completed,
Open commit View diff
697 COALESCE(SUM(CASE WHEN f.status = 'confirmed' AND julianday(f.end_time) < julianday('now') THEN 1 ELSE 0 END), 0) AS completed,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
698
      COALESCE(SUM(CASE WHEN f.status = 'cancelled' AND f.is_booking = 1 THEN 1 ELSE 0 END), 0) AS cancelled,
Open commit View diff
698 COALESCE(SUM(CASE WHEN f.status = 'cancelled' AND f.is_booking = 1 THEN 1 ELSE 0 END), 0) AS cancelled,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
699
      COALESCE(SUM(CASE WHEN f.is_booking = 1 THEN f.reschedule_count ELSE 0 END), 0) AS reschedules,
Open commit View diff
699 COALESCE(SUM(CASE WHEN f.is_booking = 1 THEN f.reschedule_count ELSE 0 END), 0) AS reschedules,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
700
      COALESCE(SUM(CASE WHEN f.is_booking = 1 AND f.paid_at IS NOT NULL THEN 1 ELSE 0 END), 0) AS paid_bookings,
Open commit View diff
700 COALESCE(SUM(CASE WHEN f.is_booking = 1 AND f.paid_at IS NOT NULL THEN 1 ELSE 0 END), 0) AS paid_bookings,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
701
      COALESCE(SUM(CASE WHEN f.is_booking = 1 AND (f.refunded_at IS NOT NULL OR f.refund_status = 'succeeded') THEN 1 ELSE 0 END), 0) AS refunded_bookings,
Open commit View diff
701 COALESCE(SUM(CASE WHEN f.is_booking = 1 AND (f.refunded_at IS NOT NULL OR f.refund_status = 'succeeded') THEN 1 ELSE 0 END), 0) AS refunded_bookings,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
702
      COALESCE(SUM(CASE WHEN f.is_booking = 1 THEN f.duration_minutes ELSE 0 END), 0) AS total_minutes,
Open commit View diff
702 COALESCE(SUM(CASE WHEN f.is_booking = 1 THEN f.duration_minutes ELSE 0 END), 0) AS total_minutes,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
703
      COALESCE(ROUND(AVG(CASE WHEN f.is_booking = 1 THEN f.duration_minutes END), 1), 0) AS average_minutes,
Open commit View diff
703 COALESCE(ROUND(AVG(CASE WHEN f.is_booking = 1 THEN f.duration_minutes END), 1), 0) AS average_minutes,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
704
      MIN(CASE WHEN f.is_booking = 1 THEN f.created_at END) AS first_booked_at,
Open commit View diff
704 MIN(CASE WHEN f.is_booking = 1 THEN f.created_at END) AS first_booked_at,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
705
      MAX(CASE WHEN f.is_booking = 1 THEN f.created_at END) AS last_booked_at
Open commit View diff
705 MAX(CASE WHEN f.is_booking = 1 THEN f.created_at END) AS last_booked_at
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
706
    FROM facts f
Open commit View diff
706 FROM facts f
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
707
    GROUP BY f.email_key
Open commit View diff
707 GROUP BY f.email_key
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
708
    HAVING SUM(f.is_booking) > 0
Open commit View diff
708 HAVING SUM(f.is_booking) > 0
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
709
    ORDER BY MAX(CASE WHEN f.is_booking = 1 THEN datetime(f.created_at) END) DESC
Open commit View diff
709 ORDER BY MAX(CASE WHEN f.is_booking = 1 THEN datetime(f.created_at) END) DESC
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
710
    LIMIT 500
Open commit View diff
710 LIMIT 500
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
711
  `).all<{
Open commit View diff
711 `).all<{
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
712
    email_key: string;
Open commit View diff
712 email_key: string;
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
713
    email: string;
Open commit View diff
713 email: string;
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
714
    name: string;
Open commit View diff
714 name: string;
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
715
    total_bookings: number;
Open commit View diff
715 total_bookings: number;
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
716
    upcoming: number;
Open commit View diff
716 upcoming: number;
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
717
    completed: number;
Open commit View diff
717 completed: number;
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
718
    cancelled: number;
Open commit View diff
718 cancelled: number;
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
719
    reschedules: number;
Open commit View diff
719 reschedules: number;
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
720
    paid_bookings: number;
Open commit View diff
720 paid_bookings: number;
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
721
    refunded_bookings: number;
Open commit View diff
721 refunded_bookings: number;
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
722
    total_minutes: number;
Open commit View diff
722 total_minutes: number;
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
723
    average_minutes: number;
Open commit View diff
723 average_minutes: number;
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
724
    first_booked_at: string | null;
Open commit View diff
724 first_booked_at: string | null;
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
725
    last_booked_at: string | null;
Open commit View diff
725 last_booked_at: string | null;
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
726
  }>();
Open commit View diff
726 }>();
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
727
Open commit View diff
727
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
728
  return json({
Open commit View diff
728 return json({
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
729
    paymentsEnabled: settings.paymentEnabled,
Open commit View diff
729 paymentsEnabled: settings.paymentEnabled,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
730
    attendees: (result.results ?? []).map((row) => ({
Open commit View diff
730 attendees: (result.results ?? []).map((row) => ({
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
731
      email: row.email,
Open commit View diff
731 email: row.email,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
732
      name: row.name,
Open commit View diff
732 name: row.name,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
733
      total_bookings: Number(row.total_bookings ?? 0),
Open commit View diff
733 total_bookings: Number(row.total_bookings ?? 0),
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
734
      upcoming: Number(row.upcoming ?? 0),
Open commit View diff
734 upcoming: Number(row.upcoming ?? 0),
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
735
      completed: Number(row.completed ?? 0),
Open commit View diff
735 completed: Number(row.completed ?? 0),
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
736
      cancelled: Number(row.cancelled ?? 0),
Open commit View diff
736 cancelled: Number(row.cancelled ?? 0),
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
737
      reschedules: Number(row.reschedules ?? 0),
Open commit View diff
737 reschedules: Number(row.reschedules ?? 0),
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
738
      paid_bookings: Number(row.paid_bookings ?? 0),
Open commit View diff
738 paid_bookings: Number(row.paid_bookings ?? 0),
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
739
      refunded_bookings: Number(row.refunded_bookings ?? 0),
Open commit View diff
739 refunded_bookings: Number(row.refunded_bookings ?? 0),
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
740
      total_minutes: Number(row.total_minutes ?? 0),
Open commit View diff
740 total_minutes: Number(row.total_minutes ?? 0),
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
741
      average_minutes: Number(row.average_minutes ?? 0),
Open commit View diff
741 average_minutes: Number(row.average_minutes ?? 0),
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
742
      first_booked_at: row.first_booked_at,
Open commit View diff
742 first_booked_at: row.first_booked_at,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
743
      last_booked_at: row.last_booked_at,
Open commit View diff
743 last_booked_at: row.last_booked_at,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
744
    })),
Open commit View diff
744 })),
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
745
  });
Open commit View diff
745 });
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
746
}
Open commit View diff
746 }
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
747
Open commit View diff
747
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
748
async function adminAttendeeBookings(env: Env, email: string): Promise<Response> {
Open commit View diff
748 async function adminAttendeeBookings(env: Env, email: string): Promise<Response> {
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
749
  const normalizedEmail = email.trim().toLowerCase();
Open commit View diff
749 const normalizedEmail = email.trim().toLowerCase();
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
750
  if (!normalizedEmail || normalizedEmail.length > 320 || !normalizedEmail.includes('@')) {
Open commit View diff
750 if (!normalizedEmail || normalizedEmail.length > 320 || !normalizedEmail.includes('@')) {
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
751
    return json({ error: 'Invalid attendee email.' }, 400);
Open commit View diff
751 return json({ error: 'Invalid attendee email.' }, 400);
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
752
  }
Open commit View diff
752 }
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
753
Open commit View diff
753
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
754
  const result = await env.DB.prepare(`
Open commit View diff
754 const result = await env.DB.prepare(`
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
755
    SELECT id, public_booking_id, name, email, start_time, end_time, duration_minutes,
Open commit View diff
755 SELECT id, public_booking_id, name, email, start_time, end_time, duration_minutes,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
756
           meeting_mode, status, meet_url, created_at,
Open commit View diff
756 meeting_mode, status, meet_url, created_at,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
757
           cancelled_at, calendar_provider, calendar_sync_status,
Open commit View diff
757 cancelled_at, calendar_provider, calendar_sync_status,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
758
           calendar_sync_error, calendar_sync_updated_at,
Open commit View diff
758 calendar_sync_error, calendar_sync_updated_at,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
759
           payment_status, payment_amount, payment_currency,
Open commit View diff
759 payment_status, payment_amount, payment_currency,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
760
           stripe_checkout_session_id, stripe_payment_intent_id, paid_at,
Open commit View diff
760 stripe_checkout_session_id, stripe_payment_intent_id, paid_at,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
761
           rescheduled_at, reschedule_count, proposed_start_time, proposed_end_time,
Open commit View diff
761 rescheduled_at, reschedule_count, proposed_start_time, proposed_end_time,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
762
           proposed_at, proposal_status, refund_status, stripe_refund_id,
Open commit View diff
762 proposed_at, proposal_status, refund_status, stripe_refund_id,
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
763
           refunded_amount, refunded_at
Open commit View diff
763 refunded_amount, refunded_at
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
764
    FROM bookings
Open commit View diff
764 FROM bookings
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
765
    WHERE lower(trim(email)) = ?1
Open commit View diff
765 WHERE lower(trim(email)) = ?1
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
766
      AND (
Open commit View diff
766 AND (
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
767
        status = 'confirmed'
Open commit View diff
767 status = 'confirmed'
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
768
        OR (status = 'cancelled' AND (payment_status <> 'cancelled' OR paid_at IS NOT NULL))
Open commit View diff
768 OR (status = 'cancelled' AND (payment_status <> 'cancelled' OR paid_at IS NOT NULL))
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
769
      )
Open commit View diff
769 )
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
770
    ORDER BY datetime(created_at) DESC, start_time DESC
Open commit View diff
770 ORDER BY datetime(created_at) DESC, start_time DESC
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
771
    LIMIT 100
Open commit View diff
771 LIMIT 100
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
772
  `).bind(normalizedEmail).all();
Open commit View diff
772 `).bind(normalizedEmail).all();
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
773
  return json({ bookings: result.results ?? [] });
Open commit View diff
773 return json({ bookings: result.results ?? [] });
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
774
}
Open commit View diff
774 }
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
775
Open commit View diff
775
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
776
async function paymentBookingById(env: Env, bookingId: string): Promise<PaymentBookingRow | null> {
Open commit View diff
776 async function paymentBookingById(env: Env, bookingId: string): Promise<PaymentBookingRow | null> {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
777
  return env.DB.prepare(`
Open commit View diff
777 return env.DB.prepare(`
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
778
    SELECT id, public_booking_id, name, email, phone, message, start_time, end_time, duration_minutes,
Open commit View diff
778 SELECT id, public_booking_id, name, email, phone, message, start_time, end_time, duration_minutes,
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
779
           timezone, meeting_mode, status, google_event_id, meet_url, payment_status,
Open commit View diff
779 timezone, meeting_mode, status, google_event_id, meet_url, payment_status,
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
780
           payment_amount, payment_currency, stripe_checkout_session_id, stripe_payment_intent_id, paid_at,
Open commit View diff
780 payment_amount, payment_currency, stripe_checkout_session_id, stripe_payment_intent_id, paid_at,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
781
           rescheduled_at, reschedule_count, proposed_start_time, proposed_end_time, proposed_at,
Open commit View diff
781 rescheduled_at, reschedule_count, proposed_start_time, proposed_end_time, proposed_at,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
782
           proposal_status, proposal_token_hash, refund_status, stripe_refund_id, refunded_amount,
Open commit View diff
782 proposal_status, proposal_token_hash, refund_status, stripe_refund_id, refunded_amount,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
783
           refunded_at, updated_at
Open commit View diff
783 refunded_at, updated_at
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
784
    FROM bookings
Open commit View diff
784 FROM bookings
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
785
    WHERE id = ?1
Open commit View diff
785 WHERE id = ?1
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
786
  `).bind(bookingId).first<PaymentBookingRow>();
Open commit View diff
786 `).bind(bookingId).first<PaymentBookingRow>();
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
787
}
Open commit View diff
787 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
788
Open commit View diff
788
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
789
async function releasePendingBooking(env: Env, settings: AppSettings, bookingId: string): Promise<void> {
Open commit View diff
789 async function releasePendingBooking(env: Env, settings: AppSettings, bookingId: string): Promise<void> {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
790
  const booking = await paymentBookingById(env, bookingId);
Open commit View diff
790 const booking = await paymentBookingById(env, bookingId);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
791
  if (!booking || booking.status !== 'pending') return;
Open commit View diff
791 if (!booking || booking.status !== 'pending') return;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
792
  if (booking.google_event_id) {
Open commit View diff
792 if (booking.google_event_id) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
793
    let lastError: unknown = null;
Open commit View diff
793 let lastError: unknown = null;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
794
    for (let attempt = 0; attempt < 3; attempt += 1) {
Open commit View diff
794 for (let attempt = 0; attempt < 3; attempt += 1) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
795
      try {
Open commit View diff
795 try {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
796
        await deleteCalendarEvent(env, settings, booking.google_event_id);
Open commit View diff
796 await deleteCalendarEvent(env, settings, booking.google_event_id);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
797
        lastError = null;
Open commit View diff
797 lastError = null;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
798
        break;
Open commit View diff
798 break;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
799
      } catch (error) {
Open commit View diff
799 } catch (error) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
800
        lastError = error;
Open commit View diff
800 lastError = error;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
801
        if (attempt < 2) await new Promise((resolve) => setTimeout(resolve, 150 * (attempt + 1)));
Open commit View diff
801 if (attempt < 2) await new Promise((resolve) => setTimeout(resolve, 150 * (attempt + 1)));
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
802
      }
Open commit View diff
802 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
803
    }
Open commit View diff
803 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
804
    if (lastError) throw lastError;
Open commit View diff
804 if (lastError) throw lastError;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
805
  }
Open commit View diff
805 }
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
806
  // Keep a cancelled audit row instead of deleting the booking. Besides making
Open commit View diff
806 // Keep a cancelled audit row instead of deleting the booking. Besides making
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
807
  // released holds visible in Admin history, this preserves the Stripe session id
Open commit View diff
807 // released holds visible in Admin history, this preserves the Stripe session id
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
808
  // if a stale Checkout from another Stripe mode ever reports back later.
Open commit View diff
808 // if a stale Checkout from another Stripe mode ever reports back later.
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
809
  await env.DB.batch([
Open commit View diff
809 await env.DB.batch([
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
810
    env.DB.prepare('DELETE FROM slot_locks WHERE booking_id = ?1').bind(bookingId),
Open commit View diff
810 env.DB.prepare('DELETE FROM slot_locks WHERE booking_id = ?1').bind(bookingId),
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
811
    env.DB.prepare(`
Open commit View diff
811 env.DB.prepare(`
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
812
      UPDATE bookings
Open commit View diff
812 UPDATE bookings
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
813
      SET status = 'cancelled',
Open commit View diff
813 SET status = 'cancelled',
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
814
          payment_status = CASE WHEN payment_status = 'paid' THEN 'paid' ELSE 'cancelled' END,
Open commit View diff
814 payment_status = CASE WHEN payment_status = 'paid' THEN 'paid' ELSE 'cancelled' END,
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
815
          google_event_id = NULL,
Open commit View diff
815 google_event_id = NULL,
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
816
          meet_url = NULL,
Open commit View diff
816 meet_url = NULL,
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
817
          cancelled_at = COALESCE(cancelled_at, datetime('now')),
Open commit View diff
817 cancelled_at = COALESCE(cancelled_at, datetime('now')),
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
818
          calendar_sync_status = 'cancelled',
Open commit View diff
818 calendar_sync_status = 'cancelled',
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
819
          calendar_sync_error = NULL,
Open commit View diff
819 calendar_sync_error = NULL,
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
820
          calendar_sync_updated_at = datetime('now'),
Open commit View diff
820 calendar_sync_updated_at = datetime('now'),
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
821
          updated_at = datetime('now')
Open commit View diff
821 updated_at = datetime('now')
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
822
      WHERE id = ?1 AND status = 'pending'
Open commit View diff
822 WHERE id = ?1 AND status = 'pending'
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
823
    `).bind(bookingId),
Open commit View diff
823 `).bind(bookingId),
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
824
  ]);
Open commit View diff
824 ]);
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
825
  await logActivity(env, bookingId, 'payment_hold_released', {
Open commit View diff
825 await logActivity(env, bookingId, 'payment_hold_released', {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
826
    start: booking.start_time,
Open commit View diff
826 start: booking.start_time,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
827
    end: booking.end_time,
Open commit View diff
827 end: booking.end_time,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
828
    amount: booking.payment_amount,
Open commit View diff
828 amount: booking.payment_amount,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
829
    currency: booking.payment_currency,
Open commit View diff
829 currency: booking.payment_currency,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
830
  }, `booking:${bookingId}:hold-released`);
Open commit View diff
830 }, `booking:${bookingId}:hold-released`);
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
831
}
Open commit View diff
831 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
832
Open commit View diff
832
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
833
async function recordPaidSession(
Open commit View diff
833 async function recordPaidSession(
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
834
  env: Env,
Open commit View diff
834 env: Env,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
835
  bookingId: string,
Open commit View diff
835 bookingId: string,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
836
  session: StripeCheckoutSession,
Open commit View diff
836 session: StripeCheckoutSession,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
837
): Promise<void> {
Open commit View diff
837 ): Promise<void> {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
838
  await env.DB.prepare(`
Open commit View diff
838 await env.DB.prepare(`
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
839
    UPDATE bookings
Open commit View diff
839 UPDATE bookings
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
840
    SET payment_status = 'paid',
Open commit View diff
840 SET payment_status = 'paid',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
841
        payment_amount = COALESCE(?1, payment_amount),
Open commit View diff
841 payment_amount = COALESCE(?1, payment_amount),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
842
        payment_currency = COALESCE(?2, payment_currency),
Open commit View diff
842 payment_currency = COALESCE(?2, payment_currency),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
843
        stripe_checkout_session_id = COALESCE(stripe_checkout_session_id, ?3),
Open commit View diff
843 stripe_checkout_session_id = COALESCE(stripe_checkout_session_id, ?3),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
844
        stripe_payment_intent_id = ?4,
Open commit View diff
844 stripe_payment_intent_id = ?4,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
845
        paid_at = COALESCE(paid_at, datetime('now'))
Open commit View diff
845 paid_at = COALESCE(paid_at, datetime('now'))
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
846
    WHERE id = ?5
Open commit View diff
846 WHERE id = ?5
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
847
      AND (stripe_checkout_session_id IS NULL OR stripe_checkout_session_id = ?3)
Open commit View diff
847 AND (stripe_checkout_session_id IS NULL OR stripe_checkout_session_id = ?3)
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
848
  `).bind(
Open commit View diff
848 `).bind(
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
849
    session.amount_total ?? null,
Open commit View diff
849 session.amount_total ?? null,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
850
    session.currency ?? null,
Open commit View diff
850 session.currency ?? null,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
851
    session.id,
Open commit View diff
851 session.id,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
852
    stripePaymentIntentId(session),
Open commit View diff
852 stripePaymentIntentId(session),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
853
    bookingId,
Open commit View diff
853 bookingId,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
854
  ).run();
Open commit View diff
854 ).run();
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
855
  await logActivity(env, bookingId, 'payment_received', {
Open commit View diff
855 await logActivity(env, bookingId, 'payment_received', {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
856
    amount: session.amount_total ?? null,
Open commit View diff
856 amount: session.amount_total ?? null,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
857
    currency: session.currency ?? null,
Open commit View diff
857 currency: session.currency ?? null,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
858
  }, `booking:${bookingId}:paid`);
Open commit View diff
858 }, `booking:${bookingId}:paid`);
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
859
}
Open commit View diff
859 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
860
Open commit View diff
860
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
861
async function fulfillPaidBooking(env: Env, bookingId: string): Promise<PaymentBookingRow> {
Open commit View diff
861 async function fulfillPaidBooking(env: Env, bookingId: string): Promise<PaymentBookingRow> {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
862
  let booking = await paymentBookingById(env, bookingId);
Open commit View diff
862 let booking = await paymentBookingById(env, bookingId);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
863
  if (!booking) throw new Error('Paid booking record was not found.');
Open commit View diff
863 if (!booking) throw new Error('Paid booking record was not found.');
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
864
  if (booking.status === 'confirmed') return booking;
Open commit View diff
864 if (booking.status === 'confirmed') return booking;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
865
  if (booking.status === 'confirming') {
Open commit View diff
865 if (booking.status === 'confirming') {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
866
    await env.DB.prepare(`
Open commit View diff
866 await env.DB.prepare(`
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
867
      UPDATE bookings
Open commit View diff
867 UPDATE bookings
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
868
      SET status = 'pending', updated_at = datetime('now')
Open commit View diff
868 SET status = 'pending', updated_at = datetime('now')
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
869
      WHERE id = ?1
Open commit View diff
869 WHERE id = ?1
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
870
        AND status = 'confirming'
Open commit View diff
870 AND status = 'confirming'
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
871
        AND updated_at < datetime('now', '-2 minutes')
Open commit View diff
871 AND updated_at < datetime('now', '-2 minutes')
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
872
    `).bind(booking.id).run();
Open commit View diff
872 `).bind(booking.id).run();
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
873
    booking = await paymentBookingById(env, booking.id);
Open commit View diff
873 booking = await paymentBookingById(env, booking.id);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
874
    if (booking?.status === 'confirmed') return booking;
Open commit View diff
874 if (booking?.status === 'confirmed') return booking;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
875
    if (booking?.status === 'confirming') {
Open commit View diff
875 if (booking?.status === 'confirming') {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
876
      throw new Error('Paid booking confirmation is already in progress.');
Open commit View diff
876 throw new Error('Paid booking confirmation is already in progress.');
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
877
    }
Open commit View diff
877 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
878
    if (!booking) throw new Error('Paid booking record was not found.');
Open commit View diff
878 if (!booking) throw new Error('Paid booking record was not found.');
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
879
  }
Open commit View diff
879 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
880
  if (booking.status !== 'pending' || booking.payment_status !== 'paid') {
Open commit View diff
880 if (booking.status !== 'pending' || booking.payment_status !== 'paid') {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
881
    throw new Error('Booking is not ready for paid confirmation.');
Open commit View diff
881 throw new Error('Booking is not ready for paid confirmation.');
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
882
  }
Open commit View diff
882 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
883
Open commit View diff
883
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
884
  // Claim fulfillment before touching Google. This keeps the Stripe webhook and
Open commit View diff
884 // Claim fulfillment before touching Google. This keeps the Stripe webhook and
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
885
  // the browser return-page fallback from both sending the attendee invitation.
Open commit View diff
885 // the browser return-page fallback from both sending the attendee invitation.
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
886
  const claim = await env.DB.prepare(`
Open commit View diff
886 const claim = await env.DB.prepare(`
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
887
    UPDATE bookings
Open commit View diff
887 UPDATE bookings
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
888
    SET status = 'confirming',
Open commit View diff
888 SET status = 'confirming',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
889
        calendar_sync_status = 'confirming',
Open commit View diff
889 calendar_sync_status = 'confirming',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
890
        calendar_sync_error = NULL,
Open commit View diff
890 calendar_sync_error = NULL,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
891
        calendar_sync_updated_at = datetime('now'),
Open commit View diff
891 calendar_sync_updated_at = datetime('now'),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
892
        updated_at = datetime('now')
Open commit View diff
892 updated_at = datetime('now')
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
893
    WHERE id = ?1
Open commit View diff
893 WHERE id = ?1
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
894
      AND status = 'pending'
Open commit View diff
894 AND status = 'pending'
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
895
      AND payment_status = 'paid'
Open commit View diff
895 AND payment_status = 'paid'
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
896
  `).bind(booking.id).run();
Open commit View diff
896 `).bind(booking.id).run();
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
897
  const claimed = ((claim as unknown as { meta?: { changes?: number } }).meta?.changes ?? 0) > 0;
Open commit View diff
897 const claimed = ((claim as unknown as { meta?: { changes?: number } }).meta?.changes ?? 0) > 0;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
898
  if (!claimed) {
Open commit View diff
898 if (!claimed) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
899
    booking = await paymentBookingById(env, booking.id);
Open commit View diff
899 booking = await paymentBookingById(env, booking.id);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
900
    if (booking?.status === 'confirmed') return booking;
Open commit View diff
900 if (booking?.status === 'confirmed') return booking;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
901
    throw new Error('Paid booking confirmation is already in progress.');
Open commit View diff
901 throw new Error('Paid booking confirmation is already in progress.');
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
902
  }
Open commit View diff
902 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
903
Open commit View diff
903
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
904
  const settings = await getSettings(env);
Open commit View diff
904 const settings = await getSettings(env);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
905
  try {
Open commit View diff
905 try {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
906
    const created = booking.google_event_id
Open commit View diff
906 const created = booking.google_event_id
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
907
      ? await confirmCalendarHold(env, settings, booking.google_event_id, {
Open commit View diff
907 ? await confirmCalendarHold(env, settings, booking.google_event_id, {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
908
          id: booking.id,
Open commit View diff
908 id: booking.id,
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
909
          publicBookingId: booking.public_booking_id ?? booking.id,
Open commit View diff
909 publicBookingId: booking.public_booking_id ?? booking.id,
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
910
          name: booking.name,
Open commit View diff
910 name: booking.name,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
911
          email: booking.email,
Open commit View diff
911 email: booking.email,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
912
          phone: booking.phone ?? undefined,
Open commit View diff
912 phone: booking.phone ?? undefined,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
913
          message: booking.message ?? undefined,
Open commit View diff
913 message: booking.message ?? undefined,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
914
          start: booking.start_time,
Open commit View diff
914 start: booking.start_time,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
915
          end: booking.end_time,
Open commit View diff
915 end: booking.end_time,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
916
          meetingMode: booking.meeting_mode,
Open commit View diff
916 meetingMode: booking.meeting_mode,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
917
        })
Open commit View diff
917 })
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
918
      : await createCalendarEvent(env, settings, {
Open commit View diff
918 : await createCalendarEvent(env, settings, {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
919
          id: booking.id,
Open commit View diff
919 id: booking.id,
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
920
          publicBookingId: booking.public_booking_id ?? booking.id,
Open commit View diff
920 publicBookingId: booking.public_booking_id ?? booking.id,
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
921
          name: booking.name,
Open commit View diff
921 name: booking.name,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
922
          email: booking.email,
Open commit View diff
922 email: booking.email,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
923
          phone: booking.phone ?? undefined,
Open commit View diff
923 phone: booking.phone ?? undefined,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
924
          message: booking.message ?? undefined,
Open commit View diff
924 message: booking.message ?? undefined,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
925
          start: booking.start_time,
Open commit View diff
925 start: booking.start_time,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
926
          end: booking.end_time,
Open commit View diff
926 end: booking.end_time,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
927
          meetingMode: booking.meeting_mode,
Open commit View diff
927 meetingMode: booking.meeting_mode,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
928
        });
Open commit View diff
928 });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
929
Open commit View diff
929
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
930
    await env.DB.batch([
Open commit View diff
930 await env.DB.batch([
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
931
      env.DB.prepare(`
Open commit View diff
931 env.DB.prepare(`
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
932
        UPDATE bookings
Open commit View diff
932 UPDATE bookings
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
933
        SET status = 'confirmed',
Open commit View diff
933 SET status = 'confirmed',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
934
            google_event_id = ?1,
Open commit View diff
934 google_event_id = ?1,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
935
            meet_url = ?2,
Open commit View diff
935 meet_url = ?2,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
936
            calendar_sync_status = 'synced',
Open commit View diff
936 calendar_sync_status = 'synced',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
937
            calendar_sync_error = NULL,
Open commit View diff
937 calendar_sync_error = NULL,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
938
            calendar_sync_updated_at = datetime('now'),
Open commit View diff
938 calendar_sync_updated_at = datetime('now'),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
939
            updated_at = datetime('now')
Open commit View diff
939 updated_at = datetime('now')
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
940
        WHERE id = ?3
Open commit View diff
940 WHERE id = ?3
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
941
      `).bind(created.eventId, created.meetUrl, booking.id),
Open commit View diff
941 `).bind(created.eventId, created.meetUrl, booking.id),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
942
      env.DB.prepare('UPDATE slot_locks SET expires_at = ?1 WHERE booking_id = ?2')
Open commit View diff
942 env.DB.prepare('UPDATE slot_locks SET expires_at = ?1 WHERE booking_id = ?2')
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
943
        .bind(Date.now() + 10 * 60_000, booking.id),
Open commit View diff
943 .bind(Date.now() + 10 * 60_000, booking.id),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
944
    ]);
Open commit View diff
944 ]);
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
945
    await logActivity(env, booking.id, 'booking_confirmed', {
Open commit View diff
945 await logActivity(env, booking.id, 'booking_confirmed', {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
946
      start: booking.start_time,
Open commit View diff
946 start: booking.start_time,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
947
      end: booking.end_time,
Open commit View diff
947 end: booking.end_time,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
948
      duration: booking.duration_minutes,
Open commit View diff
948 duration: booking.duration_minutes,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
949
      paid: true,
Open commit View diff
949 paid: true,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
950
    }, `booking:${booking.id}:confirmed`);
Open commit View diff
950 }, `booking:${booking.id}:confirmed`);
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
951
  } catch (error) {
Open commit View diff
951 } catch (error) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
952
    await env.DB.prepare(`
Open commit View diff
952 await env.DB.prepare(`
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
953
      UPDATE bookings
Open commit View diff
953 UPDATE bookings
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
954
      SET status = 'pending',
Open commit View diff
954 SET status = 'pending',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
955
          calendar_sync_status = 'failed',
Open commit View diff
955 calendar_sync_status = 'failed',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
956
          calendar_sync_error = ?1,
Open commit View diff
956 calendar_sync_error = ?1,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
957
          calendar_sync_updated_at = datetime('now'),
Open commit View diff
957 calendar_sync_updated_at = datetime('now'),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
958
          updated_at = datetime('now')
Open commit View diff
958 updated_at = datetime('now')
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
959
      WHERE id = ?2
Open commit View diff
959 WHERE id = ?2
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
960
        AND status = 'confirming'
Open commit View diff
960 AND status = 'confirming'
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
961
    `).bind(privateCalendarError(error), booking.id).run().catch(() => undefined);
Open commit View diff
961 `).bind(privateCalendarError(error), booking.id).run().catch(() => undefined);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
962
    throw error;
Open commit View diff
962 throw error;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
963
  }
Open commit View diff
963 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
964
Open commit View diff
964
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
965
  const confirmed = await paymentBookingById(env, booking.id);
Open commit View diff
965 const confirmed = await paymentBookingById(env, booking.id);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
966
  if (!confirmed) throw new Error('Confirmed booking record disappeared.');
Open commit View diff
966 if (!confirmed) throw new Error('Confirmed booking record disappeared.');
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
967
  return confirmed;
Open commit View diff
967 return confirmed;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
968
}
Open commit View diff
968 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
969
Open commit View diff
969
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
970
async function cleanupStalePendingBookings(env: Env, settings: AppSettings): Promise<void> {
Open commit View diff
970 async function cleanupStalePendingBookings(env: Env, settings: AppSettings): Promise<void> {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
971
  const stale = await env.DB.prepare(`
Open commit View diff
971 const stale = await env.DB.prepare(`
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
972
    SELECT id, stripe_checkout_session_id
Open commit View diff
972 SELECT id, stripe_checkout_session_id
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
973
    FROM bookings
Open commit View diff
973 FROM bookings
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
974
    WHERE status = 'pending'
Open commit View diff
974 WHERE status = 'pending'
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
975
      AND created_at < datetime('now', '-35 minutes')
Open commit View diff
975 AND created_at < datetime('now', '-35 minutes')
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
976
    ORDER BY created_at
Open commit View diff
976 ORDER BY created_at
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
977
    LIMIT 5
Open commit View diff
977 LIMIT 5
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
978
  `).all<{ id: string; stripe_checkout_session_id: string | null }>();
Open commit View diff
978 `).all<{ id: string; stripe_checkout_session_id: string | null }>();
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
979
Open commit View diff
979
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
980
  for (const row of stale.results ?? []) {
Open commit View diff
980 for (const row of stale.results ?? []) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
981
    if (row.stripe_checkout_session_id && stripeConfigured(env)) {
Open commit View diff
981 if (row.stripe_checkout_session_id && stripeConfigured(env)) {
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
982
      const sessionMode = stripeCheckoutSessionMode(row.stripe_checkout_session_id);
Open commit View diff
982 const sessionMode = stripeCheckoutSessionMode(row.stripe_checkout_session_id);
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
983
      const configuredMode = stripeMode(env);
Open commit View diff
983 const configuredMode = stripeMode(env);
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
984
      // These rows are already older than 35 minutes and Slot creates Checkout
Open commit View diff
984 // These rows are already older than 35 minutes and Slot creates Checkout
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
985
      // sessions with a 30-minute expires_at. If the Worker has since switched
Open commit View diff
985 // sessions with a 30-minute expires_at. If the Worker has since switched
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
986
      // Stripe modes, the current key cannot retrieve the old session, but it is
Open commit View diff
986 // Stripe modes, the current key cannot retrieve the old session, but it is
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
987
      // safe to release the expired local hold instead of keeping it forever.
Open commit View diff
987 // safe to release the expired local hold instead of keeping it forever.
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
988
      const modeMismatch = sessionMode !== 'unknown'
Open commit View diff
988 const modeMismatch = sessionMode !== 'unknown'
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
989
        && configuredMode !== 'unknown'
Open commit View diff
989 && configuredMode !== 'unknown'
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
990
        && sessionMode !== configuredMode;
Open commit View diff
990 && sessionMode !== configuredMode;
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
991
      if (!modeMismatch) {
Open commit View diff
991 if (!modeMismatch) {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
992
        try {
Open commit View diff
992 try {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
993
          const session = await retrieveStripeCheckoutSession(env, row.stripe_checkout_session_id);
Open commit View diff
993 const session = await retrieveStripeCheckoutSession(env, row.stripe_checkout_session_id);
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
994
          if (session.payment_status === 'paid') {
Open commit View diff
994 if (session.payment_status === 'paid') {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
995
            await recordPaidSession(env, row.id, session);
Open commit View diff
995 await recordPaidSession(env, row.id, session);
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
996
            await fulfillPaidBooking(env, row.id);
Open commit View diff
996 await fulfillPaidBooking(env, row.id);
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
997
            continue;
Open commit View diff
997 continue;
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
998
          }
Open commit View diff
998 }
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
999
          if (session.status === 'open') continue;
Open commit View diff
999 if (session.status === 'open') continue;
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1000
        } catch {
Open commit View diff
1000 } catch {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1001
          // Do not destroy a reservation when Stripe cannot be checked safely.
Open commit View diff
1001 // Do not destroy a reservation when Stripe cannot be checked safely.
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1002
          continue;
Open commit View diff
1002 continue;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1003
        }
Open commit View diff
1003 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1004
      }
Open commit View diff
1004 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1005
    }
Open commit View diff
1005 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1006
    await releasePendingBooking(env, settings, row.id).catch(() => undefined);
Open commit View diff
1006 await releasePendingBooking(env, settings, row.id).catch(() => undefined);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1007
  }
Open commit View diff
1007 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1008
}
Open commit View diff
1008 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1009
Open commit View diff
1009
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1010
async function createBooking(env: Env, httpRequest: Request, request: BookingRequest): Promise<Response> {
Open commit View diff
1010 async function createBooking(env: Env, httpRequest: Request, request: BookingRequest): Promise<Response> {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1011
  if (request.website) return json({ ok: true, message: 'Booked' }); // honeypot
Open commit View diff
1011 if (request.website) return json({ ok: true, message: 'Booked' }); // honeypot
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1012
  if (!(await enforceBookingRateLimit(httpRequest, env))) {
Open commit View diff
1012 if (!(await enforceBookingRateLimit(httpRequest, env))) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1013
    return json({ error: 'Too many booking attempts from this connection. Try again later.' }, 429);
Open commit View diff
1013 return json({ error: 'Too many booking attempts from this connection. Try again later.' }, 429);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1014
  }
Open commit View diff
1014 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1015
  const name = String(request.name ?? '').trim().slice(0, 120);
Open commit View diff
1015 const name = String(request.name ?? '').trim().slice(0, 120);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1016
  const email = String(request.email ?? '').trim().toLowerCase().slice(0, 254);
Open commit View diff
1016 const email = String(request.email ?? '').trim().toLowerCase().slice(0, 254);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1017
  const phone = String(request.phone ?? '').trim().slice(0, 80);
Open commit View diff
1017 const phone = String(request.phone ?? '').trim().slice(0, 80);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1018
  const message = String(request.message ?? '').trim().slice(0, 2000);
Open commit View diff
1018 const message = String(request.message ?? '').trim().slice(0, 2000);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1019
  const duration = Number(request.duration);
Open commit View diff
1019 const duration = Number(request.duration);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1020
  const startMs = Date.parse(request.start);
Open commit View diff
1020 const startMs = Date.parse(request.start);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1021
Open commit View diff
1021
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1022
  if (!name || !isEmail(email) || !Number.isFinite(startMs)) {
Open commit View diff
1022 if (!name || !isEmail(email) || !Number.isFinite(startMs)) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1023
    return json({ error: 'Name, a valid email, and a start time are required.' }, 400);
Open commit View diff
1023 return json({ error: 'Name, a valid email, and a start time are required.' }, 400);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1024
  }
Open commit View diff
1024 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1025
Open commit View diff
1025
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1026
  const settings = await getSettings(env);
Open commit View diff
1026 const settings = await getSettings(env);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1027
  if (!settings.durations.includes(duration)) return json({ error: 'That duration is not available.' }, 400);
Open commit View diff
1027 if (!settings.durations.includes(duration)) return json({ error: 'That duration is not available.' }, 400);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1028
  if (!settings.allowMeetingModes.includes(request.meetingMode)) {
Open commit View diff
1028 if (!settings.allowMeetingModes.includes(request.meetingMode)) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1029
    return json({ error: 'That meeting type is not available.' }, 400);
Open commit View diff
1029 return json({ error: 'That meeting type is not available.' }, 400);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1030
  }
Open commit View diff
1030 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1031
  if (request.meetingMode === 'phone' && !phone) {
Open commit View diff
1031 if (request.meetingMode === 'phone' && !phone) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1032
    return json({ error: 'A phone number is required for a phone meeting.' }, 400);
Open commit View diff
1032 return json({ error: 'A phone number is required for a phone meeting.' }, 400);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1033
  }
Open commit View diff
1033 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1034
Open commit View diff
1034
Alex Nord about 16 hours ago 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1035
  const paymentRequired = settings.paymentEnabled && !settings.paymentFreeDurations.includes(duration);
Open commit View diff
1035 const paymentRequired = settings.paymentEnabled && !settings.paymentFreeDurations.includes(duration);
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1036
  if (paymentRequired && settings.paymentRatePerMinute <= 0) {
Open commit View diff
1036 if (paymentRequired && settings.paymentRatePerMinute <= 0) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1037
    return json({ error: 'Payment is required, but the owner has not configured a per-minute price.' }, 503);
Open commit View diff
1037 return json({ error: 'Payment is required, but the owner has not configured a per-minute price.' }, 503);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1038
  }
Open commit View diff
1038 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1039
  if (paymentRequired && !stripeConfigured(env)) {
Open commit View diff
1039 if (paymentRequired && !stripeConfigured(env)) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1040
    return json({ error: 'Payment is required, but Stripe is not configured. The owner needs to fix the Stripe setup.' }, 503);
Open commit View diff
1040 return json({ error: 'Payment is required, but Stripe is not configured. The owner needs to fix the Stripe setup.' }, 503);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1041
  }
Open commit View diff
1041 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1042
Open commit View diff
1042
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1043
  const amountMinor = paymentRequired
Open commit View diff
1043 const amountMinor = paymentRequired
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1044
    ? bookingAmountMinor(settings.paymentRatePerMinute, duration, settings.paymentCurrency)
Open commit View diff
1044 ? bookingAmountMinor(settings.paymentRatePerMinute, duration, settings.paymentCurrency)
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1045
    : 0;
Open commit View diff
1045 : 0;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1046
  if (paymentRequired && amountMinor <= 0) {
Open commit View diff
1046 if (paymentRequired && amountMinor <= 0) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1047
    return json({ error: 'The configured per-minute price is too small for this currency.' }, 409);
Open commit View diff
1047 return json({ error: 'The configured per-minute price is too small for this currency.' }, 409);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1048
  }
Open commit View diff
1048 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1049
Open commit View diff
1049
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1050
  const dateKey = dateKeyInZone(new Date(startMs), settings.timezone);
Open commit View diff
1050 const dateKey = dateKeyInZone(new Date(startMs), settings.timezone);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1051
  const availability = await computeAvailability(env, dateKey);
Open commit View diff
1051 const availability = await computeAvailability(env, dateKey);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1052
  const matchingSlot = availability.slots.find((slot) => slot.start === new Date(startMs).toISOString());
Open commit View diff
1052 const matchingSlot = availability.slots.find((slot) => slot.start === new Date(startMs).toISOString());
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1053
  if (!matchingSlot || !matchingSlot.durations.includes(duration)) {
Open commit View diff
1053 if (!matchingSlot || !matchingSlot.durations.includes(duration)) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1054
    return json({ error: 'That slot is no longer available. Pick another time.' }, 409);
Open commit View diff
1054 return json({ error: 'That slot is no longer available. Pick another time.' }, 409);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1055
  }
Open commit View diff
1055 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1056
Open commit View diff
1056
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1057
  const endMs = addMinutes(startMs, duration);
Open commit View diff
1057 const endMs = addMinutes(startMs, duration);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1058
  const lockStart = addMinutes(startMs, -settings.bufferBeforeMinutes);
Open commit View diff
1058 const lockStart = addMinutes(startMs, -settings.bufferBeforeMinutes);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1059
  const lockEnd = addMinutes(endMs, settings.bufferAfterMinutes);
Open commit View diff
1059 const lockEnd = addMinutes(endMs, settings.bufferAfterMinutes);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1060
  const id = crypto.randomUUID();
Open commit View diff
1060 const id = crypto.randomUUID();
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1061
  const publicBookingId = newPublicBookingId();
Open commit View diff
1061 const publicBookingId = newPublicBookingId();
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1062
  const lockExpiry = Date.now() + (paymentRequired ? 35 : 3) * 60_000;
Open commit View diff
1062 const lockExpiry = Date.now() + (paymentRequired ? 35 : 3) * 60_000;
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1063
  const keys = slotKeys(lockStart, lockEnd, settings.slotIncrementMinutes);
Open commit View diff
1063 const keys = slotKeys(lockStart, lockEnd, settings.slotIncrementMinutes);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1064
Open commit View diff
1064
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1065
  await env.DB.prepare('DELETE FROM slot_locks WHERE expires_at < ?1').bind(Date.now()).run();
Open commit View diff
1065 await env.DB.prepare('DELETE FROM slot_locks WHERE expires_at < ?1').bind(Date.now()).run();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1066
Open commit View diff
1066
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1067
  const statements: D1PreparedStatement[] = [
Open commit View diff
1067 const statements: D1PreparedStatement[] = [
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1068
    env.DB.prepare(`
Open commit View diff
1068 env.DB.prepare(`
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1069
      INSERT INTO bookings (
Open commit View diff
1069 INSERT INTO bookings (
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1070
        id, public_booking_id, name, email, phone, message, start_time, end_time,
Open commit View diff
1070 id, public_booking_id, name, email, phone, message, start_time, end_time,
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1071
        duration_minutes, timezone, meeting_mode, status,
Open commit View diff
1071 duration_minutes, timezone, meeting_mode, status,
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1072
        payment_status, payment_amount, payment_currency
Open commit View diff
1072 payment_status, payment_amount, payment_currency
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1073
      ) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, 'pending', ?12, ?13, ?14)
Open commit View diff
1073 ) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, 'pending', ?12, ?13, ?14)
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1074
    `).bind(
Open commit View diff
1074 `).bind(
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1075
      id,
Open commit View diff
1075 id,
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1076
      publicBookingId,
Open commit View diff
1076 publicBookingId,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1077
      name,
Open commit View diff
1077 name,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1078
      email,
Open commit View diff
1078 email,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1079
      phone || null,
Open commit View diff
1079 phone || null,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1080
      message || null,
Open commit View diff
1080 message || null,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1081
      new Date(startMs).toISOString(),
Open commit View diff
1081 new Date(startMs).toISOString(),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1082
      new Date(endMs).toISOString(),
Open commit View diff
1082 new Date(endMs).toISOString(),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1083
      duration,
Open commit View diff
1083 duration,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1084
      settings.timezone,
Open commit View diff
1084 settings.timezone,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1085
      request.meetingMode,
Open commit View diff
1085 request.meetingMode,
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1086
      paymentRequired ? 'awaiting_checkout' : 'not_requested',
Open commit View diff
1086 paymentRequired ? 'awaiting_checkout' : 'not_requested',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1087
      paymentRequired ? amountMinor : null,
Open commit View diff
1087 paymentRequired ? amountMinor : null,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1088
      paymentRequired ? settings.paymentCurrency : null,
Open commit View diff
1088 paymentRequired ? settings.paymentCurrency : null,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1089
    ),
Open commit View diff
1089 ),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1090
    ...keys.map((key) =>
Open commit View diff
1090 ...keys.map((key) =>
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1091
      env.DB.prepare('INSERT INTO slot_locks (slot_key, booking_id, expires_at) VALUES (?1, ?2, ?3)')
Open commit View diff
1091 env.DB.prepare('INSERT INTO slot_locks (slot_key, booking_id, expires_at) VALUES (?1, ?2, ?3)')
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1092
        .bind(key, id, lockExpiry),
Open commit View diff
1092 .bind(key, id, lockExpiry),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1093
    ),
Open commit View diff
1093 ),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1094
  ];
Open commit View diff
1094 ];
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1095
Open commit View diff
1095
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1096
  try {
Open commit View diff
1096 try {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1097
    await env.DB.batch(statements);
Open commit View diff
1097 await env.DB.batch(statements);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1098
  } catch {
Open commit View diff
1098 } catch {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1099
    return json({ error: 'Someone just took that time. Please choose another slot.' }, 409);
Open commit View diff
1099 return json({ error: 'Someone just took that time. Please choose another slot.' }, 409);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1100
  }
Open commit View diff
1100 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1101
Open commit View diff
1101
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1102
  let holdEventId: string | null = null;
Open commit View diff
1102 let holdEventId: string | null = null;
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1103
  try {
Open commit View diff
1103 try {
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1104
    // Recheck Google after the D1 reservation. Paid bookings then get a private
Open commit View diff
1104 // Recheck Google after the D1 reservation. Paid bookings then get a private
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1105
    // owner-only calendar hold, so the visitor receives no invitation or Meet link
Open commit View diff
1105 // owner-only calendar hold, so the visitor receives no invitation or Meet link
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1106
    // until Stripe says the payment succeeded.
Open commit View diff
1106 // until Stripe says the payment succeeded.
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1107
    const fresh = await queryBusy(
Open commit View diff
1107 const fresh = await queryBusy(
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1108
      env,
Open commit View diff
1108 env,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1109
      settings,
Open commit View diff
1109 settings,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1110
      new Date(lockStart).toISOString(),
Open commit View diff
1110 new Date(lockStart).toISOString(),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1111
      new Date(lockEnd).toISOString(),
Open commit View diff
1111 new Date(lockEnd).toISOString(),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1112
    );
Open commit View diff
1112 );
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1113
    const conflicts = fresh.some((range) =>
Open commit View diff
1113 const conflicts = fresh.some((range) =>
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1114
      lockStart < Date.parse(range.end) && lockEnd > Date.parse(range.start),
Open commit View diff
1114 lockStart < Date.parse(range.end) && lockEnd > Date.parse(range.start),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1115
    );
Open commit View diff
1115 );
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1116
    if (conflicts) throw new Error('That slot became busy in Google Calendar.');
Open commit View diff
1116 if (conflicts) throw new Error('That slot became busy in Google Calendar.');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1117
Open commit View diff
1117
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1118
    if (paymentRequired) {
Open commit View diff
1118 if (paymentRequired) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1119
      const hold = await createCalendarHold(env, settings, {
Open commit View diff
1119 const hold = await createCalendarHold(env, settings, {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1120
        id,
Open commit View diff
1120 id,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1121
        start: new Date(startMs).toISOString(),
Open commit View diff
1121 start: new Date(startMs).toISOString(),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1122
        end: new Date(endMs).toISOString(),
Open commit View diff
1122 end: new Date(endMs).toISOString(),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1123
        meetingMode: request.meetingMode,
Open commit View diff
1123 meetingMode: request.meetingMode,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1124
      });
Open commit View diff
1124 });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1125
      holdEventId = hold.eventId;
Open commit View diff
1125 holdEventId = hold.eventId;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1126
      await env.DB.prepare(`
Open commit View diff
1126 await env.DB.prepare(`
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1127
        UPDATE bookings
Open commit View diff
1127 UPDATE bookings
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1128
        SET google_event_id = ?1,
Open commit View diff
1128 SET google_event_id = ?1,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1129
            meet_url = ?2,
Open commit View diff
1129 meet_url = ?2,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1130
            calendar_sync_status = 'held',
Open commit View diff
1130 calendar_sync_status = 'held',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1131
            calendar_sync_updated_at = datetime('now'),
Open commit View diff
1131 calendar_sync_updated_at = datetime('now'),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1132
            updated_at = datetime('now')
Open commit View diff
1132 updated_at = datetime('now')
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1133
        WHERE id = ?3
Open commit View diff
1133 WHERE id = ?3
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1134
      `).bind(hold.eventId, hold.meetUrl, id).run();
Open commit View diff
1134 `).bind(hold.eventId, hold.meetUrl, id).run();
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1135
Open commit View diff
1135
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1136
      const session = await createStripeCheckoutSession(env, {
Open commit View diff
1136 const session = await createStripeCheckoutSession(env, {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1137
        id,
Open commit View diff
1137 id,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1138
        email,
Open commit View diff
1138 email,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1139
        durationMinutes: duration,
Open commit View diff
1139 durationMinutes: duration,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1140
        amountMinor,
Open commit View diff
1140 amountMinor,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1141
        currency: settings.paymentCurrency,
Open commit View diff
1141 currency: settings.paymentCurrency,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1142
        label: settings.paymentLabel,
Open commit View diff
1142 label: settings.paymentLabel,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1143
      });
Open commit View diff
1143 });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1144
      if (!session.id || !session.url) throw new StripeError('Stripe did not return a Checkout URL.');
Open commit View diff
1144 if (!session.id || !session.url) throw new StripeError('Stripe did not return a Checkout URL.');
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1145
Open commit View diff
1145
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1146
      await env.DB.prepare(`
Open commit View diff
1146 await env.DB.prepare(`
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1147
        UPDATE bookings
Open commit View diff
1147 UPDATE bookings
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1148
        SET payment_status = 'checkout_open',
Open commit View diff
1148 SET payment_status = 'checkout_open',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1149
            stripe_checkout_session_id = ?1,
Open commit View diff
1149 stripe_checkout_session_id = ?1,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1150
            updated_at = datetime('now')
Open commit View diff
1150 updated_at = datetime('now')
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1151
        WHERE id = ?2
Open commit View diff
1151 WHERE id = ?2
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1152
      `).bind(session.id, id).run();
Open commit View diff
1152 `).bind(session.id, id).run();
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1153
      await logActivity(env, id, 'payment_checkout_started', {
Open commit View diff
1153 await logActivity(env, id, 'payment_checkout_started', {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1154
        start: new Date(startMs).toISOString(),
Open commit View diff
1154 start: new Date(startMs).toISOString(),
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1155
        end: new Date(endMs).toISOString(),
Open commit View diff
1155 end: new Date(endMs).toISOString(),
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1156
        duration,
Open commit View diff
1156 duration,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1157
        amount: amountMinor,
Open commit View diff
1157 amount: amountMinor,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1158
        currency: settings.paymentCurrency,
Open commit View diff
1158 currency: settings.paymentCurrency,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1159
      }, `checkout:${session.id}:opened`);
Open commit View diff
1159 }, `checkout:${session.id}:opened`);
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1160
Open commit View diff
1160
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1161
      return json({
Open commit View diff
1161 return json({
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1162
        ok: true,
Open commit View diff
1162 ok: true,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1163
        requiresPayment: true,
Open commit View diff
1163 requiresPayment: true,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1164
        checkoutUrl: session.url,
Open commit View diff
1164 checkoutUrl: session.url,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1165
        bookingId: id,
Open commit View diff
1165 bookingId: id,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1166
        amountMinor,
Open commit View diff
1166 amountMinor,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1167
        currency: settings.paymentCurrency,
Open commit View diff
1167 currency: settings.paymentCurrency,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1168
      }, 201);
Open commit View diff
1168 }, 201);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1169
    }
Open commit View diff
1169 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1170
Open commit View diff
1170
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1171
    const created = await createCalendarEvent(env, settings, {
Open commit View diff
1171 const created = await createCalendarEvent(env, settings, {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1172
      id,
Open commit View diff
1172 id,
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1173
      publicBookingId,
Open commit View diff
1173 publicBookingId,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1174
      name,
Open commit View diff
1174 name,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1175
      email,
Open commit View diff
1175 email,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1176
      phone: phone || undefined,
Open commit View diff
1176 phone: phone || undefined,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1177
      message: message || undefined,
Open commit View diff
1177 message: message || undefined,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1178
      start: new Date(startMs).toISOString(),
Open commit View diff
1178 start: new Date(startMs).toISOString(),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1179
      end: new Date(endMs).toISOString(),
Open commit View diff
1179 end: new Date(endMs).toISOString(),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1180
      meetingMode: request.meetingMode,
Open commit View diff
1180 meetingMode: request.meetingMode,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1181
    });
Open commit View diff
1181 });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1182
Open commit View diff
1182
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1183
    await env.DB.batch([
Open commit View diff
1183 await env.DB.batch([
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1184
      env.DB.prepare(`
Open commit View diff
1184 env.DB.prepare(`
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1185
        UPDATE bookings
Open commit View diff
1185 UPDATE bookings
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1186
        SET status = 'confirmed', google_event_id = ?1, meet_url = ?2,
Open commit View diff
1186 SET status = 'confirmed', google_event_id = ?1, meet_url = ?2,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1187
            calendar_sync_status = 'synced', calendar_sync_updated_at = datetime('now'),
Open commit View diff
1187 calendar_sync_status = 'synced', calendar_sync_updated_at = datetime('now'),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1188
            updated_at = datetime('now')
Open commit View diff
1188 updated_at = datetime('now')
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1189
        WHERE id = ?3
Open commit View diff
1189 WHERE id = ?3
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1190
      `).bind(created.eventId, created.meetUrl, id),
Open commit View diff
1190 `).bind(created.eventId, created.meetUrl, id),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1191
      env.DB.prepare('UPDATE slot_locks SET expires_at = ?1 WHERE booking_id = ?2')
Open commit View diff
1191 env.DB.prepare('UPDATE slot_locks SET expires_at = ?1 WHERE booking_id = ?2')
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1192
        .bind(Date.now() + 10 * 60_000, id),
Open commit View diff
1192 .bind(Date.now() + 10 * 60_000, id),
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1193
    ]);
Open commit View diff
1193 ]);
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1194
    await logActivity(env, id, 'booking_confirmed', {
Open commit View diff
1194 await logActivity(env, id, 'booking_confirmed', {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1195
      start: new Date(startMs).toISOString(),
Open commit View diff
1195 start: new Date(startMs).toISOString(),
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1196
      end: new Date(endMs).toISOString(),
Open commit View diff
1196 end: new Date(endMs).toISOString(),
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1197
      duration,
Open commit View diff
1197 duration,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1198
      paid: false,
Open commit View diff
1198 paid: false,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1199
    }, `booking:${id}:confirmed`);
Open commit View diff
1199 }, `booking:${id}:confirmed`);
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1200
Open commit View diff
1200
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1201
    return json({
Open commit View diff
1201 return json({
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1202
      ok: true,
Open commit View diff
1202 ok: true,
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1203
      requiresPayment: false,
Open commit View diff
1203 requiresPayment: false,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1204
      booking: {
Open commit View diff
1204 booking: {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1205
        id,
Open commit View diff
1205 id,
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1206
        bookingId: publicBookingId,
Open commit View diff
1206 bookingId: publicBookingId,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1207
        start: new Date(startMs).toISOString(),
Open commit View diff
1207 start: new Date(startMs).toISOString(),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1208
        end: new Date(endMs).toISOString(),
Open commit View diff
1208 end: new Date(endMs).toISOString(),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1209
        duration,
Open commit View diff
1209 duration,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1210
        timezone: settings.timezone,
Open commit View diff
1210 timezone: settings.timezone,
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1211
        meetingMode: request.meetingMode,
Open commit View diff
1211 meetingMode: request.meetingMode,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1212
        meetUrl: created.meetUrl,
Open commit View diff
1212 meetUrl: created.meetUrl,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1213
      },
Open commit View diff
1213 },
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1214
    }, 201);
Open commit View diff
1214 }, 201);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1215
  } catch (error) {
Open commit View diff
1215 } catch (error) {
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1216
    if (holdEventId) {
Open commit View diff
1216 if (holdEventId) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1217
      await deleteCalendarEvent(env, settings, holdEventId).catch(() => undefined);
Open commit View diff
1217 await deleteCalendarEvent(env, settings, holdEventId).catch(() => undefined);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1218
    }
Open commit View diff
1218 }
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1219
    await env.DB.batch([
Open commit View diff
1219 await env.DB.batch([
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1220
      env.DB.prepare('DELETE FROM slot_locks WHERE booking_id = ?1').bind(id),
Open commit View diff
1220 env.DB.prepare('DELETE FROM slot_locks WHERE booking_id = ?1').bind(id),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1221
      env.DB.prepare('DELETE FROM bookings WHERE id = ?1').bind(id),
Open commit View diff
1221 env.DB.prepare('DELETE FROM bookings WHERE id = ?1').bind(id),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1222
    ]).catch(() => undefined);
Open commit View diff
1222 ]).catch(() => undefined);
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1223
    if (error instanceof StripeError) return json({ error: error.message }, error.status);
Open commit View diff
1223 if (error instanceof StripeError) return json({ error: error.message }, error.status);
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1224
    const message = errorMessage(error);
Open commit View diff
1224 const message = errorMessage(error);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1225
    const status = message.includes('became busy') ? 409 : 502;
Open commit View diff
1225 const status = message.includes('became busy') ? 409 : 502;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1226
    return json({ error: message }, status);
Open commit View diff
1226 return json({ error: message }, status);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1227
  }
Open commit View diff
1227 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1228
}
Open commit View diff
1228 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1229
Open commit View diff
1229
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1230
async function createPaymentCheckout(env: Env, bookingId: string): Promise<Response> {
Open commit View diff
1230 async function createPaymentCheckout(env: Env, bookingId: string): Promise<Response> {
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1231
  if (!/^[0-9a-f-]{36}$/i.test(bookingId)) return json({ error: 'Invalid booking id.' }, 400);
Open commit View diff
1231 if (!/^[0-9a-f-]{36}$/i.test(bookingId)) return json({ error: 'Invalid booking id.' }, 400);
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1232
  if (!stripeConfigured(env)) return json({ error: 'Stripe is not configured for this deployment.' }, 503);
Open commit View diff
1232 if (!stripeConfigured(env)) return json({ error: 'Stripe is not configured for this deployment.' }, 503);
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1233
  const booking = await paymentBookingById(env, bookingId);
Open commit View diff
1233 const booking = await paymentBookingById(env, bookingId);
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1234
  if (!booking) return json({ error: 'Booking not found.' }, 404);
Open commit View diff
1234 if (!booking) return json({ error: 'Booking not found.' }, 404);
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1235
  if (booking.status === 'confirmed' && booking.payment_status === 'paid') return json({ ok: true, paid: true, booking: publicConfirmation(booking) });
Open commit View diff
1235 if (booking.status === 'confirmed' && booking.payment_status === 'paid') return json({ ok: true, paid: true, booking: publicConfirmation(booking) });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1236
  if (booking.status !== 'pending' || !booking.stripe_checkout_session_id) {
Open commit View diff
1236 if (booking.status !== 'pending' || !booking.stripe_checkout_session_id) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1237
    return json({ error: 'This booking does not have an active payment checkout.' }, 409);
Open commit View diff
1237 return json({ error: 'This booking does not have an active payment checkout.' }, 409);
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1238
  }
Open commit View diff
1238 }
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1239
Open commit View diff
1239
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1240
  try {
Open commit View diff
1240 try {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1241
    const session = await retrieveStripeCheckoutSession(env, booking.stripe_checkout_session_id);
Open commit View diff
1241 const session = await retrieveStripeCheckoutSession(env, booking.stripe_checkout_session_id);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1242
    if (session.payment_status === 'paid') {
Open commit View diff
1242 if (session.payment_status === 'paid') {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1243
      await recordPaidSession(env, booking.id, session);
Open commit View diff
1243 await recordPaidSession(env, booking.id, session);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1244
      const confirmed = await fulfillPaidBooking(env, booking.id);
Open commit View diff
1244 const confirmed = await fulfillPaidBooking(env, booking.id);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1245
      return json({ ok: true, paid: true, booking: publicConfirmation(confirmed) });
Open commit View diff
1245 return json({ ok: true, paid: true, booking: publicConfirmation(confirmed) });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1246
    }
Open commit View diff
1246 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1247
    if (session.status === 'open' && session.url) return json({ ok: true, url: session.url });
Open commit View diff
1247 if (session.status === 'open' && session.url) return json({ ok: true, url: session.url });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1248
    if (session.status === 'complete') return json({ ok: true, processing: true });
Open commit View diff
1248 if (session.status === 'complete') return json({ ok: true, processing: true });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1249
    return json({ error: 'That Stripe checkout is no longer active. Please book the slot again.' }, 409);
Open commit View diff
1249 return json({ error: 'That Stripe checkout is no longer active. Please book the slot again.' }, 409);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1250
  } catch (error) {
Open commit View diff
1250 } catch (error) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1251
    if (error instanceof StripeError) return json({ error: error.message }, error.status);
Open commit View diff
1251 if (error instanceof StripeError) return json({ error: error.message }, error.status);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1252
    throw error;
Open commit View diff
1252 throw error;
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1253
  }
Open commit View diff
1253 }
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1254
}
Open commit View diff
1254 }
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1255
Open commit View diff
1255
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1256
async function paymentStatus(env: Env, sessionId: string): Promise<Response> {
Open commit View diff
1256 async function paymentStatus(env: Env, sessionId: string): Promise<Response> {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1257
  if (!stripeConfigured(env)) return json({ error: 'Stripe is not configured for this deployment.' }, 503);
Open commit View diff
1257 if (!stripeConfigured(env)) return json({ error: 'Stripe is not configured for this deployment.' }, 503);
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1258
  try {
Open commit View diff
1258 try {
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1259
    const session = await retrieveStripeCheckoutSession(env, sessionId);
Open commit View diff
1259 const session = await retrieveStripeCheckoutSession(env, sessionId);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1260
    const bookingId = session.metadata?.booking_id || session.client_reference_id;
Open commit View diff
1260 const bookingId = session.metadata?.booking_id || session.client_reference_id;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1261
    if (!bookingId || !/^[0-9a-f-]{36}$/i.test(bookingId)) {
Open commit View diff
1261 if (!bookingId || !/^[0-9a-f-]{36}$/i.test(bookingId)) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1262
      return json({ state: 'missing' }, 404);
Open commit View diff
1262 return json({ state: 'missing' }, 404);
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1263
    }
Open commit View diff
1263 }
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1264
Open commit View diff
1264
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1265
    const existing = await paymentBookingById(env, bookingId);
Open commit View diff
1265 const existing = await paymentBookingById(env, bookingId);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1266
    if (existing?.status === 'confirmed') {
Open commit View diff
1266 if (existing?.status === 'confirmed') {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1267
      const receiptUrl = session.payment_status === 'paid'
Open commit View diff
1267 const receiptUrl = session.payment_status === 'paid'
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1268
        ? await stripeReceiptUrl(env, session).catch(() => null)
Open commit View diff
1268 ? await stripeReceiptUrl(env, session).catch(() => null)
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1269
        : null;
Open commit View diff
1269 : null;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1270
      return json({ state: 'confirmed', booking: publicConfirmation(existing, receiptUrl) });
Open commit View diff
1270 return json({ state: 'confirmed', booking: publicConfirmation(existing, receiptUrl) });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1271
    }
Open commit View diff
1271 }
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1272
Open commit View diff
1272
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1273
    if (session.payment_status === 'paid') {
Open commit View diff
1273 if (session.payment_status === 'paid') {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1274
      await recordPaidSession(env, bookingId, session);
Open commit View diff
1274 await recordPaidSession(env, bookingId, session);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1275
      try {
Open commit View diff
1275 try {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1276
        const confirmed = await fulfillPaidBooking(env, bookingId);
Open commit View diff
1276 const confirmed = await fulfillPaidBooking(env, bookingId);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1277
        const receiptUrl = await stripeReceiptUrl(env, session).catch(() => null);
Open commit View diff
1277 const receiptUrl = await stripeReceiptUrl(env, session).catch(() => null);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1278
        return json({ state: 'confirmed', booking: publicConfirmation(confirmed, receiptUrl) });
Open commit View diff
1278 return json({ state: 'confirmed', booking: publicConfirmation(confirmed, receiptUrl) });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1279
      } catch {
Open commit View diff
1279 } catch {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1280
        return json({ state: 'confirming', message: 'Payment received. Finalizing your calendar invitation…' });
Open commit View diff
1280 return json({ state: 'confirming', message: 'Payment received. Finalizing your calendar invitation…' });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1281
      }
Open commit View diff
1281 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1282
    }
Open commit View diff
1282 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1283
Open commit View diff
1283
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1284
    if (session.status === 'complete') {
Open commit View diff
1284 if (session.status === 'complete') {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1285
      return json({ state: 'processing', message: 'Stripe is still processing the payment.' });
Open commit View diff
1285 return json({ state: 'processing', message: 'Stripe is still processing the payment.' });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1286
    }
Open commit View diff
1286 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1287
    if (session.status === 'expired') {
Open commit View diff
1287 if (session.status === 'expired') {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1288
      const settings = await getSettings(env);
Open commit View diff
1288 const settings = await getSettings(env);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1289
      await releasePendingBooking(env, settings, bookingId).catch(() => undefined);
Open commit View diff
1289 await releasePendingBooking(env, settings, bookingId).catch(() => undefined);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1290
      return json({ state: 'expired', message: 'Payment expired. No booking was confirmed.' });
Open commit View diff
1290 return json({ state: 'expired', message: 'Payment expired. No booking was confirmed.' });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1291
    }
Open commit View diff
1291 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1292
    return json({ state: 'awaiting_payment', message: 'Payment has not completed yet.' });
Open commit View diff
1292 return json({ state: 'awaiting_payment', message: 'Payment has not completed yet.' });
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1293
  } catch (error) {
Open commit View diff
1293 } catch (error) {
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1294
    if (error instanceof StripeError) return json({ error: error.message }, error.status);
Open commit View diff
1294 if (error instanceof StripeError) return json({ error: error.message }, error.status);
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1295
    throw error;
Open commit View diff
1295 throw error;
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1296
  }
Open commit View diff
1296 }
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1297
}
Open commit View diff
1297 }
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1298
Open commit View diff
1298
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1299
async function cancelPendingPayment(
Open commit View diff
1299 async function cancelPendingPayment(
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1300
  env: Env,
Open commit View diff
1300 env: Env,
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1301
  bookingId: string,
Open commit View diff
1301 bookingId: string,
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1302
  options: { allowStaleStripeRelease?: boolean } = {},
Open commit View diff
1302 options: { allowStaleStripeRelease?: boolean } = {},
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1303
): Promise<Response> {
Open commit View diff
1303 ): Promise<Response> {
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1304
  if (!/^[0-9a-f-]{36}$/i.test(bookingId)) return json({ error: 'Invalid booking id.' }, 400);
Open commit View diff
1304 if (!/^[0-9a-f-]{36}$/i.test(bookingId)) return json({ error: 'Invalid booking id.' }, 400);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1305
  const booking = await paymentBookingById(env, bookingId);
Open commit View diff
1305 const booking = await paymentBookingById(env, bookingId);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1306
  if (!booking) return json({ ok: true, state: 'cancelled' });
Open commit View diff
1306 if (!booking) return json({ ok: true, state: 'cancelled' });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1307
  if (booking.status === 'confirmed') return json({ ok: true, state: 'confirmed', booking: publicConfirmation(booking) });
Open commit View diff
1307 if (booking.status === 'confirmed') return json({ ok: true, state: 'confirmed', booking: publicConfirmation(booking) });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1308
  if (booking.status === 'confirming') return json({ ok: true, state: 'processing' });
Open commit View diff
1308 if (booking.status === 'confirming') return json({ ok: true, state: 'processing' });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1309
  if (booking.status !== 'pending') return json({ ok: true, state: booking.status });
Open commit View diff
1309 if (booking.status !== 'pending') return json({ ok: true, state: booking.status });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1310
Open commit View diff
1310
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1311
  const settings = await getSettings(env);
Open commit View diff
1311 const settings = await getSettings(env);
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1312
  let releaseWarning: string | null = null;
Open commit View diff
1312 let releaseWarning: string | null = null;
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1313
  const sessionId = booking.stripe_checkout_session_id;
Open commit View diff
1313 const sessionId = booking.stripe_checkout_session_id;
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1314
Open commit View diff
1314
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1315
  if (sessionId && stripeConfigured(env)) {
Open commit View diff
1315 if (sessionId && stripeConfigured(env)) {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1316
    const sessionMode = stripeCheckoutSessionMode(sessionId);
Open commit View diff
1316 const sessionMode = stripeCheckoutSessionMode(sessionId);
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1317
    const configuredMode = stripeMode(env);
Open commit View diff
1317 const configuredMode = stripeMode(env);
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1318
    const modeMismatch = sessionMode !== 'unknown'
Open commit View diff
1318 const modeMismatch = sessionMode !== 'unknown'
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1319
      && configuredMode !== 'unknown'
Open commit View diff
1319 && configuredMode !== 'unknown'
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1320
      && sessionMode !== configuredMode;
Open commit View diff
1320 && sessionMode !== configuredMode;
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1321
Open commit View diff
1321
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1322
    if (modeMismatch) {
Open commit View diff
1322 if (modeMismatch) {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1323
      if (!options.allowStaleStripeRelease) {
Open commit View diff
1323 if (!options.allowStaleStripeRelease) {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1324
        return json({
Open commit View diff
1324 return json({
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1325
          error: `This payment hold was created in Stripe ${sessionMode} mode, but this deployment is using ${configuredMode} mode. Switch back to the ${sessionMode} key to expire that Checkout session, or release it from Admin.`,
Open commit View diff
1325 error: `This payment hold was created in Stripe ${sessionMode} mode, but this deployment is using ${configuredMode} mode. Switch back to the ${sessionMode} key to expire that Checkout session, or release it from Admin.`,
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1326
          code: 'stripe_mode_mismatch',
Open commit View diff
1326 code: 'stripe_mode_mismatch',
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1327
          sessionMode,
Open commit View diff
1327 sessionMode,
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1328
          configuredMode,
Open commit View diff
1328 configuredMode,
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1329
        }, 409);
Open commit View diff
1329 }, 409);
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1330
      }
Open commit View diff
1330 }
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1331
      releaseWarning = `Released locally. The hold belongs to Stripe ${sessionMode} mode while this Worker uses ${configuredMode} mode, so Slot could not expire the old Stripe Checkout session.`;
Open commit View diff
1331 releaseWarning = `Released locally. The hold belongs to Stripe ${sessionMode} mode while this Worker uses ${configuredMode} mode, so Slot could not expire the old Stripe Checkout session.`;
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1332
    } else {
Open commit View diff
1332 } else {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1333
      try {
Open commit View diff
1333 try {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1334
        const session = await retrieveStripeCheckoutSession(env, sessionId);
Open commit View diff
1334 const session = await retrieveStripeCheckoutSession(env, sessionId);
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1335
        if (session.payment_status === 'paid') {
Open commit View diff
1335 if (session.payment_status === 'paid') {
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1336
          await recordPaidSession(env, booking.id, session);
Open commit View diff
1336 await recordPaidSession(env, booking.id, session);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1337
          const confirmed = await fulfillPaidBooking(env, booking.id);
Open commit View diff
1337 const confirmed = await fulfillPaidBooking(env, booking.id);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1338
          return json({ ok: true, state: 'confirmed', booking: publicConfirmation(confirmed) });
Open commit View diff
1338 return json({ ok: true, state: 'confirmed', booking: publicConfirmation(confirmed) });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1339
        }
Open commit View diff
1339 }
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1340
        if (session.status === 'complete') {
Open commit View diff
1340 if (session.status === 'complete') {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1341
          return json({ ok: true, state: 'processing' });
Open commit View diff
1341 return json({ ok: true, state: 'processing' });
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1342
        }
Open commit View diff
1342 }
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1343
        if (session.status === 'open') await expireStripeCheckoutSession(env, session.id);
Open commit View diff
1343 if (session.status === 'open') await expireStripeCheckoutSession(env, session.id);
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1344
      } catch (error) {
Open commit View diff
1344 } catch (error) {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1345
        if (error instanceof StripeError) {
Open commit View diff
1345 if (error instanceof StripeError) {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1346
          // A resource_missing error is what Stripe returns when a Checkout
Open commit View diff
1346 // A resource_missing error is what Stripe returns when a Checkout
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1347
          // session belongs to another account/mode. Admin has already made an
Open commit View diff
1347 // session belongs to another account/mode. Admin has already made an
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1348
          // explicit release decision, so let it clean up the local/calendar hold
Open commit View diff
1348 // explicit release decision, so let it clean up the local/calendar hold
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1349
          // instead of trapping the slot behind a stale Stripe id.
Open commit View diff
1349 // instead of trapping the slot behind a stale Stripe id.
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1350
          if (options.allowStaleStripeRelease && (error.code === 'resource_missing' || /No such checkout\.session/i.test(error.message))) {
Open commit View diff
1350 if (options.allowStaleStripeRelease && (error.code === 'resource_missing' || /No such checkout\.session/i.test(error.message))) {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1351
            releaseWarning = 'Released locally because Stripe could not find the stored Checkout session with the currently configured key.';
Open commit View diff
1351 releaseWarning = 'Released locally because Stripe could not find the stored Checkout session with the currently configured key.';
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1352
          } else {
Open commit View diff
1352 } else {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1353
            return json({ error: error.message }, error.status);
Open commit View diff
1353 return json({ error: error.message }, error.status);
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1354
          }
Open commit View diff
1354 }
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1355
        } else {
Open commit View diff
1355 } else {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1356
          throw error;
Open commit View diff
1356 throw error;
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1357
        }
Open commit View diff
1357 }
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1358
      }
Open commit View diff
1358 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1359
    }
Open commit View diff
1359 }
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1360
  } else if (sessionId && options.allowStaleStripeRelease) {
Open commit View diff
1360 } else if (sessionId && options.allowStaleStripeRelease) {
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1361
    releaseWarning = 'Released locally. Stripe is not configured on this deployment, so Slot could not expire the stored Checkout session.';
Open commit View diff
1361 releaseWarning = 'Released locally. Stripe is not configured on this deployment, so Slot could not expire the stored Checkout session.';
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1362
  }
Open commit View diff
1362 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1363
Open commit View diff
1363
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1364
  await releasePendingBooking(env, settings, booking.id);
Open commit View diff
1364 await releasePendingBooking(env, settings, booking.id);
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1365
  return json({ ok: true, state: 'cancelled', warning: releaseWarning });
Open commit View diff
1365 return json({ ok: true, state: 'cancelled', warning: releaseWarning });
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1366
}
Open commit View diff
1366 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1367
Open commit View diff
1367
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1368
async function paymentCancelReturn(env: Env, bookingId: string): Promise<Response> {
Open commit View diff
1368 async function paymentCancelReturn(env: Env, bookingId: string): Promise<Response> {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1369
  const appUrl = env.APP_URL.replace(/\/+$/, '');
Open commit View diff
1369 const appUrl = env.APP_URL.replace(/\/+$/, '');
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1370
  if (!/^[0-9a-f-]{36}$/i.test(bookingId)) {
Open commit View diff
1370 if (!/^[0-9a-f-]{36}$/i.test(bookingId)) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1371
    return redirect(`${appUrl}/?payment=cancelled&release_error=invalid_booking`);
Open commit View diff
1371 return redirect(`${appUrl}/?payment=cancelled&release_error=invalid_booking`);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1372
  }
Open commit View diff
1372 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1373
Open commit View diff
1373
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1374
  const before = await paymentBookingById(env, bookingId);
Open commit View diff
1374 const before = await paymentBookingById(env, bookingId);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1375
  const sessionId = before?.stripe_checkout_session_id ?? null;
Open commit View diff
1375 const sessionId = before?.stripe_checkout_session_id ?? null;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1376
  const response = await cancelPendingPayment(env, bookingId);
Open commit View diff
1376 const response = await cancelPendingPayment(env, bookingId);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1377
  const payload = await response.clone().json().catch(() => ({})) as { state?: string };
Open commit View diff
1377 const payload = await response.clone().json().catch(() => ({})) as { state?: string };
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1378
Open commit View diff
1378
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1379
  if (response.ok && (payload.state === 'confirmed' || payload.state === 'processing') && sessionId) {
Open commit View diff
1379 if (response.ok && (payload.state === 'confirmed' || payload.state === 'processing') && sessionId) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1380
    return redirect(`${appUrl}/?payment=success&session_id=${encodeURIComponent(sessionId)}`);
Open commit View diff
1380 return redirect(`${appUrl}/?payment=success&session_id=${encodeURIComponent(sessionId)}`);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1381
  }
Open commit View diff
1381 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1382
  if (response.ok && payload.state === 'cancelled') {
Open commit View diff
1382 if (response.ok && payload.state === 'cancelled') {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1383
    return redirect(`${appUrl}/?payment=cancelled&released=1`);
Open commit View diff
1383 return redirect(`${appUrl}/?payment=cancelled&released=1`);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1384
  }
Open commit View diff
1384 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1385
Open commit View diff
1385
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1386
  // Keep the booking id only on the error fallback so the browser can retry the
Open commit View diff
1386 // Keep the booking id only on the error fallback so the browser can retry the
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1387
  // release through the normal POST endpoint and show a useful error if needed.
Open commit View diff
1387 // release through the normal POST endpoint and show a useful error if needed.
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1388
  return redirect(`${appUrl}/?payment=cancelled&booking_id=${encodeURIComponent(bookingId)}&release_error=1`);
Open commit View diff
1388 return redirect(`${appUrl}/?payment=cancelled&booking_id=${encodeURIComponent(bookingId)}&release_error=1`);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1389
}
Open commit View diff
1389 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1390
Open commit View diff
1390
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1391
async function handleStripeWebhook(request: Request, env: Env): Promise<Response> {
Open commit View diff
1391 async function handleStripeWebhook(request: Request, env: Env): Promise<Response> {
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1392
  const rawBody = await request.text();
Open commit View diff
1392 const rawBody = await request.text();
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1393
  try {
Open commit View diff
1393 try {
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1394
    const event = await verifyStripeWebhook(env, rawBody, request.headers.get('Stripe-Signature'));
Open commit View diff
1394 const event = await verifyStripeWebhook(env, rawBody, request.headers.get('Stripe-Signature'));
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1395
    const object = event.data?.object;
Open commit View diff
1395 const object = event.data?.object;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1396
    if (!object) return json({ received: true });
Open commit View diff
1396 if (!object) return json({ received: true });
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1397
Open commit View diff
1397
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1398
    if (object.object === 'refund') {
Open commit View diff
1398 if (object.object === 'refund') {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1399
      const refund = object as StripeRefund;
Open commit View diff
1399 const refund = object as StripeRefund;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1400
      const bookingId = refund.metadata?.booking_id;
Open commit View diff
1400 const bookingId = refund.metadata?.booking_id;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1401
      if (bookingId && /^[0-9a-f-]{36}$/i.test(bookingId)) {
Open commit View diff
1401 if (bookingId && /^[0-9a-f-]{36}$/i.test(bookingId)) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1402
        const status = event.type === 'refund.failed' ? 'failed' : (refund.status ?? 'pending');
Open commit View diff
1402 const status = event.type === 'refund.failed' ? 'failed' : (refund.status ?? 'pending');
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1403
        await env.DB.prepare(`
Open commit View diff
1403 await env.DB.prepare(`
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1404
          UPDATE bookings
Open commit View diff
1404 UPDATE bookings
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1405
          SET refund_status = ?1,
Open commit View diff
1405 SET refund_status = ?1,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1406
              stripe_refund_id = COALESCE(stripe_refund_id, ?2),
Open commit View diff
1406 stripe_refund_id = COALESCE(stripe_refund_id, ?2),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1407
              refunded_amount = COALESCE(?3, refunded_amount),
Open commit View diff
1407 refunded_amount = COALESCE(?3, refunded_amount),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1408
              refunded_at = CASE WHEN ?1 = 'succeeded' THEN COALESCE(refunded_at, datetime('now')) ELSE refunded_at END,
Open commit View diff
1408 refunded_at = CASE WHEN ?1 = 'succeeded' THEN COALESCE(refunded_at, datetime('now')) ELSE refunded_at END,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1409
              updated_at = datetime('now')
Open commit View diff
1409 updated_at = datetime('now')
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1410
          WHERE id = ?4
Open commit View diff
1410 WHERE id = ?4
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1411
        `).bind(status, refund.id, refund.amount ?? null, bookingId).run();
Open commit View diff
1411 `).bind(status, refund.id, refund.amount ?? null, bookingId).run();
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1412
        await logActivity(env, bookingId,
Open commit View diff
1412 await logActivity(env, bookingId,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1413
          status === 'succeeded' ? 'refund_succeeded' : status === 'failed' ? 'refund_failed' : 'refund_started',
Open commit View diff
1413 status === 'succeeded' ? 'refund_succeeded' : status === 'failed' ? 'refund_failed' : 'refund_started',
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1414
          { amount: refund.amount ?? null, currency: refund.currency ?? null, refundStatus: status },
Open commit View diff
1414 { amount: refund.amount ?? null, currency: refund.currency ?? null, refundStatus: status },
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1415
          `refund:${refund.id}:${status}`,
Open commit View diff
1415 `refund:${refund.id}:${status}`,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1416
        );
Open commit View diff
1416 );
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1417
      }
Open commit View diff
1417 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1418
      return json({ received: true });
Open commit View diff
1418 return json({ received: true });
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1419
    }
Open commit View diff
1419 }
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1420
Open commit View diff
1420
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1421
    if (object.object !== 'checkout.session') return json({ received: true });
Open commit View diff
1421 if (object.object !== 'checkout.session') return json({ received: true });
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1422
    const session = object;
Open commit View diff
1422 const session = object;
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1423
    const bookingId = session.metadata?.booking_id || session.client_reference_id;
Open commit View diff
1423 const bookingId = session.metadata?.booking_id || session.client_reference_id;
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1424
    if (!bookingId || !/^[0-9a-f-]{36}$/i.test(bookingId)) return json({ received: true });
Open commit View diff
1424 if (!bookingId || !/^[0-9a-f-]{36}$/i.test(bookingId)) return json({ received: true });
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1425
Open commit View diff
1425
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1426
    if (event.type === 'checkout.session.completed' || event.type === 'checkout.session.async_payment_succeeded') {
Open commit View diff
1426 if (event.type === 'checkout.session.completed' || event.type === 'checkout.session.async_payment_succeeded') {
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1427
      const paid = session.payment_status === 'paid' || event.type === 'checkout.session.async_payment_succeeded';
Open commit View diff
1427 const paid = session.payment_status === 'paid' || event.type === 'checkout.session.async_payment_succeeded';
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1428
      if (paid) {
Open commit View diff
1428 if (paid) {
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1429
        await recordPaidSession(env, bookingId, session);
Open commit View diff
1429 await recordPaidSession(env, bookingId, session);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1430
        await fulfillPaidBooking(env, bookingId);
Open commit View diff
1430 await fulfillPaidBooking(env, bookingId);
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1431
      } else {
Open commit View diff
1431 } else {
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1432
        await env.DB.prepare(`
Open commit View diff
1432 await env.DB.prepare(`
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1433
          UPDATE bookings
Open commit View diff
1433 UPDATE bookings
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1434
          SET payment_status = CASE WHEN payment_status = 'paid' THEN 'paid' ELSE 'processing' END,
Open commit View diff
1434 SET payment_status = CASE WHEN payment_status = 'paid' THEN 'paid' ELSE 'processing' END,
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1435
              payment_amount = COALESCE(?1, payment_amount),
Open commit View diff
1435 payment_amount = COALESCE(?1, payment_amount),
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1436
              payment_currency = COALESCE(?2, payment_currency),
Open commit View diff
1436 payment_currency = COALESCE(?2, payment_currency),
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1437
              stripe_payment_intent_id = COALESCE(?3, stripe_payment_intent_id),
Open commit View diff
1437 stripe_payment_intent_id = COALESCE(?3, stripe_payment_intent_id),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1438
              updated_at = datetime('now')
Open commit View diff
1438 updated_at = datetime('now')
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1439
          WHERE id = ?4
Open commit View diff
1439 WHERE id = ?4
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1440
            AND stripe_checkout_session_id = ?5
Open commit View diff
1440 AND stripe_checkout_session_id = ?5
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1441
        `).bind(
Open commit View diff
1441 `).bind(
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1442
          session.amount_total ?? null,
Open commit View diff
1442 session.amount_total ?? null,
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1443
          session.currency ?? null,
Open commit View diff
1443 session.currency ?? null,
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1444
          stripePaymentIntentId(session),
Open commit View diff
1444 stripePaymentIntentId(session),
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1445
          bookingId,
Open commit View diff
1445 bookingId,
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1446
          session.id,
Open commit View diff
1446 session.id,
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1447
        ).run();
Open commit View diff
1447 ).run();
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1448
      }
Open commit View diff
1448 }
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1449
    } else if (event.type === 'checkout.session.async_payment_failed' || event.type === 'checkout.session.expired') {
Open commit View diff
1449 } else if (event.type === 'checkout.session.async_payment_failed' || event.type === 'checkout.session.expired') {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1450
      const settings = await getSettings(env);
Open commit View diff
1450 const settings = await getSettings(env);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1451
      await releasePendingBooking(env, settings, bookingId);
Open commit View diff
1451 await releasePendingBooking(env, settings, bookingId);
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1452
    }
Open commit View diff
1452 }
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1453
Open commit View diff
1453
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1454
    return json({ received: true });
Open commit View diff
1454 return json({ received: true });
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1455
  } catch (error) {
Open commit View diff
1455 } catch (error) {
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1456
    if (error instanceof StripeError) return json({ error: error.message }, error.status);
Open commit View diff
1456 if (error instanceof StripeError) return json({ error: error.message }, error.status);
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1457
    throw error;
Open commit View diff
1457 throw error;
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1458
  }
Open commit View diff
1458 }
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1459
}
Open commit View diff
1459 }
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1460
Open commit View diff
1460
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1461
Open commit View diff
1461
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1462
async function assertRescheduleSlotAvailable(
Open commit View diff
1462 async function assertRescheduleSlotAvailable(
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1463
  env: Env,
Open commit View diff
1463 env: Env,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1464
  booking: PaymentBookingRow,
Open commit View diff
1464 booking: PaymentBookingRow,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1465
  startIso: string,
Open commit View diff
1465 startIso: string,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1466
): Promise<{ settings: AppSettings; startMs: number; endMs: number }> {
Open commit View diff
1466 ): Promise<{ settings: AppSettings; startMs: number; endMs: number }> {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1467
  const startMs = Date.parse(startIso);
Open commit View diff
1467 const startMs = Date.parse(startIso);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1468
  if (!Number.isFinite(startMs) || startMs <= Date.now()) throw new Error('Choose a future time.');
Open commit View diff
1468 if (!Number.isFinite(startMs) || startMs <= Date.now()) throw new Error('Choose a future time.');
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1469
  const settings = await getSettings(env);
Open commit View diff
1469 const settings = await getSettings(env);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1470
  const dateKey = dateKeyInZone(new Date(startMs), settings.timezone);
Open commit View diff
1470 const dateKey = dateKeyInZone(new Date(startMs), settings.timezone);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1471
  const availability = await computeAvailability(env, dateKey);
Open commit View diff
1471 const availability = await computeAvailability(env, dateKey);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1472
  const matching = availability.slots.find((slot) => slot.start === new Date(startMs).toISOString());
Open commit View diff
1472 const matching = availability.slots.find((slot) => slot.start === new Date(startMs).toISOString());
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1473
  if (!matching || !matching.durations.includes(booking.duration_minutes)) {
Open commit View diff
1473 if (!matching || !matching.durations.includes(booking.duration_minutes)) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1474
    throw new Error('That suggested time is no longer available. Choose another time.');
Open commit View diff
1474 throw new Error('That suggested time is no longer available. Choose another time.');
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1475
  }
Open commit View diff
1475 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1476
  return { settings, startMs, endMs: addMinutes(startMs, booking.duration_minutes) };
Open commit View diff
1476 return { settings, startMs, endMs: addMinutes(startMs, booking.duration_minutes) };
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1477
}
Open commit View diff
1477 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1478
Open commit View diff
1478
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1479
async function rescheduleConfirmedBooking(
Open commit View diff
1479 async function rescheduleConfirmedBooking(
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1480
  env: Env,
Open commit View diff
1480 env: Env,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1481
  booking: PaymentBookingRow,
Open commit View diff
1481 booking: PaymentBookingRow,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1482
  startIso: string,
Open commit View diff
1482 startIso: string,
Alex Nord about 16 hours ago 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1483
  source: 'admin' | 'guest_suggestion' | 'guest_self' = 'admin',
Open commit View diff
1483 source: 'admin' | 'guest_suggestion' | 'guest_self' = 'admin',
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1484
): Promise<PaymentBookingRow> {
Open commit View diff
1484 ): Promise<PaymentBookingRow> {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1485
  if (booking.status !== 'confirmed') throw new Error('Only confirmed bookings can be rescheduled.');
Open commit View diff
1485 if (booking.status !== 'confirmed') throw new Error('Only confirmed bookings can be rescheduled.');
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1486
  if (!booking.google_event_id) throw new Error('This booking is missing its Google Calendar event.');
Open commit View diff
1486 if (!booking.google_event_id) throw new Error('This booking is missing its Google Calendar event.');
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1487
  const { settings, startMs, endMs } = await assertRescheduleSlotAvailable(env, booking, startIso);
Open commit View diff
1487 const { settings, startMs, endMs } = await assertRescheduleSlotAvailable(env, booking, startIso);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1488
  const lockStart = addMinutes(startMs, -settings.bufferBeforeMinutes);
Open commit View diff
1488 const lockStart = addMinutes(startMs, -settings.bufferBeforeMinutes);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1489
  const lockEnd = addMinutes(endMs, settings.bufferAfterMinutes);
Open commit View diff
1489 const lockEnd = addMinutes(endMs, settings.bufferAfterMinutes);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1490
  const keys = slotKeys(lockStart, lockEnd, settings.slotIncrementMinutes);
Open commit View diff
1490 const keys = slotKeys(lockStart, lockEnd, settings.slotIncrementMinutes);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1491
Open commit View diff
1491
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1492
  await env.DB.prepare('DELETE FROM slot_locks WHERE expires_at < ?1').bind(Date.now()).run();
Open commit View diff
1492 await env.DB.prepare('DELETE FROM slot_locks WHERE expires_at < ?1').bind(Date.now()).run();
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1493
  await env.DB.prepare('DELETE FROM slot_locks WHERE booking_id = ?1').bind(booking.id).run();
Open commit View diff
1493 await env.DB.prepare('DELETE FROM slot_locks WHERE booking_id = ?1').bind(booking.id).run();
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1494
  try {
Open commit View diff
1494 try {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1495
    await env.DB.batch(keys.map((key) =>
Open commit View diff
1495 await env.DB.batch(keys.map((key) =>
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1496
      env.DB.prepare('INSERT INTO slot_locks (slot_key, booking_id, expires_at) VALUES (?1, ?2, ?3)')
Open commit View diff
1496 env.DB.prepare('INSERT INTO slot_locks (slot_key, booking_id, expires_at) VALUES (?1, ?2, ?3)')
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1497
        .bind(key, booking.id, Date.now() + 3 * 60_000),
Open commit View diff
1497 .bind(key, booking.id, Date.now() + 3 * 60_000),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1498
    ));
Open commit View diff
1498 ));
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1499
  } catch {
Open commit View diff
1499 } catch {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1500
    throw new Error('Someone just took that time. Choose another slot.');
Open commit View diff
1500 throw new Error('Someone just took that time. Choose another slot.');
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1501
  }
Open commit View diff
1501 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1502
Open commit View diff
1502
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1503
  try {
Open commit View diff
1503 try {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1504
    const fresh = await queryBusy(env, settings, new Date(lockStart).toISOString(), new Date(lockEnd).toISOString());
Open commit View diff
1504 const fresh = await queryBusy(env, settings, new Date(lockStart).toISOString(), new Date(lockEnd).toISOString());
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1505
    const conflicts = fresh.some((range) => lockStart < Date.parse(range.end) && lockEnd > Date.parse(range.start));
Open commit View diff
1505 const conflicts = fresh.some((range) => lockStart < Date.parse(range.end) && lockEnd > Date.parse(range.start));
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1506
    if (conflicts) throw new Error('That time became busy in Google Calendar. Choose another slot.');
Open commit View diff
1506 if (conflicts) throw new Error('That time became busy in Google Calendar. Choose another slot.');
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1507
Open commit View diff
1507
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1508
    const updated = await rescheduleCalendarEvent(env, settings, booking.google_event_id, {
Open commit View diff
1508 const updated = await rescheduleCalendarEvent(env, settings, booking.google_event_id, {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1509
      phone: booking.phone ?? undefined,
Open commit View diff
1509 phone: booking.phone ?? undefined,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1510
      message: booking.message ?? undefined,
Open commit View diff
1510 message: booking.message ?? undefined,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1511
      paid: booking.payment_status === 'paid',
Open commit View diff
1511 paid: booking.payment_status === 'paid',
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1512
      publicBookingId: booking.public_booking_id ?? undefined,
Open commit View diff
1512 publicBookingId: booking.public_booking_id ?? undefined,
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1513
      start: new Date(startMs).toISOString(),
Open commit View diff
1513 start: new Date(startMs).toISOString(),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1514
      end: new Date(endMs).toISOString(),
Open commit View diff
1514 end: new Date(endMs).toISOString(),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1515
    });
Open commit View diff
1515 });
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1516
Open commit View diff
1516
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1517
    try {
Open commit View diff
1517 try {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1518
      await env.DB.batch([
Open commit View diff
1518 await env.DB.batch([
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1519
        env.DB.prepare(`
Open commit View diff
1519 env.DB.prepare(`
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1520
          UPDATE bookings
Open commit View diff
1520 UPDATE bookings
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1521
          SET start_time = ?1,
Open commit View diff
1521 SET start_time = ?1,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1522
              end_time = ?2,
Open commit View diff
1522 end_time = ?2,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1523
              meet_url = COALESCE(?3, meet_url),
Open commit View diff
1523 meet_url = COALESCE(?3, meet_url),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1524
              rescheduled_at = datetime('now'),
Open commit View diff
1524 rescheduled_at = datetime('now'),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1525
              reschedule_count = reschedule_count + 1,
Open commit View diff
1525 reschedule_count = reschedule_count + 1,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1526
              proposed_start_time = NULL,
Open commit View diff
1526 proposed_start_time = NULL,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1527
              proposed_end_time = NULL,
Open commit View diff
1527 proposed_end_time = NULL,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1528
              proposed_at = NULL,
Open commit View diff
1528 proposed_at = NULL,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1529
              proposal_status = NULL,
Open commit View diff
1529 proposal_status = NULL,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1530
              proposal_token_hash = NULL,
Open commit View diff
1530 proposal_token_hash = NULL,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1531
              calendar_sync_status = 'synced',
Open commit View diff
1531 calendar_sync_status = 'synced',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1532
              calendar_sync_error = NULL,
Open commit View diff
1532 calendar_sync_error = NULL,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1533
              calendar_sync_updated_at = datetime('now'),
Open commit View diff
1533 calendar_sync_updated_at = datetime('now'),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1534
              updated_at = datetime('now')
Open commit View diff
1534 updated_at = datetime('now')
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1535
          WHERE id = ?4 AND status = 'confirmed'
Open commit View diff
1535 WHERE id = ?4 AND status = 'confirmed'
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1536
        `).bind(new Date(startMs).toISOString(), new Date(endMs).toISOString(), updated.meetUrl, booking.id),
Open commit View diff
1536 `).bind(new Date(startMs).toISOString(), new Date(endMs).toISOString(), updated.meetUrl, booking.id),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1537
        env.DB.prepare('UPDATE slot_locks SET expires_at = ?1 WHERE booking_id = ?2')
Open commit View diff
1537 env.DB.prepare('UPDATE slot_locks SET expires_at = ?1 WHERE booking_id = ?2')
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1538
          .bind(Date.now() + 10 * 60_000, booking.id),
Open commit View diff
1538 .bind(Date.now() + 10 * 60_000, booking.id),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1539
      ]);
Open commit View diff
1539 ]);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1540
    } catch (error) {
Open commit View diff
1540 } catch (error) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1541
      await rescheduleCalendarEvent(env, settings, booking.google_event_id, {
Open commit View diff
1541 await rescheduleCalendarEvent(env, settings, booking.google_event_id, {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1542
        phone: booking.phone ?? undefined,
Open commit View diff
1542 phone: booking.phone ?? undefined,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1543
        message: booking.message ?? undefined,
Open commit View diff
1543 message: booking.message ?? undefined,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1544
        paid: booking.payment_status === 'paid',
Open commit View diff
1544 paid: booking.payment_status === 'paid',
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1545
        publicBookingId: booking.public_booking_id ?? undefined,
Open commit View diff
1545 publicBookingId: booking.public_booking_id ?? undefined,
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1546
        start: booking.start_time,
Open commit View diff
1546 start: booking.start_time,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1547
        end: booking.end_time,
Open commit View diff
1547 end: booking.end_time,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1548
      }).catch(() => undefined);
Open commit View diff
1548 }).catch(() => undefined);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1549
      throw error;
Open commit View diff
1549 throw error;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1550
    }
Open commit View diff
1550 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1551
  } catch (error) {
Open commit View diff
1551 } catch (error) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1552
    await env.DB.prepare('DELETE FROM slot_locks WHERE booking_id = ?1').bind(booking.id).run().catch(() => undefined);
Open commit View diff
1552 await env.DB.prepare('DELETE FROM slot_locks WHERE booking_id = ?1').bind(booking.id).run().catch(() => undefined);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1553
    throw error;
Open commit View diff
1553 throw error;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1554
  }
Open commit View diff
1554 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1555
Open commit View diff
1555
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1556
  const result = await paymentBookingById(env, booking.id);
Open commit View diff
1556 const result = await paymentBookingById(env, booking.id);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1557
  if (!result) throw new Error('Rescheduled booking record was not found.');
Open commit View diff
1557 if (!result) throw new Error('Rescheduled booking record was not found.');
Alex Nord about 16 hours ago 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1558
  await logActivity(env, booking.id, source === 'guest_suggestion' ? 'time_suggestion_accepted' : 'booking_rescheduled', {
Open commit View diff
1558 await logActivity(env, booking.id, source === 'guest_suggestion' ? 'time_suggestion_accepted' : 'booking_rescheduled', {
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1559
    source,
Open commit View diff
1559 source,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1560
    oldStart: booking.start_time,
Open commit View diff
1560 oldStart: booking.start_time,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1561
    oldEnd: booking.end_time,
Open commit View diff
1561 oldEnd: booking.end_time,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1562
    newStart: result.start_time,
Open commit View diff
1562 newStart: result.start_time,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1563
    newEnd: result.end_time,
Open commit View diff
1563 newEnd: result.end_time,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1564
    duration: booking.duration_minutes,
Open commit View diff
1564 duration: booking.duration_minutes,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1565
  }, `booking:${booking.id}:reschedule:${result.reschedule_count}`);
Open commit View diff
1565 }, `booking:${booking.id}:reschedule:${result.reschedule_count}`);
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1566
  return result;
Open commit View diff
1566 return result;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1567
}
Open commit View diff
1567 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1568
Open commit View diff
1568
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1569
async function adminRescheduleBooking(env: Env, bookingId: string, start: string): Promise<Response> {
Open commit View diff
1569 async function adminRescheduleBooking(env: Env, bookingId: string, start: string): Promise<Response> {
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1570
  if (!/^[0-9a-f-]{36}$/i.test(bookingId)) return json({ error: 'Invalid booking id.' }, 400);
Open commit View diff
1570 if (!/^[0-9a-f-]{36}$/i.test(bookingId)) return json({ error: 'Invalid booking id.' }, 400);
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1571
  const booking = await paymentBookingById(env, bookingId);
Open commit View diff
1571 const booking = await paymentBookingById(env, bookingId);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1572
  if (!booking) return json({ error: 'Booking not found.' }, 404);
Open commit View diff
1572 if (!booking) return json({ error: 'Booking not found.' }, 404);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1573
  try {
Open commit View diff
1573 try {
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1574
    const updated = await rescheduleConfirmedBooking(env, booking, start, 'admin');
Open commit View diff
1574 const updated = await rescheduleConfirmedBooking(env, booking, start, 'admin');
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1575
    return json({ ok: true, booking: publicConfirmation(updated) });
Open commit View diff
1575 return json({ ok: true, booking: publicConfirmation(updated) });
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1576
  } catch (error) {
Open commit View diff
1576 } catch (error) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1577
    if (error instanceof GoogleCalendarError) return json({ error: error.publicMessage }, 502);
Open commit View diff
1577 if (error instanceof GoogleCalendarError) return json({ error: error.publicMessage }, 502);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1578
    return json({ error: errorMessage(error) }, /available|busy|future|took/i.test(errorMessage(error)) ? 409 : 400);
Open commit View diff
1578 return json({ error: errorMessage(error) }, /available|busy|future|took/i.test(errorMessage(error)) ? 409 : 400);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1579
  }
Open commit View diff
1579 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1580
}
Open commit View diff
1580 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1581
Open commit View diff
1581
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1582
async function adminSuggestNewTime(env: Env, bookingId: string, start: string): Promise<Response> {
Open commit View diff
1582 async function adminSuggestNewTime(env: Env, bookingId: string, start: string): Promise<Response> {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1583
  if (!/^[0-9a-f-]{36}$/i.test(bookingId)) return json({ error: 'Invalid booking id.' }, 400);
Open commit View diff
1583 if (!/^[0-9a-f-]{36}$/i.test(bookingId)) return json({ error: 'Invalid booking id.' }, 400);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1584
  const booking = await paymentBookingById(env, bookingId);
Open commit View diff
1584 const booking = await paymentBookingById(env, bookingId);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1585
  if (!booking) return json({ error: 'Booking not found.' }, 404);
Open commit View diff
1585 if (!booking) return json({ error: 'Booking not found.' }, 404);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1586
  if (booking.status !== 'confirmed') return json({ error: 'Only confirmed bookings can receive a new-time suggestion.' }, 409);
Open commit View diff
1586 if (booking.status !== 'confirmed') return json({ error: 'Only confirmed bookings can receive a new-time suggestion.' }, 409);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1587
  if (!booking.google_event_id) return json({ error: 'This booking is missing its Google Calendar event.' }, 409);
Open commit View diff
1587 if (!booking.google_event_id) return json({ error: 'This booking is missing its Google Calendar event.' }, 409);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1588
Open commit View diff
1588
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1589
  try {
Open commit View diff
1589 try {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1590
    const { settings, startMs, endMs } = await assertRescheduleSlotAvailable(env, booking, start);
Open commit View diff
1590 const { settings, startMs, endMs } = await assertRescheduleSlotAvailable(env, booking, start);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1591
    const token = randomUrlToken();
Open commit View diff
1591 const token = randomUrlToken();
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1592
    const tokenHash = await sha256Base64Url(token);
Open commit View diff
1592 const tokenHash = await sha256Base64Url(token);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1593
    const suggestionUrl = `${env.APP_URL.replace(/\/+$/, '')}/reschedule/${encodeURIComponent(token)}`;
Open commit View diff
1593 const suggestionUrl = `${env.APP_URL.replace(/\/+$/, '')}/reschedule/${encodeURIComponent(token)}`;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1594
    await env.DB.prepare(`
Open commit View diff
1594 await env.DB.prepare(`
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1595
      UPDATE bookings
Open commit View diff
1595 UPDATE bookings
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1596
      SET proposed_start_time = ?1,
Open commit View diff
1596 SET proposed_start_time = ?1,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1597
          proposed_end_time = ?2,
Open commit View diff
1597 proposed_end_time = ?2,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1598
          proposed_at = datetime('now'),
Open commit View diff
1598 proposed_at = datetime('now'),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1599
          proposal_status = 'pending',
Open commit View diff
1599 proposal_status = 'pending',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1600
          proposal_token_hash = ?3,
Open commit View diff
1600 proposal_token_hash = ?3,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1601
          updated_at = datetime('now')
Open commit View diff
1601 updated_at = datetime('now')
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1602
      WHERE id = ?4 AND status = 'confirmed'
Open commit View diff
1602 WHERE id = ?4 AND status = 'confirmed'
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1603
    `).bind(new Date(startMs).toISOString(), new Date(endMs).toISOString(), tokenHash, booking.id).run();
Open commit View diff
1603 `).bind(new Date(startMs).toISOString(), new Date(endMs).toISOString(), tokenHash, booking.id).run();
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1604
Open commit View diff
1604
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1605
    try {
Open commit View diff
1605 try {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1606
      await sendRescheduleSuggestion(env, settings, booking.google_event_id, {
Open commit View diff
1606 await sendRescheduleSuggestion(env, settings, booking.google_event_id, {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1607
        phone: booking.phone ?? undefined,
Open commit View diff
1607 phone: booking.phone ?? undefined,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1608
        message: booking.message ?? undefined,
Open commit View diff
1608 message: booking.message ?? undefined,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1609
        paid: booking.payment_status === 'paid',
Open commit View diff
1609 paid: booking.payment_status === 'paid',
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1610
        publicBookingId: booking.public_booking_id ?? undefined,
Open commit View diff
1610 publicBookingId: booking.public_booking_id ?? undefined,
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1611
      }, {
Open commit View diff
1611 }, {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1612
        start: new Date(startMs).toISOString(),
Open commit View diff
1612 start: new Date(startMs).toISOString(),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1613
        end: new Date(endMs).toISOString(),
Open commit View diff
1613 end: new Date(endMs).toISOString(),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1614
        url: suggestionUrl,
Open commit View diff
1614 url: suggestionUrl,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1615
      });
Open commit View diff
1615 });
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1616
    } catch (error) {
Open commit View diff
1616 } catch (error) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1617
      await env.DB.prepare(`
Open commit View diff
1617 await env.DB.prepare(`
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1618
        UPDATE bookings
Open commit View diff
1618 UPDATE bookings
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1619
        SET proposed_start_time = NULL, proposed_end_time = NULL, proposed_at = NULL,
Open commit View diff
1619 SET proposed_start_time = NULL, proposed_end_time = NULL, proposed_at = NULL,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1620
            proposal_status = NULL, proposal_token_hash = NULL, updated_at = datetime('now')
Open commit View diff
1620 proposal_status = NULL, proposal_token_hash = NULL, updated_at = datetime('now')
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1621
        WHERE id = ?1
Open commit View diff
1621 WHERE id = ?1
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1622
      `).bind(booking.id).run().catch(() => undefined);
Open commit View diff
1622 `).bind(booking.id).run().catch(() => undefined);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1623
      throw error;
Open commit View diff
1623 throw error;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1624
    }
Open commit View diff
1624 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1625
Open commit View diff
1625
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1626
    await logActivity(env, booking.id, 'time_suggested', {
Open commit View diff
1626 await logActivity(env, booking.id, 'time_suggested', {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1627
      currentStart: booking.start_time,
Open commit View diff
1627 currentStart: booking.start_time,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1628
      currentEnd: booking.end_time,
Open commit View diff
1628 currentEnd: booking.end_time,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1629
      proposedStart: new Date(startMs).toISOString(),
Open commit View diff
1629 proposedStart: new Date(startMs).toISOString(),
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1630
      proposedEnd: new Date(endMs).toISOString(),
Open commit View diff
1630 proposedEnd: new Date(endMs).toISOString(),
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1631
      duration: booking.duration_minutes,
Open commit View diff
1631 duration: booking.duration_minutes,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1632
    }, `suggest:${tokenHash}`);
Open commit View diff
1632 }, `suggest:${tokenHash}`);
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1633
Open commit View diff
1633
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1634
    return json({
Open commit View diff
1634 return json({
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1635
      ok: true,
Open commit View diff
1635 ok: true,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1636
      suggestionUrl,
Open commit View diff
1636 suggestionUrl,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1637
      proposedStart: new Date(startMs).toISOString(),
Open commit View diff
1637 proposedStart: new Date(startMs).toISOString(),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1638
      proposedEnd: new Date(endMs).toISOString(),
Open commit View diff
1638 proposedEnd: new Date(endMs).toISOString(),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1639
    });
Open commit View diff
1639 });
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1640
  } catch (error) {
Open commit View diff
1640 } catch (error) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1641
    if (error instanceof GoogleCalendarError) return json({ error: error.publicMessage }, 502);
Open commit View diff
1641 if (error instanceof GoogleCalendarError) return json({ error: error.publicMessage }, 502);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1642
    return json({ error: errorMessage(error) }, /available|busy|future/i.test(errorMessage(error)) ? 409 : 400);
Open commit View diff
1642 return json({ error: errorMessage(error) }, /available|busy|future/i.test(errorMessage(error)) ? 409 : 400);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1643
  }
Open commit View diff
1643 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1644
}
Open commit View diff
1644 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1645
Open commit View diff
1645
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1646
async function proposalBookingByToken(env: Env, token: string): Promise<PaymentBookingRow | null> {
Open commit View diff
1646 async function proposalBookingByToken(env: Env, token: string): Promise<PaymentBookingRow | null> {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1647
  if (!/^[A-Za-z0-9_-]{20,200}$/.test(token)) return null;
Open commit View diff
1647 if (!/^[A-Za-z0-9_-]{20,200}$/.test(token)) return null;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1648
  const hash = await sha256Base64Url(token);
Open commit View diff
1648 const hash = await sha256Base64Url(token);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1649
  return env.DB.prepare(`
Open commit View diff
1649 return env.DB.prepare(`
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1650
    SELECT id, public_booking_id, name, email, phone, message, start_time, end_time, duration_minutes,
Open commit View diff
1650 SELECT id, public_booking_id, name, email, phone, message, start_time, end_time, duration_minutes,
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1651
           timezone, meeting_mode, status, google_event_id, meet_url, payment_status,
Open commit View diff
1651 timezone, meeting_mode, status, google_event_id, meet_url, payment_status,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1652
           payment_amount, payment_currency, stripe_checkout_session_id, stripe_payment_intent_id, paid_at,
Open commit View diff
1652 payment_amount, payment_currency, stripe_checkout_session_id, stripe_payment_intent_id, paid_at,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1653
           rescheduled_at, reschedule_count, proposed_start_time, proposed_end_time, proposed_at,
Open commit View diff
1653 rescheduled_at, reschedule_count, proposed_start_time, proposed_end_time, proposed_at,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1654
           proposal_status, proposal_token_hash, refund_status, stripe_refund_id, refunded_amount,
Open commit View diff
1654 proposal_status, proposal_token_hash, refund_status, stripe_refund_id, refunded_amount,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1655
           refunded_at, updated_at
Open commit View diff
1655 refunded_at, updated_at
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1656
    FROM bookings
Open commit View diff
1656 FROM bookings
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1657
    WHERE proposal_token_hash = ?1
Open commit View diff
1657 WHERE proposal_token_hash = ?1
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1658
      AND proposal_status = 'pending'
Open commit View diff
1658 AND proposal_status = 'pending'
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1659
  `).bind(hash).first<PaymentBookingRow>();
Open commit View diff
1659 `).bind(hash).first<PaymentBookingRow>();
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1660
}
Open commit View diff
1660 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1661
Open commit View diff
1661
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1662
async function getRescheduleProposal(env: Env, token: string): Promise<Response> {
Open commit View diff
1662 async function getRescheduleProposal(env: Env, token: string): Promise<Response> {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1663
  const booking = await proposalBookingByToken(env, token);
Open commit View diff
1663 const booking = await proposalBookingByToken(env, token);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1664
  if (!booking || !booking.proposed_start_time || !booking.proposed_end_time) {
Open commit View diff
1664 if (!booking || !booking.proposed_start_time || !booking.proposed_end_time) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1665
    return json({ error: 'This reschedule suggestion is invalid or no longer active.' }, 404);
Open commit View diff
1665 return json({ error: 'This reschedule suggestion is invalid or no longer active.' }, 404);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1666
  }
Open commit View diff
1666 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1667
  const settings = await getSettings(env);
Open commit View diff
1667 const settings = await getSettings(env);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1668
  return json({
Open commit View diff
1668 return json({
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1669
    title: settings.title,
Open commit View diff
1669 title: settings.title,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1670
    name: booking.name,
Open commit View diff
1670 name: booking.name,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1671
    currentStart: booking.start_time,
Open commit View diff
1671 currentStart: booking.start_time,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1672
    currentEnd: booking.end_time,
Open commit View diff
1672 currentEnd: booking.end_time,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1673
    proposedStart: booking.proposed_start_time,
Open commit View diff
1673 proposedStart: booking.proposed_start_time,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1674
    proposedEnd: booking.proposed_end_time,
Open commit View diff
1674 proposedEnd: booking.proposed_end_time,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1675
    duration: booking.duration_minutes,
Open commit View diff
1675 duration: booking.duration_minutes,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1676
    timezone: booking.timezone,
Open commit View diff
1676 timezone: booking.timezone,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1677
    meetingMode: booking.meeting_mode,
Open commit View diff
1677 meetingMode: booking.meeting_mode,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1678
  });
Open commit View diff
1678 });
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1679
}
Open commit View diff
1679 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1680
Open commit View diff
1680
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1681
async function acceptRescheduleProposal(env: Env, token: string): Promise<Response> {
Open commit View diff
1681 async function acceptRescheduleProposal(env: Env, token: string): Promise<Response> {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1682
  const booking = await proposalBookingByToken(env, token);
Open commit View diff
1682 const booking = await proposalBookingByToken(env, token);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1683
  if (!booking || !booking.proposed_start_time) {
Open commit View diff
1683 if (!booking || !booking.proposed_start_time) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1684
    return json({ error: 'This reschedule suggestion is invalid or no longer active.' }, 404);
Open commit View diff
1684 return json({ error: 'This reschedule suggestion is invalid or no longer active.' }, 404);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1685
  }
Open commit View diff
1685 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1686
  try {
Open commit View diff
1686 try {
Alex Nord about 16 hours ago 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1687
    const updated = await rescheduleConfirmedBooking(env, booking, booking.proposed_start_time, 'guest_suggestion');
Open commit View diff
1687 const updated = await rescheduleConfirmedBooking(env, booking, booking.proposed_start_time, 'guest_suggestion');
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1688
    return json({ ok: true, booking: publicConfirmation(updated) });
Open commit View diff
1688 return json({ ok: true, booking: publicConfirmation(updated) });
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1689
  } catch (error) {
Open commit View diff
1689 } catch (error) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1690
    if (error instanceof GoogleCalendarError) return json({ error: error.publicMessage }, 502);
Open commit View diff
1690 if (error instanceof GoogleCalendarError) return json({ error: error.publicMessage }, 502);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1691
    return json({ error: errorMessage(error) }, /available|busy|future|took/i.test(errorMessage(error)) ? 409 : 400);
Open commit View diff
1691 return json({ error: errorMessage(error) }, /available|busy|future|took/i.test(errorMessage(error)) ? 409 : 400);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1692
  }
Open commit View diff
1692 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1693
}
Open commit View diff
1693 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1694
Open commit View diff
1694
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1695
async function cancelBooking(env: Env, bookingId: string, allowStaleStripeRelease = false): Promise<Response> {
Open commit View diff
1695 async function cancelBooking(env: Env, bookingId: string, allowStaleStripeRelease = false): Promise<Response> {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1696
  if (!/^[0-9a-f-]{36}$/i.test(bookingId)) return json({ error: 'Invalid booking id.' }, 400);
Open commit View diff
1696 if (!/^[0-9a-f-]{36}$/i.test(bookingId)) return json({ error: 'Invalid booking id.' }, 400);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1697
  const booking = await paymentBookingById(env, bookingId);
Open commit View diff
1697 const booking = await paymentBookingById(env, bookingId);
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1698
Open commit View diff
1698
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1699
  if (!booking) return json({ error: 'Booking not found.' }, 404);
Open commit View diff
1699 if (!booking) return json({ error: 'Booking not found.' }, 404);
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1700
  if (booking.status === 'cancelled') {
Open commit View diff
1700 if (booking.status === 'cancelled') {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1701
    return json({
Open commit View diff
1701 return json({
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1702
      ok: true,
Open commit View diff
1702 ok: true,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1703
      refunded: booking.refund_status === 'succeeded' || booking.refund_status === 'pending',
Open commit View diff
1703 refunded: booking.refund_status === 'succeeded' || booking.refund_status === 'pending',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1704
      refundStatus: booking.refund_status,
Open commit View diff
1704 refundStatus: booking.refund_status,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1705
    });
Open commit View diff
1705 });
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1706
  }
Open commit View diff
1706 }
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1707
  if (booking.status === 'pending' && booking.payment_status !== 'not_requested') {
Open commit View diff
1707 if (booking.status === 'pending' && booking.payment_status !== 'not_requested') {
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1708
    return cancelPendingPayment(env, bookingId, { allowStaleStripeRelease });
Open commit View diff
1708 return cancelPendingPayment(env, bookingId, { allowStaleStripeRelease });
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1709
  }
Open commit View diff
1709 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1710
  if (booking.status !== 'confirmed') return json({ error: 'Only confirmed bookings or pending payment holds can be cancelled.' }, 409);
Open commit View diff
1710 if (booking.status !== 'confirmed') return json({ error: 'Only confirmed bookings or pending payment holds can be cancelled.' }, 409);
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1711
Open commit View diff
1711
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1712
  let refundStatus = booking.refund_status;
Open commit View diff
1712 let refundStatus = booking.refund_status;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1713
  let refunded = refundStatus === 'succeeded' || refundStatus === 'pending';
Open commit View diff
1713 let refunded = refundStatus === 'succeeded' || refundStatus === 'pending';
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1714
  let refundWarning: string | null = null;
Open commit View diff
1714 let refundWarning: string | null = null;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1715
Open commit View diff
1715
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1716
  if (booking.payment_status === 'paid' && !refunded) {
Open commit View diff
1716 if (booking.payment_status === 'paid' && !refunded) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1717
    if (!stripeConfigured(env)) {
Open commit View diff
1717 if (!stripeConfigured(env)) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1718
      return json({ error: 'This booking was paid, but Stripe is not configured. Slot will not cancel it without attempting the refund.' }, 503);
Open commit View diff
1718 return json({ error: 'This booking was paid, but Stripe is not configured. Slot will not cancel it without attempting the refund.' }, 503);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1719
    }
Open commit View diff
1719 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1720
    const sessionMode = stripeCheckoutSessionMode(booking.stripe_checkout_session_id);
Open commit View diff
1720 const sessionMode = stripeCheckoutSessionMode(booking.stripe_checkout_session_id);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1721
    const configuredMode = stripeMode(env);
Open commit View diff
1721 const configuredMode = stripeMode(env);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1722
    if (sessionMode !== 'unknown' && configuredMode !== 'unknown' && sessionMode !== configuredMode) {
Open commit View diff
1722 if (sessionMode !== 'unknown' && configuredMode !== 'unknown' && sessionMode !== configuredMode) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1723
      return json({
Open commit View diff
1723 return json({
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1724
        error: `This booking was paid in Stripe ${sessionMode} mode, but Slot is currently using ${configuredMode} mode. Switch to the ${sessionMode} Stripe key before cancelling so Slot can refund the payment.`,
Open commit View diff
1724 error: `This booking was paid in Stripe ${sessionMode} mode, but Slot is currently using ${configuredMode} mode. Switch to the ${sessionMode} Stripe key before cancelling so Slot can refund the payment.`,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1725
        code: 'stripe_mode_mismatch',
Open commit View diff
1725 code: 'stripe_mode_mismatch',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1726
      }, 409);
Open commit View diff
1726 }, 409);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1727
    }
Open commit View diff
1727 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1728
Open commit View diff
1728
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1729
    let paymentIntentId = booking.stripe_payment_intent_id;
Open commit View diff
1729 let paymentIntentId = booking.stripe_payment_intent_id;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1730
    if (!paymentIntentId && booking.stripe_checkout_session_id) {
Open commit View diff
1730 if (!paymentIntentId && booking.stripe_checkout_session_id) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1731
      try {
Open commit View diff
1731 try {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1732
        const session = await retrieveStripeCheckoutSession(env, booking.stripe_checkout_session_id);
Open commit View diff
1732 const session = await retrieveStripeCheckoutSession(env, booking.stripe_checkout_session_id);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1733
        paymentIntentId = stripePaymentIntentId(session);
Open commit View diff
1733 paymentIntentId = stripePaymentIntentId(session);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1734
        if (paymentIntentId) {
Open commit View diff
1734 if (paymentIntentId) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1735
          await env.DB.prepare(`
Open commit View diff
1735 await env.DB.prepare(`
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1736
            UPDATE bookings
Open commit View diff
1736 UPDATE bookings
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1737
            SET stripe_payment_intent_id = ?1, updated_at = datetime('now')
Open commit View diff
1737 SET stripe_payment_intent_id = ?1, updated_at = datetime('now')
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1738
            WHERE id = ?2
Open commit View diff
1738 WHERE id = ?2
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1739
          `).bind(paymentIntentId, booking.id).run();
Open commit View diff
1739 `).bind(paymentIntentId, booking.id).run();
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1740
        }
Open commit View diff
1740 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1741
      } catch (error) {
Open commit View diff
1741 } catch (error) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1742
        if (error instanceof StripeError) return json({ error: error.message }, error.status);
Open commit View diff
1742 if (error instanceof StripeError) return json({ error: error.message }, error.status);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1743
        throw error;
Open commit View diff
1743 throw error;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1744
      }
Open commit View diff
1744 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1745
    }
Open commit View diff
1745 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1746
    if (!paymentIntentId) {
Open commit View diff
1746 if (!paymentIntentId) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1747
      return json({ error: 'This paid booking is missing its Stripe PaymentIntent, so Slot cannot safely refund it.' }, 409);
Open commit View diff
1747 return json({ error: 'This paid booking is missing its Stripe PaymentIntent, so Slot cannot safely refund it.' }, 409);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1748
    }
Open commit View diff
1748 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1749
Open commit View diff
1749
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1750
    try {
Open commit View diff
1750 try {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1751
      const refund = await createStripeRefund(env, paymentIntentId, booking.id);
Open commit View diff
1751 const refund = await createStripeRefund(env, paymentIntentId, booking.id);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1752
      refundStatus = refund.status ?? 'pending';
Open commit View diff
1752 refundStatus = refund.status ?? 'pending';
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1753
      if (refundStatus === 'failed' || refundStatus === 'canceled' || refundStatus === 'requires_action') {
Open commit View diff
1753 if (refundStatus === 'failed' || refundStatus === 'canceled' || refundStatus === 'requires_action') {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1754
        await env.DB.prepare(`
Open commit View diff
1754 await env.DB.prepare(`
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1755
          UPDATE bookings
Open commit View diff
1755 UPDATE bookings
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1756
          SET refund_status = ?1,
Open commit View diff
1756 SET refund_status = ?1,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1757
              stripe_refund_id = ?2,
Open commit View diff
1757 stripe_refund_id = ?2,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1758
              refunded_amount = ?3,
Open commit View diff
1758 refunded_amount = ?3,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1759
              updated_at = datetime('now')
Open commit View diff
1759 updated_at = datetime('now')
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1760
          WHERE id = ?4
Open commit View diff
1760 WHERE id = ?4
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1761
        `).bind(refundStatus, refund.id, refund.amount, booking.id).run();
Open commit View diff
1761 `).bind(refundStatus, refund.id, refund.amount, booking.id).run();
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1762
        await logActivity(env, booking.id, 'refund_failed', {
Open commit View diff
1762 await logActivity(env, booking.id, 'refund_failed', {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1763
          amount: refund.amount,
Open commit View diff
1763 amount: refund.amount,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1764
          currency: booking.payment_currency,
Open commit View diff
1764 currency: booking.payment_currency,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1765
          refundStatus,
Open commit View diff
1765 refundStatus,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1766
        }, `refund:${refund.id}:${refundStatus}`);
Open commit View diff
1766 }, `refund:${refund.id}:${refundStatus}`);
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1767
        return json({ error: `Stripe created refund ${refund.id}, but its status is ${refundStatus}. The booking has not been cancelled.` }, 502);
Open commit View diff
1767 return json({ error: `Stripe created refund ${refund.id}, but its status is ${refundStatus}. The booking has not been cancelled.` }, 502);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1768
      }
Open commit View diff
1768 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1769
      refunded = true;
Open commit View diff
1769 refunded = true;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1770
      await env.DB.prepare(`
Open commit View diff
1770 await env.DB.prepare(`
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1771
        UPDATE bookings
Open commit View diff
1771 UPDATE bookings
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1772
        SET refund_status = ?1,
Open commit View diff
1772 SET refund_status = ?1,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1773
            stripe_refund_id = ?2,
Open commit View diff
1773 stripe_refund_id = ?2,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1774
            refunded_amount = ?3,
Open commit View diff
1774 refunded_amount = ?3,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1775
            refunded_at = CASE WHEN ?1 = 'succeeded' THEN datetime('now') ELSE refunded_at END,
Open commit View diff
1775 refunded_at = CASE WHEN ?1 = 'succeeded' THEN datetime('now') ELSE refunded_at END,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1776
            updated_at = datetime('now')
Open commit View diff
1776 updated_at = datetime('now')
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1777
        WHERE id = ?4
Open commit View diff
1777 WHERE id = ?4
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1778
      `).bind(refundStatus, refund.id, refund.amount, booking.id).run();
Open commit View diff
1778 `).bind(refundStatus, refund.id, refund.amount, booking.id).run();
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1779
      await logActivity(env, booking.id, refundStatus === 'succeeded' ? 'refund_succeeded' : 'refund_started', {
Open commit View diff
1779 await logActivity(env, booking.id, refundStatus === 'succeeded' ? 'refund_succeeded' : 'refund_started', {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1780
        amount: refund.amount,
Open commit View diff
1780 amount: refund.amount,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1781
        currency: booking.payment_currency,
Open commit View diff
1781 currency: booking.payment_currency,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1782
        refundStatus,
Open commit View diff
1782 refundStatus,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1783
      }, `refund:${refund.id}:${refundStatus}`);
Open commit View diff
1783 }, `refund:${refund.id}:${refundStatus}`);
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1784
      if (refundStatus === 'pending') {
Open commit View diff
1784 if (refundStatus === 'pending') {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1785
        refundWarning = 'Stripe accepted the refund, but it is still pending.';
Open commit View diff
1785 refundWarning = 'Stripe accepted the refund, but it is still pending.';
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1786
      }
Open commit View diff
1786 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1787
    } catch (error) {
Open commit View diff
1787 } catch (error) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1788
      if (error instanceof StripeError) return json({ error: `Stripe refund failed: ${error.message}` }, error.status);
Open commit View diff
1788 if (error instanceof StripeError) return json({ error: `Stripe refund failed: ${error.message}` }, error.status);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1789
      throw error;
Open commit View diff
1789 throw error;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1790
    }
Open commit View diff
1790 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1791
  }
Open commit View diff
1791 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1792
Open commit View diff
1792
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1793
  const settings = await getSettings(env);
Open commit View diff
1793 const settings = await getSettings(env);
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1794
  let calendarWarning: string | null = null;
Open commit View diff
1794 let calendarWarning: string | null = null;
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1795
  try {
Open commit View diff
1795 try {
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1796
    if (booking.google_event_id) await deleteCalendarEvent(env, settings, booking.google_event_id);
Open commit View diff
1796 if (booking.google_event_id) await deleteCalendarEvent(env, settings, booking.google_event_id);
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1797
  } catch (error) {
Open commit View diff
1797 } catch (error) {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1798
    const message = privateCalendarError(error);
Open commit View diff
1798 const message = privateCalendarError(error);
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1799
    if (!refunded) {
Open commit View diff
1799 if (!refunded) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1800
      await env.DB.prepare(`
Open commit View diff
1800 await env.DB.prepare(`
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1801
        UPDATE bookings
Open commit View diff
1801 UPDATE bookings
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1802
        SET calendar_sync_status = 'failed',
Open commit View diff
1802 SET calendar_sync_status = 'failed',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1803
            calendar_sync_error = ?1,
Open commit View diff
1803 calendar_sync_error = ?1,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1804
            calendar_sync_updated_at = datetime('now'),
Open commit View diff
1804 calendar_sync_updated_at = datetime('now'),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1805
            updated_at = datetime('now')
Open commit View diff
1805 updated_at = datetime('now')
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1806
        WHERE id = ?2
Open commit View diff
1806 WHERE id = ?2
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1807
      `).bind(message, bookingId).run();
Open commit View diff
1807 `).bind(message, bookingId).run();
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1808
      return json({ error: 'Slot could not cancel the Google Calendar event. The booking has not been cancelled.' }, 502);
Open commit View diff
1808 return json({ error: 'Slot could not cancel the Google Calendar event. The booking has not been cancelled.' }, 502);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1809
    }
Open commit View diff
1809 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1810
    calendarWarning = 'The Stripe refund was created, but Google Calendar could not be updated. Remove the calendar event manually.';
Open commit View diff
1810 calendarWarning = 'The Stripe refund was created, but Google Calendar could not be updated. Remove the calendar event manually.';
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1811
  }
Open commit View diff
1811 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1812
Open commit View diff
1812
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1813
  await env.DB.batch([
Open commit View diff
1813 await env.DB.batch([
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1814
    env.DB.prepare(`
Open commit View diff
1814 env.DB.prepare(`
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1815
      UPDATE bookings
Open commit View diff
1815 UPDATE bookings
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1816
      SET status = 'cancelled',
Open commit View diff
1816 SET status = 'cancelled',
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1817
          cancelled_at = datetime('now'),
Open commit View diff
1817 cancelled_at = datetime('now'),
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1818
          proposed_start_time = NULL,
Open commit View diff
1818 proposed_start_time = NULL,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1819
          proposed_end_time = NULL,
Open commit View diff
1819 proposed_end_time = NULL,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1820
          proposed_at = NULL,
Open commit View diff
1820 proposed_at = NULL,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1821
          proposal_status = NULL,
Open commit View diff
1821 proposal_status = NULL,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1822
          proposal_token_hash = NULL,
Open commit View diff
1822 proposal_token_hash = NULL,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1823
          calendar_sync_status = ?1,
Open commit View diff
1823 calendar_sync_status = ?1,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1824
          calendar_sync_error = ?2,
Open commit View diff
1824 calendar_sync_error = ?2,
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1825
          calendar_sync_updated_at = datetime('now'),
Open commit View diff
1825 calendar_sync_updated_at = datetime('now'),
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1826
          updated_at = datetime('now')
Open commit View diff
1826 updated_at = datetime('now')
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1827
      WHERE id = ?3
Open commit View diff
1827 WHERE id = ?3
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1828
    `).bind(calendarWarning ? 'failed' : 'synced', calendarWarning, bookingId),
Open commit View diff
1828 `).bind(calendarWarning ? 'failed' : 'synced', calendarWarning, bookingId),
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1829
    env.DB.prepare('DELETE FROM slot_locks WHERE booking_id = ?1').bind(bookingId),
Open commit View diff
1829 env.DB.prepare('DELETE FROM slot_locks WHERE booking_id = ?1').bind(bookingId),
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1830
  ]);
Open commit View diff
1830 ]);
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1831
  await logActivity(env, bookingId, 'booking_cancelled', {
Open commit View diff
1831 await logActivity(env, bookingId, 'booking_cancelled', {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1832
    start: booking.start_time,
Open commit View diff
1832 start: booking.start_time,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1833
    end: booking.end_time,
Open commit View diff
1833 end: booking.end_time,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1834
    duration: booking.duration_minutes,
Open commit View diff
1834 duration: booking.duration_minutes,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1835
    refunded,
Open commit View diff
1835 refunded,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1836
    refundStatus,
Open commit View diff
1836 refundStatus,
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1837
  }, `booking:${bookingId}:cancelled`);
Open commit View diff
1837 }, `booking:${bookingId}:cancelled`);
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1838
Open commit View diff
1838
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1839
  return json({
Open commit View diff
1839 return json({
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1840
    ok: true,
Open commit View diff
1840 ok: true,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1841
    refunded,
Open commit View diff
1841 refunded,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1842
    refundStatus,
Open commit View diff
1842 refundStatus,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1843
    warning: [refundWarning, calendarWarning].filter(Boolean).join(' ') || undefined,
Open commit View diff
1843 warning: [refundWarning, calendarWarning].filter(Boolean).join(' ') || undefined,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
1844
  });
Open commit View diff
1844 });
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1845
}
Open commit View diff
1845 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1846
Open commit View diff
1846
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1847
async function publicCancelBooking(request: Request, env: Env, value: unknown): Promise<Response> {
Open commit View diff
1847 async function publicCancelBooking(request: Request, env: Env, value: unknown): Promise<Response> {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1848
  if (!(await enforceCancellationRateLimit(request, env))) {
Open commit View diff
1848 if (!(await enforceCancellationRateLimit(request, env))) {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1849
    return json({ error: 'Too many cancellation attempts. Try again later.' }, 429);
Open commit View diff
1849 return json({ error: 'Too many cancellation attempts. Try again later.' }, 429);
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1850
  }
Open commit View diff
1850 }
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1851
Open commit View diff
1851
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1852
  const publicBookingId = normalizePublicBookingId(value);
Open commit View diff
1852 const publicBookingId = normalizePublicBookingId(value);
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1853
  if (!publicBookingId) return json({ error: 'Enter a valid Slot booking ID.' }, 400);
Open commit View diff
1853 if (!publicBookingId) return json({ error: 'Enter a valid Slot booking ID.' }, 400);
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1854
Open commit View diff
1854
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1855
  const row = await env.DB.prepare(`
Open commit View diff
1855 const row = await env.DB.prepare(`
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1856
    SELECT id, status, end_time
Open commit View diff
1856 SELECT id, status, end_time
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1857
    FROM bookings
Open commit View diff
1857 FROM bookings
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1858
    WHERE public_booking_id = ?1
Open commit View diff
1858 WHERE public_booking_id = ?1
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1859
  `).bind(publicBookingId).first<{ id: string; status: string; end_time: string }>();
Open commit View diff
1859 `).bind(publicBookingId).first<{ id: string; status: string; end_time: string }>();
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1860
Open commit View diff
1860
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1861
  if (!row) return json({ error: 'Booking ID not found.' }, 404);
Open commit View diff
1861 if (!row) return json({ error: 'Booking ID not found.' }, 404);
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1862
  if (row.status === 'cancelled') return json({ ok: true, alreadyCancelled: true });
Open commit View diff
1862 if (row.status === 'cancelled') return json({ ok: true, alreadyCancelled: true });
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1863
  if (row.status !== 'confirmed') return json({ error: 'This booking is not currently confirmed.' }, 409);
Open commit View diff
1863 if (row.status !== 'confirmed') return json({ error: 'This booking is not currently confirmed.' }, 409);
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1864
  if (Date.parse(row.end_time) <= Date.now()) return json({ error: 'Past bookings cannot be cancelled.' }, 409);
Open commit View diff
1864 if (Date.parse(row.end_time) <= Date.now()) return json({ error: 'Past bookings cannot be cancelled.' }, 409);
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1865
Open commit View diff
1865
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1866
  return cancelBooking(env, row.id);
Open commit View diff
1866 return cancelBooking(env, row.id);
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1867
}
Open commit View diff
1867 }
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
1868
Open commit View diff
1868
Alex Nord about 16 hours ago 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1869
Open commit View diff
1869
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1870
async function publicManageBooking(request: Request, env: Env, value: unknown): Promise<Response> {
Open commit View diff
1870 async function publicManageBooking(request: Request, env: Env, value: unknown): Promise<Response> {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1871
  if (!(await enforceManageRateLimit(request, env))) {
Open commit View diff
1871 if (!(await enforceManageRateLimit(request, env))) {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1872
    return json({ error: 'Too many booking management attempts. Try again later.' }, 429);
Open commit View diff
1872 return json({ error: 'Too many booking management attempts. Try again later.' }, 429);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1873
  }
Open commit View diff
1873 }
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1874
  const publicBookingId = normalizePublicBookingId(value);
Open commit View diff
1874 const publicBookingId = normalizePublicBookingId(value);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1875
  if (!publicBookingId) return json({ error: 'Enter a valid Slot booking ID.' }, 400);
Open commit View diff
1875 if (!publicBookingId) return json({ error: 'Enter a valid Slot booking ID.' }, 400);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1876
  const booking = await bookingByPublicId(env, publicBookingId);
Open commit View diff
1876 const booking = await bookingByPublicId(env, publicBookingId);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1877
  if (!booking) return json({ error: 'Booking ID not found.' }, 404);
Open commit View diff
1877 if (!booking) return json({ error: 'Booking ID not found.' }, 404);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1878
  return json({ booking: publicManagePayload(booking) });
Open commit View diff
1878 return json({ booking: publicManagePayload(booking) });
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1879
}
Open commit View diff
1879 }
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1880
Open commit View diff
1880
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1881
async function publicManageAvailability(
Open commit View diff
1881 async function publicManageAvailability(
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1882
  request: Request,
Open commit View diff
1882 request: Request,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1883
  env: Env,
Open commit View diff
1883 env: Env,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1884
  value: unknown,
Open commit View diff
1884 value: unknown,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1885
  date: unknown,
Open commit View diff
1885 date: unknown,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1886
): Promise<Response> {
Open commit View diff
1886 ): Promise<Response> {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1887
  if (!(await enforceManageRateLimit(request, env))) {
Open commit View diff
1887 if (!(await enforceManageRateLimit(request, env))) {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1888
    return json({ error: 'Too many booking management attempts. Try again later.' }, 429);
Open commit View diff
1888 return json({ error: 'Too many booking management attempts. Try again later.' }, 429);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1889
  }
Open commit View diff
1889 }
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1890
  const publicBookingId = normalizePublicBookingId(value);
Open commit View diff
1890 const publicBookingId = normalizePublicBookingId(value);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1891
  if (!publicBookingId) return json({ error: 'Enter a valid Slot booking ID.' }, 400);
Open commit View diff
1891 if (!publicBookingId) return json({ error: 'Enter a valid Slot booking ID.' }, 400);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1892
  const booking = await bookingByPublicId(env, publicBookingId);
Open commit View diff
1892 const booking = await bookingByPublicId(env, publicBookingId);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1893
  if (!booking) return json({ error: 'Booking ID not found.' }, 404);
Open commit View diff
1893 if (!booking) return json({ error: 'Booking ID not found.' }, 404);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1894
  if (booking.status !== 'confirmed' || Date.parse(booking.end_time) <= Date.now()) {
Open commit View diff
1894 if (booking.status !== 'confirmed' || Date.parse(booking.end_time) <= Date.now()) {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1895
    return json({ error: 'Only upcoming confirmed bookings can be rescheduled.' }, 409);
Open commit View diff
1895 return json({ error: 'Only upcoming confirmed bookings can be rescheduled.' }, 409);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1896
  }
Open commit View diff
1896 }
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1897
  const dateKey = String(date ?? '').trim();
Open commit View diff
1897 const dateKey = String(date ?? '').trim();
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1898
  try {
Open commit View diff
1898 try {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1899
    const availability = await computeAvailability(env, dateKey);
Open commit View diff
1899 const availability = await computeAvailability(env, dateKey);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1900
    const slots = availability.slots
Open commit View diff
1900 const slots = availability.slots
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1901
      .filter((slot) => slot.durations.includes(booking.duration_minutes))
Open commit View diff
1901 .filter((slot) => slot.durations.includes(booking.duration_minutes))
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1902
      .map((slot) => ({ start: slot.start, time: slot.time }));
Open commit View diff
1902 .map((slot) => ({ start: slot.start, time: slot.time }));
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1903
    return json({ date: dateKey, timezone: availability.settings.timezone, duration: booking.duration_minutes, slots });
Open commit View diff
1903 return json({ date: dateKey, timezone: availability.settings.timezone, duration: booking.duration_minutes, slots });
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1904
  } catch (error) {
Open commit View diff
1904 } catch (error) {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1905
    if (error instanceof GoogleCalendarError) return json({ error: error.publicMessage }, 502);
Open commit View diff
1905 if (error instanceof GoogleCalendarError) return json({ error: error.publicMessage }, 502);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1906
    return json({ error: errorMessage(error) }, 400);
Open commit View diff
1906 return json({ error: errorMessage(error) }, 400);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1907
  }
Open commit View diff
1907 }
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1908
}
Open commit View diff
1908 }
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1909
Open commit View diff
1909
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1910
async function publicRescheduleBooking(
Open commit View diff
1910 async function publicRescheduleBooking(
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1911
  request: Request,
Open commit View diff
1911 request: Request,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1912
  env: Env,
Open commit View diff
1912 env: Env,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1913
  value: unknown,
Open commit View diff
1913 value: unknown,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1914
  start: unknown,
Open commit View diff
1914 start: unknown,
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1915
): Promise<Response> {
Open commit View diff
1915 ): Promise<Response> {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1916
  if (!(await enforceManageRateLimit(request, env))) {
Open commit View diff
1916 if (!(await enforceManageRateLimit(request, env))) {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1917
    return json({ error: 'Too many booking management attempts. Try again later.' }, 429);
Open commit View diff
1917 return json({ error: 'Too many booking management attempts. Try again later.' }, 429);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1918
  }
Open commit View diff
1918 }
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1919
  const publicBookingId = normalizePublicBookingId(value);
Open commit View diff
1919 const publicBookingId = normalizePublicBookingId(value);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1920
  if (!publicBookingId) return json({ error: 'Enter a valid Slot booking ID.' }, 400);
Open commit View diff
1920 if (!publicBookingId) return json({ error: 'Enter a valid Slot booking ID.' }, 400);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1921
  const booking = await bookingByPublicId(env, publicBookingId);
Open commit View diff
1921 const booking = await bookingByPublicId(env, publicBookingId);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1922
  if (!booking) return json({ error: 'Booking ID not found.' }, 404);
Open commit View diff
1922 if (!booking) return json({ error: 'Booking ID not found.' }, 404);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1923
  if (booking.status !== 'confirmed' || Date.parse(booking.end_time) <= Date.now()) {
Open commit View diff
1923 if (booking.status !== 'confirmed' || Date.parse(booking.end_time) <= Date.now()) {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1924
    return json({ error: 'Only upcoming confirmed bookings can be rescheduled.' }, 409);
Open commit View diff
1924 return json({ error: 'Only upcoming confirmed bookings can be rescheduled.' }, 409);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1925
  }
Open commit View diff
1925 }
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1926
  try {
Open commit View diff
1926 try {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1927
    const updated = await rescheduleConfirmedBooking(env, booking, String(start ?? ''), 'guest_self');
Open commit View diff
1927 const updated = await rescheduleConfirmedBooking(env, booking, String(start ?? ''), 'guest_self');
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1928
    return json({ ok: true, booking: publicManagePayload(updated) });
Open commit View diff
1928 return json({ ok: true, booking: publicManagePayload(updated) });
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1929
  } catch (error) {
Open commit View diff
1929 } catch (error) {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1930
    if (error instanceof GoogleCalendarError) return json({ error: error.publicMessage }, 502);
Open commit View diff
1930 if (error instanceof GoogleCalendarError) return json({ error: error.publicMessage }, 502);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1931
    const message = errorMessage(error);
Open commit View diff
1931 const message = errorMessage(error);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1932
    return json({ error: message }, /available|busy|future|took/i.test(message) ? 409 : 400);
Open commit View diff
1932 return json({ error: message }, /available|busy|future|took/i.test(message) ? 409 : 400);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1933
  }
Open commit View diff
1933 }
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1934
}
Open commit View diff
1934 }
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
1935
Open commit View diff
1935
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1936
function cleanLabel(value: unknown): string | null {
Open commit View diff
1936 function cleanLabel(value: unknown): string | null {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1937
  const label = String(value ?? '').trim().slice(0, 80);
Open commit View diff
1937 const label = String(value ?? '').trim().slice(0, 80);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1938
  return label || null;
Open commit View diff
1938 return label || null;
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1939
}
Open commit View diff
1939 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1940
Open commit View diff
1940
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1941
async function listAvailabilityRules(env: Env): Promise<Response> {
Open commit View diff
1941 async function listAvailabilityRules(env: Env): Promise<Response> {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1942
  const recurring = await env.DB.prepare(`
Open commit View diff
1942 const recurring = await env.DB.prepare(`
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1943
    SELECT id, weekdays, start_time, end_time, label
Open commit View diff
1943 SELECT id, weekdays, start_time, end_time, label
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1944
    FROM recurring_unavailable_periods
Open commit View diff
1944 FROM recurring_unavailable_periods
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1945
    ORDER BY start_time
Open commit View diff
1945 ORDER BY start_time
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1946
  `).all<{ id: string; weekdays: string; start_time: string; end_time: string; label: string | null }>();
Open commit View diff
1946 `).all<{ id: string; weekdays: string; start_time: string; end_time: string; label: string | null }>();
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1947
  const blocks = await env.DB.prepare(`
Open commit View diff
1947 const blocks = await env.DB.prepare(`
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1948
    SELECT id, date, start_time, end_time, all_day, label
Open commit View diff
1948 SELECT id, date, start_time, end_time, all_day, label
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1949
    FROM availability_blocks
Open commit View diff
1949 FROM availability_blocks
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1950
    ORDER BY date DESC, all_day DESC, start_time
Open commit View diff
1950 ORDER BY date DESC, all_day DESC, start_time
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1951
    LIMIT 100
Open commit View diff
1951 LIMIT 100
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1952
  `).all<{ id: string; date: string; start_time: string | null; end_time: string | null; all_day: number; label: string | null }>();
Open commit View diff
1952 `).all<{ id: string; date: string; start_time: string | null; end_time: string | null; all_day: number; label: string | null }>();
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1953
Open commit View diff
1953
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1954
  return json({
Open commit View diff
1954 return json({
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1955
    recurring: (recurring.results ?? []).map((row) => ({
Open commit View diff
1955 recurring: (recurring.results ?? []).map((row) => ({
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1956
      id: row.id,
Open commit View diff
1956 id: row.id,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1957
      weekdays: row.weekdays.split(',').map(Number).filter((day) => day >= 0 && day <= 6),
Open commit View diff
1957 weekdays: row.weekdays.split(',').map(Number).filter((day) => day >= 0 && day <= 6),
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1958
      start: row.start_time,
Open commit View diff
1958 start: row.start_time,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1959
      end: row.end_time,
Open commit View diff
1959 end: row.end_time,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1960
      label: row.label,
Open commit View diff
1960 label: row.label,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1961
    })),
Open commit View diff
1961 })),
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1962
    blocks: (blocks.results ?? []).map((row) => ({
Open commit View diff
1962 blocks: (blocks.results ?? []).map((row) => ({
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1963
      id: row.id,
Open commit View diff
1963 id: row.id,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1964
      date: row.date,
Open commit View diff
1964 date: row.date,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1965
      start: row.start_time,
Open commit View diff
1965 start: row.start_time,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1966
      end: row.end_time,
Open commit View diff
1966 end: row.end_time,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1967
      allDay: row.all_day === 1,
Open commit View diff
1967 allDay: row.all_day === 1,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1968
      label: row.label,
Open commit View diff
1968 label: row.label,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1969
    })),
Open commit View diff
1969 })),
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1970
  });
Open commit View diff
1970 });
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1971
}
Open commit View diff
1971 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1972
Open commit View diff
1972
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1973
async function createRecurringUnavailable(env: Env, input: unknown): Promise<Response> {
Open commit View diff
1973 async function createRecurringUnavailable(env: Env, input: unknown): Promise<Response> {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1974
  const raw = input as Partial<{ weekdays: unknown[]; start: string; end: string; label: string }>;
Open commit View diff
1974 const raw = input as Partial<{ weekdays: unknown[]; start: string; end: string; label: string }>;
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1975
  const weekdays = Array.isArray(raw.weekdays)
Open commit View diff
1975 const weekdays = Array.isArray(raw.weekdays)
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1976
    ? [...new Set(raw.weekdays.map(Number).filter((day) => Number.isInteger(day) && day >= 0 && day <= 6))].sort((a, b) => a - b)
Open commit View diff
1976 ? [...new Set(raw.weekdays.map(Number).filter((day) => Number.isInteger(day) && day >= 0 && day <= 6))].sort((a, b) => a - b)
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1977
    : [];
Open commit View diff
1977 : [];
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1978
  const start = String(raw.start ?? '');
Open commit View diff
1978 const start = String(raw.start ?? '');
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1979
  const end = String(raw.end ?? '');
Open commit View diff
1979 const end = String(raw.end ?? '');
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1980
  if (!weekdays.length || !isTime(start) || !isTime(end) || timeToMinutes(end) <= timeToMinutes(start)) {
Open commit View diff
1980 if (!weekdays.length || !isTime(start) || !isTime(end) || timeToMinutes(end) <= timeToMinutes(start)) {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1981
    return json({ error: 'Choose weekdays plus a valid start and end time.' }, 400);
Open commit View diff
1981 return json({ error: 'Choose weekdays plus a valid start and end time.' }, 400);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1982
  }
Open commit View diff
1982 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1983
Open commit View diff
1983
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1984
  const id = crypto.randomUUID();
Open commit View diff
1984 const id = crypto.randomUUID();
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1985
  await env.DB.prepare(`
Open commit View diff
1985 await env.DB.prepare(`
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1986
    INSERT INTO recurring_unavailable_periods (id, weekdays, start_time, end_time, label)
Open commit View diff
1986 INSERT INTO recurring_unavailable_periods (id, weekdays, start_time, end_time, label)
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1987
    VALUES (?1, ?2, ?3, ?4, ?5)
Open commit View diff
1987 VALUES (?1, ?2, ?3, ?4, ?5)
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1988
  `).bind(id, weekdays.join(','), start, end, cleanLabel(raw.label)).run();
Open commit View diff
1988 `).bind(id, weekdays.join(','), start, end, cleanLabel(raw.label)).run();
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1989
  return json({ ok: true, id }, 201);
Open commit View diff
1989 return json({ ok: true, id }, 201);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1990
}
Open commit View diff
1990 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1991
Open commit View diff
1991
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1992
async function createAvailabilityBlock(env: Env, input: unknown): Promise<Response> {
Open commit View diff
1992 async function createAvailabilityBlock(env: Env, input: unknown): Promise<Response> {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1993
  const raw = input as Partial<{ date: string; start: string; end: string; allDay: boolean; label: string }>;
Open commit View diff
1993 const raw = input as Partial<{ date: string; start: string; end: string; allDay: boolean; label: string }>;
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1994
  const date = String(raw.date ?? '');
Open commit View diff
1994 const date = String(raw.date ?? '');
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1995
  const allDay = Boolean(raw.allDay);
Open commit View diff
1995 const allDay = Boolean(raw.allDay);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1996
  const start = String(raw.start ?? '');
Open commit View diff
1996 const start = String(raw.start ?? '');
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1997
  const end = String(raw.end ?? '');
Open commit View diff
1997 const end = String(raw.end ?? '');
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1998
  if (!/^\d{4}-\d{2}-\d{2}$/.test(date)) return json({ error: 'Choose a valid date.' }, 400);
Open commit View diff
1998 if (!/^\d{4}-\d{2}-\d{2}$/.test(date)) return json({ error: 'Choose a valid date.' }, 400);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1999
  if (!allDay && (!isTime(start) || !isTime(end) || timeToMinutes(end) <= timeToMinutes(start))) {
Open commit View diff
1999 if (!allDay && (!isTime(start) || !isTime(end) || timeToMinutes(end) <= timeToMinutes(start))) {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2000
    return json({ error: 'Choose a valid start and end time, or mark the block all day.' }, 400);
Open commit View diff
2000 return json({ error: 'Choose a valid start and end time, or mark the block all day.' }, 400);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2001
  }
Open commit View diff
2001 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2002
Open commit View diff
2002
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2003
  const id = crypto.randomUUID();
Open commit View diff
2003 const id = crypto.randomUUID();
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2004
  await env.DB.prepare(`
Open commit View diff
2004 await env.DB.prepare(`
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2005
    INSERT INTO availability_blocks (id, date, start_time, end_time, all_day, label)
Open commit View diff
2005 INSERT INTO availability_blocks (id, date, start_time, end_time, all_day, label)
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2006
    VALUES (?1, ?2, ?3, ?4, ?5, ?6)
Open commit View diff
2006 VALUES (?1, ?2, ?3, ?4, ?5, ?6)
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2007
  `).bind(id, date, allDay ? null : start, allDay ? null : end, allDay ? 1 : 0, cleanLabel(raw.label)).run();
Open commit View diff
2007 `).bind(id, date, allDay ? null : start, allDay ? null : end, allDay ? 1 : 0, cleanLabel(raw.label)).run();
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2008
  return json({ ok: true, id }, 201);
Open commit View diff
2008 return json({ ok: true, id }, 201);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2009
}
Open commit View diff
2009 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2010
Open commit View diff
2010
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2011
async function deleteAvailabilityRule(env: Env, kind: string, id: string): Promise<Response> {
Open commit View diff
2011 async function deleteAvailabilityRule(env: Env, kind: string, id: string): Promise<Response> {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2012
  if (!/^[0-9a-f-]{36}$/i.test(id)) return json({ error: 'Invalid rule id.' }, 400);
Open commit View diff
2012 if (!/^[0-9a-f-]{36}$/i.test(id)) return json({ error: 'Invalid rule id.' }, 400);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2013
  if (kind === 'recurring') {
Open commit View diff
2013 if (kind === 'recurring') {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2014
    await env.DB.prepare('DELETE FROM recurring_unavailable_periods WHERE id = ?1').bind(id).run();
Open commit View diff
2014 await env.DB.prepare('DELETE FROM recurring_unavailable_periods WHERE id = ?1').bind(id).run();
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2015
    return json({ ok: true });
Open commit View diff
2015 return json({ ok: true });
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2016
  }
Open commit View diff
2016 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2017
  if (kind === 'block') {
Open commit View diff
2017 if (kind === 'block') {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2018
    await env.DB.prepare('DELETE FROM availability_blocks WHERE id = ?1').bind(id).run();
Open commit View diff
2018 await env.DB.prepare('DELETE FROM availability_blocks WHERE id = ?1').bind(id).run();
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2019
    return json({ ok: true });
Open commit View diff
2019 return json({ ok: true });
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2020
  }
Open commit View diff
2020 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2021
  return json({ error: 'Invalid availability rule type.' }, 400);
Open commit View diff
2021 return json({ error: 'Invalid availability rule type.' }, 400);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2022
}
Open commit View diff
2022 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2023
Open commit View diff
2023
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2024
async function handleApi(request: Request, env: Env, url: URL): Promise<Response> {
Open commit View diff
2024 async function handleApi(request: Request, env: Env, url: URL): Promise<Response> {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2025
  if (request.method === 'GET' && url.pathname === '/api/config') {
Open commit View diff
2025 if (request.method === 'GET' && url.pathname === '/api/config') {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2026
    const settings = await getSettings(env);
Open commit View diff
2026 const settings = await getSettings(env);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2027
    const connected = await hasGoogleConnection(env);
Open commit View diff
2027 const connected = await hasGoogleConnection(env);
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2028
    const paymentRequired = settings.paymentEnabled;
Open commit View diff
2028 const paymentRequired = settings.paymentEnabled;
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2029
    return json({
Open commit View diff
2029 return json({
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2030
      title: settings.title,
Open commit View diff
2030 title: settings.title,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2031
      subtitle: settings.subtitle,
Open commit View diff
2031 subtitle: settings.subtitle,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2032
      timezone: settings.timezone,
Open commit View diff
2032 timezone: settings.timezone,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2033
      bookingWindowDays: settings.bookingWindowDays,
Open commit View diff
2033 bookingWindowDays: settings.bookingWindowDays,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2034
      durations: settings.durations,
Open commit View diff
2034 durations: settings.durations,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2035
      defaultMeetingMode: settings.defaultMeetingMode,
Open commit View diff
2035 defaultMeetingMode: settings.defaultMeetingMode,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2036
      allowMeetingModes: settings.allowMeetingModes,
Open commit View diff
2036 allowMeetingModes: settings.allowMeetingModes,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2037
      availableWeekdays: Object.entries(settings.availability)
Open commit View diff
2037 availableWeekdays: Object.entries(settings.availability)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2038
        .filter(([, intervals]) => intervals.length > 0)
Open commit View diff
2038 .filter(([, intervals]) => intervals.length > 0)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2039
        .map(([day]) => Number(day)),
Open commit View diff
2039 .map(([day]) => Number(day)),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2040
      connected,
Open commit View diff
2040 connected,
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2041
      payment: paymentRequired ? {
Open commit View diff
2041 payment: paymentRequired ? {
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2042
        enabled: true,
Open commit View diff
2042 enabled: true,
Alex Nord about 16 hours ago 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2043
        required: settings.paymentFreeDurations.length === 0,
Open commit View diff
2043 required: settings.paymentFreeDurations.length === 0,
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2044
        ready: stripeConfigured(env) && settings.paymentRatePerMinute > 0,
Open commit View diff
2044 ready: stripeConfigured(env) && settings.paymentRatePerMinute > 0,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2045
        ratePerMinute: settings.paymentRatePerMinute,
Open commit View diff
2045 ratePerMinute: settings.paymentRatePerMinute,
Alex Nord about 16 hours ago 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2046
        freeDurations: settings.paymentFreeDurations,
Open commit View diff
2046 freeDurations: settings.paymentFreeDurations,
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2047
        currency: settings.paymentCurrency,
Open commit View diff
2047 currency: settings.paymentCurrency,
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2048
        label: settings.paymentLabel,
Open commit View diff
2048 label: settings.paymentLabel,
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2049
      } : undefined,
Open commit View diff
2049 } : undefined,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2050
    });
Open commit View diff
2050 });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2051
  }
Open commit View diff
2051 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2052
Open commit View diff
2052
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2053
  if (request.method === 'GET' && url.pathname === '/api/availability') {
Open commit View diff
2053 if (request.method === 'GET' && url.pathname === '/api/availability') {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2054
    const date = url.searchParams.get('date') ?? '';
Open commit View diff
2054 const date = url.searchParams.get('date') ?? '';
Alex Nord 3 days ago 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2055
    try {
Open commit View diff
2055 try {
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2056
      const result = await computeAvailability(env, date);
Open commit View diff
2056 const result = await computeAvailability(env, date);
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2057
      return json({
Open commit View diff
2057 return json({
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2058
        date: result.date,
Open commit View diff
2058 date: result.date,
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2059
        timezone: result.settings.timezone,
Open commit View diff
2059 timezone: result.settings.timezone,
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2060
        connected: result.connected,
Open commit View diff
2060 connected: result.connected,
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2061
        slots: result.slots,
Open commit View diff
2061 slots: result.slots,
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2062
      });
Open commit View diff
2062 });
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2063
    } catch (error) {
Open commit View diff
2063 } catch (error) {
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2064
      if (error instanceof GoogleCalendarError) {
Open commit View diff
2064 if (error instanceof GoogleCalendarError) {
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2065
        const settings = await getSettings(env);
Open commit View diff
2065 const settings = await getSettings(env);
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2066
        return json({
Open commit View diff
2066 return json({
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2067
          date,
Open commit View diff
2067 date,
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2068
          timezone: settings.timezone,
Open commit View diff
2068 timezone: settings.timezone,
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2069
          connected: true,
Open commit View diff
2069 connected: true,
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2070
          slots: [],
Open commit View diff
2070 slots: [],
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2071
          calendarError: error.publicMessage,
Open commit View diff
2071 calendarError: error.publicMessage,
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2072
        });
Open commit View diff
2072 });
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2073
      }
Open commit View diff
2073 }
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2074
      throw error;
Open commit View diff
2074 throw error;
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2075
    }
Open commit View diff
2075 }
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2076
  }
Open commit View diff
2076 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2077
Open commit View diff
2077
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2078
  if (request.method === 'POST' && url.pathname === '/api/book') {
Open commit View diff
2078 if (request.method === 'POST' && url.pathname === '/api/book') {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2079
    const body = (await request.json()) as BookingRequest;
Open commit View diff
2079 const body = (await request.json()) as BookingRequest;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2080
    return createBooking(env, request, body);
Open commit View diff
2080 return createBooking(env, request, body);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2081
  }
Open commit View diff
2081 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2082
Open commit View diff
2082
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2083
  if (request.method === 'POST' && url.pathname === '/api/bookings/cancel') {
Open commit View diff
2083 if (request.method === 'POST' && url.pathname === '/api/bookings/cancel') {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2084
    const body = await request.json().catch(() => ({})) as { bookingId?: string };
Open commit View diff
2084 const body = await request.json().catch(() => ({})) as { bookingId?: string };
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2085
    return publicCancelBooking(request, env, body.bookingId);
Open commit View diff
2085 return publicCancelBooking(request, env, body.bookingId);
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2086
  }
Open commit View diff
2086 }
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2087
Open commit View diff
2087
Alex Nord about 16 hours ago 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2088
  if (request.method === 'POST' && url.pathname === '/api/bookings/manage') {
Open commit View diff
2088 if (request.method === 'POST' && url.pathname === '/api/bookings/manage') {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2089
    const body = await request.json().catch(() => ({})) as { bookingId?: string };
Open commit View diff
2089 const body = await request.json().catch(() => ({})) as { bookingId?: string };
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2090
    return publicManageBooking(request, env, body.bookingId);
Open commit View diff
2090 return publicManageBooking(request, env, body.bookingId);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2091
  }
Open commit View diff
2091 }
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2092
Open commit View diff
2092
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2093
  if (request.method === 'POST' && url.pathname === '/api/bookings/manage/availability') {
Open commit View diff
2093 if (request.method === 'POST' && url.pathname === '/api/bookings/manage/availability') {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2094
    const body = await request.json().catch(() => ({})) as { bookingId?: string; date?: string };
Open commit View diff
2094 const body = await request.json().catch(() => ({})) as { bookingId?: string; date?: string };
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2095
    return publicManageAvailability(request, env, body.bookingId, body.date);
Open commit View diff
2095 return publicManageAvailability(request, env, body.bookingId, body.date);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2096
  }
Open commit View diff
2096 }
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2097
Open commit View diff
2097
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2098
  if (request.method === 'POST' && url.pathname === '/api/bookings/reschedule') {
Open commit View diff
2098 if (request.method === 'POST' && url.pathname === '/api/bookings/reschedule') {
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2099
    const body = await request.json().catch(() => ({})) as { bookingId?: string; start?: string };
Open commit View diff
2099 const body = await request.json().catch(() => ({})) as { bookingId?: string; start?: string };
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2100
    return publicRescheduleBooking(request, env, body.bookingId, body.start);
Open commit View diff
2100 return publicRescheduleBooking(request, env, body.bookingId, body.start);
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2101
  }
Open commit View diff
2101 }
same change 456feae

feat: add self-service booking management and free payment durations

Full commit hash
456feae6ef68a3e3bf55a0ea617bac46f7dc289e
Author
Alex Nord <[email protected]>
Date
about 16 hours ago
Selected line
2102
Open commit View diff
2102
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2103
  if (request.method === 'POST' && url.pathname === '/api/payments/checkout') {
Open commit View diff
2103 if (request.method === 'POST' && url.pathname === '/api/payments/checkout') {
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2104
    const body = (await request.json()) as { bookingId?: string };
Open commit View diff
2104 const body = (await request.json()) as { bookingId?: string };
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2105
    return createPaymentCheckout(env, String(body.bookingId ?? ''));
Open commit View diff
2105 return createPaymentCheckout(env, String(body.bookingId ?? ''));
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2106
  }
Open commit View diff
2106 }
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2107
Open commit View diff
2107
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2108
  if (request.method === 'GET' && url.pathname === '/api/payments/status') {
Open commit View diff
2108 if (request.method === 'GET' && url.pathname === '/api/payments/status') {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2109
    return paymentStatus(env, String(url.searchParams.get('session_id') ?? ''));
Open commit View diff
2109 return paymentStatus(env, String(url.searchParams.get('session_id') ?? ''));
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2110
  }
Open commit View diff
2110 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2111
Open commit View diff
2111
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2112
  if (request.method === 'GET' && url.pathname === '/api/payments/cancel-return') {
Open commit View diff
2112 if (request.method === 'GET' && url.pathname === '/api/payments/cancel-return') {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2113
    return paymentCancelReturn(env, String(url.searchParams.get('booking_id') ?? ''));
Open commit View diff
2113 return paymentCancelReturn(env, String(url.searchParams.get('booking_id') ?? ''));
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2114
  }
Open commit View diff
2114 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2115
Open commit View diff
2115
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2116
  if (request.method === 'POST' && url.pathname === '/api/payments/cancel') {
Open commit View diff
2116 if (request.method === 'POST' && url.pathname === '/api/payments/cancel') {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2117
    const body = (await request.json()) as { bookingId?: string };
Open commit View diff
2117 const body = (await request.json()) as { bookingId?: string };
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2118
    return cancelPendingPayment(env, String(body.bookingId ?? ''));
Open commit View diff
2118 return cancelPendingPayment(env, String(body.bookingId ?? ''));
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2119
  }
Open commit View diff
2119 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2120
Open commit View diff
2120
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2121
  if (request.method === 'POST' && url.pathname === '/api/stripe/webhook') {
Open commit View diff
2121 if (request.method === 'POST' && url.pathname === '/api/stripe/webhook') {
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2122
    return handleStripeWebhook(request, env);
Open commit View diff
2122 return handleStripeWebhook(request, env);
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2123
  }
Open commit View diff
2123 }
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2124
Open commit View diff
2124
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2125
  const proposalMatch = url.pathname.match(/^\/api\/reschedule-suggestions\/([^/]+)$/);
Open commit View diff
2125 const proposalMatch = url.pathname.match(/^\/api\/reschedule-suggestions\/([^/]+)$/);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2126
  if (request.method === 'GET' && proposalMatch) {
Open commit View diff
2126 if (request.method === 'GET' && proposalMatch) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2127
    return getRescheduleProposal(env, decodeURIComponent(proposalMatch[1]));
Open commit View diff
2127 return getRescheduleProposal(env, decodeURIComponent(proposalMatch[1]));
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2128
  }
Open commit View diff
2128 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2129
  const proposalAcceptMatch = url.pathname.match(/^\/api\/reschedule-suggestions\/([^/]+)\/accept$/);
Open commit View diff
2129 const proposalAcceptMatch = url.pathname.match(/^\/api\/reschedule-suggestions\/([^/]+)\/accept$/);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2130
  if (request.method === 'POST' && proposalAcceptMatch) {
Open commit View diff
2130 if (request.method === 'POST' && proposalAcceptMatch) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2131
    return acceptRescheduleProposal(env, decodeURIComponent(proposalAcceptMatch[1]));
Open commit View diff
2131 return acceptRescheduleProposal(env, decodeURIComponent(proposalAcceptMatch[1]));
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2132
  }
Open commit View diff
2132 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2133
Open commit View diff
2133
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2134
  if (url.pathname.startsWith('/api/admin/')) {
Open commit View diff
2134 if (url.pathname.startsWith('/api/admin/')) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2135
    const admin = await requireAdmin(request, env);
Open commit View diff
2135 const admin = await requireAdmin(request, env);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2136
    if (!admin) return json({ error: 'Unauthorized' }, 401);
Open commit View diff
2136 if (!admin) return json({ error: 'Unauthorized' }, 401);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2137
Open commit View diff
2137
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2138
    if (request.method === 'GET' && url.pathname === '/api/admin/session') {
Open commit View diff
2138 if (request.method === 'GET' && url.pathname === '/api/admin/session') {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2139
      const connected = await hasGoogleConnection(env);
Open commit View diff
2139 const connected = await hasGoogleConnection(env);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2140
      return json({ authenticated: true, email: admin, connected });
Open commit View diff
2140 return json({ authenticated: true, email: admin, connected });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2141
    }
Open commit View diff
2141 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2142
Open commit View diff
2142
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2143
    if (request.method === 'GET' && url.pathname === '/api/admin/settings') {
Open commit View diff
2143 if (request.method === 'GET' && url.pathname === '/api/admin/settings') {
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2144
      return json({
Open commit View diff
2144 return json({
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2145
        settings: await getSettings(env),
Open commit View diff
2145 settings: await getSettings(env),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2146
        stripeConfigured: stripeConfigured(env),
Open commit View diff
2146 stripeConfigured: stripeConfigured(env),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2147
        stripeMode: stripeMode(env),
Open commit View diff
2147 stripeMode: stripeMode(env),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2148
      });
Open commit View diff
2148 });
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2149
    }
Open commit View diff
2149 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2150
Open commit View diff
2150
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2151
    if (request.method === 'PUT' && url.pathname === '/api/admin/settings') {
Open commit View diff
2151 if (request.method === 'PUT' && url.pathname === '/api/admin/settings') {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2152
      const settings = validateAppSettings(await request.json());
Open commit View diff
2152 const settings = validateAppSettings(await request.json());
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2153
      await saveSettings(env, settings);
Open commit View diff
2153 await saveSettings(env, settings);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2154
      return json({ ok: true, settings });
Open commit View diff
2154 return json({ ok: true, settings });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2155
    }
Open commit View diff
2155 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2156
Open commit View diff
2156
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2157
    if (request.method === 'GET' && url.pathname === '/api/admin/activity') {
Open commit View diff
2157 if (request.method === 'GET' && url.pathname === '/api/admin/activity') {
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2158
      return adminActivity(env);
Open commit View diff
2158 return adminActivity(env);
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2159
    }
Open commit View diff
2159 }
same change 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2160
Open commit View diff
2160
Alex Nord about 23 hours ago 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2161
    if (request.method === 'GET' && url.pathname === '/api/admin/attendees') {
Open commit View diff
2161 if (request.method === 'GET' && url.pathname === '/api/admin/attendees') {
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2162
      return adminAttendees(env);
Open commit View diff
2162 return adminAttendees(env);
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2163
    }
Open commit View diff
2163 }
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2164
Open commit View diff
2164
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2165
    if (request.method === 'GET' && url.pathname === '/api/admin/attendee-bookings') {
Open commit View diff
2165 if (request.method === 'GET' && url.pathname === '/api/admin/attendee-bookings') {
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2166
      return adminAttendeeBookings(env, url.searchParams.get('email') ?? '');
Open commit View diff
2166 return adminAttendeeBookings(env, url.searchParams.get('email') ?? '');
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2167
    }
Open commit View diff
2167 }
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2168
Open commit View diff
2168
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2169
    if (request.method === 'GET' && url.pathname === '/api/admin/bookings') {
Open commit View diff
2169 if (request.method === 'GET' && url.pathname === '/api/admin/bookings') {
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2170
      const settings = await getSettings(env);
Open commit View diff
2170 const settings = await getSettings(env);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2171
      await cleanupStalePendingBookings(env, settings);
Open commit View diff
2171 await cleanupStalePendingBookings(env, settings);
Alex Nord about 23 hours ago 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2172
      const query = (url.searchParams.get('q') ?? '').trim().toLowerCase();
Open commit View diff
2172 const query = (url.searchParams.get('q') ?? '').trim().toLowerCase();
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2173
      const select = `
Open commit View diff
2173 const select = `
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2174
        SELECT id, public_booking_id, name, email, start_time, end_time, duration_minutes,
Open commit View diff
2174 SELECT id, public_booking_id, name, email, start_time, end_time, duration_minutes,
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2175
               meeting_mode, status, meet_url, created_at,
Open commit View diff
2175 meeting_mode, status, meet_url, created_at,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2176
               cancelled_at, calendar_provider, calendar_sync_status,
Open commit View diff
2176 cancelled_at, calendar_provider, calendar_sync_status,
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2177
               calendar_sync_error, calendar_sync_updated_at,
Open commit View diff
2177 calendar_sync_error, calendar_sync_updated_at,
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2178
               payment_status, payment_amount, payment_currency,
Open commit View diff
2178 payment_status, payment_amount, payment_currency,
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2179
               stripe_checkout_session_id, stripe_payment_intent_id, paid_at,
Open commit View diff
2179 stripe_checkout_session_id, stripe_payment_intent_id, paid_at,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2180
               rescheduled_at, reschedule_count, proposed_start_time, proposed_end_time,
Open commit View diff
2180 rescheduled_at, reschedule_count, proposed_start_time, proposed_end_time,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2181
               proposed_at, proposal_status, refund_status, stripe_refund_id,
Open commit View diff
2181 proposed_at, proposal_status, refund_status, stripe_refund_id,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2182
               refunded_amount, refunded_at
Open commit View diff
2182 refunded_amount, refunded_at
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2183
        FROM bookings
Open commit View diff
2183 FROM bookings
Alex Nord about 23 hours ago 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2184
      `;
Open commit View diff
2184 `;
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2185
      const result = query
Open commit View diff
2185 const result = query
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2186
        ? await env.DB.prepare(`${select}
Open commit View diff
2186 ? await env.DB.prepare(`${select}
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2187
            WHERE lower(COALESCE(public_booking_id, '')) LIKE ?1
Open commit View diff
2187 WHERE lower(COALESCE(public_booking_id, '')) LIKE ?1
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2188
               OR lower(id) LIKE ?1
Open commit View diff
2188 OR lower(id) LIKE ?1
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2189
               OR lower(name) LIKE ?1
Open commit View diff
2189 OR lower(name) LIKE ?1
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2190
               OR lower(email) LIKE ?1
Open commit View diff
2190 OR lower(email) LIKE ?1
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2191
            ORDER BY start_time DESC
Open commit View diff
2191 ORDER BY start_time DESC
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2192
            LIMIT 100
Open commit View diff
2192 LIMIT 100
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2193
          `).bind(`%${query}%`).all()
Open commit View diff
2193 `).bind(`%${query}%`).all()
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2194
        : await env.DB.prepare(`${select}
Open commit View diff
2194 : await env.DB.prepare(`${select}
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2195
            ORDER BY start_time DESC
Open commit View diff
2195 ORDER BY start_time DESC
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2196
            LIMIT 100
Open commit View diff
2196 LIMIT 100
same change 862116d

feat: add attendee insights and booking search

Full commit hash
862116d1429c92c653ba637895820678ba975eb9
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
2197
          `).all();
Open commit View diff
2197 `).all();
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2198
      return json({ bookings: result.results ?? [] });
Open commit View diff
2198 return json({ bookings: result.results ?? [] });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2199
    }
Open commit View diff
2199 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2200
Open commit View diff
2200
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2201
    const cancelMatch = url.pathname.match(/^\/api\/admin\/bookings\/([^/]+)\/cancel$/);
Open commit View diff
2201 const cancelMatch = url.pathname.match(/^\/api\/admin\/bookings\/([^/]+)\/cancel$/);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2202
    if (request.method === 'POST' && cancelMatch) {
Open commit View diff
2202 if (request.method === 'POST' && cancelMatch) {
Alex Nord 1 day ago f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2203
      const body = await request.json().catch(() => ({})) as { allowStaleStripeRelease?: boolean };
Open commit View diff
2203 const body = await request.json().catch(() => ({})) as { allowStaleStripeRelease?: boolean };
same change f1dbf89

fix: clarify availability limits and document Stripe as optional

Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2204
      return cancelBooking(env, cancelMatch[1], body.allowStaleStripeRelease === true);
Open commit View diff
2204 return cancelBooking(env, cancelMatch[1], body.allowStaleStripeRelease === true);
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2205
    }
Open commit View diff
2205 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2206
Open commit View diff
2206
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2207
    const bookingAvailabilityMatch = url.pathname.match(/^\/api\/admin\/bookings\/([^/]+)\/availability$/);
Open commit View diff
2207 const bookingAvailabilityMatch = url.pathname.match(/^\/api\/admin\/bookings\/([^/]+)\/availability$/);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2208
    if (request.method === 'GET' && bookingAvailabilityMatch) {
Open commit View diff
2208 if (request.method === 'GET' && bookingAvailabilityMatch) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2209
      const booking = await paymentBookingById(env, bookingAvailabilityMatch[1]);
Open commit View diff
2209 const booking = await paymentBookingById(env, bookingAvailabilityMatch[1]);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2210
      if (!booking) return json({ error: 'Booking not found.' }, 404);
Open commit View diff
2210 if (!booking) return json({ error: 'Booking not found.' }, 404);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2211
      if (booking.status !== 'confirmed') return json({ error: 'Only confirmed bookings can be rescheduled.' }, 409);
Open commit View diff
2211 if (booking.status !== 'confirmed') return json({ error: 'Only confirmed bookings can be rescheduled.' }, 409);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2212
      const date = url.searchParams.get('date') ?? '';
Open commit View diff
2212 const date = url.searchParams.get('date') ?? '';
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2213
      try {
Open commit View diff
2213 try {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2214
        const result = await computeAvailability(env, date);
Open commit View diff
2214 const result = await computeAvailability(env, date);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2215
        return json({
Open commit View diff
2215 return json({
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2216
          date: result.date,
Open commit View diff
2216 date: result.date,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2217
          timezone: result.settings.timezone,
Open commit View diff
2217 timezone: result.settings.timezone,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2218
          duration: booking.duration_minutes,
Open commit View diff
2218 duration: booking.duration_minutes,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2219
          slots: result.slots.filter((slot) => slot.durations.includes(booking.duration_minutes)),
Open commit View diff
2219 slots: result.slots.filter((slot) => slot.durations.includes(booking.duration_minutes)),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2220
        });
Open commit View diff
2220 });
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2221
      } catch (error) {
Open commit View diff
2221 } catch (error) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2222
        return json({ error: errorMessage(error) }, 400);
Open commit View diff
2222 return json({ error: errorMessage(error) }, 400);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2223
      }
Open commit View diff
2223 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2224
    }
Open commit View diff
2224 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2225
Open commit View diff
2225
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2226
    const rescheduleMatch = url.pathname.match(/^\/api\/admin\/bookings\/([^/]+)\/reschedule$/);
Open commit View diff
2226 const rescheduleMatch = url.pathname.match(/^\/api\/admin\/bookings\/([^/]+)\/reschedule$/);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2227
    if (request.method === 'POST' && rescheduleMatch) {
Open commit View diff
2227 if (request.method === 'POST' && rescheduleMatch) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2228
      const body = await request.json().catch(() => ({})) as { start?: string };
Open commit View diff
2228 const body = await request.json().catch(() => ({})) as { start?: string };
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2229
      return adminRescheduleBooking(env, rescheduleMatch[1], String(body.start ?? ''));
Open commit View diff
2229 return adminRescheduleBooking(env, rescheduleMatch[1], String(body.start ?? ''));
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2230
    }
Open commit View diff
2230 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2231
Open commit View diff
2231
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2232
    const suggestMatch = url.pathname.match(/^\/api\/admin\/bookings\/([^/]+)\/suggest$/);
Open commit View diff
2232 const suggestMatch = url.pathname.match(/^\/api\/admin\/bookings\/([^/]+)\/suggest$/);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2233
    if (request.method === 'POST' && suggestMatch) {
Open commit View diff
2233 if (request.method === 'POST' && suggestMatch) {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2234
      const body = await request.json().catch(() => ({})) as { start?: string };
Open commit View diff
2234 const body = await request.json().catch(() => ({})) as { start?: string };
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2235
      return adminSuggestNewTime(env, suggestMatch[1], String(body.start ?? ''));
Open commit View diff
2235 return adminSuggestNewTime(env, suggestMatch[1], String(body.start ?? ''));
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2236
    }
Open commit View diff
2236 }
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
2237
Open commit View diff
2237
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2238
    if (request.method === 'GET' && url.pathname === '/api/admin/availability-rules') {
Open commit View diff
2238 if (request.method === 'GET' && url.pathname === '/api/admin/availability-rules') {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2239
      return listAvailabilityRules(env);
Open commit View diff
2239 return listAvailabilityRules(env);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2240
    }
Open commit View diff
2240 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2241
Open commit View diff
2241
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2242
    if (request.method === 'POST' && url.pathname === '/api/admin/availability-rules/recurring') {
Open commit View diff
2242 if (request.method === 'POST' && url.pathname === '/api/admin/availability-rules/recurring') {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2243
      return createRecurringUnavailable(env, await request.json());
Open commit View diff
2243 return createRecurringUnavailable(env, await request.json());
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2244
    }
Open commit View diff
2244 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2245
Open commit View diff
2245
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2246
    if (request.method === 'POST' && url.pathname === '/api/admin/availability-rules/blocks') {
Open commit View diff
2246 if (request.method === 'POST' && url.pathname === '/api/admin/availability-rules/blocks') {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2247
      return createAvailabilityBlock(env, await request.json());
Open commit View diff
2247 return createAvailabilityBlock(env, await request.json());
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2248
    }
Open commit View diff
2248 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2249
Open commit View diff
2249
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2250
    const availabilityDeleteMatch = url.pathname.match(/^\/api\/admin\/availability-rules\/(recurring|block)\/([^/]+)$/);
Open commit View diff
2250 const availabilityDeleteMatch = url.pathname.match(/^\/api\/admin\/availability-rules\/(recurring|block)\/([^/]+)$/);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2251
    if (request.method === 'DELETE' && availabilityDeleteMatch) {
Open commit View diff
2251 if (request.method === 'DELETE' && availabilityDeleteMatch) {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2252
      return deleteAvailabilityRule(env, availabilityDeleteMatch[1], availabilityDeleteMatch[2]);
Open commit View diff
2252 return deleteAvailabilityRule(env, availabilityDeleteMatch[1], availabilityDeleteMatch[2]);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2253
    }
Open commit View diff
2253 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2254
Open commit View diff
2254
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2255
    if (request.method === 'POST' && url.pathname === '/api/admin/disconnect-google') {
Open commit View diff
2255 if (request.method === 'POST' && url.pathname === '/api/admin/disconnect-google') {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2256
      await disconnectGoogle(env);
Open commit View diff
2256 await disconnectGoogle(env);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2257
      return json({ ok: true });
Open commit View diff
2257 return json({ ok: true });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2258
    }
Open commit View diff
2258 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2259
Open commit View diff
2259
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2260
    if (request.method === 'POST' && url.pathname === '/api/admin/logout') {
Open commit View diff
2260 if (request.method === 'POST' && url.pathname === '/api/admin/logout') {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2261
      return json({ ok: true }, 200, { 'Set-Cookie': clearSessionCookie(env.APP_URL.startsWith('https://')) });
Open commit View diff
2261 return json({ ok: true }, 200, { 'Set-Cookie': clearSessionCookie(env.APP_URL.startsWith('https://')) });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2262
    }
Open commit View diff
2262 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2263
  }
Open commit View diff
2263 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2264
Open commit View diff
2264
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2265
  return json({ error: 'Not found' }, 404);
Open commit View diff
2265 return json({ error: 'Not found' }, 404);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2266
}
Open commit View diff
2266 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2267
Open commit View diff
2267
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2268
async function handleAuth(request: Request, env: Env, url: URL): Promise<Response> {
Open commit View diff
2268 async function handleAuth(request: Request, env: Env, url: URL): Promise<Response> {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2269
  if (request.method === 'GET' && url.pathname === '/auth/google/start') {
Open commit View diff
2269 if (request.method === 'GET' && url.pathname === '/auth/google/start') {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2270
    return redirect(await createGoogleAuthUrl(env, url.searchParams.get('force') === '1'));
Open commit View diff
2270 return redirect(await createGoogleAuthUrl(env, url.searchParams.get('force') === '1'));
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2271
  }
Open commit View diff
2271 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2272
Open commit View diff
2272
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2273
  if (request.method === 'GET' && url.pathname === '/auth/google/callback') {
Open commit View diff
2273 if (request.method === 'GET' && url.pathname === '/auth/google/callback') {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2274
    const error = url.searchParams.get('error');
Open commit View diff
2274 const error = url.searchParams.get('error');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2275
    if (error) return redirect(`/admin?oauth_error=${encodeURIComponent(error)}`);
Open commit View diff
2275 if (error) return redirect(`/admin?oauth_error=${encodeURIComponent(error)}`);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2276
    const state = url.searchParams.get('state');
Open commit View diff
2276 const state = url.searchParams.get('state');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2277
    const code = url.searchParams.get('code');
Open commit View diff
2277 const code = url.searchParams.get('code');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2278
    if (!state || !code) return redirect('/admin?oauth_error=missing_callback_parameters');
Open commit View diff
2278 if (!state || !code) return redirect('/admin?oauth_error=missing_callback_parameters');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2279
Open commit View diff
2279
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2280
    try {
Open commit View diff
2280 try {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2281
      const email = await completeGoogleOAuth(env, state, code);
Open commit View diff
2281 const email = await completeGoogleOAuth(env, state, code);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2282
      const token = await signSession(env, email);
Open commit View diff
2282 const token = await signSession(env, email);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2283
      return redirect('/admin?connected=1', {
Open commit View diff
2283 return redirect('/admin?connected=1', {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2284
        'Set-Cookie': sessionCookie(token, 7 * 86400, env.APP_URL.startsWith('https://')),
Open commit View diff
2284 'Set-Cookie': sessionCookie(token, 7 * 86400, env.APP_URL.startsWith('https://')),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2285
      });
Open commit View diff
2285 });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2286
    } catch (error) {
Open commit View diff
2286 } catch (error) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2287
      return redirect(`/admin?oauth_error=${encodeURIComponent(errorMessage(error))}`);
Open commit View diff
2287 return redirect(`/admin?oauth_error=${encodeURIComponent(errorMessage(error))}`);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2288
    }
Open commit View diff
2288 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2289
  }
Open commit View diff
2289 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2290
Open commit View diff
2290
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2291
  return new Response('Not found', { status: 404 });
Open commit View diff
2291 return new Response('Not found', { status: 404 });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2292
}
Open commit View diff
2292 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2293
Open commit View diff
2293
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2294
export default {
Open commit View diff
2294 export default {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2295
  async fetch(request: Request, env: Env): Promise<Response> {
Open commit View diff
2295 async fetch(request: Request, env: Env): Promise<Response> {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2296
    const url = new URL(request.url);
Open commit View diff
2296 const url = new URL(request.url);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2297
    try {
Open commit View diff
2297 try {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2298
      if (url.pathname.startsWith('/api/')) return await handleApi(request, env, url);
Open commit View diff
2298 if (url.pathname.startsWith('/api/')) return await handleApi(request, env, url);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2299
      if (url.pathname.startsWith('/auth/')) return await handleAuth(request, env, url);
Open commit View diff
2299 if (url.pathname.startsWith('/auth/')) return await handleAuth(request, env, url);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2300
      return new Response('Not found', { status: 404 });
Open commit View diff
2300 return new Response('Not found', { status: 404 });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2301
    } catch (error) {
Open commit View diff
2301 } catch (error) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2302
      console.error(error);
Open commit View diff
2302 console.error(error);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2303
      if (url.pathname.startsWith('/api/')) return json({ error: errorMessage(error) }, 500);
Open commit View diff
2303 if (url.pathname.startsWith('/api/')) return json({ error: errorMessage(error) }, 500);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2304
      return new Response(errorMessage(error), { status: 500 });
Open commit View diff
2304 return new Response(errorMessage(error), { status: 500 });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2305
    }
Open commit View diff
2305 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2306
  },
Open commit View diff
2306 },
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2307
} satisfies ExportedHandler<Env>;
Open commit View diff
2307 } satisfies ExportedHandler<Env>;