Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nice to have: Terraform script to create Mollie custom types #157

Open
dsjak-shie opened this issue Apr 11, 2022 · 1 comment
Open

Nice to have: Terraform script to create Mollie custom types #157

dsjak-shie opened this issue Apr 11, 2022 · 1 comment

Comments

@dsjak-shie
Copy link

Summary

We use terraform to manage a part of our commercetools configuration. It would be a nice addition to have a piece of terraform script included in this project which has all the custom type configuration defined in it.
Developers who manage their commercetools configuration through terraform would then be able to just copy the type configuration from this project into their own terraform script.

mollie-custom-types.tf

resource "commercetools_type" "mollie-integration-payment-type" {
  key = "ct-mollie-integration-payment-type"
  name = {
    en = "Mollie Integration payment type"
  }
  resource_type_ids = ["payment"]

  # payment methods request field
  field {
    type {
      name = "String"
    }
    name = "paymentMethodsRequest"
    label = {
      en = "Payment methods request"
    }
    required   = false
    input_hint = "MultiLine"
  }

  # payment methods response field
  field {
    type {
      name = "String"
    }
    name = "paymentMethodsResponse"
    label = {
      en = "Payment methods response"
    }
    required   = false
    input_hint = "MultiLine"
  }

  # create payment field
  field {
    type {
      name = "String"
    }
    name = "createPayment"
    label = {
      en = "Create payment"
    }
    required   = false
    input_hint = "MultiLine"
  }
}

resource "commercetools_type" "mollie-integration-transaction-type" {
  key = "ct-mollie-integration-transaction-type"
  name = {
    en = "Mollie Integration transaction type"
  }
  resource_type_ids = ["transaction"]

  # line IDs field
  field {
    type {
      name = "String"
    }
    name = "lineIds"
    label = {
      en = "Line IDs and Custom Line IDs"
    }
    required   = false
    input_hint = "MultiLine"
  }

  # include shipping field
  field {
    type {
      name = "Boolean"
    }
    name = "includeShipping"
    label = {
      en = "Include shipping"
    }
    required = false
  }

  # description field
  field {
    type {
      name = "String"
    }
    name = "description"
    label = {
      en = "Description"
    }
    required   = false
    input_hint = "SingleLine"
  }

  # metadata field
  field {
    type {
      name = "String"
    }
    name = "metadata"
    label = {
      en = "Metadata"
    }
    required   = false
    input_hint = "MultiLine"
  }
}

resource "commercetools_type" "mollie-integration-interaction-type" {
  key = "ct-mollie-integration-interface-interaction-type"
  name = {
    en = "Mollie Integration payment interface interaction type"
  }
  resource_type_ids = ["payment-interface-interaction"]

  # id field
  field {
    type {
      name = "String"
    }
    name = "id"
    label = {
      en = "ID"
    }
    required   = true
    input_hint = "SingleLine"
  }

  # action type field
  field {
    type {
      name = "String"
    }
    name = "actionType"
    label = {
      en = "Action type"
    }
    required   = true
    input_hint = "SingleLine"
  }

  # created at field
  field {
    type {
      name = "DateTime"
    }
    name = "createdAt"
    label = {
      en = "Created at"
    }
    required = false
  }

  # request field
  field {
    type {
      name = "String"
    }
    name = "request"
    label = {
      en = "Request"
    }
    required   = false
    input_hint = "MultiLine"
  }

  # response field
  field {
    type {
      name = "String"
    }
    name = "response"
    label = {
      en = "Response"
    }
    required   = false
    input_hint = "MultiLine"
  }
}
@denisand
Copy link
Contributor

Great idea, can you make a PR for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants