Files
taxbaik/TaxBaik.Domain/Interfaces/IInquiryRepository.cs
kjh2064 c65742a0c7
TaxBaik CI/CD / build-and-deploy (push) Successful in 48s
feat: implement admin inquiry create/edit/delete functionality
Core Components:
- Create reusable InquiryForm.razor component following SOLID principles
- Implement InquiryCreate.razor for registering new inquiries (offline, phone)
- Implement InquiryEdit.razor for modifying existing inquiries with delete
- Add DeleteAsync method to InquiryRepository and InquiryService
- Update InquiryList with 'Create' button and Edit link in table

Architecture:
- InquiryForm: Encapsulates form logic, can be reused for create/edit
- Service Layer: All operations go through InquiryService for cache invalidation
- Repository Pattern: Database operations isolated in InquiryRepository
- UI Consistency: Both pages follow admin-page-hero pattern

Features:
- Admin can create inquiries from phone/offline consultations
- Admin can modify inquiry details (name, phone, email, message, status, memo)
- Admin can delete inquiries with confirmation dialog
- All operations update dashboard cache
- Status validation and error handling throughout

Testing:
- Updated FakeInquiryRepository in tests to implement DeleteAsync
2026-06-28 16:45:29 +09:00

21 lines
1.3 KiB
C#

namespace TaxBaik.Domain.Interfaces;
using TaxBaik.Domain.Entities;
public interface IInquiryRepository
{
Task<int> CreateAsync(Inquiry inquiry, CancellationToken cancellationToken = default);
Task<Inquiry?> GetByIdAsync(int id, CancellationToken cancellationToken = default);
Task<(IEnumerable<Inquiry> Items, int Total)> GetPagedAsync(
int page, int pageSize, string? status = null, CancellationToken cancellationToken = default);
Task<int> CountAsync(CancellationToken cancellationToken = default);
Task<int> CountThisMonthAsync(CancellationToken cancellationToken = default);
Task<int> CountByStatusAsync(string status, CancellationToken cancellationToken = default);
Task<int> CountByDateRangeAsync(DateTime startDate, DateTime endDate, CancellationToken cancellationToken = default);
Task<int> CountByStatusAndDateAsync(string status, DateTime startDate, DateTime endDate, CancellationToken cancellationToken = default);
Task UpdateStatusAsync(int id, string status, CancellationToken cancellationToken = default);
Task UpdateAdminMemoAsync(int id, string? adminMemo, CancellationToken cancellationToken = default);
Task LinkClientAsync(int inquiryId, int clientId, CancellationToken cancellationToken = default);
Task DeleteAsync(int id, CancellationToken cancellationToken = default);
}