Skip to content

Commit 0d7271a

Browse files
authored
fix: Add the missing archived field to Envelope, Category, and Account responses (#879)
This adds the field that was missing so far and removes the "hidden" field as documented. It also improves tests to ensure fields are set correctly. Some small API documentation fixes are also included in this commit, mainly fixing wrong resource names due to copy-pasting.
1 parent cd582db commit 0d7271a

17 files changed

+358
-129
lines changed

api/docs.go

Lines changed: 75 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3973,13 +3973,13 @@ const docTemplate = `{
39733973
},
39743974
{
39753975
"type": "integer",
3976-
"description": "The offset of the first Transaction returned. Defaults to 0.",
3976+
"description": "The offset of the first Account returned. Defaults to 0.",
39773977
"name": "offset",
39783978
"in": "query"
39793979
},
39803980
{
39813981
"type": "integer",
3982-
"description": "Maximum number of transactions to return. Defaults to 50.",
3982+
"description": "Maximum number of Accounts to return. Defaults to 50.",
39833983
"name": "limit",
39843984
"in": "query"
39853985
}
@@ -4284,6 +4284,18 @@ const docTemplate = `{
42844284
"description": "Search for this text in name and note",
42854285
"name": "search",
42864286
"in": "query"
4287+
},
4288+
{
4289+
"type": "integer",
4290+
"description": "The offset of the first Budget returned. Defaults to 0.",
4291+
"name": "offset",
4292+
"in": "query"
4293+
},
4294+
{
4295+
"type": "integer",
4296+
"description": "Maximum number of Budgets to return. Defaults to 50.",
4297+
"name": "limit",
4298+
"in": "query"
42874299
}
42884300
],
42894301
"responses": {
@@ -5899,7 +5911,7 @@ const docTemplate = `{
58995911
},
59005912
{
59015913
"type": "integer",
5902-
"description": "Maximum number of transactions to return. Defaults to 50.",
5914+
"description": "Maximum number of Transactions to return. Defaults to 50.",
59035915
"name": "limit",
59045916
"in": "query"
59055917
}
@@ -6204,6 +6216,12 @@ const docTemplate = `{
62046216
"controllers.Account": {
62056217
"type": "object",
62066218
"properties": {
6219+
"archived": {
6220+
"description": "Is the account archived?",
6221+
"type": "boolean",
6222+
"default": false,
6223+
"example": true
6224+
},
62076225
"balance": {
62086226
"description": "Balance of the account, including all transactions referencing it",
62096227
"type": "number",
@@ -6395,6 +6413,12 @@ const docTemplate = `{
63956413
"controllers.AccountV3": {
63966414
"type": "object",
63976415
"properties": {
6416+
"archived": {
6417+
"description": "Is the account archived?",
6418+
"type": "boolean",
6419+
"default": false,
6420+
"example": true
6421+
},
63986422
"balance": {
63996423
"description": "Balance of the account, including all transactions referencing it",
64006424
"type": "number",
@@ -6422,10 +6446,8 @@ const docTemplate = `{
64226446
"example": false
64236447
},
64246448
"hidden": {
6425-
"description": "Is the account archived?",
6426-
"type": "boolean",
6427-
"default": false,
6428-
"example": true
6449+
"description": "Remove the hidden field",
6450+
"type": "boolean"
64296451
},
64306452
"id": {
64316453
"description": "UUID for the resource",
@@ -6867,6 +6889,12 @@ const docTemplate = `{
68676889
"controllers.Category": {
68686890
"type": "object",
68696891
"properties": {
6892+
"archived": {
6893+
"description": "Is the Category archived?",
6894+
"type": "boolean",
6895+
"default": false,
6896+
"example": true
6897+
},
68706898
"budgetId": {
68716899
"description": "ID of the budget the category belongs to",
68726900
"type": "string",
@@ -7020,6 +7048,12 @@ const docTemplate = `{
70207048
"controllers.CategoryV3": {
70217049
"type": "object",
70227050
"properties": {
7051+
"archived": {
7052+
"description": "Is the Category archived?",
7053+
"type": "boolean",
7054+
"default": false,
7055+
"example": true
7056+
},
70237057
"budgetId": {
70247058
"description": "ID of the budget the category belongs to",
70257059
"type": "string",
@@ -7043,10 +7077,8 @@ const docTemplate = `{
70437077
}
70447078
},
70457079
"hidden": {
7046-
"description": "Is the category hidden?",
7047-
"type": "boolean",
7048-
"default": false,
7049-
"example": true
7080+
"description": "Remove the hidden field",
7081+
"type": "boolean"
70507082
},
70517083
"id": {
70527084
"description": "UUID for the resource",
@@ -7088,6 +7120,12 @@ const docTemplate = `{
70887120
"controllers.Envelope": {
70897121
"type": "object",
70907122
"properties": {
7123+
"archived": {
7124+
"description": "Is the Envelope archived?",
7125+
"type": "boolean",
7126+
"default": false,
7127+
"example": true
7128+
},
70917129
"categoryId": {
70927130
"description": "ID of the category the envelope belongs to",
70937131
"type": "string",
@@ -7258,6 +7296,12 @@ const docTemplate = `{
72587296
"controllers.EnvelopeV3": {
72597297
"type": "object",
72607298
"properties": {
7299+
"archived": {
7300+
"description": "Is the Envelope archived?",
7301+
"type": "boolean",
7302+
"default": false,
7303+
"example": true
7304+
},
72617305
"categoryId": {
72627306
"description": "ID of the category the envelope belongs to",
72637307
"type": "string",
@@ -7274,10 +7318,8 @@ const docTemplate = `{
72747318
"example": "2022-04-22T21:01:05.058161Z"
72757319
},
72767320
"hidden": {
7277-
"description": "Is the envelope hidden?",
7278-
"type": "boolean",
7279-
"default": false,
7280-
"example": true
7321+
"description": "Remove the hidden field",
7322+
"type": "boolean"
72817323
},
72827324
"id": {
72837325
"description": "UUID for the resource",
@@ -8431,6 +8473,12 @@ const docTemplate = `{
84318473
"type": "number",
84328474
"example": 90
84338475
},
8476+
"archived": {
8477+
"description": "Is the Category archived?",
8478+
"type": "boolean",
8479+
"default": false,
8480+
"example": true
8481+
},
84348482
"balance": {
84358483
"description": "Sum of the balances of the envelopes",
84368484
"type": "number",
@@ -8494,6 +8542,12 @@ const docTemplate = `{
84948542
"models.Envelope": {
84958543
"type": "object",
84968544
"properties": {
8545+
"archived": {
8546+
"description": "Is the Envelope archived?",
8547+
"type": "boolean",
8548+
"default": false,
8549+
"example": true
8550+
},
84978551
"categoryId": {
84988552
"description": "ID of the category the envelope belongs to",
84998553
"type": "string",
@@ -8571,6 +8625,12 @@ const docTemplate = `{
85718625
"type": "number",
85728626
"example": 85.44
85738627
},
8628+
"archived": {
8629+
"description": "Is the Envelope archived?",
8630+
"type": "boolean",
8631+
"default": false,
8632+
"example": true
8633+
},
85748634
"balance": {
85758635
"description": "The balance at the end of the monht",
85768636
"type": "number",

api/swagger.json

Lines changed: 75 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3962,13 +3962,13 @@
39623962
},
39633963
{
39643964
"type": "integer",
3965-
"description": "The offset of the first Transaction returned. Defaults to 0.",
3965+
"description": "The offset of the first Account returned. Defaults to 0.",
39663966
"name": "offset",
39673967
"in": "query"
39683968
},
39693969
{
39703970
"type": "integer",
3971-
"description": "Maximum number of transactions to return. Defaults to 50.",
3971+
"description": "Maximum number of Accounts to return. Defaults to 50.",
39723972
"name": "limit",
39733973
"in": "query"
39743974
}
@@ -4273,6 +4273,18 @@
42734273
"description": "Search for this text in name and note",
42744274
"name": "search",
42754275
"in": "query"
4276+
},
4277+
{
4278+
"type": "integer",
4279+
"description": "The offset of the first Budget returned. Defaults to 0.",
4280+
"name": "offset",
4281+
"in": "query"
4282+
},
4283+
{
4284+
"type": "integer",
4285+
"description": "Maximum number of Budgets to return. Defaults to 50.",
4286+
"name": "limit",
4287+
"in": "query"
42764288
}
42774289
],
42784290
"responses": {
@@ -5888,7 +5900,7 @@
58885900
},
58895901
{
58905902
"type": "integer",
5891-
"description": "Maximum number of transactions to return. Defaults to 50.",
5903+
"description": "Maximum number of Transactions to return. Defaults to 50.",
58925904
"name": "limit",
58935905
"in": "query"
58945906
}
@@ -6193,6 +6205,12 @@
61936205
"controllers.Account": {
61946206
"type": "object",
61956207
"properties": {
6208+
"archived": {
6209+
"description": "Is the account archived?",
6210+
"type": "boolean",
6211+
"default": false,
6212+
"example": true
6213+
},
61966214
"balance": {
61976215
"description": "Balance of the account, including all transactions referencing it",
61986216
"type": "number",
@@ -6384,6 +6402,12 @@
63846402
"controllers.AccountV3": {
63856403
"type": "object",
63866404
"properties": {
6405+
"archived": {
6406+
"description": "Is the account archived?",
6407+
"type": "boolean",
6408+
"default": false,
6409+
"example": true
6410+
},
63876411
"balance": {
63886412
"description": "Balance of the account, including all transactions referencing it",
63896413
"type": "number",
@@ -6411,10 +6435,8 @@
64116435
"example": false
64126436
},
64136437
"hidden": {
6414-
"description": "Is the account archived?",
6415-
"type": "boolean",
6416-
"default": false,
6417-
"example": true
6438+
"description": "Remove the hidden field",
6439+
"type": "boolean"
64186440
},
64196441
"id": {
64206442
"description": "UUID for the resource",
@@ -6856,6 +6878,12 @@
68566878
"controllers.Category": {
68576879
"type": "object",
68586880
"properties": {
6881+
"archived": {
6882+
"description": "Is the Category archived?",
6883+
"type": "boolean",
6884+
"default": false,
6885+
"example": true
6886+
},
68596887
"budgetId": {
68606888
"description": "ID of the budget the category belongs to",
68616889
"type": "string",
@@ -7009,6 +7037,12 @@
70097037
"controllers.CategoryV3": {
70107038
"type": "object",
70117039
"properties": {
7040+
"archived": {
7041+
"description": "Is the Category archived?",
7042+
"type": "boolean",
7043+
"default": false,
7044+
"example": true
7045+
},
70127046
"budgetId": {
70137047
"description": "ID of the budget the category belongs to",
70147048
"type": "string",
@@ -7032,10 +7066,8 @@
70327066
}
70337067
},
70347068
"hidden": {
7035-
"description": "Is the category hidden?",
7036-
"type": "boolean",
7037-
"default": false,
7038-
"example": true
7069+
"description": "Remove the hidden field",
7070+
"type": "boolean"
70397071
},
70407072
"id": {
70417073
"description": "UUID for the resource",
@@ -7077,6 +7109,12 @@
70777109
"controllers.Envelope": {
70787110
"type": "object",
70797111
"properties": {
7112+
"archived": {
7113+
"description": "Is the Envelope archived?",
7114+
"type": "boolean",
7115+
"default": false,
7116+
"example": true
7117+
},
70807118
"categoryId": {
70817119
"description": "ID of the category the envelope belongs to",
70827120
"type": "string",
@@ -7247,6 +7285,12 @@
72477285
"controllers.EnvelopeV3": {
72487286
"type": "object",
72497287
"properties": {
7288+
"archived": {
7289+
"description": "Is the Envelope archived?",
7290+
"type": "boolean",
7291+
"default": false,
7292+
"example": true
7293+
},
72507294
"categoryId": {
72517295
"description": "ID of the category the envelope belongs to",
72527296
"type": "string",
@@ -7263,10 +7307,8 @@
72637307
"example": "2022-04-22T21:01:05.058161Z"
72647308
},
72657309
"hidden": {
7266-
"description": "Is the envelope hidden?",
7267-
"type": "boolean",
7268-
"default": false,
7269-
"example": true
7310+
"description": "Remove the hidden field",
7311+
"type": "boolean"
72707312
},
72717313
"id": {
72727314
"description": "UUID for the resource",
@@ -8420,6 +8462,12 @@
84208462
"type": "number",
84218463
"example": 90
84228464
},
8465+
"archived": {
8466+
"description": "Is the Category archived?",
8467+
"type": "boolean",
8468+
"default": false,
8469+
"example": true
8470+
},
84238471
"balance": {
84248472
"description": "Sum of the balances of the envelopes",
84258473
"type": "number",
@@ -8483,6 +8531,12 @@
84838531
"models.Envelope": {
84848532
"type": "object",
84858533
"properties": {
8534+
"archived": {
8535+
"description": "Is the Envelope archived?",
8536+
"type": "boolean",
8537+
"default": false,
8538+
"example": true
8539+
},
84868540
"categoryId": {
84878541
"description": "ID of the category the envelope belongs to",
84888542
"type": "string",
@@ -8560,6 +8614,12 @@
85608614
"type": "number",
85618615
"example": 85.44
85628616
},
8617+
"archived": {
8618+
"description": "Is the Envelope archived?",
8619+
"type": "boolean",
8620+
"default": false,
8621+
"example": true
8622+
},
85638623
"balance": {
85648624
"description": "The balance at the end of the monht",
85658625
"type": "number",

0 commit comments

Comments
 (0)