Skip to content
Nedelcho Delchev edited this page May 13, 2024 · 20 revisions

Welcome to the codbex-rhea wiki!

Best Practices

  1. Subfolder in git repo to be the same name as the git repo
  2. EDM file to have the same name as the git repo(eg. codbex-orders)
  3. Table prefix when generating an application should be CODBEX
  4. Entities should always be name with singular form(eg. account, journal entry, etc.)
  5. Always have an Id property as primary key
  6. Always have a Name property, could be in some cases plays as a compound string calculated from other key properties
  7. For Document types of entities e.g. Order, Invoice, etc. use UUID calculated property (e.g. require("sdk/utils/uuid").random())
  8. For fields like Net, VAT, Gross, etc. use calculated field option e.g. entity["Quantity"] * entity["Price"]
  9. Wherever needed use weak dependency via property Reference which holds the UUID of the referenced document
  10. Numbers generator used for e.g. SO00000123, SI00004567 - at Entity Properties in the Imports add
    import { NumberGeneratorService } from "/codbex-number-generator/service/generator";
    then in the calculated field e.g. Number on Create put new NumberGeneratorService().generate(1) where the digit parameter comes from Numbers
  11. Always prefer a type-safe approach in modelling, e.g. having separate Customer and Supplier entities instead of a single Partner entity
  12. Use CamelUpperCase for perspective names (no spaces in the keys)
  13. Place Master-Details entities in a separate perspective
  14. Use Dropdown widget for hard dependencies with Id and Name for Dropdown key and Dropdown value respectively
  15. Use Item suffix for the main detail entity of a given master e.g. SalesOrderItem
  16. Use suffix Entry for ledger type of entities where make sense e.g. JournalEntry (alternative is Record e.g. StockRecord)
  17. For all the (Company dependent) documents use relation to a Company entity by default
  18. Use project.json to maintain the dependencies
  19. Format date with new Date(entity["Date"]).toISOString().slice(0, 10) to display eg 2024-01-01
  20. For money use DECMIAL with precision 16 and scale 2
  21. For all the Properties like Prices, Total, etc. set WidgetType Number
  22. Core functionalities(e.g. Print in codbex-orders and codbex-invoices) should be integrated in the main projects.
  23. Functionalities that might depend on multiple project(e.g Generate for SalesOrder -> GoodsIssue in codbex-orders-inventory-ext) should be in separate repository with -ext` at the end of the name.
Clone this wiki locally