您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

267 行
8.0KB

  1. import { APICommonResponse, ApiId, HttpMethod, makeParam, request } from "api";
  2. import { getUrl } from "./url";
  3. export type 店舗 = {
  4. shop_id: string;
  5. deposit: number;
  6. name: string;
  7. qr_service_expire_min: number;
  8. under_amount_when_create: number;
  9. under_amount_when_auth: number;
  10. under_amount_when_use: number;
  11. };
  12. export type QRサービス券認証設定 = {
  13. shop_no: number;
  14. parking_management_code: string;
  15. parking_name: string;
  16. discount_ticket_code: number | null;
  17. };
  18. export type QRサービス券取得設定 = {
  19. qr_service_parking_group_id: string;
  20. qr_service_parking_group_name: string;
  21. parking_management_code: string;
  22. parking_name: string;
  23. shop_no: number;
  24. discount_ticket_code: number;
  25. };
  26. // -------店舗一覧取得---------------
  27. export type 店舗一覧取得Request = {
  28. shop_id?: string;
  29. email?: string;
  30. name?: string;
  31. };
  32. export type 店舗一覧取得Response = {
  33. data: {
  34. list: 店舗[];
  35. };
  36. } & APICommonResponse;
  37. export const 店舗一覧取得 = async (param: 店舗一覧取得Request) => {
  38. const res = await request<店舗一覧取得Response>({
  39. url: getUrl(ApiId.店舗一覧取得),
  40. method: HttpMethod.GET,
  41. data: new URLSearchParams(param),
  42. });
  43. return res;
  44. };
  45. // -------店舗新規登録---------------
  46. export type 店舗新規登録Request = {
  47. name: string;
  48. };
  49. export type 店舗新規登録Response = {
  50. data: {
  51. shop_id: string;
  52. };
  53. } & APICommonResponse;
  54. export const 店舗新規登録 = async (param: 店舗新規登録Request) => {
  55. const res = await request<店舗新規登録Response>({
  56. url: getUrl(ApiId.店舗新規登録),
  57. method: HttpMethod.POST,
  58. data: makeParam(param),
  59. });
  60. return res;
  61. };
  62. // -------デポジット情報取得---------------
  63. export type デポジット情報取得Request = {};
  64. export type デポジット情報取得Response = {
  65. data: {
  66. deposit: number;
  67. };
  68. } & APICommonResponse;
  69. export const デポジット情報取得 = async (param: デポジット情報取得Request) => {
  70. const res = await request<デポジット情報取得Response>({
  71. url: getUrl(ApiId.デポジット情報取得),
  72. method: HttpMethod.GET,
  73. });
  74. return res;
  75. };
  76. // -------デポジットチャージ---------------
  77. export type デポジットチャージRequest = {
  78. shop_id: string;
  79. amount: string;
  80. };
  81. export type デポジットチャージResponse = {
  82. data: {
  83. shop_id: string;
  84. deposit: number;
  85. };
  86. } & APICommonResponse;
  87. export const デポジットチャージ = async (param: デポジットチャージRequest) => {
  88. const res = await request<デポジットチャージResponse>({
  89. url: getUrl(ApiId.デポジットチャージ),
  90. method: HttpMethod.POST,
  91. data: makeParam(param),
  92. });
  93. return res;
  94. };
  95. // -------店舗設定---------------
  96. export type 店舗設定Request = {
  97. shop_id: string;
  98. qr_service_expire_min: string;
  99. under_amount_when_create: string;
  100. under_amount_when_auth: string;
  101. under_amount_when_use: string;
  102. };
  103. export type 店舗設定Response = {
  104. data: {
  105. shop_id: string;
  106. };
  107. } & APICommonResponse;
  108. export const 店舗設定 = async (param: 店舗設定Request) => {
  109. const res = await request<店舗設定Response>({
  110. url: getUrl(ApiId.店舗設定),
  111. method: HttpMethod.POST,
  112. data: makeParam(param),
  113. });
  114. return res;
  115. };
  116. // -------店舗QR設定取得---------------
  117. export type 店舗QR設定取得Request = {
  118. shop_id: string;
  119. };
  120. export type 店舗QR設定取得Response = {
  121. data: {
  122. shop_id: string;
  123. certification: QRサービス券認証設定[];
  124. acquisition: QRサービス券取得設定 | null;
  125. };
  126. } & APICommonResponse;
  127. export const 店舗QR設定取得 = async (param: 店舗QR設定取得Request) => {
  128. const res = await request<店舗QR設定取得Response>({
  129. url: getUrl(ApiId.店舗QR設定取得),
  130. method: HttpMethod.GET,
  131. data: new URLSearchParams(param),
  132. });
  133. return res;
  134. };
  135. // -------店舗QR設定認証設定新規登録---------------
  136. export type 店舗QR設定認証設定新規登録Request = {
  137. shop_id: string;
  138. parking_management_code: string;
  139. shop_no: string;
  140. };
  141. export type 店舗QR設定認証設定新規登録Response = {} & APICommonResponse;
  142. export const 店舗QR設定認証設定新規登録 = async (
  143. param: 店舗QR設定認証設定新規登録Request
  144. ) => {
  145. const res = await request<店舗QR設定認証設定新規登録Response>({
  146. url: getUrl(ApiId.店舗QR設定認証設定新規登録),
  147. method: HttpMethod.POST,
  148. data: makeParam(param),
  149. });
  150. return res;
  151. };
  152. // -------店舗QR設定認証設定更新---------------
  153. export type 店舗QR設定認証設定更新Request = {
  154. shop_id: string;
  155. parking_management_code: string;
  156. shop_no: string;
  157. };
  158. export type 店舗QR設定認証設定更新Response = {} & APICommonResponse;
  159. export const 店舗QR設定認証設定更新 = async (
  160. param: 店舗QR設定認証設定更新Request
  161. ) => {
  162. const res = await request<店舗QR設定認証設定更新Response>({
  163. url: getUrl(ApiId.店舗QR設定認証設定更新),
  164. method: HttpMethod.POST,
  165. data: makeParam(param),
  166. });
  167. return res;
  168. };
  169. // -------店舗QR設定認証設定追加---------------
  170. export type 店舗QR設定認証設定追加Request = {
  171. shop_id: string;
  172. parking_management_code: string;
  173. discount_ticket_code: string;
  174. };
  175. export type 店舗QR設定認証設定追加Response = {} & APICommonResponse;
  176. export const 店舗QR設定認証設定追加 = async (
  177. param: 店舗QR設定認証設定追加Request
  178. ) => {
  179. const res = await request<店舗QR設定認証設定追加Response>({
  180. url: getUrl(ApiId.店舗QR設定認証設定追加),
  181. method: HttpMethod.POST,
  182. data: makeParam(param),
  183. });
  184. return res;
  185. };
  186. // -------店舗QR設定認証設定削除---------------
  187. export type 店舗QR設定認証設定削除Request = {
  188. shop_id: string;
  189. parking_management_code: string;
  190. discount_ticket_code: string;
  191. };
  192. export type 店舗QR設定認証設定削除Response = {} & APICommonResponse;
  193. export const 店舗QR設定認証設定削除 = async (
  194. param: 店舗QR設定認証設定削除Request
  195. ) => {
  196. const res = await request<店舗QR設定認証設定削除Response>({
  197. url: getUrl(ApiId.店舗QR設定認証設定削除),
  198. method: HttpMethod.POST,
  199. data: makeParam(param),
  200. });
  201. return res;
  202. };
  203. // -------店舗QR設定認証設定削除---------------
  204. export type 店舗QR設定認証設定全削除Request = {
  205. shop_id: string;
  206. parking_management_code: string;
  207. };
  208. export type 店舗QR設定認証設定全削除Response = {} & APICommonResponse;
  209. export const 店舗QR設定認証設定全削除 = async (
  210. param: 店舗QR設定認証設定全削除Request
  211. ) => {
  212. const res = await request<店舗QR設定認証設定全削除Response>({
  213. url: getUrl(ApiId.店舗QR設定認証設定全削除),
  214. method: HttpMethod.POST,
  215. data: makeParam(param),
  216. });
  217. return res;
  218. };
  219. // -------店舗QR設定取得設定変更---------------
  220. export type 店舗QR設定取得設定変更Request = {
  221. shop_id: string;
  222. qr_service_parking_group_id: string;
  223. shop_no: string;
  224. discount_ticket_code: string;
  225. };
  226. export type 店舗QR設定取得設定変更Response = {} & APICommonResponse;
  227. export const 店舗QR設定取得設定変更 = async (
  228. param: 店舗QR設定取得設定変更Request
  229. ) => {
  230. const res = await request<店舗QR設定取得設定変更Response>({
  231. url: getUrl(ApiId.店舗QR設定取得設定変更),
  232. method: HttpMethod.POST,
  233. data: makeParam(param),
  234. });
  235. return res;
  236. };
  237. // -------店舗QR設定取得設定無効化---------------
  238. export type 店舗QR設定取得設定無効化Request = {
  239. shop_id: string;
  240. };
  241. export type 店舗QR設定取得設定無効化Response = {} & APICommonResponse;
  242. export const 店舗QR設定取得設定無効化 = async (
  243. param: 店舗QR設定取得設定無効化Request
  244. ) => {
  245. const res = await request<店舗QR設定取得設定無効化Response>({
  246. url: getUrl(ApiId.店舗QR設定取得設定無効化),
  247. method: HttpMethod.POST,
  248. data: makeParam(param),
  249. });
  250. return res;
  251. };