-
Notifications
You must be signed in to change notification settings - Fork 1
Add ApplicationSettings bounded context for issue #67 #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ba89b89
73d9662
52211f9
e76e82c
4cf3494
704c22d
ea01d31
4f25ed8
c656e51
4969132
02e878e
fc72254
93bf656
f855474
20cffda
6450f18
b85a052
92d8b1d
09ff03d
88ea683
9e6ae22
b858438
35e7f52
df4a879
c665594
2399fde
38bbbc3
8d3c5e6
4e7521f
a06a148
ce211c1
f187837
6346c29
50f36ab
1e7a1e1
218b3f8
8ba250e
aa39517
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
| xmlns:xs="https://www.w3.org/2001/XMLSchema" | ||
| xmlns:orm="https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> | ||
| <entity name="Bitrix24\Lib\ApplicationSettings\Entity\ApplicationSettingsItem" | ||
| table="application_settings"> | ||
| <id name="id" type="uuid" column="id"> | ||
|
|
||
| </id> | ||
|
|
||
| <field name="applicationInstallationId" type="uuid" column="application_installation_id" nullable="false"/> | ||
|
|
||
| <field name="key" type="string" column="key" length="255" nullable="false"/> | ||
|
|
||
| <field name="value" type="text" column="value" nullable="false"/> | ||
|
|
||
| <field name="b24UserId" type="integer" column="b24_user_id" nullable="true"/> | ||
|
|
||
| <field name="b24DepartmentId" type="integer" column="b24_department_id" nullable="true"/> | ||
|
|
||
| <field name="changedByBitrix24UserId" type="integer" column="changed_by_b24_user_id" nullable="true"/> | ||
|
|
||
| <field name="isRequired" type="boolean" column="is_required" nullable="false"/> | ||
|
|
||
| <field name="status" enum-type="string" column="status" nullable="false"/> | ||
|
|
||
| <field name="createdAt" type="carbon_immutable" column="created_at_utc" precision="3" nullable="false"/> | ||
|
|
||
| <field name="updatedAt" type="carbon_immutable" column="updated_at_utc" precision="3" nullable="false"/> | ||
|
|
||
| <unique-constraints> | ||
| <unique-constraint columns="application_installation_id,key,b24_user_id,b24_department_id" name="unique_app_setting_scope"/> | ||
| </unique-constraints> | ||
|
Comment on lines
+30
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The unique constraint on Useful? React with 👍 / 👎. |
||
|
|
||
| <indexes> | ||
| <index name="idx_application_installation_id" columns="application_installation_id"/> | ||
| <index name="idx_b24_user_id" columns="b24_user_id"/> | ||
| <index name="idx_b24_department_id" columns="b24_department_id"/> | ||
| <index name="idx_key" columns="key"/> | ||
| <index name="idx_status" columns="status"/> | ||
| </indexes> | ||
| </entity> | ||
| </doctrine-mapping> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The XML mapping declares
statuswithenum-type="string", butApplicationSettingsItem::$statusis a typedApplicationSettingStatusenum (see src/ApplicationSettings/Entity/ApplicationSettingsItem.php:30‑39). Doctrine expectsenum-typeto point at the enum FQCN; using the literalstringwill hydrate database values as plain strings and will either raise a mapping/type error or fail assigning to the enum-typed property whenever settings are loaded from the database. Any read of application settings will break until the mapping referencesApplicationSettingStatus(or a custom type) instead ofstring.Useful? React with 👍 / 👎.