Feat: Create customer group (#1074)

* fix babel transform-runtime regenerator required for migrations

* add customer group model

* add migration for customer group

* add customer group model export

* add customer group repository

* add customer group service

* add CustomerGroupRepository to "withTransaction" in CustomerGroupService

* remove unnecessary argument to runtime plugin

* service export ordering

* add create customer group endpoint

* add customergroup to route index in admin

* add customer group service

* add customer groups test

* cleanup

* duplicate error handling

* ducplicate name integration test

* add jsdoc

* customergroup not customer

* pr feedback

* pipeline test

* fix weird merge

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
This commit is contained in:
Philip Korsholm
2022-02-18 09:58:54 +01:00
committed by GitHub
co-authored by Sebastian Rindom
parent 22d387dcce
commit b16976a6f4
16 changed files with 440 additions and 11 deletions
@@ -1,4 +1,4 @@
const { Customer, Address } = require("@medusajs/medusa")
const { Customer, Address, CustomerGroup } = require("@medusajs/medusa")
module.exports = async (connection, data = {}) => {
const manager = connection.manager
@@ -35,4 +35,9 @@ module.exports = async (connection, data = {}) => {
email: "test4@email.com",
has_account: true,
})
await manager.insert(CustomerGroup, {
id: "customer-group-1",
name: "vip-customers",
})
}