Compare commits

...

1013 Commits

Author SHA1 Message Date
21624a835b fix: update time restrictions for entry and exit registration to 5 minutes 2025-12-22 12:16:47 +03:30
12fab5a9a5 add {id:guid} convention for controllers 2025-12-20 20:57:34 +03:30
20dd8f64f4 add: include OneMonthWithoutTax and OneMonthTax properties in InstitutionContractPrintViewModel 2025-12-20 20:28:08 +03:30
b827493306 refactor: remove unused discount-related classes from IInstitutionContractApplicationpnpm 2025-12-20 20:12:31 +03:30
04c65eae93 Merge branch 'Feature/institution-contract/print'
# Conflicts:
#	CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs
2025-12-20 20:10:30 +03:30
b4526a4338 Merge branch 'Feature/institution-contract/verify-mannually' 2025-12-20 20:09:13 +03:30
2d879ce80a fix: update workshop identification logic in InstitutionContractApplication 2025-12-20 20:06:28 +03:30
56e79d2099 fix: correct ContractAmountWithTax calculation for old contracts 2025-12-20 19:38:32 +03:30
93891f3837 add one month more details for InstitutionContract.cs print 2025-12-20 19:18:27 +03:30
SamSys
5bdfbc572b add next deploy and contractingParty add to workshop on AndroidApk page 2025-12-20 18:42:53 +03:30
4385a65cbc feat: add manual verification endpoint for institution contracts 2025-12-20 18:27:59 +03:30
722f8dae7c feat: implement manual verification for institution contracts and add signing type handling 2025-12-20 18:27:17 +03:30
SamSys
07113353c4 add uploadFrontEnd btn to AndroidApk page 2025-12-20 16:01:07 +03:30
8c6336b9bd fix: correct IsOldContract logic to properly identify old contracts 2025-12-20 14:35:02 +03:30
20e3d454cf feat: add ContractAmountWithTax calculation and update related references 2025-12-20 13:35:52 +03:30
2bf31db6b2 fix: enhance parameter binding logic for route parameters 2025-12-20 12:05:34 +03:30
7a4a6de84f feat: add OneMonthPrice to institution contract details 2025-12-20 10:56:36 +03:30
4f16d7680c feat: add insurance client list retrieval with pagination and filtering 2025-12-18 10:59:06 +03:30
SamSys
7a10d5ce59 changes 2025-12-18 10:40:11 +03:30
SamSys
3d88feeee7 Clent Add Employee Change to authorizedCanceled 2025-12-17 19:13:47 +03:30
SamSys
f408624463 Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-12-17 13:25:38 +03:30
SamSys
8296292e49 checkout week finder switch fixed bug 2025-12-17 13:25:24 +03:30
be8deef167 fix: update license context setting for Excel packages 2025-12-17 11:33:40 +03:30
84fb29c8c8 feat: enhance project creation validation and add operation result filter 2025-12-16 20:18:54 +03:30
0969e8a5fd Merge remote-tracking branch 'origin/master' 2025-12-16 19:14:28 +03:30
92e2282381 refactor: change GetAllCodes to return a dictionary for improved structure 2025-12-16 19:13:30 +03:30
SamSys
3b71b7d707 add pmPermission to claim 2025-12-16 18:24:18 +03:30
6123a53f01 fix: update permission check for project board visibility 2025-12-16 17:15:22 +03:30
ec74db17eb Merge branch 'master' into Feature/program-manager/set-permission-board 2025-12-16 17:10:41 +03:30
dc118cf18b Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-12-16 17:09:54 +03:30
a11e54c333 Add project board detail endpoint & validation improvements
- Added GET /board/{id:guid} endpoint to ProjectController for detailed project board info.
- Enforced max length of 15 characters for project names in CreateProjectCommandValidator.
- Improved SetTimeProjectCommandHandler: skip zero/negative initial times, removed duplicate error message, and cleaned up formatting.
- Enhanced RollCallApplication to use employee-specific workshop shift settings when available.
2025-12-16 17:09:28 +03:30
SamSys
2383e7a54f Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-12-16 17:03:02 +03:30
SamSys
2ef1ea3d1a add new permission for workshop 2025-12-16 17:02:40 +03:30
SamSys
ebdc9b1e55 ProgramManager PermissionCodes set 2025-12-16 16:26:15 +03:30
9e5a494881 feat: enhance project board query with skill and user details 2025-12-16 14:18:00 +03:30
2972807c9f feat: add permission handling methods and project board detail query 2025-12-16 12:56:49 +03:30
f7351454f3 feat: implement method to update face embedding names for employees with changed names 2025-12-16 11:05:22 +03:30
b64d0e5ffd feat: add method to update employee full name in FaceEmbeddingService and integrate with RollCallEmployeeApplication 2025-12-16 10:39:51 +03:30
35b7a3a3dd remove documentation file generation from project settings 2025-12-16 09:32:42 +03:30
fe93ef60c9 Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-12-15 21:14:06 +03:30
ef865d9c68 Add Skill navigation to Phase/ProjectSection, refactor logic
- Add Skill navigation properties to PhaseSection and ProjectSection, with EF Core mappings and migration for foreign keys and indexes.
- Refactor SetSkillFlags in GetProjectsListQueryHandler for clarity and efficiency; use eager loading for Skill.
- Add HasRemainingTime() to TaskSection and enforce time check in ChangeStatusSectionCommandHandler.
- Optimize EmployeeDocumentsRepository queries; add EmployeeId to WorkshopWithEmployeeDocumentsViewModel.
- Improve CustomExceptionHandler to handle FluentValidation exceptions and return proper status codes.
- Add FluentValidation package reference and perform minor code cleanups.
2025-12-15 20:56:32 +03:30
SamSys
61e35100f9 Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-12-15 18:49:35 +03:30
SamSys
01d33ff340 add InstitutionContract Confirm Reminder Sms completed 2025-12-15 18:49:13 +03:30
cd64e1d24d Merge remote-tracking branch 'origin/master' 2025-12-15 14:06:18 +03:30
d9da2e97ab feat: add method to retrieve task sections assigned to a user and enhance permission code structure 2025-12-15 14:06:07 +03:30
SamSys
1c1c8816a5 pm GetHolidaysInDates completed - remove OldholidayItems 2025-12-15 14:01:42 +03:30
a1e85261a6 Merge remote-tracking branch 'origin/master' 2025-12-15 13:49:53 +03:30
000af89fd7 feat: add permission checking and task assignment handling in ProjectBoardHub 2025-12-15 13:49:41 +03:30
SamSys
a4f3feba1c update account edit method 2025-12-15 13:26:09 +03:30
SamSys
a3d286c040 remove PmDbContext and depndencies 2025-12-15 13:05:05 +03:30
SamSys
902ef34757 Remove Pm Old Context 2025-12-15 12:42:19 +03:30
SamSys
e67aca37f9 Insurance HasCheckout change 2025-12-15 12:15:00 +03:30
2a31b27f9b feat: simplify StartWork and StopWork methods by removing userId parameter 2025-12-15 10:43:17 +03:30
e05eb1236b Merge branch 'refs/heads/Feature/program-manager/signalR-notification'
# Conflicts:
#	ServiceHost/Program.cs
2025-12-15 10:41:31 +03:30
a7d3b1e96f feat: update SignalR group handling for project status notifications 2025-12-15 10:14:32 +03:30
73bef104fb feat: implement custom parameter binding convention for ASP.NET Core 2025-12-15 09:45:39 +03:30
SamSys
b31559a29a add institutionContractConfirmTab SmsSettigs 2025-12-14 18:59:22 +03:30
SamSys
e62270a9b7 update sms settings js 2025-12-14 18:14:18 +03:30
SamSys
998759e2dc change smsSettings 2025-12-14 17:58:27 +03:30
SamSys
49d401856f change GetAverageWeeklyDuration method 2025-12-14 17:46:19 +03:30
SamSys
2faf6c1400 Get Average Weekly Duration query Handler 2025-12-14 16:27:36 +03:30
SamSys
a01a927f6f chnage pm shift duration method on domain 2025-12-14 15:11:39 +03:30
bca1e66f0f feat: update ProjectBoardHub endpoint to include API prefix 2025-12-14 14:21:45 +03:30
SamSys
097d5a6e86 sepration report js 2025-12-14 14:03:39 +03:30
83a7bbf5f3 feat: register SignalR notification publisher for board updates 2025-12-14 13:50:24 +03:30
SamSys
24501df615 sepration js and css for workshop and account 2025-12-14 12:50:19 +03:30
da46d45601 feat: implement SignalR notifications for project status changes 2025-12-14 12:13:23 +03:30
14fda440c1 Merge branch 'Feature/program-manager/move' 2025-12-14 11:19:31 +03:30
85ce92af2c feat: add permission attribute to program manager menu items 2025-12-14 09:41:16 +03:30
SamSys
5777a869cf migration changes 2025-12-13 22:42:08 +03:30
ed6301831c add program-manager in menu 2025-12-13 20:38:47 +03:30
2d0eb52211 merge from programManager Move 2025-12-13 20:24:20 +03:30
05d8b738cc Merge branch 'Feature/notification/create-api' 2025-12-13 20:18:29 +03:30
SamSys
5936f02421 Merge branch 'Feature/program-manager/move' of https://github.com/samsyntax24/OriginalGozareshgir into Feature/program-manager/move 2025-12-13 20:05:03 +03:30
SamSys
57116b14cc Update pmUser and create completed 2025-12-13 20:04:57 +03:30
a1e52ca48a feat: add ProgramManagerDbServer configuration and simplify OperationResult usage in GetSingleUserQueryHandler 2025-12-13 19:25:18 +03:30
f75d267ef5 Merge remote-tracking branch 'origin/Feature/program-manager/move' into Feature/program-manager/move 2025-12-13 18:56:04 +03:30
5be44432b1 feat: add user ID to GetSingleUserResponse and update PmUserQueryService for ID retrieval 2025-12-13 18:55:50 +03:30
SamSys
c0d2cae82e Merge branch 'Feature/program-manager/move' of https://github.com/samsyntax24/OriginalGozareshgir into Feature/program-manager/move 2025-12-13 18:51:14 +03:30
SamSys
955a6a3d21 edit pmRole completed 2025-12-13 18:51:08 +03:30
a52e313984 feat: register PmUserQueryService in Dependency Injection for user queries 2025-12-13 18:50:39 +03:30
58816ca383 feat: implement PmUserQueryService and integrate into AccountApplication for user ID retrieval 2025-12-13 18:38:08 +03:30
370feca81e Refactor bug report pages to use string identifiers and improve styling 2025-12-13 18:26:01 +03:30
SamSys
a4bf6c952d Merge branch 'Feature/program-manager/move' of https://github.com/samsyntax24/OriginalGozareshgir into Feature/program-manager/move 2025-12-13 18:25:26 +03:30
SamSys
c9d582877b create PmRole Completed 2025-12-13 18:25:19 +03:30
339cea998a Merge branch 'Feature/roll-call/camera-bug-report'
# Conflicts:
#	PersonalContractingParty.Config/PersonalBootstrapper.cs
2025-12-13 17:30:31 +03:30
32065aec33 refactor: remove unused authentication methods and clean up AuthHelper 2025-12-13 16:45:17 +03:30
f2293934d4 feat: restructure ProgramManager area and integrate Shared.Contracts 2025-12-13 16:41:27 +03:30
b12b3b9eb8 Revert "refactor: restructure controllers and update user references for ProgramManager"
This reverts commit c059066b13.
2025-12-13 15:49:57 +03:30
91259046f6 Revert "feat: introduce Shared.Contracts for account management and refactor related services"
This reverts commit 9469a5f76e.
2025-12-13 15:49:31 +03:30
c9882f0b59 update to 10 2025-12-13 14:54:45 +03:30
SamSys
e89aae1cc9 change accountTable 2025-12-13 14:11:41 +03:30
9469a5f76e feat: introduce Shared.Contracts for account management and refactor related services 2025-12-13 13:48:05 +03:30
c059066b13 refactor: restructure controllers and update user references for ProgramManager 2025-12-13 12:17:29 +03:30
ba0669bc55 Merge branch 'refs/heads/master' into Feature/program-manager/move 2025-12-13 11:36:44 +03:30
b3f42af77c Refactor bug report system to use Guid for identifiers instead of long 2025-12-13 11:19:17 +03:30
f42db3d21c fix: change token expiration time to local time in JWT settings 2025-12-13 10:28:19 +03:30
eb49bf771d changes mongo camera report 2025-12-12 19:42:08 +03:30
f829b8ddd1 Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-12-08 16:36:42 +03:30
5e6033db95 change ssologin url 2025-12-08 16:36:35 +03:30
27e8a26ed8 Add new domain models and interfaces for project management features 2025-12-08 14:47:03 +03:30
SamSys
0a2815946c change leavComput for staticWorkshop set 2025-12-08 14:37:04 +03:30
SamSys
7776dedd2a update SmsSettings js 2025-12-08 13:29:09 +03:30
SamSys
5da523e9a8 spreating js and css on SmsSettings 2025-12-08 13:24:18 +03:30
b7a7fb01d7 Merge remote-tracking branch 'origin/master' 2025-12-08 13:04:30 +03:30
8d49220532 Implement SSO token generation for Program Manager and update domain configuration 2025-12-08 13:04:19 +03:30
SamSys
def27929d9 Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-12-07 19:54:23 +03:30
SamSys
ea6fcbc773 add new permissions 2025-12-07 19:53:41 +03:30
788d58b413 change Id to ENtityId in getting institution by installment Id from FInancial invoice Item for Verify gateway payment controller 2025-12-07 19:39:01 +03:30
de8181770d Merge branch 'Feature/authorize/program-manager'
# Conflicts:
#	ServiceHost/appsettings.Development.json
#	ServiceHost/appsettings.json
2025-12-07 18:25:18 +03:30
3a32d1ca9d Merge branch 'master' into Feature/authorize/program-manager 2025-12-07 18:22:56 +03:30
951a194961 Add Program Manager menu item and update SSO login URL 2025-12-07 18:22:44 +03:30
ea896c4c11 Add migration for camera bug report system with related logs and screenshots 2025-12-07 17:56:56 +03:30
167b2bce09 Implement camera bug report system with CRUD operations and logging 2025-12-07 17:54:55 +03:30
SamSys
32a05398de add ProgramManager ConnectionString on AppSettings 2025-12-07 16:41:47 +03:30
SamSys
57853e2d1f Merge branch 'master' into ProgramManagerUserAccount 2025-12-07 15:33:46 +03:30
SamSys
acd96bcdc7 Add ProgramManager Context 2025-12-07 15:21:53 +03:30
3c0ec01f77 Fix date comparison logic in roll call validation 2025-12-06 18:57:52 +03:30
517f2d06ca Add CountController to manage task, ticket, and workflow counts 2025-12-06 17:44:00 +03:30
SamSys
fb97d3453d Merge branch 'master' into ProgramManagerUserAccount 2025-12-06 17:06:58 +03:30
SamSys
2320185ade Change 2025-12-06 16:58:34 +03:30
SamSys
80fdd1fece add programManager Domains and context 2025-12-06 16:58:14 +03:30
343f830d0d Fix calculation of discounted payment amount in institution contract repository 2025-12-06 16:46:02 +03:30
323a46a623 Add Program Manager menu item and implement JWT token generation for SSO login 2025-12-06 16:24:11 +03:30
87ff7976fb Add menu item for bank account information
Added a new menu item with `permission="307"` to `_Menu.cshtml`
for accessing the `account-number-database` page. The link
is dynamically constructed using `AppSetting.Value.Domain`
and styled with `class="clik10"` and inline styles. Included
an SVG icon and the text "اطلاعات بانکی طرف حساب"
("Bank account information of the counterparty"). Maintained
the hierarchical structure of the menu.
2025-12-06 10:41:03 +03:30
a533850f24 Enhance contract removal logic and handle financial statement updates 2025-12-04 10:36:59 +03:30
b5c1a4c29d Refactor legal party handling logic
Replaced `realPersonalContractingParty` with `legalPersonalContractingParty` to ensure correct variable usage in legal party operations. Updated the authentication logic to handle both authenticated and unauthenticated states, introducing a new `else` block for `LegalAuthentication`. Adjusted method calls (`UnAuthenticateLegalEdit` and `EditLegalPartyFromInstitution`) to use the updated variable and ensure consistent updates to legal party details.
2025-12-03 20:21:08 +03:30
28607dec66 Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-12-03 12:10:52 +03:30
4a041ca8e2 add condition for null rollcall employee in IfEmloyeeHasNewLeftWorkDateAddEndDateToRollCallStatus 2025-12-03 12:10:48 +03:30
SamSys
de0de6fde8 Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-12-02 15:01:41 +03:30
SamSys
70447a74ef change lunchSettings 2025-12-02 15:01:25 +03:30
90aa6058f0 Handle "*" in NationalCode assignment gracefully
Updated the `NationalCode` assignment in the `CreateInstitutionContractLegalPartyRequest` object to replace `"*"` with an empty string (`string.Empty`). This ensures compliance with business rules where `"*"` is not considered a valid value for `NationalCode`. Retains the original value otherwise.
2025-12-02 14:40:54 +03:30
3df296f205 Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-12-02 14:23:39 +03:30
6a2e4405de add check for gender if is empty 2025-12-02 14:00:01 +03:30
88c10ac141 Add phone and ID number series fields to temporary client registration result 2025-12-02 13:44:25 +03:30
SamSys
8de3939675 change lunch setting adddress 2025-12-02 13:06:22 +03:30
e78c838cab Add method to edit legal party details from institution in contracting party 2025-12-02 13:00:34 +03:30
SamSys
5e4b8a3a80 change static file permiission 2025-12-02 11:51:13 +03:30
SamSys
a18984fec1 add account to static list 2025-12-02 11:37:29 +03:30
a178fcd202 Add logic to count absences on Fridays and Thursdays without leave 2025-12-01 19:37:17 +03:30
9e92d2215f Add institution contract workflow count functionality to admin workflow 2025-12-01 10:53:26 +03:30
c63eb23b22 Handle null API response in employee authorization checks 2025-12-01 10:07:09 +03:30
238926118f Handle additional status code 3 in UID service response for employee authorization checks 2025-11-30 11:09:25 +03:30
c874164ca2 Merge branch 'Feature/InstitutionContract/set-discount' 2025-11-29 20:08:00 +03:30
d2f0ed46ae Refactor discount calculation and response models for institution contracts
- Replace InstitutionContractExtensionPaymentResponse with InstitutionContractDiscountResponse in discount-related methods and endpoints
- Update request and response models to include OneMonthAmount, Obligation, and improved discount fields
- Adjust method signatures and controller actions to use new response types
- Refactor discount calculation logic to support new structure and ensure correct plan updates for both installment and one-time payments
- Improve naming consistency for discount percentage fields
2025-11-29 20:07:29 +03:30
40dd90074b Add discount amount and percentage fields to InstitutionContract entity and database schema 2025-11-29 14:56:45 +03:30
452b0b6277 Refactor institution contract discount calculation to use TotalAmount instead of PaymentAmount 2025-11-29 13:26:04 +03:30
720e998a54 Return null if FirstName is missing in UID service response and improve null checks in GetPersonalInfo 2025-11-29 12:30:12 +03:30
626722e805 Handle null response from UID service in GetPersonalInfo and return appropriate failure message 2025-11-29 11:43:58 +03:30
5e5910e0fd Add [FromBody] attribute to ResetDiscountForCreate endpoint parameter 2025-11-29 11:30:49 +03:30
5d81731512 Add reset discount functionality for institution contract creation and extension 2025-11-29 11:11:34 +03:30
511932fa58 Add discount support for institution contract extensions
- Introduce DiscountPercentage and DiscountAmount fields to contract creation and payment models
- Implement discount calculation logic in repository
- Add SetDiscountForExtension API endpoint and related request/response models
- Update contract creation and extension flows to handle discounts
2025-11-29 09:44:30 +03:30
95891d5bae Handle BuyInstitutionContractInstallment items in invoice processing and add GetIdByInstallmentId method 2025-11-27 21:12:52 +03:30
SamSys
901a4ebd35 check httpContext for api to currentUrl 2025-11-27 13:46:42 +03:30
f3fa76c292 Prevent duplicate financial invoices by checking for existing unpaid invoices before creation 2025-11-27 11:39:03 +03:30
SamSys
16b04fc75c ProgrmmaagerUserAccount completed 2025-11-27 10:48:03 +03:30
ac6bbc3587 service 2025-11-26 20:15:54 +03:30
947d7590f4 Fix contract validation and authentication checks
Updated authentication checks for LegalParty and RealParty to
prevent null reference exceptions by ensuring existingContractingParty
is not null before invoking unauthentication methods.

Added a validation step to prevent duplicate contracts by checking
for existing records in the repository based on ContractingPartyId,
RepresentativeId, and TypeOfContract.
2025-11-26 19:47:24 +03:30
91403a52a3 Replace VerifySend with SendInstitutionVerificationCode
Replaced the `_smsService.VerifySend` method with the new
asynchronous `_smsService.SendInstitutionVerificationCode`
method. The new method includes additional parameters:
`contractingPartyFullName`, `contractingParty.id`, and
`institutionContract.id`, providing more context for the
verification process. Added `await` to ensure proper
asynchronous execution.
2025-11-26 18:25:26 +03:30
7e80342f80 Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-11-26 17:12:02 +03:30
5e92207778 Refactor financial transaction and invoice handling
Refactored and streamlined the handling of financial transactions, invoices, and installment logic in `InstitutionContractApplication` and `InstitutionContractRepository`. Removed redundant code and consolidated logic for creating financial transactions and invoices into a reusable structure.

- Delegated financial transaction and invoice creation to the application layer.
- Simplified installment handling by directly managing installment lists.
- Introduced modular logic for handling installment and full payment scenarios.
- Replaced redundant `FinancialInvoice` and `FinancialInvoiceItem` creation in the repository layer.
- Added logic to retrieve `financialStatement` from the repository when available.
- Improved consistency in handling `invoiceAmount` across payment-related operations.
- Removed unused code for unpaid invoice retrieval and associated logic.
- Added support for creating `CreateContactInfo` objects for institution contracts.

These changes improve code maintainability, readability, and modularity by reducing duplication and ensuring responsibilities are handled at the appropriate layers.
2025-11-26 17:11:53 +03:30
SamSys
29484e9565 changes 2025-11-26 13:50:28 +03:30
SamSys
86ac300e00 edit role completed 2025-11-26 13:37:04 +03:30
ba640494d2 update workshop plan calculation to use latest roll call service status 2025-11-26 12:36:51 +03:30
6974a505b4 Refactor contract logic and improve async handling
Refactored the `InstitutionContractListStatus.PendingForRenewal` logic in `InstitutionContractRepository.cs` to include additional checks for conflicting contracts.

Updated `OnPostShiftDateNew` in `Index.cshtml.cs` to be asynchronous, removed unused code, and added a call to the new `UpdateInstitutionContract` method.

Introduced `UpdateInstitutionContract` to filter contracts by a predefined list of IDs and streamline related entity inclusion.
2025-11-26 11:52:37 +03:30
6d3d599449 add DashboardController to provide client dashboard view with calendar and holiday information 2025-11-25 16:45:36 +03:30
2d28bd1f98 Merge branch 'Feature/InstitutionContract/edit-phone' 2025-11-25 15:30:46 +03:30
75ae3efb65 refactor UidService to improve code formatting and readability 2025-11-25 12:56:21 +03:30
eb53fd67ef update mobile and national code matching logic in temporary client registration and increase UidService timeout 2025-11-25 12:52:49 +03:30
8ec717916c add unauthenticated edit support for contracting party phone and info in institution contracts 2025-11-25 11:40:44 +03:30
64bdbcbd2d update authentication error handling to include status code 3 as unavailable 2025-11-24 19:35:49 +03:30
7e9ba23b97 add Excel export for workshop roll call data with new exporter and view model 2025-11-23 12:52:07 +03:30
SamSys
90a420c8c5 unitOfWork Added 2025-11-23 12:28:05 +03:30
SamSys
e6640a1636 remove PitzaAmir(resturan) HasRollCallRecord sekip condition 2025-11-22 19:53:09 +03:30
SamSys
e9665c190b Remove pitzaamir(resturan) costum static checkout Condition 2025-11-22 19:50:48 +03:30
SamSys
73563b0421 add create ProgramManagerAccount Api 2025-11-22 19:47:11 +03:30
ea3baf14e8 add HttpPost attribute to Create action in ContactUsController 2025-11-22 15:43:19 +03:30
36f104f316 add ContactUsController to handle contact us form submissions 2025-11-22 15:27:49 +03:30
42cae1295f Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-11-21 17:34:14 +03:30
95b281c3a4 change pizza amir lateEntry fine 2025-11-21 17:27:15 +03:30
SamSys
c239b094d7 Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-11-20 15:51:03 +03:30
9e61bd3f55 Merge branch 'master' into Feature/customize-checkout/pizza-amir 2025-11-20 15:21:06 +03:30
7025478417 feat: add dynamic deduction items to customize checkout and temp entities with migration 2025-11-20 15:20:45 +03:30
SamSys
b5ee4f01c7 update BackgroundInstitutionContract 2025-11-20 14:29:03 +03:30
3937cd8a9f feat: add dynamic deduction items for late entry and insurance fines to checkout calculations 2025-11-20 12:58:25 +03:30
SamSys
3ed14bf2bd update block sms method 2025-11-20 11:37:04 +03:30
933dd3d937 Enhance face embedding service notifications and error handling; add new shift date actions and improve UidService timeout 2025-11-20 10:52:29 +03:30
90d7de4901 Increase max length for contact info and names in contract entities; update related migrations and improve SMS service logic 2025-11-19 21:23:28 +03:30
37aa57d773 Refactor repository and remove unused Index files
Refactored `IPersonalContractingPartyRepository` to replace `GetByRegisterId` with `GetByNationalId`. Updated `InstitutionContractApplication` to use the new method and removed duplicate `RegisterId` validation logic.

