Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
80f5b6e
Initial plan
Copilot Sep 3, 2025
76d298c
Initial analysis of NopCommerce structure for serial number plugin
Copilot Sep 3, 2025
760b63f
Create core plugin structure with domain models and services
Copilot Sep 3, 2025
7f88909
Add API controllers, customer views, and basic test structure
Copilot Sep 3, 2025
2c57bd2
Complete plugin with admin interface, DI configuration, and documenta…
Copilot Sep 3, 2025
e604d94
Add GitHub Actions workflow for build and test automation
aelmen Sep 3, 2025
9a329fb
Fix build error by removing non-functional test file with missing pro…
Copilot Sep 3, 2025
6e67563
Remove Serial Numbers plugin files and update project configuration
aelmen Sep 4, 2025
54ba9e2
Add Serial Numbers plugin with configuration controller, settings mod…
aelmen Sep 4, 2025
1119163
Add Serial Numbers plugin with configuration model, views, and styles
aelmen Sep 4, 2025
7221976
Checkpoint from VS Code for coding agent session
aelmen Sep 4, 2025
be4b78a
Initial plan
Copilot Sep 4, 2025
0436dd4
Fix form handling in SerialNumbers plugin to follow NopCommerce patterns
Copilot Sep 4, 2025
c2c2bf0
Add initial copilot instructions for Serial Numbers plugin
aelmen Sep 5, 2025
d545733
Merge branch 'copilot/vscode1757000943365' of https://github.com/Need…
aelmen Sep 5, 2025
c83065c
Implement Serial Numbers plugin with admin interface and validation l…
aelmen Sep 5, 2025
1ded2c7
Checkpoint from VS Code for coding agent session
aelmen Sep 5, 2025
48599c9
Initial plan
Copilot Sep 5, 2025
99c6421
Improve Serial Numbers plugin with modern UI and best practices
Copilot Sep 5, 2025
7757ca1
Fix Razor syntax error in Configure.cshtml asp-additional-attributes
Copilot Sep 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

# Copilot Instructions – Nop.Plugin.Misc.SerialNumbers

## Syfte
Denna plugin hanterar generering och administration av serienummer för produkter i NopCommerce. All kod följer strikt NopCommerce 4.60+ och .NET 9 best practice. Endast version 4.60+ ska användas – äldre versioner eller andra mönster får inte övervägas eller implementeras.

## Struktur
- **Ingen Areas/Admin**: All adminfunktionalitet sker via controller, vy och komponenter enligt NopCommerce standard.
- **Konfigurationsmodell**: `SerialNumberSettingsModel` är ett `record` som ärver från `BaseNopModel`.
- **Validering och hjälptexter**: Alla properties har `[NopResourceDisplayName]` och relevanta valideringsattribut.
- **CSS**: All CSS är flyttad till extern fil (`Content/serial-numbers.css`).
- **Controller**: Async GET/POST för konfiguration, följer Dependency Injection och Clean Code.
- **Vy**: Razor-formulär med hjälptexter, validering och modern UI.
- **Testbarhet**: Kod är testbar och följer SOLID.


- Använd alltid async/await.
- Följ NopCommerce plugin-arkitektur.
- Endast NopCommerce 4.60+ får användas (äldre versioner, klasser eller patterns är ej tillåtna).
- Placera plugin i `Plugins`-mappen.
- Ingen inline CSS – använd extern fil.
- Alla konfigurationsvyer ska vara användarvänliga och ha hjälptexter.
- Validering med DataAnnotations.
- Ingen överflödig kod i modeller.
- Bygg med `dotnet build src/NopCommerce.sln`.
- Stöd för MS SQL, MySQL, PostgreSQL och Docker.

- Använd aldrig regions (`#region`/`#endregion`) i kodbasen.

## Källor
- [NopCommerce Docs](https://docs.nopcommerce.com/en/index.html)
- [NopCommerce GitHub](https://github.com/nopSolutions/nopCommerce)
- [Microsoft Docs: Records (C#)](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record)
- [NopCommerce Migration Guide](https://github.com/nopSolutions/nopCommerce/issues/6722)

## Checklist
- [x] Areas/Admin borttaget
- [x] Konfigurationsmodell som record
- [x] Hjälptexter och validering
- [x] CSS i extern fil
- [x] Controller och vy enligt best practice
- [x] Testbar kod
- [x] Byggbar och synlig i admin

## Vidare arbete
- Lägg till XML-kommentarer för properties om önskas.
- Granska controller, vy och teststruktur vid behov.
- Följ alltid senaste NopCommerce och .NET riktlinjer.
29 changes: 29 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build and Test

on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore src/NopCommerce.sln
- name: Build
run: dotnet build src/NopCommerce.sln --configuration Release --no-restore
- name: Test
run: dotnet test src/NopCommerce.sln --configuration Release --no-build --logger "trx;LogFileName=test-results.trx"
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results
path: '**/TestResults/*.trx'
Loading
Loading