@mac777/project-pinecone-schema 1.0.1 → 1.0.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/dist/events/events.constants.d.ts +1 -8
- package/dist/events/events.constants.js +1 -6
- package/dist/events/events.schema.d.ts +110 -55
- package/dist/events/events.type.d.ts +0 -8
- package/dist/events/utils/ticket.schema.d.ts +6 -3
- package/dist/events/utils/ticket.schema.js +2 -1
- package/package.json +2 -5
- package/src/auth/auth.constants.ts +9 -0
- package/src/auth/auth.schema.ts +65 -0
- package/src/auth/auth.type.ts +42 -0
- package/src/auth/index.ts +3 -0
- package/src/auth/utils/password.schema.ts +18 -0
- package/src/events/events.constants.ts +170 -0
- package/src/events/events.schema.ts +158 -0
- package/src/events/events.type.ts +51 -0
- package/src/events/events.utils.schema.ts +5 -0
- package/{dist/events/events.d.ts → src/events/index.ts} +4 -3
- package/src/events/utils/admin.schema.ts +77 -0
- package/src/events/utils/age.restriction.schema.ts +3 -0
- package/src/events/utils/document.schema.ts +8 -0
- package/src/events/utils/event.type.schema.ts +3 -0
- package/src/events/utils/media.schema.ts +36 -0
- package/src/events/utils/organizer.schema.ts +14 -0
- package/src/events/utils/schedule.schema.ts +10 -0
- package/src/events/utils/ticket.schema.ts +33 -0
- package/src/events/utils/venue.schema.ts +22 -0
- package/src/index.ts +5 -0
- package/src/media/index.ts +2 -0
- package/src/media/media.schema.ts +37 -0
- package/src/media/media.type.ts +18 -0
- package/src/media/utils/backblaze.schema.ts +8 -0
- package/src/media/utils/imagekit.schema.ts +20 -0
- package/src/orders/index.ts +6 -0
- package/src/orders/orders.schema.ts +106 -0
- package/src/orders/orders.type.ts +85 -0
- package/src/orders/payments.schema.ts +81 -0
- package/src/orders/payments.type.ts +87 -0
- package/src/orders/ticket.schema.ts +78 -0
- package/src/orders/ticket.type.ts +103 -0
- package/tsconfig.json +13 -0
- package/dist/auth.d.ts +0 -1
- package/dist/auth.js +0 -18
- package/dist/events/admin.schema.d.ts +0 -208
- package/dist/events/admin.schema.js +0 -70
- package/dist/events/age.restriction.schema.d.ts +0 -2
- package/dist/events/age.restriction.schema.js +0 -5
- package/dist/events/document.schema.d.ts +0 -17
- package/dist/events/document.schema.js +0 -10
- package/dist/events/event.schema.d.ts +0 -0
- package/dist/events/event.schema.js +0 -1
- package/dist/events/event.type.schema.d.ts +0 -2
- package/dist/events/event.type.schema.js +0 -5
- package/dist/events/events.constant.d.ts +0 -9
- package/dist/events/events.constant.js +0 -12
- package/dist/events/events.js +0 -19
- package/dist/events/media.schema.d.ts +0 -77
- package/dist/events/media.schema.js +0 -36
- package/dist/events/organizer.schema.d.ts +0 -55
- package/dist/events/organizer.schema.js +0 -15
- package/dist/events/schedule.schema.d.ts +0 -20
- package/dist/events/schedule.schema.js +0 -11
- package/dist/events/step.schema.d.ts +0 -0
- package/dist/events/step.schema.js +0 -1
- package/dist/events/ticket.schema.d.ts +0 -113
- package/dist/events/ticket.schema.js +0 -29
- package/dist/events/utils.schema.d.ts +0 -6
- package/dist/events/utils.schema.js +0 -22
- package/dist/events/venue.schema.d.ts +0 -75
- package/dist/events/venue.schema.js +0 -22
- package/dist/events.constant.d.ts +0 -9
- package/dist/events.constant.js +0 -12
- package/dist/events.constants.d.ts +0 -9
- package/dist/events.constants.js +0 -12
- package/dist/events.d.ts +0 -39
- package/dist/events.js +0 -2
- package/dist/events.schema.d.ts +0 -229
- package/dist/events.schema.js +0 -95
- package/dist/events.type.d.ts +0 -42
- package/dist/events.type.js +0 -2
- package/dist/events.utils.schema.d.ts +0 -6
- package/dist/events.utils.schema.js +0 -22
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
paymentSchema,
|
|
4
|
+
paymentStatusSchema,
|
|
5
|
+
paymentMethodSchema,
|
|
6
|
+
cardBrandSchema,
|
|
7
|
+
failureCodeSchema,
|
|
8
|
+
createPaymentSchema,
|
|
9
|
+
updatePaymentStatusSchema,
|
|
10
|
+
refundPaymentSchema,
|
|
11
|
+
paymentResponseSchema,
|
|
12
|
+
paymentsListResponseSchema
|
|
13
|
+
} from './payments.schema';
|
|
14
|
+
|
|
15
|
+
// =============================================================================
|
|
16
|
+
// TYPE EXPORTS
|
|
17
|
+
// =============================================================================
|
|
18
|
+
|
|
19
|
+
// Enum types
|
|
20
|
+
export type PaymentStatus = z.infer<typeof paymentStatusSchema>;
|
|
21
|
+
export type PaymentMethod = z.infer<typeof paymentMethodSchema>;
|
|
22
|
+
export type CardBrand = z.infer<typeof cardBrandSchema>;
|
|
23
|
+
export type FailureCode = z.infer<typeof failureCodeSchema>;
|
|
24
|
+
|
|
25
|
+
// Main payment type
|
|
26
|
+
export type Payment = z.infer<typeof paymentSchema>;
|
|
27
|
+
|
|
28
|
+
// API request/response types
|
|
29
|
+
export type CreatePaymentRequest = z.infer<typeof createPaymentSchema>;
|
|
30
|
+
export type UpdatePaymentStatusRequest = z.infer<typeof updatePaymentStatusSchema>;
|
|
31
|
+
export type RefundPaymentRequest = z.infer<typeof refundPaymentSchema>;
|
|
32
|
+
|
|
33
|
+
export type PaymentResponse = z.infer<typeof paymentResponseSchema>;
|
|
34
|
+
export type PaymentsListResponse = z.infer<typeof paymentsListResponseSchema>;
|
|
35
|
+
|
|
36
|
+
// Service method parameter types
|
|
37
|
+
export interface CreatePaymentData {
|
|
38
|
+
orderId: string;
|
|
39
|
+
userId: string;
|
|
40
|
+
paymentId: string;
|
|
41
|
+
amount: number;
|
|
42
|
+
currency?: string;
|
|
43
|
+
paymentMethod: PaymentMethod;
|
|
44
|
+
last4?: string;
|
|
45
|
+
brand?: CardBrand;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface UpdatePaymentData {
|
|
49
|
+
paymentId: string;
|
|
50
|
+
status: PaymentStatus;
|
|
51
|
+
failureCode?: FailureCode;
|
|
52
|
+
failureMessage?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface RefundPaymentData {
|
|
56
|
+
paymentId: string;
|
|
57
|
+
refundAmount: number;
|
|
58
|
+
refundId: string;
|
|
59
|
+
reason: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Utility types for frontend
|
|
63
|
+
export interface PaymentWithOrder extends Omit<Payment, 'orderId'> {
|
|
64
|
+
orderId: {
|
|
65
|
+
_id: string;
|
|
66
|
+
orderNumber: string;
|
|
67
|
+
eventId: {
|
|
68
|
+
_id: string;
|
|
69
|
+
title: string;
|
|
70
|
+
schedule: {
|
|
71
|
+
startDate: string;
|
|
72
|
+
venue: {
|
|
73
|
+
name: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface PaymentSummary {
|
|
81
|
+
totalPayments: number;
|
|
82
|
+
successfulPayments: number;
|
|
83
|
+
failedPayments: number;
|
|
84
|
+
refundedPayments: number;
|
|
85
|
+
totalAmount: number;
|
|
86
|
+
totalRefunded: number;
|
|
87
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// Ticket status enum
|
|
4
|
+
export const ticketStatusSchema = z.enum(['valid', 'used', 'cancelled', 'refunded', 'transferred']);
|
|
5
|
+
|
|
6
|
+
// Check-in status enum
|
|
7
|
+
export const checkInStatusSchema = z.enum(['not_checked_in', 'checked_in']);
|
|
8
|
+
|
|
9
|
+
// Main ticket schema
|
|
10
|
+
export const ticketSchema = z.object({
|
|
11
|
+
_id: z.string().optional(), // MongoDB ObjectId
|
|
12
|
+
ticketNumber: z.string().regex(/^TKT-[A-Z0-9]{6}-[A-Z0-9]{4}-\d{2}$/), // TKT-EVT123-A3K9-01
|
|
13
|
+
|
|
14
|
+
// BELONGS TO
|
|
15
|
+
orderId: z.string(), // Parent order
|
|
16
|
+
eventId: z.string(), // Which event
|
|
17
|
+
userId: z.string(), // Owner
|
|
18
|
+
ticketVariantId: z.string(), // Which type (VIP, GA, etc)
|
|
19
|
+
|
|
20
|
+
// DETAILS (denormalized for speed)
|
|
21
|
+
eventTitle: z.string(),
|
|
22
|
+
eventDate: z.date(),
|
|
23
|
+
eventVenue: z.string(),
|
|
24
|
+
ticketType: z.string(), // "VIP Pass"
|
|
25
|
+
price: z.number().min(0),
|
|
26
|
+
|
|
27
|
+
// QR CODE
|
|
28
|
+
qrCode: z.string(), // SHA256 hash
|
|
29
|
+
qrCodeUrl: z.string(), // ImageKit/S3 URL
|
|
30
|
+
|
|
31
|
+
// STATUS
|
|
32
|
+
status: ticketStatusSchema,
|
|
33
|
+
|
|
34
|
+
// CHECK-IN
|
|
35
|
+
checkInStatus: checkInStatusSchema,
|
|
36
|
+
checkedInAt: z.date().optional(),
|
|
37
|
+
checkedInBy: z.string().optional(), // Staff user ID
|
|
38
|
+
|
|
39
|
+
// TRANSFER
|
|
40
|
+
transferredTo: z.string().optional(), // New owner user ID
|
|
41
|
+
transferredAt: z.date().optional(),
|
|
42
|
+
|
|
43
|
+
// LIFECYCLE
|
|
44
|
+
issuedAt: z.date().default(() => new Date()),
|
|
45
|
+
validUntil: z.date(), // Event end date
|
|
46
|
+
|
|
47
|
+
// SECURITY
|
|
48
|
+
secretHash: z.string(), // Internal validation hash
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// API request/response schemas
|
|
52
|
+
export const createTicketSchema = z.object({
|
|
53
|
+
orderId: z.string(),
|
|
54
|
+
eventId: z.string(),
|
|
55
|
+
userId: z.string(),
|
|
56
|
+
ticketVariantId: z.string(),
|
|
57
|
+
eventTitle: z.string(),
|
|
58
|
+
eventDate: z.date(),
|
|
59
|
+
eventVenue: z.string(),
|
|
60
|
+
ticketType: z.string(),
|
|
61
|
+
price: z.number().min(0),
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export const updateTicketStatusSchema = z.object({
|
|
65
|
+
status: ticketStatusSchema,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export const checkInTicketSchema = z.object({
|
|
69
|
+
staffUserId: z.string(),
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export const transferTicketSchema = z.object({
|
|
73
|
+
newOwnerId: z.string(),
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Response schemas
|
|
77
|
+
export const ticketResponseSchema = ticketSchema;
|
|
78
|
+
export const ticketsListResponseSchema = z.array(ticketResponseSchema);
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
ticketSchema,
|
|
4
|
+
ticketStatusSchema,
|
|
5
|
+
checkInStatusSchema,
|
|
6
|
+
createTicketSchema,
|
|
7
|
+
updateTicketStatusSchema,
|
|
8
|
+
checkInTicketSchema,
|
|
9
|
+
transferTicketSchema,
|
|
10
|
+
ticketResponseSchema,
|
|
11
|
+
ticketsListResponseSchema
|
|
12
|
+
} from './ticket.schema';
|
|
13
|
+
|
|
14
|
+
// =============================================================================
|
|
15
|
+
// TYPE EXPORTS
|
|
16
|
+
// =============================================================================
|
|
17
|
+
|
|
18
|
+
// Enum types
|
|
19
|
+
export type TicketStatus = z.infer<typeof ticketStatusSchema>;
|
|
20
|
+
export type CheckInStatus = z.infer<typeof checkInStatusSchema>;
|
|
21
|
+
|
|
22
|
+
// Main ticket type
|
|
23
|
+
export type Ticket = z.infer<typeof ticketSchema>;
|
|
24
|
+
|
|
25
|
+
// API request/response types
|
|
26
|
+
export type CreateTicketRequest = z.infer<typeof createTicketSchema>;
|
|
27
|
+
export type UpdateTicketStatusRequest = z.infer<typeof updateTicketStatusSchema>;
|
|
28
|
+
export type CheckInTicketRequest = z.infer<typeof checkInTicketSchema>;
|
|
29
|
+
export type TransferTicketRequest = z.infer<typeof transferTicketSchema>;
|
|
30
|
+
|
|
31
|
+
export type TicketResponse = z.infer<typeof ticketResponseSchema>;
|
|
32
|
+
export type TicketsListResponse = z.infer<typeof ticketsListResponseSchema>;
|
|
33
|
+
|
|
34
|
+
// Service method parameter types
|
|
35
|
+
export interface CreateTicketData {
|
|
36
|
+
orderId: string;
|
|
37
|
+
eventId: string;
|
|
38
|
+
userId: string;
|
|
39
|
+
ticketVariantId: string;
|
|
40
|
+
eventTitle: string;
|
|
41
|
+
eventDate: Date;
|
|
42
|
+
eventVenue: string;
|
|
43
|
+
ticketType: string;
|
|
44
|
+
price: number;
|
|
45
|
+
quantity: number; // For creating multiple tickets
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface UpdateTicketData {
|
|
49
|
+
ticketId: string;
|
|
50
|
+
status: TicketStatus;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface CheckInTicketData {
|
|
54
|
+
ticketId: string;
|
|
55
|
+
staffUserId: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface TransferTicketData {
|
|
59
|
+
ticketId: string;
|
|
60
|
+
newOwnerId: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Utility types for frontend
|
|
64
|
+
export interface TicketWithOrder extends Omit<Ticket, 'orderId'> {
|
|
65
|
+
orderId: {
|
|
66
|
+
_id: string;
|
|
67
|
+
orderNumber: string;
|
|
68
|
+
status: string;
|
|
69
|
+
createdAt: string;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface TicketWithEvent extends Omit<Ticket, 'eventId'> {
|
|
74
|
+
eventId: {
|
|
75
|
+
_id: string;
|
|
76
|
+
title: string;
|
|
77
|
+
schedule: {
|
|
78
|
+
startDate: string;
|
|
79
|
+
venue: {
|
|
80
|
+
name: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface TicketSummary {
|
|
87
|
+
totalTickets: number;
|
|
88
|
+
validTickets: number;
|
|
89
|
+
usedTickets: number;
|
|
90
|
+
checkedInTickets: number;
|
|
91
|
+
cancelledTickets: number;
|
|
92
|
+
refundedTickets: number;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// QR Code generation types
|
|
96
|
+
export interface QRCodeData {
|
|
97
|
+
ticketId: string;
|
|
98
|
+
ticketNumber: string;
|
|
99
|
+
eventTitle: string;
|
|
100
|
+
eventDate: string;
|
|
101
|
+
userId: string;
|
|
102
|
+
secretHash: string;
|
|
103
|
+
}
|
package/tsconfig.json
ADDED
package/dist/auth.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './auth/index';
|
package/dist/auth.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
// Re-export from the modular auth structure
|
|
18
|
-
__exportStar(require("./auth/index"), exports);
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const metricsSchema: z.ZodObject<{
|
|
3
|
-
views: z.ZodDefault<z.ZodNumber>;
|
|
4
|
-
ticketsSold: z.ZodDefault<z.ZodNumber>;
|
|
5
|
-
revenue: z.ZodDefault<z.ZodNumber>;
|
|
6
|
-
checkIns: z.ZodDefault<z.ZodNumber>;
|
|
7
|
-
averageRating: z.ZodOptional<z.ZodNumber>;
|
|
8
|
-
reviewCount: z.ZodDefault<z.ZodNumber>;
|
|
9
|
-
}, "strip", z.ZodTypeAny, {
|
|
10
|
-
views: number;
|
|
11
|
-
ticketsSold: number;
|
|
12
|
-
revenue: number;
|
|
13
|
-
checkIns: number;
|
|
14
|
-
reviewCount: number;
|
|
15
|
-
averageRating?: number | undefined;
|
|
16
|
-
}, {
|
|
17
|
-
views?: number | undefined;
|
|
18
|
-
ticketsSold?: number | undefined;
|
|
19
|
-
revenue?: number | undefined;
|
|
20
|
-
checkIns?: number | undefined;
|
|
21
|
-
averageRating?: number | undefined;
|
|
22
|
-
reviewCount?: number | undefined;
|
|
23
|
-
}>;
|
|
24
|
-
export declare const pricingSchema: z.ZodObject<{
|
|
25
|
-
platformFee: z.ZodDefault<z.ZodNumber>;
|
|
26
|
-
paymentProcessingFee: z.ZodOptional<z.ZodNumber>;
|
|
27
|
-
currency: z.ZodOptional<z.ZodString>;
|
|
28
|
-
}, "strip", z.ZodTypeAny, {
|
|
29
|
-
platformFee: number;
|
|
30
|
-
currency?: string | undefined;
|
|
31
|
-
paymentProcessingFee?: number | undefined;
|
|
32
|
-
}, {
|
|
33
|
-
currency?: string | undefined;
|
|
34
|
-
platformFee?: number | undefined;
|
|
35
|
-
paymentProcessingFee?: number | undefined;
|
|
36
|
-
}>;
|
|
37
|
-
export declare const payoutSchema: z.ZodObject<{
|
|
38
|
-
status: z.ZodOptional<z.ZodEnum<["pending", "scheduled", "completed"]>>;
|
|
39
|
-
amount: z.ZodOptional<z.ZodNumber>;
|
|
40
|
-
scheduledDate: z.ZodOptional<z.ZodString>;
|
|
41
|
-
paidAt: z.ZodOptional<z.ZodString>;
|
|
42
|
-
stripePayoutId: z.ZodOptional<z.ZodString>;
|
|
43
|
-
}, "strip", z.ZodTypeAny, {
|
|
44
|
-
status?: "pending" | "scheduled" | "completed" | undefined;
|
|
45
|
-
amount?: number | undefined;
|
|
46
|
-
scheduledDate?: string | undefined;
|
|
47
|
-
paidAt?: string | undefined;
|
|
48
|
-
stripePayoutId?: string | undefined;
|
|
49
|
-
}, {
|
|
50
|
-
status?: "pending" | "scheduled" | "completed" | undefined;
|
|
51
|
-
amount?: number | undefined;
|
|
52
|
-
scheduledDate?: string | undefined;
|
|
53
|
-
paidAt?: string | undefined;
|
|
54
|
-
stripePayoutId?: string | undefined;
|
|
55
|
-
}>;
|
|
56
|
-
export declare const cancellationSchema: z.ZodObject<{
|
|
57
|
-
allowed: z.ZodDefault<z.ZodBoolean>;
|
|
58
|
-
refundPercentage: z.ZodDefault<z.ZodNumber>;
|
|
59
|
-
deadlineHours: z.ZodOptional<z.ZodNumber>;
|
|
60
|
-
}, "strip", z.ZodTypeAny, {
|
|
61
|
-
allowed: boolean;
|
|
62
|
-
refundPercentage: number;
|
|
63
|
-
deadlineHours?: number | undefined;
|
|
64
|
-
}, {
|
|
65
|
-
allowed?: boolean | undefined;
|
|
66
|
-
refundPercentage?: number | undefined;
|
|
67
|
-
deadlineHours?: number | undefined;
|
|
68
|
-
}>;
|
|
69
|
-
export declare const policiesSchema: z.ZodObject<{
|
|
70
|
-
cancellation: z.ZodOptional<z.ZodObject<{
|
|
71
|
-
allowed: z.ZodDefault<z.ZodBoolean>;
|
|
72
|
-
refundPercentage: z.ZodDefault<z.ZodNumber>;
|
|
73
|
-
deadlineHours: z.ZodOptional<z.ZodNumber>;
|
|
74
|
-
}, "strip", z.ZodTypeAny, {
|
|
75
|
-
allowed: boolean;
|
|
76
|
-
refundPercentage: number;
|
|
77
|
-
deadlineHours?: number | undefined;
|
|
78
|
-
}, {
|
|
79
|
-
allowed?: boolean | undefined;
|
|
80
|
-
refundPercentage?: number | undefined;
|
|
81
|
-
deadlineHours?: number | undefined;
|
|
82
|
-
}>>;
|
|
83
|
-
transferable: z.ZodDefault<z.ZodBoolean>;
|
|
84
|
-
}, "strip", z.ZodTypeAny, {
|
|
85
|
-
transferable: boolean;
|
|
86
|
-
cancellation?: {
|
|
87
|
-
allowed: boolean;
|
|
88
|
-
refundPercentage: number;
|
|
89
|
-
deadlineHours?: number | undefined;
|
|
90
|
-
} | undefined;
|
|
91
|
-
}, {
|
|
92
|
-
cancellation?: {
|
|
93
|
-
allowed?: boolean | undefined;
|
|
94
|
-
refundPercentage?: number | undefined;
|
|
95
|
-
deadlineHours?: number | undefined;
|
|
96
|
-
} | undefined;
|
|
97
|
-
transferable?: boolean | undefined;
|
|
98
|
-
}>;
|
|
99
|
-
export declare const flagSchema: z.ZodObject<{
|
|
100
|
-
reportedBy: z.ZodString;
|
|
101
|
-
reason: z.ZodString;
|
|
102
|
-
description: z.ZodString;
|
|
103
|
-
createdAt: z.ZodOptional<z.ZodString>;
|
|
104
|
-
status: z.ZodDefault<z.ZodEnum<["pending", "resolved", "dismissed"]>>;
|
|
105
|
-
}, "strip", z.ZodTypeAny, {
|
|
106
|
-
status: "pending" | "resolved" | "dismissed";
|
|
107
|
-
description: string;
|
|
108
|
-
reportedBy: string;
|
|
109
|
-
reason: string;
|
|
110
|
-
createdAt?: string | undefined;
|
|
111
|
-
}, {
|
|
112
|
-
description: string;
|
|
113
|
-
reportedBy: string;
|
|
114
|
-
reason: string;
|
|
115
|
-
status?: "pending" | "resolved" | "dismissed" | undefined;
|
|
116
|
-
createdAt?: string | undefined;
|
|
117
|
-
}>;
|
|
118
|
-
export declare const moderationSchema: z.ZodObject<{
|
|
119
|
-
isFlagged: z.ZodDefault<z.ZodBoolean>;
|
|
120
|
-
flags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
121
|
-
reportedBy: z.ZodString;
|
|
122
|
-
reason: z.ZodString;
|
|
123
|
-
description: z.ZodString;
|
|
124
|
-
createdAt: z.ZodOptional<z.ZodString>;
|
|
125
|
-
status: z.ZodDefault<z.ZodEnum<["pending", "resolved", "dismissed"]>>;
|
|
126
|
-
}, "strip", z.ZodTypeAny, {
|
|
127
|
-
status: "pending" | "resolved" | "dismissed";
|
|
128
|
-
description: string;
|
|
129
|
-
reportedBy: string;
|
|
130
|
-
reason: string;
|
|
131
|
-
createdAt?: string | undefined;
|
|
132
|
-
}, {
|
|
133
|
-
description: string;
|
|
134
|
-
reportedBy: string;
|
|
135
|
-
reason: string;
|
|
136
|
-
status?: "pending" | "resolved" | "dismissed" | undefined;
|
|
137
|
-
createdAt?: string | undefined;
|
|
138
|
-
}>, "many">>;
|
|
139
|
-
suspendedUntil: z.ZodOptional<z.ZodString>;
|
|
140
|
-
banReason: z.ZodOptional<z.ZodString>;
|
|
141
|
-
}, "strip", z.ZodTypeAny, {
|
|
142
|
-
isFlagged: boolean;
|
|
143
|
-
flags?: {
|
|
144
|
-
status: "pending" | "resolved" | "dismissed";
|
|
145
|
-
description: string;
|
|
146
|
-
reportedBy: string;
|
|
147
|
-
reason: string;
|
|
148
|
-
createdAt?: string | undefined;
|
|
149
|
-
}[] | undefined;
|
|
150
|
-
suspendedUntil?: string | undefined;
|
|
151
|
-
banReason?: string | undefined;
|
|
152
|
-
}, {
|
|
153
|
-
isFlagged?: boolean | undefined;
|
|
154
|
-
flags?: {
|
|
155
|
-
description: string;
|
|
156
|
-
reportedBy: string;
|
|
157
|
-
reason: string;
|
|
158
|
-
status?: "pending" | "resolved" | "dismissed" | undefined;
|
|
159
|
-
createdAt?: string | undefined;
|
|
160
|
-
}[] | undefined;
|
|
161
|
-
suspendedUntil?: string | undefined;
|
|
162
|
-
banReason?: string | undefined;
|
|
163
|
-
}>;
|
|
164
|
-
export declare const seoSchema: z.ZodObject<{
|
|
165
|
-
metaTitle: z.ZodOptional<z.ZodString>;
|
|
166
|
-
metaDescription: z.ZodOptional<z.ZodString>;
|
|
167
|
-
keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
168
|
-
ogImage: z.ZodOptional<z.ZodString>;
|
|
169
|
-
}, "strip", z.ZodTypeAny, {
|
|
170
|
-
metaTitle?: string | undefined;
|
|
171
|
-
metaDescription?: string | undefined;
|
|
172
|
-
keywords?: string[] | undefined;
|
|
173
|
-
ogImage?: string | undefined;
|
|
174
|
-
}, {
|
|
175
|
-
metaTitle?: string | undefined;
|
|
176
|
-
metaDescription?: string | undefined;
|
|
177
|
-
keywords?: string[] | undefined;
|
|
178
|
-
ogImage?: string | undefined;
|
|
179
|
-
}>;
|
|
180
|
-
export declare const featuresSchema: z.ZodObject<{
|
|
181
|
-
isFeatured: z.ZodDefault<z.ZodBoolean>;
|
|
182
|
-
isPremium: z.ZodDefault<z.ZodBoolean>;
|
|
183
|
-
badges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
184
|
-
}, "strip", z.ZodTypeAny, {
|
|
185
|
-
isFeatured: boolean;
|
|
186
|
-
isPremium: boolean;
|
|
187
|
-
badges?: string[] | undefined;
|
|
188
|
-
}, {
|
|
189
|
-
isFeatured?: boolean | undefined;
|
|
190
|
-
isPremium?: boolean | undefined;
|
|
191
|
-
badges?: string[] | undefined;
|
|
192
|
-
}>;
|
|
193
|
-
export declare const historySchema: z.ZodObject<{
|
|
194
|
-
action: z.ZodString;
|
|
195
|
-
performedBy: z.ZodString;
|
|
196
|
-
timestamp: z.ZodOptional<z.ZodString>;
|
|
197
|
-
changes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
198
|
-
}, "strip", z.ZodTypeAny, {
|
|
199
|
-
action: string;
|
|
200
|
-
performedBy: string;
|
|
201
|
-
timestamp?: string | undefined;
|
|
202
|
-
changes?: Record<string, any> | undefined;
|
|
203
|
-
}, {
|
|
204
|
-
action: string;
|
|
205
|
-
performedBy: string;
|
|
206
|
-
timestamp?: string | undefined;
|
|
207
|
-
changes?: Record<string, any> | undefined;
|
|
208
|
-
}>;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.historySchema = exports.featuresSchema = exports.seoSchema = exports.moderationSchema = exports.flagSchema = exports.policiesSchema = exports.cancellationSchema = exports.payoutSchema = exports.pricingSchema = exports.metricsSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
// Metrics schema
|
|
6
|
-
exports.metricsSchema = zod_1.z.object({
|
|
7
|
-
views: zod_1.z.number({ required_error: 'Views must be a number' }).int('Views must be an integer').min(0, 'Views cannot be negative').default(0),
|
|
8
|
-
ticketsSold: zod_1.z.number({ required_error: 'Tickets sold must be a number' }).int('Tickets sold must be an integer').min(0, 'Tickets sold cannot be negative').default(0),
|
|
9
|
-
revenue: zod_1.z.number({ required_error: 'Revenue must be a number' }).min(0, 'Revenue cannot be negative').default(0),
|
|
10
|
-
checkIns: zod_1.z.number({ required_error: 'Check-ins must be a number' }).int('Check-ins must be an integer').min(0, 'Check-ins cannot be negative').default(0),
|
|
11
|
-
averageRating: zod_1.z.number().min(0, 'Rating must be at least 0').max(5, 'Rating cannot exceed 5').optional(),
|
|
12
|
-
reviewCount: zod_1.z.number({ required_error: 'Review count must be a number' }).int('Review count must be an integer').min(0, 'Review count cannot be negative').default(0),
|
|
13
|
-
});
|
|
14
|
-
// Business schemas
|
|
15
|
-
exports.pricingSchema = zod_1.z.object({
|
|
16
|
-
platformFee: zod_1.z.number({ required_error: 'Platform fee must be a number' }).min(0, 'Platform fee cannot be negative').default(5),
|
|
17
|
-
paymentProcessingFee: zod_1.z.number().min(0, 'Payment processing fee cannot be negative').optional(),
|
|
18
|
-
currency: zod_1.z.string().optional(),
|
|
19
|
-
});
|
|
20
|
-
exports.payoutSchema = zod_1.z.object({
|
|
21
|
-
status: zod_1.z.enum(['pending', 'scheduled', 'completed'], { required_error: 'Payout status must be pending, scheduled, or completed' }).optional(),
|
|
22
|
-
amount: zod_1.z.number().min(0, 'Payout amount cannot be negative').optional(),
|
|
23
|
-
scheduledDate: zod_1.z.string().datetime('Payout scheduled date must be a valid ISO datetime string').optional(),
|
|
24
|
-
paidAt: zod_1.z.string().datetime('Payout paid date must be a valid ISO datetime string').optional(),
|
|
25
|
-
stripePayoutId: zod_1.z.string().optional(),
|
|
26
|
-
});
|
|
27
|
-
// Policies schemas
|
|
28
|
-
exports.cancellationSchema = zod_1.z.object({
|
|
29
|
-
allowed: zod_1.z.boolean({ required_error: 'Cancellation allowed must be true or false' }).default(true),
|
|
30
|
-
refundPercentage: zod_1.z.number({ required_error: 'Refund percentage must be a number' }).min(0, 'Refund percentage cannot be less than 0').max(100, 'Refund percentage cannot exceed 100').default(100),
|
|
31
|
-
deadlineHours: zod_1.z.number().min(0, 'Deadline hours cannot be negative').optional(),
|
|
32
|
-
});
|
|
33
|
-
exports.policiesSchema = zod_1.z.object({
|
|
34
|
-
cancellation: exports.cancellationSchema.optional(),
|
|
35
|
-
transferable: zod_1.z.boolean({ required_error: 'Transferable must be true or false' }).default(false),
|
|
36
|
-
});
|
|
37
|
-
// Moderation schemas
|
|
38
|
-
exports.flagSchema = zod_1.z.object({
|
|
39
|
-
reportedBy: zod_1.z.string({ required_error: 'Reported by user ID is required' }), // ObjectId as string
|
|
40
|
-
reason: zod_1.z.string({ required_error: 'Report reason is required' }),
|
|
41
|
-
description: zod_1.z.string({ required_error: 'Report description is required' }),
|
|
42
|
-
createdAt: zod_1.z.string().datetime('Report created date must be a valid ISO datetime string').optional(),
|
|
43
|
-
status: zod_1.z.enum(['pending', 'resolved', 'dismissed'], { required_error: 'Report status must be pending, resolved, or dismissed' }).default('pending'),
|
|
44
|
-
});
|
|
45
|
-
exports.moderationSchema = zod_1.z.object({
|
|
46
|
-
isFlagged: zod_1.z.boolean({ required_error: 'Is flagged must be true or false' }).default(false),
|
|
47
|
-
flags: zod_1.z.array(exports.flagSchema, { required_error: 'Flags must be an array' }).optional(),
|
|
48
|
-
suspendedUntil: zod_1.z.string().datetime('Suspension date must be a valid ISO datetime string').optional(),
|
|
49
|
-
banReason: zod_1.z.string().optional(),
|
|
50
|
-
});
|
|
51
|
-
// SEO schema
|
|
52
|
-
exports.seoSchema = zod_1.z.object({
|
|
53
|
-
metaTitle: zod_1.z.string().optional(),
|
|
54
|
-
metaDescription: zod_1.z.string().optional(),
|
|
55
|
-
keywords: zod_1.z.array(zod_1.z.string(), { required_error: 'SEO keywords must be an array of strings' }).optional(),
|
|
56
|
-
ogImage: zod_1.z.string().optional(),
|
|
57
|
-
});
|
|
58
|
-
// Features schema
|
|
59
|
-
exports.featuresSchema = zod_1.z.object({
|
|
60
|
-
isFeatured: zod_1.z.boolean({ required_error: 'Is featured must be true or false' }).default(false),
|
|
61
|
-
isPremium: zod_1.z.boolean({ required_error: 'Is premium must be true or false' }).default(false),
|
|
62
|
-
badges: zod_1.z.array(zod_1.z.string(), { required_error: 'Badges must be an array of strings' }).optional(),
|
|
63
|
-
});
|
|
64
|
-
// History schema
|
|
65
|
-
exports.historySchema = zod_1.z.object({
|
|
66
|
-
action: zod_1.z.string({ required_error: 'History action is required' }),
|
|
67
|
-
performedBy: zod_1.z.string({ required_error: 'Performed by user ID is required' }), // ObjectId as string
|
|
68
|
-
timestamp: zod_1.z.string().datetime('History timestamp must be a valid ISO datetime string').optional(),
|
|
69
|
-
changes: zod_1.z.record(zod_1.z.any()).optional(),
|
|
70
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ageRestrictionSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.ageRestrictionSchema = zod_1.z.enum(['all_ages', '18+', '21+'], { required_error: "Age restriction is required" }).default('all_ages');
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const documentSchema: z.ZodObject<{
|
|
3
|
-
type: z.ZodOptional<z.ZodEnum<["venue_booking", "permit", "insurance", "license", "portfolio", "other"]>>;
|
|
4
|
-
url: z.ZodOptional<z.ZodString>;
|
|
5
|
-
filename: z.ZodString;
|
|
6
|
-
objectKey: z.ZodString;
|
|
7
|
-
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
filename: string;
|
|
9
|
-
objectKey: string;
|
|
10
|
-
type?: "venue_booking" | "permit" | "insurance" | "license" | "portfolio" | "other" | undefined;
|
|
11
|
-
url?: string | undefined;
|
|
12
|
-
}, {
|
|
13
|
-
filename: string;
|
|
14
|
-
objectKey: string;
|
|
15
|
-
type?: "venue_booking" | "permit" | "insurance" | "license" | "portfolio" | "other" | undefined;
|
|
16
|
-
url?: string | undefined;
|
|
17
|
-
}>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.documentSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.documentSchema = zod_1.z.object({
|
|
6
|
-
type: zod_1.z.enum(['venue_booking', 'permit', 'insurance', 'license', 'portfolio', 'other'], { required_error: 'Document type is required' }).optional(),
|
|
7
|
-
url: zod_1.z.string({ required_error: 'Document URL is required' }).url('Document URL must be valid').optional(),
|
|
8
|
-
filename: zod_1.z.string({ required_error: 'Document filename is required' }),
|
|
9
|
-
objectKey: zod_1.z.string({ required_error: 'Document object key is required' }),
|
|
10
|
-
});
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.eventTypeSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.eventTypeSchema = zod_1.z.enum(['concert', 'festival', 'conference', 'theater', 'sports', 'other'], { required_error: "Event type is required" }).default('concert');
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const MAX_TAGLINE_LENGTH = 150;
|
|
2
|
-
export declare const MAX_CATEGORIES = 3;
|
|
3
|
-
export declare const MAX_DESCRIPTION_LENGTH = 2000;
|
|
4
|
-
export declare const MAX_DOCUMENTS = 5;
|
|
5
|
-
export declare const SUPPORTED_IMAGE_TYPES: string[];
|
|
6
|
-
export declare const MAX_FILE_SIZE_MB = 10;
|
|
7
|
-
export declare const MAX_FILE_SIZE_BYTES: number;
|
|
8
|
-
export declare const ALLOWED_FILE_TYPES: string[];
|
|
9
|
-
export declare const ALLOWED_FILE_EXTENSIONS: string[];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ALLOWED_FILE_EXTENSIONS = exports.ALLOWED_FILE_TYPES = exports.MAX_FILE_SIZE_BYTES = exports.MAX_FILE_SIZE_MB = exports.SUPPORTED_IMAGE_TYPES = exports.MAX_DOCUMENTS = exports.MAX_DESCRIPTION_LENGTH = exports.MAX_CATEGORIES = exports.MAX_TAGLINE_LENGTH = void 0;
|
|
4
|
-
exports.MAX_TAGLINE_LENGTH = 150;
|
|
5
|
-
exports.MAX_CATEGORIES = 3;
|
|
6
|
-
exports.MAX_DESCRIPTION_LENGTH = 2000;
|
|
7
|
-
exports.MAX_DOCUMENTS = 5;
|
|
8
|
-
exports.SUPPORTED_IMAGE_TYPES = ['image/jpeg', 'image/jpg', 'image/png', 'image/gif', 'image/webp'];
|
|
9
|
-
exports.MAX_FILE_SIZE_MB = 10;
|
|
10
|
-
exports.MAX_FILE_SIZE_BYTES = exports.MAX_FILE_SIZE_MB * 1024 * 1024;
|
|
11
|
-
exports.ALLOWED_FILE_TYPES = ['image/jpeg', 'image/png', 'application/pdf'];
|
|
12
|
-
exports.ALLOWED_FILE_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.pdf'];
|