mocks.ts 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. // Utilidad para simular requests durante desarrollo
  2. export const mockRequest = (
  3. success: Boolean,
  4. payload: string,
  5. timeout: number | null
  6. ): Promise<string> => {
  7. return new Promise((resolve, reject) => {
  8. setTimeout(() => {
  9. if (success) {
  10. resolve(payload);
  11. } else {
  12. reject(payload);
  13. }
  14. }, timeout || 1000);
  15. });
  16. };
  17. export const mockPayloads = {
  18. seasonsSummariesTable: `
  19. [
  20. {
  21. "station": {
  22. "name": "excepteur",
  23. "code": "6dd49d1c-68ee-4e68-b993-0ca6489c478c"
  24. },
  25. "from": "2016-12-22T02:14:38 +03:00",
  26. "to": "2015-12-02T10:22:04 +03:00",
  27. "lt10": 30.48,
  28. "gt30": 13.65,
  29. "gt33": 21.98,
  30. "grados_acumulados": 18.67,
  31. "amplitud_termica": 19.95,
  32. "precip_acumulada": 11.53,
  33. "dias_para_igualar_temporada": -8
  34. },
  35. {
  36. "station": {
  37. "name": "excepteur",
  38. "code": "6dd49d1c-68ee-4e68-b993-0ca6489c478c"
  39. },
  40. "from": "2014-08-02T04:29:26 +03:00",
  41. "to": "2014-06-18T08:59:25 +03:00",
  42. "lt10": 30.8,
  43. "gt30": 15.51,
  44. "gt33": 27.18,
  45. "grados_acumulados": 15.31,
  46. "amplitud_termica": 13.78,
  47. "precip_acumulada": 15.58,
  48. "dias_para_igualar_temporada": -2
  49. },
  50. {
  51. "station": {
  52. "name": "excepteur",
  53. "code": "6dd49d1c-68ee-4e68-b993-0ca6489c478c"
  54. },
  55. "from": "2017-04-30T08:01:55 +03:00",
  56. "to": "2021-05-03T05:35:16 +03:00",
  57. "lt10": 19.58,
  58. "gt30": 29.96,
  59. "gt33": 17.12,
  60. "grados_acumulados": 13.11,
  61. "amplitud_termica": 31.6,
  62. "precip_acumulada": 23.31,
  63. "dias_para_igualar_temporada": -10
  64. },
  65. {
  66. "station": {
  67. "name": "excepteur",
  68. "code": "6dd49d1c-68ee-4e68-b993-0ca6489c478c"
  69. },
  70. "from": "2016-07-28T06:30:57 +03:00",
  71. "to": "2015-04-29T02:19:31 +03:00",
  72. "lt10": 34.5,
  73. "gt30": 24.31,
  74. "gt33": 38.21,
  75. "grados_acumulados": 18.47,
  76. "amplitud_termica": 10.49,
  77. "precip_acumulada": 24.36,
  78. "dias_para_igualar_temporada": 7
  79. },
  80. {
  81. "station": {
  82. "name": "excepteur",
  83. "code": "6dd49d1c-68ee-4e68-b993-0ca6489c478c"
  84. },
  85. "from": "2019-08-21T08:41:01 +03:00",
  86. "to": "2014-07-05T03:50:04 +03:00",
  87. "lt10": 12.94,
  88. "gt30": 16.74,
  89. "gt33": 21.02,
  90. "grados_acumulados": 37.22,
  91. "amplitud_termica": 31.71,
  92. "precip_acumulada": 10.77,
  93. "dias_para_igualar_temporada": -4
  94. }
  95. ]
  96. `,
  97. general: `
  98. [
  99. {
  100. "station": {
  101. "name": "consequat",
  102. "code": "b7d147cb-a5f0-4a55-b6d9-8934b7085f13"
  103. },
  104. "from": "2015-02-15T02:03:07 +03:00",
  105. "to": "2018-05-19T10:42:45 +03:00",
  106. "lt10": 23.81,
  107. "gt30": 30.49,
  108. "gt33": 25.3,
  109. "grados_acumulados": 20.88,
  110. "amplitud_termica": 36,
  111. "precip_acumulada": 21.64
  112. },
  113. {
  114. "station": {
  115. "name": "dolor",
  116. "code": "b3414719-92ad-4977-985b-e9e6f5d09312"
  117. },
  118. "from": "2014-03-22T06:51:34 +03:00",
  119. "to": "2018-01-27T07:58:57 +03:00",
  120. "lt10": 37.58,
  121. "gt30": 12.2,
  122. "gt33": 32.12,
  123. "grados_acumulados": 31.02,
  124. "amplitud_termica": 39.29,
  125. "precip_acumulada": 12.01
  126. },
  127. {
  128. "station": {
  129. "name": "dolore",
  130. "code": "889d2e8b-45fd-4342-88ae-1de44b58409c"
  131. },
  132. "from": "2020-09-27T02:05:22 +03:00",
  133. "to": "2021-09-16T10:24:50 +03:00",
  134. "lt10": 32.2,
  135. "gt30": 30.93,
  136. "gt33": 32.54,
  137. "grados_acumulados": 26.78,
  138. "amplitud_termica": 24.5,
  139. "precip_acumulada": 21.59
  140. },
  141. {
  142. "station": {
  143. "name": "eu",
  144. "code": "62fada45-6f04-40b4-95a1-99959b82145c"
  145. },
  146. "from": "2019-02-08T12:46:41 +03:00",
  147. "to": "2021-06-01T07:29:53 +03:00",
  148. "lt10": 14.25,
  149. "gt30": 10.34,
  150. "gt33": 30.31,
  151. "grados_acumulados": 29,
  152. "amplitud_termica": 25.09,
  153. "precip_acumulada": 33.63
  154. },
  155. {
  156. "station": {
  157. "name": "officia",
  158. "code": "6cca9007-ea5b-496b-9e7b-a520416a6564"
  159. },
  160. "from": "2018-06-26T08:18:13 +03:00",
  161. "to": "2020-03-27T09:04:18 +03:00",
  162. "lt10": 38.79,
  163. "gt30": 34.99,
  164. "gt33": 36.03,
  165. "grados_acumulados": 18.87,
  166. "amplitud_termica": 26.55,
  167. "precip_acumulada": 30.38
  168. }
  169. ]
  170. `,
  171. };