-
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.
- AbstractDemand - DemandPosition
- Loading branch information
Showing
10 changed files
with
87 additions
and
10 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,29 @@ | ||
import type { | ||
DocumentWithPositions, | ||
DocumentWithPositionsPatch, | ||
EntityRef, | ||
HasVat, | ||
HasVatPatch | ||
} from '.' | ||
|
||
export type DemandMetaType = 'demand' | 'retaildemand' | ||
|
||
export type AbstractDemandFields = { | ||
customerOrder: EntityRef<'customerorder'> | ||
|
||
// TODO facture: IDREF | ||
// TODO invoicesOutUuid: IDREF | ||
// TODO paymentsUuid: IDREF | ||
// TODO salesReturnsUuid: IDREF | ||
// TODO shipmentOut: ShipmentOut | ||
} | ||
|
||
export type AbstractDemand< | ||
T extends DemandMetaType | ||
> = DocumentWithPositions<T> & HasVat | ||
|
||
export type AbstractDemandPatch< | ||
T extends DemandMetaType | ||
> = DocumentWithPositionsPatch<T> & | ||
HasVatPatch & | ||
Partial<Pick<AbstractDemandFields, 'customerOrder'>> |
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,3 +1,12 @@ | ||
import type { DocumentWithPositions, HasVat, MetaType } from '.' | ||
import type { AbstractDemand, AbstractDemandPatch } from './AbstractDemand' | ||
|
||
export type Demand = DocumentWithPositions<'demand'> & HasVat | ||
export type DemandFields = { | ||
// TODO extension: DemandExtension | ||
// TODO overhead: MoneyAmount | ||
// TODO overheadDistribution: OverheadDistribution | ||
} | ||
|
||
export type Demand = AbstractDemand<'demand'> | ||
|
||
export type DemandPatch = AbstractDemandPatch<'demand'> | ||
// & Partial<Pick<DemandFields, ''>> |
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,15 @@ | ||
import type { Position, PositionPatch } from './Position' | ||
|
||
export type DemandPositionFields = { | ||
/** | ||
* НДС | ||
*/ | ||
vat: number | ||
|
||
overhead: number | ||
} | ||
|
||
export type DemandPosition = Position<'demandposition'> & DemandPositionFields | ||
|
||
export type DemandPositionPatch = PositionPatch<'demandposition'> & | ||
Partial<Pick<DemandPositionFields, 'vat' | 'overhead'>> |
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,7 +1,12 @@ | ||
import type { DocumentWithPositions, MetaType } from '.' | ||
import type { AbstractDemand, DocumentWithPositions, MetaType } from '.' | ||
import type { AbstractDemandPatch } from './AbstractDemand' | ||
|
||
export interface RetailDemand extends DocumentWithPositions<'retaildemand'> { | ||
export type RetailDemandFields = { | ||
readonly cashSum: number | ||
|
||
readonly noCashSum: number | ||
} | ||
|
||
export type RetailDemand = AbstractDemand<'retaildemand'> & RetailDemandFields | ||
|
||
export type RetailDemandPatch = AbstractDemandPatch<'retaildemand'> |
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
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
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,10 +1,21 @@ | ||
import type { | ||
Collection, | ||
CustomerOrder, | ||
Document, | ||
DocumentMetaType, | ||
DocumentWithPositionsMetaType, | ||
Expand, | ||
IsExtends | ||
} from '../../src' | ||
|
||
const t1: IsExtends<DocumentWithPositionsMetaType, DocumentMetaType> = true | ||
|
||
const t2 = {} as Document<DocumentWithPositionsMetaType> | ||
|
||
let t3_1 = {} as Expand<Collection<'customerorder'>, 'state'> | ||
const t3_2 = {} as Expand<Collection<'customerorder'>, 'state'> | ||
|
||
// FIXME Судя по всему, коллекцию нужно переделывать на Expand<Collection<CustomerOrder>, 'state'> | ||
|
||
// @ts-expect-error | ||
t3_1 = [...t3_1.rows, ...t3_2.rows] |