feat(merchant-service): add Cafe/Restaurant/Karaoke/Spa business categories
Add vertical-specific BusinessCategory enum values: - Cafe (11), Restaurant (12), Karaoke (13), Spa (14) Update CreateShopCommandHandler to map vertical names to new categories Update EF Core seed data with new categories
This commit is contained in:
@@ -78,13 +78,19 @@ public class CreateShopCommandHandler : IRequestHandler<CreateShopCommand, Creat
|
||||
|
||||
// EN: Parse business category
|
||||
// VI: Parse ngành nghề
|
||||
// EN: Parse business category (includes vertical-specific aliases)
|
||||
// VI: Parse ngành nghề (bao gồm alias theo ngành hàng)
|
||||
var category = request.Category.ToLowerInvariant() switch
|
||||
{
|
||||
"foodbeverage" => BusinessCategory.FoodBeverage,
|
||||
"cafe" or "café" or "coffee" => BusinessCategory.Cafe,
|
||||
"restaurant" or "nhà hàng" or "bar" => BusinessCategory.Restaurant,
|
||||
"karaoke" => BusinessCategory.Karaoke,
|
||||
"spa" or "massage" or "wellness" => BusinessCategory.Spa,
|
||||
"fashion" => BusinessCategory.Fashion,
|
||||
"electronics" => BusinessCategory.Electronics,
|
||||
"healthcare" => BusinessCategory.Healthcare,
|
||||
"beauty" => BusinessCategory.Beauty,
|
||||
"beauty" or "salon" or "thẩm mỹ" => BusinessCategory.Beauty,
|
||||
"education" => BusinessCategory.Education,
|
||||
"entertainment" => BusinessCategory.Entertainment,
|
||||
"services" => BusinessCategory.Services,
|
||||
|
||||
@@ -77,6 +77,32 @@ public class BusinessCategory : Enumeration
|
||||
/// </summary>
|
||||
public static readonly BusinessCategory Other = new(99, nameof(Other));
|
||||
|
||||
// ─── Vertical-specific categories (for multi-vertical POS) ───
|
||||
|
||||
/// <summary>
|
||||
/// EN: Café — coffee shops, tea houses, bubble tea.
|
||||
/// VI: Quán cà phê, trà sữa.
|
||||
/// </summary>
|
||||
public static readonly BusinessCategory Cafe = new(11, nameof(Cafe));
|
||||
|
||||
/// <summary>
|
||||
/// EN: Restaurant — restaurants, bars, eateries.
|
||||
/// VI: Nhà hàng, quán ăn, bar.
|
||||
/// </summary>
|
||||
public static readonly BusinessCategory Restaurant = new(12, nameof(Restaurant));
|
||||
|
||||
/// <summary>
|
||||
/// EN: Karaoke — karaoke bars, entertainment venues.
|
||||
/// VI: Karaoke, các địa điểm giải trí.
|
||||
/// </summary>
|
||||
public static readonly BusinessCategory Karaoke = new(13, nameof(Karaoke));
|
||||
|
||||
/// <summary>
|
||||
/// EN: Spa — spa, massage, wellness centers.
|
||||
/// VI: Spa, massage, trung tâm sức khỏe.
|
||||
/// </summary>
|
||||
public static readonly BusinessCategory Spa = new(14, nameof(Spa));
|
||||
|
||||
public BusinessCategory(int id, string name) : base(id, name)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -368,7 +368,12 @@ public class BusinessCategoryEntityTypeConfiguration : IEntityTypeConfiguration<
|
||||
BusinessCategory.Services,
|
||||
BusinessCategory.Grocery,
|
||||
BusinessCategory.HomeFurniture,
|
||||
BusinessCategory.Other
|
||||
BusinessCategory.Other,
|
||||
// Vertical-specific categories
|
||||
BusinessCategory.Cafe,
|
||||
BusinessCategory.Restaurant,
|
||||
BusinessCategory.Karaoke,
|
||||
BusinessCategory.Spa
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user