Repository: elizavetapavliv/report_hub
Pull request #21: Mongo script for creating collection and filling it with seed data
Author: login: mkknyaz
Created: 2025-03-26T15:26:12Z | Merged: 2025-03-27T13:15:12Z



Diff:
diff --git a/Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/00_create_MigrationHistory.js b/Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/00_create_MigrationHistory.js
new file mode 100644
index 00000000..b1966a16
--- /dev/null
+++ b/Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/00_create_MigrationHistory.js
@@ -0,0 +1,6 @@
+﻿db.MigrationHistory.createIndex(
+    { scriptName: 1, version: 1 },
+    {
+        unique: true,
+        background: true
+    });
\ No newline at end of file
diff --git a/Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/01_create_Invoice.js b/Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/01_create_Invoice.js
new file mode 100644
index 00000000..7d565545
--- /dev/null
+++ b/Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/01_create_Invoice.js
@@ -0,0 +1,186 @@
+﻿const scriptName = "01_create_Invoice";
+const version = NumberInt(1);
+
+if (db.MigrationHistory.findOne({ scriptName, version })) {
+    print(`${scriptName} v${version} is already applied`);
+    quit();
+}
+
+db.createCollection("Invoice", {
+    collation: {
+        locale: "en"
+    }
+});
+
+db.Invoice.insertMany([
+    {
+        _id: UUID(),
+        InvoiceId: "INV2025002",
+        IssueDate: ISODate("2025-01-20T00:00:00Z"),
+        DueDate: ISODate("2025-02-20T00:00:00Z"),
+        Amount: NumberDecimal("500.00"),
+        Currency: "USD",
+        PaymentStatus: "Unpaid"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2024001",
+        IssueDate: ISODate("2024-04-28T00:00:00Z"),
+        DueDate: ISODate("2024-06-19T00:00:00Z"),
+        Amount: NumberDecimal("98917.28"),
+        Currency: "JPY",
+        PaymentStatus: "Overdue"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2025005",
+        IssueDate: ISODate("2025-08-09T00:00:00Z"),
+        DueDate: ISODate("2025-09-17T00:00:00Z"),
+        Amount: NumberDecimal("47418.14"),
+        Currency: "USD",
+        PaymentStatus: "Unpaid"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2024002",
+        IssueDate: ISODate("2024-08-12T00:00:00Z"),
+        DueDate: ISODate("2024-09-05T00:00:00Z"),
+        Amount: NumberDecimal("38510.38"),
+        Currency: "CAD",
+        PaymentStatus: "Cancelled"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2024003",
+        IssueDate: ISODate("2024-08-20T00:00:00Z"),
+        DueDate: ISODate("2024-09-17T00:00:00Z"),
+        Amount: NumberDecimal("17775.52"),
+        Currency: "INR",
+        PaymentStatus: "Partially Paid"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2024004",
+        IssueDate: ISODate("2024-10-24T00:00:00Z"),
+        DueDate: ISODate("2024-12-10T00:00:00Z"),
+        Amount: NumberDecimal("35625.06"),
+        Currency: "GBP",
+        PaymentStatus: "Paid"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2024005",
+        IssueDate: ISODate("2024-10-25T00:00:00Z"),
+        DueDate: ISODate("2024-12-18T00:00:00Z"),
+        Amount: NumberDecimal("80875.27"),
+        Currency: "CNY",
+        PaymentStatus: "Pending"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2025010",
+        IssueDate: ISODate("2025-09-21T00:00:00Z"),
+        DueDate: ISODate("2025-10-15T00:00:00Z"),
+        Amount: NumberDecimal("7024.28"),
+        Currency: "AUD",
+        PaymentStatus: "Pending"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2024006",
+        IssueDate: ISODate("2024-04-03T00:00:00Z"),
+        DueDate: ISODate("2024-04-19T00:00:00Z"),
+        Amount: NumberDecimal("30632.44"),
+        Currency: "EUR",
+        PaymentStatus: "Pending"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2025012",
+        IssueDate: ISODate("2025-10-24T00:00:00Z"),
+        DueDate: ISODate("2025-11-04T00:00:00Z"),
+        Amount: NumberDecimal("61696.31"),
+        Currency: "INR",
+        PaymentStatus: "Cancelled"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2025013",
+        IssueDate: ISODate("2025-01-07T00:00:00Z"),
+        DueDate: ISODate("2025-01-26T00:00:00Z"),
+        Amount: NumberDecimal("3216.18"),
+        Currency: "AUD",
+        PaymentStatus: "Partially Paid"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2025015",
+        IssueDate: ISODate("2025-12-20T00:00:00Z"),
+        DueDate: ISODate("2025-12-31T00:00:00Z"),
+        Amount: NumberDecimal("100000.00"),
+        Currency: "USD",
+        PaymentStatus: "Paid"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2025014",
+        IssueDate: ISODate("2025-07-11T00:00:00Z"),
+        DueDate: ISODate("2025-07-18T00:00:00Z"),
+        Amount: NumberDecimal("40805.19"),
+        Currency: "JPY",
+        PaymentStatus: "Pending"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2025016",
+        IssueDate: ISODate("2025-11-10T00:00:00Z"),
+        DueDate: ISODate("2025-12-31T00:00:00Z"),
+        Amount: NumberDecimal("44972.66"),
+        Currency: "AUD",
+        PaymentStatus: "Cancelled"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2024007",
+        IssueDate: ISODate("2024-07-20T00:00:00Z"),
+        DueDate: ISODate("2024-08-28T00:00:00Z"),
+        Amount: NumberDecimal("42622.83"),
+        Currency: "GBP",
+        PaymentStatus: "Overdue"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2025018",
+        IssueDate: ISODate("2025-08-14T00:00:00Z"),
+        DueDate: ISODate("2025-08-28T00:00:00Z"),
+        Amount: NumberDecimal("50.00"),
+        Currency: "USD",
+        PaymentStatus: "Unpaid"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2025019",
+        IssueDate: ISODate("2025-10-05T00:00:00Z"),
+        DueDate: ISODate("2025-10-26T00:00:00Z"),
+        Amount: NumberDecimal("79897.20"),
+        Currency: "CNY",
+        PaymentStatus: "Paid"
+    },
+    {
+        _id: UUID(),
+        InvoiceId: "INV2025020",
+        IssueDate: ISODate("2025-06-29T00:00:00Z"),
+        DueDate: ISODate("2025-07-22T00:00:00Z"),
+        Amount: NumberDecimal("89556.04"),
+        Currency: "CNY",
+        PaymentStatus: "Paid"
+    }
+]);
+
+db.MigrationHistory.insertOne({
+    SriptName: scriptName,
+    Version: version,
+    ScriptRunTime: new Date()
+});
+
+print("All invoices are inserted successfully!");
\ No newline at end of file
diff --git a/Projects/Exadel.ReportHub/Exadel.ReportHub.SDK/Exadel.ReportHub.SDK.csproj b/Projects/Exadel.ReportHub/Exadel.ReportHub.SDK/Exadel.ReportHub.SDK.csproj
new file mode 100644
index 00000000..b264ad40
--- /dev/null
+++ b/Projects/Exadel.ReportHub/Exadel.ReportHub.SDK/Exadel.ReportHub.SDK.csproj
@@ -0,0 +1,24 @@
+﻿<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net8.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>disable</Nullable>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Folder Include="DTOs\" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <PackageReference Include="SonarAnalyzer.CSharp" Version="10.7.0.110445">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+    <PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+  </ItemGroup>
+
+</Project>
diff --git a/Projects/Exadel.ReportHub/Exadel.ReportHub.sln b/Projects/Exadel.ReportHub/Exadel.ReportHub.sln
index 55f878c7..7bb473df 100644
--- a/Projects/Exadel.ReportHub/Exadel.ReportHub.sln
+++ b/Projects/Exadel.ReportHub/Exadel.ReportHub.sln
@@ -19,6 +19,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exadel.ReportHub.Tests", "E
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exadel.ReportHub.Data", "Exadel.ReportHub.Data\Exadel.ReportHub.Data.csproj", "{D8AD2927-2246-4007-A75C-32591FE8CFBF}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exadel.ReportHub.SDK", "Exadel.ReportHub.SDK\Exadel.ReportHub.SDK.csproj", "{0DFE34E1-81B3-4DC7-9776-B080786E1A10}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -45,6 +47,10 @@ Global
 		{D8AD2927-2246-4007-A75C-32591FE8CFBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{D8AD2927-2246-4007-A75C-32591FE8CFBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{D8AD2927-2246-4007-A75C-32591FE8CFBF}.Release|Any CPU.Build.0 = Release|Any CPU
+		{0DFE34E1-81B3-4DC7-9776-B080786E1A10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{0DFE34E1-81B3-4DC7-9776-B080786E1A10}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{0DFE34E1-81B3-4DC7-9776-B080786E1A10}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{0DFE34E1-81B3-4DC7-9776-B080786E1A10}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -54,6 +60,7 @@ Global
 		{CC0BDD35-2D6B-4E9B-8337-DA70F67A4307} = {B6CC3523-FA57-4B5C-B890-44CFBD6AA3E1}
 		{33679034-4CBE-475C-9E63-F51078465729} = {6A4FE6FB-DDF4-44DB-96DF-52C8E08E42DE}
 		{D8AD2927-2246-4007-A75C-32591FE8CFBF} = {A8ECB1D2-3858-4B88-A148-DC4BFD9B4383}
+		{0DFE34E1-81B3-4DC7-9776-B080786E1A10} = {B6CC3523-FA57-4B5C-B890-44CFBD6AA3E1}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {3195911D-8F36-411D-B5B3-B1C727FA44D2}


Reviews:
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T07:28:16Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T07:28:29Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T07:28:57Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T07:29:13Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T07:29:37Z
user: login: mkknyaz
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-27T08:28:06Z
user: login: mkknyaz
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-27T08:28:16Z
user: login: mkknyaz
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-27T08:28:25Z
user: login: mkknyaz
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-27T08:28:31Z
user: login: mkknyaz
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-27T08:28:37Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T10:45:23Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T10:46:32Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T10:46:51Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T10:47:06Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T10:47:17Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T10:50:00Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T10:50:19Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T10:50:36Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T10:51:47Z
user: login: mkknyaz
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-27T11:29:30Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T12:10:15Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T12:10:31Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T12:11:13Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T12:11:31Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T12:11:58Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T12:12:27Z
user: login: elizavetapavliv
state: COMMENTED
author_association: OWNER
submitted_at: 2025-03-27T12:13:45Z
user: login: elizavetapavliv
state: DISMISSED
author_association: OWNER
submitted_at: 2025-03-27T12:29:50Z
user: login: elizavetapavliv
state: APPROVED
author_association: OWNER
submitted_at: 2025-03-27T13:04:03Z

Review comments:
diff_hunk: @@ -0,0 +1,3 @@
+﻿db.createCollection("MigrationHistory");
+
+db.MigrationHistory.createIndex({ ScriptName: 1, Version: 1 }, { unique: true });
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/migrationHistory.js
user: login: elizavetapavliv
body: add option so that index is created in the background
created_at: 2025-03-27T07:28:15Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,166 @@
+﻿load("migrationHistory.js")
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: remove this
created_at: 2025-03-27T07:28:29Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,166 @@
+﻿load("migrationHistory.js")
+
+const ScriptName = "SeedInvoices";
+const Version = "1.0";
+
+if (db.MigrationHistory.findOne({ ScriptName, Version })) {
+    print(`${ScriptName} v${Version} already applied`);
+    quit();
+}
+
+db.createCollection("Invoices");
+
+db.Invoices.insertMany([
+    {
+        invoiceId: "INV2025002",
+        issueDate: ISODate("2025-01-20T00:00:00Z"),
+        dueDate: ISODate("2025-02-20T00:00:00Z"),
+        amount: NumberDecimal("500.00"),
+        currency: "USD",
+        paymentStatus: "Unpaid"
+    },
+    {
+        invoiceId: "INV2024001",
+        issueDate: ISODate("2024-04-28T00:00:00Z"),
+        dueDate: ISODate("2024-06-19T00:00:00Z"),
+        amount: NumberDecimal("98917.28"),
+        currency: "JPY",
+        paymentStatus: "Overdue"
+    },
+    {
+        invoiceId: "INV2025005",
+        issueDate: ISODate("2025-08-09T00:00:00Z"),
+        dueDate: ISODate("2025-09-17T00:00:00Z"),
+        amount: NumberDecimal("47418.14"),
+        currency: "USD",
+        paymentStatus: "Unpaid"
+    },
+    {
+        invoiceId: "INV2024002",
+        issueDate: ISODate("2024-08-12T00:00:00Z"),
+        dueDate: ISODate("2024-09-05T00:00:00Z"),
+        amount: NumberDecimal("38510.38"),
+        currency: "CAD",
+        paymentStatus: "Cancelled"
+    },
+    {
+        invoiceId: "INV2024003",
+        issueDate: ISODate("2024-08-20T00:00:00Z"),
+        dueDate: ISODate("2024-09-17T00:00:00Z"),
+        amount: NumberDecimal("17775.52"),
+        currency: "INR",
+        paymentStatus: "Partially Paid"
+    },
+    {
+        invoiceId: "INV2024004",
+        issueDate: ISODate("2024-10-24T00:00:00Z"),
+        dueDate: ISODate("2024-12-10T00:00:00Z"),
+        amount: NumberDecimal("35625.06"),
+        currency: "GBP",
+        paymentStatus: "Paid"
+    },
+    {
+        invoiceId: "INV2024005",
+        issueDate: ISODate("2024-10-25T00:00:00Z"),
+        dueDate: ISODate("2024-12-18T00:00:00Z"),
+        amount: NumberDecimal("80875.27"),
+        currency: "CNY",
+        paymentStatus: "Pending"
+    },
+    {
+        invoiceId: "INV2025010",
+        issueDate: ISODate("2025-09-21T00:00:00Z"),
+        dueDate: ISODate("2025-10-15T00:00:00Z"),
+        amount: NumberDecimal("7024.28"),
+        currency: "AUD",
+        paymentStatus: "Pending"
+    },
+    {
+        invoiceId: "INV2024006",
+        issueDate: ISODate("2024-04-03T00:00:00Z"),
+        dueDate: ISODate("2024-04-19T00:00:00Z"),
+        amount: NumberDecimal("30632.44"),
+        currency: "EUR",
+        paymentStatus: "Pending"
+    },
+    {
+        invoiceId: "INV2025012",
+        issueDate: ISODate("2025-10-24T00:00:00Z"),
+        dueDate: ISODate("2025-11-04T00:00:00Z"),
+        amount: NumberDecimal("61696.31"),
+        currency: "INR",
+        paymentStatus: "Cancelled"
+    },
+    {
+        invoiceId: "INV2025013",
+        issueDate: ISODate("2025-01-07T00:00:00Z"),
+        dueDate: ISODate("2025-01-26T00:00:00Z"),
+        amount: NumberDecimal("3216.18"),
+        currency: "AUD",
+        paymentStatus: "Partially Paid"
+    },
+    {
+        invoiceId: "INV2025015",
+        issueDate: ISODate("2025-12-20T00:00:00Z"),
+        dueDate: ISODate("2025-12-31T00:00:00Z"),
+        amount: NumberDecimal("100000.00"),
+        currency: "USD",
+        paymentStatus: "Paid"
+    },
+    {
+        invoiceId: "INV2025014",
+        issueDate: ISODate("2025-07-11T00:00:00Z"),
+        dueDate: ISODate("2025-07-18T00:00:00Z"),
+        amount: NumberDecimal("40805.19"),
+        currency: "JPY",
+        paymentStatus: "Pending"
+    },
+    {
+        invoiceId: "INV2025016",
+        issueDate: ISODate("2025-11-10T00:00:00Z"),
+        dueDate: ISODate("2025-12-31T00:00:00Z"),
+        amount: NumberDecimal("44972.66"),
+        currency: "AUD",
+        paymentStatus: "Cancelled"
+    },
+    {
+        invoiceId: "INV2024007",
+        issueDate: ISODate("2024-07-20T00:00:00Z"),
+        dueDate: ISODate("2024-08-28T00:00:00Z"),
+        amount: NumberDecimal("42622.83"),
+        currency: "GBP",
+        paymentStatus: "Overdue"
+    },
+    {
+        invoiceId: "INV2025018",
+        issueDate: ISODate("2025-08-14T00:00:00Z"),
+        dueDate: ISODate("2025-08-28T00:00:00Z"),
+        amount: NumberDecimal("50.00"),
+        currency: "USD",
+        paymentStatus: "Unpaid"
+    },
+    {
+        invoiceId: "INV2025019",
+        issueDate: ISODate("2025-10-05T00:00:00Z"),
+        dueDate: ISODate("2025-10-26T00:00:00Z"),
+        amount: NumberDecimal("79897.20"),
+        currency: "CNY",
+        paymentStatus: "Paid"
+    },
+    {
+        invoiceId: "INV2025020",
+        issueDate: ISODate("2025-06-29T00:00:00Z"),
+        dueDate: ISODate("2025-07-22T00:00:00Z"),
+        amount: NumberDecimal("89556.04"),
+        currency: "CNY",
+        paymentStatus: "Paid"
+    }
+]);
+
+db.MigrationHistory.insertOne({
+    ScriptName,
+    Version,
+    ScriptRunTime: new Date()
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: use UTC date
created_at: 2025-03-27T07:28:56Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,166 @@
+﻿load("migrationHistory.js")
+
+const ScriptName = "SeedInvoices";
+const Version = "1.0";
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: number int can be just used
created_at: 2025-03-27T07:29:13Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,166 @@
+﻿load("migrationHistory.js")
+
+const ScriptName = "SeedInvoices";
+const Version = "1.0";
+
+if (db.MigrationHistory.findOne({ ScriptName, Version })) {
+    print(`${ScriptName} v${Version} already applied`);
+    quit();
+}
+
+db.createCollection("Invoices");
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: read about collation, and specify "en" collation
created_at: 2025-03-27T07:29:37Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,166 @@
+﻿load("migrationHistory.js")
+
+const ScriptName = "SeedInvoices";
+const Version = "1.0";
+
+if (db.MigrationHistory.findOne({ ScriptName, Version })) {
+    print(`${ScriptName} v${Version} already applied`);
+    quit();
+}
+
+db.createCollection("Invoices");
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: mkknyaz
body: Added
created_at: 2025-03-27T08:28:06Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,166 @@
+﻿load("migrationHistory.js")
+
+const ScriptName = "SeedInvoices";
+const Version = "1.0";
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: mkknyaz
body: Added
created_at: 2025-03-27T08:28:16Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,166 @@
+﻿load("migrationHistory.js")
+
+const ScriptName = "SeedInvoices";
+const Version = "1.0";
+
+if (db.MigrationHistory.findOne({ ScriptName, Version })) {
+    print(`${ScriptName} v${Version} already applied`);
+    quit();
+}
+
+db.createCollection("Invoices");
+
+db.Invoices.insertMany([
+    {
+        invoiceId: "INV2025002",
+        issueDate: ISODate("2025-01-20T00:00:00Z"),
+        dueDate: ISODate("2025-02-20T00:00:00Z"),
+        amount: NumberDecimal("500.00"),
+        currency: "USD",
+        paymentStatus: "Unpaid"
+    },
+    {
+        invoiceId: "INV2024001",
+        issueDate: ISODate("2024-04-28T00:00:00Z"),
+        dueDate: ISODate("2024-06-19T00:00:00Z"),
+        amount: NumberDecimal("98917.28"),
+        currency: "JPY",
+        paymentStatus: "Overdue"
+    },
+    {
+        invoiceId: "INV2025005",
+        issueDate: ISODate("2025-08-09T00:00:00Z"),
+        dueDate: ISODate("2025-09-17T00:00:00Z"),
+        amount: NumberDecimal("47418.14"),
+        currency: "USD",
+        paymentStatus: "Unpaid"
+    },
+    {
+        invoiceId: "INV2024002",
+        issueDate: ISODate("2024-08-12T00:00:00Z"),
+        dueDate: ISODate("2024-09-05T00:00:00Z"),
+        amount: NumberDecimal("38510.38"),
+        currency: "CAD",
+        paymentStatus: "Cancelled"
+    },
+    {
+        invoiceId: "INV2024003",
+        issueDate: ISODate("2024-08-20T00:00:00Z"),
+        dueDate: ISODate("2024-09-17T00:00:00Z"),
+        amount: NumberDecimal("17775.52"),
+        currency: "INR",
+        paymentStatus: "Partially Paid"
+    },
+    {
+        invoiceId: "INV2024004",
+        issueDate: ISODate("2024-10-24T00:00:00Z"),
+        dueDate: ISODate("2024-12-10T00:00:00Z"),
+        amount: NumberDecimal("35625.06"),
+        currency: "GBP",
+        paymentStatus: "Paid"
+    },
+    {
+        invoiceId: "INV2024005",
+        issueDate: ISODate("2024-10-25T00:00:00Z"),
+        dueDate: ISODate("2024-12-18T00:00:00Z"),
+        amount: NumberDecimal("80875.27"),
+        currency: "CNY",
+        paymentStatus: "Pending"
+    },
+    {
+        invoiceId: "INV2025010",
+        issueDate: ISODate("2025-09-21T00:00:00Z"),
+        dueDate: ISODate("2025-10-15T00:00:00Z"),
+        amount: NumberDecimal("7024.28"),
+        currency: "AUD",
+        paymentStatus: "Pending"
+    },
+    {
+        invoiceId: "INV2024006",
+        issueDate: ISODate("2024-04-03T00:00:00Z"),
+        dueDate: ISODate("2024-04-19T00:00:00Z"),
+        amount: NumberDecimal("30632.44"),
+        currency: "EUR",
+        paymentStatus: "Pending"
+    },
+    {
+        invoiceId: "INV2025012",
+        issueDate: ISODate("2025-10-24T00:00:00Z"),
+        dueDate: ISODate("2025-11-04T00:00:00Z"),
+        amount: NumberDecimal("61696.31"),
+        currency: "INR",
+        paymentStatus: "Cancelled"
+    },
+    {
+        invoiceId: "INV2025013",
+        issueDate: ISODate("2025-01-07T00:00:00Z"),
+        dueDate: ISODate("2025-01-26T00:00:00Z"),
+        amount: NumberDecimal("3216.18"),
+        currency: "AUD",
+        paymentStatus: "Partially Paid"
+    },
+    {
+        invoiceId: "INV2025015",
+        issueDate: ISODate("2025-12-20T00:00:00Z"),
+        dueDate: ISODate("2025-12-31T00:00:00Z"),
+        amount: NumberDecimal("100000.00"),
+        currency: "USD",
+        paymentStatus: "Paid"
+    },
+    {
+        invoiceId: "INV2025014",
+        issueDate: ISODate("2025-07-11T00:00:00Z"),
+        dueDate: ISODate("2025-07-18T00:00:00Z"),
+        amount: NumberDecimal("40805.19"),
+        currency: "JPY",
+        paymentStatus: "Pending"
+    },
+    {
+        invoiceId: "INV2025016",
+        issueDate: ISODate("2025-11-10T00:00:00Z"),
+        dueDate: ISODate("2025-12-31T00:00:00Z"),
+        amount: NumberDecimal("44972.66"),
+        currency: "AUD",
+        paymentStatus: "Cancelled"
+    },
+    {
+        invoiceId: "INV2024007",
+        issueDate: ISODate("2024-07-20T00:00:00Z"),
+        dueDate: ISODate("2024-08-28T00:00:00Z"),
+        amount: NumberDecimal("42622.83"),
+        currency: "GBP",
+        paymentStatus: "Overdue"
+    },
+    {
+        invoiceId: "INV2025018",
+        issueDate: ISODate("2025-08-14T00:00:00Z"),
+        dueDate: ISODate("2025-08-28T00:00:00Z"),
+        amount: NumberDecimal("50.00"),
+        currency: "USD",
+        paymentStatus: "Unpaid"
+    },
+    {
+        invoiceId: "INV2025019",
+        issueDate: ISODate("2025-10-05T00:00:00Z"),
+        dueDate: ISODate("2025-10-26T00:00:00Z"),
+        amount: NumberDecimal("79897.20"),
+        currency: "CNY",
+        paymentStatus: "Paid"
+    },
+    {
+        invoiceId: "INV2025020",
+        issueDate: ISODate("2025-06-29T00:00:00Z"),
+        dueDate: ISODate("2025-07-22T00:00:00Z"),
+        amount: NumberDecimal("89556.04"),
+        currency: "CNY",
+        paymentStatus: "Paid"
+    }
+]);
+
+db.MigrationHistory.insertOne({
+    ScriptName,
+    Version,
+    ScriptRunTime: new Date()
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: mkknyaz
body: added
created_at: 2025-03-27T08:28:25Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,166 @@
+﻿load("migrationHistory.js")
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: mkknyaz
body: removed
created_at: 2025-03-27T08:28:31Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,3 @@
+﻿db.createCollection("MigrationHistory");
+
+db.MigrationHistory.createIndex({ ScriptName: 1, Version: 1 }, { unique: true });
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/migrationHistory.js
user: login: mkknyaz
body: added
created_at: 2025-03-27T08:28:37Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,168 @@
+﻿const ScriptName = "SeedInvoices";
+const Version = NumberInt(1);
+
+if (db.MigrationHistory.findOne({ ScriptName, Version })) {
+    print(`${ScriptName} v${Version} already applied`);
+    quit();
+}
+
+db.createCollection("Invoices", {
+    collation: {
+        locale: "en"
+    }
+});
+
+db.Invoices.insertMany([
+    {
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: specify _id field withing UUID
created_at: 2025-03-27T10:45:23Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,8 @@
+﻿db.createCollection("MigrationHistory");
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/migrationHistory.js
user: login: elizavetapavliv
body: lets name this script as 00_create_MigrationHistory.js
created_at: 2025-03-27T10:46:32Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,168 @@
+﻿const ScriptName = "SeedInvoices";
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: lets name this script as 01_create_Invoice.js
created_at: 2025-03-27T10:46:51Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,168 @@
+﻿const ScriptName = "SeedInvoices";
+const Version = NumberInt(1);
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: in js variables are named from lower case
created_at: 2025-03-27T10:47:06Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,168 @@
+﻿const ScriptName = "SeedInvoices";
+const Version = NumberInt(1);
+
+if (db.MigrationHistory.findOne({ ScriptName, Version })) {
+    print(`${ScriptName} v${Version} already applied`);
+    quit();
+}
+
+db.createCollection("Invoices", {
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: name collection Invoice
created_at: 2025-03-27T10:47:17Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,168 @@
+﻿const ScriptName = "SeedInvoices";
+const Version = NumberInt(1);
+
+if (db.MigrationHistory.findOne({ ScriptName, Version })) {
+    print(`${ScriptName} v${Version} already applied`);
+    quit();
+}
+
+db.createCollection("Invoices", {
+    collation: {
+        locale: "en"
+    }
+});
+
+db.Invoices.insertMany([
+    {
+        invoiceId: "INV2025002",
+        issueDate: ISODate("2025-01-20T00:00:00Z"),
+        dueDate: ISODate("2025-02-20T00:00:00Z"),
+        amount: NumberDecimal("500.00"),
+        currency: "USD",
+        paymentStatus: "Unpaid"
+    },
+    {
+        invoiceId: "INV2024001",
+        issueDate: ISODate("2024-04-28T00:00:00Z"),
+        dueDate: ISODate("2024-06-19T00:00:00Z"),
+        amount: NumberDecimal("98917.28"),
+        currency: "JPY",
+        paymentStatus: "Overdue"
+    },
+    {
+        invoiceId: "INV2025005",
+        issueDate: ISODate("2025-08-09T00:00:00Z"),
+        dueDate: ISODate("2025-09-17T00:00:00Z"),
+        amount: NumberDecimal("47418.14"),
+        currency: "USD",
+        paymentStatus: "Unpaid"
+    },
+    {
+        invoiceId: "INV2024002",
+        issueDate: ISODate("2024-08-12T00:00:00Z"),
+        dueDate: ISODate("2024-09-05T00:00:00Z"),
+        amount: NumberDecimal("38510.38"),
+        currency: "CAD",
+        paymentStatus: "Cancelled"
+    },
+    {
+        invoiceId: "INV2024003",
+        issueDate: ISODate("2024-08-20T00:00:00Z"),
+        dueDate: ISODate("2024-09-17T00:00:00Z"),
+        amount: NumberDecimal("17775.52"),
+        currency: "INR",
+        paymentStatus: "Partially Paid"
+    },
+    {
+        invoiceId: "INV2024004",
+        issueDate: ISODate("2024-10-24T00:00:00Z"),
+        dueDate: ISODate("2024-12-10T00:00:00Z"),
+        amount: NumberDecimal("35625.06"),
+        currency: "GBP",
+        paymentStatus: "Paid"
+    },
+    {
+        invoiceId: "INV2024005",
+        issueDate: ISODate("2024-10-25T00:00:00Z"),
+        dueDate: ISODate("2024-12-18T00:00:00Z"),
+        amount: NumberDecimal("80875.27"),
+        currency: "CNY",
+        paymentStatus: "Pending"
+    },
+    {
+        invoiceId: "INV2025010",
+        issueDate: ISODate("2025-09-21T00:00:00Z"),
+        dueDate: ISODate("2025-10-15T00:00:00Z"),
+        amount: NumberDecimal("7024.28"),
+        currency: "AUD",
+        paymentStatus: "Pending"
+    },
+    {
+        invoiceId: "INV2024006",
+        issueDate: ISODate("2024-04-03T00:00:00Z"),
+        dueDate: ISODate("2024-04-19T00:00:00Z"),
+        amount: NumberDecimal("30632.44"),
+        currency: "EUR",
+        paymentStatus: "Pending"
+    },
+    {
+        invoiceId: "INV2025012",
+        issueDate: ISODate("2025-10-24T00:00:00Z"),
+        dueDate: ISODate("2025-11-04T00:00:00Z"),
+        amount: NumberDecimal("61696.31"),
+        currency: "INR",
+        paymentStatus: "Cancelled"
+    },
+    {
+        invoiceId: "INV2025013",
+        issueDate: ISODate("2025-01-07T00:00:00Z"),
+        dueDate: ISODate("2025-01-26T00:00:00Z"),
+        amount: NumberDecimal("3216.18"),
+        currency: "AUD",
+        paymentStatus: "Partially Paid"
+    },
+    {
+        invoiceId: "INV2025015",
+        issueDate: ISODate("2025-12-20T00:00:00Z"),
+        dueDate: ISODate("2025-12-31T00:00:00Z"),
+        amount: NumberDecimal("100000.00"),
+        currency: "USD",
+        paymentStatus: "Paid"
+    },
+    {
+        invoiceId: "INV2025014",
+        issueDate: ISODate("2025-07-11T00:00:00Z"),
+        dueDate: ISODate("2025-07-18T00:00:00Z"),
+        amount: NumberDecimal("40805.19"),
+        currency: "JPY",
+        paymentStatus: "Pending"
+    },
+    {
+        invoiceId: "INV2025016",
+        issueDate: ISODate("2025-11-10T00:00:00Z"),
+        dueDate: ISODate("2025-12-31T00:00:00Z"),
+        amount: NumberDecimal("44972.66"),
+        currency: "AUD",
+        paymentStatus: "Cancelled"
+    },
+    {
+        invoiceId: "INV2024007",
+        issueDate: ISODate("2024-07-20T00:00:00Z"),
+        dueDate: ISODate("2024-08-28T00:00:00Z"),
+        amount: NumberDecimal("42622.83"),
+        currency: "GBP",
+        paymentStatus: "Overdue"
+    },
+    {
+        invoiceId: "INV2025018",
+        issueDate: ISODate("2025-08-14T00:00:00Z"),
+        dueDate: ISODate("2025-08-28T00:00:00Z"),
+        amount: NumberDecimal("50.00"),
+        currency: "USD",
+        paymentStatus: "Unpaid"
+    },
+    {
+        invoiceId: "INV2025019",
+        issueDate: ISODate("2025-10-05T00:00:00Z"),
+        dueDate: ISODate("2025-10-26T00:00:00Z"),
+        amount: NumberDecimal("79897.20"),
+        currency: "CNY",
+        paymentStatus: "Paid"
+    },
+    {
+        invoiceId: "INV2025020",
+        issueDate: ISODate("2025-06-29T00:00:00Z"),
+        dueDate: ISODate("2025-07-22T00:00:00Z"),
+        amount: NumberDecimal("89556.04"),
+        currency: "CNY",
+        paymentStatus: "Paid"
+    }
+]);
+
+db.MigrationHistory.insertOne({
+    ScriptName,
+    Version,
+    ScriptRunTime: ISODate(new Date())
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: oh, ` new Date()` automatically converted to ISODate, I thought you used Date function instead https://www.mongodb.com/docs/manual/reference/method/Date/#syntax

So you can leave as new Date() 
created_at: 2025-03-27T10:50:00Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,168 @@
+﻿const ScriptName = "SeedInvoices";
+const Version = NumberInt(1);
+
+if (db.MigrationHistory.findOne({ ScriptName, Version })) {
+    print(`${ScriptName} v${Version} already applied`);
+    quit();
+}
+
+db.createCollection("Invoices", {
+    collation: {
+        locale: "en"
+    }
+});
+
+db.Invoices.insertMany([
+    {
+        invoiceId: "INV2025002",
+        issueDate: ISODate("2025-01-20T00:00:00Z"),
+        dueDate: ISODate("2025-02-20T00:00:00Z"),
+        amount: NumberDecimal("500.00"),
+        currency: "USD",
+        paymentStatus: "Unpaid"
+    },
+    {
+        invoiceId: "INV2024001",
+        issueDate: ISODate("2024-04-28T00:00:00Z"),
+        dueDate: ISODate("2024-06-19T00:00:00Z"),
+        amount: NumberDecimal("98917.28"),
+        currency: "JPY",
+        paymentStatus: "Overdue"
+    },
+    {
+        invoiceId: "INV2025005",
+        issueDate: ISODate("2025-08-09T00:00:00Z"),
+        dueDate: ISODate("2025-09-17T00:00:00Z"),
+        amount: NumberDecimal("47418.14"),
+        currency: "USD",
+        paymentStatus: "Unpaid"
+    },
+    {
+        invoiceId: "INV2024002",
+        issueDate: ISODate("2024-08-12T00:00:00Z"),
+        dueDate: ISODate("2024-09-05T00:00:00Z"),
+        amount: NumberDecimal("38510.38"),
+        currency: "CAD",
+        paymentStatus: "Cancelled"
+    },
+    {
+        invoiceId: "INV2024003",
+        issueDate: ISODate("2024-08-20T00:00:00Z"),
+        dueDate: ISODate("2024-09-17T00:00:00Z"),
+        amount: NumberDecimal("17775.52"),
+        currency: "INR",
+        paymentStatus: "Partially Paid"
+    },
+    {
+        invoiceId: "INV2024004",
+        issueDate: ISODate("2024-10-24T00:00:00Z"),
+        dueDate: ISODate("2024-12-10T00:00:00Z"),
+        amount: NumberDecimal("35625.06"),
+        currency: "GBP",
+        paymentStatus: "Paid"
+    },
+    {
+        invoiceId: "INV2024005",
+        issueDate: ISODate("2024-10-25T00:00:00Z"),
+        dueDate: ISODate("2024-12-18T00:00:00Z"),
+        amount: NumberDecimal("80875.27"),
+        currency: "CNY",
+        paymentStatus: "Pending"
+    },
+    {
+        invoiceId: "INV2025010",
+        issueDate: ISODate("2025-09-21T00:00:00Z"),
+        dueDate: ISODate("2025-10-15T00:00:00Z"),
+        amount: NumberDecimal("7024.28"),
+        currency: "AUD",
+        paymentStatus: "Pending"
+    },
+    {
+        invoiceId: "INV2024006",
+        issueDate: ISODate("2024-04-03T00:00:00Z"),
+        dueDate: ISODate("2024-04-19T00:00:00Z"),
+        amount: NumberDecimal("30632.44"),
+        currency: "EUR",
+        paymentStatus: "Pending"
+    },
+    {
+        invoiceId: "INV2025012",
+        issueDate: ISODate("2025-10-24T00:00:00Z"),
+        dueDate: ISODate("2025-11-04T00:00:00Z"),
+        amount: NumberDecimal("61696.31"),
+        currency: "INR",
+        paymentStatus: "Cancelled"
+    },
+    {
+        invoiceId: "INV2025013",
+        issueDate: ISODate("2025-01-07T00:00:00Z"),
+        dueDate: ISODate("2025-01-26T00:00:00Z"),
+        amount: NumberDecimal("3216.18"),
+        currency: "AUD",
+        paymentStatus: "Partially Paid"
+    },
+    {
+        invoiceId: "INV2025015",
+        issueDate: ISODate("2025-12-20T00:00:00Z"),
+        dueDate: ISODate("2025-12-31T00:00:00Z"),
+        amount: NumberDecimal("100000.00"),
+        currency: "USD",
+        paymentStatus: "Paid"
+    },
+    {
+        invoiceId: "INV2025014",
+        issueDate: ISODate("2025-07-11T00:00:00Z"),
+        dueDate: ISODate("2025-07-18T00:00:00Z"),
+        amount: NumberDecimal("40805.19"),
+        currency: "JPY",
+        paymentStatus: "Pending"
+    },
+    {
+        invoiceId: "INV2025016",
+        issueDate: ISODate("2025-11-10T00:00:00Z"),
+        dueDate: ISODate("2025-12-31T00:00:00Z"),
+        amount: NumberDecimal("44972.66"),
+        currency: "AUD",
+        paymentStatus: "Cancelled"
+    },
+    {
+        invoiceId: "INV2024007",
+        issueDate: ISODate("2024-07-20T00:00:00Z"),
+        dueDate: ISODate("2024-08-28T00:00:00Z"),
+        amount: NumberDecimal("42622.83"),
+        currency: "GBP",
+        paymentStatus: "Overdue"
+    },
+    {
+        invoiceId: "INV2025018",
+        issueDate: ISODate("2025-08-14T00:00:00Z"),
+        dueDate: ISODate("2025-08-28T00:00:00Z"),
+        amount: NumberDecimal("50.00"),
+        currency: "USD",
+        paymentStatus: "Unpaid"
+    },
+    {
+        invoiceId: "INV2025019",
+        issueDate: ISODate("2025-10-05T00:00:00Z"),
+        dueDate: ISODate("2025-10-26T00:00:00Z"),
+        amount: NumberDecimal("79897.20"),
+        currency: "CNY",
+        paymentStatus: "Paid"
+    },
+    {
+        invoiceId: "INV2025020",
+        issueDate: ISODate("2025-06-29T00:00:00Z"),
+        dueDate: ISODate("2025-07-22T00:00:00Z"),
+        amount: NumberDecimal("89556.04"),
+        currency: "CNY",
+        paymentStatus: "Paid"
+    }
+]);
+
+db.MigrationHistory.insertOne({
+    ScriptName,
+    Version,
+    ScriptRunTime: ISODate(new Date())
+});
+
+print("All invoices inserted successfully!");
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: are inserted
created_at: 2025-03-27T10:50:19Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,168 @@
+﻿const ScriptName = "SeedInvoices";
+const Version = NumberInt(1);
+
+if (db.MigrationHistory.findOne({ ScriptName, Version })) {
+    print(`${ScriptName} v${Version} already applied`);
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: is already applied
created_at: 2025-03-27T10:50:36Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,168 @@
+﻿const ScriptName = "SeedInvoices";
+const Version = NumberInt(1);
+
+if (db.MigrationHistory.findOne({ ScriptName, Version })) {
+    print(`${ScriptName} v${Version} already applied`);
+    quit();
+}
+
+db.createCollection("Invoices", {
+    collation: {
+        locale: "en"
+    }
+});
+
+db.Invoices.insertMany([
+    {
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: we will use UUID type for id, instead of ObjectId
created_at: 2025-03-27T10:51:47Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,168 @@
+﻿const ScriptName = "SeedInvoices";
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: mkknyaz
body: Should i renamed the file name also?

created_at: 2025-03-27T11:29:30Z
author_association: COLLABORATOR
diff_hunk: @@ -1,7 +1,7 @@
-﻿db.createCollection("MigrationHistory");
+﻿db.createCollection("00_create_MigrationHistory.js");
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/migrationHistory.js
user: login: elizavetapavliv
body: 00_create_MigrationHistory.js it's for file name, db.createCollection is not needed here, db.MigrationHistory.createIndex will create collection also
created_at: 2025-03-27T12:10:15Z
author_association: OWNER
diff_hunk: @@ -1,19 +1,20 @@
-﻿const ScriptName = "SeedInvoices";
-const Version = NumberInt(1);
+﻿const scriptName = "01_create_Invoice.js";
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: "01_create_Invoice", 01_create_Invoice.js is file name
created_at: 2025-03-27T12:10:30Z
author_association: OWNER
diff_hunk: @@ -1,19 +1,20 @@
-﻿const ScriptName = "SeedInvoices";
-const Version = NumberInt(1);
+﻿const scriptName = "01_create_Invoice.js";
+const version = NumberInt(1);
 
-if (db.MigrationHistory.findOne({ ScriptName, Version })) {
-    print(`${ScriptName} v${Version} already applied`);
+if (db.MigrationHistory.findOne({ scriptName, version })) {
+    print(`${scriptName} v${version} is already applied`);
     quit();
 }
 
-db.createCollection("Invoices", {
+db.createCollection("Invoice", {
     collation: {
         locale: "en"
     }
 });
 
-db.Invoices.insertMany([
+db.Invoice.insertMany([
     {
+        _id: UUID(),
         invoiceId: "INV2025002",
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: and rename all fields like in C#, e.g. InvoiceId, etc
created_at: 2025-03-27T12:11:13Z
author_association: OWNER
diff_hunk: @@ -1,19 +1,20 @@
-﻿const ScriptName = "SeedInvoices";
-const Version = NumberInt(1);
+﻿const scriptName = "01_create_Invoice.js";
+const version = NumberInt(1);
 
-if (db.MigrationHistory.findOne({ ScriptName, Version })) {
-    print(`${ScriptName} v${Version} already applied`);
+if (db.MigrationHistory.findOne({ scriptName, version })) {
+    print(`${scriptName} v${version} is already applied`);
     quit();
 }
 
-db.createCollection("Invoices", {
+db.createCollection("Invoice", {
     collation: {
         locale: "en"
     }
 });
 
-db.Invoices.insertMany([
+db.Invoice.insertMany([
     {
+        _id: UUID(),
         invoiceId: "INV2025002",
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: except _id
created_at: 2025-03-27T12:11:31Z
author_association: OWNER
diff_hunk: @@ -160,9 +178,9 @@ db.Invoices.insertMany([
 ]);
 
 db.MigrationHistory.insertOne({
-    ScriptName,
-    Version,
-    ScriptRunTime: ISODate(new Date())
+    scriptName,
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: return back ScriptName, etc, like c# naming
created_at: 2025-03-27T12:11:58Z
author_association: OWNER
diff_hunk: @@ -160,9 +178,9 @@ db.Invoices.insertMany([
 ]);
 
 db.MigrationHistory.insertOne({
-    ScriptName,
-    Version,
-    ScriptRunTime: ISODate(new Date())
+    scriptName,
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: ScriptName: scriptName, where ScriptName is name of field, and scriptName is variable
created_at: 2025-03-27T12:12:26Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,168 @@
+﻿const ScriptName = "SeedInvoices";
path: Projects/Exadel.ReportHub/Exadel.ReportHub.Host/Deployment/Mongo/seedInvoices.js
user: login: elizavetapavliv
body: yes
created_at: 2025-03-27T12:13:45Z
author_association: OWNER

PR comments:
user: login: elizavetapavliv
created_at: 2025-03-27T12:30:47Z
body: for now you can manually run these scripts in Studio 3T (just copy contents of files to console)
author_association: OWNER
user: login: mkknyaz
created_at: 2025-03-27T12:33:42Z
body: Yes, I already tested it in the console and in Studio


author_association: COLLABORATOR