@ehfuse/taskbox 0.5.247 → 0.5.249

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,3 +9,4 @@ export * from "./upload";
9
9
  export * from "./employee";
10
10
  export * from "./provider";
11
11
  export * from "./theme";
12
+ export * from "./workload";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * 인원별 용량(capacity) 타입이다 — "이 사람이 한 번에 안을 수 있는 양"의 기준선.
3
+ *
4
+ * 워크로드 차트는 원래 **팀 평균의 1.5배**를 과부하 기준으로 삼았다. 팀 전체가 함께 과부하면
5
+ * 평균도 같이 올라가 아무도 과부하로 안 잡히는 것이 그 방식의 한계라, 조직이 정한 절대 기준을 함께 둔다.
6
+ * 용량을 안 정하면(0) 예전처럼 팀 평균 기준으로 되돌아간다.
7
+ */
8
+ /** 용량을 무엇으로 세는지다 — 건수(기본) 또는 스토리 포인트(목표를 쓰는 조직). */
9
+ export type WorkloadCapacityBasis = "count" | "points";
10
+ /** 용량 설정이다(전원 공통 기본값 + 사람별 예외). */
11
+ export interface WorkloadCapacity {
12
+ basis: WorkloadCapacityBasis;
13
+ default_capacity: number;
14
+ by_account: Record<number, number>;
15
+ }
16
+ /** 용량 설정의 기본값이다(용량을 안 쓰는 상태). */
17
+ export declare const DEFAULT_WORKLOAD_CAPACITY: WorkloadCapacity;
18
+ /** 저장된 값을 전 키 확정 형태로 만든다(모르는 값은 기본값 — 소비처 저장 blob 이 반쪽이어도 화면이 깨지지 않게). */
19
+ export declare function resolveWorkloadCapacity(raw: unknown): WorkloadCapacity;
@@ -8,7 +8,7 @@
8
8
  * 전부 지난 마감인 사람과 다음 달 마감인 사람의 사정이 전혀 다르기 때문이다.
9
9
  * 마감이 없는 업무는 급할 근거가 없어 여유로 센다.
10
10
  */
11
- import type { TaskBoxItem } from "../types";
11
+ import type { TaskBoxItem, WorkloadCapacity } from "../types";
12
12
  /** 부하 구간이다 — overdue=마감 지남, soon=임박(기본 7일 이내), later=그 밖(마감 없음 포함). */
13
13
  export type WorkloadBucket = "overdue" | "soon" | "later";
14
14
  /** 한 사람의 부하다. */
@@ -20,6 +20,9 @@ export interface WorkloadRow {
20
20
  later: number;
21
21
  total: number;
22
22
  points: number;
23
+ capacity: number;
24
+ load: number;
25
+ ratio: number;
23
26
  }
24
27
  /** 워크로드 계산 옵션이다. */
25
28
  export interface WorkloadOptions {
@@ -27,12 +30,20 @@ export interface WorkloadOptions {
27
30
  soonDays?: number;
28
31
  includeUnassigned?: boolean;
29
32
  limit?: number;
33
+ capacity?: WorkloadCapacity;
30
34
  }
31
35
  /**
32
36
  * 인원별 부하를 만든다(부하 큰 순 정렬 — 지연이 많은 사람이 위로).
33
37
  * 담당자는 책임자(manager) 기준이다. 참조자는 "보고 있는 사람"이지 짊어진 사람이 아니라 세지 않는다.
34
38
  */
35
39
  export declare function buildWorkloadRows(tasks: readonly TaskBoxItem[], options: WorkloadOptions): WorkloadRow[];
40
+ /**
41
+ * 그 사람의 용량을 고른다 — 사람별 예외가 있으면 그것, 없으면 공통 기본값이다.
42
+ * 미배정(계정 0)은 사람이 아니라 용량을 두지 않는다(항상 0).
43
+ */
44
+ export declare function resolveRowCapacity(accountSeq: number, capacity: WorkloadCapacity): number;
45
+ /** 용량을 넘겼는지 본다(용량 미설정이면 판정하지 않는다 — 그때는 팀 평균 기준을 쓴다). */
46
+ export declare function isOverCapacity(row: WorkloadRow): boolean;
36
47
  /**
37
48
  * 과부하 임계치를 넘긴 행인지 본다.
38
49
  * 절대 기준(예: 15건)이 아니라 **팀 평균 대비**로도 볼 수 있게 둘 다 받는다 —
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ehfuse/taskbox",
3
- "version": "0.5.247",
3
+ "version": "0.5.249",
4
4
  "description": "A React/MUI task inbox component with notices, per-user assignments, read tracking, and mobile card UI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",