add status to invoices
This commit is contained in:
committed by
Daniel Hutzel
parent
9a63f406ec
commit
52f00c62b7
@@ -12,6 +12,12 @@ const SRC_STORAGE_NAME = args[FIRST_INDEX];
|
||||
const TARGET_STORAGE_NAME = args[SECOND_INDEX];
|
||||
const TARGET_SCHEMA_PATH = args[THIRD_INDEX];
|
||||
|
||||
function getRandomInt(min, max) {
|
||||
min = Math.ceil(min);
|
||||
max = Math.floor(max);
|
||||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||
}
|
||||
|
||||
const camelCaseToSnake = (str) =>
|
||||
str.replace(
|
||||
/[a-z][A-Z]/g,
|
||||
@@ -120,6 +126,14 @@ const logProcessArgs = () => {
|
||||
password: "some",
|
||||
}));
|
||||
}
|
||||
// for mock invoice data
|
||||
if (srcEntityName === "Invoices") {
|
||||
columns.push("status");
|
||||
srcResultRows = srcResultRows.map((row) => ({
|
||||
...row,
|
||||
status: getRandomInt(-1, 2),
|
||||
}));
|
||||
}
|
||||
|
||||
const transaction = await targetStorage.tx();
|
||||
await transaction.run(
|
||||
|
||||
Reference in New Issue
Block a user