feat: add earnings endpoint #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/earnings"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Walkthrough — Shop Earnings Endpoint
Changes Made
New File
show()method computing total earnings, per-product and per-payment-method breakdowns, and recent transactionsModified Files
Shop.php — Added
payments()hasManyThroughrelationship (Shop → Product → Payment)ShopPolicy.php — Added
viewEarnings()method (shop owner + admins)web.php — Added
GET /estabelecimentos/{shop}/financeiroinsideauth:sanctumgroupEndpoint Reference
GET/estabelecimentos/{shop}/financeiroauth:sanctum(shop owner or admin)?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD(optional)Verification
php -lsyntax checksweb.phpphp artisan route:listcould not run (vendor/ not installed in this workspace)View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.