refactor: Replace hardcoded billing data seeding with plugin-configurable collection overrides

- Remove `seedBillingData` function for sample data creation
- Update refunds, invoices, and payments collections to use pluginConfig for dynamic overrides
- Introduce utility functions like `extractSlug` for customizable collection slugs
- Streamline customer relation and data extractor logic across collections
This commit is contained in:
2025-09-16 00:06:18 +02:00
parent f17b4c064e
commit 0308e30ebd
10 changed files with 515 additions and 580 deletions

5
src/plugin/utils.ts Normal file
View File

@@ -0,0 +1,5 @@
import type { CollectionConfig, Field } from 'payload'
export type FieldsOverride = (args: { defaultFields: Field[] }) => Field[]
export const extractSlug = (arg: string | Partial<CollectionConfig>) => typeof arg === 'string' ? arg : arg.slug!