Skip to content

Commit 5144c27

Browse files
authored
fix: accept archived parameter on resource creation for accounts, categories, envelopes (#883)
1 parent 378b475 commit 5144c27

15 files changed

+552
-175
lines changed

api/docs.go

Lines changed: 112 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4037,7 +4037,7 @@ const docTemplate = `{
40374037
"schema": {
40384038
"type": "array",
40394039
"items": {
4040-
"$ref": "#/definitions/models.AccountCreate"
4040+
"$ref": "#/definitions/controllers.AccountCreateV3"
40414041
}
40424042
}
40434043
}
@@ -4232,7 +4232,7 @@ const docTemplate = `{
42324232
"in": "body",
42334233
"required": true,
42344234
"schema": {
4235-
"$ref": "#/definitions/models.AccountCreate"
4235+
"$ref": "#/definitions/controllers.AccountCreateV3"
42364236
}
42374237
}
42384238
],
@@ -4659,7 +4659,7 @@ const docTemplate = `{
46594659
"schema": {
46604660
"type": "array",
46614661
"items": {
4662-
"$ref": "#/definitions/models.CategoryCreate"
4662+
"$ref": "#/definitions/controllers.CategoryCreateV3"
46634663
}
46644664
}
46654665
}
@@ -4854,7 +4854,7 @@ const docTemplate = `{
48544854
"in": "body",
48554855
"required": true,
48564856
"schema": {
4857-
"$ref": "#/definitions/models.CategoryCreate"
4857+
"$ref": "#/definitions/controllers.CategoryCreateV3"
48584858
}
48594859
}
48604860
],
@@ -4979,7 +4979,7 @@ const docTemplate = `{
49794979
"schema": {
49804980
"type": "array",
49814981
"items": {
4982-
"$ref": "#/definitions/models.EnvelopeCreate"
4982+
"$ref": "#/definitions/controllers.EnvelopeCreateV3"
49834983
}
49844984
}
49854985
}
@@ -5174,7 +5174,7 @@ const docTemplate = `{
51745174
"in": "body",
51755175
"required": true,
51765176
"schema": {
5177-
"$ref": "#/definitions/models.EnvelopeCreate"
5177+
"$ref": "#/definitions/controllers.EnvelopeCreateV3"
51785178
}
51795179
}
51805180
],
@@ -6523,6 +6523,60 @@ const docTemplate = `{
65236523
}
65246524
}
65256525
},
6526+
"controllers.AccountCreateV3": {
6527+
"type": "object",
6528+
"properties": {
6529+
"archived": {
6530+
"description": "Is the account archived?",
6531+
"type": "boolean",
6532+
"default": false,
6533+
"example": true
6534+
},
6535+
"budgetId": {
6536+
"description": "ID of the budget this account belongs to",
6537+
"type": "string",
6538+
"example": "550dc009-cea6-4c12-b2a5-03446eb7b7cf"
6539+
},
6540+
"external": {
6541+
"description": "Does the account belong to the budget owner or not?",
6542+
"type": "boolean",
6543+
"default": false,
6544+
"example": false
6545+
},
6546+
"importHash": {
6547+
"description": "The SHA256 hash of a unique combination of values to use in duplicate detection",
6548+
"type": "string",
6549+
"example": "867e3a26dc0baf73f4bff506f31a97f6c32088917e9e5cf1a5ed6f3f84a6fa70"
6550+
},
6551+
"initialBalance": {
6552+
"description": "Balance of the account before any transactions were recorded",
6553+
"type": "number",
6554+
"default": 0,
6555+
"example": 173.12
6556+
},
6557+
"initialBalanceDate": {
6558+
"description": "Date of the initial balance",
6559+
"type": "string",
6560+
"example": "2017-05-12T00:00:00Z"
6561+
},
6562+
"name": {
6563+
"description": "Name of the account",
6564+
"type": "string",
6565+
"example": "Cash"
6566+
},
6567+
"note": {
6568+
"description": "A longer description for the account",
6569+
"type": "string",
6570+
"example": "Money in my wallet"
6571+
},
6572+
"onBudget": {
6573+
"description": "Does the account factor into the available budget? Always false when external: true",
6574+
"type": "boolean",
6575+
"default": false,
6576+
"example": true
6577+
}
6578+
}
6579+
},
65266580
"controllers.AccountListResponse": {
65276581
"type": "object",
65286582
"properties": {
@@ -7158,6 +7212,32 @@ const docTemplate = `{
71587212
}
71597213
}
71607214
},
7215+
"controllers.CategoryCreateV3": {
7216+
"type": "object",
7217+
"properties": {
7218+
"archived": {
7219+
"description": "Is the category hidden?",
7220+
"type": "boolean",
7221+
"default": false,
7222+
"example": true
7223+
},
7224+
"budgetId": {
7225+
"description": "ID of the budget the category belongs to",
7226+
"type": "string",
7227+
"example": "52d967d3-33f4-4b04-9ba7-772e5ab9d0ce"
7228+
},
7229+
"name": {
7230+
"description": "Name of the category",
7231+
"type": "string",
7232+
"example": "Saving"
7233+
},
7234+
"note": {
7235+
"description": "Notes about the category",
7236+
"type": "string",
7237+
"example": "All envelopes for long-term saving"
7238+
}
7239+
}
7240+
},
71617241
"controllers.CategoryEnvelopesV3": {
71627242
"type": "object",
71637243
"properties": {
@@ -7467,6 +7547,32 @@ const docTemplate = `{
74677547
}
74687548
}
74697549
},
7550+
"controllers.EnvelopeCreateV3": {
7551+
"type": "object",
7552+
"properties": {
7553+
"archived": {
7554+
"description": "Is the envelope hidden?",
7555+
"type": "boolean",
7556+
"default": false,
7557+
"example": true
7558+
},
7559+
"categoryId": {
7560+
"description": "ID of the category the envelope belongs to",
7561+
"type": "string",
7562+
"example": "878c831f-af99-4a71-b3ca-80deb7d793c1"
7563+
},
7564+
"name": {
7565+
"description": "Name of the envelope",
7566+
"type": "string",
7567+
"example": "Groceries"
7568+
},
7569+
"note": {
7570+
"description": "Notes about the envelope",
7571+
"type": "string",
7572+
"example": "For stuff bought at supermarkets and drugstores"
7573+
}
7574+
}
7575+
},
74707576
"controllers.EnvelopeListResponse": {
74717577
"type": "object",
74727578
"properties": {

api/swagger.json

Lines changed: 112 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4026,7 +4026,7 @@
40264026
"schema": {
40274027
"type": "array",
40284028
"items": {
4029-
"$ref": "#/definitions/models.AccountCreate"
4029+
"$ref": "#/definitions/controllers.AccountCreateV3"
40304030
}
40314031
}
40324032
}
@@ -4221,7 +4221,7 @@
42214221
"in": "body",
42224222
"required": true,
42234223
"schema": {
4224-
"$ref": "#/definitions/models.AccountCreate"
4224+
"$ref": "#/definitions/controllers.AccountCreateV3"
42254225
}
42264226
}
42274227
],
@@ -4648,7 +4648,7 @@
46484648
"schema": {
46494649
"type": "array",
46504650
"items": {
4651-
"$ref": "#/definitions/models.CategoryCreate"
4651+
"$ref": "#/definitions/controllers.CategoryCreateV3"
46524652
}
46534653
}
46544654
}
@@ -4843,7 +4843,7 @@
48434843
"in": "body",
48444844
"required": true,
48454845
"schema": {
4846-
"$ref": "#/definitions/models.CategoryCreate"
4846+
"$ref": "#/definitions/controllers.CategoryCreateV3"
48474847
}
48484848
}
48494849
],
@@ -4968,7 +4968,7 @@
49684968
"schema": {
49694969
"type": "array",
49704970
"items": {
4971-
"$ref": "#/definitions/models.EnvelopeCreate"
4971+
"$ref": "#/definitions/controllers.EnvelopeCreateV3"
49724972
}
49734973
}
49744974
}
@@ -5163,7 +5163,7 @@
51635163
"in": "body",
51645164
"required": true,
51655165
"schema": {
5166-
"$ref": "#/definitions/models.EnvelopeCreate"
5166+
"$ref": "#/definitions/controllers.EnvelopeCreateV3"
51675167
}
51685168
}
51695169
],
@@ -6512,6 +6512,60 @@
65126512
}
65136513
}
65146514
},
6515+
"controllers.AccountCreateV3": {
6516+
"type": "object",
6517+
"properties": {
6518+
"archived": {
6519+
"description": "Is the account archived?",
6520+
"type": "boolean",
6521+
"default": false,
6522+
"example": true
6523+
},
6524+
"budgetId": {
6525+
"description": "ID of the budget this account belongs to",
6526+
"type": "string",
6527+
"example": "550dc009-cea6-4c12-b2a5-03446eb7b7cf"
6528+
},
6529+
"external": {
6530+
"description": "Does the account belong to the budget owner or not?",
6531+
"type": "boolean",
6532+
"default": false,
6533+
"example": false
6534+
},
6535+
"importHash": {
6536+
"description": "The SHA256 hash of a unique combination of values to use in duplicate detection",
6537+
"type": "string",
6538+
"example": "867e3a26dc0baf73f4bff506f31a97f6c32088917e9e5cf1a5ed6f3f84a6fa70"
6539+
},
6540+
"initialBalance": {
6541+
"description": "Balance of the account before any transactions were recorded",
6542+
"type": "number",
6543+
"default": 0,
6544+
"example": 173.12
6545+
},
6546+
"initialBalanceDate": {
6547+
"description": "Date of the initial balance",
6548+
"type": "string",
6549+
"example": "2017-05-12T00:00:00Z"
6550+
},
6551+
"name": {
6552+
"description": "Name of the account",
6553+
"type": "string",
6554+
"example": "Cash"
6555+
},
6556+
"note": {
6557+
"description": "A longer description for the account",
6558+
"type": "string",
6559+
"example": "Money in my wallet"
6560+
},
6561+
"onBudget": {
6562+
"description": "Does the account factor into the available budget? Always false when external: true",
6563+
"type": "boolean",
6564+
"default": false,
6565+
"example": true
6566+
}
6567+
}
6568+
},
65156569
"controllers.AccountListResponse": {
65166570
"type": "object",
65176571
"properties": {
@@ -7147,6 +7201,32 @@
71477201
}
71487202
}
71497203
},
7204+
"controllers.CategoryCreateV3": {
7205+
"type": "object",
7206+
"properties": {
7207+
"archived": {
7208+
"description": "Is the category hidden?",
7209+
"type": "boolean",
7210+
"default": false,
7211+
"example": true
7212+
},
7213+
"budgetId": {
7214+
"description": "ID of the budget the category belongs to",
7215+
"type": "string",
7216+
"example": "52d967d3-33f4-4b04-9ba7-772e5ab9d0ce"
7217+
},
7218+
"name": {
7219+
"description": "Name of the category",
7220+
"type": "string",
7221+
"example": "Saving"
7222+
},
7223+
"note": {
7224+
"description": "Notes about the category",
7225+
"type": "string",
7226+
"example": "All envelopes for long-term saving"
7227+
}
7228+
}
7229+
},
71507230
"controllers.CategoryEnvelopesV3": {
71517231
"type": "object",
71527232
"properties": {
@@ -7456,6 +7536,32 @@
74567536
}
74577537
}
74587538
},
7539+
"controllers.EnvelopeCreateV3": {
7540+
"type": "object",
7541+
"properties": {
7542+
"archived": {
7543+
"description": "Is the envelope hidden?",
7544+
"type": "boolean",
7545+
"default": false,
7546+
"example": true
7547+
},
7548+
"categoryId": {
7549+
"description": "ID of the category the envelope belongs to",
7550+
"type": "string",
7551+
"example": "878c831f-af99-4a71-b3ca-80deb7d793c1"
7552+
},
7553+
"name": {
7554+
"description": "Name of the envelope",
7555+
"type": "string",
7556+
"example": "Groceries"
7557+
},
7558+
"note": {
7559+
"description": "Notes about the envelope",
7560+
"type": "string",
7561+
"example": "For stuff bought at supermarkets and drugstores"
7562+
}
7563+
}
7564+
},
74597565
"controllers.EnvelopeListResponse": {
74607566
"type": "object",
74617567
"properties": {

0 commit comments

Comments
 (0)