Skip to content

Conversation

@Akith-002
Copy link
Collaborator

No description provided.

rithakith and others added 30 commits July 13, 2025 16:08
updating branch with main
- Created a new migration (20250720165102_UpdateExistingLotsData) to update existing records in the LandAquisitionMasterFiles table.
- Set random values for the Lots column (between 1 and 6) where the current value is 0 using PostgreSQL's RANDOM() function.
- Implemented rollback functionality to reset Lots back to 0 if needed.
- Updated the model snapshot to reflect the new Lots property in LandAquisitionMasterFile.
- Added Lots property to the LandAquisitionMasterFile model.
Merge pull request #72 from rithakith/main
- Updated BuildingRatesLA model to make AssessmentNumber, Owner, YearOfConstruction, FloorAreaSQFT, RatePerSQFT, and Cost required fields.
- Modified AppDbContextModelSnapshot to reflect the changes in the BuildingRatesLA model.
- Created a new migration file for updating the required fields in the database schema.
- Created PasswordResets migration and updated model snapshot.
- Implemented PasswordReset model to store OTP and related data.
- Added IEmailSender interface and EmailSender service for sending emails.
- Developed PasswordResetService to handle password reset requests, OTP generation, and verification.
- Integrated EmailSender into PasswordResetService for sending OTP emails.
- Updated Program.cs to register new services in the dependency injection container.
Add Password Reset functionality with OTP verification
Dulmini07 and others added 14 commits July 22, 2025 09:20
- Created migration for LALots table with foreign key to LandAquisitionMasterFiles.
- Updated AppDbContextModelSnapshot to include LALots entity.
- Added DTOs for LALot creation, update, and response.
- Implemented LALot model with necessary properties and relationships.
- Created AutoMapper profile for LALot mapping.
- Defined ILALotRepository interface and implemented LALotRepository class.
- Developed ILALotService interface and LALotService class for business logic.
- Added methods for CRUD operations and validation in the service and repository layers.
- Introduced new models for PastValuationsLA, BuildingRatesLA, SalesEvidenceLA, and RentalEvidenceLA coordinates.
- Created corresponding DTOs for creating, updating, and responding with coordinate data.
- Implemented repositories for managing coordinate data, including CRUD operations and report existence checks.
- Developed services to handle business logic for coordinates, including validation and mapping to DTOs.
- Updated the database context with new coordinate tables and relationships.
- Added AutoMapper profiles for mapping between models and DTOs.
Enhance email formatting for password reset OTP notification
- Updated foreign key references in BuildingRatesLACoordinates, PastValuationsLACoordinates, RentalEvidenceLACoordinates, and SalesEvidenceLACoordinates to use specific IDs instead of ReportId.
- Renamed columns and indices accordingly to reflect the new foreign key relationships.
- Adjusted migration files to drop old foreign keys and add new ones.
- Updated model snapshots to match the new schema.
- Modified DTOs to replace ReportId with specific IDs for each coordinate type.
- Refactored LACoordinates models to use new foreign key properties.
- Updated AutoMapper profiles to ignore old Report references and map new relationships.
- Changed repository interfaces and implementations to use new methods for fetching coordinates by specific IDs.
- Updated service layer methods to reflect changes in repository methods and ensure correct validation for existence checks.
…nversion

- Added migration to convert MasterFileId from string to int in PastValuationsLA table.
- Introduced a temporary column for safe conversion and updated existing records.
- Dropped the old string column and renamed the temporary column.
- Ensured non-null constraint on MasterFileId with a default value for nulls.
- Created index and foreign key constraint for MasterFileId referencing LandAquisitionMasterFiles.

refactor(models): Update DTOs and entity models for MasterFileId type change

- Changed MasterFileId property type from string to int in PastValuationsLADtos and PastValuationsLA model.
- Added foreign key relationship in PastValuationsLA model for MasterFileId.

chore(context): Add NeondbContext for PastValuationsLA

- Created NeondbContext class for managing PastValuationsLA entity.
- Configured model creating for PastValuationsLA with necessary indexes.

feat(entity): Introduce PastValuationsLa entity

