콘텐츠로 이동

material 스키마 (자재 품목 마스터)

현장별 자재 품목 마스터. 각 작업(tasks/{tid})의 material_usage 서브컬렉션이 이 문서의 material_id를 참조하여 일일 사용량을 기록합니다.

저장 위치

companies/{company_id}/sites/{site_id}/material/{material_id}
  • material_id: Firestore 자동 생성 ID

문서 필드

필드 타입 설명
item_name string 품목명 (예: "시멘트 40kg")
specification string 규격 (예: "D10", "40kg", "1종 보통")
unit string 단위 (예: "EA", "kg", "m", "L")
created_at timestamp 생성 시각 (SERVER_TIMESTAMP)
created_by string 생성자 UID

엔드포인트

엔드포인트 동작
add_task_material 자재 마스터 생성 → 반환값 task_material_id
edit_task_material 자재 마스터 수정 (item_name, specification, unit)

자재 사용량 등록/수정/삭제는 작업(tasks/{tid}) 하위 material_usage/{daily_usage_id}에서 이루어집니다. 자세한 내용은 tasks.md 참조.

참고 관계

  • 재무 화면의 자재비(세금계산서/매입 내역) 관리는 별도 컬렉션(material_supplier/{sid}/material_cost/{YYYYMMDD})에서 관리합니다. 본 material 컬렉션은 작업 일지용 품목 목록이며 재무용과 분리되어 있습니다. 재무용은 finance/_schema/material_cost.md 참조.

예시 문서

{
  "item_name": "시멘트",
  "specification": "40kg / 1종 보통",
  "unit": "포대",
  "created_at": "2026-04-20T09:00:00+09:00",
  "created_by": "uid_manager"
}