diff --git a/docs/cms-integration.md b/docs/cms-integration.md new file mode 100644 index 0000000..140ab33 --- /dev/null +++ b/docs/cms-integration.md @@ -0,0 +1,593 @@ +# BackOffice.BFF - CMS Integration Documentation + +**Date**: 2025-11-30 +**Status**: ✅ Integrated +**CMS Package Version**: 0.0.140 + +--- + +## 📋 Overview + +BackOffice.BFF به CMS Microservice متصل شد و حالا می‌تواند به سرویس‌های Network-Club-Commission دسترسی داشته باشد. + +این Integration به BackOffice امکان می‌دهد: +- مدیریت کامیسیون‌های کاربران +- مشاهده ساختار شبکه Binary Tree +- فعال/غیرفعال کردن عضویت باشگاه +- مشاهده گزارشات هفتگی کمیسیون + +--- + +## 🏗️ Architecture + +``` +┌─────────────────────────────────────────────────────────┐ +│ BackOffice.BFF (API Gateway) │ +│ │ +│ ┌──────────────────────────────────────────────────┐ │ +│ │ IApplicationContractContext │ │ +│ │ - Users (existing) │ │ +│ │ - Products (existing) │ │ +│ │ - Orders (existing) │ │ +│ │ ✨ Commissions (NEW) │ │ +│ │ ✨ NetworkMemberships (NEW) │ │ +│ │ ✨ ClubMemberships (NEW) │ │ +│ └──────────────────────────────────────────────────┘ │ +│ ↓ gRPC │ +└─────────────────────────────────────────────────────────┘ + ↓ +┌─────────────────────────────────────────────────────────┐ +│ CMS Microservice │ +│ https://cms.kbs1.ir │ +│ │ +│ ┌─────────────────────┐ ┌─────────────────────────┐ │ +│ │ CommissionContract │ │ NetworkMembershipContract│ │ +│ │ - GetWeeklyPool │ │ - GetUserNetworkInfo │ │ +│ │ - GetUserPayouts │ │ - GetNetworkTree │ │ +│ │ - ProcessWithdrawal │ │ - CalculateLegBalances │ │ +│ └─────────────────────┘ └─────────────────────────┘ │ +│ │ +│ ┌─────────────────────┐ │ +│ │ ClubMembershipContract│ │ +│ │ - ActivateClub │ │ +│ │ - DeactivateClub │ │ +│ │ - GetClubStatus │ │ +│ └─────────────────────┘ │ +└─────────────────────────────────────────────────────────┘ +``` + +--- + +## 📦 Integration Details + +### 1️⃣ NuGet Package + +**Package**: `Foursat.CMSMicroservice.Protobuf` +**Version**: `0.0.140` (Updated from 0.0.137) + +**File**: `/BackOffice.BFF/src/BackOffice.BFF.Domain/BackOffice.BFF.Domain.csproj` + +```xml + +``` + +**What's New in 0.0.140**: +- ✨ `commission.proto` - Commission system contracts +- ✨ `networkmembership.proto` - Binary tree network contracts +- ✨ `clubmembership.proto` - Club membership contracts +- ✨ `configuration.proto` - System configuration contracts + +--- + +### 2️⃣ Interface Definition + +**File**: `/BackOffice.BFF/src/BackOffice.BFF.Application/Common/Interfaces/IApplicationContractContext.cs` + +```csharp +public interface IApplicationContractContext +{ + // ... existing services ... + + // Network & Commission System (NEW) + CommissionContract.CommissionContractClient Commissions { get; } + NetworkMembershipContract.NetworkMembershipContractClient NetworkMemberships { get; } + ClubMembershipContract.ClubMembershipContractClient ClubMemberships { get; } +} +``` + +--- + +### 3️⃣ Implementation + +**File**: `/BackOffice.BFF/src/BackOffice.BFF.Infrastructure/Services/ApplicationContractContext.cs` + +```csharp +public class ApplicationContractContext : IApplicationContractContext +{ + // ... existing implementations ... + + // Network & Commission System + public CommissionContract.CommissionContractClient Commissions + => GetService(); + + public NetworkMembershipContract.NetworkMembershipContractClient NetworkMemberships + => GetService(); + + public ClubMembershipContract.ClubMembershipContractClient ClubMemberships + => GetService(); +} +``` + +--- + +### 4️⃣ gRPC Configuration + +**File**: `/BackOffice.BFF/src/BackOffice.BFF.WebApi/appsettings.json` + +```json +{ + "GrpcChannelOptions": { + "FMSMSAddress": "https://dl.afrino.co", + "CMSMSAddress": "https://cms.kbs1.ir" + } +} +``` + +**Auto-Registration**: +- gRPC clients به صورت خودکار توسط `ConfigureGrpcServices.BatchRegisterGrpcClients()` ثبت می‌شوند +- بر اساس نام Assembly (`CMSMicroservice.Protobuf`) +- با Address مشخص شده در `appsettings.json` + +--- + +## 🔌 Available Services + +### 1️⃣ CommissionContract + +**Namespace**: `CMSMicroservice.Protobuf.Protos.Commission` + +#### Commands: +```csharp +// محاسبه بالانس های هفتگی +await _context.Commissions.CalculateWeeklyBalancesAsync( + new CalculateWeeklyBalancesRequest { WeekNumber = "2025-W48" }); + +// محاسبه Pool هفتگی +await _context.Commissions.CalculateWeeklyCommissionPoolAsync( + new CalculateWeeklyCommissionPoolRequest { WeekNumber = "2025-W48" }); + +// پردازش Payout های کاربران +await _context.Commissions.ProcessUserPayoutsAsync( + new ProcessUserPayoutsRequest { WeekNumber = "2025-W48" }); + +// درخواست برداشت توسط کاربر +await _context.Commissions.RequestWithdrawalAsync( + new RequestWithdrawalRequest + { + UserId = 123, + Amount = 500000 + }); + +// پردازش برداشت (توسط Admin) +await _context.Commissions.ProcessWithdrawalAsync( + new ProcessWithdrawalRequest + { + PayoutId = 456, + Status = WithdrawalStatus.Approved + }); +``` + +#### Queries: +```csharp +// دریافت Pool هفتگی +var pool = await _context.Commissions.GetWeeklyCommissionPoolAsync( + new GetWeeklyCommissionPoolRequest { WeekNumber = "2025-W48" }); + +// دریافت Payout های یک کاربر +var payouts = await _context.Commissions.GetUserPayoutsAsync( + new GetUserPayoutsRequest + { + UserId = 123, + PageNumber = 1, + PageSize = 10 + }); + +// دریافت تاریخچه Withdrawal ها +var withdrawals = await _context.Commissions.GetWithdrawalHistoryAsync( + new GetWithdrawalHistoryRequest + { + UserId = 123, + Status = WithdrawalStatus.Pending + }); +``` + +--- + +### 2️⃣ NetworkMembershipContract + +**Namespace**: `CMSMicroservice.Protobuf.Protos.NetworkMembership` + +#### Queries: +```csharp +// دریافت اطلاعات شبکه یک کاربر +var networkInfo = await _context.NetworkMemberships.GetUserNetworkInfoAsync( + new GetUserNetworkInfoRequest { UserId = 123 }); + +// دریافت درخت شبکه (Binary Tree) +var tree = await _context.NetworkMemberships.GetNetworkTreeAsync( + new GetNetworkTreeRequest + { + RootUserId = 123, + MaxDepth = 5 + }); + +// دریافت بالانس های هفتگی +var balances = await _context.NetworkMemberships.GetUserWeeklyBalancesAsync( + new GetUserWeeklyBalancesRequest + { + UserId = 123, + WeekNumber = "2025-W48" + }); + +// محاسبه بالانس Leg های یک کاربر +var legBalances = await _context.NetworkMemberships.CalculateLegBalancesAsync( + new CalculateLegBalancesRequest { UserId = 123 }); +``` + +--- + +### 3️⃣ ClubMembershipContract + +**Namespace**: `CMSMicroservice.Protobuf.Protos.ClubMembership` + +#### Commands: +```csharp +// فعال کردن عضویت باشگاه +await _context.ClubMemberships.ActivateClubMembershipAsync( + new ActivateClubMembershipRequest + { + UserId = 123, + ActivationDate = Timestamp.FromDateTime(DateTime.UtcNow) + }); + +// غیرفعال کردن عضویت باشگاه +await _context.ClubMemberships.DeactivateClubMembershipAsync( + new DeactivateClubMembershipRequest + { + UserId = 123, + Reason = "User request" + }); +``` + +#### Queries: +```csharp +// دریافت وضعیت عضویت باشگاه +var status = await _context.ClubMemberships.GetClubMembershipStatusAsync( + new GetClubMembershipStatusRequest { UserId = 123 }); + +// لیست تمام اعضای باشگاه +var members = await _context.ClubMemberships.GetAllClubMembersAsync( + new GetAllClubMembersRequest + { + IsActive = true, + PageNumber = 1, + PageSize = 20 + }); +``` + +--- + +## 📝 Usage Example in BFF + +### Example 1: Create Commission Query Handler + +**File**: `/BackOffice.BFF/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetUserPayouts/GetUserPayoutsQuery.cs` + +```csharp +public record GetUserPayoutsQuery : IRequest +{ + public long UserId { get; init; } + public int PageNumber { get; init; } = 1; + public int PageSize { get; init; } = 10; +} + +public class GetUserPayoutsQueryHandler + : IRequestHandler +{ + private readonly IApplicationContractContext _context; + + public GetUserPayoutsQueryHandler(IApplicationContractContext context) + { + _context = context; + } + + public async Task Handle( + GetUserPayoutsQuery request, + CancellationToken cancellationToken) + { + var response = await _context.Commissions.GetUserPayoutsAsync( + request.Adapt(), + cancellationToken: cancellationToken); + + return response.Adapt(); + } +} +``` + +--- + +### Example 2: Create Network Tree Query Handler + +**File**: `/BackOffice.BFF/src/BackOffice.BFF.Application/NetworkCQ/Queries/GetNetworkTree/GetNetworkTreeQuery.cs` + +```csharp +public record GetNetworkTreeQuery : IRequest +{ + public long RootUserId { get; init; } + public int MaxDepth { get; init; } = 5; +} + +public class GetNetworkTreeQueryHandler + : IRequestHandler +{ + private readonly IApplicationContractContext _context; + + public GetNetworkTreeQueryHandler(IApplicationContractContext context) + { + _context = context; + } + + public async Task Handle( + GetNetworkTreeQuery request, + CancellationToken cancellationToken) + { + var response = await _context.NetworkMemberships.GetNetworkTreeAsync( + request.Adapt(), + cancellationToken: cancellationToken); + + return response.Adapt(); + } +} +``` + +--- + +### Example 3: Create Club Activation Command Handler + +**File**: `/BackOffice.BFF/src/BackOffice.BFF.Application/ClubCQ/Commands/ActivateClub/ActivateClubCommand.cs` + +```csharp +public record ActivateClubCommand : IRequest +{ + public long UserId { get; init; } + public DateTimeOffset? ActivationDate { get; init; } +} + +public class ActivateClubCommandHandler + : IRequestHandler +{ + private readonly IApplicationContractContext _context; + + public ActivateClubCommandHandler(IApplicationContractContext context) + { + _context = context; + } + + public async Task Handle( + ActivateClubCommand request, + CancellationToken cancellationToken) + { + await _context.ClubMemberships.ActivateClubMembershipAsync( + request.Adapt(), + cancellationToken: cancellationToken); + + return Unit.Value; + } +} +``` + +--- + +## 🔐 Authentication & Authorization + +**JWT Token**: +- BackOffice.BFF به CMS با JWT Token متصل می‌شود +- Token از `ITokenProvider` گرفته می‌شود +- در Header با کلید `Authorization: Bearer {token}` ارسال می‌شود + +**Implementation در `ConfigureGrpcServices.cs`**: +```csharp +private static async Task CallCredentials( + AuthInterceptorContext context, + Metadata metadata, + IServiceProvider serviceProvider) +{ + var provider = serviceProvider.GetRequiredService(); + var token = await provider.GetTokenAsync(); + metadata.Add("Authorization", $"Bearer {token}"); +} +``` + +--- + +## 🧪 Testing + +### Test Connection: + +```csharp +// در یک Controller یا Handler: +var pool = await _context.Commissions.GetWeeklyCommissionPoolAsync( + new GetWeeklyCommissionPoolRequest { WeekNumber = "2025-W48" }); + +Console.WriteLine($"Total Pool Value: {pool.TotalPoolValue}"); +Console.WriteLine($"Active Members: {pool.ActiveMembersCount}"); +``` + +**Expected Output**: +``` +Total Pool Value: 50000000 +Active Members: 120 +``` + +--- + +### Test with Postman/Swagger: + +1. Start BackOffice.BFF: + ```bash + cd /home/masoud/Apps/project/FourSat/BackOffice.BFF/src + dotnet run --project BackOffice.BFF.WebApi + ``` + +2. Call API endpoint (example): + ```http + GET /api/commission/weekly-pool?weekNumber=2025-W48 + Authorization: Bearer {your-token} + ``` + +3. Expected Response: + ```json + { + "weekNumber": "2025-W48", + "totalPoolValue": 50000000, + "activeMembersCount": 120, + "isCalculated": true + } + ``` + +--- + +## 📊 Status & Metrics + +| Component | Status | Version | Notes | +|-----------|--------|---------|-------| +| **CMS Protobuf Package** | ✅ Active | 0.0.140 | With Network-Club-Commission | +| **gRPC Connection** | ✅ Configured | - | https://cms.kbs1.ir | +| **Auto-Registration** | ✅ Active | - | Via BatchRegisterGrpcClients | +| **Commission Client** | ✅ Ready | - | All commands & queries available | +| **Network Client** | ✅ Ready | - | Binary tree queries available | +| **Club Client** | ✅ Ready | - | Activation/Deactivation available | +| **Authentication** | ✅ Configured | JWT | Via ITokenProvider | + +--- + +## 🔗 Related Documentation + +### CMS Side: +- **Implementation Progress**: `/CMS/docs/implementation-progress.md` +- **Network System Design**: `/CMS/docs/network-club-commission-system.md` +- **Monitoring Setup**: `/CMS/docs/monitoring-alerts-consolidated-report.md` +- **Migration Guide**: `/CMS/docs/migration-network-parent-guide.md` +- **Binary Tree Registration**: `/CMS/docs/binary-tree-registration-guide.md` + +### BFF Side: +- **This Document**: `/BackOffice.BFF/docs/cms-integration.md` +- **README**: `/BackOffice.BFF/README.md` + +--- + +## 🚀 Next Steps + +### Immediate: +1. ✅ Integration completed +2. ⏳ Create Commission/Network/Club CQRS handlers in BFF +3. ⏳ Add API endpoints in BackOffice.BFF.WebApi +4. ⏳ Test integration with real data + +### Short-term: +5. ⏳ Add Swagger documentation for new endpoints +6. ⏳ Implement error handling for gRPC calls +7. ⏳ Add logging for commission operations +8. ⏳ Create admin dashboard for network visualization + +### Long-term: +9. ⏳ Add real-time notifications (SignalR) for commission updates +10. ⏳ Implement caching for frequently accessed data +11. ⏳ Add reporting/analytics endpoints +12. ⏳ Performance optimization for large network trees + +--- + +## 📞 Troubleshooting + +### Issue 1: gRPC Connection Failed + +**Error**: `Status(StatusCode="Unavailable", Detail="...")` + +**Solutions**: +1. Check CMS service is running: `https://cms.kbs1.ir` +2. Verify network connectivity +3. Check firewall settings +4. Verify SSL certificate is valid + +--- + +### Issue 2: Authentication Failed + +**Error**: `Status(StatusCode="Unauthenticated", Detail="...")` + +**Solutions**: +1. Verify `ITokenProvider` is registered in DI +2. Check JWT token is valid and not expired +3. Verify token has correct claims/permissions +4. Check Authorization header is being sent + +--- + +### Issue 3: Package Version Mismatch + +**Error**: `The type or namespace 'CommissionContract' could not be found` + +**Solutions**: +1. Update package version in `.csproj`: + ```xml + + ``` +2. Run `dotnet restore` +3. Clean and rebuild solution + +--- + +### Issue 4: Method Not Found + +**Error**: `Method 'GetWeeklyPool' not found on service 'CommissionContract'` + +**Solutions**: +1. Verify CMS service has the latest code deployed +2. Check Protobuf contract matches between CMS and BFF +3. Update both CMS and BFF to latest versions +4. Restart both services + +--- + +## 🎯 Summary + +### ✅ Completed: +- CMS Protobuf package updated to 0.0.140 +- 3 new gRPC clients added to BFF: + * CommissionContract (8+ methods) + * NetworkMembershipContract (6+ methods) + * ClubMembershipContract (4+ methods) +- Auto-registration configured +- Authentication via JWT configured +- Build successful (0 errors) + +### ⏳ Pending: +- Create CQRS handlers for Commission operations +- Create CQRS handlers for Network operations +- Create CQRS handlers for Club operations +- Add API Controllers/Endpoints +- Add Swagger documentation +- Integration testing + +### 🔑 Key Points: +- **No manual registration needed**: gRPC clients auto-register via `BatchRegisterGrpcClients()` +- **Authentication handled**: JWT token automatically added to all requests +- **Type-safe**: All Protobuf contracts are strongly typed +- **Easy to use**: Simple interface via `IApplicationContractContext` + +--- + +**Last Updated**: 2025-11-30 +**Build Status**: ✅ Success +**Ready for**: Handler implementation & API endpoint creation diff --git a/src/BackOffice.BFF.Application/BackOffice.BFF.Application.csproj b/src/BackOffice.BFF.Application/BackOffice.BFF.Application.csproj index a7c2287..f1ffbfb 100644 --- a/src/BackOffice.BFF.Application/BackOffice.BFF.Application.csproj +++ b/src/BackOffice.BFF.Application/BackOffice.BFF.Application.csproj @@ -17,6 +17,7 @@ + diff --git a/src/BackOffice.BFF.Application/ClubMembershipCQ/Commands/ActivateClub/ActivateClubCommand.cs b/src/BackOffice.BFF.Application/ClubMembershipCQ/Commands/ActivateClub/ActivateClubCommand.cs new file mode 100644 index 0000000..f2f2597 --- /dev/null +++ b/src/BackOffice.BFF.Application/ClubMembershipCQ/Commands/ActivateClub/ActivateClubCommand.cs @@ -0,0 +1,24 @@ +namespace BackOffice.BFF.Application.ClubMembershipCQ.Commands.ActivateClub; + +public record ActivateClubCommand : IRequest +{ + /// + /// شناسه کاربر + /// + public long UserId { get; init; } + + /// + /// شناسه بسته (Package) + /// + public long PackageId { get; init; } + + /// + /// کد فعال‌سازی (اختیاری) + /// + public string? ActivationCode { get; init; } + + /// + /// مدت زمان عضویت به ماه (پیش‌فرض: 12) + /// + public int DurationMonths { get; init; } = 12; +} diff --git a/src/BackOffice.BFF.Application/ClubMembershipCQ/Commands/ActivateClub/ActivateClubCommandHandler.cs b/src/BackOffice.BFF.Application/ClubMembershipCQ/Commands/ActivateClub/ActivateClubCommandHandler.cs new file mode 100644 index 0000000..ab9d281 --- /dev/null +++ b/src/BackOffice.BFF.Application/ClubMembershipCQ/Commands/ActivateClub/ActivateClubCommandHandler.cs @@ -0,0 +1,38 @@ +using CMSMicroservice.Protobuf.Protos.ClubMembership; + +namespace BackOffice.BFF.Application.ClubMembershipCQ.Commands.ActivateClub; + +public class ActivateClubCommandHandler : IRequestHandler +{ + private readonly IApplicationContractContext _context; + + public ActivateClubCommandHandler(IApplicationContractContext context) + { + _context = context; + } + + public async Task Handle(ActivateClubCommand request, CancellationToken cancellationToken) + { + var grpcRequest = new ActivateClubMembershipRequest + { + UserId = request.UserId, + PackageId = request.PackageId, + DurationMonths = request.DurationMonths + }; + + // اگر کد فعال‌سازی ارسال شده، اضافه کن + if (!string.IsNullOrEmpty(request.ActivationCode)) + { + grpcRequest.ActivationCode = request.ActivationCode; + } + + var response = await _context.ClubMemberships.ActivateClubMembershipAsync( + grpcRequest, + cancellationToken: cancellationToken); + + return new ActivateClubResponseDto + { + Message = "Club membership activated successfully" + }; + } +} diff --git a/src/BackOffice.BFF.Application/ClubMembershipCQ/Commands/ActivateClub/ActivateClubResponseDto.cs b/src/BackOffice.BFF.Application/ClubMembershipCQ/Commands/ActivateClub/ActivateClubResponseDto.cs new file mode 100644 index 0000000..d5f531f --- /dev/null +++ b/src/BackOffice.BFF.Application/ClubMembershipCQ/Commands/ActivateClub/ActivateClubResponseDto.cs @@ -0,0 +1,9 @@ +namespace BackOffice.BFF.Application.ClubMembershipCQ.Commands.ActivateClub; + +public class ActivateClubResponseDto +{ + /// + /// پیام موفقیت + /// + public string Message { get; set; } = "Club membership activated successfully"; +} diff --git a/src/BackOffice.BFF.Application/ClubMembershipCQ/Queries/GetAllClubMembers/GetAllClubMembersQuery.cs b/src/BackOffice.BFF.Application/ClubMembershipCQ/Queries/GetAllClubMembers/GetAllClubMembersQuery.cs new file mode 100644 index 0000000..06d367b --- /dev/null +++ b/src/BackOffice.BFF.Application/ClubMembershipCQ/Queries/GetAllClubMembers/GetAllClubMembersQuery.cs @@ -0,0 +1,19 @@ +namespace BackOffice.BFF.Application.ClubMembershipCQ.Queries.GetAllClubMembers; + +public record GetAllClubMembersQuery : IRequest +{ + /// + /// فیلتر بر اساس وضعیت فعال/غیرفعال (null = همه) + /// + public bool? IsActive { get; init; } + + /// + /// شماره صفحه (پیش‌فرض: 1) + /// + public int PageNumber { get; init; } = 1; + + /// + /// تعداد در هر صفحه (پیش‌فرض: 20) + /// + public int PageSize { get; init; } = 20; +} diff --git a/src/BackOffice.BFF.Application/ClubMembershipCQ/Queries/GetAllClubMembers/GetAllClubMembersQueryHandler.cs b/src/BackOffice.BFF.Application/ClubMembershipCQ/Queries/GetAllClubMembers/GetAllClubMembersQueryHandler.cs new file mode 100644 index 0000000..d524037 --- /dev/null +++ b/src/BackOffice.BFF.Application/ClubMembershipCQ/Queries/GetAllClubMembers/GetAllClubMembersQueryHandler.cs @@ -0,0 +1,22 @@ +using CMSMicroservice.Protobuf.Protos.ClubMembership; + +namespace BackOffice.BFF.Application.ClubMembershipCQ.Queries.GetAllClubMembers; + +public class GetAllClubMembersQueryHandler : IRequestHandler +{ + private readonly IApplicationContractContext _context; + + public GetAllClubMembersQueryHandler(IApplicationContractContext context) + { + _context = context; + } + + public async Task Handle(GetAllClubMembersQuery request, CancellationToken cancellationToken) + { + var response = await _context.ClubMemberships.GetAllClubMembershipsAsync( + request.Adapt(), + cancellationToken: cancellationToken); + + return response.Adapt(); + } +} diff --git a/src/BackOffice.BFF.Application/ClubMembershipCQ/Queries/GetAllClubMembers/GetAllClubMembersResponseDto.cs b/src/BackOffice.BFF.Application/ClubMembershipCQ/Queries/GetAllClubMembers/GetAllClubMembersResponseDto.cs new file mode 100644 index 0000000..cfb36e8 --- /dev/null +++ b/src/BackOffice.BFF.Application/ClubMembershipCQ/Queries/GetAllClubMembers/GetAllClubMembersResponseDto.cs @@ -0,0 +1,72 @@ +namespace BackOffice.BFF.Application.ClubMembershipCQ.Queries.GetAllClubMembers; + +public class GetAllClubMembersResponseDto +{ + /// + /// لیست اعضای باشگاه + /// + public List Members { get; set; } = new(); + + /// + /// تعداد کل رکوردها + /// + public int TotalCount { get; set; } + + /// + /// شماره صفحه فعلی + /// + public int PageNumber { get; set; } + + /// + /// تعداد در هر صفحه + /// + public int PageSize { get; set; } +} + +public class ClubMemberDto +{ + /// + /// شناسه ClubMembership + /// + public long Id { get; set; } + + /// + /// شناسه کاربر + /// + public long UserId { get; set; } + + /// + /// نام کاربر + /// + public string UserName { get; set; } = string.Empty; + + /// + /// تاریخ فعال‌سازی + /// + public DateTime ActivationDate { get; set; } + + /// + /// مبلغ مشارکت اولیه (تومان) + /// + public decimal InitialContribution { get; set; } + + /// + /// وضعیت فعال/غیرفعال + /// + public bool IsActive { get; set; } + + /// + /// تاریخ غیرفعال شدن (در صورت وجود) + /// + public DateTime? DeactivationDate { get; set; } + + /// + /// دلیل غیرفعال شدن (در صورت وجود) + /// + public string? DeactivationReason { get; set; } + + /// + /// تاریخ ایجاد + /// + public DateTime CreatedAt { get; set; } +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Commands/ApproveWithdrawal/ApproveWithdrawalCommand.cs b/src/BackOffice.BFF.Application/CommissionCQ/Commands/ApproveWithdrawal/ApproveWithdrawalCommand.cs new file mode 100644 index 0000000..c42dbcf --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Commands/ApproveWithdrawal/ApproveWithdrawalCommand.cs @@ -0,0 +1,14 @@ +namespace BackOffice.BFF.Application.CommissionCQ.Commands.ApproveWithdrawal; + +public record ApproveWithdrawalCommand : IRequest +{ + /// + /// شناسه درخواست برداشت + /// + public long WithdrawalId { get; init; } + + /// + /// یادداشت مدیر (اختیاری) + /// + public string? AdminNote { get; init; } +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Commands/ApproveWithdrawal/ApproveWithdrawalCommandHandler.cs b/src/BackOffice.BFF.Application/CommissionCQ/Commands/ApproveWithdrawal/ApproveWithdrawalCommandHandler.cs new file mode 100644 index 0000000..159d163 --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Commands/ApproveWithdrawal/ApproveWithdrawalCommandHandler.cs @@ -0,0 +1,30 @@ +using BackOffice.BFF.Commission.Protobuf; + +namespace BackOffice.BFF.Application.CommissionCQ.Commands.ApproveWithdrawal; + +public class ApproveWithdrawalCommandHandler : IRequestHandler +{ + private readonly IApplicationContractContext _context; + + public ApproveWithdrawalCommandHandler(IApplicationContractContext context) + { + _context = context; + } + + public async Task Handle(ApproveWithdrawalCommand request, CancellationToken cancellationToken) + { + var grpcRequest = new ApproveWithdrawalRequest + { + WithdrawalId = request.WithdrawalId, + AdminNote = request.AdminNote ?? string.Empty + }; + + var response = await _context.Commissions.ApproveWithdrawalAsync(grpcRequest, cancellationToken: cancellationToken); + + return new ApproveWithdrawalResponseDto + { + Success = response.Success, + Message = response.Message + }; + } +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Commands/ApproveWithdrawal/ApproveWithdrawalResponseDto.cs b/src/BackOffice.BFF.Application/CommissionCQ/Commands/ApproveWithdrawal/ApproveWithdrawalResponseDto.cs new file mode 100644 index 0000000..857b7d5 --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Commands/ApproveWithdrawal/ApproveWithdrawalResponseDto.cs @@ -0,0 +1,7 @@ +namespace BackOffice.BFF.Application.CommissionCQ.Commands.ApproveWithdrawal; + +public record ApproveWithdrawalResponseDto +{ + public bool Success { get; init; } + public string Message { get; init; } = string.Empty; +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Commands/ProcessWithdrawal/ProcessWithdrawalCommand.cs b/src/BackOffice.BFF.Application/CommissionCQ/Commands/ProcessWithdrawal/ProcessWithdrawalCommand.cs new file mode 100644 index 0000000..92c9f62 --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Commands/ProcessWithdrawal/ProcessWithdrawalCommand.cs @@ -0,0 +1,19 @@ +namespace BackOffice.BFF.Application.CommissionCQ.Commands.ProcessWithdrawal; + +public record ProcessWithdrawalCommand : IRequest +{ + /// + /// شناسه درخواست برداشت + /// + public long WithdrawalId { get; init; } + + /// + /// شناسه تراکنش بانکی (اختیاری) + /// + public string? TransactionId { get; init; } + + /// + /// یادداشت مدیر (اختیاری) + /// + public string? AdminNote { get; init; } +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Commands/ProcessWithdrawal/ProcessWithdrawalCommandHandler.cs b/src/BackOffice.BFF.Application/CommissionCQ/Commands/ProcessWithdrawal/ProcessWithdrawalCommandHandler.cs new file mode 100644 index 0000000..927f7e2 --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Commands/ProcessWithdrawal/ProcessWithdrawalCommandHandler.cs @@ -0,0 +1,31 @@ +using BackOffice.BFF.Commission.Protobuf; + +namespace BackOffice.BFF.Application.CommissionCQ.Commands.ProcessWithdrawal; + +public class ProcessWithdrawalCommandHandler : IRequestHandler +{ + private readonly IApplicationContractContext _context; + + public ProcessWithdrawalCommandHandler(IApplicationContractContext context) + { + _context = context; + } + + public async Task Handle(ProcessWithdrawalCommand request, CancellationToken cancellationToken) + { + var grpcRequest = new ProcessWithdrawalRequest + { + WithdrawalId = request.WithdrawalId, + TransactionId = request.TransactionId ?? string.Empty, + AdminNote = request.AdminNote ?? string.Empty + }; + + var response = await _context.Commissions.ProcessWithdrawalAsync(grpcRequest, cancellationToken: cancellationToken); + + return new ProcessWithdrawalResponseDto + { + Success = response.Success, + Message = response.Message + }; + } +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Commands/ProcessWithdrawal/ProcessWithdrawalResponseDto.cs b/src/BackOffice.BFF.Application/CommissionCQ/Commands/ProcessWithdrawal/ProcessWithdrawalResponseDto.cs new file mode 100644 index 0000000..a28735d --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Commands/ProcessWithdrawal/ProcessWithdrawalResponseDto.cs @@ -0,0 +1,7 @@ +namespace BackOffice.BFF.Application.CommissionCQ.Commands.ProcessWithdrawal; + +public record ProcessWithdrawalResponseDto +{ + public bool Success { get; init; } + public string Message { get; init; } = string.Empty; +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Commands/RejectWithdrawal/RejectWithdrawalCommand.cs b/src/BackOffice.BFF.Application/CommissionCQ/Commands/RejectWithdrawal/RejectWithdrawalCommand.cs new file mode 100644 index 0000000..336b32a --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Commands/RejectWithdrawal/RejectWithdrawalCommand.cs @@ -0,0 +1,14 @@ +namespace BackOffice.BFF.Application.CommissionCQ.Commands.RejectWithdrawal; + +public record RejectWithdrawalCommand : IRequest +{ + /// + /// شناسه درخواست برداشت + /// + public long WithdrawalId { get; init; } + + /// + /// دلیل رد (الزامی) + /// + public string RejectReason { get; init; } = string.Empty; +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Commands/RejectWithdrawal/RejectWithdrawalCommandHandler.cs b/src/BackOffice.BFF.Application/CommissionCQ/Commands/RejectWithdrawal/RejectWithdrawalCommandHandler.cs new file mode 100644 index 0000000..dcc046e --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Commands/RejectWithdrawal/RejectWithdrawalCommandHandler.cs @@ -0,0 +1,30 @@ +using BackOffice.BFF.Commission.Protobuf; + +namespace BackOffice.BFF.Application.CommissionCQ.Commands.RejectWithdrawal; + +public class RejectWithdrawalCommandHandler : IRequestHandler +{ + private readonly IApplicationContractContext _context; + + public RejectWithdrawalCommandHandler(IApplicationContractContext context) + { + _context = context; + } + + public async Task Handle(RejectWithdrawalCommand request, CancellationToken cancellationToken) + { + var grpcRequest = new RejectWithdrawalRequest + { + WithdrawalId = request.WithdrawalId, + RejectReason = request.RejectReason + }; + + var response = await _context.Commissions.RejectWithdrawalAsync(grpcRequest, cancellationToken: cancellationToken); + + return new RejectWithdrawalResponseDto + { + Success = response.Success, + Message = response.Message + }; + } +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Commands/RejectWithdrawal/RejectWithdrawalResponseDto.cs b/src/BackOffice.BFF.Application/CommissionCQ/Commands/RejectWithdrawal/RejectWithdrawalResponseDto.cs new file mode 100644 index 0000000..40121e6 --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Commands/RejectWithdrawal/RejectWithdrawalResponseDto.cs @@ -0,0 +1,7 @@ +namespace BackOffice.BFF.Application.CommissionCQ.Commands.RejectWithdrawal; + +public record RejectWithdrawalResponseDto +{ + public bool Success { get; init; } + public string Message { get; init; } = string.Empty; +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetAllWeeklyPools/GetAllWeeklyPoolsQuery.cs b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetAllWeeklyPools/GetAllWeeklyPoolsQuery.cs new file mode 100644 index 0000000..be994ca --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetAllWeeklyPools/GetAllWeeklyPoolsQuery.cs @@ -0,0 +1,29 @@ +namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetAllWeeklyPools; + +public record GetAllWeeklyPoolsQuery : IRequest +{ + /// + /// از هفته (فیلتر اختیاری) + /// + public string? FromWeek { get; init; } + + /// + /// تا هفته (فیلتر اختیاری) + /// + public string? ToWeek { get; init; } + + /// + /// فقط Pool های محاسبه شده + /// + public bool? OnlyCalculated { get; init; } + + /// + /// شماره صفحه + /// + public int PageIndex { get; init; } = 1; + + /// + /// تعداد در صفحه + /// + public int PageSize { get; init; } = 10; +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetAllWeeklyPools/GetAllWeeklyPoolsQueryHandler.cs b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetAllWeeklyPools/GetAllWeeklyPoolsQueryHandler.cs new file mode 100644 index 0000000..7d157f6 --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetAllWeeklyPools/GetAllWeeklyPoolsQueryHandler.cs @@ -0,0 +1,41 @@ +using CMSMicroservice.Protobuf.Protos.Commission; + +namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetAllWeeklyPools; + +public class GetAllWeeklyPoolsQueryHandler : IRequestHandler +{ + private readonly IApplicationContractContext _context; + + public GetAllWeeklyPoolsQueryHandler(IApplicationContractContext context) + { + _context = context; + } + + public async Task Handle(GetAllWeeklyPoolsQuery request, CancellationToken cancellationToken) + { + var grpcRequest = new GetAllWeeklyPoolsRequest + { + PageIndex = request.PageIndex, + PageSize = request.PageSize + }; + + if (!string.IsNullOrWhiteSpace(request.FromWeek)) + { + grpcRequest.FromWeek = request.FromWeek; + } + + if (!string.IsNullOrWhiteSpace(request.ToWeek)) + { + grpcRequest.ToWeek = request.ToWeek; + } + + if (request.OnlyCalculated.HasValue) + { + grpcRequest.OnlyCalculated = request.OnlyCalculated.Value; + } + + var response = await _context.Commissions.GetAllWeeklyPoolsAsync(grpcRequest, cancellationToken: cancellationToken); + + return response.Adapt(); + } +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetAllWeeklyPools/GetAllWeeklyPoolsResponseDto.cs b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetAllWeeklyPools/GetAllWeeklyPoolsResponseDto.cs new file mode 100644 index 0000000..1c41976 --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetAllWeeklyPools/GetAllWeeklyPoolsResponseDto.cs @@ -0,0 +1,27 @@ +namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetAllWeeklyPools; + +public record GetAllWeeklyPoolsResponseDto +{ + public MetaDataDto MetaData { get; init; } = new(); + public List Models { get; init; } = new(); +} + +public record WeeklyCommissionPoolDto +{ + public long Id { get; init; } + public string WeekNumber { get; init; } = string.Empty; + public long TotalPoolAmount { get; init; } + public int TotalBalances { get; init; } + public long ValuePerBalance { get; init; } + public bool IsCalculated { get; init; } + public DateTime? CalculatedAt { get; init; } + public DateTime Created { get; init; } +} + +public record MetaDataDto +{ + public int TotalCount { get; init; } + public int PageSize { get; init; } + public int CurrentPage { get; init; } + public int TotalPages { get; init; } +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetUserPayouts/GetUserPayoutsQuery.cs b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetUserPayouts/GetUserPayoutsQuery.cs new file mode 100644 index 0000000..e011f97 --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetUserPayouts/GetUserPayoutsQuery.cs @@ -0,0 +1,24 @@ +namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetUserPayouts; + +public record GetUserPayoutsQuery : IRequest +{ + /// + /// شناسه کاربر + /// + public long UserId { get; init; } + + /// + /// شماره هفته (اختیاری - برای فیلتر) + /// + public string? WeekNumber { get; init; } + + /// + /// شماره صفحه (پیش‌فرض: 1) + /// + public int PageNumber { get; init; } = 1; + + /// + /// تعداد در هر صفحه (پیش‌فرض: 10) + /// + public int PageSize { get; init; } = 10; +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetUserPayouts/GetUserPayoutsQueryHandler.cs b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetUserPayouts/GetUserPayoutsQueryHandler.cs new file mode 100644 index 0000000..3d6e8b8 --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetUserPayouts/GetUserPayoutsQueryHandler.cs @@ -0,0 +1,22 @@ +using CMSMicroservice.Protobuf.Protos.Commission; + +namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetUserPayouts; + +public class GetUserPayoutsQueryHandler : IRequestHandler +{ + private readonly IApplicationContractContext _context; + + public GetUserPayoutsQueryHandler(IApplicationContractContext context) + { + _context = context; + } + + public async Task Handle(GetUserPayoutsQuery request, CancellationToken cancellationToken) + { + var response = await _context.Commissions.GetUserCommissionPayoutsAsync( + request.Adapt(), + cancellationToken: cancellationToken); + + return response.Adapt(); + } +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetUserPayouts/GetUserPayoutsResponseDto.cs b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetUserPayouts/GetUserPayoutsResponseDto.cs new file mode 100644 index 0000000..57c6357 --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetUserPayouts/GetUserPayoutsResponseDto.cs @@ -0,0 +1,77 @@ +namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetUserPayouts; + +public class GetUserPayoutsResponseDto +{ + /// + /// لیست Payout ها + /// + public List Payouts { get; set; } = new(); + + /// + /// تعداد کل رکوردها + /// + public int TotalCount { get; set; } + + /// + /// شماره صفحه فعلی + /// + public int PageNumber { get; set; } + + /// + /// تعداد در هر صفحه + /// + public int PageSize { get; set; } +} + +public class UserPayoutDto +{ + /// + /// شناسه Payout + /// + public long Id { get; set; } + + /// + /// شناسه کاربر + /// + public long UserId { get; set; } + + /// + /// شماره هفته + /// + public string WeekNumber { get; set; } = string.Empty; + + /// + /// بالانس Leg چپ + /// + public decimal LeftLegBalance { get; set; } + + /// + /// بالانس Leg راست + /// + public decimal RightLegBalance { get; set; } + + /// + /// بالانس Leg ضعیف‌تر + /// + public decimal WeakerLegBalance { get; set; } + + /// + /// مبلغ کمیسیون (تومان) + /// + public decimal CommissionAmount { get; set; } + + /// + /// وضعیت پرداخت + /// + public string Status { get; set; } = string.Empty; + + /// + /// تاریخ پرداخت + /// + public DateTime? PaidAt { get; set; } + + /// + /// تاریخ ایجاد + /// + public DateTime CreatedAt { get; set; } +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWeeklyPool/GetWeeklyPoolQuery.cs b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWeeklyPool/GetWeeklyPoolQuery.cs new file mode 100644 index 0000000..9af0e15 --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWeeklyPool/GetWeeklyPoolQuery.cs @@ -0,0 +1,9 @@ +namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWeeklyPool; + +public record GetWeeklyPoolQuery : IRequest +{ + /// + /// شماره هفته (فرمت: YYYY-Www مثلاً 2025-W48) + /// + public string WeekNumber { get; init; } = string.Empty; +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWeeklyPool/GetWeeklyPoolQueryHandler.cs b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWeeklyPool/GetWeeklyPoolQueryHandler.cs new file mode 100644 index 0000000..4fb6832 --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWeeklyPool/GetWeeklyPoolQueryHandler.cs @@ -0,0 +1,22 @@ +using CMSMicroservice.Protobuf.Protos.Commission; + +namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWeeklyPool; + +public class GetWeeklyPoolQueryHandler : IRequestHandler +{ + private readonly IApplicationContractContext _context; + + public GetWeeklyPoolQueryHandler(IApplicationContractContext context) + { + _context = context; + } + + public async Task Handle(GetWeeklyPoolQuery request, CancellationToken cancellationToken) + { + var response = await _context.Commissions.GetWeeklyCommissionPoolAsync( + request.Adapt(), + cancellationToken: cancellationToken); + + return response.Adapt(); + } +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWeeklyPool/GetWeeklyPoolResponseDto.cs b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWeeklyPool/GetWeeklyPoolResponseDto.cs new file mode 100644 index 0000000..be6e83d --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWeeklyPool/GetWeeklyPoolResponseDto.cs @@ -0,0 +1,59 @@ +namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWeeklyPool; + +public class GetWeeklyPoolResponseDto +{ + /// + /// شناسه Pool + /// + public long Id { get; set; } + + /// + /// شماره هفته (فرمت: YYYY-Www) + /// + public string WeekNumber { get; set; } = string.Empty; + + /// + /// مجموع کل Pool (تومان) + /// + public decimal TotalPoolValue { get; set; } + + /// + /// مجموع مشارکت‌های اولیه (InitialContribution) + /// + public decimal TotalContributions { get; set; } + + /// + /// مجموع Payout های پرداخت شده + /// + public decimal TotalPayouts { get; set; } + + /// + /// باقیمانده Pool + /// + public decimal LeftBalance { get; set; } + + /// + /// تعداد اعضای فعال در این هفته + /// + public int ActiveMembersCount { get; set; } + + /// + /// آیا محاسبه شده است؟ + /// + public bool IsCalculated { get; set; } + + /// + /// تاریخ محاسبه + /// + public DateTime? CalculatedAt { get; set; } + + /// + /// تاریخ ایجاد + /// + public DateTime CreatedAt { get; set; } + + /// + /// تاریخ آخرین ویرایش + /// + public DateTime? ModifiedAt { get; set; } +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWithdrawalRequests/GetWithdrawalRequestsQuery.cs b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWithdrawalRequests/GetWithdrawalRequestsQuery.cs new file mode 100644 index 0000000..e6596f1 --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWithdrawalRequests/GetWithdrawalRequestsQuery.cs @@ -0,0 +1,24 @@ +namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWithdrawalRequests; + +public record GetWithdrawalRequestsQuery : IRequest +{ + /// + /// شماره صفحه (پیش‌فرض: 1) + /// + public int PageIndex { get; init; } = 1; + + /// + /// تعداد در هر صفحه (پیش‌فرض: 10) + /// + public int PageSize { get; init; } = 10; + + /// + /// فیلتر وضعیت (اختیاری): 0=Pending, 1=Approved, 2=Rejected, 3=Processed + /// + public int? Status { get; init; } + + /// + /// فیلتر شناسه کاربر (اختیاری) + /// + public long? UserId { get; init; } +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWithdrawalRequests/GetWithdrawalRequestsQueryHandler.cs b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWithdrawalRequests/GetWithdrawalRequestsQueryHandler.cs new file mode 100644 index 0000000..91a9e93 --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWithdrawalRequests/GetWithdrawalRequestsQueryHandler.cs @@ -0,0 +1,36 @@ +using BackOffice.BFF.Commission.Protobuf; + +namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWithdrawalRequests; + +public class GetWithdrawalRequestsQueryHandler : IRequestHandler +{ + private readonly IApplicationContractContext _context; + + public GetWithdrawalRequestsQueryHandler(IApplicationContractContext context) + { + _context = context; + } + + public async Task Handle(GetWithdrawalRequestsQuery request, CancellationToken cancellationToken) + { + var grpcRequest = new GetWithdrawalRequestsRequest + { + PageIndex = request.PageIndex, + PageSize = request.PageSize + }; + + if (request.Status.HasValue) + { + grpcRequest.Status = request.Status.Value; + } + + if (request.UserId.HasValue) + { + grpcRequest.UserId = request.UserId.Value; + } + + var response = await _context.Commissions.GetWithdrawalRequestsAsync(grpcRequest, cancellationToken: cancellationToken); + + return response.Adapt(); + } +} diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWithdrawalRequests/GetWithdrawalRequestsResponseDto.cs b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWithdrawalRequests/GetWithdrawalRequestsResponseDto.cs new file mode 100644 index 0000000..e4cb043 --- /dev/null +++ b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetWithdrawalRequests/GetWithdrawalRequestsResponseDto.cs @@ -0,0 +1,31 @@ +namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWithdrawalRequests; + +public record GetWithdrawalRequestsResponseDto +{ + public List Models { get; init; } = new(); + public MetaDataDto MetaData { get; init; } = new(); +} + +public record WithdrawalRequestDto +{ + public long Id { get; init; } + public long UserId { get; init; } + public string UserName { get; init; } = string.Empty; + public string PhoneNumber { get; init; } = string.Empty; + public long Amount { get; init; } + public int Status { get; init; } + public string Method { get; init; } = "Bank"; + public string? BankAccount { get; init; } + public string? BankName { get; init; } + public DateTime RequestDate { get; init; } + public DateTime? ProcessedDate { get; init; } + public string? AdminNote { get; init; } +} + +public record MetaDataDto +{ + public int TotalCount { get; init; } + public int PageSize { get; init; } + public int CurrentPage { get; init; } + public int TotalPages { get; init; } +} diff --git a/src/BackOffice.BFF.Application/Common/Interfaces/IApplicationContractContext.cs b/src/BackOffice.BFF.Application/Common/Interfaces/IApplicationContractContext.cs index 89562dd..4c1c000 100644 --- a/src/BackOffice.BFF.Application/Common/Interfaces/IApplicationContractContext.cs +++ b/src/BackOffice.BFF.Application/Common/Interfaces/IApplicationContractContext.cs @@ -9,6 +9,9 @@ using CMSMicroservice.Protobuf.Protos.ProductImages; using CMSMicroservice.Protobuf.Protos.ProductGallerys; using CMSMicroservice.Protobuf.Protos.Category; using CMSMicroservice.Protobuf.Protos.PruductCategory; +using CMSMicroservice.Protobuf.Protos.Commission; +using CMSMicroservice.Protobuf.Protos.NetworkMembership; +using CMSMicroservice.Protobuf.Protos.ClubMembership; using FMSMicroservice.Protobuf.Protos.FileInfo; namespace BackOffice.BFF.Application.Common.Interfaces; @@ -30,6 +33,11 @@ public interface IApplicationContractContext UserContract.UserContractClient Users { get; } UserOrderContract.UserOrderContractClient UserOrders { get; } UserRoleContract.UserRoleContractClient UserRoles { get; } + + // Network & Commission System + CommissionContract.CommissionContractClient Commissions { get; } + NetworkMembershipContract.NetworkMembershipContractClient NetworkMemberships { get; } + ClubMembershipContract.ClubMembershipContractClient ClubMemberships { get; } #endregion } diff --git a/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkHistory/GetNetworkHistoryQuery.cs b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkHistory/GetNetworkHistoryQuery.cs new file mode 100644 index 0000000..45aae2a --- /dev/null +++ b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkHistory/GetNetworkHistoryQuery.cs @@ -0,0 +1,24 @@ +namespace BackOffice.BFF.Application.NetworkMembershipCQ.Queries.GetNetworkHistory; + +public record GetNetworkHistoryQuery : IRequest +{ + /// + /// شناسه کاربر (اختیاری) + /// + public long? UserId { get; init; } + + /// + /// شناسه والد (اختیاری) + /// + public long? ParentId { get; init; } + + /// + /// شماره صفحه (پیش‌فرض: 1) + /// + public int PageNumber { get; init; } = 1; + + /// + /// تعداد در هر صفحه (پیش‌فرض: 10) + /// + public int PageSize { get; init; } = 10; +} diff --git a/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkHistory/GetNetworkHistoryQueryHandler.cs b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkHistory/GetNetworkHistoryQueryHandler.cs new file mode 100644 index 0000000..7d772d8 --- /dev/null +++ b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkHistory/GetNetworkHistoryQueryHandler.cs @@ -0,0 +1,22 @@ +using CMSMicroservice.Protobuf.Protos.NetworkMembership; + +namespace BackOffice.BFF.Application.NetworkMembershipCQ.Queries.GetNetworkHistory; + +public class GetNetworkHistoryQueryHandler : IRequestHandler +{ + private readonly IApplicationContractContext _context; + + public GetNetworkHistoryQueryHandler(IApplicationContractContext context) + { + _context = context; + } + + public async Task Handle(GetNetworkHistoryQuery request, CancellationToken cancellationToken) + { + var response = await _context.NetworkMemberships.GetNetworkMembershipHistoryAsync( + request.Adapt(), + cancellationToken: cancellationToken); + + return response.Adapt(); + } +} diff --git a/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkHistory/GetNetworkHistoryResponseDto.cs b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkHistory/GetNetworkHistoryResponseDto.cs new file mode 100644 index 0000000..acef274 --- /dev/null +++ b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkHistory/GetNetworkHistoryResponseDto.cs @@ -0,0 +1,87 @@ +namespace BackOffice.BFF.Application.NetworkMembershipCQ.Queries.GetNetworkHistory; + +public class GetNetworkHistoryResponseDto +{ + /// + /// لیست تاریخچه تغییرات شبکه + /// + public List History { get; set; } = new(); + + /// + /// تعداد کل رکوردها + /// + public int TotalCount { get; set; } + + /// + /// شماره صفحه فعلی + /// + public int PageNumber { get; set; } + + /// + /// تعداد در هر صفحه + /// + public int PageSize { get; set; } +} + +public class NetworkHistoryDto +{ + /// + /// شناسه تاریخچه + /// + public long Id { get; set; } + + /// + /// شناسه کاربر + /// + public long UserId { get; set; } + + /// + /// شناسه والد قبلی + /// + public long? OldParentId { get; set; } + + /// + /// شناسه والد جدید + /// + public long? NewParentId { get; set; } + + /// + /// موقعیت قبلی (0=Left, 1=Right) + /// + public int? OldNetworkLeg { get; set; } + + /// + /// موقعیت جدید + /// + public int? NewNetworkLeg { get; set; } + + /// + /// سطح قبلی + /// + public int? OldNetworkLevel { get; set; } + + /// + /// سطح جدید + /// + public int? NewNetworkLevel { get; set; } + + /// + /// نوع عملیات + /// + public int Action { get; set; } + + /// + /// انجام دهنده عملیات + /// + public string PerformedBy { get; set; } = string.Empty; + + /// + /// دلیل تغییر + /// + public string Reason { get; set; } = string.Empty; + + /// + /// تاریخ ایجاد + /// + public DateTime CreatedAt { get; set; } +} diff --git a/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkTree/GetNetworkTreeQuery.cs b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkTree/GetNetworkTreeQuery.cs new file mode 100644 index 0000000..398598e --- /dev/null +++ b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkTree/GetNetworkTreeQuery.cs @@ -0,0 +1,19 @@ +namespace BackOffice.BFF.Application.NetworkMembershipCQ.Queries.GetNetworkTree; + +public record GetNetworkTreeQuery : IRequest +{ + /// + /// شناسه کاربر ریشه (Root) + /// + public long RootUserId { get; init; } + + /// + /// حداکثر عمق درخت (اختیاری، پیش‌فرض: 5) + /// + public int? MaxDepth { get; init; } + + /// + /// فقط کاربران فعال (اختیاری) + /// + public bool? OnlyActive { get; init; } +} diff --git a/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkTree/GetNetworkTreeQueryHandler.cs b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkTree/GetNetworkTreeQueryHandler.cs new file mode 100644 index 0000000..1223f78 --- /dev/null +++ b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkTree/GetNetworkTreeQueryHandler.cs @@ -0,0 +1,22 @@ +using CMSMicroservice.Protobuf.Protos.NetworkMembership; + +namespace BackOffice.BFF.Application.NetworkMembershipCQ.Queries.GetNetworkTree; + +public class GetNetworkTreeQueryHandler : IRequestHandler +{ + private readonly IApplicationContractContext _context; + + public GetNetworkTreeQueryHandler(IApplicationContractContext context) + { + _context = context; + } + + public async Task Handle(GetNetworkTreeQuery request, CancellationToken cancellationToken) + { + var response = await _context.NetworkMemberships.GetNetworkTreeAsync( + request.Adapt(), + cancellationToken: cancellationToken); + + return response.Adapt(); + } +} diff --git a/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkTree/GetNetworkTreeResponseDto.cs b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkTree/GetNetworkTreeResponseDto.cs new file mode 100644 index 0000000..8d9c5bf --- /dev/null +++ b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkTree/GetNetworkTreeResponseDto.cs @@ -0,0 +1,47 @@ +namespace BackOffice.BFF.Application.NetworkMembershipCQ.Queries.GetNetworkTree; + +public class GetNetworkTreeResponseDto +{ + /// + /// لیست گره‌های درخت شبکه + /// + public List Nodes { get; set; } = new(); +} + +public class NetworkTreeNodeDto +{ + /// + /// شناسه کاربر + /// + public long UserId { get; set; } + + /// + /// نام کاربر + /// + public string UserName { get; set; } = string.Empty; + + /// + /// شناسه والد + /// + public long? ParentId { get; set; } + + /// + /// موقعیت در شبکه (0=Left, 1=Right) + /// + public int NetworkLeg { get; set; } + + /// + /// سطح در شبکه + /// + public int NetworkLevel { get; set; } + + /// + /// وضعیت فعال/غیرفعال + /// + public bool IsActive { get; set; } + + /// + /// تاریخ عضویت + /// + public DateTime JoinedAt { get; set; } +} diff --git a/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetUserNetworkInfo/GetUserNetworkInfoQuery.cs b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetUserNetworkInfo/GetUserNetworkInfoQuery.cs new file mode 100644 index 0000000..260e308 --- /dev/null +++ b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetUserNetworkInfo/GetUserNetworkInfoQuery.cs @@ -0,0 +1,9 @@ +namespace BackOffice.BFF.Application.NetworkMembershipCQ.Queries.GetUserNetworkInfo; + +public record GetUserNetworkInfoQuery : IRequest +{ + /// + /// شناسه کاربر + /// + public long UserId { get; init; } +} diff --git a/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetUserNetworkInfo/GetUserNetworkInfoQueryHandler.cs b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetUserNetworkInfo/GetUserNetworkInfoQueryHandler.cs new file mode 100644 index 0000000..0bee3e4 --- /dev/null +++ b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetUserNetworkInfo/GetUserNetworkInfoQueryHandler.cs @@ -0,0 +1,22 @@ +using CMSMicroservice.Protobuf.Protos.NetworkMembership; + +namespace BackOffice.BFF.Application.NetworkMembershipCQ.Queries.GetUserNetworkInfo; + +public class GetUserNetworkInfoQueryHandler : IRequestHandler +{ + private readonly IApplicationContractContext _context; + + public GetUserNetworkInfoQueryHandler(IApplicationContractContext context) + { + _context = context; + } + + public async Task Handle(GetUserNetworkInfoQuery request, CancellationToken cancellationToken) + { + var response = await _context.NetworkMemberships.GetUserNetworkAsync( + request.Adapt(), + cancellationToken: cancellationToken); + + return response.Adapt(); + } +} diff --git a/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetUserNetworkInfo/GetUserNetworkInfoResponseDto.cs b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetUserNetworkInfo/GetUserNetworkInfoResponseDto.cs new file mode 100644 index 0000000..2fded29 --- /dev/null +++ b/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetUserNetworkInfo/GetUserNetworkInfoResponseDto.cs @@ -0,0 +1,74 @@ +namespace BackOffice.BFF.Application.NetworkMembershipCQ.Queries.GetUserNetworkInfo; + +public class GetUserNetworkInfoResponseDto +{ + /// + /// شناسه عضویت شبکه + /// + public long Id { get; set; } + + /// + /// شناسه کاربر + /// + public long UserId { get; set; } + + /// + /// نام کاربر + /// + public string UserName { get; set; } = string.Empty; + + /// + /// شناسه والد در شبکه + /// + public long? ParentId { get; set; } + + /// + /// نام والد + /// + public string ParentName { get; set; } = string.Empty; + + /// + /// موقعیت در شبکه (0=Left, 1=Right) + /// + public int NetworkLeg { get; set; } + + /// + /// شناسه فرزند چپ + /// + public long? LeftChildId { get; set; } + + /// + /// نام فرزند چپ + /// + public string LeftChildName { get; set; } = string.Empty; + + /// + /// شناسه فرزند راست + /// + public long? RightChildId { get; set; } + + /// + /// نام فرزند راست + /// + public string RightChildName { get; set; } = string.Empty; + + /// + /// سطح در شبکه + /// + public int NetworkLevel { get; set; } + + /// + /// کد معرف + /// + public string ReferralCode { get; set; } = string.Empty; + + /// + /// تاریخ عضویت در شبکه + /// + public DateTime JoinedAt { get; set; } + + /// + /// تاریخ ایجاد + /// + public DateTime CreatedAt { get; set; } +} diff --git a/src/BackOffice.BFF.Domain/BackOffice.BFF.Domain.csproj b/src/BackOffice.BFF.Domain/BackOffice.BFF.Domain.csproj index 76be69e..f674477 100644 --- a/src/BackOffice.BFF.Domain/BackOffice.BFF.Domain.csproj +++ b/src/BackOffice.BFF.Domain/BackOffice.BFF.Domain.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/BackOffice.BFF.Infrastructure/Services/ApplicationContractContext.cs b/src/BackOffice.BFF.Infrastructure/Services/ApplicationContractContext.cs index 1e5c3f5..be1c965 100644 --- a/src/BackOffice.BFF.Infrastructure/Services/ApplicationContractContext.cs +++ b/src/BackOffice.BFF.Infrastructure/Services/ApplicationContractContext.cs @@ -10,6 +10,9 @@ using CMSMicroservice.Protobuf.Protos.ProductImages; using CMSMicroservice.Protobuf.Protos.ProductGallerys; using CMSMicroservice.Protobuf.Protos.Category; using CMSMicroservice.Protobuf.Protos.PruductCategory; +using CMSMicroservice.Protobuf.Protos.Commission; +using CMSMicroservice.Protobuf.Protos.NetworkMembership; +using CMSMicroservice.Protobuf.Protos.ClubMembership; using FMSMicroservice.Protobuf.Protos.FileInfo; using Microsoft.Extensions.DependencyInjection; @@ -54,5 +57,10 @@ public class ApplicationContractContext : IApplicationContractContext public UserContract.UserContractClient Users => GetService(); public UserOrderContract.UserOrderContractClient UserOrders => GetService(); public UserRoleContract.UserRoleContractClient UserRoles => GetService(); + + // Network & Commission System + public CommissionContract.CommissionContractClient Commissions => GetService(); + public NetworkMembershipContract.NetworkMembershipContractClient NetworkMemberships => GetService(); + public ClubMembershipContract.ClubMembershipContractClient ClubMemberships => GetService(); #endregion } diff --git a/src/BackOffice.BFF.sln b/src/BackOffice.BFF.sln index 61b587c..a6b4337 100644 --- a/src/BackOffice.BFF.sln +++ b/src/BackOffice.BFF.sln @@ -1,3 +1,4 @@ + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 @@ -30,64 +31,242 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BackOffice.BFF.Products.Pro EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BackOffice.BFF.Category.Protobuf", "Protobufs\BackOffice.BFF.Category.Protobuf\BackOffice.BFF.Category.Protobuf.csproj", "{640BD51E-8298-4074-9713-BCE619318155}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BackOffice.BFF.Configuration.Protobuf", "Protobufs\BackOffice.BFF.Configuration.Protobuf\BackOffice.BFF.Configuration.Protobuf.csproj", "{5D7FCD40-BFB0-4D39-B662-05840154C6AF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BackOffice.BFF.ClubMembership.Protobuf", "Protobufs\BackOffice.BFF.ClubMembership.Protobuf\BackOffice.BFF.ClubMembership.Protobuf.csproj", "{3EC432DA-F351-43C5-A781-595062B999A5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BackOffice.BFF.NetworkMembership.Protobuf", "Protobufs\BackOffice.BFF.NetworkMembership.Protobuf\BackOffice.BFF.NetworkMembership.Protobuf.csproj", "{CA0F6C82-227A-41E4-A59F-B45EF68411A1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BackOffice.BFF.Commission.Protobuf", "Protobufs\BackOffice.BFF.Commission.Protobuf\BackOffice.BFF.Commission.Protobuf.csproj", "{3B7514DE-1C2F-4BB1-BBD5-C57BEEC6843E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BackOffice.BFF.Common.Protobuf", "Protobufs\BackOffice.BFF.Common.Protobuf\BackOffice.BFF.Common.Protobuf.csproj", "{9911D6BE-3022-44F6-B93B-B3D62A14FBCA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {9AC57CFF-BEE5-46D2-BFF7-6787E2BB8441}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9AC57CFF-BEE5-46D2-BFF7-6787E2BB8441}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9AC57CFF-BEE5-46D2-BFF7-6787E2BB8441}.Debug|x64.ActiveCfg = Debug|Any CPU + {9AC57CFF-BEE5-46D2-BFF7-6787E2BB8441}.Debug|x64.Build.0 = Debug|Any CPU + {9AC57CFF-BEE5-46D2-BFF7-6787E2BB8441}.Debug|x86.ActiveCfg = Debug|Any CPU + {9AC57CFF-BEE5-46D2-BFF7-6787E2BB8441}.Debug|x86.Build.0 = Debug|Any CPU {9AC57CFF-BEE5-46D2-BFF7-6787E2BB8441}.Release|Any CPU.ActiveCfg = Release|Any CPU {9AC57CFF-BEE5-46D2-BFF7-6787E2BB8441}.Release|Any CPU.Build.0 = Release|Any CPU + {9AC57CFF-BEE5-46D2-BFF7-6787E2BB8441}.Release|x64.ActiveCfg = Release|Any CPU + {9AC57CFF-BEE5-46D2-BFF7-6787E2BB8441}.Release|x64.Build.0 = Release|Any CPU + {9AC57CFF-BEE5-46D2-BFF7-6787E2BB8441}.Release|x86.ActiveCfg = Release|Any CPU + {9AC57CFF-BEE5-46D2-BFF7-6787E2BB8441}.Release|x86.Build.0 = Release|Any CPU {C857BF04-2856-46D0-90EF-1C8A6E9420CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C857BF04-2856-46D0-90EF-1C8A6E9420CA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C857BF04-2856-46D0-90EF-1C8A6E9420CA}.Debug|x64.ActiveCfg = Debug|Any CPU + {C857BF04-2856-46D0-90EF-1C8A6E9420CA}.Debug|x64.Build.0 = Debug|Any CPU + {C857BF04-2856-46D0-90EF-1C8A6E9420CA}.Debug|x86.ActiveCfg = Debug|Any CPU + {C857BF04-2856-46D0-90EF-1C8A6E9420CA}.Debug|x86.Build.0 = Debug|Any CPU {C857BF04-2856-46D0-90EF-1C8A6E9420CA}.Release|Any CPU.ActiveCfg = Release|Any CPU {C857BF04-2856-46D0-90EF-1C8A6E9420CA}.Release|Any CPU.Build.0 = Release|Any CPU + {C857BF04-2856-46D0-90EF-1C8A6E9420CA}.Release|x64.ActiveCfg = Release|Any CPU + {C857BF04-2856-46D0-90EF-1C8A6E9420CA}.Release|x64.Build.0 = Release|Any CPU + {C857BF04-2856-46D0-90EF-1C8A6E9420CA}.Release|x86.ActiveCfg = Release|Any CPU + {C857BF04-2856-46D0-90EF-1C8A6E9420CA}.Release|x86.Build.0 = Release|Any CPU {B3BCF789-C32E-49EC-8A35-FFF8C9A05D1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B3BCF789-C32E-49EC-8A35-FFF8C9A05D1C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B3BCF789-C32E-49EC-8A35-FFF8C9A05D1C}.Debug|x64.ActiveCfg = Debug|Any CPU + {B3BCF789-C32E-49EC-8A35-FFF8C9A05D1C}.Debug|x64.Build.0 = Debug|Any CPU + {B3BCF789-C32E-49EC-8A35-FFF8C9A05D1C}.Debug|x86.ActiveCfg = Debug|Any CPU + {B3BCF789-C32E-49EC-8A35-FFF8C9A05D1C}.Debug|x86.Build.0 = Debug|Any CPU {B3BCF789-C32E-49EC-8A35-FFF8C9A05D1C}.Release|Any CPU.ActiveCfg = Release|Any CPU {B3BCF789-C32E-49EC-8A35-FFF8C9A05D1C}.Release|Any CPU.Build.0 = Release|Any CPU + {B3BCF789-C32E-49EC-8A35-FFF8C9A05D1C}.Release|x64.ActiveCfg = Release|Any CPU + {B3BCF789-C32E-49EC-8A35-FFF8C9A05D1C}.Release|x64.Build.0 = Release|Any CPU + {B3BCF789-C32E-49EC-8A35-FFF8C9A05D1C}.Release|x86.ActiveCfg = Release|Any CPU + {B3BCF789-C32E-49EC-8A35-FFF8C9A05D1C}.Release|x86.Build.0 = Release|Any CPU {39ED8B99-36D2-43D4-8491-F8302446385E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {39ED8B99-36D2-43D4-8491-F8302446385E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39ED8B99-36D2-43D4-8491-F8302446385E}.Debug|x64.ActiveCfg = Debug|Any CPU + {39ED8B99-36D2-43D4-8491-F8302446385E}.Debug|x64.Build.0 = Debug|Any CPU + {39ED8B99-36D2-43D4-8491-F8302446385E}.Debug|x86.ActiveCfg = Debug|Any CPU + {39ED8B99-36D2-43D4-8491-F8302446385E}.Debug|x86.Build.0 = Debug|Any CPU {39ED8B99-36D2-43D4-8491-F8302446385E}.Release|Any CPU.ActiveCfg = Release|Any CPU {39ED8B99-36D2-43D4-8491-F8302446385E}.Release|Any CPU.Build.0 = Release|Any CPU + {39ED8B99-36D2-43D4-8491-F8302446385E}.Release|x64.ActiveCfg = Release|Any CPU + {39ED8B99-36D2-43D4-8491-F8302446385E}.Release|x64.Build.0 = Release|Any CPU + {39ED8B99-36D2-43D4-8491-F8302446385E}.Release|x86.ActiveCfg = Release|Any CPU + {39ED8B99-36D2-43D4-8491-F8302446385E}.Release|x86.Build.0 = Release|Any CPU {794F666D-6D5D-73EC-C654-104EAFA4E58A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {794F666D-6D5D-73EC-C654-104EAFA4E58A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {794F666D-6D5D-73EC-C654-104EAFA4E58A}.Debug|x64.ActiveCfg = Debug|Any CPU + {794F666D-6D5D-73EC-C654-104EAFA4E58A}.Debug|x64.Build.0 = Debug|Any CPU + {794F666D-6D5D-73EC-C654-104EAFA4E58A}.Debug|x86.ActiveCfg = Debug|Any CPU + {794F666D-6D5D-73EC-C654-104EAFA4E58A}.Debug|x86.Build.0 = Debug|Any CPU {794F666D-6D5D-73EC-C654-104EAFA4E58A}.Release|Any CPU.ActiveCfg = Release|Any CPU {794F666D-6D5D-73EC-C654-104EAFA4E58A}.Release|Any CPU.Build.0 = Release|Any CPU + {794F666D-6D5D-73EC-C654-104EAFA4E58A}.Release|x64.ActiveCfg = Release|Any CPU + {794F666D-6D5D-73EC-C654-104EAFA4E58A}.Release|x64.Build.0 = Release|Any CPU + {794F666D-6D5D-73EC-C654-104EAFA4E58A}.Release|x86.ActiveCfg = Release|Any CPU + {794F666D-6D5D-73EC-C654-104EAFA4E58A}.Release|x86.Build.0 = Release|Any CPU {BD79FF62-CD7B-7873-7200-FA8EBAEFA9E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BD79FF62-CD7B-7873-7200-FA8EBAEFA9E1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD79FF62-CD7B-7873-7200-FA8EBAEFA9E1}.Debug|x64.ActiveCfg = Debug|Any CPU + {BD79FF62-CD7B-7873-7200-FA8EBAEFA9E1}.Debug|x64.Build.0 = Debug|Any CPU + {BD79FF62-CD7B-7873-7200-FA8EBAEFA9E1}.Debug|x86.ActiveCfg = Debug|Any CPU + {BD79FF62-CD7B-7873-7200-FA8EBAEFA9E1}.Debug|x86.Build.0 = Debug|Any CPU {BD79FF62-CD7B-7873-7200-FA8EBAEFA9E1}.Release|Any CPU.ActiveCfg = Release|Any CPU {BD79FF62-CD7B-7873-7200-FA8EBAEFA9E1}.Release|Any CPU.Build.0 = Release|Any CPU + {BD79FF62-CD7B-7873-7200-FA8EBAEFA9E1}.Release|x64.ActiveCfg = Release|Any CPU + {BD79FF62-CD7B-7873-7200-FA8EBAEFA9E1}.Release|x64.Build.0 = Release|Any CPU + {BD79FF62-CD7B-7873-7200-FA8EBAEFA9E1}.Release|x86.ActiveCfg = Release|Any CPU + {BD79FF62-CD7B-7873-7200-FA8EBAEFA9E1}.Release|x86.Build.0 = Release|Any CPU {5FC682A7-F5D3-63A2-0A48-0D42DABF954B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5FC682A7-F5D3-63A2-0A48-0D42DABF954B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5FC682A7-F5D3-63A2-0A48-0D42DABF954B}.Debug|x64.ActiveCfg = Debug|Any CPU + {5FC682A7-F5D3-63A2-0A48-0D42DABF954B}.Debug|x64.Build.0 = Debug|Any CPU + {5FC682A7-F5D3-63A2-0A48-0D42DABF954B}.Debug|x86.ActiveCfg = Debug|Any CPU + {5FC682A7-F5D3-63A2-0A48-0D42DABF954B}.Debug|x86.Build.0 = Debug|Any CPU {5FC682A7-F5D3-63A2-0A48-0D42DABF954B}.Release|Any CPU.ActiveCfg = Release|Any CPU {5FC682A7-F5D3-63A2-0A48-0D42DABF954B}.Release|Any CPU.Build.0 = Release|Any CPU + {5FC682A7-F5D3-63A2-0A48-0D42DABF954B}.Release|x64.ActiveCfg = Release|Any CPU + {5FC682A7-F5D3-63A2-0A48-0D42DABF954B}.Release|x64.Build.0 = Release|Any CPU + {5FC682A7-F5D3-63A2-0A48-0D42DABF954B}.Release|x86.ActiveCfg = Release|Any CPU + {5FC682A7-F5D3-63A2-0A48-0D42DABF954B}.Release|x86.Build.0 = Release|Any CPU {B688459B-67B0-3170-79C6-AB05DB7E911D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B688459B-67B0-3170-79C6-AB05DB7E911D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B688459B-67B0-3170-79C6-AB05DB7E911D}.Debug|x64.ActiveCfg = Debug|Any CPU + {B688459B-67B0-3170-79C6-AB05DB7E911D}.Debug|x64.Build.0 = Debug|Any CPU + {B688459B-67B0-3170-79C6-AB05DB7E911D}.Debug|x86.ActiveCfg = Debug|Any CPU + {B688459B-67B0-3170-79C6-AB05DB7E911D}.Debug|x86.Build.0 = Debug|Any CPU {B688459B-67B0-3170-79C6-AB05DB7E911D}.Release|Any CPU.ActiveCfg = Release|Any CPU {B688459B-67B0-3170-79C6-AB05DB7E911D}.Release|Any CPU.Build.0 = Release|Any CPU + {B688459B-67B0-3170-79C6-AB05DB7E911D}.Release|x64.ActiveCfg = Release|Any CPU + {B688459B-67B0-3170-79C6-AB05DB7E911D}.Release|x64.Build.0 = Release|Any CPU + {B688459B-67B0-3170-79C6-AB05DB7E911D}.Release|x86.ActiveCfg = Release|Any CPU + {B688459B-67B0-3170-79C6-AB05DB7E911D}.Release|x86.Build.0 = Release|Any CPU {75481681-ABB4-2A4C-8901-FE7242DE5B20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {75481681-ABB4-2A4C-8901-FE7242DE5B20}.Debug|Any CPU.Build.0 = Debug|Any CPU + {75481681-ABB4-2A4C-8901-FE7242DE5B20}.Debug|x64.ActiveCfg = Debug|Any CPU + {75481681-ABB4-2A4C-8901-FE7242DE5B20}.Debug|x64.Build.0 = Debug|Any CPU + {75481681-ABB4-2A4C-8901-FE7242DE5B20}.Debug|x86.ActiveCfg = Debug|Any CPU + {75481681-ABB4-2A4C-8901-FE7242DE5B20}.Debug|x86.Build.0 = Debug|Any CPU {75481681-ABB4-2A4C-8901-FE7242DE5B20}.Release|Any CPU.ActiveCfg = Release|Any CPU {75481681-ABB4-2A4C-8901-FE7242DE5B20}.Release|Any CPU.Build.0 = Release|Any CPU + {75481681-ABB4-2A4C-8901-FE7242DE5B20}.Release|x64.ActiveCfg = Release|Any CPU + {75481681-ABB4-2A4C-8901-FE7242DE5B20}.Release|x64.Build.0 = Release|Any CPU + {75481681-ABB4-2A4C-8901-FE7242DE5B20}.Release|x86.ActiveCfg = Release|Any CPU + {75481681-ABB4-2A4C-8901-FE7242DE5B20}.Release|x86.Build.0 = Release|Any CPU {CB811954-E42E-75BB-A02D-689180B72E28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CB811954-E42E-75BB-A02D-689180B72E28}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CB811954-E42E-75BB-A02D-689180B72E28}.Debug|x64.ActiveCfg = Debug|Any CPU + {CB811954-E42E-75BB-A02D-689180B72E28}.Debug|x64.Build.0 = Debug|Any CPU + {CB811954-E42E-75BB-A02D-689180B72E28}.Debug|x86.ActiveCfg = Debug|Any CPU + {CB811954-E42E-75BB-A02D-689180B72E28}.Debug|x86.Build.0 = Debug|Any CPU {CB811954-E42E-75BB-A02D-689180B72E28}.Release|Any CPU.ActiveCfg = Release|Any CPU {CB811954-E42E-75BB-A02D-689180B72E28}.Release|Any CPU.Build.0 = Release|Any CPU + {CB811954-E42E-75BB-A02D-689180B72E28}.Release|x64.ActiveCfg = Release|Any CPU + {CB811954-E42E-75BB-A02D-689180B72E28}.Release|x64.Build.0 = Release|Any CPU + {CB811954-E42E-75BB-A02D-689180B72E28}.Release|x86.ActiveCfg = Release|Any CPU + {CB811954-E42E-75BB-A02D-689180B72E28}.Release|x86.Build.0 = Release|Any CPU {E1833EDA-39E9-C241-2772-E4C7E960AC41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E1833EDA-39E9-C241-2772-E4C7E960AC41}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E1833EDA-39E9-C241-2772-E4C7E960AC41}.Debug|x64.ActiveCfg = Debug|Any CPU + {E1833EDA-39E9-C241-2772-E4C7E960AC41}.Debug|x64.Build.0 = Debug|Any CPU + {E1833EDA-39E9-C241-2772-E4C7E960AC41}.Debug|x86.ActiveCfg = Debug|Any CPU + {E1833EDA-39E9-C241-2772-E4C7E960AC41}.Debug|x86.Build.0 = Debug|Any CPU {E1833EDA-39E9-C241-2772-E4C7E960AC41}.Release|Any CPU.ActiveCfg = Release|Any CPU {E1833EDA-39E9-C241-2772-E4C7E960AC41}.Release|Any CPU.Build.0 = Release|Any CPU + {E1833EDA-39E9-C241-2772-E4C7E960AC41}.Release|x64.ActiveCfg = Release|Any CPU + {E1833EDA-39E9-C241-2772-E4C7E960AC41}.Release|x64.Build.0 = Release|Any CPU + {E1833EDA-39E9-C241-2772-E4C7E960AC41}.Release|x86.ActiveCfg = Release|Any CPU + {E1833EDA-39E9-C241-2772-E4C7E960AC41}.Release|x86.Build.0 = Release|Any CPU {DFDECBE8-D071-4CDB-A1B4-D5C556EF72A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DFDECBE8-D071-4CDB-A1B4-D5C556EF72A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DFDECBE8-D071-4CDB-A1B4-D5C556EF72A6}.Debug|x64.ActiveCfg = Debug|Any CPU + {DFDECBE8-D071-4CDB-A1B4-D5C556EF72A6}.Debug|x64.Build.0 = Debug|Any CPU + {DFDECBE8-D071-4CDB-A1B4-D5C556EF72A6}.Debug|x86.ActiveCfg = Debug|Any CPU + {DFDECBE8-D071-4CDB-A1B4-D5C556EF72A6}.Debug|x86.Build.0 = Debug|Any CPU {DFDECBE8-D071-4CDB-A1B4-D5C556EF72A6}.Release|Any CPU.ActiveCfg = Release|Any CPU {DFDECBE8-D071-4CDB-A1B4-D5C556EF72A6}.Release|Any CPU.Build.0 = Release|Any CPU + {DFDECBE8-D071-4CDB-A1B4-D5C556EF72A6}.Release|x64.ActiveCfg = Release|Any CPU + {DFDECBE8-D071-4CDB-A1B4-D5C556EF72A6}.Release|x64.Build.0 = Release|Any CPU + {DFDECBE8-D071-4CDB-A1B4-D5C556EF72A6}.Release|x86.ActiveCfg = Release|Any CPU + {DFDECBE8-D071-4CDB-A1B4-D5C556EF72A6}.Release|x86.Build.0 = Release|Any CPU {640BD51E-8298-4074-9713-BCE619318155}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {640BD51E-8298-4074-9713-BCE619318155}.Debug|Any CPU.Build.0 = Debug|Any CPU + {640BD51E-8298-4074-9713-BCE619318155}.Debug|x64.ActiveCfg = Debug|Any CPU + {640BD51E-8298-4074-9713-BCE619318155}.Debug|x64.Build.0 = Debug|Any CPU + {640BD51E-8298-4074-9713-BCE619318155}.Debug|x86.ActiveCfg = Debug|Any CPU + {640BD51E-8298-4074-9713-BCE619318155}.Debug|x86.Build.0 = Debug|Any CPU {640BD51E-8298-4074-9713-BCE619318155}.Release|Any CPU.ActiveCfg = Release|Any CPU {640BD51E-8298-4074-9713-BCE619318155}.Release|Any CPU.Build.0 = Release|Any CPU + {640BD51E-8298-4074-9713-BCE619318155}.Release|x64.ActiveCfg = Release|Any CPU + {640BD51E-8298-4074-9713-BCE619318155}.Release|x64.Build.0 = Release|Any CPU + {640BD51E-8298-4074-9713-BCE619318155}.Release|x86.ActiveCfg = Release|Any CPU + {640BD51E-8298-4074-9713-BCE619318155}.Release|x86.Build.0 = Release|Any CPU + {5D7FCD40-BFB0-4D39-B662-05840154C6AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D7FCD40-BFB0-4D39-B662-05840154C6AF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5D7FCD40-BFB0-4D39-B662-05840154C6AF}.Debug|x64.ActiveCfg = Debug|Any CPU + {5D7FCD40-BFB0-4D39-B662-05840154C6AF}.Debug|x64.Build.0 = Debug|Any CPU + {5D7FCD40-BFB0-4D39-B662-05840154C6AF}.Debug|x86.ActiveCfg = Debug|Any CPU + {5D7FCD40-BFB0-4D39-B662-05840154C6AF}.Debug|x86.Build.0 = Debug|Any CPU + {5D7FCD40-BFB0-4D39-B662-05840154C6AF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5D7FCD40-BFB0-4D39-B662-05840154C6AF}.Release|Any CPU.Build.0 = Release|Any CPU + {5D7FCD40-BFB0-4D39-B662-05840154C6AF}.Release|x64.ActiveCfg = Release|Any CPU + {5D7FCD40-BFB0-4D39-B662-05840154C6AF}.Release|x64.Build.0 = Release|Any CPU + {5D7FCD40-BFB0-4D39-B662-05840154C6AF}.Release|x86.ActiveCfg = Release|Any CPU + {5D7FCD40-BFB0-4D39-B662-05840154C6AF}.Release|x86.Build.0 = Release|Any CPU + {3EC432DA-F351-43C5-A781-595062B999A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3EC432DA-F351-43C5-A781-595062B999A5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3EC432DA-F351-43C5-A781-595062B999A5}.Debug|x64.ActiveCfg = Debug|Any CPU + {3EC432DA-F351-43C5-A781-595062B999A5}.Debug|x64.Build.0 = Debug|Any CPU + {3EC432DA-F351-43C5-A781-595062B999A5}.Debug|x86.ActiveCfg = Debug|Any CPU + {3EC432DA-F351-43C5-A781-595062B999A5}.Debug|x86.Build.0 = Debug|Any CPU + {3EC432DA-F351-43C5-A781-595062B999A5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3EC432DA-F351-43C5-A781-595062B999A5}.Release|Any CPU.Build.0 = Release|Any CPU + {3EC432DA-F351-43C5-A781-595062B999A5}.Release|x64.ActiveCfg = Release|Any CPU + {3EC432DA-F351-43C5-A781-595062B999A5}.Release|x64.Build.0 = Release|Any CPU + {3EC432DA-F351-43C5-A781-595062B999A5}.Release|x86.ActiveCfg = Release|Any CPU + {3EC432DA-F351-43C5-A781-595062B999A5}.Release|x86.Build.0 = Release|Any CPU + {CA0F6C82-227A-41E4-A59F-B45EF68411A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CA0F6C82-227A-41E4-A59F-B45EF68411A1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CA0F6C82-227A-41E4-A59F-B45EF68411A1}.Debug|x64.ActiveCfg = Debug|Any CPU + {CA0F6C82-227A-41E4-A59F-B45EF68411A1}.Debug|x64.Build.0 = Debug|Any CPU + {CA0F6C82-227A-41E4-A59F-B45EF68411A1}.Debug|x86.ActiveCfg = Debug|Any CPU + {CA0F6C82-227A-41E4-A59F-B45EF68411A1}.Debug|x86.Build.0 = Debug|Any CPU + {CA0F6C82-227A-41E4-A59F-B45EF68411A1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CA0F6C82-227A-41E4-A59F-B45EF68411A1}.Release|Any CPU.Build.0 = Release|Any CPU + {CA0F6C82-227A-41E4-A59F-B45EF68411A1}.Release|x64.ActiveCfg = Release|Any CPU + {CA0F6C82-227A-41E4-A59F-B45EF68411A1}.Release|x64.Build.0 = Release|Any CPU + {CA0F6C82-227A-41E4-A59F-B45EF68411A1}.Release|x86.ActiveCfg = Release|Any CPU + {CA0F6C82-227A-41E4-A59F-B45EF68411A1}.Release|x86.Build.0 = Release|Any CPU + {3B7514DE-1C2F-4BB1-BBD5-C57BEEC6843E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B7514DE-1C2F-4BB1-BBD5-C57BEEC6843E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B7514DE-1C2F-4BB1-BBD5-C57BEEC6843E}.Debug|x64.ActiveCfg = Debug|Any CPU + {3B7514DE-1C2F-4BB1-BBD5-C57BEEC6843E}.Debug|x64.Build.0 = Debug|Any CPU + {3B7514DE-1C2F-4BB1-BBD5-C57BEEC6843E}.Debug|x86.ActiveCfg = Debug|Any CPU + {3B7514DE-1C2F-4BB1-BBD5-C57BEEC6843E}.Debug|x86.Build.0 = Debug|Any CPU + {3B7514DE-1C2F-4BB1-BBD5-C57BEEC6843E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B7514DE-1C2F-4BB1-BBD5-C57BEEC6843E}.Release|Any CPU.Build.0 = Release|Any CPU + {3B7514DE-1C2F-4BB1-BBD5-C57BEEC6843E}.Release|x64.ActiveCfg = Release|Any CPU + {3B7514DE-1C2F-4BB1-BBD5-C57BEEC6843E}.Release|x64.Build.0 = Release|Any CPU + {3B7514DE-1C2F-4BB1-BBD5-C57BEEC6843E}.Release|x86.ActiveCfg = Release|Any CPU + {3B7514DE-1C2F-4BB1-BBD5-C57BEEC6843E}.Release|x86.Build.0 = Release|Any CPU + {9911D6BE-3022-44F6-B93B-B3D62A14FBCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9911D6BE-3022-44F6-B93B-B3D62A14FBCA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9911D6BE-3022-44F6-B93B-B3D62A14FBCA}.Debug|x64.ActiveCfg = Debug|Any CPU + {9911D6BE-3022-44F6-B93B-B3D62A14FBCA}.Debug|x64.Build.0 = Debug|Any CPU + {9911D6BE-3022-44F6-B93B-B3D62A14FBCA}.Debug|x86.ActiveCfg = Debug|Any CPU + {9911D6BE-3022-44F6-B93B-B3D62A14FBCA}.Debug|x86.Build.0 = Debug|Any CPU + {9911D6BE-3022-44F6-B93B-B3D62A14FBCA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9911D6BE-3022-44F6-B93B-B3D62A14FBCA}.Release|Any CPU.Build.0 = Release|Any CPU + {9911D6BE-3022-44F6-B93B-B3D62A14FBCA}.Release|x64.ActiveCfg = Release|Any CPU + {9911D6BE-3022-44F6-B93B-B3D62A14FBCA}.Release|x64.Build.0 = Release|Any CPU + {9911D6BE-3022-44F6-B93B-B3D62A14FBCA}.Release|x86.ActiveCfg = Release|Any CPU + {9911D6BE-3022-44F6-B93B-B3D62A14FBCA}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -102,6 +281,11 @@ Global {E1833EDA-39E9-C241-2772-E4C7E960AC41} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} {DFDECBE8-D071-4CDB-A1B4-D5C556EF72A6} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} {640BD51E-8298-4074-9713-BCE619318155} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {5D7FCD40-BFB0-4D39-B662-05840154C6AF} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {3EC432DA-F351-43C5-A781-595062B999A5} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {CA0F6C82-227A-41E4-A59F-B45EF68411A1} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {3B7514DE-1C2F-4BB1-BBD5-C57BEEC6843E} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {9911D6BE-3022-44F6-B93B-B3D62A14FBCA} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0AE1AB4A-3C91-4853-93C2-C2476E79F845} diff --git a/src/Protobufs/BackOffice.BFF.ClubMembership.Protobuf/BackOffice.BFF.ClubMembership.Protobuf.csproj b/src/Protobufs/BackOffice.BFF.ClubMembership.Protobuf/BackOffice.BFF.ClubMembership.Protobuf.csproj new file mode 100644 index 0000000..e56cfc3 --- /dev/null +++ b/src/Protobufs/BackOffice.BFF.ClubMembership.Protobuf/BackOffice.BFF.ClubMembership.Protobuf.csproj @@ -0,0 +1,33 @@ + + + + net9.0 + enable + enable + true + Foursat.BackOffice.BFF.ClubMembership.Protobuf + 0.0.1 + FourSat + FourSat + Foursat.BackOffice.BFF.ClubMembership.Protobuf + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + diff --git a/src/Protobufs/BackOffice.BFF.ClubMembership.Protobuf/Protos/clubmembership.proto b/src/Protobufs/BackOffice.BFF.ClubMembership.Protobuf/Protos/clubmembership.proto new file mode 100644 index 0000000..9fe4f7d --- /dev/null +++ b/src/Protobufs/BackOffice.BFF.ClubMembership.Protobuf/Protos/clubmembership.proto @@ -0,0 +1,138 @@ +syntax = "proto3"; + +package clubmembership; + +import "public_messages.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/wrappers.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "BackOffice.BFF.ClubMembership.Protobuf"; + +service ClubMembershipContract +{ + rpc ActivateClubMembership(ActivateClubMembershipRequest) returns (google.protobuf.Empty); + rpc DeactivateClubMembership(DeactivateClubMembershipRequest) returns (google.protobuf.Empty); + rpc AssignFeatureToMembership(AssignFeatureToMembershipRequest) returns (google.protobuf.Empty); + rpc GetClubMembership(GetClubMembershipRequest) returns (GetClubMembershipResponse); + rpc GetAllClubMemberships(GetAllClubMembershipsRequest) returns (GetAllClubMembershipsResponse); + rpc GetClubMembershipHistory(GetClubMembershipHistoryRequest) returns (GetClubMembershipHistoryResponse); +} + +// Activate Command +message ActivateClubMembershipRequest +{ + int64 user_id = 1; + int64 package_id = 2; + google.protobuf.StringValue activation_code = 3; + int32 duration_months = 4; +} + +// Deactivate Command +message DeactivateClubMembershipRequest +{ + int64 user_id = 1; + string reason = 2; +} + +// AssignFeature Command +message AssignFeatureToMembershipRequest +{ + int64 user_id = 1; + int64 product_id = 2; + google.protobuf.Int32Value quantity = 3; + google.protobuf.Int32Value duration_days = 4; +} + +// Get Query +message GetClubMembershipRequest +{ + int64 user_id = 1; +} + +message GetClubMembershipResponse +{ + int64 id = 1; + int64 user_id = 2; + int64 package_id = 3; + string package_name = 4; + string activation_code = 5; + google.protobuf.Timestamp activated_at = 6; + google.protobuf.Timestamp expires_at = 7; + bool is_active = 8; + google.protobuf.Timestamp created = 9; + repeated MembershipFeatureModel features = 10; +} + +message MembershipFeatureModel +{ + int64 product_id = 1; + string product_name = 2; + int32 quantity = 3; + google.protobuf.Timestamp expires_at = 4; + bool is_active = 5; +} + +// GetAll Query +message GetAllClubMembershipsRequest +{ + google.protobuf.Int64Value user_id = 1; + google.protobuf.Int64Value package_id = 2; + google.protobuf.BoolValue is_active = 3; + google.protobuf.BoolValue is_expired = 4; + int32 page_index = 5; + int32 page_size = 6; +} + +message GetAllClubMembershipsResponse +{ + messages.MetaData meta_data = 1; + repeated ClubMembershipModel models = 2; +} + +message ClubMembershipModel +{ + int64 id = 1; + int64 user_id = 2; + string user_name = 3; + int64 package_id = 4; + string package_name = 5; + string activation_code = 6; + google.protobuf.Timestamp activated_at = 7; + google.protobuf.Timestamp expires_at = 8; + bool is_active = 9; + bool is_expired = 10; + google.protobuf.Timestamp created = 11; +} + +// GetHistory Query +message GetClubMembershipHistoryRequest +{ + google.protobuf.Int64Value user_id = 1; + google.protobuf.Int64Value package_id = 2; + int32 page_index = 3; + int32 page_size = 4; +} + +message GetClubMembershipHistoryResponse +{ + messages.MetaData meta_data = 1; + repeated ClubMembershipHistoryModel models = 2; +} + +message ClubMembershipHistoryModel +{ + int64 id = 1; + int64 club_membership_id = 2; + int64 user_id = 3; + google.protobuf.Int64Value old_package_id = 4; + google.protobuf.Int64Value new_package_id = 5; + google.protobuf.Timestamp old_activated_at = 6; + google.protobuf.Timestamp new_activated_at = 7; + google.protobuf.Timestamp old_expires_at = 8; + google.protobuf.Timestamp new_expires_at = 9; + int32 action = 10; // ClubMembershipAction enum + string performed_by = 11; + string reason = 12; + google.protobuf.Timestamp created = 13; +} diff --git a/src/Protobufs/BackOffice.BFF.ClubMembership.Protobuf/Protos/public_messages.proto b/src/Protobufs/BackOffice.BFF.ClubMembership.Protobuf/Protos/public_messages.proto new file mode 100644 index 0000000..fe252ee --- /dev/null +++ b/src/Protobufs/BackOffice.BFF.ClubMembership.Protobuf/Protos/public_messages.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package messages; + +option csharp_namespace = "BackOffice.BFF.Protobuf.Common"; +service PublicMessageContract{} +message PaginationState +{ + int32 page_number = 1; + + int32 page_size = 2; +} +message MetaData +{ + int64 current_page = 1; + + int64 total_page = 2; + + int64 page_size = 3; + + int64 total_count = 4; + + bool has_previous = 5; + + bool has_next = 6; +} +message DecimalValue +{ + + int64 units = 1; + + sfixed32 nanos = 2; +} +enum PaymentStatus +{ + Success = 0; + Reject = 1; + Pending = 2; +} +// وضعیت ارسال سفارش +enum DeliveryStatus +{ + // نامشخص / نیاز به ارسال ندارد (مثلا سفارش پکیج) + DeliveryStatus_None = 0; + // ثبت شده و در انتظار آماده‌سازی/ارسال + DeliveryStatus_Pending = 1; + // تحویل پست/حمل‌ونقل شده است + DeliveryStatus_InTransit = 2; + // توسط مشتری دریافت شده است + DeliveryStatus_Delivered = 3; + // مرجوع شده + DeliveryStatus_Returned = 4; +} +enum TransactionType +{ + Buy = 0; + DepositIpg = 1; + DepositExternal1 = 2; + Withdraw = 3; +} +enum ContractType +{ + Main = 0; + CMS = 1; +} +enum PaymentMethod +{ + IPG = 0; + Wallet = 1; +} diff --git a/src/Protobufs/BackOffice.BFF.Commission.Protobuf/BackOffice.BFF.Commission.Protobuf.csproj b/src/Protobufs/BackOffice.BFF.Commission.Protobuf/BackOffice.BFF.Commission.Protobuf.csproj new file mode 100644 index 0000000..b2dab23 --- /dev/null +++ b/src/Protobufs/BackOffice.BFF.Commission.Protobuf/BackOffice.BFF.Commission.Protobuf.csproj @@ -0,0 +1,41 @@ + + + + net9.0 + enable + enable + true + Foursat.BackOffice.BFF.Commission.Protobuf + 0.0.2 + FourSat + FourSat + BackOffice.BFF.Commission.Protobuf + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Protobufs/BackOffice.BFF.Commission.Protobuf/Protos/commission.proto b/src/Protobufs/BackOffice.BFF.Commission.Protobuf/Protos/commission.proto new file mode 100644 index 0000000..e5e9f8b --- /dev/null +++ b/src/Protobufs/BackOffice.BFF.Commission.Protobuf/Protos/commission.proto @@ -0,0 +1,273 @@ +syntax = "proto3"; + +package commission; + +import "public_messages.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/wrappers.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "BackOffice.BFF.Commission.Protobuf"; + +service CommissionContract +{ + // Commands + rpc CalculateWeeklyBalances(CalculateWeeklyBalancesRequest) returns (google.protobuf.Empty); + rpc CalculateWeeklyCommissionPool(CalculateWeeklyCommissionPoolRequest) returns (google.protobuf.Empty); + rpc ProcessUserPayouts(ProcessUserPayoutsRequest) returns (google.protobuf.Empty); + rpc RequestWithdrawal(RequestWithdrawalRequest) returns (google.protobuf.Empty); + rpc ProcessWithdrawal(ProcessWithdrawalRequest) returns (ProcessWithdrawalResponse); + rpc ApproveWithdrawal(ApproveWithdrawalRequest) returns (ApproveWithdrawalResponse); + rpc RejectWithdrawal(RejectWithdrawalRequest) returns (RejectWithdrawalResponse); + + // Queries + rpc GetWeeklyCommissionPool(GetWeeklyCommissionPoolRequest) returns (GetWeeklyCommissionPoolResponse); + rpc GetUserCommissionPayouts(GetUserCommissionPayoutsRequest) returns (GetUserCommissionPayoutsResponse); + rpc GetCommissionPayoutHistory(GetCommissionPayoutHistoryRequest) returns (GetCommissionPayoutHistoryResponse); + rpc GetUserWeeklyBalances(GetUserWeeklyBalancesRequest) returns (GetUserWeeklyBalancesResponse); + rpc GetAllWeeklyPools(GetAllWeeklyPoolsRequest) returns (GetAllWeeklyPoolsResponse); + rpc GetWithdrawalRequests(GetWithdrawalRequestsRequest) returns (GetWithdrawalRequestsResponse); +} + +// ============ Commands ============ + +// CalculateWeeklyBalances Command +message CalculateWeeklyBalancesRequest +{ + string week_number = 1; // Format: "YYYY-Www" (e.g., "2025-W01") + bool force_recalculate = 2; +} + +// CalculateWeeklyCommissionPool Command +message CalculateWeeklyCommissionPoolRequest +{ + string week_number = 1; +} + +// ProcessUserPayouts Command +message ProcessUserPayoutsRequest +{ + string week_number = 1; + bool force_reprocess = 2; +} + +// RequestWithdrawal Command +message RequestWithdrawalRequest +{ + int64 payout_id = 1; + int32 withdrawal_method = 2; // WithdrawalMethod enum: Cash=0, Diamond=1 + google.protobuf.StringValue iban_number = 3; // Required for Cash method +} + +// ProcessWithdrawal Command +message ProcessWithdrawalRequest +{ + int64 withdrawal_id = 1; + string transaction_id = 2; + string admin_note = 3; +} + +message ProcessWithdrawalResponse +{ + bool success = 1; + string message = 2; +} + +// ApproveWithdrawal Command +message ApproveWithdrawalRequest +{ + int64 withdrawal_id = 1; + string admin_note = 2; +} + +message ApproveWithdrawalResponse +{ + bool success = 1; + string message = 2; +} + +// RejectWithdrawal Command +message RejectWithdrawalRequest +{ + int64 withdrawal_id = 1; + string reject_reason = 2; +} + +message RejectWithdrawalResponse +{ + bool success = 1; + string message = 2; +} + +// ============ Queries ============ + +// GetWeeklyCommissionPool Query +message GetWeeklyCommissionPoolRequest +{ + string week_number = 1; +} + +message GetWeeklyCommissionPoolResponse +{ + int64 id = 1; + string week_number = 2; + int64 total_pool_amount = 3; // Rials + int32 total_balances = 4; + int64 value_per_balance = 5; // Rials per balance + bool is_calculated = 6; + google.protobuf.Timestamp calculated_at = 7; + google.protobuf.Timestamp created = 8; +} + +// GetUserCommissionPayouts Query +message GetUserCommissionPayoutsRequest +{ + google.protobuf.Int64Value user_id = 1; + google.protobuf.Int32Value status = 2; // CommissionPayoutStatus enum + google.protobuf.StringValue week_number = 3; + int32 page_index = 4; + int32 page_size = 5; +} + +message GetUserCommissionPayoutsResponse +{ + messages.MetaData meta_data = 1; + repeated UserCommissionPayoutModel models = 2; +} + +message UserCommissionPayoutModel +{ + int64 id = 1; + int64 user_id = 2; + string user_name = 3; + string week_number = 4; + int32 balances_earned = 5; + int64 value_per_balance = 6; + int64 total_amount = 7; + int32 status = 8; // CommissionPayoutStatus enum + google.protobuf.Int32Value withdrawal_method = 9; + string iban_number = 10; + google.protobuf.Timestamp created = 11; + google.protobuf.Timestamp last_modified = 12; +} + +// GetCommissionPayoutHistory Query +message GetCommissionPayoutHistoryRequest +{ + google.protobuf.Int64Value payout_id = 1; + google.protobuf.Int64Value user_id = 2; + google.protobuf.StringValue week_number = 3; + int32 page_index = 4; + int32 page_size = 5; +} + +message GetCommissionPayoutHistoryResponse +{ + messages.MetaData meta_data = 1; + repeated CommissionPayoutHistoryModel models = 2; +} + +message CommissionPayoutHistoryModel +{ + int64 id = 1; + int64 payout_id = 2; + int64 user_id = 3; + string week_number = 4; + int64 amount_before = 5; + int64 amount_after = 6; + int32 old_status = 7; // CommissionPayoutStatus enum + int32 new_status = 8; + int32 action = 9; // CommissionPayoutAction enum + string performed_by = 10; + string reason = 11; + google.protobuf.Timestamp created = 12; +} + +// GetUserWeeklyBalances Query +message GetUserWeeklyBalancesRequest +{ + google.protobuf.Int64Value user_id = 1; + google.protobuf.StringValue week_number = 2; + bool only_active = 3; // Only non-expired balances + int32 page_index = 4; + int32 page_size = 5; +} + +message GetUserWeeklyBalancesResponse +{ + messages.MetaData meta_data = 1; + repeated UserWeeklyBalanceModel models = 2; +} + +message UserWeeklyBalanceModel +{ + int64 id = 1; + int64 user_id = 2; + string week_number = 3; + int32 left_leg_balances = 4; + int32 right_leg_balances = 5; + int32 total_balances = 6; + int64 weekly_pool_contribution = 7; + google.protobuf.Timestamp calculated_at = 8; + bool is_expired = 9; + google.protobuf.Timestamp created = 10; +} + +// GetWithdrawalRequests Query +message GetWithdrawalRequestsRequest +{ + int32 page_index = 1; + int32 page_size = 2; + google.protobuf.Int32Value status = 3; // 0=Pending, 1=Approved, 2=Rejected, 3=Processed + google.protobuf.Int64Value user_id = 4; +} + +message GetWithdrawalRequestsResponse +{ + messages.MetaData meta_data = 1; + repeated WithdrawalRequestModel models = 2; +} + +message WithdrawalRequestModel +{ + int64 id = 1; + int64 user_id = 2; + string user_name = 3; + string phone_number = 4; + int64 amount = 5; + int32 status = 6; // 0=Pending, 1=Approved, 2=Rejected, 3=Processed + string method = 7; // Bank, Crypto, Cash + string bank_account = 8; + string bank_name = 9; + google.protobuf.Timestamp requested_at = 10; + google.protobuf.Timestamp processed_at = 11; + string admin_note = 12; +} + +// GetAllWeeklyPools Query +message GetAllWeeklyPoolsRequest +{ + google.protobuf.StringValue from_week = 1; + google.protobuf.StringValue to_week = 2; + google.protobuf.BoolValue only_calculated = 3; + int32 page_index = 4; + int32 page_size = 5; +} + +message GetAllWeeklyPoolsResponse +{ + messages.MetaData meta_data = 1; + repeated WeeklyCommissionPoolModel models = 2; +} + +message WeeklyCommissionPoolModel +{ + int64 id = 1; + string week_number = 2; + int64 total_pool_amount = 3; + int32 total_balances = 4; + int64 value_per_balance = 5; + bool is_calculated = 6; + google.protobuf.Timestamp calculated_at = 7; + google.protobuf.Timestamp created = 8; +} diff --git a/src/Protobufs/BackOffice.BFF.Commission.Protobuf/Protos/public_messages.proto b/src/Protobufs/BackOffice.BFF.Commission.Protobuf/Protos/public_messages.proto new file mode 100644 index 0000000..fe252ee --- /dev/null +++ b/src/Protobufs/BackOffice.BFF.Commission.Protobuf/Protos/public_messages.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package messages; + +option csharp_namespace = "BackOffice.BFF.Protobuf.Common"; +service PublicMessageContract{} +message PaginationState +{ + int32 page_number = 1; + + int32 page_size = 2; +} +message MetaData +{ + int64 current_page = 1; + + int64 total_page = 2; + + int64 page_size = 3; + + int64 total_count = 4; + + bool has_previous = 5; + + bool has_next = 6; +} +message DecimalValue +{ + + int64 units = 1; + + sfixed32 nanos = 2; +} +enum PaymentStatus +{ + Success = 0; + Reject = 1; + Pending = 2; +} +// وضعیت ارسال سفارش +enum DeliveryStatus +{ + // نامشخص / نیاز به ارسال ندارد (مثلا سفارش پکیج) + DeliveryStatus_None = 0; + // ثبت شده و در انتظار آماده‌سازی/ارسال + DeliveryStatus_Pending = 1; + // تحویل پست/حمل‌ونقل شده است + DeliveryStatus_InTransit = 2; + // توسط مشتری دریافت شده است + DeliveryStatus_Delivered = 3; + // مرجوع شده + DeliveryStatus_Returned = 4; +} +enum TransactionType +{ + Buy = 0; + DepositIpg = 1; + DepositExternal1 = 2; + Withdraw = 3; +} +enum ContractType +{ + Main = 0; + CMS = 1; +} +enum PaymentMethod +{ + IPG = 0; + Wallet = 1; +} diff --git a/src/Protobufs/BackOffice.BFF.Common.Protobuf/BackOffice.BFF.Common.Protobuf.csproj b/src/Protobufs/BackOffice.BFF.Common.Protobuf/BackOffice.BFF.Common.Protobuf.csproj new file mode 100644 index 0000000..e2bb19a --- /dev/null +++ b/src/Protobufs/BackOffice.BFF.Common.Protobuf/BackOffice.BFF.Common.Protobuf.csproj @@ -0,0 +1,32 @@ + + + + net9.0 + enable + enable + true + Foursat.BackOffice.BFF.Common.Protobuf + 0.0.1 + FourSat + FourSat + BackOffice.BFF.Common.Protobuf + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + diff --git a/src/Protobufs/BackOffice.BFF.Common.Protobuf/Protos/public_messages.proto b/src/Protobufs/BackOffice.BFF.Common.Protobuf/Protos/public_messages.proto new file mode 100644 index 0000000..fe252ee --- /dev/null +++ b/src/Protobufs/BackOffice.BFF.Common.Protobuf/Protos/public_messages.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package messages; + +option csharp_namespace = "BackOffice.BFF.Protobuf.Common"; +service PublicMessageContract{} +message PaginationState +{ + int32 page_number = 1; + + int32 page_size = 2; +} +message MetaData +{ + int64 current_page = 1; + + int64 total_page = 2; + + int64 page_size = 3; + + int64 total_count = 4; + + bool has_previous = 5; + + bool has_next = 6; +} +message DecimalValue +{ + + int64 units = 1; + + sfixed32 nanos = 2; +} +enum PaymentStatus +{ + Success = 0; + Reject = 1; + Pending = 2; +} +// وضعیت ارسال سفارش +enum DeliveryStatus +{ + // نامشخص / نیاز به ارسال ندارد (مثلا سفارش پکیج) + DeliveryStatus_None = 0; + // ثبت شده و در انتظار آماده‌سازی/ارسال + DeliveryStatus_Pending = 1; + // تحویل پست/حمل‌ونقل شده است + DeliveryStatus_InTransit = 2; + // توسط مشتری دریافت شده است + DeliveryStatus_Delivered = 3; + // مرجوع شده + DeliveryStatus_Returned = 4; +} +enum TransactionType +{ + Buy = 0; + DepositIpg = 1; + DepositExternal1 = 2; + Withdraw = 3; +} +enum ContractType +{ + Main = 0; + CMS = 1; +} +enum PaymentMethod +{ + IPG = 0; + Wallet = 1; +} diff --git a/src/Protobufs/BackOffice.BFF.Configuration.Protobuf/BackOffice.BFF.Configuration.Protobuf.csproj b/src/Protobufs/BackOffice.BFF.Configuration.Protobuf/BackOffice.BFF.Configuration.Protobuf.csproj new file mode 100644 index 0000000..d2fb610 --- /dev/null +++ b/src/Protobufs/BackOffice.BFF.Configuration.Protobuf/BackOffice.BFF.Configuration.Protobuf.csproj @@ -0,0 +1,44 @@ + + + + net9.0 + enable + enable + true + BackOffice.BFF.Configuration.Protobuf + 1.0.0 + FourSat + FourSat + BackOffice.BFF.Configuration.Protobuf + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + $(PackageOutputPath)$(PackageId).$(Version).nupkg + + dotnet nuget push **/*.nupkg --source https://git.afrino.co/api/packages/FourSat/nuget/index.json --api-key 061a5cb15517c6da39c16cfce8556c55ae104d0d --skip-duplicate + + + + + + + diff --git a/src/Protobufs/BackOffice.BFF.Configuration.Protobuf/Protos/configuration.proto b/src/Protobufs/BackOffice.BFF.Configuration.Protobuf/Protos/configuration.proto new file mode 100644 index 0000000..35b8802 --- /dev/null +++ b/src/Protobufs/BackOffice.BFF.Configuration.Protobuf/Protos/configuration.proto @@ -0,0 +1,110 @@ +syntax = "proto3"; + +package configuration; + +import "public_messages.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/wrappers.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "BackOffice.BFF.Configuration.Protobuf"; + +service ConfigurationContract +{ + rpc CreateOrUpdateConfiguration(CreateOrUpdateConfigurationRequest) returns (google.protobuf.Empty); + rpc DeactivateConfiguration(DeactivateConfigurationRequest) returns (google.protobuf.Empty); + rpc GetConfigurationByKey(GetConfigurationByKeyRequest) returns (GetConfigurationByKeyResponse); + rpc GetAllConfigurations(GetAllConfigurationsRequest) returns (GetAllConfigurationsResponse); + rpc GetConfigurationHistory(GetConfigurationHistoryRequest) returns (GetConfigurationHistoryResponse); +} + +// CreateOrUpdate Command +message CreateOrUpdateConfigurationRequest +{ + string key = 1; + string value = 2; + google.protobuf.StringValue description = 3; + int32 scope = 4; // ConfigurationScope enum: System=0, Network=1, Club=2, Commission=3 +} + +// Deactivate Command +message DeactivateConfigurationRequest +{ + string key = 1; + google.protobuf.StringValue reason = 2; +} + +// GetByKey Query +message GetConfigurationByKeyRequest +{ + string key = 1; +} + +message GetConfigurationByKeyResponse +{ + int64 id = 1; + string key = 2; + string value = 3; + string description = 4; + int32 scope = 5; + bool is_active = 6; + google.protobuf.Timestamp created = 7; + google.protobuf.Timestamp last_modified = 8; +} + +// GetAll Query +message GetAllConfigurationsRequest +{ + google.protobuf.Int32Value scope = 1; + google.protobuf.BoolValue is_active = 2; + int32 page_index = 3; + int32 page_size = 4; +} + +message GetAllConfigurationsResponse +{ + messages.MetaData meta_data = 1; + repeated ConfigurationModel models = 2; +} + +message ConfigurationModel +{ + int64 id = 1; + string key = 2; + string value = 3; + string description = 4; + int32 scope = 5; + bool is_active = 6; + google.protobuf.Timestamp created = 7; +} + +// GetHistory Query +message GetConfigurationHistoryRequest +{ + google.protobuf.Int64Value configuration_id = 1; + google.protobuf.StringValue key = 2; + int32 page_index = 3; + int32 page_size = 4; +} + +message GetConfigurationHistoryResponse +{ + messages.MetaData meta_data = 1; + repeated ConfigurationHistoryModel models = 2; +} + +message ConfigurationHistoryModel +{ + int64 id = 1; + int64 configuration_id = 2; + string key = 3; + string old_value = 4; + string new_value = 5; + string old_description = 6; + string new_description = 7; + int32 old_scope = 8; + int32 new_scope = 9; + string performed_by = 10; + string reason = 11; + google.protobuf.Timestamp created = 12; +} diff --git a/src/Protobufs/BackOffice.BFF.Configuration.Protobuf/Protos/public_messages.proto b/src/Protobufs/BackOffice.BFF.Configuration.Protobuf/Protos/public_messages.proto new file mode 100644 index 0000000..fe252ee --- /dev/null +++ b/src/Protobufs/BackOffice.BFF.Configuration.Protobuf/Protos/public_messages.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package messages; + +option csharp_namespace = "BackOffice.BFF.Protobuf.Common"; +service PublicMessageContract{} +message PaginationState +{ + int32 page_number = 1; + + int32 page_size = 2; +} +message MetaData +{ + int64 current_page = 1; + + int64 total_page = 2; + + int64 page_size = 3; + + int64 total_count = 4; + + bool has_previous = 5; + + bool has_next = 6; +} +message DecimalValue +{ + + int64 units = 1; + + sfixed32 nanos = 2; +} +enum PaymentStatus +{ + Success = 0; + Reject = 1; + Pending = 2; +} +// وضعیت ارسال سفارش +enum DeliveryStatus +{ + // نامشخص / نیاز به ارسال ندارد (مثلا سفارش پکیج) + DeliveryStatus_None = 0; + // ثبت شده و در انتظار آماده‌سازی/ارسال + DeliveryStatus_Pending = 1; + // تحویل پست/حمل‌ونقل شده است + DeliveryStatus_InTransit = 2; + // توسط مشتری دریافت شده است + DeliveryStatus_Delivered = 3; + // مرجوع شده + DeliveryStatus_Returned = 4; +} +enum TransactionType +{ + Buy = 0; + DepositIpg = 1; + DepositExternal1 = 2; + Withdraw = 3; +} +enum ContractType +{ + Main = 0; + CMS = 1; +} +enum PaymentMethod +{ + IPG = 0; + Wallet = 1; +} diff --git a/src/Protobufs/BackOffice.BFF.NetworkMembership.Protobuf/BackOffice.BFF.NetworkMembership.Protobuf.csproj b/src/Protobufs/BackOffice.BFF.NetworkMembership.Protobuf/BackOffice.BFF.NetworkMembership.Protobuf.csproj new file mode 100644 index 0000000..b2795d1 --- /dev/null +++ b/src/Protobufs/BackOffice.BFF.NetworkMembership.Protobuf/BackOffice.BFF.NetworkMembership.Protobuf.csproj @@ -0,0 +1,33 @@ + + + + net9.0 + enable + enable + true + Foursat.BackOffice.BFF.NetworkMembership.Protobuf + 0.0.1 + FourSat + FourSat + Foursat.BackOffice.BFF.NetworkMembership.Protobuf + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + diff --git a/src/Protobufs/BackOffice.BFF.NetworkMembership.Protobuf/Protos/networkmembership.proto b/src/Protobufs/BackOffice.BFF.NetworkMembership.Protobuf/Protos/networkmembership.proto new file mode 100644 index 0000000..508d7b6 --- /dev/null +++ b/src/Protobufs/BackOffice.BFF.NetworkMembership.Protobuf/Protos/networkmembership.proto @@ -0,0 +1,124 @@ +syntax = "proto3"; + +package networkmembership; + +import "public_messages.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/wrappers.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "BackOffice.BFF.NetworkMembership.Protobuf"; + +service NetworkMembershipContract +{ + rpc JoinNetwork(JoinNetworkRequest) returns (google.protobuf.Empty); + rpc ChangeNetworkParent(ChangeNetworkParentRequest) returns (google.protobuf.Empty); + rpc RemoveFromNetwork(RemoveFromNetworkRequest) returns (google.protobuf.Empty); + rpc GetUserNetwork(GetUserNetworkRequest) returns (GetUserNetworkResponse); + rpc GetNetworkTree(GetNetworkTreeRequest) returns (GetNetworkTreeResponse); + rpc GetNetworkMembershipHistory(GetNetworkMembershipHistoryRequest) returns (GetNetworkMembershipHistoryResponse); +} + +// JoinNetwork Command +message JoinNetworkRequest +{ + int64 user_id = 1; + int64 parent_id = 2; + int32 leg = 3; // NetworkLeg enum: Left=0, Right=1 + google.protobuf.StringValue referral_code = 4; +} + +// ChangeParent Command +message ChangeNetworkParentRequest +{ + int64 user_id = 1; + int64 new_parent_id = 2; + int32 new_leg = 3; // NetworkLeg enum + string reason = 4; +} + +// Remove Command +message RemoveFromNetworkRequest +{ + int64 user_id = 1; + string reason = 2; +} + +// GetUserNetwork Query +message GetUserNetworkRequest +{ + int64 user_id = 1; +} + +message GetUserNetworkResponse +{ + int64 id = 1; + int64 user_id = 2; + string user_name = 3; + google.protobuf.Int64Value parent_id = 4; + string parent_name = 5; + int32 network_leg = 6; // NetworkLeg enum + google.protobuf.Int64Value left_child_id = 7; + string left_child_name = 8; + google.protobuf.Int64Value right_child_id = 9; + string right_child_name = 10; + int32 network_level = 11; + string referral_code = 12; + google.protobuf.Timestamp joined_at = 13; + google.protobuf.Timestamp created = 14; +} + +// GetNetworkTree Query +message GetNetworkTreeRequest +{ + int64 root_user_id = 1; + google.protobuf.Int32Value max_depth = 2; + google.protobuf.BoolValue only_active = 3; +} + +message GetNetworkTreeResponse +{ + repeated NetworkTreeNodeModel nodes = 1; +} + +message NetworkTreeNodeModel +{ + int64 user_id = 1; + string user_name = 2; + google.protobuf.Int64Value parent_id = 3; + int32 network_leg = 4; + int32 network_level = 5; + bool is_active = 6; + google.protobuf.Timestamp joined_at = 7; +} + +// GetHistory Query +message GetNetworkMembershipHistoryRequest +{ + google.protobuf.Int64Value user_id = 1; + google.protobuf.Int64Value parent_id = 2; + int32 page_index = 3; + int32 page_size = 4; +} + +message GetNetworkMembershipHistoryResponse +{ + messages.MetaData meta_data = 1; + repeated NetworkMembershipHistoryModel models = 2; +} + +message NetworkMembershipHistoryModel +{ + int64 id = 1; + int64 user_id = 2; + google.protobuf.Int64Value old_parent_id = 3; + google.protobuf.Int64Value new_parent_id = 4; + google.protobuf.Int32Value old_network_leg = 5; + google.protobuf.Int32Value new_network_leg = 6; + google.protobuf.Int32Value old_network_level = 7; + google.protobuf.Int32Value new_network_level = 8; + int32 action = 9; // NetworkMembershipAction enum + string performed_by = 10; + string reason = 11; + google.protobuf.Timestamp created = 12; +} diff --git a/src/Protobufs/BackOffice.BFF.NetworkMembership.Protobuf/Protos/public_messages.proto b/src/Protobufs/BackOffice.BFF.NetworkMembership.Protobuf/Protos/public_messages.proto new file mode 100644 index 0000000..fe252ee --- /dev/null +++ b/src/Protobufs/BackOffice.BFF.NetworkMembership.Protobuf/Protos/public_messages.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package messages; + +option csharp_namespace = "BackOffice.BFF.Protobuf.Common"; +service PublicMessageContract{} +message PaginationState +{ + int32 page_number = 1; + + int32 page_size = 2; +} +message MetaData +{ + int64 current_page = 1; + + int64 total_page = 2; + + int64 page_size = 3; + + int64 total_count = 4; + + bool has_previous = 5; + + bool has_next = 6; +} +message DecimalValue +{ + + int64 units = 1; + + sfixed32 nanos = 2; +} +enum PaymentStatus +{ + Success = 0; + Reject = 1; + Pending = 2; +} +// وضعیت ارسال سفارش +enum DeliveryStatus +{ + // نامشخص / نیاز به ارسال ندارد (مثلا سفارش پکیج) + DeliveryStatus_None = 0; + // ثبت شده و در انتظار آماده‌سازی/ارسال + DeliveryStatus_Pending = 1; + // تحویل پست/حمل‌ونقل شده است + DeliveryStatus_InTransit = 2; + // توسط مشتری دریافت شده است + DeliveryStatus_Delivered = 3; + // مرجوع شده + DeliveryStatus_Returned = 4; +} +enum TransactionType +{ + Buy = 0; + DepositIpg = 1; + DepositExternal1 = 2; + Withdraw = 3; +} +enum ContractType +{ + Main = 0; + CMS = 1; +} +enum PaymentMethod +{ + IPG = 0; + Wallet = 1; +}