Skip to content

バグの除去が完了したかも - #29

Merged
Myxogastria0808 merged 2 commits into
mainfrom
dev
Jan 10, 2026
Merged

バグの除去が完了したかも#29
Myxogastria0808 merged 2 commits into
mainfrom
dev

Conversation

@Myxogastria0808

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings January 10, 2026 17:04
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@Myxogastria0808
Myxogastria0808 merged commit c22be4c into main Jan 10, 2026
12 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request addresses bug fixes related to date handling, response schema cleanup, and UI improvements. The changes modify how dates are stored and validated, remove an unused response schema, and enhance the group detail page with invite URL functionality.

Changes:

  • Changed occurred_at from timestamp to date type in the database schema and made it required in the API
  • Removed unused registerGroupDebtResponseSchema and changed the register debt endpoint to return 204 No Content
  • Added invite URL copy functionality and additional group information fields to the group detail page
  • Fixed error messages and removed display of user IDs in member lists

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
products/validator/src/response/group.ts Added fields to group info response, added description and occurred_at to debt history, removed unused registerGroupDebtResponseSchema
products/validator/src/request/group.ts Made occurred_at required with date format validation
products/validator/src/index.ts Removed export of unused registerGroupDebtResponseSchema
products/frontend/src/routes/Root/index.tsx Simplified member list display by removing user ID
products/frontend/src/routes/GroupDetail/index.tsx Added invite URL copy functionality, changed date input from datetime-local to date, improved error messages
products/frontend/src/routes/GenerateGroup/index.tsx Fixed success message grammar
products/frontend/src/api/openapi.d.ts Updated type definitions to match API changes
products/frontend/openapi.json Updated OpenAPI specification to match schema changes
products/backend/src/presentation/routes/info.ts Removed updatedAt field update on soft delete
products/backend/src/presentation/routes/group.ts Updated to use camelCase for inviteId, changed response to 204 No Content, removed timestamp assignments relying on database defaults
products/backend/src/db/pay-crew2-schema.ts Changed occurredAt from timestamp to date type, renamed invite_id property to inviteId

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1,5 +1,5 @@
// drizzle
import { pgTable, text, timestamp, index, uuid, uniqueIndex, integer } from 'drizzle-orm/pg-core';
import { pgTable, text, timestamp, index, uuid, uniqueIndex, integer, date } from 'drizzle-orm/pg-core';

Copilot AI Jan 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The date import from 'drizzle-orm/pg-core' is added but should be verified that it's correctly used for the occurredAt field. Ensure that the date type correctly handles the YYYY-MM-DD format expected by the API validators and doesn't introduce timezone-related issues.

Copilot uses AI. Check for mistakes.
amount: integer('amount').notNull(),
description: text('description'),
occurredAt: timestamp('occurred_at').defaultNow().notNull(),
occurredAt: date('occurred_at').notNull(),

Copilot AI Jan 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the column type from timestamp to date removes time information from debt records. This is a breaking change that could result in data loss if existing records contain time information. Consider using a migration strategy to handle existing data appropriately.

