Includes all Phase 1 features: - Search-first navigation with auto-complete - Responsive reading interface (desktop/tablet/mobile) - 4 customization presets + full fine-tuning controls - Layered details panel with notes, bookmarks, highlights - Smart offline caching with IndexedDB and auto-sync - Full accessibility (WCAG 2.1 AA) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
75 lines
1.6 KiB
TypeScript
75 lines
1.6 KiB
TypeScript
import { CollectionConfig } from 'payload';
|
|
|
|
export const Donations: CollectionConfig = {
|
|
slug: 'donations',
|
|
admin: {
|
|
useAsTitle: 'donorName',
|
|
defaultColumns: ['donorName', 'amount', 'currency', 'status', 'createdAt'],
|
|
group: 'E-Commerce',
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'donorName',
|
|
type: 'text',
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'donorEmail',
|
|
type: 'email',
|
|
required: true,
|
|
index: true,
|
|
},
|
|
{
|
|
name: 'amount',
|
|
type: 'number',
|
|
required: true,
|
|
min: 0,
|
|
admin: {
|
|
description: 'Amount in dollars',
|
|
},
|
|
},
|
|
{
|
|
name: 'currency',
|
|
type: 'text',
|
|
defaultValue: 'USD',
|
|
},
|
|
{
|
|
name: 'stripeSessionId',
|
|
type: 'text',
|
|
unique: true,
|
|
index: true,
|
|
},
|
|
{
|
|
name: 'stripePaymentIntentId',
|
|
type: 'text',
|
|
unique: true,
|
|
index: true,
|
|
},
|
|
{
|
|
name: 'status',
|
|
type: 'select',
|
|
options: [
|
|
{ label: 'Pending', value: 'pending' },
|
|
{ label: 'Completed', value: 'completed' },
|
|
{ label: 'Failed', value: 'failed' },
|
|
],
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'message',
|
|
type: 'textarea',
|
|
},
|
|
{
|
|
name: 'anonymous',
|
|
type: 'checkbox',
|
|
defaultValue: false,
|
|
},
|
|
],
|
|
access: {
|
|
read: ({ req }) => req.user?.role === 'admin' || req.user?.role === 'super-admin',
|
|
create: () => true,
|
|
update: ({ req }) => req.user?.role === 'admin' || req.user?.role === 'super-admin',
|
|
delete: ({ req }) => req.user?.role === 'super-admin',
|
|
},
|
|
};
|