Skip to content

Commit

Permalink
feat: add new table for tracking startup trends and metrics (#510)
Browse files Browse the repository at this point in the history
* chore: add startup dashboard page to get insight about whats going on in startup

* chore: replaced react-tabulator by react-table

* chore: replaced react-tabulator by react-table

* chore: check isAdmin

* chore: add signaux faibles beta page

* fix: sorting negative value

* feat: add startups aggregated stats

* chore: add script to dry run refreshStartupAggregatedData
  • Loading branch information
LucasCharrier authored Oct 23, 2024
1 parent e0612c8 commit 77360d4
Show file tree
Hide file tree
Showing 10 changed files with 22,654 additions and 21,771 deletions.
18 changes: 6 additions & 12 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
fileignoreconfig:
- filename: src/components/MemberPage/MemberStatus.tsx
checksum: 605d6fdbd7f40fd4d4f8e2aaae09f3c9319ec84d435bdb23399a4b5dcce0699c
version: ""
ion: ""
ount/page.tsx
checksum: 1c9b1df42135952c43133eb46ccfb97a7f073cfb9ffc1751efd91c62875b436a
- filename: src/components/CommunityPage/Community.tsx
checksum: dc3ab9308a1f99026b70342a2ecf7f6c3dffa8c83caef74e44cb244d4cafcf06
- filename: src/components/CommunityPage/exportToCsv.ts
checksum: a94d12759ff13fb5a19c266b40ee5762ab7ed4cfb208a17caa62297de955f962
- filename: src/components/FichePicture.tsx
checksum: 181275c6da1d9e5d09f75a4bf202f57867f3323cc53f0c698f4b4a773de4fc42
- filename: src/app/(private)/(dashboard)/admin/signaux-faible-beta/AdminProductClientPage.tsx
checksum: a8924d7f6456185db63a9b4f7c0c013d65eacecd5e696472adf6d1f979b38f83
- filename: src/app/(private)/(dashboard)/admin/signaux-faibles-beta/AdminProductClientPage.tsx
checksum: 9c740513497d70e871e4abcad3a9e509ef5b1a0da9db2d0d2d336c19854303b4
- filename: src/app/(private)/(dashboard)/incubators/[id]/info-form/page.tsx
checksum: 1ec9acf039a7d336e710ef7b47c385eb7080293ee2750c2cf99e9056cde7f129
- filename: src/components/IncubatorForm/IncubatorForm.tsx
checksum: 267f0f0e491b06862cd957ae86d22baf799a705370673cd24e588391a4613a5a
- filename: src/components/MemberPage/EmailUpgrade.tsx
Expand Down
61 changes: 61 additions & 0 deletions migrations/20241023153024_add_startups_aggregated_stats.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
exports.up = function (knex) {
return knex.schema.createTable(
"startup_aggregated_stats",
function (table) {
// Defining the uuid column for startup, which will be a foreign key
table.uuid("uuid").notNullable();
table.string("current_phase");
table.date("current_phase_start_date");
// Additional columns as per your requirements
table.boolean("has_coach");
table.boolean("has_intra");
table.boolean("had_coach");
table.boolean("had_intra");
table.decimal("turnover_rate_value"); // decimal with 2 decimal points
table.decimal("average_mission_duration_value");
table.decimal("renewal_rate_value");
table.decimal("average_replacement_frequency_value");

// devMissionsTrend columns
table.decimal("dev_current");
table.decimal("dev_one_month_ago");
table.decimal("dev_two_months_ago");
table.decimal("dev_three_months_ago");
table.decimal("dev_change_from_last_month");
table.decimal("dev_trend_over_three_months");
table.decimal("dev_trend_over_six_months");
table.decimal("dev_trend_over_twelve_months");

// bizdevMissionsTrend columns
table.decimal("bizdev_current");
table.decimal("bizdev_one_month_ago");
table.decimal("bizdev_two_months_ago");
table.decimal("bizdev_three_months_ago");
table.decimal("bizdev_change_from_last_month");
table.decimal("bizdev_trend_over_three_months");
table.decimal("bizdev_trend_over_six_months");
table.decimal("bizdev_trend_over_twelve_months");

// activeMember (missionsTrend) columns
table.decimal("active_member_current");
table.decimal("active_member_one_month_ago");
table.decimal("active_member_two_months_ago");
table.decimal("active_member_three_months_ago");
table.decimal("active_member_change_from_last_month");
table.decimal("active_member_trend_over_three_months");
table.decimal("active_member_trend_over_six_months");
table.decimal("active_member_trend_over_twelve_months");

// Setting foreign key constraint on the 'uuid' column referencing startups.uuid
table
.foreign("uuid")
.references("uuid")
.inTable("startups")
.onDelete("CASCADE");
}
);
};

exports.down = function (knex) {
return knex.schema.dropTable("startup_aggregated_stats");
};
Loading

0 comments on commit 77360d4

Please sign in to comment.