Skip to content

Add product short id to Boilerplate's sales module (#9929)#9930

Merged
msynk merged 6 commits intobitfoundation:developfrom
yasmoradi:9929
Feb 17, 2025
Merged

Add product short id to Boilerplate's sales module (#9929)#9930
msynk merged 6 commits intobitfoundation:developfrom
yasmoradi:9929

Conversation

@yasmoradi
Copy link
Member

@yasmoradi yasmoradi commented Feb 17, 2025

closes #9929

Summary by CodeRabbit

  • New Features
    • Added a sortable product number column in product listings, improving how users view and order products.
    • Updated product page URLs and routing to use numeric identifiers for a more streamlined navigation experience.
    • Enhanced localization by adding translations for the term “Number.”
    • Improved product data retrieval and display consistency.

@yasmoradi yasmoradi requested a review from msynk February 17, 2025 18:26
@coderabbitai
Copy link

coderabbitai bot commented Feb 17, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The pull request replaces the old GUID-based product identification with an integer-based system across the stack. In the UI, a new sortable column displaying the product “Number” has been added. Routing and controller methods have been updated to use this integer, along with changes in data mapping and URL generation. Database models and migrations now enforce uniqueness and include the new property. Additionally, localization files have been updated with new entries for “Number” and minor modifications have been made to tooling and query string handling.

Changes

