From bc4c3cba90abab55b0bfc223b6f7e3a0dbec8fb0 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Thu, 25 Jun 2026 23:11:22 +0100 Subject: [PATCH] il: Update for 'Individuals Losses' API version 7.0 Signed-off-by: Andrew Clayton --- README.rst | 2 +- src/endpoints.h | 2 +- src/mtd-cli-il.c | 47 ++++++++++++++++++++++ src/mtd-cli-ilos.c | 98 ---------------------------------------------- src/mtd-cli.c | 2 +- 5 files changed, 50 insertions(+), 101 deletions(-) create mode 100644 src/mtd-cli-il.c delete mode 100644 src/mtd-cli-ilos.c diff --git a/README.rst b/README.rst index e64edfa..2faa83e 100644 --- a/README.rst +++ b/README.rst @@ -55,7 +55,7 @@ It has a fairly straightforward interface, essentially :: - mtd-cli init|init-creds|init-oauth|init-nino|bd|biss|bsas|cisd|ic|ical|icgi|id|idi|ie|iei|ifi|iipi|ilos|ioi|ipi|ir|isb|isi|itla|ob|od|pb|saa|saass|said|seb|vat|test_cu|test_fph|test_sa + mtd-cli init|init-creds|init-oauth|init-nino|bd|biss|bsas|cisd|ic|ical|icgi|id|idi|ie|iei|ifi|iipi|il|ioi|ipi|ir|isb|isi|itla|ob|od|pb|saa|saass|said|seb|vat|test_cu|test_fph|test_sa The first argument specifies the API to interface with diff --git a/src/endpoints.h b/src/endpoints.h index 6e491c4..c286918 100644 --- a/src/endpoints.h +++ b/src/endpoints.h @@ -22,7 +22,7 @@ extern const struct _endpoint ie_endpoint; extern const struct _endpoint iei_endpoint; extern const struct _endpoint ifi_endpoint; extern const struct _endpoint iipi_endpoint; -extern const struct _endpoint ilos_endpoint; +extern const struct _endpoint il_endpoint; extern const struct _endpoint ioi_endpoint; extern const struct _endpoint ipi_endpoint; extern const struct _endpoint ir_endpoint; diff --git a/src/mtd-cli-il.c b/src/mtd-cli-il.c new file mode 100644 index 0000000..8767006 --- /dev/null +++ b/src/mtd-cli-il.c @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +/* + * mtd-cli-il.c - Make Tax Digital - Individuals Losses + * + * Copyright (C) 2020 - 2026 Andrew Clayton + */ + +#include + +#include + +#include "mtd-cli.h" + +#define API il + +#define API_NAME "Individuals Losses" +#define CMDS \ +"get amend delete\n\n"\ + +static const struct endpoint endpoints[] = { + { + .name = "get", + .api_ep = MTD_API_EP_IL_GET, + .nr_req_args = 2, + .args = "businessId taxYear" + }, { + .name = "amend", + .api_ep = MTD_API_EP_IL_AMEND, + .nr_req_args = 3, + .file_data = true, + .args = " businessId taxYear" + }, { + .name = "delete", + .api_ep = MTD_API_EP_IL_DELETE, + .nr_req_args = 2, + .args = "businessId taxYear" + }, + + { } +}; + +const struct _endpoint ENDPOINT = { + .endpoints = endpoints, + .api_name = API_NAME, + .cmds = CMDS +}; diff --git a/src/mtd-cli-ilos.c b/src/mtd-cli-ilos.c deleted file mode 100644 index 1ce826c..0000000 --- a/src/mtd-cli-ilos.c +++ /dev/null @@ -1,98 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ - -/* - * mtd-cli-ilos.c - Make Tax Digital - Individual Loses - * - * Copyright (C) 2020 - 2026 Andrew Clayton - */ - -#include - -#include - -#include "mtd-cli.h" - -#define API ilos - -#define API_NAME "Individual Loses" -#define CMDS \ -"Brought Forward Losses\n\n"\ -"bf-list bf-create bf-get bf-delete bf-update-amnt\n\n"\ -"Loss Claims\n\n"\ -"lc-list lc-create lc-get lc-delete lc-update-type lc-update-order" - -static const struct endpoint endpoints[] = { - /* Brought Forward Loses */ - { - .name = "bf-list", - .api_ep = MTD_API_EP_ILOS_BF_LIST, - .nr_req_args = 1, - .args = "taxYearBroughtForwardFrom [[businessId=][,[typeOfLoss={self-employment,uk-property-fhl,uk-property,foreign-property-fhl-eea,foreign-property}]]]" - }, { - .name = "bf-create", - .api_ep = MTD_API_EP_ILOS_BF_CREATE, - .nr_req_args = 2, - .file_data = true, - .args = " taxYear" - }, { - .name = "bf-get", - .api_ep = MTD_API_EP_ILOS_BF_GET, - .nr_req_args = 1, - .args = "lossId" - }, { - .name = "bf-delete", - .api_ep = MTD_API_EP_ILOS_BF_DELETE, - .nr_req_args = 2, - .args = "lossId taxYear" - }, { - .name = "bf-update-amnt", - .api_ep = MTD_API_EP_ILOS_BF_AMEND_AMNT, - .nr_req_args = 3, - .file_data = true, - .args = " lossId taxYear" - }, - /* Loss Claims */ - { - .name = "lc-list", - .api_ep = MTD_API_EP_ILOS_LC_LIST, - .nr_req_args = 1, - .args = "taxYearClaimedFor [[businessId=][,[typeOfLoss={self-employment,uk-property,foreign-property}][,[typeOfClaim={carry-forward,carry-sideways}]]]]" - }, { - .name = "lc-create", - .api_ep = MTD_API_EP_ILOS_LC_CREATE, - .nr_req_args = 1, - .file_data = true, - .args = "" - }, { - .name = "lc-get", - .api_ep = MTD_API_EP_ILOS_LC_GET, - .nr_req_args = 1, - .args = "claimId" - }, { - .name = "lc-delete", - .api_ep = MTD_API_EP_ILOS_LC_DELETE, - .nr_req_args = 2, - .args = "claimId taxYearClaimedFor" - }, { - .name = "lc-update-type", - .api_ep = MTD_API_EP_ILOS_LC_AMEND_TYPE, - .nr_req_args = 3, - .file_data = true, - .args = " claimId taxYearClaimedFor" - }, - { - .name = "lc-update-order", - .api_ep = MTD_API_EP_ILOS_LC_AMEND_ORDER, - .nr_req_args = 2, - .file_data = true, - .args = " taxYearClaimedFor" - }, - - { } -}; - -const struct _endpoint ENDPOINT = { - .endpoints = endpoints, - .api_name = API_NAME, - .cmds = CMDS -}; diff --git a/src/mtd-cli.c b/src/mtd-cli.c index a68dcf7..2d46eb5 100644 --- a/src/mtd-cli.c +++ b/src/mtd-cli.c @@ -53,7 +53,7 @@ static const struct api_ep { EP_MAP_ENT(iei), EP_MAP_ENT(ifi), EP_MAP_ENT(iipi), - EP_MAP_ENT(ilos), + EP_MAP_ENT(il), EP_MAP_ENT(ioi), EP_MAP_ENT(ipi), EP_MAP_ENT(ir),