mirror of
https://github.com/frappe/books.git
synced 2024-12-22 19:09:01 +00:00
14 lines
455 B
TypeScript
14 lines
455 B
TypeScript
import { ModelNameEnum } from '../../models/types';
|
|
import { defaultUOMs } from '../../utils/defaults';
|
|
import { DatabaseManager } from '../database/manager';
|
|
import { getDefaultMetaFieldValueMap } from '../helpers';
|
|
|
|
async function execute(dm: DatabaseManager) {
|
|
for (const uom of defaultUOMs) {
|
|
const defaults = getDefaultMetaFieldValueMap();
|
|
await dm.db?.insert(ModelNameEnum.UOM, { ...uom, ...defaults });
|
|
}
|
|
}
|
|
|
|
export default { execute };
|