Compare commits

...

413 Commits

Author SHA1 Message Date
f112bab021 Add endpoint for workshop details: implement GetWorkshopsDetails method in institutionContractController 2025-11-18 15:07:38 +03:30
8b39eed7bb Add workshop total amount details: include price properties in InstitutionContract and implement GetContractWorkshopsDetails method 2025-11-18 14:53:08 +03:30
07851ff7c8 Add total amount to workshop list: include Price property in InstitutionContractListWorkshop 2025-11-17 17:11:49 +03:30
07b2596a6a Update APK handling and UI: add title length limit, modify download link, and include force update flag 2025-11-17 00:26:19 +03:30
7dce7f5bc8 Merge branch 'Feature/roll-call/camera-api' 2025-11-16 23:32:15 +03:30
7ac078c631 Refactor APK creation methods to reorder parameters and enhance title length limit in the database 2025-11-16 23:31:43 +03:30
265d5f8b22 Enhance Excel download by grouping institution contracts by ContractingPartyId 2025-11-16 22:29:18 +03:30
cf5c9f29cf Enhance APK upload functionality by adding version name and code parameters, and update UI for better user input validation 2025-11-16 22:09:19 +03:30
7448ddc79c Merge branch 'refs/heads/Feature/roll-call/apk-versioning' into Feature/roll-call/camera-api 2025-11-16 22:00:19 +03:30
3f1a6f3387 Merge branch 'refs/heads/master' into Feature/roll-call/camera-api
# Conflicts:
#	ServiceHost/Properties/launchSettings.json
2025-11-16 21:40:33 +03:30
95d4dfe568 feat: add SignalR integration for Face Embedding with client implementation and notification service 2025-11-16 20:30:15 +03:30
3258deeb2c Add support for APK versioning with force update functionality and separate APK types 2025-11-16 13:38:24 +03:30
783fffa0c2 Add Sepehr Payment Gateway integration
- Added `DigitalReceipt` and `Rrn` columns to `PaymentTransactions` table for enhanced payment tracking.
- Introduced `SepehrPaymentGateway` class for API integration, including methods for creating, verifying, and processing payments.
- Updated `PaymentTransaction` class to include `Gateway`, `Rrn`, and `DigitalReceipt` properties.
- Refactored payment workflows in `GeneralController`, `Index.cshtml.cs`, and `FinancialController` to use Sepehr gateway.
- Added new classes (`TokenReq`, `SepehrGatewayPayResponse`, etc.) for handling Sepehr-specific requests and responses.
- Configured Sepehr gateway in `Program.cs` using the `Parbad` library.
- Updated `appsettings.json` and `appsettings.Development.json` to include `SepehrGateWayTerminalId`.
- Added `Parbad.AspNetCore` and `Parbad.Storage.Cache` packages to the project.
- Improved error handling for payment creation and verification processes.
2025-11-12 21:01:54 +03:30
16c29bc2d0 Add SepehrPaymentGateway and enhance payment tracking
Introduced the SepehrPaymentGateway to replace the previous
payment gateway, AqayePardakht. Added `Rrn` and `DigitalReceipt`
columns to the `PaymentTransactions` table for improved payment
tracking and verification. Updated the Entity Framework model
and mappings to reflect these changes.

Refactored payment transaction logic to support the new gateway,
including creating, verifying, and handling payments. Added new
request/response models for Sepehr gateway integration. Enhanced
error handling and financial statement creation upon successful
payment verification. Removed legacy code and updated dependency
injection for the Parbad library.
2025-11-12 20:59:37 +03:30
SamSys
57ef47473b changes 2025-11-12 16:24:06 +03:30
syntax24
e00c93b23d change launch setting 2025-11-12 15:05:36 +03:30
8bd248c6a7 Integrate Sepehr payment gateway with Parbad
Added Parbad libraries and configured Sepehr gateway in `Program.cs`
and `appsettings.json`. Implemented payment request and verification
logic in `Index.cshtml.cs` and `GeneralController`. Updated
`ServiceHost.csproj` with required dependencies. Refactored roll call
logic and removed unused URLs in `launchSettings.json`. Enhanced
services with memory cache storage and added `Bogus` for data
generation.
2025-11-12 15:00:12 +03:30
7f9531f07b Integrate Sepehr payment gateway via Parbad library
Added `Parbad.Gateway.Sepehr` package to enable Sepehr payment gateway integration. Updated `Index.cshtml.cs` to handle online payment requests using `IOnlinePayment`. Configured Sepehr gateway in `Program.cs` with terminal ID from `appsettings.Development.json`. Enabled Swagger for development builds.
2025-11-12 12:01:44 +03:30
0b439d0268 Refactor and integrate face embedding API support
Refactored `EmployeeUploadPicture.cshtml.cs` to improve readability, maintainability, and modularity. Introduced `_httpClientFactory` for HTTP requests and added `SendEmbeddingsToApi` for Python API integration. Enhanced employee-related operations, including activation, image handling, and settings management.

Added `IFaceEmbeddingService` interface and implemented it in `FaceEmbeddingService` to manage face embeddings. Integrated with a Python API for generating, refining, deleting, and retrieving embeddings. Included robust error handling and detailed logging.

Improved code structure, reduced duplication, and added comments for better debugging and future development.

Add face embedding integration for employee management

Introduced `IFaceEmbeddingService` and its implementation to manage
face embeddings via a Python API. Integrated embedding generation
into `EmployeeApplication` and `EmployeeUploadPictureModel`,
enabling image uploads, embedding creation, and validation.

Refactored `EmployeeUploadPictureModel` for clarity, adding methods
to handle image processing, API interactions, and employee
activation/deactivation with embedding checks. Enhanced error
handling, logging, and user feedback.

Removed legacy code and updated dependencies to include
`IHttpClientFactory` and `IFaceEmbeddingService`. Added localized
error messages and improved maintainability by streamlining code.
2025-11-11 18:52:35 +03:30
SamSys
861b214b0c test sepehr gatway completed 2025-11-11 17:34:40 +03:30
SamSys
690f574240 fix conflict 2025-11-11 16:12:35 +03:30
SamSys
05abc67cdd add gatewaypayment test 2025-11-11 16:11:04 +03:30
3282825719 Merge branch 'Feature/roll-call/camera-api' 2025-11-10 09:52:29 +03:30
cd1cf93ad1 Merge remote-tracking branch 'origin/master' 2025-11-08 18:25:46 +03:30
adef1fc15a feat: update workshop_name assignment in Index.cshtml.cs to use the directory name instead of the full path 2025-11-08 15:29:58 +03:30
597f54c062 feat: update workshop_id assignment in Index.cshtml.cs to use dynamic workshop name from directory path 2025-11-08 15:04:49 +03:30
c0ead0a917 feat: refactor CreateDadmehrWorkshopFaceEmbedding method to handle subdirectories and improve image processing logic 2025-11-08 12:37:23 +03:30
59284ffd29 feat: enhance CameraController with refined roll call enter/exit endpoints and HTTP client integration 2025-11-08 12:17:34 +03:30
5c7dd76e3f feat: add roll call functionality to CameraController with enter and exit endpoints 2025-11-07 15:04:24 +03:30
dff6bc2541 feat: add SMS settings configuration and refactor SMS sending methods for institution creation verification 2025-11-06 12:37:06 +03:30
22b67b344a feat: update WorkshopEmbedding method and enhance EmployeeFaceEmbedding model with additional properties 2025-11-06 10:02:11 +03:30
SamSys
d8b432ca1e Admin Report ---> bug fixed 2025-11-05 19:17:24 +03:30
f4853b6f39 feat: add EmployeeFaceEmbedding integration to CameraController and application logic 2025-11-05 17:56:37 +03:30
6ab418c4ab feat: implement EmployeeFaceEmbedding model and application logic for managing embeddings 2025-11-05 14:50:44 +03:30
SamSys
74dca1d2d2 Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-11-04 17:38:29 +03:30
SamSys
a9b4eb6195 some change report admin 2025-11-04 17:37:22 +03:30
SamSys
2125e15fb9 Admin Repoert --> add EmployeeOptionsCheck to report 2025-11-04 17:27:55 +03:30
b7f7d3b223 feat: add HasLeft property to employee settings and update related logic in group settings 2025-11-04 12:15:11 +03:30
752c7c72ab feat: add EmployeeFaceEmbedding model and related metadata classes 2025-11-03 20:06:28 +03:30
18c27d7a9a fix dates js error 2025-11-02 11:05:27 +03:30
73da938bc9 feat: add authentication check to WorkshopEmbedding endpoint 2025-11-02 10:36:29 +03:30
SamSys
c080e11fe0 Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-11-01 13:23:04 +03:30
SamSys
0eb9ecc373 client checkou warning message FrontEnd 2025-11-01 13:21:41 +03:30
470651cb76 feat: add method to remove roll call employee statuses and update handling of left work dates 2025-10-29 18:43:23 +03:30
2a9d9574e3 feat: filter employers in institution contract repository to exclude specific contracting party 2025-10-29 12:06:17 +03:30
SamSys
7b1542d5c6 Merge branch 'InsuranceEmployeeShareoCheckout' 2025-10-29 11:11:52 +03:30
SamSys
981fd2d4ee Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-10-29 11:10:15 +03:30
SamSys
7f3f785e39 InsuranceEmployeeShare comput on checkout completed 2025-10-28 19:10:31 +03:30
ca1ef420af feat: add exception for Amir's pizza workshop to adjust roll call date handling 2025-10-28 17:31:43 +03:30
d7baf358cc Merge branch 'Feature/InstitutionContract/print-api' 2025-10-28 14:58:03 +03:30
SamSys
676c8d2fa6 add CheckoutWarningMessage 2025-10-28 14:56:54 +03:30
SamSys
632ab3631b added UseWebSockets 2025-10-28 13:16:56 +03:30
595b2c8a2d feat: update verification date and time properties in institution contract model 2025-10-28 13:15:46 +03:30
c7bace728e feat: integrate workshop repository for roll call workflows 2025-10-28 12:31:08 +03:30
08574b5bb5 fix: update application URL in launchSettings for local development 2025-10-28 09:34:13 +03:30
288e3a8988 feat: add workshop embedding endpoint to retrieve embeddings.json 2025-10-28 09:33:09 +03:30
8134216a4a feat: update roll call links to use dynamic domain 2025-10-27 16:46:09 +03:30
SamSys
3d013cfa60 compute insuranceEmployeeShare on checkout 2025-10-27 16:41:02 +03:30
30bfc96cbe Merge branch 'Feature/roll-call/admin-report-api' 2025-10-27 16:29:37 +03:30
5d55118c3c feat: add endpoint to retrieve distinct workshops for roll call reporting 2025-10-27 13:25:20 +03:30
280db87408 Merge branch 'Feature/InstitutionContract/print-api' 2025-10-26 14:00:18 +03:30
c5a1e5c274 feat: implement RollCallController and enhance workshop roll call reporting functionality 2025-10-26 11:23:51 +03:30
4c6de6a76f refactor: improve sorting logic in Fine, Loan, and Reward repositories 2025-10-25 17:25:08 +03:30
25c7b67eb5 feat: extend SMS service to include contracting party and institution contract IDs in verification link and code methods 2025-10-25 14:18:04 +03:30
19b390b17d refactor: update employee sorting logic by color for improved clarity 2025-10-25 12:08:27 +03:30
026d8da74a feat: implement camera login functionality and related API endpoints 2025-10-25 08:53:51 +03:30
6b6b0767e3 Merge branch 'master' into Feature/InstitutionContract/print-api 2025-10-23 16:44:36 +03:30
3d86ba401f fix: update IsOldContract logic to handle null and empty workshop groups 2025-10-23 16:44:19 +03:30
6a6e2e532a feat: add print API for institution contracts and include verifier details 2025-10-23 14:13:55 +03:30
ca6638d6a3 feat: enhance workshop query with additional filtering options and improved mapping 2025-10-22 19:26:10 +03:30
608fb824dc refactor: remove unnecessary console logging in workshop selection 2025-10-22 17:23:17 +03:30
4686151bbb Merge branch 'Main'
# Conflicts:
#	CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs
2025-10-22 17:04:59 +03:30
d7fae42e4f Merge remote-tracking branch 'origin/master' 2025-10-22 17:01:12 +03:30
2cfe480733 fix: correct workshop ID reference in employee count calculation 2025-10-22 17:00:33 +03:30
syntax24
c574ce534d Insurance Exept include = 0, Employee 1496 2025-10-22 16:55:11 +03:30
174edbf87d Merge branch 'Feature/InstitutionContract/add-old-edit-api' into Main
# Conflicts:
#	ServiceHost/Areas/Admin/Controllers/institutionContractController.cs
2025-10-22 15:29:43 +03:30
a827470831 feat: add API for editing old institution contracts with new properties 2025-10-22 15:19:17 +03:30
c9b61c3fc6 fix: validate Georgian date conversion in financial statement application 2025-10-22 12:07:26 +03:30
45002b88c4 fix: update absence terminology to 'عدم حضور' across multiple files 2025-10-22 11:18:55 +03:30
0bacb24aa2 Merge branch 'Feature/InstitutionContract/upgrade' into Main 2025-10-21 21:58:25 +03:30
7fd8851f71 refactor: optimize employee count calculation in InstitutionContractRepository 2025-10-21 21:57:04 +03:30
bc6ae854f8 Merge branch 'Feature/InstitutionContract/upgrade' into Main
# Conflicts:
#	Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs
#	Company.Domain/InstitutionContractAgg/InstitutionContract.cs
2025-10-21 15:07:16 +03:30
68f1f81b53 feat: add BSON representation for Id property in InstitutionContractAmendmentTemp 2025-10-21 15:05:48 +03:30
d4c2ab939e fix: correct workshop ID reference in employee count calculation 2025-10-21 14:55:23 +03:30
5822005b68 Merge branch 'master' into Feature/InstitutionContract/upgrade
# Conflicts:
#	Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs
#	Company.Domain/InstitutionContractAgg/InstitutionContract.cs
#	ServiceHost/Areas/Admin/Controllers/institutionContractController.cs
2025-10-21 14:45:22 +03:30
53aeb60861 Merge branch 'Feature/InstitutionContract/upgrade' into Main 2025-10-21 14:37:41 +03:30
c2a08d9c33 feat: add BsonRepresentation attribute to Id property for string representation in MongoDB 2025-10-21 14:37:11 +03:30
85e2481680 feat: enhance financial statement retrieval with contracting party validation and creation 2025-10-21 13:50:42 +03:30
b711e803a9 Merge branch 'master' into Main
# Conflicts:
#	ServiceHost/Areas/Admin/Controllers/institutionContractController.cs
2025-10-21 11:50:45 +03:30
232a834dc9 feat: add resend verification link end point added 2025-10-21 11:41:23 +03:30
55f7b4f7c0 Merge branch 'Feature/InstitutionContract/upgrade' into Main
# Conflicts:
#	Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs
#	Company.Domain/InstitutionContractAgg/InstitutionContract.cs
2025-10-21 11:10:06 +03:30
c5b521bc50 feat: add endpoints for inserting, removing, and retrieving amendment workshops and payment details 2025-10-21 11:04:46 +03:30
acdd7de4f6 feat: update InsertAmendmentTempWorkshops method to return detailed response and refactor related classes 2025-10-21 11:02:10 +03:30
78458f24e5 feat: add entry and exit time differences to roll call reports 2025-10-20 15:43:59 +03:30
fde58a7c75 feat: add temporary workshop management for institution contract amendments 2025-10-20 13:13:43 +03:30
syntax24
dbddccf011 add inew permission admin > workflow > institution-contract 2025-10-19 23:06:14 +03:30
488454d354 feat: add authorized bank details functionality with repository and application layers 2025-10-19 13:20:54 +03:30
4126a7370f fix: handle nullable UidBank in account number conversion 2025-10-19 12:17:33 +03:30
7aff8ba59f fix: fix url workflow institution contract 2025-10-18 19:55:06 +03:30
7d6b57affd feat: make Workshops property public and update CalculateInstallment method visibility 2025-10-18 16:50:40 +03:30
950f2884ac Merge branch 'Main' 2025-10-18 09:20:10 +03:30
2edf150ef6 Merge branch 'Feature/Registeration-workflow/add-existed-employer' 2025-10-18 09:03:26 +03:30
df9c268959 Merge branch 'Feature/contracting-party-bank-account/add-inquiry' 2025-10-18 09:03:18 +03:30
3c6303e817 feat: add financial contracts card to workflow page 2025-10-16 18:06:44 +03:30
23386fda76 Merge branch 'Feature/contracting-party-bank-account/add-inquiry' into Main 2025-10-16 16:02:40 +03:30
119f4496cd feat: add endpoint to retrieve UID banks with Persian names 2025-10-16 16:01:49 +03:30
ce4fc33daa Merge branch 'Feature/Registeration-workflow/add-existed-employer' into Main 2025-10-16 15:42:21 +03:30
f5d95b21b0 feat: enhance employer gender handling in registration workflow 2025-10-16 15:41:49 +03:30
6e83904e11 Merge branch 'Feature/Registeration-workflow/add-existed-employer' into Main 2025-10-16 15:27:30 +03:30
1f7785581c feat: streamline employer removal process from workshop details 2025-10-16 15:26:53 +03:30
9140f1ea0b Merge branch 'Feature/contracting-party-bank-account/add-inquiry' into Main 2025-10-16 14:00:37 +03:30
81e6094817 feat: add bank inquiry functionality and validation methods for IBAN and card numbers 2025-10-16 13:52:05 +03:30
e5c0a7db58 Merge branch 'Feature/Registeration-workflow/add-existed-employer' into Main 2025-10-16 12:17:10 +03:30
d44a9224be feat: prevent duplicate employer registration in workshop 2025-10-16 12:16:31 +03:30
c8018948c2 feat: add validation to prevent upgrading institution contracts with zero-priced workshops 2025-10-16 11:56:45 +03:30
a5e68cbd90 feat: remove deprecated account info endpoints and update request context structure in UidService 2025-10-16 10:20:02 +03:30
37a6920a74 feat: implement account information retrieval methods in DashboardController and UidService 2025-10-16 09:20:47 +03:30
db40ab567c refactor: update InstitutionContractAmendment and InstitutionContractAmendmentChange constructors for improved encapsulation 2025-10-16 08:01:10 +03:30
5f324a6fa1 refactor: rename zInstitutionContractExtensionPaymentResponse to InstitutionContractExtensionPaymentResponse 2025-10-15 18:06:20 +03:30
d1703ad20e refactor: remove unused classes and rename InstitutionContractExtensionPaymentResponse 2025-10-15 17:50:52 +03:30
2f38470746 Merge branch 'Feature/InstitutionContract/upgrade' into Main
# Conflicts:
#	Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs
#	CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs
#	CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs
2025-10-15 17:49:23 +03:30
23c02abe65 feat: add endpoint to retrieve amendment workshops by institution contract ID 2025-10-15 17:34:16 +03:30
475142744f Merge branch 'Feature/admin-dashboard/add-date-details' into Main 2025-10-15 16:33:51 +03:30
230cde7c15 feat: enhance AdminDashboardViewModel to include date details for improved dashboard insights 2025-10-15 16:33:14 +03:30
13a2cd78cd feat: improve institution contract retrieval and ensure account creation consistency 2025-10-15 12:28:30 +03:30
4aa3c10466 feat: update API endpoint for bank inquiries in UidService 2025-10-15 11:57:12 +03:30
91fc560355 feat: enhance registration workflow by adding account creation for contracting parties 2025-10-15 11:32:23 +03:30
8acb25dd67 feat: refactor financial transaction list processing for improved readability and performance 2025-10-15 10:54:09 +03:30
9297bdefb5 feat: add bank inquiry methods and UidBanks enum for bank identification 2025-10-15 10:38:50 +03:30
61b326aed4 feat: enhance InstitutionContractAmendment with lawId and improve constructor logic 2025-10-15 08:27:00 +03:30
Mahan Chamani
397280d0a2 Merge pull request #2 from samsyntax24/Main
Main
2025-10-14 12:11:11 +00:00
5975a92aa1 Merge branch 'Feature/Registeration-workflow/add-existed-employer' into Main 2025-10-14 15:15:03 +03:30
0cec7c0cce feat: update institution contract retrieval to use WorkshopGroup's InstitutionContractId 2025-10-14 15:14:36 +03:30
be6cb6430f Merge branch 'Fix/institution-contract/list-search' into Main
# Conflicts:
#	ServiceHost/Areas/Admin/Controllers/RegistrationWorkflowController.cs
2025-10-14 14:21:58 +03:30
f863fb065f feat: update search functionality in InstitutionContractRepository and add edit route in RegistrationWorkflowController 2025-10-14 14:20:56 +03:30
76aa1eae88 Merge branch 'Fix/institution-contract/list-search' into Main 2025-10-14 14:06:21 +03:30
d0b29e7643 feat: add GetInstitutionContractSelectList method for improved search functionality 2025-10-14 14:05:44 +03:30
f1106deff9 feat: add authentication fields and workflow registration retrieval for employers 2025-10-14 12:10:50 +03:30
94a5741906 feat: add optional legal type parameter to employer selection list retrieval 2025-10-14 10:33:08 +03:30
221d06a0fc Merge branch 'Feature/Registeration-workflow/add-existed-employer' into Main 2025-10-14 09:59:19 +03:30
2b993fb746 feat: enhance employer selection with optional legal type filtering 2025-10-14 09:58:49 +03:30
756e06cc2f feat: implement amendment features in InstitutionContract, including payment and workshop retrieval 2025-10-14 09:51:29 +03:30
syntax24
5b3c7e471e web.config remove new tag 2025-10-13 15:45:12 +03:30
syntax24
330a3ca839 web.config change 2025-10-13 15:34:53 +03:30
7c4cf1e2ed feat: add edit laws and regulations link to the menu 2025-10-13 15:14:24 +03:30
1d2c4f26f1 Merge branch 'Feature/law/add-edit-law' 2025-10-13 13:02:18 +03:30
761ac352df Merge branch 'Feature/Registeration-workflow/add-existed-employer' into Main 2025-10-13 12:56:47 +03:30
ecfb7af386 feat: implement archive code retrieval for workshops in registration workflow 2025-10-13 12:43:53 +03:30
92fd8d6b0e feat: add support for existing employers in registration workflow 2025-10-13 11:33:42 +03:30
4f68d141e8 Merge branch 'Feature/Insurance/add-not-created-tab' 2025-10-13 11:17:40 +03:30
a0e2b969c0 fix insitution contract convetor for multi employer workshops 2025-10-13 10:47:29 +03:30
8efffe8b75 feat: add LawId to InstitutionContract and related classes for improved contract management 2025-10-13 09:29:59 +03:30
fdf7fa0d3c feat: add versioning to Law entity and implement version management in LawApplication 2025-10-13 09:02:17 +03:30
5cde26e7f3 fix: update dashboard links to use Next URLs 2025-10-13 08:00:20 +03:30
b448c43bb7 Merge branch 'Feature/Insurance/add-not-created-tab' 2025-10-13 07:49:13 +03:30
987e5acca4 Merge branch 'Main' 2025-10-11 23:35:58 +03:30
9ebbe00a95 fix bug 2025-10-11 23:35:28 +03:30
b576a8dd6b Merge branch 'Main' 2025-10-11 20:01:46 +03:30
69279b320c feat: enhance workshop handling by adding workshop group association and improving initialization logic 2025-10-11 19:36:48 +03:30
a360a20478 feat: add phone number to authentication methods and improve temporary client registration validation 2025-10-11 16:54:04 +03:30
aad1645edd Merge branch 'Feature/Insurance/add-not-created-tab' 2025-10-11 14:58:59 +03:30
4d0cf13d40 Merge branch 'Feature/Insurance/add-not-created-tab' 2025-10-11 14:46:05 +03:30
6584558e6a fix: update error message for invalid national ID and birth date mismatch 2025-10-11 14:35:37 +03:30
561f742eb5 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-10-11 13:36:07 +03:30
560ea04f33 refactor: remove unused ExtensionInquiry method and clean up IInstitutionContractApplication interface 2025-10-11 13:28:04 +03:30
a1a361a09c Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-10-11 11:10:08 +03:30
ccd99c5184 feat: enhance extension inquiry with detailed response and validation improvements 2025-10-11 11:08:31 +03:30
f29fac2631 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-10-11 10:29:19 +03:30
4707c389ae refactor: standardize extension naming and add extension inquiry handling 2025-10-11 10:26:02 +03:30
a403b9f960 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-10-09 14:44:22 +03:30
6a0abf2545 update contract start date calculation and ensure transaction commit in InstitutionContractRepository 2025-10-09 14:44:02 +03:30
83ef2a1177 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-10-09 13:49:27 +03:30
3fa05b99dd add [FromBody] attribute to ExtenstionComplete parameter in institutionContractController 2025-10-09 13:48:58 +03:30
c5d6dcbbc3 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-10-09 12:33:31 +03:30
d70ea10d2d add [FromBody] attribute to GetExtenstionPaymentMethod parameter in institutionContractController 2025-10-09 12:32:27 +03:30
bd331c8afe Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-10-09 11:54:50 +03:30
9f7d267afb add payment method handling to InstitutionContractExtension, update repository and controller 2025-10-09 11:54:30 +03:30
7abbd489bb remove redundant whitespace in InstitutionContract and InstitutionContractRepository 2025-10-09 11:35:46 +03:30
35811775f3 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-10-09 10:51:46 +03:30
b78a06e743 add RollCallInPerson and CustomizeCheckout handling in InstitutionContract workflows and update repository 2025-10-09 10:51:23 +03:30
4ce82679ff add extension completion handling in InstitutionContract workflows and update repositories 2025-10-08 18:05:55 +03:30
e1161245cf Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-10-08 15:25:48 +03:30
8e83b32856 add payment models to InstitutionContractExtenstionTemp and update handling in repository 2025-10-08 15:24:51 +03:30
8eeec345d1 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-10-08 14:39:34 +03:30
780a610e91 add payment method handling in institution contract extension and refactor installment calculation 2025-10-08 14:38:06 +03:30
e095f4e07d Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-10-08 11:32:13 +03:30
4a3ac6e096 add workshops and plan amounts handling in InstitutionContractExtenstionTemp and update related services 2025-10-08 11:31:44 +03:30
a1ad139730 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-10-07 17:06:51 +03:30
dbe7aebf37 add institution contract extension plan service and integrate with controller 2025-10-07 17:05:11 +03:30
7eca8226b3 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-10-07 15:09:13 +03:30
8912215bbc rename workshop service calculator route and add placeholders for future methods 2025-10-07 15:08:49 +03:30
6c5f224fda Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-10-07 14:43:43 +03:30
437f419c2d add LegalAuthentication method and integrate it with contract workflows 2025-10-07 14:42:21 +03:30
fc1258e985 Merge branch 'Feature/Leave/add-invalid-leave' into Main 2025-10-07 14:11:32 +03:30
6d0072c8ac add InstitutionContractExtenstionTemp - add mongodb Config 2025-10-06 15:04:26 +03:30
76013946bd fix sms bug for sending link 2025-10-05 17:38:51 +03:30
024b8cfaa9 boost get list 2025-10-05 14:40:32 +03:30
b8c738bd14 add convertor for InstitutionContract.cs 2025-10-05 11:42:48 +03:30
126cbff54f add ticket and task count 2025-10-05 11:41:56 +03:30
2e97d3238d add convertor for InstitutionContract 2025-10-04 17:20:01 +03:30
ea0be6b865 fix institutionContract otp bug 2025-10-04 15:30:12 +03:30
896c891f70 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main
# Conflicts:
#	CompanyManagment.EFCore/Repository/PersonalContractingPartyRepository.cs
2025-10-04 11:42:31 +03:30
11207a785c fix institution contract list bugs 2025-10-04 11:38:45 +03:30
bfb7f4e38c add sms templates 2025-10-02 14:57:24 +03:30
b5465f5501 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-10-01 15:59:39 +03:30
bcb42cc05e add address details 2025-10-01 15:59:12 +03:30
ee9f802486 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-10-01 15:14:38 +03:30
72d082d5f2 add oneMonthAmount 2025-10-01 15:14:14 +03:30
983f629cd6 Merge branch 'Feature/admin-dashboard/migrate-next' into Main 2025-10-01 14:03:19 +03:30
0e3e783c5c set client dashboard 2025-10-01 14:02:19 +03:30
136a9775ea Merge branch 'Feature/contracting-party/modify-apis' into Main 2025-10-01 12:20:40 +03:30
a6fdfd13f9 add new get contractingParty 2025-10-01 12:20:09 +03:30
9bf8153d95 set authorize data 2025-10-01 12:05:22 +03:30
8893b53d9a Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-30 16:50:19 +03:30
e49f635b4e change validation text 2025-09-30 16:49:50 +03:30
04d9b84eb6 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-30 16:18:21 +03:30
39d887c4c3 add validation for create contractingParty 2025-09-30 15:46:28 +03:30
2e0d005ab9 add lock for sms 2025-09-30 13:40:04 +03:30
f90bb3dfc6 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-30 12:24:01 +03:30
2d0365bc6e Add insurance Job and workshop details 2025-09-30 12:23:37 +03:30
dba90c9a3f Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-29 17:20:00 +03:30
0e360836f7 add custom exception 2025-09-29 17:19:41 +03:30
0753095415 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-29 14:47:21 +03:30
7725384a87 add extra custom exception 2025-09-29 14:47:10 +03:30
94f16c8a49 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-29 13:15:16 +03:30
f5c3e6351c feat: add exception and opt bugs 2025-09-29 13:15:04 +03:30
6bfc0a8d67 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-29 10:31:29 +03:30
413bd3aad9 set allow anonymous for law get details 2025-09-29 10:31:16 +03:30
031f05937d Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-29 10:21:29 +03:30
84060e83f5 fix: change send sms verification and fix validation bug 2025-09-29 10:21:08 +03:30
0acb691c54 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-28 18:31:54 +03:30
90c6eef199 change condition if for institutioncontract 2025-09-28 18:31:40 +03:30
52f310353f Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-28 15:54:09 +03:30
71f7b05490 add is installment to institutioncontract 2025-09-28 15:53:49 +03:30
7681f4e95b Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-28 15:14:32 +03:30
681ac6eb1a remove statics for services 2025-09-28 15:14:22 +03:30
349b96ba08 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-28 14:59:40 +03:30
c38aa29009 fix: institutioncontract verify details bugs 2025-09-28 14:59:21 +03:30
2b6864c024 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-28 13:07:38 +03:30
cf2849e47e feat: add labels for services 2025-09-28 13:07:24 +03:30
c0cbf20450 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-28 12:53:27 +03:30
75cc5a3e5f set sms verification label 2025-09-28 12:53:09 +03:30
6603427845 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-28 10:39:48 +03:30
3d12f3b4d2 change create workshop structure 2025-09-28 10:38:51 +03:30
c87d734b5a Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-27 14:32:37 +03:30
b47759244e change workshops in InstitutionContract to initial and current 2025-09-27 14:30:10 +03:30
7905dff7c6 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-27 11:23:28 +03:30
0ebca7c613 add seprate tax for institutionContractController create 2025-09-27 11:22:52 +03:30
57dae3d8f1 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-27 10:39:37 +03:30
81d78affa0 set installment persian numbers 2025-09-27 10:39:28 +03:30
32e118d6f7 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-27 09:46:01 +03:30
68748ab8a6 Fix workflow new bugs 2025-09-27 09:45:44 +03:30
58152ae2d6 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-25 10:32:32 +03:30
f51c42a359 fix route 2025-09-25 10:32:17 +03:30
0373a7e6be Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-25 10:06:05 +03:30
957284be7f feat: set second party for institution verification 2025-09-25 09:53:41 +03:30
c01bc80608 Merge branch 'master' into Main 2025-09-24 15:40:42 +03:30
27109b3472 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-24 14:28:43 +03:30
d1f64dd1b0 add fname and lname 2025-09-24 14:19:12 +03:30
9beed6cf45 add ceo names in contracting party 2025-09-24 12:02:36 +03:30
868bb3f17a add amendment mapping in InstitutionContract 2025-09-23 18:59:19 +03:30
56cce8c93d add institutioncontract new data 2025-09-23 16:38:54 +03:30
c13a77e53d Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-22 16:27:22 +03:30
523cbc744b fix bug 2025-09-22 16:26:59 +03:30
e53f3a721a Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-22 14:45:35 +03:30
79b14ec958 add Services and updat get list institutioncontract 2025-09-22 14:45:19 +03:30
bd72dada76 has ticket access 2025-09-21 14:24:37 +03:30
df00f5cbac Merge branch 'feature/accounts/show-admin-based-on-role' into Feature/InstitutionContract/add-registration-style 2025-09-21 12:24:47 +03:30
e79dabbb2d add accounts by role 2025-09-21 11:57:48 +03:30
f527c59603 Merge branch 'Feature/admin-dashboard/api' into Main 2025-09-21 11:32:19 +03:30
112369c2a5 add fridays to holiday in DashboardController 2025-09-21 11:30:46 +03:30
518719a6b8 Merge branch 'Feature/admin-dashboard/api' into Main 2025-09-21 11:04:17 +03:30
53eab1be67 feat: Add DashboardController for Admin 2025-09-21 11:03:06 +03:30
90ee299b87 feat:add InstitutionContractWorkshopGroup add migrations 2025-09-20 17:02:03 +03:30
e6e81cd1c9 Refactor InstitutionContract to use VerificationStatus and add support for amendments and installments 2025-09-18 14:08:54 +03:30
Mahan Chamani
21aa17d856 Update dotnet-developPublish.yml 2025-09-18 10:42:41 +03:30
b8d6911756 Merge remote-tracking branch 'origin/Main' into Main 2025-09-18 10:40:27 +03:30
2e8f098937 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-18 10:38:58 +03:30
c9cae74cd4 Add HeadTitle and Notifications properties to Law model and update related mappings 2025-09-18 10:38:14 +03:30
Mahan Chamani
abe8774d6f Update dotnet-developPublish.yml 2025-09-18 10:04:15 +03:30
Mahan Chamani
eab0441f00 Update dotnet-developPublish.yml 2025-09-18 09:44:25 +03:30
13250d9f62 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-17 16:15:19 +03:30
e77eb217f7 Refine search query in LawRepository to focus on item headers and details 2025-09-17 16:15:08 +03:30
39200da4b5 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-17 15:51:24 +03:30
49050a8990 Add search functionality to law retrieval with filtering options 2025-09-17 15:49:58 +03:30
9474f3ff1a Add transaction ID to financial statement mapping 2025-09-16 11:51:20 +03:30
ad4cffffcd Add status and verification code handling to ContractingPartyTemp 2025-09-16 11:46:17 +03:30
MahanCh
18e559f1ae Enhance law management functionality and API
Updated ILawApplication with new methods for activating and deactivating laws by type. Added UpsertLaw method for creating and updating laws. Modified LawViewModel and EditLaw to include LawType. Enhanced LawApplication methods to support new features and updated GetLawByType to return default laws when none exist. Introduced LawController with endpoints for law operations.
2025-09-14 10:47:31 +03:30
MahanCh
e1dfd8c8e1 Enhance institution contract query to support 'blue' as an active status and update discounted amount calculation in client registration 2025-09-13 18:23:12 +03:30
MahanCh
b1c9b2669d Update institution contract query to include 'blue' as a valid active status 2025-09-13 16:52:47 +03:30
MahanCh
116f40d87d Add exception handling for unsuccessful institution contract creation 2025-09-13 13:15:32 +03:30
MahanCh
6a982a80f7 Refactor date of birth handling in EmployerApplication 2025-09-13 12:52:44 +03:30
MahanCh
604ac76a1a Add employer workflow registration edit and delete functionality 2025-09-11 12:58:50 +03:30
MahanCh
5a1d2640c3 Merge branch 'Main' into Feature/InstitutionContract/add-registration-style 2025-09-09 13:12:02 +03:30
MahanCh
de0e21f98b Sort law items by OrderNumber in LawRepository for consistent ordering 2025-09-09 13:11:55 +03:30
MahanCh
80ed1e9469 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-09 11:55:31 +03:30
MahanCh
0609c66e0a Refactor LawApplication class for improved readability and consistency 2025-09-09 11:55:19 +03:30
MahanCh
add5b8ef8e Enforce minimum item requirement for law creation and editing; remove unused OrderNumber property from LawItemViewModel 2025-09-09 11:55:01 +03:30
MahanCh
c5091c53a4 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-09 10:56:43 +03:30
MahanCh
3f1664a844 Refactor payment calculations in PlanPercentageRepository and TemporaryClientRegistrationApplication for improved accuracy 2025-09-09 10:56:19 +03:30
MahanCh
fdc5ea950f Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-08 17:02:41 +03:30
MahanCh
39d62eb02d Adjust online and in-person sum amount calculation for accuracy 2025-09-08 16:42:33 +03:30
MahanCh
a42ef19470 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-08 13:02:10 +03:30
MahanCh
7ae7d8fc07 Throw InternalServerException for null API response and specific error codes in employer and temporary client registration applications 2025-09-08 13:01:55 +03:30
MahanCh
2bc7766ba1 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-08 12:29:50 +03:30
MahanCh
d780f24b36 Validate birth date against existing person's record in UidService 2025-09-08 12:29:30 +03:30
MahanCh
d7b49f8fc3 Comment out unused properties in PlanPercentageRepository for clarity 2025-09-08 11:59:55 +03:30
MahanCh
14480eb683 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-07 16:16:11 +03:30
MahanCh
882a295413 Refactor Law model to use LawType enum and update repository methods for asynchronous operations 2025-09-07 16:14:44 +03:30
MahanCh
785e364efc Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-07 15:06:33 +03:30
MahanCh
bd83ed3880 Add Remove method to institution contract controller for contract deletion 2025-09-07 15:06:19 +03:30
MahanCh
fae3c7cbd3 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-07 14:46:31 +03:30
MahanCh
052b94a66e Remove TelephoneNumber property from employer application model 2025-09-07 14:46:16 +03:30
MahanCh
369757aebe Merge branch 'Feature/Ticket/Add-Api' into Main 2025-09-07 14:30:54 +03:30
MahanCh
38d8e88fd6 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-07 14:10:42 +03:30
MahanCh
bcedb0d690 Add Persian date of birth property to employer application model 2025-09-07 14:10:14 +03:30
MahanCh
3662502db1 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-07 11:54:56 +03:30
MahanCh
0701b334e4 Add [FromBody] attribute to AuthenticateEmployer method parameter 2025-09-07 11:54:20 +03:30
MahanCh
631bf3a920 feat: add TicketController for admin ticket management with CRUD operations 2025-09-07 10:28:41 +03:30
MahanCh
874bce1113 feat: add TicketController with CRUD operations for ticket management 2025-09-07 09:22:03 +03:30
MahanCh
1f897fa0c9 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-06 14:43:01 +03:30
MahanCh
5f7c27e45c Add handling for deactivated institution contracts in query logic 2025-09-06 14:42:50 +03:30
MahanCh
824a80d1fe Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-06 12:43:48 +03:30
MahanCh
9e2ec49247 Refactor institution contract status handling and improve query logic 2025-09-06 12:43:37 +03:30
MahanCh
f5137d0bab Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-03 17:25:08 +03:30
MahanCh
881bdfa7ae Add discounted amount for one month in client registration application 2025-09-03 17:24:51 +03:30
MahanCh
e063870b36 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-03 16:32:41 +03:30
MahanCh
fe8335af55 Update obligation calculation to use one-time payment without tax 2025-09-03 16:32:27 +03:30
MahanCh
5c3119d3d2 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-03 13:47:34 +03:30
MahanCh
0c56240158 Remove unnecessary assignment of discount in one-time payment calculation 2025-09-03 13:47:21 +03:30
MahanCh
2e703c49f7 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-03 13:12:33 +03:30
MahanCh
e9dbfb411a Update installment labels in client registration application to use simplified Persian terms 2025-09-03 13:11:33 +03:30
MahanCh
40a02dbede Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-03 10:15:30 +03:30
MahanCh
030ce880f8 Add discounted amount calculations to institution contract responses 2025-09-03 10:15:16 +03:30
MahanCh
2b8cc9d05a Update DailyCompensation to use response value from institution contract 2025-09-02 17:14:46 +03:30
MahanCh
0136e219a1 Refactor institution plan calculator response type and return structure 2025-09-02 16:59:47 +03:30
MahanCh
60ed37b965 Add detailed response structure for institution plan calculator 2025-09-02 16:44:52 +03:30
MahanCh
5355e74830 Merge branch 'Main' into Feature/InstitutionContract/add-registration-style 2025-09-02 14:20:01 +03:30
MahanCh
87609773e5 feat: refine payment calculation logic in TemporaryClientRegistrationApplication 2025-09-02 14:19:23 +03:30
MahanCh
6112e969b6 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-02 13:23:20 +03:30
MahanCh
3e4c57d813 feat: update institution plan calculator to return review and payment view model 2025-09-02 13:23:02 +03:30
MahanCh
efc510a09b Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-02 12:47:19 +03:30
MahanCh
a6c1ae7971 feat: add daily compensation and obligation properties to institution contract response 2025-09-02 12:46:10 +03:30
MahanCh
8bf707056e Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-02 11:56:10 +03:30
MahanCh
ee72c95d55 feat: change properties in InstitutionContract to private setters for encapsulation 2025-09-02 11:55:47 +03:30
MahanCh
f4f8ab8272 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-02 10:28:48 +03:30
MahanCh
1c6def5d70 feat: adjust installment start date handling to use the first day of the month 2025-09-02 10:27:57 +03:30
MahanCh
87e0181a8d Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-09-02 10:08:56 +03:30
MahanCh
66d566847e feat: add daily compensation and obligation properties to payment result 2025-09-02 09:46:28 +03:30
MahanCh
dbfffafbee feat: enhance institution plan calculator with in-person contract handling and tax calculations 2025-08-31 16:55:27 +03:30
MahanCh
969a707000 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-08-30 15:35:35 +03:30
MahanCh
57b625f3b2 feat: add discount and contracting party properties to institution contract responses 2025-08-30 15:35:15 +03:30
MahanCh
62572a9b64 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-08-30 14:48:33 +03:30
MahanCh
6d0b7de149 feat: update contract start date handling and optimize workshop and employer data retrieval 2025-08-30 14:48:11 +03:30
MahanCh
34d8e068df Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-08-30 13:49:39 +03:30
MahanCh
3a1dfa7e11 fix: correct InstitutionContractId assignment in RegistrationWorkflowMainListViewModel 2025-08-30 13:47:24 +03:30
MahanCh
866725e3b4 feat: simplify institution plan calculator by removing contract start type parameter and updating response properties 2025-08-30 13:42:52 +03:30
MahanCh
7772bff9f4 fix bug 2025-08-27 18:08:24 +03:30
MahanCh
033461641a feat: update domain in development configuration 2025-08-27 17:59:36 +03:30
MahanCh
83a251ad3b feat: update menu links for institution contracts and payment gateway 2025-08-27 17:39:37 +03:30
MahanCh
cdf282a17a Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-08-27 16:35:23 +03:30
MahanCh
4bc3fd2fbc feat: add employer authentication method and view model to registration workflow 2025-08-27 16:34:55 +03:30
MahanCh
c826c3614d feat: enhance employer workflow registration with detailed properties for real and legal employers 2025-08-27 13:39:24 +03:30
MahanCh
b8ea59b814 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-08-27 12:04:08 +03:30
MahanCh
f82d0d5925 feat: add in-person contract and insurance plan properties to workshop details 2025-08-27 12:02:04 +03:30
MahanCh
701ebaeb96 feat: add in-person contract and insurance plan properties to institution contract 2025-08-27 11:47:41 +03:30
MahanCh
a1d57b291c Merge branch 'Feature/authorize-person/init' into Main
# Conflicts:
#	CompanyManagment.EFCore/CompanyContext.cs
2025-08-27 11:21:16 +03:30
MahanCh
e7d43316ad feat: implement AuthorizedPerson management with repository and application services 2025-08-27 11:11:32 +03:30
MahanCh
bdc5ccae13 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-08-26 17:36:44 +03:30
MahanCh
d37ad552df feat: add ContractStart and ContractEnd properties to institution contract response 2025-08-26 17:36:12 +03:30
MahanCh
9c04fd439d Merge branch 'fix/institution-contract/add-contracting-partyId' into Main
# Conflicts:
#	CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs
2025-08-26 12:31:38 +03:30
MahanCh
2b3067dab2 fix: add ContractingPartyId to institution contract list items 2025-08-26 12:29:17 +03:30
MahanCh
86682a28e2 feat: add method to update institution contract status based on workshop completion 2025-08-26 11:28:18 +03:30
MahanCh
5720c30f7a feat: add method to include workshop details in institution contract retrieval 2025-08-26 11:17:16 +03:30
MahanCh
c90a68a8cc Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-08-26 10:45:29 +03:30
MahanCh
a71205aa2b feat: add LawType property to Law model and update related classes 2025-08-26 10:43:05 +03:30
MahanCh
641dcc1767 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-08-26 09:58:15 +03:30
MahanCh
b1a15bfa54 feat: update institution plan calculator to use total amount directly and remove workshop list parameter 2025-08-26 09:57:50 +03:30
MahanCh
d4f9c810ea feat: implement workshop creation workflow and enhance employer registration process 2025-08-25 18:24:07 +03:30
MahanCh
09574150b6 feat: add employer creation functionality and institution workshop detail retrieval 2025-08-25 17:06:44 +03:30
MahanCh
7ccf600885 feat: add contact info creation and account registration in institution contract process 2025-08-25 16:23:14 +03:30
MahanCh
170a0ddba0 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-08-25 14:42:43 +03:30
MahanCh
33a736ab5d feat: remove payment model parameter from GetTotalPaymentAndWorkshopList method 2025-08-25 14:42:27 +03:30
MahanCh
e34fef37d7 Merge branch 'master' into Main 2025-08-23 16:28:04 +03:30
MahanCh
23723e4b7a Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-08-23 15:05:01 +03:30
MahanCh
859f8ea8ca feat: update financial response models to use string type for amounts 2025-08-23 15:04:42 +03:30
MahanCh
3744b5f470 Merge branch 'fix/payment-transaction/list-bug' into Main 2025-08-23 13:02:57 +03:30
MahanCh
db78fb1cd4 Merge branch 'master' into Main 2025-08-23 11:55:57 +03:30
MahanCh
8bde7aa3d1 feat: add PublicId to institution contract and update response models for calculators 2025-08-23 10:50:07 +03:30
MahanCh
76e5a93ee5 feat: update RegistrationStatus to use string type and add Completed status 2025-08-21 13:50:27 +03:30
MahanCh
469a8808d1 refactor: remove TODO comment for amount calculation in InstitutionContractApplication 2025-08-21 13:32:50 +03:30
MahanCh
d3157780ea feat: refactor registration workflow to use InstitutionContractDuration and add new endpoint for registration workflow items 2025-08-21 13:32:24 +03:30
MahanCh
2d2dc24280 Merge branch 'Main' into Feature/InstitutionContract/add-registration-style 2025-08-21 11:53:32 +03:30
MahanCh
362b306c48 feat: add InstitutionContractWorkshopDetail and related mappings for workshop management 2025-08-21 11:05:26 +03:30
MahanCh
b0c02d47c4 fix: update HTTP POST routes to include ID parameter for contract actions 2025-08-21 10:05:26 +03:30
MahanCh
6869ccb436 feat: update registration status handling in InstitutionContract and Workshop models 2025-08-21 09:55:41 +03:30
MahanCh
605fe16ced feat: add registration details and pricing to InstitutionContract and related models 2025-08-21 09:32:49 +03:30
MahanCh
dfb78db2fa feat: add installment management to InstitutionContract and related classes 2025-08-20 13:32:55 +03:30
MahanCh
f0daa0b283 feat: add workshop details handling to InstitutionContract and InstitutionContractApplication 2025-08-19 14:52:52 +03:30
MahanCh
82f68d1bbe feat: add ContractingPartyId property to EditInstitutionContractRequest 2025-08-19 14:43:43 +03:30
MahanCh
48c2186110 feat: enhance CreateInstitutionContractRequest with detailed properties and enums for legal and real parties 2025-08-19 14:41:50 +03:30
MahanCh
72fe632516 Merge branch 'fix/client-menu/customize-checkout-bug' into Main 2025-08-18 11:59:44 +03:30
MahanCh
2a315ff7ae refactor: rename InstitutionContractStatus to InstitutionContractListStatus and update related properties 2025-08-18 10:40:17 +03:30
MahanCh
204355acd6 add PublicId and RegistrationStatus enum to InstitutionContractTemp and related classes 2025-08-16 16:50:29 +03:30
MahanCh
e1ac481dc3 remove Version property from Law model and related classes - Add migration 2025-08-16 13:20:47 +03:30
MahanCh
8fd3930393 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-08-16 11:24:08 +03:30
MahanCh
b2694ca281 add temporary institution contract creation functionality 2025-08-16 11:23:29 +03:30
MahanCh
7cb3551dc8 Merge branch 'Feature/Chcekout/AddHasConflict' into Main 2025-08-13 15:52:08 +03:30
MahanCh
c048e89da8 Merge branch 'Feature/Chcekout/AddHasConflict' into Main 2025-08-13 15:33:10 +03:30
MahanCh
5902472b86 Merge branch 'Feature/InstitutionContract/add-registration-style' into Main 2025-08-13 11:53:04 +03:30
MahanCh
9aa8855a46 add temporary client registration features and workshop service calculations 2025-08-13 11:52:21 +03:30
MahanCh
9556be42ea add Law domain model and application services 2025-08-12 15:10:14 +03:30
MahanCh
3ebaeb645c add InstitutionContractContactInfoTemp entity and repository 2025-08-12 14:02:45 +03:30
347 changed files with 783148 additions and 4873 deletions

