Skip to content

Commit 473f511

Browse files
committed
Update swagger
1 parent bd94f49 commit 473f511

File tree

3 files changed

+183
-230
lines changed

3 files changed

+183
-230
lines changed

api/docs/docs.go

Lines changed: 67 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,29 +2363,29 @@ const docTemplate = `{
23632363
}
23642364
}
23652365
},
2366-
"/users/subscription/invoices": {
2367-
"get": {
2366+
"/users/subscription/invoices/{subscriptionInvoiceID}": {
2367+
"post": {
23682368
"security": [
23692369
{
23702370
"ApiKeyAuth": []
23712371
}
23722372
],
2373-
"description": "Subscription invoices are generated throughout the lifecycle of a subscription, typically there is one at the time of purchase and then one for each renewal.",
2373+
"description": "Generates a new invoice PDF file for the given subscription payment with given parameters.",
23742374
"consumes": [
23752375
"application/json"
23762376
],
23772377
"produces": [
2378-
"application/json"
2378+
"application/pdf"
23792379
],
23802380
"tags": [
23812381
"Users"
23822382
],
2383-
"summary": "Get the last 10 subscription invoices.",
2383+
"summary": "Generate a subscription invoice",
23842384
"responses": {
23852385
"200": {
23862386
"description": "OK",
23872387
"schema": {
2388-
"$ref": "#/definitions/responses.UserInvoicesResponse"
2388+
"type": "file"
23892389
}
23902390
},
23912391
"400": {
@@ -2415,29 +2415,29 @@ const docTemplate = `{
24152415
}
24162416
}
24172417
},
2418-
"/users/subscription/invoices/{subscriptionInvoiceID}": {
2419-
"post": {
2418+
"/users/subscription/payments": {
2419+
"get": {
24202420
"security": [
24212421
{
24222422
"ApiKeyAuth": []
24232423
}
24242424
],
2425-
"description": "Generates a new invoice for the given subscription with given parameters.",
2425+
"description": "Subscription payments are generated throughout the lifecycle of a subscription, typically there is one at the time of purchase and then one for each renewal.",
24262426
"consumes": [
24272427
"application/json"
24282428
],
24292429
"produces": [
2430-
"application/pdf"
2430+
"application/json"
24312431
],
24322432
"tags": [
24332433
"Users"
24342434
],
2435-
"summary": "Generate a subscription invoice",
2435+
"summary": "Get the last 10 subscription payments.",
24362436
"responses": {
24372437
"200": {
24382438
"description": "OK",
24392439
"schema": {
2440-
"type": "file"
2440+
"$ref": "#/definitions/responses.UserSubscriptionPaymentsResponse"
24412441
}
24422442
},
24432443
"400": {
@@ -4318,27 +4318,6 @@ const docTemplate = `{
43184318
}
43194319
}
43204320
},
4321-
"responses.UserInvoicesResponse": {
4322-
"type": "object",
4323-
"required": [
4324-
"data",
4325-
"message",
4326-
"status"
4327-
],
4328-
"properties": {
4329-
"data": {
4330-
"$ref": "#/definitions/responses.subscriptionInvoicesAPIResponse"
4331-
},
4332-
"message": {
4333-
"type": "string",
4334-
"example": "Request handled successfully"
4335-
},
4336-
"status": {
4337-
"type": "string",
4338-
"example": "success"
4339-
}
4340-
}
4341-
},
43424321
"responses.UserResponse": {
43434322
"type": "object",
43444323
"required": [
@@ -4360,56 +4339,13 @@ const docTemplate = `{
43604339
}
43614340
}
43624341
},
4363-
"responses.WebhookResponse": {
4342+
"responses.UserSubscriptionPaymentsResponse": {
43644343
"type": "object",
43654344
"required": [
43664345
"data",
43674346
"message",
43684347
"status"
43694348
],
4370-
"properties": {
4371-
"data": {
4372-
"$ref": "#/definitions/entities.Webhook"
4373-
},
4374-
"message": {
4375-
"type": "string",
4376-
"example": "Request handled successfully"
4377-
},
4378-
"status": {
4379-
"type": "string",
4380-
"example": "success"
4381-
}
4382-
}
4383-
},
4384-
"responses.WebhooksResponse": {
4385-
"type": "object",
4386-
"required": [
4387-
"data",
4388-
"message",
4389-
"status"
4390-
],
4391-
"properties": {
4392-
"data": {
4393-
"type": "array",
4394-
"items": {
4395-
"$ref": "#/definitions/entities.Webhook"
4396-
}
4397-
},
4398-
"message": {
4399-
"type": "string",
4400-
"example": "Request handled successfully"
4401-
},
4402-
"status": {
4403-
"type": "string",
4404-
"example": "success"
4405-
}
4406-
}
4407-
},
4408-
"responses.subscriptionInvoicesAPIResponse": {
4409-
"type": "object",
4410-
"required": [
4411-
"data"
4412-
],
44134349
"properties": {
44144350
"data": {
44154351
"type": "array",
@@ -4450,9 +4386,7 @@ const docTemplate = `{
44504386
"total",
44514387
"total_formatted",
44524388
"total_usd",
4453-
"updated_at",
4454-
"user_email",
4455-
"user_name"
4389+
"updated_at"
44564390
],
44574391
"properties": {
44584392
"billing_reason": {
@@ -4533,12 +4467,6 @@ const docTemplate = `{
45334467
},
45344468
"updated_at": {
45354469
"type": "string"
4536-
},
4537-
"user_email": {
4538-
"type": "string"
4539-
},
4540-
"user_name": {
4541-
"type": "string"
45424470
}
45434471
}
45444472
},
@@ -4550,6 +4478,59 @@ const docTemplate = `{
45504478
}
45514479
}
45524480
}
4481+
},
4482+
"message": {
4483+
"type": "string",
4484+
"example": "Request handled successfully"
4485+
},
4486+
"status": {
4487+
"type": "string",
4488+
"example": "success"
4489+
}
4490+
}
4491+
},
4492+
"responses.WebhookResponse": {
4493+
"type": "object",
4494+
"required": [
4495+
"data",
4496+
"message",
4497+
"status"
4498+
],
4499+
"properties": {
4500+
"data": {
4501+
"$ref": "#/definitions/entities.Webhook"
4502+
},
4503+
"message": {
4504+
"type": "string",
4505+
"example": "Request handled successfully"
4506+
},
4507+
"status": {
4508+
"type": "string",
4509+
"example": "success"
4510+
}
4511+
}
4512+
},
4513+
"responses.WebhooksResponse": {
4514+
"type": "object",
4515+
"required": [
4516+
"data",
4517+
"message",
4518+
"status"
4519+
],
4520+
"properties": {
4521+
"data": {
4522+
"type": "array",
4523+
"items": {
4524+
"$ref": "#/definitions/entities.Webhook"
4525+
}
4526+
},
4527+
"message": {
4528+
"type": "string",
4529+
"example": "Request handled successfully"
4530+
},
4531+
"status": {
4532+
"type": "string",
4533+
"example": "success"
45534534
}
45544535
}
45554536
}

0 commit comments

Comments
 (0)