Skip to content

Commit 97cdba0

Browse files
committed
refactor: introduce internal.types.Month
1 parent 66d7bcf commit 97cdba0

24 files changed

+636
-581
lines changed

api/docs.go

Lines changed: 95 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -3039,6 +3039,43 @@ const docTemplate = `{
30393039
}
30403040
}
30413041
},
3042+
"controllers.CategoryEnvelopes": {
3043+
"type": "object",
3044+
"properties": {
3045+
"allocation": {
3046+
"description": "Sum of allocations for the envelopes",
3047+
"type": "number",
3048+
"example": 90
3049+
},
3050+
"balance": {
3051+
"description": "Sum of the balances of the envelopes",
3052+
"type": "number",
3053+
"example": -10.13
3054+
},
3055+
"envelopes": {
3056+
"description": "Slice of all envelopes",
3057+
"type": "array",
3058+
"items": {
3059+
"$ref": "#/definitions/models.EnvelopeMonth"
3060+
}
3061+
},
3062+
"id": {
3063+
"description": "ID of the category",
3064+
"type": "string",
3065+
"example": "dafd9a74-6aeb-46b9-9f5a-cfca624fea85"
3066+
},
3067+
"name": {
3068+
"description": "Name of the category",
3069+
"type": "string",
3070+
"example": "Rainy Day Funds"
3071+
},
3072+
"spent": {
3073+
"description": "Sum spent for all envelopes",
3074+
"type": "number",
3075+
"example": 100.13
3076+
}
3077+
}
3078+
},
30423079
"controllers.CategoryLinks": {
30433080
"type": "object",
30443081
"properties": {
@@ -3161,6 +3198,63 @@ const docTemplate = `{
31613198
}
31623199
}
31633200
},
3201+
"controllers.Month": {
3202+
"type": "object",
3203+
"properties": {
3204+
"allocation": {
3205+
"description": "The sum of all allocations for this month",
3206+
"type": "number",
3207+
"example": 1200.5
3208+
},
3209+
"available": {
3210+
"description": "The amount available to budget",
3211+
"type": "number",
3212+
"example": 217.34
3213+
},
3214+
"balance": {
3215+
"description": "The sum of all envelope balances",
3216+
"type": "number",
3217+
"example": 5231.37
3218+
},
3219+
"budgeted": {
3220+
"description": "The sum of all allocations for the month. **Deprecated, please use the ` + "`" + `allocation` + "`" + ` field**",
3221+
"type": "number",
3222+
"example": 2100
3223+
},
3224+
"categories": {
3225+
"description": "A list of envelope month calculations grouped by category",
3226+
"type": "array",
3227+
"items": {
3228+
"$ref": "#/definitions/controllers.CategoryEnvelopes"
3229+
}
3230+
},
3231+
"id": {
3232+
"description": "The ID of the Budget",
3233+
"type": "string",
3234+
"example": "1e777d24-3f5b-4c43-8000-04f65f895578"
3235+
},
3236+
"income": {
3237+
"description": "The total income for the month (sum of all incoming transactions without an Envelope)",
3238+
"type": "number",
3239+
"example": 2317.34
3240+
},
3241+
"month": {
3242+
"description": "The month",
3243+
"type": "string",
3244+
"example": "2006-05-01T00:00:00.000000Z"
3245+
},
3246+
"name": {
3247+
"description": "The name of the Budget",
3248+
"type": "string",
3249+
"example": "Zero budget"
3250+
},
3251+
"spent": {
3252+
"description": "The amount of money spent in this month",
3253+
"type": "number",
3254+
"example": 133.7
3255+
}
3256+
}
3257+
},
31643258
"controllers.MonthConfig": {
31653259
"type": "object",
31663260
"properties": {
@@ -3235,7 +3329,7 @@ const docTemplate = `{
32353329
"type": "object",
32363330
"properties": {
32373331
"data": {
3238-
"$ref": "#/definitions/models.Month"
3332+
"$ref": "#/definitions/controllers.Month"
32393333
}
32403334
}
32413335
},
@@ -3441,7 +3535,6 @@ const docTemplate = `{
34413535
"example": 2317.34
34423536
},
34433537
"month": {
3444-
"description": "This is always set to 00:00 UTC on the first of the month.",
34453538
"type": "string",
34463539
"example": "2006-05-01T00:00:00.000000Z"
34473540
},
@@ -3474,43 +3567,6 @@ const docTemplate = `{
34743567
}
34753568
}
34763569
},
3477-
"models.CategoryEnvelopes": {
3478-
"type": "object",
3479-
"properties": {
3480-
"allocation": {
3481-
"description": "Sum of allocations for the envelopes",
3482-
"type": "number",
3483-
"example": 90
3484-
},
3485-
"balance": {
3486-
"description": "Sum of the balances of the envelopes",
3487-
"type": "number",
3488-
"example": -10.13
3489-
},
3490-
"envelopes": {
3491-
"description": "Slice of all envelopes",
3492-
"type": "array",
3493-
"items": {
3494-
"$ref": "#/definitions/models.EnvelopeMonth"
3495-
}
3496-
},
3497-
"id": {
3498-
"description": "ID of the category",
3499-
"type": "string",
3500-
"example": "dafd9a74-6aeb-46b9-9f5a-cfca624fea85"
3501-
},
3502-
"name": {
3503-
"description": "Name of the category",
3504-
"type": "string",
3505-
"example": "Rainy Day Funds"
3506-
},
3507-
"spent": {
3508-
"description": "Sum spent for all envelopes",
3509-
"type": "number",
3510-
"example": 100.13
3511-
}
3512-
}
3513-
},
35143570
"models.Envelope": {
35153571
"type": "object",
35163572
"properties": {
@@ -3616,63 +3672,6 @@ const docTemplate = `{
36163672
}
36173673
}
36183674
},
3619-
"models.Month": {
3620-
"type": "object",
3621-
"properties": {
3622-
"allocation": {
3623-
"description": "The sum of all allocations for this month",
3624-
"type": "number",
3625-
"example": 1200.5
3626-
},
3627-
"available": {
3628-
"description": "The amount available to budget",
3629-
"type": "number",
3630-
"example": 217.34
3631-
},
3632-
"balance": {
3633-
"description": "The sum of all envelope balances",
3634-
"type": "number",
3635-
"example": 5231.37
3636-
},
3637-
"budgeted": {
3638-
"description": "The sum of all allocations for the month. **Deprecated, please use the ` + "`" + `allocation` + "`" + ` field**",
3639-
"type": "number",
3640-
"example": 2100
3641-
},
3642-
"categories": {
3643-
"description": "A list of envelope month calculations grouped by category",
3644-
"type": "array",
3645-
"items": {
3646-
"$ref": "#/definitions/models.CategoryEnvelopes"
3647-
}
3648-
},
3649-
"id": {
3650-
"description": "The ID of the Budget",
3651-
"type": "string",
3652-
"example": "1e777d24-3f5b-4c43-8000-04f65f895578"
3653-
},
3654-
"income": {
3655-
"description": "The total income for the month (sum of all incoming transactions without an Envelope)",
3656-
"type": "number",
3657-
"example": 2317.34
3658-
},
3659-
"month": {
3660-
"description": "This is always set to 00:00 UTC on the first of the month.",
3661-
"type": "string",
3662-
"example": "2006-05-01T00:00:00.000000Z"
3663-
},
3664-
"name": {
3665-
"description": "The name of the Budget",
3666-
"type": "string",
3667-
"example": "Zero budget"
3668-
},
3669-
"spent": {
3670-
"description": "The amount of money spent in this month",
3671-
"type": "number",
3672-
"example": 133.7
3673-
}
3674-
}
3675-
},
36763675
"models.MonthConfigCreate": {
36773676
"type": "object",
36783677
"properties": {

0 commit comments

Comments
 (0)