-
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
Idproperty as primary key - Always have a
Nameproperty, could be in some cases plays as a compound string calculated from other key properties - For
Documenttypes 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
Referencewhich holds the UUID of the referenced document - Numbers generator used for e.g.
SO00000123,SI00004567- at Entity Properties in theImportsaddthen in the calculated field e.g.import { NumberGeneratorService } from "/codbex-number-generator/service/generator";
NumberonCreateputnew NumberGeneratorService().generate(1)where the digit parameter comes from Numbers - Always prefer a
type-safeapproach 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
Dropdownwidget for hard dependencies withIdandNameforDropdown keyandDropdown valuerespectively - Use
Itemsuffix for the maindetailentity of a givenmastere.g.SalesOrderItem - Use suffix
Entryfor ledger type of entities where make sense e.g.JournalEntry(alternative isRecorde.g.StockRecord) - For all the (
Companydependent) documents use relation to aCompanyentity by default - Use
project.jsonto 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.
Printin codbex-orders and codbex-invoices) should be integrated in the main projects. - Functionalities that might depend on multiple project(e.g
Generatefor SalesOrder -> GoodsIssue incodbex-orders-inventory-ext) should be in separate repository with-ext` at the end of the name.