- Added PastValuationsLa class to represent PastValuationsLA records with updated properties.
- Added a migration to convert the MasterFileId column in the BuildingRatesLA table from string to integer.
- Introduced a temporary column for data conversion and ensured data integrity during the migration.
- Updated the BuildingRatesLA model to reflect the new integer type for MasterFileId.
- Modified DTOs for BuildingRatesLA to accommodate the change from string to int for MasterFileId.
- Established foreign key relationship with LandAquisitionMasterFiles.
- Added a new migration to convert the MasterFileId column in the RentalEvidencesLA table from string to integer.
- Introduced a temporary column for safe data migration and ensured data integrity by validating existing records against LandAquisitionMasterFiles.
- Updated the RentalEvidenceLADtos and RentalEvidenceLA model to reflect the change in MasterFileId type.
- Established foreign key relationship between RentalEvidencesLA and LandAquisitionMasterFiles.
- Added migration to convert MasterFileId from string to integer in SalesEvidencesLA table.
- Updated related foreign key and index for MasterFileId.
- Modified SalesEvidenceLADtos to reflect the change in MasterFileId type.
- Adjusted SalesEvidenceLA model to include foreign key relationship with LandAquisitionMasterFile.
@Akith-002 Akith-002 requested review from Copilot and rithakith July 23, 2025 09:25
Copy link

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 is a branch update pull request that introduces multiple new features and database migrations to the valuation backend system. The PR includes database schema changes for new coordinate tables, rating cards, lots management, and password reset functionality.

  • Adds new database tables for LACoordinates, LALots, OfficesRatingCard, and PasswordReset entities
  • Implements new API controllers and services for managing offices rating cards, land acquisition lots, and coordinate management
  • Updates the authentication system with password reset functionality using OTP verification

Reviewed Changes

Copilot reviewed 21 out of 92 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Migrations/*.cs Adds new database tables and schema changes for LA coordinates, lots, rating cards, and password reset
Extensions/*.cs Registers new services and repositories for DI container
Data/*.cs Updates DbContext with new entities and adds ValuationContext
Controllers/*.cs Implements new API controllers for coordinates, lots, offices rating cards, and decision fields
Controllers/AuthController.cs Adds password reset functionality with OTP verification
Files not reviewed (9)
  • Migrations/20250720164829_AddLotsToLandAquisitionMasterFile.Designer.cs: Language not supported
  • Migrations/20250720165102_UpdateExistingLotsData.Designer.cs: Language not supported
  • Migrations/20250721111435_AddOfficesRatingCardTable.Designer.cs: Language not supported
  • Migrations/20250721114426_MakeOfficesRatingCardUpdatedByNullable.Designer.cs: Language not supported
  • Migrations/20250721163317_MakeBuildingRatesFieldsRequired.Designer.cs: Language not supported
  • Migrations/20250721163415_UpdateBuildingRatesLARequiredFields.Designer.cs: Language not supported
  • Migrations/20250721174110_AddPasswordResetTable.Designer.cs: Language not supported
  • Migrations/20250722140643_CreateLALotsTable.Designer.cs: Language not supported
  • Migrations/20250722142137_CreateLACoordinateTables.Designer.cs: Language not supported
Comments suppressed due to low confidence (1)

using System.Security.Cryptography;
using System.Text;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

Duplicate using statement. The 'using Microsoft.EntityFrameworkCore;' directive is already present on line 3.

Suggested change
using Microsoft.EntityFrameworkCore;

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +19

}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{

Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

Empty migration Up method. This migration doesn't perform any operations and should either be removed or contain actual migration logic.

Suggested change
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
// Example: Add a new column to the "BuildingRates" table
migrationBuilder.AddColumn<string>(
name: "LARequiredField",
table: "BuildingRates",
type: "nvarchar(max)",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
// Rollback logic: Remove the column added in the Up method
migrationBuilder.DropColumn(
name: "LARequiredField",
table: "BuildingRates");

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +22
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace ValuationBackend.Migrations
{
/// <inheritdoc />
public partial class UpdateBuildingRatesLARequiredFields : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{

}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{

}
}
}
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

Empty migration Down method. This migration doesn't perform any operations and should either be removed or contain actual rollback logic.

Suggested change
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ValuationBackend.Migrations
{
/// <inheritdoc />
public partial class UpdateBuildingRatesLARequiredFields : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
// File removed as the migration is unnecessary (both Up and Down methods are empty).

Copilot uses AI. Check for mistakes.
Comment on lines +35 to +36
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

SQL Server annotations used in PostgreSQL migration. The code uses 'SqlServer:Identity' annotation but the other migrations use PostgreSQL (Npgsql) annotations. This inconsistency could cause migration issues.

Suggested change
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),

Copilot uses AI. Check for mistakes.
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

SQL Server identity annotation used in PostgreSQL context. This should use 'Npgsql:ValueGenerationStrategy' with 'NpgsqlValueGenerationStrategy.IdentityByDefaultColumn' to be consistent with other migrations.

Suggested change
.Annotation("SqlServer:Identity", "1, 1"),
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),

Copilot uses AI. Check for mistakes.
@Akith-002 Akith-002 merged commit 228650d into dev-akith Jul 23, 2025
1 check passed
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.

6 participants