View File

@@ -37,7 +37,7 @@ jobs:
& "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" `
-verb:sync `
-source:contentPath="$publishFolder" `
-dest:contentPath="dadmehrg",computerName="https://171.22.24.15:8172/msdeploy.axd?site=dadmehrg",userName=".\deployuser",password="R2rNpdnetP3j>q5b18",authType="Basic" `
-dest:contentPath="dadmehrg",computerName="https://171.22.24.15:8172/msdeploy.axd?site=dadmehrg",userName="Administrator",password="R2rNpdnetP3j>q5b18",authType="Basic" `
-allowUntrusted `
-enableRule:AppOffline

View File

@@ -21,4 +21,19 @@
</ItemGroup>
<ItemGroup>
<Compile Remove="Application\UID\UidService.cs" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Application\AuthorizedPerson\AuthorizedPersonApplication.cs" />
<Compile Remove="Application\AuthorizedPerson\IAuthorizedPersonApplication.cs" />
<Compile Remove="Domain\AuthorizedPersonAgg\IAuthorizedPersonRepository.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Domain\AuthorizedPersonAgg\" />
<Folder Include="InfraStructure\AuthorizedPerson\" />
</ItemGroup>
</Project>

View File

@@ -3,4 +3,6 @@
public class AppSettingConfiguration
{
public string Domain { get; set; }
public string ClientDomain =>"client"+Domain;
public string AdminDomain =>"admin"+Domain;
}

View File

@@ -0,0 +1,15 @@
namespace _0_Framework.Application.Enums;
public enum TypeOfCheckoutWarning
{
/// <summary>
/// هشدار های متفرقه
/// </summary>
OthersWarning,
/// <summary>
/// هشدار سهم بیمه کارگر
/// </summary>
InsuranceEmployeeShare,
}

View File

@@ -0,0 +1,25 @@
using System.Threading.Tasks;
namespace _0_Framework.Application.FaceEmbedding;
/// <summary>
/// سرویس اطلاع‌رسانی تغییرات Face Embedding
/// </summary>
public interface IFaceEmbeddingNotificationService
{
/// <summary>
/// اطلاع‌رسانی ایجاد یا به‌روزرسانی Embedding
/// </summary>
Task NotifyEmbeddingCreatedAsync(long workshopId, long employeeId, string employeeFullName);
/// <summary>
/// اطلاع‌رسانی حذف Embedding
/// </summary>
Task NotifyEmbeddingDeletedAsync(long workshopId, long employeeId);
/// <summary>
/// اطلاع‌رسانی بهبود Embedding
/// </summary>
Task NotifyEmbeddingRefinedAsync(long workshopId, long employeeId);
}

View File

@@ -0,0 +1,24 @@
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
namespace _0_Framework.Application.FaceEmbedding;
public interface IFaceEmbeddingService
{
Task<OperationResult> GenerateEmbeddingsAsync(long employeeId, long workshopId, string employeeFullName, string picture1Path, string picture2Path);
Task<OperationResult> GenerateEmbeddingsFromStreamAsync(long employeeId, long workshopId, string employeeFullName, Stream picture1Stream, Stream picture2Stream);
Task<OperationResult> RefineEmbeddingAsync(long employeeId, long workshopId, float[] embedding, float confidence, Dictionary<string, object> metadata = null);
Task<OperationResult> DeleteEmbeddingAsync(long employeeId, long workshopId);
Task<OperationResult<FaceEmbeddingResponse>> GetEmbeddingAsync(long employeeId, long workshopId);
}
public class FaceEmbeddingResponse
{
public long EmployeeId { get; set; }
public long WorkshopId { get; set; }
public string EmployeeFullName { get; set; }
public float[] Embedding { get; set; }
public float Confidence { get; set; }
public Dictionary<string, object> Metadata { get; set; }
}

View File

@@ -29,9 +29,11 @@ public class PaymentGatewayResponse
public int? ErrorCode { get; set; }
[JsonPropertyName("transid")]
public string TransactionId { get; set; }
public string Token { get; set; }
public bool IsSuccess => Status == "success";
public bool IsSuccess { get; set; }
public string Message { get; set; }
}
public class WalletAmountResponse
@@ -53,10 +55,12 @@ public class CreatePaymentGatewayRequest
public string Mobile { get; set; }
public string Email { get; set; }
public string Description { get; set; }
public IDictionary<string, object> ExtraData { get; set; }
}
public class VerifyPaymentGateWayRequest
{
public string TransactionId { get; set; }
public string DigitalReceipt { get; set; }
public string TransactionId { get; set; }
public double Amount { get; set; }
}

View File

@@ -0,0 +1,97 @@
using System;
using System.Net.Http;
using System.Net.Http.Json;
using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace _0_Framework.Application.PaymentGateway;
public class SepehrPaymentGateway:IPaymentGateway
{
private readonly HttpClient _httpClient;
private const long TerminalId = 99213700;
public SepehrPaymentGateway(IHttpClientFactory httpClient)
{
_httpClient = httpClient.CreateClient();
_httpClient.BaseAddress = new Uri("https://sepehr.shaparak.ir/Rest/V1/PeymentApi/");
}
public async Task<PaymentGatewayResponse> Create(CreatePaymentGatewayRequest command, CancellationToken cancellationToken = default)
{
var extraData = JsonConvert.SerializeObject(command.ExtraData);
var res = await _httpClient.PostAsJsonAsync("GetToken", new
{
TerminalID = TerminalId,
Amount = command.Amount,
InvoiceID = command.InvoiceId,
callbackURL = command.CallBackUrl,
payload = extraData
}, cancellationToken: cancellationToken);
// خواندن محتوای پاسخ
var content = await res.Content.ReadAsStringAsync(cancellationToken);
// تبدیل پاسخ JSON به آبجکت دات‌نت
var json = System.Text.Json.JsonDocument.Parse(content);
// گرفتن مقدار AccessToken
var accessToken = json.RootElement.GetProperty("Accesstoken").ToString();
var status = json.RootElement.GetProperty("Status").ToString();
return new PaymentGatewayResponse
{
Status = status,
IsSuccess = status == "0",
Token = accessToken
};
}
public string GetStartPayUrl(string token)=>
$"https://sepehr.shaparak.ir/Payment/Pay?token={token}&terminalId={TerminalId}";
public async Task<PaymentGatewayResponse> Verify(VerifyPaymentGateWayRequest command, CancellationToken cancellationToken = default)
{
var res = await _httpClient.PostAsJsonAsync("Advice", new
{
digitalreceipt = command.DigitalReceipt,
Tid = TerminalId,
}, cancellationToken: cancellationToken);
// خواندن محتوای پاسخ
var content = await res.Content.ReadAsStringAsync(cancellationToken);
// تبدیل پاسخ JSON به آبجکت دات‌نت
var json = System.Text.Json.JsonDocument.Parse(content);
var message = json.RootElement.GetProperty("Message").GetString();
var status = json.RootElement.GetProperty("Status").GetString();
return new PaymentGatewayResponse
{
Status = status,
IsSuccess = status.ToLower() == "ok",
Message = message
};
}
public Task<PaymentGatewayResponse> CreateSandBox(CreatePaymentGatewayRequest command, CancellationToken cancellationToken = default)
{
throw new System.NotImplementedException();
}
public string GetStartPaySandBoxUrl(string transactionId)
{
throw new System.NotImplementedException();
}
public Task<WalletAmountResponse> GetWalletAmount(CancellationToken cancellationToken)
{
throw new System.NotImplementedException();
}
}

View File

@@ -26,6 +26,11 @@ public interface ISmsService
#region Mahan
Task<double> GetCreditAmount();
public Task<bool> SendInstitutionCreationVerificationLink(string number, string fullName, Guid institutionId, long contractingPartyId, long institutionContractId);
public Task<bool> SendInstitutionVerificationCode(string number, string code, string contractingPartyFullName,
long contractingPartyId, long institutionContractId);
#endregion

View File

@@ -0,0 +1,7 @@
namespace _0_Framework.Application.Sms;
public class OtpResultViewModel
{
public int ExpireTimeSec { get; set; }
public int ReSendTimeSec { get; set; }
}

View File

@@ -1512,6 +1512,14 @@ public static class Tools
#region Mahan
public static bool IsvalidIban(this string iban)
{
return Regex.IsMatch(iban, @"^IR[0-9]{24}$");
}
public static bool IsValidCardNumber(this string cardNumber)
{
return Regex.IsMatch(cardNumber, @"^[0-9]{16}$");
}
/// <summary>
/// این متد حروف عربی را به فارسی در میاورد. مثال: علي را به علی تبدیل میکند
/// </summary>

View File

