@fayz-ai/plugin-agenda 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -0
- package/dist/AgendaContext.d.ts +13 -0
- package/dist/AgendaContext.d.ts.map +1 -0
- package/dist/AgendaPage.d.ts +11 -0
- package/dist/AgendaPage.d.ts.map +1 -0
- package/dist/bridges/create-financial-bridge.d.ts +19 -0
- package/dist/bridges/create-financial-bridge.d.ts.map +1 -0
- package/dist/calendar-styles.d.ts +8 -0
- package/dist/calendar-styles.d.ts.map +1 -0
- package/dist/chunk-3LJKZQK4.js +12 -0
- package/dist/chunk-3LJKZQK4.js.map +1 -0
- package/dist/chunk-SYDBDI3Q.cjs +15 -0
- package/dist/chunk-SYDBDI3Q.cjs.map +1 -0
- package/dist/components/AgendaGeneralSettings.d.ts +3 -0
- package/dist/components/AgendaGeneralSettings.d.ts.map +1 -0
- package/dist/components/AppointmentModal.d.ts +16 -0
- package/dist/components/AppointmentModal.d.ts.map +1 -0
- package/dist/components/AppointmentPopover.d.ts +14 -0
- package/dist/components/AppointmentPopover.d.ts.map +1 -0
- package/dist/components/BookingPaymentPanel.d.ts +18 -0
- package/dist/components/BookingPaymentPanel.d.ts.map +1 -0
- package/dist/components/CalendarSidebar.d.ts +3 -0
- package/dist/components/CalendarSidebar.d.ts.map +1 -0
- package/dist/components/CalendarToolbar.d.ts +13 -0
- package/dist/components/CalendarToolbar.d.ts.map +1 -0
- package/dist/components/EventContextMenu.d.ts +14 -0
- package/dist/components/EventContextMenu.d.ts.map +1 -0
- package/dist/components/FloatingPanel.d.ts +27 -0
- package/dist/components/FloatingPanel.d.ts.map +1 -0
- package/dist/components/MiniCalendar.d.ts +9 -0
- package/dist/components/MiniCalendar.d.ts.map +1 -0
- package/dist/components/PaymentStatusBadge.d.ts +13 -0
- package/dist/components/PaymentStatusBadge.d.ts.map +1 -0
- package/dist/components/SearchCombobox.d.ts +38 -0
- package/dist/components/SearchCombobox.d.ts.map +1 -0
- package/dist/components/StatusBadge.d.ts +5 -0
- package/dist/components/StatusBadge.d.ts.map +1 -0
- package/dist/config.d.ts +151 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/data/index.d.ts +4 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/mock.d.ts +3 -0
- package/dist/data/mock.d.ts.map +1 -0
- package/dist/data/supabase.d.ts +3 -0
- package/dist/data/supabase.d.ts.map +1 -0
- package/dist/data/types.d.ts +26 -0
- package/dist/data/types.d.ts.map +1 -0
- package/dist/financial-bridge.d.ts +92 -0
- package/dist/financial-bridge.d.ts.map +1 -0
- package/dist/hooks/useAgendaSettings.d.ts +7 -0
- package/dist/hooks/useAgendaSettings.d.ts.map +1 -0
- package/dist/index.cjs +5135 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5120 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/tenant.d.ts +3 -0
- package/dist/lib/tenant.d.ts.map +1 -0
- package/dist/locales/en.d.ts +2 -0
- package/dist/locales/en.d.ts.map +1 -0
- package/dist/locales/index.d.ts +2 -0
- package/dist/locales/index.d.ts.map +1 -0
- package/dist/locales/pt-BR.d.ts +2 -0
- package/dist/locales/pt-BR.d.ts.map +1 -0
- package/dist/registries.d.ts +3 -0
- package/dist/registries.d.ts.map +1 -0
- package/dist/store.d.ts +66 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/tenant-222EHYUC.cjs +16 -0
- package/dist/tenant-222EHYUC.cjs.map +1 -0
- package/dist/tenant-LAUWVUYB.js +3 -0
- package/dist/tenant-LAUWVUYB.js.map +1 -0
- package/dist/types.d.ts +202 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/views/CalendarView.d.ts +3 -0
- package/dist/views/CalendarView.d.ts.map +1 -0
- package/dist/views/ConfirmationsView.d.ts +3 -0
- package/dist/views/ConfirmationsView.d.ts.map +1 -0
- package/package.json +63 -0
- package/src/AgendaContext.tsx +11 -0
- package/src/AgendaPage.tsx +33 -0
- package/src/bridges/create-financial-bridge.ts +298 -0
- package/src/calendar-styles.css +245 -0
- package/src/calendar-styles.ts +285 -0
- package/src/components/AgendaGeneralSettings.tsx +64 -0
- package/src/components/AppointmentModal.tsx +1031 -0
- package/src/components/AppointmentPopover.tsx +221 -0
- package/src/components/BookingPaymentPanel.tsx +394 -0
- package/src/components/CalendarSidebar.tsx +119 -0
- package/src/components/CalendarToolbar.tsx +83 -0
- package/src/components/EventContextMenu.tsx +122 -0
- package/src/components/FloatingPanel.tsx +123 -0
- package/src/components/MiniCalendar.tsx +120 -0
- package/src/components/PaymentStatusBadge.tsx +62 -0
- package/src/components/SearchCombobox.tsx +216 -0
- package/src/components/StatusBadge.tsx +23 -0
- package/src/config.ts +269 -0
- package/src/data/index.ts +3 -0
- package/src/data/mock.ts +324 -0
- package/src/data/supabase.ts +570 -0
- package/src/data/types.ts +37 -0
- package/src/financial-bridge.ts +96 -0
- package/src/hooks/useAgendaSettings.ts +17 -0
- package/src/index.ts +180 -0
- package/src/lib/tenant.ts +3 -0
- package/src/locales/en.ts +207 -0
- package/src/locales/index.ts +7 -0
- package/src/locales/pt-BR.ts +207 -0
- package/src/registries.ts +36 -0
- package/src/store.ts +304 -0
- package/src/types.ts +265 -0
- package/src/views/CalendarView.tsx +904 -0
- package/src/views/ConfirmationsView.tsx +155 -0
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @fayz-ai/plugin-agenda
|
|
2
|
+
|
|
3
|
+
> The scheduling engine that turns any SaaS into a bookable business.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@fayz-ai/plugin-agenda)
|
|
6
|
+
[](https://github.com/FayaLabs/fayz-sdk/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
Every service business runs on a calendar. Salons book stylists, clinics book doctors, studios book rooms — the same primitive, rebuilt badly a thousand times. `plugin-agenda` is that primitive done once: a resource-aware calendar with appointments, blocks, working hours, conflict detection, and drag-and-drop, all driven by config instead of forks.
|
|
9
|
+
|
|
10
|
+
It snaps into any `defineSaas` app and reshapes itself per vertical — booking types, statuses, professional/client/service lookups, and locations are all options. Pair it with `@fayz-ai/plugin-financial` and a booking can auto-create an order, so scheduling and revenue stay in sync from the first appointment. One engine, every vertical, no rewrite.
|
|
11
|
+
|
|
12
|
+
## What's inside
|
|
13
|
+
- **Calendar page** (`/agenda`) — FullCalendar-powered day/week/month/list views plus resource time-grid, with drag-and-drop and conflict detection.
|
|
14
|
+
- **Booking types** — appointments, tasks, and blocks out of the box, each with its own fields and rules; fully overridable.
|
|
15
|
+
- **Status workflow** — scheduled → confirmed → in progress → completed, plus cancelled / no-show, with time-aware availability.
|
|
16
|
+
- **Working hours & schedule blocks** — buffer time, max-concurrent, advance-booking windows, multi-location selection.
|
|
17
|
+
- **AI tools** — `listAppointments`, `createAppointment`, `checkAvailability` for natural-language scheduling.
|
|
18
|
+
- **Financial bridge** — optional cross-plugin integration that auto-creates orders and tracks booking payment status (`createFinancialBridge`, `computeCommissionAmount`).
|
|
19
|
+
- Supabase-or-mock data provider, settings tab, and i18n built in.
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
```bash
|
|
23
|
+
npm install @fayz-ai/plugin-agenda
|
|
24
|
+
```
|
|
25
|
+
Peer deps: `react`, `react-dom`. Runtime deps include `@fayz-ai/core`, `@fayz-ai/ui`, `@fayz-ai/saas`, `@fayz-ai/plugin-financial`, and FullCalendar.
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
```tsx
|
|
29
|
+
import { defineSaas } from '@fayz-ai/saas'
|
|
30
|
+
import { createAgendaPlugin } from '@fayz-ai/plugin-agenda'
|
|
31
|
+
|
|
32
|
+
export const app = defineSaas({
|
|
33
|
+
// ...
|
|
34
|
+
plugins: [
|
|
35
|
+
createAgendaPlugin({
|
|
36
|
+
labels: { pageTitle: 'Bookings' },
|
|
37
|
+
defaultCalendarView: 'resourceTimeGridWeek',
|
|
38
|
+
businessHours: { startTime: '08:00', endTime: '20:00' },
|
|
39
|
+
slotDuration: 30,
|
|
40
|
+
autoCreateOrder: true,
|
|
41
|
+
modules: { locationSelection: true },
|
|
42
|
+
}),
|
|
43
|
+
],
|
|
44
|
+
})
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Part of the Fayz SDK
|
|
48
|
+
`plugin-agenda` is the front door for any booking-driven vertical (beauty, health, services). It pairs naturally with `@fayz-ai/plugin-financial` via the financial bridge, and with `@fayz-ai/plugin-reports` for occupancy and revenue analytics.
|
|
49
|
+
|
|
50
|
+
## Roadmap & contributing
|
|
51
|
+
Built and evolving in the open. See the [Fayz SDK roadmap](../../docs/ROADMAP.md#plugin-agenda) for current gaps, missing features, and good first issues.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ResolvedAgendaConfig } from './config';
|
|
2
|
+
import type { AgendaDataProvider } from './data/types';
|
|
3
|
+
import type { AgendaUIState } from './store';
|
|
4
|
+
export declare const AgendaContextProvider: import("react").FC<{
|
|
5
|
+
config: ResolvedAgendaConfig;
|
|
6
|
+
provider: AgendaDataProvider;
|
|
7
|
+
store: import("zustand").StoreApi<AgendaUIState>;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const useAgendaConfig: () => ResolvedAgendaConfig;
|
|
11
|
+
export declare const useAgendaProvider: () => AgendaDataProvider;
|
|
12
|
+
export declare const useAgendaStore: <T>(selector: (state: AgendaUIState) => T) => T;
|
|
13
|
+
//# sourceMappingURL=AgendaContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgendaContext.d.ts","sourceRoot":"","sources":["../src/AgendaContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C,eAAO,MAAM,qBAAqB;;;;;EAAsB,CAAA;AACxD,eAAO,MAAM,eAAe,4BAAgB,CAAA;AAC5C,eAAO,MAAM,iBAAiB,0BAAkB,CAAA;AAChD,eAAO,MAAM,cAAc,iDAAe,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StoreApi } from 'zustand/vanilla';
|
|
3
|
+
import type { ResolvedAgendaConfig } from './config';
|
|
4
|
+
import type { AgendaDataProvider } from './data/types';
|
|
5
|
+
import type { AgendaUIState } from './store';
|
|
6
|
+
export declare function AgendaPage({ config, provider, store }: {
|
|
7
|
+
config: ResolvedAgendaConfig;
|
|
8
|
+
provider: AgendaDataProvider;
|
|
9
|
+
store: StoreApi<AgendaUIState>;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
//# sourceMappingURL=AgendaPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgendaPage.d.ts","sourceRoot":"","sources":["../src/AgendaPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAQ5C,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IACtD,MAAM,EAAE,oBAAoB,CAAA;IAC5B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAA;CAC/B,qBAcA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FinancialDataProvider } from '@fayz-ai/plugin-financial';
|
|
2
|
+
import type { AgendaFinancialBridge } from '../financial-bridge';
|
|
3
|
+
/**
|
|
4
|
+
* Pure commission math: percentage of a realized order total, rounded to cents.
|
|
5
|
+
* Exported for unit-testing and reuse; the bridge method below wraps the I/O.
|
|
6
|
+
* Returns 0 for a non-positive base or rate so callers can skip empty accruals.
|
|
7
|
+
*/
|
|
8
|
+
export declare function computeCommissionAmount(total: number, ratePercent: number): number;
|
|
9
|
+
/**
|
|
10
|
+
* Create an AgendaFinancialBridge backed by the financial plugin's data provider.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const financialProvider = createSupabaseFinancialProvider()
|
|
14
|
+
* const agenda = createAgendaPlugin({
|
|
15
|
+
* financialBridge: createFinancialBridge(financialProvider),
|
|
16
|
+
* })
|
|
17
|
+
*/
|
|
18
|
+
export declare function createFinancialBridge(provider: FinancialDataProvider): AgendaFinancialBridge;
|
|
19
|
+
//# sourceMappingURL=create-financial-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-financial-bridge.d.ts","sourceRoot":"","sources":["../../src/bridges/create-financial-bridge.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AACtE,OAAO,KAAK,EAAE,qBAAqB,EAAqE,MAAM,qBAAqB,CAAA;AAGnI;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAKlF;AAeD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,qBAAqB,CA4O5F"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Injects agenda calendar CSS at runtime.
|
|
3
|
+
* This ensures styles work both in symlinked dev mode and when consumed
|
|
4
|
+
* as a built package (where CSS side-effect imports are extracted by tsup
|
|
5
|
+
* and not automatically loaded).
|
|
6
|
+
*/
|
|
7
|
+
export declare function injectCalendarStyles(): void;
|
|
8
|
+
//# sourceMappingURL=calendar-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-styles.d.ts","sourceRoot":"","sources":["../src/calendar-styles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwQH,wBAAgB,oBAAoB,IAAI,IAAI,CAe3C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/lib/tenant.ts
|
|
2
|
+
var t;
|
|
3
|
+
function setAgendaTenantId(id) {
|
|
4
|
+
t = id;
|
|
5
|
+
}
|
|
6
|
+
function getAgendaTenantId() {
|
|
7
|
+
return t;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { getAgendaTenantId, setAgendaTenantId };
|
|
11
|
+
//# sourceMappingURL=chunk-3LJKZQK4.js.map
|
|
12
|
+
//# sourceMappingURL=chunk-3LJKZQK4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/tenant.ts"],"names":[],"mappings":";AAAA,IAAI,CAAA;AACG,SAAS,kBAAkB,EAAA,EAAuB;AAAE,EAAA,CAAA,GAAI,EAAA;AAAG;AAC3D,SAAS,iBAAA,GAAwC;AAAE,EAAA,OAAO,CAAA;AAAE","file":"chunk-3LJKZQK4.js","sourcesContent":["let t: string | undefined\nexport function setAgendaTenantId(id: string | undefined){ t = id }\nexport function getAgendaTenantId(): string | undefined { return t }\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/lib/tenant.ts
|
|
4
|
+
var t;
|
|
5
|
+
function setAgendaTenantId(id) {
|
|
6
|
+
t = id;
|
|
7
|
+
}
|
|
8
|
+
function getAgendaTenantId() {
|
|
9
|
+
return t;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
exports.getAgendaTenantId = getAgendaTenantId;
|
|
13
|
+
exports.setAgendaTenantId = setAgendaTenantId;
|
|
14
|
+
//# sourceMappingURL=chunk-SYDBDI3Q.cjs.map
|
|
15
|
+
//# sourceMappingURL=chunk-SYDBDI3Q.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/tenant.ts"],"names":[],"mappings":";;;AAAA,IAAI,CAAA;AACG,SAAS,kBAAkB,EAAA,EAAuB;AAAE,EAAA,CAAA,GAAI,EAAA;AAAG;AAC3D,SAAS,iBAAA,GAAwC;AAAE,EAAA,OAAO,CAAA;AAAE","file":"chunk-SYDBDI3Q.cjs","sourcesContent":["let t: string | undefined\nexport function setAgendaTenantId(id: string | undefined){ t = id }\nexport function getAgendaTenantId(): string | undefined { return t }\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgendaGeneralSettings.d.ts","sourceRoot":"","sources":["../../src/components/AgendaGeneralSettings.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,wBAAgB,qBAAqB,sBAqDpC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CreateBookingInput } from '../types';
|
|
3
|
+
interface Props {
|
|
4
|
+
open: boolean;
|
|
5
|
+
mode: 'create' | 'edit';
|
|
6
|
+
bookingId?: string;
|
|
7
|
+
prefill?: Partial<CreateBookingInput> & {
|
|
8
|
+
endsAt?: string;
|
|
9
|
+
};
|
|
10
|
+
initialTab?: string;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
onCreated?: (bookingId: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function AppointmentModal({ open, mode, bookingId, prefill, initialTab, onClose, onCreated }: Props): React.JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=AppointmentModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppointmentModal.d.ts","sourceRoot":"","sources":["../../src/components/AppointmentModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAA;AAsBnE,OAAO,KAAK,EAAE,kBAAkB,EAAiB,MAAM,UAAU,CAAA;AAgPjE,UAAU,KAAK;IACb,IAAI,EAAE,OAAO,CAAA;IACb,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,SAAS,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;CACxC;AAED,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,KAAK,qBAsvBzG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CalendarBooking } from '../types';
|
|
3
|
+
interface Props {
|
|
4
|
+
booking: CalendarBooking;
|
|
5
|
+
position: {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
};
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
onEdit: (id: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function AppointmentPopover({ booking, position, onClose, onEdit }: Props): React.JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=AppointmentPopover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppointmentPopover.d.ts","sourceRoot":"","sources":["../../src/components/AppointmentPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAO1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,UAAU,KAAK;IACb,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAClC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC7B;AA4DD,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,qBAkJ/E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
orderId: string;
|
|
4
|
+
orderTotal: number;
|
|
5
|
+
services?: Array<{
|
|
6
|
+
name: string;
|
|
7
|
+
price: number;
|
|
8
|
+
durationMinutes: number;
|
|
9
|
+
}>;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
onPaymentChange?: () => void;
|
|
12
|
+
formatCurrency: (amount: number) => string;
|
|
13
|
+
/** Render inline (no portal overlay) — for embedding in tabs */
|
|
14
|
+
inline?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function BookingPaymentPanel({ orderId, orderTotal, services, onClose, onPaymentChange, formatCurrency, inline }: Props): React.JSX.Element;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=BookingPaymentPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BookingPaymentPanel.d.ts","sourceRoot":"","sources":["../../src/components/BookingPaymentPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAkClD,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC1E,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IAC5B,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;IAC1C,gEAAgE;IAChE,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,KAAK,qBA4V7H"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarSidebar.d.ts","sourceRoot":"","sources":["../../src/components/CalendarSidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,wBAAgB,eAAe,sBAgH9B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface CalendarToolbarProps {
|
|
3
|
+
title: string;
|
|
4
|
+
onPrev: () => void;
|
|
5
|
+
onNext: () => void;
|
|
6
|
+
onToday: () => void;
|
|
7
|
+
onViewChange: (view: string) => void;
|
|
8
|
+
currentView: string;
|
|
9
|
+
onNewAppointment: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function CalendarToolbar({ title, onPrev, onNext, onToday, onViewChange, currentView, onNewAppointment, }: CalendarToolbarProps): React.JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=CalendarToolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarToolbar.d.ts","sourceRoot":"","sources":["../../src/components/CalendarToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,UAAU,oBAAoB;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,WAAW,EAAE,MAAM,CAAA;IACnB,gBAAgB,EAAE,MAAM,IAAI,CAAA;CAC7B;AASD,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,gBAAgB,GAC5E,EAAE,oBAAoB,qBAyDtB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CalendarBooking } from '../types';
|
|
3
|
+
interface Props {
|
|
4
|
+
booking: CalendarBooking;
|
|
5
|
+
position: {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
};
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
onEdit: (id: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function EventContextMenu({ booking, position, onClose, onEdit }: Props): React.JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=EventContextMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventContextMenu.d.ts","sourceRoot":"","sources":["../../src/components/EventContextMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAA;AAOxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAiD/C,UAAU,KAAK;IACb,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAClC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC7B;AAED,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,qBA0D7E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface FloatingPanelRef {
|
|
3
|
+
/** Dismiss with fade-out, then call onClose */
|
|
4
|
+
dismiss: () => void;
|
|
5
|
+
/** Expand-out animation (e.g. popover → modal), then call callback */
|
|
6
|
+
expandThen: (callback: () => void) => void;
|
|
7
|
+
}
|
|
8
|
+
interface FloatingPanelProps {
|
|
9
|
+
position: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
/** Offset from cursor (default: { x: 0, y: 0 }) */
|
|
16
|
+
offset?: {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
};
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
className?: string;
|
|
22
|
+
children: (ref: FloatingPanelRef) => React.ReactNode;
|
|
23
|
+
zIndex?: number;
|
|
24
|
+
}
|
|
25
|
+
export declare function FloatingPanel({ position, width, height, offset, onClose, className, children, zIndex, }: FloatingPanelProps): React.ReactPortal;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=FloatingPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingPanel.d.ts","sourceRoot":"","sources":["../../src/components/FloatingPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AA0BvE,MAAM,WAAW,gBAAgB;IAC/B,+CAA+C;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,sEAAsE;IACtE,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,CAAA;CAC3C;AAED,UAAU,kBAAkB;IAC1B,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,mDAAmD;IACnD,MAAM,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACjC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAA;IACpD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAMD,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAY,GAC5E,EAAE,kBAAkB,qBAuEpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface MiniCalendarProps {
|
|
3
|
+
selectedDate: Date;
|
|
4
|
+
onDateSelect: (date: Date) => void;
|
|
5
|
+
onMonthChange?: (date: Date) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function MiniCalendar({ selectedDate, onDateSelect, onMonthChange }: MiniCalendarProps): React.JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=MiniCalendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MiniCalendar.d.ts","sourceRoot":"","sources":["../../src/components/MiniCalendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAItC,UAAU,iBAAiB;IACzB,YAAY,EAAE,IAAI,CAAA;IAClB,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAClC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;CACrC;AAoBD,wBAAgB,YAAY,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,EAAE,iBAAiB,qBA2F5F"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BookingPaymentStatus } from '../financial-bridge';
|
|
3
|
+
interface PaymentStatusBadgeProps {
|
|
4
|
+
status: BookingPaymentStatus;
|
|
5
|
+
totalAmount?: number;
|
|
6
|
+
paidAmount?: number;
|
|
7
|
+
formatCurrency?: (amount: number) => string;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
compact?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function PaymentStatusBadge({ status, totalAmount, paidAmount, formatCurrency, onClick, compact, }: PaymentStatusBadgeProps): React.JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=PaymentStatusBadge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaymentStatusBadge.d.ts","sourceRoot":"","sources":["../../src/components/PaymentStatusBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAiB/D,UAAU,uBAAuB;IAC/B,MAAM,EAAE,oBAAoB,CAAA;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;IAC3C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,GAClE,EAAE,uBAAuB,qBA+BzB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ComboboxOption {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
price?: number;
|
|
7
|
+
data?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
interface SearchComboboxProps {
|
|
10
|
+
value: string;
|
|
11
|
+
onChange: (value: string) => void;
|
|
12
|
+
onSelect: (option: ComboboxOption) => void;
|
|
13
|
+
options: ComboboxOption[];
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
autoFocus?: boolean;
|
|
16
|
+
onBlurEmpty?: () => void;
|
|
17
|
+
renderRight?: (option: ComboboxOption) => React.ReactNode;
|
|
18
|
+
/** Show a "+ Create ..." option when search has no exact match */
|
|
19
|
+
allowCreate?: boolean;
|
|
20
|
+
/** Called when user clicks the create option. Receives the current search text. */
|
|
21
|
+
onCreateNew?: (searchText: string) => void;
|
|
22
|
+
/** Label for the create option (default: 'Create') */
|
|
23
|
+
createLabel?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
/** Minimal style — no border/bg, just underline on focus. For inline use. */
|
|
26
|
+
minimal?: boolean;
|
|
27
|
+
/** Inline label shown when collapsed. Click reveals the search input. */
|
|
28
|
+
inlineLabel?: string;
|
|
29
|
+
/** Icon for the inline label: 'search' (default) or 'plus' (for "add" actions) */
|
|
30
|
+
inlineIcon?: 'search' | 'plus';
|
|
31
|
+
/** Show a loading skeleton in the dropdown while results are being fetched */
|
|
32
|
+
loading?: boolean;
|
|
33
|
+
/** Called when the input gains focus */
|
|
34
|
+
onFocus?: () => void;
|
|
35
|
+
}
|
|
36
|
+
export declare function SearchCombobox({ value, onChange, onSelect, options, placeholder, autoFocus, onBlurEmpty, renderRight, allowCreate, onCreateNew, createLabel, className, minimal, inlineLabel, inlineIcon, loading, onFocus: onFocusProp, }: SearchComboboxProps): React.JSX.Element;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=SearchCombobox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchCombobox.d.ts","sourceRoot":"","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AC,EAC7B,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EACvE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAsB,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,UAAqB,EACrH,OAAO,EAAE,OAAO,EAAE,WAAW,GAC9B,EAAE,mBAAmB,qBAuKrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusBadge.d.ts","sourceRoot":"","sources":["../../src/components/StatusBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,qBAmBzD"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import type { PluginScope, VerticalId } from '@fayz-ai/core';
|
|
2
|
+
import type { EntityLookup } from '@fayz-ai/saas';
|
|
3
|
+
import type { AgendaDataProvider } from './data/types';
|
|
4
|
+
import type { StatusConfig, BookingTypeConfig } from './types';
|
|
5
|
+
import type { AgendaFinancialBridge } from './financial-bridge';
|
|
6
|
+
import type { EntityDef } from '@fayz-ai/core';
|
|
7
|
+
export interface AgendaPluginLabels {
|
|
8
|
+
pageTitle: string;
|
|
9
|
+
pageSubtitle: string;
|
|
10
|
+
calendar: string;
|
|
11
|
+
dayView: string;
|
|
12
|
+
weekView: string;
|
|
13
|
+
monthView: string;
|
|
14
|
+
listView: string;
|
|
15
|
+
workingHours: string;
|
|
16
|
+
confirmations: string;
|
|
17
|
+
newAppointment: string;
|
|
18
|
+
filters: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ConfirmationChannelOption {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
icon: string;
|
|
24
|
+
}
|
|
25
|
+
export interface LocationOption {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
isHQ?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface AgendaPluginOptions {
|
|
31
|
+
modules?: {
|
|
32
|
+
workingHours?: boolean;
|
|
33
|
+
confirmations?: boolean;
|
|
34
|
+
conflictDetection?: boolean;
|
|
35
|
+
dragAndDrop?: boolean;
|
|
36
|
+
locationSelection?: boolean;
|
|
37
|
+
/** Enable financial integration (auto-enabled when financialBridge is provided) */
|
|
38
|
+
financial?: boolean;
|
|
39
|
+
};
|
|
40
|
+
labels?: Partial<AgendaPluginLabels>;
|
|
41
|
+
currency?: {
|
|
42
|
+
code?: string;
|
|
43
|
+
locale?: string;
|
|
44
|
+
symbol?: string;
|
|
45
|
+
};
|
|
46
|
+
/** Booking kind used in saas_core.bookings.kind (default: 'appointment') */
|
|
47
|
+
bookingKind?: string;
|
|
48
|
+
/** Order kind for financial records (default: 'service_order') */
|
|
49
|
+
orderKind?: string;
|
|
50
|
+
/** Schedule kind in saas_core.schedules.kind (default: 'working_hours') */
|
|
51
|
+
scheduleKind?: string;
|
|
52
|
+
/** Booking type tabs shown in the appointment modal */
|
|
53
|
+
bookingTypes?: BookingTypeConfig[];
|
|
54
|
+
/** Booking status options */
|
|
55
|
+
statuses?: StatusConfig[];
|
|
56
|
+
/** Default calendar view (default: 'resourceTimeGridWeek'). Options: 'dayGridMonth', 'timeGridWeek', 'resourceTimeGridWeek', 'listWeek' */
|
|
57
|
+
defaultCalendarView?: string;
|
|
58
|
+
/** Calendar visible time range (default: '07:00'-'21:00') */
|
|
59
|
+
businessHours?: {
|
|
60
|
+
startTime: string;
|
|
61
|
+
endTime: string;
|
|
62
|
+
};
|
|
63
|
+
/** Slot duration in minutes (default: 30) */
|
|
64
|
+
slotDuration?: number;
|
|
65
|
+
/** Person kind for professionals (default: 'staff') */
|
|
66
|
+
professionalKind?: string;
|
|
67
|
+
/** Person kind for clients (default: 'customer') */
|
|
68
|
+
clientKind?: string;
|
|
69
|
+
/** Auto-create an order when creating a booking (default: true) */
|
|
70
|
+
autoCreateOrder?: boolean;
|
|
71
|
+
/** Contact/client lookup */
|
|
72
|
+
contactLookup?: EntityLookup;
|
|
73
|
+
/** Client entity definition for the Client tab in booking modal */
|
|
74
|
+
clientEntityDef?: EntityDef;
|
|
75
|
+
/** Service lookup */
|
|
76
|
+
serviceLookup?: EntityLookup;
|
|
77
|
+
/** Professional/staff lookup */
|
|
78
|
+
professionalLookup?: EntityLookup;
|
|
79
|
+
/** Location lookup */
|
|
80
|
+
locationLookup?: EntityLookup;
|
|
81
|
+
/** Called when user clicks a selected entity link (e.g. view client profile) */
|
|
82
|
+
onEntityClick?: (type: 'client' | 'service' | 'professional', id: string) => void;
|
|
83
|
+
/** Business locations for unit filtering */
|
|
84
|
+
locations?: LocationOption[];
|
|
85
|
+
/** Confirmation channel options */
|
|
86
|
+
confirmationChannels?: ConfirmationChannelOption[];
|
|
87
|
+
/** Financial bridge for agenda × financial cross-plugin integration */
|
|
88
|
+
financialBridge?: AgendaFinancialBridge;
|
|
89
|
+
/** Data provider — defaults to Supabase, falls back to mock */
|
|
90
|
+
dataProvider?: AgendaDataProvider;
|
|
91
|
+
/** Default values for schedule block advanced settings */
|
|
92
|
+
scheduleBlockDefaults?: {
|
|
93
|
+
bufferMinutes?: number;
|
|
94
|
+
maxConcurrent?: number;
|
|
95
|
+
minAdvanceHours?: number;
|
|
96
|
+
maxAdvanceDays?: number;
|
|
97
|
+
};
|
|
98
|
+
navPosition?: number;
|
|
99
|
+
navSection?: 'main' | 'secondary';
|
|
100
|
+
scope?: PluginScope;
|
|
101
|
+
verticalId?: VerticalId;
|
|
102
|
+
}
|
|
103
|
+
export interface AgendaModules {
|
|
104
|
+
workingHours: boolean;
|
|
105
|
+
confirmations: boolean;
|
|
106
|
+
conflictDetection: boolean;
|
|
107
|
+
dragAndDrop: boolean;
|
|
108
|
+
locationSelection: boolean;
|
|
109
|
+
financial: boolean;
|
|
110
|
+
}
|
|
111
|
+
export interface AgendaCurrency {
|
|
112
|
+
code: string;
|
|
113
|
+
locale: string;
|
|
114
|
+
symbol: string;
|
|
115
|
+
}
|
|
116
|
+
export interface ResolvedAgendaConfig {
|
|
117
|
+
modules: AgendaModules;
|
|
118
|
+
labels: AgendaPluginLabels;
|
|
119
|
+
currency: AgendaCurrency;
|
|
120
|
+
bookingKind: string;
|
|
121
|
+
orderKind: string;
|
|
122
|
+
scheduleKind: string;
|
|
123
|
+
statuses: StatusConfig[];
|
|
124
|
+
bookingTypes: BookingTypeConfig[];
|
|
125
|
+
businessHours: {
|
|
126
|
+
startTime: string;
|
|
127
|
+
endTime: string;
|
|
128
|
+
};
|
|
129
|
+
slotDuration: number;
|
|
130
|
+
professionalKind: string;
|
|
131
|
+
clientKind: string;
|
|
132
|
+
autoCreateOrder: boolean;
|
|
133
|
+
locations: LocationOption[];
|
|
134
|
+
confirmationChannels: ConfirmationChannelOption[];
|
|
135
|
+
contactLookup?: EntityLookup;
|
|
136
|
+
clientEntityDef?: EntityDef;
|
|
137
|
+
serviceLookup?: EntityLookup;
|
|
138
|
+
professionalLookup?: EntityLookup;
|
|
139
|
+
locationLookup?: EntityLookup;
|
|
140
|
+
onEntityClick?: (type: 'client' | 'service' | 'professional', id: string) => void;
|
|
141
|
+
financialBridge?: AgendaFinancialBridge;
|
|
142
|
+
scheduleBlockDefaults: {
|
|
143
|
+
bufferMinutes: number;
|
|
144
|
+
maxConcurrent: number;
|
|
145
|
+
minAdvanceHours: number;
|
|
146
|
+
maxAdvanceDays: number;
|
|
147
|
+
};
|
|
148
|
+
defaultCalendarView: string;
|
|
149
|
+
}
|
|
150
|
+
export declare function resolveConfig(options?: AgendaPluginOptions): ResolvedAgendaConfig;
|
|
151
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eA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E,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;IACrD,YAAY,EAAE,MAAM,CAAA;IACpB,gBAAgB,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,OAAO,CAAA;IACxB,SAAS,EAAE,cAAc,EAAE,CAAA;IAC3B,oBAAoB,EAAE,yBAAyB,EAAE,CAAA;IACjD,aAAa,CAAC,EAAE,YAAY,CAAA;IAC5B,eAAe,CAAC,EAAE,SAAS,CAAA;IAC3B,aAAa,CAAC,EAAE,YAAY,CAAA;IAC5B,kBAAkB,CAAC,EAAE,YAAY,CAAA;IACjC,cAAc,CAAC,EAAE,YAAY,CAAA;IAC7B,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,cAAc,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACjF,eAAe,CAAC,EAAE,qBAAqB,CAAA;IACvC,qBAAqB,EAAE;QACrB,aAAa,EAAE,MAAM,CAAA;QACrB,aAAa,EAAE,MAAM,CAAA;QACrB,eAAe,EAAE,MAAM,CAAA;QACvB,cAAc,EAAE,MAAM,CAAA;KACvB,CAAA;IACD,mBAAmB,EAAE,MAAM,CAAA;CAC5B;AAMD,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,oBAAoB,CAuCjF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAA;AACjD,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/data/mock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAuIjD,wBAAgB,wBAAwB,IAAI,kBAAkB,CA4L7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/data/supabase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AA8MjD,wBAAgB,4BAA4B,IAAI,kBAAkB,CA2WjE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CalendarBooking, Professional, Schedule, TimeSlot, CreateBookingInput, UpdateBookingInput, SaveScheduleInput, BookingQuery, ConflictCheckParams, AvailableSlotsParams } from '../types';
|
|
2
|
+
export interface AgendaDataProvider {
|
|
3
|
+
getBookings(query: BookingQuery): Promise<CalendarBooking[]>;
|
|
4
|
+
getBookingById(id: string): Promise<CalendarBooking | null>;
|
|
5
|
+
createBooking(input: CreateBookingInput): Promise<CalendarBooking>;
|
|
6
|
+
updateBooking(id: string, data: UpdateBookingInput): Promise<CalendarBooking>;
|
|
7
|
+
deleteBooking(id: string): Promise<void>;
|
|
8
|
+
updateBookingStatus(id: string, status: string): Promise<CalendarBooking>;
|
|
9
|
+
checkConflict(params: ConflictCheckParams): Promise<boolean>;
|
|
10
|
+
getAvailableSlots(params: AvailableSlotsParams): Promise<TimeSlot[]>;
|
|
11
|
+
getSchedules(professionalId?: string): Promise<Schedule[]>;
|
|
12
|
+
saveSchedule(input: SaveScheduleInput): Promise<Schedule>;
|
|
13
|
+
deleteSchedule(id: string): Promise<void>;
|
|
14
|
+
getProfessionals(): Promise<Professional[]>;
|
|
15
|
+
getLocations?(): Promise<Array<{
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
}>>;
|
|
19
|
+
getConfirmationsPending(daysAhead?: number): Promise<CalendarBooking[]>;
|
|
20
|
+
sendConfirmation(bookingId: string, channel: string): Promise<void>;
|
|
21
|
+
completeBooking(bookingId: string): Promise<{
|
|
22
|
+
booking: CalendarBooking;
|
|
23
|
+
orderId: string;
|
|
24
|
+
}>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/data/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EACjD,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EACzD,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EACxD,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,kBAAkB;IAEjC,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAAA;IAC5D,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAA;IAC3D,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;IAClE,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;IAC7E,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACxC,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;IAGzE,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAC5D,iBAAiB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA;IAGpE,YAAY,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC1D,YAAY,CAAC,K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