Skip to content

Institute works v1#1892

Open
Manijitya30 wants to merge 11 commits into
FusionIIIT:institute-works-v1from
Manijitya30:institute-works-v1
Open

Institute works v1#1892
Manijitya30 wants to merge 11 commits into
FusionIIIT:institute-works-v1from
Manijitya30:institute-works-v1

Conversation

@Manijitya30
Copy link
Copy Markdown

Institute Works V1 - Backend Improvements

Overview

This pull request focuses on backend enhancements for the Institute Works (IWD) module, improving API consistency, validation handling, authentication, workflow management, and overall system reliability.

Key Backend Changes

Standardized Error Handling

  • Added comprehensive backend documentation for standardized API error responses.
  • Implemented consistent error and success response formats across endpoints.
  • Added structured validation and machine-readable error codes for easier frontend integration.

Authentication and Security

  • Configured Django REST Framework to use token-based authentication by default.
  • Improved session handling and backend security consistency.

Safer User Attribute Handling

  • Refactored middleware and views to safely access extrainfo attributes using fallback checks.
  • Prevented potential runtime errors for users missing extra profile information.

Serializer Validation Improvements

  • Added validation checks for:

    • Requests
    • Proposals
    • Inventory items
    • Vendors
    • Feedback submissions
    • Work orders
  • Improved field validation and automatic calculation logic for proposal items.

New Backend Features

Inventory Management APIs

  • Added inventory item management endpoints.
  • Implemented inventory transaction tracking.
  • Added material issue and receive workflows.

SLA Monitoring

  • Added SLA dashboard APIs.
  • Added escalation tracking support.
  • Implemented overdue and due-soon request monitoring.

Feedback & Reopening Workflow

  • Added feedback submission APIs.
  • Added request reopening functionality.
  • Added feedback history endpoints.

Database and Migration Updates

  • Added new migrations for:

    • Academic specialization choices
    • EIS year field updates
    • Inventory-related models
    • SLA and feedback models

Admin Panel Improvements

  • Registered multiple IWD models in Django admin for easier backend management and monitoring.

API Refactoring

  • Refactored and cleaned API routing structure.
  • Added multiple new endpoints for backend workflows and integrations.
  • Improved maintainability of API services and views.

Build and Dependency Updates

  • Updated Dockerfile to pin pip version for stable dependency installation and consistent builds.

Result

These backend changes improve maintainability, validation consistency, workflow automation, API reliability, and overall robustness of the Institute Works module.

Copilot AI review requested due to automatic review settings May 8, 2026 06:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request introduces backend infrastructure and workflow changes for the Institute Works (IWD) module, aiming to standardize API responses, tighten authentication defaults, and expand system-level testing coverage.

Changes:

  • Added a shared helper for standardized API success/error responses and accompanying IWD error-handling documentation.
  • Refactored parts of the IWD web workflow (routing/forwarding) and URL routing structure.
  • Added extensive IWD module test suites (UC/BR/WF), specs, and a custom report-generating test runner; added multiple new/updated migrations and build pinning.

Reviewed changes

