Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions db/query_statistics.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
SELECT customer.customername AS customer,
TO_CHAR(appointment."yearMonth", 'Month YYYY') AS month,
TO_CHAR(appointment."yearmonth", 'Month YYYY') AS month,
appointment.count AS appointments,
participant.count AS participants,
voting.count AS votings
FROM "appointmentStatistic" appointment
LEFT JOIN "participantStatistic" participant ON appointment."customerId" = participant."customerId"
LEFT JOIN "votingStatistic" voting ON appointment."customerId" = voting."customerId"
LEFT JOIN customer ON appointment."customerId" = customer.customerid
WHERE appointment."customerId" = '11111111-1111-1111-1111-111111111111'
ORDER BY appointment."yearMonth" DESC;
FROM "appointmentstatistic" appointment
LEFT JOIN "participantstatistic" participant ON appointment."customerid" = participant."customerid"
LEFT JOIN "votingstatistic" voting ON appointment."customerid" = voting."customerid"
LEFT JOIN customer ON appointment."customerid" = customer.customerid
WHERE appointment."customerid" = '11111111-1111-1111-1111-111111111111'
ORDER BY appointment."yearmonth" DESC;
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
/// Representation for an appointment statistic
/// </summary>
[ExcludeFromCodeCoverage]
[Table("appointmentStatistic", Schema = "public")]
[Table("appointmentstatistic", Schema = "public")]
public class AppointmentStatistic
{
/// <summary>
/// Identifier of the appointment statistic
/// </summary>
[Column("appointmentStatisticId")]
[Column("appointmentstatisticid")]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid AppointmentStatisticId { get; set; }

/// <summary>
/// Identifier of the customer
/// </summary>
/// <example>00000000-0000-0000-0000-000000000000</example>
[Column("customerId")]
[Column("customerid")]
public Guid CustomerId { get; set; }

/// <summary>
/// The year and month for which the statistic is recorded
/// </summary>
[Column("yearMonth")]
[Column("yearmonth")]
public DateOnly YearMonth { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
/// Representation for a Participant statistic
/// </summary>
[ExcludeFromCodeCoverage]
[Table("participantStatistic", Schema = "public")]
[Table("participantstatistic", Schema = "public")]
public class ParticipantStatistic
{
/// <summary>
/// Identifier of the participant statistic
/// </summary>
[Column("participantStatisticId")]
[Column("participantstatisticid")]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid ParticipantStatisticId { get; set; }

/// <summary>
/// Identifier of the customer
/// </summary>
/// <example>00000000-0000-0000-0000-000000000000</example>
[Column("customerId")]
[Column("customerid")]
public Guid CustomerId { get; set; }

/// <summary>
/// The year and month for which the statistic is recorded
/// </summary>
[Column("yearMonth")]
[Column("yearmonth")]
public DateOnly YearMonth { get; set; }

/// <summary>
Expand Down
8 changes: 4 additions & 4 deletions src/Dataport.Terminfinder.BusinessObject/VotingStatistic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
/// Representation for a Voting statistic
/// </summary>
[ExcludeFromCodeCoverage]
[Table("votingStatistic", Schema = "public")]
[Table("votingstatistic", Schema = "public")]
public class VotingStatistic
{
/// <summary>
/// Identifier of the voting statistic
/// </summary>
[Column("votingStatisticId")]
[Column("votingstatisticid")]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid VotingStatisticId { get; set; }

/// <summary>
/// Identifier of the customer
/// </summary>
/// <example>00000000-0000-0000-0000-000000000000</example>
[Column("customerId")]
[Column("customerid")]
public Guid CustomerId { get; set; }

/// <summary>
/// The year and month for which the statistic is recorded
/// </summary>
[Column("yearMonth")]
[Column("yearmonth")]
public DateOnly YearMonth { get; set; }

/// <summary>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -13,76 +13,76 @@ public partial class AddStatistics : Migration
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
var sqlInhalt = "update public.appconfig set configvalue='1.4.0' WHERE configkey='version';";
var sqlInhalt = "update public.appconfig set configvalue='1.4.1' WHERE configkey='version';";
migrationBuilder.Sql(sqlInhalt, suppressTransaction: true);

sqlInhalt = "update public.appconfig set configvalue='2026-09-09' WHERE configkey='builddate';";
sqlInhalt = "update public.appconfig set configvalue='2026-09-17' WHERE configkey='builddate';";
migrationBuilder.Sql(sqlInhalt, suppressTransaction: true);

migrationBuilder.CreateTable(
name: "appointmentStatistic",
name: "appointmentstatistic",
schema: "public",
columns: table => new
{
appointmentStatisticId = table.Column<Guid>(type: "uuid", nullable: false),
customerId = table.Column<Guid>(type: "uuid", nullable: false),
yearMonth = table.Column<DateOnly>(type: "date", nullable: false),
appointmentstatisticid = table.Column<Guid>(type: "uuid", nullable: false),
customerid = table.Column<Guid>(type: "uuid", nullable: false),
yearmonth = table.Column<DateOnly>(type: "date", nullable: false),
count = table.Column<int>(type: "integer", nullable: false, defaultValue: 1)
},
constraints: table =>
{
table.PrimaryKey("PK_appointmentStatistic", x => x.appointmentStatisticId);
table.PrimaryKey("PK_appointmentstatistic", x => x.appointmentstatisticid);
});

migrationBuilder.CreateTable(
name: "participantStatistic",
name: "participantstatistic",
schema: "public",
columns: table => new
{
participantStatisticId = table.Column<Guid>(type: "uuid", nullable: false),
customerId = table.Column<Guid>(type: "uuid", nullable: false),
yearMonth = table.Column<DateOnly>(type: "date", nullable: false),
participantstatisticid = table.Column<Guid>(type: "uuid", nullable: false),
customerid = table.Column<Guid>(type: "uuid", nullable: false),
yearmonth = table.Column<DateOnly>(type: "date", nullable: false),
count = table.Column<int>(type: "integer", nullable: false, defaultValue: 1)
},
constraints: table =>
{
table.PrimaryKey("PK_participantStatistic", x => x.participantStatisticId);
table.PrimaryKey("PK_participantstatistic", x => x.participantstatisticid);
});

migrationBuilder.CreateTable(
name: "votingStatistic",
name: "votingstatistic",
schema: "public",
columns: table => new
{
votingStatisticId = table.Column<Guid>(type: "uuid", nullable: false),
customerId = table.Column<Guid>(type: "uuid", nullable: false),
yearMonth = table.Column<DateOnly>(type: "date", nullable: false),
votingstatisticid = table.Column<Guid>(type: "uuid", nullable: false),
customerid = table.Column<Guid>(type: "uuid", nullable: false),
yearmonth = table.Column<DateOnly>(type: "date", nullable: false),
count = table.Column<int>(type: "integer", nullable: false, defaultValue: 1)
},
constraints: table =>
{
table.PrimaryKey("PK_votingStatistic", x => x.votingStatisticId);
table.PrimaryKey("PK_votingstatistic", x => x.votingstatisticid);
});

migrationBuilder.CreateIndex(
name: "IX_appointmentStatistic_customerId_yearMonth",
name: "IX_appointmentstatistic_customerid_yearmonth",
schema: "public",
table: "appointmentStatistic",
columns: new[] { "customerId", "yearMonth" },
table: "appointmentstatistic",
columns: new[] { "customerid", "yearmonth" },
unique: true);

migrationBuilder.CreateIndex(
name: "IX_participantStatistic_customerId_yearMonth",
name: "IX_participantstatistic_customerid_yearmonth",
schema: "public",
table: "participantStatistic",
columns: new[] { "customerId", "yearMonth" },
table: "participantstatistic",
columns: new[] { "customerid", "yearmonth" },
unique: true);

migrationBuilder.CreateIndex(
name: "IX_votingStatistic_customerId_yearMonth",
name: "IX_votingstatistic_customerid_yearmonth",
schema: "public",
table: "votingStatistic",
columns: new[] { "customerId", "yearMonth" },
table: "votingstatistic",
columns: new[] { "customerid", "yearmonth" },
unique: true);
}

Expand All @@ -96,15 +96,15 @@ protected override void Down(MigrationBuilder migrationBuilder)
migrationBuilder.Sql(sqlInhalt, suppressTransaction: true);

migrationBuilder.DropTable(
name: "appointmentStatistic",
name: "appointmentstatistic",
schema: "public");

migrationBuilder.DropTable(
name: "participantStatistic",
name: "participantstatistic",
schema: "public");

migrationBuilder.DropTable(
name: "votingStatistic",
name: "votingstatistic",
schema: "public");
}
}
Expand Down
Loading