Skip to content

Commit 762a502

Browse files
authored
feat: integrate allocations into MonthConfig in API v3 (#881)
1 parent 0d7271a commit 762a502

File tree

7 files changed

+236
-37
lines changed

7 files changed

+236
-37
lines changed

api/docs.go

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ const docTemplate = `{
460460
"Allocations"
461461
],
462462
"summary": "Get allocations",
463+
"deprecated": true,
463464
"parameters": [
464465
{
465466
"type": "string",
@@ -510,6 +511,7 @@ const docTemplate = `{
510511
"Allocations"
511512
],
512513
"summary": "Create allocations",
514+
"deprecated": true,
513515
"parameters": [
514516
{
515517
"description": "Allocation",
@@ -554,6 +556,7 @@ const docTemplate = `{
554556
"Allocations"
555557
],
556558
"summary": "Allowed HTTP verbs",
559+
"deprecated": true,
557560
"responses": {
558561
"204": {
559562
"description": "No Content"
@@ -571,6 +574,7 @@ const docTemplate = `{
571574
"Allocations"
572575
],
573576
"summary": "Get allocation",
577+
"deprecated": true,
574578
"parameters": [
575579
{
576580
"type": "string",
@@ -613,6 +617,7 @@ const docTemplate = `{
613617
"Allocations"
614618
],
615619
"summary": "Delete allocation",
620+
"deprecated": true,
616621
"parameters": [
617622
{
618623
"type": "string",
@@ -652,6 +657,7 @@ const docTemplate = `{
652657
"Allocations"
653658
],
654659
"summary": "Allowed HTTP verbs",
660+
"deprecated": true,
655661
"parameters": [
656662
{
657663
"type": "string",
@@ -697,6 +703,7 @@ const docTemplate = `{
697703
"Allocations"
698704
],
699705
"summary": "Update allocation",
706+
"deprecated": true,
700707
"parameters": [
701708
{
702709
"type": "string",
@@ -5309,7 +5316,7 @@ const docTemplate = `{
53095316
"in": "body",
53105317
"required": true,
53115318
"schema": {
5312-
"$ref": "#/definitions/models.MonthConfigCreate"
5319+
"$ref": "#/definitions/controllers.MonthConfigCreateV3"
53135320
}
53145321
}
53155322
],
@@ -7584,6 +7591,14 @@ const docTemplate = `{
75847591
"controllers.MonthConfig": {
75857592
"type": "object",
75867593
"properties": {
7594+
"allocation": {
7595+
"description": "The maximum value is \"999999999999.99999999\", swagger unfortunately rounds this.",
7596+
"type": "number",
7597+
"maximum": 1000000000000,
7598+
"minimum": 1e-8,
7599+
"multipleOf": 1e-8,
7600+
"example": 22.01
7601+
},
75877602
"createdAt": {
75887603
"description": "Time the resource was created",
75897604
"type": "string",
@@ -7641,6 +7656,24 @@ const docTemplate = `{
76417656
}
76427657
}
76437658
},
7659+
"controllers.MonthConfigCreateV3": {
7660+
"type": "object",
7661+
"properties": {
7662+
"allocation": {
7663+
"description": "The maximum value is \"999999999999.99999999\", swagger unfortunately rounds this.",
7664+
"type": "number",
7665+
"maximum": 1000000000000,
7666+
"minimum": 1e-8,
7667+
"multipleOf": 1e-8,
7668+
"example": 22.01
7669+
},
7670+
"note": {
7671+
"description": "A note for the month config",
7672+
"type": "string",
7673+
"example": "Added 200€ here because we replaced Tim's expensive vase"
7674+
}
7675+
}
7676+
},
76447677
"controllers.MonthConfigListResponse": {
76457678
"type": "object",
76467679
"properties": {
@@ -7687,6 +7720,14 @@ const docTemplate = `{
76877720
"controllers.MonthConfigV3": {
76887721
"type": "object",
76897722
"properties": {
7723+
"allocation": {
7724+
"description": "The maximum value is \"999999999999.99999999\", swagger unfortunately rounds this.",
7725+
"type": "number",
7726+
"maximum": 1000000000000,
7727+
"minimum": 1e-8,
7728+
"multipleOf": 1e-8,
7729+
"example": 22.01
7730+
},
76907731
"createdAt": {
76917732
"description": "Time the resource was created",
76927733
"type": "string",

api/swagger.json

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@
449449
"Allocations"
450450
],
451451
"summary": "Get allocations",
452+
"deprecated": true,
452453
"parameters": [
453454
{
454455
"type": "string",
@@ -499,6 +500,7 @@
499500
"Allocations"
500501
],
501502
"summary": "Create allocations",
503+
"deprecated": true,
502504
"parameters": [
503505
{
504506
"description": "Allocation",
@@ -543,6 +545,7 @@
543545
"Allocations"
544546
],
545547
"summary": "Allowed HTTP verbs",
548+
"deprecated": true,
546549
"responses": {
547550
"204": {
548551
"description": "No Content"
@@ -560,6 +563,7 @@
560563
"Allocations"
561564
],
562565
"summary": "Get allocation",
566+
"deprecated": true,
563567
"parameters": [
564568
{
565569
"type": "string",
@@ -602,6 +606,7 @@
602606
"Allocations"
603607
],
604608
"summary": "Delete allocation",
609+
"deprecated": true,
605610
"parameters": [
606611
{
607612
"type": "string",
@@ -641,6 +646,7 @@
641646
"Allocations"
642647
],
643648
"summary": "Allowed HTTP verbs",
649+
"deprecated": true,
644650
"parameters": [
645651
{
646652
"type": "string",
@@ -686,6 +692,7 @@
686692
"Allocations"
687693
],
688694
"summary": "Update allocation",
695+
"deprecated": true,
689696
"parameters": [
690697
{
691698
"type": "string",
@@ -5298,7 +5305,7 @@
52985305
"in": "body",
52995306
"required": true,
53005307
"schema": {
5301-
"$ref": "#/definitions/models.MonthConfigCreate"
5308+
"$ref": "#/definitions/controllers.MonthConfigCreateV3"
53025309
}
53035310
}
53045311
],
@@ -7573,6 +7580,14 @@
75737580
"controllers.MonthConfig": {
75747581
"type": "object",
75757582
"properties": {
7583+
"allocation": {
7584+
"description": "The maximum value is \"999999999999.99999999\", swagger unfortunately rounds this.",
7585+
"type": "number",
7586+
"maximum": 1000000000000,
7587+
"minimum": 1e-8,
7588+
"multipleOf": 1e-8,
7589+
"example": 22.01
7590+
},
75767591
"createdAt": {
75777592
"description": "Time the resource was created",
75787593
"type": "string",
@@ -7630,6 +7645,24 @@
76307645
}
76317646
}
76327647
},
7648+
"controllers.MonthConfigCreateV3": {
7649+
"type": "object",
7650+
"properties": {
7651+
"allocation": {
7652+
"description": "The maximum value is \"999999999999.99999999\", swagger unfortunately rounds this.",
7653+
"type": "number",
7654+
"maximum": 1000000000000,
7655+
"minimum": 1e-8,
7656+
"multipleOf": 1e-8,
7657+
"example": 22.01
7658+
},
7659+
"note": {
7660+
"description": "A note for the month config",
7661+
"type": "string",
7662+
"example": "Added 200€ here because we replaced Tim's expensive vase"
7663+
}
7664+
}
7665+
},
76337666
"controllers.MonthConfigListResponse": {
76347667
"type": "object",
76357668
"properties": {
@@ -7676,6 +7709,14 @@
76767709
"controllers.MonthConfigV3": {
76777710
"type": "object",
76787711
"properties": {
7712+
"allocation": {
7713+
"description": "The maximum value is \"999999999999.99999999\", swagger unfortunately rounds this.",
7714+
"type": "number",
7715+
"maximum": 1000000000000,
7716+
"minimum": 1e-8,
7717+
"multipleOf": 1e-8,
7718+
"example": 22.01
7719+
},
76797720
"createdAt": {
76807721
"description": "Time the resource was created",
76817722
"type": "string",

api/swagger.yaml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,14 @@ definitions:
10041004
type: object
10051005
controllers.MonthConfig:
10061006
properties:
1007+
allocation:
1008+
description: The maximum value is "999999999999.99999999", swagger unfortunately
1009+
rounds this.
1010+
example: 22.01
1011+
maximum: 1000000000000
1012+
minimum: 1e-08
1013+
multipleOf: 1e-08
1014+
type: number
10071015
createdAt:
10081016
description: Time the resource was created
10091017
example: "2022-04-02T19:28:44.491514Z"
@@ -1048,6 +1056,21 @@ definitions:
10481056
example: "2022-04-17T20:14:01.048145Z"
10491057
type: string
10501058
type: object
1059+
controllers.MonthConfigCreateV3:
1060+
properties:
1061+
allocation:
1062+
description: The maximum value is "999999999999.99999999", swagger unfortunately
1063+
rounds this.
1064+
example: 22.01
1065+
maximum: 1000000000000
1066+
minimum: 1e-08
1067+
multipleOf: 1e-08
1068+
type: number
1069+
note:
1070+
description: A note for the month config
1071+
example: Added 200€ here because we replaced Tim's expensive vase
1072+
type: string
1073+
type: object
10511074
controllers.MonthConfigListResponse:
10521075
properties:
10531076
data:
@@ -1076,6 +1099,14 @@ definitions:
10761099
type: object
10771100
controllers.MonthConfigV3:
10781101
properties:
1102+
allocation:
1103+
description: The maximum value is "999999999999.99999999", swagger unfortunately
1104+
rounds this.
1105+
example: 22.01
1106+
maximum: 1000000000000
1107+
minimum: 1e-08
1108+
multipleOf: 1e-08
1109+
type: number
10791110
createdAt:
10801111
description: Time the resource was created
10811112
example: "2022-04-02T19:28:44.491514Z"
@@ -2506,6 +2537,7 @@ paths:
25062537
- Accounts
25072538
/v1/allocations:
25082539
get:
2540+
deprecated: true
25092541
description: Returns a list of allocations
25102542
parameters:
25112543
- description: Filter by month
@@ -2539,6 +2571,7 @@ paths:
25392571
tags:
25402572
- Allocations
25412573
options:
2574+
deprecated: true
25422575
description: Returns an empty response with the HTTP Header "allow" set to the
25432576
allowed HTTP verbs
25442577
responses:
@@ -2548,6 +2581,7 @@ paths:
25482581
tags:
25492582
- Allocations
25502583
post:
2584+
deprecated: true
25512585
description: Create a new allocation of funds to an envelope for a specific
25522586
month
25532587
parameters:
@@ -2581,6 +2615,7 @@ paths:
25812615
- Allocations
25822616
/v1/allocations/{id}:
25832617
delete:
2618+
deprecated: true
25842619
description: Deletes an allocation
25852620
parameters:
25862621
- description: ID formatted as string
@@ -2607,6 +2642,7 @@ paths:
26072642
tags:
26082643
- Allocations
26092644
get:
2645+
deprecated: true
26102646
description: Returns a specific allocation
26112647
parameters:
26122648
- description: ID formatted as string
@@ -2637,6 +2673,7 @@ paths:
26372673
tags:
26382674
- Allocations
26392675
options:
2676+
deprecated: true
26402677
description: Returns an empty response with the HTTP Header "allow" set to the
26412678
allowed HTTP verbs
26422679
parameters:
@@ -2666,6 +2703,7 @@ paths:
26662703
patch:
26672704
consumes:
26682705
- application/json
2706+
deprecated: true
26692707
description: Update an allocation. Only values to be updated need to be specified.
26702708
parameters:
26712709
- description: ID formatted as string
@@ -5817,7 +5855,7 @@ paths:
58175855
name: monthConfig
58185856
required: true
58195857
schema:
5820-
$ref: '#/definitions/models.MonthConfigCreate'
5858+
$ref: '#/definitions/controllers.MonthConfigCreateV3'
58215859
produces:
58225860
- application/json
58235861
responses:

0 commit comments

Comments
 (0)