Files
meezi/src/Meezi.Core/Entities/Cafe.cs
T
soroush.asadi 15def7ff1c
CI/CD / CI · API (dotnet build + test) (push) Successful in 1m10s
CI/CD / CI · Admin API (dotnet build) (push) Successful in 52s
CI/CD / CI · Dashboard (tsc) (push) Successful in 1m5s
CI/CD / CI · Admin Web (tsc) (push) Successful in 35s
CI/CD / CI · Website (tsc) (push) Successful in 45s
CI/CD / CI · Koja (tsc) (push) Successful in 55s
CI/CD / Deploy · all services (push) Successful in 3m29s
feat: delete actions for warehouse/reservations/coupons/customers + Koja listing toggle
Delete (every manageable entity that only had "add" now has delete):
- Ingredients (warehouse): new DELETE /inventory/ingredients/{id} (soft-delete via
  the global DeletedAt filter — no FK trouble with recipes/movements) + NoOp stub +
  trash button in the materials cards.
- Reservations: new DELETE /reservations/{id} (soft-delete) + per-card delete button.
- Coupons & Customers: backend DELETE already existed; wired delete buttons in the UI.
- Shared ConfirmDialog component used by all delete flows (RTL-aware).
- Audit result: tables/branches/taxes/kitchen-stations/expenses/menu/terminals already
  had delete; HR has no "add" so no delete needed; shifts intentionally excluded
  (financial open/close records, not add-style entities).

Koja visibility:
- New Cafe.ShowOnKoja flag, default TRUE (DB default true so existing cafés stay
  listed). Discover query now filters IsVerified && !Deleted && ShowOnKoja.
- public-profile GET/PUT expose showOnKoja; dashboard public-profile panel has an
  on-by-default toggle that persists immediately. Platform IsVerified gate unchanged.
- EF migration AddCafeShowOnKoja (defaultValue: true).

Also: added the missing errors.generic i18n key (fa/en/ar) so useApiError's fallback
resolves instead of rendering the literal "errors.generic". 81 API tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 16:14:40 +03:30

64 lines
3.4 KiB
C#

using Meezi.Core.Enums;
namespace Meezi.Core.Entities;
public class Cafe : BaseEntity
{
public string Name { get; set; } = string.Empty;
public string? NameAr { get; set; }
public string? NameEn { get; set; }
public string Slug { get; set; } = string.Empty;
public string? Phone { get; set; }
public string? Address { get; set; }
public string? City { get; set; }
public string? LogoUrl { get; set; }
public string? CoverImageUrl { get; set; }
public string? Description { get; set; }
public PlanTier PlanTier { get; set; } = PlanTier.Free;
public DateTime? PlanExpiresAt { get; set; }
public bool IsVerified { get; set; }
/// <summary>Owner preference: list this café on Koja (public discovery). Defaults true so a
/// verified café is discoverable out of the box; the owner can opt out from settings.</summary>
public bool ShowOnKoja { get; set; } = true;
/// <summary>When true, merchant API access is blocked until reactivated by platform admin.</summary>
public bool IsSuspended { get; set; }
public string? SnappfoodVendorId { get; set; }
public string? Tap30VendorId { get; set; }
public string? DigikalaVendorId { get; set; }
public string PreferredLanguage { get; set; } = "fa";
/// <summary>JSON <see cref="Branding.CafeTheme"/> for dashboard + guest menu colors/styles.</summary>
public string? ThemeJson { get; set; }
/// <summary>JSON <see cref="Discover.CafeDiscoverProfile"/> for discover / AI matching.</summary>
public string? DiscoverProfileJson { get; set; }
/// <summary>JSON array of <see cref="Discover.CafeBadgeCatalog"/> keys (Enterprise, admin-assigned).</summary>
public string? DiscoverBadgesJson { get; set; }
/// <summary>JSON array of up to 8 gallery photo URLs (owner-managed).</summary>
public string? GalleryJson { get; set; }
/// <summary>JSON <see cref="Discover.WorkingHoursSchedule"/> per-day schedule.</summary>
public string? WorkingHoursJson { get; set; }
/// <summary>Instagram handle without @, max 80 chars.</summary>
public string? InstagramHandle { get; set; }
/// <summary>Cafe website URL, max 300 chars.</summary>
public string? WebsiteUrl { get; set; }
/// <summary>WGS-84 latitude (positive = north). Null until owner sets location.</summary>
public double? Latitude { get; set; }
/// <summary>WGS-84 longitude (positive = east). Null until owner sets location.</summary>
public double? Longitude { get; set; }
/// <summary>Default VAT/sales tax % for all branches unless branch override is allowed.</summary>
public decimal DefaultTaxRate { get; set; } = 9m;
public bool AllowBranchTaxOverride { get; set; }
public ICollection<Branch> Branches { get; set; } = [];
public ICollection<Table> Tables { get; set; } = [];
public ICollection<Employee> Employees { get; set; } = [];
public ICollection<MenuCategory> MenuCategories { get; set; } = [];
public ICollection<MenuItem> MenuItems { get; set; } = [];
public ICollection<Order> Orders { get; set; } = [];
public ICollection<Customer> Customers { get; set; } = [];
public ICollection<Coupon> Coupons { get; set; } = [];
public ICollection<Tax> Taxes { get; set; } = [];
public ICollection<CafeReview> Reviews { get; set; } = [];
public ICollection<SubscriptionPayment> SubscriptionPayments { get; set; } = [];
public ICollection<Ingredient> Ingredients { get; set; } = [];
}