From 2edd592ef937cdcbf39327f99c2cbb564603e999 Mon Sep 17 00:00:00 2001 From: philc Date: Thu, 29 Jun 2023 10:57:44 +0200 Subject: [PATCH] update schema --- adminapi/schema/educations.json | 17 ++++ adminapi/schema/experiences.json | 20 +++++ adminapi/schema/lg/enumcontract_fr.json | 4 + adminapi/schema/lg/enumdiploma_fr.json | 3 + adminapi/schema/lg/enumjobsector_fr.json | 3 + adminapi/schema/lg/enumofferrecruiter_fr.json | 30 +++++++ adminapi/schema/lg/enumofferseeker_fr.json | 30 +++++++ adminapi/schema/lg/enumpronom_fr.json | 5 ++ adminapi/schema/lg/enumseekcriterias_fr.json | 3 + adminapi/schema/person.json | 86 ++++++++++++++----- adminapi/schema/recoveryauth.json | 11 --- adminapi/schema/seeker.json | 70 +++++++++++---- adminapi/www/adminapx/static/js/apxtowns.js | 2 +- 13 files changed, 234 insertions(+), 50 deletions(-) create mode 100644 adminapi/schema/educations.json create mode 100644 adminapi/schema/experiences.json create mode 100644 adminapi/schema/lg/enumcontract_fr.json create mode 100644 adminapi/schema/lg/enumdiploma_fr.json create mode 100644 adminapi/schema/lg/enumjobsector_fr.json create mode 100644 adminapi/schema/lg/enumofferrecruiter_fr.json create mode 100644 adminapi/schema/lg/enumofferseeker_fr.json create mode 100644 adminapi/schema/lg/enumpronom_fr.json create mode 100644 adminapi/schema/lg/enumseekcriterias_fr.json delete mode 100644 adminapi/schema/recoveryauth.json diff --git a/adminapi/schema/educations.json b/adminapi/schema/educations.json new file mode 100644 index 0000000..e6ef2cc --- /dev/null +++ b/adminapi/schema/educations.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "/schema/educations", + "title": "Education diplomat", + "description": "Training follow ", + "type": "object", + "properties":{ + "schoolname":{"type":"string"}, + "diploma":{"type":"string","enum":["BEPx","CAPy"]}, + "jobsector":{"type":"string","enum":["serveur"]}, + "dt_start":{"type":"string","format":"date"}, + "dt_end":{"type":"string","format":"date"}, + "description":{"type":"string"}, + "skills":{"type":"array","$ref":"schema/skills.json"} + }, + "required":["jobsector","schoolname","diploma","dt_start","dt_end"] +} \ No newline at end of file diff --git a/adminapi/schema/experiences.json b/adminapi/schema/experiences.json new file mode 100644 index 0000000..f1f6d25 --- /dev/null +++ b/adminapi/schema/experiences.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "/schema/experiences", + "title": "Describe a professionnal experience", + "description": "List of information to describe professional experiences", + "type": "object", + "properties":{ + "jobtitle":{"type":"string"}, + "contract":{"type":"string","enum":["CDI","CDD","FREE","STAGE","ALTERNANCE"]}, + "companyname":{"type":"string"}, + "location":{"type":"object","$ref":"https://schema.org/PostalAddress"}, + "remotexp":{"type":"string","enum":["onsite","remote","hybrid"]}, + "dt_start":{"type":"string","format":"date"}, + "dt_end":{"type":"string","format":"date"}, + "jobsector":{"type":"string","enum":[]}, + "description":{"type":"string"}, + "skills":{"type":"array","$ref":"schema/skills.json"} + }, + "required":["jobtitle","companyname","contract"] +} \ No newline at end of file diff --git a/adminapi/schema/lg/enumcontract_fr.json b/adminapi/schema/lg/enumcontract_fr.json new file mode 100644 index 0000000..5e46e66 --- /dev/null +++ b/adminapi/schema/lg/enumcontract_fr.json @@ -0,0 +1,4 @@ +{ + "CDI":{"title":"Contrat à durée indeterninée","autreinfoutile":""}, + "CDD":{} +} \ No newline at end of file diff --git a/adminapi/schema/lg/enumdiploma_fr.json b/adminapi/schema/lg/enumdiploma_fr.json new file mode 100644 index 0000000..8caccd1 --- /dev/null +++ b/adminapi/schema/lg/enumdiploma_fr.json @@ -0,0 +1,3 @@ +{ + "BEPx":{"title":"blabla","description":"blabla"} +} \ No newline at end of file diff --git a/adminapi/schema/lg/enumjobsector_fr.json b/adminapi/schema/lg/enumjobsector_fr.json new file mode 100644 index 0000000..82bba15 --- /dev/null +++ b/adminapi/schema/lg/enumjobsector_fr.json @@ -0,0 +1,3 @@ +{ + "serveur":{"title":"Serveur en salle"} +} \ No newline at end of file diff --git a/adminapi/schema/lg/enumofferrecruiter_fr.json b/adminapi/schema/lg/enumofferrecruiter_fr.json new file mode 100644 index 0000000..414b75c --- /dev/null +++ b/adminapi/schema/lg/enumofferrecruiter_fr.json @@ -0,0 +1,30 @@ +{ + "offerA": { + "accessright": { + "person": "O", + "person.alias": "", + "person.owner": "", + "person.accessright": "" + }, + "title":"Offre de lancement", + "description":"txt blabla", + "html":"

Offre de lancement

blabla

", + "priceHT":"19", + "currency":"euro", + "monthbillfrequency":"1" + }, + "offerB": { + "accessright": { + "person": "O", + "person.alias": "", + "person.owner": "", + "person.accessright": "" + }, + "title":"Offre de lancement", + "description":"txt blabla", + "html":"

Offre de lancement

blabla

", + "priceHT":"49", + "currency":"euro", + "monthbillfrequency":"3" + } +} diff --git a/adminapi/schema/lg/enumofferseeker_fr.json b/adminapi/schema/lg/enumofferseeker_fr.json new file mode 100644 index 0000000..414b75c --- /dev/null +++ b/adminapi/schema/lg/enumofferseeker_fr.json @@ -0,0 +1,30 @@ +{ + "offerA": { + "accessright": { + "person": "O", + "person.alias": "", + "person.owner": "", + "person.accessright": "" + }, + "title":"Offre de lancement", + "description":"txt blabla", + "html":"

Offre de lancement

blabla

", + "priceHT":"19", + "currency":"euro", + "monthbillfrequency":"1" + }, + "offerB": { + "accessright": { + "person": "O", + "person.alias": "", + "person.owner": "", + "person.accessright": "" + }, + "title":"Offre de lancement", + "description":"txt blabla", + "html":"

Offre de lancement

blabla

", + "priceHT":"49", + "currency":"euro", + "monthbillfrequency":"3" + } +} diff --git a/adminapi/schema/lg/enumpronom_fr.json b/adminapi/schema/lg/enumpronom_fr.json new file mode 100644 index 0000000..9d45b1b --- /dev/null +++ b/adminapi/schema/lg/enumpronom_fr.json @@ -0,0 +1,5 @@ +{ + "M": { "title": "Monsieur", "description": "" }, + "MME": { "title": "Madame", "description": "" }, + "OTHER": { "title": "Autre", "edescription": "" } +} diff --git a/adminapi/schema/lg/enumseekcriterias_fr.json b/adminapi/schema/lg/enumseekcriterias_fr.json new file mode 100644 index 0000000..7e74626 --- /dev/null +++ b/adminapi/schema/lg/enumseekcriterias_fr.json @@ -0,0 +1,3 @@ +{ + "crit1":{"title":"critere1"} +} \ No newline at end of file diff --git a/adminapi/schema/person.json b/adminapi/schema/person.json index 323fca7..5b39e9b 100755 --- a/adminapi/schema/person.json +++ b/adminapi/schema/person.json @@ -2,16 +2,19 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "/schema/person", "title": "Person minimum definition to link a person to a pagan identity", - "description": "A person is a human with a apxtrib identity (Public Private Key. Information stored (not cipher) for a person are only visible from the town's Mayor and the tribe's Druid. You need at least trus the druid that trust the mayor (for sensitive data Mayor and Druid can be the same apx Identity.) Only a pagan that have the privateKey can read cipher data. The purpose of this sschema is to link a person to a tribe and manage basic activities, profil will be a tribe object if need more personnal information", + "description": "A person is a human with a apxtrib identity (alias = Public Private Key) that accept to be part of a tribe (a person is store inside a tribe). Information stored for a person are only visible from the town's Mayor and the tribe's Druid. You need at least trust the druid that trust the mayor (for sensitive data Mayor and Druid can be the same apx Identity.) Only a pagan that have the privateKey can read cipher data. The purpose of this schema is to link a person to a tribe and manage basic activities, profil for specific purpose will be a tribe object that can be add additionalProperties of this is set at true.", "type": "object", "properties": { "alias": { + "title": "alias", + "description": "A unique string identifying a unique public key", "type": "string", "minLength": 5, "pattern": "^[a-z0-9]*$" }, "owner": { - "title": "Alias that own this object", + "title": "Owner of this person", + "description": "For accessright purpose this is always equal as alias", "type": "string", "format": "Alias" }, @@ -25,53 +28,92 @@ "format": "date-time" }, "dt_lastlogin": { + "title": "Last time login", + "description": "Last time this person authentify as alias access to this tribe", "type": "string", "format": "date-time" }, "dt_close": { + "title": "Date of leaving tribe", + "description": "Date from when this alias is ban of tribe by druid or want to leave. A pocess of data cleaning has to be run depending of Tribe's rules.", "type": "string", "format": "date-time" }, "recoveryauth": { + "title": "Store numeric identity to recover it by email", + "description": "This object store numeric identity alias with an email mainly used at Person level to recover by email a private and passphrase key associate to alias", "type": "object", - "$ref": "schema/recoveryauth.json" + "$ref": "#/definitions/recoveryauth" }, "firstname": { + "title": "A firstname", + "description": "This will be use to present yourself", "type": "string" }, "lastname": { + "title": "A lastname", + "description": "This will be use to present yourself", "type": "string" }, - "dt_birth":{ - "type":"string", - "format":"date" + "dt_birth": { + "title": "Your birthdate", + "description": "Date of birth you want to communicate", + "type": "string", + "format": "date" }, - "gender":{ - "type":"string", - "enum":[ "M","MME","OTHER"] + "pronom": { + "title": "Your pronom", + "description": "The way you want people communicate with you", + "type": "string", + "enum": ["M", "MME", "OTHER"] + }, + "emailcom": { + "title": "email use to communicate with you", + "description": "email used by tribe to communicate with you, depending of your profil you can also define other mail to interact with other person", + "type": "string", + "format": "email" }, - "emailcom":{"type":"string","format":"email"}, "biography": { + "title":"Your bio or few words to define yoursel", + "description":"Use this to share your values, this will be public to all of tribe's members and link to your person", "type": "string", "pattern": "^.{O,150}$" }, "imgavatar": { - "type": "string" + "title":"A picture of your person or personnality", + "description":"This picture will be public to all tribe's member", + "type": "url" }, "accessrights": { - "title": "Accessright per Object or per Object.key belonging to tribe", - "description": "A Person has to exist and want to create read update delete, if Own means if owner = alias of user requested some CRUD action to owner then he can act on this object or object.key List of Object with CRUDO value like {Person:'RUDO',"Person.recoveryauth":'O',...}", - "type": "object" + "title": "Accessright per Object or per Object.key belonging to a tribe", + "description": "A Person can create read update delete an object (CRUD), if Own means if owner = alias of user requested some CRUD action to owner then he can act on this object or object.key List of Object with CRUDO value like {Person:'RUDO','Person.recoveryauth':'O',...}. To simplify some profil can be define admin, user, recruiter, seeker, and get a standard accessright object", + "type": "object", + "$ref": "#/definitions/accessright" } }, - "required": [ - "alias", - "accessright" - ], + "definitions": { + "recoveryauth": { + "type": "object", + "properties": { + "email": { "type": "string", "format": "email" }, + "alias": { "type": "string", "format": "Pagan" }, + "privatekey": { "type": "string", "format": "eccCorve25519armored" } + } + }, + "accessright":{ + "type":"object", + "properties":{ + "type":"object", + "properties":{ + "objkey": {"type":"sring","format":"CRUDO"} + } + } + } + }, + "required": ["alias", "accessright"], + "additionalProperties": true, "apxprimarykey": "alias", - "apxunique": [ - "" - ], + "apxunique": [""], "apxsearchindex": [ { "key": "alias", @@ -82,4 +124,4 @@ "value": "alias" } ] -} \ No newline at end of file +} diff --git a/adminapi/schema/recoveryauth.json b/adminapi/schema/recoveryauth.json deleted file mode 100644 index aa49d47..0000000 --- a/adminapi/schema/recoveryauth.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "/schema/recoveryauth", - "title": "Store numeric identity to recover it by email", - "description": "This object store numeric identity alias with an email mainly used at Person level to recover by email a private and passphrase key associate to alias", - "properties":{ - "email": { "type": "string", "format": "email" }, - "alias": {"type": "string", "format":"Pagan"}, - "privatekey": { "type": "string", "format": "eccCorve25519armored" } - } -} \ No newline at end of file diff --git a/adminapi/schema/seeker.json b/adminapi/schema/seeker.json index 7bf0909..e2f89cd 100644 --- a/adminapi/schema/seeker.json +++ b/adminapi/schema/seeker.json @@ -1,18 +1,56 @@ { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "/schema/seeker", - "title": "Data Profil of a person that is in a seek process", - "description": "All those data have to store any useffull logistical data and profil about a seeker (skill, ...) ", - "type": "object", - "properties": { - "emailseek":{"type":"string","format":"email"}, - "mainlivinglocation":{"type":"object","$ref":"https://schema.org/PostalAddress"}, - "secondlivinglocation":{"type":"object","$ref":"https://schema.org/PostalAddress"}, - "thirdlivinglocation":{"type":"object","$ref":"https://schema.org/PostalAddress"}, - "fourthlivinglocation":{"type":"object","$ref":"https://schema.org/PostalAddress"}, - "seekcriterias":{"type":"array","$ref":"schema/seekcriteria.json"}, - "skills":{"type":"array","$ref":"schema/skills.json"}, - "educations":{"type":"array","$ref":"schema/educations.json"}, - "experiences":{"type":"array","$ref":"schema/experiences.json"} + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "/schema/seeker", + "title": "Data Profil of a person that is in a seek process", + "description": "All those data have to store any useffull logistical data and profil about a seeker (skill, ...) ", + "type": "object", + "properties": { + "offerseeker": { "type": "string", "emum": ["offerA", "offerB"] }, + "emailseek": { "type": "string", "format": "email" }, + "seeklocation": { + "type": "array", + "items": { + "type": "object", + "$ref": "https://schema.org/PostalAddress" + } + }, + "seekcriterias": { + "type": "array", + "items": { "type": "string", "enum": [] } + }, + "skills": { + "type": "array", + "items": { "type": "object", "$ref": "schema/skills.json" } + }, + "educations": { + "type": "array", + "items": { "type": "object", "$ref": "schema/educations.json" } + }, + "experiences": { + "type": "array", + "items": { "type": "object", "$ref": "schema/experiences.json" } + }, + "recommandation": { + "type": "array", + "items": { "type": "object", "$ref": "#/definitions/recommandation"} } -} \ No newline at end of file + }, + "definitions": { + "recommandation": { + "type": "object", + "properties": { + "email": { "type": "string", "format": "email" }, + "phone": { "type": "string", "format": "telephone" }, + "fisrtname": { "type": "string" }, + "lastname": { "type": "string" }, + "jobtitle": { "type": "string" }, + "description": { + "title": "Area of recomandation", + "description": "Describe why this recommandation is relevant to confirm your skills", + "type": "string" + } + } + } + }, + "required": ["offerseeker", "emailseek", "mainlivinglocation", ""] +} diff --git a/adminapi/www/adminapx/static/js/apxtowns.js b/adminapi/www/adminapx/static/js/apxtowns.js index 411d059..771bc48 100644 --- a/adminapi/www/adminapx/static/js/apxtowns.js +++ b/adminapi/www/adminapx/static/js/apxtowns.js @@ -51,7 +51,7 @@ towns.owntown = (newowner) => { console.log(rep); apx.data.tpldata.setup.mayorId = newowner; apx.save(); - app.load("apxmain", "townowner", towns.loadtpldata()); + app.load("apxmain", "townowner", towns.loadtpldata("owner")); }) .catch((err) => { console.log(err);