39eab2e3a2
Extends RegionService, RegionRepository, and RegionController with the endpoints from mainPlan.md sec 2 beyond plain CRUD: setRegionalTarget, setRegionalBudget, mapAgencyToRegion, setRegionalTaxRule, getRegionHierarchy, and getRegionDashboard. Target/budget/tax-rule mutation is gated to users with region scope at RegionalManager level or RegionalAgency level across all regions; mapAgencyToRegion links an existing User holding the RegionalAgency role rather than introducing a separate agency entity, matching the convention already used by Claim.FK_AgencyUserId elsewhere in the codebase. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
33 lines
1.3 KiB
C#
33 lines
1.3 KiB
C#
namespace Distribution.Features.Region;
|
|
|
|
public interface IRegionRepository
|
|
{
|
|
Task<Models.Region?> GetByIdAsync(Guid id);
|
|
Task<List<Models.Region>> GetAllAsync();
|
|
Task AddAsync(Models.Region entity);
|
|
void Update(Models.Region entity);
|
|
void Remove(Models.Region entity);
|
|
|
|
Task<Models.RegionalTarget?> GetTargetAsync(Guid regionId, string period);
|
|
Task AddTargetAsync(Models.RegionalTarget target);
|
|
void UpdateTarget(Models.RegionalTarget target);
|
|
|
|
Task<Models.RegionalBudget?> GetBudgetAsync(Guid regionId, string period);
|
|
Task AddBudgetAsync(Models.RegionalBudget budget);
|
|
void UpdateBudget(Models.RegionalBudget budget);
|
|
|
|
Task<Models.RegionAgencyMap?> GetAgencyMapAsync(Guid regionId, Guid agencyUserId);
|
|
Task AddAgencyMapAsync(Models.RegionAgencyMap map);
|
|
|
|
Task<Models.RegionalTaxRule?> GetTaxRuleAsync(Guid regionId);
|
|
Task AddTaxRuleAsync(Models.RegionalTaxRule rule);
|
|
void UpdateTaxRule(Models.RegionalTaxRule rule);
|
|
|
|
Task<int?> GetUserRoleLevelAsync(Guid userId);
|
|
|
|
Task<List<Models.Route>> GetRoutesAsync(Guid regionId);
|
|
Task<List<Models.Store>> GetStoresByRouteIdsAsync(List<Guid> routeIds);
|
|
|
|
Task<List<Models.Order>> GetOrdersForDashboardAsync(Guid regionId, DateTime periodStart, DateTime periodEndExclusive);
|
|
}
|