Skip to content

Commit

Permalink
Merge pull request incentro-ecx#70 from incentro-dc/feat/update-docs
Browse files Browse the repository at this point in the history
feat: moved examples to specific folder. Added check marks to documen…
  • Loading branch information
Thomas De Meyer authored Dec 4, 2022
2 parents f52cc2b + 8da9ebb commit e479fca
Show file tree
Hide file tree
Showing 43 changed files with 625 additions and 195 deletions.
2 changes: 1 addition & 1 deletion .idea/terraform-provider-commercelayer.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,42 @@
The Commercelayer terraform provider allows you to configure your [Commercelayer shops](https://commercelayer.io/) with
infrastructure-as-code principles.

## Currently supported resources

Currently, the checked resources are supported. Support for additional resources will come when they are required in
projects, or contributed.

- [x] Address
- [ ] Adyen payment gateway
- [ ] Avalara tax calculator
- [ ] Bing Geocoder
- [ ] Braintree payment gateway
- [ ] Checkout.com payment gateway
- [x] Customer group
- [ ] Delivery lead times
- [x] External payment gateway
- [x] External tax calculator
- [ ] Google Geocoder
- [x] Inventory model
- [x] Inventory return location
- [x] Inventory stock location
- [ ] Klarna payment gateway
- [ ] Manual payment gateway
- [ ] Manual tax calculator
- [x] Market
- [x] Merchant
- [ ] Paypal payment gateway
- [ ] Payment method
- [x] Price list
- [x] Shipping category
- [x] Shipping method
- [x] Shipping zone
- [x] Stock location
- [ ] Stripe payment gateway
- [ ] Taxjar tax calculator
- [ ] Tax rules
- [x] Webhook

## Usage

Add the provider to your terraform project
Expand Down
2 changes: 1 addition & 1 deletion commercelayer/resource_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func resourceWebhook() *schema.Resource {
Required: true,
},
"include_resources": {
Description: "List of related resources that should be included in the webhook body.",
Description: "List of related commercelayer_inventory_stock_location that should be included in the webhook body.",
Type: schema.TypeList,
Elem: &schema.Schema{
Type: schema.TypeString,
Expand Down
29 changes: 18 additions & 11 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,34 @@ The commercelayer provider provides resources to interact with the commercelayer
# commercelayer provider

## Commercial support
TODO

Need support implementing this terraform module in your organization? We are able to offer support. Please contact us at
<info@incentro.com>

## Installation

Terraform automatically downloads providers from the terraform registry. Add the following to your terraform project

```hcl
terraform {
required_providers {
commercelayer = {
version = ">= 0.0.1"
source = "incentro-dc/commercelayer"
}
required_providers {
commercelayer = {
version = ">= 0.0.1"
source = "incentro-dc/commercelayer"
}
}
}
```

Packages of the releases are available at [the GitHub Repo](https://github.com/incentro-dc/terraform-provider-commercelayer/releases).
Packages of the releases are available
at [the GitHub Repo](https://github.com/incentro-dc/terraform-provider-commercelayer/releases).
See the [terraform documentation](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins)
for more information about installing third-party providers.

## Using the provider

The provider attempts to read the required values from environment variables:

- `COMMERCELAYER_CLIENT_ID`
- `COMMERCELAYER_CLIENT_SECRET`
- `COMMERCELAYER_API_ENDPOINT`
Expand All @@ -40,14 +46,15 @@ Alternatively, you can set it up directly in the terraform file:

```hcl
provider "commercelayer" {
client_id = "<client_id>"
client_secret = "<client_secret>"
api_endpoint = "<api_endpoint>"
auth_endpoint = "<auth_endpoint>"
client_id = "<client_id>"
client_secret = "<client_secret>"
api_endpoint = "<api_endpoint>"
auth_endpoint = "<auth_endpoint>"
}
```

<!-- schema generated by tfplugindocs -->

## Schema

### Required
Expand Down
17 changes: 16 additions & 1 deletion docs/resources/address.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,22 @@ description: |-

Addresses can be associated with orders as their shipping or billing addresses. Add a Google or Bing geocoder to a market if you want its addresses to be automatically geocoded. Customers can save their most-used addresses in their address books (as customer addresses).


## Example Usage

```terraform
resource "commercelayer_address" "incentro_address" {
attributes {
business = true
company = "Incentro"
line_1 = "Van Nelleweg 1"
zip_code = "3044 BC"
country_code = "NL"
city = "Rotterdam"
phone = "+31(0)10 20 20 544"
state_code = "ZH"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
10 changes: 9 additions & 1 deletion docs/resources/customer_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ A customer group is a resource that can be used to organize customers into group
only by the customers belonging to the group. You can use customer groups to manage B2B customers,
B2C loyalty programs, private sales, and more.


## Example Usage

```terraform
resource "commercelayer_customer_group" "incentro_customer_group" {
attributes {
name = "Incentro Customer Group"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
15 changes: 14 additions & 1 deletion docs/resources/external_gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,20 @@ Price lists are collections of SKU prices,
a stock item in one of the market stock locations will be returned.
A user can create price lists to manage international business or B2B/B2C models.


## Example Usage

```terraform
resource "commercelayer_external_gateway" "incentro_external_gateway" {
attributes {
name = "Incentro External Gateway"
authorize_url = "https://example.com"
capture_url = "https://foo.com"
void_url = "https://foo.com"
refund_url = "https://example.com"
token_url = "https://example.com"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
11 changes: 10 additions & 1 deletion docs/resources/external_tax_calculator.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ description: |-

Create an external tax calculator to delegate tax calculation logic to the specified external service. Use the order payload to compute your own logic and return the tax rate to be applied to the order.


## Example Usage

```terraform
resource "commercelayer_external_tax_calculator" "incentro_external_tax_calculator" {
attributes {
name = "Incentro External Tax Calculator"
tax_calculator_url = "https://example.com"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
12 changes: 11 additions & 1 deletion docs/resources/inventory_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ description: |-

An inventory model defines a list of stock locations ordered by priority. The priority and cutoff determine how the availability of SKU's gets calculated within a market.


## Example Usage

```terraform
resource "commercelayer_inventory_model" "incentro_inventory_model" {
attributes {
name = "Incentro Inventory Model"
stock_locations_cutoff = 2
strategy = "split_shipments"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
48 changes: 47 additions & 1 deletion docs/resources/inventory_return_location.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,53 @@ description: |-

Inventory return locations build a hierarchy of stock locations within an inventory model, determining the available options for the returns. In the case a SKU is available in more stock locations, it gets returned to those with the highest priority.


## Example Usage

```terraform
resource "commercelayer_inventory_model" "incentro_inventory_model" {
attributes {
name = "Incentro Inventory Model"
stock_locations_cutoff = 2
strategy = "split_shipments"
}
}
resource "commercelayer_address" "incentro_address" {
attributes {
business = true
company = "Incentro"
line_1 = "Van Nelleweg 1"
zip_code = "3044 BC"
country_code = "NL"
city = "Rotterdam"
phone = "+31(0)10 20 20 544"
state_code = "ZH"
}
}
resource "commercelayer_stock_location" "incentro_stock_location" {
attributes {
name = "Incentro Warehouse Location"
label_format = "PNG"
suppress_etd = true
}
relationships {
address_id = commercelayer_address.incentro_address.id
}
}
resource "commercelayer_inventory_return_location" "incentro_return_location" {
attributes {
priority = 1
}
relationships {
inventory_model_id = commercelayer_inventory_model.incentro_inventory_model.id
stock_location_id = commercelayer_stock_location.incentro_stock_location.id
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
61 changes: 60 additions & 1 deletion docs/resources/inventory_stock_location.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,66 @@ description: |-

Inventory stock locations build a hierarchy of stock locations within an inventory model, determining the availability of SKU's that are being purchased. In the case a SKU is available in more stock locations, it gets shipped from those with the highest priority.


## Example Usage

```terraform
resource "commercelayer_inventory_model" "incentro_inventory_model" {
attributes {
name = "Incentro Inventory Model"
stock_locations_cutoff = 2
strategy = "split_shipments"
}
}
resource "commercelayer_address" "incentro_address" {
attributes {
business = true
company = "Incentro"
line_1 = "Van Nelleweg 1"
zip_code = "3044 BC"
country_code = "NL"
city = "Rotterdam"
phone = "+31(0)10 20 20 544"
state_code = "ZH"
}
}
resource "commercelayer_stock_location" "incentro_stock_location" {
attributes {
name = "Incentro Warehouse Location"
label_format = "PNG"
suppress_etd = true
}
relationships {
address_id = commercelayer_address.incentro_address.id
}
}
resource "commercelayer_inventory_stock_location" "incentro_warehouse_location" {
attributes {
priority = 1
}
relationships {
inventory_model_id = commercelayer_inventory_model.incentro_inventory_model.id
stock_location_id = commercelayer_stock_location.incentro_stock_location.id
}
}
resource "commercelayer_inventory_stock_location" "incentro_backorder_location" {
attributes {
priority = 2
on_hold = true
}
relationships {
inventory_model_id = commercelayer_inventory_model.incentro_inventory_model.id
stock_location_id = commercelayer_stock_location.incentro_stock_location.id
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
Loading

0 comments on commit e479fca

Please sign in to comment.