feat: Generate account model in api addon

This commit is contained in:
Susmitha Girumala committed 2020-09-14 10:45:56 -04:00
1 parent b8da8b2ec0
commit cf5a625740
4 files changed
+63

No files matched your search

@@ -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;
}
+3
View File
@@ -0,0 +1,3 @@
import GeneratedAccountModel from '../generated/models/account';
export default class AccountModel extends GeneratedAccountModel {}
+1
View File
@@ -0,0 +1 @@
export { default } from 'api/models/account';
@@ -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);
});
});