feat: plan limits, café location, nearby API, Iran map section
CI/CD / CI · API (dotnet build + test) (push) Successful in 56s
CI/CD / CI · Admin API (dotnet build) (push) Successful in 49s
CI/CD / CI · Dashboard (tsc) (push) Successful in 1m4s
CI/CD / CI · Admin Web (tsc) (push) Successful in 34s
CI/CD / CI · Website (tsc) (push) Successful in 44s
CI/CD / CI · Koja (tsc) (push) Successful in 50s
CI/CD / Deploy · all services (push) Successful in 3m15s
CI/CD / CI · API (dotnet build + test) (push) Successful in 56s
CI/CD / CI · Admin API (dotnet build) (push) Successful in 49s
CI/CD / CI · Dashboard (tsc) (push) Successful in 1m4s
CI/CD / CI · Admin Web (tsc) (push) Successful in 34s
CI/CD / CI · Website (tsc) (push) Successful in 44s
CI/CD / CI · Koja (tsc) (push) Successful in 50s
CI/CD / Deploy · all services (push) Successful in 3m15s
• PlanLimits: add MaxMenuCategories (Free→3), MaxMenuItems (Free→30), CanAccessCrm and CanAccessStatistics (Pro+ only) • MenuController: enforce category/item limits before create (403 + PLAN_LIMIT_REACHED) • Cafe entity + EF migration: Latitude/Longitude (double?, nullable) • CafeSettingsController: PATCH accepts lat/lng with range validation • PublicController: GET /api/public/map-markers (marketing SVG map feed) and GET /api/public/nearby (Koja nearby-cafés with Haversine sort) • Dashboard settings: location card with OSM iframe preview + Neshan link • Website homepage: IranMapSection — stylised SVG silhouette with SMIL-animated blinking dots at real café coordinates Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -87,6 +87,21 @@ public class CafeSettingsController : CafeApiControllerBase
|
||||
if (request.AllowBranchTaxOverride is bool allowTax)
|
||||
cafe.AllowBranchTaxOverride = allowTax;
|
||||
|
||||
// Location: explicit null-clear flag OR new values
|
||||
if (request.ClearLocation)
|
||||
{
|
||||
cafe.Latitude = null;
|
||||
cafe.Longitude = null;
|
||||
}
|
||||
else if (request.Latitude.HasValue && request.Longitude.HasValue)
|
||||
{
|
||||
if (request.Latitude is < -90 or > 90 || request.Longitude is < -180 or > 180)
|
||||
return BadRequest(new ApiResponse<object>(false, null,
|
||||
new ApiError("INVALID_LOCATION", "Latitude must be −90…90 and longitude −180…180.")));
|
||||
cafe.Latitude = request.Latitude;
|
||||
cafe.Longitude = request.Longitude;
|
||||
}
|
||||
|
||||
await _db.SaveChangesAsync(ct);
|
||||
return Ok(new ApiResponse<CafeSettingsDto>(true, ToDto(cafe)));
|
||||
}
|
||||
@@ -106,5 +121,7 @@ public class CafeSettingsController : CafeApiControllerBase
|
||||
cafe.PlanExpiresAt,
|
||||
CafeThemeMapping.FromJson(cafe.ThemeJson),
|
||||
cafe.DefaultTaxRate,
|
||||
cafe.AllowBranchTaxOverride);
|
||||
cafe.AllowBranchTaxOverride,
|
||||
cafe.Latitude,
|
||||
cafe.Longitude);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user