add_other_expense (기타 비용 추가)
새로운 기타 비용 항목을 등록합니다.
기본 정보
| 항목 |
값 |
| URL |
https://asia-northeast3-construction24-test.cloudfunctions.net/add_other_expense |
| Method |
POST |
| 인증 |
Firebase ID Token 필요 |
| 권한 |
해당 회사의 멤버 |
요청
Body
| 필드 |
타입 |
필수 |
설명 |
검증 |
| token |
string |
O |
Firebase ID Token |
- |
| company_id |
string |
O |
회사 ID |
- |
| site_id |
string |
O |
현장 ID |
- |
| title |
string |
O |
제목 |
- |
| description |
string |
O |
설명 |
- |
요청 예시
{
"token": "eyJhbGci...",
"company_id": "abc123",
"site_id": "site456",
"title": "현장 사무실 임대료",
"description": "월별 사무실 임대 비용"
}
응답
성공 (200)
{
"message": "기타 비용 추가 완료",
"expense_id": "expense789"
}
실패
| 코드 |
message |
원인 |
| 500 |
"해당 회사의 멤버가 아닙니다." |
요청자가 해당 회사의 멤버가 아닌 경우 |
참고
- 기타 비용 생성 시 집계 필드(total_cost, total_tax, year_costs, year_tax, month_costs, month_tax)는 0 또는 빈 객체로 초기화됩니다.
- 실제 비용 내역은 [[add_other_expense_item]] API를 통해 추가합니다.
- 관련 API: [[edit_other_expense]], [[delete_other_expense]], [[add_other_expense_item]]