読み込み中
豆知識
現在の位置づけ: ✅ IMPLEMENTED 最終更新: 2026-05-01 Public API Reference: /docs/api-reference — search for
reminderAPI 仕様: /docs/api-reference
The reminders API supports the frontend notification settings panel and dashboard タスク・リマインダー section. Auto-creates default config for new users.
reminder_configs TableStores user-specific reminder configuration settings.
CREATE TABLE reminder_configs (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES auth.users(id) ON DELETE CASCADE,
-- Monthly reminders
reimbursement_day INTEGER DEFAULT 1,
reimbursement_active BOOLEAN DEFAULT false,
expense_payment_day INTEGER DEFAULT 25,
expense_payment_active BOOLEAN DEFAULT false,
invoice_day INTEGER DEFAULT 25,
invoice_active BOOLEAN DEFAULT false,
-- Annual reminders (fiscal year based)
corporate_tax_day INTEGER DEFAULT 1,
corporate_tax_month INTEGER DEFAULT 3,
corporate_tax_active BOOLEAN DEFAULT false,
year_end_adjustment_day INTEGER DEFAULT 31,
year_end_adjustment_month INTEGER DEFAULT 12,
year_end_adjustment_active BOOLEAN DEFAULT false,
consumption_tax_day INTEGER DEFAULT 31,
consumption_tax_month INTEGER DEFAULT 3,
consumption_tax_active BOOLEAN DEFAULT false,
labor_insurance_day INTEGER DEFAULT 10,
labor_insurance_month INTEGER DEFAULT 7,
labor_insurance_active BOOLEAN DEFAULT false,
social_insurance_day INTEGER DEFAULT 10,
social_insurance_month INTEGER DEFAULT 7,
social_insurance_active BOOLEAN DEFAULT false,
-- Statutory deadline reminders (January 31st - calendar year)
legal_records_summary_day INTEGER DEFAULT 31,
legal_records_summary_month INTEGER DEFAULT 1,
legal_records_summary_active BOOLEAN DEFAULT false,
withholding_tax_slip_day INTEGER DEFAULT 31,
withholding_tax_slip_month INTEGER DEFAULT 1,
withholding_tax_slip_active BOOLEAN DEFAULT false,
salary_payment_report_day INTEGER DEFAULT 31,
salary_payment_report_month INTEGER DEFAULT 1,
salary_payment_report_active BOOLEAN DEFAULT false,
depreciable_assets_day INTEGER DEFAULT 31,
depreciable_assets_month INTEGER DEFAULT 1,
depreciable_assets_active BOOLEAN DEFAULT false,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW(),
UNIQUE(user_id)
);
-- RLS Policy
ALTER TABLE reminder_configs ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Users can manage their own reminder configs"
ON reminder_configs
FOR ALL
USING (user_id = auth.uid())
WITH CHECK (user_id = auth.uid());
-- Auto-update timestamp trigger
CREATE TRIGGER update_reminder_configs_updated_at
BEFORE UPDATE ON reminder_configs
FOR EACH ROW
EXECUTE FUNCTION update_updated_at_column();
-- Index for user lookup
CREATE INDEX idx_reminder_configs_user_id ON reminder_configs(user_id);
custom_reminders TableStores user-created custom reminders.
CREATE TABLE custom_reminders (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES auth.users(id) ON DELETE CASCADE,
title VARCHAR(255) NOT NULL,
reminder_type INTEGER DEFAULT 8, -- 8 = CUSTOM
reminder_cycle INTEGER NOT NULL, -- 0=MONTHLY, 1=YEARLY, 2=WEEKLY
day INTEGER NOT NULL, -- Day of month (1-31)
month INTEGER, -- Month (1-12) for YEARLY
year INTEGER, -- Year for one-time reminders
week_day INTEGER, -- Day of week (1-7, Mon-Sun) for WEEKLY
is_done BOOLEAN DEFAULT false,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
-- RLS Policy
ALTER TABLE custom_reminders ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Users can manage their own custom reminders"
ON custom_reminders
FOR ALL
USING (user_id = auth.uid())
WITH CHECK (user_id = auth.uid());
-- Index
CREATE INDEX idx_custom_reminders_user_id ON custom_reminders(user_id);
/api/reminders/configsGet user's reminder configuration. Auto-creates default config for new users.
Response (200):
{
statusCode: 200,
message: "Reminder configs retrieved successfully",
data: {
id: string,
userId: string,
// Monthly reminders
reimbursementDay: number, // Default: 25
reimbursementActive: boolean, // Default: false
expensePaymentDay: number, // Default: 30
expensePaymentActive: boolean, // Default: false
invoiceDay: number, // Default: 25
invoiceActive: boolean, // Default: false
// Fiscal year dependent
corporateTaxDay: number, // Default: 17
corporateTaxMonth: number, // Default: 4
corporateTaxActive: boolean, // Default: false
yearEndAdjustmentDay: number, // Default: 31
yearEndAdjustmentMonth: number, // Default: 1
yearEndAdjustmentActive: boolean, // Default: false
consumptionTaxDay: number, // Default: 17
consumptionTaxMonth: number, // Default: 4
consumptionTaxActive: boolean, // Default: false
laborInsuranceDay: number, // Default: 10
laborInsuranceMonth: number, // Default: 7
laborInsuranceActive: boolean, // Default: false
socialInsuranceDay: number, // Default: 10
socialInsuranceMonth: number, // Default: 7
socialInsuranceActive: boolean, // Default: false
// Statutory deadlines (January 31st) - ACTIVE by default
legalRecordsSummaryDay: number, // Default: 31
legalRecordsSummaryMonth: number, // Default: 1
legalRecordsSummaryActive: boolean, // Default: true ✅
withholdingTaxSlipDay: number, // Default: 31
withholdingTaxSlipMonth: number, // Default: 1
withholdingTaxSlipActive: boolean, // Default: true ✅
salaryPaymentReportDay: number, // Default: 31
salaryPaymentReportMonth: number, // Default: 1
salaryPaymentReportActive: boolean, // Default: true ✅
depreciableAssetsDay: number, // Default: 31
depreciableAssetsMonth: number, // Default: 1
depreciableAssetsActive: boolean, // Default: true ✅
createdAt: string,
updatedAt: string
}
}
Notes:
/api/reminders/configsUpdate user's reminder configuration. Partial updates supported.
Request Body:
{
reimbursementDay?: number,
reimbursementActive?: boolean,
expensePaymentDay?: number,
expensePaymentActive?: boolean,
// ... all config fields are optional
}
Response: Same as GET
/api/remindersReturns active reminders based on user's config. Includes both system-generated and custom reminders.
Response (200):
{
statusCode: 200,
message: "Current reminders retrieved successfully",
data: [
{
id: string,
userId: string,
title: string, // e.g., "法人税申告"
reminderType: number, // ReminderType enum (0-12)
reminderCycle: number, // 0=MONTHLY, 1=YEARLY, 2=WEEKLY
day: number,
month: number,
year: number,
isDone: boolean
}
]
}
ReminderType Enum:
enum ReminderType {
REIMBURSEMENT = 0, // 経費精算
EXPENSE_PAYMENT = 1, // 経費支払
INVOICE = 2, // 請求書
CORPORATE_TAX = 3, // 法人税
YEAR_END_ADJUSTMENT = 4, // 年末調整
CONSUMPTION_TAX = 5, // 消費税
LABOR_INSURANCE = 6, // 労働保険
SOCIAL_INSURANCE = 7, // 社会保険
CUSTOM = 8, // カスタム
LEGAL_RECORDS_SUMMARY = 9, // 法定調書合計表
WITHHOLDING_TAX_SLIP = 10, // 源泉徴収票
SALARY_PAYMENT_REPORT = 11, // 給与支払報告書
DEPRECIABLE_ASSETS = 12, // 償却資産申告
}
/api/reminders/customCreate a custom reminder.
Request Body:
{
title: string, // Required
reminderCycle: number, // Required: 0=MONTHLY, 1=YEARLY, 2=WEEKLY
reminderType: 8, // Must be 8 (CUSTOM)
day: number, // Required: 1-31
month?: number, // Required for YEARLY
year?: number, // Optional
weekDay?: number // 0-6 for WEEKLY
}
Response (201):
{
statusCode: 201,
message: "Custom reminder created successfully",
data: { /* reminder object */ }
}
/api/reminders/customReturns only user-created custom reminders.
/api/reminders/custom/:idSoft delete a custom reminder.
/api/reminders/:id/doneToggle the isDone status of a reminder. For recurring reminders, also creates the next occurrence.
src/features/settings/notification/apis.ts - API callssrc/features/settings/notification/queries.ts - React Query hookssrc/features/settings/notification/types.ts - TypeScript typessrc/components/panels/notification-settings-side-panel.tsx - Settings UIsrc/components/ui/fiscal-year-progress-bar.tsx - Dashboard displayThe backend automatically converts:
Frontend code should always use camelCase.
All endpoints require Bearer token:
Authorization: Bearer YOUR_JWT_TOKEN
| File | Purpose |
|---|---|
src/features/settings/notification/types.ts |
TypeScript types/enums |
src/features/settings/notification/apis.ts |
API client calls |
src/components/panels/notification-settings-side-panel.tsx |
Settings UI |
src/components/ui/fiscal-year-progress-bar.tsx |
Dashboard display |
読み込み中
豆知識