Suggested change
occurredAt: date('occurred_at').notNull(),
occurredAt: timestamp('occurred_at').notNull(),

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +33
setCopyStatus('success');
} catch (e) {
console.error(e);
setCopyStatus('error');

Copilot AI Jan 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inviteUrlHandler function does not reset the copy status after success. Users who copy the URL multiple times will see "コピー済み" (Copied) permanently after the first successful copy. Consider adding a timeout to reset the status back to 'idle' after a few seconds to provide better user feedback for subsequent copy operations.

Suggested change
setCopyStatus('success');
} catch (e) {
console.error(e);
setCopyStatus('error');
setCopyStatus('success');
// 一定時間後にステータスをリセット
setTimeout(() => {
setCopyStatus('idle');
}, 2000);
} catch (e) {
console.error(e);
setCopyStatus('error');
// エラー表示も一定時間後にリセット
setTimeout(() => {
setCopyStatus('idle');
}, 2000);

Copilot uses AI. Check for mistakes.
await db.insert(groupMembership).values({
id: crypto.randomUUID(),
groupId: result[0].id,
userId: loginUser.id,

Copilot AI Jan 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the joinedAt field assignment means this field will rely solely on the database default. If the database schema doesn't have a proper defaultNow() or equivalent default configured for this column, it could result in null values. Verify that the database schema has the appropriate default configured.

Suggested change
userId: loginUser.id,
userId: loginUser.id,
joinedAt: new Date(),

Copilot uses AI. Check for mistakes.
@@ -188,7 +177,6 @@ hono.openapi(joinGroupSchema, async (c) => {
id: crypto.randomUUID(),
groupId: groupData[0].id,
userId: user.id,

Copilot AI Jan 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the joinedAt field assignment means this field will rely solely on the database default. If the database schema doesn't have a proper defaultNow() or equivalent default configured for this column, it could result in null values. Verify that the database schema has the appropriate default configured.

Suggested change
userId: user.id,
userId: user.id,
joinedAt: new Date(),

Copilot uses AI. Check for mistakes.
Comment on lines 298 to 300
.set({
deletedBy: loginUser.id,
deletedAt: now,

Copilot AI Jan 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the updatedAt field update on deletion is inconsistent with typical soft-delete patterns. When a record is soft-deleted (by setting deletedAt and deletedBy), it's common practice to also update the updatedAt timestamp to track when the deletion occurred. Consider whether this removal was intentional or if it could cause issues with audit trails or timestamp-based queries.

Copilot uses AI. Check for mistakes.
<li key={index}>
{debt.debtor_name} さんが {debt.creditor_name} さんに {debt.amount} 円を借りています。
{debt.debtor_name} さんが {debt.creditor_name} さんに {debt.amount} 円を借りています。 (詳細:{' '}
{debt.description}、発生日時: {debt.occurred_at}

Copilot AI Jan 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The closing parenthesis ")" is missing at the end of line 238. The text starts with an opening parenthesis "(詳細:" on line 237 but doesn't have a corresponding closing parenthesis, which will result in malformed display text in the UI.

Suggested change
{debt.description}、発生日時: {debt.occurred_at}
{debt.description}、発生日時: {debt.occurred_at}

Copilot uses AI. Check for mistakes.
id: uuid('id').primaryKey(),
name: text('name').notNull(),
invite_id: text('invite_id').notNull().unique(),
inviteId: text('invite_id').notNull().unique(),

Copilot AI Jan 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The column name is changed from invite_id (snake_case) to inviteId (camelCase) in the schema definition, but the actual database column name remains invite_id due to the second parameter in the text() function. This inconsistency between the schema property name and how it's referenced in the code could lead to confusion. Ensure all references in the codebase use the correct property name inviteId.

Suggested change
inviteId: text('invite_id').notNull().unique(),
invite_id: text('invite_id').notNull().unique(),

Copilot uses AI. Check for mistakes.
name: body.group_name,
invite_id: `${crypto.randomUUID()}-${crypto.randomUUID()}`,
inviteId: `${crypto.randomUUID()}-${crypto.randomUUID()}`,
createdBy: loginUser.id,

Copilot AI Jan 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of createdAt and updatedAt timestamp assignments means these fields will rely solely on database defaults. If the database default is not set or fails, this could result in null values. Verify that the database schema has proper defaultNow() or equivalent defaults configured for these columns.

Suggested change
createdBy: loginUser.id,
createdBy: loginUser.id,
createdAt: new Date(),
updatedAt: new Date(),

Copilot uses AI. Check for mistakes.
@@ -597,7 +566,6 @@ hono.openapi(deleteGroupDebtSchema, async (c) => {
.set({
deletedBy: loginUser.id,
deletedAt: now,

Copilot AI Jan 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the updatedAt field update on deletion is inconsistent with typical soft-delete patterns. When a record is soft-deleted (by setting deletedAt and deletedBy), it's common practice to also update the updatedAt timestamp to track when the deletion occurred. Consider whether this removal was intentional or if it could cause issues with audit trails or timestamp-based queries.

Suggested change
deletedAt: now,
deletedAt: now,
updatedAt: now,

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants