Latest Updates

Documenting code, one commit at a time.

Implementing a Unified Credit Conversion System for AI Services

Introduction

Managing costs associated with AI-powered features, such as text, image, and video generation, can be complex. Our platform needed a unified system to convert these costs into credits, manage profit margins, and track consumption effectively.

The Challenge

Previously, our credit system lacked a standardized approach. Calculating costs for various AI services (text, image,

Read more

Database Compatibility: Adapting Queries for PostgreSQL

When developing applications across different database systems, ensuring compatibility in your queries is crucial. Minor differences in SQL syntax can lead to unexpected errors and application downtime. Let's explore a practical example of adapting queries for PostgreSQL.

The Challenge: Date Extraction

MySQL provides functions like YEAR() and MONTH() to extract year and month values from

Read more

Refactoring Primary Keys with Foreign Key Constraints in Reimpact Platform

When refactoring database schemas, developers often encounter challenges with primary and foreign key relationships. In the Reimpact platform, a recent update focused on modifying a primary key (priority_product ID) while ensuring existing foreign key references remained valid. This process highlights the importance of managing dependencies during schema alterations.

The Problem

Read more
PHP Laravel

Handling Database Seed Conflicts in Laravel

Introduction

When working on the Reimpact platform, a common issue arises during database seeding: conflicting UUIDs, especially when dealing with priority products. This post details how to resolve such conflicts, ensuring smooth database setup and consistent application behavior.

The Problem: Duplicate Entries

During the database seeding process, the system attempts to insert a new

Read more
PHP Laravel

Seeding Sanity: Ensuring Data Integrity in Laravel Migrations

When working on the Reimpact/platform, we encountered an issue where seeding migrations were failing due to missing prerequisite data. This post outlines the problem and the solution implemented to ensure data integrity during migrations.

The Problem

Our Laravel application relies on a seeding process to populate the database with initial data. One particular migration was attempting to

Read more

Ensuring Data Integrity: A Migration Story

Imagine deploying a new feature only to find that a critical piece of data is missing, causing unexpected errors. This is the story of how a small, seemingly insignificant migration change prevented a larger issue in a Laravel project called platform.

The Problem

During a recent update, it was discovered that a database row, specifically the priority_product entry, was not consistently

Read more

Tenant Isolation Strategy: Global Rates in a Multi-Tenant Laravel Application

Introduction

In multi-tenant applications, data isolation is key. One common challenge is determining which data should be tenant-specific and which should be global. In our Laravel platform project, we faced this question with application rates. Initially, we considered rates to be tenant-scoped, but we discovered that, due to regulatory requirements, these rates are actually global and

Read more
PHP Laravel

Tackling QueryExceptions: Ensuring Data Integrity in Laravel Applications

When developing applications with Laravel, maintaining database schema consistency across different environments is crucial. In the Reimpact/platform project, a recent issue highlighted the importance of this practice. The project involves managing various data points, and a discrepancy arose when a column present in one database schema was missing in another.

The Problem: Missing Column

Read more

Enhancements to Rate Management in the Platform

Streamlining Rate Management in the Platform

We've been working on the Reimpact platform to improve how rates are managed, focusing on global applicability and enhanced security. Here's a breakdown of the changes.

Global Rate Application

Previously, rates were tied to specific companies. We've transitioned to a model where rates are global, scoped by a priority_product_id.

Read more