File(s) Change Summary
.../Pages/Authorized/Products/ProductsPage.razor Added a new BitDataGridPropertyColumn for the "Number" property to enable display and sorting in the grid.
.../Pages/ProductPage.razor
.../Pages/ProductPage.razor.cs
Updated routing from GUID (Id) to integer (Number) and modified how product names are rendered; streamlined product loading logic.
.../Controllers/Products/ProductController.cs
.../Controllers/Products/ProductViewController.cs
Switched method parameters and internal logic from GUID to integer; adjusted cache purging and retrieval to use Number.
.../Data/AppDbContext.cs
.../Data/Configurations/Product/ProductConfiguration.cs
.../Migrations/*
.../AppDbContextModelSnapshot.cs
Added new Number property with unique index and a sequence for product numbers; removed older initial migration files and added a new migration for the database schema.
.../Mappers/ProductsMapper.cs
.../Models/Products/Product.cs
.../Dtos/Products/ProductDto.cs
Introduced the Number property and updated mapping methods and URL generation to reference the new identifier.
.../dotnet-tools.json (Server.Api & Server.Web) Updated the dotnet-ef tool version from "9.0.1" to "9.0.2".
.../Program.Middlewares.cs
.../Controllers/IAppController.cs
Modified the product query logic and updated extension methods to handle null values and use the new Number property.
.../Controllers/Products/IProductViewController.cs Changed method signatures to accept an integer-based identifier (number) instead of a GUID (id).
.../Resources/AppStrings*.resx Added new localization entries for "Number" in multiple languages.
.../Services/AppQueryStringCollection.cs Changed the Parse method signature to accept a nullable string to improve query string handling.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant R as Router
    participant PC as ProductController
    participant DB as Database

    U->>R: Navigate to ProductPage with Number & Name
    R->>PC: Route request with parameter Number
    PC->>DB: Query product details using Number
    DB-->>PC: Return product details
    PC-->>R: Render Product Page with updated info
    R-->>U: Display Product Information
Loading

Poem

I hopped through lines of code so bright,
Changing GUIDs to numbers in my sight.
New columns bloom with order and grace,
Each product now finds its proper place.
With whiskers twitching, I celebrate the change—
A rabbit’s code leap, fun and rearranged!
🥕🐇


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (11)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/ProductPage.razor.cs (3)

32-32: Parallelize loading carefully.

Using Task.WhenAll for parallel calls is an efficient approach, but if any of these tasks throw exceptions, none of them complete successfully. Consider adding robust error handling or partial-failure recovery to improve resilience.


41-41: Handle null product scenarios.

After invoking productViewController.Get(Number, ...), gracefully handle the possibility of a null or not-found product. For example, show an error message or redirect if product remains null.


56-56: Gracefully handle empty similar products.

Consider how the UI behaves if GetSimilar returns an empty list. Ensure there's a fallback or an appropriate message to maintain a good user experience.

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/AppDbContext.cs (1)

41-54: Streamline preprocessor directives and consider consolidated conditions.

Defining a sequence named “ProductNumber” for SQL Server or PostgreSQL is a solid approach for generating unique product numbers. However, the nested #if directives and provider name checks can complicate readability. Consider consolidating them or using environment-specific code paths to reduce complexity.

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Migrations/20250217182038_InitialMigration.cs (2)

7-9: Document migration purpose briefly.

Including a short comment summarizing this migration’s shift to integer-based product identification helps future maintainers understand context and rationale.


10-545: Evaluate seed data volume and indexing strategies.

The large seed block showcases numerous products with integer-based IDs. This is helpful for testing but can slow migrations in production. Ensure relevant indexes (e.g., the unique index on Number) are fully optimized, and consider optional or partial seeding in non-development environments.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Products/ProductsPage.razor (1)

39-43: Consider adding search functionality for product numbers.

While the new column is well-implemented with sorting capability, consider adding a search box similar to the Name and Category columns for enhanced filtering capabilities.

 <BitDataGridPropertyColumn Title="@Localizer[nameof(AppStrings.Number)]"
         Property="p => p!.Number"
         Class="name-col"
         Sortable="true">
+    <ColumnOptions>
+        <BitStack Horizontal>
+            <BitSearchBox @bind-Value="ProductNumberFilter"
+                         AutoFocus DisableAnimation
+                         Immediate DebounceTime="500"
+                         Placeholder="@Localizer[(nameof(AppStrings.SearchOnNumber))]" />
+            @if (isLoading)
+            {
+                <BitEllipsisLoading CustomSize="32" />
+            }
+        </BitStack>
+    </ColumnOptions>
 </BitDataGridPropertyColumn>
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Product/ProductConfiguration.cs (1)

25-56: Consider simplifying the product number generation logic.

The current approach using productsCountInEachForLoop and base number 9001 works but could be simplified for better maintainability.

Consider using a simpler sequential numbering approach:

-const int productsCountInEachForLoop = 23;
+const int baseNumber = 1001;

 for (int i = 1; i <= 6; i++)
 {
     builder.HasData(
-        new() { ..., Number = 9001 + (productsCountInEachForLoop * i) },
-        new() { ..., Number = 9002 + (productsCountInEachForLoop * i) },
+        new() { ..., Number = baseNumber + ((i - 1) * 100) + 1 },
+        new() { ..., Number = baseNumber + ((i - 1) * 100) + 2 },
         // ... rest of the products
     );
 }

This would generate more predictable numbers like 1001, 1002, 1101, 1102, etc.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/ProductPage.razor (1)

49-97: Consider enhancing error state handling.

While the product display logic is solid, consider adding explicit error state handling for cases where the product fails to load but isn't null (e.g., partial data).

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs (1)

239-239: LGTM! Consider optimizing sitemap generation.

The query change from ProductDto.Id to ProductDto.Number is correct. However, since sitemap generation is a resource-intensive operation, consider implementing additional caching strategies.

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Migrations/AppDbContextModelSnapshot.cs (1)

315-1833: Seed data updated with sequential product numbers.

The seed data changes look good:

  1. Each product has a unique Number value starting from 9024
  2. Product names follow a consistent pattern with numeric suffixes
  3. Referential integrity is maintained with valid CategoryId values

Consider optimizing the seed data volume.

The current seed data includes multiple copies of each product with only minor variations. Consider:

  1. Reducing the number of seed records to improve initial database creation time
  2. Using a more diverse set of products instead of duplicates
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 32ffa57 and 8a23f2e.

📒 Files selected for processing (23)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Products/ProductsPage.razor (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/ProductPage.razor (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/ProductPage.razor.cs (4 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/.config/dotnet-tools.json (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Products/ProductController.cs (2 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Products/ProductViewController.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/AppDbContext.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Product/ProductConfiguration.cs (2 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Migrations/20250109120517_InitialMigration.Designer.cs (0 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Migrations/20250109120517_InitialMigration.cs (0 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Migrations/20250217182038_InitialMigration.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Migrations/AppDbContextModelSnapshot.cs (5 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Mappers/ProductsMapper.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Products/Product.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/.config/dotnet-tools.json (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Controllers/IAppController.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Controllers/Products/IProductViewController.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Products/ProductDto.cs (2 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Services/AppQueryStringCollection.cs (1 hunks)
💤 Files with no reviewable changes (2)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Migrations/20250109120517_InitialMigration.Designer.cs
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Migrations/20250109120517_InitialMigration.cs
🧰 Additional context used
🪛 Biome (1.9.4)
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/.config/dotnet-tools.json

[error] 7-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-8: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/.config/dotnet-tools.json

[error] 7-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-8: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build and test
🔇 Additional comments (23)
src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Services/AppQueryStringCollection.cs (1)

18-18: LGTM! Improved null safety with explicit parameter nullability.

The change to make the query parameter nullable (string?) better reflects the method's ability to handle null input, making the contract more explicit. This aligns with C# best practices for null safety.

src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Controllers/IAppController.cs (1)

16-16: LGTM! Good improvement in type safety.

Making existingQueryString nullable is a positive change that:

  • Better represents the reality that query strings can be null
  • Provides clearer API contracts through nullable reference types
  • Maintains backward compatibility
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/.config/dotnet-tools.json (1)

6-8: Updated dotnet-ef Tool Version in API Configuration

The version for the dotnet-ef tool under the net9.0 framework condition has been updated to "9.0.2", which aligns with the intended update. Note that some static analysis tools are reporting errors (e.g., "End of file expected" and suggestions about using an array) which appear to be false positives in this context—likely due to the use of conditional comments. If these warnings persist and affect your build or validation pipelines, consider configuring your JSON linter or preprocessor to ignore these conditional comment sections.

🧰 Tools
🪛 Biome (1.9.4)

[error] 6-6: Expected a property but instead found '//#if (framework == 'net9.0')'.

Expected a property here.

(parse)


[error] 7-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-8: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/.config/dotnet-tools.json (1)

6-8: Consistent Update of dotnet-ef Version in Web Configuration

Similar to the API configuration file, the dotnet-ef tool's version under the net9.0 condition has been updated to "9.0.2". This ensures consistency across the project. The static analysis warnings (e.g., "End of file expected") are most likely false positives due to the conditional comment syntax. You may need to adjust your configuration for the JSON linter if these warnings are problematic.

🧰 Tools
🪛 Biome (1.9.4)

[error] 6-6: Expected a property but instead found '//#if (framework == 'net9.0')'.

Expected a property here.

(parse)


[error] 7-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-8: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/ProductPage.razor.cs (3)

12-12: Validate negative or zero values for product number.

While switching from Guid to int, ensure there's handling or checks for invalid Number values (e.g., negative or zero) to avoid potential runtime issues or confusion in the UI.


34-34: Check if base.OnInitAsync should be called first.

Some Blazor patterns dictate calling the base method early for framework initialization tasks. Verify whether any base logic depends on the product load sequence or concurrency behavior.


70-71: Confirm filter logic for sibling products.

Filtering out the current product by ne {Number} is correct to exclude the active product, but also ensure there's no overlap if partial matches occur. Verify that the OData filter remains safe from injection or misuse (the underlying library typically handles this, but it's worth confirming).

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Migrations/20250217182038_InitialMigration.cs (1)

547-589: Down method consistency.

Dropping the newly created entities is correct. If you add or rename additional tables in the future, ensure these DropTable calls remain consistent to cleanly revert the schema.

src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Controllers/Products/IProductViewController.cs (1)

11-18: LGTM! Consistent transition from GUID to integer-based product identification.

The changes consistently update all method signatures and route attributes to use number instead of id, aligning with the PR objective.

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Models/Products/Product.cs (1)

10-11: LGTM! Good use of Range validation.

The Range validation ensures that product numbers are non-negative.

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Mappers/ProductsMapper.cs (1)

25-29: LGTM! Good use of MapperIgnoreSource.

Correctly ignoring the Number property during mapping to prevent overwriting the database-managed value.

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Products/ProductViewController.cs (1)

16-24: LGTM! Well-structured implementation with appropriate caching.

The changes consistently use number for product identification while maintaining proper caching and async/await patterns.

Also applies to: 27-36, 38-49

src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Products/ProductDto.cs (2)

9-10: LGTM! Range validation ensures data integrity.

The [Range(0, int.MaxValue)] attribute ensures that product numbers are always non-negative.


60-60:

Details

✅ Verification successful

Verify URL compatibility with existing routes.

The URL pattern has been updated to use Number instead of Id. Ensure all route handlers and links throughout the application have been updated accordingly.


🏁 Script executed:

#!/bin/bash
# Search for any remaining URL patterns using product Id
rg -g '!*.{json,md,txt}' '/product/[^/]+/[^/]+' --multiline

Length of output: 724


URL Pattern Update Verified

  • Confirmed that src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Dtos/Products/ProductDto.cs now generates URLs using Number instead of the previous Id.
  • Verified in src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Products/ProductController.cs that route calls and cache purging utilize the updated URL pattern (e.g., /product/{dto.Number}/{Uri.EscapeDataString(dto.Name!)}).
  • No instances of URL patterns using Id were detected in our search.
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Products/ProductController.cs (2)

81-81: LGTM! Cache purging paths updated correctly.

Cache purging paths now use the new number-based URL structure, maintaining consistency with the DTO changes.


102-102: LGTM! Cache purging in Delete method aligned with Update method.

The cache purging paths in the Delete method mirror those in the Update method, ensuring consistent cache invalidation.

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Product/ProductConfiguration.cs (1)

11-11: LGTM! Unique index ensures data integrity.

The unique index on the Number property prevents duplicate product numbers.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/ProductPage.razor (1)

1-2: LGTM! Route parameter changes align with the new integer-based product identification.

The route parameter changes from {Id:guid} to {Number:int} are consistent across both default and culture-specific routes.

src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx (1)

381-383: LGTM! Persian localization for "Number" added correctly.

The new localization entry for "Number" (شماره) follows the established pattern and provides proper Persian translation.

src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx (1)

381-383: LGTM! English localization for "Number" added correctly.

The new localization entry for "Number" follows the established pattern and maintains consistency with other language resources.

src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx (1)

381-383: LGTM! Dutch localization for "Number" added.

The new localization entry "Nummer" for "Number" is correctly added and follows the existing format.

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Migrations/AppDbContextModelSnapshot.cs (2)

289-291:

Details

❓ Verification inconclusive

Product entity enhanced with image support and unique number.

Good additions to the Product entity:

  1. ImageFileName property for storing image references
  2. Number property with a unique index for product identification
  3. Logical property ordering maintained

Verify image file handling implementation.

Since a new ImageFileName property has been added, ensure proper image file handling is implemented:

  1. File upload validation
  2. Storage location configuration
  3. File cleanup on product deletion

Also applies to: 297-301, 310-312


🏁 Script executed:

#!/bin/bash
# Search for image handling implementation
rg -g "!*.resx" -g "!*.cs.d.ts" "ImageFileName" -A 5

Length of output: 7714


Product entity enhancements verified with integrated image file handling – further validation needed

The migration snapshot and model updates correctly introduce the new ImageFileName and Number properties in the Product entity. The related image file handling is partially implemented (see usage in the AttachmentController and ProductDto), ensuring that image paths are processed as expected.

Please ensure that the complete image handling flow is robust by verifying:

  • File upload validations are in place.
  • Storage location configuration is correctly set.
  • File cleanup on product deletion is properly handled.

14-14:

Details

✅ Verification successful

Verify EF Core version compatibility.

The EF Core version has been updated to 9.0.2. Let's verify this is the latest stable version and check for any breaking changes.


🌐 Web query:

What is the latest stable version of Entity Framework Core?

💡 Result:

The latest stable version of Entity Framework Core as of February 17, 2025 is Entity Framework Core 9.0, which was released on November 14, 2024[6][10]. This version targets .NET 8 and will be supported until May 12, 2026[4].

Key details about EF Core versions:

  • EF Core 8.0 (released November 2023) introduced features like JSON columns and bulk updates[1]
  • EF Core 9.0 added new capabilities including enhanced LINQ query optimizations and improved performance metrics[6]
  • The next planned release is EF Core 10.0, scheduled for November 2025[4]

The latest NuGet package available is Microsoft.EntityFrameworkCore v9.0.2, which includes recent bug fixes and performance improvements[8][10]. This version continues to support multiple database providers including SQL Server, PostgreSQL, MySQL, and SQLite[2].

Citations:


EF Core Version Compatibility Verified

  • The code in src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Migrations/AppDbContextModelSnapshot.cs at line 14 now uses:
            modelBuilder.HasAnnotation("ProductVersion", "9.0.2");
  • A web query confirms that EF Core 9.0 is the latest stable version and the NuGet package Microsoft.EntityFrameworkCore v9.0.2 is in line with this release.
  • No breaking changes or additional modifications are necessary.

@yasmoradi yasmoradi changed the title Add product number to Boilerplate's sales module (#9929) Add product short id to Boilerplate's sales module (#9929) Feb 17, 2025
@msynk msynk merged commit 3e2dd8e into bitfoundation:develop Feb 17, 2025
3 checks passed
@yasmoradi yasmoradi deleted the 9929 branch February 17, 2025 19:48
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.

Boilerplate project template's sales module doesn't contain product short id

2 participants