Skip to content

feat(demo): add crm-orders collection definition files with single-file order_details subcollection#30

Merged
trakhimenok merged 4 commits intomainfrom
copilot/create-demo-ingitdb-schema
Mar 4, 2026
Merged

feat(demo): add crm-orders collection definition files with single-file order_details subcollection#30
trakhimenok merged 4 commits intomainfrom
copilot/create-demo-ingitdb-schema

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

Bootstraps the demo-dbs/crm-orders database with machine-readable .collection/definition.yaml files for all 15 collections and the .ingitdb/ root config. The order_details subcollection stores all line items per order in a single details.json (no {key} placeholder) using []map[string]any.

Structure added

  • .ingitdb/root-collections.yaml — registers all 14 root collections
  • .ingitdb/settings.yaml — sets default_namespace: crm-orders
  • 14 root collection definitions — each uses {key}.yaml / map[string]any per-record files
  • orders/.collection/subcollections/order_details/definition.yamldetails.json / []map[string]any (single file per order)

order_details record_file

record_file:
  name: "details.json"
  type: "[]map[string]any"
  format: json

Path on disk: orders/$records/{order-id}/order_details/details.json

Unimplemented ColumnDef constraints

Constraints present in the README schema but not yet in ColumnDef are included as commented-out YAML with # TODO: needs implementation markers:

  • regex — pattern validation (e.g. ^[A-Z]{3}$ for currency codes, email patterns)
  • min / max — numeric value bounds (prices, quantities, percentages)
  • enum — allowed value sets (e.g. orders.status, shipping_options.service_level)
  • Conditional required (e.g. promotions.currency_id required only when discount_type=fixed)
Original prompt

Create a markdown specification document for a new demo ingitdb schema for a company CRM, ordering & shipping systems.

Should include (not limited to):

  • orders
  • details (subcollection of an order)
  • customers
  • products
  • suppliers
  • shippers
  • shipping options (standard, express, etc)
  • product images (can be shared by multiple products)
  • currencies
  • currency exchange rates

Feel free to add more collections that would make sense for such system and be easily understood by users that explore our app.

First have a list of tables with name and quick description.

Then detailed specification for each table with list of columns (name, type, constraints, foreign key, etc). Try to create a solid foundation but don't go too crazy - we probably shouldn't have more than 20 columns in a table. Use constraints like min/max length, regex pattern, etc.

For each collection provide a table example of 2-5 records to have sense how it will look. Use links for fk columns linking to referenced table definition.

List referring tables and what columns are referring. For example:

Referrers of Currency

  • orders: currency_id
  • customers: preferred_currency

The table names should be links to collection definition.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: trakhimenok <533159+trakhimenok@users.noreply.github.com>
Copilot AI changed the title [WIP] Add markdown specification for demo ingitdb schema docs: add CRM orders demo schema specification Mar 4, 2026
Co-authored-by: trakhimenok <533159+trakhimenok@users.noreply.github.com>
Copilot AI changed the title docs: add CRM orders demo schema specification docs(demo): add CRM/orders schema spec; change order_details to single-file storage Mar 4, 2026
Co-authored-by: trakhimenok <533159+trakhimenok@users.noreply.github.com>
Copilot AI changed the title docs(demo): add CRM/orders schema spec; change order_details to single-file storage feat(demo): add crm-orders collection definition files with single-file order_details subcollection Mar 4, 2026
@trakhimenok trakhimenok marked this pull request as ready for review March 4, 2026 12:07
@trakhimenok trakhimenok merged commit d0b59a6 into main Mar 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants