concentrix/module-corporate-group 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

concentrix/module-corporate-group

Composer 安装命令:

composer require concentrix/module-corporate-group

包简介

Corporate Group Module

README 文档

README

Concentrix code challenge!

Overview

Concentrix Corporate Groups Module for Magento 2.4 is designed to manage corporate groups through a rest API and link them with customers.

Installation

Composer (recommended)

In the root directory of magento, execute the following command:

composer require concentrix/module-corporate-group

If there are any problems trying to install this package, update to the latest version of composer

composer self-update --2

Git

On the main page of the repository, click the "Code" button and clone the repository via git, or click "Download Zip" to download the module and add it to Magento manually in app/code/Concentrix/CorporateGroup directory

In both cases (composer or git), execute the following command in the root directory of magento:

bin/magento s:up

This should be enough for the module to start working correctly, although in a few cases, it will be necessary to deploy the static content. This can be done with the following command:

bin/magento setup:static-content:deploy -f

How to consume the API

Since this web API is exposed to anonymous users, it can be accessed without the need for a token or authentication of any kind.

The urls must be formed in the following way:

http://<magento_url>/rest/all/{endpoint}

For the definition of the endpoints of this web API in a visual way, you can access the Swagger UI of Magento at:

http://<magento_url>/swagger/#/concentrixCorporateGroupCorporateGroupRepositoryV1

Swagger api definition

To consume the API, you can either download a REST client (such as Postman or Insomnia) to make the corresponding requests, or you can perform a direct curl command. (You can even run it directly from Swagger UI!)

REST client request example

Curl example

curl -X 'POST' \
  'http://magento2.test/rest/all/V1/concentrix/corporate-groups' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "corporateGroup": {
    "internal_code": "string",
    "name": "string",
    "email": "string",
    "telephone": "string"
  }
}'

Manage corporate groups

There are 4 main endpoints:

Description Method Endpoint
Create a new corporate group POST V1/concentrix/corporate-groups
Get a corporate group GET V1/concentrix/corporate-groups/{internalCode}
Delete a corporate group PUT V1/concentrix/corporate-groups
Search corporate group(s) GET V1/concentrix/corporate-groups

1. Create a new corporate group

V1/concentrix/corporate-groups POST

Request example

{
  "corporateGroup": {
    "internal_code": "unique_code",
    "name": "Test Group Name or Label",
    "email": "test@concentrix.com",
    "telephone": "+525512345678"
  }
}

2. Get a corporate group

V1/concentrix/corporate-groups/{internalCode} GET

Request example

There is no request body for this, the internal_code must be passed by URL

3. Delete a corporate group

V1/concentrix/corporate-groups PUT

For this endpoint, I didn't use the DELETE method because of a bug I couldn't resolve :( sorry

Request example

{
  "internalCode": "unique_code"
}

4. Search corporate group(s)

V1/concentrix/corporate-groups GET

There is no request body for this, the URL must conform to a couple of SearchCriteria parameters (more details in Swagger UI of your Magento instance)

V1/concentrix/corporate-groups?searchCriteria%5BfilterGroups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bfield%5D={field_name}&searchCriteria%5BfilterGroups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bvalue%5D={value}

Example (To search by phone)

V1/concentrix/corporate-groups?searchCriteria%5BfilterGroups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bfield%5D=telephone&searchCriteria%5BfilterGroups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bvalue%5D=+525512345678

Bind customer group to a customer

There are also 2 additional endpoints to link a client to a business group:

Description Method Endpoint
Link a corporate group to a customer by customer id POST V1/concentrix/corporate-groups/link-customer-by-id
Link a business group to a customer using the customer's email POST V1/concentrix/corporate-groups/link-customer-by-email

1. Link a corporate group to a customer by customer ID

V1/concentrix/corporate-groups/link-customer-by-id POST

Request example

{
  "internalCode": "unique_code",
  "customerId": 1
}

2. Link a corporate group to a customer by customer email

V1/concentrix/corporate-groups/link-customer-by-email POST

Request example

{
  "internalCode": "unique_code",
  "customerEmail": "example@concentrix.com"
}

It is also possible to link a customer with an existing corporate group through the Magento administrator, going to Customers > All Customers then clicking on the customer of your choice and going to the Account Information tab

REST client request example

That's it!

concentrix/module-corporate-group 适用场景与选型建议

concentrix/module-corporate-group 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 07 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 concentrix/module-corporate-group 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 concentrix/module-corporate-group 我们能提供哪些服务?
定制开发 / 二次开发

基于 concentrix/module-corporate-group 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2022-07-03