feat: Phase 5 API 개발 완료 (사용자 초대, 알림설정, 계정관리, 거래명세서)

5.1 사용자 초대 기능:
- UserInvitation 마이그레이션, 모델, 서비스, 컨트롤러, Swagger
- 초대 발송/수락/취소/재발송 API

5.2 알림설정 확장:
- NotificationSetting 마이그레이션, 모델, 서비스, 컨트롤러, Swagger
- 채널별/유형별 알림 설정 관리

5.3 계정정보 수정 API:
- 회원탈퇴, 사용중지, 약관동의 관리
- AccountService, AccountController, Swagger

5.4 매출 거래명세서 API:
- 거래명세서 조회/발행/이메일발송
- SaleService 확장, Swagger 문서화
This commit is contained in:
2025-12-19 14:52:53 +09:00
parent c7b25710a0
commit 3020026abf
31 changed files with 2735 additions and 8 deletions

View File

@@ -81,6 +81,79 @@
* )
* )
* )
*
* @OA\Schema(
* schema="SaleStatementItem",
* type="object",
* description="거래명세서 품목",
*
* @OA\Property(property="description", type="string", example="1월 매출", description="품목 설명"),
* @OA\Property(property="quantity", type="integer", example=1, description="수량"),
* @OA\Property(property="unit_price", type="number", example=1000000, description="단가"),
* @OA\Property(property="supply_amount", type="number", example=1000000, description="공급가액"),
* @OA\Property(property="tax_amount", type="number", example=100000, description="세액"),
* @OA\Property(property="total_amount", type="number", example=1100000, description="합계")
* )
*
* @OA\Schema(
* schema="SaleStatementParty",
* type="object",
* description="거래명세서 거래 당사자 정보",
*
* @OA\Property(property="name", type="string", example="(주)테스트", description="상호"),
* @OA\Property(property="business_number", type="string", example="123-45-67890", description="사업자번호"),
* @OA\Property(property="representative", type="string", example="홍길동", description="대표자"),
* @OA\Property(property="address", type="string", example="서울시 강남구", description="주소"),
* @OA\Property(property="tel", type="string", example="02-1234-5678", description="전화번호"),
* @OA\Property(property="fax", type="string", example="02-1234-5679", description="팩스"),
* @OA\Property(property="email", type="string", example="test@example.com", description="이메일")
* )
*
* @OA\Schema(
* schema="SaleStatement",
* type="object",
* description="거래명세서 정보",
*
* @OA\Property(property="statement_number", type="string", example="STSL202501150001", description="거래명세서 번호"),
* @OA\Property(property="issued_at", type="string", format="date-time", nullable=true, description="발행일시"),
* @OA\Property(property="sale", ref="#/components/schemas/Sale"),
* @OA\Property(property="seller", ref="#/components/schemas/SaleStatementParty"),
* @OA\Property(property="buyer", ref="#/components/schemas/SaleStatementParty"),
* @OA\Property(property="items", type="array", @OA\Items(ref="#/components/schemas/SaleStatementItem")),
* @OA\Property(property="summary", type="object",
* @OA\Property(property="supply_amount", type="number", example=1000000),
* @OA\Property(property="tax_amount", type="number", example=100000),
* @OA\Property(property="total_amount", type="number", example=1100000)
* )
* )
*
* @OA\Schema(
* schema="SaleStatementIssueResponse",
* type="object",
* description="거래명세서 발행 응답",
*
* @OA\Property(property="statement_number", type="string", example="STSL202501150001", description="거래명세서 번호"),
* @OA\Property(property="issued_at", type="string", format="date-time", example="2025-01-15T10:30:00+09:00", description="발행일시")
* )
*
* @OA\Schema(
* schema="SaleStatementSendRequest",
* type="object",
* description="거래명세서 이메일 발송 요청",
*
* @OA\Property(property="email", type="string", format="email", example="buyer@example.com", nullable=true, description="수신자 이메일 (미입력 시 거래처 이메일 사용)"),
* @OA\Property(property="message", type="string", example="거래명세서를 발송합니다.", maxLength=1000, nullable=true, description="추가 메시지")
* )
*
* @OA\Schema(
* schema="SaleStatementSendResponse",
* type="object",
* description="거래명세서 발송 응답",
*
* @OA\Property(property="sent_to", type="string", format="email", example="buyer@example.com", description="발송 이메일"),
* @OA\Property(property="sent_at", type="string", format="date-time", example="2025-01-15T10:30:00+09:00", description="발송일시"),
* @OA\Property(property="statement_number", type="string", example="STSL202501150001", description="거래명세서 번호")
* )
*/
class SaleApi
{
@@ -334,4 +407,111 @@ public function destroy() {}
* )
*/
public function confirm() {}
/**
* @OA\Get(
* path="/api/v1/sales/{id}/statement",
* tags={"Sales"},
* summary="거래명세서 조회",
* description="매출에 대한 거래명세서 정보를 조회합니다.",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="매출 ID", @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="조회 성공",
*
* @OA\JsonContent(
* allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="data", ref="#/components/schemas/SaleStatement")
* )
* }
* )
* ),
*
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=404, description="매출 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function getStatement() {}
/**
* @OA\Post(
* path="/api/v1/sales/{id}/statement/issue",
* tags={"Sales"},
* summary="거래명세서 발행",
* description="매출에 대한 거래명세서를 발행합니다. 확정(confirmed) 상태의 매출만 발행 가능합니다.",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="매출 ID", @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="발행 성공",
*
* @OA\JsonContent(
* allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="data", ref="#/components/schemas/SaleStatementIssueResponse")
* )
* }
* )
* ),
*
* @OA\Response(response=400, description="발행 불가 (미확정 상태)", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=404, description="매출 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function issueStatement() {}
/**
* @OA\Post(
* path="/api/v1/sales/{id}/statement/send",
* tags={"Sales"},
* summary="거래명세서 이메일 발송",
* description="거래명세서를 이메일로 발송합니다. 이메일 미입력 시 거래처 이메일로 발송됩니다.",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="매출 ID", @OA\Schema(type="integer")),
*
* @OA\RequestBody(
* required=false,
*
* @OA\JsonContent(ref="#/components/schemas/SaleStatementSendRequest")
* ),
*
* @OA\Response(
* response=200,
* description="발송 성공",
*
* @OA\JsonContent(
* allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="data", ref="#/components/schemas/SaleStatementSendResponse")
* )
* }
* )
* ),
*
* @OA\Response(response=400, description="발송 불가 (이메일 없음)", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=404, description="매출 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function sendStatement() {}
}