feat: add defaultPopulate configuration to payments collection

- Include defaultPopulate fields to simplify API responses
- Ensure key payment details (amount, status, provider, etc.) are preloaded
This commit is contained in:
2025-11-18 23:12:30 +01:00
parent 4fde492e0f
commit 46bec6bd2e

View File

@@ -144,6 +144,18 @@ export function createPaymentsCollection(pluginConfig: BillingPluginConfig): Col
useAsTitle: 'id', useAsTitle: 'id',
}, },
fields, fields,
defaultPopulate: {
id: true,
provider: true,
status: true,
amount: true,
currency: true,
description: true,
checkoutUrl: true,
providerId: true,
metadata: true,
providerData: true,
},
hooks: { hooks: {
afterChange: [ afterChange: [
async ({ doc, operation, req, previousDoc }) => { async ({ doc, operation, req, previousDoc }) => {