Skip to content

add Ng.modular crm#307

Open
fahrigedik wants to merge 8 commits intomasterfrom
NG.ModularCRM
Open

add Ng.modular crm#307
fahrigedik wants to merge 8 commits intomasterfrom
NG.ModularCRM

Conversation

@fahrigedik
Copy link
Member

How to Test It

  1. Run backend:
    dotnet run --project NG.ModularCRM/NG.ModularCRM.csproj
  2. Run frontend (new terminal):
      cd angular
   yarn symlinks:setup
   yarn start
  1. Verify Catalog/Ordering pages:
    • Open http://localhost:4200
    • Login and check:
      • /catalog shows products
      • /ordering shows orders with productName (not only productId)
  2. Verify event-based stock update:
    • Open https://localhost:44321/swagger
    • Create an order via POST /api/ordering/order with a valid productId
    • Confirm related product stock decreases by 1 in GET /api/catalog/product (or /catalog page)
  3. Verify reporting join endpoint:
    • Call GET /api/app/order-reporting/latest-orders - Ensure response includes combined fields: orderId, customerName, state, productId, productName

Introduce a new NG.ModularCRM ABP-based solution and full scaffold. Adds solution & project files, server-side modules (core, data, services, health checks, OpenIddict seed), EF Core DbContext and migration helpers, a Catalog module with contracts, tests and sample app services/controllers, localization resources for many languages, Angular frontend with build/config/assets, Docker and helper scripts, run profiles, and .cursor rule documentation files describing ABP conventions and patterns. Includes initial README, NuGet/Yarn configs, and utility scripts for initializing, migrating and running the solution.
Register the Catalog EF module in ModularCRMDbContext (add using and builder.ConfigureCatalog()) and generate the initial EF Core migration (Migration, Designer and ModelSnapshot) to capture the schema. Also update ModularCRMModule and the project file to include the catalog integration, and adjust Angular configuration (app config/routes, symlink script and tsconfig) to support the catalog module.
Introduce a Product entity and full catalog support: add Product model, DTOs, IProductAppService contract and ProductAppService implementation, mappers, and module registrations. Implement ICatalogDbContext and expose DbSet<Product> in the main ModularCRMDbContext, add EF Core migration (AddedProductEntity) and update model snapshot. Add Angular catalog component and generated proxy files (services/models/index) to enable client-side calls to the new product API. These changes implement the product catalog feature end-to-end (server model, API, persistence, and client proxy).
Introduce a new ModularCrm.Ordering feature module and integrate it into the main app and Angular frontend. Added Ordering projects (Contracts, Implementation, Tests, Angular package), localization JSON files and OrderingResource, permission and remote service constants, sample application service DTOs and tests, Fody configs and abp package metadata. Wire the module into the host app: add project reference, register OrderingModule in ModularCRMModule, extend ModularCRMDbContext to implement IOrderingDbContext and call builder.ConfigureOrdering(), and replace the DB context registration. Update Angular setup to include ordering package: symlink script, tsconfig paths, app config provider, and app routes. Also add AngularInstallationInfo.json for automatic installation. Overall this commit integrates the new Ordering module into backend and frontend scaffolding.
Introduce a new Ordering module: adds the Order entity, domain/data layer (OrderingDbContext updates and model-creating extensions), application service and contracts (IOrderAppService, DTOs), mappers, and module registration. Update the root ModularCRMDbContext to include Orders DbSet and add the EF Core migration (20260225125032_AddedOrderEntity) with updated model snapshot. Also add Angular proxy/client files and a basic ordering component to expose the new API from the frontend. This change implements the initial ordering feature and its DB migration.
Introduce a product integration service in the Catalog module (IProductIntegrationService + ProductIntegrationService) to fetch ProductDto by IDs. Add ProductName to OrderDto and wire the integration into the Ordering app: add Catalog.Contracts project reference, depend on CatalogContractsModule, inject IProductIntegrationService in OrderAppService, fetch product names and populate OrderDto.ProductName. Update mapper to ignore ProductName so it isn't overwritten, update Angular ordering component and generated proxy/models to include productName.
Add OrderPlacedEto and publish it when creating an order, and handle it in the Catalog module to decrement product stock.

- Added ModularCrm.Ordering.Contracts.Events.OrderPlacedEto (customer name + product id).
- OrderAppService now injects IDistributedEventBus and publishes OrderPlacedEto after inserting an order.
- Added OrderEventHandler in ModularCrm.Catalog to handle OrderPlacedEto: loads the product, decrements StockCount and updates the repository.
- Updated CatalogModule and ModularCrm.Catalog.csproj to depend on and reference the ordering contracts module so the catalog can consume the event contract.
Introduce OrderReportDto, IOrderReportingAppService and OrderReportingAppService to provide a reporting API for latest orders. The service queries Order and Product repositories, joins them, orders by CreationTime descending and returns the top 10 results as OrderReportDto (OrderId, CustomerName, State, ProductId, ProductName) using AsyncExecuter for async execution. This adds a clean interface and implementation for fetching recent order reports for UI/analytics use.
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.

1 participant