From cf5a6257402b664fc056f90eb0217262c22493be Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Mon, 14 Sep 2020 10:45:56 -0400 Subject: [PATCH] feat: Generate account model in api addon --- addons/api/addon/generated/models/account.js | 46 ++++++++++++++++++++ addons/api/addon/models/account.js | 3 ++ addons/api/app/models/account.js | 1 + addons/api/tests/unit/models/account-test.js | 13 ++++++ 4 files changed, 63 insertions(+) create mode 100644 addons/api/addon/generated/models/account.js create mode 100644 addons/api/addon/models/account.js create mode 100644 addons/api/app/models/account.js create mode 100644 addons/api/tests/unit/models/account-test.js diff --git a/addons/api/addon/generated/models/account.js b/addons/api/addon/generated/models/account.js new file mode 100644 index 000000000..1abfe3e3f --- /dev/null +++ b/addons/api/addon/generated/models/account.js @@ -0,0 +1,46 @@ +import BaseModel from '../../models/base'; +import { attr } from '@ember-data/model'; + +/** + * Account contains all fields related to an account resource + */ +export default class GeneratedAccountModel extends BaseModel { + + // =attributes + + @attr('string', { + description: 'The type of the resource, to help differentiate schemas' + }) type; + + @attr('string', { + description: 'The owning auth method ID.', + }) auth_method_id; + + @attr('string', { + description: 'Optional name for identification purposes', + }) + name; + + @attr('string', { + description: 'Optional user-set description for identification purposes', + }) + description; + + @attr('date', { + description: 'The time this resource was created\nOutput only.', + readOnly: true, + }) + created_time; + + @attr('date', { + description: 'The time this resource was last updated\nOutput only.', + readOnly: true, + }) + updated_time; + + @attr('number', { + description: 'Current version number of this resource.', + }) + version; + +} diff --git a/addons/api/addon/models/account.js b/addons/api/addon/models/account.js new file mode 100644 index 000000000..0e61e3aa5 --- /dev/null +++ b/addons/api/addon/models/account.js @@ -0,0 +1,3 @@ +import GeneratedAccountModel from '../generated/models/account'; + +export default class AccountModel extends GeneratedAccountModel {} diff --git a/addons/api/app/models/account.js b/addons/api/app/models/account.js new file mode 100644 index 000000000..83b737fe4 --- /dev/null +++ b/addons/api/app/models/account.js @@ -0,0 +1 @@ +export { default } from 'api/models/account'; diff --git a/addons/api/tests/unit/models/account-test.js b/addons/api/tests/unit/models/account-test.js new file mode 100644 index 000000000..8dcfecdde --- /dev/null +++ b/addons/api/tests/unit/models/account-test.js @@ -0,0 +1,13 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module('Unit | Model | account', function(hooks) { + setupTest(hooks); + + // Replace this with your real tests. + test('it exists', function(assert) { + let store = this.owner.lookup('service:store'); + let model = store.createRecord('account', {}); + assert.ok(model); + }); +});