Skip to content

Instantly share code, notes, and snippets.

View olivier5741's full-sized avatar

Olivier Wouters olivier5741

View GitHub Profile
@olivier5741
olivier5741 / order.ts
Created December 7, 2023 12:20
Order typescript overview
class Order {
_id!: ObjectId;
ids?: string[]; // legacy -> use references instead
key?: string;
number?: string;
references?: Reference[]; // references (id) the transaction has on other platforms
name?: string;
// roles
customer?: Party; // can be an enterprise (organisation), one of its activities, a person, a partnership
This file has been truncated, but you can view the full file.
{
"N32-005151": {
"id": "N32-005151",
"nutrientBasisQuantity": {
"s:value": "100",
"s:unitCode": "GRM",
"@type": [
"gs1:QuantitativeValue",
"s:QuantitativeValue"
@olivier5741
olivier5741 / clean-up-nulls-in-mongo.js
Last active April 29, 2024 15:09
Clean up null values in mongo
const collectionNames = db.getCollectionNames();
for (const name of collectionNames) {
var coll = db.getCollection(name);
var cursor = coll.find();
while (cursor.hasNext()) {
var doc = cursor.next();
var keys = {};
var hasNull = false;
for (var x in doc) {
@olivier5741
olivier5741 / diagram.d2
Last active August 23, 2023 09:34
logcica 2.0 activity hierarchy diagram
classes: {
embedded: {
shape: package
}
party: {
shape: image
icon: https://icons.terrastruct.com/essentials%2F365-user.svg
}
subject: {
shape: image
@olivier5741
olivier5741 / schema.d2
Last active July 19, 2023 15:05
logCiCa 2.0 schema
# Logistics Management System LMS
#
# use classes, the same as interface ... ?
# contact, a party could reference multilple contacts (or one ?)
classes: {
transactionnal: {
style: {
stroke-width: 0
@olivier5741
olivier5741 / off-product-context-before-consolidation.json
Last active November 8, 2022 15:01
Open food facts - context before consolidation in logCiCa
{
"allergens": [
{
"ids": ["off/allergens/en:milk"],
"translations": {
"en": {
"name": "Milk"
},
"fr": {
"name": "Lait"
@olivier5741
olivier5741 / consolidation-context.json
Created September 12, 2022 17:15
Consolidation logCiCa
{
"codes": [
{
"ids": ["ofn_be/country/29"],
"name": "Belgium",
"list": {
"ids": ["iso/country"]
}
}
],
@olivier5741
olivier5741 / ofn_hook_v0_24_0_beta (2).json
Last active September 15, 2022 11:01
OFN hook v0.18.0 beta
{
"name": "ofn hook v0.24.0 beta",
"nodes": [
{
"parameters": {},
"id": "a9f63be4-fd47-4585-a180-9e8c8047b58d",
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
@olivier5741
olivier5741 / readme.md
Created January 13, 2022 08:36
Short distribution channel product schema through graphQL.

Short distribution channel product schema through graphQL

How to query a product based on its

  • contributors (or main contributors based on their role: Producer, Transformer)
  • categories (a category is part of a classification : GPC, OFN instance classification)
  • ingredients

The proposed graphQL solution :

@olivier5741
olivier5741 / product.json
Last active October 25, 2021 06:14
GS1 product new schema
{
"_id": {
"$oid": "6172b6be68707a71104595f4"
},
"isTradeItemAnOrderableUnit": true,
"allergenInformation": {"isAllergenRelevantDataProvided": true},
"isTradeItemABaseUnit": true,
"unitDescriptorCode": "BASE_UNIT_OR_EACH",
"dutyFeeTaxInformation": {"targetMarketTaxInformations": [{
"taxInformations":[