@@ -110,6 +110,53 @@ public interface IUidService
{
Task<PersonalInfoResponse> GetPersonalInfo(string nationalCode , string birthDate);
Task<MatchMobileWithNationalCodeResponse> IsMachPhoneWithNationalCode(string nationalCode , string phoneNumber);
Task<IbanInquiryResponse> IbanInquiry (string iban);
Task<AccountToIbanResponse> AccountToIban(string accountNumber, UidBanks bank);
Task<CardToNumberResponse> CardToIban(string cardNumber);
}
public class CardToNumberResponse:UidBaseResponse
{
public string Iban { get; set; }
public string CardNumber { get; set; }
}
public class AccountToIbanResponse:UidBaseResponse
{
public string Iban { get; set; }
}
public class IbanInquiryResponse:UidBaseResponse
{
public IbanInquiryAccountBasicInformation AccountBasicInformation { get; set; }
[JsonProperty("owners")]
public List<IbanInquiryOwner> Owners { get; set; }
}
public class IbanInquiryAccountBasicInformation
{
public string Iban { get; set; }
public string AccountNumber { get; set; }
public IbanInquiryBankInformation BankInformation { get; set; }
public string AccountStatus { get; set; }
}
public class IbanInquiryBankInformation
{
public string BankName { get; set; }
}
public class IbanInquiryOwner
{
[JsonProperty("firstName")]
public string FirstName { get; set; }
[JsonProperty("lastName")]
public string LastName { get; set; }
[JsonProperty("nationalIdentifier")]
public string NationalIdentifier { get; set; }
[JsonProperty("customerType")]
public string CustomerType { get; set; }
}
public class MatchMobileWithNationalCodeResponse
@@ -118,4 +165,7 @@ public class MatchMobileWithNationalCodeResponse
public ResponseContext ResponseContext { get; set; }
}
public class UidBaseResponse
{
public ResponseContext ResponseContext { get; set; }
}

View File

@@ -0,0 +1,117 @@
using System.ComponentModel;
namespace _0_Framework.Application.UID;
public enum UidBanks
{
[Description("بانک دی")]
BANK_DEY = 66,
[Description("بانک سپه")]
BANK_SEPAH = 15,
[Description("بانک شهر")]
BANK_SHAHR = 61,
[Description("بانک ملت")]
BANK_MELAT = 12,
[Description("بانک ملی")]
BANK_MELLI = 17,
[Description("بانک رفاه کارگران")]
BANK_REFAH = 13,
[Description("بانک سینا")]
BANK_SINA = 59,
[Description("بانک مسکن")]
BANK_MASKAN = 14,
[Description("بانک آینده")]
BANK_AYANDEH = 62,
[Description("بانک انصار")]
BANK_ANSAR = 63,
[Description("بانک تجارت")]
BANK_TEJARAT = 18,
[Description("بانک رسالت")]
BANK_RESALAT = 70,
[Description("بانک سامان")]
BANK_SAMAN = 56,
[Description("بانک مرکزی")]
BANK_MARKAZI = 10,
[Description("بانک سرمایه")]
BANK_SARMAYEH = 58,
[Description("بانک صادرات")]
BANK_SADERAT = 19,
[Description("بانک قوامین")]
BANK_GHAVAMIN = 52,
[Description("بانک پارسیان")]
BANK_PARSIAN = 54,
[Description("بانک کشاورزی")]
BANK_KESHAVARZI = 16,
[Description("بانک گردشگری")]
BANK_GARDESHGARI = 64,
[Description("پست بانک")]
BANK_POST_BANK = 21,
[Description("بانک پاسارگاد")]
BANK_PASARGAD = 57,
[Description("بانک کارآفرین")]
BANK_KARAFARIN = 53,
[Description("بانک خاورمیانه")]
BANK_KHAVARMIANEH = 78,
[Description("بانک ایران زمین")]
BANK_IRAN_ZAMIN = 69,
[Description("بانک مهر اقتصاد")]
BANK_MEHR_EQTESAD = 79,
[Description("بانک صنعت و معدن")]
BANK_SANAT_MADAN = 11,
[Description("بانک اقتصاد نوین")]
BANK_EGHTESAD_NOVIN = 55,
[Description("بانک توسعه تعاون")]
BANK_TOSSE_TAAVON = 22,
[Description("بانک توسعه صادرات")]
BANK_TOSSE_SADERAT = 20,
[Description("بانک ایران و ونزوئلا")]
BANK_IRAN_VENEZUELA = 95,
[Description("بانک حکمت ایرانیان")]
BANK_HEKMAT_IRANIAN = 65,
[Description("بانک قرض الحسنه مهر")]
BANK_GHARZOLHASANEH_MEHR = 60,
[Description("موسسه مالی و اعتباری ملل")]
BANK_MOASSASE_MELLAL = 75,
[Description("موسسه مالی و اعتباری نور")]
BANK_MOASSASE_NOOR = 80,
[Description("موسسه مالی و اعتباری کوثر")]
BANK_MOASSASE_KOSAR = 73,
[Description("موسسه مالی و اعتباری توسعه")]
BANK_MOASSASE_TOSSE = 51
}

View File

@@ -0,0 +1,27 @@
using System;
using System.ComponentModel;
using System.Reflection;
namespace _0_Framework.Application.UID
{
public static class UidBanksExtension
{
/// <summary>
/// دریافت نام فارسی بانک
/// </summary>
/// <param name="bank">بانک</param>
/// <returns>نام فارسی بانک</returns>
public static string GetPersianName(this UidBanks bank)
{
var fieldInfo = bank.GetType().GetField(bank.ToString());
if (fieldInfo == null)
return string.Empty;
var attribute = (DescriptionAttribute)Attribute.GetCustomAttribute(
fieldInfo, typeof(DescriptionAttribute));
return attribute?.Description ?? bank.ToString();
}
}
}

View File

@@ -1,79 +0,0 @@
using System;
using System.Net.Http;
using System.Net.Http.Json;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace _0_Framework.Application.UID;
public class UidService : IUidService
{
private readonly HttpClient _httpClient;
private const string BaseUrl = "https://json-api.uid.ir/api/inquiry/";
public UidService()
{
_httpClient = new HttpClient()
{
BaseAddress = new Uri(BaseUrl)
};
}
public async Task<PersonalInfoResponse> GetPersonalInfo(string nationalCode, string birthDate)
{
var request = new PersonalInfoRequest
{
BirthDate = birthDate,
NationalId = nationalCode,
RequestContext = new UidRequestContext()
};
var json = JsonConvert.SerializeObject(request);
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
try
{
var requestResult = await _httpClient.PostAsync("person/v2", contentType);
if (!requestResult.IsSuccessStatusCode)
return null;
var responseResult = await requestResult.Content.ReadFromJsonAsync<PersonalInfoResponse>();
if (responseResult.BasicInformation != null)
{
responseResult.BasicInformation.FirstName = responseResult.BasicInformation.FirstName?.ToPersian();
responseResult.BasicInformation.LastName = responseResult.BasicInformation.LastName?.ToPersian();
responseResult.BasicInformation.FatherName = responseResult.BasicInformation.FatherName?.ToPersian();
}
return responseResult;
}
catch
{
return new PersonalInfoResponse(new UidBasicInformation(),
new IdentificationInformation(default, default, default, default, default), new RegistrationStatus(),
new ResponseContext(new UidStatus(14, "")));
}
}
public async Task<MatchMobileWithNationalCodeResponse> IsMachPhoneWithNationalCode(string nationalCode, string phoneNumber)
{
var request = new PersonalInfoRequest
{
MobileNumber = phoneNumber,
NationalId = nationalCode,
RequestContext = new UidRequestContext()
};
var json = JsonConvert.SerializeObject(request);
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
var requestResult = await _httpClient.PostAsync("mobile/owner/v2", contentType);
if (!requestResult.IsSuccessStatusCode)
return null;
var responseResult = await requestResult.Content.ReadFromJsonAsync<MatchMobileWithNationalCodeResponse>();
return responseResult;
}
}

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
namespace _0_Framework.Exceptions;
@@ -14,5 +15,13 @@ public class BadRequestException:Exception
Details = details;
}
public BadRequestException(string message, Dictionary<string, object?> extra) :
base(message)
{
Extra = extra;
}
public string Details { get; }
public Dictionary<string,object> Extra { get; set; }
}

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Diagnostics;
@@ -24,37 +25,42 @@ public class CustomExceptionHandler : IExceptionHandler
"Error Message: {exceptionMessage}, Time of occurrence {time}",
exception.Message, DateTime.UtcNow);
(string Detail, string Title, int StatusCode) details = exception switch
(string Detail, string Title, int StatusCode, Dictionary<string, object>? Extra) details = exception switch
{
InternalServerException =>
(
exception.Message,
exception.GetType().Name,
context.Response.StatusCode = StatusCodes.Status500InternalServerError
context.Response.StatusCode = StatusCodes.Status500InternalServerError,
null
),
BadRequestException =>
BadRequestException bre =>
(
exception.Message,
exception.GetType().Name,
context.Response.StatusCode = StatusCodes.Status400BadRequest
context.Response.StatusCode = StatusCodes.Status400BadRequest,
bre.Extra
),
NotFoundException =>
(
exception.Message,
exception.GetType().Name,
context.Response.StatusCode = StatusCodes.Status404NotFound
context.Response.StatusCode = StatusCodes.Status404NotFound,
null
),
UnAuthorizeException =>
(
exception.Message,
exception.GetType().Name,
context.Response.StatusCode = StatusCodes.Status401Unauthorized
context.Response.StatusCode = StatusCodes.Status401Unauthorized,
null
),
_ =>
(
exception.Message,
exception.GetType().Name,
context.Response.StatusCode = StatusCodes.Status500InternalServerError
context.Response.StatusCode = StatusCodes.Status500InternalServerError,
null
)
};
@@ -63,9 +69,12 @@ public class CustomExceptionHandler : IExceptionHandler
Title = details.Title,
Detail = details.Detail,
Status = details.StatusCode,
Instance = context.Request.Path
Instance = context.Request.Path,
Extensions = details.Extra ?? new Dictionary<string, object>()
};
problemDetails.Extensions.Add("traceId", context.TraceIdentifier);
await context.Response.WriteAsJsonAsync(problemDetails, cancellationToken: cancellationToken);

View File

@@ -0,0 +1,346 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text.Json;
using _0_Framework.Application;
using _0_Framework.Application.FaceEmbedding;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Http;
using System.Threading.Tasks;
namespace _0_Framework.Infrastructure;
/// <summary>
/// پیاده‌سازی سرویس ارتباط با API پایتون برای مدیریت Embeddings چهره
/// </summary>
public class FaceEmbeddingService : IFaceEmbeddingService
{
private readonly IHttpClientFactory _httpClientFactory;
private readonly ILogger<FaceEmbeddingService> _logger;
private readonly IFaceEmbeddingNotificationService _notificationService;
private readonly string _apiBaseUrl;
public FaceEmbeddingService(IHttpClientFactory httpClientFactory, ILogger<FaceEmbeddingService> logger,
IFaceEmbeddingNotificationService notificationService = null)
{
_httpClientFactory = httpClientFactory;
_logger = logger;
_notificationService = notificationService;
_apiBaseUrl = "http://localhost:8000";
}
public async Task<OperationResult> GenerateEmbeddingsAsync(long employeeId, long workshopId,
string employeeFullName, string picture1Path, string picture2Path)
{
try
{
var httpClient = _httpClientFactory.CreateClient();
httpClient.BaseAddress = new Uri(_apiBaseUrl);
httpClient.Timeout = TimeSpan.FromSeconds(30);
using var content = new MultipartFormDataContent();
// Add form fields
content.Add(new StringContent(employeeId.ToString()), "employee_id");
content.Add(new StringContent(workshopId.ToString()), "workshop_id");
content.Add(new StringContent(employeeFullName ?? ""), "employee_full_name");
// Add picture files
if (File.Exists(picture1Path))
{
var picture1Bytes = await File.ReadAllBytesAsync(picture1Path);
var picture1Content = new ByteArrayContent(picture1Bytes);
picture1Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
content.Add(picture1Content, "picture1", "1.jpg");
}
else
{
_logger.LogWarning("Picture1 not found at path: {Path}", picture1Path);
return new OperationResult { IsSuccedded = false, Message = "تصویر اول یافت نشد" };
}
if (File.Exists(picture2Path))
{
var picture2Bytes = await File.ReadAllBytesAsync(picture2Path);
var picture2Content = new ByteArrayContent(picture2Bytes);
picture2Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
content.Add(picture2Content, "picture2", "2.jpg");
}
else
{
_logger.LogWarning("Picture2 not found at path: {Path}", picture2Path);
return new OperationResult { IsSuccedded = false, Message = "تصویر دوم یافت نشد" };
}
// Send request to Python API
var response = await httpClient.PostAsync("embeddings", content);
if (response.IsSuccessStatusCode)
{
var responseContent = await response.Content.ReadAsStringAsync();
_logger.LogInformation("Embeddings generated successfully for Employee {EmployeeId}, Workshop {WorkshopId}",
employeeId, workshopId);
// ارسال اطلاع‌رسانی به سایر سیستم‌ها
if (_notificationService != null)
{
await _notificationService.NotifyEmbeddingCreatedAsync(workshopId, employeeId, employeeFullName);
}
return new OperationResult
{
IsSuccedded = true,
Message = "Embedding با موفقیت ایجاد شد"
};
}
else
{
var errorContent = await response.Content.ReadAsStringAsync();
_logger.LogError("Failed to generate embeddings. Status: {StatusCode}, Error: {Error}",
response.StatusCode, errorContent);
return new OperationResult
{
IsSuccedded = false,
Message = $"خطا در تولید Embedding: {response.StatusCode}"
};
}
}
catch (HttpRequestException ex)
{
_logger.LogError(ex, "HTTP error while calling embeddings API for Employee {EmployeeId}", employeeId);
return new OperationResult
{
IsSuccedded = false,
Message = "خطا در ارتباط با سرور Embedding"
};
}
catch (Exception ex)
{
_logger.LogError(ex, "Error while calling embeddings API for Employee {EmployeeId}", employeeId);
return new OperationResult
{
IsSuccedded = false,
Message = "خطای غیرمنتظره در تولید Embedding"
};
}
}
public async Task<OperationResult> GenerateEmbeddingsFromStreamAsync(long employeeId, long workshopId,
string employeeFullName, Stream picture1Stream, Stream picture2Stream)
{
try
{
var httpClient = _httpClientFactory.CreateClient();
httpClient.BaseAddress = new Uri(_apiBaseUrl);
httpClient.Timeout = TimeSpan.FromSeconds(30);
using var content = new MultipartFormDataContent();
// Add form fields
content.Add(new StringContent(employeeId.ToString()), "employee_id");
content.Add(new StringContent(workshopId.ToString()), "workshop_id");
content.Add(new StringContent(employeeFullName ?? ""), "employee_full_name");
// Add picture streams
var picture1Content = new StreamContent(picture1Stream);
picture1Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
content.Add(picture1Content, "picture1", "1.jpg");
var picture2Content = new StreamContent(picture2Stream);
picture2Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
content.Add(picture2Content, "picture2", "2.jpg");
// Send request to Python API
var response = await httpClient.PostAsync("embeddings", content);
if (response.IsSuccessStatusCode)
{
_logger.LogInformation("Embeddings generated successfully from streams for Employee {EmployeeId}", employeeId);
// ارسال اطلاع‌رسانی به سایر سیستم‌ها
if (_notificationService != null)
{
await _notificationService.NotifyEmbeddingCreatedAsync(workshopId, employeeId, employeeFullName);
}
return new OperationResult { IsSuccedded = true, Message = "Embedding با موفقیت ایجاد شد" };
}
else
{
var errorContent = await response.Content.ReadAsStringAsync();
_logger.LogError("Failed to generate embeddings from streams. Status: {StatusCode}, Error: {Error}",
response.StatusCode, errorContent);
return new OperationResult
{
IsSuccedded = false,
Message = $"خطا در تولید Embedding: {response.StatusCode}"
};
}
}
catch (Exception ex)
{
_logger.LogError(ex, "Error while generating embeddings from streams for Employee {EmployeeId}", employeeId);
return new OperationResult
{
IsSuccedded = false,
Message = "خطا در تولید Embedding"
};
}
}
public async Task<OperationResult> RefineEmbeddingAsync(long employeeId, long workshopId, float[] embedding,
float confidence, Dictionary<string, object> metadata = null)
{
try
{
var httpClient = _httpClientFactory.CreateClient();
httpClient.BaseAddress = new Uri(_apiBaseUrl);
httpClient.Timeout = TimeSpan.FromSeconds(30);
var requestBody = new
{
employeeId,
workshopId,
embedding,
confidence,
metadata = metadata ?? new Dictionary<string, object>()
};
var response = await httpClient.PostAsJsonAsync("embeddings/refine", requestBody);
if (response.IsSuccessStatusCode)
{
_logger.LogInformation("Embedding refined successfully for Employee {EmployeeId}", employeeId);
// ارسال اطلاع‌رسانی به سایر سیستم‌ها
if (_notificationService != null)
{
await _notificationService.NotifyEmbeddingRefinedAsync(workshopId, employeeId);
}
return new OperationResult { IsSuccedded = true, Message = "Embedding بهبود یافت" };
}
else
{
var errorContent = await response.Content.ReadAsStringAsync();
_logger.LogError("Failed to refine embedding. Status: {StatusCode}, Error: {Error}",
response.StatusCode, errorContent);
return new OperationResult
{
IsSuccedded = false,
Message = $"خطا در بهبود Embedding: {response.StatusCode}"
};
}
}
catch (Exception ex)
{
_logger.LogError(ex, "Error while refining embedding for Employee {EmployeeId}", employeeId);
return new OperationResult
{
IsSuccedded = false,
Message = "خطا در بهبود Embedding"
};
}
}
public async Task<OperationResult> DeleteEmbeddingAsync(long employeeId, long workshopId)
{
try
{
var httpClient = _httpClientFactory.CreateClient();
httpClient.BaseAddress = new Uri(_apiBaseUrl);
httpClient.Timeout = TimeSpan.FromSeconds(30);
var response = await httpClient.DeleteAsync($"embeddings/{workshopId}/{employeeId}");
if (response.IsSuccessStatusCode)
{
_logger.LogInformation("Embedding deleted successfully for Employee {EmployeeId}", employeeId);
// ارسال اطلاع‌رسانی به سایر سیستم‌ها
if (_notificationService != null)
{
await _notificationService.NotifyEmbeddingDeletedAsync(workshopId, employeeId);
}
return new OperationResult { IsSuccedded = true, Message = "Embedding حذف شد" };
}
else
{
var errorContent = await response.Content.ReadAsStringAsync();
_logger.LogError("Failed to delete embedding. Status: {StatusCode}, Error: {Error}",
response.StatusCode, errorContent);
return new OperationResult
{
IsSuccedded = false,
Message = $"خطا در حذف Embedding: {response.StatusCode}"
};
}
}
catch (Exception ex)
{
_logger.LogError(ex, "Error while deleting embedding for Employee {EmployeeId}", employeeId);
return new OperationResult
{
IsSuccedded = false,
Message = "خطا در حذف Embedding"
};
}
}
public async Task<OperationResult<FaceEmbeddingResponse>> GetEmbeddingAsync(long employeeId, long workshopId)
{
try
{
var httpClient = _httpClientFactory.CreateClient();
httpClient.BaseAddress = new Uri(_apiBaseUrl);
httpClient.Timeout = TimeSpan.FromSeconds(30);
var response = await httpClient.GetAsync($"embeddings/{workshopId}/{employeeId}");
if (response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync();
var embeddingData = JsonSerializer.Deserialize<FaceEmbeddingResponse>(content,
new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
_logger.LogInformation("Embedding retrieved successfully for Employee {EmployeeId}", employeeId);
return new OperationResult<FaceEmbeddingResponse>
{
IsSuccedded = true,
Message = "Embedding دریافت شد",
Data = embeddingData
};
}
else
{
var errorContent = await response.Content.ReadAsStringAsync();
_logger.LogError("Failed to get embedding. Status: {StatusCode}, Error: {Error}",
response.StatusCode, errorContent);
return new OperationResult<FaceEmbeddingResponse>
{
IsSuccedded = false,
Message = $"خطا در دریافت Embedding: {response.StatusCode}"
};
}
}
catch (Exception ex)
{
_logger.LogError(ex, "Error while getting embedding for Employee {EmployeeId}", employeeId);
return new OperationResult<FaceEmbeddingResponse>
{
IsSuccedded = false,
Message = "خطا در دریافت Embedding"
};
}
}
}

View File

@@ -0,0 +1,8 @@
namespace _0_Framework.InfraStructure.Mongo;
public class MongoDbConfig
{
public string ConnectionString { get; set; } = null!;
public string DatabaseName { get; set; } = null!;
}

View File

@@ -0,0 +1,30 @@
using System.Threading.Tasks;
using _0_Framework.Application.FaceEmbedding;
namespace _0_Framework.InfraStructure;
/// <summary>
/// پیاده‌سازی پیش‌فرض (بدون عملیات) برای IFaceEmbeddingNotificationService
/// این کلاس زمانی استفاده می‌شود که SignalR در دسترس نباشد
/// </summary>
public class NullFaceEmbeddingNotificationService : IFaceEmbeddingNotificationService
{
public Task NotifyEmbeddingCreatedAsync(long workshopId, long employeeId, string employeeFullName)
{
// هیچ عملیاتی انجام نمی‌دهد
return Task.CompletedTask;
}
public Task NotifyEmbeddingDeletedAsync(long workshopId, long employeeId)
{
// هیچ عملیاتی انجام نمی‌دهد
return Task.CompletedTask;
}
public Task NotifyEmbeddingRefinedAsync(long workshopId, long employeeId)
{
// هیچ عملیاتی انجام نمی‌دهد
return Task.CompletedTask;
}
}

624
ANDROID_SIGNALR_GUIDE.md Normal file
View File

@@ -0,0 +1,624 @@
# راهنمای اتصال اپلیکیشن Android به SignalR برای Face Embedding
## 1. افزودن کتابخانه SignalR به پروژه Android
در فایل `build.gradle` (Module: app) خود، dependency زیر را اضافه کنید:
```gradle
dependencies {
// SignalR for Android
implementation 'com.microsoft.signalr:signalr:7.0.0'
// اگر از Kotlin استفاده می‌کنید:
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1'
// برای JSON پردازش:
implementation 'com.google.code.gson:gson:2.10.1'
}
```
## 2. اضافه کردن Permission در AndroidManifest.xml
```xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
```
## 3. کد Java/Kotlin برای اتصال به SignalR
### نسخه Java:
```java
import com.microsoft.signalr.HubConnection;
import com.microsoft.signalr.HubConnectionBuilder;
import com.microsoft.signalr.HubConnectionState;
import com.google.gson.JsonObject;
import android.util.Log;
public class FaceEmbeddingSignalRClient {
private static final String TAG = "FaceEmbeddingHub";
private HubConnection hubConnection;
private String serverUrl = "http://YOUR_SERVER_IP:PORT/trackingFaceEmbeddingHub"; // آدرس سرور خود را وارد کنید
private long workshopId;
public FaceEmbeddingSignalRClient(long workshopId) {
this.workshopId = workshopId;
initializeSignalR();
}
private void initializeSignalR() {
// ایجاد اتصال SignalR
hubConnection = HubConnectionBuilder
.create(serverUrl)
.build();
// دریافت رویداد ایجاد Embedding
hubConnection.on("EmbeddingCreated", (data) -> {
JsonObject jsonData = (JsonObject) data;
long employeeId = jsonData.get("employeeId").getAsLong();
String employeeFullName = jsonData.get("employeeFullName").getAsString();
String timestamp = jsonData.get("timestamp").getAsString();
Log.d(TAG, "Embedding Created - Employee: " + employeeFullName + " (ID: " + employeeId + ")");
// اینجا می‌توانید داده‌های جدید را از سرور بگیرید یا UI را بروزرسانی کنید
onEmbeddingCreated(employeeId, employeeFullName, timestamp);
}, JsonObject.class);
// دریافت رویداد حذف Embedding
hubConnection.on("EmbeddingDeleted", (data) -> {
JsonObject jsonData = (JsonObject) data;
long employeeId = jsonData.get("employeeId").getAsLong();
String timestamp = jsonData.get("timestamp").getAsString();
Log.d(TAG, "Embedding Deleted - Employee ID: " + employeeId);
onEmbeddingDeleted(employeeId, timestamp);
}, JsonObject.class);
// دریافت رویداد بهبود Embedding
hubConnection.on("EmbeddingRefined", (data) -> {
JsonObject jsonData = (JsonObject) data;
long employeeId = jsonData.get("employeeId").getAsLong();
String timestamp = jsonData.get("timestamp").getAsString();
Log.d(TAG, "Embedding Refined - Employee ID: " + employeeId);
onEmbeddingRefined(employeeId, timestamp);
}, JsonObject.class);
}
public void connect() {
if (hubConnection.getConnectionState() == HubConnectionState.DISCONNECTED) {
hubConnection.start()
.doOnComplete(() -> {
Log.d(TAG, "Connected to SignalR Hub");
joinWorkshopGroup();
})
.doOnError(error -> {
Log.e(TAG, "Error connecting to SignalR: " + error.getMessage());
})
.subscribe();
}
}
private void joinWorkshopGroup() {
// عضویت در گروه مخصوص این کارگاه
hubConnection.send("JoinWorkshopGroup", workshopId);
Log.d(TAG, "Joined workshop group: " + workshopId);
}
public void disconnect() {
if (hubConnection.getConnectionState() == HubConnectionState.CONNECTED) {
// خروج از گروه
hubConnection.send("LeaveWorkshopGroup", workshopId);
hubConnection.stop();
Log.d(TAG, "Disconnected from SignalR Hub");
}
}
// این متدها را در Activity/Fragment خود override کنید
protected void onEmbeddingCreated(long employeeId, String employeeFullName, String timestamp) {
// اینجا UI را بروزرسانی کنید یا داده جدید را بگیرید
}
protected void onEmbeddingDeleted(long employeeId, String timestamp) {
// اینجا UI را بروزرسانی کنید
}
protected void onEmbeddingRefined(long employeeId, String timestamp) {
// اینجا UI را بروزرسانی کنید
}
}
```
### نسخه Kotlin:
```kotlin
import com.microsoft.signalr.HubConnection
import com.microsoft.signalr.HubConnectionBuilder
import com.microsoft.signalr.HubConnectionState
import com.google.gson.JsonObject
import android.util.Log
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
class FaceEmbeddingSignalRClient(private val workshopId: Long) {
companion object {
private const val TAG = "FaceEmbeddingHub"
}
private lateinit var hubConnection: HubConnection
private val serverUrl = "http://YOUR_SERVER_IP:PORT/trackingFaceEmbeddingHub" // آدرس سرور خود را وارد کنید
init {
initializeSignalR()
}
private fun initializeSignalR() {
hubConnection = HubConnectionBuilder
.create(serverUrl)
.build()
// دریافت رویداد ایجاد Embedding
hubConnection.on("EmbeddingCreated", { data: JsonObject ->
val employeeId = data.get("employeeId").asLong
val employeeFullName = data.get("employeeFullName").asString
val timestamp = data.get("timestamp").asString
Log.d(TAG, "Embedding Created - Employee: $employeeFullName (ID: $employeeId)")
onEmbeddingCreated(employeeId, employeeFullName, timestamp)
}, JsonObject::class.java)
// دریافت رویداد حذف Embedding
hubConnection.on("EmbeddingDeleted", { data: JsonObject ->
val employeeId = data.get("employeeId").asLong
val timestamp = data.get("timestamp").asString
Log.d(TAG, "Embedding Deleted - Employee ID: $employeeId")
onEmbeddingDeleted(employeeId, timestamp)
}, JsonObject::class.java)
// دریافت رویداد بهبود Embedding
hubConnection.on("EmbeddingRefined", { data: JsonObject ->
val employeeId = data.get("employeeId").asLong
val timestamp = data.get("timestamp").asString
Log.d(TAG, "Embedding Refined - Employee ID: $employeeId")
onEmbeddingRefined(employeeId, timestamp)
}, JsonObject::class.java)
}
fun connect() {
if (hubConnection.connectionState == HubConnectionState.DISCONNECTED) {
CoroutineScope(Dispatchers.IO).launch {
try {
hubConnection.start().blockingAwait()
Log.d(TAG, "Connected to SignalR Hub")
joinWorkshopGroup()
} catch (e: Exception) {
Log.e(TAG, "Error connecting to SignalR: ${e.message}")
}
}
}
}
private fun joinWorkshopGroup() {
hubConnection.send("JoinWorkshopGroup", workshopId)
Log.d(TAG, "Joined workshop group: $workshopId")
}
fun disconnect() {
if (hubConnection.connectionState == HubConnectionState.CONNECTED) {
hubConnection.send("LeaveWorkshopGroup", workshopId)
hubConnection.stop()
Log.d(TAG, "Disconnected from SignalR Hub")
}
}
// این متدها را override کنید
open fun onEmbeddingCreated(employeeId: Long, employeeFullName: String, timestamp: String) {
// اینجا UI را بروزرسانی کنید یا داده جدید را بگیرید
}
open fun onEmbeddingDeleted(employeeId: Long, timestamp: String) {
// اینجا UI را بروزرسانی کنید
}
open fun onEmbeddingRefined(employeeId: Long, timestamp: String) {
// اینجا UI را بروزرسانی کنید
}
}
```
## 4. استفاده در Activity یا Fragment
### مثال با Login و دریافت WorkshopId
#### Java:
```java
public class LoginActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
Button btnLogin = findViewById(R.id.btnLogin);
btnLogin.setOnClickListener(v -> performLogin());
}
private void performLogin() {
// فراخوانی API لاگین
// فرض کنید response شامل workshopId است
// مثال ساده (باید از Retrofit یا کتابخانه مشابه استفاده کنید):
// LoginResponse response = apiService.login(username, password);
// long workshopId = response.getWorkshopId();
long workshopId = 123; // این را از response دریافت کنید
// ذخیره workshopId
SharedPreferences prefs = getSharedPreferences("AppPrefs", MODE_PRIVATE);
prefs.edit().putLong("workshopId", workshopId).apply();
// رفتن به صفحه اصلی
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
finish();
}
}
public class MainActivity extends AppCompatActivity {
private FaceEmbeddingSignalRClient signalRClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// دریافت workshopId از SharedPreferences
SharedPreferences prefs = getSharedPreferences("AppPrefs", MODE_PRIVATE);
long workshopId = prefs.getLong("workshopId", 0);
if (workshopId == 0) {
// اگر workshopId وجود نداره، برگرد به صفحه لاگین
Intent intent = new Intent(this, LoginActivity.class);
startActivity(intent);
finish();
return;
}
// ایجاد و اتصال SignalR
signalRClient = new FaceEmbeddingSignalRClient(workshopId) {
@Override
protected void onEmbeddingCreated(long employeeId, String employeeFullName, String timestamp) {
runOnUiThread(() -> {
// بروزرسانی UI
Toast.makeText(MainActivity.this,
"Embedding ایجاد شد برای: " + employeeFullName,
Toast.LENGTH_SHORT).show();
// دریافت داده‌های جدید از API
refreshEmployeeList();
});
}
@Override
protected void onEmbeddingDeleted(long employeeId, String timestamp) {
runOnUiThread(() -> {
// بروزرسانی UI
refreshEmployeeList();
});
}
@Override
protected void onEmbeddingRefined(long employeeId, String timestamp) {
runOnUiThread(() -> {
// بروزرسانی UI
refreshEmployeeList();
});
}
};
signalRClient.connect();
}
@Override
protected void onDestroy() {
super.onDestroy();
if (signalRClient != null) {
signalRClient.disconnect();
}
}
private void refreshEmployeeList() {
// دریافت لیست جدید کارمندان از API
}
}
```
#### Kotlin:
```kotlin
class LoginActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_login)
val btnLogin = findViewById<Button>(R.id.btnLogin)
btnLogin.setOnClickListener { performLogin() }
}
private fun performLogin() {
// فراخوانی API لاگین
// فرض کنید response شامل workshopId است
// مثال ساده (باید از Retrofit یا کتابخانه مشابه استفاده کنید):
// val response = apiService.login(username, password)
// val workshopId = response.workshopId
val workshopId = 123L // این را از response دریافت کنید
// ذخیره workshopId
val prefs = getSharedPreferences("AppPrefs", Context.MODE_PRIVATE)
prefs.edit().putLong("workshopId", workshopId).apply()
// رفتن به صفحه اصلی
val intent = Intent(this, MainActivity::class.java)
startActivity(intent)
finish()
}
}
class MainActivity : AppCompatActivity() {
private lateinit var signalRClient: FaceEmbeddingSignalRClient
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// دریافت workshopId از SharedPreferences
val prefs = getSharedPreferences("AppPrefs", Context.MODE_PRIVATE)
val workshopId = prefs.getLong("workshopId", 0L)
if (workshopId == 0L) {
// اگر workshopId وجود نداره، برگرد به صفحه لاگین
val intent = Intent(this, LoginActivity::class.java)
startActivity(intent)
finish()
return
}
// ایجاد و اتصال SignalR
signalRClient = object : FaceEmbeddingSignalRClient(workshopId) {
override fun onEmbeddingCreated(employeeId: Long, employeeFullName: String, timestamp: String) {
runOnUiThread {
// بروزرسانی UI
Toast.makeText(this@MainActivity,
"Embedding ایجاد شد برای: $employeeFullName",
Toast.LENGTH_SHORT).show()
// دریافت داده‌های جدید از API
refreshEmployeeList()
}
}
override fun onEmbeddingDeleted(employeeId: Long, timestamp: String) {
runOnUiThread {
// بروزرسانی UI
refreshEmployeeList()
}
}
override fun onEmbeddingRefined(employeeId: Long, timestamp: String) {
runOnUiThread {
// بروزرسانی UI
refreshEmployeeList()
}
}
}
signalRClient.connect()
}
override fun onDestroy() {
super.onDestroy()
signalRClient.disconnect()
}
private fun refreshEmployeeList() {
// دریافت لیست جدید کارمندان از API
}
}
```
### مثال ساده بدون Login:
اگر workshopId را از قبل می‌دانید:
#### Java:
```java
public class MainActivity extends AppCompatActivity {
private FaceEmbeddingSignalRClient signalRClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
long workshopId = 123; // شناسه کارگاه خود را وارد کنید
signalRClient = new FaceEmbeddingSignalRClient(workshopId) {
@Override
protected void onEmbeddingCreated(long employeeId, String employeeFullName, String timestamp) {
runOnUiThread(() -> {
// بروزرسانی UI
Toast.makeText(MainActivity.this,
"Embedding ایجاد شد برای: " + employeeFullName,
Toast.LENGTH_SHORT).show();
// دریافت داده‌های جدید از API
refreshEmployeeList();
});
}
@Override
protected void onEmbeddingDeleted(long employeeId, String timestamp) {
runOnUiThread(() -> {
// بروزرسانی UI
refreshEmployeeList();
});
}
};
signalRClient.connect();
}
@Override
protected void onDestroy() {
super.onDestroy();
if (signalRClient != null) {
signalRClient.disconnect();
}
}
private void refreshEmployeeList() {
// دریافت لیست جدید کارمندان از API
}
}
```
#### Kotlin:
```kotlin
class MainActivity : AppCompatActivity() {
private lateinit var signalRClient: FaceEmbeddingSignalRClient
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val workshopId = 123L // شناسه کارگاه خود را وارد کنید
signalRClient = object : FaceEmbeddingSignalRClient(workshopId) {
override fun onEmbeddingCreated(employeeId: Long, employeeFullName: String, timestamp: String) {
runOnUiThread {
// بروزرسانی UI
Toast.makeText(this@MainActivity,
"Embedding ایجاد شد برای: $employeeFullName",
Toast.LENGTH_SHORT).show()
// دریافت داده‌های جدید از API
refreshEmployeeList()
}
}
override fun onEmbeddingDeleted(employeeId: Long, timestamp: String) {
runOnUiThread {
// بروزرسانی UI
refreshEmployeeList()
}
}
}
signalRClient.connect()
}
override fun onDestroy() {
super.onDestroy()
signalRClient.disconnect()
}
private fun refreshEmployeeList() {
// دریافت لیست جدید کارمندان از API
}
}
```
## 5. نکات مهم
### آدرس سرور
- اگر روی شبیه‌ساز اندروید تست می‌کنید و سرور روی localhost اجرا می‌شود، از آدرس `http://10.0.2.2:PORT` استفاده کنید
- اگر روی دستگاه فیزیکی تست می‌کنید، از آدرس IP شبکه محلی سرور استفاده کنید (مثل `http://192.168.1.100:PORT`)
- PORT پیش‌فرض معمولاً 5000 یا 5001 است (بسته به کانفیگ پروژه شما)
### دریافت WorkshopId از Login
بعد از login موفق، workshopId را از سرور دریافت کنید و در SharedPreferences یا یک Singleton ذخیره کنید:
```java
// بعد از login موفق
SharedPreferences prefs = getSharedPreferences("AppPrefs", MODE_PRIVATE);
prefs.edit().putLong("workshopId", workshopId).apply();
// استفاده در Activity
long workshopId = prefs.getLong("workshopId", 0);
```
یا در Kotlin:
```kotlin
// بعد از login موفق
val prefs = getSharedPreferences("AppPrefs", Context.MODE_PRIVATE)
prefs.edit().putLong("workshopId", workshopId).apply()
// استفاده در Activity
val workshopId = prefs.getLong("workshopId", 0L)
```
### مدیریت اتصال
برای reconnection خودکار:
```java
hubConnection.onClosed(exception -> {
Log.e(TAG, "Connection closed. Attempting to reconnect...");
new Handler().postDelayed(() -> connect(), 5000); // تلاش مجدد بعد از 5 ثانیه
});
```
### Thread Safety
همیشه UI updates را در main thread انجام دهید:
```java
runOnUiThread(() -> {
// UI updates here
});
```
## 6. تست اتصال
برای تست می‌توانید:
1. اپلیکیشن را اجرا کنید
2. از طریق Postman یا Swagger یک Embedding ایجاد کنید
3. باید در Logcat پیام "Embedding Created" را ببینید
## 7. خطایابی (Debugging)
برای دیدن جزئیات بیشتر:
```java
hubConnection = HubConnectionBuilder
.create(serverUrl)
.withHttpConnectionOptions(options -> {
options.setLogging(LogLevel.TRACE);
})
.build();
```
---
## خلاصه Endpoints
| نوع رویداد | متد SignalR | پارامترهای دریافتی |
|-----------|-------------|---------------------|
| ایجاد Embedding | `EmbeddingCreated` | workshopId, employeeId, employeeFullName, timestamp |
| حذف Embedding | `EmbeddingDeleted` | workshopId, employeeId, timestamp |
| بهبود Embedding | `EmbeddingRefined` | workshopId, employeeId, timestamp |
| متد ارسالی | پارامتر | توضیحات |
|-----------|---------|---------|
| `JoinWorkshopGroup` | workshopId | عضویت در گروه کارگاه |
| `LeaveWorkshopGroup` | workshopId | خروج از گروه کارگاه |

View File

@@ -64,4 +64,13 @@ public interface IAccountApplication
/// <param name="userName"></param>
/// <returns></returns>
public bool CheckExistClientAccount(string userName);
List<AccountViewModel> GetAdminAccountsNew();
void CameraLogin(CameraLoginRequest request);
}
public class CameraLoginRequest
{
public string UserName { get; set; }
public string Password { get; set; }
}

