@asafarim/booking-calendar 0.2.0

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.
@@ -0,0 +1,76 @@
1
+ export type BookingStatus = "Pending" | "Confirmed" | "Cancelled" | "Completed" | "NoShow";
2
+ export type DeliveryStatus = "Pending" | "Sent" | "Failed" | "Retrying";
3
+ export interface BookingEvent {
4
+ id: string;
5
+ title: string;
6
+ description?: string;
7
+ startTime: Date;
8
+ endTime: Date;
9
+ durationMinutes: number;
10
+ status: BookingStatus;
11
+ meetingLink?: string;
12
+ location?: string;
13
+ clientName: string;
14
+ clientEmail: string;
15
+ clientPhone?: string;
16
+ meetingReason?: string;
17
+ cancellationReason?: string;
18
+ reminderSentAt?: Date;
19
+ deliveryStatus?: DeliveryStatus;
20
+ lastAttemptAt?: Date;
21
+ retryCount: number;
22
+ createdAt: Date;
23
+ updatedAt: Date;
24
+ clientId?: string;
25
+ }
26
+ export interface CreateBookingDto {
27
+ title: string;
28
+ description?: string;
29
+ startTime: string;
30
+ endTime: string;
31
+ location?: string;
32
+ meetingLink?: string;
33
+ clientId?: string;
34
+ clientName?: string;
35
+ clientEmail?: string;
36
+ clientPhone?: string;
37
+ meetingReason?: string;
38
+ }
39
+ export interface UpdateBookingDto {
40
+ title?: string;
41
+ description?: string;
42
+ startTime?: string;
43
+ endTime?: string;
44
+ location?: string;
45
+ meetingLink?: string;
46
+ status?: BookingStatus;
47
+ clientPhone?: string;
48
+ meetingReason?: string;
49
+ cancellationReason?: string;
50
+ }
51
+ export interface RescheduleBookingDto {
52
+ newStartTime: string;
53
+ newEndTime: string;
54
+ }
55
+ export interface AvailabilityRequest {
56
+ startTime: string;
57
+ endTime: string;
58
+ excludeBookingId?: string;
59
+ }
60
+ export interface AvailabilityResponse {
61
+ isAvailable: boolean;
62
+ conflictingBookings: BookingEvent[];
63
+ }
64
+ export type CalendarView = "month" | "week" | "day";
65
+ export interface BookingCalendarProps {
66
+ bookings: BookingEvent[];
67
+ onCreateBooking?: (booking: CreateBookingDto) => Promise<void>;
68
+ onUpdateBooking?: (id: string, booking: UpdateBookingDto) => Promise<void>;
69
+ onDeleteBooking?: (id: string) => Promise<void>;
70
+ onRescheduleBooking?: (id: string, dto: RescheduleBookingDto) => Promise<void>;
71
+ onCheckAvailability?: (dto: AvailabilityRequest) => Promise<AvailabilityResponse>;
72
+ onSendConfirmation?: (id: string) => Promise<void>;
73
+ initialView?: CalendarView;
74
+ initialDate?: Date;
75
+ className?: string;
76
+ }
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@asafarim/booking-calendar",
3
+ "version": "0.2.0",
4
+ "description": "Google Calendar-style booking UI for FreelanceToolkit.Api",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ },
14
+ "./styles": "./dist/index.css"
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "peerDependencies": {
20
+ "react": "^18.0.0",
21
+ "react-dom": "^18.0.0"
22
+ },
23
+ "dependencies": {
24
+ "date-fns": "^3.0.0"
25
+ },
26
+ "devDependencies": {
27
+ "@types/react": "^18.2.0",
28
+ "@types/react-dom": "^18.2.0",
29
+ "@vitejs/plugin-react": "^4.2.0",
30
+ "typescript": "^5.3.0",
31
+ "vite": "^5.0.0",
32
+ "vite-plugin-dts": "^3.7.0"
33
+ },
34
+ "keywords": [
35
+ "calendar",
36
+ "booking",
37
+ "scheduler",
38
+ "react",
39
+ "typescript",
40
+ "freelance-toolkit"
41
+ ],
42
+ "author": "ASafariM",
43
+ "license": "MIT",
44
+ "private": false,
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/AliSafari-IT/booking-calendar.git"
48
+ },
49
+ "bugs": {
50
+ "url": "https://github.com/AliSafari-IT/booking-calendar/issues"
51
+ },
52
+ "homepage": "https://github.com/AliSafari-IT/booking-calendar#readme",
53
+ "publishConfig": {
54
+ "access": "public",
55
+ "registry": "https://registry.npmjs.org/",
56
+ "tag": "latest"
57
+ },
58
+ "scripts": {
59
+ "clean": "rm -rf dist",
60
+ "build": "tsc && vite build",
61
+ "preview": "vite preview"
62
+ }
63
+ }