diff --git a/countries/countries.intent b/countries/countries.intent index b0397a5..0bb9e9e 100644 --- a/countries/countries.intent +++ b/countries/countries.intent @@ -3,7 +3,7 @@ description: Country nomenclature (ISO 3166) icon: globe entities: - name: Country - kind: setting + function: Setting icon: globe fields: # Matches codbex-countries.model. Intent has no fixed-width CHAR type, so CHAR(n) is @@ -16,7 +16,7 @@ entities: # Cities per country - the Depends-On cascade target: a consumer's City dropdown is narrowed to # the chosen Country (City.Country == Country.id). Seeded with a few well-known cities. - name: City - kind: setting + function: Setting icon: building fields: - { name: id, type: integer, primaryKey: true, generated: true } diff --git a/currencies/currencies.intent b/currencies/currencies.intent index 98f723c..a33f5d9 100644 --- a/currencies/currencies.intent +++ b/currencies/currencies.intent @@ -3,7 +3,7 @@ description: Currency nomenclature and exchange rates icon: money-bill entities: - name: Currency - kind: setting + function: Setting icon: money-bill audit: true fields: @@ -17,7 +17,7 @@ entities: - { name: base, type: boolean } - { name: rate, type: decimal, precision: 18, scale: 6 } - name: CurrencyRate - kind: setting + function: Setting fields: - { name: id, type: integer, primaryKey: true, generated: true } - { name: name, type: string, length: 100 } diff --git a/numbers/numbers.intent b/numbers/numbers.intent index e70d078..feb7c95 100644 --- a/numbers/numbers.intent +++ b/numbers/numbers.intent @@ -8,7 +8,7 @@ entities: # e.g. type "Sales Invoice" (prefix SI, length 10) -> "SI00000001". Other projects (sales-invoices, # orders, ...) call that generator from their own document delegates - see the sales-invoices process. - name: Number - kind: setting + function: Setting group: settings icon: hash fields: diff --git a/sales-invoices/sales-invoices.intent b/sales-invoices/sales-invoices.intent index c6cb56d..70c2fcf 100644 --- a/sales-invoices/sales-invoices.intent +++ b/sales-invoices/sales-invoices.intent @@ -13,24 +13,25 @@ entities: # (SalesInvoiceNumberAction) and the real sequential SI-number just after Issue (the generateNumber # serviceTask -> DocumentNumberGeneratorDelegate). See SalesInvoice.imports + number below. - name: SalesInvoiceStatus - kind: setting + function: Setting group: settings fields: - { name: id, type: integer, primaryKey: true, generated: true } - { name: name, type: string, required: true, length: 100 } - name: PaymentMethod - kind: setting + function: Setting group: settings fields: - { name: id, type: integer, primaryKey: true, generated: true } - { name: name, type: string, required: true, length: 100 } - name: SentMethod - kind: setting + function: Setting group: settings fields: - { name: id, type: integer, primaryKey: true, generated: true } - { name: name, type: string, required: true, length: 100 } - name: SalesInvoice + function: Document # header + line items + status pill + totals footer icon: receipt audit: true group: sales @@ -42,7 +43,7 @@ entities: - { name: id, type: integer, primaryKey: true, generated: true } # number is computed server-side by the SalesInvoiceNumberAction CalculatedField (imported above), # invoked as Beans.get(SalesInvoiceNumberAction.class).calculate(entity) on create. - - { name: number, type: string, length: 100, calculatedActionOnCreate: SalesInvoiceNumberAction, documentTitle: true } + - { name: number, type: string, length: 100, calculatedActionOnCreate: SalesInvoiceNumberAction, function: DocumentTitle } - { name: date, type: date, required: true } - { name: due, type: date } # Document totals: aggregate fields shown read-only in the footer. Net/Vat/Discount/Total are kept @@ -63,10 +64,11 @@ entities: # target seed id), applied on insert when left unset - so a new invoice starts as DRAFT, Bank # transfer, E-mail without a process step (race-free vs the trigger). - { name: Currency, kind: manyToOne, to: Currency, model: currencies, size: 4 } - - { name: Status, kind: manyToOne, to: SalesInvoiceStatus, documentStatus: true, init: 1 } # 1 = DRAFT + - { name: Status, kind: manyToOne, to: SalesInvoiceStatus, function: DocumentStatus, init: 1 } # 1 = DRAFT - { name: PaymentMethod, kind: manyToOne, to: PaymentMethod, init: 2, size: 4 } # 2 = Bank transfer - { name: SentMethod, kind: manyToOne, to: SentMethod, init: 1, size: 4 } # 1 = E-mail - name: SalesInvoiceItem + function: DocumentItem # the document's line items (rendered inline under SalesInvoice) fields: - { name: id, type: integer, primaryKey: true, generated: true } - { name: name, type: string, length: 200 } diff --git a/uoms/uoms.intent b/uoms/uoms.intent index e5fe770..f4ac59b 100644 --- a/uoms/uoms.intent +++ b/uoms/uoms.intent @@ -6,7 +6,7 @@ icon: ruler languages: [en, bg] entities: - name: UoM - kind: setting + function: Setting icon: ruler # UoM names carry per-language values in UOMS_UOM_LANG (generated by the schema layer); every # read overlays the caller's language. Translations are the uoms-bg seed below.