Skip to content

Commit 1b2321c

Browse files
authored
feat: add PATCH and DELETE handling for /v3/transactions/{id} (#842)
1 parent 4308b38 commit 1b2321c

18 files changed

+829
-108
lines changed

api/docs.go

Lines changed: 102 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,6 +2823,7 @@ const docTemplate = `{
28232823
"Transactions"
28242824
],
28252825
"summary": "Get transaction",
2826+
"deprecated": true,
28262827
"parameters": [
28272828
{
28282829
"type": "string",
@@ -2865,6 +2866,7 @@ const docTemplate = `{
28652866
"Transactions"
28662867
],
28672868
"summary": "Delete transaction",
2869+
"deprecated": true,
28682870
"parameters": [
28692871
{
28702872
"type": "string",
@@ -2904,6 +2906,7 @@ const docTemplate = `{
29042906
"Transactions"
29052907
],
29062908
"summary": "Allowed HTTP verbs",
2909+
"deprecated": true,
29072910
"parameters": [
29082911
{
29092912
"type": "string",
@@ -2949,6 +2952,7 @@ const docTemplate = `{
29492952
"Transactions"
29502953
],
29512954
"summary": "Update transaction",
2955+
"deprecated": true,
29522956
"parameters": [
29532957
{
29542958
"type": "string",
@@ -3951,13 +3955,13 @@ const docTemplate = `{
39513955
"400": {
39523956
"description": "Bad Request",
39533957
"schema": {
3954-
"$ref": "#/definitions/httperrors.HTTPError"
3958+
"$ref": "#/definitions/controllers.TransactionListResponseV3"
39553959
}
39563960
},
39573961
"500": {
39583962
"description": "Internal Server Error",
39593963
"schema": {
3960-
"$ref": "#/definitions/httperrors.HTTPError"
3964+
"$ref": "#/definitions/controllers.TransactionListResponseV3"
39613965
}
39623966
}
39633967
}
@@ -4051,6 +4055,45 @@ const docTemplate = `{
40514055
"$ref": "#/definitions/controllers.TransactionResponseV3"
40524056
}
40534057
},
4058+
"400": {
4059+
"description": "Bad Request",
4060+
"schema": {
4061+
"$ref": "#/definitions/controllers.TransactionResponseV3"
4062+
}
4063+
},
4064+
"404": {
4065+
"description": "Not Found",
4066+
"schema": {
4067+
"$ref": "#/definitions/controllers.TransactionResponseV3"
4068+
}
4069+
},
4070+
"500": {
4071+
"description": "Internal Server Error",
4072+
"schema": {
4073+
"$ref": "#/definitions/controllers.TransactionResponseV3"
4074+
}
4075+
}
4076+
}
4077+
},
4078+
"delete": {
4079+
"description": "Deletes a transaction",
4080+
"tags": [
4081+
"Transactions"
4082+
],
4083+
"summary": "Delete transaction",
4084+
"parameters": [
4085+
{
4086+
"type": "string",
4087+
"description": "ID formatted as string",
4088+
"name": "transactionId",
4089+
"in": "path",
4090+
"required": true
4091+
}
4092+
],
4093+
"responses": {
4094+
"204": {
4095+
"description": "No Content"
4096+
},
40544097
"400": {
40554098
"description": "Bad Request",
40564099
"schema": {
@@ -4109,6 +4152,63 @@ const docTemplate = `{
41094152
}
41104153
}
41114154
}
4155+
},
4156+
"patch": {
4157+
"description": "Updates an existing transaction. Only values to be updated need to be specified.",
4158+
"consumes": [
4159+
"application/json"
4160+
],
4161+
"produces": [
4162+
"application/json"
4163+
],
4164+
"tags": [
4165+
"Transactions"
4166+
],
4167+
"summary": "Update transaction",
4168+
"parameters": [
4169+
{
4170+
"type": "string",
4171+
"description": "ID formatted as string",
4172+
"name": "transactionId",
4173+
"in": "path",
4174+
"required": true
4175+
},
4176+
{
4177+
"description": "Transaction",
4178+
"name": "transaction",
4179+
"in": "body",
4180+
"required": true,
4181+
"schema": {
4182+
"$ref": "#/definitions/models.TransactionCreate"
4183+
}
4184+
}
4185+
],
4186+
"responses": {
4187+
"200": {
4188+
"description": "OK",
4189+
"schema": {
4190+
"$ref": "#/definitions/controllers.TransactionResponseV3"
4191+
}
4192+
},
4193+
"400": {
4194+
"description": "Bad Request",
4195+
"schema": {
4196+
"$ref": "#/definitions/controllers.TransactionResponseV3"
4197+
}
4198+
},
4199+
"404": {
4200+
"description": "Not Found",
4201+
"schema": {
4202+
"$ref": "#/definitions/controllers.TransactionResponseV3"
4203+
}
4204+
},
4205+
"500": {
4206+
"description": "Internal Server Error",
4207+
"schema": {
4208+
"$ref": "#/definitions/controllers.TransactionResponseV3"
4209+
}
4210+
}
4211+
}
41124212
}
41134213
},
41144214
"/version": {

api/swagger.json

Lines changed: 102 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,6 +2812,7 @@
28122812
"Transactions"
28132813
],
28142814
"summary": "Get transaction",
2815+
"deprecated": true,
28152816
"parameters": [
28162817
{
28172818
"type": "string",
@@ -2854,6 +2855,7 @@
28542855
"Transactions"
28552856
],
28562857
"summary": "Delete transaction",
2858+
"deprecated": true,
28572859
"parameters": [
28582860
{
28592861
"type": "string",
@@ -2893,6 +2895,7 @@
28932895
"Transactions"
28942896
],
28952897
"summary": "Allowed HTTP verbs",
2898+
"deprecated": true,
28962899
"parameters": [
28972900
{
28982901
"type": "string",
@@ -2938,6 +2941,7 @@
29382941
"Transactions"
29392942
],
29402943
"summary": "Update transaction",
2944+
"deprecated": true,
29412945
"parameters": [
29422946
{
29432947
"type": "string",
@@ -3940,13 +3944,13 @@
39403944
"400": {
39413945
"description": "Bad Request",
39423946
"schema": {
3943-
"$ref": "#/definitions/httperrors.HTTPError"
3947+
"$ref": "#/definitions/controllers.TransactionListResponseV3"
39443948
}
39453949
},
39463950
"500": {
39473951
"description": "Internal Server Error",
39483952
"schema": {
3949-
"$ref": "#/definitions/httperrors.HTTPError"
3953+
"$ref": "#/definitions/controllers.TransactionListResponseV3"
39503954
}
39513955
}
39523956
}
@@ -4040,6 +4044,45 @@
40404044
"$ref": "#/definitions/controllers.TransactionResponseV3"
40414045
}
40424046
},
4047+
"400": {
4048+
"description": "Bad Request",
4049+
"schema": {
4050+
"$ref": "#/definitions/controllers.TransactionResponseV3"
4051+
}
4052+
},
4053+
"404": {
4054+
"description": "Not Found",
4055+
"schema": {
4056+
"$ref": "#/definitions/controllers.TransactionResponseV3"
4057+
}
4058+
},
4059+
"500": {
4060+
"description": "Internal Server Error",
4061+
"schema": {
4062+
"$ref": "#/definitions/controllers.TransactionResponseV3"
4063+
}
4064+
}
4065+
}
4066+
},
4067+
"delete": {
4068+
"description": "Deletes a transaction",
4069+
"tags": [
4070+
"Transactions"
4071+
],
4072+
"summary": "Delete transaction",
4073+
"parameters": [
4074+
{
4075+
"type": "string",
4076+
"description": "ID formatted as string",
4077+
"name": "transactionId",
4078+
"in": "path",
4079+
"required": true
4080+
}
4081+
],
4082+
"responses": {
4083+
"204": {
4084+
"description": "No Content"
4085+
},
40434086
"400": {
40444087
"description": "Bad Request",
40454088
"schema": {
@@ -4098,6 +4141,63 @@
40984141
}
40994142
}
41004143
}
4144+
},
4145+
"patch": {
4146+
"description": "Updates an existing transaction. Only values to be updated need to be specified.",
4147+
"consumes": [
4148+
"application/json"
4149+
],
4150+
"produces": [
4151+
"application/json"
4152+
],
4153+
"tags": [
4154+
"Transactions"
4155+
],
4156+
"summary": "Update transaction",
4157+
"parameters": [
4158+
{
4159+
"type": "string",
4160+
"description": "ID formatted as string",
4161+
"name": "transactionId",
4162+
"in": "path",
4163+
"required": true
4164+
},
4165+
{
4166+
"description": "Transaction",
4167+
"name": "transaction",
4168+
"in": "body",
4169+
"required": true,
4170+
"schema": {
4171+
"$ref": "#/definitions/models.TransactionCreate"
4172+
}
4173+
}
4174+
],
4175+
"responses": {
4176+
"200": {
4177+
"description": "OK",
4178+
"schema": {
4179+
"$ref": "#/definitions/controllers.TransactionResponseV3"
4180+
}
4181+
},
4182+
"400": {
4183+
"description": "Bad Request",
4184+
"schema": {
4185+
"$ref": "#/definitions/controllers.TransactionResponseV3"
4186+
}
4187+
},
4188+
"404": {
4189+
"description": "Not Found",
4190+
"schema": {
4191+
"$ref": "#/definitions/controllers.TransactionResponseV3"
4192+
}
4193+
},
4194+
"500": {
4195+
"description": "Internal Server Error",
4196+
"schema": {
4197+
"$ref": "#/definitions/controllers.TransactionResponseV3"
4198+
}
4199+
}
4200+
}
41014201
}
41024202
},
41034203
"/version": {

0 commit comments

Comments
 (0)