Removed `Index.cshtml` and `Index.cshtml.cs` files, including all associated HTML, scripts, styles, and backend logic, indicating a deprecation or restructuring of the related functionality.
2025-11-19 19:16:55 +03:30
cce903f2ae Merge remote-tracking branch 'origin/master' 2025-11-19 11:10:33 +03:30
873ad2f41f Adjust institution contract creation flow to ensure entity is saved before invoice generation 2025-11-19 11:09:42 +03:30
2035b6fff8 feat: add dynamic deductions to checkout model and enhance roll call difference calculations 2025-11-19 10:45:40 +03:30
SamSys
d31cf8470f Sms Sttings Update 2025-11-18 19:13:09 +03:30
SamSys
5a34c9a6c9 Merg from Master 2025-11-18 16:06:13 +03:30
SamSys
4eb78996d5 Instan Send Block Sms Completed 2025-11-18 15:59:02 +03:30
SamSys
9d8e40c841 Instant block sms started 2025-11-18 15:14:18 +03:30
SamSys
4ba21db7c7 Instant Send Smms for reminder completed 2025-11-18 15:10:32 +03:30
164388dac3 Update payment redirect logic in Verify method to include callback URL 2025-11-18 12:46:50 +03:30
e81a44dd2f Merge branch 'Feature/FinancialInvoice/Init'
# Conflicts:
#	PersonalContractingParty.Config/PersonalBootstrapper.cs
2025-11-17 20:52:31 +03:30
f238b5af6b Enhance financial invoice handling by adding InvoiceNumber property and increasing DescriptionOption max length; implement SetPendingWorkflow method 2025-11-17 20:51:21 +03:30
SamSys
f5cb6b276e RemoveSetting Completed 2025-11-17 17:35:04 +03:30
ed746cb60a Refactor invoice handling to use TransactionId and add InvoiceNumber property 2025-11-17 17:06:31 +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
SamSys
a481e941c5 Create Reminder Sms 2025-11-16 19:59:25 +03:30
SamSys
58637ab038 SmsSettings frontEnd 2025-11-16 19:07:59 +03:30
SamSys
d10eff3dd5 MontlySms and blockSms Background Task Completed 2025-11-16 17:26:49 +03:30
3258deeb2c Add support for APK versioning with force update functionality and separate APK types 2025-11-16 13:38:24 +03:30
6d3526fb30 Refactor FinancialInvoiceItem constructor for improved readability 2025-11-15 19:16:47 +03:30
SamSys
ed35067ecc CreateTransaction completed 2025-11-15 19:00:39 +03:30
SamSys
488ce6041a ReminderDebtSms COmpleted 2025-11-15 14:47:03 +03:30
SamSys
0f261684e9 change 2025-11-15 12:51:17 +03:30
SamSys
a2c0cf126a add SmsSettings Table 2025-11-15 12:21:18 +03:30
SamSys
09a1d6df38 SmsSettingUpdate 2025-11-13 13:51:42 +03:30
SamSys
39bacdf8d6 SmsSetting domin created 2025-11-13 13:06:32 +03:30
ba2b402c04 Add Financial Invoice Management System
Refactored `FinancialInvoice` to include new properties (`Description`, `PublicId`, `IsActive`) and methods for managing items and statuses. Introduced `FinancialInvoiceItem` for invoice itemization. Updated `PaymentTransaction` to reference `FinancialInvoice`.

Enhanced repository and application layers with CRUD operations, advanced search functionality, and integration with contracts. Updated `CompanyContext` with `DbSet<FinancialInvoices>` and `DbSet<FinancialInvoiceItem>`.

Created new database tables for `FinancialInvoices` and `FinancialInvoiceItem`, and updated relationships with `PaymentTransactions`. Added DTOs for invoice creation, editing, and searching. Registered `IFinancialInvoiceRepository` for dependency injection.
2025-11-13 12:49:30 +03:30
f3470de8b6 Merge branch 'master' into Feature/FinancialInvoice/Init 2025-11-12 21:02:30 +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
dad334a9bd create SendReminderSmsForBackgroundTask methodes 2025-11-12 18:53:52 +03:30
SamSys
57ef47473b changes 2025-11-12 16:24:06 +03:30
SamSys
193e9f587f institutioncontract task 2025-11-12 15:37:24 +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
SamSys
2164aeb5bc error fixed 2025-11-12 13:27:37 +03:30
SamSys
7e08b44d4d fix conflict 2025-11-12 13:10:57 +03:30
SamSys
eec53c8024 fix conflict 2025-11-12 12:44:38 +03:30
SamSys
8c37826367 merge from master 2025-11-12 12:44:13 +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
4a8f76c473 Refactor FinancialInvoice class to simplify properties
Removed `SmsCode`, `FinancialStatementId`, and `FinancialStatement` properties, along with their associated methods (`SetFinancialStatement` and `SetNewSmsCode`).

Added a new `InvoiceId` property of type `Guid` to serve as a unique identifier for invoices. Updated the constructor to initialize `InvoiceId` and removed the `SmsCode` initialization logic.

These changes streamline the `FinancialInvoice` class and improve its alignment with application requirements.
2025-11-12 10:20:22 +03:30
3e5520d8a0 merge from master 2025-11-11 19:57:05 +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
76666b3da7 add pizza amir calculation method 2025-11-08 19:25:14 +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
75ea35596b refactor: comment out conditional checks in Index.js for clarity 2025-10-13 11:17:13 +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
6045153865 fix: duplicate insurance record in not created insurances 2025-10-13 07:48:45 +03:30
5d16020c6a feat: optimize join queries in InsuranceListRepository for improved data retrieval 2025-10-12 12:23:56 +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
af1388f0d7 feat: update not created workshops query to include filtering by left work insurance dates 2025-10-11 14:58:30 +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
ed5681256d feat: enhance "Not Created" tab functionality and improve data loading in InsuranceList 2025-10-11 13:14:30 +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
7a58423eb3 feat: implement "GetNotCreatedWorkshop" method and update related functionality in InsuranceList 2025-10-09 14:30:09 +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
70164ae498 feat: add "GetNotCreatedWorkshop" method to InsuranceList functionality 2025-10-09 13:47:43 +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
db225fea18 feat: add "Not Created" tab and implement related functionality in InsuranceList page 2025-10-09 12:27:20 +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
2bbe616127 fix: apply IgnoreQueryFilters in LeaveRepository for accurate data retrieval 2025-10-08 09:53:06 +03:30
f64e6ac176 Merge branch 'Feature/Leave/add-invalid-leave' 2025-10-07 17:23:27 +03:30
9095ed28e1 fix invalid bug 2025-10-07 17:20:48 +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
04ec2ed5a4 Merge branch 'Feature/Leave/add-invalid-leave' 2025-10-07 14:12:49 +03:30
fc1258e985 Merge branch 'Feature/Leave/add-invalid-leave' into Main 2025-10-07 14:11:32 +03:30
SamSys
c7f5310c56 Edit Employee change NationalCode Validation By Nationality 2025-10-07 14:02:12 +03:30
7b3d1f527c feat: integrate "IsInvalid" filter and dropdown functionality in leave management 2025-10-07 12:51:18 +03:30
dbbee73e2a add is invalid to list - NOT FINISHED 2025-10-06 20:07:32 +03:30
21df40af3b add isInvalid to leave entity - set query filter for it 2025-10-06 19:50:42 +03:30
6d0072c8ac add InstitutionContractExtenstionTemp - add mongodb Config 2025-10-06 15:04:26 +03:30
SamSys
f50fdd7f91 createLive bug fixed 2025-10-06 14:45:54 +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
SamSys
87cde91ad0 Extecpt Condition EmployeeId = 45104, workshopId = 315 2025-10-02 16:11:38 +03:30
SamSys
55f62da928 monthlyWage bug fixed 2025-10-02 15:39:01 +03:30
bfb7f4e38c add sms templates 2025-10-02 14:57:24 +03:30
SamSys
5a7f233568 checkout dailyWage bug fixed 2025-10-02 14:22:48 +03:30
SamSys
9d83de947f Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-10-02 13:03:47 +03:30
SamSys
f4c3aa1889 Except Personnel checkoutChange 2025-10-02 13:03:29 +03:30
8fb10ba5b0 add validation for leave 2025-10-01 16:32:58 +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
SamSys
d0928804ee new permission to DailyWageReport btn on Contract list 2025-09-30 22:05:12 +03:30
SamSys
67f199e86f merge from master 2025-09-30 21:37:19 +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
SamSys
85936cad63 gozareshgir address and phone changed 2025-09-29 05:11:05 +03:30
SamSys
6f805d9abe add enamd logo 2025-09-28 18:33:09 +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
914a7def53 feat: add condition for left personnel for laon installment 2025-09-28 14:47:33 +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
7777ad52de create workshop permission 2025-09-25 13:06:39 +03:30
b8b8d9c3c4 set account permission in EditWorkshop 2025-09-25 12:47:04 +03:30
SamSys
04710e321a Merge branch 'master' of https://git.dadmehrg.ir/gozareshgir/OriginalGozareshgir 2025-09-25 12:26:46 +03:30
SamSys
b9ff14757b new tab permission code 2025-09-25 12:26:38 +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
f387d0c535 fix create pay bug 2025-09-24 15:38:47 +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
ffc6969ee7 feat: change the create customize checkout 2025-09-24 13:47:55 +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
c3bbd9af98 feat: change the loan is paid by checkout 2025-09-23 17:55:03 +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
72435f2d47 fix: InsuranceList edit on get bug 2025-09-22 11:07:37 +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
SamSys
b3cf56eb1c conflict Fixed 2025-09-16 03:01:41 +03:30
SamSys
20dbd0121f Merge From Master 2025-09-16 03:01:02 +03:30
SamSys
74c7b1ebbd Optimized leaves affected on checkout 2025-09-15 23:44:37 +03:30
SamSys
b2c6ad2541 SickLeaving Bug on Static Checkout Fixed 2025-09-15 17:31:05 +03:30
8eded713da fix: update gender handling in Create and CreateEmployee views 2025-09-15 16:12: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
SamSys
c3cb3df3d3 change compute leaving model on checkout 2025-09-13 06:29:25 +03:30
MahanCh
604ac76a1a Add employer workflow registration edit and delete functionality 2025-09-11 12:58:50 +03:30
SamSys
f9947dc138 change leaving time on checkout for EndOfyear or OnLeftWork Employees 2025-09-09 18:41:16 +03:30
SamSys
3b12be04b5 test defualt remote 2025-09-09 16:18:38 +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
SamSys
82d035b7e1 mirrorTest4 2025-09-08 01:20:58 +03:30
SamSys
e80621280c mirror test 2025-09-08 01:09:15 +03:30
SamSys
1c6b0ac292 test miror 2025-09-08 01:04:02 +03:30
SamSys
7d3a1dad71 test mirror2 2025-09-08 00:53:59 +03:30
SamSys
b5fc98a47b test mirror 2025-09-08 00:50:28 +03:30
SamSys
01bc8ef01b Merge branch 'master' of https://git.dadmehrg.ir/gozareshgir/OriginalGozareshgir 2025-09-08 00:42:41 +03:30
SamSys
ca350aa795 delete test files 2025-09-08 00:40:17 +03:30
MahanCh
58c015b151 fix: remove unnecessary whitespace in development environment check 2025-09-07 17:22:01 +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
SamSys
1daaeff194 test 2 2025-09-07 05:29:07 +03:30
SamSys
9cd00a1886 test 2025-09-07 05:25:46 +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
179ff95d54 fix: normalize file extension check to lowercase 2025-09-03 15:22:55 +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
SamSys
29fed23805 Checkout NEW Compute DailyWage Completed 2025-09-02 04:33:30 +03:30
SamSys
a26f079969 merge from master to manualDailyWage 2025-08-31 17:20:27 +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
SamSys
b2a70bc5a9 merge add-employee-avrage [EmployeeMandatoryHours ] 2025-08-31 16:23:39 +03:30
SamSys
5053b69295 EmployeeMandatoryHourse bug fixed 2025-08-31 16:18:34 +03:30
SamSys
77458978b5 checkout change 2025-08-31 05:28:59 +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
2f15c2d54b fix: update SMS reminder job schedule and clean up code 2025-08-28 12:05:37 +03:30
SamSys
7e3f7d1dcf Completed DailYWage and BaseYear report For Contract 2025-08-28 06:09:02 +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
df39072944 feat: add employee mandatory hours to print layouts and view models 2025-08-26 13:52:21 +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
6f8ced3192 feat: enhance print layout for employee attendance details 2025-08-26 12:25:14 +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
SamSys
c40b457d1f Merge branch 'master' into ManualDailyWageContractSide 2025-08-26 01:49:05 +03:30
SamSys
f7166ca17f bug fixed : workshopTime setting save on client 2025-08-25 18:56:35 +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
a7b7bfc745 feat: add grouping SVG and update image reference in rollcall 2025-08-25 15:03:39 +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
fa5e079db5 fix: update image references for contract and insurance sections 2025-08-25 14:31:24 +03:30
MahanCh
ec2defab69 feat: add employee mandatory hours to checkout model and database 2025-08-25 10:33:43 +03:30
SamSys
a344c3f3a6 Merge branch 'master' into ManualDailyWageContractSide 2025-08-24 03:45:58 +03:30
SamSys
8f76b8c082 Upgraded daillyWage Completed 2025-08-24 03:37:54 +03:30
MahanCh
e34fef37d7 Merge branch 'master' into Main 2025-08-23 16:28:04 +03:30
MahanCh
5e7bfe0634 fix: improve case history data handling and add debugging logs 2025-08-23 16:22:26 +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
2732ec09b2 fix: sort payment transactions by creation date 2025-08-23 13:11:10 +03:30
MahanCh
3744b5f470 Merge branch 'fix/payment-transaction/list-bug' into Main 2025-08-23 13:02:57 +03:30
MahanCh
13d93b3e1d fix: handle null card numbers in payment transaction list 2025-08-23 13:02:03 +03:30
MahanCh
db78fb1cd4 Merge branch 'master' into Main 2025-08-23 11:55:57 +03:30
MahanCh
7ce2142517 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	CompanyManagment.EFCore/Repository/FinancialStatmentRepository.cs
2025-08-23 11:54:09 +03:30
MahanCh
98146b4aa7 fix: calculate balance correctly in financial transaction details 2025-08-23 11:53:08 +03:30
MahanCh
5f65c13b45 fix: calculate balance correctly in financial transaction details 2025-08-23 11:51:46 +03:30
MahanCh
8bde7aa3d1 feat: add PublicId to institution contract and update response models for calculators 2025-08-23 10:50:07 +03:30
SamSys
584425b3af and new metod to upgrade dailyWage 2025-08-23 07:09:56 +03:30
SamSys
2f60883ea2 add new prop to contractTable - compute dailyWage 2025-08-23 04:27:04 +03:30
SamSys
da8579d2a6 Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-08-22 01:07:04 +03:30
SamSys
41503101b6 create rollcallservice transaction chnages 2025-08-22 00:58:42 +03:30
syntax24
1cd4cd4b49 Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-08-21 16:46:56 +03:30
syntax24
7afa112e63 appsettings.dev changes 2025-08-21 16:46:40 +03:30
SamSys
3aa5668696 CustomizeCheckout enable or disable on client menu bug fixed 2025-08-21 16:44:51 +03:30
SamSys
df1e6f62b8 new manualdailywage metod to create contract 2025-08-21 15:55:53 +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
SamSys
856ed38f08 Merge branch 'master' into ManualDailyWageContractSide 2025-08-21 01:49:27 +03:30
MahanCh
dfb78db2fa feat: add installment management to InstitutionContract and related classes 2025-08-20 13:32:55 +03:30
SamSys
13ebe2fc2a Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-08-20 03:33:11 +03:30
SamSys
54fbbc964f change OvertTimeWOrking Compute - Send EmployeeMandatoryHours To Save 2025-08-20 03:27:54 +03:30
SamSys
4a3515ad65 manualDailyWage frontEnd Completed 2025-08-20 02:52:06 +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
b92aaaffa0 fix: enable and manage customize checkout options in client menu 2025-08-18 11:55:34 +03:30
MahanCh
2a315ff7ae refactor: rename InstitutionContractStatus to InstitutionContractListStatus and update related properties 2025-08-18 10:40:17 +03:30
SamSys
49b84b50a5 add dailywage select on create contract front 2025-08-18 05:33:31 +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
SamSys
b82456f172 chnages 2025-08-15 16:22:27 +03:30
SamSys
c04a8f86a4 new metod To Compute Spreation BaseYear 2025-08-15 15:49:35 +03:30
MahanCh
e0f7ff5ec7 Merge branch 'Feature/Chcekout/AddHasConflict' 2025-08-13 16:29:49 +03:30
MahanCh
7cb3551dc8 Merge branch 'Feature/Chcekout/AddHasConflict' into Main 2025-08-13 15:52:08 +03:30
MahanCh
873a30ecd1 enhance tooltip initialization and clean up code structure 2025-08-13 15:51:41 +03:30
MahanCh
c048e89da8 Merge branch 'Feature/Chcekout/AddHasConflict' into Main 2025-08-13 15:33:10 +03:30
MahanCh
c91df337d4 refactor checkout process to simplify salary aid conflict handling 2025-08-13 15:27:39 +03:30
MahanCh
b88cda4007 fix logic for employee checkout validation in AdminMonthlyOverviewRepository 2025-08-13 13:18:21 +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
MahanCh
366ad25a3a add conflict indication for salary aids in checkout process 2025-08-12 12:44:48 +03:30
MahanCh
463e4bc080 Merge branch 'refs/heads/master' into Feature/Chcekout/AddHasConflict 2025-08-12 12:43:12 +03:30
MahanCh
785309c731 fix leave date comparison logic in LeaveRepository 2025-08-12 11:55:13 +03:30
MahanCh
f0126d365d add HasAmountConflict column to CustomizeCheckoutTemps and CustomizeCheckouts 2025-08-12 11:17:43 +03:30
MahanCh
b77538218f add conflict indicator for employee customize checkout records 2025-08-12 11:17:02 +03:30
MahanCh
e877aca832 Merge branch 'Main' into Feature/Chcekout/AddHasConflict 2025-08-12 09:56:50 +03:30
MahanCh
f66293a637 add id to finacialtransaction viewmodel 2025-08-11 16:30:19 +03:30
MahanCh
4aa710b7d6 add search 2025-08-11 15:13:31 +03:30
MahanCh
2547fec258 Merge branch 'Feature/AdminMonthlyOverview/AddEmployeeOption' 2025-08-11 13:06:19 +03:30
MahanCh
acb572d94a fix admin monthly overview bug 2025-08-11 13:05:55 +03:30
MahanCh
5ff08ebb2f fix error for payment transactions 2025-08-10 11:20:31 +03:30
MahanCh
fd122fe582 fix error 2025-08-10 11:08:59 +03:30
MahanCh
25903856b2 add has conflict in List for checkout 2025-08-10 11:02:16 +03:30
MahanCh
d1b7e0c3e1 changes 2025-08-09 15:15:38 +03:30
MahanCh
9c0d5b65be comment condition for one month ago for creating salaryAid 2025-08-09 15:13:43 +03:30
MahanCh
ac4bd3453a Merge branch 'master' into Main
# Conflicts:
#	CompanyManagment.Application/SalaryAidApplication.cs
2025-08-09 14:46:36 +03:30
MahanCh
77e03f3d7f Merge remote-tracking branch 'origin/master' 2025-08-09 14:45:14 +03:30
MahanCh
a9008beb24 Change CreateAsync For SalaryAid 2025-08-09 14:45:04 +03:30
SamSys
a30d5b68d7 Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-08-09 14:21:30 +03:30
SamSys
93c72e16e7 Computing OverTimeWork WithOut Leaves - AbsenceDeduction changed to zero 2025-08-09 14:21:22 +03:30
MahanCh
290e1639e8 Merge branch 'master' into Main 2025-08-09 14:10:33 +03:30
MahanCh
3650b46b8e fix 404 Error on sending data for checkout exists in SalaryAid 2025-08-09 14:10:12 +03:30
MahanCh
734de19bc2 Merge branch 'master' into Main 2025-08-09 13:32:55 +03:30
MahanCh
398bb35815 Merge remote-tracking branch 'origin/master' 2025-08-09 12:47:18 +03:30
MahanCh
697bd9fefe fix error for "get last personnelCode" 2025-08-09 12:47:04 +03:30
MahanCh
9d9f0e14d3 add task job 2025-08-09 12:40:31 +03:30
MahanCh
2743493a11 add correct validation for create ContractingPartyBankAccounts 2025-08-09 11:02:32 +03:30
MahanCh
f9de490c13 cors 2025-08-07 17:13:43 +03:30
MahanCh
f374ff3012 PaymentTransaction Get data from it 2025-08-07 15:09:50 +03:30
MahanCh
563fe563c0 fix appsetting bug 2025-08-07 14:29:44 +03:30
MahanCh
c75e3464d7 fix bug 2025-08-07 10:08:56 +03:30
MahanCh
e3a5fb578b Change Payment Instrument api 2025-08-07 10:08:02 +03:30
MahanCh
8cb99b2862 ADD ROUTE 2025-08-07 10:00:28 +03:30
MahanCh
57b2ad3445 test for deploying 2025-08-06 15:30:13 +03:30
SamSys
3befd6f0d9 Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-08-06 15:01:02 +03:30
SamSys
8f10aa54a8 PaidLiveTimeSapn on checkout Footer bug fixed 2025-08-06 15:00:13 +03:30
MahanCh
efbd74479b fix error 2025-08-06 14:23:21 +03:30
MahanCh
8432b2660e Merge branch 'Feature/Chcekout/AddHasConflict' into Main
# Conflicts:
#	ServiceHost/Areas/Admin/Controllers/FinancialStatementController.cs
2025-08-06 14:11:06 +03:30
MahanCh
2f9426bdaf Merge branch 'Feature/InstitutionContract/Create-Api' into Main 2025-08-06 14:07:44 +03:30
MahanCh
5477519464 add extensionAsync in institutionContract for Api 2025-08-06 14:07:12 +03:30
MahanCh
f92257b251 add order by for Get list 2025-08-06 13:49:11 +03:30
MahanCh
5efe58d23d add bank inquiry data from body 2025-08-06 13:40:10 +03:30
MahanCh
648ca44ebb change bank card to bank number 2025-08-06 13:17:12 +03:30
MahanCh
3232c979aa Merge remote-tracking branch 'origin/Main' into Main 2025-08-06 11:47:19 +03:30
MahanCh
ce8a0b397d Merge branch 'Feature/InstitutionContract/Create-Api' into Main 2025-08-06 11:37:37 +03:30
MahanCh
c1fcaa1726 add transaction controller and create api
edit institutionContractController.cs and add excel download
2025-08-06 11:37:06 +03:30
Mahan Chamani
e1fd94db04 Update dotnet-developPublish.yml 2025-08-06 11:33:53 +03:30
Mahan Chamani
882f38d000 Update dotnet-developPublish.yml 2025-08-06 11:19:00 +03:30
Mahan Chamani
29560370d8 Update dotnet-developPublish.yml 2025-08-06 10:50:47 +03:30
Mahan Chamani
7841e8c336 Update dotnet-developPublish.yml 2025-08-06 10:41:16 +03:30
Mahan Chamani
a114cc8242 Update dotnet-developPublish.yml 2025-08-06 10:10:22 +03:30
MahanCh
473132d66a change Representative selectList 2025-08-06 09:55:33 +03:30
Mahan Chamani
9124f50577 Update dotnet-developPublish.yml 2025-08-05 18:22:41 +03:30
Mahan Chamani
7a13150223 Update dotnet-developPublish.yml 2025-08-05 18:18:14 +03:30
Mahan Chamani
f7059bcaeb Update dotnet-developPublish.yml 2025-08-05 18:08:18 +03:30
MahanCh
4c4e848f52 Merge branch 'master' into Main 2025-08-05 17:59:54 +03:30
Mahan Chamani
7984f18516 Update dotnet-developPublish.yml 2025-08-05 17:59:11 +03:30
MahanCh
94aa4fda51 Merge branch 'master' into Main 2025-08-05 17:57:38 +03:30
MahanCh
2d2207565e test 2025-08-05 17:55:48 +03:30
Mahan Chamani
3f8b85906f Create dotnet-developPublish.yml 2025-08-05 17:55:18 +03:30
MahanCh
346756c766 Merge branch 'Feature/PaymentInstrument/Init' into Main 2025-08-05 16:05:54 +03:30
MahanCh
20f208ac0e Add IsActive to group 2025-08-05 16:05:17 +03:30
MahanCh
2b602e4199 Merge branch 'Feature/PaymentInstrument/Init' into Main 2025-08-05 15:54:46 +03:30
MahanCh
9557f860bb Merge branch 'Feature/ContractingPartyBankAccount/Init' into Main 2025-08-05 15:54:41 +03:30
MahanCh
cf0dc95b5c add create range for ContractingPartyBankAccounts 2025-08-05 15:54:09 +03:30
MahanCh
c7f7b17866 add list create for payment instrument 2025-08-05 15:51:53 +03:30
MahanCh
d9259bf7c4 Merge branch 'Feature/PaymentInstrument/Init' into Main 2025-08-05 15:21:12 +03:30
MahanCh
55dc4c891f fix bug 2025-08-05 15:19:40 +03:30
MahanCh
daa2a0fdc1 add bank inquiry 2025-08-05 15:12:07 +03:30
MahanCh
6d6ce93f74 some changes 2025-08-05 14:25:32 +03:30
MahanCh
a71433f751 add AmountConflict in checkout 2025-08-05 13:11:12 +03:30
SamSys
68d1a8d9fe financialStament transaction list bug fixed 2025-08-05 04:16:15 +03:30
SamSys
a1dfc17ce9 static checkout fridayPay bug fixed 2025-08-04 18:17:35 +03:30
MahanCh
99a8cc181d Refactor: add stats method for tabs in GetList InstitutionContract 2025-08-04 16:27:16 +03:30
MahanCh
05cd8832d5 refactor: extract common pagination properties into PaginationRequest and apply it in InstitutionContractListSearchModel 2025-08-04 15:45:05 +03:30
MahanCh
a4bcb1ac55 refactor: update GetList methods to use PagedResult for paginated responses in InstitutionContract-related components 2025-08-04 15:36:20 +03:30
MahanCh
6cec0e39ec add PagedResult generic class to support paginated responses 2025-08-04 15:17:14 +03:30
MahanCh
08bf8395c4 Merge branch 'Feature/InstitutionContract/Create-Api' into Main 2025-08-04 14:05:13 +03:30
MahanCh
bc6378beca Add Edit, Deactivate, Activate, and Sign/Unsign methods to institutionContractController and application 2025-08-04 14:04:49 +03:30
MahanCh
08adccb2f1 fix: update GetList method return type in IContractingPartyBankAccountsRepository 2025-08-04 12:50:19 +03:30
MahanCh
5e24071175 Merge branch 'Feature/PaymentInstrument/Init' into Main
# Conflicts:
#	Company.Domain/ContractingPartyBankAccountsAgg/IContractingPartyBankAccountsRepository.cs
#	CompanyManagment.App.Contracts/ContractingPartyBankAccounts/IContractingPartyBankAccountsApplication.cs
#	CompanyManagment.Application/ContractingPartyBankAccountsApplication.cs
#	CompanyManagment.EFCore/Repository/ContractingPartyBankAccountsRepository.cs
#	ServiceHost/Areas/Admin/Controllers/ContractingPartyBankAccountController.cs
2025-08-04 12:18:08 +03:30
MahanCh
ebc377603a refactor: replace OperationResult with raw data for select list methods in repositories and controllers 2025-08-04 12:10:17 +03:30
MahanCh
b70dbc8a6b Merge remote-tracking branch 'origin/master' 2025-08-04 11:04:13 +03:30
MahanCh
a34d81318b order payment transactions by creation date 2025-08-04 11:03:10 +03:30
SamSys
00357df859 test 2025-08-04 05:00:13 +03:30
MahanCh
ba8e07c63a Merge branch 'Feature/InstitutionContract/Create-Api' into Main 2025-08-03 15:51:27 +03:30
MahanCh
f87b203939 Add New Searches for Get list in InstitutionContract 2025-08-03 15:49:07 +03:30
MahanCh
79807569dc add status for list of InstitutionContract 2025-08-03 15:19:09 +03:30
MahanCh
bda666b989 Merge branch 'Feature/InstitutionContract/Create-Api' into Main 2025-08-03 13:24:11 +03:30
MahanCh
9eca54276b update InstitutionContractRepository to apply pagination with PageIndex and PageSize parameters in GetList method 2025-08-03 13:23:45 +03:30
MahanCh
de64933d06 Merge branch 'Feature/PaymentInstrument/Init' into Main
# Conflicts:
#	CompanyManagment.EFCore/Repository/ContractingPartyBankAccountsRepository.cs
2025-08-03 13:19:47 +03:30
MahanCh
44763da729 add select list methods for PaymentInstrument and enhance repository logic 2025-08-03 13:10:51 +03:30
MahanCh
1f3bf123c4 update institutionContractController and application to improve validation and switch to async operations for contract creation 2025-08-03 10:53:08 +03:30
MahanCh
7a33b7da46 Merge branch 'Main' into Feature/InstitutionContract/Create-Api 2025-08-02 14:40:51 +03:30
MahanCh
da6573a147 Merge branch 'Feature/PaymentInstrument/Init' into Main 2025-08-02 14:40:10 +03:30
MahanCh
6a6ec2610d add AccountHolderName and Type to PaymentInstrument model and repository 2025-08-02 14:39:46 +03:30
MahanCh
d9717033cf add Create method in institutionContractController to handle institution contract creation with validations and account registration 2025-08-02 14:27:55 +03:30
MahanCh
beafd047bf Merge branch 'Main' into Feature/InstitutionContract/Create-Api 2025-08-02 13:21:02 +03:30
MahanCh
7c3abeb463 Merge branch 'master' into Feature/InstitutionContract/Create-Api 2025-08-02 13:05:42 +03:30
MahanCh
040f40df52 add status for GetList in InstitutionContractRepository.cs 2025-08-02 13:05:32 +03:30
MahanCh
ac66df98f5 more complete the InstitutionContractRepository.cs get list data - NOT FINISHED YET 2025-07-31 15:13:27 +03:30
MahanCh
8da9f09663 add debt alert for users who don't have permissions 2025-07-31 14:09:16 +03:30
MahanCh
591de9acd8 add search and get some data from query for GetList in InstitutionContractRepository.cs 2025-07-31 13:37:43 +03:30
MahanCh
be282fa548 change get list in InstitutionContractApplication.cs 2025-07-31 12:22:01 +03:30
MahanCh
1b88cebdf2 delete fake data for ContractingPartyBankAccountController.cs 2025-07-31 11:42:53 +03:30
MahanCh
12356c927b Merge branch 'Feature/PaymentInstrument/Init' into Main 2025-07-31 11:23:54 +03:30
MahanCh
b73898f5ea Merge branch 'Feature/ContractingPartyBankAccount/Init' into Main 2025-07-31 11:23:42 +03:30
MahanCh
51e8686668 add pagination for get PaymentInstrument 2025-07-31 11:09:27 +03:30
MahanCh
133b99d5fc change GetList of ContractingPartyBankAccounts and add count to it 2025-07-31 10:54:20 +03:30
SamSys
6c814d5dce add new static account 2025-07-30 19:42:25 +03:30
MahanCh
9879857a97 init PaymentInstrument 2025-07-30 17:03:01 +03:30
MahanCh
e3f29e5efa change header login button 2025-07-29 17:14:51 +03:30
MahanCh
4d45ee36b6 add PaymentTransactionValidatePending.cs file 2025-07-29 16:06:03 +03:30
MahanCh
7ae08fe023 Merge branch 'master' into Feature/BgService/init 2025-07-29 14:15:18 +03:30
MahanCh
13278e2c24 fix: change the route of jquery mask in Admin new 2025-07-29 14:13:10 +03:30
MahanCh
5ca32bbbaf Add Redirect If the User is Authenticated in Home Screen 2025-07-29 14:06:38 +03:30
SamSys
3ea80c1344 merge api to master 2025-07-28 23:26:36 +03:30
MahanCh
5ae31b9cea add "debt" section for mobile 2025-07-28 16:17:53 +03:30
MahanCh
117b5df447 change namespace 2025-07-28 16:03:35 +03:30
MahanCh
fee14c65ec add Hangfire Prj 2025-07-28 16:02:51 +03:30
SamSys
0d06457e1f Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-07-28 14:45:27 +03:30
SamSys
bdc433b0a3 employee children delet bug fixed 2025-07-28 14:45:17 +03:30
MahanCh
e87733f5cb Add Client Menu changes and add "debt" section in header 2025-07-28 14:20:36 +03:30
MahanCh
60bd120196 add main page and commented "register" buttons 2025-07-28 12:43:00 +03:30
MahanCh
0a41751c15 Merge branch 'master' into Api 2025-07-28 11:55:12 +03:30
MahanCh
41f39fb6fa FIX: fix WeeklyOffDays Select On Null Error 2025-07-28 11:53:08 +03:30
MahanCh
e8fd8bdace change the menu for new items 2025-07-28 11:39:53 +03:30
MahanCh
9f2487f8ef add new menu Items 2025-07-27 17:40:30 +03:30
MahanCh
32dbd094e0 Feat: Add Condition For FinancialStatmentRepository.cs to set balance 0 when amount searched 2025-07-27 17:15:20 +03:30
MahanCh
b97039ee15 Feat: add institutionContractController.cs and GetList() Method but not Implemented Yet 2025-07-27 17:02:59 +03:30
MahanCh
313579cdee add fake api - disable employeeReport in Menu 2025-07-27 13:16:21 +03:30
MahanCh
3bda7116a2 Merge branch 'refs/heads/Feature/ContractingPartyBankAccount/Init' into Api
# Conflicts:
#	.gitignore
2025-07-27 12:19:04 +03:30
MahanCh
8bb29447e2 add .idea Folder to .gitignore 2025-07-27 11:32:46 +03:30
SamSys
8dc839f561 financialStatment row Balance bug fixed 2025-07-26 20:39:56 +03:30
SamSys
9f9c0d64a9 Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-07-26 16:05:32 +03:30
SamSys
751c1a4131 change checkout footer [TotalPresent and TotalWorking] 2025-07-26 16:05:25 +03:30
MahanCh
b96ed1c7c3 Feat:init ContractingPartyBankAccount Module 2025-07-26 15:58:01 +03:30
MahanCh
500d7fc8d4 fix style bugs 2025-07-26 11:44:21 +03:30
MahanCh
b8cfc8eb56 fix menu bug problem 2025-07-24 11:30:41 +03:30
MahanCh
4c0f4bb70c Merge branch 'Api' of https://github.com/syntax24/OriginalGozareshgir into Api 2025-07-24 11:27:42 +03:30
MahanCh
6317ebb079 Merge branch 'master' into Api 2025-07-24 11:26:29 +03:30
MahanCh
91d86dbd2e fix menu admin monthly overview url for admin new 2025-07-24 11:26:14 +03:30
SamSys
aedaf84d57 Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-07-23 19:16:54 +04:00
SamSys
b0c1f216a1 checkout MainList bug fixed 2025-07-23 19:16:47 +04:00
syntax24
bd42a6d5e9 menu change 2025-07-23 17:19:13 +03:30
syntax24
e924ca7049 change menu 2025-07-23 16:56:40 +03:30
syntax24
482eb8ab0b change menu 2025-07-23 16:54:04 +03:30
SamSys
7541abb92c Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-07-23 16:46:22 +04:00
SamSys
91365f5aeb bug : Load rollCall Contract to Create checkout - Fixed 2025-07-23 16:46:16 +04:00
MahanCh
0664a71047 add contracting party to get financial preview 2025-07-23 13:48:54 +03:30
MahanCh
4ff2596864 fix some bugs for admin monthly overview 2025-07-23 12:42:52 +03:30
MahanCh
744078dd6c add id to select lists 2025-07-23 10:46:00 +03:30
syntax24
1ebc93a1f8 insurance change [workshopId = 666} commented 2025-07-23 03:25:23 +03:30
SamSys
a61c62a2c3 add new metod "CreateFromBankGateway" 2025-07-23 03:43:29 +04:00
syntax24
0981dc20ec appsetting change 2025-07-22 14:21:24 +03:30
MahanCh
e8a65e51db change command 2025-07-22 13:57:58 +03:30
MahanCh
fb10d962a6 Add validation and chnage create financial statement order 2025-07-22 13:32:00 +03:30
syntax24
ad2612b60c change insurance exception workshop 2025-07-22 13:25:29 +03:30
MahanCh
3254db4a62 change financial preivew method to post 2025-07-22 12:22:03 +03:30
MahanCh
8325752355 add userType to login data 2025-07-22 11:09:42 +03:30
MahanCh
bb3a50eb18 add pagination Queryrable - add pagination for workshop select List 2025-07-22 11:07:16 +03:30
MahanCh
767022d0b8 fix bug 2025-07-22 09:39:31 +03:30
SamSys
6e7199cf6d add new option to insurance 2025-07-21 19:43:22 +04:00
MahanCh
9ab4670d68 fix failedBug 2025-07-21 17:52:55 +03:30
MahanCh
d080b093e8 change mediaType for CreateApi 2025-07-21 16:49:17 +03:30
MahanCh
f2717de5bf merge from CreateApi for GetDetailsByPublicId 2025-07-21 15:11:18 +03:30
MahanCh
e5fa554971 change Get details by public Id Name 2025-07-21 15:03:26 +03:30
MahanCh
6932ba7b79 add query for getting data from sms preview 2025-07-21 14:57:36 +03:30
MahanCh
cc3b18bc99 add publicId to financialStatement 2025-07-21 14:19:51 +03:30
MahanCh
194323004b refactor: add redirect from backend to payment gateway 2025-07-21 11:43:29 +03:30
MahanCh
5a3b99d07c add id to workshopSelectList 2025-07-21 11:21:14 +03:30
SamSys
aab65e07dc create rollcall transction add workshop name 2025-07-20 16:42:29 +04:00
MahanCh
3c6e83a967 merge from CreateApiPaymentGateWay 2025-07-20 14:56:19 +03:30
MahanCh
bfd6632940 change the step from paymentCallBack - set transactionId on create PaymentGateway 2025-07-20 14:53:50 +03:30
SamSys
39a91c269d change 2025-07-20 14:50:51 +04:00
SamSys
29875f4870 Create RollCall Transaction Completed 2025-07-20 14:48:51 +04:00
MahanCh
0859cd3ba4 merged from client/financial/api 2025-07-20 13:06:17 +03:30
MahanCh
200f86b270 add using 2025-07-20 13:05:25 +03:30
MahanCh
54b3d6ad2c fix bugs 2025-07-20 13:05:13 +03:30
SamSys
e9ab5c40ef Create Financial Transaction 2025-07-20 13:25:12 +04:00
SamSys
c7b9f2ae20 add RollCall service transaction 2025-07-20 13:14:12 +04:00
MahanCh
bf08af0b3d Merge branch 'Api' of https://github.com/syntax24/OriginalGozareshgir into Api 2025-07-20 12:16:31 +03:30
MahanCh
314ec82133 merge from financial client api branch 2025-07-20 12:16:24 +03:30
MahanCh
76448cdca4 refactor:update get financial for client 2025-07-20 12:15:20 +03:30
SamSys
9f33b481fa Add Create transaction metod 2025-07-20 12:01:28 +04:00
SamSys
f6441f916e Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-07-20 11:27:59 +04:00
SamSys
fe20c63baf change RollcallServiceCreateTransaction 2025-07-20 11:27:41 +04:00
syntax24
5427782b06 Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-07-19 18:27:48 +03:30
syntax24
0806b55dfb add client cors 2025-07-19 18:27:42 +03:30
syntax24
7f68e11f9d Merge branch 'Api' of https://github.com/samsyntax24/OriginalGozareshgir into Api 2025-07-19 18:26:02 +03:30
syntax24
f550aca7f7 add client cors 2025-07-19 18:25:53 +03:30
SamSys
f1f3ff199a Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-07-19 18:43:15 +04:00
SamSys
60252ab032 Insurance bug fix - CreateTransction for rolllCall 2025-07-19 18:43:05 +04:00
MahanCh
15e608a1cf merge from Feature/ContractingParty/AddSearchForSelectList 2025-07-19 16:37:19 +03:30
MahanCh
f3bf66aeb0 feat: add search for contractingparty select list 2025-07-19 16:35:21 +03:30
MahanCh
8ac15191ad merge from create api payment gateway 2025-07-19 15:02:32 +03:30
MahanCh
a177d6063d fix api url bug 2025-07-19 15:01:50 +03:30
MahanCh
59f063b824 merge from createApiGatewat 2025-07-19 13:30:41 +03:30
MahanCh
be2333cac8 add a validation for call back and fill Id in transaction Get details 2025-07-19 13:28:00 +03:30
MahanCh
f8a1aa596d merge from api createApigateway 2025-07-19 13:25:58 +03:30
MahanCh
64422755f2 complete payment gateway 2025-07-19 13:11:46 +03:30
8255e8679e add get profile 2025-07-17 21:15:37 +03:30
MahanCh
62bcd4d6b6 add payment for api gateway 2025-07-17 15:20:34 +03:30
MahanCh
af2c71ea09 add select workshop for admin api 2025-07-16 14:48:27 +03:30
MahanCh
0cb9cfe9b2 refactor: change Search of GetPaymentTransactions 2025-07-16 14:31:43 +03:30
MahanCh
558021ac6a feat: add debt amount in client profile 2025-07-16 14:24:39 +03:30
MahanCh
0b59e6af15 get detail from aqayepardakht for create payment transaction 2025-07-16 12:21:03 +03:30
MahanCh
eecdcc11c0 add dad-mehr api gateway for test 2025-07-16 11:59:02 +03:30
MahanCh
ccbc180c96 add checkout salaryAid option To Create 2025-07-16 11:45:45 +03:30
MahanCh
376d9d1d78 Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-07-16 10:16:11 +03:30
MahanCh
7ddd51034a revert print confirm employer for block workshop 2025-07-16 10:13:34 +03:30
MahanCh
a63fed8c4a add workshopSlug in login controller 2025-07-16 09:50:28 +03:30
SamSys
042530b6e3 Create Debt for stand from Excel 2025-07-16 03:39:33 +04:00
SamSys
0579692a55 add new descriptonOption to financialStatment 2025-07-16 02:49:48 +04:00
SamSys
e26df8026e add new Description Option to financialStatment create and edit 2025-07-16 02:39:46 +04:00
MahanCh
5ebcbcf774 add get profileMethod 2025-07-15 16:00:49 +03:30
MahanCh
2bdfdb366e fix create employee by client 2025-07-15 15:39:32 +03:30
MahanCh
b1a5333a25 add archive code to insurance list 2025-07-15 13:55:17 +03:30
MahanCh
31defcde7e add financialInvoice Module 2025-07-15 13:32:41 +03:30
syntax24
bf24b3b36d api to master merged 2025-07-15 13:11:20 +03:30
MahanCh
e9b115e962 Merge branch 'master' into MergeApiToMaster 2025-07-15 11:52:40 +03:30
MahanCh
6f1e651559 Merge branch 'Feature/Insurance/Employer-Confirm-Print' of https://github.com/syntax24/OriginalGozareshgir into Feature/Insurance/Employer-Confirm-Print 2025-07-15 11:47:21 +03:30
MahanCh
143cc4943c add archivecode and set employer confirm list available 2025-07-15 11:47:16 +03:30
MahanCh
33ae219fbf print confirm employer insurance available in block workshops 2025-07-15 11:25:22 +03:30
MahanCh
8f8a971a41 merge from CreateEmployeeBug 2025-07-15 11:08:40 +03:30
MahanCh
94058660b6 fix create employee bug 2025-07-15 11:07:37 +03:30
SamSys
725559e7c1 new metod to InstitutionContract 2025-07-15 02:58:26 +03:30
MahanCh
aab30b3a4b Fix FinancialStatement bug 2025-07-14 17:19:27 +03:30
MahanCh
a4dbb016d2 add financial invoice 2025-07-14 14:32:58 +03:30
MahanCh
d0e05df33a Add AppSetting Configuration 2025-07-13 16:07:55 +03:30
MahanCh
8eaa739e5e Api merged with master 2025-07-13 15:28:29 +03:30
MahanCh
358544e56c Merge branch 'master' into API 2025-07-13 14:58:30 +03:30
MahanCh
fb52e99c68 add financial statement controller 2025-07-13 14:17:52 +03:30
MahanCh
8eb74fea15 refactor: comment InsuranceConfirm Condtion in InsuranceList index.js 2025-07-13 10:24:52 +03:30
MahanCh
00012cef52 Add RoleName Ro CurrentAccountInfo
Add Payment Transaction Time in Query
2025-07-12 16:29:14 +03:30
MahanCh
ba994a5802 feat: add wallet api for aqaye pardakht 2025-07-10 11:55:18 +03:30
MahanCh
f4ec4f43c6 add institution Contract Excel 2025-07-09 17:19:28 +03:30
MahanCh
030a622252 change payment transaction status 2025-07-09 13:39:42 +03:30
MahanCh
3099881416 Merge branch 'API' of https://github.com/syntax24/OriginalGozareshgir into API 2025-07-09 13:15:31 +03:30
MahanCh
6449776348 feat : add payment transaction controller 2025-07-09 13:15:05 +03:30
MahanCh
e8f7f6b778 fix : update data from edit employee in grouping in cws 2025-07-09 13:01:36 +03:30
MahanCh
513b093c66 set create payment transaction for sandbox creation 2025-07-09 12:45:09 +03:30
MahanCh
b0b8680125 fix: weekly offdays foreign key conflict in CreateEmployeesSettingsAndSetChanges 2025-07-09 12:06:42 +03:30
MahanCh
2e63c7b80a refactor: complete get payment transaction - add paymentCallBack 2025-07-09 11:54:28 +03:30
MahanCh
255d13049e add payment transaction 2025-07-08 16:50:09 +03:30
MahanCh
2714732750 Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-07-08 13:51:59 +03:30
MahanCh
2a78a9dc1a change employee upload picture change name style 2025-07-08 13:51:52 +03:30
MahanCh
60b53f6e39 add payment PaymentGateway 2025-07-08 12:54:23 +03:30
SamSys
87f8517afb Registration Worklow api 2025-07-08 08:29:36 +03:30
SamSys
45a4a735ca register/init merged 2025-07-08 05:57:22 +03:30
SamSys
95b09278aa KababMahdi bug fixed merged 2025-07-07 18:08:08 +03:30
SamSys
6e5f41ec60 dad-mehr ConnectionStrings added 2025-07-07 14:28:15 +03:30
SamSys
f2b3a26471 employeeUploadPicture bug fixed merged 2025-07-07 14:12:27 +03:30
MahanCh
629ae1f0df Merge branch 'master' into API 2025-07-07 14:10:46 +03:30
MahanCh
b9db912441 Revert "set cookie domain"
This reverts commit b3d339d7fb.
2025-07-07 14:00:21 +03:30
MahanCh
b3d339d7fb set cookie domain 2025-07-07 13:01:50 +03:30
SamSys
33e3efeef5 manadatory Compute friday count bug fix 2025-07-07 02:14:38 +03:30
MahanCh
35f948484e chnage use cors placement 2025-07-03 13:46:06 +03:30
MahanCh
4ec744a6bd Merge branch 'API' of https://github.com/syntax24/OriginalGozareshgir into API 2025-07-02 12:03:31 +03:30
MahanCh
c30c460a68 feature : add login controller and get detail profile
Add user profile and permissions handling

