# Framework Generator for Industries Consumer Goods Mobile application

This generator will be able to transpile the meta data files for the Consumer Goods Mobile Application into a runtime json which will be interpreded by the runtime Framework. This modules is mainly used for the modeler-sfdx-cli-plugin and in Consumer Goods Cloud app provided over public AppStores like Google PlayStore and Apple AppStore.

## `<PicklistSource>` on Toggle domains

A `Toggle` domain in `Domains.xml` may declare a `<PicklistSource>` block to bind the domain to a Salesforce object/field picklist and (optionally) enrich each picklist value with code, validation code, image id, or short text label id.

Source XML:

```xml
<Domain name="DomVisitStatus" baseType="Toggle" length="255">
  <Initializer>
    <Default value="' '"/>
    <Empty value=""/>
  </Initializer>
  <PicklistSource object="Visit__c" field="Status__c" hasEmptyItem="false">
    <Value picklist="Planned" code="P" shortTextLabelId="lbl.visit.planned"/>
    <Value picklist="Completed"/>
  </PicklistSource>
</Domain>
```

Emitted `rtas.json` entry:

```json
"DomVisitStatus": {
  "name": "DomVisitStatus",
  "baseType": "Toggle",
  "length": "255",
  "defaultValue": " ",
  "picklistSource": {
    "object": "Visit__c",
    "field": "Status__c",
    "hasEmptyItem": false,
    "values": [
      { "picklist": "Planned", "code": "P", "shortTextLabelId": "lbl.visit.planned" },
      { "picklist": "Completed" }
    ]
  }
}
```

Rules:

- `<PicklistSource>` is allowed only on `<Domain baseType="Toggle">`.
- `object` and `field` are required; `hasEmptyItem` defaults to `false` and is always emitted.
- `values` is always emitted (empty array when no `<Value>` children are declared); XML source order is preserved.
- Optional `<Value>` attributes (`code`, `validationCode`, `imageId`, `shortTextLabelId`) are absent from the JSON when missing in the source XML; empty strings are preserved.
- Toggle domains without `<PicklistSource>` produce no `picklistSource` key.

# License
BSD-3-Clause

