Skip to content

Commit

Permalink
chore: Create entity testdata for the consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
kellnerd committed Jul 22, 2024
1 parent 44f73bc commit be7218d
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 0 deletions.
32 changes: 32 additions & 0 deletions importer/testdata/author.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"data": {
"alias": [{
"name": "Test Author",
"sortName": "Author, Test",
"languageId": 120,
"default": true,
"primary": true
}],
"disambiguation": "import test",
"type": "Person",
"typeId": 1,
"genderId": 3,
"beginDate": "1701-04-23",
"endDate": "1742-12-31",
"ended": true,
"identifiers": [],
"annotation": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto enim reprehenderit dolorum iure eaque accusamus, soluta pariatur aliquam commodi repellat cumque quaerat possimus nesciunt molestiae. Sunt deserunt magnam sint repellendus.",
"metadata": {
"links": [{
"title": "Example link",
"url": "https://example.com/author"
}],
"relationships": []
},
"source": "Testdata"
},
"entityType": "Author",
"lastEdited": "2024-07-17",
"originId": "A123",
"source": "Testdata"
}
34 changes: 34 additions & 0 deletions importer/testdata/author.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import type {ParsedAuthor, QueuedEntity} from 'bookbrainz-data/lib/types/parser.d.ts';

export const entity: QueuedEntity<ParsedAuthor> = {
"data": {
"alias": [{
"name": "Test Author",
"sortName": "Author, Test",
"languageId": 120, // English, TODO: use language codes
"default": true,
"primary": true
}],
"disambiguation": "import test",
"type": "Person", // unused, TODO: map to ID
"typeId": 1, // Person
"genderId": 3, // Other
"beginDate": "1701-04-23",
"endDate": "1742-12-31",
"ended": true,
"identifiers": [],
"annotation": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto enim reprehenderit dolorum iure eaque accusamus, soluta pariatur aliquam commodi repellat cumque quaerat possimus nesciunt molestiae. Sunt deserunt magnam sint repellendus.",
"metadata": { // currently unused
"links": [{
"title": "Example link",
"url": "https://example.com/author"
}],
"relationships": []
},
"source": "Testdata"
},
"entityType": "Author",
"lastEdited": "2024-07-17",
"originId": "A123", // change this to import another dummy entity
"source": "Testdata"
};
27 changes: 27 additions & 0 deletions importer/testdata/edition_group.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"data": {
"alias": [{
"name": "The Complete Test Collection",
"sortName": "Complete Test Collection, The",
"languageId": 120,
"default": true,
"primary": true
}],
"disambiguation": "import test",
"typeId": 1,
"identifiers": [],
"annotation": "Empty edition group",
"metadata": {
"links": [{
"title": "Example link",
"url": "https://example.com/edition-group"
}],
"relationships": []
},
"source": "Testdata"
},
"entityType": "EditionGroup",
"lastEdited": "2024-07-22",
"originId": "G123",
"source": "Testdata"
}
30 changes: 30 additions & 0 deletions importer/testdata/edition_group.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

import type {ParsedEditionGroup, QueuedEntity} from 'bookbrainz-data/lib/types/parser.d.ts';

export const entity: QueuedEntity<ParsedEditionGroup> = {
"data": {
"alias": [{
"name": "The Complete Test Collection",
"sortName": "Complete Test Collection, The",
"languageId": 120, // English, TODO: use language codes
"default": true,
"primary": true
}],
"disambiguation": "import test",
"typeId": 1, // Book
"identifiers": [],
"annotation": "Empty edition group",
"metadata": { // currently unused
"links": [{
"title": "Example link",
"url": "https://example.com/edition-group"
}],
"relationships": []
},
"source": "Testdata"
},
"entityType": "EditionGroup",
"lastEdited": "2024-07-22",
"originId": "G123", // change this to import another dummy entity
"source": "Testdata"
};
27 changes: 27 additions & 0 deletions importer/testdata/work.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"data": {
"alias": [{
"name": "The Fairytale Test",
"sortName": "Fairytale Test, The",
"languageId": 120,
"default": true,
"primary": true
}],
"disambiguation": "import test",
"typeId": 2,
"identifiers": [],
"annotation": "Once upon a time...",
"metadata": {
"links": [{
"title": "Example link",
"url": "https://example.com/work"
}],
"relationships": []
},
"source": "Testdata"
},
"entityType": "Work",
"lastEdited": "2024-07-17",
"originId": "W123",
"source": "Testdata"
}
30 changes: 30 additions & 0 deletions importer/testdata/work.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

import type {ParsedWork, QueuedEntity} from 'bookbrainz-data/lib/types/parser.d.ts';

export const entity: QueuedEntity<ParsedWork> = {
"data": {
"alias": [{
"name": "The Fairytale Test",
"sortName": "Fairytale Test, The",
"languageId": 120, // English, TODO: use language codes
"default": true,
"primary": true
}],
"disambiguation": "import test",
"typeId": 2, // Short Story
"identifiers": [],
"annotation": "Once upon a time...",
"metadata": { // currently unused
"links": [{
"title": "Example link",
"url": "https://example.com/work"
}],
"relationships": []
},
"source": "Testdata"
},
"entityType": "Work",
"lastEdited": "2024-07-17",
"originId": "W123", // change this to import another dummy entity
"source": "Testdata"
};

0 comments on commit be7218d

Please sign in to comment.