feat : create store and repository and interface

This commit is contained in:
2025-11-23 18:25:59 +03:30
parent 41aaef9889
commit 5774d9e204
21 changed files with 601 additions and 1 deletions
@@ -0,0 +1,38 @@
using Application.Aggregates.Stores;
using Application.Aggregates.Stores.ViewModels;
using Application.Aggregates.Users;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Server.Pages.Panel.Stores;
public class DeleteModel(StoresApplication storesApplication) : PageModel
{
[BindProperty]
public StoreViewModel DeleteViewModel { get; set; } = new();
public async Task<IActionResult> OnGetAsync(Guid id)
{
if (id == Guid.Empty)
{
return RedirectToPage("Index");
}
DeleteViewModel =
await storesApplication.GetAsync(id);
if (DeleteViewModel == null)
{
return RedirectToPage("Index");
}
return Page();
}
public async Task<IActionResult> OnPostAsync()
{
await storesApplication.DeleteAsync(DeleteViewModel.Id);
return RedirectToPage("Index");
}
}