-
Notifications
You must be signed in to change notification settings - Fork 0
Behavioral Traits
lpachecob edited this page Mar 22, 2026
·
6 revisions
In BOUNDLY, you add enterprise features with a single class attribute. These traits automate horizontal concerns like auditing, deletion, and segmentation.
Automates traceability for your creation and modification.
| Property | Default | Description |
|---|---|---|
createdBy |
'created_by' |
The column name for the creator. |
updatedBy |
'updated_by' |
The column name for the last updater. |
-
The DB:
core:migratewill addcreated_byandupdated_byasBIGINTcolumns. -
The Logic: On every
create()orupdate(), BOUNDLY will auto-populate these with theauth()->user()->id.
#[Entity(...)]
#[Auditable]
class Product extends AggregateRoot { ... }Enables logical deletion (doesn't destroy the row).
| Property | Default | Description |
|---|---|---|
deletedAt |
'deleted_at' |
The column name for the deletion timestamp. |
-
The DB:
core:migratewill adddeleted_atas aTIMESTAMP. -
The Logic: All
GETrequests in BOUNDLY's repository will automatically filter wheredeleted_at IS NULL. -
The Action:
DELETErequests will set the timestamp instead of executing aDELETESQL command.
#[Entity(...)]
#[SoftDelete]
class Order extends AggregateRoot { ... }Isolates data by "Tenant" code. Essential for SAAS.
| Property | Default | Description |
|---|---|---|
tenantKey |
'tenant_id' |
The column name for the tenant. |
-
The DB:
core:migrateadds atenant_idcolumn. -
The Logic: BOUNDLY will automatically add a
WHERE tenant_id = current_tenant_id()on EVERY select, update, and delete. -
The Auth: The common
tenant_idis extracted from the authenticated user or the request context.
#[Entity(...)]
#[TenantAware]
class Inventory extends AggregateRoot { ... }You can combine all of them for a truly enterprise-level entity:
#[Entity(...)]
#[Auditable]
#[SoftDelete]
#[TenantAware]
class Client extends AggregateRoot { ... }Next Step: Query-Engine 🔎