- Updated `AuthHelper` to deserialize permissions from claims.
- Introduced `GetDates` method in `GeneralController` for date info.
- Created `LoginController` with `GetProfile` method to return user profile details.
2025-07-02 12:03:25 +03:30
SamSys
6f292ddac6 Program.cs change 2025-07-01 03:23:43 +03:30
MahanCh
5c5f3eefa6 complete new checkout calcualation for kebab mahdi time differences 2025-06-30 13:30:49 +03:30
MahanCh
3fa027dfd1 change rollcall mandatoory computes 2025-06-26 14:43:11 +03:30
MahanCh
b9943cf460 change select list parameter name 2025-06-25 15:50:18 +03:30
MahanCh
8d490cd3fe change name spaces 2025-06-25 15:02:10 +03:30
MahanCh
1e3780be38 change base controllers name - add dates and add admin select List 2025-06-25 15:01:29 +03:30
MahanCh
92f68d8555 fix enum convertor for api and razor 2025-06-25 11:00:35 +03:30
MahanCh
8284ec199f add new rule for rollcall 2025-06-24 12:02:23 +03:30
d27b8484a2 add entire teamwork api to original 2025-06-23 17:07:15 +03:30
5c637e3626 merge from master 2025-06-23 16:00:45 +03:30
SamSys
87afbbe44c change of register 2025-06-03 16:48:42 +03:30
5fa49a4988 change main pages 2025-06-01 18:23:51 +03:30
SamSys
5576ee5c24 api started 2025-05-30 23:04:53 +03:30
MahanCh
99e807fa23 fix step4 bug 2025-05-20 17:45:43 +03:30
MahanCh
2ce17dcac9 change some styles 2025-05-19 18:04:47 +03:30
MahanCh
233c1a3aa9 merge from master 2025-05-19 18:04:36 +03:30
MahanCh
37cd07c2b8 fix conflict 2025-05-18 17:54:55 +03:30
MahanCh
6201492879 change step4 2025-05-18 17:52:33 +03:30
SamSys
489528d076 new version of Register 2025-05-14 21:24:06 +03:30
MahanCh
3a6f87eaca fix some register financial bugs 2025-05-07 22:45:42 +03:30
MahanCh
ec277629fb fix register financial problems 2025-05-04 20:58:45 +03:30
MahanCh
faeb297f5c fix register problems 2025-04-28 15:49:56 +03:30
MahanCh
c3457881b0 add register part 2025-04-23 23:22:26 +03:30
1235 changed files with 1163408 additions and 24719 deletions

View File

