diff --git a/pom.xml b/pom.xml
index f6eb2d0..767ca4c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,6 +21,7 @@
UTF-8
3.3.4
3.3.4
+ 6.0.21
3.0.20
2.24.1
3.4.2
@@ -67,6 +68,11 @@
structured-logging
${structured-logging.version}
+
+ uk.gov.companieshouse
+ api-sdk-java
+ ${api-sdk-java.version}
+
diff --git a/spec/schema.json b/spec/schema.json
index 759b260..32fcc52 100644
--- a/spec/schema.json
+++ b/spec/schema.json
@@ -1,32 +1,91 @@
{
- "swagger": "2.0",
+ "openapi": "3.0.1",
"info": {
"title": "Companies House - Limited Partnerships API",
- "description": "An API to allow the registration, transition and update of limited partnerships",
+ "description": "An API to allow the registration, transition and update of Limited Partnerships",
"version": "1.0.0"
},
- "host": "api.companieshouse.gov.uk",
+ "servers": [
+ {
+ "url": "https://api.companieshouse.gov.uk/"
+ }
+ ],
"tags": [
{
"name": "Limited Partnerships"
}
],
"paths": {
+ "/transactions/{transaction_id}/limited-partnership/partnership": {
+ "post": {
+ "tags": [
+ "Limited Partnership"
+ ],
+ "summary": "Create a Limited Partnership submission",
+ "parameters": [
+ {
+ "name": "transaction_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Limited Partnership Submission has been successfully created.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LimitedPartnershipSubmissionCreatedResponse"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request"
+ },
+ "401": {
+ "description": "Unauthorised"
+ },
+ "500": {
+ "description": "Internal Server Error"
+ }
+ }
+ }
+ },
"/limited-partnership/healthcheck": {
"get": {
"summary": "Health check URL returns 200 if service is running",
- "produces": [
- "application/json"
- ],
"tags": [
- "Limited Partnerships"
+ "Limited Partnership"
],
"responses": {
"200": {
- "description": "Request has been received"
+ "description": "Request has been received",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "LimitedPartnershipSubmissionCreatedResponse": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
}
}
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/uk/gov/companieshouse/limitedpartnershipsapi/controller/PartnershipController.java b/src/main/java/uk/gov/companieshouse/limitedpartnershipsapi/controller/PartnershipController.java
new file mode 100644
index 0000000..61f1a40
--- /dev/null
+++ b/src/main/java/uk/gov/companieshouse/limitedpartnershipsapi/controller/PartnershipController.java
@@ -0,0 +1,30 @@
+package uk.gov.companieshouse.limitedpartnershipsapi.controller;
+
+import jakarta.servlet.http.HttpServletRequest;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import uk.gov.companieshouse.limitedpartnershipsapi.model.dto.LimitedPartnershipSubmissionCreatedResponseDto;
+import uk.gov.companieshouse.limitedpartnershipsapi.utils.ApiLogger;
+
+import java.net.URI;
+
+import static uk.gov.companieshouse.limitedpartnershipsapi.utils.Constants.URL_PARAM_TRANSACTION_ID;
+
+@RestController
+@RequestMapping("/transactions/{" + URL_PARAM_TRANSACTION_ID + "}/limited-partnership/partnership")
+public class PartnershipController {
+
+ @PostMapping
+ public ResponseEntity