Skip to content

Commit

Permalink
int32で桁溢れが発生しているためint系のデータ型をint64に統一
Browse files Browse the repository at this point in the history
  • Loading branch information
hanenao committed Aug 9, 2024
1 parent 2b512fb commit 53a1050
Show file tree
Hide file tree
Showing 17 changed files with 280 additions and 280 deletions.
60 changes: 30 additions & 30 deletions account_items.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type AccountItems struct {

type AccountItem struct {
// 勘定科目ID
ID int32 `json:"id"`
ID int64 `json:"id"`
// 勘定科目コード
Code *string `json:"code,omitempty"`
// 勘定科目名 (30文字以内)
Expand All @@ -32,49 +32,49 @@ type AccountItem struct {
// ショートカット2(勘定科目コード) (20文字以内)
ShortcutNum *string `json:"shortcut_num,omitempty"`
// 税区分コード
TaxCode int32 `json:"tax_code"`
TaxCode int64 `json:"tax_code"`
// デフォルト設定がされている税区分ID
DefaultTaxID int32 `json:"default_tax_id,omitempty"`
DefaultTaxID int64 `json:"default_tax_id,omitempty"`
// デフォルト設定がされている税区分コード
DefaultTaxCode int32 `json:"default_tax_code"`
DefaultTaxCode int64 `json:"default_tax_code"`
// 勘定科目カテゴリー
AccountCategory string `json:"account_category"`
// 勘定科目のカテゴリーID
AccountCategoryID int32 `json:"account_category_id"`
AccountCategoryID int64 `json:"account_category_id"`
Categories []string `json:"categories"`
// 勘定科目の使用設定(true: 使用する、false: 使用しない)
Available bool `json:"available"`
// 口座ID
WalletableID *int32 `json:"walletable_id"`
WalletableID *int64 `json:"walletable_id"`
// 決算書表示名(小カテゴリー)
GroupName *string `json:"group_name,omitempty"`
// 収入取引相手勘定科目名
CorrespondingIncomeName *string `json:"corresponding_income_name,omitempty"`
// 収入取引相手勘定科目ID
CorrespondingIncomeID *int32 `json:"corresponding_income_id,omitempty"`
CorrespondingIncomeID *int64 `json:"corresponding_income_id,omitempty"`
// 支出取引相手勘定科目名
CorrespondingExpenseName *string `json:"corresponding_expense_name,omitempty"`
// 支出取引相手勘定科目ID
CorrespondingExpenseID *int32 `json:"corresponding_expense_id,omitempty"`
CorrespondingExpenseID *int64 `json:"corresponding_expense_id,omitempty"`
}

type AccountItemCreateParams struct {
// 事業所ID
CompanyID int32 `json:"company_id"`
CompanyID int64 `json:"company_id"`
AccountItem AccountItemCreateParamsAccountItem `json:"account_item"`
}

type AccountItemCreateParamsAccountItem struct {
// 勘定科目カテゴリーID Selectablesフォーム用選択項目情報エンドポイント(account_groups.account_category_id)で取得可能です
AccountCategoryID int32 `json:"account_category_id"`
AccountCategoryID int64 `json:"account_category_id"`
// 減価償却累計額勘定科目ID(法人のみ利用可能)
AccumulatedDepAccountItemID *int32 `json:"accumulated_dep_account_item_id,omitempty"`
AccumulatedDepAccountItemID *int64 `json:"accumulated_dep_account_item_id,omitempty"`
// 勘定科目コード
Code *string `json:"code,omitempty"`
// 支出取引相手勘定科目ID
CorrespondingExpenseID int32 `json:"corresponding_expense_id"`
CorrespondingExpenseID int64 `json:"corresponding_expense_id"`
// 収入取引相手勘定科目ID
CorrespondingIncomeID int32 `json:"corresponding_income_id"`
CorrespondingIncomeID int64 `json:"corresponding_income_id"`
// 決算書表示名(小カテゴリー) Selectablesフォーム用選択項目情報エンドポイント(account_groups.name)で取得可能です
GroupName string `json:"group_name"`
// 品目
Expand All @@ -84,21 +84,21 @@ type AccountItemCreateParamsAccountItem struct {
// 取引先
Partners *[]AccountItemCreateParamsPartners `json:"partners,omitempty"`
// 検索可能:2, 検索不可:3(登録時未指定の場合は2で登録されます。更新時未指定の場合はsearchableは変更されません。)
Searchable *int32 `json:"searchable,omitempty"`
Searchable *int64 `json:"searchable,omitempty"`
// ショートカット1 (20文字以内)
Shortcut *string `json:"shortcut,omitempty"`
// ショートカット2 (20文字以内)
ShortcutNum *string `json:"shortcut_num,omitempty"`
// 税区分コード 指定できるコードは本APIの注意点をご確認ください。
TaxCode int32 `json:"tax_code"`
TaxCode int64 `json:"tax_code"`
}

type AccountItemCreateParamsItems struct {
ID *int32 `json:"id,omitempty"`
ID *int64 `json:"id,omitempty"`
}

type AccountItemCreateParamsPartners struct {
ID *int32 `json:"id,omitempty"`
ID *int64 `json:"id,omitempty"`
}

type AccountItemCreateResponse struct {
Expand All @@ -108,68 +108,68 @@ type AccountItemCreateResponse struct {
// AccountItemDetail はPOST /api/1/account_items のレスポンス。
type AccountItemDetail struct {
// 勘定科目ID
ID int32 `json:"id"`
ID int64 `json:"id"`
// 勘定科目名 (30文字以内)
Name string `json:"name"`
// 事業所ID
CompanyID int32 `json:"company_id"`
CompanyID int64 `json:"company_id"`
// 税区分コード
TaxCode int32 `json:"tax_code"`
TaxCode int64 `json:"tax_code"`
// 勘定科目カテゴリー
AccountCategory string `json:"account_category"`
// 勘定科目のカテゴリーID
AccountCategoryID int32 `json:"account_category_id"`
AccountCategoryID int64 `json:"account_category_id"`
// ショートカット1 (20文字以内)
Shortcut *string `json:"shortcut,omitempty"`
// ショートカット2 (20文字以内)
ShortcutNum *string `json:"shortcut_num,omitempty"`
// 勘定科目コード (20文字以内)
Code *string `json:"code"`
// 検索可能:2, 検索不可:3
Searchable int32 `json:"searchable"`
Searchable int64 `json:"searchable"`
// 減価償却累計額勘定科目(法人のみ利用可能)
AccumulatedDepAccountItemName *string `json:"accumulated_dep_account_item_name,omitempty"`
// 減価償却累計額勘定科目ID(法人のみ利用可能)
AccumulatedDepAccountItemID *int32 `json:"accumulated_dep_account_item_id"`
AccumulatedDepAccountItemID *int64 `json:"accumulated_dep_account_item_id"`
// 品目
Items *[]AccountItemDetalItems `json:"items,omitempty"`
// 取引先
Partners *[]AccountItemDetailPartners `json:"partners,omitempty"`
// 勘定科目の使用設定(true: 使用する、false: 使用しない)
Available bool `json:"available"`
// 口座ID
WalletableID *int32 `json:"walletable_id"`
WalletableID *int64 `json:"walletable_id"`
// 決算書表示名(小カテゴリー)
GroupName *string `json:"group_name,omitempty"`
// 決算書表示名ID(小カテゴリー)
GroupID *int32 `json:"group_id"`
GroupID *int64 `json:"group_id"`
// 収入取引相手勘定科目名
CorrespondingIncomeName *string `json:"corresponding_income_name,omitempty"`
// 収入取引相手勘定科目ID
CorrespondingIncomeID *int32 `json:"corresponding_income_id,omitempty"`
CorrespondingIncomeID *int64 `json:"corresponding_income_id,omitempty"`
// 支出取引相手勘定科目名
CorrespondingExpenseName *string `json:"corresponding_expense_name,omitempty"`
// 支出取引相手勘定科目ID
CorrespondingExpenseID *int32 `json:"corresponding_expense_id,omitempty"`
CorrespondingExpenseID *int64 `json:"corresponding_expense_id,omitempty"`
}

type AccountItemDetalItems struct {
// 品目ID
ID *int32 `json:"id,omitempty"`
ID *int64 `json:"id,omitempty"`
// 品目名
Name string `json:"name"`
}

type AccountItemDetailPartners struct {
// 取引先ID
ID *int32 `json:"id,omitempty"`
ID *int64 `json:"id,omitempty"`
// 取引先名
Name string `json:"name"`
}

func (c *Client) GetAccountItems(
ctx context.Context, oauth2Token *oauth2.Token,
companyID uint32, opts GetAccountItemsOpts,
companyID int64, opts GetAccountItemsOpts,
) (*AccountItems, *oauth2.Token, error) {
var result AccountItems

Expand Down
28 changes: 14 additions & 14 deletions companies.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,29 @@ type CompanyResponse struct {

type Company struct {
// 事業所ID
ID int32 `json:"id"`
ID int64 `json:"id"`
// 事業所の正式名称 (100文字以内)
Name *string `json:"name"`
// 正式名称フリガナ (100文字以内)
NameKana *string `json:"name_kana"`
// 事業所名
DisplayName string `json:"display_name"`
// 源泉徴収税計算(0: 消費税を含める、1: 消費税を含めない)
TaxAtSourceCalcType int32 `json:"tax_at_source_calc_type"`
TaxAtSourceCalcType int64 `json:"tax_at_source_calc_type"`
// 担当者名 (50文字以内)
ContactName *string `json:"contact_name"`
// 従業員数(0: 経営者のみ、1: 2~5人、2: 6~10人、3: 11~20人、4: 21~30人、5: 31~40人、6: 41~100人、7: 100人以上
HeadCount *int32 `json:"head_count"`
HeadCount *int64 `json:"head_count"`
// 法人番号 (半角数字13桁、法人のみ)
CorporateNumber string `json:"corporate_number"`
// 仕訳番号形式(not_used: 使用しない、digits: 数字(例:5091824)、alnum: 英数字(例:59J0P))
TxnNumberFormat string `json:"txn_number_format"`
// 決済口座のデフォルト
DefaultWalletAccountId *int32 `json:"default_wallet_account_id,omitempty"`
DefaultWalletAccountId *int64 `json:"default_wallet_account_id,omitempty"`
// プライベート資金/役員資金(false: 使用しない、true: 使用する)
PrivateSettlement bool `json:"private_settlement"`
// マイナスの表示方法(0: -、 1: △)
MinusFormat int32 `json:"minus_format"`
MinusFormat int64 `json:"minus_format"`
// ユーザーの権限
Role string `json:"role"`
// 電話番号1
Expand All @@ -54,15 +54,15 @@ type Company struct {
// 郵便番号
Zipcode string `json:"zipcode"`
// 都道府県コード(-1: 設定しない、0: 北海道、1:青森、2:岩手、3:宮城、4:秋田、5:山形、6:福島、7:茨城、8:栃木、9:群馬、10:埼玉、11:千葉、12:東京、13:神奈川、14:新潟、15:富山、16:石川、17:福井、18:山梨、19:長野、20:岐阜、21:静岡、22:愛知、23:三重、24:滋賀、25:京都、26:大阪、27:兵庫、28:奈良、29:和歌山、30:鳥取、31:島根、32:岡山、33:広島、34:山口、35:徳島、36:香川、37:愛媛、38:高知、39:福岡、40:佐賀、41:長崎、42:熊本、43:大分、44:宮崎、45:鹿児島、46:沖縄
PrefectureCode *int32 `json:"prefecture_code"`
PrefectureCode *int64 `json:"prefecture_code"`
// 市区町村・番地
StreetName1 string `json:"street_name1"`
// 建物名・部屋番号など
StreetName2 string `json:"street_name2"`
// 請求書レイアウト * `default_classic` - レイアウト1/クラシック (デフォルト) * `standard_classic` - レイアウト2/クラシック * `envelope_classic` - 封筒1/クラシック * `carried_forward_standard_classic` - レイアウト3(繰越金額欄あり)/クラシック * `carried_forward_envelope_classic` - 封筒2(繰越金額欄あり)/クラシック * `default_modern` - レイアウト1/モダン * `standard_modern` - レイアウト2/モダン * `envelope_modern` - 封筒/モダン
InvoiceLayout string `json:"invoice_layout"`
// 金額端数処理方法(0: 切り捨て、1: 切り上げ、2: 四捨五入)
AmountFraction int32 `json:"amount_fraction"`
AmountFraction int64 `json:"amount_fraction"`
// 種別(agriculture_forestry_fisheries_ore: 農林水産業/鉱業、construction: 建設、manufacturing_processing: 製造/加工、it: IT、transportation_logistics: 運輸/物流、retail_wholesale: 小売/卸売、finance_insurance: 金融/保険、real_estate_rental: 不動産/レンタル、profession: 士業/学術/専門技術サービス、design_production: デザイン/制作、food: 飲食、leisure_entertainment: レジャー/娯楽、lifestyle: 生活関連サービス、education: 教育/学習支援、medical_welfare: 医療/福祉、other_services: その他サービス、other: その他)
IndustryClass string `json:"industry_class"`
// 業種(agriculture: 農業, forestry: 林業, fishing_industry: 漁業、水産養殖業, mining: 鉱業、採石業、砂利採取業, civil_contractors: 土木工事業, pavement: 舗装工事業, carpenter: とび、大工、左官等の建設工事業, renovation: リフォーム工事業, electrical_plumbing: 電気、管工事等の設備工事業, grocery: 食料品の製造加工業, machinery_manufacturing: 機械器具の製造加工業, printing: 印刷業, other_manufacturing: その他の製造加工業, software_development: 受託:ソフトウェア、アプリ開発業, system_development: 受託:システム開発業, survey_analysis: 受託:調査、分析等の情報処理業, server_management: 受託:サーバー運営管理, website_production: 受託:ウェブサイト制作, online_service_management: オンラインサービス運営業, online_advertising_agency: オンライン広告代理店業, online_advertising_planning_production: オンライン広告企画・制作業, online_media_management: オンラインメディア運営業, portal_site_management: ポータルサイト運営業, other_it_services: その他、IT サービス業, transport_delivery: 輸送業、配送業, delivery: バイク便等の配達業, other_transportation_logistics: その他の運輸業、物流業, other_wholesale: 卸売業:その他, clothing_wholesale_fiber: 卸売業:衣類卸売/繊維, food_wholesale: 卸売業:飲食料品, entrusted_development_wholesale: 卸売業:機械器具, online_shop: 小売業:無店舗 オンラインショップ, fashion_grocery_store: 小売業:店舗あり ファッション、雑貨, food_store: 小売業:店舗あり 生鮮食品、飲食料品, entrusted_store: 小売業:店舗あり 機械、器具, other_store: 小売業:店舗あり その他, financial_instruments_exchange: 金融業:金融商品取引, commodity_futures_investment_advisor: 金融業:商品先物取引、商品投資顧問, other_financial: 金融業:その他, brokerage_insurance: 保険業:仲介、代理, other_insurance: 保険業:その他, real_estate_developer: 不動産業:ディベロッパー, real_estate_brokerage: 不動産業:売買、仲介, rent_coin_parking_management: 不動産業:賃貸、コインパーキング、管理, rental_office_co_working_space: 不動産業:レンタルオフィス、コワーキングスペース, rental_lease: レンタル業、リース業, cpa_tax_accountant: 士業:公認会計士事務所、税理士事務所, law_office: 士業:法律事務所, judicial_and_administrative_scrivener: 士業:司法書士事務所/行政書士事務所, labor_consultant: 士業:社会保険労務士事務所, other_profession: 士業:その他, business_consultant: 経営コンサルタント, academic_research_development: 学術・開発研究機関, advertising_agency: 広告代理店, advertising_planning_production: 広告企画/制作, design_development: ソフトウェア、アプリ開発業(受託), apparel_industry_design: 服飾デザイン業、工業デザイン業, website_design: ウェブサイト制作(受託), advertising_planning_design: 広告企画/制作業, other_design: その他、デザイン/制作, restaurants_coffee_shops: レストラン、喫茶店等の飲食店業, sale_of_lunch: 弁当の販売業, bread_confectionery_manufacture_sale: パン、菓子等の製造販売業, delivery_catering_mobile_catering: デリバリー業、ケータリング業、移動販売業, hotel_inn: 宿泊業:ホテル、旅館, homestay: 宿泊業:民泊, travel_agency: 旅行代理店業, leisure_sports_facility_management: レジャー、スポーツ等の施設運営業, show_event_management: ショー、イベント等の興行、イベント運営業, barber: ビューティ、ヘルスケア業:床屋、理容室, beauty_salon: ビューティ、ヘルスケア業:美容室, spa_sand_bath_sauna: ビューティ、ヘルスケア業:スパ、砂風呂、サウナ等, este_ail_salon: ビューティ、ヘルスケア業:その他、エステサロン、ネイルサロン等, bridal_planning_introduce_wedding: 冠婚葬祭業:ブライダルプランニング、結婚式場紹介等, memorial_ceremony_funeral: 冠婚葬祭業:メモリアルセレモニー、葬儀等, moving: 引っ越し業, courier_industry: 宅配業, house_maid_cleaning_agency: 家事代行サービス業:無店舗 ハウスメイド、掃除代行等, re_tailoring_clothes: 家事代行サービス業:店舗あり 衣類修理、衣類仕立て直し等, training_institute_management: 研修所等の施設運営業, tutoring_school: 学習塾、進学塾等の教育・学習支援業, music_calligraphy_abacus_classroom: 音楽教室、書道教室、そろばん教室等のの教育・学習支援業, english_school: 英会話スクール等の語学学習支援業, tennis_yoga_judo_school: テニススクール、ヨガ教室、柔道場等のスポーツ指導、支援業, culture_school: その他、カルチャースクール等の教育・学習支援業, seminar_planning_management: セミナー等の企画、運営業, hospital_clinic: 医療業:病院、一般診療所、クリニック等, dental_clinic: 医療業:歯科診療所, other_medical_services: 医療業:その他、医療サービス等, nursery: 福祉業:保育所等、児童向け施設型サービス, nursing_home: 福祉業:老人ホーム等、老人向け施設型サービス, rehabilitation_support_services: 福祉業:療育支援サービス等、障害者等向け施設型サービス, other_welfare: 福祉業:その他、施設型福祉サービス, visit_welfare_service: 福祉業:訪問型福祉サービス, recruitment_temporary_staffing: 人材紹介業、人材派遣業, life_related_recruitment_temporary_staffing: 生活関連サービスの人材紹介業、人材派遣業, car_maintenance_car_repair: 自動車整備業、自動車修理業, machinery_equipment_maintenance_repair: 機械機器類の整備業、修理業, cleaning_maintenance_building_management: 清掃業、メンテナンス業、建物管理業, security: 警備業, other_services: その他のサービス業, npo: NPO, general_incorporated_association: 一般社団法人, general_incorporated_foundation: 一般財団法人, other_association: その他組織)
Expand All @@ -85,17 +85,17 @@ type FiscalYears struct {
// 期末日
EndDate *string `json:"end_date,omitempty"`
// 月次償却(0: しない、1: する)
DepreciationRecordMethod int32 `json:"depreciation_record_method"`
DepreciationRecordMethod int64 `json:"depreciation_record_method"`
// 課税区分(0: 免税、1: 簡易課税、2: 本則課税(個別対応方式)、3: 本則課税(一括比例配分方式)、4: 本則課税(全額控除))
TaxMethod int32 `json:"tax_method"`
TaxMethod int64 `json:"tax_method"`
// 簡易課税用事業区分(0: 第一種:卸売業、1: 第二種:小売業、2: 第三種:農林水産業、工業、建設業、製造業など、3: 第四種:飲食店業など、4: 第五種:金融・保険業、運輸通信業、サービス業など、5: 第六種:不動産業など
SalesTaxBusinessCode int32 `json:"sales_tax_business_code"`
SalesTaxBusinessCode int64 `json:"sales_tax_business_code"`
// 消費税端数処理方法(0: 切り捨て、1: 切り上げ、2: 四捨五入)
TaxFraction int32 `json:"tax_fraction"`
TaxFraction int64 `json:"tax_fraction"`
// 消費税経理処理方法(0: 税込経理、1: 旧税抜経理、2: 税抜経理)
TaxAccountMethod int32 `json:"tax_account_method"`
TaxAccountMethod int64 `json:"tax_account_method"`
// 不動産所得使用区分(0: 一般、3: 一般/不動産) ※個人事業主のみ設定可能
ReturnCode int32 `json:"return_code"`
ReturnCode int64 `json:"return_code"`
}

type GetCompanyOpts struct {
Expand All @@ -111,7 +111,7 @@ type GetCompanyOpts struct {

func (c *Client) GetCompany(
ctx context.Context, oauth2Token *oauth2.Token,
companyID uint32, opts GetCompanyOpts,
companyID int64, opts GetCompanyOpts,
) (*CompanyResponse, *oauth2.Token, error) {
var result CompanyResponse

Expand Down
Loading

0 comments on commit 53a1050

Please sign in to comment.