-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add CollectionPageInfo - add CounterpartyReport
- Loading branch information
Showing
6 changed files
with
54 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#TODO | ||
|
||
- [ ] Расширить Expand для записи полей через запятую | ||
|
||
```ts | ||
Expand<CustomerOrder, 'agent.group,state'> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
import type { EntityRef } from './EntityRef' | ||
import type { MetaType } from './MetaType' | ||
|
||
export type CollectionPageInfo = { | ||
size: number | ||
limit: number | ||
offset: number | ||
hextHref?: string | ||
} | ||
|
||
export interface CollectionRef<T extends MetaType = MetaType> | ||
extends EntityRef<T> { | ||
meta: EntityRef<T>['meta'] & { | ||
size: number | ||
limit: number | ||
offset: number | ||
} | ||
meta: EntityRef<T>['meta'] & CollectionPageInfo | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { MetaType } from '..' | ||
import type { CollectionRef } from '../CollectionRef' | ||
import type { EntityRef } from '../EntityRef' | ||
|
||
export interface CounterpartyReportItem | ||
extends EntityRef<MetaType.Counterparty> { | ||
counterparty: EntityRef<MetaType.Counterparty> | ||
firstDemandDate: string | null | ||
lastDemandDate: string | null | ||
demandsCount: number | ||
demandsSum: number | ||
averageReceipt: number | ||
returnsCount: number | ||
returnsSum: number | ||
discountsSum: number | ||
balance: number | ||
profit: number | ||
lastEventDate: string | null | ||
lastEventText: string | null | ||
updated: string | ||
} | ||
|
||
/** | ||
* `/report/counterparty` | ||
*/ | ||
export interface CounterpartyReport | ||
extends CollectionRef<MetaType.Counterparty> { | ||
context: { | ||
employee: EntityRef<MetaType.Employee> | ||
} | ||
|
||
rows: CounterpartyReportItem[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './counterparty' |