Skip to content

feat: Add SrushtiAPI - .NET Core Web API with CRUD for Sales, Purchase, and Employee#68

Open
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
devin/1774515252-srushti-api-dotnet
Open

feat: Add SrushtiAPI - .NET Core Web API with CRUD for Sales, Purchase, and Employee#68
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
devin/1774515252-srushti-api-dotnet

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot commented Mar 26, 2026

Summary

Adds a new .NET 8 Web API project (SrushtiAPI/) implementing CRUD operations for Sales, Purchase, and Employee entities using the Repository Pattern with Dapper as the micro-ORM.

Project structure:

  • Models/Sales, Purchase, Employee entity classes
  • Repositories/Interfaces/ISalesRepository, IPurchaseRepository, IEmployeeRepository
  • Repositories/SalesRepository, PurchaseRepository, EmployeeRepository (Dapper implementations)
  • Controllers/SalesController, PurchaseController, EmployeeController (full CRUD: GET all, GET by id, POST, PUT, DELETE)
  • Data/DapperContext.cs — Connection factory using Microsoft.Data.SqlClient
  • Data/DatabaseSchema.sql — SQL Server DDL script for Sales, Purchases, and Employees tables
  • DI wired in Program.cs; Swagger enabled in Development mode

Review & Testing Checklist for Human

  • TotalAmount on Sales/Purchase is accepted from the client rather than computed server-side from Quantity × UnitPrice. Verify this is the desired behavior — it allows clients to submit inconsistent totals.
  • No input validation on any controller models (no [Required], [Range], [EmailAddress], etc.). Invalid or empty payloads will reach the database layer and fail there.
  • Connection string uses Trusted_Connection=True (Windows Auth) — update appsettings.json with actual SQL Server credentials before deploying or testing on non-Windows environments.
  • SrushtiAPI.http still references the old /weatherforecast/ endpoint from the template — should be updated to /api/Sales, /api/Purchase, and /api/Employee if this file is kept.
  • Test plan: Run DatabaseSchema.sql against a SQL Server instance, update the connection string, then dotnet run inside SrushtiAPI/. Verify all endpoints via Swagger UI at http://localhost:5229/swagger — create, read, update, and delete records for Sales, Purchase, and Employee.

Notes

  • The project targets .NET 8.0 and uses Dapper 2.1.72 + Microsoft.Data.SqlClient 7.0.0.
  • No unit/integration tests are included yet.
  • No global exception handling middleware — unhandled SQL errors will surface as raw 500 responses.
  • DapperContext stores an unused _configuration field (only _connectionString is used after the constructor).

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/083835991649441e801ad6578317fd14


Open with Devin

…hase using Repository Pattern and Dapper

- Models: Sales, Purchase
- Repository interfaces: ISalesRepository, IPurchaseRepository
- Repository implementations with Dapper ORM
- Controllers: SalesController, PurchaseController with full CRUD
- DapperContext for database connection management
- SQL schema script for Sales and Purchases tables
- Dependency injection configured in Program.cs
- Swagger/OpenAPI documentation enabled
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

- Model: Employee (FirstName, LastName, Email, Phone, Department, Designation, Salary, DateOfJoining)
- Repository interface: IEmployeeRepository
- Repository implementation: EmployeeRepository with Dapper
- Controller: EmployeeController with full CRUD endpoints
- Updated DatabaseSchema.sql with Employees table
- Registered IEmployeeRepository in DI container
@devin-ai-integration devin-ai-integration bot changed the title feat: Add SrushtiAPI - .NET Core Web API with CRUD for Sales and Purchase feat: Add SrushtiAPI - .NET Core Web API with CRUD for Sales, Purchase, and Employee Mar 26, 2026
Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

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.

0 participants