Skip to content

Commit b089037

Browse files
authored
Merge pull request magento#364 from magento-architects/company-credit
ECP-472: GraphQL schema for company credit
2 parents 30e70df + 422f1a9 commit b089037

File tree

3 files changed

+70
-6
lines changed

3 files changed

+70
-6
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Queries
2+
3+
```graphql
4+
5+
###### Begin: Extending existing types ######
6+
type Company {
7+
credit: CompanyCredit! @doc(description: "Company credit balance")
8+
credit_history(filter: CompanyCreditHistoryFilterInput, pageSize: Int = 20, currentPage: Int = 1): CompanyCreditHistory! @doc(description: "Company credit operations history")
9+
}
10+
###### End: Extending existing types ######
11+
12+
13+
###### Begin: Defining new types ######
14+
type CompanyCreditHistory {
15+
items: [CompanyCreditOperation]! @doc(description: "An array of company credit operations")
16+
page_info: SearchResultPageInfo! @doc(description: "Metadata for pagination rendering")
17+
total_count: Int @doc(description: "The number of the company credit operations matching the specified filter")
18+
}
19+
20+
type CompanyCreditOperation {
21+
date: String! @doc(description: "The date of the company credit operation")
22+
type: CompanyCreditOperationType! @doc(description: "The type of the company credit operation")
23+
amount: Money @doc(description: "The amount fo the company credit operation")
24+
balance: CompanyCredit! @doc(description: "Credit balance after the company credit operation")
25+
purchase_order: String @doc(description: "Purchase order number associated with the company credit operation")
26+
updated_by: CompanyCreditOperationUser! @doc(description: "The user submitting the company credit operation")
27+
}
28+
29+
type CompanyCreditOperationUser {
30+
name: String! @doc(description: "The name of the user submitting the company credit operation")
31+
type: CompanyCreditOperationUserType! @doc(description: "The type of the user submitting the company credit operation")
32+
}
33+
34+
type CompanyCredit {
35+
outstanding_balance: Money! @doc(description: "Outstanding company credit")
36+
available_credit: Money! @doc(description: "Available company credit")
37+
credit_limit: Money! @doc(description: "Company credit limit")
38+
}
39+
40+
enum CompanyCreditOperationType {
41+
ALLOCATION
42+
UPDATE
43+
PURCHASE
44+
REIMBURSEMENT
45+
REFUND
46+
REVERT
47+
}
48+
49+
enum CompanyCreditOperationUserType {
50+
CUSTOMER
51+
ADMIN
52+
}
53+
54+
input CompanyCreditHistoryFilterInput {
55+
operation_type: CompanyCreditOperationType @doc(description: "Enum filter by the type of the company credit operation")
56+
purchase_order: String @doc(description: "Free text filter by the purchase order number associated with the company credit operation")
57+
updated_by: String @doc(description: "Free text filter by the name of the person submitting the company credit operation")
58+
}
59+
###### End: Defining new types ######
60+
61+
```
62+
63+
64+

design-documents/graph-ql/coverage/customer-password-reset.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
```graphql
44
type Mutation {
5-
requestPasswordResetEmail(email: String!): Boolean @doc(description: "Request an email with reset password token for the registerspecified customer identified by the provided email")
5+
requestPasswordResetEmail(email: String!): Boolean @doc(description: "Request an email with reset password token for the registered customer identified by the provided email")
66
resetPassword(email: String!, resetPasswordToken: String!, newPassword: String!): Boolean @doc(description: "Reset customer password using reset password token received in the email after requesting it using requestPasswordResetEmail")
77
}
88
```

design-documents/graph-ql/coverage/gift-wrapping.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ It is suggested to use base64 encoded DB increment ID as ID in GraphQL.
1313
type Cart {
1414
available_gift_wrappings: [GiftWrapping]! @doc(description: "The list of available gift wrapping options for the cart")
1515
gift_wrapping: GiftWrapping @doc(description: "The selected gift wrapping for the cart")
16-
include_printed_card: Boolean! @doc(description: "Wether customer requested printed card for the order")
17-
include_gift_receipt: Boolean! @doc(description: "Wether customer requested gift receipt for the order")
16+
printed_card_included: Boolean! @doc(description: "Wether customer requested printed card for the order")
17+
gift_receipt_included: Boolean! @doc(description: "Wether customer requested gift receipt for the order")
1818
gift_message: GiftMessage @doc(description: "The entered gift message for the cart")
1919
}
2020

@@ -47,8 +47,8 @@ type SalesItemInterface {
4747

4848
type CustomerOrder {
4949
gift_wrapping: GiftWrapping @doc(description: "The selected gift wrapping for the order")
50-
include_printed_card: Boolean! @doc(description: "Wether customer requested printed card for the order")
51-
include_gift_receipt: Boolean! @doc(description: "Wether customer requested gift receipt for the order")
50+
printed_card_included: Boolean! @doc(description: "Whether customer requested printed card for the order")
51+
gift_receipt_included: Boolean! @doc(description: "Whether customer requested gift receipt for the order")
5252
gift_message: GiftMessage @doc(description: "The entered gift message for the order")
5353
}
5454

@@ -178,7 +178,7 @@ type CartItemUpdateInput {
178178
}
179179

180180
type Mutation {
181-
setGiftOptionsOnCart(cart_id: String!, gift_message: GiftMessageInput, gift_wrapping_id: ID, include_gift_receipt: Boolean, include_printed_card: Boolean): SetGiftOptionsOnCartOutput @doc(description: "Set gift options like gift wrapping or gift message for the entire cart")
181+
setGiftOptionsOnCart(cart_id: String!, gift_message: GiftMessageInput, gift_wrapping_id: ID, gift_receipt_included: Boolean, printed_card_included: Boolean): SetGiftOptionsOnCartOutput @doc(description: "Set gift options like gift wrapping or gift message for the entire cart")
182182
}
183183
###### End: Extending existing types ######
184184

0 commit comments

Comments
 (0)