{"openapi":"3.0.1","info":{"title":"Card Issue API v2","description":"API для выпуска банковских карт с поддержкой доставки.\n\nЭто основной сервис-оркестратор, который координирует работу:\n- User API - для управления пользователями\n- Branch API - для проверки отделений\n- Card Issue Operation API v3 - для обработки заявок на выпуск карт\n\n## Основные возможности:\n- Создание заявки на выпуск карты с указанием способа доставки\n- Получение информации о заявке по ID\n- Получение всех заявок клиента\n- Обновление статуса заявки\n\n## Варианты доставки (обязательно):\n- **toBranch** - доставка в отделение банка (указать ID отделения)\n- **courier** - курьерская доставка (адрес, получатель, дата, время)\n\n## Правила курьерской доставки:\n- Дата: от завтра до +7 дней\n- Время: слот 4 часа, с 09:00 до 21:00\n- Получатель: существующий userId ИЛИ новое третье лицо\n\n## Статусы заявки:\n- **CREATED** - заявка создана\n- **PROCESSING** - заявка в обработке\n- **PLASTIC_READY** - пластик готов (только для пластиковых карт)\n- **READY** - карта готова к использованию\n- **FAILED** - ошибка при обработке заявки\n","contact":{"name":"Alfa Campus QA","email":"campus-qa@alfabank.ru"},"version":"2.0"},"servers":[{"url":"http://alfa-campus-qa.ru/rest/practice/cards","description":"Generated server url"}],"paths":{"/api/v1/card-issue":{"post":{"tags":["card-issue-controller"],"operationId":"createCardIssueRequest","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardIssueRequestDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CardIssueResponseDto"}}}}}}},"/api/v1/card-issue/{id}/status":{"patch":{"tags":["card-issue-controller"],"operationId":"updateStatus","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStatusRequestDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CardIssueResponseDto"}}}}}}},"/api/v1/card-issue/{id}":{"get":{"tags":["card-issue-controller"],"operationId":"getRequestById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}}}}}},"/api/v1/card-issue/client/{clientId}":{"get":{"tags":["card-issue-controller"],"operationId":"getRequestsByClient","parameters":[{"name":"clientId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"type":"object","additionalProperties":{"type":"object"}}}}}}}}}},"components":{"schemas":{"AddressDto":{"required":["building","city","country","region","street"],"type":"object","properties":{"country":{"maxLength":150,"minLength":0,"type":"string"},"region":{"maxLength":150,"minLength":0,"type":"string"},"city":{"maxLength":150,"minLength":0,"type":"string"},"street":{"maxLength":150,"minLength":0,"type":"string"},"building":{"maxLength":150,"minLength":0,"type":"string"},"apartment":{"maxLength":150,"minLength":0,"type":"string"}}},"CardHolderDto":{"required":["nameless"],"type":"object","properties":{"userId":{"pattern":"^X[A-Z0-9]{5}$","type":"string"},"nameless":{"type":"boolean"},"embossedName":{"maxLength":150,"minLength":0,"pattern":"^[A-Z\\s]*$","type":"string"},"user":{"$ref":"#/components/schemas/UserDto"}}},"CardIssueRequestBodyDto":{"required":["cardHolder","cardOwner","formFactor"],"type":"object","properties":{"cardOwner":{"pattern":"^X[A-Z0-9]{5}$","type":"string"},"formFactor":{"type":"string","enum":["VIRTUAL","PLASTIC"]},"cardHolder":{"$ref":"#/components/schemas/CardHolderDto"},"options":{"$ref":"#/components/schemas/OptionsDto"},"delivery":{"$ref":"#/components/schemas/DeliveryDto"}}},"CardIssueRequestDto":{"required":["request"],"type":"object","properties":{"request":{"$ref":"#/components/schemas/CardIssueRequestBodyDto"}}},"ContactInfoDto":{"required":["email","phone"],"type":"object","properties":{"phone":{"pattern":"^7\\d{10}$","type":"string"},"email":{"maxLength":150,"minLength":0,"type":"string"}}},"CourierAddressDto":{"required":["building","city","country","region","street"],"type":"object","properties":{"country":{"maxLength":150,"minLength":0,"type":"string","description":"Страна","example":"Россия"},"region":{"maxLength":150,"minLength":0,"type":"string","description":"Регион","example":"Московская область"},"city":{"maxLength":150,"minLength":0,"type":"string","description":"Город","example":"Москва"},"street":{"maxLength":150,"minLength":0,"type":"string","description":"Улица","example":"Ленина"},"building":{"maxLength":150,"minLength":0,"type":"string","description":"Дом","example":"1"},"apartment":{"maxLength":150,"minLength":0,"type":"string","description":"Квартира (опционально)","example":"25"}},"description":"Адрес курьерской доставки"},"CourierDto":{"required":["address","date","recipient","timeSlot"],"type":"object","properties":{"address":{"$ref":"#/components/schemas/CourierAddressDto"},"recipient":{"$ref":"#/components/schemas/RecipientDto"},"date":{"pattern":"^\\d{2}-\\d{2}-\\d{4}$","type":"string","description":"Дата доставки (dd-MM-yyyy)","example":"25-12-2025"},"timeSlot":{"$ref":"#/components/schemas/TimeSlotDto"}},"description":"Курьерская доставка"},"DeliveryDto":{"type":"object","properties":{"toBranch":{"$ref":"#/components/schemas/ToBranchDto"},"courier":{"$ref":"#/components/schemas/CourierDto"}},"description":"Способ доставки карты (обязательно для PLASTIC, запрещено для VIRTUAL)"},"OptionsDto":{"type":"object","properties":{"smsNotifications":{"$ref":"#/components/schemas/SmsNotificationsDto"}}},"PassportDataDto":{"required":["birthDate","birthPlace","issueDate","number","series"],"type":"object","properties":{"birthDate":{"pattern":"^\\d{2}-\\d{2}-\\d{4}$","type":"string"},"birthPlace":{"maxLength":150,"minLength":0,"type":"string"},"issueDate":{"pattern":"^\\d{2}-\\d{2}-\\d{4}$","type":"string"},"series":{"pattern":"^\\d{4}$","type":"string"},"number":{"pattern":"^\\d{6}$","type":"string"}}},"RecipientContactInfoDto":{"required":["phone"],"type":"object","properties":{"phone":{"pattern":"^7\\d{10}$","type":"string","description":"Телефон (7XXXXXXXXXX)","example":"79287746363"}},"description":"Контактная информация получателя"},"RecipientDto":{"type":"object","properties":{"userId":{"pattern":"^[A-Z][A-Z0-9]{5}$","type":"string","description":"ID существующего пользователя","example":"XAAAHX"},"user":{"$ref":"#/components/schemas/RecipientUserDto"}},"description":"Получатель карты"},"RecipientUserDto":{"required":["contactInfo","firstName","lastName"],"type":"object","properties":{"firstName":{"maxLength":150,"minLength":0,"type":"string","description":"Имя","example":"Иван"},"middleName":{"maxLength":150,"minLength":0,"type":"string","description":"Отчество (опционально)","example":"Иванович"},"lastName":{"maxLength":150,"minLength":0,"type":"string","description":"Фамилия","example":"Иванов"},"contactInfo":{"$ref":"#/components/schemas/RecipientContactInfoDto"}},"description":"Данные получателя (третье лицо)"},"SmsNotificationsDto":{"type":"object","properties":{"phoneNumber":{"pattern":"^7\\d{10}$","type":"string"},"userId":{"pattern":"^X[A-Z0-9]{5}$","type":"string"}}},"TimeSlotDto":{"required":["from","to"],"type":"object","properties":{"from":{"pattern":"^([01]?[0-9]|2[0-3]):[0-5][0-9]$","type":"string","description":"Начало интервала (HH:mm)","example":"09:00"},"to":{"pattern":"^([01]?[0-9]|2[0-3]):[0-5][0-9]$","type":"string","description":"Конец интервала (HH:mm)","example":"13:00"}},"description":"Временной слот доставки"},"ToBranchDto":{"required":["id"],"type":"object","properties":{"id":{"pattern":"^\\d{4}$","type":"string","description":"ID отделения (4 цифры)","example":"0130"}},"description":"Доставка в отделение банка"},"UserDto":{"required":["account","actualAddress","bankruptEntrepreneur","bankruptIndividual","clientType","contactInfo","embossingName","firstName","gender","lastName","managerPin","passportData","registrationAddress"],"type":"object","properties":{"firstName":{"maxLength":150,"minLength":0,"type":"string"},"middleName":{"maxLength":150,"minLength":0,"type":"string"},"lastName":{"maxLength":150,"minLength":0,"type":"string"},"gender":{"type":"string","enum":["MALE","FEMALE"]},"clientType":{"pattern":"^(UP|FL|IP)$","type":"string"},"bankruptIndividual":{"type":"boolean"},"bankruptEntrepreneur":{"type":"boolean"},"contactInfo":{"$ref":"#/components/schemas/ContactInfoDto"},"embossingName":{"maxLength":150,"minLength":0,"pattern":"^[A-Z\\s]+$","type":"string"},"passportData":{"$ref":"#/components/schemas/PassportDataDto"},"actualAddress":{"$ref":"#/components/schemas/AddressDto"},"registrationAddress":{"$ref":"#/components/schemas/AddressDto"},"account":{"pattern":"^(RUR|USD|EUR)$","type":"string"},"managerPin":{"maxLength":20,"minLength":0,"pattern":"^[A-Z]_[A-Z0-9]{4}$","type":"string"}}},"CardIssueResponseDto":{"type":"object","properties":{"requestId":{"type":"string"},"status":{"type":"string"},"statusCode":{"type":"string"},"failureReason":{"type":"string"}}},"UpdateStatusRequestDto":{"required":["status"],"type":"object","properties":{"status":{"pattern":"^(CREATED|PROCESSING|READY|PLASTIC_READY|FAILED)$","type":"string"}}}}}}