-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnypl-core-objects.js
28 lines (27 loc) · 1.21 KB
/
nypl-core-objects.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const ByRecapCustomerCodeFactory = require('./lib/by_recap_customer_code_factory')
const ByM2CustomerCodeFactory = require('./lib/by_m2_customer_code_factory')
const BySierraLocationFactory = require('./lib/by_sierra_location_factory')
const ByPatronTypeFactory = require('./lib/by_patron_type_factory')
const ByCatalogItemTypeFactory = require('./lib/by_catalog_item_type_factory')
const ByFulfillmentFactory = require('./lib/by_fulfillment_factory')
const FactoryBase = require('./lib/factory_base')
module.exports = (maptype) => {
switch (maptype) {
case 'by-fulfillment':
return ByFulfillmentFactory.createMapping()
case 'by-recap-customer-code':
return ByRecapCustomerCodeFactory.createMapping()
case 'by-sierra-location':
return BySierraLocationFactory.createMapping()
case 'by-patron-type':
return ByPatronTypeFactory.createMapping()
case 'by-catalog-item-type':
return ByCatalogItemTypeFactory.createMapping()
case 'by-m2-customer-code':
return ByM2CustomerCodeFactory.createMapping()
default:
// Attempt to create a basic map based on maptype:
// Will throw a MappingNameError if unrecognized
return FactoryBase.createMapping(maptype)
}
}