Skip to content

부과 배분 행렬 셀 도출근거 — BE 참고

데이터 계약

  • allocateDetailed(charge) → { principal, totalWeight, perLine: { [lineId]: { amount, weight, isResidual } } }
  • allocate(charge) = allocateDetailed에서 amount만 추출(기존 시그니처 불변).
  • allocationBreakdown(charge, axis, entityCode) — axis ∈ {unit,member,contract}. 그 엔티티에 속한 charge 라인을 분해.

공식 (단일 출처)

  • 라인 가중치 = basisQuantity(line, chargeBasis) × (occupancyDays / monthDays).
  • 라인 배분액 = round(principal × weight / totalWeight), 마지막 라인은 잔차 흡수(principal − Σ앞선라인).
  • 비중(share) = weight / totalWeight (totalWeight=0이면 0).

불변식

  • Σ breakdown.lines.amount === cellAmount(charge, entity) (행렬 셀과 정확 일치).
  • charge별 3축 셀 합 = chargePrincipal (Σ allocate).
  • totalWeight=0 엣지: 마지막 라인이 principal 전액 흡수(기존 allocate 동작), 비중 0 표기.

실서비스 전환 메모

  • 가중치/점유일수는 demoSeed 라인(원자) 기반. 실 BE는 소유·점유 이력에서 라인 생성 후 동일 공식 적용.