View File

@@ -18,6 +18,7 @@ using Microsoft.AspNetCore.Mvc.Rendering;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
using Company.Domain.WorkshopAgg;
using System.Security.Claims;
using _0_Framework.Exceptions;
using AccountManagement.Domain.PositionAgg;
using AccountManagement.Domain.SubAccountAgg;
using AccountManagement.Domain.SubAccountPermissionSubtitle1Agg;
@@ -799,4 +800,33 @@ public class AccountApplication : IAccountApplication
return _accountRepository.CheckExistClientAccount(userName);
}
public List<AccountViewModel> GetAdminAccountsNew()
{
return _accountRepository.GetAdminAccountsNew();
}
public void CameraLogin(CameraLoginRequest request)
{
var cameraAccount = _cameraAccountRepository.GetBy(request.UserName);
if (cameraAccount == null)
{
throw new BadRequestException(ApplicationMessages.WrongUserPass);
}
(bool Verified, bool NeedUpgrade) result = _passwordHasher.Check(cameraAccount.Password, request.Password);
if (!result.Verified)
throw new BadRequestException(ApplicationMessages.WrongUserPass);
var mobile = string.IsNullOrWhiteSpace(cameraAccount.Mobile) ? " " : cameraAccount.Mobile;
var authViewModel = new CameraAuthViewModel(cameraAccount.id, cameraAccount.WorkshopId,
cameraAccount.Username, mobile, cameraAccount.WorkshopName, cameraAccount.AccountId,
cameraAccount.IsActiveSting);
if (cameraAccount.IsActiveSting != "true")
throw new BadRequestException(ApplicationMessages.WrongUserPass);
_authHelper.CameraSignIn(authViewModel);
}
}

View File

@@ -1,6 +1,7 @@
using System;
using _0_Framework.Application;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.AndroidApkVersion;
namespace Company.Domain.AndroidApkVersionAgg;
@@ -8,14 +9,17 @@ public class AndroidApkVersion:EntityBase
{
private AndroidApkVersion () { }
public AndroidApkVersion( string versionName,string versionCode, IsActive isActive, string path)
public AndroidApkVersion( string versionName,string versionCode, IsActive isActive, string path, ApkType apkType, bool isForce = false)
{
VersionName = versionName;
VersionCode = versionCode;
IsActive = isActive;
Path = path;
Title = $"Gozareshgir-{versionName}-{CreationDate:g}";
ApkType = apkType;
IsForce = isForce;
var appName = apkType == ApkType.WebView ? "Gozareshgir-WebView" : "Gozareshgir-FaceDetection";
Title = $"{appName}-{versionName}-{CreationDate:g}";
}
public string Title { get; private set; }
@@ -23,6 +27,9 @@ public class AndroidApkVersion:EntityBase
public string VersionCode{ get; private set; }
public IsActive IsActive { get; private set; }
public string Path { get; set; }
public ApkType ApkType { get; private set; }
public bool IsForce { get; private set; }
public void Active()
{
@@ -33,4 +40,4 @@ public class AndroidApkVersion:EntityBase
{
IsActive = IsActive.False;
}
}
}

View File

@@ -1,12 +1,14 @@
using System.Collections.Generic;
using System.Linq;
using _0_Framework_b.Domain;
using CompanyManagment.App.Contracts.AndroidApkVersion;
namespace Company.Domain.AndroidApkVersionAgg;
public interface IAndroidApkVersionRepository:IRepository<long,AndroidApkVersion>
{
IQueryable<AndroidApkVersion> GetActives();
IQueryable<AndroidApkVersion> GetActives(ApkType apkType);
AndroidApkVersion GetLatestActive(ApkType apkType);
void Remove(AndroidApkVersion entity);
System.Threading.Tasks.Task<string> GetLatestActiveVersionPath();
System.Threading.Tasks.Task<string> GetLatestActiveVersionPath(ApkType apkType);
}

View File

@@ -0,0 +1,46 @@
using System.Collections.Generic;
using _0_Framework_b.Domain;
namespace Company.Domain.AuthorizedBankDetailsAgg
{
public class AuthorizedBankDetails : EntityBase
{
private AuthorizedBankDetails()
{
OwnersList = new List<AuthorizedBankDetailsOwner>();
}
public AuthorizedBankDetails(string cardNumber, string accountNumber, string ban, string bankName, List<AuthorizedBankDetailsOwner> ownersList)
{
CardNumber = cardNumber;
AccountNumber = accountNumber;
IBan = ban;
BankName = bankName;
OwnersList = ownersList ?? new List<AuthorizedBankDetailsOwner>();
}
public string CardNumber { get; private set; }
public string AccountNumber { get; private set; }
public string IBan { get; private set; }
public string BankName { get; private set; }
public List<AuthorizedBankDetailsOwner> OwnersList { get; private set; }
}
public class AuthorizedBankDetailsOwner // Value Object - not inheriting from EntityBase
{
private AuthorizedBankDetailsOwner() { }
public AuthorizedBankDetailsOwner(string fName, string lName, string nationalIdentifier, string customerType)
{
FName = fName;
LName = lName;
NationalIdentifier = nationalIdentifier;
CustomerType = customerType;
}
public string FName { get; private set; }
public string LName { get; private set; }
public string NationalIdentifier { get; private set; }
public string CustomerType { get; private set; }
}
}

View File

@@ -0,0 +1,13 @@
using _0_Framework_b.Domain;
using System.Collections.Generic;
using Company.Application.Contracts.AuthorizedBankDetails;
namespace Company.Domain.AuthorizedBankDetailsAgg
{
public interface IAuthorizedBankDetailsRepository : IRepository<long, AuthorizedBankDetails>
{
EditAuthorizedBankDetails GetDetails(long id);
List<AuthorizedBankDetailsViewModel> Search(AuthorizedBankDetailsSearchModel searchModel);
AuthorizedBankDetailsViewModel GetByIban(string iban);
}
}

View File

@@ -0,0 +1,51 @@
using System;
using _0_Framework.Domain;
namespace Company.Domain.AuthorizedPersonAgg;
public class AuthorizedPerson : EntityBase
{
public string NationalCode { get; private set; }
public string FirstName { get; private set; }
public string LastName { get; private set; }
public string FatherName { get; private set; }
public string BirthDate { get; private set; }
public string Gender { get; private set; }
public string DeathStatus { get; private set; }
public string ShenasnameSeri { get; private set; }
public string ShenasnameSerial { get; private set; }
public string ShenasnamehNumber { get; private set; }
public bool IsVerified { get; private set; }
public DateTime? VerificationDate { get; private set; }
public AuthorizedPerson(string nationalCode, string firstName, string lastName, string fatherName,
string birthDate, string gender, string deathStatus, string shenasnameSeri,
string shenasnameSerial, string shenasnamehNumber)
{
NationalCode = nationalCode;
FirstName = firstName;
LastName = lastName;
FatherName = fatherName;
BirthDate = birthDate;
Gender = gender;
DeathStatus = deathStatus;
ShenasnameSeri = shenasnameSeri;
ShenasnameSerial = shenasnameSerial;
ShenasnamehNumber = shenasnamehNumber;
IsVerified = true;
VerificationDate = DateTime.Now;
}
public void UpdatePersonalInfo(string firstName, string lastName, string fatherName,
string gender, string deathStatus)
{
FirstName = firstName;
LastName = lastName;
FatherName = fatherName;
Gender = gender;
DeathStatus = deathStatus;
VerificationDate = DateTime.Now;
}
protected AuthorizedPerson() { }
}

View File

@@ -0,0 +1,9 @@
using _0_Framework.Domain;
namespace Company.Domain.AuthorizedPersonAgg;
public interface IAuthorizedPersonRepository : IRepository<long, AuthorizedPerson>
{
AuthorizedPerson GetByNationalCode(string nationalCode);
bool ExistsByNationalCode(string nationalCode);
}

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Security.AccessControl;
using _0_Framework.Application;
using _0_Framework.Domain;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
@@ -12,25 +13,25 @@ namespace Company.Domain.CheckoutAgg;
public class Checkout : EntityBase
{
private Checkout()
{
}
public Checkout()
{
}
public Checkout(string employeeFullName, string fathersName, string nationalCode, string dateOfBirth,
long employeeId, string workshopName, long workshopId, string contractNo, DateTime contractStart,
DateTime contractEnd, string month, string year, long contractId, long workingHoursId,
DateTime contractEnd, string month, string year, long contractId, long workingHoursId,
double monthlySalary, double baseYearsPay, double consumableItems, double housingAllowance,
double overtimePay, double nightworkPay, double fridayPay, double missionPay, double shiftPay,
double familyAllowance, double bonusesPay, double yearsPay, double leavePay,
double insuranceDeduction, double taxDeducation, double installmentDeduction,
double salaryAidDeduction, double absenceDeduction, string sumOfWorkingDays
, string archiveCode, string personnelCode,
, string archiveCode, string personnelCode,
string totalClaims, string totalDeductions, double totalPayment, string signature, double marriedAllowance, bool leaveCheckout,
double creditLeaves, double absencePeriod, double averageHoursPerDay, bool hasRollCall, string overTimeWorkvalue,
string overNightWorkValue, string fridayWorkValue, string rotatingShifValue, string absenceValue,
string totalDayOfLeaveCompute, string totalDayOfYearsCompute, string totalDayOfBunosesCompute,
ICollection<CheckoutLoanInstallment> loanInstallments,
ICollection<CheckoutSalaryAid> salaryAids,CheckoutRollCall checkoutRollCall,TimeSpan employeeMandatoryHours)
ICollection<CheckoutSalaryAid> salaryAids, CheckoutRollCall checkoutRollCall, TimeSpan employeeMandatoryHours, bool hasInsuranceShareTheSameAsList)
{
EmployeeFullName = employeeFullName;
FathersName = fathersName;
@@ -91,6 +92,7 @@ public class Checkout : EntityBase
SalaryAids = salaryAids;
CheckoutRollCall = checkoutRollCall;
EmployeeMandatoryHours = employeeMandatoryHours;
HasInsuranceShareTheSameAsList = hasInsuranceShareTheSameAsList;
}
@@ -99,7 +101,7 @@ public class Checkout : EntityBase
public string Signature { get; private set; }
public string FathersName { get; private set; }
public string NationalCode { get; private set; }
public string DateOfBirth { get; private set; }
public string DateOfBirth { get; private set; }
public long EmployeeId { get; private set; }
public string WorkshopName { get; private set; }
@@ -135,7 +137,7 @@ public class Checkout : EntityBase
public double SalaryAidDeduction { get; private set; }
public double AbsenceDeduction { get; private set; }
public string SumOfWorkingDays { get; private set; }
public string ArchiveCode { get; private set; }
public string PersonnelCode { get; private set; }
@@ -157,58 +159,70 @@ public class Checkout : EntityBase
//میانگین ساعت کار در یک روز
public double AverageHoursPerDay { get; private set; }
public bool HasRollCall { get; private set; }
/// <summary>
/// مقدار اضافه کار
/// </summary>
/// <summary>
/// مقدار اضافه کار
/// </summary>
public string OverTimeWorkValue { get; private set; }
/// <summary>
/// مقدار شبکاری
/// </summary>
/// <summary>
/// مقدار شبکاری
/// </summary>
public string OverNightWorkValue { get; private set; }
/// <summary>
/// مقدار جمعه کاری
/// </summary>
public string FridayWorkValue { get; private set; }
/// <summary>
/// درصد نوبت کاری
/// </summary>
public string RotatingShiftValue { get; private set; }
/// <summary>
/// <summary>
/// مقدار جمعه کاری
/// </summary>
public string FridayWorkValue { get; private set; }
/// <summary>
/// درصد نوبت کاری
/// </summary>
public string RotatingShiftValue { get; private set; }
/// <summary>
/// مقدار غیبت
/// </summary>
public string AbsenceValue { get; private set; }
public string AbsenceValue { get; private set; }
/// <summary>
/// تعداد روزهای محاسبه شده برای مزد مرخصی
/// </summary>
public string TotalDayOfLeaveCompute { get; private set; }
/// <summary>
/// تعداد روزهای محاسبه شده برای سنوات
/// </summary>
public string TotalDayOfYearsCompute { get; private set; }
/// <summary>
/// تعداد روزهای محاسبه شده برای عیدی و پاداش
/// </summary>
public string TotalDayOfBunosesCompute { get; private set; }
/// <summary>
/// تعداد روزهای محاسبه شده برای مزد مرخصی
/// </summary>
public string TotalDayOfLeaveCompute { get; private set; }
/// <summary>
/// تعداد روزهای محاسبه شده برای سنوات
/// </summary>
public string TotalDayOfYearsCompute { get; private set; }
/// <summary>
/// تعداد روزهای محاسبه شده برای عیدی و پاداش
/// </summary>
public string TotalDayOfBunosesCompute { get; private set; }
/// <summary>
/// دارای تداخل مبلغ است. این در زمانی اتفاق می افتد که فیش مبلغ آن تغییر کرده ولی به دلیل مسائل قانونی امکان صدور دوباره آن وجود ندارد
/// </summary>
public bool HasAmountConflict { get; private set; }
/// <summary>
/// دارای تداخل مبلغ است. این در زمانی اتفاق می افتد که فیش مبلغ آن تغییر کرده ولی به دلیل مسائل قانونی امکان صدور دوباره آن وجود ندارد
/// </summary>
public bool HasAmountConflict { get; private set; }
/// <summary>
/// ساعت موظفی پرسنل در ماه
/// </summary>
/// <summary>
/// ساعت موظفی پرسنل در ماه
/// </summary>
public TimeSpan EmployeeMandatoryHours { get; set; }
#region valueObjects
public ICollection<CheckoutLoanInstallment> LoanInstallments { get; set; } = [];
public ICollection<CheckoutSalaryAid> SalaryAids { get; set; } = [];
/// <summary>
/// آیا حق بیمه مشابه لیست بیمه حساب شده؟
/// </summary>
public bool HasInsuranceShareTheSameAsList { get; private set; }
/// <summary>
/// آیا فیش نیاز به بروزرسانی دارد
/// </summary>
public bool IsUpdateNeeded { get; private set; }
public List<CheckoutWarningMessage> CheckoutWarningMessageList { get; set; }
#region valueObjects
public ICollection<CheckoutLoanInstallment> LoanInstallments { get; set; } = [];
public ICollection<CheckoutSalaryAid> SalaryAids { get; set; } = [];
public CheckoutRollCall CheckoutRollCall { get; private set; }
#endregion
@@ -277,7 +291,7 @@ public class Checkout : EntityBase
var year = contarctStart.ToFarsiYear();
var sumYear = year.Substring(Math.Max(0, year.Length - 2));
ContractNo = archiveCode + "/" + personnelCode + "/" + sumYear + "/" + month;
}
public void Active()
@@ -312,7 +326,7 @@ public class Checkout : EntityBase
}
public void SetSalaryAid(ICollection<CheckoutSalaryAid> salaryAids,double salaryAidAmount)
public void SetSalaryAid(ICollection<CheckoutSalaryAid> salaryAids, double salaryAidAmount)
{
SalaryAids = salaryAids;
SalaryAidDeduction = salaryAidAmount;
@@ -330,30 +344,45 @@ public class Checkout : EntityBase
public void SetAmountConflict(bool hasAmountConflict)
{
HasAmountConflict = hasAmountConflict;
HasAmountConflict = hasAmountConflict;
}
public void SetEmployeeMandatoryHours(TimeSpan employeeMandatoryHours)
{
EmployeeMandatoryHours = employeeMandatoryHours;
}
public void SetInsuranceShare()
{
HasInsuranceShareTheSameAsList = true;
}
/// <summary>
/// نیاز به آپدیت
/// </summary>
public void SetUpdateNeeded()
{
IsUpdateNeeded = true;
}
}
public class CheckoutRollCall
{
private CheckoutRollCall(){}
public CheckoutRollCall(TimeSpan totalMandatoryTimeSpan, TimeSpan totalPresentTimeSpan, TimeSpan totalBreakTimeSpan,
TimeSpan totalWorkingTimeSpan, TimeSpan totalPaidLeaveTmeSpan, TimeSpan totalSickLeaveTimeSpan,
ICollection<CheckoutRollCallDay> rollCallDaysCollection)
{
TotalMandatoryTimeSpan = totalMandatoryTimeSpan;
TotalPresentTimeSpan = totalPresentTimeSpan;
TotalBreakTimeSpan = totalBreakTimeSpan;
TotalWorkingTimeSpan = totalWorkingTimeSpan;
TotalPaidLeaveTmeSpan = totalPaidLeaveTmeSpan;
TotalSickLeaveTimeSpan = totalSickLeaveTimeSpan;
RollCallDaysCollection = rollCallDaysCollection;
}
private CheckoutRollCall() { }
public CheckoutRollCall(TimeSpan totalMandatoryTimeSpan, TimeSpan totalPresentTimeSpan, TimeSpan totalBreakTimeSpan,
TimeSpan totalWorkingTimeSpan, TimeSpan totalPaidLeaveTmeSpan, TimeSpan totalSickLeaveTimeSpan,
ICollection<CheckoutRollCallDay> rollCallDaysCollection)
{
TotalMandatoryTimeSpan = totalMandatoryTimeSpan;
TotalPresentTimeSpan = totalPresentTimeSpan;
TotalBreakTimeSpan = totalBreakTimeSpan;
TotalWorkingTimeSpan = totalWorkingTimeSpan;
TotalPaidLeaveTmeSpan = totalPaidLeaveTmeSpan;
TotalSickLeaveTimeSpan = totalSickLeaveTimeSpan;
RollCallDaysCollection = rollCallDaysCollection;
}
/// <summary>
@@ -394,27 +423,27 @@ public class CheckoutRollCall
public class CheckoutRollCallDay
{
private CheckoutRollCallDay(){}
public CheckoutRollCallDay(DateTime date, string firstStartDate, string firstEndDate,
string secondStartDate, string secondEndDate, TimeSpan breakTimeSpan,
bool isSliced, TimeSpan workingTimeSpan, bool isAbsent, bool isFriday,
bool isHoliday, string leaveType)
{
Date = date;
FirstStartDate = firstStartDate;
FirstEndDate = firstEndDate;
SecondStartDate = secondStartDate;
SecondEndDate = secondEndDate;
BreakTimeSpan = breakTimeSpan;
IsSliced = isSliced;
WorkingTimeSpan = workingTimeSpan;
IsAbsent = isAbsent;
IsFriday = isFriday;
IsHoliday = isHoliday;
LeaveType = leaveType;
}
private CheckoutRollCallDay() { }
public CheckoutRollCallDay(DateTime date, string firstStartDate, string firstEndDate,
string secondStartDate, string secondEndDate, TimeSpan breakTimeSpan,
bool isSliced, TimeSpan workingTimeSpan, bool isAbsent, bool isFriday,
bool isHoliday, string leaveType)
{
Date = date;
FirstStartDate = firstStartDate;
FirstEndDate = firstEndDate;
SecondStartDate = secondStartDate;
SecondEndDate = secondEndDate;
BreakTimeSpan = breakTimeSpan;
IsSliced = isSliced;
WorkingTimeSpan = workingTimeSpan;
IsAbsent = isAbsent;
IsFriday = isFriday;
IsHoliday = isHoliday;
LeaveType = leaveType;
}
public long Id { get; set; }
public long Id { get; set; }
/// <summary>
/// تاریخ
@@ -458,12 +487,12 @@ public class CheckoutRollCallDay
/// <summary>
/// آیا غیبت است
/// </summary>
public bool IsAbsent { get; private set; }
public bool IsAbsent { get; private set; }
/// <summary>
/// آیا جمعه است
/// </summary>
public bool IsFriday { get; private set; }
public bool IsFriday { get; private set; }
/// <summary>
/// آیا تعطیل رسمی است
@@ -475,6 +504,6 @@ public class CheckoutRollCallDay
/// </summary>
public string LeaveType { get; private set; }
public long CheckoutId { get; set; }
public long CheckoutId { get; set; }
}

View File

@@ -0,0 +1,32 @@
using _0_Framework.Application.Enums;
using _0_Framework.Domain;
namespace Company.Domain.CheckoutAgg;
public class CheckoutWarningMessage : EntityBaseWithoutCreationDate
{
public CheckoutWarningMessage(string warningMessage, long checkoutId, TypeOfCheckoutWarning typeOfCheckoutWarning)
{
WarningMessage = warningMessage;
CheckoutId = checkoutId;
TypeOfCheckoutWarning = typeOfCheckoutWarning;
}
/// <summary>
/// پیام هشدار
/// </summary>
public string WarningMessage { get; private set; }
/// <summary>
/// آی دی فیش حقوقی
/// </summary>
public long CheckoutId { get; private set; }
/// <summary>
/// نوع هشدار فیش حقوقی
/// </summary>
public TypeOfCheckoutWarning TypeOfCheckoutWarning { get; private set; }
public Checkout Checkout { get; set; }
}

View File

@@ -18,4 +18,8 @@
<Folder Include="CheckoutAgg\ValueObjects\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Bson" Version="3.5.0" />
</ItemGroup>
</Project>

View File

@@ -15,7 +15,7 @@ public interface IPersonalContractingPartyRepository :IRepository<long, Personal
EditPersonalContractingParty GetDetailsToEdit(long id);
string GetFullName(long id);
List<PersonalContractingPartyViewModel> Search(PersonalContractingPartySearchModel searchModel2);
int GetLastArchiveCode();
int GetLastNewArchiveCode();
#region Mahan
List<string> SearchByName(string name);
@@ -74,4 +74,6 @@ public interface IPersonalContractingPartyRepository :IRepository<long, Personal
Task<GetRealContractingPartyDetailsViewModel> GetRealDetails(long id);
Task<GetLegalContractingPartyDetailsViewModel> GetLegalDetails(long id);
Task<PersonalContractingParty> GetByNationalCode(string nationalCode);
Task<PersonalContractingParty> GetByRegisterId(string registerId);
}

