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
type Order = { | |
id: number; | |
value: number; | |
customer: string; | |
}; | |
class Payment { | |
private discount: number; | |
private fee: number; | |
private order: Order; |
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
type Order = { | |
id: number; | |
value: number; | |
customer: string; | |
}; | |
type Card = { | |
id: number; | |
ownerName: string; | |
cardNumber: number; |
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
type Order = { | |
id: number; | |
value: number; | |
customer: string; | |
}; | |
type Card = { | |
id: number; | |
ownerName: string; | |
cardNumber: number; |
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 ConventionalEmployee { | |
getName(): string; | |
getSalary(): number; | |
} | |
interface CommissionableEmployee extends ConventionalEmployee { | |
getCommission(): number; | |
} | |
class SecurityEmployee implements ConventionalEmployee { |
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
abstract class Employee { | |
private name: string; | |
constructor(name: string) { | |
this.name = name; | |
} | |
public getName(): string { | |
return this.name; | |
} |
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
type Order = { | |
id: number; | |
value: number; | |
customer: string; | |
}; | |
class Payment { | |
private order: Order; | |
constructor(order: Order) { |
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 StatusPlate = { | |
DELIVERED: "delivered", | |
PREPARATION: "preparation", | |
WAITING: "waiting" | |
} | |
interface Plate { | |
getStatusPlate(): StatusPlate; | |
preparatePlate(): void; | |
} |
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 PreparationModeType = { | |
COOKED: "cooked", | |
ROAST: "roast" | |
}; | |
enum StatusPlate = { | |
DELIVERED: "delivered", | |
PREPARATION: "preparation", | |
WAITING: "waiting" | |
} |
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 WaiterEmployee { | |
public function takePlate(): void { | |
// method implementation here | |
} | |
public function removePlate(): void { | |
// method implementation here | |
} | |
public function takeCheck(): void { | |
// method implementation here | |
} |
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 EmployeeRestaurant { | |
public function cook():void { | |
// method implementation here | |
} | |
public function takePlate(): void { | |
// method implementation here | |
} | |
public function removePlate(): void { | |
// method implementation here | |
} |
NewerOlder