- Replace InstitutionContractExtensionPaymentResponse with InstitutionContractDiscountResponse in discount-related methods and endpoints
- Update request and response models to include OneMonthAmount, Obligation, and improved discount fields
- Adjust method signatures and controller actions to use new response types
- Refactor discount calculation logic to support new structure and ensure correct plan updates for both installment and one-time payments
- Improve naming consistency for discount percentage fields
- Introduce DiscountPercentage and DiscountAmount fields to contract creation and payment models
- Implement discount calculation logic in repository
- Add SetDiscountForExtension API endpoint and related request/response models
- Update contract creation and extension flows to handle discounts
Updated authentication checks for LegalParty and RealParty to
prevent null reference exceptions by ensuring existingContractingParty
is not null before invoking unauthentication methods.
Added a validation step to prevent duplicate contracts by checking
for existing records in the repository based on ContractingPartyId,
RepresentativeId, and TypeOfContract.
Replaced the `_smsService.VerifySend` method with the new
asynchronous `_smsService.SendInstitutionVerificationCode`
method. The new method includes additional parameters:
`contractingPartyFullName`, `contractingParty.id`, and
`institutionContract.id`, providing more context for the
verification process. Added `await` to ensure proper
asynchronous execution.
Refactored and streamlined the handling of financial transactions, invoices, and installment logic in `InstitutionContractApplication` and `InstitutionContractRepository`. Removed redundant code and consolidated logic for creating financial transactions and invoices into a reusable structure.
- Delegated financial transaction and invoice creation to the application layer.
- Simplified installment handling by directly managing installment lists.
- Introduced modular logic for handling installment and full payment scenarios.
- Replaced redundant `FinancialInvoice` and `FinancialInvoiceItem` creation in the repository layer.
- Added logic to retrieve `financialStatement` from the repository when available.
- Improved consistency in handling `invoiceAmount` across payment-related operations.
- Removed unused code for unpaid invoice retrieval and associated logic.
- Added support for creating `CreateContactInfo` objects for institution contracts.
These changes improve code maintainability, readability, and modularity by reducing duplication and ensuring responsibilities are handled at the appropriate layers.
Refactored the `InstitutionContractListStatus.PendingForRenewal` logic in `InstitutionContractRepository.cs` to include additional checks for conflicting contracts.
Updated `OnPostShiftDateNew` in `Index.cshtml.cs` to be asynchronous, removed unused code, and added a call to the new `UpdateInstitutionContract` method.
Introduced `UpdateInstitutionContract` to filter contracts by a predefined list of IDs and streamline related entity inclusion.
Refactored `IPersonalContractingPartyRepository` to replace `GetByRegisterId` with `GetByNationalId`. Updated `InstitutionContractApplication` to use the new method and removed duplicate `RegisterId` validation logic.
Removed `Index.cshtml` and `Index.cshtml.cs` files, including all associated HTML, scripts, styles, and backend logic, indicating a deprecation or restructuring of the related functionality.