ef15fd6247
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>
28 lines
876 B
C#
28 lines
876 B
C#
using Meezi.API.Models.Branches;
|
|
using Meezi.API.Validators;
|
|
using Meezi.Core.Utilities;
|
|
using Xunit;
|
|
|
|
namespace Meezi.API.Tests;
|
|
|
|
public class BranchPhaseATests
|
|
{
|
|
[Fact]
|
|
public void CreateBranchRequestValidator_requires_valid_login_phone()
|
|
{
|
|
var validator = new CreateBranchRequestValidator();
|
|
var invalid = validator.Validate(new CreateBranchRequest("شعبه", "123", null, null, null, null));
|
|
Assert.False(invalid.IsValid);
|
|
|
|
var valid = validator.Validate(new CreateBranchRequest("شعبه", "09121234567", "علی", null, null, null));
|
|
Assert.True(valid.IsValid);
|
|
}
|
|
|
|
[Fact]
|
|
public void PhoneNormalizer_aligns_branch_login_phones()
|
|
{
|
|
Assert.Equal("09121234567", PhoneNormalizer.Normalize("0912 123 4567"));
|
|
Assert.Equal("09121234567", PhoneNormalizer.Normalize("+989121234567"));
|
|
}
|
|
}
|