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

feat: add history endpoint #33349

Merged
merged 17 commits into from
Oct 15, 2024
Merged

feat: add history endpoint #33349

merged 17 commits into from
Oct 15, 2024

Conversation

tapiarafael
Copy link
Member

@tapiarafael tapiarafael commented Sep 24, 2024

Proposed changes (including videos or screenshots)

Include a new endpoint to list the chat history of a contact. It does basically the same query as the current visitor history but for multiple visitors.

[GET] api/v1/omnichannel/contacts.history?contactId=[id]
response example

{
	"history": [
			{
				"_id": "E7DxYy9HNX4xPqhyy",
				"v": {
					"_id": "66df0ccb6f2de823455bca97",
					"username": "guest-52",
					"token": "8e5ae65364b2190c228a49368896677674d77ffa7fb00014189d37d30b553c31",
					"status": "offline",
					"activity": [
						"2024-09"
					],
					"lastMessageTs": "2024-09-09T14:57:36.144Z"
				},
				"fname": "guest-52",
				"source": {
					"type": "widget"
				},
				"ts": "2024-09-09T14:57:31.164Z",
				"msgs": 8,
				"servedBy": {
					"_id": "jnuReT9zctgoNKz7t",
					"username": "johndoe",
					"ts": "2024-09-09T14:57:31.195Z"
				},
				"closedAt": "2024-09-09T14:57:40.250Z",
				"closedBy": {
					"_id": "66df0ccb6f2de823455bca97",
					"username": "guest-52"
				},
				"closer": "visitor"
			},
	],
	"count": 25,
	"offset": 0,
	"total": 1,
	"success": true
}

Issue(s)

Steps to test or reproduce

Further comments

SCI-82

Copy link
Contributor

dionisio-bot bot commented Sep 24, 2024

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is targeting the wrong base branch. It should target 7.0.0, but it targets 6.14.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented Sep 24, 2024

⚠️ No Changeset found

Latest commit: e848b67

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Sep 24, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-33349/
on branch gh-pages at 2024-10-14 22:56 UTC

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.

Project coverage is 58.41%. Comparing base (d929799) to head (e848b67).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #33349      +/-   ##
===========================================
- Coverage    58.42%   58.41%   -0.02%     
===========================================
  Files         2744     2744              
  Lines        66242    66255      +13     
  Branches     14987    14990       +3     
===========================================
  Hits         38703    38703              
- Misses       24719    24732      +13     
  Partials      2820     2820              
Flag Coverage Δ
unit 74.60% <0.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@tapiarafael tapiarafael marked this pull request as ready for review September 25, 2024 13:45
@tapiarafael tapiarafael requested review from a team as code owners September 25, 2024 13:45
apps/meteor/app/livechat/server/lib/Contacts.ts Outdated Show resolved Hide resolved
packages/i18n/src/locales/pt-BR.i18n.json Outdated Show resolved Hide resolved
packages/model-typings/src/models/ILivechatRoomsModel.ts Outdated Show resolved Hide resolved
@tapiarafael tapiarafael force-pushed the feat/contact-history branch 5 times, most recently from 7aff8b9 to 7c00139 Compare September 30, 2024 20:23
Copy link
Member

@MarcosSpessatto MarcosSpessatto left a comment

Choose a reason for hiding this comment

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

We need a changeset here. Or will this be added only when the whole feature is available?

apps/meteor/server/models/raw/LivechatRooms.ts Outdated Show resolved Hide resolved
packages/rest-typings/src/v1/omnichannel.ts Show resolved Hide resolved
@tapiarafael
Copy link
Member Author

We need a changeset here. Or will this be added only when the whole feature is available?

We'll add it when the whole feature is available

Copy link
Member

@MarcosSpessatto MarcosSpessatto left a comment

Choose a reason for hiding this comment

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

Forgot to ask before 😞, can we write some tests for the endpoint?

@tapiarafael tapiarafael added the stat: QA assured Means it has been tested and approved by a company insider label Oct 14, 2024
@tapiarafael tapiarafael added this to the 7.0 milestone Oct 14, 2024
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Oct 14, 2024
@kodiakhq kodiakhq bot merged commit 682507c into develop Oct 15, 2024
50 checks passed
@kodiakhq kodiakhq bot deleted the feat/contact-history branch October 15, 2024 00:09
gabriellsh added a commit that referenced this pull request Oct 15, 2024
…ctor/avatar

* 'develop' of github.com:RocketChat/Rocket.Chat: (58 commits)
  refactor: unified users page header content into a single component (#33498)
  chore: store contact emails and phones on the same format as user's and visitor's (#33484)
  fix: broken jump-to-thread-message functionality using link  (#33332)
  feat: Apps-Engine method for reading and counting unread room messages for a user (#32194)
  feat: adds a new featured room action on the header for non-default category (#33562)
  chore(deps): bump actions/setup-node from 4.0.3 to 4.0.4 (#33327)
  fix: consider query strings in Twilio request validation (#33364)
  ci: add restore cache for `deploy-preview` (#33579)
  feat: add history endpoint (#33349)
  ci: cache artifacts to reduce api calls (#33567)
  feat: new E2EE composer hint (#33283)
  chore: Add `force` option to `rmSync` call (#33570)
  chore: remove nameInsensitive sorting on /v1/users.listByStatus (#33401)
  chore: Use `rmSync` instead of `rmdirSync` (#33551)
  feat: add contact channels (#33308)
  chore: split ImportDataConverter into multiple classes and add unit testing (#33394)
  test: added MockedDeviceContext to voip unit tests (#33553)
  refactor: adjusted voip endpoints error messages (#33515)
  fix: Cannot send messages after E2EE keys are refreshed (#33527)
  fix: Custom sounds not working when storage is set to filesystem (#33424)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants