Skip to content

Commit

Permalink
B2B-1354: [update] fix s2s endpoints review issues (#598)
Browse files Browse the repository at this point in the history
<!-- Ticket number or summary of work -->
# [B2B-1354](https://bigcommercecloud.atlassian.net/browse/B2B-1354)


## What changed?
<!-- Provide a bulleted list in the present tense -->

### Fix some issues
Fix s2s endpoints issues in [google
doc](https://docs.google.com/document/d/1maGQinFAxBQH8b3h0EGwzUZi9ikpf-mAgTWgVLqGo4I/edit?usp=sharing)
* company
a. Bulk Create Companies (request body has these additional read only
fields (bcGroupName and companyStatus)
**Create a new model for bulk company create (copy from orrigin), and
remove 2 read only fields**

* User
a. Get a User (companyRoleId and companyRoleName missing from response
body)
    **Add companyRoleName and companyRoleId in user response model**
   
    b. Get a User (meta is missing from the 404 error response)
    **Fix 404 response**

    c. Get a User (Should we document a 500 error response?)
    **Remove 500 response**

d. Update a User (companyRoleId and companyRoleName are not in response
body)
    **Add companyRoleName and companyRoleId in user response model**
    
    e. Delete a User  (meta is missing from the 404 error response)
    **Fix 404 response**

    f. Delete a User (Should we document a 500 error response?)
    **Remove 500 response**

g. Get Users (companyRoleId and companyRoleName missing from response
body)
     **Add companyRoleName and companyRoleId in user response model**

i. Bulk Create Company User (meta is missing from the 404 error
response)
     **Fix 404 response**

j. Get a User by Customer ID (companyRoleId and companyRoleName missing
from response body)
    **Add companyRoleName and companyRoleId in user response model**

k. Get a User by Customer ID (meta is missing from the 404 error
response)
    **Fix 404 response**

* Sales Staff
a. Get a Sales Staff (assignedAt field is missing from the response body
> assignedCompanies)
    **Add assignAt**

* invoice payment
a. Update a Offline Payment (422 error response is this correct? Data >
currency)
    **Fix 422 response**

### Remove task section
The task section has been removed in PR
[535](#535), but re-created in
PR [562](#562). May be conflicts
between PR. As this section has already been removed in the original
Stoplight, it should be removed again.
    

## Release notes draft
<!-- Provide an entry for the release notes using simple, conversational
language. Don't be too technical. Explain how the change will benefit
the merchant and link to the feature.

Examples:
* The newly-released [X feature] is now available to use. Now, you’ll be
able to [perform Y action].
* We're happy to announce [X feature], which can help you [perform Y
action].
* [X feature] helps you to create [Y response] using the [Z query
parameter]. Now, you can deliver [ex, localized shopping experiences for
your customers].
* Fixed a bug in the [X endpoint]. Now the [Y field] will appear when
you click [Z option]. -->
n/a




[B2B-1354]:
https://bigcommercecloud.atlassian.net/browse/B2B-1354?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Traci Porter <[email protected]>
  • Loading branch information
JamessenLiu and bc-traciporter authored Oct 23, 2024
1 parent 338fe0c commit 5e7945d
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 425 deletions.
95 changes: 95 additions & 0 deletions docs/b2b-edition/models/company/company_bulk_create.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
description: ''
type: object
title: Company Base Model
properties:
companyName:
type: string
description: Name of this company
example: Tesla
minLength: 1
maxLength: 200
addressLine1:
type: string
description: Address line 1 of ths company.
maxLength: 200
example: 1600 Pennsylvania Avenue NW
addressLine2:
type: string
description: Address line 2 of ths company.
maxLength: 200
example: 'Washington, DC 22202'
city:
type: string
description: City name of the company.
example: 'Detroit '
maxLength: 100
state:
type: string
description: State of the company.
example: State of Texas
maxLength: 50
zipCode:
type: string
description: Zip code of the company.
example: '100000'
maxLength: 50
country:
type: string
description: Country of the company.
example: US
maxLength: 200
companyEmail:
type: string
format: email
example: [email protected]
maxLength: 200
description: Contact email of this company.
companyPhone:
type: string
description: Phone number of the company.
maxLength: 50
example: '9090980'
catalogName:
type: string
description: Name of this company's catalog.
example: catalog
adminFirstName:
type: string
minLength: 1
maxLength: 100
description: First name of the company's administrator.
example: Tom
adminLastName:
type: string
minLength: 1
maxLength: 100
description: Last name of the company's administrator.
example: Cat
adminEmail:
type: string
minLength: 1
maxLength: 100
description: Email address of the company's administrator.
example: [email protected]
adminPhoneNumber:
type: string
minLength: 1
maxLength: 100
description: Phone number of the company's administrator.
example: '1223312'
example:
companyName: Tesla
addressLine1: 1600 Pennsylvania Avenue NW
addressLine2: 'Washington, DC 22202'
city: 'Detroit '
state: State of Texas
zipCode: '100000'
country: US
companyEmail: [email protected]
companyPhone: '9090980'
catalogName: catalog
adminFirstName: Tom
adminLastName: Cat
adminEmail: [email protected]
adminPhoneNumber: '1223312'
x-internal: false
6 changes: 6 additions & 0 deletions docs/b2b-edition/models/user/user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ allOf:
iconUrl:
type: string
description: Channel icon url
companyRoleId:
type: integer
description: The company role ID. This field is only applicable to company's RBAC feature. If your store doesn't utilize this feature, please do not use this field.
companyRoleName:
type: integer
description: The company role name. This field is only applicable to company's RBAC feature. If your store doesn't utilize this feature, please do not use this field.
required:
- id
- $ref: https://raw.githubusercontent.com/bigcommerce/docs/main/docs/b2b-edition/models/user/user-base.yaml
Expand Down
3 changes: 1 addition & 2 deletions docs/b2b-edition/specs/api-v3/company/company.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,6 @@ paths:
required:
- id
- _detail
- $ref: https://raw.githubusercontent.com/bigcommerce/docs/main/docs/b2b-edition/models/company/company_base.yaml
meta:
type: object
required:
Expand Down Expand Up @@ -1580,7 +1579,7 @@ paths:
type: array
items:
allOf:
- $ref: https://raw.githubusercontent.com/bigcommerce/docs/main/docs/b2b-edition/models/company/company_base.yaml
- $ref: https://raw.githubusercontent.com/bigcommerce/docs/main/docs/b2b-edition/models/company/company_bulk_create.yaml
- type: object
properties:
acceptWelcomeEmail:
Expand Down
10 changes: 3 additions & 7 deletions docs/b2b-edition/specs/api-v3/invoice-management.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,9 @@ components:
minLength: 1
data:
type: object
required:
- currency
properties:
currency:
type: array
items:
type: string
errMsg:
type: string
required:
- code
- meta
Expand All @@ -209,7 +205,7 @@ components:
meta:
message: Parameter Error
data:
currency: [USD]
errMsg: Invalid currency code
"Receipt404":
description: Example response
content:
Expand Down
3 changes: 3 additions & 0 deletions docs/b2b-edition/specs/api-v3/sales_staff/sales_staff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ paths:
minLength: 1
description: 'bc group name '
example: google
assignedAt:
type: integer
description: Timestamp of when the company was assigned to the sales staff
- $ref: https://raw.githubusercontent.com/bigcommerce/docs/main/docs/b2b-edition/models/utils/response-object.yaml
examples:
example-1:
Expand Down
Loading

0 comments on commit 5e7945d

Please sign in to comment.