namespace services.concept
{
/**
*/
export function get
(
concept_id : int
) : Promise<entities.concept>
{
return repositories.concept.read(concept_id);
}
/**
*/
export async function suck
(
concept_thing : any
) : Promise<int>
{
const type_id : int = await services.type.give(concept_thing["type"]);
const concept_id : int = await repositories.concept_core.create
(
{
"type_id": type_id,
"description": concept_thing["description"],
}
);
await concept_thing["tags"].map
(
async (tag_value) =>
{
const tag_id : int = await services.tag.give(tag_value);
const concept_tag_id : int = await repositories.concept_tags.create
(
{
"concept_id": concept_id,
"tag_id": tag_id,
}
);
return concept_tag_id;
}
);
await Object.keys(concept_thing["translations"]).map
(
async (language_value) =>
{
const language_id : int = await services.language.give(language_value);
const concept_translation_ids = await concept_thing["translations"][language_value].map
(