@@ -0,0 +1,48 @@
name: Deploy Development ASP.NET Core App to IIS
on:
push:
branches:
- Main
env:
DOTNET_ENVIRONMENT: Development
jobs:
build-and-deploy:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x' # یا نسخه پروژه‌ت
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release
- name: Publish
run: dotnet publish --configuration Release --output ./publish /p:EnvironmentName=Development --no-build
- name: Deploy to IIS via Web Deploy
shell: powershell
run: |
$publishFolder = Resolve-Path ./publish
& "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="Administrator",password="R2rNpdnetP3j>q5b18",authType="Basic" `
-allowUntrusted `
-enableRule:AppOffline
env:
SERVER_HOST: your-server-ip-or-domain
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_PASSWORD: ${{ secrets.DEPLOY_PASSWORD }}

2
.gitignore vendored
View File

@@ -361,4 +361,4 @@ MigrationBackup/
# # Fody - auto-generated XML schema
# FodyWeavers.xsd
.idea

View File

@@ -1,22 +1,44 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>_0_Framework</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="IPE.SmsIR" Version="1.0.5" />
<PackageReference Include="EPPlus" Version="7.5.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.1.34" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Newtonsoft.Json.Bson" Version="1.0.2" />
<PackageReference Include="FluentValidation" Version="12.1.1" />
<PackageReference Include="IPE.SmsIR" Version="1.2.7" />
<PackageReference Include="EPPlus" Version="8.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.3.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="10.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="Newtonsoft.Json.Bson" Version="1.0.3" />
<PackageReference Include="PersianTools.Core" Version="2.0.4" />
<PackageReference Include="System.Drawing.Common" Version="9.0.0" />
<PackageReference Include="MD.PersianDateTime.Standard" Version="2.5.0" />
<PackageReference Include="System.Drawing.Common" Version="10.0.1" />
<PackageReference Include="MD.PersianDateTime.Standard" Version="2.6.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="10.0.1" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.0.1" />
</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

@@ -0,0 +1,8 @@
namespace _0_Framework.Application;
public class AppSettingConfiguration
{
public string Domain { get; set; }
public string ClientDomain =>"client"+Domain;
public string AdminDomain =>"admin"+Domain;
}

View File

@@ -40,7 +40,10 @@ public class AuthHelper : IAuthHelper
result.Mobile = claims.FirstOrDefault(x => x is { Type: "Mobile" }).Value;
result.SubAccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "SubAccountId").Value);
result.WorkshopName = claims.FirstOrDefault(x => x is { Type: "WorkshopName" })?.Value;
return result;
result.Permissions = Tools.DeserializeFromBsonList<int>(claims.FirstOrDefault(x => x is { Type: "permissions" })?.Value);
result.RoleName = claims.FirstOrDefault(x => x is { Type: "RoleName" })?.Value;
result.WorkshopId = long.Parse(claims.FirstOrDefault(x => x.Type == "WorkshopId")?.Value??"0");
return result;
}
public List<int> GetPermissions()
@@ -53,6 +56,11 @@ public class AuthHelper : IAuthHelper
return Tools.DeserializeFromBsonList<int>(permissions); //Mahan
}
public bool HasPermission(int permission)
{
return GetPermissions().Any(x => x == permission);
}
public long CurrentAccountId()
{
return IsAuthenticated()
@@ -74,7 +82,7 @@ public class AuthHelper : IAuthHelper
#region Vafa
public void UpdateWorkshopSlugClaim(string newWorkshopSlug, string newWorkshopName)
public void UpdateWorkshopSlugClaim(string newWorkshopSlug, string newWorkshopName,long newWorkshopId)
{
var user = _contextAccessor.HttpContext.User;
@@ -83,6 +91,7 @@ public class AuthHelper : IAuthHelper
var claimsIdentity = (ClaimsIdentity)user.Identity;
var existingClaimSlug = claimsIdentity.FindFirst("WorkshopSlug");
var existingClaimName = claimsIdentity.FindFirst("WorkshopName");
var existingWorkshopId = claimsIdentity.FindFirst("WorkshopId");
if (existingClaimSlug != null)
{
@@ -94,9 +103,14 @@ public class AuthHelper : IAuthHelper
claimsIdentity.RemoveClaim(existingClaimName);
}
if (existingWorkshopId != null)
{
claimsIdentity.RemoveClaim(existingWorkshopId);
}
claimsIdentity.AddClaim(new Claim("WorkshopSlug", newWorkshopSlug));
claimsIdentity.AddClaim(new Claim("WorkshopName", newWorkshopName));
claimsIdentity.AddClaim(new Claim("WorkshopId",newWorkshopId.ToString()));
var authProperties = new AuthenticationProperties
@@ -126,8 +140,16 @@ public class AuthHelper : IAuthHelper
return "";
}
#endregion
public long GetWorkshopId()
{
return long.Parse(_contextAccessor.HttpContext?.User.Claims.FirstOrDefault(x => x.Type == "WorkshopId")?.Value ?? "0");
}
public string CurrentAccountRole()
{
@@ -180,7 +202,9 @@ public class AuthHelper : IAuthHelper
//mahanChanges
new("workshopList",workshopBson),
new("WorkshopSlug",slug),
new("WorkshopName",account.WorkshopName??"")
new("WorkshopId", account.WorkshopId.ToString()),
new("WorkshopName",account.WorkshopName??""),
new("pm.userId", account.PmUserId.ToString()),
};

View File

@@ -20,16 +20,19 @@ public class AuthViewModel
public int? PositionValue { get; set; }
public string WorkshopSlug { get; set; }
public long WorkshopId { get; set; }
public string WorkshopName { get; set; }
public List<WorkshopClaim> WorkshopList { get; set; }
#endregion
public long SubAccountId { get; set; }
public long? PmUserId { get; set; }
public AuthViewModel(long id, long roleId, string fullname, string username, string mobile,string profilePhoto,
List<int> permissions, string roleName, string adminAreaPermission, string clientAriaPermission, int? positionValue, long subAccountId = 0)
List<int> permissions, string roleName, string adminAreaPermission, string clientAriaPermission, int? positionValue,
long subAccountId = 0,long? pmUserId = null)
{
Id = id;
RoleId = roleId;
@@ -43,6 +46,7 @@ public class AuthViewModel
ClientAriaPermission = clientAriaPermission;
PositionValue = positionValue;
SubAccountId = subAccountId;
PmUserId = pmUserId;
}
public AuthViewModel()

View File

@@ -0,0 +1,8 @@
namespace _0_Framework.Application.Enums;
public enum ActivationStatus
{
None = 0,
Active = 1,
DeActive = 2
}

View File

@@ -0,0 +1,22 @@
namespace _0_Framework.Application.Enums;
/// <summary>
/// وضعیت تایید قرادا مالی
/// </summary>
public enum InstitutionContractVerificationStatus
{
/// <summary>
/// در انتظار تایید
/// </summary>
PendingForVerify = 0,
/// <summary>
/// در انتظار کارپوشه
/// </summary>
PendingWorkflow = 1,
/// <summary>
/// تایید شده
/// </summary>
Verified = 2
}

View File

@@ -0,0 +1,8 @@
namespace _0_Framework.Application.Enums;
public enum LegalType
{
None = 0,
Real = 1,
Legal = 2
}

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,41 @@
namespace _0_Framework.Application.Enums;
public enum TypeOfSmsSetting
{
/// <summary>
/// پیامک
/// یادآور بدهی ماهیانه قرارداد مالی
/// </summary>
InstitutionContractDebtReminder,
/// <summary>
/// پیامک
/// صورت حساب ماهانه قرارداد مالی
/// </summary>
MonthlyInstitutionContract,
/// <summary>
/// پیامک
/// اعلام مسدودی طرف حساب
/// </summary>
BlockContractingParty,
/// <summary>
/// پیامک
/// هشدار اول
/// </summary>
Warning,
/// <summary>
///پیامک اقدام قضائی
/// </summary>
LegalAction,
/// <summary>
/// پیامک تایید قراداد
/// </summary>
InstitutionContractConfirm,
}

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,25 @@
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);
Task<OperationResult> UpdateEmbeddingFullNameAsync(long employeeId, long workshopId, string newFullName);
}
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

@@ -12,16 +12,18 @@ public interface IAuthHelper
string CurrentAccountRole();
AuthViewModel CurrentAccountInfo();
List<int> GetPermissions();
bool HasPermission(int permission);
long CurrentAccountId();
string CurrentAccountMobile();
#region Vafa
void UpdateWorkshopSlugClaim(string workshopSlug, string workshopName);
void UpdateWorkshopSlugClaim(string workshopSlug, string workshopName, long workshopId);
#endregion
long CurrentSubAccountId();
string GetWorkshopSlug();
string GetWorkshopName();
long GetWorkshopId();
(long Id, UserType userType, long roleId) GetUserTypeWithId();
}

View File

@@ -0,0 +1,15 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
namespace _0_Framework.Application;
public class PagedResult<T> where T : class
{
public int TotalCount { get; set; }
public List<T> List { get; set; }
}
public class PagedResult<T,TMeta>:PagedResult<T> where T : class
{
public TMeta? Meta { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace _0_Framework.Application;
public class PaginationRequest
{
public int PageIndex { get; set; } = 1;
public int PageSize { get; set; } = 30;
}

View File

@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Json;
using System.Security.Policy;
using System.Security.Principal;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
namespace _0_Framework.Application.PaymentGateway;
public class AqayePardakhtPaymentGateway:IPaymentGateway
{
private static string _pin = "86EAF2C4D052F7D8759F";
private const string AccountNumber = "AP.1042276242";
private const string EncryptedKey = "130D2@D2923";
private readonly HttpClient _httpClient;
public AqayePardakhtPaymentGateway(IHttpClientFactory httpClientFactory,IOptions<AppSettingConfiguration> appSetting)
{
_httpClient = httpClientFactory.CreateClient();
if (appSetting.Value.Domain == ".dadmehrg.ir")
{
_pin = "7349F84E81AB584862D9";
}
}
public async Task<PaymentGatewayResponse> Create(CreatePaymentGatewayRequest command,CancellationToken cancellationToken =default)
{
var response = await _httpClient.PostAsJsonAsync("https://panel.aqayepardakht.ir/api/v2/create", new
{
pin = _pin,
amount = command.Amount,
callback = command.CallBackUrl,
card_number = command.CardNumber,
invoice_id = command.TransactionId,
mobile = command.Mobile,
email = command.Email??"",
description = command.Description,
}, cancellationToken: cancellationToken);
var resStr = await response.Content.ReadAsStringAsync(cancellationToken);
var result = await response.Content.ReadFromJsonAsync<PaymentGatewayResponse>(cancellationToken: cancellationToken);
return result;
}
public string GetStartPayUrl(string transactionId) =>
$"https://panel.aqayepardakht.ir/startpay/{transactionId}";
public async Task<PaymentGatewayResponse> Verify(VerifyPaymentGateWayRequest command, CancellationToken cancellationToken = default)
{
var response = await _httpClient.PostAsJsonAsync("https://panel.aqayepardakht.ir/api/v2/verify", new
{
pin = _pin,
amount = command.Amount,
transid = command.TransactionId,
}, cancellationToken: cancellationToken);
var result = await response.Content.ReadFromJsonAsync<PaymentGatewayResponse>(cancellationToken: cancellationToken);
return result;
}
public async Task<PaymentGatewayResponse> CreateSandBox(CreatePaymentGatewayRequest command, CancellationToken cancellationToken = default)
{
var response = await _httpClient.PostAsJsonAsync("https://panel.aqayepardakht.ir/api/v2/create", new
{
pin = "sandbox",
amount = command.Amount,
callback = command.CallBackUrl,
card_number = command.Amount,
invoice_id = command.TransactionId,
mobile = command.Mobile,
email = command.Email,
description = command.Email,
}, cancellationToken: cancellationToken);
var result = await response.Content.ReadFromJsonAsync<PaymentGatewayResponse>(cancellationToken: cancellationToken);
return result;
}
public string GetStartPaySandBoxUrl(string transactionId) =>
$"https://panel.aqayepardakht.ir/startpay/sandbox/{transactionId}";
public async Task<WalletAmountResponse> GetWalletAmount(CancellationToken cancellationToken)
{
var response =await _httpClient.PostAsJsonAsync("https://panel.aqayepardakht.ir/api/v2/getmoney", new
{
account=AccountNumber,
code = EncryptedKey
}, cancellationToken: cancellationToken);
var jsonString = await response.Content.ReadAsStringAsync(cancellationToken);
var result = await response.Content.ReadFromJsonAsync<WalletAmountResponse>(cancellationToken);
return result;
}
}

View File

@@ -0,0 +1,67 @@
using Microsoft.AspNetCore.Server.HttpSys;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Tasks;
namespace _0_Framework.Application.PaymentGateway;
public interface IPaymentGateway
{
Task<PaymentGatewayResponse> Create(CreatePaymentGatewayRequest command, CancellationToken cancellationToken =default);
string GetStartPayUrl(string transactionId);
Task<PaymentGatewayResponse> Verify(VerifyPaymentGateWayRequest command, CancellationToken cancellationToken=default);
Task<PaymentGatewayResponse> CreateSandBox(CreatePaymentGatewayRequest command, CancellationToken cancellationToken=default);
string GetStartPaySandBoxUrl(string transactionId);
Task<WalletAmountResponse> GetWalletAmount(CancellationToken cancellationToken);
}
public class PaymentGatewayResponse
{
[JsonPropertyName("status")]
public string Status { get; set; }
[JsonPropertyName("code")]
public int? ErrorCode { get; set; }
[JsonPropertyName("transid")]
public string Token { get; set; }
public bool IsSuccess { get; set; }
public string Message { get; set; }
}
public class WalletAmountResponse
{
[JsonPropertyName("status")]
public string Status { get; set; }
[JsonPropertyName("money")]
public double Amount { get; set; }
[JsonPropertyName("code")]
public int Code { get; set; }
}
public class CreatePaymentGatewayRequest
{
public double Amount { get; set; }
public string TransactionId { get; set; }
public string CallBackUrl { get; set; }
public string CardNumber { get; set; }
public string Mobile { get; set; }
public string Email { get; set; }
public string Description { get; set; }
public long FinancialInvoiceId { get; set; }
public IDictionary<string, object> ExtraData { get; set; }
}
public class VerifyPaymentGateWayRequest
{
public string DigitalReceipt { get; set; }
public string TransactionId { get; set; }
public double Amount { get; set; }
}

View File

@@ -0,0 +1,98 @@
using System;
using System.Collections.Generic;
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)
{
command.ExtraData ??= new Dictionary<string, object>();
command.ExtraData.Add("financialInvoiceId", command.FinancialInvoiceId);
var extraData = JsonConvert.SerializeObject(command.ExtraData);
var res = await _httpClient.PostAsJsonAsync("GetToken", new
{
TerminalID = TerminalId,
Amount = command.Amount,
InvoiceID = command.TransactionId,
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

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _0_Framework.Application;
public static class SecretKeys
{
public static string ProgramManagerInternalApi => "JOb09$Ic3NJd0siLCJtYWMiOiI2%dmODJmNDV";
}

View File

@@ -0,0 +1,7 @@
namespace _0_Framework.Application;
public class SelectListViewModel
{
public long Id { get; set; }
public string Text { get; set; }
}

View File

@@ -26,6 +26,65 @@ public interface ISmsService
#region Mahan
Task<double> GetCreditAmount();
public Task<bool> SendInstitutionCreationVerificationLink(string number, string fullName, Guid institutionId, long contractingPartyId, long institutionContractId, string typeOfSms = null);
public Task<bool> SendInstitutionVerificationCode(string number, string code, string contractingPartyFullName,
long contractingPartyId, long institutionContractId);
SmsResult TaskReminderSms(string number, string taskCount);
#endregion
#region InstitutionContractSMS
/// <summary>
/// پیامک اهانه جدید
/// </summary>
/// <param name="number"></param>
/// <param name="tamplateId"></param>
/// <param name="fullname"></param>
/// <param name="amount"></param>
/// <param name="code1"></param>
/// <param name="code2"></param>
/// <returns></returns>
Task<(byte status, string message, int messaeId, bool isSucceded)> MonthlyBillNew(string number, int tamplateId, string fullname, string amount, string code1,
string code2);
/// <summary>
/// پیامک ماهانه قدیم
/// </summary>
/// <param name="number"></param>
/// <param name="tamplateId"></param>
/// <param name="fullname"></param>
/// <param name="amount"></param>
/// <param name="id"></param>
/// <param name="aprove"></param>
/// <returns></returns>
Task<(byte status, string message, int messaeId, bool isSucceded)> MonthlyBill(string number, int tamplateId, string fullname, string amount, string id, string aprove);
/// <summary>
/// پیامک مسدودی طرف حساب
/// </summary>
/// <param name="number"></param>
/// <param name="fullname"></param>
/// <param name="amount"></param>
/// <param name="accountType"></param>
/// <param name="id"></param>
/// <param name="aprove"></param>
/// <returns></returns>
Task<(byte status, string message, int messaeId, bool isSucceded)> BlockMessage(string number, string fullname, string amount, string accountType, string id, string aprove);
#endregion
#region AlarmMessage
/// <summary>
/// ارسال پیامک های خطا یا اعمال ارسال
/// </summary>
/// <param name="number"></param>
/// <param name="message"></param>
/// <returns></returns>
Task<bool> Alarm(string number, string message);
#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

@@ -0,0 +1,32 @@
namespace _0_Framework.Application.Sms;
public class SmsResult
{
public SmsResult()
{
IsSuccedded = false;
}
public bool IsSuccedded { get; set; }
public string Message { get; set; }
public byte StatusCode { get; set; }
public int MessageId { get; set; }
public SmsResult Succedded(byte statusCode, string message, int messageId)
{
IsSuccedded = true;
Message = message;
StatusCode = statusCode;
MessageId = messageId;
return this;
}
public SmsResult Failed(byte statusCode, string message, int messageId)
{
IsSuccedded = false;
Message = message;
StatusCode = statusCode;
MessageId = messageId;
return this;
}
}

View File

@@ -1,337 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.ComTypes;
using System.Security.AccessControl;
using System.Threading;
using System.Threading.Tasks;
using IPE.SmsIrClient;
using IPE.SmsIrClient.Models.Requests;
using IPE.SmsIrClient.Models.Results;
using Microsoft.Extensions.Configuration;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace _0_Framework.Application.Sms;
public class SmsService : ISmsService
{
private readonly IConfiguration _configuration;
public SmsIr SmsIr { get; set; }
public SmsService(IConfiguration configuration)
{
_configuration = configuration;
SmsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
}
public void Send(string number, string message)
{
//var token = GetToken();
//var lines = new SmsLine().GetSmsLines(token);
//if (lines == null) return;
//var line = lines.SMSLines.Last().LineNumber.ToString();
//var data = new MessageSendObject
//{
// Messages = new List<string>
// {message}.ToArray(),
// MobileNumbers = new List<string> {number}.ToArray(),
// LineNumber = line,
// SendDateTime = DateTime.Now,
// CanContinueInCaseOfError = true
//};
//var messageSendResponseObject =
// new MessageSend().Send(token, data);
//if (messageSendResponseObject.IsSuccessful) return;
//line = lines.SMSLines.First().LineNumber.ToString();
//data.LineNumber = line;
//new MessageSend().Send(token, data);
}
public bool VerifySend(string number, string message)
{
SmsIr smsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
//var bulkSendResult = smsIr.BulkSendAsync(95007079000006, "your text message", new string[] { "9120000000" });
var verificationSendResult = smsIr.VerifySendAsync(number, 768382, new VerifySendParameter[] { new VerifySendParameter("VerificationCode", message) });
Thread.Sleep(2000);
if (verificationSendResult.IsCompletedSuccessfully)
{
var resStartStatus = verificationSendResult.Result;
var b = resStartStatus.Status;
var resResult = verificationSendResult.Status;
var a = verificationSendResult.IsCompleted;
var reseExceptiont = verificationSendResult.Exception;
return true;
}
else
{
var resStartStatus = verificationSendResult.Status;
var resResult = verificationSendResult.Status;
var reseExceptiont = verificationSendResult.Exception;
return false;
}
}
public bool LoginSend(string number, string message)
{
SmsIr smsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
//var bulkSendResult = smsIr.BulkSendAsync(95007079000006, "your text message", new string[] { "9120000000" });
var verificationSendResult = smsIr.VerifySendAsync(number, 635330, new VerifySendParameter[] { new VerifySendParameter("LOGINCODE", message) });
Thread.Sleep(2000);
if (verificationSendResult.IsCompletedSuccessfully)
{
var resStartStatus = verificationSendResult.Result;
var b = resStartStatus.Status;
var resResult = verificationSendResult.Status;
var a = verificationSendResult.IsCompleted;
var reseExceptiont = verificationSendResult.Exception;
return true;
}
else
{
var resStartStatus = verificationSendResult.Status;
var resResult = verificationSendResult.Status;
var reseExceptiont = verificationSendResult.Exception;
return false;
}
}
public async Task<SentSmsViewModel> SendVerifyCodeToClient(string number, string code)
{
SmsIr smsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
var result = new SentSmsViewModel();
//var bulkSendResult = smsIr.BulkSendAsync(95007079000006, "your text message", new string[] { "9120000000" });
var sendResult = await smsIr.VerifySendAsync(number, 768382, new VerifySendParameter[] { new VerifySendParameter("VerificationCode", code) });
Thread.Sleep(2000);
if (sendResult.Message == "موفق")
{
var status = sendResult.Status;
var message = sendResult.Message;
var messaeId = sendResult.Data.MessageId;
return result.Succedded(status, message, messaeId);
}
else
{
var status = sendResult.Status;
var message = sendResult.Message;
var messaeId = sendResult.Data.MessageId;
return result.Failed(status, message, messaeId);
}
}
public bool SendAccountsInfo(string number, string fullName, string userName)
{
var checkLength = fullName.Length;
if (checkLength > 25)
fullName = fullName.Substring(0, 24);
SmsIr smsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
var sendResult = smsIr.VerifySendAsync(number, 725814, new VerifySendParameter[] { new VerifySendParameter("FULLNAME", fullName), new VerifySendParameter("USERNAME", userName), new VerifySendParameter("PASSWORD", userName) });
Console.WriteLine(userName + " - " + sendResult.Result.Status);
if (sendResult.IsCompletedSuccessfully)
{
return true;
}
else
{
return false;
}
}
public async Task<ApiResultViewModel> GetByMessageId(int messId)
{
SmsIr smsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
var response = await smsIr.GetReportAsync(messId);
MessageReportResult messages = response.Data;
var appendData = new ApiResultViewModel()
{
MessageId = messages.MessageId,
LineNumber = messages.LineNumber,
Mobile = messages.Mobile,
MessageText = messages.MessageText,
SendUnixTime = UnixTimeStampToDateTime(messages.SendDateTime),
DeliveryState = DeliveryStatus(messages.DeliveryState),
DeliveryUnixTime = UnixTimeStampToDateTime(messages.DeliveryDateTime),
DeliveryColor = DeliveryColorStatus(messages.DeliveryState),
};
return appendData;
}
public async Task<List<ApiResultViewModel>> GetApiResult(string startDate, string endDate)
{
var st = new DateTime(2024, 6, 2);
var ed = new DateTime(2024, 7, 1);
if (!string.IsNullOrWhiteSpace(startDate) && startDate.Length == 10)
{
st = startDate.ToGeorgianDateTime();
}
if (!string.IsNullOrWhiteSpace(endDate) && endDate.Length == 10)
{
ed = endDate.ToGeorgianDateTime();
}
var res = new List<ApiResultViewModel>();
Int32 unixTimestamp = (int)st.Subtract(new DateTime(1970,1,1)).TotalSeconds;
Int32 unixTimestamp2 = (int)ed.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
// int? fromDateUnixTime = null; // unix time - for instance: 1700598600
//int? toDateUnixTime = null; // unix time - for instance: 1703190600
int pageNumber = 2;
int pageSize = 100; // max: 100
SmsIr smsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
var response = await smsIr.GetArchivedReportAsync(pageNumber, pageSize, unixTimestamp, unixTimestamp2);
MessageReportResult[] messages = response.Data;
foreach (var message in messages)
{
var appendData = new ApiResultViewModel()
{
MessageId = message.MessageId,
LineNumber = message.LineNumber,
Mobile = message.Mobile,
MessageText = message.MessageText,
SendUnixTime = UnixTimeStampToDateTime(message.SendDateTime),
DeliveryState = DeliveryStatus(message.DeliveryState),
DeliveryUnixTime = UnixTimeStampToDateTime(message.DeliveryDateTime),
DeliveryColor = DeliveryColorStatus(message.DeliveryState),
};
res.Add(appendData);
}
return res;
}
public string DeliveryStatus(byte? dv)
{
string mess = "";
switch (dv)
{
case 1:
mess = "رسیده به گوشی";
break;
case 2:
mess = "نرسیده به گوشی";
break;
case 3:
mess = "پردازش در مخابرات";
break;
case 4:
mess = "نرسیده به مخابرات";
break;
case 5:
mess = "سیده به مخابرات";
break;
case 6:
mess = "خطا";
break;
case 7:
mess = "لیست سیاه";
break;
default:
mess="";
break;
}
return mess;
}
public string DeliveryColorStatus(byte? dv)
{
string mess = "";
switch (dv)
{
case 1:
mess = "successSend";
break;
case 2:
mess = "errSend";
break;
case 3:
mess = "pSend";
break;
case 4:
mess = "noSend";
break;
case 5:
mess = "itcSend";
break;
case 6:
mess = "redSend";
break;
case 7:
mess = "blockSend";
break;
default:
mess = "";
break;
}
return mess;
}
public string UnixTimeStampToDateTime(int? unixTimeStamp)
{
if (unixTimeStamp != null)
{
// Unix timestamp is seconds past epoch
DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
dateTime = dateTime.AddSeconds(Convert.ToDouble(unixTimeStamp)).ToLocalTime();
var time = dateTime.ToFarsiFull();
return time;
}
return "";
}
private string GetToken()
{
return "";
//var smsSecrets = _configuration.GetSection("SmsSecrets");
//var tokenService = new Token();
//return tokenService.GetToken("x-api-key", "Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
}
#region Mahan
public async Task<double> GetCreditAmount()
{
try
{
var credit = await SmsIr.GetCreditAsync();
return (double)credit.Data;
}
catch
{
return -1;
}
}
#endregion
}

View File

@@ -30,8 +30,9 @@ public static class StaticWorkshopAccounts
/// 380 - افروز نظری
/// 381 - مهدی قربانی
/// 392 - عمار حسن دوست
/// 20 - سمیرا الهی نیا
/// </summary>
public static List<long> StaticAccountIds = [2, 3, 380, 381, 392];
public static List<long> StaticAccountIds = [2, 3, 380, 381, 392, 20, 476];
/// <summary>
/// این تاریخ در جدول اکانت لفت ورک به این معنیست

View File

@@ -41,6 +41,23 @@ public static class Tools
return Regex.IsMatch(mobileNo, "^((09))(\\d{9})$");
}
/// <summary>
/// تاریخ شروع و تعداد ماه را میگیرد و تاریخ پایان قراردا را بر میگرداند
/// </summary>
/// <param name="startDate"></param>
/// <param name="monthPlus"></param>
/// <returns></returns>
public static (DateTime endDateGr, string endDateFa) FindEndOfContract(string startDate, string monthPlus)
{
int startYear = Convert.ToInt32(startDate.Substring(0, 4));
int startMonth = Convert.ToInt32(startDate.Substring(5, 2));
int startDay = Convert.ToInt32(startDate.Substring(8, 2));
var start = new PersianDateTime(startYear, startMonth, startDay);
var end = (start.AddMonths(Convert.ToInt32(monthPlus))).AddDays(-1);
return ($"{end}".ToGeorgianDateTime(), $"{end}");
}
/// <summary>
/// دریافت روزهای کارکرد پرسنل در لیست بیمه ماه مشخص شده
@@ -460,26 +477,42 @@ public static class Tools
string bb = string.Empty;
bool isNegative = false;
for (int x = 0; x < myMoney.Length; x++)
try
{
if (char.IsDigit(myMoney[x]))
if (!string.IsNullOrWhiteSpace(myMoney))
{
bb += myMoney[x];
}
else if (myMoney[x] == '-' && bb.Length == 0)
{
// اگر علامت منفی قبل از اولین عدد آمد، در نظر بگیر
isNegative = true;
}
}
for (int x = 0; x < myMoney.Length; x++)
{
if (char.IsDigit(myMoney[x]))
{
bb += myMoney[x];
}
else if (myMoney[x] == '-' && bb.Length == 0)
{
// اگر علامت منفی قبل از اولین عدد آمد، در نظر بگیر
isNegative = true;
}
}
if (bb.Length > 0)
{
double res = double.Parse(bb);
return isNegative ? -res : res;
if (bb.Length > 0)
{
double res = double.Parse(bb);
return isNegative ? -res : res;
}
else
{
return 0;
}
}
else
{
return 0;
}
}
else
catch (Exception)
{
return 0;
}
}
@@ -1479,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

@@ -38,7 +38,7 @@ public class UidBasicInformation
{
"GENDER_MALE" => Application.Gender.Male,
"GENDER_FEMALE" => Application.Gender.Female,
_ => throw new ArgumentOutOfRangeException()
_ => Application.Gender.None
};
}
public record IdentificationInformation(string NationalId, string BirthDate, string ShenasnameSeri, string ShenasnameSerial, string ShenasnamehNumber);
@@ -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

@@ -119,7 +119,7 @@ public class BaseCustomizeEntity : EntityBase
public BreakTime BreakTime { get; protected set; }
public List<WeeklyOffDay> WeeklyOffDays { get; set; }
public List<WeeklyOffDay> WeeklyOffDays { get; set; } = [];
public void FridayWorkToWeeklyDayOfWeek()
{

View File

@@ -0,0 +1,9 @@
namespace _0_Framework.Application.Enums
{
public class CheckoutDynamicDeductionItem
{
public string Name { get; set; }
public int Count { get; set; }
public string Amount { get; set; }
}
}

View File

@@ -4,6 +4,7 @@ using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.Storage;
namespace _0_Framework.Domain;
@@ -17,4 +18,6 @@ public interface IRepository<TKey, T> where T:class
bool Exists(Expression<Func<T, bool>> expression);
void SaveChanges();
Task SaveChangesAsync();
Task<IDbContextTransaction> BeginTransactionAsync();
}

View File

@@ -17,7 +17,7 @@ public class ExcelGenerator
{
public ExcelGenerator()
{
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
OfficeOpenXml.ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
}
public static byte[] GenerateExcel<T>(List<T> obj, string date = "") where T : class
{

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

@@ -0,0 +1,97 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using FluentValidation;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace _0_Framework.Exceptions.Handler;
public class CustomExceptionHandler : IExceptionHandler
{
private readonly ILogger<CustomExceptionHandler> _logger;
public CustomExceptionHandler(ILogger<CustomExceptionHandler> logger)
{
_logger = logger;
}
public async ValueTask<bool> TryHandleAsync(HttpContext context, Exception exception, CancellationToken cancellationToken)
{
_logger.LogError(
"Error Message: {exceptionMessage}, Time of occurrence {time}",
exception.Message, DateTime.UtcNow);
(string Detail, string Title, int StatusCode, Dictionary<string, object>? Extra) details = exception switch
{
ValidationException validationException =>
(
validationException.Errors.FirstOrDefault()?.ErrorMessage ?? "One or more validation errors occurred.",
"Validation Error",
context.Response.StatusCode = StatusCodes.Status400BadRequest,
null
),
InternalServerException =>
(
exception.Message,
exception.GetType().Name,
context.Response.StatusCode = StatusCodes.Status500InternalServerError,
null
),
BadRequestException bre =>
(
exception.Message,
exception.GetType().Name,
context.Response.StatusCode = StatusCodes.Status400BadRequest,
bre.Extra
),
NotFoundException =>
(
exception.Message,
exception.GetType().Name,
context.Response.StatusCode = StatusCodes.Status404NotFound,
null
),
UnAuthorizeException =>
(
exception.Message,
exception.GetType().Name,
context.Response.StatusCode = StatusCodes.Status401Unauthorized,
null
),
_ =>
(
exception.Message,
exception.GetType().Name,
context.Response.StatusCode = StatusCodes.Status500InternalServerError,
null
)
};
var problemDetails = new ProblemDetails
{
Title = details.Title,
Detail = details.Detail,
Status = details.StatusCode,
Instance = context.Request.Path,
Extensions = details.Extra ?? new Dictionary<string, object>()
};
problemDetails.Extensions.Add("traceId", context.TraceIdentifier);
await context.Response.WriteAsJsonAsync(problemDetails, cancellationToken: cancellationToken);
return true;
}
}

View File

@@ -0,0 +1,10 @@
using System;
namespace _0_Framework.Exceptions;
public class UnAuthorizeException:Exception
{
public UnAuthorizeException(string message) : base(message)
{
}
}

View File

@@ -0,0 +1,404 @@
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"
};
}
}
public async Task<OperationResult> UpdateEmbeddingFullNameAsync(long employeeId, long workshopId,
string newFullName)
{
try
{
var httpClient = _httpClientFactory.CreateClient();
httpClient.BaseAddress = new Uri(_apiBaseUrl);
httpClient.Timeout = TimeSpan.FromSeconds(30);
var requestBody = new
{
employee_id = employeeId,
workshop_id = workshopId,
employee_full_name = newFullName
};
var response = await httpClient.PutAsJsonAsync("embeddings/update-name", requestBody);
if (response.IsSuccessStatusCode)
{
_logger.LogInformation("Employee Name Changed For {EmployeeId} In workshop ={WorkshopId}", employeeId,
workshopId);
// ارسال اطلاع‌رسانی به سایر سیستم‌ها
if (_notificationService != null)
{
//await _notificationService.NotifyEmbeddingRefinedAsync(workshopId, employeeId);
}
return new OperationResult { IsSuccedded = true, Message = "عملیات با موفقیت انجام شد" };
}
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 Changing EmployeeFullName for Employee {EmployeeId}", employeeId);
return new OperationResult
{
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,29 @@
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;
}
}

View File

@@ -0,0 +1,22 @@
using System.Collections.Generic;
using System.Linq;
namespace _0_Framework.InfraStructure;
public static class QueryableExtensions
{
public static IQueryable<T> ApplyPagination<T>(this IQueryable<T> query, int page, int pageSize = 30)
{
if (page <= 0) page = 1;
if (pageSize <= 0) pageSize = 10;
return query.Skip((page - 1) * pageSize).Take(pageSize);
}
public static IEnumerable<T> ApplyPagination<T>(this IEnumerable<T> source, int page, int pageSize = 30)
{
if (page <= 0) page = 1;
if (pageSize <= 0) pageSize = 10;
return source.Skip((page - 1) * pageSize).Take(pageSize);
}
}

View File

@@ -6,6 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using _0_Framework.Domain;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage;
namespace _0_Framework.InfraStructure
{
@@ -70,5 +71,10 @@ namespace _0_Framework.InfraStructure
{
await _context.SaveChangesAsync();
}
public async Task<IDbContextTransaction> BeginTransactionAsync()
{
return await _context.Database.BeginTransactionAsync();
}
}
}

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

@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using AccountManagement.Application.Contracts.Role;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace AccountManagement.Application.Contracts.Account;
@@ -35,4 +36,20 @@ public class CreateAccount
public string Email { get; set; }
public string VerifyCode { get; set; }
public string IsActiveString { get; set; }
/// <summary>
/// آیا کاربر در پروگرام منیجر فعالیت مبکند؟
/// </summary>
public bool IsProgramManagerUser { get; set; }
/// <summary>
/// لیست نقش های پروگرام منیجر
/// </summary>
public List<long> UserRoles { get; set; }
/// <summary>
/// لیست نقشهای موجود در پروگرام منیجر
/// </summary>
public SelectList RoleList { get; set; }
}

View File

@@ -3,4 +3,5 @@
public class EditAccount : CreateAccount
{
public long Id { get; set; }
}

View File

@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AccountManagement.Application.Contracts.Account;
namespace AccountManagement.Application.Contracts.Account;
public class EditClientAccount : RegisterAccount
{

View File

@@ -2,15 +2,21 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Shared.Contracts.PmUser.Queries;
namespace AccountManagement.Application.Contracts.Account;
public interface IAccountApplication
{
AccountViewModel GetAccountBy(long id);
OperationResult Create(CreateAccount command);
/// <summary>
/// ایجاد کاربر گزارشگیر و پروگرام منیجر
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
Task<OperationResult> Create(CreateAccount command);
OperationResult RegisterClient(RegisterAccount command);
OperationResult Edit(EditAccount command);
Task<OperationResult> Edit(EditAccount command);
OperationResult EditClient(EditClientAccount command);
OperationResult ChangePassword(ChangePassword command);
OperationResult Login(Login command);
@@ -64,4 +70,16 @@ public interface IAccountApplication
/// <param name="userName"></param>
/// <returns></returns>
public bool CheckExistClientAccount(string userName);
List<AccountViewModel> GetAdminAccountsNew();
void CameraLogin(CameraLoginRequest request);
Task<GetPmUserDto> GetPmUserAsync(long accountId);
}
public class CameraLoginRequest
{
public string UserName { get; set; }
public string Password { get; set; }
}

View File

@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using _0_Framework.Application;
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Http;
namespace AccountManagement.Application.Contracts.Account;

View File

@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AccountManagement.Application.Contracts.Account;
namespace AccountManagement.Application.Contracts.Account;
public class WorkshopSelectList
{

View File

@@ -1,15 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.3.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="10.0.1" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\0_Framework\0_Framework.csproj" />
<ProjectReference Include="..\Shared.Contracts\Shared.Contracts.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,11 @@
namespace AccountManagement.Application.Contracts.ProgramManagerApiResult;
public record ApiResponse
{
public bool isSuccess { get; set; }
public string errorMessage { get; set; }
public ErrorType ErrorType { get; set; }
}

View File

@@ -0,0 +1,22 @@
using System.Collections.Generic;
namespace AccountManagement.Application.Contracts.ProgramManagerApiResult;
public record CreateProgramManagerRole
{
/// <summary>
/// نام نقش
/// </summary>
public string RoleName { get; set; }
/// <summary>
/// کدهای دسترسی
/// </summary>
public List<int> Permissions { get; set; }
/// <summary>
/// آی دی اکانت گزارشگیر
/// </summary>
public long? GozareshgirRoleId { get; set; }
};

View File

@@ -0,0 +1,7 @@
using System.Collections.Generic;
namespace AccountManagement.Application.Contracts.ProgramManagerApiResult;
public record CreateProgramManagerUser(string FullName, string UserName, string Password, string Mobile, string Email, long? AccountId, List<long> Roles);
public record EditUserCommand(string FullName, string UserName, string Mobile, long AccountId, List<long> Roles, bool IsActive);

View File

@@ -0,0 +1,11 @@
namespace AccountManagement.Application.Contracts.ProgramManagerApiResult;
public enum ErrorType
{
None,
BadRequest,
NotFound,
Unauthorized,
Validation,
InternalServerError
}

View File

@@ -0,0 +1,22 @@
using System.Collections.Generic;
namespace AccountManagement.Application.Contracts.ProgramManagerApiResult;
public class RoleResponse
{
public bool isSuccess { get; set; }
public RolesData data { get; set; }
}
public class RolesData
{
public List<RoleList> role { get; set; }
}
public class RoleList
{
public int id { get; set; }
public string roleName { get; set; }
public int gozareshgirRoleId { get; set; }
public List<int> permissions { get; set; }
}

View File

@@ -0,0 +1,55 @@
using System.Collections.Generic;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace AccountManagement.Application.Contracts.ProgramManagerApiResult;
public record SingleUserResponseResult
{
public bool isSuccess { get; set; }
public SingleUserData Data { get; set; }
};
public record SingleUserData
{
public long id { get; set; }
/// <summary>
/// نام و نام خانوادگی
/// </summary>
public string fullName { get; set; }
/// <summary>
/// نام کاربری
/// </summary>
public string userName { get; set; }
/// <summary>
/// مسیر عکس پروفایل
/// </summary>
public string profilePhotoPath { get; set; }
/// <summary>
/// شماره موبایل
/// </summary>
public string mobile { get; set; }
/// <summary>
/// فعال/غیر فعال بودن یوزر
/// </summary>
public bool isActive { get; set; }
/// <summary>
/// گذرواژه
/// </summary>
public string password { get; set; }
/// <summary>
/// ای دی اکانت کاربر در گزارشگیر
/// </summary>
public long? accountId { get; set; }
public List<long> Roles { get; set; }
}

View File

@@ -9,6 +9,10 @@ namespace AccountManagement.Application.Contracts.Role
[Required(ErrorMessage = ValidationMessages.IsRequired)]
public string Name { get; set; }
public List<int> Permissions { get; set; }
/// <summary>
/// لیست پرمیشن های پروگرام منیجر
/// </summary>
public List<int> PmPermissions { get; set; }
}
}

View File

@@ -1,13 +1,26 @@
using _0_Framework.Application;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.Collections.Generic;
using System.Threading.Tasks;
using Shared.Contracts.PmRole.Queries;
namespace AccountManagement.Application.Contracts.Role
{
public interface IRoleApplication
{
OperationResult Create(CreateRole command);
OperationResult Edit(EditRole command);
Task<OperationResult> Create(CreateRole command);
Task<OperationResult> Edit(EditRole command);
List<RoleViewModel> List();
EditRole GetDetails(long id);
#region ProgramManager
Task<SelectList> GetPmRoleList(long? gozareshgirRoleId);
Task<List<GetPmRolesDto>> GetPmRoleListToEdit(long? gozareshgirRoleId);
#endregion
}
}

View File

@@ -1,28 +1,26 @@
using System;
using System.Collections;
using _0_Framework.Application;
using _0_Framework.Application;
using _0_Framework.Application.Sms;
using _0_Framework.Exceptions;
using AccountManagement.Application.Contracts.Account;
using AccountManagement.Domain.AccountAgg;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using _0_Framework.Application.Sms;
using AccountManagement.Domain.AccountLeftWorkAgg;
using AccountManagement.Domain.CameraAccountAgg;
using AccountManagement.Domain.RoleAgg;
using CompanyManagment.App.Contracts.Workshop;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Rendering;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
using Company.Domain.WorkshopAgg;
using System.Security.Claims;
using AccountManagement.Domain.PositionAgg;
using AccountManagement.Domain.RoleAgg;
using AccountManagement.Domain.SubAccountAgg;
using AccountManagement.Domain.SubAccountPermissionSubtitle1Agg;
using AccountManagement.Domain.SubAccountRoleAgg;
using Company.Domain._common;
using Company.Domain.WorkshopAgg;
using Company.Domain.WorkshopSubAccountAgg;
using Microsoft.AspNetCore.Mvc.Rendering;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Shared.Contracts.PmUser.Commands;
using Shared.Contracts.PmUser.Queries;
//using AccountManagement.Domain.RoleAgg;
@@ -38,15 +36,19 @@ public class AccountApplication : IAccountApplication
private readonly ISmsService _smsService;
private readonly ICameraAccountRepository _cameraAccountRepository;
private readonly IPositionRepository _positionRepository;
private readonly IAccountLeftworkRepository _accountLeftworkRepository;
private readonly IAccountLeftworkRepository _accountLeftworkRepository;
private readonly IWorkshopRepository _workshopRepository;
private readonly ISubAccountRepository _subAccountRepository;
private readonly ISubAccountRoleRepository _subAccountRoleRepository;
private readonly IWorkshopSubAccountRepository _workshopSubAccountRepository;
private readonly ISubAccountPermissionSubtitle1Repository _accountPermissionSubtitle1Repository;
public AccountApplication(IAccountRepository accountRepository, IPasswordHasher passwordHasher,
IFileUploader fileUploader, IAuthHelper authHelper, IRoleRepository roleRepository, IWorker worker, ISmsService smsService, ICameraAccountRepository cameraAccountRepository, IPositionRepository positionRepository, IAccountLeftworkRepository accountLeftworkRepository, IWorkshopRepository workshopRepository, ISubAccountRepository subAccountRepository, ISubAccountRoleRepository subAccountRoleRepository, IWorkshopSubAccountRepository workshopSubAccountRepository, ISubAccountPermissionSubtitle1Repository accountPermissionSubtitle1Repository)
private readonly IUnitOfWork _unitOfWork;
private readonly IPmUserQueryService _pmUserQueryService;
private readonly IPmUserCommandService _pmUserCommandService;
public AccountApplication(IAccountRepository accountRepository, IPasswordHasher passwordHasher,
IFileUploader fileUploader, IAuthHelper authHelper, IRoleRepository roleRepository, IWorker worker, ISmsService smsService, ICameraAccountRepository cameraAccountRepository, IPositionRepository positionRepository, IAccountLeftworkRepository accountLeftworkRepository, IWorkshopRepository workshopRepository, ISubAccountRepository subAccountRepository, ISubAccountRoleRepository subAccountRoleRepository, IWorkshopSubAccountRepository workshopSubAccountRepository, ISubAccountPermissionSubtitle1Repository accountPermissionSubtitle1Repository, IUnitOfWork unitOfWork, IPmUserQueryService pmUserQueryService, IPmUserCommandService pmUserCommandService)
{
_authHelper = authHelper;
_roleRepository = roleRepository;
@@ -59,10 +61,14 @@ public class AccountApplication : IAccountApplication
_subAccountRoleRepository = subAccountRoleRepository;
_workshopSubAccountRepository = workshopSubAccountRepository;
_accountPermissionSubtitle1Repository = accountPermissionSubtitle1Repository;
_unitOfWork = unitOfWork;
_pmUserQueryService = pmUserQueryService;
_pmUserCommandService = pmUserCommandService;
_fileUploader = fileUploader;
_passwordHasher = passwordHasher;
_accountRepository = accountRepository;
}
public OperationResult EditClient(EditClientAccount command)
@@ -91,7 +97,7 @@ public class AccountApplication : IAccountApplication
var path = $"profilePhotos";
var picturePath = _fileUploader.Upload(command.ProfilePhoto, path);
editAccount.EditClient(command.Fullname,command.Username,command.Mobile,picturePath,command.Email,command.NationalCode);
editAccount.EditClient(command.Fullname, command.Username, command.Mobile, picturePath, command.Email, command.NationalCode);
_accountRepository.SaveChanges();
return opreation.Succcedded();
}
@@ -122,7 +128,7 @@ public class AccountApplication : IAccountApplication
};
}
public OperationResult Create(CreateAccount command)
public async Task<OperationResult> Create(CreateAccount command)
{
var operation = new OperationResult();
@@ -132,15 +138,59 @@ public class AccountApplication : IAccountApplication
var password = _passwordHasher.Hash(command.Password);
var roleName = _roleRepository.GetDetails(command.RoleId);
var path = $"profilePhotos";
var picturePath = "";
if (_fileUploader != null)
{
var picturePath = _fileUploader.Upload(command.ProfilePhoto, path);
var account = new Account(command.Fullname, command.Username, password, command.Mobile, command.RoleId,
picturePath, roleName.Name,"true","false");
_accountRepository.Create(account);
picturePath = _fileUploader.Upload(command.ProfilePhoto, path);
}
var account = new Account(command.Fullname, command.Username, password, command.Mobile, command.RoleId,
picturePath, roleName.Name, "true", "false");
_unitOfWork.BeginAccountContext();
_accountRepository.Create(account);
_accountRepository.SaveChanges();
if (command.IsProgramManagerUser)
{
if (command.UserRoles == null)
return operation.Failed("حداقل یک نقش برای کاربر مدیریت پروژه لازم است");
var pmUserRoles = command.UserRoles.Where(x => x > 0).ToList();
var createPm = await _pmUserCommandService.Create(new CreatePmUserDto(command.Fullname, command.Username, account.Password, command.Mobile,
null, account.id, pmUserRoles));
if (!createPm.isSuccess)
{
_unitOfWork.RollbackAccountContext();
return operation.Failed("خطا در ویرایش کاربر پروگرام منیجر");
}
//var url = "api/user/create";
//var key = SecretKeys.ProgramManagerInternalApi;
//var response = InternalApiCaller.PostAsync<CreateProgramManagerUser, ApiResponse>(
// url,
// key,
// parameters
//);
//if (!response.Success)
//{
// _unitOfWork.RollbackAccountContext();
// return operation.Failed(response.Error);
//}
//if (!response.Result.isSuccess)
//{
// _unitOfWork.RollbackAccountContext();
// return operation.Failed(response.Result.errorMessage);
//}
}
_accountRepository.SaveChanges();
_unitOfWork.CommitAccountContext();
return operation.Succcedded();
}
@@ -154,8 +204,8 @@ public class AccountApplication : IAccountApplication
return opreation.Failed("پر کردن تمامی فیلدها الزامی است");
if (_accountRepository.Exists(x => x.Username == command.Username))
return opreation.Failed("نام کاربری تکراری است");
if (_accountRepository.Exists(x => x.Mobile == command.Mobile && x.IsActiveString =="true"))
if (_accountRepository.Exists(x => x.Mobile == command.Mobile && x.IsActiveString == "true"))
return opreation.Failed("مقادیر وارد شده تکراری است");
//var nationalCodeValidation = command.NationalCode.NationalCodeValid();
@@ -172,14 +222,14 @@ public class AccountApplication : IAccountApplication
// break;
//}
var password = _passwordHasher.Hash(command.Password);
var register =new Account(command.Fullname,command.Username, password, command.Mobile, command.NationalCode);
var register = new Account(command.Fullname, command.Username, password, command.Mobile, command.NationalCode);
_accountRepository.Create(register);
_accountRepository.SaveChanges();
return opreation.Succcedded(register.id,message: "ثبت نام شما با موفقیت انجام شد");
return opreation.Succcedded(register.id, message: "ثبت نام شما با موفقیت انجام شد");
}
public OperationResult Edit(EditAccount command)
public async Task<OperationResult> Edit(EditAccount command)
{
var operation = new OperationResult();
var account = _accountRepository.Get(command.Id);
@@ -193,8 +243,129 @@ public class AccountApplication : IAccountApplication
var roleName = _roleRepository.GetDetails(command.RoleId);
var path = $"profilePhotos";
var picturePath = _fileUploader.Upload(command.ProfilePhoto, path);
_unitOfWork.BeginAccountContext();
account.Edit(command.Fullname, command.Username, command.Mobile, command.RoleId, picturePath, roleName.Name);
_accountRepository.SaveChanges();
var key = SecretKeys.ProgramManagerInternalApi;
//var apiResult = InternalApiCaller.GetAsync<SingleUserResponseResult>(
// $"api/user/{account.id}",
// key
//);
var userResult =await _pmUserQueryService.GetPmUserDataByAccountId(account.id);
if (command.UserRoles == null)
return operation.Failed("حداقل یک نقش برای کاربر مدیریت پروژه لازم است");
var pmUserRoles = command.UserRoles.Where(x => x > 0).ToList();
//اگر کاربر در پروگرام منیجر قبلا ایجاد شده
if (userResult.Id >0)
{
if (!command.UserRoles.Any())
{
_unitOfWork.RollbackAccountContext();
return operation.Failed("حداقل یک نقش باید انتخاب شود");
}
var editPm =await _pmUserCommandService.Edit(new EditPmUserDto(command.Fullname, command.Username, command.Mobile, account.id, pmUserRoles,
command.IsProgramManagerUser));
if (!editPm.isSuccess)
{
_unitOfWork.RollbackAccountContext();
return operation.Failed("خطا در ویرایش کاربر پروگرام منیجر");
}
//var parameters = new EditUserCommand(
// command.Fullname,
// command.Username,
// command.Mobile,
// account.id,
// command.UserRoles,
// command.IsProgramManagerUser
//);
//var url = "api/user/edit";
//var response = InternalApiCaller.PostAsync<EditUserCommand, ApiResponse>(
// url,
// key,
// parameters
//);
//if (!response.Success)
//{
// _unitOfWork.RollbackAccountContext();
// return operation.Failed(response.Error);
//}
//if (!response.Result.isSuccess)
//{
// _unitOfWork.RollbackAccountContext();
// return operation.Failed(response.Error);
//}
}
else //اگر کاربر قبلا ایجاد نشده
{
//اگر تیک فعالیت در پروگرام منیجر روشن بود
if (command.IsProgramManagerUser)
{
if (!command.UserRoles.Any())
{
_unitOfWork.RollbackAccountContext();
return operation.Failed("حداقل یک نقش باید انتخاب شود");
}
var createPm = await _pmUserCommandService.Create(new CreatePmUserDto(command.Fullname, command.Username, account.Password, command.Mobile,
null, account.id, pmUserRoles));
if (!createPm.isSuccess)
{
_unitOfWork.RollbackAccountContext();
return operation.Failed("خطا در ویرایش کاربر پروگرام منیجر");
}
//var parameters = new CreateProgramManagerUser(
// command.Fullname,
// command.Username,
// account.Password,
// command.Mobile,
// command.Email,
// account.id,
// command.UserRoles
//);
//var url = "api/user/Create";
//var response = InternalApiCaller.PostAsync<CreateProgramManagerUser, ApiResponse>(
// url,
// key,
// parameters
//);
//if (!response.Success)
//{
// _unitOfWork.RollbackAccountContext();
// return operation.Failed(response.Error);
//}
//if (!response.Result.isSuccess)
//{
// _unitOfWork.RollbackAccountContext();
// return operation.Failed(response.Error);
//}
}
}
_unitOfWork.CommitAccountContext();
return operation.Succcedded();
}
@@ -209,18 +380,18 @@ public class AccountApplication : IAccountApplication
long idAutoriz = 0;
var operation = new OperationResult();
if (string.IsNullOrWhiteSpace(command.Password))
return operation.Failed(ApplicationMessages.EmptyPassword);
return operation.Failed(ApplicationMessages.EmptyPassword);
if (string.IsNullOrWhiteSpace(command.Username))
return operation.Failed(ApplicationMessages.EmptyUsername);
return operation.Failed(ApplicationMessages.EmptyUsername);
var account = _accountRepository.GetBy(command.Username);
var account = _accountRepository.GetBy(command.Username);
var cameraAccount = _cameraAccountRepository.GetBy(command.Username);
SubAccount subAccount = _subAccountRepository.GetBy(command.Username);
if (account == null && cameraAccount == null && subAccount == null)
return operation.Failed(ApplicationMessages.WrongUserPass);
SubAccount subAccount = _subAccountRepository.GetBy(command.Username);
if (account == null && cameraAccount == null && subAccount == null)
return operation.Failed(ApplicationMessages.WrongUserPass);
if (account != null)
if (account != null)
{
(bool Verified, bool NeedUpgrade) result = _passwordHasher.Check(account.Password, command.Password);
if (!result.Verified)
@@ -229,6 +400,23 @@ public class AccountApplication : IAccountApplication
.Permissions
.Select(x => x.Code)
.ToList();
//PmPermission
var PmUserData = _pmUserQueryService.GetPmUserDataByAccountId(account.id).GetAwaiter().GetResult();
if (PmUserData.AccountId > 0 && PmUserData.IsActive)
{
var pmUserPermissions =
PmUserData.RoleListDto != null
? PmUserData.RoleListDto
.SelectMany(x => x.Permissions)
.Where(p => p != 99)
.Distinct()
.ToList()
: new List<int>();
permissions.AddRange(pmUserPermissions);
}
int? positionValue;
if (account.PositionId != null)
{
@@ -238,14 +426,17 @@ public class AccountApplication : IAccountApplication
{
positionValue = null;
}
var pmUserId = PmUserData.AccountId > 0 ? PmUserData.AccountId : null;
var authViewModel = new AuthViewModel(account.id, account.RoleId, account.Fullname
, account.Username, account.Mobile, account.ProfilePhoto, permissions, account.RoleName, account.AdminAreaPermission, account.ClientAriaPermission, positionValue);
, account.Username, account.Mobile, account.ProfilePhoto,
permissions, account.RoleName, account.AdminAreaPermission,
account.ClientAriaPermission, positionValue,0,pmUserId);
if (account.ClientAriaPermission == "true" && account.AdminAreaPermission == "false" &&
account.IsActiveString == "true")
{
var clientPermissions = _accountPermissionSubtitle1Repository.GetAllPermissionCodes();
authViewModel.Permissions = clientPermissions;
var clientPermissions = _accountPermissionSubtitle1Repository.GetAllPermissionCodes();
authViewModel.Permissions = clientPermissions;
var workshopList = _workshopRepository.GetWorkshopsByClientAccountId(account.id).Select(x => new WorkshopClaim
{
PersonnelCount = x.PersonnelCount,
@@ -254,13 +445,14 @@ public class AccountApplication : IAccountApplication
Slug = _passwordHasher.SlugHasher(x.Id)
}).OrderByDescending(x => x.PersonnelCount).ToList();
authViewModel.WorkshopList = workshopList;
if (workshopList.Any())
{
var workshop = workshopList.First();
authViewModel.WorkshopName = workshop.Name;
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
}
}
if (workshopList.Any())
{
var workshop = workshopList.First();
authViewModel.WorkshopName = workshop.Name;
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
authViewModel.WorkshopId = workshop.Id;
}
}
_authHelper.Signin(authViewModel);
@@ -279,7 +471,7 @@ public class AccountApplication : IAccountApplication
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);
cameraAccount.Username, mobile, cameraAccount.WorkshopName, cameraAccount.AccountId, cameraAccount.IsActiveSting);
if (cameraAccount.IsActiveSting == "true")
{
_authHelper.CameraSignIn(authViewModel);
@@ -289,40 +481,41 @@ public class AccountApplication : IAccountApplication
{
idAutoriz = 0;
}
}
if (subAccount != null)
{
(bool Verified, bool NeedUpgrade) result = _passwordHasher.Check(subAccount.Password, command.Password);
if (!result.Verified)
return operation.Failed(ApplicationMessages.WrongUserPass);
var role = _subAccountRoleRepository.Get(subAccount.SubAccountRoleId);
if (subAccount != null)
{
(bool Verified, bool NeedUpgrade) result = _passwordHasher.Check(subAccount.Password, command.Password);
if (!result.Verified)
return operation.Failed(ApplicationMessages.WrongUserPass);
var role = _subAccountRoleRepository.Get(subAccount.SubAccountRoleId);
var permissions = role.RolePermissions.Select(x => x.PermissionCode).ToList();
var authViewModel = new AuthViewModel(subAccount.AccountId, subAccount.SubAccountRoleId, subAccount.FullName
, subAccount.Username, subAccount.PhoneNumber, "", permissions, role.Title, "false",
"true", 0, subAccount.id);
var workshopList = _workshopSubAccountRepository.GetWorkshopsBySubAccountId(subAccount.id);
authViewModel.WorkshopList = workshopList.Select(x => new WorkshopClaim()
{
Slug = _passwordHasher.SlugHasher(x.WorkshopId),
Name = x.WorkshopName,
PersonnelCount = x.PersonnelCount,
Id = x.WorkshopId
}).ToList();
var permissions = role.RolePermissions.Select(x => x.PermissionCode).ToList();
var authViewModel = new AuthViewModel(subAccount.AccountId, subAccount.SubAccountRoleId, subAccount.FullName
, subAccount.Username, subAccount.PhoneNumber, "", permissions, role.Title, "false",
"true", 0, subAccount.id);
var workshopList = _workshopSubAccountRepository.GetWorkshopsBySubAccountId(subAccount.id);
authViewModel.WorkshopList = workshopList.Select(x => new WorkshopClaim()
{
Slug = _passwordHasher.SlugHasher(x.WorkshopId),
Name = x.WorkshopName,
PersonnelCount = x.PersonnelCount,
Id = x.WorkshopId
}).ToList();
if (workshopList.Any())
{
var workshop = workshopList.First();
authViewModel.WorkshopName = workshop.WorkshopName;
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.WorkshopId);
}
_authHelper.Signin(authViewModel);
idAutoriz = 2;
}
if (workshopList.Any())
{
var workshop = workshopList.First();
authViewModel.WorkshopName = workshop.WorkshopName;
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.WorkshopId);
authViewModel.WorkshopId = workshop.WorkshopId;
}
_authHelper.Signin(authViewModel);
idAutoriz = 2;
}
return operation.Succcedded(idAutoriz);
return operation.Succcedded(idAutoriz);
}
public OperationResult LoginWithMobile(long id)
{
@@ -353,23 +546,24 @@ public class AccountApplication : IAccountApplication
if (account.ClientAriaPermission == "true" && account.AdminAreaPermission == "false" &&
account.IsActiveString == "true")
{
var clientPermissions = _accountPermissionSubtitle1Repository.GetAllPermissionCodes();
authViewModel.Permissions = clientPermissions;
var workshopList = _workshopRepository.GetWorkshopsByClientAccountId(account.id).Select(x => new WorkshopClaim
{
PersonnelCount = x.PersonnelCount,
Id = x.Id,
Name = x.WorkshopFullName,
Slug = _passwordHasher.SlugHasher(x.Id)
}).OrderByDescending(x => x.PersonnelCount).ToList();
authViewModel.WorkshopList = workshopList;
if (workshopList.Any())
{
var workshop = workshopList.First();
authViewModel.WorkshopName = workshop.Name;
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
}
}
var clientPermissions = _accountPermissionSubtitle1Repository.GetAllPermissionCodes();
authViewModel.Permissions = clientPermissions;
var workshopList = _workshopRepository.GetWorkshopsByClientAccountId(account.id).Select(x => new WorkshopClaim
{
PersonnelCount = x.PersonnelCount,
Id = x.Id,
Name = x.WorkshopFullName,
Slug = _passwordHasher.SlugHasher(x.Id)
}).OrderByDescending(x => x.PersonnelCount).ToList();
authViewModel.WorkshopList = workshopList;
if (workshopList.Any())
{
var workshop = workshopList.First();
authViewModel.WorkshopName = workshop.Name;
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
authViewModel.WorkshopId = workshop.Id;
}
}
_authHelper.Signin(authViewModel);
long idAutoriz = 0;
@@ -425,7 +619,7 @@ public class AccountApplication : IAccountApplication
return _accountRepository.GetByUserNameAndId(id, username);
}
public async Task <OperationResult> SetVerifyCode(string phone, long id)
public async Task<OperationResult> SetVerifyCode(string phone, long id)
{
var operation = new OperationResult();
var account = _accountRepository.Get(id);
@@ -439,11 +633,11 @@ public class AccountApplication : IAccountApplication
_smsService.LoginSend(phone, r);
//TimeSpan delay = TimeSpan.FromSeconds(30);
await _accountRepository.RemoveCode(id);
return operation.Succcedded();
}
@@ -494,66 +688,67 @@ public class AccountApplication : IAccountApplication
.Select(x => x.Code)
.ToList();
_authHelper.SignOut();
var authViewModel = new AuthViewModel(account.id, account.RoleId, account.Fullname
, account.Username, account.Mobile, account.ProfilePhoto, permissions, account.RoleName, "false", "true",null);
var workshopList = _workshopRepository.GetWorkshopsByClientAccountId(account.id).Select(x => new WorkshopClaim
{
PersonnelCount = x.PersonnelCount,
Id = x.Id,
Name = x.WorkshopFullName,
Slug = _passwordHasher.SlugHasher(x.Id)
}).OrderByDescending(x => x.PersonnelCount).ToList();
, account.Username, account.Mobile, account.ProfilePhoto, permissions, account.RoleName, "false", "true", null);
var workshopList = _workshopRepository.GetWorkshopsByClientAccountId(account.id).Select(x => new WorkshopClaim
{
PersonnelCount = x.PersonnelCount,
Id = x.Id,
Name = x.WorkshopFullName,
Slug = _passwordHasher.SlugHasher(x.Id)
}).OrderByDescending(x => x.PersonnelCount).ToList();
authViewModel.WorkshopList = workshopList;
authViewModel.WorkshopList = workshopList;
var clientPermissions = _accountPermissionSubtitle1Repository.GetAllPermissionCodes();
var clientPermissions = _accountPermissionSubtitle1Repository.GetAllPermissionCodes();
authViewModel.Permissions = clientPermissions;
if (authViewModel.WorkshopList.Any())
{
var workshop = authViewModel.WorkshopList.First();
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
authViewModel.WorkshopName = workshop.Name;
}
_authHelper.Signin(authViewModel);
if (authViewModel.WorkshopList.Any())
{
var workshop = authViewModel.WorkshopList.First();
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
authViewModel.WorkshopName = workshop.Name;
authViewModel.WorkshopId = workshop.Id;
}
_authHelper.Signin(authViewModel);
return operation.Succcedded(2);
}
public OperationResult DirectCameraLogin(long cameraAccountId)
{
var prAcc = _authHelper.CurrentAccountInfo();
var operation = new OperationResult();
var cameraAccount = _cameraAccountRepository.GetById(cameraAccountId);
if (cameraAccount == null)
return operation.Failed("این اکانت وجود ندارد");
var prAcc = _authHelper.CurrentAccountInfo();
var operation = new OperationResult();
var cameraAccount = _cameraAccountRepository.GetById(cameraAccountId);
if (cameraAccount == null)
return operation.Failed("این اکانت وجود ندارد");
_authHelper.SignOut();
_authHelper.SignOut();
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")
{
_authHelper.CameraSignIn(authViewModel);
}
else
{
return operation.Failed("این اکانت غیر فعال شده است");
}
return operation.Succcedded(2);
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")
{
_authHelper.CameraSignIn(authViewModel);
}
else
{
return operation.Failed("این اکانت غیر فعال شده است");
}
return operation.Succcedded(2);
}
public AccountLeftWorkViewModel WorkshopList(long accountId)
{
string fullname = this._accountRepository.GetById(accountId).Fullname;
List<WorkshopAccountlistViewModel> source =_accountLeftworkRepository.WorkshopList(accountId);
List<WorkshopAccountlistViewModel> source = _accountLeftworkRepository.WorkshopList(accountId);
List<long> userWorkshopIds = source.Select(x => x.WorkshopId).ToList();
List<WorkshopSelectList> allWorkshops = this._accountLeftworkRepository.GetAllWorkshops();
List<AccountViewModel> accountSelectList = this._accountRepository.GetAdminAccountSelectList();
@@ -636,65 +831,65 @@ public class AccountApplication : IAccountApplication
#region Pooya
public OperationResult IsPhoneNumberAndPasswordValid(long accountId, string phoneNumber, string password, string rePassword)
{
OperationResult op = new();
OperationResult op = new();
var entity = _accountRepository.Get(accountId);
var entity = _accountRepository.Get(accountId);
if (entity == null)
return op.Failed(ApplicationMessages.RecordNotFound);
if (entity == null)
return op.Failed(ApplicationMessages.RecordNotFound);
if (!string.IsNullOrWhiteSpace(rePassword) || !string.IsNullOrWhiteSpace(password))
{
if (rePassword != password)
return op.Failed("تکرار رمز عبور با رمز عبور مطابقت ندارد");
if (!string.IsNullOrWhiteSpace(rePassword) || !string.IsNullOrWhiteSpace(password))
{
if (rePassword != password)
return op.Failed("تکرار رمز عبور با رمز عبور مطابقت ندارد");
if (password.Length < 8)
return op.Failed("رمز عبور نمی تواند کمتر از 8 کاراکتر باشد");
}
if (password.Length < 8)
return op.Failed("رمز عبور نمی تواند کمتر از 8 کاراکتر باشد");
}
if ((string.IsNullOrWhiteSpace(phoneNumber) || entity.Mobile == phoneNumber) && string.IsNullOrWhiteSpace(rePassword))
return op.Failed("چیزی برای تغییر وجود ندارد");
if ((string.IsNullOrWhiteSpace(phoneNumber) || entity.Mobile == phoneNumber) && string.IsNullOrWhiteSpace(rePassword))
return op.Failed("چیزی برای تغییر وجود ندارد");
if (!string.IsNullOrWhiteSpace(phoneNumber) && entity.Mobile != phoneNumber)
{
phoneNumber = phoneNumber.Trim();
if (phoneNumber.Length != 11)
return op.Failed("شماره تلفن همراه به درستی وارد نشده است");
if (_accountRepository.Exists(x => x.Mobile == phoneNumber && x.id != accountId) ||
_subAccountRepository.Exists(x => x.PhoneNumber == phoneNumber) ||
_cameraAccountRepository.Exists(x => x.Mobile == phoneNumber))
return op.Failed("قبلا یک حساب با این شماره ثبت شده است");
}
if (!string.IsNullOrWhiteSpace(phoneNumber) && entity.Mobile != phoneNumber)
{
phoneNumber = phoneNumber.Trim();
if (phoneNumber.Length != 11)
return op.Failed("شماره تلفن همراه به درستی وارد نشده است");
if (_accountRepository.Exists(x => x.Mobile == phoneNumber && x.id != accountId) ||
_subAccountRepository.Exists(x => x.PhoneNumber == phoneNumber) ||
_cameraAccountRepository.Exists(x => x.Mobile == phoneNumber))
return op.Failed("قبلا یک حساب با این شماره ثبت شده است");
}
return op.Succcedded();
}
return op.Succcedded();
}
public OperationResult ChangePasswordAndPhoneNumber(AccountChangePasswordAndPhoneNumber command)
{
OperationResult op = new();
command.PhoneNumber = command.PhoneNumber.Trim();
var entity = _accountRepository.Get(command.AccountId);
if (entity == null)
return op.Failed(ApplicationMessages.RecordNotFound);
var validationResult = IsPhoneNumberAndPasswordValid(command.AccountId, command.PhoneNumber, command.Password, command.RePassword);
if (validationResult.IsSuccedded == false)
return validationResult;
OperationResult op = new();
command.PhoneNumber = command.PhoneNumber.Trim();
var entity = _accountRepository.Get(command.AccountId);
if (entity == null)
return op.Failed(ApplicationMessages.RecordNotFound);
var validationResult = IsPhoneNumberAndPasswordValid(command.AccountId, command.PhoneNumber, command.Password, command.RePassword);
if (validationResult.IsSuccedded == false)
return validationResult;
if (!string.IsNullOrWhiteSpace(command.RePassword))
{
if (!string.IsNullOrWhiteSpace(command.RePassword))
{
entity.ChangePassword(_passwordHasher.Hash(command.Password));
}
entity.ChangePassword(_passwordHasher.Hash(command.Password));
}
if (!string.IsNullOrWhiteSpace(command.PhoneNumber))
{
entity.Edit(entity.Fullname, entity.Username, command.PhoneNumber, entity.RoleId, entity.ProfilePhoto, entity.RoleName);
}
_accountRepository.SaveChanges();
return op.Succcedded();
}
if (!string.IsNullOrWhiteSpace(command.PhoneNumber))
{
entity.Edit(entity.Fullname, entity.Username, command.PhoneNumber, entity.RoleId, entity.ProfilePhoto, entity.RoleName);
}
_accountRepository.SaveChanges();
return op.Succcedded();
}
//public UserClaimsResponseDTO GetClaimsForSignIn(Login command)
//{
// var operation = new OperationResult();
@@ -795,4 +990,38 @@ 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);
}
public async Task<GetPmUserDto> GetPmUserAsync(long accountId)
{
return await _pmUserQueryService.GetPmUserDataByAccountId(accountId);
}
}

View File

@@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\AccountManagement.Application.Contracts\AccountManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\AccountManagement.Domain\AccountManagement.Domain.csproj" />
<ProjectReference Include="..\Company.Domain\Company.Domain.csproj" />
<ProjectReference Include="..\Shared.Contracts\Shared.Contracts.csproj" />
</ItemGroup>

View File

@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Account;
using AccountManagement.Application.Contracts.CameraAccount;

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using _0_Framework.Application;

View File

@@ -2,6 +2,14 @@
using AccountManagement.Application.Contracts.Role;
using AccountManagement.Domain.RoleAgg;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Company.Domain._common;
using Microsoft.AspNetCore.Mvc.Rendering;
using Shared.Contracts.PmRole.Commands;
using GetPmRolesDto = Shared.Contracts.PmRole.Queries.GetPmRolesDto;
using Role = AccountManagement.Domain.RoleAgg.Role;
using Shared.Contracts.PmRole.Queries;
namespace AccountManagement.Application;
@@ -9,32 +17,82 @@ public class RoleApplication : IRoleApplication
{
private readonly IRoleRepository _roleRepository;
public RoleApplication(IRoleRepository roleRepository)
private readonly IPmRoleQueryService _pmRoleQueryService;
private readonly IPmRoleCommandService _pmRoleCommandService;
private readonly IUnitOfWork _unitOfWork;
public RoleApplication(IRoleRepository roleRepository, IUnitOfWork unitOfWork, IPmRoleQueryService pmRoleQueryService, IPmRoleCommandService pmRoleCommandService)
{
_roleRepository = roleRepository;
_unitOfWork = unitOfWork;
_pmRoleQueryService = pmRoleQueryService;
_pmRoleCommandService = pmRoleCommandService;
}
public OperationResult Create(CreateRole command)
public async Task<OperationResult> Create(CreateRole command)
{
var operation = new OperationResult();
if (_roleRepository.Exists(x => x.Name == command.Name))
return operation.Failed(ApplicationMessages.DuplicatedRecord);
var permissions = new List<Permission>();
foreach (var code in command.Permissions)
{
if (code > 0)
{
permissions.Add(new Permission(code));
}
}
//command.Permissions.ForEach(code => permissions.Add(new Permission(code)));
var permissions = command.Permissions.Where(x => x > 0).Select(x => new Permission(x)).ToList();
var role = new Role(command.Name, permissions);
_unitOfWork.BeginAccountContext();
_roleRepository.Create(role);
_roleRepository.SaveChanges();
var pmPermissions = command.PmPermissions.Where(x => x > 0).ToList();
if (pmPermissions.Any())
{
var pmRole = new CreatePmRoleDto{ RoleName = command.Name, Permissions = pmPermissions, GozareshgirRoleId = role.id};
var res =await _pmRoleCommandService.Create(pmRole);
if (!res.Item1)
{
_unitOfWork.RollbackAccountContext();
return operation.Failed("خطا در ویرایش دسترسی ها در پروگرام منیجر");
}
//var parameters = new CreateProgramManagerRole
//{
// RoleName = command.Name,
// Permissions = pmPermissions,
// GozareshgirRoleId = role.id
//};
//var url = "api/role";
//var key = SecretKeys.ProgramManagerInternalApi;
//var response = InternalApiCaller.PostAsync<CreateProgramManagerRole, ApiResponse>(
// url,
// key,
// parameters
//);
//if (!response.Success)
//{
// _unitOfWork.RollbackAccountContext();
// return operation.Failed("ارتباط با اپلیکیش پروگرام منیجر برقرار نشد");
//}
//if (!response.Result.isSuccess)
//{
// _unitOfWork.RollbackAccountContext();
// return operation.Failed(response.Result.errorMessage);
//}
}
//command.Permissions.ForEach(code => permissions.Add(new Permission(code)));
_unitOfWork.CommitAccountContext();
return operation.Succcedded();
}
public OperationResult Edit(EditRole command)
public async Task<OperationResult> Edit(EditRole command)
{
var operation = new OperationResult();
var role = _roleRepository.Get(command.Id);
@@ -47,17 +105,134 @@ public class RoleApplication : IRoleApplication
//var permissions = new List<Permission>();
//command.Permissions.ForEach(code => permissions.Add(new Permission(code)));
var permissions = new List<Permission>();
foreach (var code in command.Permissions)
{
if (code > 0)
{
permissions.Add(new Permission(code));
}
}
var permissions = command.Permissions.Where(x => x > 0).Select(x => new Permission(x)).ToList();
_unitOfWork.BeginAccountContext();
role.Edit(command.Name, permissions);
_roleRepository.SaveChanges();
var key = SecretKeys.ProgramManagerInternalApi;
var pmPermissions = command.PmPermissions.Where(x => x > 0).ToList();
//یافتن نقش در پروگرام منیجر
//var apiResult = InternalApiCaller.GetAsync<RoleResponse>(
// "api/role",
// key,
// new Dictionary<string, object>
// {
// { "RoleName", "" },
// { "GozareshgirRoleId", command.Id}
// }
//);
var pmRoleListResult = await _pmRoleQueryService.GetPmRoleList(command.Id);
var pmRoleResult = pmRoleListResult.FirstOrDefault();
//اگر این نقش در پروگرام منیجر وجود داشت ویرایش کن
if (pmRoleResult != null)
{
var edit = new CreatePmRoleDto { RoleName = command.Name, Permissions = pmPermissions, GozareshgirRoleId = role.id };
var res = await _pmRoleCommandService.Edit(edit);
if (!res.Item1)
{
_unitOfWork.RollbackAccountContext();
return operation.Failed("خطا در ویرایش دسترسی ها در پروگرام منیجر");
}
//var parameters = new CreateProgramManagerRole
//{
// RoleName = command.Name,
// Permissions = pmPermissions,
// GozareshgirRoleId = role.id
//};
//var url = "api/role/edit";
//var response = InternalApiCaller.PostAsync<CreateProgramManagerRole, ApiResponse>(
// url,
// key,
// parameters
//);
//if (!response.Success)
//{
// _unitOfWork.RollbackAccountContext();
// return operation.Failed("ارتباط با اپلیکیش پروگرام منیجر برقرار نشد");
//}
//if (!response.Result.isSuccess)
//{
// _unitOfWork.RollbackAccountContext();
// return operation.Failed(response.Result.errorMessage);
//}
}
else //اگر نقش در پروگرام منیجر وجود نداشت
{
//اگر تیک پرمیشن های پروگرام منیجر زده شده
//این نقش را سمت پروگرام منیجر بساز
if (pmPermissions.Any())
{
var pmRole = new CreatePmRoleDto { RoleName = command.Name, Permissions = pmPermissions, GozareshgirRoleId = role.id };
var res = await _pmRoleCommandService.Create(pmRole);
if (!res.Item1)
{
_unitOfWork.RollbackAccountContext();
return operation.Failed("خطا در ویرایش دسترسی ها در پروگرام منیجر");
}
//try
//{
// var pmPermissionsData = pmPermissions.Where(x => x > 0).Select(x => new PmPermission(x)).ToList();
// var pmRole = new PmRole(command.Name, command.Id, pmPermissionsData);
// await _pmRoleRepository.CreateAsync(pmRole);
// await _pmRoleRepository.SaveChangesAsync();
//}
//catch (System.Exception)
//{
// _unitOfWork.RollbackAccountContext();
// return operation.Failed("خطا در ویرایش دسترسی ها در پروگرام منیجر");
//}
//var parameters = new CreateProgramManagerRole
//{
// RoleName = command.Name,
// Permissions = pmPermissions,
// GozareshgirRoleId = role.id
//};
//var url = "api/role";
//var response = InternalApiCaller.PostAsync<CreateProgramManagerRole, ApiResponse>(
// url,
// key,
// parameters
//);
//if (!response.Success)
//{
// _unitOfWork.RollbackAccountContext();
// return operation.Failed("ارتباط با اپلیکیش پروگرام منیجر برقرار نشد");
//}
//if (!response.Result.isSuccess)
//{
// _unitOfWork.RollbackAccountContext();
// return operation.Failed(response.Result.errorMessage);
//}
}
}
_unitOfWork.CommitAccountContext();
return operation.Succcedded();
}
@@ -70,4 +245,23 @@ public class RoleApplication : IRoleApplication
{
return _roleRepository.List();
}
public async Task<SelectList> GetPmRoleList(long? gozareshgirRoleId)
{
var rolse = await _pmRoleQueryService.GetPmRoleList(gozareshgirRoleId);
return new SelectList(rolse, "Id", "RoleName");
}
public async Task<List<GetPmRolesDto>> GetPmRoleListToEdit(long? gozareshgirRoleId)
{
return await _pmRoleQueryService.GetPmRoleList(gozareshgirRoleId);
}
}

View File

@@ -5,14 +5,11 @@ using AccountManagement.Domain.AccountAgg;
using AccountManagement.Domain.CameraAccountAgg;
using AccountManagement.Domain.SubAccountAgg;
using AccountManagement.Domain.SubAccountRoleAgg;
using Company.Domain.WorkshopAccountAgg;
using Company.Domain.WorkshopSubAccountAgg;
using CompanyManagment.App.Contracts.Workshop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
namespace AccountManagement.Application

View File

@@ -1,9 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.TaskSubject;
using AccountManagement.Domain.TaskSubjectAgg;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
namespace AccountManagement.Application;

View File

@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.4">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@@ -1,9 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.3.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="10.0.1" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\0_Framework\0_Framework.csproj" />
<ProjectReference Include="..\AccountManagement.Application.Contracts\AccountManagement.Application.Contracts.csproj" />

View File

@@ -0,0 +1,155 @@
using Newtonsoft.Json;
using System.Net.Http;
using System.Text;
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.Configuration;
namespace AccountManagement.Domain.InternalApiCaller;
public class ApiResult<T>
{
public bool Success { get; set; }
public T Result { get; set; }
public string Error { get; set; }
}
public static class InternalApiCaller
{
private static string _baseUrl = "";
public static void SetBaseUrl(string baseUrl)
{
_baseUrl = baseUrl.TrimEnd('/'); // حذف / اضافی
}
/// <summary>
///api post متد
/// </summary>
/// <typeparam name="TRequest"></typeparam>
/// <typeparam name="TResponse"></typeparam>
/// <param name="url"></param>
/// <param name="internalKey"></param>
/// <param name="body"></param>
/// <returns></returns>
public static ApiResult<TResponse> PostAsync<TRequest, TResponse>(
string url,
string internalKey,
TRequest body
)
{
try
{
var client = new HttpClient();
// ساخت URL نهایی
var finalUrl = $"{_baseUrl}/{url.TrimStart('/')}";
var request = new HttpRequestMessage(HttpMethod.Post, finalUrl);
request.Headers.Add("X-INTERNAL-KEY", internalKey);
var json = JsonConvert.SerializeObject(body);
request.Content = new StringContent(json, Encoding.UTF8, "application/json");
var response = client.SendAsync(request).GetAwaiter().GetResult();
if (!response.IsSuccessStatusCode)
{
return new ApiResult<TResponse>
{
Success = false,
Error = $"HTTP Error: {response.StatusCode}"
};
}
var text = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
var deserialized = JsonConvert.DeserializeObject<TResponse>(text);
return new ApiResult<TResponse>
{
Success = true,
Result = deserialized
};
}
catch (Exception ex)
{
return new ApiResult<TResponse>
{
Success = false,
Error = ex.Message
};
}
}
/// <summary>
/// Api Get متد
/// </summary>
/// <typeparam name="TResponse"></typeparam>
/// <param name="url"></param>
/// <param name="internalKey"></param>
/// <param name="parameters"></param>
/// <returns></returns>
public static ApiResult<TResponse> GetAsync<TResponse>(
string url,
string internalKey,
Dictionary<string, object> parameters = null
)
{
try
{
if (parameters != null && parameters.Any())
{
var query = string.Join("&",
parameters
.Where(p => p.Value != null)
.Select(p => $"{p.Key}={p.Value}")
);
url += url.Contains("?") ? "&" + query : "?" + query;
}
// ساخت URL نهایی
var finalUrl = $"{_baseUrl}/{url.TrimStart('/')}";
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, finalUrl);
request.Headers.Add("X-INTERNAL-KEY", internalKey);
var response = client.SendAsync(request).GetAwaiter().GetResult();
if (!response.IsSuccessStatusCode)
{
return new ApiResult<TResponse>
{
Success = false,
Error = $"HTTP Error: {response.StatusCode}"
};
}
var text = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
var deserialized = JsonConvert.DeserializeObject<TResponse>(text);
return new ApiResult<TResponse>
{
Success = true,
Result = deserialized
};
}
catch (Exception ex)
{
return new ApiResult<TResponse>
{
Success = false,
Error = ex.Message
};
}
}
}

View File

@@ -1,4 +1,4 @@
using AccountManagement.Domain.AccountAgg;
using AccountManagement.Domain.AccountAgg;
using AccountMangement.Infrastructure.EFCore.Mappings;
using Microsoft.EntityFrameworkCore;
using System;
@@ -26,7 +26,6 @@ using AccountManagement.Domain.SubAccountPermissionSubtitle2Agg;
using AccountManagement.Domain.SubAccountPermissionSubtitle3Agg;
using AccountManagement.Domain.SubAccountPermissionSubtitle4Agg;
using AccountManagement.Domain.SubAccountRoleAgg;
using AccountMangement.Infrastructure.EFCore.Seed;
using AccountManagement.Domain.TaskScheduleAgg;
namespace AccountMangement.Infrastructure.EFCore
@@ -60,9 +59,10 @@ namespace AccountMangement.Infrastructure.EFCore
public DbSet<TaskSchedule> TaskSchedules { get; set; }
#endregion
#region Pooya
public DbSet<SubAccount> SubAccounts { get; set; }
public DbSet<SubAccountRole> SubAccountRoles { get; set; }

View File

@@ -1,13 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.4">
<PackageReference Include="Azure.Identity" Version="1.17.1" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.3.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
@@ -18,4 +20,12 @@
<ProjectReference Include="..\Company.Domain\Company.Domain.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Services\" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Mappings\BugReportMapping.cs" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,31 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AccountMangement.Infrastructure.EFCore.Migrations
{
/// <inheritdoc />
public partial class addprogrammangerbooinaccount : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsProgramManagerUser",
table: "Accounts",
type: "bit",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsProgramManagerUser",
table: "Accounts");
}
}
}

View File

@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AccountMangement.Infrastructure.EFCore.Migrations
{
/// <inheritdoc />
public partial class romoveIsProgramManagerUserFromAccount : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsProgramManagerUser",
table: "Accounts");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsProgramManagerUser",
table: "Accounts",
type: "bit",
nullable: false,
defaultValue: false);
}
}
}

View File

@@ -17,7 +17,7 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.10")
.HasAnnotation("ProductVersion", "10.0.1")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
@@ -377,6 +377,87 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
b.ToTable("Medias", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.PmDomains.PmRoleAgg.PmRole", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<long?>("GozareshgirRoleId")
.HasColumnType("bigint");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("id");
b.ToTable("PmRoles", null, t =>
{
t.ExcludeFromMigrations();
});
});
modelBuilder.Entity("AccountManagement.Domain.PmDomains.PmUserAgg.PmUser", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long?>("AccountId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Email")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<string>("FullName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<bool>("IsActive")
.HasColumnType("bit");
b.Property<string>("Mobile")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("nvarchar(20)");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<string>("ProfilePhotoPath")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<string>("UserName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("VerifyCode")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.HasKey("id");
b.ToTable("Users", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.PositionAgg.Position", b =>
{
b.Property<long>("id")
@@ -1001,6 +1082,71 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
b.Navigation("Media");
});
modelBuilder.Entity("AccountManagement.Domain.PmDomains.PmRoleAgg.PmRole", b =>
{
b.OwnsMany("AccountManagement.Domain.PmDomains.PmPermissionAgg.PmPermission", "PmPermission", b1 =>
{
b1.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
b1.Property<int>("Code")
.HasColumnType("int");
b1.Property<long>("Roleid")
.HasColumnType("bigint");
b1.HasKey("Id");
b1.HasIndex("Roleid");
b1.ToTable("PmRolePermissions", null, t =>
{
t.ExcludeFromMigrations();
});
b1.WithOwner("Role")
.HasForeignKey("Roleid");
b1.Navigation("Role");
});
b.Navigation("PmPermission");
});
modelBuilder.Entity("AccountManagement.Domain.PmDomains.PmUserAgg.PmUser", b =>
{
b.OwnsMany("AccountManagement.Domain.PmDomains.PmRoleUserAgg.PmRoleUser", "RoleUser", b1 =>
{
b1.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
b1.Property<long>("RoleId")
.HasColumnType("bigint");
b1.Property<long>("Userid")
.HasColumnType("bigint");
b1.HasKey("Id");
b1.HasIndex("Userid");
b1.ToTable("RoleUsers", (string)null);
b1.WithOwner("User")
.HasForeignKey("Userid");
b1.Navigation("User");
});
b.Navigation("RoleUser");
});
modelBuilder.Entity("AccountManagement.Domain.RoleAgg.Role", b =>
{
b.OwnsMany("AccountManagement.Domain.RoleAgg.Permission", "Permissions", b1 =>

175
BUG_REPORT_SYSTEM.md Normal file
View File

@@ -0,0 +1,175 @@
# سیستم گزارش خرابی (Bug Report System)
## نمای کلی
این سیستم برای جمع‌آوری، ذخیره و مدیریت گزارش‌های خرابی از تطبیق موبایلی طراحی شده است.
## ساختار فایل‌ها
### Domain Layer
- `AccountManagement.Domain/BugReportAgg/`
- `BugReport.cs` - موجودیت اصلی
- `BugReportLog.cs` - لاگ‌های گزارش
- `BugReportScreenshot.cs` - تصاویر ضمیمه شده
### Application Contracts
- `AccountManagement.Application.Contracts/BugReport/`
- `IBugReportApplication.cs` - اینترفیس سرویس
- `CreateBugReportCommand.cs` - درخواست ایجاد
- `EditBugReportCommand.cs` - درخواست ویرایش
- `BugReportViewModel.cs` - نمایش لیست
- `BugReportDetailViewModel.cs` - نمایش جزئیات
- `IBugReportRepository.cs` - اینترفیس Repository
### Application Service
- `AccountManagement.Application/BugReportApplication.cs` - پیاده‌سازی سرویس
### Infrastructure
- `AccountMangement.Infrastructure.EFCore/`
- `Mappings/BugReportMapping.cs`
- `Mappings/BugReportLogMapping.cs`
- `Mappings/BugReportScreenshotMapping.cs`
- `Repository/BugReportRepository.cs`
### API Controller
- `ServiceHost/Controllers/BugReportController.cs`
### Admin Pages
- `ServiceHost/Areas/AdminNew/Pages/BugReport/`
- `BugReportPageModel.cs` - base model
- `Index.cshtml.cs / Index.cshtml` - لیست گزارش‌ها
- `Details.cshtml.cs / Details.cshtml` - جزئیات کامل
- `Edit.cshtml.cs / Edit.cshtml` - ویرایش وضعیت/اولویت
- `Delete.cshtml.cs / Delete.cshtml` - حذف
## روش استفاده
### 1. ثبت گزارش از موبایل
```csharp
POST /api/bugreport/submit
{
"title": "برنامه هنگام ورود خراب می‌شود",
"description": "هنگام وارد کردن نام کاربری، برنامه کرش می‌کند",
"userEmail": "user@example.com",
"deviceModel": "Samsung Galaxy S21",
"osVersion": "Android 12",
"platform": "Android",
"manufacturer": "Samsung",
"deviceId": "device-unique-id",
"screenResolution": "1440x3200",
"memoryInMB": 8000,
"storageInMB": 256000,
"batteryLevel": 75,
"isCharging": false,
"networkType": "4G",
"appVersion": "1.0.0",
"buildNumber": "100",
"packageName": "com.example.app",
"installTime": "2024-01-01T10:00:00Z",
"lastUpdateTime": "2024-12-01T14:30:00Z",
"flavor": "production",
"type": 1, // Crash = 1
"priority": 2, // High = 2
"stackTrace": "...",
"logs": ["log1", "log2"],
"screenshots": ["base64-encoded-image-1"]
}
```
### 2. دسترسی به Admin Panel
```
https://yourdomain.com/AdminNew/BugReport
```
**صفحات موجود:**
- **Index** - لیست تمام گزارش‌ها با فیلترها
- **Details** - نمایش جزئیات کامل شامل:
- معلومات کاربر و گزارش
- معلومات دستگاه
- معلومات برنامه
- لاگ‌ها
- تصاویر
- Stack Trace
- **Edit** - تغییر وضعیت و اولویت
- **Delete** - حذف گزارش
### 3. درخواست‌های API
#### دریافت لیست
```
GET /api/bugreport/list?type=1&priority=2&status=1&searchTerm=crash&pageNumber=1&pageSize=10
```
#### دریافت جزئیات
```
GET /api/bugreport/{id}
```
#### ویرایش
```
PUT /api/bugreport/{id}
{
"id": 1,
"priority": 2,
"status": 3
}
```
#### حذف
```
DELETE /api/bugreport/{id}
```
## انواع (Enums)
### BugReportType
- `1` - Crash (کرش)
- `2` - UI (مشکل رابط)
- `3` - Performance (عملکرد)
- `4` - Feature (فیچر)
- `5` - Network (شبکه)
- `6` - Camera (دوربین)
- `7` - FaceRecognition (تشخیص چهره)
- `8` - Database (دیتابیس)
- `9` - Login (ورود)
- `10` - Other (سایر)
### BugPriority
- `1` - Critical (بحرانی)
- `2` - High (بالا)
- `3` - Medium (متوسط)
- `4` - Low (پایین)
### BugReportStatus
- `1` - Open (باز)
- `2` - InProgress (در حال بررسی)
- `3` - Fixed (رفع شده)
- `4` - Closed (بسته شده)
- `5` - Reopened (مجدداً باز)
## Migration
برای اعمال تغییرات دیتابیس:
```powershell
Add-Migration AddBugReportTables
Update-Database
```
## نکات مهم
1. **تصاویر**: تصاویر به صورت Base64 encoded ذخیره می‌شوند
2. **لاگ‌ها**: تمام لاگ‌ها به صورت جدا ذخیره می‌شوند
3. **وضعیت پیش‌فرض**: وقتی گزارش ثبت می‌شود، وضعیت آن "Open" است
4. **تاریخ**: تاریخ ایجاد و بروزرسانی خودکار ثبت می‌شود
## Security
- API endpoints از `authentication` محافظت می‌شوند
- Admin pages تنها برای کاربرانی با دسترسی AdminArea قابل دسترس هستند
- حذف و ویرایش نیاز به تأیید دارد

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>BackgroundInstitutionContract.Task</AssemblyName>
<RootNamespace>BackgroundInstitutionContract.Task</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\0_Framework\0_Framework.csproj" />
<ProjectReference Include="..\..\AccountManagement.Configuration\AccountManagement.Configuration.csproj" />
<ProjectReference Include="..\..\PersonalContractingParty.Config\PersonalContractingParty.Config.csproj" />
<ProjectReference Include="..\..\ProgramManager\src\Infrastructure\GozareshgirProgramManager.Infrastructure\GozareshgirProgramManager.Infrastructure.csproj" />
<ProjectReference Include="..\..\Query.Bootstrapper\Query.Bootstrapper.csproj" />
<ProjectReference Include="..\..\WorkFlow\Infrastructure\WorkFlow.Infrastructure.Config\WorkFlow.Infrastructure.Config.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,32 @@
using _0_Framework.Application;
namespace BackgroundInstitutionContract.Task
{
public class FileUploader : IFileUploader
{
private readonly IWebHostEnvironment _webHostEnvironment;
public FileUploader(IWebHostEnvironment webHostEnvironment)
{
_webHostEnvironment = webHostEnvironment;
}
public string Upload(IFormFile file, string path)
{
if (file == null) return "";
var directoryPath = $"{_webHostEnvironment.WebRootPath}\\ProductPictures\\{path}";
if (!Directory.Exists(directoryPath))
Directory.CreateDirectory(directoryPath);
var fileName = $"{DateTime.Now.ToFileName()}-{file.FileName}";
var filePath = $"{directoryPath}\\{fileName}";
var output = System.IO.File.Create(filePath);
file.CopyTo(output);
return $"{path}/{fileName}";
}
}
}

View File

@@ -0,0 +1,165 @@
using _0_Framework.Application;
using Company.Domain.ContarctingPartyAgg;
using Company.Domain.InstitutionContractAgg;
using Hangfire;
namespace BackgroundInstitutionContract.Task.Jobs;
public class JobSchedulerRegistrator
{
private readonly IBackgroundJobClient _backgroundJobClient;
private readonly SmsReminder _smsReminder;
private readonly IInstitutionContractRepository _institutionContractRepository;
private static DateTime? _lastRunCreateTransaction;
private static DateTime? _lastRunSendMonthlySms;
public JobSchedulerRegistrator(SmsReminder smsReminder, IBackgroundJobClient backgroundJobClient, IInstitutionContractRepository institutionContractRepository)
{
_smsReminder = smsReminder;
_backgroundJobClient = backgroundJobClient;
_institutionContractRepository = institutionContractRepository;
}
public void Register()
{
RecurringJob.AddOrUpdate(
"InstitutionContract.CreateFinancialTransaction",
() => CreateFinancialTransaction(),
"*/30 * * * *" // هر 30 دقیقه یکبار چک کن
);
RecurringJob.AddOrUpdate(
"InstitutionContract.SendMonthlySms",
() => SendFirstDayOfMonthSms(),
"*/20 * * * *" // هر 30 دقیقه یکبار چک کن
);
RecurringJob.AddOrUpdate(
"InstitutionContract.SendReminderSms",
() => SendReminderSms(),
"*/1 * * * *" // هر 1 دقیقه یکبار چک کن
);
RecurringJob.AddOrUpdate(
"InstitutionContract.SendBlockSms",
() => SendBlockSms(),
"*/1 * * * *" // هر 1 دقیقه یکبار چک کن
);
RecurringJob.AddOrUpdate(
"InstitutionContract.SendInstitutionContractConfirmSms",
() => SendInstitutionContractConfirmSms(),
"*/1 * * * *" // هر 1 دقیقه یکبار چک کن
);
}
/// <summary>
/// ایجاد سند بدهی ماهیانه برای قراداد مالی
/// </summary>
/// <returns></returns>
[DisableConcurrentExecution(timeoutInSeconds: 1200)]
public async System.Threading.Tasks.Task CreateFinancialTransaction()
{
var now =DateTime.Now;
var endOfMonth = now.ToFarsi().FindeEndOfMonth();
var endOfMonthGr = endOfMonth.ToGeorgianDateTime();
if (now.Date == endOfMonthGr.Date && now.Hour >= 2 && now.Hour < 4 &&
now.Date != _lastRunCreateTransaction?.Date)
{
var month = endOfMonth.Substring(5, 2);
var year = endOfMonth.Substring(0, 4);
var monthName = month.ToFarsiMonthByNumber();
var description = $"{monthName} {year}";
var endnew = ($"{endOfMonth.Substring(0, 8)}01").FindeEndOfMonth();
var endNewGr = endnew.ToGeorgianDateTime();
var endNewFa = endNewGr.ToFarsi();
try
{
await _institutionContractRepository.CreateTransactionForInstitutionContracts(endNewGr, endNewFa, description);
_lastRunCreateTransaction = now;
Console.WriteLine("CreateTransAction executed");
}
catch (Exception e)
{
//_smsService.Alarm("09114221321", "خطا-ایجاد سند مالی");
}
}
}
/// <summary>
/// ارسال پیامک صورت حساب ماهانه
/// </summary>
/// <returns></returns>
[DisableConcurrentExecution(timeoutInSeconds: 600)]
public async System.Threading.Tasks.Task SendFirstDayOfMonthSms()
{
//var now = new DateTime(2025,11,21, 10,30,0);
var now = DateTime.Now;
var endOfMonth = now.ToFarsi().FindeEndOfMonth();
var endOfMonthGr = endOfMonth.ToGeorgianDateTime();
if (now.Date == endOfMonthGr.Date && now.Hour >= 10 && now.Hour < 11 &&
now.Date != _lastRunSendMonthlySms?.Date)
{
try
{
await _institutionContractRepository.SendMonthlySms(now);
_lastRunSendMonthlySms = now;
Console.WriteLine("Send Monthly sms executed");
}
catch (Exception e)
{
//_smsService.Alarm("09114221321", "خطا-ایجاد سند مالی");
}
}
}
/// <summary>
/// ارسال پیامک یاد آور بدهی
/// </summary>
/// <returns></returns>
[DisableConcurrentExecution(timeoutInSeconds: 1200)]
public async System.Threading.Tasks.Task SendReminderSms()
{
await _institutionContractRepository.SendReminderSmsForBackgroundTask();
}
/// <summary>
/// ارسال پیامک مسدودی
/// </summary>
/// <returns></returns>
[DisableConcurrentExecution(timeoutInSeconds: 100)]
public async System.Threading.Tasks.Task SendBlockSms()
{
await _institutionContractRepository.SendBlockSmsForBackgroundTask();
}
/// <summary>
/// ارسال پیامک یادآور تایید قراداد مالی
/// </summary>
/// <returns></returns>
[DisableConcurrentExecution(timeoutInSeconds: 100)]
public async System.Threading.Tasks.Task SendInstitutionContractConfirmSms()
{
await _institutionContractRepository.SendInstitutionContractConfirmSmsTask();
}
}

View File

@@ -0,0 +1,116 @@
using _0_Framework.Application.Sms;
using AccountManagement.Application.Contracts.Account;
using AccountMangement.Infrastructure.EFCore;
using Company.Domain.SmsResultAgg;
using Microsoft.EntityFrameworkCore;
using SmsResult = Company.Domain.SmsResultAgg.SmsResult;
namespace BackgroundInstitutionContract.Task.Jobs;
public class SmsReminder
{
private readonly AccountContext _accountContext;
private readonly ISmsService _smsService;
private readonly ISmsResultRepository _smsResultRepository;
public SmsReminder(ISmsService smsService, AccountContext accountContext, ISmsResultRepository smsResultRepository)
{
_smsService = smsService;
_accountContext = accountContext;
_smsResultRepository = smsResultRepository;
}
public void Execute()
{
//var accounts = _accountContext.Accounts.Where(x => x.PositionId > 0 && x.IsActiveString == "true").Select(x => new AccountViewModel() { Id = x.id, Mobile = x.Mobile, Fullname = x.Fullname }).ToList();
//Thread.Sleep(300);
//var accounts = new List<AccountViewModel>() { new AccountViewModel() { Mobile = "09114221321", Id = 2 } };
var accounts= _accountContext.Accounts.Where(x => x.Username.ToLower()=="mahan").Select(x => new AccountViewModel() { Id = x.id, Mobile = x.Mobile, Fullname = x.Fullname }).ToList();
var smsVM = accounts.Select(x => new AccountSmsTaskViewModel()
{
Mobile = x.Mobile,
AccountId = x.Id,
FullName = x.Fullname,
TaskCount = GetLateTasksCount(x.Id)
}).Where(x => x.TaskCount > 0 && !string.IsNullOrEmpty(x.Mobile) && x.Mobile.Length == 11).ToList();
Thread.Sleep(300);
foreach (var viewmodel in smsVM)
{
var smsResult = _smsService.TaskReminderSms(viewmodel.Mobile, $"{viewmodel.TaskCount}");
Thread.Sleep(1000);
var createSmsResult = new SmsResult(smsResult.MessageId, smsResult.Message, "یادآور وظایف",
viewmodel.FullName, viewmodel.Mobile, viewmodel.AccountId, viewmodel.AccountId);
_smsResultRepository.Create(createSmsResult);
_smsResultRepository.SaveChanges();
Thread.Sleep(1000);
}
}
private int GetLateTasksCount(long accountId)
{
var positionValue = _accountContext.Accounts
.Where(x => x.id == accountId)
.Include(p => p.Position)
.Select(x => x.Position.PositionValue)
.FirstOrDefault();
if (positionValue == 0)
return 0;
DateTime now = DateTime.Now;
int overdueTasksCount;
if (positionValue == 1)
{
overdueTasksCount = _accountContext.Assigns.Include(x => x.Task).Where(x => x.AssignedId == accountId &&
x.AssignerId == accountId && x.Task.Assigns.Count == 1 &&
!x.IsCancel && !x.IsCanceledRequest &&
!x.IsDone && !x.TimeRequest && !x.IsDoneRequest && x.EndTaskDate.Date <= DateTime.Now.Date && x.Task.IsActiveString == "true")
.GroupBy(x => x.TaskId).Select(x => x.First()).Count();
//overdueTasksCount = _accountContext.Tasks.Include(x =>
// x.Assigns).Count(x => !x.Assigns.Any(a => a.IsCancel) && !x.Assigns.Any(a => a.IsCanceledRequest) &&
// !x.Assigns.Any(a => a.IsDone) && !x.Assigns.Any(a => a.IsDoneRequest) &&
// !x.Assigns.Any(a => a.TimeRequest)
// && x.Assigns.Any(a => a.AssignedId == accountId && a.AssignerId == accountId) &&
// (x.Assigns.First(a => a.AssignedId == accountId && a.AssignerId == accountId)
// .EndTaskDate.Date <= DateTime.Now.Date) && x.Assigns.Count == 1);
}
else
{
overdueTasksCount = _accountContext.Assigns
.Include(x => x.Task)
.Where(x => x.AssignedId == accountId &&
!x.IsCancel && !x.IsCanceledRequest &&
!x.IsDone && !x.TimeRequest && !x.IsDoneRequest && x.EndTaskDate.Date <= DateTime.Now.Date && x.Task.IsActiveString == "true")
.GroupBy(x => x.TaskId).Select(x => x.First()).Count();
}
//overdueTasksCount = _accountContext.Tasks.Include(x =>
// x.Assigns).Count(x => !x.Assigns.Any(a => a.IsCancel) && !x.Assigns.Any(a => a.IsCanceledRequest) &&
// !x.Assigns.Any(a => a.IsDone) && !x.Assigns.Any(a => a.IsDoneRequest) &&
// !x.Assigns.Any(a => a.TimeRequest)
// && x.Assigns.Any(a => a.AssignedId == accountId) &&
// (x.Assigns.First(a => a.AssignedId == accountId).EndTaskDate.Date <= DateTime.Now.Date));
var overdueRequestsCount = _accountContext.Assigns.Include(x => x.Task)
.Where(x => (x.IsCanceledRequest
|| x.IsDoneRequest || x.TimeRequest) && !x.IsCancel && !x.IsDone &&
x.Task.IsActiveString == "true" &&
x.Task.SenderId == accountId).GroupBy(x => x.TaskId).Select(x => x.First()).Count();
return overdueTasksCount + overdueRequestsCount;
}
}
public class AccountSmsTaskViewModel
{
public int TaskCount { get; set; }
public long AccountId { get; set; }
public string Mobile { get; set; }
public string FullName { get; set; }
}

View File

@@ -0,0 +1,25 @@
using BackgroundInstitutionContract.Task.Jobs;
namespace BackgroundInstitutionContract.Task;
public class JobsBootstrapper
{
public static void Configure(IServiceCollection services)
{
var currentNamespace = typeof(JobSchedulerRegistrator).Namespace; // همون namespace کلاس
var assembly = typeof(JobSchedulerRegistrator).Assembly;
var jobTypes = assembly.GetTypes()
.Where(t =>
t is { IsClass: true, IsAbstract: false, Namespace: not null } &&
t.Namespace.StartsWith(currentNamespace, StringComparison.Ordinal))
.ToList();
foreach (var jobType in jobTypes)
{
services.AddTransient(jobType);
}
}
}

View File

@@ -0,0 +1,73 @@
using _0_Framework.Application;
using _0_Framework.Application.Sms;
using _0_Framework.Application.UID;
using _0_Framework.InfraStructure.Mongo;
using AccountManagement.Configuration;
using BackgroundInstitutionContract.Task;
using BackgroundInstitutionContract.Task.Jobs;
using CompanyManagment.App.Contracts.Hubs;
using CompanyManagment.EFCore.Services;
using GozareshgirProgramManager.Application._Bootstrapper;
using GozareshgirProgramManager.Application.Modules.Users.Commands.CreateUser;
using GozareshgirProgramManager.Infrastructure;
using GozareshgirProgramManager.Infrastructure.Persistence.Seed;
using Hangfire;
using Microsoft.AspNetCore.Identity;
using MongoDB.Driver;
using PersonalContractingParty.Config;
using Query.Bootstrapper;
using Shared.Contracts.PmUser.Queries;
using WorkFlow.Infrastructure.Config;
var builder = WebApplication.CreateBuilder(args);
var hangfireConnectionString = builder.Configuration.GetConnectionString("HangfireDb");
builder.Services.AddHangfire(x => x.UseSqlServerStorage(hangfireConnectionString));
builder.Services.AddHangfireServer();
var connectionString = builder.Configuration.GetConnectionString("MesbahDb");
var connectionStringTestDb = builder.Configuration.GetConnectionString("TestDb");
builder.Services.AddSingleton<IPasswordHasher, PasswordHasher>();
builder.Services.AddTransient<IAuthHelper, AuthHelper>();
builder.Services.AddTransient<ISmsService, SmsService>();
builder.Services.AddTransient<IUidService, UidService>();
builder.Services.AddTransient<IFileUploader, FileUploader>();
builder.Services.Configure<AppSettingConfiguration>(builder.Configuration);
#region MongoDb
var mongoConnectionSection = builder.Configuration.GetSection("MongoDb");
var mongoDbSettings = mongoConnectionSection.Get<MongoDbConfig>();
var mongoClient = new MongoClient(mongoDbSettings.ConnectionString);
var mongoDatabase = mongoClient.GetDatabase(mongoDbSettings.DatabaseName);
builder.Services.AddSingleton<IMongoDatabase>(mongoDatabase);
#endregion
builder.Services.AddProgramManagerApplication();
builder.Services.AddProgramManagerInfrastructure(builder.Configuration);
PersonalBootstrapper.Configure(builder.Services, connectionString);
TestDbBootStrapper.Configure(builder.Services, connectionStringTestDb);
AccountManagementBootstrapper.Configure(builder.Services, connectionString);
WorkFlowBootstrapper.Configure(builder.Services, connectionString);
QueryBootstrapper.Configure(builder.Services);
JobsBootstrapper.Configure(builder.Services);
builder.Services.AddHttpClient();
builder.Services.AddHttpContextAccessor();
builder.Services.AddSignalR();
var app = builder.Build();
app.MapHub<SendSmsHub>("/sendSmsHub");
app.MapHangfireDashboard();
app.MapGet("/", () => "Hello World!");
using (var scope = app.Services.CreateScope())
{
var jobScheduler = scope.ServiceProvider.GetRequiredService<JobSchedulerRegistrator>();
jobScheduler.Register();
}
app.Run();

View File

@@ -0,0 +1,38 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:56492",
"sslPort": 44378
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5216",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7223;http://localhost:5217",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@@ -0,0 +1,47 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"ConnectionStrings": {
//تست
//"MesbahDb": "Data Source=DESKTOP-NUE119G\\MSNEW;Initial Catalog=Mesbah_db;Integrated Security=True"
//server
//"MesbahDb": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;",
//local
"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;",
//dad-mehr
//"MesbahDb": "Data Source=.;Initial Catalog=teamWork;Integrated Security=True;TrustServerCertificate=true;",
"TestDb": "Data Source=.;Initial Catalog=TestDb;Integrated Security=True;TrustServerCertificate=true;",
//mahan Docker
//"MesbahDb": "Data Source=localhost,5069;Initial Catalog=mesbah_db;User ID=sa;Password=YourPassword123;TrustServerCertificate=True;",
//"HangfireDb": "Data Source=.;Initial Catalog=hangfire_db;Integrated Security=True;TrustServerCertificate=true;",
"HangfireDb": "Data Source=185.208.175.186;Initial Catalog=hangfire_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;"
},
"GoogleRecaptchaV3": {
"SiteKey": "6Lfhp_AnAAAAAB79WkrMoHd1k8ir4m8VvfjE7FTH",
"SecretKey": "6Lfhp_AnAAAAANjDDY6DPrbbUQS7k6ZCRmrVP5Lb"
},
"SmsSecrets": {
"ApiKey": "Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa",
"SecretKey": "dadmehr"
},
"Domain": ".gozareshgir.ir",
"MongoDb": {
"ConnectionString": "mongodb://localhost:27017",
"DatabaseName": "Gozareshgir"
}
}

View File

@@ -0,0 +1,28 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"ConnectionStrings": {
//local
//"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;",
"MesbahDb": "Data Source=185.208.175.186;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;",
//dad-mehr
//"MesbahDb": "Data Source=.;Initial Catalog=teamWork;Integrated Security=True;TrustServerCertificate=true;",
//"TestDb": "Data Source=.;Initial Catalog=TestDb;Integrated Security=True;TrustServerCertificate=true;",
"TestDb": "Data Source=185.208.175.186;Initial Catalog=TestDb;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;",
//"MesbahDb": "Data Source=.\\MSSQLSERVER2019;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=mesbah_db;Password=sa142857$@;"
//"HangfireDb": "Data Source=.;Initial Catalog=hangfire_db;Integrated Security=True;TrustServerCertificate=true;",
"HangfireDb": "Data Source=185.208.175.186;Initial Catalog=hangfire_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;"
},
"MongoDb": {
"ConnectionString": "mongodb://localhost:27017",
"DatabaseName": "Gozareshgir"
}
}

View File

@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\0_Framework\0_Framework.csproj" />
<ProjectReference Include="..\..\AccountManagement.Configuration\AccountManagement.Configuration.csproj" />
<ProjectReference Include="..\..\PersonalContractingParty.Config\PersonalContractingParty.Config.csproj" />
<ProjectReference Include="..\..\Query.Bootstrapper\Query.Bootstrapper.csproj" />
<ProjectReference Include="..\..\WorkFlow\Infrastructure\WorkFlow.Infrastructure.Config\WorkFlow.Infrastructure.Config.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,32 @@
using _0_Framework.Application;
namespace BackgroundJobs.Task
{
public class FileUploader : IFileUploader
{
private readonly IWebHostEnvironment _webHostEnvironment;
public FileUploader(IWebHostEnvironment webHostEnvironment)
{
_webHostEnvironment = webHostEnvironment;
}
public string Upload(IFormFile file, string path)
{
if (file == null) return "";
var directoryPath = $"{_webHostEnvironment.WebRootPath}\\ProductPictures\\{path}";
if (!Directory.Exists(directoryPath))
Directory.CreateDirectory(directoryPath);
var fileName = $"{DateTime.Now.ToFileName()}-{file.FileName}";
var filePath = $"{directoryPath}\\{fileName}";
var output = System.IO.File.Create(filePath);
file.CopyTo(output);
return $"{path}/{fileName}";
}
}
}

View File

@@ -0,0 +1,62 @@
using Hangfire;
namespace BackgroundJobs.Task.Jobs;
public class JobSchedulerRegistrator
{
private readonly IBackgroundJobClient _backgroundJobClient;
private readonly SmsReminder _smsReminder;
private static DateTime? _lastRunDateMorning;
private static DateTime? _lastRunDateEvening;
public JobSchedulerRegistrator(SmsReminder smsReminder, IBackgroundJobClient backgroundJobClient)
{
_smsReminder = smsReminder;
_backgroundJobClient = backgroundJobClient;
}
public void Register()
{
RecurringJob.AddOrUpdate(
"Task.SmsReminderChecker",
() => SmsReminderCheckAndSchedule(),
"*/5 * * * *" // هر 5 دقیقه یکبار چک کن
);
}
public void SmsReminderCheckAndSchedule()
{
var now = DateTime.Now;
var startMorning = new TimeSpan(9, 0, 0);
var endMorning = new TimeSpan(9, 40, 0);
var startEvening = new TimeSpan(15, 30, 0);
var endEvening = new TimeSpan(15, 40, 0);
// صبح
if (now.DayOfWeek != DayOfWeek.Friday &&
now.TimeOfDay >= startMorning &&
now.TimeOfDay < endMorning)
{
if (_lastRunDateMorning?.Date != now.Date)
{
_backgroundJobClient.Enqueue(() => _smsReminder.Execute());
_lastRunDateMorning = now;
}
}
// عصر - پنجشنبه و جمعه تعطیل است
if (now.DayOfWeek != DayOfWeek.Friday &&
now.DayOfWeek != DayOfWeek.Thursday &&
now.TimeOfDay >= startEvening &&
now.TimeOfDay < endEvening)
{
if (_lastRunDateEvening?.Date != now.Date)
{
_backgroundJobClient.Enqueue(() => _smsReminder.Execute());
_lastRunDateEvening = now;
}
}
}
}

View File

@@ -0,0 +1,116 @@
using _0_Framework.Application.Sms;
using AccountManagement.Application.Contracts.Account;
using AccountMangement.Infrastructure.EFCore;
using Company.Domain.SmsResultAgg;
using Microsoft.EntityFrameworkCore;
using SmsResult = Company.Domain.SmsResultAgg.SmsResult;
namespace BackgroundJobs.Task.Jobs;
public class SmsReminder
{
private readonly AccountContext _accountContext;
private readonly ISmsService _smsService;
private readonly ISmsResultRepository _smsResultRepository;
public SmsReminder(ISmsService smsService, AccountContext accountContext, ISmsResultRepository smsResultRepository)
{
_smsService = smsService;
_accountContext = accountContext;
_smsResultRepository = smsResultRepository;
}
public void Execute()
{
//var accounts = _accountContext.Accounts.Where(x => x.PositionId > 0 && x.IsActiveString == "true").Select(x => new AccountViewModel() { Id = x.id, Mobile = x.Mobile, Fullname = x.Fullname }).ToList();
//Thread.Sleep(300);
//var accounts = new List<AccountViewModel>() { new AccountViewModel() { Mobile = "09114221321", Id = 2 } };
var accounts= _accountContext.Accounts.Where(x => x.Username.ToLower()=="mahan").Select(x => new AccountViewModel() { Id = x.id, Mobile = x.Mobile, Fullname = x.Fullname }).ToList();
var smsVM = accounts.Select(x => new AccountSmsTaskViewModel()
{
Mobile = x.Mobile,
AccountId = x.Id,
FullName = x.Fullname,
TaskCount = GetLateTasksCount(x.Id)
}).Where(x => x.TaskCount > 0 && !string.IsNullOrEmpty(x.Mobile) && x.Mobile.Length == 11).ToList();
Thread.Sleep(300);
foreach (var viewmodel in smsVM)
{
var smsResult = _smsService.TaskReminderSms(viewmodel.Mobile, $"{viewmodel.TaskCount}");
Thread.Sleep(1000);
var createSmsResult = new SmsResult(smsResult.MessageId, smsResult.Message, "یادآور وظایف",
viewmodel.FullName, viewmodel.Mobile, viewmodel.AccountId, viewmodel.AccountId);
_smsResultRepository.Create(createSmsResult);
_smsResultRepository.SaveChanges();
Thread.Sleep(1000);
}
}
private int GetLateTasksCount(long accountId)
{
var positionValue = _accountContext.Accounts
.Where(x => x.id == accountId)
.Include(p => p.Position)
.Select(x => x.Position.PositionValue)
.FirstOrDefault();
if (positionValue == 0)
return 0;
DateTime now = DateTime.Now;
int overdueTasksCount;
if (positionValue == 1)
{
overdueTasksCount = _accountContext.Assigns.Include(x => x.Task).Where(x => x.AssignedId == accountId &&
x.AssignerId == accountId && x.Task.Assigns.Count == 1 &&
!x.IsCancel && !x.IsCanceledRequest &&
!x.IsDone && !x.TimeRequest && !x.IsDoneRequest && x.EndTaskDate.Date <= DateTime.Now.Date && x.Task.IsActiveString == "true")
.GroupBy(x => x.TaskId).Select(x => x.First()).Count();
//overdueTasksCount = _accountContext.Tasks.Include(x =>
// x.Assigns).Count(x => !x.Assigns.Any(a => a.IsCancel) && !x.Assigns.Any(a => a.IsCanceledRequest) &&
// !x.Assigns.Any(a => a.IsDone) && !x.Assigns.Any(a => a.IsDoneRequest) &&
// !x.Assigns.Any(a => a.TimeRequest)
// && x.Assigns.Any(a => a.AssignedId == accountId && a.AssignerId == accountId) &&
// (x.Assigns.First(a => a.AssignedId == accountId && a.AssignerId == accountId)
// .EndTaskDate.Date <= DateTime.Now.Date) && x.Assigns.Count == 1);
}
else
{
overdueTasksCount = _accountContext.Assigns
.Include(x => x.Task)
.Where(x => x.AssignedId == accountId &&
!x.IsCancel && !x.IsCanceledRequest &&
!x.IsDone && !x.TimeRequest && !x.IsDoneRequest && x.EndTaskDate.Date <= DateTime.Now.Date && x.Task.IsActiveString == "true")
.GroupBy(x => x.TaskId).Select(x => x.First()).Count();
}
//overdueTasksCount = _accountContext.Tasks.Include(x =>
// x.Assigns).Count(x => !x.Assigns.Any(a => a.IsCancel) && !x.Assigns.Any(a => a.IsCanceledRequest) &&
// !x.Assigns.Any(a => a.IsDone) && !x.Assigns.Any(a => a.IsDoneRequest) &&
// !x.Assigns.Any(a => a.TimeRequest)
// && x.Assigns.Any(a => a.AssignedId == accountId) &&
// (x.Assigns.First(a => a.AssignedId == accountId).EndTaskDate.Date <= DateTime.Now.Date));
var overdueRequestsCount = _accountContext.Assigns.Include(x => x.Task)
.Where(x => (x.IsCanceledRequest
|| x.IsDoneRequest || x.TimeRequest) && !x.IsCancel && !x.IsDone &&
x.Task.IsActiveString == "true" &&
x.Task.SenderId == accountId).GroupBy(x => x.TaskId).Select(x => x.First()).Count();
return overdueTasksCount + overdueRequestsCount;
}
}
public class AccountSmsTaskViewModel
{
public int TaskCount { get; set; }
public long AccountId { get; set; }
public string Mobile { get; set; }
public string FullName { get; set; }
}

View File

@@ -0,0 +1,24 @@
using BackgroundJobs.Task.Jobs;
namespace BackgroundJobs.Task;
public class JobsBootstrapper
{
public static void Configure(IServiceCollection services)
{
var currentNamespace = typeof(JobSchedulerRegistrator).Namespace; // همون namespace کلاس
var assembly = typeof(JobSchedulerRegistrator).Assembly;
var jobTypes = assembly.GetTypes()
.Where(t =>
t is { IsClass: true, IsAbstract: false, Namespace: not null } &&
t.Namespace.StartsWith(currentNamespace, StringComparison.Ordinal))
.ToList();
foreach (var jobType in jobTypes)
{
services.AddTransient(jobType);
}
}
}

View File

@@ -0,0 +1,59 @@
using _0_Framework.Application;
using _0_Framework.Application.Sms;
using _0_Framework.Application.UID;
using _0_Framework.InfraStructure.Mongo;
using AccountManagement.Configuration;
using BackgroundJobs.Task;
using BackgroundJobs.Task.Jobs;
using CompanyManagment.EFCore.Services;
using Hangfire;
using Microsoft.AspNetCore.Identity;
using MongoDB.Driver;
using PersonalContractingParty.Config;
using Query.Bootstrapper;
using WorkFlow.Infrastructure.Config;
var builder = WebApplication.CreateBuilder(args);
var hangfireConnectionString = builder.Configuration.GetConnectionString("HangfireDb");
builder.Services.AddHangfire(x => x.UseSqlServerStorage(hangfireConnectionString));
builder.Services.AddHangfireServer();
var connectionString = builder.Configuration.GetConnectionString("MesbahDb");
var connectionStringTestDb = builder.Configuration.GetConnectionString("TestDb");
builder.Services.AddSingleton<IPasswordHasher, PasswordHasher>();
builder.Services.AddTransient<IAuthHelper, AuthHelper>();
builder.Services.AddTransient<ISmsService, SmsService>();
builder.Services.AddTransient<IUidService, UidService>();
builder.Services.AddTransient<IFileUploader, FileUploader>();
builder.Services.Configure<AppSettingConfiguration>(builder.Configuration);
#region MongoDb
var mongoConnectionSection = builder.Configuration.GetSection("MongoDb");
var mongoDbSettings = mongoConnectionSection.Get<MongoDbConfig>();
var mongoClient = new MongoClient(mongoDbSettings.ConnectionString);
var mongoDatabase = mongoClient.GetDatabase(mongoDbSettings.DatabaseName);
builder.Services.AddSingleton<IMongoDatabase>(mongoDatabase);
#endregion
PersonalBootstrapper.Configure(builder.Services, connectionString);
TestDbBootStrapper.Configure(builder.Services, connectionStringTestDb);
AccountManagementBootstrapper.Configure(builder.Services, connectionString);
WorkFlowBootstrapper.Configure(builder.Services, connectionString);
QueryBootstrapper.Configure(builder.Services);
JobsBootstrapper.Configure(builder.Services);
builder.Services.AddHttpClient();
builder.Services.AddHttpContextAccessor();
var app = builder.Build();
app.MapHangfireDashboard();
app.MapGet("/", () => "Hello World!");
using (var scope = app.Services.CreateScope())
{
var jobScheduler = scope.ServiceProvider.GetRequiredService<JobSchedulerRegistrator>();
jobScheduler.Register();
}
app.Run();

View File

@@ -0,0 +1,38 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:56492",
"sslPort": 44378
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5216",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7222;http://localhost:5216",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@@ -0,0 +1,46 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"ConnectionStrings": {
//تست
//"MesbahDb": "Data Source=DESKTOP-NUE119G\\MSNEW;Initial Catalog=Mesbah_db;Integrated Security=True"
//server
//"MesbahDb": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;",
//local
"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;",
//dad-mehr
//"MesbahDb": "Data Source=.;Initial Catalog=teamWork;Integrated Security=True;TrustServerCertificate=true;",
"TestDb": "Data Source=.;Initial Catalog=TestDb;Integrated Security=True;TrustServerCertificate=true;",
//mahan Docker
//"MesbahDb": "Data Source=localhost,5069;Initial Catalog=mesbah_db;User ID=sa;Password=YourPassword123;TrustServerCertificate=True;",
"HangfireDb": "Data Source=.;Initial Catalog=hangfire_db;Integrated Security=True;TrustServerCertificate=true;"
},
"GoogleRecaptchaV3": {
"SiteKey": "6Lfhp_AnAAAAAB79WkrMoHd1k8ir4m8VvfjE7FTH",
"SecretKey": "6Lfhp_AnAAAAANjDDY6DPrbbUQS7k6ZCRmrVP5Lb"
},
"SmsSecrets": {
"ApiKey": "Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa",
"SecretKey": "dadmehr"
},
"Domain": ".gozareshgir.ir",
"MongoDb": {
"ConnectionString": "mongodb://localhost:27017",
"DatabaseName": "Gozareshgir"
}
}

View File

@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

314
CHANGELOG.md Normal file
View File

@@ -0,0 +1,314 @@
# خلاصه تغییرات سیستم گزارش خرابی
## 📝 فایل‌های اضافه شده (23 فایل)
### 1⃣ Domain Layer (3 فایل)
```
✓ AccountManagement.Domain/BugReportAgg/
├── BugReport.cs
├── BugReportLog.cs
└── BugReportScreenshot.cs
```
### 2⃣ Application Contracts (6 فایل)
```
✓ AccountManagement.Application.Contracts/BugReport/
├── IBugReportRepository.cs
├── IBugReportApplication.cs
├── CreateBugReportCommand.cs
├── EditBugReportCommand.cs
├── BugReportViewModel.cs
└── BugReportDetailViewModel.cs
```
### 3⃣ Application Service (1 فایل)
```
✓ AccountManagement.Application/
└── BugReportApplication.cs
```
### 4⃣ Infrastructure EFCore (4 فایل)
```
✓ AccountMangement.Infrastructure.EFCore/
├── Mappings/
│ ├── BugReportMapping.cs
│ ├── BugReportLogMapping.cs
│ └── BugReportScreenshotMapping.cs
└── Repository/
└── BugReportRepository.cs
```
### 5⃣ API Controller (1 فایل)
```
✓ ServiceHost/Controllers/
└── BugReportController.cs
```
### 6⃣ Admin Pages (8 فایل)
```
✓ ServiceHost/Areas/AdminNew/Pages/BugReport/
├── BugReportPageModel.cs
├── Index.cshtml.cs
├── Index.cshtml
├── Details.cshtml.cs
├── Details.cshtml
├── Edit.cshtml.cs
├── Edit.cshtml
├── Delete.cshtml.cs
└── Delete.cshtml
```
### 7⃣ Documentation (2 فایل)
```
✓ BUG_REPORT_SYSTEM.md
✓ FLUTTER_BUG_REPORT_EXAMPLE.dart
```
---
## ✏️ فایل‌های اصلاح شده (2 فایل)
### 1. AccountManagement.Configuration/AccountManagementBootstrapper.cs
**تغییر:** اضافه کردن using برای BugReport
```csharp
using AccountManagement.Application.Contracts.BugReport;
```
**تغییر:** رجیستریشن سرویس‌ها
```csharp
services.AddTransient<IBugReportApplication, BugReportApplication>();
services.AddTransient<IBugReportRepository, BugReportRepository>();
```
### 2. AccountMangement.Infrastructure.EFCore/AccountContext.cs
**تغییر:** اضافه کردن using
```csharp
using AccountManagement.Domain.BugReportAgg;
```
**تغییر:** اضافه کردن DbSets
```csharp
#region BugReport
public DbSet<BugReport> BugReports { get; set; }
public DbSet<BugReportLog> BugReportLogs { get; set; }
public DbSet<BugReportScreenshot> BugReportScreenshots { get; set; }
#endregion
```
---
## 🔧 موارد مورد نیاز قبل از استفاده
### 1. Database Migration
```powershell
# در Package Manager Console
cd AccountMangement.Infrastructure.EFCore
Add-Migration AddBugReportSystem
Update-Database
```
### 2. الگوی Enum برای Flutter
```dart
enum BugReportType {
crash, // 1
ui, // 2
performance, // 3
feature, // 4
network, // 5
camera, // 6
faceRecognition, // 7
database, // 8
login, // 9
other, // 10
}
enum BugPriority {
critical, // 1
high, // 2
medium, // 3
low, // 4
}
```
---
## 🚀 نقاط ورود
### API Endpoints
```
POST /api/bugreport/submit - ثبت گزارش جدید
GET /api/bugreport/list - دریافت لیست
GET /api/bugreport/{id} - دریافت جزئیات
PUT /api/bugreport/{id} - ویرایش وضعیت/اولویت
DELETE /api/bugreport/{id} - حذف گزارش
```
### Admin Pages
```
/AdminNew/BugReport - لیست گزارش‌ها
/AdminNew/BugReport/Details/{id} - جزئیات کامل
/AdminNew/BugReport/Edit/{id} - ویرایش
/AdminNew/BugReport/Delete/{id} - حذف
```
---
## 📊 Database Schema
### BugReports جدول
```sql
- id (bigint, PK)
- Title (nvarchar(200))
- Description (ntext)
- UserEmail (nvarchar(150))
- AccountId (bigint, nullable)
- DeviceModel (nvarchar(100))
- OsVersion (nvarchar(50))
- Platform (nvarchar(50))
- Manufacturer (nvarchar(100))
- DeviceId (nvarchar(200))
- ScreenResolution (nvarchar(50))
- MemoryInMB (int)
- StorageInMB (int)
- BatteryLevel (int)
- IsCharging (bit)
- NetworkType (nvarchar(50))
- AppVersion (nvarchar(50))
- BuildNumber (nvarchar(50))
- PackageName (nvarchar(150))
- InstallTime (datetime2)
- LastUpdateTime (datetime2)
- Flavor (nvarchar(50))
- Type (int)
- Priority (int)
- Status (int)
- StackTrace (ntext, nullable)
- CreationDate (datetime2)
- UpdateDate (datetime2, nullable)
```
### BugReportLogs جدول
```sql
- id (bigint, PK)
- BugReportId (bigint, FK)
- Message (ntext)
- Timestamp (datetime2)
```
### BugReportScreenshots جدول
```sql
- id (bigint, PK)
- BugReportId (bigint, FK)
- Base64Data (ntext)
- FileName (nvarchar(255))
- UploadDate (datetime2)
```
---
## ✨ مثال درخواست API
```json
POST /api/bugreport/submit
Content-Type: application/json
{
"title": "برنامه هنگام ورود خراب می‌شود",
"description": "هنگام فشار دادن دکمه ورود، برنامه کرش می‌کند",
"userEmail": "user@example.com",
"accountId": 123,
"deviceModel": "Samsung Galaxy S21",
"osVersion": "Android 12",
"platform": "Android",
"manufacturer": "Samsung",
"deviceId": "device-12345",
"screenResolution": "1440x3200",
"memoryInMB": 8000,
"storageInMB": 256000,
"batteryLevel": 75,
"isCharging": false,
"networkType": "4G",
"appVersion": "1.0.0",
"buildNumber": "100",
"packageName": "com.example.app",
"installTime": "2024-01-01T10:00:00Z",
"lastUpdateTime": "2024-12-07T14:30:00Z",
"flavor": "production",
"type": 1,
"priority": 2,
"stackTrace": "...",
"logs": ["log line 1", "log line 2"],
"screenshots": ["base64-string"]
}
```
---
## 🔐 Security Features
- ✅ Authorization برای Admin Pages (AdminAreaPermission required)
- ✅ API Authentication
- ✅ XSS Protection (Html.Raw محدود)
- ✅ CSRF Protection (ASP.NET Core default)
- ✅ Input Validation
- ✅ Safe Delete with Confirmation
---
## 📚 Documentation Files
1. **BUG_REPORT_SYSTEM.md** - راهنمای کامل سیستم
2. **FLUTTER_BUG_REPORT_EXAMPLE.dart** - مثال پیاده‌سازی Flutter
3. **CHANGELOG.md** (این فایل) - خلاصه تغییرات
---
## ✅ Checklist پیاده‌سازی
- [x] Domain Models
- [x] Database Mappings
- [x] Repository Pattern
- [x] Application Services
- [x] API Endpoints
- [x] Admin UI Pages
- [x] Dependency Injection
- [x] Error Handling
- [x] Documentation
- [x] Flutter Example
- [ ] Database Migration (باید دستی اجرا شود)
- [ ] Testing
---
## 🎯 مراحل بعدی
1. **اجرای Migration:**
```powershell
Add-Migration AddBugReportSystem
Update-Database
```
2. **تست API:**
- استفاده از Postman/Thunder Client
- تست تمام endpoints
3. **تست Admin Panel:**
- دسترسی به /AdminNew/BugReport
- تست فیلترها و جستجو
- تست ویرایش و حذف
4. **Integration Flutter:**
- کپی کردن `FLUTTER_BUG_REPORT_EXAMPLE.dart`
- سازگار کردن با پروژه Flutter
- تست ثبت گزارش‌ها
---
## 📞 پشتیبانی
برای هر سوال یا مشکل:
1. بررسی کنید `BUG_REPORT_SYSTEM.md`
2. بررسی کنید logs و error messages
3. مطمئن شوید Migration اجرا شده است

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);
}
}

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