Commit Graph

42 Commits

Author SHA1 Message Date
DeepnaPooja a9a201cce1 Update sales pages 2026-09-20 21:33:44 +05:30
DeepnaPooja b63f264551 Add cn package as a dependency 2026-09-18 12:00:04 +05:30
DeepnaPooja 7ced279ad5 Add toggle controls and payment API fields 2026-09-18 11:56:11 +05:30
DeepnaPooja 1f6d63a0b3 Add cheque to payment UI 2026-09-18 11:47:34 +05:30
Kalana B. Thilakarathna 03d01d4c4e name: CI/CD - ERP Core Monorepo
on:
  pull_request:
    branches:
      - production
    types:
      - closed

jobs:
  backend-build-and-deploy:
    name: Build & Deploy ERP Core Backend
    runs-on: linux
    if: github.event.pull_request.merged == true
    steps:
      - name: Checkout code
        run: |
          git clone \
            --depth 1 \
            --branch production \
            https://oauth2:${{ secrets.ERPCORE }}@gitea.hexdive.com/New_REP_SYSTEM/ERP-core.git \
            .

      - name: Restore backend
        run: dotnet restore Backend/ERPCore.sln

      - name: Publish backend
        run: |
          rm -rf /tmp/erpcore-deploy
          mkdir -p /tmp/erpcore-deploy
          dotnet publish Backend/ERPCore/ERPCore.csproj \
            -c Release \
            -r linux-x64 \
            --self-contained true \
            -o /tmp/erpcore-deploy

      - name: Stop backend service
        run: systemctl stop erpcore.service

      - name: Copy backend to deploy folder
        run: |
          mkdir -p /home/erp/core/publish
          rm -rf /home/erp/core/publish/*
          cp -r /tmp/erpcore-deploy/* /home/erp/core/publish/

      - name: Fix backend ownership and permissions
        run: |
          chown -R erpuser:erpuser /home/erp/core/publish
          find /home/erp/core/publish -type d -exec chmod 755 {} +
          find /home/erp/core/publish -type f -exec chmod 644 {} +
          chmod +x /home/erp/core/publish/ERPCore

      - name: Restart backend service
        run: systemctl restart erpcore.service

      - name: Verify backend
        run: |
          systemctl is-active erpcore.service && echo "Backend service running" || echo "Backend service failed"

  frontend-build-and-deploy:
    name: Build & Deploy ERP Core Frontend
    runs-on: linux
    needs: backend-build-and-deploy
    if: github.event.pull_request.merged == true
    steps:
      - name: Checkout code
        run: |
          git clone \
            --depth 1 \
            --branch Production \
            https://oauth2:${{ secrets.ERPCORE }}@gitea.hexdive.com/New_REP_SYSTEM/ERP-core.git \
            .

      - name: Build frontend Docker image
        run: docker build -t erpcore-frontend:latest Frontend/erp-system

      - name: Stop & remove existing frontend container
        run: |
          docker stop erpcore-frontend 2>/dev/null || true
          docker rm erpcore-frontend 2>/dev/null || true

      - name: Start frontend container
        run: |
          docker run -d \
            --name erpcore-frontend \
            -p 6702:6702 \
            --add-host=host.docker.internal:host-gateway \
            -e BACKEND_ORIGIN=http://host.docker.internal:6701 \
            --restart unless-stopped \
            --memory="512m" \
            --cpus="1.0" \
            --cap-drop ALL \
            --security-opt no-new-privileges \
            erpcore-frontend:latest

      - name: Remove old frontend images
        run: docker image prune -f

      - name: Verify frontend
        run: |
          docker ps --filter name=erpcore-frontend --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" \
            | grep erpcore-frontend && echo "Frontend container running" || echo "Frontend container failed"
2026-09-17 13:59:05 +05:30
DeepnaPooja 6c6d30f4f9 Add RetailPrice and AgencyMarginPercent to PriceListItem and related API updates 2026-09-09 16:32:57 +05:30
DeepnaPooja 617c0713a1 remove PriceListSheet component and integrate new price list creation page 2026-09-09 16:31:35 +05:30
DeepnaPooja 58d67495d2 Add supplier claims management components and API integration 2026-09-08 16:14:33 +05:30
DeepnaPooja e53db290c8 Add order return management 2026-09-08 16:12:44 +05:30
DeepnaPooja 2a5562a355 Add ClaimSettleDialog, ClaimSheet, ClaimViewSheet, and ClaimsClient 2026-09-08 16:12:05 +05:30
DeepnaPooja 5a6eca1f07 Add GrnViewSheet in GrnClient 2026-09-08 16:11:11 +05:30
DeepnaPooja bbf9e5b60e Add external location type and location name fields to stock responses 2026-09-08 13:18:42 +05:30
DeepnaPooja 508149dab8 Add adjustment functionality to stock API 2026-09-08 13:18:26 +05:30
DeepnaPooja eea87c0ee2 Add stock movement view and edit dialogs, and integrate with stock movements client 2026-09-08 13:18:11 +05:30
DeepnaPooja 3bcb42ea9b Add StockAdjustDialog component for stock adjustment 2026-09-08 13:17:46 +05:30
DeepnaPooja aee3e840a0 Add category viewing 2026-09-08 11:46:34 +05:30
DeepnaPooja ef0486829c Add brand viewing 2026-09-08 11:45:54 +05:30
DeepnaPooja 04004437bb Add item details viewing 2026-09-04 13:08:07 +05:30
DeepnaPooja dfd51b8273 Add user selection for check-in and update API to include user ID 2026-09-04 12:26:59 +05:30
DeepnaPooja 0523dabc5a Add route to StoresClient and implement updateStatus API method 2026-09-04 11:52:10 +05:30
DeepnaPooja 1bdda3a8ab Add route management to StoreViewPage 2026-09-04 11:50:06 +05:30
DeepnaPooja d0bf5581c5 Update PaymentBody fields in sales.ts 2026-09-03 17:22:49 +05:30
DeepnaPooja 8864f8ad6d Refactor payments UI: dropdowns, view sheet 2026-09-03 17:22:04 +05:30
DeepnaPooja 899d04e4eb Update orders flow 2026-09-03 17:04:13 +05:30
DeepnaPooja 5e48873422 Update sales UI 2026-09-03 16:08:34 +05:30
DeepnaPooja 63115f18b4 Validate ride close form 2026-09-03 13:31:33 +05:30
DeepnaPooja 1357f7e3f8 Update delivery tasks client 2026-09-03 13:31:14 +05:30
DeepnaPooja 831f33df34 Add delivery task details sheet 2026-09-03 13:29:17 +05:30
DeepnaPooja 8f5ad872e5 Add delivery task fail dialog 2026-09-03 13:29:02 +05:30
DeepnaPooja 38b893b9f6 Add delivery task deliver dialog 2026-09-03 13:28:55 +05:30
DeepnaPooja 5f82090272 Update delivery task API 2026-09-03 13:28:48 +05:30
DeepnaPooja 35fe512bd1 Add loading sheet view fix 2026-09-02 17:01:38 +05:30
DeepnaPooja de3dcb8c52 Add dialogs and update API for cancel requests 2026-09-02 16:30:04 +05:30
DeepnaPooja 7cf272e311 Consolidate region management APIs 2026-09-01 15:46:35 +05:30
Kalana B. Thilakarathna 68b34b3fc3 Refactor store CRUD to pages, add map-based location picker
Refactored store creation and editing from modal sheets to dedicated pages (`/stores/new`, `/stores/[id]/edit`), and added a new store detail view page (`/stores/[id]`). Introduced a `LocationPicker` component using `react-leaflet` for map-based location selection, replacing manual latitude/longitude inputs. Updated navigation in the store list to use these pages. Improved UI and user feedback for store forms and details. Updated backend API and form logic to match the new flow. Added `leaflet`, `react-leaflet`, and types as dependencies. Temporarily relaxed store scope checks in `StoreService.cs`. Updated table actions and types for the new workflow.
2026-09-01 10:53:55 +05:30
DeepnaPooja da9caa855a add sales visits ui 2026-08-31 13:00:33 +05:30
DeepnaPooja 9febae6d63 Add region management dialog for targets, budgets, tax rules & agencies
RegionManageSheet lets a manager set a region's target/budget for a
period, save a tax rule config, map a RegionalAgency user to the
region, and view its route/store hierarchy and dashboard stats. Wired
into the regions table as a new row action.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-30 22:46:05 +05:30
DeepnaPooja df27d58089 Add frontend types and API client methods for region management
Adds RegionalTargetResponse, RegionalBudgetResponse,
RegionAgencyMapResponse, RegionalTaxRuleResponse,
RegionHierarchyResponse, and RegionDashboardResponse types, plus
setTarget/setBudget/mapAgency/setTaxRule/hierarchy/dashboard methods
on the regions API client, mirroring the new backend endpoints.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-30 22:45:55 +05:30
Kalana B. Thilakarathna f4db83654c Implement GRN and Purchase Order sheets with form handling and data fetching 2026-08-29 21:03:31 +05:30
Kalana B. Thilakarathna dc7e7a70fc Add FlatPaymentController with RESTful payment endpoints
Introduced FlatPaymentController under Distribution.Features.Payment, providing GET and POST endpoints at /api/payments. Supports listing, retrieving, and creating payments with filtering and error handling. Business logic is delegated to PaymentService.
2026-08-26 20:18:58 +05:30
Kalana B. Thilakarathna 83d3272784 frontend fully integreated with the backend 2026-08-25 23:47:33 +05:30
Kalana B. Thilakarathna f1c036d1d8 frontend initiatewith shadcn uis 2026-08-25 16:20:50 +05:30