Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // api/year-end-reporting/ales
- interface Ale {
- aleId: string,
- aleName: string,
- clientType: string,
- totals: [{
- formType: string,
- approvedCount: number,
- notApprovedWithoutErrorCount: number,
- notApprovedAttentionCount: number,
- extensionDate: string
- }],
- associatedMembers?: Array<Ale>
- }
- // Transformer
- var request = {
- endpoint: 'api/year-end-report/ales',
- descriptor: {
- type: 'products',
- id: {$alias: 'clientType'},
- attributes: {
- name: {$alias: 'clientType'}
- },
- relationships: {
- companies: [{
- data: {
- type: 'companies',
- id: {$alias: 'aleId'},
- attributes: {
- name: {$alias: 'aleName'},
- totals: __
- },
- relationships: {
- ales: {
- data: [{
- $each: 'associatedMembers',
- type: 'ales',
- id: {$alias: 'aleId'},
- attributes: {
- name: {$alias: 'aleName'},
- totals: __
- }
- }]
- }
- }
- }
- }]
- }
- }
- }
- // Usage
- store.findWhere({name, taxYear}).related('companies')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement