Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order export csv #990

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Order export csv #990

wants to merge 10 commits into from

Conversation

kernicPanel
Copy link
Member

Purpose

Export filtered orders as csv

Fixes #980

@kernicPanel kernicPanel force-pushed the order-export-csv branch 2 times, most recently from d9660be to 10ce316 Compare December 11, 2024 14:27
@kernicPanel kernicPanel marked this pull request as ready for review December 11, 2024 14:50
src/backend/joanie/core/api/admin/__init__.py Outdated Show resolved Hide resolved
src/backend/joanie/core/api/admin/__init__.py Outdated Show resolved Hide resolved
src/backend/joanie/core/api/admin/__init__.py Outdated Show resolved Hide resolved
@kernicPanel kernicPanel force-pushed the order-export-csv branch 8 times, most recently from 7b0e4c4 to 57904b6 Compare December 17, 2024 08:30
queryset.iterator(), child=self.get_serializer()
)
now = timezone.now().strftime("%d-%m-%Y_%H-%M-%S")
return StreamingHttpResponse(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the time needed to Stream the whole file, I emit some reserve about that as this will block a worker. If you are able to connect your local env to the preproduction database this is something to check IMO.

src/backend/joanie/core/serializers/admin.py Outdated Show resolved Hide resolved
src/backend/joanie/core/serializers/admin.py Outdated Show resolved Hide resolved
@kernicPanel kernicPanel force-pushed the order-export-csv branch 4 times, most recently from c8068b8 to ae48642 Compare December 19, 2024 10:03
@@ -19,7 +19,7 @@ export default defineConfig({
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
reporter: "list",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

src/backend/joanie/core/api/admin/__init__.py Show resolved Hide resolved
As we want to export order csv, an api endpoint is needed.
We want to export the order list using the current filters.
Flaky test retry needs to be increased.
When we start a localtunnel, we don't want to rerun the full stack
everytime.
Extract demo data generation to use it in order export test.
Reduce log levers to remove noise in console output during tests.
Order export headers were not translated.
Adds a test asserting that orders export allows filtering.
As we have the same logic to get the best available user name, it has
been moved to the user model.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backoffice - Export orders as CSV
4 participants