View File

@@ -73,12 +73,27 @@ public class PersonalContractingParty : EntityBase
/// آیا از طریق ای پی ای احراز هویت شده است
/// </summary>
public bool IsAuthenticated { get; private set; }
/// <summary>
/// جنسیت
/// </summary>
public Gender Gender { get; private set; }
/// <summary>
/// سمت و صاحب امضاء اوراق (فقط برای طرف حقوقی)
/// </summary>
public string LegalPosition { get; private set; }
/// <summary>
/// نام مدیر عامل (فقط برای طرف حقوقی)
/// </summary>
public string CeoFName { get; private set; }
/// <summary>
/// نام خانوادگی مدیر عامل (فقط برای طرف حقوقی)
/// </summary>
public string CeoLName { get; private set; }
#endregion
@@ -94,7 +109,8 @@ public class PersonalContractingParty : EntityBase
public PersonalContractingParty(string fName, string lName, string nationalcode, string idNumber,
/*string legalName,*/ string registerId, string nationalId, string isLegal,
string phone, string agentPhone, string address,long representativeId,
string representativeFullName, int archiveCode, string state,string city, string zone, string sureName)
string representativeFullName, int archiveCode, string state,string city,
string zone, string sureName,string ceoFName,string ceoLName,string legalPosition=null)
{
FName = fName;
@@ -120,8 +136,9 @@ public class PersonalContractingParty : EntityBase
IsActiveString = "true";
IsBlock = "false";
BlockTimes = 0;
LegalPosition = legalPosition;
CeoFName = ceoFName;
CeoLName = ceoLName;
}
@@ -151,7 +168,7 @@ public class PersonalContractingParty : EntityBase
}
public void EditLegal(string lName, string registerId, string nationalId, string phone, string agentPhone, string address, long representativeId, string representativeFullName, int archiveCode,
string state, string city, string zone, string sureName)
string state, string city, string zone, string sureName,string legalPosition = null)
{
LName = lName;
@@ -168,6 +185,8 @@ public class PersonalContractingParty : EntityBase
State = state;
City = city;
Zone = zone;
if (legalPosition != null)
LegalPosition = legalPosition;
}
@@ -203,7 +222,8 @@ public class PersonalContractingParty : EntityBase
IsAuthenticated = true;
}
public void Authentication(string fName, string lName, string fatherName,string idNumber, string idNumberSeri, string idNumberSerial, string dateOfBirth, Gender gender)
public void Authentication(string fName, string lName, string fatherName,string idNumber,
string idNumberSeri, string idNumberSerial, string dateOfBirth, Gender gender,string phone)
{
this.FName = fName;
this.LName = lName;
@@ -214,6 +234,22 @@ public class PersonalContractingParty : EntityBase
this.IdNumber = idNumber;
this.Gender = gender;
this.IsAuthenticated = true;
Phone = phone;
}
public void LegalAuthentication(string fName, string lName, string fatherName,string idNumber, string idNumberSeri,
string idNumberSerial, string dateOfBirth, Gender gender,string phone)
{
CeoFName = fName;
CeoLName = lName;
this.FatherName = fatherName;
this.IdNumberSeri = idNumberSeri;
this.IdNumberSerial = idNumberSerial;
this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : null;
this.IdNumber = idNumber;
this.Gender = gender;
this.IsAuthenticated = true;
Phone = phone;
}
public void RegisterComplete(string fatherName, string idNumberSeri, string idNumberSerial, DateTime dateOfBirth, Gender gender)

View File

@@ -0,0 +1,189 @@
using System;
using System.Collections.Generic;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Company.Domain.EmployeeFaceEmbeddingAgg;
public class EmployeeFaceEmbedding
{
public EmployeeFaceEmbedding()
{
EmbeddingHistory = new List<EmbeddingHistoryItem>();
MetadataHistory = new List<MetadataHistoryItem>();
}
public EmployeeFaceEmbedding(string employeeFullName, long employeeId, long workshopId,
List<double> embeddings, EmployeeFaceEmbeddingMetadata metadata)
{
Id = Guid.NewGuid().ToString();
EmployeeFullName = employeeFullName;
EmployeeId = employeeId;
WorkshopId = workshopId;
Embeddings = embeddings;
Metadata = metadata;
EmbeddingHistory = new List<EmbeddingHistoryItem>();
MetadataHistory = new List<MetadataHistoryItem>();
CreatedAt = DateTime.UtcNow;
UpdatedAt = DateTime.UtcNow;
}
[BsonId]
[BsonRepresentation(BsonType.String)]
public string Id { get; set; }
[BsonElement("employeeFullName")]
public string EmployeeFullName { get; set; }
[BsonElement("employeeId")]
public long EmployeeId { get; set; }
[BsonElement("workshopId")]
public long WorkshopId { get; set; }
[BsonElement("embeddings")]
public List<double> Embeddings { get; set; }
[BsonElement("metadata")]
public EmployeeFaceEmbeddingMetadata Metadata { get; set; }
[BsonElement("embeddingHistory")]
public List<EmbeddingHistoryItem> EmbeddingHistory { get; set; }
[BsonElement("metadataHistory")]
public List<MetadataHistoryItem> MetadataHistory { get; set; }
[BsonElement("createdAt")]
public DateTime CreatedAt { get; set; }
[BsonElement("updatedAt")]
public DateTime UpdatedAt { get; set; }
public void UpdateEmbedding(List<double> newEmbedding, double confidence, double refinementPercentage)
{
if (Embeddings != null)
{
EmbeddingHistory.Add(new EmbeddingHistoryItem
{
Embedding = new List<double>(Embeddings),
Timestamp = DateTime.UtcNow,
Confidence = confidence,
RefinementPercentage = refinementPercentage
});
}
Embeddings = newEmbedding;
UpdatedAt = DateTime.UtcNow;
}
public void UpdateMetadata(EmployeeFaceEmbeddingMetadata newMetadata, double confidence, double refinementPercentage)
{
if (Metadata != null)
{
MetadataHistory.Add(new MetadataHistoryItem
{
Metadata = Metadata,
Timestamp = DateTime.UtcNow,
Confidence = confidence,
RefinementPercentage = refinementPercentage
});
}
Metadata = newMetadata;
UpdatedAt = DateTime.UtcNow;
}
public void UpdateEmployeeInfo(string employeeFullName, long workshopId)
{
EmployeeFullName = employeeFullName;
WorkshopId = workshopId;
UpdatedAt = DateTime.UtcNow;
}
}
public class EmployeeFaceEmbeddingMetadata
{
[BsonElement("avg_eye_distance_normalized")]
public double AvgEyeDistanceNormalized { get; set; }
[BsonElement("avg_eye_to_face_ratio")]
public double AvgEyeToFaceRatio { get; set; }
[BsonElement("avg_face_aspect_ratio")]
public double AvgFaceAspectRatio { get; set; }
[BsonElement("avg_detection_confidence")]
public double AvgDetectionConfidence { get; set; }
[BsonElement("avg_keypoints_normalized")]
public EmployeeFaceEmbeddingKeypoints AvgKeypointsNormalized { get; set; }
[BsonElement("per_image_metadata")]
public List<ImageMetadata> PerImageMetadata { get; set; }
}
public class EmployeeFaceEmbeddingKeypoints
{
[BsonElement("left_eye")]
public double[] LeftEye { get; set; }
[BsonElement("right_eye")]
public double[] RightEye { get; set; }
[BsonElement("nose")]
public double[] Nose { get; set; }
[BsonElement("mouth_left")]
public double[] MouthLeft { get; set; }
[BsonElement("mouth_right")]
public double[] MouthRight { get; set; }
}
public class ImageMetadata
{
[BsonElement("face_aspect_ratio")]
public double FaceAspectRatio { get; set; }
[BsonElement("eye_distance_normalized")]
public double EyeDistanceNormalized { get; set; }
[BsonElement("eye_to_face_ratio")]
public double EyeToFaceRatio { get; set; }
[BsonElement("detection_confidence")]
public double DetectionConfidence { get; set; }
[BsonElement("keypoints_normalized")]
public EmployeeFaceEmbeddingKeypoints KeypointsNormalized { get; set; }
}
public class EmbeddingHistoryItem
{
[BsonElement("embedding")]
public List<double> Embedding { get; set; }
[BsonElement("timestamp")]
public DateTime Timestamp { get; set; }
[BsonElement("confidence")]
public double Confidence { get; set; }
[BsonElement("refinementPercentage")]
public double RefinementPercentage { get; set; }
}
public class MetadataHistoryItem
{
[BsonElement("metadata")]
public EmployeeFaceEmbeddingMetadata Metadata { get; set; }
[BsonElement("timestamp")]
public DateTime Timestamp { get; set; }
[BsonElement("confidence")]
public double Confidence { get; set; }
[BsonElement("refinementPercentage")]
public double RefinementPercentage { get; set; }
}

View File

@@ -0,0 +1,15 @@
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Company.Domain.EmployeeFaceEmbeddingAgg;
public interface IEmployeeFaceEmbeddingRepository
{
Task CreateAsync(EmployeeFaceEmbedding employeeFaceEmbedding);
Task UpdateAsync(EmployeeFaceEmbedding employeeFaceEmbedding);
Task<EmployeeFaceEmbedding> GetByIdAsync(string id);
Task<EmployeeFaceEmbedding> GetByEmployeeIdAsync(long employeeId);
Task<List<EmployeeFaceEmbedding>> GetByWorkshopIdAsync(long workshopId);
Task<List<EmployeeFaceEmbedding>> GetByWorkshopIdsAsync(List<long> workshopIds);
Task DeleteAsync(string id);
}

View File

@@ -17,6 +17,7 @@ public class FinancialStatment : EntityBase
ContractingPartyId = contractingPartyId;
ContractingPartyName = contractingPartyName;
PublicId = Guid.NewGuid();
FinancialTransactionList = [];
}
public FinancialStatment()
@@ -37,4 +38,12 @@ public class FinancialStatment : EntityBase
{
PublicId = Guid.NewGuid();
}
public void AddFinancialTransaction(FinancialTransaction financialTransaction)
{
if (financialTransaction == null)
throw new ArgumentNullException(nameof(financialTransaction));
FinancialTransactionList.Add(financialTransaction);
}
}

View File

@@ -23,4 +23,5 @@ public interface IFinancialStatmentRepository : IRepository<long, FinancialStatm
Task<GetFinancialStatementBalanceAmount> GetBalanceAmount(long id);
Task<double> GetClientDebtAmount(long accountId);
Task<FinancialStatmentDetailsByContractingPartyViewModel> GetDetailsByContractingParty(long contractingPartyId,FinancialStatementSearchModel searchModel);
Task<FinancialStatment> GetByContractingPartyId(long contractingPartyId);
}

View File

@@ -6,6 +6,7 @@ using _0_Framework.Application;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.InstitutionContract;
using CompanyManagment.App.Contracts.Workshop;
using Microsoft.AspNetCore.Mvc;
namespace Company.Domain.InstitutionContractAgg;
@@ -47,4 +48,34 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
Task<PagedResult<GetInstitutionContractListItemsViewModel>> GetList(InstitutionContractListSearchModel searchModel);
Task<GetInstitutionContractListStatsViewModel> GetListStats(InstitutionContractListSearchModel searchModel);
Task<List<RegistrationWorkflowMainListViewModel>> RegistrationWorkflowMainList();
Task<List<RegistrationWorkflowItemsViewModel>> RegistrationWorkflowItems(long institutionContractId);
Task<InstitutionContractWorkshopInitial> GetInstitutionWorkshopInitialDetails(long institutionWorkshopInitialId);
Task<InstitutionContract> GetIncludeWorkshopDetailsAsync(long institutionContractId);
void UpdateStatusIfNeeded(long institutionContractId);
Task<GetInstitutionVerificationDetailsViewModel> GetVerificationDetails(Guid id);
Task<InstitutionContract> GetByPublicIdAsync(Guid id);
#region Extension
Task<InstitutionContractExtensionInquiryResult> GetExtensionInquiry(long previousContractId);
Task<InstitutionContractExtensionWorkshopsResponse> GetExtensionWorkshops(InstitutionContractExtensionWorkshopsRequest request);
Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(InstitutionContractExtensionPlanRequest request);
Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(InstitutionContractExtensionPaymentRequest request);
Task<OperationResult> ExtensionComplete(InstitutionContractExtensionCompleteRequest request);
#endregion
#region Upgrade(Amendment)
Task<InstitutionContractAmendmentWorkshopsResponse> GetAmendmentWorkshops(long institutionContractId);
Task<InsitutionContractAmendmentPaymentResponse> GetAmendmentPaymentDetails(InsitutionContractAmendmentPaymentRequest request);
Task<InsertAmendmentTempWorkshopResponse> InsertAmendmentTempWorkshops(InstitutionContractAmendmentTempWorkshopViewModel request);
Task RemoveAmendmentWorkshops(Guid workshopTempId);
#endregion
Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search, string selected);
Task<List<InstitutionContractPrintViewModel>> PrintAllAsync(List<long> ids);
Task<GetInstitutionContractWorkshopsDetails> GetContractWorkshopsDetails(long id);
}

View File

