Skip to content

Instantly share code, notes, and snippets.

@lomeat
Created December 17, 2021 00:55
Show Gist options
  • Save lomeat/2b163f4a97a0325d96d4c11595ae9d84 to your computer and use it in GitHub Desktop.
Save lomeat/2b163f4a97a0325d96d4c11595ae9d84 to your computer and use it in GitHub Desktop.
model_flat_passport
export type Passport = {
title: string;
children: PassportCategory[];
};
export type PassportCategory = {
id: number | null;
base_title: string;
base_unit?: string;
children: PassportCategory[] | PassportNomenclature[] | null;
};
export type PassportNomenclature = {
id: number;
base_title: string;
base_unit?: string;
budget_amount?: number;
// Must be formatted price in rubles
budget_pricePerUnit?: number;
budget_priceFull?: number;
// Must be Date or formatted date
contract_date?: string | Date;
// User name
contract_user?: string;
contract_contractor?: string;
contract_amount?: number;
// Must be formatted price in rubles
contract_pricePerUnit?: number;
contract_priceFull?: number;
// Object with presenter's name of amount of accounts
account_number?: number;
// Must be Date or formatted date
account_date?: string;
payment_amountShould?: number;
payment_amountAlready?: number;
payment_pricePerUnit?: number;
payment_priceFullShould?: number;
payment_priceFullAlready?: number;
// Must be boolean to switch strings
payment_percentStatus?: string;
payment_percentShould?: number;
paymnet_percentAlready?: number;
workdone_amount?: number;
workdone_date?: string;
workdone_document?: number;
workdone_percent?: number;
invoice_amount?: number;
invoice_pricePerUnit?: number;
invoice_priceFull?: number;
};
type Agents = {
id: number;
type: 'ts' | 'account' | 'internal';
title: string;
amount: number;
price_unit: number;
price_sum: number;
contracts?: Contract[];
payments?: Payment[];
};
type Contract = {
uuid: string;
title: string;
amount: number;
price_unit: number;
price_sum: number;
payments?: Payment[];
ttns?: TTN[];
invoices?: Invoice[];
};
type Payment = {
uuid: string;
date: 'YYYY-MM-DD';
amount_to: number;
amount_now: number;
price_unit: number;
price_sum_to: number;
price_sum_now: number;
status: 'at_work' | 'agreed' | 'for_payment' | 'is_paid';
file_uuid: string;
file_name: string;
percent_to: number;
percent_now: number;
ttns?: TTN[];
invoices?: Invoice[];
};
type TTN = {
uuid: string;
amount: number;
date: 'YYYY-MM-DD';
file_uuid: string;
file_name: string;
percent: number;
};
type Invoice = {
uuid: string;
amount: number;
price_unit: number;
price_sum: number;
ttns: TTN[];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment