-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Nedelcho Delchev edited this page May 13, 2024
·
20 revisions
Welcome to the codbex-rhea wiki!
Best Practices
- Subfolder in git repo to be the same name as the git repo
- EDM file to have the same name as the git repo(eg. codbex-orders)
- Table prefix when generating an application should be
CODBEX
- Entities should always be name with singular form(eg. account, journal entry, etc.)
- Always have an
Id
property as primary key - Always have a
Name
property, could be in some cases plays as a compound string calculated from other key properties - For
Document
types of entities e.g. Order, Invoice, etc. use UUID calculated property (e.g.require("sdk/utils/uuid").random()
) - For fields like
Net
,VAT
,Gross
, etc. use calculated field option e.g.entity["Quantity"] * entity["Price"]
- Wherever needed use weak dependency via property
Reference
which holds the UUID of the referenced document - Numbers generator used for e.g.
SO00000123
,SI00004567
- at Entity Properties in theImports
addthen in the calculated field e.g.import { NumberGeneratorService } from "/codbex-number-generator/service/generator";
Number
onCreate
putnew NumberGeneratorService().generate(1)
where the digit parameter comes from Numbers - Always prefer a
type-safe
approach in modelling, e.g. having separate Customer and Supplier entities instead of a single Partner entity - Use CamelUpperCase for perspective names (no spaces in the keys)
- Place Master-Details entities in a separate perspective
- Use
Dropdown
widget for hard dependencies withId
andName
forDropdown key
andDropdown value
respectively - Use
Item
suffix for the maindetail
entity of a givenmaster
e.g.SalesOrderItem
- Use suffix
Entry
for ledger type of entities where make sense e.g.JournalEntry
(alternative isRecord
e.g.StockRecord
) - For all the (
Company
dependent) documents use relation to aCompany
entity by default - Use
project.json
to maintain the dependencies - Format date with
new Date(entity["Date"]).toISOString().slice(0, 10)
to display eg 2024-01-01 - For money use DECMIAL with precision 16 and scale 2
- For all the Properties like Prices, Total, etc. set WidgetType
Number
- Core functionalities(e.g.
Print
in codbex-orders and codbex-invoices) should be integrated in the main projects. - Functionalities that might depend on multiple project(e.g
Generate
for SalesOrder -> GoodsIssue incodbex-orders-inventory-ext) should be in separate repository with
-ext` at the end of the name.