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

Node client notes and call logs API support[sc-55272] #85

Merged

Conversation

SoeunSona
Copy link
Contributor

@SoeunSona SoeunSona commented Dec 7, 2023

https://app.shortcut.com/chartmogul/story/55272/node-client-notes-and-call-logs-api-support

ChartMogul.Customer.notes(config, customerUuid, { per_page: 10, cursor: 'cursor==' })
ChartMogul.Customer.createNote(config, customerUuid, data)

ChartMogul.CustomerNote.create(config, data)
ChartMogul.CustomerNote.retrieve(config, noteUuid)
ChartMogul.CustomerNote.patch(config, noteUuid)
ChartMogul.CustomerNote.destroy(config, noteUuid)
ChartMogul.CustomerNote.all(config, { per_page: 10, cursor: 'cursor==', customer_uuid: customerUuid})

Copy link

This pull request has been linked to Shortcut Story #55272: Node client notes and call logs API support.

@SoeunSona SoeunSona force-pushed the soeunlee/sc-55272/node-client-notes-and-call-logs-api-support branch 3 times, most recently from 8890d09 to 7b30b2e Compare December 11, 2023 19:50
@SoeunSona SoeunSona force-pushed the soeunlee/sc-55272/node-client-notes-and-call-logs-api-support branch from 7b30b2e to 2198fa4 Compare December 12, 2023 10:31
@SoeunSona SoeunSona marked this pull request as ready for review December 13, 2023 10:46
@SoeunSona SoeunSona requested a review from briwa December 13, 2023 10:47
Copy link
Contributor

@briwa briwa left a comment

Choose a reason for hiding this comment

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

LGTM but the tests can be improved

const CustomerNote = ChartMogul.CustomerNote;

describe('CustomerNote', () => {
it('create a customer note', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
it('create a customer note', () => {
it('creates a note from a customer', () => {

const uuid = 'note_00000000-0000-0000-0000-000000000000';

nock(config.API_BASE)
.get('/v1/customer_notes' + '/' + uuid)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why + '/'? You can just use the template strings like how you did here:

nock(config.API_BASE)
.get(`/v1/customer_notes?customer_uuid=${customerUuid}`)

Suggested change
.get('/v1/customer_notes' + '/' + uuid)
.get(`v1/customer_notes/${uuid}`)

};

nock(config.API_BASE)
.patch('/v1/customer_notes' + '/' + uuid, postBody)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

const uuid = 'con_00000000-0000-0000-0000-000000000000';

nock(config.API_BASE)
.delete('/v1/customer_notes' + '/' + uuid)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here. I assume this is a copy-paste mistake 🤔

});
});

it('lists all customer notes', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
it('lists all customer notes', () => {
it('lists all notes from a customer', () => {

@SoeunSona SoeunSona merged commit 158c05d into main Dec 14, 2023
4 checks passed
@SoeunSona SoeunSona deleted the soeunlee/sc-55272/node-client-notes-and-call-logs-api-support branch December 14, 2023 08:41
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