{"openapi":"3.0.1","info":{"title":"Card Issue Operation API v3","description":"API для обработки операций выпуска карт с поддержкой доставки.\n\n## Основные возможности:\n- Создание операции выпуска карты с указанием доставки\n- Получение операции по ID\n- Поиск операций по владельцу карты (cardOwner)\n- Поиск операций по держателю карты (cardHolder)\n- Обновление статуса операции\n\n## Варианты доставки:\n- **toBranch** - доставка в отделение банка\n- **courier** - курьерская доставка\n\n## Статусы операции:\n- **CREATED** - операция создана\n- **PROCESSING** - операция в обработке\n- **PLASTIC_READY** - пластик готов (только для PLASTIC)\n- **READY** - карта готова\n- **FAILED** - ошибка\n\n## Автоматические переходы статусов:\nСтатусы автоматически переходят по расписанию:\n- CREATED -> PROCESSING (через 30 сек)\n- PROCESSING -> READY/PLASTIC_READY (через 30 сек)\n- PLASTIC_READY -> READY (через 30 сек)\n","contact":{"name":"Alfa Campus QA","email":"campus-qa@alfabank.ru"},"version":"3.0"},"servers":[{"url":"http://alfa-campus-qa.ru/rest/practice/cards/operation-api","description":"Generated server url"}],"paths":{"/api/v1/operations":{"post":{"tags":["card-issue-operation-controller"],"operationId":"createRequest","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCardIssueRequestDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CardIssueResponseDto"}}}}}}},"/api/v1/operations/{id}/status":{"patch":{"tags":["card-issue-operation-controller"],"operationId":"updateStatus","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStatusDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CardIssueResponseDto"}}}}}}},"/api/v1/operations/{id}":{"get":{"tags":["card-issue-operation-controller"],"operationId":"getRequestById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CardIssueResponseDto"}}}}}}},"/api/v1/operations/by-owner/{cardOwner}":{"get":{"tags":["card-issue-operation-controller"],"operationId":"getRequestsByCardOwner","parameters":[{"name":"cardOwner","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CardIssueResponseDto"}}}}}}}},"/api/v1/operations/by-holder/{userId}":{"get":{"tags":["card-issue-operation-controller"],"operationId":"getRequestsByCardHolder","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CardIssueResponseDto"}}}}}}}}},"components":{"schemas":{"CreateCardIssueRequestDto":{"type":"object","properties":{"cardOwner":{"type":"string"},"formFactor":{"type":"string","enum":["VIRTUAL","PLASTIC"]},"cardHolderUserId":{"type":"string"},"nameless":{"type":"boolean"},"embossedName":{"type":"string"},"smsPhoneNumber":{"type":"string"},"smsUserId":{"type":"string"},"failed":{"type":"boolean"},"failureReason":{"type":"string"},"newClientRegistration":{"type":"boolean"},"deliveryType":{"type":"string"},"deliveryBranchId":{"type":"string"},"courierCountry":{"type":"string"},"courierRegion":{"type":"string"},"courierCity":{"type":"string"},"courierStreet":{"type":"string"},"courierBuilding":{"type":"string"},"courierApartment":{"type":"string"},"recipientUserId":{"type":"string"},"recipientFirstName":{"type":"string"},"recipientMiddleName":{"type":"string"},"recipientLastName":{"type":"string"},"recipientPhone":{"type":"string"},"deliveryDate":{"type":"string","format":"date"},"timeSlotFrom":{"type":"string"},"timeSlotTo":{"type":"string"}}},"AddressDto":{"type":"object","properties":{"country":{"type":"string"},"region":{"type":"string"},"city":{"type":"string"},"street":{"type":"string"},"building":{"type":"string"},"apartment":{"type":"string"}}},"CardHolderDto":{"type":"object","properties":{"userId":{"type":"string"},"nameless":{"type":"boolean"},"embossedName":{"type":"string"}}},"CardIssueResponseDto":{"type":"object","properties":{"id":{"type":"string"},"cardOwner":{"type":"string"},"formFactor":{"type":"string","enum":["VIRTUAL","PLASTIC"]},"cardHolder":{"$ref":"#/components/schemas/CardHolderDto"},"options":{"$ref":"#/components/schemas/OptionsDto"},"delivery":{"$ref":"#/components/schemas/DeliveryDto"},"status":{"type":"string"},"statusCode":{"type":"string"},"failureReason":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CourierDto":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/AddressDto"},"recipient":{"$ref":"#/components/schemas/RecipientDto"},"date":{"type":"string","format":"date"},"timeSlot":{"$ref":"#/components/schemas/TimeSlotDto"}}},"DeliveryDto":{"type":"object","properties":{"toBranch":{"$ref":"#/components/schemas/ToBranchDto"},"courier":{"$ref":"#/components/schemas/CourierDto"}}},"OptionsDto":{"type":"object","properties":{"smsNotifications":{"$ref":"#/components/schemas/SmsNotificationsDto"}}},"RecipientContactInfoDto":{"type":"object","properties":{"phone":{"type":"string"}}},"RecipientDto":{"type":"object","properties":{"userId":{"type":"string"},"user":{"$ref":"#/components/schemas/RecipientUserDto"}}},"RecipientUserDto":{"type":"object","properties":{"firstName":{"type":"string"},"middleName":{"type":"string"},"lastName":{"type":"string"},"contactInfo":{"$ref":"#/components/schemas/RecipientContactInfoDto"}}},"SmsNotificationsDto":{"type":"object","properties":{"phoneNumber":{"type":"string"},"userId":{"type":"string"}}},"TimeSlotDto":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}}},"ToBranchDto":{"type":"object","properties":{"id":{"type":"string"}}},"UpdateStatusDto":{"type":"object","properties":{"status":{"type":"string"}}}}}}