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
class CookingOrder extends ValueObject { | |
// TODO: тут только те данные, которые нужны для работы в этом контексте | |
} | |
// Основная сущность, задача на готовку | |
class CookingRequest extends Aggregate { | |
id: Identifier; | |
orderId: Identifier; | |
positions: CookingRequestPosition[]; |
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
interface ILoyaltySystem { | |
/** | |
*/ | |
findMember(search: string): Promise<LoyaltyMember[]>; | |
registerMember(name: string, phone: string): Promise<id>; | |
} |
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
enum PrintableDocumentType { | |
SELL = 'sell', | |
PAYBACK = 'payback', | |
OPEN_SHIFT = 'open_shift', | |
CLOSE_SHIFT = 'close_shift', | |
CASH_INCOME = 'cash_income', | |
CASH_OUTCOME = 'cash_outcome', | |
PRECHECK = 'precheck', | |
PACKING_LIST = 'packing_list', |
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
export enum PaymentMethod { | |
CASH = 'cash', // hardware | |
CARD = 'card', // hardware, external | |
ONLINE = 'online', // shop, external | |
BONUS = 'bonus', // loyalty | |
SBP = 'sbp', // payment_service, external | |
} | |
export enum PaymentProvider { | |
HARDWARE = 'hardware', // Оплата производится с помощью втроенного оборудования |
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 interface define bank terminal device | |
* | |
* @method payByPaymentCard | |
* @method cancelPayByPaymentCard | |
* @method settlement | |
* @method report | |
*/ | |
export interface IBankTerminal extends IHardware { | |
/** |
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
export interface IUseCase<TRequest, TResponse> { | |
execute(request?: TRequest): Promise<TResponse> | |
} | |
class AddProductToOrderUseCase implements IUseCase<Identifier, Promise<void>> { | |
protected productRepository: IProductRepository; | |
protected orderRepository: IOrderRepository; | |
async execute(productId: Identifier) { | |
const order = await this.orderRepository.getCurrent(); |
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
2. Решаем проблему с крашем всего приложения в пользу краша конкретной БОЛЬШОЙ части интерефейса, с возможностью исправить проблему вручную | |
<div> | |
<ErrorBoundary> | |
<ProfileScreen /> | |
</ErrorBoundary> | |
<ErrorBoundary title="Ошибка!" description="Что-то случилось" action={(props) => <Button onPress={props.onRefresh}>Повторить</Button>}> | |
<OrderItems /> | |
</ErrorBoundary> | |
<ErrorBoundary> |
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
eslint --fix $(git diff --name-only HEAD | xargs) |
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
// Add deps in top | |
import groovy.json.JsonSlurper | |
// Add this function to your android/app/build.gradle | |
def getFromPackage(field) { | |
def inputFile = new File("$rootDir/../package.json") | |
def packageJson = new JsonSlurper().parseText(inputFile.text) |
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
# Функциональщина | |
## lambda исчисления | |
Аппликация - применение функции к определеннному значениию, обозначается ƒ a где ƒ - функция а - значение (ƒ - трактуется как алгоритм производящий работу с входным значением а) | |
В λ-исчислении любой программный код является термом | |
λ - определение функции |
NewerOlder