@@ -1,17 +1,24 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Security.Cryptography;
using _0_Framework.Domain;
using Company.Domain.InstitutionContractContactInfoAgg;
using CompanyManagment.App.Contracts.InstitutionContract;
namespace Company.Domain.InstitutionContractAgg;
public class InstitutionContract : EntityBase
{
public InstitutionContract(string contractNo, long representativeId, string representativeName, long contractingPartyId,
public InstitutionContract(string contractNo, long representativeId, string representativeName,
long contractingPartyId,
string contractingPartyName, DateTime contractDateGr, string contractDateFa, string state, string city,
string address, DateTime contractStartGr, string contractStartFa, DateTime contractEndGr,
string contractEndFa, double contractAmount, double dailyCompenseation, double obligation,
double totalAmount, int extensionNo, string workshopManualCount, string employeeManualCount, string description, string officialCompany,string typeOfcontract, string hasValueAddedTax, double valueAddedTax)
double totalAmount, int extensionNo, string workshopManualCount, string employeeManualCount, string description,
string officialCompany, string typeOfcontract, string hasValueAddedTax, double valueAddedTax,
List<InstitutionContractWorkshopInitial> workshopDetails, long lawId)
{
ContractNo = contractNo;
RepresentativeId = representativeId;
@@ -43,67 +50,123 @@ public class InstitutionContract : EntityBase
TypeOfContract = typeOfcontract;
HasValueAddedTax = hasValueAddedTax;
ValueAddedTax = valueAddedTax;
VerificationStatus = InstitutionContractVerificationStatus.PendingForVerify;
ContactInfoList = [];
Installments = [];
WorkshopGroup = new InstitutionContractWorkshopGroup(id, workshopDetails);
PublicId = Guid.NewGuid();
LawId = lawId;
}
public long LawId { get; private set; }
public string ContractNo { get; private set; }
public long RepresentativeId { get; private set; }
public string RepresentativeName { get; private set; }
public long ContractingPartyId { get; private set; }
public string ContractingPartyName { get; private set; }
public DateTime ContractDateGr { get; private set; }
public string ContractDateFa { get; private set; }
public string State { get; private set; }
public string City { get; private set; }
public string Address { get; private set; }
//public long ContactInfoId { get; private set; }
public DateTime ContractStartGr { get; private set; }
public string ContractStartFa { get; private set; }
public DateTime ContractEndGr { get; private set; }
public string ContractEndFa { get; private set; }
// مبلغ قرارداد
public double ContractAmount { get; private set; }
//خسارت روزانه
public double DailyCompenseation { get; private set; }
//وجه التزام
public double Obligation { get; private set; }
// مبلغ کل قرارداد
public double TotalAmount { get; private set; }
public string WorkshopManualCount { get; private set; }
public string EmployeeManualCount { get; private set; }
public string IsActiveString { get; private set; }
public int ExtensionNo { get; private set; }
public string Description { get; private set; }
public string Signature { get; private set; }
public string OfficialCompany { get; private set; }
public string TypeOfContract { get; private set; }
public string HasValueAddedTax { get; set; }
public double ValueAddedTax { get; set; }
public string HasValueAddedTax { get; private set; }
public double ValueAddedTax { get; private set; }
public Guid PublicId { get; private set; }
public string VerifyCode { get; private set; }
public DateTime VerifyCodeCreation { get; private set; }
public string VerifierFullName { get; private set; }
public string VerifierPhoneNumber { get; private set; }
[NotMapped] public bool VerifyCodeExpired => VerifyCodeCreation.Add(ExpireTime) <= DateTime.Now;
[NotMapped] public bool CanResendVerifyCode => VerifyCodeCreation.Add(ReSendTime) <= DateTime.Now;
[NotMapped] public TimeSpan ExpireTime => TimeSpan.FromMinutes(5);
[NotMapped] public TimeSpan ReSendTime => TimeSpan.FromMinutes(2);
public bool IsInstallment { get; set; }
public InstitutionContractVerificationStatus VerificationStatus { get; private set; }
public InstitutionContractWorkshopGroup WorkshopGroup { get; private set; }
public List<InstitutionContractContactInfo> ContactInfoList { get; set; }
public List<InstitutionContractInstallment> Installments { get; set; }
public List<InstitutionContractAmendment> Amendments { get; private set; }
public InstitutionContract()
{
ContactInfoList = new List<InstitutionContractContactInfo>();
ContactInfoList = [];
Installments = [];
}
public void Edit(DateTime contractDateGr, string contractDateFa, string state, string city, string address,
DateTime contractStartGr, string contractStartFa, DateTime contractEndGr, string contractEndFa,
double contractAmount, double dailyCompenseation, double obligation, double totalAmount,
string workshopManualCount, string employeeManualCount, string description, string officialCompany,
string workshopManualCount, string employeeManualCount, string description, string officialCompany,
string typeOfcontract, double valueAddedTax, string hasValueAddedTax)
{
ContractDateGr = contractDateGr;
ContractDateFa = contractDateFa;
State = state;
City = city;
Address = address;
ContractStartGr = contractStartGr;
ContractStartFa = contractStartFa;
ContractEndGr = contractEndGr;
@@ -124,13 +187,11 @@ public class InstitutionContract : EntityBase
public void Active()
{
this.IsActiveString = "true";
}
public void DeActive()
{
this.IsActiveString = "false";
}
@@ -148,4 +209,182 @@ public class InstitutionContract : EntityBase
{
this.Signature = "0";
}
public void Verified()
{
VerificationStatus = InstitutionContractVerificationStatus.Verified;
}
public void SetPendingWorkflow()
{
VerificationStatus = InstitutionContractVerificationStatus.PendingWorkflow;
}
public void SetInstallments(List<InstitutionContractInstallment> installments)
{
Installments = installments;
IsInstallment = true;
}
public void SetVerifyCode(string code,string verifierFullName, string verifierPhoneNumber)
{
VerifyCode = code;
VerifyCodeCreation = DateTime.Now;
VerifierFullName = verifierFullName;
VerifierPhoneNumber = verifierPhoneNumber;
}
public void SetWorkshopGroup(InstitutionContractWorkshopGroup workshopGroup)
{
WorkshopGroup = workshopGroup;
}
public void SetAmount(double totalAmount, double tax, double oneMonthPayment)
{
ContractAmount = oneMonthPayment;
TotalAmount = totalAmount;
ValueAddedTax = tax;
HasValueAddedTax = tax > 0 ? "true" : "false";
}
public void ClearGroup()
{
WorkshopGroup = null;
}
}
public class InstitutionContractAmendment : EntityBase
{
private InstitutionContractAmendment(){}
public InstitutionContractAmendment(long institutionContractId,
List<InstitutionContractInstallment> installments, double amount, bool hasInstallment,
InstitutionContractAmendmentChange amendmentChange, long lawId)
{
InstitutionContractId = institutionContractId;
Installments = installments is { Count: > 0} ? installments : [];
Amount = amount;
HasInstallment = hasInstallment;
AmendmentChanges = [amendmentChange];
LawId = lawId;
}
public long InstitutionContractId { get; set; }
public InstitutionContract InstitutionContract { get; set; }
public List<InstitutionContractInstallment> Installments { get; set; }
public double Amount { get; set; }
public bool HasInstallment { get; set; }
public string VerifyCode { get; set; }
public DateTime VerificationCreation { get; set; }
public List<InstitutionContractAmendmentChange> AmendmentChanges { get; set; }
public long LawId { get; set; }
public void SetVerifyCode(string code,string verifierFullName, string verifierPhoneNumber)
{
VerifyCode = code;
VerifyCodeCreation = DateTime.Now;
VerifierFullName = verifierFullName;
VerifierPhoneNumber = verifierPhoneNumber;
}
public string VerifierPhoneNumber { get; private set; }
public string VerifierFullName { get; private set; }
public DateTime VerifyCodeCreation { get; set; }
}
public class InstitutionContractAmendmentChange : EntityBase
{
private InstitutionContractAmendmentChange() { }
private InstitutionContractAmendmentChange(long institutionContractAmendmentId,
InstitutionContractAmendment institutionContractAmendment, InstitutionContractAmendmentChangeType changeType,
DateTime changeDateGr, bool? hasRollCallPlan, bool? hasCustomizeCheckoutPlan, bool? hasContractPlan,
bool? hasContractPlanInPerson, bool? hasInsurancePlan, bool? hasInsurancePlanInPerson, int? personnelCount,
long? workshopDetailsId)
{
InstitutionContractAmendmentId = institutionContractAmendmentId;
InstitutionContractAmendment = institutionContractAmendment;
ChangeType = changeType;
ChangeDateGr = changeDateGr;
HasRollCallPlan = hasRollCallPlan;
HasCustomizeCheckoutPlan = hasCustomizeCheckoutPlan;
HasContractPlan = hasContractPlan;
HasContractPlanInPerson = hasContractPlanInPerson;
HasInsurancePlan = hasInsurancePlan;
HasInsurancePlanInPerson = hasInsurancePlanInPerson;
PersonnelCount = personnelCount;
WorkshopDetailsId = workshopDetailsId;
}
public long InstitutionContractAmendmentId { get; private set; }
public InstitutionContractAmendment InstitutionContractAmendment { get; private set; }
public InstitutionContractAmendmentChangeType ChangeType { get; private set; }
public DateTime ChangeDateGr { get; private set; }
/// <summary>
/// پلن حضور و غیاب
/// </summary>
public bool? HasRollCallPlan { get; private set; }
/// <summary>
/// پلن فیش غیر رسمی
/// </summary>
public bool? HasCustomizeCheckoutPlan { get; private set; }
/// <summary>
/// پلن قرارداد و تصفیه
/// </summary>
public bool? HasContractPlan { get; private set; }
/// <summary>
/// پلن قرارداد و تصفیه حضوری
/// </summary>
public bool? HasContractPlanInPerson { get; private set; }
/// <summary>
/// پلن بیمه
/// </summary>
public bool? HasInsurancePlan { get; private set; }
/// <summary>
/// پلن بیمه حضوری
/// </summary>
public bool? HasInsurancePlanInPerson { get; private set; }
/// <summary>
/// تعداد پرسنل
/// </summary>
public int? PersonnelCount { get; private set; }
/// <summary>
/// تعداد کارگاه
/// </summary>
public long? WorkshopDetailsId { get; private set; }
}
public enum InstitutionContractAmendmentChangeType
{
PersonCount,
Services,
WorkshopCreated
}
public enum InstitutionContractVerificationStatus
{
/// <summary>
/// در انتظار تایید
/// </summary>
PendingForVerify = 0,
/// <summary>
/// در انتظار کارپوشه
/// </summary>
PendingWorkflow = 1,
/// <summary>
/// تایید شده
/// </summary>
Verified = 2
}

View File

@@ -0,0 +1,28 @@
using System;
using _0_Framework.Application;
namespace Company.Domain.InstitutionContractAgg;
public class InstitutionContractInstallment
{
public InstitutionContractInstallment(DateTime installmentDateGr, double amount,
string description)
{
InstallmentDateGr = installmentDateGr;
InstallmentDateFa = installmentDateGr.ToFarsi();
Amount = amount;
Description = description;
}
public long Id { get; private set; }
public DateTime InstallmentDateGr { get; private set; }
public string InstallmentDateFa { get; private set; }
public double Amount { get; private set; }
public string Description { get; private set; }
public long InstitutionContractId { get; private set; }
public long? InstitutionContractAmendmentId { get; private set; }
public InstitutionContract InstitutionContract { get; private set; }
public InstitutionContractAmendment InstitutionContractAmendment { get; set; }
}

View File

@@ -0,0 +1,84 @@
using System;
using System.Collections.Generic;
using _0_Framework.Domain;
namespace Company.Domain.InstitutionContractAgg;
public class InstitutionContractWorkshopBase:EntityBase
{
protected InstitutionContractWorkshopBase(){}
public InstitutionContractWorkshopBase(string workshopName, bool hasRollCallPlan,bool hasRollCallPlanInPerson,
bool hasCustomizeCheckoutPlan, bool hasContractPlan,bool hasContractPlanInPerson,bool hasInsurancePlan,bool hasInsurancePlanInPerson,
int personnelCount, double price )
{
WorkshopName = workshopName;
Services = new WorkshopServices(hasInsurancePlan, hasInsurancePlanInPerson,
hasContractPlan, hasContractPlanInPerson, hasRollCallPlan, hasRollCallPlanInPerson,hasCustomizeCheckoutPlan);
PersonnelCount = personnelCount;
Price = price;
Employers = [];
}
/// <summary>
/// شناسه کارگاه
/// </summary>
public long? WorkshopId { get; protected set; }
/// <summary>
/// نام کارگاه
/// </summary>
public string WorkshopName { get; private set; }
public WorkshopServices Services { get; set; } = new (false, false,
false, false, false,
false, false);
public int PersonnelCount { get; private set; }
/// <summary>
/// شناسه قرارداد نهاد مرتبط
/// </summary>
public long InstitutionContractId { get; private set; }
public double Price { get; private set; }
public List<InstitutionContractWorkshopDetailEmployer> Employers { get; private set; } = new();
public void SetEmployers(List<long> employerIds)
{
Employers.Clear();
foreach (var employerId in employerIds)
{
Employers.Add(new InstitutionContractWorkshopDetailEmployer(employerId));
}
}
public void AddEmployer(long employerId)
{
if (Employers.Exists(x => x.EmployerId == employerId))
return;
Employers.Add(new InstitutionContractWorkshopDetailEmployer(employerId));
}
// ⚡️ Equality Implementation
public override bool Equals(object? obj)
{
if (obj is not InstitutionContractWorkshopBase other)
return false;
return WorkshopName == other.WorkshopName &&
PersonnelCount == other.PersonnelCount &&
Price == other.Price &&
Services == other.Services;
}
public override int GetHashCode()
{
return HashCode.Combine(WorkshopName, PersonnelCount, Price, Services);
}
}

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using _0_Framework_b.Domain;
namespace Company.Domain.InstitutionContractAgg;
public class InstitutionContractWorkshopCurrent:InstitutionContractWorkshopBase
{
private InstitutionContractWorkshopCurrent(){}
public InstitutionContractWorkshopCurrent(string workshopName, bool hasRollCallPlan,
bool hasRollCallPlanInPerson, bool hasCustomizeCheckoutPlan, bool hasContractPlan,
bool hasContractPlanInPerson, bool hasInsurancePlan, bool hasInsurancePlanInPerson,
int personnelCount, double price,long institutionContractWorkshopGroupId,InstitutionContractWorkshopGroup workshopGroup,long workshopId) : base(workshopName, hasRollCallPlan,
hasRollCallPlanInPerson, hasCustomizeCheckoutPlan, hasContractPlan,
hasContractPlanInPerson, hasInsurancePlan, hasInsurancePlanInPerson, personnelCount, price)
{
InstitutionContractWorkshopGroupId = institutionContractWorkshopGroupId;
WorkshopGroup = workshopGroup;
WorkshopId = workshopId;
}
public long InstitutionContractWorkshopGroupId { get; private set; }
public InstitutionContractWorkshopGroup WorkshopGroup { get; private set; }
public long InitialWorkshopId { get; private set; }
public InstitutionContractWorkshopInitial WorkshopInitial { get; private set; }
}

View File

@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using _0_Framework_b.Domain;
namespace Company.Domain.InstitutionContractAgg;
public class InstitutionContractWorkshopGroup : EntityBase
{
private InstitutionContractWorkshopGroup()
{
}
public long InstitutionContractId { get; private set; }
public InstitutionContract InstitutionContract { get; set; }
public List<InstitutionContractWorkshopInitial> InitialWorkshops { get; private set; }
public List<InstitutionContractWorkshopCurrent> CurrentWorkshops { get; private set; }
public DateTime LastModifiedDate { get; private set; }
[NotMapped]
public bool HasChanges =>
!InitialWorkshops.Cast<InstitutionContractWorkshopBase>()
.SequenceEqual(CurrentWorkshops.Cast<InstitutionContractWorkshopBase>());
public InstitutionContractWorkshopGroup(long institutionContractId,
List<InstitutionContractWorkshopInitial> initialDetails)
{
InstitutionContractId = institutionContractId;
var initialWorkshops = initialDetails.ToList();
InitialWorkshops = initialWorkshops.ToList();
LastModifiedDate = DateTime.Now;
}
public void UpdateCurrentWorkshops(List<InstitutionContractWorkshopCurrent> updatedDetails)
{
CurrentWorkshops = updatedDetails.ToList();
LastModifiedDate = DateTime.Now;
}
}

View File

@@ -0,0 +1,70 @@
using System.Collections.Generic;
using System.Linq;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.InstitutionContract;
namespace Company.Domain.InstitutionContractAgg;
public class InstitutionContractWorkshopInitial:InstitutionContractWorkshopBase
{
private InstitutionContractWorkshopInitial(){}
public InstitutionContractWorkshopInitial(string workshopName, bool hasRollCallPlan,
bool hasRollCallPlanInPerson, bool hasCustomizeCheckoutPlan, bool hasContractPlan,
bool hasContractPlanInPerson, bool hasInsurancePlan, bool hasInsurancePlanInPerson,
int personnelCount, double price) : base(workshopName, hasRollCallPlan,
hasRollCallPlanInPerson, hasCustomizeCheckoutPlan, hasContractPlan, hasContractPlanInPerson,
hasInsurancePlan, hasInsurancePlanInPerson, personnelCount, price)
{
WorkshopCreated = false;
}
public long InstitutionContractWorkshopGroupId { get; private set; }
public InstitutionContractWorkshopGroup WorkshopGroup { get; private set; }
public bool WorkshopCreated { get; private set; }
public InstitutionContractWorkshopCurrent? WorkshopCurrent { get; private set; }
public long? InstitutionContractWorkshopCurrentId { get; private set; }
public void SetWorkshopId(long workshopId)
{
WorkshopId = workshopId;
WorkshopCreated = true;
WorkshopCurrent = new InstitutionContractWorkshopCurrent(WorkshopName,Services.RollCall,Services.RollCallInPerson,
Services.CustomizeCheckout,Services.Contract,Services.ContractInPerson,Services.Insurance,
Services.InsuranceInPerson,PersonnelCount,Price,InstitutionContractWorkshopGroupId,WorkshopGroup,workshopId);
WorkshopCurrent.SetEmployers(Employers.Select(x=>x.EmployerId).ToList());
}
public static InstitutionContractWorkshopInitial CreateManual(string workshopName, bool hasRollCallPlan,
bool hasRollCallPlanInPerson, bool hasCustomizeCheckoutPlan, bool hasContractPlan,
bool hasContractPlanInPerson, bool hasInsurancePlan, bool hasInsurancePlanInPerson,
int personnelCount, double price, long workshopId,List<long> employerIds)
{
var entity = new InstitutionContractWorkshopInitial(workshopName, hasRollCallPlan,
hasRollCallPlanInPerson, hasCustomizeCheckoutPlan, hasContractPlan, hasContractPlanInPerson,
hasInsurancePlan, hasInsurancePlanInPerson, personnelCount, price);
entity.WorkshopCreated = true;
entity.WorkshopId = workshopId;
entity.SetEmployers(employerIds);
return entity;
}
public void SetWorkshopGroup(InstitutionContractWorkshopGroup entityWorkshopGroup)
{
InstitutionContractWorkshopGroupId = entityWorkshopGroup.id;
WorkshopGroup = entityWorkshopGroup;
}
}
public class InstitutionContractWorkshopDetailEmployer : EntityBase
{
public long EmployerId { get; private set; }
public InstitutionContractWorkshopDetailEmployer(long employerId)
{
EmployerId = employerId;
}
private InstitutionContractWorkshopDetailEmployer() { }
}

View File

@@ -0,0 +1,23 @@
namespace Company.Domain.InstitutionContractAgg;
public record WorkshopServices
{
public WorkshopServices(bool insurance, bool insuranceInPerson, bool contract, bool contractInPerson, bool rollCall, bool rollCallInPerson, bool customizeCheckout)
{
Insurance = insurance;
InsuranceInPerson = insuranceInPerson;
Contract = contract;
ContractInPerson = contractInPerson;
RollCall = rollCall;
CustomizeCheckout = customizeCheckout;
RollCallInPerson = rollCallInPerson;
}
public bool Insurance { get; private set; }
public bool InsuranceInPerson { get; private set; }
public bool Contract { get; private set; }
public bool ContractInPerson { get; private set; }
public bool RollCall { get; private set; }
public bool RollCallInPerson { get; private set; }
public bool CustomizeCheckout { get; private set; }
}

View File

@@ -0,0 +1,151 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Company.Domain.InstitutionContractAmendmentTempAgg;
public class InstitutionContractAmendmentTemp
{
public InstitutionContractAmendmentTemp(List<InstitutionContractAmendmentTempPrevWorkshop> prevWorkshops,
long institutionContractId)
{
Id = Guid.NewGuid();
PrevWorkshops = prevWorkshops;
NewWorkshops = prevWorkshops.Select(x=> new InstitutionContractAmendmentTempNewWorkshop(
x.WorkshopName, x.CountPerson, x.ContractAndCheckout, x.ContractAndCheckoutInPerson, x.Insurance,
x.InsuranceInPerson, x.RollCall, x.RollCallInPerson, x.CustomizeCheckout, x.Price, x.WorkshopId,
x.CurrentWorkshopId, 0)).ToList();
InstitutionContractId = institutionContractId;
}
[BsonId]
[BsonRepresentation(BsonType.String)]
public Guid Id { get; private set; }
public List<InstitutionContractAmendmentTempPrevWorkshop> PrevWorkshops { get; private set; }
public List<InstitutionContractAmendmentTempNewWorkshop> NewWorkshops { get; private set; }
public long InstitutionContractId { get; private set; }
}
public class InstitutionContractAmendmentTempNewWorkshop : InstitutionContractAmendmentTempPrevWorkshop
{
public InstitutionContractAmendmentTempNewWorkshop(string workshopName, int countPerson, bool contractAndCheckout,
bool contractAndCheckoutInPerson, bool insurance, bool insuranceInPerson, bool rollCall, bool rollCallInPerson,
bool customizeCheckout, double price, long workshopId, long currentWorkshopId,double priceDifference) : base(
workshopName, countPerson, contractAndCheckout, contractAndCheckoutInPerson, insurance, insuranceInPerson,
rollCall, rollCallInPerson, customizeCheckout, price, workshopId, currentWorkshopId)
{
PriceDifference = priceDifference;
}
/// <summary>
/// مبلغ اختلاف کارگاه جدید با کارگاه قبلی(مبلغ اصلی ارتقاء)
/// </summary>
public double PriceDifference { get; private set; }
public void Edit(string workshopName, int countPerson, bool contractAndCheckout,
bool contractAndCheckoutInPerson,
bool insurance, bool insuranceInPerson, bool rollCall, bool customizeCheckout,
double price,double priceDifference)
{
base.Edit(workshopName, countPerson, contractAndCheckout, contractAndCheckoutInPerson, insurance,
insuranceInPerson, rollCall, customizeCheckout, price);
PriceDifference = priceDifference;
}
}
public class InstitutionContractAmendmentTempPrevWorkshop
{
public InstitutionContractAmendmentTempPrevWorkshop(string workshopName, int countPerson, bool contractAndCheckout,
bool contractAndCheckoutInPerson,
bool insurance, bool insuranceInPerson,
bool rollCall, bool rollCallInPerson, bool customizeCheckout, double price, long workshopId,
long currentWorkshopId)
{
Id = Guid.NewGuid();
WorkshopName = workshopName;
CountPerson = countPerson;
ContractAndCheckout = contractAndCheckout;
Insurance = insurance;
RollCall = rollCall;
CustomizeCheckout = customizeCheckout;
ContractAndCheckoutInPerson = contractAndCheckoutInPerson;
InsuranceInPerson = insuranceInPerson;
RollCallInPerson = rollCallInPerson;
Price = price;
WorkshopId = workshopId;
CurrentWorkshopId = currentWorkshopId;
}
[BsonRepresentation(BsonType.String)]
public Guid Id { get; set; }
public long CurrentWorkshopId { get; private set; }
public long WorkshopId { get; set; }
/// <summary>
/// نام کارگاه
/// </summary>
public string WorkshopName { get; private set; }
/// <summary>
/// تعداد پرسنل
/// </summary>
public int CountPerson { get; private set; }
#region ServiceSelection
/// <summary>
/// قرارداد و تصفیه
/// </summary>
public bool ContractAndCheckout { get; private set; }
/// <summary>
/// بیمه
/// </summary>
public bool Insurance { get; private set; }
/// <summary>
/// حضورغباب
/// </summary>
public bool RollCall { get; private set; }
public bool RollCallInPerson { get; set; }
/// <summary>
/// فیش غیر رسمی
/// </summary>
public bool CustomizeCheckout { get; private set; }
/// <summary>
/// خدمات حضوری قرداد و تصفیه
/// </summary>
public bool ContractAndCheckoutInPerson { get; private set; }
/// <summary>
/// خدمات حضوری بیمه
/// </summary>
public bool InsuranceInPerson { get; private set; }
public double Price { get; private set; }
#endregion
public void Edit(string workshopName, int countPerson, bool contractAndCheckout, bool contractAndCheckoutInPerson,
bool insurance, bool insuranceInPerson, bool rollCall, bool customizeCheckout,
double price)
{
WorkshopName = workshopName;
CountPerson = countPerson;
ContractAndCheckout = contractAndCheckout;
Insurance = insurance;
RollCall = rollCall;
CustomizeCheckout = customizeCheckout;
ContractAndCheckoutInPerson = contractAndCheckoutInPerson;
InsuranceInPerson = insuranceInPerson;
Price = price;
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Threading.Tasks;
namespace Company.Domain.InstitutionContractExtensionTempAgg;
public interface IInstitutionContractExtenstionTempRepository
{
Task Create(InstitutionContractExtensionTemp institutionContract);
Task<InstitutionContractExtensionTemp> GetPreviousExtenstionData(long contractingPartyId);
Task Remove(Guid id);
}

View File

@@ -0,0 +1,168 @@
using System;
using System.Collections.Generic;
using CompanyManagment.App.Contracts.InstitutionContract;
using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Company.Domain.InstitutionContractExtensionTempAgg;
public class InstitutionContractExtensionTemp
{
public InstitutionContractExtensionTemp(long previousContractingPartyId)
{
Id = Guid.NewGuid();
PreviousId = previousContractingPartyId;
}
[BsonId] // Specifies this field as the _id in MongoDB
[BsonRepresentation(BsonType.String)] // Ensures the GUID is stored as a string
public Guid Id { get; set; }
public long PreviousId { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string Province { get; set; }
public List<EditContactInfo> ContactInfos { get; set; }
public List<InstitutionContractExtensionTempWorkshop> Workshops { get; set; }
public InstitutionContractExtensionPlanDetail OneMonth { get; set; }
public InstitutionContractExtensionPlanDetail ThreeMonths { get; set; }
public InstitutionContractExtensionPlanDetail SixMonths { get; set; }
public InstitutionContractExtensionPlanDetail TwelveMonths { get; set; }
public InstitutionContractPaymentMonthlyViewModel MonthlyPayment { get; set; }
public InstitutionContractPaymentOneTimeViewModel OneTimePayment { get; set; }
public bool HasContractInPerson { get; set; }
public InstitutionContractDuration? Duration { get; set; }
public void SetContractingPartyInfos(string address, string city, string province, List<EditContactInfo> contactInfos)
{
Address = address;
City = city;
Province = province;
ContactInfos = contactInfos;
}
public void SetWorkshopsAndPlanAmounts(List<InstitutionContractExtensionTempWorkshop> workshops,
InstitutionContractExtensionPlanDetail oneMonth,
InstitutionContractExtensionPlanDetail threeMonth, InstitutionContractExtensionPlanDetail sixMonth,
InstitutionContractExtensionPlanDetail twelveMonth, bool hasContractInPerson)
{
Workshops = workshops;
OneMonth = oneMonth;
ThreeMonths = threeMonth;
SixMonths = sixMonth;
TwelveMonths = twelveMonth;
HasContractInPerson = hasContractInPerson;
}
public void SetAmountAndDuration(InstitutionContractDuration duration,InstitutionContractPaymentMonthlyViewModel monthly,
InstitutionContractPaymentOneTimeViewModel oneTime)
{
Duration = duration;
MonthlyPayment = monthly;
OneTimePayment = oneTime;
}
}
public class InstitutionContractExtenstionTempPlan
{
public InstitutionContractExtenstionTempPlan(string contractStart, string contractEnd,
string oneMonthPaymentDiscounted, string oneMonthDiscount, string oneMonthOriginalPayment,
string totalPayment, string dailyCompensation, string obligation)
{
ContractStart = contractStart;
ContractEnd = contractEnd;
OneMonthPaymentDiscounted = oneMonthPaymentDiscounted;
OneMonthDiscount = oneMonthDiscount;
OneMonthOriginalPayment = oneMonthOriginalPayment;
TotalPayment = totalPayment;
DailyCompensation = dailyCompensation;
Obligation = obligation;
}
public string ContractStart { get; set; }
public string ContractEnd { get; set; }
public string OneMonthPaymentDiscounted { get; set; }
public string OneMonthDiscount { get; set; }
public string OneMonthOriginalPayment { get; set; }
public string TotalPayment { get; set; }
public string DailyCompensation { get; set; }
public string Obligation { get; set; }
}
public class InstitutionContractExtensionTempWorkshop
{
public InstitutionContractExtensionTempWorkshop(string workshopName, int countPerson, bool contractAndCheckout, bool contractAndCheckoutInPerson,
bool insurance, bool insuranceInPerson,
bool rollCall,bool rollCallInPerson, bool customizeCheckout,double price,long workshopId)
{
WorkshopName = workshopName;
CountPerson = countPerson;
ContractAndCheckout = contractAndCheckout;
Insurance = insurance;
RollCall = rollCall;
CustomizeCheckout = customizeCheckout;
ContractAndCheckoutInPerson = contractAndCheckoutInPerson;
InsuranceInPerson = insuranceInPerson;
RollCallInPerson = rollCallInPerson;
Price = price;
WorkshopId = workshopId;
}
public long WorkshopId { get; set; }
/// <summary>
/// نام کارگاه
/// </summary>
public string WorkshopName { get; private set; }
/// <summary>
/// تعداد پرسنل
/// </summary>
public int CountPerson { get; private set; }
#region ServiceSelection
/// <summary>
/// قرارداد و تصفیه
/// </summary>
public bool ContractAndCheckout { get; private set; }
/// <summary>
/// بیمه
/// </summary>
public bool Insurance { get; private set; }
/// <summary>
/// حضورغباب
/// </summary>
public bool RollCall { get; private set; }
public bool RollCallInPerson { get; set; }
/// <summary>
/// فیش غیر رسمی
/// </summary>
public bool CustomizeCheckout { get;private set; }
/// <summary>
/// خدمات حضوری قرداد و تصفیه
/// </summary>
public bool ContractAndCheckoutInPerson { get; private set; }
/// <summary>
/// خدمات حضوری بیمه
/// </summary>
public bool InsuranceInPerson { get; private set; }
public double Price{ get; set; }
#endregion
}

View File

@@ -25,5 +25,6 @@ public interface IInsuranceJobRepositpry:IRepository<long, InsuranceJob>
OperationResult EditInsuranceJob(EditInsuranceJob command);
Task<List<InsuranceJobSelectListViewModel>> GetSelectList();
}

View File

@@ -51,6 +51,14 @@ public interface IInsuranceListRepository:IRepository<long, InsuranceList>
List<EmployeeInsurancListDataViewModel> GetEmployeeInsuranceDataAmonthAgo(DateTime currentMonthStartDate, long workshopId);
#endregion
/// <summary>
/// دریافت اطلاعات بیمه کارکنان برای استفاده در فیش حقوقی
/// </summary>
/// <param name="startDate"></param>
/// <param name="workshopId"></param>
/// <returns></returns>
List<EmployeeInsurancListDataViewModel> EmployeeInsuranceDataBy(DateTime startDate, long workshopId);
/// <summary>
/// بدست آوردن اطلاعات محاسباتی ماه پرسنل برای ویرایش
/// </summary>

View File

@@ -0,0 +1,15 @@
using _0_Framework.Domain;
using System.Collections.Generic;
using System.Threading.Tasks;
using CompanyManagment.App.Contracts.Law;
namespace Company.Domain.LawAgg
{
public interface ILawRepository : IRepository<long, Law>
{
Task<Law> GetWithItems(long id);
Task<List<Law>> GetActive();
Task<LawViewModel> GetByType(LawType type);
Task<List<LawViewModel>> GetList(LawSearchModel searchModel);
}
}

View File

@@ -0,0 +1,116 @@
using System;
using System.Collections.Generic;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.Law;
using System.Text.Json;
using System.ComponentModel.DataAnnotations.Schema;
namespace Company.Domain.LawAgg
{
public class Law : EntityBase
{
private Law(){}
public string Title { get; private set; }
public bool IsActive { get; private set; }
public List<LawItem> Items { get; private set; }
public LawType Type { get; private set; }
public string HeadTitle { get; private set; }
public string NotificationsJson { get; private set; }
public int Version { get; private set; }
[NotMapped]
public List<string> Notifications
{
get => string.IsNullOrEmpty(NotificationsJson)
? new List<string>()
: JsonSerializer.Deserialize<List<string>>(NotificationsJson);
set => NotificationsJson = JsonSerializer.Serialize(value);
}
public Law(string title, LawType lawType, List<string> notifications, string headTitle, int version = 1)
{
Title = title;
IsActive = true; // آخرین نسخه فعال است
Items = new List<LawItem>();
Type = lawType;
Notifications = notifications ?? new List<string>();
HeadTitle = headTitle;
Version = version;
}
public void Edit(string title)
{
Title = title;
}
public void AddItem(string header, string details, int orderNumber)
{
Items.Add(new LawItem(header, details, orderNumber));
}
public void SetItem(List<LawItem> items)
{
Items = items ?? new List<LawItem>();
}
public void RemoveItem(int orderNumber)
{
var item = Items.Find(x => x.OrderNumber == orderNumber);
if (item != null)
Items.Remove(item);
}
public void Activate()
{
IsActive = true;
}
public void Deactivate()
{
IsActive = false;
}
public void SetAsLatestVersion()
{
IsActive = true;
}
public void SetAsOldVersion()
{
IsActive = false;
}
public Law CreateNewVersion(string title, List<string> notifications, string headTitle, List<LawItem> items)
{
var newVersion = new Law(
title,
this.Type,
notifications,
headTitle,
this.Version + 1
);
newVersion.SetItem(items);
newVersion.SetAsLatestVersion();
return newVersion;
}
}
public class LawItem
{
public long Id { get; set; }
public string Header { get; private set; }
public string Details { get; private set; }
public int OrderNumber { get; private set; }
public long LawId { get; set; }
protected LawItem() { }
public LawItem(string header, string details, int orderNumber)
{
Header = header;
Details = details;
OrderNumber = orderNumber;
}
}
}

View File

@@ -18,13 +18,15 @@ public class PaymentTransaction:EntityBase
/// <param name="callBackUrl"></param>
public PaymentTransaction(long contractingPartyId,
double amount,
string contractingPartyName,string callBackUrl)
string contractingPartyName,string callBackUrl,
PaymentTransactionGateWay gateway)
{
ContractingPartyId = contractingPartyId;
Status = PaymentTransactionStatus.Pending;
Amount = amount;
ContractingPartyName = contractingPartyName;
CallBackUrl = callBackUrl;
Gateway = gateway;
}
/// <summary>
@@ -68,13 +70,20 @@ public class PaymentTransaction:EntityBase
public string TransactionId { get; private set; }
public string CallBackUrl { get; private set; }
public PaymentTransactionGateWay Gateway { get; private set; }
public string Rrn { get; private set; }
public string DigitalReceipt { get; private set; }
public void SetPaid(string cardNumber,string bankName)
public void SetPaid(string cardNumber,string bankName,string rrn,string digitalReceipt)
{
Status = PaymentTransactionStatus.Success;
TransactionDate = DateTime.Now;
CardNumber = cardNumber;
BankName = bankName;
Rrn = rrn;
DigitalReceipt = digitalReceipt;
}
public void SetFailed()
{
@@ -85,4 +94,5 @@ public class PaymentTransaction:EntityBase
{
TransactionId = transactionId;
}
}
}

View File

@@ -11,21 +11,23 @@ namespace Company.Domain.ReportAgg
{
Task<AllReport> GetAllActiveWorkshopsNew(string year, string month);
AllReport GetAllActiveWorkshops(string year, string month);
WorkshopResult GetWorkshopContractDone(string year, string month, long accountId, List<long> workshopList);
WorkshopResult GetWorkshopContractSignDone(string year, string month, long accountId, List<long> workshopList);
WorkshopResult GetWorkshopCheckoutDone(string year, string month, long accountId, List<long> workshopList);
WorkshopResult GetWorkshopCheckoutSignDone(string year, string month, long accountId, List<long> workshopList);
List<EmployeeNotDone> GetEmployeeContract(string year, string month, long workshopId);
List<EmployeeNotDone> GetEmployeeContractSign(string year, string month, long workshopId);
List<EmployeeNotDone> GetEmployeeCheckout(string year, string month, long workshopId);
List<EmployeeNotDone> GetEmployeeCheckoutSign(string year, string month, long workshopId);
PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId,
Task<WorkshopResult> GetWorkshopContractDone(string year, string month, long accountId, List<long> workshopList);
Task<WorkshopResult> GetWorkshopContractSignDone(string year, string month, long accountId,
List<long> workshopList);
PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId,
Task<WorkshopResult> GetWorkshopCheckoutDone(string year, string month, long accountId, List<long> workshopList);
Task<WorkshopResult> GetWorkshopCheckoutSignDone(string year, string month, long accountId,
List<long> workshopList);
PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId,
Task<List<EmployeeNotDone>> GetEmployeeContract(string year, string month, long workshopId);
Task<List<EmployeeNotDone>> GetEmployeeContractSign(string year, string month, long workshopId);
Task<List<EmployeeNotDone>> GetEmployeeCheckout(string year, string month, long workshopId);
Task<List<EmployeeNotDone>> GetEmployeeCheckoutSign(string year, string month, long workshopId);
Task<PrintAllContractCheckout> GetPrintAllContractDone(string year, string month, long accountId,
List<long> workshopList);
PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId,
Task<PrintAllContractCheckout> GetPrintAllContractSignDone(string year, string month, long accountId,
List<long> workshopList);
Task<PrintAllContractCheckout> GetPrintAllCheckoutDone(string year, string month, long accountId,
List<long> workshopList);
Task<PrintAllContractCheckout> GetPrintAllCheckoutSignDone(string year, string month, long accountId,
List<long> workshopList);

View File

@@ -26,5 +26,6 @@ namespace Company.Domain.RollCallEmployeeStatusAgg
List<RollCallEmployeeStatusViewModel> GetActiveByWorkshopIdInDate(long workshopId, DateTime startDateGr, DateTime endDateGr);
List<RollCallEmployeeStatusViewModel> GetByWorkshopIdInDates(long workshopId, DateTime start, DateTime end);
bool IsActiveInPeriod(long employeeId, long workshopId, DateTime startDate, DateTime endDate);
}
void RemoveRange(IEnumerable<RollCallEmployeeStatus> rollCallEmployeeStatusList);
}
}

View File

@@ -5,7 +5,8 @@ namespace Company.Domain.SmsResultAgg;
public class SmsResult: EntityBase
{
public SmsResult(int messageId, string status,string typeOfSms, string contractingPartyName,string mobile, long contractingPatyId, long institutionContractId)
public SmsResult(int messageId, string status,string typeOfSms,
string contractingPartyName,string mobile, long contractingPatyId, long institutionContractId)
{
MessageId = messageId;
Status = status;

View File

@@ -21,6 +21,8 @@ public class ContractingPartyTemp : EntityBase
IdNumberSerial = idNumberSerial;
Gender = gender;
DateOfBirth = dateOfBirth;
PublicId = Guid.NewGuid();
Status = ContractingPartyTempStatus.InComplete;
}
/// <summary>
@@ -91,10 +93,34 @@ public class ContractingPartyTemp : EntityBase
/// </summary>
public string Address { get; private set; }
public ContractingPartyTempStatus Status { get; set; }
public string VerifyCode { get; set; }
public DateTime VerifyCodeSentDateTime { get; set; }
public Guid PublicId { get; set; }
public void UpdateAddress(string state, string city, string address)
{
this.State = state;
this.City = city;
this.Address = address;
}
public void SetCompleted()
{
Status = ContractingPartyTempStatus.Completed;
}
public void SetVerifyCode(string verifyCode)
{
VerifyCode = verifyCode;
VerifyCodeSentDateTime = DateTime.Now;
}
}
public enum ContractingPartyTempStatus
{
InComplete,
Completed
}

View File

@@ -0,0 +1,7 @@
using _0_Framework.Domain;
namespace Company.Domain.TemporaryClientRegistrationAgg;
public interface IInstitutionContractContactInfoTempRepository : IRepository<long, InstitutionContractContactInfoTemp>
{
}

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using _0_Framework_b.Domain;
using CompanyManagment.App.Contracts.InstitutionContract;
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
namespace Company.Domain.TemporaryClientRegistrationAgg;
@@ -17,10 +18,5 @@ public interface IInstitutionContractTempRepository : IRepository<long, Institut
/// <returns></returns>
Task<InstitutionContractTempViewModel> GetInstitutionContractTemp(long id,long contractingPartyTempId);
/// <summary>
/// دریافت لیست طرف حساب هایی که ثبت نام آنها تکمیل شده
/// جهت نمایش در کارپوشه
/// </summary>
/// <returns></returns>
Task<List<RegistrationWorkflowMainList>> GetAllCompletedRegistration();
}

View File

@@ -0,0 +1,25 @@
using _0_Framework.Domain;
namespace Company.Domain.TemporaryClientRegistrationAgg;
public class InstitutionContractContactInfoTemp : EntityBase
{
public InstitutionContractContactInfoTemp(string phoneType, string position, string phoneNumber,
string fullName, long institutionContractTempId, bool sendSms)
{
PhoneType = phoneType;
Position = position;
PhoneNumber = phoneNumber;
FullName = fullName;
InstitutionContractTempId = institutionContractTempId;
SendSms = sendSms;
}
public string PhoneType { get; private set; }
public long InstitutionContractTempId { get; private set; }
public string Position { get; private set; }
public string PhoneNumber { get; private set; }
public string FullName { get; private set; }
public bool SendSms { get; private set; }
public InstitutionContractTemp InstitutionContractTemp { get; set; }
}

View File

