Skip to content

Commit

Permalink
Updated API from documentation release
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-sdks[bot] committed Jun 28, 2024
1 parent c5211df commit c163df6
Show file tree
Hide file tree
Showing 16 changed files with 125 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"action": "changeApprovalRuleMode",
"approvalRuleMode": "Explicit"
}
3 changes: 2 additions & 1 deletion api-specs/api/examples/business-unit.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"addresses": [],
"associates": [],
"associateMode": "Explicit",
"inheritedAssociates": []
"inheritedAssociates": [],
"approvalRuleMode": "Explicit"
}
1 change: 1 addition & 0 deletions api-specs/api/examples/business-units.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"associates": [],
"associateMode": "Explicit",
"inheritedAssociates": [],
"approvalRuleMode": "Explicit",
"storeMode": "Explicit",
"stores": []
}
Expand Down
3 changes: 2 additions & 1 deletion api-specs/api/examples/my-business-unit.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"addresses": [],
"associates": [],
"associateMode": "Explicit",
"inheritedAssociates": []
"inheritedAssociates": [],
"approvalRuleMode": "Explicit"
}
3 changes: 2 additions & 1 deletion api-specs/api/examples/my-business-units.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"addresses": [],
"associates": [],
"associateMode": "Explicit",
"inheritedAssociates": []
"inheritedAssociates": [],
"approvalRuleMode": "Explicit"
}
]
}
5 changes: 5 additions & 0 deletions api-specs/api/types/business-unit/BusinessUnit.raml
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,8 @@ properties:
type: BusinessUnitKeyReference
description: |
Top-level unit of the Business Unit. The top-level unit is of `unitType` `Company`.
approvalRuleMode:
type: BusinessUnitApprovalRuleMode
description: |
Determines whether the Business Unit can inherit Approval Rules from a parent.
Always `Explicit` for [Companies](ctp:api:type:BusinessUnitType) and defaults to `ExplicitAndFromParent` for [Divisions](ctp:api:type:BusinessUnitType).
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#%RAML 1.0 DataType
(package): BusinessUnit
displayName: BusinessUnitApprovalRuleMode
type: string
description: |
Determines whether a Business Unit can inherit [Approval Rules](/projects/approval-rules) from a parent. Only Business Units of type `Division` can use `ExplicitAndFromParent`.
enum:
- Explicit
- ExplicitAndFromParent
(enumDescriptions):
Explicit: |
Approval Rules of a Business Unit must be explicitly assigned. The Business Unit cannot inherit Approval Rules from a parent.
ExplicitAndFromParent: |
Approval Rules of a Business Unit are inherited from a parent and can also be explicitly assigned.
6 changes: 6 additions & 0 deletions api-specs/api/types/business-unit/BusinessUnitDraft.raml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ properties:
type: AssociateDraft[]
description: |
List of members that are part of the Business Unit in specific [roles](ctp:api:type:AssociateRole).
approvalRuleMode?:
type: BusinessUnitApprovalRuleMode
description: |
Determines whether the Business Unit can inherit Approval Rules from a parent.
For [Companies](ctp:api:type:BusinessUnitType), the value of this field is always `Explicit`.
For [Divisions](ctp:api:type:BusinessUnitType), the default value is `ExplicitAndFromParent`.
addresses?:
type: BaseAddress[]
description: |
Expand Down
9 changes: 7 additions & 2 deletions api-specs/api/types/business-unit/Company.raml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ properties:
storeMode:
type: BusinessUnitStoreMode
description: |
Is always `Explicit` since a Company cannot have a parent Business Unit that Stores can be inherited from.
The value of this field is always `Explicit` because a Company cannot have a parent Business Unit that Stores can be inherited from.
associateMode:
type: BusinessUnitAssociateMode
description: |
Is always `Explicit` since a Company cannot have a parent Business Unit that Associates can be inherited from.
The value of this field is always `Explicit` because a Company cannot have a parent Business Unit that Associates can be inherited from.
approvalRuleMode:
type: BusinessUnitApprovalRuleMode
default: Explicit
description: |
The value of this field is always `Explicit` because a Company cannot have a parent Business Unit that Approval Rules can be inherited from.
5 changes: 5 additions & 0 deletions api-specs/api/types/business-unit/Division.raml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ properties:
default: ExplicitAndFromParent
description: |
Determines whether the Division can inherit Associates from a parent.
approvalRuleMode:
type: BusinessUnitApprovalRuleMode
default: ExplicitAndFromParent
description: |
Determines whether a Business Unit can inherit Approval Rules from a parent.
5 changes: 5 additions & 0 deletions api-specs/api/types/business-unit/DivisionDraft.raml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ properties:
default: ExplicitAndFromParent
description: |
Determines whether the Division can inherit Associates from a parent.
approvalRuleMode?:
type: BusinessUnitApprovalRuleMode
default: ExplicitAndFromParent
description: |
Determines whether the Division can inherit Approval Rules from a parent.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#%RAML 1.0 DataType
(package): BusinessUnit
type: BusinessUnitUpdateAction
displayName: BusinessUnitChangeApprovalRuleModeAction
discriminatorValue: changeApprovalRuleMode
example: !include ../../../examples/BusinessUnit/BusinessUnitChangeApprovalRuleModeAction.json
description: |
Updates [Approval Rules](/projects/approval-rules) inheritance behavior between Business Units.
Only Business Units of type `Division` can be changed to `ExplicitAndFromParent`.
This update action generates a [BusinessUnitApprovalRuleModeChanged](ctp:api:type:BusinessUnitApprovalRuleModeChangedMessage) Message.
properties:
approvalRuleMode:
type: BusinessUnitApprovalRuleMode
description: |
The new value for `approvalRuleMode`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#%RAML 1.0 DataType
(package): Message
type: Message
displayName: BusinessUnitApprovalRuleModeChangedMessage
discriminatorValue: BusinessUnitApprovalRuleModeChanged
description: |
Generated after a successful [Change Approval Rule Mode](ctp:api:type:BusinessUnitChangeApprovalRuleModeAction) update action.
properties:
approvalRuleMode:
type: BusinessUnitApprovalRuleMode
description: |
[BusinessUnitApprovalRuleMode](ctp:api:type:BusinessUnitApprovalRuleMode) of the Business Unit after the [Change Approval Rule Mode](ctp:api:type:BusinessUnitChangeApprovalRuleModeAction) update action.
oldApprovalRuleMode?:
type: BusinessUnitApprovalRuleMode
description: |
[BusinessUnitApprovalRuleMode](ctp:api:type:BusinessUnitApprovalRuleMode) of the Business Unit before the [Change Approval Rule Mode](ctp:api:type:BusinessUnitChangeApprovalRuleModeAction) update action.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#%RAML 1.0 DataType
(package): Message
type: MessagePayload
displayName: BusinessUnitApprovalRuleModeChangedMessagePayload
discriminatorValue: BusinessUnitApprovalRuleModeChanged
description: |
Generated after a successful [Change Approval Rule Mode](ctp:api:type:BusinessUnitChangeApprovalRuleModeAction) update action.
properties:
approvalRuleMode:
type: BusinessUnitApprovalRuleMode
description: |
[BusinessUnitApprovalRuleMode](ctp:api:type:BusinessUnitApprovalRuleMode) of the Business Unit after the [Change Approval Rule Mode](ctp:api:type:BusinessUnitChangeApprovalRuleModeAction) update action.
oldApprovalRuleMode?:
type: BusinessUnitApprovalRuleMode
description: |
[BusinessUnitApprovalRuleMode](ctp:api:type:BusinessUnitApprovalRuleMode) of the Business Unit before the [Change Approval Rule Mode](ctp:api:type:BusinessUnitChangeApprovalRuleModeAction) update action.
5 changes: 5 additions & 0 deletions api-specs/api/types/types.raml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ AssociateRoleAssignmentDraft: !include business-unit/AssociateRoleAssignmentDraf
AssociateRoleDeprecated: !include business-unit/AssociateRoleDeprecated.raml
AssociateRoleInheritanceMode: !include business-unit/AssociateRoleInheritanceMode.raml
BusinessUnit: !include business-unit/BusinessUnit.raml
BusinessUnitApprovalRuleMode: !include business-unit/BusinessUnitApprovalRuleMode.raml
BusinessUnitAssociateMode: !include business-unit/BusinessUnitAssociateMode.raml
BusinessUnitDraft: !include business-unit/BusinessUnitDraft.raml
BusinessUnitKeyReference: !include business-unit/BusinessUnitKeyReference.raml
Expand All @@ -98,6 +99,7 @@ BusinessUnitAddBillingAddressIdAction: !include business-unit/updates/BusinessUn
BusinessUnitAddShippingAddressIdAction: !include business-unit/updates/BusinessUnitAddShippingAddressIdAction.raml
BusinessUnitAddStoreAction: !include business-unit/updates/BusinessUnitAddStoreAction.raml
BusinessUnitChangeAddressAction: !include business-unit/updates/BusinessUnitChangeAddressAction.raml
BusinessUnitChangeApprovalRuleModeAction: !include business-unit/updates/BusinessUnitChangeApprovalRuleModeAction.raml
BusinessUnitChangeAssociateAction: !include business-unit/updates/BusinessUnitChangeAssociateAction.raml
BusinessUnitChangeAssociateModeAction: !include business-unit/updates/BusinessUnitChangeAssociateModeAction.raml
BusinessUnitChangeNameAction: !include business-unit/updates/BusinessUnitChangeNameAction.raml
Expand Down Expand Up @@ -844,6 +846,7 @@ BusinessUnitAddressCustomFieldRemovedMessage: !include message/BusinessUnitAddre
BusinessUnitAddressCustomTypeRemovedMessage: !include message/BusinessUnitAddressCustomTypeRemovedMessage.raml
BusinessUnitAddressCustomTypeSetMessage: !include message/BusinessUnitAddressCustomTypeSetMessage.raml
BusinessUnitAddressRemovedMessage: !include message/BusinessUnitAddressRemovedMessage.raml
BusinessUnitApprovalRuleModeChangedMessage: !include message/BusinessUnitApprovalRuleModeChangedMessage.raml
BusinessUnitAssociateAddedMessage: !include message/BusinessUnitAssociateAddedMessage.raml
BusinessUnitAssociateChangedMessage: !include message/BusinessUnitAssociateChangedMessage.raml
BusinessUnitAssociateModeChangedMessage: !include message/BusinessUnitAssociateModeChangedMessage.raml
Expand Down Expand Up @@ -1090,6 +1093,8 @@ BusinessUnitAddressCustomTypeRemovedMessagePayload: !include message/payload/Bus
# yamllint disable-line rule:line-length
BusinessUnitAddressCustomTypeSetMessagePayload: !include message/payload/BusinessUnitAddressCustomTypeSetMessagePayload.raml
BusinessUnitAddressRemovedMessagePayload: !include message/payload/BusinessUnitAddressRemovedMessagePayload.raml
# yamllint disable-line rule:line-length
BusinessUnitApprovalRuleModeChangedMessagePayload: !include message/payload/BusinessUnitApprovalRuleModeChangedMessagePayload.raml
BusinessUnitAssociateAddedMessagePayload: !include message/payload/BusinessUnitAssociateAddedMessagePayload.raml
BusinessUnitAssociateChangedMessagePayload: !include message/payload/BusinessUnitAssociateChangedMessagePayload.raml
# yamllint disable-line rule:line-length
Expand Down
18 changes: 18 additions & 0 deletions api-specs/graphql/schema.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,7 @@ type BusinessUnit implements Versioned & ReferenceExpandable {
inheritedStores: [InheritedStore!]
topLevelUnitRef: KeyReference
topLevelUnit: BusinessUnit!
approvalRuleMode: BusinessUnitApprovalRuleMode!
id: String!
version: Long!
createdAt: DateTime!
Expand Down Expand Up @@ -1410,6 +1411,17 @@ type BusinessUnitAddressRemoved implements MessagePayload {
type: String!
}

enum BusinessUnitApprovalRuleMode {
Explicit
ExplicitAndFromParent
}

type BusinessUnitApprovalRuleModeChanged implements MessagePayload {
approvalRuleMode: BusinessUnitApprovalRuleMode!
oldApprovalRuleMode: BusinessUnitApprovalRuleMode
type: String!
}

type BusinessUnitAssociateAdded implements MessagePayload {
associate: Associate!
type: String!
Expand Down Expand Up @@ -1543,6 +1555,7 @@ input BusinessUnitDraft {
stores: [ResourceIdentifierInput!]
associates: [AssociateDraft!]
associateMode: BusinessUnitAssociateMode
approvalRuleMode: BusinessUnitApprovalRuleMode
}

type BusinessUnitNameChanged implements MessagePayload {
Expand Down Expand Up @@ -1646,6 +1659,7 @@ input BusinessUnitUpdateAction {
setStores: SetBusinessUnitStores
setStoreMode: SetBusinessUnitStoreMode
changeAssociateMode: ChangeBusinessUnitAssociateMode
changeApprovalRuleMode: ChangeBusinessUnitApprovalRuleMode
}

input CancelQuoteRequest {
Expand Down Expand Up @@ -2248,6 +2262,10 @@ input ChangeBusinessUnitAddress {
address: AddressInput!
}

input ChangeBusinessUnitApprovalRuleMode {
approvalRuleMode: BusinessUnitApprovalRuleMode!
}

input ChangeBusinessUnitAssociate {
associate: AssociateDraft!
}
Expand Down

0 comments on commit c163df6

Please sign in to comment.