Skip to content

Commit 6e52381

Browse files
committed
docs: add api docs for invoice PDF generation
1 parent 7d1e04f commit 6e52381

File tree

1 file changed

+98
-9
lines changed

1 file changed

+98
-9
lines changed

swagger/swagger.yaml

Lines changed: 98 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -692,16 +692,36 @@ paths:
692692
data:
693693
type: object
694694
properties:
695-
products:
696-
type: array
697-
items:
698-
type: object
699-
properties:
700-
quantity:
701-
type: number
702-
product:
695+
orders:
696+
type: object
697+
properties:
698+
_id:
699+
type: string
700+
products:
701+
type: array
702+
items:
703703
type: object
704-
'$ref': '#/components/schemas/ProductResponse'
704+
properties:
705+
quantity:
706+
type: number
707+
product:
708+
type: object
709+
'$ref': '#/components/schemas/ProductResponse'
710+
user:
711+
type: object
712+
properties:
713+
email:
714+
type: string
715+
name:
716+
type: string
717+
surname:
718+
type: string
719+
phone:
720+
type: string
721+
address:
722+
type: string
723+
userId:
724+
type: string
705725

706726
'400':
707727
description: Bad request
@@ -836,6 +856,46 @@ paths:
836856
schema:
837857
'$ref': '#/components/schemas/ServerErrorResponse'
838858

859+
/orders/invoices/{orderId}:
860+
get:
861+
summary: Generate user order invoice as pdf and download
862+
security:
863+
- Authorization: []
864+
tags:
865+
- Order
866+
parameters:
867+
- in: path
868+
name: orderId
869+
required: true
870+
description: Unique id
871+
schema:
872+
type: string
873+
minimum: 1
874+
example: 6398540ee6e5ae8c37c333ac
875+
description:
876+
responses:
877+
'200':
878+
description: OK
879+
content:
880+
application/pdf:
881+
schema:
882+
type: string
883+
format: binary
884+
885+
'400':
886+
description: Bad request
887+
content:
888+
application/json:
889+
schema:
890+
'$ref': '#/components/schemas/BadRequestResponse'
891+
892+
'500':
893+
description: 500 Internal Server Error
894+
content:
895+
application/json:
896+
schema:
897+
'$ref': '#/components/schemas/ServerErrorResponse'
898+
839899
/checkout:
840900
get:
841901
deprecated: true
@@ -1019,6 +1079,35 @@ paths:
10191079
schema:
10201080
'$ref': '#/components/schemas/ServerErrorResponse'
10211081

1082+
# filestream
1083+
/pdf-test:
1084+
get:
1085+
summary: Api for testing pdf document serve (Returns PDF file)
1086+
tags:
1087+
- PDF - filestream
1088+
responses:
1089+
'200':
1090+
description: OK
1091+
content:
1092+
application/pdf:
1093+
schema:
1094+
type: string
1095+
format: binary
1096+
1097+
'400':
1098+
description: Bad request
1099+
content:
1100+
application/json:
1101+
schema:
1102+
'$ref': '#/components/schemas/BadRequestResponse'
1103+
1104+
'500':
1105+
description: 500 Internal Server Error
1106+
content:
1107+
application/json:
1108+
schema:
1109+
'$ref': '#/components/schemas/ServerErrorResponse'
1110+
10221111
# Auth
10231112

10241113
/auth/signup:

0 commit comments

Comments
 (0)