"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "createNote", {
    enumerable: true,
    get: function() {
        return createNote;
    }
});
const _constants = require("@tamanu/constants");
const _randomRecord = require("../randomRecord.js");
const _index = require("../../fake/index.js");
const createNote = async ({ models, authorId })=>{
    const { Note } = models;
    const recordType = _index.chance.pickone([
        _constants.NOTE_RECORD_TYPES.ENCOUNTER,
        _constants.NOTE_RECORD_TYPES.PATIENT
    ]);
    const recordModel = recordType === _constants.NOTE_RECORD_TYPES.ENCOUNTER ? 'Encounter' : 'Patient';
    await Note.create((0, _index.fake)(Note, {
        recordType,
        recordId: await (0, _randomRecord.randomRecordId)(models, recordModel),
        authorId: authorId || await (0, _randomRecord.randomRecordId)(models, 'User')
    }));
};

//# sourceMappingURL=note.js.map