@@ -1,13 +1,15 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using _0_Framework.Application.UID;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
namespace Company.Domain.TemporaryClientRegistrationAgg;
public class InstitutionContractTemp : EntityBase
{
public InstitutionContractTemp(long contractingPartyTempId, string paymentModel, string periodModel, double totalPayment, DateTime contractStartGr, DateTime contractEndGr, string officialCompany, double valueAddedTax, string verifyCode, string registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
public InstitutionContractTemp(long contractingPartyTempId, string paymentModel, string periodModel, double totalPayment, DateTime contractStartGr, DateTime contractEndGr, string officialCompany, double valueAddedTax, string verifyCode, InstitutionContractTempStatus registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
{
ContractingPartyTempId = contractingPartyTempId;
PaymentModel = paymentModel;
@@ -22,6 +24,7 @@ public class InstitutionContractTemp : EntityBase
MessageId = messageId;
SendVerifyCodeTime = sendVerifyCodeTime;
VerifyCodeEndTime = verifyCodeEndTime;
PublicId = Guid.NewGuid();
}
/// <summary>
@@ -87,7 +90,7 @@ public class InstitutionContractTemp : EntityBase
/// -
/// Completed ثبت نام تکمیل شده
/// </summary>
public string RegistrationStatus { get; private set; }
public InstitutionContractTempStatus RegistrationStatus { get; private set; }
/// <summary>
/// آی دی پیامک ارسال شده
@@ -104,8 +107,16 @@ public class InstitutionContractTemp : EntityBase
/// </summary>
public DateTime? VerifyCodeEndTime{ get; private set; }
/// <summary>
/// آیدی عمومی
/// برای نمایش در آدرس
/// </summary>
public Guid PublicId { get; set; }
public void Edit(long contractingPartyTempId, string paymentModel, string periodModel, double totalPayment, DateTime contractStartGr, DateTime contractEndGr, string officialCompany, double valueAddedTax, string verifyCode, string registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
public List<InstitutionContractContactInfoTemp> ContactInfoList { get; set; }
public void Edit(long contractingPartyTempId, string paymentModel, string periodModel, double totalPayment, DateTime contractStartGr, DateTime contractEndGr, string officialCompany, double valueAddedTax, string verifyCode, InstitutionContractTempStatus registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
{
ContractingPartyTempId = contractingPartyTempId;
PaymentModel = paymentModel;
@@ -122,7 +133,7 @@ public class InstitutionContractTemp : EntityBase
VerifyCodeEndTime = verifyCodeEndTime;
}
public void Update(string verifyCode, string registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
public void Update(string verifyCode, InstitutionContractTempStatus registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
{
VerifyCode = verifyCode;
RegistrationStatus = registrationStatus;
@@ -131,9 +142,10 @@ public class InstitutionContractTemp : EntityBase
VerifyCodeEndTime = verifyCodeEndTime;
}
public void ChangeRegistrationStatus(string registrationStatus)
public void ChangeRegistrationStatus(InstitutionContractTempStatus registrationStatus)
{
RegistrationStatus = registrationStatus;
}
}
}

View File

@@ -70,6 +70,7 @@ public interface IWorkshopRepository : IRepository<long, Workshop>
Task<List<WorkshopWithLeftWorkTempEmployeesDto>> GetWorkshopsForLeftWorkTemp(long accountId);
Task<int> GetWorkshopsForLeftWorkTempCount(long accountId);
Task<List<WorkshopSelectListViewModel>> GetSelectList(string search, long id);
int GetLastArchiveCode();
#endregion

View File

@@ -76,14 +76,13 @@ public class Workshop : EntityBase
ClientEmployeeWorkshopList = new List<ClientEmployeeWorkshop>();
}
public Workshop(string workshopName,string workshopSureName, string insuranceCode, string typeOfOwnership, string archiveCode, string agentName, string agentPhone,
string state, string city, string address, string typeOfInsuranceSend, string typeOfContract, string contractTerm,
string agreementNumber, bool fixedSalary, string population,long? insuranceJobId, string zoneName, bool addBonusesPay, bool addYearsPay, bool addLeavePay, bool totalPaymentHide,
bool isClassified, string computeOptions, string bonusesOptions, string yearsOptions, string hasRollCallFreeVip, bool workshopHolidayWorking,
bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance, bool createContract, bool signContract, bool createCheckout, bool signCheckout, IsActive cutContractEndOfYear, bool rotatingShiftCompute, bool isStaticCheckout)
bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance, bool createContract, bool signContract, bool createCheckout, bool signCheckout,
IsActive cutContractEndOfYear, bool rotatingShiftCompute, bool isStaticCheckout,long contractingPartyId)
{
WorkshopName = workshopName;
WorkshopSureName = workshopSureName;
@@ -134,6 +133,7 @@ public class Workshop : EntityBase
CutContractEndOfYear = cutContractEndOfYear;
RotatingShiftCompute = rotatingShiftCompute;
IsStaticCheckout = isStaticCheckout;
ContractingPartyId = contractingPartyId;
}
@@ -233,6 +233,8 @@ public class Workshop : EntityBase
/// </summary>
public bool IsStaticCheckout { get; private set; }
public long ContractingPartyId { get; private set; }
public Workshop()
{
RollCallServicesList = new List<RollCallService>();
@@ -344,4 +346,10 @@ public class Workshop : EntityBase
this.IsActiveString = "false";
ArchiveCode = "b-" + archiveCode;
}
}
public enum WorkshopRegistrationStatus
{
NotRegistered = 0,
Registered = 1
}

View File

@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.Security.AccessControl;
using _0_Framework.Application;
using _0_Framework.Domain;
using Company.Domain.ContarctingPartyAgg;
using Company.Domain.ContractAgg;
@@ -66,6 +68,11 @@ public class Employer : EntityBase
public string SanaPassword { get; private set; }
public string EmployerNo { get; set; }
public bool IsAuth { get; set; }
public string IdNumberSerial { get; set; }
public string IdNumberSeri { get; set; }
public PersonalContractingParty ContractingParty { get; set; }
//public List<Workshop> Workshops { get; private set; }
@@ -227,4 +234,35 @@ public class Employer : EntityBase
this.IsActive = false;
this.Address = "false";
}
public void Authentication(string fName, string lName, string fatherName,string idNumber,
string idNumberSeri, string idNumberSerial, string dateOfBirth, Gender gender,string phone)
{
this.FName = fName;
this.LName = lName;
this.FatherName = fatherName;
this.IdNumberSeri = idNumberSeri;
this.IdNumberSerial = idNumberSerial;
this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : new();
this.IdNumber = idNumber;
this.Gender = gender == _0_Framework.Application.Gender.Male? "مرد" : "زن";
this.IsAuth = true;
Phone = phone;
}
public void LegalAuthentication(string fName, string lName, string fatherName,string idNumber, string idNumberSeri,
string idNumberSerial, string dateOfBirth, Gender gender,string phone)
{
FName = fName;
EmployerLName = lName;
this.FatherName = fatherName;
this.IdNumberSeri = idNumberSeri;
this.IdNumberSerial = idNumberSerial;
this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : new();
this.IdNumber = idNumber;
this.Gender =gender == _0_Framework.Application.Gender.Male? "مرد" : "زن";
this.IsAuth = true;
Phone = phone;
}
}

View File

@@ -1,9 +1,11 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.Application.Enums;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.Checkout;
using CompanyManagment.App.Contracts.Employer;
using Microsoft.AspNetCore.Mvc;
namespace Company.Domain.empolyerAgg;
@@ -34,7 +36,7 @@ public interface IEmployerRepository : IRepository<long, Employer>
List<EmployerViewModel> GetEmployersHasWorkshop();
Task<List<EmployerSelectListViewModel>> GetSelectList(string search,long id);
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id, LegalType? legalType);
#endregion
@@ -68,5 +70,5 @@ public interface IEmployerRepository : IRepository<long, Employer>
#endregion
Task<ActionResult<EditEmployerWorkflowRegistration>> GetWorkflowRegistrationForEdit(long employerId, long institutionWorkshopDetailsId);
}

View File

@@ -12,9 +12,7 @@ public class CaseHistoryRollCallExcelForEmployeeViewModel
public string EmployeeFullName { get; set; }
public string TotalWorkingHoursFa { get; set; }
public string TotalWorkingTimeSpan { get; set; }
public List<RollCallItemForEmployeeExcelViewModel> RollCalls { get; set; }
}
@@ -40,7 +38,8 @@ public class RollCallItemForEmployeeExcelViewModel
public bool HasLeave { get; set; }
public string TotalWorkingHours { get; set; }
public string EnterTimeDifferences { get; set; }
public string ExitTimeDifferences { get; set; }
}
public class RollCallTimeExcelViewModel

View File

@@ -113,11 +113,12 @@ public class RollCallExcelGenerator : ExcelGenerator
worksheet.Cells[i + row + 1, 1].Value = i + 1;
worksheet.Cells[i + row + 1, 2].Value = rollCall.DayOfWeekFa;
worksheet.Cells[i + row + 1, 3].Value = rollCall.DateFa;
worksheet.Cells[i + row + 1, 4].Value = "-";
worksheet.Cells[i + row + 1, 4].Value = rollCall.EnterTimeDifferences;
worksheet.Cells[i + row + 1, 5].Value = rollCall.StartsItems;
worksheet.Cells[i + row + 1, 6].Value = rollCall.EndsItems;
worksheet.Cells[i + row + 1, 7].Value = "-";
worksheet.Cells[i + row + 1, 8].Value = rollCall.TotalWorkingHours == string.Empty ? "ندارد" : rollCall.TotalWorkingHours;
worksheet.Cells[i + row + 1, 7].Value = rollCall.ExitTimeDifferences;
worksheet.Cells[i + row + 1, 8].Value = rollCall.TotalWorkingHours == string.Empty
? "ندارد" : rollCall.TotalWorkingHours;
// Style data cells
for (int j = 1; j <= 8; j++)
@@ -307,6 +308,49 @@ public class RollCallExcelGenerator : ExcelGenerator
return package.GetAsByteArray();
}
private string CalculateExitMinuteDifference(TimeSpan early, TimeSpan late)
{
if (early == TimeSpan.Zero && late == TimeSpan.Zero)
{
return "-";
}
else if (late != TimeSpan.Zero)
{
var minutes = late.TotalMinutes > 999 ? "999" : late.TotalMinutes.ToString();
return $"{minutes}+";
}
else if (early != TimeSpan.Zero)
{
var minutes = early.TotalMinutes > 999 ? "999" : early.TotalMinutes.ToString();
return $"{minutes}-";
}
else
{
return $"";
}
}
private string CalculateEntryMinuteDifference(TimeSpan early, TimeSpan late)
{
if (early == TimeSpan.Zero && late == TimeSpan.Zero)
{
return "-";
}
else if (late != TimeSpan.Zero)
{
var minutes = late.TotalMinutes > 999 ? "999" : late.TotalMinutes.ToString();
return $"{minutes}-";
}
else if (early != TimeSpan.Zero)
{
var minutes = early.TotalMinutes > 999 ? "999" : early.TotalMinutes.ToString();
return $"{minutes}+";
}
else
{
return $"";
}
}
}

View File

@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Company.Domain\Company.Domain.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="3.5.0" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,60 @@
using Company.Domain.EmployeeFaceEmbeddingAgg;
using MongoDB.Driver;
namespace CompanyManagement.Infrastructure.Mongo.EmployeeFaceEmbeddingRepo;
public class EmployeeFaceEmbeddingRepository : IEmployeeFaceEmbeddingRepository
{
private readonly IMongoCollection<EmployeeFaceEmbedding> _employeeFaceEmbeddings;
public EmployeeFaceEmbeddingRepository(IMongoDatabase database)
{
_employeeFaceEmbeddings = database.GetCollection<EmployeeFaceEmbedding>("EmployeeFaces");
}
public async Task CreateAsync(EmployeeFaceEmbedding employeeFaceEmbedding)
{
await _employeeFaceEmbeddings.InsertOneAsync(employeeFaceEmbedding);
}
public async Task UpdateAsync(EmployeeFaceEmbedding employeeFaceEmbedding)
{
await _employeeFaceEmbeddings.ReplaceOneAsync(
x => x.Id == employeeFaceEmbedding.Id,
employeeFaceEmbedding);
}
public async Task<EmployeeFaceEmbedding> GetByIdAsync(string id)
{
return await _employeeFaceEmbeddings
.Find(x => x.Id == id)
.FirstOrDefaultAsync();
}
public async Task<EmployeeFaceEmbedding> GetByEmployeeIdAsync(long employeeId)
{
return await _employeeFaceEmbeddings
.Find(x => x.EmployeeId == employeeId)
.FirstOrDefaultAsync();
}
public async Task<List<EmployeeFaceEmbedding>> GetByWorkshopIdAsync(long workshopId)
{
return await _employeeFaceEmbeddings
.Find(x => x.WorkshopId == workshopId)
.ToListAsync();
}
public async Task<List<EmployeeFaceEmbedding>> GetByWorkshopIdsAsync(List<long> workshopIds)
{
return await _employeeFaceEmbeddings
.Find(x => workshopIds.First()==x.WorkshopId)
.ToListAsync();
}
public async Task DeleteAsync(string id)
{
await _employeeFaceEmbeddings.DeleteOneAsync(x => x.Id == id);
}
}

View File

@@ -0,0 +1,32 @@
using Company.Domain.InstitutionContractExtensionTempAgg;
using MongoDB.Driver;
namespace CompanyManagement.Infrastructure.Mongo.InstitutionContractInsertTempRepo;
public class InstitutionContractExtenstionTempRepository:IInstitutionContractExtenstionTempRepository
{
private readonly IMongoCollection<InstitutionContractExtensionTemp> _institutionExtenstionTemp;
public InstitutionContractExtenstionTempRepository(IMongoDatabase database)
{
_institutionExtenstionTemp = database.GetCollection<InstitutionContractExtensionTemp>("InstitutionContractExtenstionTemp");
}
public async Task Create(InstitutionContractExtensionTemp institutionContract)
{
await _institutionExtenstionTemp.InsertOneAsync(institutionContract);
}
public async Task<InstitutionContractExtensionTemp> GetPreviousExtenstionData(long contractingPartyId)
{
var entity = await _institutionExtenstionTemp
.Find(x => x.PreviousId == contractingPartyId)
.FirstOrDefaultAsync();
return entity;
}
public async Task Remove(Guid id)
{
await _institutionExtenstionTemp.DeleteOneAsync(x=>x.Id == id);
}
}

View File

@@ -0,0 +1,8 @@
namespace CompanyManagment.App.Contracts.AndroidApkVersion;
public enum ApkType
{
WebView,
FaceDetection
}

View File

@@ -4,12 +4,15 @@ using Microsoft.AspNetCore.Http;
namespace CompanyManagment.App.Contracts.AndroidApkVersion;
public record AndroidApkVersionInfo(int LatestVersionCode, string LatestVersionName, bool ShouldUpdate, bool IsForceUpdate, string DownloadUrl, string ReleaseNotes);
public interface IAndroidApkVersionApplication
{
Task<OperationResult> CreateAndActive(IFormFile file);
Task<OperationResult> CreateAndDeActive(IFormFile file);
Task<string> GetLatestActiveVersionPath();
Task<OperationResult> CreateAndActive(IFormFile file, ApkType apkType, string versionName, string versionCode, bool isForce = false);
Task<OperationResult> CreateAndDeActive(IFormFile file, ApkType apkType, string versionName, string versionCode, bool isForce = false);
Task<string> GetLatestActiveVersionPath(ApkType apkType);
Task<AndroidApkVersionInfo> GetLatestActiveInfo(ApkType apkType, int currentVersionCode);
OperationResult Remove(long id);
bool HasAndroidApkToDownload();
bool HasAndroidApkToDownload(ApkType apkType);
}

View File

