From e8303181403edccea899a1e85104135fee23e708 Mon Sep 17 00:00:00 2001 From: "sosuke.iwabuchi" Date: Fri, 26 Apr 2024 13:09:08 +0900 Subject: [PATCH] =?UTF-8?q?IC=E5=AE=9A=E6=9C=9F=E9=80=A3=E6=90=BA=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/各種申請/buttons/common.ts | 14 + .../利用者情報変更承認ボタン.ts | 65 +++++ .../buttons/口座変更承認ボタン.ts | 61 ++++ .../buttons/解約承認ボタン.ts | 56 ++++ .../車両番号変更承認ボタン.ts | 55 ++++ ...行手数料入金予定作成ボタン.ts | 49 ++++ ...車場利用方法変更承認ボタン.ts | 97 ++++++ src/apps/各種申請/index.tsx | 275 +----------------- .../保証金入金予定作成ボタン.ts | 27 +- .../初月分入金予定作成ボタン.ts | 27 +- .../buttons/受付メール送信ボタン.ts | 4 + .../buttons/承認メール送信ボタン.ts | 4 + .../日割り入金予定作成ボタン.ts | 27 +- .../buttons/自動承認ボタン.ts | 23 +- src/apps/定期申込予約/自動承認.ts | 184 +++++++++--- .../buttons/IC定期削除ボタン.ts | 54 ++++ .../buttons/IC定期同期ボタン.ts | 74 +++++ src/apps/車室情報管理/index.ts | 95 ++++++ .../顧客マスタ/customize-manifest.json | 12 + src/apps/顧客マスタ/index.ts | 79 +++++ src/common/message.ts | 27 ++ src/middleware/swal.ts | 16 + src/mypage/IC定期.ts | 145 +++++++++ src/mypage/index.ts | 9 + src/mypage/lib.ts | 21 +- src/rest-api/ParkingNavi駐車場プラン.ts | 39 +++ src/types/ParkingNavi駐車場プラン.ts | 1 - src/types/各種申請.ts | 6 + src/types/定期申込予約.ts | 2 + .../定期駐車場プランマスタ.ts | 9 + src/types/車室情報管理.ts | 25 ++ src/types/顧客マスタ.ts | 3 + 32 files changed, 1253 insertions(+), 332 deletions(-) create mode 100644 src/apps/各種申請/buttons/common.ts create mode 100644 src/apps/各種申請/buttons/利用者情報変更承認ボタン.ts create mode 100644 src/apps/各種申請/buttons/口座変更承認ボタン.ts create mode 100644 src/apps/各種申請/buttons/解約承認ボタン.ts create mode 100644 src/apps/各種申請/buttons/車両番号変更承認ボタン.ts create mode 100644 src/apps/各種申請/buttons/車庫証明発行手数料入金予定作成ボタン.ts create mode 100644 src/apps/各種申請/buttons/駐車場利用方法変更承認ボタン.ts create mode 100644 src/apps/車室情報管理/buttons/IC定期削除ボタン.ts create mode 100644 src/apps/車室情報管理/buttons/IC定期同期ボタン.ts create mode 100644 src/apps/顧客マスタ/customize-manifest.json create mode 100644 src/apps/顧客マスタ/index.ts create mode 100644 src/common/message.ts create mode 100644 src/mypage/IC定期.ts create mode 100644 src/rest-api/ParkingNavi駐車場プラン.ts diff --git a/src/apps/各種申請/buttons/common.ts b/src/apps/各種申請/buttons/common.ts new file mode 100644 index 0000000..5d4a25e --- /dev/null +++ b/src/apps/各種申請/buttons/common.ts @@ -0,0 +1,14 @@ +import { AppID } from "@/common/appids"; +import { makeRecordData } from "@/common/rest-api-client"; +import bulkRequest from "@/rest-api/bulk"; +import { 各種申請, 各種申請フィールド名, 状況Dropdown } from "@/types/各種申請"; + +export const 各種申請完了 = (record: 各種申請) => { + bulkRequest.update({ + app: AppID.各種申請, + id: record.$id.value, + record: makeRecordData({ + [各種申請フィールド名.状況]: 状況Dropdown.完了, + }), + }); +}; diff --git a/src/apps/各種申請/buttons/利用者情報変更承認ボタン.ts b/src/apps/各種申請/buttons/利用者情報変更承認ボタン.ts new file mode 100644 index 0000000..ee78526 --- /dev/null +++ b/src/apps/各種申請/buttons/利用者情報変更承認ボタン.ts @@ -0,0 +1,65 @@ +import { apptemplate } from "@/common/app-template"; +import { AppID } from "@/common/appids"; +import { setHeaderButton } from "@/common/header-button"; +import { makeRecordData } from "@/common/rest-api-client"; +import { Message } from "@/exception"; +import { ShowConfirmDialog, SuccessDialog } from "@/middleware/swal"; +import { EmailID, sendEmail } from "@/mypage/メール"; +import bulkRequest from "@/rest-api/bulk"; +import { get顧客マスタ } from "@/rest-api/顧客マスタ"; +import { 各種申請, 状況Dropdown, 申請種別Dropdown } from "@/types/各種申請"; +import { 顧客マスタフィールド名 } from "@/types/顧客マスタ"; +import { 各種申請完了 } from "./common"; + +export const 利用者情報変更承認ボタン = (record: 各種申請) => { + if ( + record.状況.value !== 状況Dropdown.完了 && + record.申請種別.value === 申請種別Dropdown.利用者情報変更 + ) { + setHeaderButton( + "利用者情報変更申請 承認", + apptemplate(async ({ needReloadAtEnd }) => { + const confirm = await ShowConfirmDialog({ title: "承認しますか" }); + if (!confirm.isConfirmed) return; + // 顧客マスタへの反映 + const customer = await get顧客マスタ({ + 顧客コード: Number(record.顧客コード.value), + }); + if (customer === null) throw new Error("顧客不正"); + bulkRequest.update({ + app: AppID.顧客マスタ, + id: customer.$id.value, + record: makeRecordData({ + [顧客マスタフィールド名.顧客名]: + record.利用者情報変更申請_変更後_氏名.value ?? "", + [顧客マスタフィールド名.顧客名カナ]: + record.利用者情報変更申請_変更後_氏名カナ.value ?? "", + [顧客マスタフィールド名.契約者_郵便番号]: + record.利用者情報変更申請_変更後_郵便番号.value ?? "", + [顧客マスタフィールド名.住所]: + record.利用者情報変更申請_変更後_住所.value ?? "", + [顧客マスタフィールド名.電話番号]: + record.利用者情報変更申請_変更後_電話番号.value ?? "", + }), + }); + + // 申請の完了 + await 各種申請完了(record); + + // データ保存 + await bulkRequest.save(); + + // メールの送信 + const email = await sendEmail(EmailID.利用者情報変更完了, { + application_no: record.申請番号.value, + }); + if (!email) { + throw new Message("メール送信失敗 データは反映済み"); + } + + await SuccessDialog.fire(); + needReloadAtEnd(true); + }) + ); + } +}; diff --git a/src/apps/各種申請/buttons/口座変更承認ボタン.ts b/src/apps/各種申請/buttons/口座変更承認ボタン.ts new file mode 100644 index 0000000..d288b73 --- /dev/null +++ b/src/apps/各種申請/buttons/口座変更承認ボタン.ts @@ -0,0 +1,61 @@ +import { apptemplate } from "@/common/app-template"; +import { AppID } from "@/common/appids"; +import { setHeaderButton } from "@/common/header-button"; +import { makeRecordData } from "@/common/rest-api-client"; +import { ShowConfirmDialog, SuccessDialog } from "@/middleware/swal"; +import bulkRequest from "@/rest-api/bulk"; +import { get顧客マスタ } from "@/rest-api/顧客マスタ"; +import { 各種申請, 状況Dropdown, 申請種別Dropdown } from "@/types/各種申請"; +import { 顧客マスタフィールド名 } from "@/types/顧客マスタ"; +import { 各種申請完了 } from "./common"; + +export const 口座変更承認ボタン = (record: 各種申請) => { + if ( + record.状況.value !== 状況Dropdown.完了 && + record.申請種別.value === 申請種別Dropdown.口座変更申請 + ) { + setHeaderButton( + "口座変更申請 承認", + apptemplate(async ({ needReloadAtEnd }) => { + const confirm = await ShowConfirmDialog({ title: "承認しますか" }); + if (!confirm.isConfirmed) return; + + const customer = await get顧客マスタ({ + 顧客コード: Number(record.顧客コード.value), + }); + if (customer === null) throw new Error("顧客不正"); + + // 顧客マスタへの反映 + await bulkRequest.update({ + app: AppID.顧客マスタ, + id: customer.$id.value, + record: makeRecordData({ + [顧客マスタフィールド名.支払方法]: "口座振替", + [顧客マスタフィールド名.口座登録催促予定日時]: "", + [顧客マスタフィールド名.銀行支店コード]: + record.口座変更申請_変更後_銀行支店ID.value, + [顧客マスタフィールド名.引落預金種別]: + record.口座変更申請_変更後_口座種目.value, + [顧客マスタフィールド名.引落口座名義人カナ]: + record.口座変更申請_変更後_口座名義カナ.value, + [顧客マスタフィールド名.引落口座番号]: + record.口座変更申請_変更後_口座番号.value, + [顧客マスタフィールド名.ゆうちょ口座記号]: + record.口座変更申請_変更後_ゆうちょ口座記号.value, + [顧客マスタフィールド名.ゆうちょ口座番号]: + record.口座変更申請_変更後_ゆうちょ口座番号.value, + }), + }); + + // 各種申請の完了 + await 各種申請完了(record); + + // 保存 + await bulkRequest.save(); + + await SuccessDialog.fire(); + needReloadAtEnd(true); + }) + ); + } +}; diff --git a/src/apps/各種申請/buttons/解約承認ボタン.ts b/src/apps/各種申請/buttons/解約承認ボタン.ts new file mode 100644 index 0000000..aa523a9 --- /dev/null +++ b/src/apps/各種申請/buttons/解約承認ボタン.ts @@ -0,0 +1,56 @@ +import { apptemplate } from "@/common/app-template"; +import { AppID } from "@/common/appids"; +import { setHeaderButton } from "@/common/header-button"; +import { makeRecordData } from "@/common/rest-api-client"; +import { 契約情報更新イベント } from "@/event/契約情報更新"; +import { ShowConfirmDialog, SuccessDialog } from "@/middleware/swal"; +import { EmailID, sendEmail } from "@/mypage/メール"; +import bulkRequest from "@/rest-api/bulk"; +import { get車室情報管理 } from "@/rest-api/車室情報管理"; +import { 各種申請, 状況Dropdown, 申請種別Dropdown } from "@/types/各種申請"; +import { 車室情報管理フィールド名 } from "@/types/車室情報管理"; +import { 各種申請完了 } from "./common"; + +export const 解約承認ボタン = (record: 各種申請) => { + if ( + record.状況.value !== 状況Dropdown.完了 && + record.申請種別.value === 申請種別Dropdown.解約申請 + ) { + setHeaderButton( + "解約申請 承認", + apptemplate(async ({ setEvent, needReloadAtEnd }) => { + const confirm = await ShowConfirmDialog({ title: "承認しますか" }); + if (!confirm.isConfirmed) return; + // 車室情報管理への反映 + bulkRequest.update({ + app: AppID.車室情報管理, + id: record.契約情報.value, + record: makeRecordData({ + [車室情報管理フィールド名.解約日]: + record.解約申請_解約希望日.value ?? "", + }), + }); + + // 申請の完了 + await 各種申請完了(record); + + // データ保存 + await bulkRequest.save(); + + // メールの送信 + const email = await sendEmail(EmailID.解約承認, { + application_no: record.申請番号.value, + }); + if (!email) { + throw new Error("メール送信失敗"); + } + + const 契約 = await get車室情報管理(record.契約情報.value); + setEvent(new 契約情報更新イベント().getEvent(契約)); + + await SuccessDialog.fire(); + needReloadAtEnd(true); + }) + ); + } +}; diff --git a/src/apps/各種申請/buttons/車両番号変更承認ボタン.ts b/src/apps/各種申請/buttons/車両番号変更承認ボタン.ts new file mode 100644 index 0000000..ebf8f65 --- /dev/null +++ b/src/apps/各種申請/buttons/車両番号変更承認ボタン.ts @@ -0,0 +1,55 @@ +import { apptemplate } from "@/common/app-template"; +import { AppID } from "@/common/appids"; +import { setHeaderButton } from "@/common/header-button"; +import { makeRecordData } from "@/common/rest-api-client"; +import { ShowConfirmDialog, SuccessDialog } from "@/middleware/swal"; +import { EmailID, sendEmail } from "@/mypage/メール"; +import bulkRequest from "@/rest-api/bulk"; +import { 各種申請, 状況Dropdown, 申請種別Dropdown } from "@/types/各種申請"; +import { 車室情報管理フィールド名 } from "@/types/車室情報管理"; +import { 各種申請完了 } from "./common"; +import { Message } from "@/exception"; + +export const 車両番号変更承認ボタン = (record: 各種申請) => { + if ( + record.状況.value !== 状況Dropdown.完了 && + record.申請種別.value === 申請種別Dropdown.車両番号_防犯登録番号変更 + ) { + setHeaderButton( + "車両番号・防犯登録番号変更申請 承認", + apptemplate(async ({ needReloadAtEnd }) => { + const confirm = await ShowConfirmDialog({ title: "承認しますか" }); + if (!confirm.isConfirmed) return; + // 車室情報管理アプリへの反映 + const F = 車室情報管理フィールド名; + bulkRequest.update({ + app: AppID.車室情報管理, + id: record.$id.value, + record: makeRecordData({ + [F.車両番号]: + record.車両番号_防犯番号変更申請_変更後_車両番号.value ?? "", + [F.防犯登録番号]: + record.車両番号_防犯番号変更申請_変更後_防犯登録番号.value ?? "", + }), + }); + + // 申請の完了 + await 各種申請完了(record); + + // データ保存 + await bulkRequest.save(); + + // メールの送信 + const email = await sendEmail(EmailID.車両番号_防犯登録番号変更完了, { + application_no: record.申請番号.value, + }); + if (!email) { + throw new Message("メール送信失敗 データは反映済み"); + } + + await SuccessDialog.fire(); + needReloadAtEnd(true); + }) + ); + } +}; diff --git a/src/apps/各種申請/buttons/車庫証明発行手数料入金予定作成ボタン.ts b/src/apps/各種申請/buttons/車庫証明発行手数料入金予定作成ボタン.ts new file mode 100644 index 0000000..7721604 --- /dev/null +++ b/src/apps/各種申請/buttons/車庫証明発行手数料入金予定作成ボタン.ts @@ -0,0 +1,49 @@ +import { apptemplate } from "@/common/app-template"; +import { AppID } from "@/common/appids"; +import { setHeaderButton } from "@/common/header-button"; +import { getCreateUrl } from "@/rest-api/url"; +import { + 入金予定結果フィールド名, + 支払方法Dropdown, + 支払種別Dropdown, +} from "@/types/入金予定結果"; +import { + 各種申請, + 申請種別Dropdown, + 車庫証明支払方法Dropdown, +} from "@/types/各種申請"; + +export const 車庫証明発行手数料入金予定作成ボタン = (record: 各種申請) => { + if (record.申請種別.value === 申請種別Dropdown.車庫証明発行申請) { + setHeaderButton( + "車庫証明発行手数料入金予定作成", + apptemplate(async () => { + const param: any = { + [入金予定結果フィールド名.支払予定金額]: "3000", + [入金予定結果フィールド名.車室情報管理レコード番号]: record.$id.value, + [入金予定結果フィールド名.支払種別]: 支払種別Dropdown.事務手数料, + }; + param[入金予定結果フィールド名.支払方法] = (() => { + if ( + record.車庫証明発行申請_支払方法.value === + 車庫証明支払方法Dropdown.口座引落 + ) { + return 支払方法Dropdown.SMBC口座振替; + } + if ( + record.車庫証明発行申請_支払方法.value === + 車庫証明支払方法Dropdown.お振込 + ) { + return 支払方法Dropdown.振込; + } + return ""; + })(); + const url = getCreateUrl( + AppID.入金予定結果, + new URLSearchParams(param) + ); + window.open(url, "_blank"); + }) + ); + } +}; diff --git a/src/apps/各種申請/buttons/駐車場利用方法変更承認ボタン.ts b/src/apps/各種申請/buttons/駐車場利用方法変更承認ボタン.ts new file mode 100644 index 0000000..f21b870 --- /dev/null +++ b/src/apps/各種申請/buttons/駐車場利用方法変更承認ボタン.ts @@ -0,0 +1,97 @@ +import { apptemplate } from "@/common/app-template"; +import { AppID } from "@/common/appids"; +import { setHeaderButton } from "@/common/header-button"; +import { makeRecordData } from "@/common/rest-api-client"; +import { 契約情報更新イベント } from "@/event/契約情報更新"; +import { + ErrorDialog, + FormDialog, + ShowConfirmDialog, + ShowFormDialog, + SuccessDialog, +} from "@/middleware/swal"; +import { EmailID, sendEmail } from "@/mypage/メール"; +import bulkRequest from "@/rest-api/bulk"; +import { get車室情報管理 } from "@/rest-api/車室情報管理"; +import { 各種申請, 状況Dropdown, 申請種別Dropdown } from "@/types/各種申請"; +import { 車室情報管理フィールド名 } from "@/types/車室情報管理"; +import { 各種申請完了 } from "./common"; +import { 定期契約更新 } from "@/mypage/IC定期"; +import { Message } from "@/exception"; +import { MessageBag } from "@/common/message"; + +export const 駐車場利用方法変更承認ボタン = (record: 各種申請) => { + if ( + record.状況.value !== 状況Dropdown.完了 && + record.申請種別.value === 申請種別Dropdown.IC定期_駐車場利用方法変更申請 + ) { + setHeaderButton( + "駐車場利用方法変更申請 承認", + apptemplate(async ({ setEvent, needReloadAtEnd }) => { + const confirm = await ShowConfirmDialog({ title: "承認しますか" }); + if (!confirm.isConfirmed) return; + + let 契約 = await get車室情報管理(record.契約情報.value); + + let 定期券番号 = ""; + if ( + record.IC定期_駐車場利用方法変更申請_変更後.value === "貸与ICカード" + ) { + const form = await ShowFormDialog({ + text: "定期券番号を入力してください", + input: "number", + }); + if (!form.isConfirmed) return; + 定期券番号 = form.value; + } + + const message = new MessageBag(); + const res = await 定期契約更新( + { + user_id: 契約.IC定期関連情報_利用者ID.value, + parking_management_code: 契約.IC定期関連情報_駐車場管理コード.value, + season_ticket_seq_no: 定期券番号, // 自動採番 + vehicle_type_name: 契約.IC定期関連情報_車種.value, + parking_use_type_name: + record.IC定期_駐車場利用方法変更申請_変更後.value, + contractor_type_name: 契約.IC定期関連情報_契約者種類.value, + expiration_start_date: 契約.IC定期関連情報_有効期限開始.value ?? "", + expiration_end_date: 契約.IC定期関連情報_有効期限開始.value ?? "", + position_memo: 契約.IC定期関連情報_駐車位置情報.value, + memo: 契約.IC定期関連情報_備考.value, + }, + message + ); + + if (res === false) { + throw new Message("IC定期連携失敗 " + message.getGeneralMessage()); + } + + // 車室情報管理への反映 + bulkRequest.update({ + app: AppID.車室情報管理, + id: record.契約情報.value, + record: makeRecordData({ + [車室情報管理フィールド名.IC定期関連情報_駐車場利用方法]: + record.IC定期_駐車場利用方法変更申請_変更後.value ?? "", + [車室情報管理フィールド名.IC定期関連情報_定期券番号]: String( + res.season_ticket_seq_no + ), + }), + }); + + // 申請の完了 + await 各種申請完了(record); + + // データ保存 + await bulkRequest.save(); + + 契約 = await get車室情報管理(record.契約情報.value); + setEvent(new 契約情報更新イベント().getEvent(契約)); + + await SuccessDialog.fire(); + needReloadAtEnd(true); + }) + ); + } +}; diff --git a/src/apps/各種申請/index.tsx b/src/apps/各種申請/index.tsx index 52de535..dbf7006 100644 --- a/src/apps/各種申請/index.tsx +++ b/src/apps/各種申請/index.tsx @@ -1,267 +1,15 @@ -import { apptemplate, eventHnalder } from "@/common/app-template"; -import { AppID } from "@/common/appids"; -import { initMenuBox, setHeaderButton } from "@/common/header-button"; +import { eventHnalder } from "@/common/app-template"; +import { initMenuBox } from "@/common/header-button"; import { KintoneEvent } from "@/common/kintone-event"; -import { makeRecordData } from "@/common/rest-api-client"; -import { 契約情報更新イベント } from "@/event/契約情報更新"; -import { Message } from "@/exception"; -import { ShowConfirmDialog, SuccessDialog } from "@/middleware/swal"; -import { EmailID, sendEmail } from "@/mypage/メール"; -import bulkRequest from "@/rest-api/bulk"; -import { get車室情報管理 } from "@/rest-api/車室情報管理"; -import { get顧客マスタ } from "@/rest-api/顧客マスタ"; -import { - 各種申請, - 各種申請フィールド名, - 状況Dropdown, - 申請種別Dropdown, - 申請詳細グループ, - 車庫証明支払方法Dropdown, -} from "@/types/各種申請"; -import { 車室情報管理フィールド名 } from "@/types/車室情報管理"; -import { 顧客マスタフィールド名 } from "@/types/顧客マスタ"; -import { setup } from ".."; +import { 各種申請, 申請詳細グループ } from "@/types/各種申請"; import { get } from "lodash"; -import { getCreateUrl } from "@/rest-api/url"; -import { - 入金予定結果フィールド名, - 支払方法Dropdown, - 支払種別Dropdown, -} from "@/types/入金予定結果"; - -const 各種申請完了 = (record: 各種申請) => { - bulkRequest.update({ - app: AppID.各種申請, - id: record.$id.value, - record: makeRecordData({ - [各種申請フィールド名.状況]: 状況Dropdown.完了, - }), - }); -}; - -const 解約承認ボタン = (record: 各種申請) => { - if ( - record.状況.value !== 状況Dropdown.完了 && - record.申請種別.value === 申請種別Dropdown.解約申請 - ) { - setHeaderButton( - "解約申請 承認", - apptemplate(async ({ setEvent, needReloadAtEnd }) => { - const confirm = await ShowConfirmDialog({ title: "承認しますか" }); - if (!confirm.isConfirmed) return; - // 車室情報管理への反映 - bulkRequest.update({ - app: AppID.車室情報管理, - id: record.契約情報.value, - record: makeRecordData({ - [車室情報管理フィールド名.解約日]: - record.解約申請_解約希望日.value ?? "", - }), - }); - - // 申請の完了 - await 各種申請完了(record); - - // データ保存 - await bulkRequest.save(); - - // メールの送信 - const email = await sendEmail(EmailID.解約承認, { - application_no: record.申請番号.value, - }); - if (!email) { - throw new Error("メール送信失敗"); - } - - const 契約 = await get車室情報管理(record.契約情報.value); - setEvent(new 契約情報更新イベント().getEvent(契約)); - - await SuccessDialog.fire(); - needReloadAtEnd(true); - }) - ); - } -}; - -const 口座変更承認ボタン = (record: 各種申請) => { - if ( - record.状況.value !== 状況Dropdown.完了 && - record.申請種別.value === 申請種別Dropdown.口座変更申請 - ) { - setHeaderButton( - "口座変更申請 承認", - apptemplate(async ({ needReloadAtEnd }) => { - const confirm = await ShowConfirmDialog({ title: "承認しますか" }); - if (!confirm.isConfirmed) return; - - const customer = await get顧客マスタ({ - 顧客コード: Number(record.顧客コード.value), - }); - if (customer === null) throw new Error("顧客不正"); - - // 顧客マスタへの反映 - await bulkRequest.update({ - app: AppID.顧客マスタ, - id: customer.$id.value, - record: makeRecordData({ - [顧客マスタフィールド名.支払方法]: "口座振替", - [顧客マスタフィールド名.口座登録催促予定日時]: "", - [顧客マスタフィールド名.銀行支店コード]: - record.口座変更申請_変更後_銀行支店ID.value, - [顧客マスタフィールド名.引落預金種別]: - record.口座変更申請_変更後_口座種目.value, - [顧客マスタフィールド名.引落口座名義人カナ]: - record.口座変更申請_変更後_口座名義カナ.value, - [顧客マスタフィールド名.引落口座番号]: - record.口座変更申請_変更後_口座番号.value, - [顧客マスタフィールド名.ゆうちょ口座記号]: - record.口座変更申請_変更後_ゆうちょ口座記号.value, - [顧客マスタフィールド名.ゆうちょ口座番号]: - record.口座変更申請_変更後_ゆうちょ口座番号.value, - }), - }); - - // 各種申請の完了 - await 各種申請完了(record); - - // 保存 - await bulkRequest.save(); - - await SuccessDialog.fire(); - needReloadAtEnd(true); - }) - ); - } -}; -const 利用者情報変更承認ボタン = (record: 各種申請) => { - if ( - record.状況.value !== 状況Dropdown.完了 && - record.申請種別.value === 申請種別Dropdown.利用者情報変更 - ) { - setHeaderButton( - "利用者情報変更申請 承認", - apptemplate(async ({ needReloadAtEnd }) => { - const confirm = await ShowConfirmDialog({ title: "承認しますか" }); - if (!confirm.isConfirmed) return; - // 顧客マスタへの反映 - const customer = await get顧客マスタ({ - 顧客コード: Number(record.顧客コード.value), - }); - if (customer === null) throw new Error("顧客不正"); - bulkRequest.update({ - app: AppID.顧客マスタ, - id: customer.$id.value, - record: makeRecordData({ - [顧客マスタフィールド名.顧客名]: - record.利用者情報変更申請_変更後_氏名.value ?? "", - [顧客マスタフィールド名.顧客名カナ]: - record.利用者情報変更申請_変更後_氏名カナ.value ?? "", - [顧客マスタフィールド名.契約者_郵便番号]: - record.利用者情報変更申請_変更後_郵便番号.value ?? "", - [顧客マスタフィールド名.住所]: - record.利用者情報変更申請_変更後_住所.value ?? "", - [顧客マスタフィールド名.電話番号]: - record.利用者情報変更申請_変更後_電話番号.value ?? "", - }), - }); - - // 申請の完了 - await 各種申請完了(record); - - // データ保存 - await bulkRequest.save(); - - // メールの送信 - const email = await sendEmail(EmailID.利用者情報変更完了, { - application_no: record.申請番号.value, - }); - if (!email) { - throw new Message("メール送信失敗 データは反映済み"); - } - - await SuccessDialog.fire(); - needReloadAtEnd(true); - }) - ); - } -}; -const 車両番号変更承認ボタン = (record: 各種申請) => { - if ( - record.状況.value !== 状況Dropdown.完了 && - record.申請種別.value === 申請種別Dropdown.車両番号_防犯登録番号変更 - ) { - setHeaderButton( - "車両番号・防犯登録番号変更申請 承認", - apptemplate(async ({ needReloadAtEnd }) => { - const confirm = await ShowConfirmDialog({ title: "承認しますか" }); - if (!confirm.isConfirmed) return; - // 車室情報管理アプリへの反映 - const F = 車室情報管理フィールド名; - bulkRequest.update({ - app: AppID.車室情報管理, - id: record.$id.value, - record: makeRecordData({ - [F.車両番号]: - record.車両番号_防犯番号変更申請_変更後_車両番号.value ?? "", - [F.防犯登録番号]: - record.車両番号_防犯番号変更申請_変更後_防犯登録番号.value ?? "", - }), - }); - - // 申請の完了 - await 各種申請完了(record); - - // データ保存 - await bulkRequest.save(); - - // メールの送信 - const email = await sendEmail(EmailID.車両番号_防犯登録番号変更完了, { - application_no: record.申請番号.value, - }); - if (!email) { - throw new Message("メール送信失敗 データは反映済み"); - } - - await SuccessDialog.fire(); - needReloadAtEnd(true); - }) - ); - } -}; -const 車庫証明発行手数料入金予定作成 = (record: 各種申請) => { - if (record.申請種別.value === 申請種別Dropdown.車庫証明発行申請) { - setHeaderButton( - "車庫証明発行手数料入金予定作成", - apptemplate(async () => { - const param: any = { - [入金予定結果フィールド名.支払予定金額]: "3000", - [入金予定結果フィールド名.車室情報管理レコード番号]: record.$id.value, - [入金予定結果フィールド名.支払種別]: 支払種別Dropdown.事務手数料, - }; - param[入金予定結果フィールド名.支払方法] = (() => { - if ( - record.車庫証明発行申請_支払方法.value === - 車庫証明支払方法Dropdown.口座引落 - ) { - return 支払方法Dropdown.SMBC口座振替; - } - if ( - record.車庫証明発行申請_支払方法.value === - 車庫証明支払方法Dropdown.お振込 - ) { - return 支払方法Dropdown.振込; - } - return ""; - })(); - const url = getCreateUrl( - AppID.入金予定結果, - new URLSearchParams(param) - ); - window.open(url, "_blank"); - }) - ); - } -}; +import { setup } from ".."; +import { 口座変更承認ボタン } from "./buttons/口座変更承認ボタン"; +import { 解約承認ボタン } from "./buttons/解約承認ボタン"; +import { 利用者情報変更承認ボタン } from "./buttons/利用者情報変更承認ボタン"; +import { 車両番号変更承認ボタン } from "./buttons/車両番号変更承認ボタン"; +import { 車庫証明発行手数料入金予定作成ボタン } from "./buttons/車庫証明発行手数料入金予定作成ボタン"; +import { 駐車場利用方法変更承認ボタン } from "./buttons/駐車場利用方法変更承認ボタン"; setup(() => { kintone.events.on( @@ -275,7 +23,8 @@ setup(() => { 解約承認ボタン(record); 利用者情報変更承認ボタン(record); 車両番号変更承認ボタン(record); - 車庫証明発行手数料入金予定作成(record); + 車庫証明発行手数料入金予定作成ボタン(record); + 駐車場利用方法変更承認ボタン(record); }) ); diff --git a/src/apps/定期申込予約/buttons/保証金入金予定作成ボタン.ts b/src/apps/定期申込予約/buttons/保証金入金予定作成ボタン.ts index 02b0f6c..ccf20ec 100644 --- a/src/apps/定期申込予約/buttons/保証金入金予定作成ボタン.ts +++ b/src/apps/定期申込予約/buttons/保証金入金予定作成ボタン.ts @@ -17,12 +17,31 @@ import { 初回入金予定Checkbox, 定期申込予約 } from "@/types/定期 import { 車室情報管理フィールド名 } from "@/types/車室情報管理"; import { addDays } from "date-fns"; -export default function 保証金入金予定作成ボタン(record: 定期申込予約) { +const 表示判定 = (record: 定期申込予約): boolean => { + if (!record.自動承認契約情報.value) { + return false; + } + + if (record.IC定期駐車場利用方法.value) { + return false; + } + if ( - !!record.自動承認契約情報.value && - record.初回入金予定_必要分.value.includes(初回入金予定Checkbox.保証金) && - !record.初回入金予定_保証金入金予定.value + record.初回入金予定_必要分.value.includes(初回入金予定Checkbox.保証金) === + false ) { + return false; + } + + if (record.初回入金予定_保証金入金予定.value) { + false; + } + + return true; +}; + +export default function 保証金入金予定作成ボタン(record: 定期申込予約) { + if (表示判定(record)) { setHeaderButton( "保証金入金予定作成", apptemplate(async () => { diff --git a/src/apps/定期申込予約/buttons/初月分入金予定作成ボタン.ts b/src/apps/定期申込予約/buttons/初月分入金予定作成ボタン.ts index 16f5d3e..7c8e436 100644 --- a/src/apps/定期申込予約/buttons/初月分入金予定作成ボタン.ts +++ b/src/apps/定期申込予約/buttons/初月分入金予定作成ボタン.ts @@ -15,12 +15,31 @@ import { 初回入金予定Checkbox, 定期申込予約 } from "@/types/定期 import { 車室情報管理フィールド名 } from "@/types/車室情報管理"; import { addDays, addMonths, endOfMonth, setDate } from "date-fns"; -export default function 初月分入金予定作成ボタン(record: 定期申込予約) { +const 表示判定 = (record: 定期申込予約): boolean => { + if (!record.自動承認契約情報.value) { + return false; + } + + if (record.IC定期駐車場利用方法.value) { + return false; + } + if ( - !!record.自動承認契約情報.value && - record.初回入金予定_必要分.value.includes(初回入金予定Checkbox.初月分) && - !record.初回入金予定_初月分入金予定.value + record.初回入金予定_必要分.value.includes(初回入金予定Checkbox.初月分) === + false ) { + return false; + } + + if (record.初回入金予定_初月分入金予定.value) { + false; + } + + return true; +}; + +export default function 初月分入金予定作成ボタン(record: 定期申込予約) { + if (表示判定(record)) { setHeaderButton( "初月分入金予定作成", apptemplate(async () => { diff --git a/src/apps/定期申込予約/buttons/受付メール送信ボタン.ts b/src/apps/定期申込予約/buttons/受付メール送信ボタン.ts index 78973d4..935251f 100644 --- a/src/apps/定期申込予約/buttons/受付メール送信ボタン.ts +++ b/src/apps/定期申込予約/buttons/受付メール送信ボタン.ts @@ -41,6 +41,10 @@ const 表示判定 = (record: 定期申込予約): boolean => { return false; } + if (!!record.IC定期駐車場利用方法) { + return false; + } + return true; }; diff --git a/src/apps/定期申込予約/buttons/承認メール送信ボタン.ts b/src/apps/定期申込予約/buttons/承認メール送信ボタン.ts index 301233c..ca01992 100644 --- a/src/apps/定期申込予約/buttons/承認メール送信ボタン.ts +++ b/src/apps/定期申込予約/buttons/承認メール送信ボタン.ts @@ -18,6 +18,10 @@ const 表示判定 = (record: 定期申込予約): boolean => { return false; } + if (!!record.IC定期駐車場利用方法) { + return false; + } + return true; }; diff --git a/src/apps/定期申込予約/buttons/日割り入金予定作成ボタン.ts b/src/apps/定期申込予約/buttons/日割り入金予定作成ボタン.ts index 09314db..71d5149 100644 --- a/src/apps/定期申込予約/buttons/日割り入金予定作成ボタン.ts +++ b/src/apps/定期申込予約/buttons/日割り入金予定作成ボタン.ts @@ -16,12 +16,31 @@ import { 初回入金予定Checkbox, 定期申込予約 } from "@/types/定期 import { 車室情報管理フィールド名 } from "@/types/車室情報管理"; import { addDays, endOfMonth } from "date-fns"; -export default function 日割り入金予定作成ボタン(record: 定期申込予約) { +const 表示判定 = (record: 定期申込予約): boolean => { + if (!record.自動承認契約情報.value) { + return false; + } + + if (record.IC定期駐車場利用方法.value) { + return false; + } + if ( - !!record.自動承認契約情報.value && - record.初回入金予定_必要分.value.includes(初回入金予定Checkbox.日割り分) && - !record.初回入金予定_日割り分入金予定.value + record.初回入金予定_必要分.value.includes(初回入金予定Checkbox.日割り分) === + false ) { + return false; + } + + if (record.初回入金予定_日割り分入金予定.value) { + false; + } + + return true; +}; + +export default function 日割り入金予定作成ボタン(record: 定期申込予約) { + if (表示判定(record)) { setHeaderButton( "日割り分入金予定作成", apptemplate(async () => { diff --git a/src/apps/定期申込予約/buttons/自動承認ボタン.ts b/src/apps/定期申込予約/buttons/自動承認ボタン.ts index 865001c..3953b03 100644 --- a/src/apps/定期申込予約/buttons/自動承認ボタン.ts +++ b/src/apps/定期申込予約/buttons/自動承認ボタン.ts @@ -4,6 +4,7 @@ import { 契約情報更新イベント } from "@/event/契約情報更新"; import { Message } from "@/exception"; import { ShowConfirmDialog, + ShowFormDialog, SuccessDialog, WarningDialog, } from "@/middleware/swal"; @@ -39,15 +40,27 @@ export default function 自動承認ボタン(record: 定期申込予約) { const entry = new 申込(record); await entry.初期化(); + + if (record.IC定期駐車場利用方法.value === "貸与ICカード") { + const form = await ShowFormDialog({ + text: "定期券番号を入力してください", + input: "number", + }); + if (!form.isConfirmed) return; + entry.IC定期_定期券番号 = form.value; + } + await entry.選定(); await SuccessDialog.fire(); - await WarningDialog.fire({ - timer: 2000, - timerProgressBar: true, - text: "各初回請求データを作成してください", - }); + if (!entry.isIC定期申込()) { + await WarningDialog.fire({ + timer: 2000, + timerProgressBar: true, + text: "各初回請求データを作成してください", + }); + } const 契約 = entry.作成後契約取得(); if (!契約) throw new Error(); diff --git a/src/apps/定期申込予約/自動承認.ts b/src/apps/定期申込予約/自動承認.ts index 9a164fa..9e5328a 100644 --- a/src/apps/定期申込予約/自動承認.ts +++ b/src/apps/定期申込予約/自動承認.ts @@ -29,14 +29,21 @@ import { dateParse, formatDateStr, now } from "@/common/datetime"; import bulkRequest from "@/rest-api/bulk"; import apiClient from "@/middleware/api-client"; import { addMonths, getDate, setDate } from "date-fns"; +import { ParkingNavi駐車場プラン } from "@/types/ParkingNavi駐車場プラン"; +import { getParkingNavi駐車場プラン } from "@/rest-api/ParkingNavi駐車場プラン"; +import { 利用者情報新規作成, 定期契約新規作成 } from "@/mypage/IC定期"; +import { MessageBag } from "@/common/message"; export class 申込 { + public IC定期_定期券番号: string = ""; + private 定期申込予約: 定期申込予約; private 初期化済み: boolean = false; private 顧客情報: { - 顧客コード: number; - } | null = null; + 顧客コード?: number; + IC定期利用者IC?: number; + }; private 車室一覧: 車室情報2[] = []; private 契約一覧: 車室情報管理[] = []; @@ -47,6 +54,7 @@ export class 申込 { constructor(定期申込予約: 定期申込予約) { this.定期申込予約 = 定期申込予約; + this.顧客情報 = {}; } async 初期化() { @@ -54,10 +62,10 @@ export class 申込 { await this.契約対象車室取得(); // 対象のプランデータ取得 await this.契約情報取得(); - // 自動承認データの取得 - await this.自動承認グループ取得(); // 定期駐車場プランマスタデータの取得 await this.プラン取得(); + // 自動承認データの取得 + await this.自動承認グループ取得(); this.初期化済み = true; return this; @@ -85,6 +93,10 @@ export class 申込 { return this.作成後契約; } + isIC定期申込() { + return this.プラン?.IC定期駐車場.value[0] === "該当"; + } + private async 契約対象車室取得() { if (!this.定期申込予約.駐車場.value) { throw new Message("駐車場名の設定をしてください"); @@ -109,10 +121,14 @@ export class 申込 { if (!this.定期申込予約.定期駐車場プラン.value) { throw new Message("プラン名の設定をしてください"); } + if (this.isIC定期申込()) { + return; + } this.自動承認グループ = await get自動承認グループ( this.定期申込予約.定期駐車場プラン.value ); } + private async プラン取得() { if (!this.定期申込予約.定期駐車場プラン.value) { throw new Message("プラン名の設定をしてください"); @@ -126,6 +142,9 @@ export class 申込 { if (!this.初期化済み) { throw new Error("実装エラー 未初期化"); } + if (this.isIC定期申込()) { + return null; + } const target = this.自動承認グループ?.対象車室番号.value .filter(({ value: 定義 }) => { // 自動承認車室でない場合は対象外とする @@ -191,9 +210,12 @@ export class 申込 { if (!confirm.isConfirmed) throw new CancelError(); - this.顧客情報 = { - 顧客コード: Number(customer[顧客マスタフィールド名.顧客コード].value), - }; + this.顧客情報.顧客コード = Number( + customer[顧客マスタフィールド名.顧客コード].value + ); + this.顧客情報.IC定期利用者IC = Number( + customer[顧客マスタフィールド名.IC定期関連情報_ユーザーID].value + ); } else { await this.顧客マスタ作成(); } @@ -216,61 +238,127 @@ export class 申込 { } const 郵便番号 = (() => { - const all = this.定期申込予約.住所.value.substring(0, 7).trim(); + const all = this.定期申込予約.住所.value + .substring(0, 8) + .replace(/-/g, "") + .trim(); return sprintf("%s-%s", all.substring(0, 3), all.substring(3)); })(); - const 住所 = this.定期申込予約.住所.value.substring(7).trim(); + const 住所 = this.定期申込予約.住所.value.substring(8).trim(); + + const data = makeRecordData({ + [F.顧客コード]: String(顧客コード), + [F.顧客名]: this.定期申込予約.氏名.value, + [F.顧客名カナ]: this.定期申込予約.フリガナ.value, + [F.電話番号]: this.定期申込予約.電話番号.value, + [F.メールアドレス]: this.定期申込予約.メールアドレス.value, + [F.SMBC契約番号]: String(await getNextSMBC番号()), + [F.支払方法]: "口座振替", + [F.振替日]: "27", //TODO + [F.振替開始日]: 振替開始日, + [F.契約者_郵便番号]: 郵便番号, + [F.住所]: 住所, + }); + + // IC定期連携 + if (this.isIC定期申込()) { + const message = new MessageBag(); + const res = await 利用者情報新規作成( + { + email: this.定期申込予約.メールアドレス.value, + first_name: this.定期申込予約.氏名.value, + first_name_kana: this.定期申込予約.フリガナ.value, + zip_code: 郵便番号.replace(/-/g, ""), + address1: 住所, + phone_number: this.定期申込予約.電話番号.value, + }, + message + ); + if (res === false) { + throw new Message( + "IC定期連携失敗 利用者情報 " + message.getGeneralMessage() + ); + } + const 利用者ID = res.id; + data[F.IC定期関連情報_ユーザーID] = { value: String(利用者ID) }; + this.顧客情報.IC定期利用者IC = 利用者ID; + } bulkRequest.create({ app: AppID.顧客マスタ, - record: makeRecordData({ - [F.顧客コード]: String(顧客コード), - [F.顧客名]: this.定期申込予約.氏名.value, - [F.顧客名カナ]: this.定期申込予約.フリガナ.value, - [F.電話番号]: this.定期申込予約.電話番号.value, - [F.メールアドレス]: this.定期申込予約.メールアドレス.value, - [F.SMBC契約番号]: String(await getNextSMBC番号()), - [F.支払方法]: "口座振替", - [F.振替日]: "27", //TODO - [F.振替開始日]: 振替開始日, - [F.契約者_郵便番号]: 郵便番号, - [F.住所]: 住所, - }), + record: data, }); - this.顧客情報 = { - 顧客コード, - }; + this.顧客情報.顧客コード = 顧客コード; } - private async 契約情報作成(対象車室: 車室情報2) { + private async 契約情報作成(対象車室: 車室情報2 | null) { if (!this.顧客情報) throw new Error("顧客情報不正"); if (!this.定期申込予約) throw new Error("定期申込予約不正"); const F = 車室情報管理フィールド名; + const data = makeRecordData({ + [F.顧客コード]: String(this.顧客情報.顧客コード), + [F.契約日]: this.get契約開始日(), + [F.車両番号]: this.定期申込予約.車両番号.value, + [F.車室番号]: 対象車室?.車室番号.value ?? "IC定期", + [F.プラン名]: this.定期申込予約.定期駐車場プラン.value, + + [F.定額_1月]: this.プラン?.契約金額.value ?? "", + [F.定額_2月]: this.プラン?.契約金額.value ?? "", + [F.定額_3月]: this.プラン?.契約金額.value ?? "", + [F.定額_4月]: this.プラン?.契約金額.value ?? "", + [F.定額_5月]: this.プラン?.契約金額.value ?? "", + [F.定額_6月]: this.プラン?.契約金額.value ?? "", + [F.定額_7月]: this.プラン?.契約金額.value ?? "", + [F.定額_8月]: this.プラン?.契約金額.value ?? "", + [F.定額_9月]: this.プラン?.契約金額.value ?? "", + [F.定額_10月]: this.プラン?.契約金額.value ?? "", + [F.定額_11月]: this.プラン?.契約金額.value ?? "", + [F.定額_12月]: this.プラン?.契約金額.value ?? "", + }); + + if (this.isIC定期申込()) { + const message = new MessageBag(); + const res = await 定期契約新規作成( + { + user_id: String(this.顧客情報.IC定期利用者IC ?? ""), + parking_management_code: + this.プラン?.IC定期_駐車場管理コード.value ?? "", + vehicle_type_name: this.プラン?.IC定期_車種.value ?? "", + parking_use_type_name: + this.定期申込予約.IC定期駐車場利用方法.value ?? "", + contractor_type_name: this.プラン?.IC定期_契約者種類.value ?? "", + season_ticket_seq_no: this.IC定期_定期券番号, + }, + message + ); + if (res === false) { + throw new Message( + "IC定期連携失敗 契約情報 " + message.getGeneralMessage() + ); + } + data[F.IC定期関連情報_契約ID] = { value: res.id }; + data[F.IC定期関連情報_利用者ID] = { value: res.user_id }; + data[F.IC定期関連情報_定期券番号] = { value: res.season_ticket_seq_no }; + data[F.IC定期関連情報_契約者種類] = { + value: this.プラン?.IC定期_契約者種類.value ?? "", + }; + data[F.IC定期関連情報_車種] = { + value: this.プラン?.IC定期_車種.value ?? "", + }; + data[F.IC定期関連情報_駐車場管理コード] = { + value: res.parking_management_code, + }; + data[F.IC定期関連情報_駐車場利用方法] = { + value: this.定期申込予約.IC定期駐車場利用方法.value ?? "", + }; + } + bulkRequest.create( { app: AppID.車室情報管理, - record: makeRecordData({ - [F.顧客コード]: String(this.顧客情報.顧客コード), - [F.契約日]: this.get契約開始日(), - [F.車両番号]: this.定期申込予約.車両番号.value, - [F.車室番号]: 対象車室.車室番号.value, - [F.プラン名]: this.定期申込予約.定期駐車場プラン.value, - - [F.定額_1月]: this.プラン?.契約金額.value ?? "", - [F.定額_2月]: this.プラン?.契約金額.value ?? "", - [F.定額_3月]: this.プラン?.契約金額.value ?? "", - [F.定額_4月]: this.プラン?.契約金額.value ?? "", - [F.定額_5月]: this.プラン?.契約金額.value ?? "", - [F.定額_6月]: this.プラン?.契約金額.value ?? "", - [F.定額_7月]: this.プラン?.契約金額.value ?? "", - [F.定額_8月]: this.プラン?.契約金額.value ?? "", - [F.定額_9月]: this.プラン?.契約金額.value ?? "", - [F.定額_10月]: this.プラン?.契約金額.value ?? "", - [F.定額_11月]: this.プラン?.契約金額.value ?? "", - [F.定額_12月]: this.プラン?.契約金額.value ?? "", - }), + record: data, }, async ({ id }) => { if (!id) throw new Error(); @@ -292,7 +380,9 @@ export class 申込 { [F.定期駐車料金]: this.プラン.契約金額.value, [F.初回入金予定_必要分]: (() => { const ret: string[] = []; - + if (this.isIC定期申込()) { + return ret; + } ret.push(初回入金予定Checkbox.初月分); const 契約日 = dateParse(this.定期申込予約.利用開始希望日.value); if (!契約日) throw new Error("契約日不正"); diff --git a/src/apps/車室情報管理/buttons/IC定期削除ボタン.ts b/src/apps/車室情報管理/buttons/IC定期削除ボタン.ts new file mode 100644 index 0000000..073665e --- /dev/null +++ b/src/apps/車室情報管理/buttons/IC定期削除ボタン.ts @@ -0,0 +1,54 @@ +import { apptemplate } from "@/common/app-template"; +import { AppID } from "@/common/appids"; +import { setHeaderButton } from "@/common/header-button"; +import { makeRecordData } from "@/common/rest-api-client"; +import { Message } from "@/exception"; +import { ShowConfirmDialog, SuccessDialog } from "@/middleware/swal"; +import { 定期契約削除 } from "@/mypage/IC定期"; +import bulkRequest from "@/rest-api/bulk"; +import { 車室情報管理, 車室情報管理フィールド名 } from "@/types/車室情報管理"; + +export default function IC定期削除ボタン(record: 車室情報管理) { + if (!!record.IC定期関連情報_契約ID.value) { + setHeaderButton( + "IC定期削除", + apptemplate(async ({ needReloadAtEnd }) => { + const confirm = await ShowConfirmDialog({ + text: "IC定期利用を終了しますか", + }); + if (!confirm.isConfirmed) return; + + const res = await 定期契約削除({ + user_id: record.IC定期関連情報_利用者ID.value, + parking_management_code: record.IC定期関連情報_駐車場管理コード.value, + }); + + if (res === false) { + throw new Message("失敗しました"); + } + + bulkRequest.update({ + app: AppID.車室情報管理, + id: record.$id.value, + record: makeRecordData({ + [車室情報管理フィールド名.IC定期関連情報_契約ID]: "", + [車室情報管理フィールド名.IC定期関連情報_利用者ID]: "", + [車室情報管理フィールド名.IC定期関連情報_駐車場管理コード]: "", + [車室情報管理フィールド名.IC定期関連情報_定期券番号]: "", + [車室情報管理フィールド名.IC定期関連情報_車種]: "", + [車室情報管理フィールド名.IC定期関連情報_駐車場利用方法]: "", + [車室情報管理フィールド名.IC定期関連情報_契約者種類]: "", + [車室情報管理フィールド名.IC定期関連情報_有効期限開始]: "", + [車室情報管理フィールド名.IC定期関連情報_有効期限終了]: "", + [車室情報管理フィールド名.IC定期関連情報_駐車位置情報]: "", + [車室情報管理フィールド名.IC定期関連情報_備考]: "", + }), + }); + + await bulkRequest.save(); + await SuccessDialog.fire(); + needReloadAtEnd(true); + }) + ); + } +} diff --git a/src/apps/車室情報管理/buttons/IC定期同期ボタン.ts b/src/apps/車室情報管理/buttons/IC定期同期ボタン.ts new file mode 100644 index 0000000..3a19801 --- /dev/null +++ b/src/apps/車室情報管理/buttons/IC定期同期ボタン.ts @@ -0,0 +1,74 @@ +import { apptemplate } from "@/common/app-template"; +import { AppID } from "@/common/appids"; +import { dateParse, formatDateStr } from "@/common/datetime"; +import { setHeaderButton } from "@/common/header-button"; +import { makeRecordData } from "@/common/rest-api-client"; +import { Message } from "@/exception"; +import { FormDialog, ShowFormDialog, SuccessDialog } from "@/middleware/swal"; +import { 定期契約同期 } from "@/mypage/IC定期"; +import bulkRequest from "@/rest-api/bulk"; +import { 車室情報管理, 車室情報管理フィールド名 } from "@/types/車室情報管理"; + +export default function IC定期同期ボタン(record: 車室情報管理) { + if (true || !record.IC定期関連情報_契約ID.value) { + setHeaderButton( + "IC定期同期", + apptemplate(async ({ needReloadAtEnd }) => { + const confirm = await ShowFormDialog({ + title: "IC定期同期", + text: "契約IDを入力してください", + input: "number", + }); + + if (!confirm.isConfirmed) return; + + const res = await 定期契約同期({ + season_ticket_contract_id: String(confirm.value), + }); + + if (res === false) { + throw new Message("失敗しました"); + } + + const getDate = (val: any) => { + if (val) { + return formatDateStr(new Date(val)); + } + return ""; + }; + + bulkRequest.update({ + app: AppID.車室情報管理, + id: record.$id.value, + record: makeRecordData({ + [車室情報管理フィールド名.IC定期関連情報_契約ID]: confirm.value, + [車室情報管理フィールド名.IC定期関連情報_利用者ID]: + res.user_id ?? "", + [車室情報管理フィールド名.IC定期関連情報_駐車場管理コード]: + res.parking_management_code ?? "", + [車室情報管理フィールド名.IC定期関連情報_定期券番号]: + res.season_ticket_seq_no ?? "", + [車室情報管理フィールド名.IC定期関連情報_車種]: + res.vehicle_type_name ?? "", + [車室情報管理フィールド名.IC定期関連情報_駐車場利用方法]: + res.parking_use_type_name, + [車室情報管理フィールド名.IC定期関連情報_契約者種類]: + res.contractor_type_name ?? "", + [車室情報管理フィールド名.IC定期関連情報_有効期限開始]: getDate( + res.expiration_start_date + ), + [車室情報管理フィールド名.IC定期関連情報_有効期限終了]: getDate( + res.expiration_end_date + ), + [車室情報管理フィールド名.IC定期関連情報_駐車位置情報]: + res.position_memo ?? "", + [車室情報管理フィールド名.IC定期関連情報_備考]: res.memo ?? "", + }), + }); + await bulkRequest.save(); + await SuccessDialog.fire(); + needReloadAtEnd(true); + }) + ); + } +} diff --git a/src/apps/車室情報管理/index.ts b/src/apps/車室情報管理/index.ts index cb9fd56..591c8ea 100644 --- a/src/apps/車室情報管理/index.ts +++ b/src/apps/車室情報管理/index.ts @@ -1,10 +1,72 @@ import { eventHnalder } from "@/common/app-template"; +import { initMenuBox } from "@/common/header-button"; import { KintoneEvent } from "@/common/kintone-event"; import { 契約情報更新イベント } from "@/event/契約情報更新"; +import { + ErrorDialog, + SuccessDialog, + showLoadingDialog, +} from "@/middleware/swal"; +import { 利用者情報削除, 定期契約削除, 定期契約更新 } from "@/mypage/IC定期"; import { 車室情報管理 } from "@/types/車室情報管理"; import { setup } from ".."; +import IC定期削除ボタン from "./buttons/IC定期削除ボタン"; +import IC定期同期ボタン from "./buttons/IC定期同期ボタン"; +import { MessageBag } from "@/common/message"; setup(() => { + kintone.events.on( + [KintoneEvent.詳細.レコード詳細画面を表示した後], + eventHnalder(async (event) => { + const record: 車室情報管理 = event.record; + + await initMenuBox(); + + IC定期削除ボタン(record); + IC定期同期ボタン(record); + }) + ); + + kintone.events.on( + [KintoneEvent.編集.保存するとき], + eventHnalder(async (event, { setEvent }) => { + const record = event.record as 車室情報管理; + // IC定期処理 + if (!!record.IC定期関連情報_契約ID.value) { + await showLoadingDialog(); + + const res = await 定期契約更新({ + user_id: record.IC定期関連情報_利用者ID.value, + parking_management_code: record.IC定期関連情報_駐車場管理コード.value, + season_ticket_seq_no: record.IC定期関連情報_定期券番号.value, + vehicle_type_name: record.IC定期関連情報_車種.value, + parking_use_type_name: + record.IC定期関連情報_駐車場利用方法.value ?? "", + contractor_type_name: record.IC定期関連情報_契約者種類.value, + expiration_start_date: record.IC定期関連情報_有効期限開始.value ?? "", + expiration_end_date: record.IC定期関連情報_有効期限終了.value ?? "", + position_memo: record.IC定期関連情報_駐車位置情報.value, + memo: record.IC定期関連情報_備考.value, + }); + + if (res === false) { + ErrorDialog.fire({ + text: "IC定期連携に失敗しました", + }); + return false; + } + // 定期券番号の自動採番結果を反映 + record.IC定期関連情報_定期券番号.value = res.season_ticket_seq_no; + + await SuccessDialog.fire({ + text: "IC定期連携成功", + }); + } + + return event; + }) + ); + kintone.events.on( [KintoneEvent.追加.保存に成功した後, KintoneEvent.編集.保存に成功した後], eventHnalder(async (event, { setEvent }) => { @@ -13,4 +75,37 @@ setup(() => { setEvent(new 契約情報更新イベント().getEvent(record)); }) ); + + kintone.events.on( + [KintoneEvent.詳細.レコードを削除する前], + eventHnalder(async (event, { setEvent }) => { + const record = event.record as 車室情報管理; + // IC定期処理 + if (!!record.IC定期関連情報_契約ID.value) { + await showLoadingDialog(); + const message = new MessageBag(); + const res = await 定期契約削除( + { + user_id: record.IC定期関連情報_利用者ID.value, + parking_management_code: + record.IC定期関連情報_駐車場管理コード.value, + }, + message + ); + + if (res === false) { + ErrorDialog.fire({ + text: "IC定期連携に失敗しました " + message.getGeneralMessage(), + }); + return false; + } + + await SuccessDialog.fire({ + text: "IC定期連携成功", + }); + } + + return event; + }) + ); }); diff --git a/src/apps/顧客マスタ/customize-manifest.json b/src/apps/顧客マスタ/customize-manifest.json new file mode 100644 index 0000000..a40d6d1 --- /dev/null +++ b/src/apps/顧客マスタ/customize-manifest.json @@ -0,0 +1,12 @@ +{ + "app": "", + "scope": "ALL", + "desktop": { + "js": ["dist/顧客マスタ.js"], + "css": [] + }, + "mobile": { + "js": [], + "css": [] + } +} diff --git a/src/apps/顧客マスタ/index.ts b/src/apps/顧客マスタ/index.ts new file mode 100644 index 0000000..e75f79b --- /dev/null +++ b/src/apps/顧客マスタ/index.ts @@ -0,0 +1,79 @@ +import { eventHnalder } from "@/common/app-template"; +import { KintoneEvent } from "@/common/kintone-event"; +import { + ErrorDialog, + SuccessDialog, + showLoadingDialog, +} from "@/middleware/swal"; +import { 利用者情報削除, 利用者情報更新 } from "@/mypage/IC定期"; +import { 顧客マスタ, 顧客マスタフィールド名 } from "@/types/顧客マスタ"; +import { setup } from ".."; +import { MessageBag } from "@/common/message"; + +setup(() => { + kintone.events.on( + [KintoneEvent.編集.保存するとき], + eventHnalder(async (event, { setEvent }) => { + const record = event.record as 顧客マスタ; + const F = 顧客マスタフィールド名; + // IC定期処理 + if (!!record.IC定期関連情報_ユーザーID.value) { + await showLoadingDialog(); + + const res = await 利用者情報更新({ + user_id: record.IC定期関連情報_ユーザーID.value, + email: record[F.メールアドレス].value, + first_name: record[F.顧客名].value, + first_name_kana: record[F.顧客名カナ].value, + zip_code: record[F.契約者_郵便番号].value.replace("-", ""), + address1: record[F.住所].value, + phone_number: record[F.電話番号].value, + }); + + if (res === false) { + ErrorDialog.fire({ + text: "IC定期連携に失敗しました", + }); + return false; + } + + await SuccessDialog.fire({ + text: "IC定期連携成功", + }); + } + + return event; + }) + ); + kintone.events.on( + [KintoneEvent.詳細.レコードを削除する前], + eventHnalder(async (event, { setEvent }) => { + const record = event.record as 顧客マスタ; + const F = 顧客マスタフィールド名; + // IC定期処理 + if (!!record.IC定期関連情報_ユーザーID.value) { + await showLoadingDialog(); + const message = new MessageBag(); + const res = await 利用者情報削除( + { + user_id: record.IC定期関連情報_ユーザーID.value, + }, + message + ); + + if (res === false) { + ErrorDialog.fire({ + text: "IC定期連携に失敗しました " + message.getGeneralMessage(), + }); + return false; + } + + await SuccessDialog.fire({ + text: "IC定期連携成功", + }); + } + + return event; + }) + ); +}); diff --git a/src/common/message.ts b/src/common/message.ts new file mode 100644 index 0000000..8dbc283 --- /dev/null +++ b/src/common/message.ts @@ -0,0 +1,27 @@ +import { Dictionary } from "lodash"; + +export class MessageBag { + private generalMessage: string = ""; + private messages: Dictionary = {}; + + add(message: string | Dictionary) { + if (typeof message === "string") { + console.log({ setmessage: message }); + this.generalMessage = message; + return; + } + + this.messages = { + ...this.messages, + ...message, + }; + } + + getGeneralMessage() { + return this.generalMessage; + } + + getMessages() { + return this.messages; + } +} diff --git a/src/middleware/swal.ts b/src/middleware/swal.ts index 568fd4a..1b0b3a0 100644 --- a/src/middleware/swal.ts +++ b/src/middleware/swal.ts @@ -32,6 +32,13 @@ export const ConfirmDialog = Swal.mixin({ }, }); +export const FormDialog = Swal.mixin({ + input: "text", + showCancelButton: true, + cancelButtonText: "キャンセル", + confirmButtonText: "実行", +}); + export const ShowConfirmDialog = (param: SweetAlertOptions) => { return ConfirmDialog.fire(param).then((result) => { if (result.isConfirmed) { @@ -41,6 +48,15 @@ export const ShowConfirmDialog = (param: SweetAlertOptions) => { }); }; +export const ShowFormDialog = (param: SweetAlertOptions) => { + return FormDialog.fire(param).then((result) => { + if (result.isConfirmed) { + showLoadingDialog(); + } + return result; + }); +}; + export const LoadingDialog = Swal.mixin({ title: "実行中...", text: "画面を閉じないでください", diff --git a/src/mypage/IC定期.ts b/src/mypage/IC定期.ts new file mode 100644 index 0000000..4955034 --- /dev/null +++ b/src/mypage/IC定期.ts @@ -0,0 +1,145 @@ +import { MessageBag } from "@/common/message"; +import { MyPageApiID } from "."; +import { send } from "./lib"; + +// ------------- +export type 利用者情報新規作成Request = { + email: string; + first_name: string; + first_name_kana: string; + zip_code: string; + address1: string; + phone_number: string; +}; +export type 利用者情報新規作成Response = { + id: number; +}; +export const 利用者情報新規作成 = async ( + data: 利用者情報新規作成Request, + message: MessageBag | null = null +): Promise<利用者情報新規作成Response | false> => { + const res = await send(MyPageApiID.IC定期_利用者情報_新規作成, data, message); + if (res === false) { + return false; + } + return res.data; +}; + +// ------------- +export type 利用者情報更新Request = { + user_id: string; + email: string; + first_name: string; + first_name_kana: string; + zip_code: string; + address1: string; + phone_number: string; +}; +export type 利用者情報更新Response = { + id: number; +}; +export const 利用者情報更新 = async ( + data: 利用者情報更新Request, + message: MessageBag | null = null +): Promise<利用者情報更新Response | false> => { + const res = await send(MyPageApiID.IC定期_利用者情報_更新, data, message); + if (res === false) { + return false; + } + return res.data; +}; + +// ------------- +export type 利用者情報削除Request = { + user_id: string; +}; +export type 利用者情報削除Response = { + id: number; +}; +export const 利用者情報削除 = async ( + data: 利用者情報削除Request, + message: MessageBag | null = null +): Promise<利用者情報削除Response | false> => { + const res = await send(MyPageApiID.IC定期_利用者情報_削除, data, message); + if (res === false) { + return false; + } + return res.data; +}; + +// ------------- +export type 定期契約新規作成Request = { + user_id: string; + parking_management_code: string; + season_ticket_seq_no?: string; + vehicle_type_name: string; + parking_use_type_name: string; + contractor_type_name: string; +}; +export type 定期契約新規作成Response = { + id: number; + user_id: number; + season_ticket_seq_no: number; + parking_management_code: string; +}; +export const 定期契約新規作成 = async ( + data: 定期契約新規作成Request, + message: MessageBag | null = null +): Promise<定期契約新規作成Response | false> => { + const res = await send(MyPageApiID.IC定期_定期契約_新規作成, data, message); + if (res === false) { + return false; + } + return res.data; +}; + +// ------------- +export type 定期契約更新Request = { + user_id: string; + parking_management_code: string; + season_ticket_seq_no: string; + vehicle_type_name: string; + parking_use_type_name: string; + contractor_type_name: string; + expiration_start_date: string; + expiration_end_date: string; + position_memo: string; + memo: string; +}; +export const 定期契約更新 = async ( + data: 定期契約更新Request, + message: MessageBag | null = null +): Promise<定期契約更新Request | false> => { + const res = await send(MyPageApiID.IC定期_定期契約_更新, data, message); + if (res === false) { + return false; + } + return res.data; +}; + +// ------------- +export type 定期契約削除Request = { + user_id: string; + parking_management_code: string; +}; +export const 定期契約削除 = ( + data: 定期契約削除Request, + message: MessageBag | null = null +) => { + return send(MyPageApiID.IC定期_定期契約_削除, data, message); +}; + +// ------------- +export type 定期契約同期Request = { + season_ticket_contract_id: string; +}; +export const 定期契約同期 = async ( + data: 定期契約同期Request, + message: MessageBag | null = null +): Promise<定期契約更新Request | false> => { + const res = await send(MyPageApiID.IC定期_定期契約_同期, data, message); + if (res === false) { + return false; + } + return res.data; +}; diff --git a/src/mypage/index.ts b/src/mypage/index.ts index a65e925..dd61587 100644 --- a/src/mypage/index.ts +++ b/src/mypage/index.ts @@ -4,5 +4,14 @@ export const MyPageApiID = { 定期選考一斉通知: "season-ticket-contract-selection/notice-to-candidates", 領収証発行: "receipt/create", 領収証ファイル保存: "receipt/save", + + // IC定期券連 + IC定期_定期契約_新規作成: "season-ticket-contract/ht-ic-web/before/create", + IC定期_定期契約_更新: "season-ticket-contract/ht-ic-web/before/update", + IC定期_定期契約_削除: "season-ticket-contract/ht-ic-web/before/delete", + IC定期_定期契約_同期: "season-ticket-contract/ht-ic-web/before/fetch", + IC定期_利用者情報_新規作成: "user/ht-ic-web/before/create", + IC定期_利用者情報_更新: "user/ht-ic-web/before/update", + IC定期_利用者情報_削除: "user/ht-ic-web/before/delete", } as const; export type MyPageApiID = (typeof MyPageApiID)[keyof typeof MyPageApiID]; diff --git a/src/mypage/lib.ts b/src/mypage/lib.ts index ec276eb..6625a8a 100644 --- a/src/mypage/lib.ts +++ b/src/mypage/lib.ts @@ -1,5 +1,7 @@ import { myPageConfig } from "@/config/mypage"; import { MyPageApiID } from "."; +import { MessageBag } from "@/common/message"; +import { get } from "lodash"; type MyPageApiResponse = { result: "SUCCESS" | "FAILED"; @@ -11,13 +13,16 @@ export const getUrl = (apiId: MyPageApiID) => { return [config.BASE_URL, "api-from-kintone", apiId].join("/"); }; -export const send = async (apiId: MyPageApiID, data: object) => { +export const send = async ( + apiId: MyPageApiID, + data: object, + message: MessageBag | null = null +) => { const url = getUrl(apiId); const sendData = { ...data, token: config.TOKEN ?? "", }; - console.info("MyPageAPICall", url, data); const res: any = await kintone.proxy( url, @@ -28,15 +33,23 @@ export const send = async (apiId: MyPageApiID, data: object) => { const status = res[1]; if (status !== 200) { + console.info("MyPageAPICall", url, data, undefined); console.error("http status not 200", res); return false; } const obj = JSON.parse(res[0]); + console.info("MyPageAPICall", url, data, obj); if (obj.result === "SUCCESS") { - return true; + return obj; } else { - console.error("処理失敗", res); + console.error("処理失敗", obj, res); + if (message !== null) { + const generalErrorMessage = get(obj, "message"); + if (typeof generalErrorMessage === "string") { + message.add(generalErrorMessage); + } + } return false; } }; diff --git a/src/rest-api/ParkingNavi駐車場プラン.ts b/src/rest-api/ParkingNavi駐車場プラン.ts new file mode 100644 index 0000000..21a2acb --- /dev/null +++ b/src/rest-api/ParkingNavi駐車場プラン.ts @@ -0,0 +1,39 @@ +import { AppID } from "@/common/appids"; +import { + ParkingNavi駐車場プラン, + ParkingNavi駐車場プランフィールド名, +} from "@/types/ParkingNavi駐車場プラン"; +import { KintoneRestAPIClient } from "@kintone/rest-api-client"; +import { sprintf } from "sprintf"; + +const client = new KintoneRestAPIClient(); + +export const getParkingNavi駐車場プラン = async ( + プラン名: string +): Promise => { + const query = sprintf( + sprintf( + '%s = "%s"', + ParkingNavi駐車場プランフィールド名.定期駐車場プラン, + プラン名 + ) + ); + + const { records } = await client.record.getRecords({ + app: AppID.ParkingNavi駐車場プラン, + query, + }); + + if (records.length !== 1) { + throw new Error( + sprintf( + "ParkingNavi駐車場プラン取得数数エラー expect %d, actual %d query:%s", + 1, + records.length, + query + ) + ); + } + + return records[0]; +}; diff --git a/src/types/ParkingNavi駐車場プラン.ts b/src/types/ParkingNavi駐車場プラン.ts index 46d12c8..6875303 100644 --- a/src/types/ParkingNavi駐車場プラン.ts +++ b/src/types/ParkingNavi駐車場プラン.ts @@ -19,6 +19,5 @@ export type ParkingNavi駐車場プラン = AppRecord & { [F.定期駐車場名]: KintoneRecordField.SingleLineText; 状態: KintoneRecordField.RadioButton; [F.プラン名]: KintoneRecordField.SingleLineText; - 割引: KintoneRecordField.CheckBox; }; diff --git a/src/types/各種申請.ts b/src/types/各種申請.ts index 4cb533d..c9448eb 100644 --- a/src/types/各種申請.ts +++ b/src/types/各種申請.ts @@ -23,6 +23,7 @@ export const 申請種別Dropdown = { 利用者情報変更: "利用者情報変更", 口座変更申請: "口座変更申請", プラン変更: "プラン変更", + IC定期_駐車場利用方法変更申請: "IC定期_駐車場利用方法変更申請", } as const; export type 申請種別Dropdown = (typeof 申請種別Dropdown)[keyof typeof 申請種別Dropdown]; @@ -43,6 +44,8 @@ export const 申請詳細グループ = { [申請種別Dropdown.利用者情報変更]: "利用者情報変更申請", [申請種別Dropdown.口座変更申請]: "口座変更申請", [申請種別Dropdown.プラン変更]: "プラン変更申請", + [申請種別Dropdown.IC定期_駐車場利用方法変更申請]: + "IC定期_駐車場利用方法変更申請", } as const; export type 申請詳細グループ = (typeof 申請詳細グループ)[keyof typeof 申請詳細グループ]; @@ -127,4 +130,7 @@ export type 各種申請 = AppRecord & { 利用者情報変更申請_変更前_住所: KintoneRecordField.SingleLineText; 利用者情報変更申請_変更前_電話番号: KintoneRecordField.SingleLineText; 利用者情報変更申請_変更前_郵便番号: KintoneRecordField.SingleLineText; + IC定期_駐車場利用方法変更申請_変更前: KintoneRecordField.SingleLineText; + IC定期_駐車場利用方法変更申請_変更後: KintoneRecordField.SingleLineText; + IC定期_駐車場利用方法変更申請_備考: KintoneRecordField.MultiLineText; }; diff --git a/src/types/定期申込予約.ts b/src/types/定期申込予約.ts index 9c37a93..b4284bd 100644 --- a/src/types/定期申込予約.ts +++ b/src/types/定期申込予約.ts @@ -25,6 +25,7 @@ const F = { ParkingNavi駐車場: "ParkingNavi駐車場", ParkingNaviプラン: "ParkingNaviプラン", 定期駐車場プラン: "定期駐車場プラン", + IC定期駐車場利用方法: "IC定期駐車場利用方法", } as const; export const 状態Dropdown = { @@ -101,4 +102,5 @@ export type 定期申込予約 = AppRecord & { [F.初回入金予定_日割り分入金予定]: KintoneRecordField.SingleLineText; [F.初回入金予定_保証金入金予定]: KintoneRecordField.SingleLineText; [F.初回入金予定_初回入金充当状態]: KintoneRecordField.SingleLineText; + [F.IC定期駐車場利用方法]: KintoneRecordField.SingleLineText; }; diff --git a/src/types/定期駐車場プランマスタ.ts b/src/types/定期駐車場プランマスタ.ts index a9577bb..08ebd0b 100644 --- a/src/types/定期駐車場プランマスタ.ts +++ b/src/types/定期駐車場プランマスタ.ts @@ -9,6 +9,11 @@ const F = { 駐車場備考: "駐車場備考", 種別: "種別", 契約金額: "契約金額", + + IC定期駐車場: "IC定期駐車場", + IC定期_駐車場管理コード: "IC定期_駐車場管理コード", + IC定期_車種: "IC定期_車種", + IC定期_契約者種類: "IC定期_契約者種類", } as const; // export const 支払種別Dropdown = { @@ -67,4 +72,8 @@ export type 定期駐車場プランマスタ = AppRecord & { }; }[]; }; + [F.IC定期駐車場]: KintoneRecordField.CheckBox; + [F.IC定期_駐車場管理コード]: KintoneRecordField.SingleLineText; + [F.IC定期_車種]: KintoneRecordField.Dropdown; + [F.IC定期_契約者種類]: KintoneRecordField.SingleLineText; }; diff --git a/src/types/車室情報管理.ts b/src/types/車室情報管理.ts index d1233f5..45a517d 100644 --- a/src/types/車室情報管理.ts +++ b/src/types/車室情報管理.ts @@ -25,6 +25,18 @@ const F = { 定額_12月: "定額_12月", 入金予定日: "入金予定日", + + IC定期関連情報_契約ID: "IC定期関連情報_契約ID", + IC定期関連情報_利用者ID: "IC定期関連情報_利用者ID", + IC定期関連情報_駐車場管理コード: "IC定期関連情報_駐車場管理コード", + IC定期関連情報_定期券番号: "IC定期関連情報_定期券番号", + IC定期関連情報_車種: "IC定期関連情報_車種", + IC定期関連情報_駐車場利用方法: "IC定期関連情報_駐車場利用方法", + IC定期関連情報_契約者種類: "IC定期関連情報_契約者種類", + IC定期関連情報_有効期限開始: "IC定期関連情報_有効期限開始", + IC定期関連情報_有効期限終了: "IC定期関連情報_有効期限終了", + IC定期関連情報_駐車位置情報: "IC定期関連情報_駐車位置情報", + IC定期関連情報_備考: "IC定期関連情報_備考", } as const; // export const 支払種別Dropdown = { @@ -143,4 +155,17 @@ export type 車室情報管理 = AppRecord & { 学生証画像: KintoneRecordField.File; 障がい者手帳画像: KintoneRecordField.File; 解約届: KintoneRecordField.File; + + // IC定期関連 + IC定期関連情報_契約ID: KintoneRecordField.Number; + IC定期関連情報_利用者ID: KintoneRecordField.Number; + IC定期関連情報_駐車場管理コード: KintoneRecordField.SingleLineText; + IC定期関連情報_定期券番号: KintoneRecordField.Number; + IC定期関連情報_車種: KintoneRecordField.SingleLineText; + IC定期関連情報_駐車場利用方法: KintoneRecordField.Dropdown; + IC定期関連情報_契約者種類: KintoneRecordField.SingleLineText; + IC定期関連情報_有効期限開始: KintoneRecordField.Date; + IC定期関連情報_有効期限終了: KintoneRecordField.Date; + IC定期関連情報_駐車位置情報: KintoneRecordField.SingleLineText; + IC定期関連情報_備考: KintoneRecordField.MultiLineText; }; diff --git a/src/types/顧客マスタ.ts b/src/types/顧客マスタ.ts index ae60a00..9a5d20a 100644 --- a/src/types/顧客マスタ.ts +++ b/src/types/顧客マスタ.ts @@ -21,6 +21,8 @@ const F = { メールアドレス: "メールアドレス", SMBC契約番号: "ContractNo", 支払方法: "支払方法", + + IC定期関連情報_ユーザーID: "IC定期関連情報_ユーザーID", } as const; // export const 支払種別Dropdown = { @@ -87,4 +89,5 @@ export type 顧客マスタ = AppRecord & { 領収書: KintoneRecordField.Dropdown; 領収書名_入力: KintoneRecordField.SingleLineText; 領収書名: KintoneRecordField.SingleLineText; + [F.IC定期関連情報_ユーザーID]: KintoneRecordField.Number; };