swagger3 project.yml 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564
  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. 401:
  819. $ref: '#/components/responses/UnauthorizedError'
  820. 403:
  821. $ref: '#/components/responses/403'
  822. security:
  823. - testAuth: []
  824. components:
  825. schemas:
  826. Project:
  827. required:
  828. - id
  829. - name
  830. - owner
  831. type: object
  832. properties:
  833. id:
  834. type: integer
  835. uniqueItems: true
  836. example: 2
  837. name:
  838. type: string
  839. uniqueItems: true
  840. maximum: 100
  841. example: PI
  842. description:
  843. type: string
  844. maximum: 255
  845. example: PropInspector
  846. owner:
  847. $ref: '#/components/schemas/User'
  848. Platform:
  849. type: object
  850. required:
  851. - id
  852. - name
  853. properties:
  854. id:
  855. type: integer
  856. uniqueItems: true
  857. example: 3
  858. name:
  859. type: string
  860. uniqueItems: true
  861. maximum: 100
  862. example: mobile
  863. project_id:
  864. $ref: '#/components/schemas/Project'
  865. User:
  866. type: object
  867. required:
  868. - id
  869. - username
  870. - password
  871. - name
  872. properties:
  873. id:
  874. type: integer
  875. uniqueItems: true
  876. example: 4
  877. username:
  878. type: string
  879. uniqueItems: true
  880. maximum: 100
  881. example: abi
  882. password:
  883. type: string
  884. maximum: 100
  885. example: abi123
  886. name:
  887. type: string
  888. maximum: 255
  889. example: abidzar
  890. Project_member:
  891. type: object
  892. properties:
  893. id:
  894. type: integer
  895. uniqueItems: true
  896. project:
  897. $ref: '#/components/schemas/Project'
  898. user:
  899. $ref: '#/components/schemas/User'
  900. role:
  901. type: number
  902. enum: [0,1,2]
  903. description: role = 0.QC, 1.Programmer, 2.Admin
  904. required:
  905. - id
  906. - project
  907. - user
  908. - role
  909. Bug:
  910. type: object
  911. properties:
  912. id:
  913. type: integer
  914. uniqueItems: true
  915. created:
  916. type: string
  917. format: date-time
  918. description:
  919. type: string
  920. maximum: 500
  921. qc:
  922. $ref: '#/components/schemas/User'
  923. dev:
  924. $ref: '#/components/schemas/User'
  925. platform:
  926. $ref: '#/components/schemas/Platform'
  927. goodday_url:
  928. type: string
  929. format: url
  930. image_url:
  931. type: string
  932. format: url
  933. level:
  934. type: number
  935. enum: [0,1,2]
  936. description: level = 0.Note, 1.Minor, 2.Major
  937. status:
  938. type: number
  939. enum: [0,1,2,3]
  940. description: status = 0.onProgress, 1.done, 2.hold, 3.cancel
  941. dev_status:
  942. type: number
  943. enum: [0,1,2]
  944. description: dev_status = 0.notStart, 1.onProgress, 2.done
  945. required:
  946. - id
  947. - created
  948. - description
  949. - qc
  950. - dev
  951. - platform
  952. - goodday_url
  953. - level
  954. - status
  955. - dev_status
  956. Comment:
  957. type: object
  958. properties:
  959. id:
  960. type: integer
  961. uniqueItems: true
  962. bug:
  963. $ref: '#/components/schemas/Bug'
  964. creator:
  965. $ref: '#/components/schemas/User'
  966. created:
  967. type: string
  968. format: date-time
  969. content:
  970. type: string
  971. maximum: 500
  972. required:
  973. - id
  974. - bug
  975. - creator
  976. - created
  977. - content
  978. paginatedResult:
  979. type: object
  980. properties:
  981. totalPage: { type: number, example: 2 }
  982. currentPage: { type: number, example: 0 }
  983. totalRecord: { type: number, example: 4 }
  984. results: { type: array, items: {} }
  985. parameters:
  986. projectPath:
  987. name: projectId
  988. in: path
  989. description: Project ID
  990. required: true
  991. schema:
  992. type: integer
  993. platformPath:
  994. name: platformId
  995. in: path
  996. description: Platform ID
  997. required: true
  998. schema:
  999. type: integer
  1000. UserPath:
  1001. name: userId
  1002. in: path
  1003. description: User ID
  1004. required: true
  1005. schema:
  1006. type: integer
  1007. projectQuery:
  1008. name: project
  1009. in: query
  1010. description: Project ID
  1011. schema:
  1012. type: integer
  1013. memberPath:
  1014. name: memberId
  1015. in: path
  1016. description: Project Member ID
  1017. required: true
  1018. schema:
  1019. type: integer
  1020. limit:
  1021. name: limit
  1022. in: query
  1023. description: Number of records to return (default 3)
  1024. schema:
  1025. type: number
  1026. minimum: 1
  1027. page:
  1028. name: page
  1029. in: query
  1030. description: Number of page to return (default 0)
  1031. schema:
  1032. type: number
  1033. minimum: 0
  1034. roleQuery:
  1035. name: role
  1036. in: query
  1037. description: filter role (role = QC, Programmer, Admin)
  1038. schema:
  1039. type: string
  1040. sortQuery:
  1041. name: sort
  1042. in: query
  1043. description: sort direction (default 'id, desc')
  1044. schema:
  1045. type: string
  1046. bugPath:
  1047. name: bugId
  1048. in: path
  1049. description: Bug ID
  1050. required: true
  1051. schema:
  1052. type: integer
  1053. commentPath:
  1054. name: commentId
  1055. in: path
  1056. description: Comment ID
  1057. required: true
  1058. schema:
  1059. type: integer
  1060. responses:
  1061. getSingleComment:
  1062. description: successful operation
  1063. content:
  1064. application/json:
  1065. schema:
  1066. properties:
  1067. id:
  1068. example: 8
  1069. bug:
  1070. example: error mobile
  1071. creator:
  1072. example: irma
  1073. created:
  1074. example: 22-Nov-2023 11:23:22
  1075. content:
  1076. example: qc error mobile done
  1077. successAddComment:
  1078. description: record succesfully added
  1079. content:
  1080. application/json:
  1081. schema:
  1082. properties:
  1083. id:
  1084. example: 15
  1085. bug:
  1086. example: error web
  1087. creator:
  1088. example: arif
  1089. created:
  1090. example: 04-Jul-2023 11:23:22
  1091. content:
  1092. example: error web mulai dikerjakan
  1093. getArrayComment:
  1094. description: successful operation
  1095. content:
  1096. application/json:
  1097. schema:
  1098. type: object
  1099. allOf:
  1100. - $ref: '#/components/schemas/paginatedResult'
  1101. - type: object
  1102. properties:
  1103. results:
  1104. type: array
  1105. items:
  1106. properties:
  1107. id:
  1108. example: 3
  1109. bug:
  1110. example: bug web
  1111. creator:
  1112. example: dama
  1113. created:
  1114. example: 15-Ags-2023 11:23:22
  1115. content:
  1116. example: web sudah done
  1117. getSingleBug:
  1118. description: successful operation
  1119. content:
  1120. application/json:
  1121. schema:
  1122. properties:
  1123. id:
  1124. example: 1
  1125. created:
  1126. example: 01-Feb-2023 11:23:22
  1127. description:
  1128. example: error button
  1129. qc:
  1130. example: irma
  1131. dev:
  1132. example: dama
  1133. platform:
  1134. example: mobile
  1135. goodday_url:
  1136. example: goodday.com
  1137. image_url:
  1138. example: image.com
  1139. level:
  1140. example: MINOR
  1141. status:
  1142. example: ONPROGRESS
  1143. dev_status:
  1144. example: DONE
  1145. successAddBug:
  1146. description: record succesfully added
  1147. content:
  1148. application/json:
  1149. schema:
  1150. properties:
  1151. id:
  1152. example: 2
  1153. created:
  1154. example: 23-Mar-2023 11:23:22
  1155. description:
  1156. example: bug browser
  1157. qc:
  1158. example: mita
  1159. dev:
  1160. example: agus
  1161. platform:
  1162. example: mobile
  1163. goodday_url:
  1164. example: goodday.com
  1165. image_url:
  1166. example: image.com
  1167. level:
  1168. example: MINOR
  1169. status:
  1170. example: ONPROGRESS
  1171. dev_status:
  1172. example: NOTSTART
  1173. getArrayBug:
  1174. description: successful operation
  1175. content:
  1176. application/json:
  1177. schema:
  1178. type: object
  1179. allOf:
  1180. - $ref: '#/components/schemas/paginatedResult'
  1181. - type: object
  1182. properties:
  1183. results:
  1184. type: array
  1185. items:
  1186. properties:
  1187. id:
  1188. type: integer
  1189. example: 1
  1190. created:
  1191. type: string
  1192. example: 01-Jan-2023 11:23:22
  1193. description:
  1194. example: error button
  1195. qc:
  1196. example: irma
  1197. dev:
  1198. example: dama
  1199. platform:
  1200. example: mobile
  1201. goodday_url:
  1202. example: goodday.com
  1203. image_url:
  1204. example: image.com
  1205. level:
  1206. example: MINOR
  1207. status:
  1208. example: ONPROGRESS
  1209. dev_status:
  1210. example: DONE
  1211. getArrayProject:
  1212. description: successful operation
  1213. content:
  1214. application/json:
  1215. schema:
  1216. type: object
  1217. allOf:
  1218. - $ref: '#/components/schemas/paginatedResult'
  1219. - type: object
  1220. properties:
  1221. results:
  1222. type: array
  1223. items:
  1224. properties:
  1225. id:
  1226. type: integer
  1227. example: 1
  1228. name:
  1229. type: string
  1230. example: TM
  1231. description:
  1232. type: string
  1233. example: TelMesengger
  1234. owner:
  1235. properties:
  1236. id:
  1237. type: integer
  1238. example: 1
  1239. username:
  1240. type: string
  1241. example: abi
  1242. name:
  1243. type: string
  1244. example: abidzar
  1245. getSingleProject:
  1246. description: successful operation
  1247. content:
  1248. application/json:
  1249. schema:
  1250. properties:
  1251. id:
  1252. type: integer
  1253. example: 1
  1254. name:
  1255. type: string
  1256. example: TM
  1257. description:
  1258. type: string
  1259. example: TelMesengger
  1260. owner:
  1261. properties:
  1262. id:
  1263. type: integer
  1264. example: 1
  1265. username:
  1266. type: string
  1267. example: abi
  1268. name:
  1269. type: string
  1270. example: abidzar
  1271. successAddProject:
  1272. description: record successfully added
  1273. content:
  1274. application/json:
  1275. schema:
  1276. properties:
  1277. id:
  1278. type: integer
  1279. example: 1
  1280. name:
  1281. type: string
  1282. example: TM
  1283. description:
  1284. type: string
  1285. example: TelMesengger
  1286. owner:
  1287. properties:
  1288. id:
  1289. type: integer
  1290. example: 1
  1291. username:
  1292. type: string
  1293. example: abi
  1294. name:
  1295. type: string
  1296. example: abidzar
  1297. successAddMember:
  1298. description: record successfully added
  1299. content:
  1300. application/json:
  1301. schema:
  1302. properties:
  1303. id:
  1304. type: integer
  1305. example: 1
  1306. project:
  1307. example: TelMessenger
  1308. user:
  1309. example: abidzar
  1310. role:
  1311. type: string
  1312. example: QC
  1313. getArrayPlatform:
  1314. description: successful operation
  1315. content:
  1316. application/json:
  1317. schema:
  1318. type: object
  1319. allOf:
  1320. - $ref: '#/components/schemas/paginatedResult'
  1321. - type: object
  1322. properties:
  1323. results:
  1324. type: array
  1325. items:
  1326. properties:
  1327. id:
  1328. type: integer
  1329. example: 1
  1330. name:
  1331. type: string
  1332. example: mobile
  1333. project:
  1334. example: TelMessenger
  1335. successAddPlatform:
  1336. description: record successfully added
  1337. content:
  1338. application/json:
  1339. schema:
  1340. properties:
  1341. id:
  1342. type: integer
  1343. example: 1
  1344. name:
  1345. type: string
  1346. example: mobile
  1347. project:
  1348. example: TelMessenger
  1349. getSinglePlatform:
  1350. description: successful operation
  1351. content:
  1352. application/json:
  1353. schema:
  1354. properties:
  1355. id:
  1356. type: integer
  1357. example: 1
  1358. name:
  1359. type: string
  1360. example: mobile
  1361. project:
  1362. example: TelMessenger
  1363. getArrayUser:
  1364. description: successful operation
  1365. content:
  1366. application/json:
  1367. schema:
  1368. type: object
  1369. allOf:
  1370. - $ref: '#/components/schemas/paginatedResult'
  1371. - type: object
  1372. properties:
  1373. results:
  1374. type: array
  1375. items:
  1376. properties:
  1377. id:
  1378. type: integer
  1379. example: 1
  1380. username:
  1381. type: string
  1382. example: abi
  1383. name:
  1384. type: string
  1385. example: abidzar
  1386. successAddUser:
  1387. description: record successfully added
  1388. content:
  1389. application/json:
  1390. schema:
  1391. properties:
  1392. id:
  1393. type: integer
  1394. example: 1
  1395. username:
  1396. type: string
  1397. example: abi
  1398. name:
  1399. type: string
  1400. example: abidzar
  1401. getSingleUser:
  1402. description: successful operation
  1403. content:
  1404. application/json:
  1405. schema:
  1406. properties:
  1407. id:
  1408. type: integer
  1409. example: 1
  1410. username:
  1411. type: string
  1412. example: abi
  1413. name:
  1414. type: string
  1415. example: abidzar
  1416. getSingleMember:
  1417. description: successful operation
  1418. content:
  1419. application/json:
  1420. schema:
  1421. properties:
  1422. id:
  1423. example: 1
  1424. project:
  1425. example: TelMessenger
  1426. user:
  1427. example: abidzar
  1428. role:
  1429. example: QC
  1430. getArrayMember:
  1431. description: successful operation
  1432. content:
  1433. application/json:
  1434. schema:
  1435. type: object
  1436. allOf:
  1437. - $ref: '#/components/schemas/paginatedResult'
  1438. - type: object
  1439. properties:
  1440. results:
  1441. type: array
  1442. items:
  1443. properties:
  1444. id:
  1445. example: 1
  1446. project:
  1447. example: TelMessenger
  1448. user:
  1449. example: abidzar
  1450. role:
  1451. example: QC
  1452. 400:
  1453. description: invalid data
  1454. 403:
  1455. description: do not have rights
  1456. UnauthorizedError:
  1457. description: Authentication information is missing or invalid
  1458. 404:
  1459. description: not found
  1460. 409:
  1461. description: duplicate data
  1462. 413:
  1463. description: content too large
  1464. requestBodies:
  1465. Project:
  1466. description: Project object
  1467. required: true
  1468. content:
  1469. application/json:
  1470. schema:
  1471. type: object
  1472. properties:
  1473. name:
  1474. type: string
  1475. example: TM
  1476. description:
  1477. type: string
  1478. example: TelMesengger
  1479. ProjectMember:
  1480. description: project member object | role = QC, Programmer, Admin
  1481. required: true
  1482. content:
  1483. application/json:
  1484. schema:
  1485. type: object
  1486. properties:
  1487. user_id:
  1488. type: integer
  1489. example: 1
  1490. role:
  1491. type: string
  1492. example: qc
  1493. Platform:
  1494. description: Platform object
  1495. required: true
  1496. content:
  1497. application/json:
  1498. schema:
  1499. type: object
  1500. properties:
  1501. name:
  1502. type: string
  1503. example: web
  1504. project_name:
  1505. type: string
  1506. example: TM
  1507. User:
  1508. description: User object
  1509. required: true
  1510. content:
  1511. application/json:
  1512. schema:
  1513. type: object
  1514. properties:
  1515. username:
  1516. type: string
  1517. example: abi
  1518. password:
  1519. type: string
  1520. example: abi123
  1521. name:
  1522. type: string
  1523. example: abidzar
  1524. Bug:
  1525. description: Bug object | level (note, minor, major) status (onprogress, done, hold, cancel) dev_status (notstart, onprogress, done)
  1526. required: true
  1527. content:
  1528. application/json:
  1529. schema:
  1530. type: object
  1531. properties:
  1532. description:
  1533. example: bug button
  1534. qc:
  1535. example: 33
  1536. dev:
  1537. example: 34
  1538. platform:
  1539. example: web
  1540. goodday_url:
  1541. example: goodday.com
  1542. image_url:
  1543. example: image.com
  1544. level:
  1545. example: NOTE
  1546. status:
  1547. example: ONPROGRESS
  1548. dev_status:
  1549. example: NOTSTART
  1550. Comment:
  1551. description: Comment object
  1552. required: true
  1553. content:
  1554. application/json:
  1555. schema:
  1556. type: object
  1557. properties:
  1558. content:
  1559. example: error web mulai dikerjakan
  1560. securitySchemes:
  1561. testAuth:
  1562. type: http
  1563. scheme: basic
  1564. description: use `user`/`password` to login