@@ -0,0 +1,12 @@
namespace Company.Application.Contracts.AuthorizedBankDetails
{
public class AuthorizedBankDetailsSearchModel
{
public string CardNumber { get; set; }
public string AccountNumber { get; set; }
public string IBan { get; set; }
public string BankName { get; set; }
public string NationalIdentifier { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System;
using System.Collections.Generic;
namespace Company.Application.Contracts.AuthorizedBankDetails;
public class AuthorizedBankDetailsViewModel
{
public string NationalIdentifier { get; set; }
public long Id { get; set; }
public string CustomerType { get; set; }
public string CardNumber { get; set; }
public string AccountNumber { get; set; }
public string IBan { get; set; }
public string BankName { get; set; }
public List<AuthorizedBankDetailsOwnerViewModel> Owners { get; set; }
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Company.Application.Contracts.AuthorizedBankDetails
{
public class CreateAuthorizedBankDetails
{
public string CardNumber { get; set; }
public string AccountNumber { get; set; }
public string IBan { get; set; }
public string BankName { get; set; }
public List<CreateAuthorizedBankDetailsOwner> OwnersList { get; set; }
}
public class CreateAuthorizedBankDetailsOwner
{
public string FName { get; set; }
public string LName { get; set; }
public string NationalIdentifier { get; set; }
public string CustomerType { get; set; }
}
}

View File

@@ -0,0 +1,28 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Company.Application.Contracts.AuthorizedBankDetails
{
public class EditAuthorizedBankDetails
{
public long Id { get; set; }
public string CardNumber { get; set; }
public string AccountNumber { get; set; }
public string IBan { get; set; }
public string BankName { get; set; }
public List<AuthorizedBankDetailsOwnerViewModel> OwnersList { get; set; }
}
public class AuthorizedBankDetailsOwnerViewModel
{
public string FName { get; set; }
public string LName { get; set; }
public string NationalIdentifier { get; set; }
public string CustomerType { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using System.Collections.Generic;
using _0_Framework.Application;
using Company.Application.Contracts.AuthorizedBankDetails;
namespace Company.Application.Contracts.AuthorizedBankDetails
{
public interface IAuthorizedBankDetailsApplication
{
OperationResult Create(CreateAuthorizedBankDetails command);
EditAuthorizedBankDetails GetDetails(long id);
List<AuthorizedBankDetailsViewModel> Search(AuthorizedBankDetailsSearchModel searchModel);
AuthorizedBankDetailsViewModel GetByIban(string iban);
}
}

View File

@@ -0,0 +1,19 @@
namespace CompanyManagment.App.Contracts.AuthorizedPerson;
public class AuthorizedPersonViewModel
{
public long Id { get; set; }
public string NationalCode { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string FatherName { get; set; }
public string BirthDate { get; set; }
public string Gender { get; set; }
public string DeathStatus { get; set; }
public string ShenasnameSeri { get; set; }
public string ShenasnameSerial { get; set; }
public string ShenasnamehNumber { get; set; }
public bool IsVerified { get; set; }
public string VerificationDate { get; set; }
public string CreationDate { get; set; }
}

View File

@@ -0,0 +1,15 @@
namespace CompanyManagment.App.Contracts.AuthorizedPerson;
public class CreateAuthorizedPerson
{
public string NationalCode { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string FatherName { get; set; }
public string BirthDate { get; set; }
public string Gender { get; set; }
public string DeathStatus { get; set; }
public string ShenasnameSeri { get; set; }
public string ShenasnameSerial { get; set; }
public string ShenasnamehNumber { get; set; }
}

View File

@@ -0,0 +1,13 @@
using System.Collections.Generic;
using _0_Framework.Application;
namespace CompanyManagment.App.Contracts.AuthorizedPerson;
public interface IAuthorizedPersonApplication
{
OperationResult Create(CreateAuthorizedPerson command);
OperationResult CreateFromUidResponse(CreateAuthorizedPerson command);
AuthorizedPersonViewModel GetByNationalCode(string nationalCode);
List<AuthorizedPersonViewModel> Search(string nationalCode = null, string firstName = null, string lastName = null);
bool ExistsByNationalCode(string nationalCode);
}

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using _0_Framework.Application.Enums;
using CompanyManagment.App.Contracts.Employer;
using CompanyManagment.App.Contracts.Loan;
using CompanyManagment.App.Contracts.RollCall;
@@ -133,6 +134,15 @@ public class CheckoutViewModel
/// </summary>
public string TotalPaidLeave { get; set; }
/// <summary>
/// آیا فیش نیاز به بروزرسانی دارد
/// </summary>
public bool IsUpdateNeeded { get; set; }
/// <summary>
/// لیست پیام های هشدار فیش حقوقی
/// </summary>
public List<CheckoutWarningMessageModel> CheckoutWarningMessageList { get; set; }
public bool HasSignCheckout { get; set; }

View File

@@ -0,0 +1,25 @@
using _0_Framework.Application.Enums;
namespace CompanyManagment.App.Contracts.Checkout;
/// <summary>
/// مدل هشدار فیش حقوقی
/// </summary>
public class CheckoutWarningMessageModel
{
/// <summary>
/// پیام هشدار
/// </summary>
public string WarningMessage { get; set; }
/// <summary>
/// آی دی فیش حقوقی
/// </summary>
public long CheckoutId { get; set; }
/// <summary>
/// نوع هشدار فیش حقوقی
/// </summary>
public TypeOfCheckoutWarning TypeOfCheckoutWarning { get; set; }
}

View File

@@ -1,8 +1,10 @@
using System.Collections.Generic;
using System.Security.AccessControl;
using System.Security.Cryptography;
using System.Threading.Tasks;
using System.Transactions;
using _0_Framework.Application;
using _0_Framework.Application.UID;
using CompanyManagment.App.Contracts.OriginalTitle;
namespace CompanyManagment.App.Contracts.ContractingPartyBankAccounts;
@@ -74,5 +76,27 @@ public interface IContractingPartyBankAccountsApplication
/// <param name="selected">نام سلکت شده</param>
/// <returns></returns>
Task<List<string>> ContractingPartyNamesSelectList(string search, string selected);
/// <summary>
/// احراز هویت اطلاعات بانکی طرف حساب
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
Task<ContractingPartyBankInquiryResponse> InquiryContractingPartyBankDetails(InquiryContractingPartyBankDetailsRequest command);
}
public class InquiryContractingPartyBankDetailsRequest
{
public string CardNumber { get; set; }
public string AccountNumber { get; set; }
public string IBan { get; set; }
public UidBanks? UidBank { get; set; }
}
public class ContractingPartyBankInquiryResponse
{
public string FullName { get; set; }
public string Iban { get; set; }
public string AccountNumber { get; set; }
public string CardNumber { get; set; }
}

View File

@@ -25,4 +25,5 @@ public class CustomizeWorkshopEmployeeSettingsViewModel
public int LeavePermittedDays { get; set; }
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShiftsViewModels { get; set; }
public List<DayOfWeek> WeeklyOffDays { get; set; }
public bool HasLeft { get; set; }
}

View File

@@ -0,0 +1,14 @@
using System.Collections.Generic;
namespace CompanyManagment.App.Contracts.EmployeeFaceEmbedding;
public class EmployeeFaceEmbeddingDto
{
public string Id { get; set; }
public string EmployeeFullName { get; set; }
public long EmployeeId { get; set; }
public long WorkshopId { get; set; }
public List<double> Embeddings { get; set; }
public EmployeeFaceEmbeddingMetadataDto Metadata { get; set; }
}

View File

@@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
namespace CompanyManagment.App.Contracts.EmployeeFaceEmbedding;
public class EmployeeFaceEmbeddingMetadataDto
{
public double AvgEyeDistanceNormalized { get; set; }
public double AvgEyeToFaceRatio { get; set; }
public double AvgFaceAspectRatio { get; set; }
public double AvgDetectionConfidence { get; set; }
public EmployeeFaceEmbeddingKeypointsDto AvgKeypointsNormalized { get; set; }
public List<ImageMetadataDto> PerImageMetadata { get; set; }
}
public class EmployeeFaceEmbeddingKeypointsDto
{
public double[] LeftEye { get; set; }
public double[] RightEye { get; set; }
public double[] Nose { get; set; }
public double[] MouthLeft { get; set; }
public double[] MouthRight { get; set; }
}
public class ImageMetadataDto
{
public double FaceAspectRatio { get; set; }
public double EyeDistanceNormalized { get; set; }
public double EyeToFaceRatio { get; set; }
public double DetectionConfidence { get; set; }
public EmployeeFaceEmbeddingKeypointsDto KeypointsNormalized { get; set; }
}
public class EmbeddingHistoryItemDto
{
public List<double> Embedding { get; set; }
public DateTime Timestamp { get; set; }
public double Confidence { get; set; }
public double RefinementPercentage { get; set; }
}
public class MetadataHistoryItemDto
{
public EmployeeFaceEmbeddingMetadataDto Metadata { get; set; }
public DateTime Timestamp { get; set; }
public double Confidence { get; set; }
public double RefinementPercentage { get; set; }
}

View File

@@ -0,0 +1,43 @@
using System.Collections.Generic;
using System.Threading.Tasks;
namespace CompanyManagment.App.Contracts.EmployeeFaceEmbedding;
/// <summary>
/// سرویس مدیریت Embedding چهره کارکنان
/// این سرویس فقط برای دریافت و ارسال داده است و هیچ command-driven نیست
/// </summary>
public interface IEmployeeFaceEmbeddingApplication
{
/// <summary>
/// دریافت embedding بر اساس شناسه
/// </summary>
Task<EmployeeFaceEmbeddingDto> GetByIdAsync(string id);
/// <summary>
/// دریافت embedding بر اساس شناسه کارمند
/// </summary>
Task<EmployeeFaceEmbeddingDto> GetByEmployeeIdAsync(long employeeId);
/// <summary>
/// دریافت لیست embeddings بر اساس شناسه کارگاه
/// </summary>
Task<List<EmployeeFaceEmbeddingDto>> GetByWorkshopIdAsync(long workshopId);
/// <summary>
/// دریافت لیست embeddings بر اساس لیست شناسه کارگاه‌ها
/// </summary>
Task<List<EmployeeFaceEmbeddingDto>> GetByWorkshopIdsAsync(List<long> workshopIds);
/// <summary>
/// ذخیره یا به‌روزرسانی embedding
/// اگر Id وجود داشته باشد، به‌روزرسانی می‌شود، در غیر این صورت ایجاد می‌شود
/// </summary>
Task<string> SaveAsync(EmployeeFaceEmbeddingDto dto);
/// <summary>
/// حذف embedding
/// </summary>
Task DeleteAsync(string id);
}

View File

@@ -1,8 +1,12 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Transactions;
using _0_Framework.Application;
using _0_Framework.Application.Enums;
using CompanyManagment.App.Contracts.Checkout;
using CompanyManagment.App.Contracts.Employee;
using Microsoft.AspNetCore.Mvc;
namespace CompanyManagment.App.Contracts.Employer;
@@ -43,8 +47,9 @@ public interface IEmployerApplication
/// </summary>
/// <param name="search"></param>
/// <param name="id"></param>
/// <param name="legalType"></param>
/// <returns></returns>
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id);
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id, LegalType? legalType = null);
#endregion
#region NewByHeydari
@@ -125,4 +130,293 @@ public interface IEmployerApplication
#endregion
}
Task<OperationResult> CreateWorkflowRegistration(CreateEmployerWorkflowRegistration command);
/// <summary>
/// ویرایش کارفرما در گردش کار ثبت نام
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
Task<OperationResult> EditWorkflowRegistration(EditEmployerWorkflowRegistration command);
/// <summary>
/// حذف کارفرما از گردش کار ثبت نام
/// </summary>
/// <param name="employerId">شناسه کارفرما</param>
/// <param name="institutionWorkshopDetailsId">شناسه جزئیات کارگاه موسسه</param>
/// <returns></returns>
Task<OperationResult> DeleteWorkflowRegistration(long employerId, long institutionWorkshopDetailsId);
Task<OperationResult<AuthenticateUserViewModel>> AuthenticateEmployer(string nationalCode, string dateOfBirth, string mobile);
Task<ActionResult<EditEmployerWorkflowRegistration>> GetWorkflowRegistrationForEdit(long employerId, long institutionWorkshopDetailsId);
}
public class AuthenticateUserViewModel
{
/// <summary>
/// نام
/// </summary>
public string FName { get; set; }
/// <summary>
/// نام خانوادگی
/// </summary>
public string LName { get; set; }
/// <summary>
/// نام پدر
/// </summary>
public string FatherName { get; set; }
/// <summary>
/// جنسیت
/// </summary>
public Gender Gender { get; set; }
/// <summary>
/// کد ملی
/// </summary>
public string NationalCode { get; set; }
public string DateOfBirth { get; set; }
/// <summary>
/// سری شناسنامه
/// </summary>
public string IdNumberSeri { get; set; }
/// <summary>
/// سریال شناسنامه
/// </summary>
public string IdNumberSerial { get; set; }
/// <summary>
/// شماره شناسنامه
/// </summary>
public string IdNumber { get; set; }
/// <summary>
/// شماره همراه
/// </summary>
public string Phone { get; set; }
}
/// <summary>
/// کلاس ثبت کارفرما در گردش کار - شامل اطلاعات کارفرمای حقیقی و حقوقی
/// </summary>
public class CreateEmployerWorkflowRegistration
{
/// <summary>
/// درزمانی که یوزر کارفرمایی رو انتخاب کرد که از قبل ثبت شده است
/// این فیلد باید مقدار داشته باشد
/// </summary>
public long EmployerId { get; set; }
/// <summary>
/// اطلاعات کارفرمای حقیقی
/// </summary>
public CreateRealEmployerWorkflowRegistration RealEmployer { get; set; }
/// <summary>
/// اطلاعات کارفرمای حقوقی
/// </summary>
public CreateLegalEmployerWorkflowRegistration LegalEmployer { get; set; }
/// <summary>
/// نوع حقوقی
/// </summary>
public LegalType LegalType { get; set; }
/// <summary>
/// شناسه جزئیات کارگاه موسسه
/// </summary>
public long InstitutionWorkshopInitialId { get; set; }
/// <summary>
/// شناسه قرارداد موسسه
/// </summary>
public long InstitutionContractId { get; set; }
/// <summary>
/// شناسه طرف قرارداد
/// </summary>
public long ContractingPartyId { get; set; }
}
/// <summary>
/// کلاس ثبت کارفرمای حقوقی در گردش کار - شامل اطلاعات شرکت و مدیرعامل
/// </summary>
public class CreateLegalEmployerWorkflowRegistration
{
/// <summary>
/// نام شرکت
/// </summary>
public string CompanyName { get; set; }
/// <summary>
/// شماره ثبت
/// </summary>
public string RegisterId { get; set; }
/// <summary>
/// شناسه ملی شرکت
/// </summary>
public string NationalId { get; set; }
/// <summary>
/// جنسیت
/// </summary>
public Gender Gender { get; set; }
/// <summary>
/// وضعیت احراز هویت
/// </summary>
public bool IsAuth { get; set; }
/// <summary>
/// کد ملی مدیرعامل
/// </summary>
public string CeoNationalCode { get; set; }
/// <summary>
/// شماره شناسنامه مدیرعامل
/// </summary>
public string CeoIdNumber { get; set; }
/// <summary>
/// نام مدیرعامل
/// </summary>
public string CeoFName { get; set; }
/// <summary>
/// نام خانوادگی مدیرعامل
/// </summary>
public string CeoLName { get; set; }
/// <summary>
/// نام پدر مدیرعامل
/// </summary>
public string CeoFatherName { get; set; }
/// <summary>
/// تاریخ تولد مدیرعامل
/// </summary>
public string CeoDateOfBirth { get; set; }
/// <summary>
/// محل صدور شناسنامه مدیرعامل
/// </summary>
public string CeoPlaceOfIssue { get; set; }
/// <summary>
/// تاریخ صدور شناسنامه مدیرعامل
/// </summary>
public string CeoDateOfIssue { get; set; }
/// <summary>
/// شماره موبایل
/// </summary>
public string PhoneNumber { get; set; }
/// <summary>
/// شماره تلفن ثابت
/// </summary>
public string TelephoneNumber { get; set; }
/// <summary>
/// اطلاعات سیستم دولتی
/// </summary>
public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
public string IdNumberSeri { get; set; }
public string IdNumberSerial { get; set; }
}
/// <summary>
/// کلاس ثبت کارفرمای حقیقی در گردش کار - شامل اطلاعات شخصی کارفرما
/// </summary>
public class CreateRealEmployerWorkflowRegistration
{
/// <summary>
/// جنسیت
/// </summary>
public Gender Gender { get; set; }
/// <summary>
/// وضعیت احراز هویت
/// </summary>
public bool IsAuth { get; set; }
/// <summary>
/// کد ملی
/// </summary>
public string NationalCode { get; set; }
/// <summary>
/// شماره شناسنامه
/// </summary>
public string IdNumber { get; set; }
/// <summary>
/// نام
/// </summary>
public string FName { get; set; }
/// <summary>
/// نام خانوادگی
/// </summary>
public string LName { get; set; }
/// <summary>
/// نام پدر
/// </summary>
public string FatherName { get; set; }
/// <summary>
/// تاریخ تولد
/// </summary>
public string DateOfBirth { get; set; }
/// <summary>
/// شماره موبایل
/// </summary>
public string PhoneNumber { get; set; }
/// <summary>
/// محل صدور شناسنامه
/// </summary>
public string PlaceOfIssue { get; set; }
/// <summary>
/// تاریخ صدور شناسنامه
/// </summary>
public string DateOfIssue { get; set; }
/// <summary>
/// اطلاعات سیستم دولتی
/// </summary>
public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
/// <summary>
/// شماره تلفن
/// </summary>
public string Telephone { get; set; }
public string IdNumberSeri { get; set; }
public string IdNumberSerial { get; set; }
}
/// <summary>
/// کلاس ویرایش کارفرما در گردش کار - شامل اطلاعات کارفرمای حقیقی و حقوقی
/// </summary>
public class EditEmployerWorkflowRegistration : CreateEmployerWorkflowRegistration
{
/// <summary>
/// شناسه کارفرما
/// </summary>
public long EmployerId { get; set; }
}

View File

@@ -8,6 +8,7 @@ namespace CompanyManagment.App.Contracts.InstitutionContract;
public class CreateInstitutionContract
{
public long LawId { get; set; }
public string ContractNo { get; set; }
[Required(ErrorMessage = "انتخاب معرف اجباری است")]

View File

@@ -1,29 +1,319 @@
using System.Collections.Generic;
using System.Security.AccessControl;
using _0_Framework.Application;
using _0_Framework.Application.Enums;
using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
using CompanyManagment.App.Contracts.Workshop;
namespace CompanyManagment.App.Contracts.InstitutionContract;
/// <summary>
/// درخواست ایجاد قرارداد نهاد
/// </summary>
public class CreateInstitutionContractRequest
{
public List<CreateContactInfo> ContactInfos { get; set; }
public long ContractingPartyId { get; set; }
/// <summary>
/// نوع حقوقی طرف قرارداد (حقیقی یا حقوقی)
/// </summary>
public LegalType ContractingPartyLegalType { get; set; }
/// <summary>
/// اطلاعات شخص حقیقی
/// </summary>
public CreateInstitutionContractRealPartyRequest RealParty { get; set; }
/// <summary>
/// اطلاعات شخص حقوقی
/// </summary>
public CreateInstitutionContractLegalPartyRequest LegalParty { get; set; }
/// <summary>
/// آیدی معرف
/// </summary>
public long RepresentativeId { get; set; }
public string TypeOfContract { get; set; }
public string ContractDateFa { get; set; }
public string ContractStartFa { get; set; }
public string ContractEndFa { get; set; }
public string Address { get; set; }
public string State { get; set; }
/// <summary>
/// مدت زمان قرارداد
/// </summary>
public InstitutionContractDuration Duration { get; set; }
/// <summary>
/// استان
/// </summary>
public string Province { get; set; }
/// <summary>
/// شهر
/// </summary>
public string City { get; set; }
public string OfficialCompany { get; set; }
public string HasValueAddedTax { get; set; }
public string ContractAmountString { get; set; }
public string DailyCompenseationString { get; set; }
public string ObligationString { get; set; }
public string TotalAmountString { get; set; }
public string ValueAddedTaxStr { get; set; }
public string WorkshopManualCount { get; set; }
public string EmployeeManualCount { get; set; }
/// <summary>
/// آدرس
/// </summary>
public string Address { get; set; }
/// <summary>
/// اطلاعات تماس
/// </summary>
public List<CreateContactInfo> ContactInfos { get; set; }
/// <summary>
/// لیست کارگاه‌های مورد نظر برای قرارداد
/// </summary>
public List<CreateInstitutionContractWorkshopDetail> Workshops { get; set; }
/// <summary>
/// تاریخ شروع قرارداد (فارسی)
/// </summary>
public string ContractStartFa { get; set; }
/// <summary>
/// مبلغ خسارت روزانه
/// </summary>
public double DailyCompensation { get; set; }
/// <summary>
/// وجه التزام
/// </summary>
public double Obligation { get; set; }
/// <summary>
/// توضیحات
/// </summary>
public string Description { get; set; }
public int ExtensionNo { get; set; }
/// <summary>
/// مبلغ کل قرارداد
/// </summary>
public double TotalAmount { get; set; }
/// <summary>
/// آیا قرارداد اقساطی است؟
/// </summary>
public bool IsInstallment { get; set; }
/// <summary>
/// مالیات ارزش افزوده
/// </summary>
public double TaxAmount { get; set; }
public double OneMonthAmount { get; set; }
public long LawId { get; set; }
}
/// <summary>
/// مدت زمان قرارداد نهاد
/// </summary>
public enum InstitutionContractDuration
{
/// <summary>
/// یک ماهه
/// </summary>
OneMonth = 1,
/// <summary>
/// سه ماهه
/// </summary>
ThreeMonths = 3,
/// <summary>
/// شش ماهه
/// </summary>
SixMonths = 6,
/// <summary>
/// دوازده ماهه
/// </summary>
TwelveMonths = 12
}
/// <summary>
/// جزئیات کارگاه در درخواست ایجاد قرارداد نهاد
/// </summary>
public class CreateInstitutionContractWorkshopDetail
{
/// <summary>
/// شناسه کارگاه (اختیاری - در صورت وجود کارگاه از قبل)
/// </summary>
public long? WorkshopId { get; set; }
/// <summary>
/// نام کارگاه
/// </summary>
public string WorkshopName { get; set; }
/// <summary>
/// پلن حضور و غیاب
/// </summary>
public bool HasRollCallPlan { get; set; }
/// <summary>
/// پلن فیش غیر رسمی
/// </summary>
public bool HasCustomizeCheckoutPlan { get; set; }
/// <summary>
/// پلن قرارداد و تصفیه
/// </summary>
public bool HasContractPlan { get; set; }
/// <summary>
/// پلن قرارداد و تصفیه حضوری
/// </summary>
public bool HasContractPlanInPerson { get; set; }
/// <summary>
/// پلن بیمه
/// </summary>
public bool HasInsurancePlan { get; set; }
/// <summary>
/// پلن بیمه حضوری
/// </summary>
public bool HasInsurancePlanInPerson { get; set; }
/// <summary>
/// تعداد پرسنل کارگاه
/// </summary>
public int PersonnelCount { get; set; }
/// <summary>
/// مبلغ
/// </summary>
public double Price { get; set; }
}
/// <summary>
/// درخواست ایجاد طرف حقیقی در قرارداد نهاد
/// </summary>
public class CreateInstitutionContractRealPartyRequest
{
/// <summary>
/// کد ملی
/// </summary>
public string NationalCode { get; set; }
/// <summary>
/// تاریخ تولد فارسی
/// </summary>
public string BirthDateFa { get; set; }
/// <summary>
/// شماره تلفن
/// </summary>
public string PhoneNumber { get; set; }
/// <summary>
/// وضعیت احراز هویت
/// </summary>
public bool IsAuth { get; set; }
/// <summary>
/// نام
/// </summary>
public string FName { get; set; }
/// <summary>
/// نام خانوادگی
/// </summary>
public string LName { get; set; }
/// <summary>
/// نام پدر
/// </summary>
public string FatherName { get; set; }
/// <summary>
/// شماره شناسنامه
/// </summary>
public string IdNumber { get; set; }
/// <summary>
/// شناسه موقت طرف قرارداد
/// </summary>
public long ContractingPartyTempId { get; set; }
/// <summary>
/// جنسیت
/// </summary>
public Gender Gender { get; set; }
}
/// <summary>
/// درخواست ایجاد طرف حقوقی در قرارداد نهاد
/// </summary>
public class CreateInstitutionContractLegalPartyRequest
{
/// <summary>
/// نام شرکت
/// </summary>
public string CompanyName { get; set; }
/// <summary>
/// شماره ثبت
/// </summary>
public string RegisterId { get; set; }
/// <summary>
/// شناسه ملی شرکت
/// </summary>
public string NationalId { get; set; }
/// <summary>
/// شماره تلفن شرکت
/// </summary>
public string PhoneNumber { get; set; }
/// <summary>
/// شناسه موقت طرف قرارداد
/// </summary>
public long ContractingPartyTempId { get; set; }
/// <summary>
/// کد ملی نماینده قانونی
/// </summary>
public string NationalCode { get; set; }
/// <summary>
/// تاریخ تولد نماینده قانونی فارسی
/// </summary>
public string BirthDateFa { get; set; }
/// <summary>
/// نام نماینده قانونی
/// </summary>
public string FName { get; set; }
/// <summary>
/// نام خانوادگی نماینده قانونی
/// </summary>
public string LName { get; set; }
/// <summary>
/// نام پدر نماینده قانونی
/// </summary>
public string FatherName { get; set; }
/// <summary>
/// شماره شناسنامه نماینده قانونی
/// </summary>
public string IdNumber { get; set; }
/// <summary>
/// وضعیت احراز هویت نماینده قانونی
/// </summary>
public bool IsAuth { get; set; }
/// <summary>
/// سمت نماینده قانونی در شرکت
/// </summary>
public string Position { get; set; }
/// <summary>
/// جنسیت نماینده قانونی
/// </summary>
public Gender Gender { get; set; }
}

View File

@@ -3,4 +3,5 @@ namespace CompanyManagment.App.Contracts.InstitutionContract;
public class EditInstitutionContractRequest:CreateInstitutionContractRequest
{
public long Id { get; set; }
public long ContractingPartyId { get; set; }
}

View File

@@ -0,0 +1,13 @@
namespace CompanyManagment.App.Contracts.InstitutionContract;
/// <summary>
/// درخواست تمدید قرارداد مؤسسه
/// شامل اطلاعات قرارداد قبلی برای فرآیند تمدید
/// </summary>
public class ExtenstionInstitutionContractRequest : EditInstitutionContractRequest
{
/// <summary>
/// شناسه قرارداد قبلی که قرار است تمدید شود
/// </summary>
public long PreviousContractId { get; set; }
}

View File

@@ -1,4 +1,7 @@
using System.Collections.Generic;
using System.Security.AccessControl;
using CompanyManagment.App.Contracts.Workshop;
using Microsoft.AspNetCore.Server.HttpSys;
namespace CompanyManagment.App.Contracts.InstitutionContract;
@@ -77,10 +80,59 @@ public class GetInstitutionContractListItemsViewModel
/// <summary>
/// وضعیت قرارداد
/// </summary>
public InstitutionContractStatus Status { get; set; }
public InstitutionContractListStatus ListStatus { get; set; }
/// <summary>
/// آیا منقضی شده است
/// </summary>
public bool IsExpired { get; set; }
public long ContractingPartyId { get; set; }
public List<InstitutionContractListWorkshop> Workshops { get; set; }
public bool IsInPersonContract { get; set; }
public bool IsOldContract { get; set; }
}
public class InstitutionContractListWorkshop
{
public string WorkshopName { get; set; }
public int EmployeeCount { get; set; }
public string Price { get; set; }
public WorkshopServicesViewModel WorkshopServices { get; set; }
}
public class WorkshopServicesViewModel
{
public bool Insurance { get; set; }
public string InsuranceLabel => "ارسال لیست بیمه";
public string InsurancePrice { get; set; }
public bool InsuranceInPerson { get; set; }
public string InsuranceInPersonLabel => "خدمات مستقیم";
public string InsuranceInPersonPrice { get; set; }
public bool Contract { get; set; }
public string ContractLabel => "قرارداد و تصفیه حساب";
public string ContractPrice { get; set; }
public bool ContractInPerson { get; set; }
public string ContractInPersonLabel => "خدمات مستقیم";
public string ContractInPersonPrice { get; set; }
public bool RollCall { get; set; }
public string RollCallLabel => "ساعت حضور و غیاب";
public string RollCallPrice { get; set; }
public bool RollCallInPerson { get; set; }
public string RollCallInPersonLabel => "خدمات مستقیم";
public string RollCallInPersonPrice { get; set; }
public bool CustomizeCheckout { get; set; }
public string CustomizeCheckoutLabel => "فیش غیر رسمی";
public string CustomizeCheckoutPrice { get; set; }
}

View File

@@ -0,0 +1,27 @@
using System.Collections.Generic;
namespace CompanyManagment.App.Contracts.InstitutionContract;
public class GetInstitutionContractListStatsViewModel
{
/// <summary>
/// مجموع بدهی قراردادهای مؤسسه
/// این ویژگی بدهی‌های قراردادهای مربوطه را تجمیع می‌کند و
/// یک معیار واحد برای اندازه‌گیری تعهدات مالی ارائه می‌دهد
/// </summary>
public double TotalDebt { get; set; }
/// <summary>
/// مجموع ارزش پولی مرتبط با قراردادهای مؤسسه
/// این ویژگی مبلغ کل قراردادهای مربوطه را برای
/// گزارش‌گیری و تجزیه و تحلیل مالی تجمیع می‌کند
/// </summary>
public double TotalAmount { get; set; }
/// <summary>
/// مجموعه‌ای از تعداد قراردادهای مؤسسه دسته‌بندی شده بر اساس وضعیت
/// این ویژگی تعداد قراردادها را برای هر وضعیت تعریف شده در
/// شمارش InstitutionContractStatus ارائه می‌دهد که امکان تجزیه و تحلیل و نظارت بر توزیع قراردادها را فراهم می‌کند
/// </summary>
public List<InstitutionContractStatusCount> Counts { get; set; }
}

View File

@@ -0,0 +1,31 @@
using _0_Framework.Application.Enums;
using System.Collections.Generic;
namespace CompanyManagment.App.Contracts.InstitutionContract;
public class GetInstitutionVerificationDetailsViewModel
{
public InstitutionContratVerificationParty FirstParty { get; set; }
public InstitutionContratVerificationParty SecondParty { get; set; }
public string ContractNo { get; set; }
public string CreationDate { get; set; }
public string ContractStart { get; set; }
public string ContractEnd { get; set; }
public List<GetInstitutionVerificationDetailsWorkshopsViewModel> Workshops { get; set; }
public string TotalPrice { get; set; }
public string TaxPrice { get; set; }
public string PaymentPrice { get; set; }
public List<InstitutionContractInstallmentViewModel> Installments { get; set; }
public bool IsInstallment { get; set; }
}
public class InstitutionContratVerificationParty
{
public string CompanyNameOrFullName { get; set; }
public string NationalCodeOrNationalId { get; set; }
public string CeoName { get; set; }
public string Address { get; set; }
public string PostalCode { get; set; }
public string PhoneNumber { get; set; }
public LegalType LegalType { get; set; }
}

View File

@@ -0,0 +1,9 @@
namespace CompanyManagment.App.Contracts.InstitutionContract;
public class GetInstitutionVerificationDetailsWorkshopsViewModel
{
public string Name { get; set; }
public int PersonnelCount { get; set; }
public WorkshopServicesViewModel Services { get; set; }
public string Price { get; set; }
}

View File

@@ -1,62 +1,165 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.Application.Sms;
using CompanyManagment.App.Contracts.Checkout;
using CompanyManagment.App.Contracts.Law;
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
using CompanyManagment.App.Contracts.Workshop;
using CompanyManagment.App.Contracts.WorkshopPlan;
using Microsoft.AspNetCore.Mvc;
namespace CompanyManagment.App.Contracts.InstitutionContract;
/// <summary>
/// رابط اپلیکیشن قراردادهای مؤسسه
/// مدیریت عملیات مربوط به قراردادهای مالی مؤسسات
/// </summary>
public interface IInstitutionContractApplication
{
/// <summary>
/// ایجاد قرارداد جدید
/// </summary>
/// <param name="command">اطلاعات قرارداد جدید</param>
/// <returns>نتیجه عملیات</returns>
OperationResult Create(CreateInstitutionContract command);
/// <summary>
/// تمدید قرارداد موجود
/// </summary>
/// <param name="command">اطلاعات قرارداد برای تمدید</param>
/// <returns>نتیجه عملیات</returns>
OperationResult Extension(CreateInstitutionContract command);
/// <summary>
/// ویرایش قرارداد موجود
/// </summary>
/// <param name="command">اطلاعات جدید قرارداد</param>
/// <returns>نتیجه عملیات</returns>
OperationResult Edit(EditInstitutionContract command);
/// <summary>
/// دریافت جزئیات قرارداد برای ویرایش
/// </summary>
/// <param name="id">شناسه قرارداد</param>
/// <returns>اطلاعات قرارداد</returns>
EditInstitutionContract GetDetails(long id);
/// <summary>
/// جستجو در قراردادها
/// </summary>
/// <param name="searchModel">مدل جستجو</param>
/// <returns>لیست قراردادها</returns>
List<InstitutionContractViewModel> Search(InstitutionContractSearchModel searchModel);
/// <summary>
/// جستجوی جدید در قراردادها
/// </summary>
/// <param name="searchModel">مدل جستجو</param>
/// <returns>لیست قراردادها</returns>
List<InstitutionContractViewModel> NewSearch(InstitutionContractSearchModel searchModel);
/// <summary>
/// دریافت اطلاعات قزداد های مالی فعال
/// دریافت اطلاعات قرارداد های مالی فعال
///دارای کارگاه
/// جهت ست کردن سرویس ها از طریق اکسل
/// </summary>
/// <returns></returns>
List<InstitutionContractViewModel> GetInstitutionContractToSetServicesExcelImport();
/// <summary>
/// چاپ مجموعه قراردادها
/// </summary>
/// <param name="id">لیست شناسه قراردادها</param>
/// <returns>لیست قراردادها برای چاپ</returns>
List<InstitutionContractViewModel> PrintAll(List<long> id);
[Obsolete("استفاده نشود، از متد غیرهمزمان استفاده شود")]
/// <summary>
/// چاپ یک قرارداد
/// </summary>
/// <param name="id">شناسه قرارداد</param>
/// <returns>اطلاعات قرارداد برای چاپ</returns>
InstitutionContractViewModel PrintOne(long id);
/// <summary>
/// فعال کردن قرارداد
/// </summary>
/// <param name="id">شناسه قرارداد</param>
/// <returns>نتیجه عملیات</returns>
OperationResult Active(long id);
/// <summary>
/// غیرفعال کردن قرارداد
/// </summary>
/// <param name="id">شناسه قرارداد</param>
/// <returns>نتیجه عملیات</returns>
OperationResult DeActive(long id);
/// <summary>
/// غیرفعال کردن قرارداد (حالت آبی)
/// </summary>
/// <param name="id">شناسه قرارداد</param>
/// <returns>نتیجه عملیات</returns>
OperationResult DeActiveBlue(long id);
/// <summary>
/// غیرفعال کردن تمام اتصالات قرارداد
/// </summary>
/// <param name="id">شناسه قرارداد</param>
/// <returns>نتیجه عملیات</returns>
OperationResult DeActiveAllConnections(long id);
/// <summary>
/// فعال کردن مجدد تمام اتصالات قرارداد
/// </summary>
/// <param name="id">شناسه قرارداد</param>
/// <returns>نتیجه عملیات</returns>
OperationResult ReActiveAllConnections(long id);
/// <summary>
/// فعال کردن مجدد تمام قراردادها بعد از ایجاد قرارداد جدید
/// </summary>
/// <param name="contractingPartyId">شناسه طرف قرارداد</param>
void ReActiveAllAfterCreateNew(long contractingPartyId);
/// <summary>
/// حذف قرارداد
/// </summary>
/// <param name="id">شناسه قرارداد</param>
void RemoveContract(long id);
/// <summary>
/// امضای قرارداد
/// </summary>
/// <param name="id">شناسه قرارداد</param>
/// <returns>نتیجه عملیات</returns>
OperationResult Sign(long id);
/// <summary>
/// لغو امضای قرارداد
/// </summary>
/// <param name="id">شناسه قرارداد</param>
/// <returns>نتیجه عملیات</returns>
OperationResult UnSign(long id);
/// <summary>
/// ایجاد حساب کاربری برای طرف قرارداد
/// </summary>
/// <param name="contractingPartyid">شناسه طرف قرارداد</param>
/// <param name="accountId">شناسه حساب کاربری</param>
void CreateContractingPartyAccount(long contractingPartyid, long accountId);
/// <summary>
/// محاسبه مبلغ قرارداد بر اساس تعداد افراد
/// </summary>
/// <param name="countPerson">تعداد افراد</param>
/// <returns>مبلغ قرارداد</returns>
double GetcontractAmount(int countPerson);
#region Api
@@ -82,52 +185,159 @@ public interface IInstitutionContractApplication
/// <param name="command"></param>
/// <returns></returns>
Task<OperationResult> CreateAsync(CreateInstitutionContractRequest command);
/// <summary>
/// ویرایش
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
Task<OperationResult> EditAsync(EditInstitutionContractRequest command);
/// <summary>
/// تمدید قرارداد
/// دریافت لیست طرف حساب هایی که ثبت نام آنها تکمیل شده
/// جهت نمایش در کارپوشه
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
Task<OperationResult> ExtensionَAsync(CreateInstitutionContractRequest command);
Task<List<RegistrationWorkflowMainListViewModel>> RegistrationWorkflowMainList();
/// <summary>
/// دریافت آیتم های کارپوشه ثبت نام
/// </summary>
/// <param name="institutionContractId"></param>
/// <returns></returns>
Task<List<RegistrationWorkflowItemsViewModel>> RegistrationWorkflowItems(long institutionContractId);
#endregion
Task<GetInstitutionVerificationDetailsViewModel> GetVerificationDetails(Guid id);
Task<OperationResult<OtpResultViewModel>> SendVerifyOtp(Guid id);
Task<OperationResult> VerifyOtp(Guid publicId, string code);
Task<InstitutionContractWorkshopDetailViewModel> GetWorkshopInitialDetails(long workshopDetailsId);
#region Extension
Task<InstitutionContractExtensionInquiryResult> GetExtensionInquiry(long previousContractId);
Task<InstitutionContractExtensionWorkshopsResponse> GetExtensionWorkshops(
InstitutionContractExtensionWorkshopsRequest request);
Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(
InstitutionContractExtensionPlanRequest request);
Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(
InstitutionContractExtensionPaymentRequest request);
Task<OperationResult> ExtensionComplete(InstitutionContractExtensionCompleteRequest request);
Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search,string selected);
#endregion
#region Upgrade (Amendment)
Task<InstitutionContractAmendmentWorkshopsResponse> GetAmendmentWorkshops(long institutionContractId);
Task<InsertAmendmentTempWorkshopResponse> InsertAmendmentTempWorkshops(InstitutionContractAmendmentTempWorkshopViewModel request);
Task RemoveAmendmentWorkshops(Guid workshopTempId);
Task<InsitutionContractAmendmentPaymentResponse> GetAmendmentPaymentDetails(InsitutionContractAmendmentPaymentRequest request);
#endregion
}
public class GetInstitutionContractListStatsViewModel
{
/// <summary>
/// Represents the total outstanding debt of institution contracts.
/// This property aggregates the liabilities of the respective contracts and provides
/// a single metric to measure financial obligations.
/// </summary>
public double TotalDebt { get; set; }
Task<OperationResult> ResendVerifyLink(long institutionContractId);
/// <summary>
/// Represents the total monetary value associated with institution contracts.
/// This property consolidates the aggregate amount from relevant contracts
/// for financial reporting and analysis.
/// دیتای پرینت قرارداد مالی
/// </summary>
public double TotalAmount { get; set; }
/// <param name="id"></param>
/// <returns></returns>
Task<InstitutionContractPrintViewModel> PrintOneAsync(long id);
Task<GetInstitutionContractWorkshopsDetails> GetContractWorkshopsDetails(long id);
}
public class GetInstitutionContractWorkshopsDetails
{
public List<InstitutionContractListWorkshop> Workshops { get; set; }
}
public class InstitutionContractPrintViewModel
{
public InstitutionContratVerificationParty FirstParty { get; set; }
public InstitutionContratVerificationParty SecondParty { get; set; }
public string ContractNo { get; set; }
public string CreationDate { get; set; }
public string ContractStart { get; set; }
public string ContractEnd { get; set; }
public List<GetInstitutionVerificationDetailsWorkshopsViewModel> Workshops { get; set; }
public string TotalPrice { get; set; }
public string TaxPrice { get; set; }
public string PaymentPrice { get; set; }
public string VerifyCode { get; set; }
public string VerifyDate { get; set; }
public string VerifyTime { get; set; }
public string VerifierFullName { get; set; }
public string VerifierPhoneNumber { get; set; }
public LawViewModel LawViewModel { get; set; }
public string Obligation { get; set; }
}
public class InsertAmendmentTempWorkshopResponse
{
public Guid WorkshopTempId { get; set; }
public string Amount { get; set; }
}
public class InstitutionContractAmendmentWorkshopsResponse
{
/// <summary>
/// Represents a collection of counts for institution contracts categorized by their status.
/// This property provides the count of contracts for each status defined in the
/// InstitutionContractStatus enumeration, enabling analysis and monitoring of contract distribution.
///
/// </summary>
public List<InstitutionContractStatusCount> Counts { get; set; }
public List<InstitutionContractAmendmentTempWorkshopViewModel> Workshops { get; set; }
public Guid TempId { get; set; }
}
public class InstitutionContractStatusCount
public class InstitutionContractSelectListViewModel : SelectListViewModel;
public class InstitutionContractExtensionInquiryResponse
{
public InstitutionContractStatus Status { get; set; }
public int Count { get; set; }
public long Id { get; set; }
public string FName { get; set; }
public string LName { get; set; }
public string DateOfBirthFa { get; set; }
public string FatherName { get; set; }
public string IdNumberSerial { get; set; }
public string IdNumber { get; set; }
public string Address { get; set; }
public string Phone { get; set; }
public string City { get; set; }
public string State { get; set; }
public long RepresentativeId { get; set; }
public string NationalCode { get; set; }
}
public class ExtenstionInstitutionContractRequest:EditInstitutionContractRequest
public class InstitutionContractExtensionPaymentMonthly:InstitutionContractExtensionPaymentOneTime
{
public long PreviousContractId { get; set; }
public List<MonthlyInstallment> Installments { get; set; }
}
public class InstitutionContractExtensionPaymentOneTime
{
/// <summary>
/// مجموع مبالغ
/// </summary>
public string TotalAmount { get; set; }
/// <summary>
/// ارزش افزوده
/// </summary>
public string Tax { get; set; }
/// <summary>
/// مبلغ قابل پرداخت
/// </summary>
public string PaymentAmount { get; set; }
}

View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
namespace CompanyManagment.App.Contracts.InstitutionContract;
public class InsitutionContractAmendmentPaymentRequest
{
public Guid TempId { get; set; }
}

View File

@@ -0,0 +1,11 @@
namespace CompanyManagment.App.Contracts.InstitutionContract;
public class InsitutionContractAmendmentPaymentResponse
{
public InstitutionContractPaymentOneTimeViewModel OneTime { get; set; }
public InstitutionContractPaymentMonthlyViewModel Monthly { get; set; }
public string ContractStart { get; set; }
public string ContractEnd { get; set; }
public string OneMonthAmount { get; set; }
public string TotalAmount { get; set; }
}

Some files were not shown because too many files have changed in this diff Show More