-
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 CompanySettings - add Currency
- Loading branch information
Showing
6 changed files
with
72 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,17 @@ | ||
import type { Currency } from './Currency' | ||
import type { Entity } from './Entity' | ||
import type { PriceType } from './PriceType' | ||
|
||
export type CompanySettingsDiscountStrategy = 'bySum' | 'byPriority' | ||
|
||
export interface CompanySettings extends Entity<'companysettings'> { | ||
currency: Currency & { archived: false; default: true } | ||
priceTypes: PriceType[] | ||
discountStrategy: CompanySettingsDiscountStrategy | ||
globalOperationNumbering: boolean | ||
checkShippingStock: boolean | ||
checkMinPrice: boolean | ||
useRecycleBin: boolean | ||
useCompanyAddress: boolean | ||
companyAddress: string | ||
} |
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,44 @@ | ||
import type { OptionalNullablePartial } from '../tools' | ||
import type { Entity } from './Entity' | ||
|
||
export type CurrencyRateUpdateType = 'manual' | 'auto' | ||
|
||
export type CurrencyUnitGender = 'masculine' | 'feminine' | ||
|
||
export type CurrencyFields = { | ||
readonly system: boolean | ||
name: string | ||
fullName: string | ||
rate: number | ||
multiplicity: number | ||
indirect: boolean | ||
readonly rateUpdateType: CurrencyRateUpdateType | ||
code: string | ||
isoCode: string | ||
majorUnit: { | ||
gender: CurrencyUnitGender | ||
s1: string | ||
s2: string | ||
s5: string | ||
} | ||
minorUnit: { | ||
gender: CurrencyUnitGender | ||
s1: string | ||
s2: string | ||
s5: string | ||
} | ||
archived: boolean | ||
readonly default: boolean | ||
} | ||
|
||
export type Currency = Entity<'currency'> & CurrencyFields | ||
|
||
// https://dev.moysklad.ru/doc/api/remap/1.2/dictionaries/#suschnosti-valuta-izmenit-valutu | ||
|
||
/** | ||
* - Нельзя указать курс валюты `rate` равным нулю, а также пустые поля `name`, `code`, `isoCode`. | ||
* - Нельзя изменять значения полей `name`, `fullName`, `code`, `isoCode`, `majorUnit`, `minorUnit` для валют, основанных на системном справочнике валют. | ||
* - Нельзя изменять курс валюты учета. | ||
* - Нельзя изменить курс валюты с автоматическим обновлением. | ||
*/ | ||
export type CurrencyPatch = OptionalNullablePartial<CurrencyFields> |
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