async fetchAllStatusDeltas() {
        const knex = this.db.knex;
        const rows = await knex('members_status_events')
            .select(knex.raw('DATE(created_at) as date'))
            .select(knex.raw(`SUM(
                CASE WHEN to_status='paid' THEN 1
                ELSE 0 END
            ) as paid_subscribed`))
            .select(knex.raw(`SUM(
                CASE WHEN from_status='paid' THEN 1
                ELSE 0 END
            ) as paid_canceled`))
            .select(knex.raw(`SUM(
                CASE WHEN to_status='comped' THEN 1
                WHEN from_status='comped' THEN -1
                ELSE 0 END
            ) as comped_delta`))
            .select(knex.raw(`SUM(
                CASE WHEN to_status='free' THEN 1
                WHEN from_status='free' THEN -1
                ELSE 0 END
            ) as free_delta`))
            .groupByRaw('DATE(created_at)')
            .orderByRaw('DATE(created_at) DESC');
        return rows;
    }
/**
     * Get the member deltas by status for all days (from new to old)
     * @returns {Promise<MemberStatusDelta[]>} The deltas of paid, free and comped users per day, sorted from new to old
     */
Get the member deltas by status for all days (from new to old)
@returns {Promise} The deltas of paid, free and comped users per day, sorted from new to old
Get the member deltas by status for all days ( from new to old ) @returns { Promise } The deltas of paid free and comped users per day sorted from new to old
async fetchAllStatusDeltas() {
        const knex = this.db.knex;
        const rows = await knex('members_status_events')
            .select(knex.raw('DATE(created_at) as date'))
            .select(knex.raw(`SUM(
                CASE WHEN to_status='paid' THEN 1
                ELSE 0 END
            ) as paid_subscribed`))
            .select(knex.raw(`SUM(
                CASE WHEN from_status='paid' THEN 1
                ELSE 0 END
            ) as paid_canceled`))
            .select(knex.raw(`SUM(
                CASE WHEN to_status='comped' THEN 1
                WHEN from_status='comped' THEN -1
                ELSE 0 END
            ) as comped_delta`))
            .select(knex.raw(`SUM(
                CASE WHEN to_status='free' THEN 1
                WHEN from_status='free' THEN -1
                ELSE 0 END
            ) as free_delta`))
            .groupByRaw('DATE(created_at)')
            .orderByRaw('DATE(created_at) DESC');
        return rows;
    }
async fetchAllStatusDeltas ( ) { const knex = this . db . knex ; const rows = await knex ( 'members_status_events' ) . select ( knex . raw ( 'DATE(created_at) as date' ) ) . select ( knex . raw ( ` ` ) ) . select ( knex . raw ( ` ` ) ) . select ( knex . raw ( ` ` ) ) . select ( knex . raw ( ` ` ) ) . groupByRaw ( 'DATE(created_at)' ) . orderByRaw ( 'DATE(created_at) DESC' ) ; return rows ; }
Get the member deltas by status for all days (from new to old)
 @returns {Promise<MemberStatusDelta[]>} The deltas of paid, free and comped users per day, sorted from new to old
Get the member deltas by status for all days ( from new to old ) @returns { Promise<MemberStatusDelta [] > } The deltas of paid free and comped users per day sorted from new to old