Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

チェックイン用のAPIエンドポイントを追加 #2300

Merged
merged 5 commits into from
May 19, 2024

Conversation

takaishi
Copy link
Contributor

@takaishi takaishi commented May 5, 2024

  • イベントとセッションそれぞれにチェックイン用のエンドポイントを追加しました
  • UI側の実装を楽にするため追記型にして、同じ参加者でも何回でもチェックインできるようにしています。

@takaishi takaishi self-assigned this May 5, 2024
Copy link

github-actions bot commented May 5, 2024

@github-actions github-actions bot added the reviewapps Build ReviewApp environment automatically if this label is granted label May 5, 2024
Base automatically changed from chore/remove-code-for-past-event to main May 5, 2024 08:17
@takaishi takaishi force-pushed the feat/add-check-in-api branch from 46430aa to 7017af1 Compare May 12, 2024 03:33
@takaishi takaishi force-pushed the feat/add-check-in-api branch from 7017af1 to 324cf85 Compare May 12, 2024 03:41
Copy link

Simplecov Report

Covered Threshold
61.48% 60%

@takaishi takaishi changed the title add api for check-in to event or talk チェックイン用のAPIエンドポイントを追加 May 16, 2024
@takaishi takaishi marked this pull request as ready for review May 16, 2024 12:36
@takaishi takaishi requested a review from a team May 16, 2024 12:37
@jacopen
Copy link
Collaborator

jacopen commented May 18, 2024

CIこけてるのなんだこれ

@@ -73,6 +73,8 @@ class Conference < ApplicationRecord
has_many :admin_profiles
has_many :media_package_harvest_jobs
has_many :rooms
has_many :check_in_conferences
has_many :check_in_talks
Copy link
Contributor

Choose a reason for hiding this comment

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

check_in_talks は profile-talk 間の relation な気がします

Copy link
Contributor Author

Choose a reason for hiding this comment

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

直しました!

create_table :check_in_conferences do |t|
t.belongs_to :conference, null: false, foreign_key: true
t.belongs_to :profile, null: false, foreign_key: true
t.datetime :timestamp, null: false
Copy link
Contributor

Choose a reason for hiding this comment

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

この timestamp column は多分フロント側でチェックインした時間だと思うのですが、 timestamp は SQL の予約語と被ってしまうので使用は避けた方がベターな気がします(絶対に避けるべきという強い意志ではないです)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

確かになと思ったのでリネームしました!

def create
@params = check_in_conference_params(JSON.parse(request.body.read, { symbolize_names: true }))
profile = Profile.find(@params[:profileId])
timestamp = Time.at(@params[:timestamp])
Copy link
Contributor

Choose a reason for hiding this comment

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

rails では TimeWithZone が利用されるのでそちらに合わせてしまうのがよさそうかと

Suggested change
timestamp = Time.at(@params[:timestamp])
timestamp = Time.zone.at(@params[:timestamp])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@oshiro3
Copy link
Contributor

oshiro3 commented May 19, 2024

CI がこけてる件はこの commit で修正されていそうでした!
cloudnativedaysjp/dreamkast-infra@3139bad

gitops-for-cloudnativedays bot pushed a commit to cloudnativedaysjp/dreamkast-infra that referenced this pull request May 19, 2024
Copy link

gitops-for-cloudnativedays bot added a commit to cloudnativedaysjp/dreamkast-infra that referenced this pull request May 19, 2024
@takaishi takaishi force-pushed the feat/add-check-in-api branch from d65f257 to 39159a9 Compare May 19, 2024 06:17
gitops-for-cloudnativedays bot pushed a commit to cloudnativedaysjp/dreamkast-infra that referenced this pull request May 19, 2024
gitops-for-cloudnativedays bot added a commit to cloudnativedaysjp/dreamkast-infra that referenced this pull request May 19, 2024
gitops-for-cloudnativedays bot pushed a commit to cloudnativedaysjp/dreamkast-infra that referenced this pull request May 19, 2024
gitops-for-cloudnativedays bot added a commit to cloudnativedaysjp/dreamkast-infra that referenced this pull request May 19, 2024
gitops-for-cloudnativedays bot pushed a commit to cloudnativedaysjp/dreamkast-infra that referenced this pull request May 19, 2024
gitops-for-cloudnativedays bot added a commit to cloudnativedaysjp/dreamkast-infra that referenced this pull request May 19, 2024
Copy link
Contributor

@oshiro3 oshiro3 left a comment

Choose a reason for hiding this comment

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

LGTM!

@takaishi takaishi merged commit d19cbb9 into main May 19, 2024
4 checks passed
@takaishi takaishi deleted the feat/add-check-in-api branch May 19, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reviewapps Build ReviewApp environment automatically if this label is granted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants