Files
Nexus/packages/application/src/index.ts
T
Hartmut 999626cf70 feat(application): extract entitlement use-cases from API router layer
Move core entitlement business logic (syncEntitlement, balance reading,
year summary, set/bulk-set) into packages/application/src/use-cases/entitlement/
using the deps-injection pattern. Audit logging stays in the router support
file; authorization check for getBalance/getBalanceDetail stays in the router
layer. The router support file becomes a thin wiring adapter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 20:14:35 +02:00

214 lines
6.3 KiB
TypeScript

export {
createDemandRequirement,
type DemandRequirementWithRelations,
} from "./use-cases/allocation/create-demand-requirement.js";
export { updateDemandRequirement } from "./use-cases/allocation/update-demand-requirement.js";
export {
createAssignment,
createAssignmentFragment,
type AssignmentWithRelations,
} from "./use-cases/allocation/create-assignment.js";
export { updateAssignment } from "./use-cases/allocation/update-assignment.js";
export { buildAllocationReadModel } from "./use-cases/allocation/build-allocation-read-model.js";
export {
buildSplitAllocationReadModel,
type BuildSplitAllocationReadModelInput,
type SplitAssignmentRecord,
type SplitDemandRequirementRecord,
} from "./use-cases/allocation/build-split-allocation-read-model.js";
export {
listAssignmentBookings,
type AssignmentBookingWithFallback,
type ListAssignmentBookingsInput,
} from "./use-cases/allocation/list-assignment-bookings.js";
export {
isChargeabilityActualBooking,
isChargeabilityRelevantProject,
isImportedTbdDraftProject,
} from "./use-cases/allocation/chargeability-bookings.js";
export {
countPlanningEntries,
type CountPlanningEntriesInput,
type CountPlanningEntriesResult,
} from "./use-cases/allocation/count-planning-entries.js";
export {
countEstimateHandoffPlanningEntries,
type CountEstimateHandoffPlanningEntriesInput,
} from "./use-cases/allocation/count-estimate-handoff-planning-entries.js";
export {
fillDemandRequirement,
type FillDemandRequirementResult,
} from "./use-cases/allocation/fill-demand-requirement.js";
export {
fillOpenDemand,
type FillOpenDemandResult,
} from "./use-cases/allocation/fill-open-demand.js";
export {
findAllocationEntry,
loadAllocationEntry,
type AllocationEntryResolution,
} from "./use-cases/allocation/load-allocation-entry.js";
export {
updateAllocationEntry,
type UpdateAllocationEntryInput,
type UpdateAllocationEntryResult,
} from "./use-cases/allocation/update-allocation-entry.js";
export {
deleteAllocationEntry,
type DeleteAllocationEntryResult,
} from "./use-cases/allocation/delete-allocation-entry.js";
export {
deleteDemandRequirement,
type DeleteDemandRequirementResult,
} from "./use-cases/allocation/delete-demand-requirement.js";
export {
deleteAssignment,
type DeleteAssignmentResult,
} from "./use-cases/allocation/delete-assignment.js";
export {
getDashboardOverview,
getDashboardPeakTimes,
getDashboardTopValueResources,
getDashboardDemand,
getDashboardChargeabilityOverview,
type GetDashboardPeakTimesInput,
type GetDashboardTopValueResourcesInput,
type GetDashboardDemandInput,
type GetDashboardChargeabilityOverviewInput,
type DashboardChargeabilityDerivation,
type DashboardChargeabilityRow,
getDashboardBudgetForecast,
type BudgetForecastDerivationSummary,
type BudgetForecastRow,
type BudgetForecastLocationSummary,
type PeakTimesPeriodDerivation,
type PeakTimesPeriodRow,
type DemandCalendarLocationSummary,
type DemandRowDerivation,
type DashboardDemandRow,
getDashboardSkillGaps,
getDashboardSkillGapSummary,
type SkillGapRow,
type DashboardSkillGapSummary,
getDashboardProjectHealth,
type ProjectHealthRow,
} from "./use-cases/dashboard/index.js";
export {
cloneEstimate,
createEstimate,
listEstimates,
getEstimateById,
updateEstimateDraft,
submitEstimateVersion,
approveEstimateVersion,
createEstimateRevision,
createEstimateExport,
createEstimatePlanningHandoff,
type CloneEstimateInput,
type EstimateWithDetails,
type EstimateListItem,
} from "./use-cases/estimate/index.js";
export {
recomputeResourceValueScores,
type RecomputeResourceValueScoresInput,
} from "./use-cases/resource/index.js";
export {
approveVacation,
batchApproveVacations,
rejectVacation,
batchRejectVacations,
cancelVacation,
type ApproveVacationInput,
type ApproveVacationResult,
type ApproveVacationDeps,
type BatchApproveVacationInput,
type BatchApproveVacationResult,
type BatchApproveVacationDeps,
type VacationChargeableInput,
type RejectVacationInput,
type RejectVacationResult,
type RejectVacationDeps,
type BatchRejectVacationInput,
type BatchRejectVacationResult,
type BatchRejectVacationDeps,
type CancelVacationInput,
type CancelVacationResult,
type CancelVacationDeps,
} from "./use-cases/vacation/index.js";
export {
syncEntitlement,
getEntitlementBalance,
getEntitlementBalanceDetail,
getEntitlementSync,
getEntitlementYearSummary,
getEntitlementYearSummaryDetail,
setEntitlement,
bulkSetEntitlements,
type EntitlementSnapshot,
type ResourceHolidayContext,
type SyncEntitlementDeps,
type ReadEntitlementBalanceDeps,
type EntitlementBalanceInput,
type EntitlementBalanceResult,
type EntitlementYearSummaryInput,
type EntitlementYearSummaryDetailInput,
type EntitlementYearSummaryRow,
type SetEntitlementInput,
type SetEntitlementReturn,
type BulkSetEntitlementsInput,
type BulkSetEntitlementsResult,
} from "./use-cases/entitlement/index.js";
export {
calculateEffectiveAllocationCostCents,
calculateEffectiveAllocationHours,
calculateEffectiveAvailableHours,
calculateEffectiveBookedHours,
calculateEffectiveDayAvailability,
countEffectiveWorkingDays,
enumerateIsoDates,
getAvailabilityHoursForDate,
loadResourceDailyAvailabilityContexts,
type ResourceCapacityProfile,
type ResourceDailyAvailabilityContext,
} from "./lib/resource-capacity.js";
export {
assessDispoImportReadiness,
parseMandatoryDispoReferenceWorkbook,
parseDispoChargeabilityWorkbook,
parseDispoPlanningWorkbook,
parseResourceRosterMasterWorkbook,
parseDispoRosterWorkbook,
persistDispoImportReadiness,
stageDispoReferenceData,
stageDispoChargeabilityResources,
stageDispoRosterResources,
stageDispoPlanningData,
stageDispoProjects,
stageDispoImportBatch,
commitDispoImportBatch,
type AssessDispoImportReadinessInput,
type CommitDispoImportBatchInput,
type CommitDispoImportBatchResult,
type DispoImportReadinessIssue,
type DispoImportReadinessReport,
type StageDispoReferenceDataResult,
type StageDispoChargeabilityResourcesResult,
type StageDispoRosterResourcesResult,
type StageDispoPlanningResult,
type StageDispoProjectsResult,
type StageDispoImportBatchInput,
type StageDispoImportBatchResult,
} from "./use-cases/dispo-import/index.js";