Copilot reviewed 51 out of 51 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
FusionIIIT/helpers/error_response.py Adds standardized API response helpers/decorator (currently missing fields expected by new tests/docs).
FusionIIIT/helpers/init.py Marks/helpers package docstring.
FusionIIIT/Fusion/settings/common.py Adds global DRF authentication configuration.
FusionIIIT/Fusion/middleware/custom_middleware.py Makes extrainfo.user_type access safer and guards empty designation lists.
FusionIIIT/applications/scholarships/migrations/0003_auto_20260419_1852.py Updates scholarship migration defaults.
FusionIIIT/applications/programme_curriculum/migrations/0032_auto_20260419_1852.py Updates programme curriculum migration defaults/choices.
FusionIIIT/applications/iwdModuleV2/views.py Refactors IWD web workflow forwarding/atomic blocks and receiver resolution.
FusionIIIT/applications/iwdModuleV2/urls.py Replaces legacy url() routes with path() and renames route names/paths.
FusionIIIT/applications/iwdModuleV2/tests/test_workflows.py Adds end-to-end workflow tests suite.
FusionIIIT/applications/iwdModuleV2/tests/test_use_cases.py Adds use-case driven API tests suite.
FusionIIIT/applications/iwdModuleV2/tests/test_frontend_integration.py Adds backend/“frontend parsing” integration tests for error display.
FusionIIIT/applications/iwdModuleV2/tests/test_error_responses.py Adds standardized error response contract tests.
FusionIIIT/applications/iwdModuleV2/tests/test_business_rules.py Adds business-rules enforcement tests suite.
FusionIIIT/applications/iwdModuleV2/tests/specs/workflows.yaml Adds workflow spec inputs for reporting.
FusionIIIT/applications/iwdModuleV2/tests/specs/business_rules.yaml Adds business rules spec inputs for reporting.
FusionIIIT/applications/iwdModuleV2/tests/specs/init.py Marks specs as a package.
FusionIIIT/applications/iwdModuleV2/tests/runner.py Adds custom Django test runner + CSV report generator.
FusionIIIT/applications/iwdModuleV2/tests/reports/WF_Test_Design.csv Generated workflow test design report committed.
FusionIIIT/applications/iwdModuleV2/tests/reports/UC_Test_Design.csv Generated use-case test design report committed.
FusionIIIT/applications/iwdModuleV2/tests/reports/Test_Execution_Log.csv Generated execution log report committed.
FusionIIIT/applications/iwdModuleV2/tests/reports/Module_Test_Summary.csv Generated module summary report committed.
FusionIIIT/applications/iwdModuleV2/tests/reports/Defect_Log.csv Generated defect log report committed.
FusionIIIT/applications/iwdModuleV2/tests/reports/BR_Test_Design.csv Generated BR test design report committed.
FusionIIIT/applications/iwdModuleV2/tests/reports/Artifact_Evaluation.csv Generated artifact evaluation report committed.
FusionIIIT/applications/iwdModuleV2/tests/conftest.py Adds shared test base/helpers + seeded role/designation setup.
FusionIIIT/applications/iwdModuleV2/tests/init.py Marks tests as a package.
FusionIIIT/applications/iwdModuleV2/selectors.py Introduces read-only query helpers (selectors).
FusionIIIT/applications/iwdModuleV2/run_system_tests.py Adds a standalone system test script (currently points to non-existent settings module).
FusionIIIT/applications/iwdModuleV2/QUICK_REFERENCE.md Adds contributor-facing quick reference for error utilities (currently mismatched with implementation).
FusionIIIT/applications/iwdModuleV2/migrations/0006_auto_20250504_0152.py Removes older migration file (migration history rewrite).
FusionIIIT/applications/iwdModuleV2/migrations/0005_auto_20250503_0123.py Removes older migration file (migration history rewrite).
FusionIIIT/applications/iwdModuleV2/migrations/0004_auto_20250415_0236.py Removes older migration file (migration history rewrite).
FusionIIIT/applications/iwdModuleV2/migrations/0003_requests_creationtime.py Removes older migration file (migration history rewrite).
FusionIIIT/applications/iwdModuleV2/migrations/0002_requests_iwdadminapproval.py Removes older migration file (migration history rewrite).
FusionIIIT/applications/iwdModuleV2/migrations/0002_auto_20241020_1126.py Removes older migration file (migration history rewrite).
FusionIIIT/applications/iwdModuleV2/migrations/0001_initial.py Regenerates initial migration with expanded schema (migration history rewrite).
FusionIIIT/applications/iwdModuleV2/ERROR_HANDLING.md Adds IWD standardized error response format documentation.
FusionIIIT/applications/iwdModuleV2/apps.py Adds default_auto_field and app metadata.
FusionIIIT/applications/iwdModuleV2/api/urls.py Cleans/extends IWD API endpoints routing.
FusionIIIT/applications/iwdModuleV2/api/services.py Adds API service layer helpers (contains hardcoded routing + Bills schema mismatch).
FusionIIIT/applications/iwdModuleV2/api/serializers.py Adds/extends serializer validations and introduces inventory/SLA/feedback serializers.
FusionIIIT/applications/iwdModuleV2/admin.py Registers IWD models in Django admin with list/search config.
FusionIIIT/applications/iwdModuleV2/init.py Adds package marker (contains an accidental literal \\n).
FusionIIIT/applications/globals/views.py Makes extrainfo access safer in dashboard/profile logic.
FusionIIIT/applications/eis/migrations/0003_auto_20260419_1852.py Updates EIS year choice migrations.
FusionIIIT/applications/academic_information/migrations/0002_auto_20260419_1852.py Updates academic specialization choice migration.
Dockerfile Pins pip version during image build.
Comments suppressed due to low confidence (1)

FusionIIIT/applications/iwdModuleV2/migrations/0001_initial.py:15

  • This PR replaces the app’s migration history by regenerating 0001_initial.py (new timestamp/contents) and deleting all subsequent migrations. On any existing installation this will break Django’s migration graph and can desynchronize database schema from recorded migration state. Instead, keep existing migrations intact and add new forward migrations for schema changes (or create a squashed migration only with a clear upgrade path).
# Generated by Django 3.1.5 on 2026-04-19 18:51

import datetime
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread FusionIIIT/helpers/error_response.py
Comment thread FusionIIIT/helpers/error_response.py
Comment thread FusionIIIT/helpers/error_response.py
Comment thread FusionIIIT/applications/iwdModuleV2/views.py Outdated
Comment thread FusionIIIT/applications/iwdModuleV2/views.py Outdated
Comment thread FusionIIIT/applications/iwdModuleV2/run_system_tests.py Outdated
Comment thread FusionIIIT/applications/iwdModuleV2/api/serializers.py
Comment thread FusionIIIT/applications/iwdModuleV2/QUICK_REFERENCE.md Outdated
Comment thread FusionIIIT/applications/iwdModuleV2/__init__.py Outdated
@Manijitya30
Copy link
Copy Markdown
Author

@copilot apply changes based on the comments in this thread

Manijitya30 and others added 2 commits May 8, 2026 19:20
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

4 participants