swagger3 project.yml 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566
  1. openapi: 3.0.1
  2. info:
  3. title: Project API
  4. description: |
  5. Latihan Project API
  6. - CRUD Project
  7. - Platform Relationship
  8. - Auth
  9. - Membership & Ownership
  10. - Rights & Paging
  11. - Bug
  12. version: 6.0.0
  13. servers:
  14. - url: http://localhost:8080/api/v1
  15. tags:
  16. - name: projects
  17. description: everything project
  18. - name: platforms
  19. description: everything platform
  20. - name: users
  21. description: everything user
  22. - name: bugs
  23. description: everything bug
  24. - name: comments
  25. description: everything comment
  26. - name: maintenance
  27. description: everything maintenance
  28. paths:
  29. /projects:
  30. get:
  31. tags:
  32. - projects
  33. summary: find all project
  34. description: return all project
  35. operationId: getProject
  36. parameters:
  37. - $ref: '#/components/parameters/page'
  38. - $ref: '#/components/parameters/limit'
  39. - name: sort
  40. in: query
  41. description: sort direction (default 'project_id, desc')
  42. schema:
  43. type: string
  44. responses:
  45. 200:
  46. $ref: '#/components/responses/getArrayProject'
  47. 400:
  48. $ref: '#/components/responses/400'
  49. 401:
  50. $ref: '#/components/responses/UnauthorizedError'
  51. security:
  52. - testAuth: []
  53. post:
  54. tags:
  55. - projects
  56. summary: Add new Project
  57. description: Add new Project
  58. operationId: addProject
  59. requestBody:
  60. $ref: '#/components/requestBodies/Project'
  61. responses:
  62. 201:
  63. $ref: '#/components/responses/successAddProject'
  64. 400:
  65. $ref: '#/components/responses/400'
  66. 401:
  67. $ref: '#/components/responses/UnauthorizedError'
  68. 409:
  69. $ref: '#/components/responses/409'
  70. 413:
  71. $ref: '#/components/responses/413'
  72. security:
  73. - testAuth: []
  74. /projects/{projectId}:
  75. get:
  76. tags:
  77. - projects
  78. summary: find project by ID
  79. description: return project
  80. operationId: getProjectById
  81. parameters:
  82. - $ref: '#/components/parameters/projectPath'
  83. responses:
  84. 200:
  85. $ref: '#/components/responses/getSingleProject'
  86. 401:
  87. $ref: '#/components/responses/UnauthorizedError'
  88. 403:
  89. $ref: '#/components/responses/403'
  90. 404:
  91. $ref: '#/components/responses/404'
  92. security:
  93. - testAuth: []
  94. put:
  95. tags:
  96. - projects
  97. summary: update existing project by ID
  98. description: update project
  99. operationId: updateProjectById
  100. parameters:
  101. - $ref: '#/components/parameters/projectPath'
  102. requestBody:
  103. $ref: '#/components/requestBodies/Project'
  104. responses:
  105. 200:
  106. $ref: '#/components/responses/getSingleProject'
  107. 400:
  108. $ref: '#/components/responses/400'
  109. 401:
  110. $ref: '#/components/responses/UnauthorizedError'
  111. 403:
  112. $ref: '#/components/responses/403'
  113. 404:
  114. $ref: '#/components/responses/404'
  115. 409:
  116. $ref: '#/components/responses/409'
  117. 413:
  118. $ref: '#/components/responses/413'
  119. security:
  120. - testAuth: []
  121. delete:
  122. tags:
  123. - projects
  124. summary: Deletes a project
  125. description: delete a project
  126. operationId: deleteProject
  127. parameters:
  128. - $ref: '#/components/parameters/projectPath'
  129. responses:
  130. 200:
  131. description: successful operation
  132. 205:
  133. description: Unable to delete. Data is used.
  134. 401:
  135. $ref: '#/components/responses/UnauthorizedError'
  136. 403:
  137. $ref: '#/components/responses/403'
  138. security:
  139. - testAuth: []
  140. /projects/{projectId}/member:
  141. get:
  142. tags:
  143. - projects
  144. summary: find all member by project
  145. description: return all member by project
  146. operationId: getMemberByProject
  147. parameters:
  148. - $ref: '#/components/parameters/projectPath'
  149. - $ref: '#/components/parameters/roleQuery'
  150. - $ref: '#/components/parameters/page'
  151. - $ref: '#/components/parameters/limit'
  152. - $ref: '#/components/parameters/sortQuery'
  153. responses:
  154. 200:
  155. $ref: '#/components/responses/getArrayMember'
  156. 400:
  157. $ref: '#/components/responses/400'
  158. 401:
  159. $ref: '#/components/responses/UnauthorizedError'
  160. security:
  161. - testAuth: []
  162. post:
  163. tags:
  164. - projects
  165. summary: add project member
  166. description: add project member
  167. operationId: addProjectMember
  168. parameters:
  169. - $ref: '#/components/parameters/projectPath'
  170. requestBody:
  171. $ref: '#/components/requestBodies/ProjectMember'
  172. responses:
  173. 201:
  174. $ref: '#/components/responses/successAddMember'
  175. 400:
  176. $ref: '#/components/responses/400'
  177. 401:
  178. $ref: '#/components/responses/UnauthorizedError'
  179. 403:
  180. $ref: '#/components/responses/403'
  181. 404:
  182. $ref: '#/components/responses/404'
  183. 409:
  184. $ref: '#/components/responses/409'
  185. security:
  186. - testAuth: []
  187. /projects/member/{memberId}:
  188. get:
  189. tags:
  190. - projects
  191. summary: find member by ID
  192. description: return member by ID
  193. operationId: getMemberProject
  194. parameters:
  195. - $ref: '#/components/parameters/memberPath'
  196. responses:
  197. 200:
  198. $ref: '#/components/responses/getSingleMember'
  199. 401:
  200. $ref: '#/components/responses/UnauthorizedError'
  201. security:
  202. - testAuth: []
  203. delete:
  204. tags:
  205. - projects
  206. summary: delete project member
  207. description: delete project member
  208. operationId: deleteProjectMember
  209. parameters:
  210. - $ref: '#/components/parameters/memberPath'
  211. responses:
  212. 200:
  213. description: successful operation
  214. 401:
  215. $ref: '#/components/responses/UnauthorizedError'
  216. 403:
  217. $ref: '#/components/responses/403'
  218. 404:
  219. $ref: '#/components/responses/404'
  220. security:
  221. - testAuth: []
  222. /projects/{projectId}/bug:
  223. get:
  224. tags:
  225. - projects
  226. summary: find all bugs of a project
  227. description: return all bugs of a project
  228. operationId: getBugByProjectId
  229. parameters:
  230. - $ref: '#/components/parameters/projectPath'
  231. - $ref: '#/components/parameters/page'
  232. - $ref: '#/components/parameters/limit'
  233. - name: sort
  234. in: query
  235. description: sort direction (default 'bug_id, desc')
  236. schema:
  237. type: string
  238. responses:
  239. 200:
  240. $ref: '#/components/responses/getArrayBug'
  241. 400:
  242. $ref: '#/components/responses/400'
  243. 401:
  244. $ref: '#/components/responses/UnauthorizedError'
  245. security:
  246. - testAuth: []
  247. /platforms:
  248. get:
  249. tags:
  250. - platforms
  251. summary: find all platform of a project
  252. description: return all platform of a project
  253. operationId: getPlatformByProjectId
  254. parameters:
  255. - $ref: '#/components/parameters/projectQuery'
  256. - $ref: '#/components/parameters/page'
  257. - $ref: '#/components/parameters/limit'
  258. - name: sort
  259. in: query
  260. description: sort direction (default 'platform_id, desc')
  261. schema:
  262. type: string
  263. responses:
  264. 200:
  265. $ref: '#/components/responses/getArrayPlatform'
  266. 400:
  267. $ref: '#/components/responses/400'
  268. 401:
  269. $ref: '#/components/responses/UnauthorizedError'
  270. security:
  271. - testAuth: []
  272. post:
  273. tags:
  274. - platforms
  275. summary: Add new platform for a project
  276. description: add new platform for a project
  277. operationId: addPlatformByProjectId
  278. requestBody:
  279. $ref: '#/components/requestBodies/Platform'
  280. responses:
  281. 201:
  282. $ref: '#/components/responses/successAddPlatform'
  283. 400:
  284. $ref: '#/components/responses/400'
  285. 401:
  286. $ref: '#/components/responses/UnauthorizedError'
  287. 403:
  288. $ref: '#/components/responses/403'
  289. 404:
  290. $ref: '#/components/responses/404'
  291. 409:
  292. $ref: '#/components/responses/409'
  293. 413:
  294. $ref: '#/components/responses/413'
  295. security:
  296. - testAuth: []
  297. /platforms/{platformId}:
  298. get:
  299. tags:
  300. - platforms
  301. summary: find platform by ID
  302. description: return platform by ID
  303. operationId: getPlatformById
  304. parameters:
  305. - $ref: '#/components/parameters/platformPath'
  306. responses:
  307. 200:
  308. $ref: '#/components/responses/getSinglePlatform'
  309. 401:
  310. $ref: '#/components/responses/UnauthorizedError'
  311. 404:
  312. $ref: '#/components/responses/404'
  313. security:
  314. - testAuth: []
  315. put:
  316. tags:
  317. - platforms
  318. summary: update existing platform by ID
  319. description: update platform
  320. operationId: updatePlatformById
  321. parameters:
  322. - $ref: '#/components/parameters/platformPath'
  323. requestBody:
  324. $ref: '#/components/requestBodies/Platform'
  325. responses:
  326. 200:
  327. $ref: '#/components/responses/getSinglePlatform'
  328. 400:
  329. $ref: '#/components/responses/400'
  330. 401:
  331. $ref: '#/components/responses/UnauthorizedError'
  332. 403:
  333. $ref: '#/components/responses/403'
  334. 404:
  335. $ref: '#/components/responses/404'
  336. 409:
  337. $ref: '#/components/responses/409'
  338. 413:
  339. $ref: '#/components/responses/413'
  340. security:
  341. - testAuth: []
  342. delete:
  343. tags:
  344. - platforms
  345. summary: deletes a platform by ID
  346. description: delete a platform by ID
  347. operationId: deletePlatformById
  348. parameters:
  349. - $ref: '#/components/parameters/platformPath'
  350. responses:
  351. 200:
  352. description: successful operation
  353. 205:
  354. description: Unable to delete. Data is used.
  355. 401:
  356. $ref: '#/components/responses/UnauthorizedError'
  357. 403:
  358. $ref: '#/components/responses/403'
  359. 404:
  360. $ref: '#/components/responses/404'
  361. security:
  362. - testAuth: []
  363. /platforms/{platformId}/bug:
  364. get:
  365. tags:
  366. - platforms
  367. summary: find all bugs of a platform
  368. description: return all bugs of a platform
  369. operationId: getBugByPlatformId
  370. parameters:
  371. - $ref: '#/components/parameters/platformPath'
  372. - $ref: '#/components/parameters/page'
  373. - $ref: '#/components/parameters/limit'
  374. - $ref: '#/components/parameters/sortQuery'
  375. responses:
  376. 200:
  377. $ref: '#/components/responses/getArrayBug'
  378. 400:
  379. $ref: '#/components/responses/400'
  380. 401:
  381. $ref: '#/components/responses/UnauthorizedError'
  382. security:
  383. - testAuth: []
  384. /users:
  385. get:
  386. tags:
  387. - users
  388. summary: find all user
  389. description: return all user
  390. operationId: getUser
  391. parameters:
  392. - $ref: '#/components/parameters/page'
  393. - $ref: '#/components/parameters/limit'
  394. - $ref: '#/components/parameters/sortQuery'
  395. responses:
  396. 200:
  397. $ref: '#/components/responses/getArrayUser'
  398. 400:
  399. $ref: '#/components/responses/400'
  400. 401:
  401. $ref: '#/components/responses/UnauthorizedError'
  402. security:
  403. - testAuth: []
  404. post:
  405. tags:
  406. - users
  407. summary: add user
  408. description: add new user
  409. operationId: AddUser
  410. requestBody:
  411. $ref: '#/components/requestBodies/User'
  412. responses:
  413. 201:
  414. $ref: '#/components/responses/successAddUser'
  415. 400:
  416. $ref: '#/components/responses/400'
  417. 401:
  418. $ref: '#/components/responses/UnauthorizedError'
  419. 409:
  420. $ref: '#/components/responses/409'
  421. 413:
  422. $ref: '#/components/responses/413'
  423. security:
  424. - testAuth: []
  425. /users/{userId}:
  426. get:
  427. tags:
  428. - users
  429. summary: find user by userId
  430. description: return user by userId
  431. operationId: getUserById
  432. parameters:
  433. - $ref: '#/components/parameters/UserPath'
  434. responses:
  435. 200:
  436. $ref: '#/components/responses/getSingleUser'
  437. 401:
  438. $ref: '#/components/responses/UnauthorizedError'
  439. 404:
  440. $ref: '#/components/responses/404'
  441. security:
  442. - testAuth: []
  443. put:
  444. tags:
  445. - users
  446. summary: update existing user except password
  447. description: update user
  448. operationId: updateUserById
  449. parameters:
  450. - $ref: '#/components/parameters/UserPath'
  451. requestBody:
  452. description: User object
  453. required: true
  454. content:
  455. application/json:
  456. schema:
  457. type: object
  458. properties:
  459. username:
  460. type: string
  461. example: abi
  462. name:
  463. type: string
  464. example: abidzar
  465. responses:
  466. 200:
  467. $ref: '#/components/responses/getSingleUser'
  468. 400:
  469. $ref: '#/components/responses/400'
  470. 401:
  471. $ref: '#/components/responses/UnauthorizedError'
  472. 404:
  473. $ref: '#/components/responses/404'
  474. 409:
  475. $ref: '#/components/responses/409'
  476. 413:
  477. $ref: '#/components/responses/413'
  478. security:
  479. - testAuth: []
  480. delete:
  481. tags:
  482. - users
  483. summary: deletes a user by ID
  484. description: delete a user by ID
  485. operationId: deleteUserById
  486. parameters:
  487. - $ref: '#/components/parameters/UserPath'
  488. responses:
  489. 200:
  490. description: successful operation
  491. 205:
  492. description: Unable to delete. Data is used.
  493. 401:
  494. $ref: '#/components/responses/UnauthorizedError'
  495. 403:
  496. $ref: '#/components/responses/403'
  497. 404:
  498. $ref: '#/components/responses/404'
  499. security:
  500. - testAuth: []
  501. /users/{userId}/password:
  502. put:
  503. tags:
  504. - users
  505. summary: change password
  506. description: update user password
  507. operationId: updatePassword
  508. parameters:
  509. - $ref: '#/components/parameters/UserPath'
  510. requestBody:
  511. description: User object
  512. required: true
  513. content:
  514. application/json:
  515. schema:
  516. type: object
  517. properties:
  518. oldPassword:
  519. type: string
  520. example: abi123
  521. newPassword:
  522. type: string
  523. example: abi456
  524. responses:
  525. 200:
  526. $ref: '#/components/responses/getSingleUser'
  527. 400:
  528. $ref: '#/components/responses/400'
  529. 401:
  530. $ref: '#/components/responses/UnauthorizedError'
  531. 403:
  532. description: wrong old password
  533. 404:
  534. $ref: '#/components/responses/404'
  535. security:
  536. - testAuth: []
  537. /bugs:
  538. get:
  539. tags:
  540. - bugs
  541. summary: find all bugs
  542. description: return all bugs
  543. operationId: getBug
  544. parameters:
  545. - $ref: '#/components/parameters/page'
  546. - $ref: '#/components/parameters/limit'
  547. - $ref: '#/components/parameters/sortQuery'
  548. responses:
  549. 200:
  550. $ref: '#/components/responses/getArrayBug'
  551. 400:
  552. $ref: '#/components/responses/400'
  553. 401:
  554. $ref: '#/components/responses/UnauthorizedError'
  555. security:
  556. - testAuth: []
  557. post:
  558. tags:
  559. - bugs
  560. summary: add bug
  561. description: add new bug
  562. operationId: addBug
  563. requestBody:
  564. $ref: '#/components/requestBodies/Bug'
  565. responses:
  566. 201:
  567. $ref: '#/components/responses/successAddBug'
  568. 400:
  569. $ref: '#/components/responses/400'
  570. 401:
  571. $ref: '#/components/responses/UnauthorizedError'
  572. 404:
  573. $ref: '#/components/responses/404'
  574. 409:
  575. $ref: '#/components/responses/409'
  576. 413:
  577. $ref: '#/components/responses/413'
  578. security:
  579. - testAuth: []
  580. /bugs/{bugId}:
  581. get:
  582. tags:
  583. - bugs
  584. summary: find bug by ID
  585. description: return bug
  586. operationId: getBugById
  587. parameters:
  588. - $ref: '#/components/parameters/bugPath'
  589. responses:
  590. 200:
  591. $ref: '#/components/responses/getSingleBug'
  592. 401:
  593. $ref: '#/components/responses/UnauthorizedError'
  594. 404:
  595. $ref: '#/components/responses/404'
  596. security:
  597. - testAuth: []
  598. put:
  599. tags:
  600. - bugs
  601. summary: update existing bug
  602. description: update bug
  603. operationId: updateBugById
  604. parameters:
  605. - $ref: '#/components/parameters/bugPath'
  606. requestBody:
  607. description: Bug object | level (note, minor, major) status (onprogress, done, hold, cancel) dev_status (notstart, onprogress, done)
  608. required: true
  609. content:
  610. application/json:
  611. schema:
  612. type: object
  613. properties:
  614. description:
  615. example: bug browser
  616. qc:
  617. example: 23
  618. dev:
  619. example: 24
  620. platform:
  621. example: web
  622. goodday_url:
  623. example: goodday.com
  624. image_url:
  625. example: image.com
  626. level:
  627. example: MAJOR
  628. status:
  629. example: ONPROGRESS
  630. dev_status:
  631. example: NOTSTART
  632. responses:
  633. 200:
  634. $ref: '#/components/responses/getSingleBug'
  635. 400:
  636. $ref: '#/components/responses/400'
  637. 401:
  638. $ref: '#/components/responses/UnauthorizedError'
  639. 403:
  640. $ref: '#/components/responses/403'
  641. 404:
  642. $ref: '#/components/responses/404'
  643. 409:
  644. $ref: '#/components/responses/409'
  645. 413:
  646. $ref: '#/components/responses/413'
  647. security:
  648. - testAuth: []
  649. delete:
  650. tags:
  651. - bugs
  652. summary: deletes a bug by ID
  653. description: delete a bug by ID
  654. operationId: deleteBugById
  655. parameters:
  656. - $ref: '#/components/parameters/bugPath'
  657. responses:
  658. 200:
  659. description: successful operation
  660. 205:
  661. description: Unable to delete. Data is used.
  662. 401:
  663. $ref: '#/components/responses/UnauthorizedError'
  664. 403:
  665. $ref: '#/components/responses/403'
  666. 404:
  667. $ref: '#/components/responses/404'
  668. security:
  669. - testAuth: []
  670. /bugs/{bugId}/comment:
  671. get:
  672. tags:
  673. - bugs
  674. summary: find all comments by bug ID
  675. description: return all comments by bug ID
  676. operationId: getCommentByBug
  677. parameters:
  678. - $ref: '#/components/parameters/bugPath'
  679. - $ref: '#/components/parameters/page'
  680. - $ref: '#/components/parameters/limit'
  681. - name: sort
  682. in: query
  683. description: sort direction (default 'comment_id, desc')
  684. schema:
  685. type: string
  686. responses:
  687. 200:
  688. $ref: '#/components/responses/getArrayComment'
  689. 400:
  690. $ref: '#/components/responses/400'
  691. 401:
  692. $ref: '#/components/responses/UnauthorizedError'
  693. 404:
  694. $ref: '#/components/responses/404'
  695. security:
  696. - testAuth: []
  697. post:
  698. tags:
  699. - bugs
  700. summary: add comment
  701. description: add new comment
  702. operationId: addComment
  703. parameters:
  704. - $ref: '#/components/parameters/bugPath'
  705. requestBody:
  706. $ref: '#/components/requestBodies/Comment'
  707. responses:
  708. 201:
  709. $ref: '#/components/responses/successAddComment'
  710. 400:
  711. $ref: '#/components/responses/400'
  712. 401:
  713. $ref: '#/components/responses/UnauthorizedError'
  714. 404:
  715. $ref: '#/components/responses/404'
  716. 413:
  717. $ref: '#/components/responses/413'
  718. security:
  719. - testAuth: []
  720. /comments/{commentId}:
  721. get:
  722. tags:
  723. - comments
  724. summary: find comment by ID
  725. description: return comment
  726. operationId: getCommentById
  727. parameters:
  728. - $ref: '#/components/parameters/commentPath'
  729. responses:
  730. 200:
  731. $ref: '#/components/responses/getSingleComment'
  732. 401:
  733. $ref: '#/components/responses/UnauthorizedError'
  734. 404:
  735. $ref: '#/components/responses/404'
  736. security:
  737. - testAuth: []
  738. delete:
  739. tags:
  740. - comments
  741. summary: deletes a comment by ID
  742. description: delete a comment by ID
  743. operationId: deleteCommentById
  744. parameters:
  745. - $ref: '#/components/parameters/commentPath'
  746. responses:
  747. 200:
  748. description: successful operation
  749. 401:
  750. $ref: '#/components/responses/UnauthorizedError'
  751. 403:
  752. $ref: '#/components/responses/403'
  753. 404:
  754. $ref: '#/components/responses/404'
  755. security:
  756. - testAuth: []
  757. /maintenance:
  758. get:
  759. tags:
  760. - maintenance
  761. summary: backup data
  762. description: export from table
  763. operationId: exportToCSV
  764. parameters:
  765. - name: tableName
  766. in: query
  767. description: table name (bug, comment, project, platform, project_member, user) (multi table gunakan ;)
  768. schema:
  769. type: string
  770. responses:
  771. 200:
  772. description: export success
  773. content:
  774. text/csv:
  775. example: string
  776. 400:
  777. $ref: '#/components/responses/400'
  778. 401:
  779. $ref: '#/components/responses/UnauthorizedError'
  780. 403:
  781. $ref: '#/components/responses/403'
  782. security:
  783. - testAuth: []
  784. post:
  785. tags:
  786. - maintenance
  787. summary: restore data
  788. description: import to table
  789. operationId: importFromCSV
  790. parameters:
  791. - name: tableName
  792. in: query
  793. description: table name (bug, comment, project, platform, project_member, user) (multi table gunakan ;)
  794. schema:
  795. type: string
  796. - name: overwrite
  797. in: query
  798. description: overwrite table value
  799. schema:
  800. type: boolean
  801. requestBody:
  802. description: file to import
  803. required: true
  804. content:
  805. multipart/form-data:
  806. schema:
  807. type: object
  808. properties:
  809. file:
  810. type: string
  811. format: binary
  812. responses:
  813. 200:
  814. description: import success
  815. content:
  816. text/csv:
  817. example: string
  818. 400:
  819. $ref: '#/components/responses/400'
  820. 401:
  821. $ref: '#/components/responses/UnauthorizedError'
  822. 403:
  823. $ref: '#/components/responses/403'
  824. security:
  825. - testAuth: []
  826. components:
  827. schemas:
  828. Project:
  829. required:
  830. - id
  831. - name
  832. - owner
  833. type: object
  834. properties:
  835. id:
  836. type: integer
  837. uniqueItems: true
  838. example: 2
  839. name:
  840. type: string
  841. uniqueItems: true
  842. maximum: 100
  843. example: PI
  844. description:
  845. type: string
  846. maximum: 255
  847. example: PropInspector
  848. owner:
  849. $ref: '#/components/schemas/User'
  850. Platform:
  851. type: object
  852. required:
  853. - id
  854. - name
  855. properties:
  856. id:
  857. type: integer
  858. uniqueItems: true
  859. example: 3
  860. name:
  861. type: string
  862. uniqueItems: true
  863. maximum: 100
  864. example: mobile
  865. project_id:
  866. $ref: '#/components/schemas/Project'
  867. User:
  868. type: object
  869. required:
  870. - id
  871. - username
  872. - password
  873. - name
  874. properties:
  875. id:
  876. type: integer
  877. uniqueItems: true
  878. example: 4
  879. username:
  880. type: string
  881. uniqueItems: true
  882. maximum: 100
  883. example: abi
  884. password:
  885. type: string
  886. maximum: 100
  887. example: abi123
  888. name:
  889. type: string
  890. maximum: 255
  891. example: abidzar
  892. Project_member:
  893. type: object
  894. properties:
  895. id:
  896. type: integer
  897. uniqueItems: true
  898. project:
  899. $ref: '#/components/schemas/Project'
  900. user:
  901. $ref: '#/components/schemas/User'
  902. role:
  903. type: number
  904. enum: [0,1,2]
  905. description: role = 0.QC, 1.Programmer, 2.Admin
  906. required:
  907. - id
  908. - project
  909. - user
  910. - role
  911. Bug:
  912. type: object
  913. properties:
  914. id:
  915. type: integer
  916. uniqueItems: true
  917. created:
  918. type: string
  919. format: date-time
  920. description:
  921. type: string
  922. maximum: 500
  923. qc:
  924. $ref: '#/components/schemas/User'
  925. dev:
  926. $ref: '#/components/schemas/User'
  927. platform:
  928. $ref: '#/components/schemas/Platform'
  929. goodday_url:
  930. type: string
  931. format: url
  932. image_url:
  933. type: string
  934. format: url
  935. level:
  936. type: number
  937. enum: [0,1,2]
  938. description: level = 0.Note, 1.Minor, 2.Major
  939. status:
  940. type: number
  941. enum: [0,1,2,3]
  942. description: status = 0.onProgress, 1.done, 2.hold, 3.cancel
  943. dev_status:
  944. type: number
  945. enum: [0,1,2]
  946. description: dev_status = 0.notStart, 1.onProgress, 2.done
  947. required:
  948. - id
  949. - created
  950. - description
  951. - qc
  952. - dev
  953. - platform
  954. - goodday_url
  955. - level
  956. - status
  957. - dev_status
  958. Comment:
  959. type: object
  960. properties:
  961. id:
  962. type: integer
  963. uniqueItems: true
  964. bug:
  965. $ref: '#/components/schemas/Bug'
  966. creator:
  967. $ref: '#/components/schemas/User'
  968. created:
  969. type: string
  970. format: date-time
  971. content:
  972. type: string
  973. maximum: 500
  974. required:
  975. - id
  976. - bug
  977. - creator
  978. - created
  979. - content
  980. paginatedResult:
  981. type: object
  982. properties:
  983. totalPage: { type: number, example: 2 }
  984. currentPage: { type: number, example: 0 }
  985. totalRecord: { type: number, example: 4 }
  986. results: { type: array, items: {} }
  987. parameters:
  988. projectPath:
  989. name: projectId
  990. in: path
  991. description: Project ID
  992. required: true
  993. schema:
  994. type: integer
  995. platformPath:
  996. name: platformId
  997. in: path
  998. description: Platform ID
  999. required: true
  1000. schema:
  1001. type: integer
  1002. UserPath:
  1003. name: userId
  1004. in: path
  1005. description: User ID
  1006. required: true
  1007. schema:
  1008. type: integer
  1009. projectQuery:
  1010. name: project
  1011. in: query
  1012. description: Project ID
  1013. schema:
  1014. type: integer
  1015. memberPath:
  1016. name: memberId
  1017. in: path
  1018. description: Project Member ID
  1019. required: true
  1020. schema:
  1021. type: integer
  1022. limit:
  1023. name: limit
  1024. in: query
  1025. description: Number of records to return (default 3)
  1026. schema:
  1027. type: number
  1028. minimum: 1
  1029. page:
  1030. name: page
  1031. in: query
  1032. description: Number of page to return (default 0)
  1033. schema:
  1034. type: number
  1035. minimum: 0
  1036. roleQuery:
  1037. name: role
  1038. in: query
  1039. description: filter role (role = QC, Programmer, Admin)
  1040. schema:
  1041. type: string
  1042. sortQuery:
  1043. name: sort
  1044. in: query
  1045. description: sort direction (default 'id, desc')
  1046. schema:
  1047. type: string
  1048. bugPath:
  1049. name: bugId
  1050. in: path
  1051. description: Bug ID
  1052. required: true
  1053. schema:
  1054. type: integer
  1055. commentPath:
  1056. name: commentId
  1057. in: path
  1058. description: Comment ID
  1059. required: true
  1060. schema:
  1061. type: integer
  1062. responses:
  1063. getSingleComment:
  1064. description: successful operation
  1065. content:
  1066. application/json:
  1067. schema:
  1068. properties:
  1069. id:
  1070. example: 8
  1071. bug:
  1072. example: error mobile
  1073. creator:
  1074. example: irma
  1075. created:
  1076. example: 22-Nov-2023 11:23:22
  1077. content:
  1078. example: qc error mobile done
  1079. successAddComment:
  1080. description: record succesfully added
  1081. content:
  1082. application/json:
  1083. schema:
  1084. properties:
  1085. id:
  1086. example: 15
  1087. bug:
  1088. example: error web
  1089. creator:
  1090. example: arif
  1091. created:
  1092. example: 04-Jul-2023 11:23:22
  1093. content:
  1094. example: error web mulai dikerjakan
  1095. getArrayComment:
  1096. description: successful operation
  1097. content:
  1098. application/json:
  1099. schema:
  1100. type: object
  1101. allOf:
  1102. - $ref: '#/components/schemas/paginatedResult'
  1103. - type: object
  1104. properties:
  1105. results:
  1106. type: array
  1107. items:
  1108. properties:
  1109. id:
  1110. example: 3
  1111. bug:
  1112. example: bug web
  1113. creator:
  1114. example: dama
  1115. created:
  1116. example: 15-Ags-2023 11:23:22
  1117. content:
  1118. example: web sudah done
  1119. getSingleBug:
  1120. description: successful operation
  1121. content:
  1122. application/json:
  1123. schema:
  1124. properties:
  1125. id:
  1126. example: 1
  1127. created:
  1128. example: 01-Feb-2023 11:23:22
  1129. description:
  1130. example: error button
  1131. qc:
  1132. example: irma
  1133. dev:
  1134. example: dama
  1135. platform:
  1136. example: mobile
  1137. goodday_url:
  1138. example: goodday.com
  1139. image_url:
  1140. example: image.com
  1141. level:
  1142. example: MINOR
  1143. status:
  1144. example: ONPROGRESS
  1145. dev_status:
  1146. example: DONE
  1147. successAddBug:
  1148. description: record succesfully added
  1149. content:
  1150. application/json:
  1151. schema:
  1152. properties:
  1153. id:
  1154. example: 2
  1155. created:
  1156. example: 23-Mar-2023 11:23:22
  1157. description:
  1158. example: bug browser
  1159. qc:
  1160. example: mita
  1161. dev:
  1162. example: agus
  1163. platform:
  1164. example: mobile
  1165. goodday_url:
  1166. example: goodday.com
  1167. image_url:
  1168. example: image.com
  1169. level:
  1170. example: MINOR
  1171. status:
  1172. example: ONPROGRESS
  1173. dev_status:
  1174. example: NOTSTART
  1175. getArrayBug:
  1176. description: successful operation
  1177. content:
  1178. application/json:
  1179. schema:
  1180. type: object
  1181. allOf:
  1182. - $ref: '#/components/schemas/paginatedResult'
  1183. - type: object
  1184. properties:
  1185. results:
  1186. type: array
  1187. items:
  1188. properties:
  1189. id:
  1190. type: integer
  1191. example: 1
  1192. created:
  1193. type: string
  1194. example: 01-Jan-2023 11:23:22
  1195. description:
  1196. example: error button
  1197. qc:
  1198. example: irma
  1199. dev:
  1200. example: dama
  1201. platform:
  1202. example: mobile
  1203. goodday_url:
  1204. example: goodday.com
  1205. image_url:
  1206. example: image.com
  1207. level:
  1208. example: MINOR
  1209. status:
  1210. example: ONPROGRESS
  1211. dev_status:
  1212. example: DONE
  1213. getArrayProject:
  1214. description: successful operation
  1215. content:
  1216. application/json:
  1217. schema:
  1218. type: object
  1219. allOf:
  1220. - $ref: '#/components/schemas/paginatedResult'
  1221. - type: object
  1222. properties:
  1223. results:
  1224. type: array
  1225. items:
  1226. properties:
  1227. id:
  1228. type: integer
  1229. example: 1
  1230. name:
  1231. type: string
  1232. example: TM
  1233. description:
  1234. type: string
  1235. example: TelMesengger
  1236. owner:
  1237. properties:
  1238. id:
  1239. type: integer
  1240. example: 1
  1241. username:
  1242. type: string
  1243. example: abi
  1244. name:
  1245. type: string
  1246. example: abidzar
  1247. getSingleProject:
  1248. description: successful operation
  1249. content:
  1250. application/json:
  1251. schema:
  1252. properties:
  1253. id:
  1254. type: integer
  1255. example: 1
  1256. name:
  1257. type: string
  1258. example: TM
  1259. description:
  1260. type: string
  1261. example: TelMesengger
  1262. owner:
  1263. properties:
  1264. id:
  1265. type: integer
  1266. example: 1
  1267. username:
  1268. type: string
  1269. example: abi
  1270. name:
  1271. type: string
  1272. example: abidzar
  1273. successAddProject:
  1274. description: record successfully added
  1275. content:
  1276. application/json:
  1277. schema:
  1278. properties:
  1279. id:
  1280. type: integer
  1281. example: 1
  1282. name:
  1283. type: string
  1284. example: TM
  1285. description:
  1286. type: string
  1287. example: TelMesengger
  1288. owner:
  1289. properties:
  1290. id:
  1291. type: integer
  1292. example: 1
  1293. username:
  1294. type: string
  1295. example: abi
  1296. name:
  1297. type: string
  1298. example: abidzar
  1299. successAddMember:
  1300. description: record successfully added
  1301. content:
  1302. application/json:
  1303. schema:
  1304. properties:
  1305. id:
  1306. type: integer
  1307. example: 1
  1308. project:
  1309. example: TelMessenger
  1310. user:
  1311. example: abidzar
  1312. role:
  1313. type: string
  1314. example: QC
  1315. getArrayPlatform:
  1316. description: successful operation
  1317. content:
  1318. application/json:
  1319. schema:
  1320. type: object
  1321. allOf:
  1322. - $ref: '#/components/schemas/paginatedResult'
  1323. - type: object
  1324. properties:
  1325. results:
  1326. type: array
  1327. items:
  1328. properties:
  1329. id:
  1330. type: integer
  1331. example: 1
  1332. name:
  1333. type: string
  1334. example: mobile
  1335. project:
  1336. example: TelMessenger
  1337. successAddPlatform:
  1338. description: record successfully added
  1339. content:
  1340. application/json:
  1341. schema:
  1342. properties:
  1343. id:
  1344. type: integer
  1345. example: 1
  1346. name:
  1347. type: string
  1348. example: mobile
  1349. project:
  1350. example: TelMessenger
  1351. getSinglePlatform:
  1352. description: successful operation
  1353. content:
  1354. application/json:
  1355. schema:
  1356. properties:
  1357. id:
  1358. type: integer
  1359. example: 1
  1360. name:
  1361. type: string
  1362. example: mobile
  1363. project:
  1364. example: TelMessenger
  1365. getArrayUser:
  1366. description: successful operation
  1367. content:
  1368. application/json:
  1369. schema:
  1370. type: object
  1371. allOf:
  1372. - $ref: '#/components/schemas/paginatedResult'
  1373. - type: object
  1374. properties:
  1375. results:
  1376. type: array
  1377. items:
  1378. properties:
  1379. id:
  1380. type: integer
  1381. example: 1
  1382. username:
  1383. type: string
  1384. example: abi
  1385. name:
  1386. type: string
  1387. example: abidzar
  1388. successAddUser:
  1389. description: record successfully added
  1390. content:
  1391. application/json:
  1392. schema:
  1393. properties:
  1394. id:
  1395. type: integer
  1396. example: 1
  1397. username:
  1398. type: string
  1399. example: abi
  1400. name:
  1401. type: string
  1402. example: abidzar
  1403. getSingleUser:
  1404. description: successful operation
  1405. content:
  1406. application/json:
  1407. schema:
  1408. properties:
  1409. id:
  1410. type: integer
  1411. example: 1
  1412. username:
  1413. type: string
  1414. example: abi
  1415. name:
  1416. type: string
  1417. example: abidzar
  1418. getSingleMember:
  1419. description: successful operation
  1420. content:
  1421. application/json:
  1422. schema:
  1423. properties:
  1424. id:
  1425. example: 1
  1426. project:
  1427. example: TelMessenger
  1428. user:
  1429. example: abidzar
  1430. role:
  1431. example: QC
  1432. getArrayMember:
  1433. description: successful operation
  1434. content:
  1435. application/json:
  1436. schema:
  1437. type: object
  1438. allOf:
  1439. - $ref: '#/components/schemas/paginatedResult'
  1440. - type: object
  1441. properties:
  1442. results:
  1443. type: array
  1444. items:
  1445. properties:
  1446. id:
  1447. example: 1
  1448. project:
  1449. example: TelMessenger
  1450. user:
  1451. example: abidzar
  1452. role:
  1453. example: QC
  1454. 400:
  1455. description: invalid data
  1456. 403:
  1457. description: do not have rights
  1458. UnauthorizedError:
  1459. description: Authentication information is missing or invalid
  1460. 404:
  1461. description: not found
  1462. 409:
  1463. description: duplicate data
  1464. 413:
  1465. description: content too large
  1466. requestBodies:
  1467. Project:
  1468. description: Project object
  1469. required: true
  1470. content:
  1471. application/json:
  1472. schema:
  1473. type: object
  1474. properties:
  1475. name:
  1476. type: string
  1477. example: TM
  1478. description:
  1479. type: string
  1480. example: TelMesengger
  1481. ProjectMember:
  1482. description: project member object | role = QC, Programmer, Admin
  1483. required: true
  1484. content:
  1485. application/json:
  1486. schema:
  1487. type: object
  1488. properties:
  1489. user_id:
  1490. type: integer
  1491. example: 1
  1492. role:
  1493. type: string
  1494. example: qc
  1495. Platform:
  1496. description: Platform object
  1497. required: true
  1498. content:
  1499. application/json:
  1500. schema:
  1501. type: object
  1502. properties:
  1503. name:
  1504. type: string
  1505. example: web
  1506. project_name:
  1507. type: string
  1508. example: TM
  1509. User:
  1510. description: User object
  1511. required: true
  1512. content:
  1513. application/json:
  1514. schema:
  1515. type: object
  1516. properties:
  1517. username:
  1518. type: string
  1519. example: abi
  1520. password:
  1521. type: string
  1522. example: abi123
  1523. name:
  1524. type: string
  1525. example: abidzar
  1526. Bug:
  1527. description: Bug object | level (note, minor, major) status (onprogress, done, hold, cancel) dev_status (notstart, onprogress, done)
  1528. required: true
  1529. content:
  1530. application/json:
  1531. schema:
  1532. type: object
  1533. properties:
  1534. description:
  1535. example: bug button
  1536. qc:
  1537. example: 33
  1538. dev:
  1539. example: 34
  1540. platform:
  1541. example: web
  1542. goodday_url:
  1543. example: goodday.com
  1544. image_url:
  1545. example: image.com
  1546. level:
  1547. example: NOTE
  1548. status:
  1549. example: ONPROGRESS
  1550. dev_status:
  1551. example: NOTSTART
  1552. Comment:
  1553. description: Comment object
  1554. required: true
  1555. content:
  1556. application/json:
  1557. schema:
  1558. type: object
  1559. properties:
  1560. content:
  1561. example: error web mulai dikerjakan
  1562. securitySchemes:
  1563. testAuth:
  1564. type: http
  1565. scheme: basic
  1566. description: use `user`/`password` to login