Skip to content

Commit

Permalink
Merge pull request #39 from froozeify/add-csv-export-for-sale
Browse files Browse the repository at this point in the history
Add csv export for sales
  • Loading branch information
froozeify authored Sep 6, 2024
2 parents 68397e4 + bae3299 commit 95f6ad1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
25 changes: 25 additions & 0 deletions config/normalizer_csv/sale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
App\Entity\Sale:
id: ~
createdAt: ~
updatedAt: ~
price: ~
comment: ~

seller:
prefix: seller
fields:
fullName: ~

paymentMode:
prefix: paymentMode
fields:
name: ~

salePurchasedItems:
prefix: item
fields:
id: ~
itemName: name
itemCategory: category
itemPrice: price
quantity: ~
3 changes: 2 additions & 1 deletion src/Entity/Sale.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
denormalizationContext: [
'groups' => ['sale', 'sale-write', 'timestamp-write-create']
],
order: ['createdAt' => 'DESC']
order: ['createdAt' => 'DESC'],
paginationClientEnabled: true,
)]
#[ApiFilter(OrderFilter::class, properties: ['createdAt' => 'DESC'])]
#[ApiFilter(SearchFilter::class, properties: ['seller.id' => 'exact'])]
Expand Down

0 comments on commit 95f6ad1

Please sign in to comment.