|
| 1 | +# Orbyss.Components.Json.Models |
| 2 | + |
| 3 | +Shared models used by the Orbyss ecosystem for schema-driven UI rendering, such as JSON-based forms and data grids. |
| 4 | +This package is part of the [Orbyss.io](https://orbyss.io) open-source initiative to simplify UI generation for .NET applications. |
| 5 | +These shared models are used for translations and for handling dates and times using ticks rather than text. |
| 6 | + |
| 7 | +💡 These models are consumed by other Orbyss components: |
| 8 | + - [Orbyss.Components.JsonForms](https://github.com/orbyss-io/Orbyss.Components.JsonForms) |
| 9 | + - [Orbyss.Components.Syncfusion.JsonDataGrid](https://github.com/orbyss-io/Orbyss.Components.Syncfusion.JsonDataGrid) |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## 🧩 Models Included |
| 14 | + |
| 15 | +### `DateTimeUtcTicks` |
| 16 | + |
| 17 | +A readonly struct for UTC-based date-time representations. |
| 18 | + |
| 19 | +```csharp |
| 20 | +public readonly struct DateTimeUtcTicks |
| 21 | +{ |
| 22 | + public DateTimeOffset DateTime { get; } |
| 23 | + public long UtcTicks { get; } |
| 24 | +} |
| 25 | +``` |
| 26 | + |
| 27 | +### `DateUtcTicks` |
| 28 | + |
| 29 | +A readonly struct for UTC-based date representations, including way to get the day range (00:00 - 23.59). |
| 30 | + |
| 31 | +```csharp |
| 32 | +public readonly struct DateUtcTicks |
| 33 | +{ |
| 34 | + public long UtcTicks { get; } |
| 35 | + public DateOnly DateOnly { get; } |
| 36 | + |
| 37 | + public (DateTime start, DateTime end) GetDayRange(); |
| 38 | +} |
| 39 | +``` |
| 40 | + |
| 41 | + |
| 42 | +### `TranslationSchema` |
| 43 | + |
| 44 | +This package also defines the shape of our i18n translation schema, compatible with tools like i18next or your own .NET localization pipeline. |
| 45 | +This structure allows you to localize field labels, enums, tooltips, and validation messages in dynamic forms or tables. |
| 46 | + |
| 47 | +```json |
| 48 | +{ |
| 49 | + "resources": { |
| 50 | + "en": { |
| 51 | + "translation": { |
| 52 | + "firstName": { |
| 53 | + "label": "First name", |
| 54 | + "error":{ |
| 55 | + "minLength": "Must have more than ...", |
| 56 | + "maxLength": "Too many characters..." |
| 57 | + } |
| 58 | + }, |
| 59 | + "personTypeEnum":{ |
| 60 | + "label": "Person type", |
| 61 | + "FamilyType": "Family", |
| 62 | + "PartnerType": "Partner", |
| 63 | + "BusinessType": "Business" |
| 64 | + } |
| 65 | + } |
| 66 | + } |
| 67 | + } |
| 68 | +} |
| 69 | +``` |
| 70 | + |
| 71 | +--- |
| 72 | + |
| 73 | +## 🤝 Contributing |
| 74 | + |
| 75 | +This project is open source and contributions are welcome! |
| 76 | + |
| 77 | +Whether it's bug fixes, improvements, documentation, or ideas — we encourage developers to get involved. |
| 78 | +Just fork the repo, create a branch, and open a pull request. |
| 79 | + |
| 80 | +We follow standard .NET open-source conventions: |
| 81 | +- Write clean, readable code |
| 82 | +- Keep PRs focused and descriptive |
| 83 | +- Open issues for larger features or discussions |
| 84 | + |
| 85 | +No formal contribution guidelines — just be constructive and respectful. |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +## 🔗 Links |
| 90 | + |
| 91 | +- 🌍 **Website**: [https://orbyss.io](https://orbyss.io) |
| 92 | +- 📦 **NuGet**: *Coming soon* |
| 93 | +- 🧑💻 **GitHub**: [https://github.com/Orbyss-io](https://github.com/orbyss-io) |
| 94 | +- 📝 **License**: [MIT](./LICENSE) |
| 95 | + |
| 96 | + |
| 97 | +--- |
| 98 | + |
| 99 | +⭐️ If you find this useful, [give us a star](https://github.com/orbyss-io/Orbyss.Components.Json.Models/stargazers) and help spread the word! |
0 commit comments