rename(phase 1): CapaKraken → Nexus across code, UI, docs, CI (#61)
CI / Architecture Guardrails (push) Successful in 2m38s
CI / Assistant Split Regression (push) Successful in 3m33s
CI / Typecheck (push) Successful in 3m51s
CI / Lint (push) Successful in 5m2s
CI / E2E Tests (push) Has been cancelled
CI / Fresh-Linux Docker Deploy (push) Has been cancelled
CI / Release Images (push) Has been cancelled
CI / Build (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Architecture Guardrails (push) Successful in 2m38s
CI / Assistant Split Regression (push) Successful in 3m33s
CI / Typecheck (push) Successful in 3m51s
CI / Lint (push) Successful in 5m2s
CI / E2E Tests (push) Has been cancelled
CI / Fresh-Linux Docker Deploy (push) Has been cancelled
CI / Release Images (push) Has been cancelled
CI / Build (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
rename(phase 1): CapaKraken → Nexus across code, UI, docs, CI (#61) Co-authored-by: Hartmut Nörenberg <hn@hartmut-noerenberg.com> Co-committed-by: Hartmut Nörenberg <hn@hartmut-noerenberg.com>
This commit was merged in pull request #61.
This commit is contained in:
@@ -6,7 +6,7 @@ import type {
|
||||
ShiftValidationResult,
|
||||
ValidationError,
|
||||
ValidationWarning,
|
||||
} from "@capakraken/shared";
|
||||
} from "@nexus/shared";
|
||||
import { calculateAllocation } from "../allocation/calculator.js";
|
||||
import { validateAvailability } from "../allocation/availability-validator.js";
|
||||
import { computeBudgetStatus } from "../budget/monitor.js";
|
||||
@@ -23,10 +23,21 @@ export interface ShiftInput {
|
||||
newEndDate: Date;
|
||||
allocations: (Pick<
|
||||
Allocation,
|
||||
"id" | "resourceId" | "startDate" | "endDate" | "hoursPerDay" | "percentage" | "role" | "dailyCostCents" | "status"
|
||||
| "id"
|
||||
| "resourceId"
|
||||
| "startDate"
|
||||
| "endDate"
|
||||
| "hoursPerDay"
|
||||
| "percentage"
|
||||
| "role"
|
||||
| "dailyCostCents"
|
||||
| "status"
|
||||
> & {
|
||||
resource: Pick<Resource, "id" | "displayName" | "lcrCents" | "availability">;
|
||||
allAllocationsForResource: Pick<Allocation, "id" | "startDate" | "endDate" | "hoursPerDay" | "status" | "projectId">[];
|
||||
allAllocationsForResource: Pick<
|
||||
Allocation,
|
||||
"id" | "startDate" | "endDate" | "hoursPerDay" | "status" | "projectId"
|
||||
>[];
|
||||
/** Extracted from allocation metadata before calling validator */
|
||||
includeSaturday?: boolean;
|
||||
})[];
|
||||
@@ -54,7 +65,13 @@ export function validateShift(input: ShiftInput): ShiftValidationResult {
|
||||
message: "New end date must be after new start date",
|
||||
field: "newEndDate",
|
||||
});
|
||||
return buildResult(false, errors, warnings, conflictDetails, buildZeroCostImpact(project.budgetCents));
|
||||
return buildResult(
|
||||
false,
|
||||
errors,
|
||||
warnings,
|
||||
conflictDetails,
|
||||
buildZeroCostImpact(project.budgetCents),
|
||||
);
|
||||
}
|
||||
|
||||
// Warn if duration changed significantly
|
||||
@@ -90,9 +107,7 @@ export function validateShift(input: ShiftInput): ShiftValidationResult {
|
||||
const shiftedEnd = new Date(newEndDate);
|
||||
|
||||
// Validate availability for shifted period (excluding current project's allocations)
|
||||
const otherAllocations = allAllocationsForResource.filter(
|
||||
(a) => a.projectId !== project.id,
|
||||
);
|
||||
const otherAllocations = allAllocationsForResource.filter((a) => a.projectId !== project.id);
|
||||
const availResult = validateAvailability(
|
||||
shiftedStart,
|
||||
shiftedEnd,
|
||||
|
||||
Reference in New Issue
Block a user