feat(pricing, types, utils, medusa-sdk): Pricing Module Setup + Currency (#4860)

What:

- Setups the skeleton for pricing module
- Creates service/model/repository for currency model
- Setups types
- Setups DB
- Moved some utils to a common place

RESOLVES CORE-1477
RESOLVES CORE-1476
This commit is contained in:
Riqwan Thamir
2023-08-29 21:58:34 +00:00
committed by GitHub
parent 470379e631
commit 460161a69f
70 changed files with 3022 additions and 75 deletions
+31
View File
@@ -0,0 +1,31 @@
import {
ExternalModuleDeclaration,
InternalModuleDeclaration,
MedusaModule,
MODULE_PACKAGE_NAMES,
Modules,
} from "@medusajs/modules-sdk"
import { IPricingModuleService, ModulesSdkTypes } from "@medusajs/types"
import { moduleDefinition } from "../module-definition"
import { InitializeModuleInjectableDependencies } from "../types"
export const initialize = async (
options?:
| ModulesSdkTypes.ModuleServiceInitializeOptions
| ModulesSdkTypes.ModuleServiceInitializeCustomDataLayerOptions
| ExternalModuleDeclaration
| InternalModuleDeclaration,
injectedDependencies?: InitializeModuleInjectableDependencies
): Promise<IPricingModuleService> => {
const serviceKey = Modules.PRICING
const loaded = await MedusaModule.bootstrap<IPricingModuleService>(
serviceKey,
MODULE_PACKAGE_NAMES[Modules.PRICING],
options as InternalModuleDeclaration | ExternalModuleDeclaration,
moduleDefinition,
injectedDependencies
)
return loaded[serviceKey]
}