feat(api): .NET 10 multi-tenant REST API
Full backend implementation: - Multi-tenant cafe/restaurant management (menus, orders, tables, staff) - POS order flow with ZarinPal and Snappfood payment integration - OTP authentication via Kavenegar SMS - QR digital menu with public discover/finder endpoints - Customer loyalty, coupons, CRM - PostgreSQL via EF Core, Redis for caching/sessions - Background jobs, webhook handlers - Full migration history Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Meezi.Infrastructure.Services.Platform;
|
||||
using Meezi.Core.Interfaces;
|
||||
using Meezi.Shared;
|
||||
|
||||
namespace Meezi.API.Controllers;
|
||||
|
||||
[Route("api/cafes/{cafeId}/platform")]
|
||||
public class CafePlatformController : CafeApiControllerBase
|
||||
{
|
||||
private readonly IPlatformCatalogService _catalog;
|
||||
|
||||
public CafePlatformController(IPlatformCatalogService catalog)
|
||||
{
|
||||
_catalog = catalog;
|
||||
}
|
||||
|
||||
[HttpGet("features")]
|
||||
public async Task<IActionResult> GetFeatures(string cafeId, ITenantContext tenant, CancellationToken cancellationToken)
|
||||
{
|
||||
if (EnsureCafeAccess(cafeId, tenant) is { } denied) return denied;
|
||||
if (tenant.PlanTier is null)
|
||||
return Ok(new ApiResponse<object>(true, new Dictionary<string, bool>()));
|
||||
|
||||
var features = await _catalog.GetEffectiveFeaturesForCafeAsync(
|
||||
cafeId,
|
||||
tenant.PlanTier.Value,
|
||||
cancellationToken);
|
||||
|
||||
return Ok(new ApiResponse<object>(true, features));
|
||||
}
|
||||
|
||||
[HttpGet("plans")]
|
||||
public async Task<IActionResult> GetPublicPlans(CancellationToken cancellationToken)
|
||||
{
|
||||
var plans = await _catalog.GetPlansAsync(cancellationToken);
|
||||
return Ok(new ApiResponse<object>(true, plans));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user