Add Reimbursement app #198
@ -1,4 +1,4 @@
|
|||||||
let schemas = require('@kosmos/schemas');
|
const schemas = require('@kosmos/schemas');
|
||||||
const validator = require('../utils/validator');
|
const validator = require('../utils/validator');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -7,7 +7,7 @@ const validator = require('../utils/validator');
|
|||||||
* @class
|
* @class
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
class Expense {
|
class ExpenseSerializer {
|
||||||
|
|
||||||
constructor (attrs) {
|
constructor (attrs) {
|
||||||
Object.keys(attrs).forEach(a => this[a] = attrs[a]);
|
Object.keys(attrs).forEach(a => this[a] = attrs[a]);
|
||||||
@ -24,7 +24,7 @@ class Expense {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get data () {
|
get data () {
|
||||||
let {
|
const {
|
||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
currency,
|
currency,
|
||||||
@ -35,7 +35,7 @@ class Expense {
|
|||||||
details,
|
details,
|
||||||
} = this;
|
} = this;
|
||||||
|
|
||||||
let data = {
|
const data = {
|
||||||
'@context': 'https://schema.kosmos.org',
|
'@context': 'https://schema.kosmos.org',
|
||||||
'@type': 'Expense',
|
'@type': 'Expense',
|
||||||
title,
|
title,
|
||||||
@ -71,7 +71,7 @@ class Expense {
|
|||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
static deserialize (serialized) {
|
static deserialize (serialized) {
|
||||||
let {
|
const {
|
||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
currency,
|
currency,
|
||||||
@ -97,4 +97,4 @@ class Expense {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Expense;
|
module.exports = ExpenseSerializer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user