Skip to content

Михайловский Евгений#12

Open
EvgenyMikhailovsky wants to merge 2 commits intoRTF-Angular-2021:masterfrom
EvgenyMikhailovsky:Михайловский-Евгений

Hidden character warning

The head ref may contain hidden characters: "\u041c\u0438\u0445\u0430\u0439\u043b\u043e\u0432\u0441\u043a\u0438\u0439-\u0415\u0432\u0433\u0435\u043d\u0438\u0439"
Open

Михайловский Евгений#12
EvgenyMikhailovsky wants to merge 2 commits intoRTF-Angular-2021:masterfrom
EvgenyMikhailovsky:Михайловский-Евгений

Conversation

@EvgenyMikhailovsky
Copy link
Copy Markdown

No description provided.

cards?: Array<ICard>;
}

export class BankOffice {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Файл не валидный.

public authorize(userId: any, cardId: any, cardPin: any): any {

public authorize(userId: string, cardId: string, cardPin: string): boolean {
for (let users of this._users) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this_users - должен быть коллекций, а он одиночный объект, по этому ошибка.


private changeUserName(newName: any): any {

private changeUserName(newName: String): boolean {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем тип с большой буквы?

moneyUnits.forEach(x => amount += x.count * Number(x.moneyInfo.denomination));
let fromRub = fromCurrency === Currency.RUB;
let money = fromRub ? (amount - amount % 70) / 70 : Math.floor(amount) * 70;
return this._moneyRepository.convertMoney(money, fromRub ? Currency.USD : Currency.RUB, moneyUnits);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этого метода нет в репозитории.

if(!this._bankOffice.authorize(user.id, card.id, cardPin)) return false;
{
this._authorizedUser = user;
this._usersCard = card;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Такого поля нет в классе

let fromRub = fromCurrency === Currency.RUB;
let money = fromRub ? (amount - amount % 70) / 70 : Math.floor(amount) * 70;
return this._moneyRepository.convertMoney(money, fromRub ? Currency.USD : Currency.RUB, moneyUnits);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 балов

} else {
return this.registerForUserNewCard(argsForChangeFunction);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 бала

}
}
return false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 балов

this._repository.forEach(point =>{
for (let pin in point) {

if (point[currency] === currency && counter >= point[count]) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У объекта point Нет поля currency - это не будет работать.
К тому же тут нужно было сделать жадный алгоритм


public takeMoney(moneyUnits: IMoneyUnit): void {
this._repository.push(moneyUnits);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 балов

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Посмотрите, я исправил решение

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Метод теперь работает верно 2 бала

@m-abrosimov
Copy link
Copy Markdown

Теперь за всё задание 7 балов у тебя


public convertMoneyUnits(fromCurrency: Currency, toCurrency: Currency, moneyUnits: any): any {

public convertMoneyUnits(fromCurrency: Currency, toCurrency: Currency, moneyUnits: IMoneyUnit[]): IMoneyUnit[] {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот метод не может возвращать массив купюр к выдаче. Потому что купюра не может быть дробной. Этот метод должен возвращать сумму, которая передаётся в _moneyRepository

public giveOutUsersMoney(count: number) {
if (this._authorizedUser)
{
this._moneyRepository.giveOutMoney(count, this._card.currency);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Добавь уменьшение денег на авторизованной карте. Изменение баланса карты

else if (option === UserSettingOptions.newCard)
return this.registerForUserNewCard(argsForChangeFunction);
}
} No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 бала


public isCardTiedToUser(cardId: string): boolean {
return this._users.filter(x=> x.cards.find(y=> y.id === cardId)).length > 0;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 бала


public takeMoney(moneyUnits: IMoneyUnit): void {
this._repository.push(moneyUnits);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Метод теперь работает верно 2 бала

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants