Skip to content

Commit

Permalink
Merge pull request #144 from AdobeDocs/jh_crud
Browse files Browse the repository at this point in the history
runtime actions
  • Loading branch information
jhadobe committed Feb 23, 2024
2 parents 312fb96 + 1415bce commit 0ba45d5
Show file tree
Hide file tree
Showing 14 changed files with 824 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/data/navigation/sections/app-development.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ module.exports = [
]
},
{
title: "Starter Kit",
title: "Starter kit",
path: "/app-development/starter-kit/index.md",
pages: [
{
title: "Project Setup",
path: "/app-development/starter-kit/project-setup.md"
path: "/app-development/starter-kit/project-setup.md",
},
{
title: "Integrate runtime actions",
path: "/app-development/starter-kit/integration.md",
}
]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<CodeBlock slots="heading, code" repeat="3" languages="JSON, JSON, JSON" />

#### create

```json
{
"type": "object",
"properties": {
"name": { "type": "string" },
"taxClassId": { "type": "number" }
},
"required": ["name", "taxClassId"],
"additionalProperties": true
}
```

#### update

```json
{
"type": "object",
"properties": {
"sku": { "type": "string" },
"name": { "type": "string" },
"price": {"type": "number"},
"description": {"type": "string"}
},
"required": ["sku", "name", "price", "description"],
"additionalProperties": true
}
```

#### delete

```json
{
"customer_group_id": 6,
"customer_group_code": "Group name code",
"tax_class_id": 4,
"tax_class_name": "Tax class name",
"extension_attributes": {
"exclude_website_ids":[]
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<CodeBlock slots="heading, code" repeat="3" languages="JSON, JSON, JSON" />

#### create

```json
{
"type": "object",
"properties": {
"name": { "type": "string" },
"lastname": {"type": "string"},
"email": {"type": "string"}
},
"required": ["name", "lastname", "email"],
"additionalProperties": true
}
```

#### update

```json
{
"type": "object",
"properties": {
"id": {"type": "number"},
"name": { "type": "string" },
"lastname": {"type": "string"},
"email": {"type": "string"}
},
"required": ["id", "name", "lastname", "email"],
"additionalProperties": true
}
```

#### delete

```json
{
"type": "object",
"properties": {
"id": { "type": "number" }
},
"required": ["id"],
"additionalProperties": false
}
```
16 changes: 16 additions & 0 deletions src/pages/app-development/starter-kit/code-samples/data-order.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<CodeBlock slots="heading, code" repeat="1" languages="JSON" />

#### update

```json
{
"type": "object",
"properties": {
"id": { "type": "integer" },
"status": { "type": "string" },
"notifyCustomer": { "type": "boolean"}
},
"required": ["id", "status"],
"additionalProperties": true
}
```
46 changes: 46 additions & 0 deletions src/pages/app-development/starter-kit/code-samples/data-product.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<CodeBlock slots="heading, code" repeat="3" languages="JSON, JSON, JSON" />

#### create

```json
{
"type": "object",
"properties": {
"sku": { "type": "string" },
"name": { "type": "string" },
"price": {"type": "number"},
"description": {"type": "string"}
},
"required": ["sku", "name", "description"],
"additionalProperties": true
}
```

#### update

```json
{
"type": "object",
"properties": {
"sku": { "type": "string" },
"name": { "type": "string" },
"price": {"type": "number"},
"description": {"type": "string"}
},
"required": ["sku", "name", "price", "description"],
"additionalProperties": true
}
```

#### delete

```json
{
"type": "object",
"properties": {
"sku": { "type": "string" }
},
"required": ["sku"],
"additionalProperties": false
}
```
109 changes: 109 additions & 0 deletions src/pages/app-development/starter-kit/code-samples/data-shipment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<CodeBlock slots="heading, code" repeat="2" languages="JSON, JSON" />

#### create

```json
{
"type": "object",
"properties": {
"orderId": { "type": "string" },
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"orderItemId": { "type": "number" },
"qty": { "type": "number" }
},
"required": ["orderItemId", "qty"],
"additionalProperties": false
}
},
"tracks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"trackNumber": { "type": "string" },
"title": { "type": "string" },
"carrierCode": { "type": "string" }
},
"required": ["trackNumber", "title", "carrierCode"],
"additionalProperties": false
}
},
"comments" : {
"type": "array",
"items": {
"type": "object",
"properties": {
"notifyCustomer": { "type": "boolean" },
"comment": { "type": "string" },
"visibleOnFront": { "type": "boolean" }
},
"required": ["notifyCustomer", "comment", "visibleOnFront"],
"additionalProperties": false
}
},
"stockSourceCode": { "type": "string" }
},
"required": ["orderId", "items", "tracks", "comments", "stockSourceCode"],
"additionalProperties": false
}
```

#### update

```json
{
"type": "object",
"properties": {
"id": { "type": "number" },
"orderId": { "type": "number" },
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"entityId": { "type": "number" },
"orderItemId": { "type": "number" },
"qty": { "type": "number" }
},
"required": ["entityId", "orderItemId", "qty"],
"additionalProperties": false
}
},
"tracks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"entityId": { "type": "number" },
"trackNumber": { "type": "string" },
"title": { "type": "string" },
"carrierCode": { "type": "string" }
},
"required": ["entityId", "trackNumber", "title", "carrierCode"],
"additionalProperties": false
}
},
"comments" : {
"type": "array",
"items": {
"type": "object",
"properties": {
"entityId": { "type": "number" },
"notifyCustomer": { "type": "boolean" },
"comment": { "type": "string" },
"visibleOnFront": { "type": "boolean" }
},
"required": ["entityId", "notifyCustomer", "comment", "visibleOnFront"],
"additionalProperties": false
}
},
"stockSourceCode": { "type": "string" }
},
"required": ["id", "orderId", "items", "tracks", "comments", "stockSourceCode"],
"additionalProperties": false
}
```
19 changes: 19 additions & 0 deletions src/pages/app-development/starter-kit/code-samples/data-stock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<CodeBlock slots="heading, code" repeat="1" languages="JSON" />

#### update

```json
{
"type": "array",
"items": {
"properties": {
"sku": { "type": "string" },
"source": { "type": "string" },
"quantity": { "type": "number" },
"outOfStock": { "type": "boolean" }
},
"required": [ "sku", "source", "quantity", "outOfStock" ],
"additionalProperties": true
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<CodeBlock slots="heading, code" repeat="3" languages="JSON, JSON, JSON" />

#### create

```json
{
"name": "A Group Name",
"taxClassId": 25
}
```

#### update

```json
{
"id": 8,
"name": "A Group Name",
"taxClassId": 25
}
```

#### delete

```json
{
"id": 8
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<CodeBlock slots="heading, code" repeat="3" languages="JSON, JSON, JSON" />

#### create

```json
{
"email": "sample@email.com",
"name": "John",
"lastname": "Doe"
}
```

#### update

```json
{
"id": 1234,
"email": "sample@email.com",
"name": "John",
"lastname": "Doe"
}
```

#### delete

```json
{
"id": 1234
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<CodeBlock slots="heading, code" repeat="1" languages="JSON" />

#### update

```json
{
"id": 99,
"status": "shipped",
"notifyCustomer": false
}
```
Loading

0 comments on commit 0ba45d5

Please sign in to comment.